From d608b504052c3581cb9b30cb75898963c9bd6fe4 Mon Sep 17 00:00:00 2001 From: Tom Haggie Date: Wed, 28 Sep 2016 11:32:31 -0700 Subject: [PATCH 01/78] Fix for issue#186 removed usage of refs, switched to using functions to assign refs. --- dist/react-infinite.js | 8 ++++---- dist/react-infinite.min.js | 2 +- src/react-infinite.jsx | 33 ++++++++++++--------------------- 3 files changed, 17 insertions(+), 26 deletions(-) diff --git a/dist/react-infinite.js b/dist/react-infinite.js index 61efee5..2e8ca73 100644 --- a/dist/react-infinite.js +++ b/dist/react-infinite.js @@ -1,6 +1,6 @@ (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Infinite = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o=0||Object.prototype.hasOwnProperty.call(e,o)&&(i[o]=e[o]);return i}var React=global.React||require("react"),ReactDOM=global.ReactDOM||require("react-dom");require("./utils/establish-polyfills");var scaleEnum=require("./utils/scaleEnum"),infiniteHelpers=require("./utils/infiniteHelpers"),_isFinite=require("lodash.isfinite"),preloadType=require("./utils/types").preloadType,checkProps=checkProps=require("./utils/checkProps"),Infinite=React.createClass({displayName:"Infinite",propTypes:{children:React.PropTypes.any,handleScroll:React.PropTypes.func,preloadBatchSize:preloadType,preloadAdditionalHeight:preloadType,elementHeight:React.PropTypes.oneOfType([React.PropTypes.number,React.PropTypes.arrayOf(React.PropTypes.number)]).isRequired,containerHeight:React.PropTypes.number,useWindowAsScrollContainer:React.PropTypes.bool,displayBottomUpwards:React.PropTypes.bool.isRequired,infiniteLoadBeginEdgeOffset:React.PropTypes.number,onInfiniteLoad:React.PropTypes.func,loadingSpinnerDelegate:React.PropTypes.node,isInfiniteLoading:React.PropTypes.bool,timeScrollStateLastsForAfterUserScrolls:React.PropTypes.number,className:React.PropTypes.string,styles:React.PropTypes.shape({scrollableStyle:React.PropTypes.object}).isRequired},statics:{containerHeightScaleFactor:function(e){if(!_isFinite(e))throw new Error("The scale factor must be a number.");return{type:scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR,amount:e}}},computedProps:{},utils:{},shouldAttachToBottom:!1,preservedScrollState:0,loadingSpinnerHeight:0,deprecationWarned:!1,getDefaultProps:function(){return{handleScroll:function(){},useWindowAsScrollContainer:!1,onInfiniteLoad:function(){},loadingSpinnerDelegate:React.createElement("div",null),displayBottomUpwards:!1,isInfiniteLoading:!1,timeScrollStateLastsForAfterUserScrolls:150,className:"",styles:{}}},getInitialState:function(){var e=this.recomputeInternalStateFromProps(this.props);this.computedProps=e.computedProps,this.utils=e.utils,this.shouldAttachToBottom=this.props.displayBottomUpwards;var t=e.newState;return t.scrollTimeout=void 0,t.isScrolling=!1,t},generateComputedProps:function(e){var t=e.containerHeight,i=e.preloadBatchSize,o=e.preloadAdditionalHeight,n=_objectWithoutProperties(e,["containerHeight","preloadBatchSize","preloadAdditionalHeight"]),r={};t="number"==typeof t?t:0,r.containerHeight=e.useWindowAsScrollContainer?window.innerHeight:t,void 0!==n.infiniteLoadBeginBottomOffset&&(r.infiniteLoadBeginEdgeOffset=n.infiniteLoadBeginBottomOffset,this.deprecationWarned||(console.error("Warning: React Infinite's infiniteLoadBeginBottomOffset prop\n has been deprecated as of 0.6.0. Please use infiniteLoadBeginEdgeOffset.\n Because this is a rather descriptive name, a simple find and replace\n should suffice."),this.deprecationWarned=!0));var s={type:scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR,amount:.5},l=i&&i.type?i:s;"number"==typeof i?r.preloadBatchSize=i:"object"==typeof l&&l.type===scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR?r.preloadBatchSize=r.containerHeight*l.amount:r.preloadBatchSize=0;var a={type:scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR,amount:1},c=o&&o.type?o:a;return"number"==typeof o?r.preloadAdditionalHeight=o:"object"==typeof c&&c.type===scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR?r.preloadAdditionalHeight=r.containerHeight*c.amount:r.preloadAdditionalHeight=0,Object.assign(n,r)},generateComputedUtilityFunctions:function(e){var t=this,i={};return i.getLoadingSpinnerHeight=function(){var e=0;if(t.refs&&t.refs.loadingSpinner){var i=ReactDOM.findDOMNode(t.refs.loadingSpinner);e=i.offsetHeight||0}return e},e.useWindowAsScrollContainer?(i.subscribeToScrollListener=function(){window.addEventListener("scroll",t.infiniteHandleScroll)},i.unsubscribeFromScrollListener=function(){window.removeEventListener("scroll",t.infiniteHandleScroll)},i.nodeScrollListener=function(){},i.getScrollTop=function(){return window.pageYOffset},i.setScrollTop=function(e){window.scroll(window.pageXOffset,e)},i.scrollShouldBeIgnored=function(){return!1},i.buildScrollableStyle=function(){return{}}):(i.subscribeToScrollListener=function(){},i.unsubscribeFromScrollListener=function(){},i.nodeScrollListener=this.infiniteHandleScroll,i.getScrollTop=function(){var e;return t.refs&&t.refs.scrollable&&(e=ReactDOM.findDOMNode(t.refs.scrollable)),e?e.scrollTop:0},i.setScrollTop=function(e){var i;t.refs&&t.refs.scrollable&&(i=ReactDOM.findDOMNode(t.refs.scrollable)),i&&(i.scrollTop=e)},i.scrollShouldBeIgnored=function(e){return e.target!==ReactDOM.findDOMNode(t.refs.scrollable)},i.buildScrollableStyle=function(){return Object.assign({},{height:t.computedProps.containerHeight,overflowX:"hidden",overflowY:"scroll",WebkitOverflowScrolling:"touch"},t.computedProps.styles.scrollableStyle||{})}),i},recomputeInternalStateFromProps:function(e){checkProps(e);var t=this.generateComputedProps(e),i=this.generateComputedUtilityFunctions(e),o={};return o.numberOfChildren=React.Children.count(t.children),o.infiniteComputer=infiniteHelpers.createInfiniteComputer(t.elementHeight,t.children,t.displayBottomUpwards),void 0!==t.isInfiniteLoading&&(o.isInfiniteLoading=t.isInfiniteLoading),o.preloadBatchSize=t.preloadBatchSize,o.preloadAdditionalHeight=t.preloadAdditionalHeight,o=Object.assign(o,infiniteHelpers.recomputeApertureStateFromOptionsAndScrollTop(o,i.getScrollTop())),{computedProps:t,utils:i,newState:o}},componentWillReceiveProps:function(e){var t=this.recomputeInternalStateFromProps(e);this.computedProps=t.computedProps,this.utils=t.utils,this.setState(t.newState)},componentWillUpdate:function(){this.props.displayBottomUpwards&&(this.preservedScrollState=this.utils.getScrollTop()-this.loadingSpinnerHeight)},componentDidUpdate:function(e,t){if(this.loadingSpinnerHeight=this.utils.getLoadingSpinnerHeight(),this.props.displayBottomUpwards){var i=this.getLowestPossibleScrollTop();this.shouldAttachToBottom&&this.utils.getScrollTop()this.state.infiniteComputer.getTotalScrollableHeight()-this.computedProps.containerHeight-this.computedProps.infiniteLoadBeginEdgeOffset},onInfiniteLoad:function(){this.setState({isInfiniteLoading:!0}),this.computedProps.onInfiniteLoad()},handleScroll:function(e){this.shouldAttachToBottom=this.computedProps.displayBottomUpwards&&e>=this.getLowestPossibleScrollTop(),this.manageScrollTimeouts();var t=infiniteHelpers.recomputeApertureStateFromOptionsAndScrollTop(this.state,e);this.passedEdgeForInfiniteScroll(e)&&!this.state.isInfiniteLoading?(this.setState(Object.assign({},t)),this.onInfiniteLoad()):this.setState(t)},buildHeightStyle:function(e){return{width:"100%",height:Math.ceil(e)}},render:function(){var e;e=this.state.numberOfChildren>1?this.computedProps.children.slice(this.state.displayIndexStart,this.state.displayIndexEnd+1):this.computedProps.children;var t={};this.state.isScrolling&&(t.pointerEvents="none");var i=this.state.infiniteComputer.getTopSpacerHeight(this.state.displayIndexStart),o=this.state.infiniteComputer.getBottomSpacerHeight(this.state.displayIndexEnd);if(this.computedProps.displayBottomUpwards){var n=this.computedProps.containerHeight-this.state.infiniteComputer.getTotalScrollableHeight();n>0&&(i=n-this.loadingSpinnerHeight)}var r=void 0===this.computedProps.infiniteLoadBeginEdgeOffset?null:React.createElement("div",{ref:"loadingSpinner"},this.state.isInfiniteLoading?this.computedProps.loadingSpinnerDelegate:null);return React.createElement("div",{className:this.computedProps.className,ref:"scrollable",style:this.utils.buildScrollableStyle(),onScroll:this.utils.nodeScrollListener},React.createElement("div",{ref:"smoothScrollingWrapper",style:t},React.createElement("div",{ref:"topSpacer",style:this.buildHeightStyle(i)}),this.computedProps.displayBottomUpwards&&r,e,!this.computedProps.displayBottomUpwards&&r,React.createElement("div",{ref:"bottomSpacer",style:this.buildHeightStyle(o)})))}});module.exports=Infinite,global.Infinite=Infinite; +"use strict";function _objectWithoutProperties(e,t){var i={};for(var o in e)t.indexOf(o)>=0||Object.prototype.hasOwnProperty.call(e,o)&&(i[o]=e[o]);return i}var React=global.React||require("react"),ReactDOM=global.ReactDOM||require("react-dom");require("./utils/establish-polyfills");var scaleEnum=require("./utils/scaleEnum"),infiniteHelpers=require("./utils/infiniteHelpers"),_isFinite=require("lodash.isfinite"),preloadType=require("./utils/types").preloadType,checkProps=checkProps=require("./utils/checkProps"),Infinite=React.createClass({displayName:"Infinite",propTypes:{children:React.PropTypes.any,handleScroll:React.PropTypes.func,preloadBatchSize:preloadType,preloadAdditionalHeight:preloadType,elementHeight:React.PropTypes.oneOfType([React.PropTypes.number,React.PropTypes.arrayOf(React.PropTypes.number)]).isRequired,containerHeight:React.PropTypes.number,useWindowAsScrollContainer:React.PropTypes.bool,displayBottomUpwards:React.PropTypes.bool.isRequired,infiniteLoadBeginEdgeOffset:React.PropTypes.number,onInfiniteLoad:React.PropTypes.func,loadingSpinnerDelegate:React.PropTypes.node,isInfiniteLoading:React.PropTypes.bool,timeScrollStateLastsForAfterUserScrolls:React.PropTypes.number,className:React.PropTypes.string,styles:React.PropTypes.shape({scrollableStyle:React.PropTypes.object}).isRequired},statics:{containerHeightScaleFactor:function(e){if(!_isFinite(e))throw new Error("The scale factor must be a number.");return{type:scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR,amount:e}}},computedProps:{},utils:{},shouldAttachToBottom:!1,preservedScrollState:0,loadingSpinnerHeight:0,deprecationWarned:!1,getDefaultProps:function(){return{handleScroll:function(){},useWindowAsScrollContainer:!1,onInfiniteLoad:function(){},loadingSpinnerDelegate:React.createElement("div",null),displayBottomUpwards:!1,isInfiniteLoading:!1,timeScrollStateLastsForAfterUserScrolls:150,className:"",styles:{}}},getInitialState:function(){var e=this.recomputeInternalStateFromProps(this.props);this.computedProps=e.computedProps,this.utils=e.utils,this.shouldAttachToBottom=this.props.displayBottomUpwards;var t=e.newState;return t.scrollTimeout=void 0,t.isScrolling=!1,t},generateComputedProps:function(e){var t=e.containerHeight,i=e.preloadBatchSize,o=e.preloadAdditionalHeight,n=_objectWithoutProperties(e,["containerHeight","preloadBatchSize","preloadAdditionalHeight"]),r={};t="number"==typeof t?t:0,r.containerHeight=e.useWindowAsScrollContainer?window.innerHeight:t,void 0!==n.infiniteLoadBeginBottomOffset&&(r.infiniteLoadBeginEdgeOffset=n.infiniteLoadBeginBottomOffset,this.deprecationWarned||(console.error("Warning: React Infinite's infiniteLoadBeginBottomOffset prop\n has been deprecated as of 0.6.0. Please use infiniteLoadBeginEdgeOffset.\n Because this is a rather descriptive name, a simple find and replace\n should suffice."),this.deprecationWarned=!0));var s={type:scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR,amount:.5},l=i&&i.type?i:s;"number"==typeof i?r.preloadBatchSize=i:"object"==typeof l&&l.type===scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR?r.preloadBatchSize=r.containerHeight*l.amount:r.preloadBatchSize=0;var a={type:scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR,amount:1},c=o&&o.type?o:a;return"number"==typeof o?r.preloadAdditionalHeight=o:"object"==typeof c&&c.type===scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR?r.preloadAdditionalHeight=r.containerHeight*c.amount:r.preloadAdditionalHeight=0,Object.assign(n,r)},generateComputedUtilityFunctions:function(e){var t=this,i={};return i.getLoadingSpinnerHeight=function(){var e=0;return t.loadingSpinner&&(e=t.loadingSpinner.offsetHeight||0),e},e.useWindowAsScrollContainer?(i.subscribeToScrollListener=function(){window.addEventListener("scroll",t.infiniteHandleScroll)},i.unsubscribeFromScrollListener=function(){window.removeEventListener("scroll",t.infiniteHandleScroll)},i.nodeScrollListener=function(){},i.getScrollTop=function(){return window.pageYOffset},i.setScrollTop=function(e){window.scroll(window.pageXOffset,e)},i.scrollShouldBeIgnored=function(){return!1},i.buildScrollableStyle=function(){return{}}):(i.subscribeToScrollListener=function(){},i.unsubscribeFromScrollListener=function(){},i.nodeScrollListener=this.infiniteHandleScroll,i.getScrollTop=function(){return t.scrollable?t.scrollable.scrollTop:0},i.setScrollTop=function(e){t.scrollable&&(t.scrollable.scrollTop=e)},i.scrollShouldBeIgnored=function(e){return e.target!==t.scrollable},i.buildScrollableStyle=function(){return Object.assign({},{height:t.computedProps.containerHeight,overflowX:"hidden",overflowY:"scroll",WebkitOverflowScrolling:"touch"},t.computedProps.styles.scrollableStyle||{})}),i},recomputeInternalStateFromProps:function(e){checkProps(e);var t=this.generateComputedProps(e),i=this.generateComputedUtilityFunctions(e),o={};return o.numberOfChildren=React.Children.count(t.children),o.infiniteComputer=infiniteHelpers.createInfiniteComputer(t.elementHeight,t.children,t.displayBottomUpwards),void 0!==t.isInfiniteLoading&&(o.isInfiniteLoading=t.isInfiniteLoading),o.preloadBatchSize=t.preloadBatchSize,o.preloadAdditionalHeight=t.preloadAdditionalHeight,o=Object.assign(o,infiniteHelpers.recomputeApertureStateFromOptionsAndScrollTop(o,i.getScrollTop())),{computedProps:t,utils:i,newState:o}},componentWillReceiveProps:function(e){var t=this.recomputeInternalStateFromProps(e);this.computedProps=t.computedProps,this.utils=t.utils,this.setState(t.newState)},componentWillUpdate:function(){this.props.displayBottomUpwards&&(this.preservedScrollState=this.utils.getScrollTop()-this.loadingSpinnerHeight)},componentDidUpdate:function(e,t){if(this.loadingSpinnerHeight=this.utils.getLoadingSpinnerHeight(),this.props.displayBottomUpwards){var i=this.getLowestPossibleScrollTop();this.shouldAttachToBottom&&this.utils.getScrollTop()this.state.infiniteComputer.getTotalScrollableHeight()-this.computedProps.containerHeight-this.computedProps.infiniteLoadBeginEdgeOffset},onInfiniteLoad:function(){this.setState({isInfiniteLoading:!0}),this.computedProps.onInfiniteLoad()},handleScroll:function(e){this.shouldAttachToBottom=this.computedProps.displayBottomUpwards&&e>=this.getLowestPossibleScrollTop(),this.manageScrollTimeouts();var t=infiniteHelpers.recomputeApertureStateFromOptionsAndScrollTop(this.state,e);this.passedEdgeForInfiniteScroll(e)&&!this.state.isInfiniteLoading?(this.setState(Object.assign({},t)),this.onInfiniteLoad()):this.setState(t)},buildHeightStyle:function(e){return{width:"100%",height:Math.ceil(e)}},render:function(){var e,t=this;e=this.state.numberOfChildren>1?this.computedProps.children.slice(this.state.displayIndexStart,this.state.displayIndexEnd+1):this.computedProps.children;var i={};this.state.isScrolling&&(i.pointerEvents="none");var o=this.state.infiniteComputer.getTopSpacerHeight(this.state.displayIndexStart),n=this.state.infiniteComputer.getBottomSpacerHeight(this.state.displayIndexEnd);if(this.computedProps.displayBottomUpwards){var r=this.computedProps.containerHeight-this.state.infiniteComputer.getTotalScrollableHeight();r>0&&(o=r-this.loadingSpinnerHeight)}var s=void 0===this.computedProps.infiniteLoadBeginEdgeOffset?null:React.createElement("div",{ref:function(e){t.loadingSpinner=e}},this.state.isInfiniteLoading?this.computedProps.loadingSpinnerDelegate:null);return React.createElement("div",{className:this.computedProps.className,ref:function(e){t.scrollable=e},style:this.utils.buildScrollableStyle(),onScroll:this.utils.nodeScrollListener},React.createElement("div",{ref:function(e){t.topSpsmoothScrollingWrapperacer=e},style:i},React.createElement("div",{ref:function(e){t.topSpacer=e},style:this.buildHeightStyle(o)}),this.computedProps.displayBottomUpwards&&s,e,!this.computedProps.displayBottomUpwards&&s,React.createElement("div",{ref:function(e){t.bottomSpacer=e},style:this.buildHeightStyle(n)})))}});module.exports=Infinite,global.Infinite=Infinite; }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) @@ -276,11 +276,11 @@ module.exports = Object.assign || function (target, source) { }; },{}],5:[function(require,module,exports){ -"use strict";function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var _createClass=function(){function e(e,t){for(var r=0;rt?0:this.prefixHeightData[t]}},{key:"getBottomSpacerHeight",value:function(e){return-1===e?0:this.getTotalScrollableHeight()-this.prefixHeightData[e]}}]),t}(InfiniteComputer);module.exports=ArrayInfiniteComputer; +"use strict";function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var _createClass=function(){function e(e,t){for(var r=0;r0?e-1:e}},{key:"getTopSpacerHeight",value:function(t){return t*this.heightData}},{key:"getBottomSpacerHeight",value:function(t){var e=t+1;return Math.max(0,(this.numberOfChildren-e)*this.heightData)}}]),e}(InfiniteComputer);module.exports=ConstantInfiniteComputer; +"use strict";function _classCallCheck(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var _createClass=function(){function t(t,e){for(var r=0;r0?e-1:e}},{key:"getTopSpacerHeight",value:function(t){return t*this.heightData}},{key:"getBottomSpacerHeight",value:function(t){var e=t+1;return Math.max(0,(this.numberOfChildren-e)*this.heightData)}}]),e}(InfiniteComputer);module.exports=ConstantInfiniteComputer; },{"./infiniteComputer.js":7}],7:[function(require,module,exports){ @@ -288,7 +288,7 @@ module.exports = Object.assign || function (target, source) { },{}],8:[function(require,module,exports){ -"use strict";var opts={CLOSEST_LOWER:1,CLOSEST_HIGHER:2},binaryIndexSearch=function(r,t,e){for(var n,o,S,a=r.length-1,s=0;a>=s;){if(o=s+Math.floor((a-s)/2),S=r[o],S===t)return o;t>S?s=o+1:S>t&&(a=o-1)}return e===opts.CLOSEST_LOWER&&s>0?n=s-1:e===opts.CLOSEST_HIGHER&&at&&(a=o-1)}return e===opts.CLOSEST_LOWER&&s>0?n=s-1:e===opts.CLOSEST_HIGHER&&a=0||Object.prototype.hasOwnProperty.call(e,n)&&(i[n]=e[n]);return i}var o=i.React||e("react"),r=i.ReactDOM||e("react-dom");e("./utils/establish-polyfills");var s=e("./utils/scaleEnum"),l=e("./utils/infiniteHelpers"),a=e("lodash.isfinite"),c=e("./utils/types").preloadType,u=u=e("./utils/checkProps"),p=o.createClass({displayName:"Infinite",propTypes:{children:o.PropTypes.any,handleScroll:o.PropTypes.func,preloadBatchSize:c,preloadAdditionalHeight:c,elementHeight:o.PropTypes.oneOfType([o.PropTypes.number,o.PropTypes.arrayOf(o.PropTypes.number)]).isRequired,containerHeight:o.PropTypes.number,useWindowAsScrollContainer:o.PropTypes.bool,displayBottomUpwards:o.PropTypes.bool.isRequired,infiniteLoadBeginEdgeOffset:o.PropTypes.number,onInfiniteLoad:o.PropTypes.func,loadingSpinnerDelegate:o.PropTypes.node,isInfiniteLoading:o.PropTypes.bool,timeScrollStateLastsForAfterUserScrolls:o.PropTypes.number,className:o.PropTypes.string,styles:o.PropTypes.shape({scrollableStyle:o.PropTypes.object}).isRequired},statics:{containerHeightScaleFactor:function(e){if(!a(e))throw new Error("The scale factor must be a number.");return{type:s.CONTAINER_HEIGHT_SCALE_FACTOR,amount:e}}},computedProps:{},utils:{},shouldAttachToBottom:!1,preservedScrollState:0,loadingSpinnerHeight:0,deprecationWarned:!1,getDefaultProps:function(){return{handleScroll:function(){},useWindowAsScrollContainer:!1,onInfiniteLoad:function(){},loadingSpinnerDelegate:o.createElement("div",null),displayBottomUpwards:!1,isInfiniteLoading:!1,timeScrollStateLastsForAfterUserScrolls:150,className:"",styles:{}}},getInitialState:function(){var e=this.recomputeInternalStateFromProps(this.props);this.computedProps=e.computedProps,this.utils=e.utils,this.shouldAttachToBottom=this.props.displayBottomUpwards;var t=e.newState;return t.scrollTimeout=void 0,t.isScrolling=!1,t},generateComputedProps:function(e){var t=e.containerHeight,i=e.preloadBatchSize,o=e.preloadAdditionalHeight,r=n(e,["containerHeight","preloadBatchSize","preloadAdditionalHeight"]),l={};t="number"==typeof t?t:0,l.containerHeight=e.useWindowAsScrollContainer?window.innerHeight:t,void 0!==r.infiniteLoadBeginBottomOffset&&(l.infiniteLoadBeginEdgeOffset=r.infiniteLoadBeginBottomOffset,this.deprecationWarned||(console.error("Warning: React Infinite's infiniteLoadBeginBottomOffset prop\n has been deprecated as of 0.6.0. Please use infiniteLoadBeginEdgeOffset.\n Because this is a rather descriptive name, a simple find and replace\n should suffice."),this.deprecationWarned=!0));var a={type:s.CONTAINER_HEIGHT_SCALE_FACTOR,amount:.5},c=i&&i.type?i:a;"number"==typeof i?l.preloadBatchSize=i:"object"==typeof c&&c.type===s.CONTAINER_HEIGHT_SCALE_FACTOR?l.preloadBatchSize=l.containerHeight*c.amount:l.preloadBatchSize=0;var u={type:s.CONTAINER_HEIGHT_SCALE_FACTOR,amount:1},p=o&&o.type?o:u;return"number"==typeof o?l.preloadAdditionalHeight=o:"object"==typeof p&&p.type===s.CONTAINER_HEIGHT_SCALE_FACTOR?l.preloadAdditionalHeight=l.containerHeight*p.amount:l.preloadAdditionalHeight=0,Object.assign(r,l)},generateComputedUtilityFunctions:function(e){var t=this,i={};return i.getLoadingSpinnerHeight=function(){var e=0;if(t.refs&&t.refs.loadingSpinner){var i=r.findDOMNode(t.refs.loadingSpinner);e=i.offsetHeight||0}return e},e.useWindowAsScrollContainer?(i.subscribeToScrollListener=function(){window.addEventListener("scroll",t.infiniteHandleScroll)},i.unsubscribeFromScrollListener=function(){window.removeEventListener("scroll",t.infiniteHandleScroll)},i.nodeScrollListener=function(){},i.getScrollTop=function(){return window.pageYOffset},i.setScrollTop=function(e){window.scroll(window.pageXOffset,e)},i.scrollShouldBeIgnored=function(){return!1},i.buildScrollableStyle=function(){return{}}):(i.subscribeToScrollListener=function(){},i.unsubscribeFromScrollListener=function(){},i.nodeScrollListener=this.infiniteHandleScroll,i.getScrollTop=function(){var e;return t.refs&&t.refs.scrollable&&(e=r.findDOMNode(t.refs.scrollable)),e?e.scrollTop:0},i.setScrollTop=function(e){var i;t.refs&&t.refs.scrollable&&(i=r.findDOMNode(t.refs.scrollable)),i&&(i.scrollTop=e)},i.scrollShouldBeIgnored=function(e){return e.target!==r.findDOMNode(t.refs.scrollable)},i.buildScrollableStyle=function(){return Object.assign({},{height:t.computedProps.containerHeight,overflowX:"hidden",overflowY:"scroll",WebkitOverflowScrolling:"touch"},t.computedProps.styles.scrollableStyle||{})}),i},recomputeInternalStateFromProps:function(e){u(e);var t=this.generateComputedProps(e),i=this.generateComputedUtilityFunctions(e),n={};return n.numberOfChildren=o.Children.count(t.children),n.infiniteComputer=l.createInfiniteComputer(t.elementHeight,t.children,t.displayBottomUpwards),void 0!==t.isInfiniteLoading&&(n.isInfiniteLoading=t.isInfiniteLoading),n.preloadBatchSize=t.preloadBatchSize,n.preloadAdditionalHeight=t.preloadAdditionalHeight,n=Object.assign(n,l.recomputeApertureStateFromOptionsAndScrollTop(n,i.getScrollTop())),{computedProps:t,utils:i,newState:n}},componentWillReceiveProps:function(e){var t=this.recomputeInternalStateFromProps(e);this.computedProps=t.computedProps,this.utils=t.utils,this.setState(t.newState)},componentWillUpdate:function(){this.props.displayBottomUpwards&&(this.preservedScrollState=this.utils.getScrollTop()-this.loadingSpinnerHeight)},componentDidUpdate:function(e,t){if(this.loadingSpinnerHeight=this.utils.getLoadingSpinnerHeight(),this.props.displayBottomUpwards){var i=this.getLowestPossibleScrollTop();this.shouldAttachToBottom&&this.utils.getScrollTop()this.state.infiniteComputer.getTotalScrollableHeight()-this.computedProps.containerHeight-this.computedProps.infiniteLoadBeginEdgeOffset},onInfiniteLoad:function(){this.setState({isInfiniteLoading:!0}),this.computedProps.onInfiniteLoad()},handleScroll:function(e){this.shouldAttachToBottom=this.computedProps.displayBottomUpwards&&e>=this.getLowestPossibleScrollTop(),this.manageScrollTimeouts();var t=l.recomputeApertureStateFromOptionsAndScrollTop(this.state,e);this.passedEdgeForInfiniteScroll(e)&&!this.state.isInfiniteLoading?(this.setState(Object.assign({},t)),this.onInfiniteLoad()):this.setState(t)},buildHeightStyle:function(e){return{width:"100%",height:Math.ceil(e)}},render:function(){var e;e=this.state.numberOfChildren>1?this.computedProps.children.slice(this.state.displayIndexStart,this.state.displayIndexEnd+1):this.computedProps.children;var t={};this.state.isScrolling&&(t.pointerEvents="none");var i=this.state.infiniteComputer.getTopSpacerHeight(this.state.displayIndexStart),n=this.state.infiniteComputer.getBottomSpacerHeight(this.state.displayIndexEnd);if(this.computedProps.displayBottomUpwards){var r=this.computedProps.containerHeight-this.state.infiniteComputer.getTotalScrollableHeight();r>0&&(i=r-this.loadingSpinnerHeight)}var s=void 0===this.computedProps.infiniteLoadBeginEdgeOffset?null:o.createElement("div",{ref:"loadingSpinner"},this.state.isInfiniteLoading?this.computedProps.loadingSpinnerDelegate:null);return o.createElement("div",{className:this.computedProps.className,ref:"scrollable",style:this.utils.buildScrollableStyle(),onScroll:this.utils.nodeScrollListener},o.createElement("div",{ref:"smoothScrollingWrapper",style:t},o.createElement("div",{ref:"topSpacer",style:this.buildHeightStyle(i)}),this.computedProps.displayBottomUpwards&&s,e,!this.computedProps.displayBottomUpwards&&s,o.createElement("div",{ref:"bottomSpacer",style:this.buildHeightStyle(n)})))}});t.exports=p,i.Infinite=p}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./utils/checkProps":9,"./utils/establish-polyfills":10,"./utils/infiniteHelpers":11,"./utils/scaleEnum":12,"./utils/types":13,"lodash.isfinite":3,react:void 0,"react-dom":void 0}],2:[function(e,t,i){function n(e){return!!e&&"object"==typeof e}function o(e,t){var i=null==e?void 0:e[t];return a(i)?i:void 0}function r(e){return"number"==typeof e&&e>-1&&e%1==0&&S>=e}function s(e){return l(e)&&g.call(e)==u}function l(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function a(e){return null==e?!1:s(e)?y.test(d.call(e)):n(e)&&p.test(e)}var c="[object Array]",u="[object Function]",p=/^\[object .+?Constructor\]$/,f=Object.prototype,d=Function.prototype.toString,h=f.hasOwnProperty,g=f.toString,y=RegExp("^"+d.call(h).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),m=o(Array,"isArray"),S=9007199254740991,b=m||function(e){return n(e)&&r(e.length)&&g.call(e)==c};t.exports=b},{}],3:[function(e,t,i){(function(e){function i(e){return"number"==typeof e&&n(e)}var n=e.isFinite;t.exports=i}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],4:[function(e,t,i){"use strict";function n(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}var o=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;t.exports=Object.assign||function(e,t){for(var i,s,l=n(e),a=1;at?0:this.prefixHeightData[t]}},{key:"getBottomSpacerHeight",value:function(e){return-1===e?0:this.getTotalScrollableHeight()-this.prefixHeightData[e]}}]),t}(l);t.exports=c},{"../utils/binaryIndexSearch.js":8,"./infiniteComputer.js":7}],6:[function(e,t,i){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var r=function(){function e(e,t){for(var i=0;i0?t-1:t}},{key:"getTopSpacerHeight",value:function(e){return e*this.heightData}},{key:"getBottomSpacerHeight",value:function(e){var t=e+1;return Math.max(0,(this.numberOfChildren-t)*this.heightData)}}]),t}(l);t.exports=a},{"./infiniteComputer.js":7}],7:[function(e,t,i){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o=function(){function e(e,t){for(var i=0;i=a;){if(r=a+Math.floor((l-a)/2),s=e[r],s===t)return r;t>s?a=r+1:s>t&&(l=r-1)}return i===n.CLOSEST_LOWER&&a>0?o=a-1:i===n.CLOSEST_HIGHER&&l=0||Object.prototype.hasOwnProperty.call(e,n)&&(i[n]=e[n]);return i}var o=i.React||e("react");i.ReactDOM||e("react-dom");e("./utils/establish-polyfills");var r=e("./utils/scaleEnum"),s=e("./utils/infiniteHelpers"),l=e("lodash.isfinite"),a=e("./utils/types").preloadType,c=c=e("./utils/checkProps"),u=o.createClass({displayName:"Infinite",propTypes:{children:o.PropTypes.any,handleScroll:o.PropTypes.func,preloadBatchSize:a,preloadAdditionalHeight:a,elementHeight:o.PropTypes.oneOfType([o.PropTypes.number,o.PropTypes.arrayOf(o.PropTypes.number)]).isRequired,containerHeight:o.PropTypes.number,useWindowAsScrollContainer:o.PropTypes.bool,displayBottomUpwards:o.PropTypes.bool.isRequired,infiniteLoadBeginEdgeOffset:o.PropTypes.number,onInfiniteLoad:o.PropTypes.func,loadingSpinnerDelegate:o.PropTypes.node,isInfiniteLoading:o.PropTypes.bool,timeScrollStateLastsForAfterUserScrolls:o.PropTypes.number,className:o.PropTypes.string,styles:o.PropTypes.shape({scrollableStyle:o.PropTypes.object}).isRequired},statics:{containerHeightScaleFactor:function(e){if(!l(e))throw new Error("The scale factor must be a number.");return{type:r.CONTAINER_HEIGHT_SCALE_FACTOR,amount:e}}},computedProps:{},utils:{},shouldAttachToBottom:!1,preservedScrollState:0,loadingSpinnerHeight:0,deprecationWarned:!1,getDefaultProps:function(){return{handleScroll:function(){},useWindowAsScrollContainer:!1,onInfiniteLoad:function(){},loadingSpinnerDelegate:o.createElement("div",null),displayBottomUpwards:!1,isInfiniteLoading:!1,timeScrollStateLastsForAfterUserScrolls:150,className:"",styles:{}}},getInitialState:function(){var e=this.recomputeInternalStateFromProps(this.props);this.computedProps=e.computedProps,this.utils=e.utils,this.shouldAttachToBottom=this.props.displayBottomUpwards;var t=e.newState;return t.scrollTimeout=void 0,t.isScrolling=!1,t},generateComputedProps:function(e){var t=e.containerHeight,i=e.preloadBatchSize,o=e.preloadAdditionalHeight,s=n(e,["containerHeight","preloadBatchSize","preloadAdditionalHeight"]),l={};t="number"==typeof t?t:0,l.containerHeight=e.useWindowAsScrollContainer?window.innerHeight:t,void 0!==s.infiniteLoadBeginBottomOffset&&(l.infiniteLoadBeginEdgeOffset=s.infiniteLoadBeginBottomOffset,this.deprecationWarned||(console.error("Warning: React Infinite's infiniteLoadBeginBottomOffset prop\n has been deprecated as of 0.6.0. Please use infiniteLoadBeginEdgeOffset.\n Because this is a rather descriptive name, a simple find and replace\n should suffice."),this.deprecationWarned=!0));var a={type:r.CONTAINER_HEIGHT_SCALE_FACTOR,amount:.5},c=i&&i.type?i:a;"number"==typeof i?l.preloadBatchSize=i:"object"==typeof c&&c.type===r.CONTAINER_HEIGHT_SCALE_FACTOR?l.preloadBatchSize=l.containerHeight*c.amount:l.preloadBatchSize=0;var u={type:r.CONTAINER_HEIGHT_SCALE_FACTOR,amount:1},p=o&&o.type?o:u;return"number"==typeof o?l.preloadAdditionalHeight=o:"object"==typeof p&&p.type===r.CONTAINER_HEIGHT_SCALE_FACTOR?l.preloadAdditionalHeight=l.containerHeight*p.amount:l.preloadAdditionalHeight=0,Object.assign(s,l)},generateComputedUtilityFunctions:function(e){var t=this,i={};return i.getLoadingSpinnerHeight=function(){var e=0;return t.loadingSpinner&&(e=t.loadingSpinner.offsetHeight||0),e},e.useWindowAsScrollContainer?(i.subscribeToScrollListener=function(){window.addEventListener("scroll",t.infiniteHandleScroll)},i.unsubscribeFromScrollListener=function(){window.removeEventListener("scroll",t.infiniteHandleScroll)},i.nodeScrollListener=function(){},i.getScrollTop=function(){return window.pageYOffset},i.setScrollTop=function(e){window.scroll(window.pageXOffset,e)},i.scrollShouldBeIgnored=function(){return!1},i.buildScrollableStyle=function(){return{}}):(i.subscribeToScrollListener=function(){},i.unsubscribeFromScrollListener=function(){},i.nodeScrollListener=this.infiniteHandleScroll,i.getScrollTop=function(){return t.scrollable?t.scrollable.scrollTop:0},i.setScrollTop=function(e){t.scrollable&&(t.scrollable.scrollTop=e)},i.scrollShouldBeIgnored=function(e){return e.target!==t.scrollable},i.buildScrollableStyle=function(){return Object.assign({},{height:t.computedProps.containerHeight,overflowX:"hidden",overflowY:"scroll",WebkitOverflowScrolling:"touch"},t.computedProps.styles.scrollableStyle||{})}),i},recomputeInternalStateFromProps:function(e){c(e);var t=this.generateComputedProps(e),i=this.generateComputedUtilityFunctions(e),n={};return n.numberOfChildren=o.Children.count(t.children),n.infiniteComputer=s.createInfiniteComputer(t.elementHeight,t.children,t.displayBottomUpwards),void 0!==t.isInfiniteLoading&&(n.isInfiniteLoading=t.isInfiniteLoading),n.preloadBatchSize=t.preloadBatchSize,n.preloadAdditionalHeight=t.preloadAdditionalHeight,n=Object.assign(n,s.recomputeApertureStateFromOptionsAndScrollTop(n,i.getScrollTop())),{computedProps:t,utils:i,newState:n}},componentWillReceiveProps:function(e){var t=this.recomputeInternalStateFromProps(e);this.computedProps=t.computedProps,this.utils=t.utils,this.setState(t.newState)},componentWillUpdate:function(){this.props.displayBottomUpwards&&(this.preservedScrollState=this.utils.getScrollTop()-this.loadingSpinnerHeight)},componentDidUpdate:function(e,t){if(this.loadingSpinnerHeight=this.utils.getLoadingSpinnerHeight(),this.props.displayBottomUpwards){var i=this.getLowestPossibleScrollTop();this.shouldAttachToBottom&&this.utils.getScrollTop()this.state.infiniteComputer.getTotalScrollableHeight()-this.computedProps.containerHeight-this.computedProps.infiniteLoadBeginEdgeOffset},onInfiniteLoad:function(){this.setState({isInfiniteLoading:!0}),this.computedProps.onInfiniteLoad()},handleScroll:function(e){this.shouldAttachToBottom=this.computedProps.displayBottomUpwards&&e>=this.getLowestPossibleScrollTop(),this.manageScrollTimeouts();var t=s.recomputeApertureStateFromOptionsAndScrollTop(this.state,e);this.passedEdgeForInfiniteScroll(e)&&!this.state.isInfiniteLoading?(this.setState(Object.assign({},t)),this.onInfiniteLoad()):this.setState(t)},buildHeightStyle:function(e){return{width:"100%",height:Math.ceil(e)}},render:function(){var e,t=this;e=this.state.numberOfChildren>1?this.computedProps.children.slice(this.state.displayIndexStart,this.state.displayIndexEnd+1):this.computedProps.children;var i={};this.state.isScrolling&&(i.pointerEvents="none");var n=this.state.infiniteComputer.getTopSpacerHeight(this.state.displayIndexStart),r=this.state.infiniteComputer.getBottomSpacerHeight(this.state.displayIndexEnd);if(this.computedProps.displayBottomUpwards){var s=this.computedProps.containerHeight-this.state.infiniteComputer.getTotalScrollableHeight();s>0&&(n=s-this.loadingSpinnerHeight)}var l=void 0===this.computedProps.infiniteLoadBeginEdgeOffset?null:o.createElement("div",{ref:function(e){t.loadingSpinner=e}},this.state.isInfiniteLoading?this.computedProps.loadingSpinnerDelegate:null);return o.createElement("div",{className:this.computedProps.className,ref:function(e){t.scrollable=e},style:this.utils.buildScrollableStyle(),onScroll:this.utils.nodeScrollListener},o.createElement("div",{ref:function(e){t.topSpsmoothScrollingWrapperacer=e},style:i},o.createElement("div",{ref:function(e){t.topSpacer=e},style:this.buildHeightStyle(n)}),this.computedProps.displayBottomUpwards&&l,e,!this.computedProps.displayBottomUpwards&&l,o.createElement("div",{ref:function(e){t.bottomSpacer=e},style:this.buildHeightStyle(r)})))}});t.exports=u,i.Infinite=u}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./utils/checkProps":9,"./utils/establish-polyfills":10,"./utils/infiniteHelpers":11,"./utils/scaleEnum":12,"./utils/types":13,"lodash.isfinite":3,react:void 0,"react-dom":void 0}],2:[function(e,t,i){function n(e){return!!e&&"object"==typeof e}function o(e,t){var i=null==e?void 0:e[t];return a(i)?i:void 0}function r(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=S}function s(e){return l(e)&&g.call(e)==u}function l(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function a(e){return null!=e&&(s(e)?y.test(d.call(e)):n(e)&&p.test(e))}var c="[object Array]",u="[object Function]",p=/^\[object .+?Constructor\]$/,f=Object.prototype,d=Function.prototype.toString,h=f.hasOwnProperty,g=f.toString,y=RegExp("^"+d.call(h).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),m=o(Array,"isArray"),S=9007199254740991,b=m||function(e){return n(e)&&r(e.length)&&g.call(e)==c};t.exports=b},{}],3:[function(e,t,i){(function(e){function i(e){return"number"==typeof e&&n(e)}var n=e.isFinite;t.exports=i}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],4:[function(e,t,i){"use strict";function n(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}var o=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;t.exports=Object.assign||function(e,t){for(var i,s,l=n(e),a=1;a0?t-1:t}},{key:"getTopSpacerHeight",value:function(e){return e*this.heightData}},{key:"getBottomSpacerHeight",value:function(e){var t=e+1;return Math.max(0,(this.numberOfChildren-t)*this.heightData)}}]),t}(l);t.exports=a},{"./infiniteComputer.js":7}],7:[function(e,t,i){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o=function(){function e(e,t){for(var i=0;it&&(l=r-1)}return i===n.CLOSEST_LOWER&&a>0?o=a-1:i===n.CLOSEST_HIGHER&&l { var loadingSpinnerHeight = 0; - if (this.refs && this.refs.loadingSpinner) { - var loadingSpinnerNode = ReactDOM.findDOMNode(this.refs.loadingSpinner); - loadingSpinnerHeight = loadingSpinnerNode.offsetHeight || 0; + if (this.loadingSpinner) { + loadingSpinnerHeight = this.loadingSpinner.offsetHeight || 0; } return loadingSpinnerHeight; }; @@ -201,23 +200,15 @@ var Infinite = React.createClass({ utilities.unsubscribeFromScrollListener = () => {}; utilities.nodeScrollListener = this.infiniteHandleScroll; utilities.getScrollTop = () => { - var scrollable; - if (this.refs && this.refs.scrollable) { - scrollable = ReactDOM.findDOMNode(this.refs.scrollable); - } - return scrollable ? scrollable.scrollTop : 0; + return this.scrollable ? this.scrollable.scrollTop : 0; }; utilities.setScrollTop = (top) => { - var scrollable; - if (this.refs && this.refs.scrollable) { - scrollable = ReactDOM.findDOMNode(this.refs.scrollable); - } - if (scrollable) { - scrollable.scrollTop = top; + if (this.scrollable) { + this.scrollable.scrollTop = top; } }; - utilities.scrollShouldBeIgnored = event => event.target !== ReactDOM.findDOMNode(this.refs.scrollable); + utilities.scrollShouldBeIgnored = event => event.target !== this.scrollable; utilities.buildScrollableStyle = () => { return Object.assign({}, { @@ -334,7 +325,7 @@ var Infinite = React.createClass({ if (this.utils.scrollShouldBeIgnored(e)) { return; } - this.computedProps.handleScroll(ReactDOM.findDOMNode(this.refs.scrollable)); + this.computedProps.handleScroll(this.scrollable); this.handleScroll(this.utils.getScrollTop()); }, @@ -438,23 +429,23 @@ var Infinite = React.createClass({ var loadingSpinner = this.computedProps.infiniteLoadBeginEdgeOffset === undefined ? null - :
+ :
{ this.loadingSpinner = c; }}> {this.state.isInfiniteLoading ? this.computedProps.loadingSpinnerDelegate : null}
; // topSpacer and bottomSpacer take up the amount of space that the // rendered elements would have taken up otherwise return
{ this.scrollable = c; }} style={this.utils.buildScrollableStyle()} onScroll={this.utils.nodeScrollListener}> -
-
{ this.topSpsmoothScrollingWrapperacer = c; }} style={infiniteScrollStyles}> +
{ this.topSpacer = c; }} style={this.buildHeightStyle(topSpacerHeight)}/> {this.computedProps.displayBottomUpwards && loadingSpinner} {displayables} {!this.computedProps.displayBottomUpwards && loadingSpinner} -
{ this.bottomSpacer = c; }} style={this.buildHeightStyle(bottomSpacerHeight)}/>
; From ec652ba6557d7f9a72cb02ad864a783f3b760489 Mon Sep 17 00:00:00 2001 From: Tom Haggie Date: Wed, 28 Sep 2016 11:59:52 -0700 Subject: [PATCH 02/78] Fixed lint error --- src/react-infinite.jsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/react-infinite.jsx b/src/react-infinite.jsx index 40bdfff..890000a 100644 --- a/src/react-infinite.jsx +++ b/src/react-infinite.jsx @@ -1,7 +1,6 @@ /* @flow */ var React = global.React || require('react'); -var ReactDOM = global.ReactDOM || require('react-dom'); require('./utils/establish-polyfills'); var scaleEnum = require('./utils/scaleEnum'); From 866235b0fbec4c82a8f94729242deeb10fe8bc2a Mon Sep 17 00:00:00 2001 From: Tom Haggie Date: Wed, 28 Sep 2016 12:28:20 -0700 Subject: [PATCH 03/78] Fixed typo --- src/react-infinite.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/react-infinite.jsx b/src/react-infinite.jsx index 890000a..f98fbb2 100644 --- a/src/react-infinite.jsx +++ b/src/react-infinite.jsx @@ -438,7 +438,7 @@ var Infinite = React.createClass({ ref={(c) => { this.scrollable = c; }} style={this.utils.buildScrollableStyle()} onScroll={this.utils.nodeScrollListener}> -
{ this.topSpsmoothScrollingWrapperacer = c; }} style={infiniteScrollStyles}> +
{ this.smoothScrollingWrapper = c; }} style={infiniteScrollStyles}>
{ this.topSpacer = c; }} style={this.buildHeightStyle(topSpacerHeight)}/> {this.computedProps.displayBottomUpwards && loadingSpinner} From d1113808b7238c8edfa5bd9d0865e883d3705958 Mon Sep 17 00:00:00 2001 From: Gareth Tan Date: Tue, 4 Oct 2016 12:33:54 -0400 Subject: [PATCH 04/78] New release files. --- dist/react-infinite.js | 4 ++-- dist/react-infinite.min.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dist/react-infinite.js b/dist/react-infinite.js index 2e8ca73..6ea7329 100644 --- a/dist/react-infinite.js +++ b/dist/react-infinite.js @@ -1,10 +1,10 @@ (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Infinite = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o=0||Object.prototype.hasOwnProperty.call(e,o)&&(i[o]=e[o]);return i}var React=global.React||require("react"),ReactDOM=global.ReactDOM||require("react-dom");require("./utils/establish-polyfills");var scaleEnum=require("./utils/scaleEnum"),infiniteHelpers=require("./utils/infiniteHelpers"),_isFinite=require("lodash.isfinite"),preloadType=require("./utils/types").preloadType,checkProps=checkProps=require("./utils/checkProps"),Infinite=React.createClass({displayName:"Infinite",propTypes:{children:React.PropTypes.any,handleScroll:React.PropTypes.func,preloadBatchSize:preloadType,preloadAdditionalHeight:preloadType,elementHeight:React.PropTypes.oneOfType([React.PropTypes.number,React.PropTypes.arrayOf(React.PropTypes.number)]).isRequired,containerHeight:React.PropTypes.number,useWindowAsScrollContainer:React.PropTypes.bool,displayBottomUpwards:React.PropTypes.bool.isRequired,infiniteLoadBeginEdgeOffset:React.PropTypes.number,onInfiniteLoad:React.PropTypes.func,loadingSpinnerDelegate:React.PropTypes.node,isInfiniteLoading:React.PropTypes.bool,timeScrollStateLastsForAfterUserScrolls:React.PropTypes.number,className:React.PropTypes.string,styles:React.PropTypes.shape({scrollableStyle:React.PropTypes.object}).isRequired},statics:{containerHeightScaleFactor:function(e){if(!_isFinite(e))throw new Error("The scale factor must be a number.");return{type:scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR,amount:e}}},computedProps:{},utils:{},shouldAttachToBottom:!1,preservedScrollState:0,loadingSpinnerHeight:0,deprecationWarned:!1,getDefaultProps:function(){return{handleScroll:function(){},useWindowAsScrollContainer:!1,onInfiniteLoad:function(){},loadingSpinnerDelegate:React.createElement("div",null),displayBottomUpwards:!1,isInfiniteLoading:!1,timeScrollStateLastsForAfterUserScrolls:150,className:"",styles:{}}},getInitialState:function(){var e=this.recomputeInternalStateFromProps(this.props);this.computedProps=e.computedProps,this.utils=e.utils,this.shouldAttachToBottom=this.props.displayBottomUpwards;var t=e.newState;return t.scrollTimeout=void 0,t.isScrolling=!1,t},generateComputedProps:function(e){var t=e.containerHeight,i=e.preloadBatchSize,o=e.preloadAdditionalHeight,n=_objectWithoutProperties(e,["containerHeight","preloadBatchSize","preloadAdditionalHeight"]),r={};t="number"==typeof t?t:0,r.containerHeight=e.useWindowAsScrollContainer?window.innerHeight:t,void 0!==n.infiniteLoadBeginBottomOffset&&(r.infiniteLoadBeginEdgeOffset=n.infiniteLoadBeginBottomOffset,this.deprecationWarned||(console.error("Warning: React Infinite's infiniteLoadBeginBottomOffset prop\n has been deprecated as of 0.6.0. Please use infiniteLoadBeginEdgeOffset.\n Because this is a rather descriptive name, a simple find and replace\n should suffice."),this.deprecationWarned=!0));var s={type:scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR,amount:.5},l=i&&i.type?i:s;"number"==typeof i?r.preloadBatchSize=i:"object"==typeof l&&l.type===scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR?r.preloadBatchSize=r.containerHeight*l.amount:r.preloadBatchSize=0;var a={type:scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR,amount:1},c=o&&o.type?o:a;return"number"==typeof o?r.preloadAdditionalHeight=o:"object"==typeof c&&c.type===scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR?r.preloadAdditionalHeight=r.containerHeight*c.amount:r.preloadAdditionalHeight=0,Object.assign(n,r)},generateComputedUtilityFunctions:function(e){var t=this,i={};return i.getLoadingSpinnerHeight=function(){var e=0;return t.loadingSpinner&&(e=t.loadingSpinner.offsetHeight||0),e},e.useWindowAsScrollContainer?(i.subscribeToScrollListener=function(){window.addEventListener("scroll",t.infiniteHandleScroll)},i.unsubscribeFromScrollListener=function(){window.removeEventListener("scroll",t.infiniteHandleScroll)},i.nodeScrollListener=function(){},i.getScrollTop=function(){return window.pageYOffset},i.setScrollTop=function(e){window.scroll(window.pageXOffset,e)},i.scrollShouldBeIgnored=function(){return!1},i.buildScrollableStyle=function(){return{}}):(i.subscribeToScrollListener=function(){},i.unsubscribeFromScrollListener=function(){},i.nodeScrollListener=this.infiniteHandleScroll,i.getScrollTop=function(){return t.scrollable?t.scrollable.scrollTop:0},i.setScrollTop=function(e){t.scrollable&&(t.scrollable.scrollTop=e)},i.scrollShouldBeIgnored=function(e){return e.target!==t.scrollable},i.buildScrollableStyle=function(){return Object.assign({},{height:t.computedProps.containerHeight,overflowX:"hidden",overflowY:"scroll",WebkitOverflowScrolling:"touch"},t.computedProps.styles.scrollableStyle||{})}),i},recomputeInternalStateFromProps:function(e){checkProps(e);var t=this.generateComputedProps(e),i=this.generateComputedUtilityFunctions(e),o={};return o.numberOfChildren=React.Children.count(t.children),o.infiniteComputer=infiniteHelpers.createInfiniteComputer(t.elementHeight,t.children,t.displayBottomUpwards),void 0!==t.isInfiniteLoading&&(o.isInfiniteLoading=t.isInfiniteLoading),o.preloadBatchSize=t.preloadBatchSize,o.preloadAdditionalHeight=t.preloadAdditionalHeight,o=Object.assign(o,infiniteHelpers.recomputeApertureStateFromOptionsAndScrollTop(o,i.getScrollTop())),{computedProps:t,utils:i,newState:o}},componentWillReceiveProps:function(e){var t=this.recomputeInternalStateFromProps(e);this.computedProps=t.computedProps,this.utils=t.utils,this.setState(t.newState)},componentWillUpdate:function(){this.props.displayBottomUpwards&&(this.preservedScrollState=this.utils.getScrollTop()-this.loadingSpinnerHeight)},componentDidUpdate:function(e,t){if(this.loadingSpinnerHeight=this.utils.getLoadingSpinnerHeight(),this.props.displayBottomUpwards){var i=this.getLowestPossibleScrollTop();this.shouldAttachToBottom&&this.utils.getScrollTop()this.state.infiniteComputer.getTotalScrollableHeight()-this.computedProps.containerHeight-this.computedProps.infiniteLoadBeginEdgeOffset},onInfiniteLoad:function(){this.setState({isInfiniteLoading:!0}),this.computedProps.onInfiniteLoad()},handleScroll:function(e){this.shouldAttachToBottom=this.computedProps.displayBottomUpwards&&e>=this.getLowestPossibleScrollTop(),this.manageScrollTimeouts();var t=infiniteHelpers.recomputeApertureStateFromOptionsAndScrollTop(this.state,e);this.passedEdgeForInfiniteScroll(e)&&!this.state.isInfiniteLoading?(this.setState(Object.assign({},t)),this.onInfiniteLoad()):this.setState(t)},buildHeightStyle:function(e){return{width:"100%",height:Math.ceil(e)}},render:function(){var e,t=this;e=this.state.numberOfChildren>1?this.computedProps.children.slice(this.state.displayIndexStart,this.state.displayIndexEnd+1):this.computedProps.children;var i={};this.state.isScrolling&&(i.pointerEvents="none");var o=this.state.infiniteComputer.getTopSpacerHeight(this.state.displayIndexStart),n=this.state.infiniteComputer.getBottomSpacerHeight(this.state.displayIndexEnd);if(this.computedProps.displayBottomUpwards){var r=this.computedProps.containerHeight-this.state.infiniteComputer.getTotalScrollableHeight();r>0&&(o=r-this.loadingSpinnerHeight)}var s=void 0===this.computedProps.infiniteLoadBeginEdgeOffset?null:React.createElement("div",{ref:function(e){t.loadingSpinner=e}},this.state.isInfiniteLoading?this.computedProps.loadingSpinnerDelegate:null);return React.createElement("div",{className:this.computedProps.className,ref:function(e){t.scrollable=e},style:this.utils.buildScrollableStyle(),onScroll:this.utils.nodeScrollListener},React.createElement("div",{ref:function(e){t.topSpsmoothScrollingWrapperacer=e},style:i},React.createElement("div",{ref:function(e){t.topSpacer=e},style:this.buildHeightStyle(o)}),this.computedProps.displayBottomUpwards&&s,e,!this.computedProps.displayBottomUpwards&&s,React.createElement("div",{ref:function(e){t.bottomSpacer=e},style:this.buildHeightStyle(n)})))}});module.exports=Infinite,global.Infinite=Infinite; +"use strict";function _objectWithoutProperties(e,t){var i={};for(var o in e)t.indexOf(o)>=0||Object.prototype.hasOwnProperty.call(e,o)&&(i[o]=e[o]);return i}var React=global.React||require("react");require("./utils/establish-polyfills");var scaleEnum=require("./utils/scaleEnum"),infiniteHelpers=require("./utils/infiniteHelpers"),_isFinite=require("lodash.isfinite"),preloadType=require("./utils/types").preloadType,checkProps=checkProps=require("./utils/checkProps"),Infinite=React.createClass({displayName:"Infinite",propTypes:{children:React.PropTypes.any,handleScroll:React.PropTypes.func,preloadBatchSize:preloadType,preloadAdditionalHeight:preloadType,elementHeight:React.PropTypes.oneOfType([React.PropTypes.number,React.PropTypes.arrayOf(React.PropTypes.number)]).isRequired,containerHeight:React.PropTypes.number,useWindowAsScrollContainer:React.PropTypes.bool,displayBottomUpwards:React.PropTypes.bool.isRequired,infiniteLoadBeginEdgeOffset:React.PropTypes.number,onInfiniteLoad:React.PropTypes.func,loadingSpinnerDelegate:React.PropTypes.node,isInfiniteLoading:React.PropTypes.bool,timeScrollStateLastsForAfterUserScrolls:React.PropTypes.number,className:React.PropTypes.string,styles:React.PropTypes.shape({scrollableStyle:React.PropTypes.object}).isRequired},statics:{containerHeightScaleFactor:function(e){if(!_isFinite(e))throw new Error("The scale factor must be a number.");return{type:scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR,amount:e}}},computedProps:{},utils:{},shouldAttachToBottom:!1,preservedScrollState:0,loadingSpinnerHeight:0,deprecationWarned:!1,getDefaultProps:function(){return{handleScroll:function(){},useWindowAsScrollContainer:!1,onInfiniteLoad:function(){},loadingSpinnerDelegate:React.createElement("div",null),displayBottomUpwards:!1,isInfiniteLoading:!1,timeScrollStateLastsForAfterUserScrolls:150,className:"",styles:{}}},getInitialState:function(){var e=this.recomputeInternalStateFromProps(this.props);this.computedProps=e.computedProps,this.utils=e.utils,this.shouldAttachToBottom=this.props.displayBottomUpwards;var t=e.newState;return t.scrollTimeout=void 0,t.isScrolling=!1,t},generateComputedProps:function(e){var t=e.containerHeight,i=e.preloadBatchSize,o=e.preloadAdditionalHeight,n=_objectWithoutProperties(e,["containerHeight","preloadBatchSize","preloadAdditionalHeight"]),s={};t="number"==typeof t?t:0,s.containerHeight=e.useWindowAsScrollContainer?window.innerHeight:t,void 0!==n.infiniteLoadBeginBottomOffset&&(s.infiniteLoadBeginEdgeOffset=n.infiniteLoadBeginBottomOffset,this.deprecationWarned||(console.error("Warning: React Infinite's infiniteLoadBeginBottomOffset prop\n has been deprecated as of 0.6.0. Please use infiniteLoadBeginEdgeOffset.\n Because this is a rather descriptive name, a simple find and replace\n should suffice."),this.deprecationWarned=!0));var r={type:scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR,amount:.5},l=i&&i.type?i:r;"number"==typeof i?s.preloadBatchSize=i:"object"==typeof l&&l.type===scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR?s.preloadBatchSize=s.containerHeight*l.amount:s.preloadBatchSize=0;var a={type:scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR,amount:1},c=o&&o.type?o:a;return"number"==typeof o?s.preloadAdditionalHeight=o:"object"==typeof c&&c.type===scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR?s.preloadAdditionalHeight=s.containerHeight*c.amount:s.preloadAdditionalHeight=0,Object.assign(n,s)},generateComputedUtilityFunctions:function(e){var t=this,i={};return i.getLoadingSpinnerHeight=function(){var e=0;return t.loadingSpinner&&(e=t.loadingSpinner.offsetHeight||0),e},e.useWindowAsScrollContainer?(i.subscribeToScrollListener=function(){window.addEventListener("scroll",t.infiniteHandleScroll)},i.unsubscribeFromScrollListener=function(){window.removeEventListener("scroll",t.infiniteHandleScroll)},i.nodeScrollListener=function(){},i.getScrollTop=function(){return window.pageYOffset},i.setScrollTop=function(e){window.scroll(window.pageXOffset,e)},i.scrollShouldBeIgnored=function(){return!1},i.buildScrollableStyle=function(){return{}}):(i.subscribeToScrollListener=function(){},i.unsubscribeFromScrollListener=function(){},i.nodeScrollListener=this.infiniteHandleScroll,i.getScrollTop=function(){return t.scrollable?t.scrollable.scrollTop:0},i.setScrollTop=function(e){t.scrollable&&(t.scrollable.scrollTop=e)},i.scrollShouldBeIgnored=function(e){return e.target!==t.scrollable},i.buildScrollableStyle=function(){return Object.assign({},{height:t.computedProps.containerHeight,overflowX:"hidden",overflowY:"scroll",WebkitOverflowScrolling:"touch"},t.computedProps.styles.scrollableStyle||{})}),i},recomputeInternalStateFromProps:function(e){checkProps(e);var t=this.generateComputedProps(e),i=this.generateComputedUtilityFunctions(e),o={};return o.numberOfChildren=React.Children.count(t.children),o.infiniteComputer=infiniteHelpers.createInfiniteComputer(t.elementHeight,t.children,t.displayBottomUpwards),void 0!==t.isInfiniteLoading&&(o.isInfiniteLoading=t.isInfiniteLoading),o.preloadBatchSize=t.preloadBatchSize,o.preloadAdditionalHeight=t.preloadAdditionalHeight,o=Object.assign(o,infiniteHelpers.recomputeApertureStateFromOptionsAndScrollTop(o,i.getScrollTop())),{computedProps:t,utils:i,newState:o}},componentWillReceiveProps:function(e){var t=this.recomputeInternalStateFromProps(e);this.computedProps=t.computedProps,this.utils=t.utils,this.setState(t.newState)},componentWillUpdate:function(){this.props.displayBottomUpwards&&(this.preservedScrollState=this.utils.getScrollTop()-this.loadingSpinnerHeight)},componentDidUpdate:function(e,t){if(this.loadingSpinnerHeight=this.utils.getLoadingSpinnerHeight(),this.props.displayBottomUpwards){var i=this.getLowestPossibleScrollTop();this.shouldAttachToBottom&&this.utils.getScrollTop()this.state.infiniteComputer.getTotalScrollableHeight()-this.computedProps.containerHeight-this.computedProps.infiniteLoadBeginEdgeOffset},onInfiniteLoad:function(){this.setState({isInfiniteLoading:!0}),this.computedProps.onInfiniteLoad()},handleScroll:function(e){this.shouldAttachToBottom=this.computedProps.displayBottomUpwards&&e>=this.getLowestPossibleScrollTop(),this.manageScrollTimeouts();var t=infiniteHelpers.recomputeApertureStateFromOptionsAndScrollTop(this.state,e);this.passedEdgeForInfiniteScroll(e)&&!this.state.isInfiniteLoading?(this.setState(Object.assign({},t)),this.onInfiniteLoad()):this.setState(t)},buildHeightStyle:function(e){return{width:"100%",height:Math.ceil(e)}},render:function(){var e,t=this;e=this.state.numberOfChildren>1?this.computedProps.children.slice(this.state.displayIndexStart,this.state.displayIndexEnd+1):this.computedProps.children;var i={};this.state.isScrolling&&(i.pointerEvents="none");var o=this.state.infiniteComputer.getTopSpacerHeight(this.state.displayIndexStart),n=this.state.infiniteComputer.getBottomSpacerHeight(this.state.displayIndexEnd);if(this.computedProps.displayBottomUpwards){var s=this.computedProps.containerHeight-this.state.infiniteComputer.getTotalScrollableHeight();s>0&&(o=s-this.loadingSpinnerHeight)}var r=void 0===this.computedProps.infiniteLoadBeginEdgeOffset?null:React.createElement("div",{ref:function(e){t.loadingSpinner=e}},this.state.isInfiniteLoading?this.computedProps.loadingSpinnerDelegate:null);return React.createElement("div",{className:this.computedProps.className,ref:function(e){t.scrollable=e},style:this.utils.buildScrollableStyle(),onScroll:this.utils.nodeScrollListener},React.createElement("div",{ref:function(e){t.smoothScrollingWrapper=e},style:i},React.createElement("div",{ref:function(e){t.topSpacer=e},style:this.buildHeightStyle(o)}),this.computedProps.displayBottomUpwards&&r,e,!this.computedProps.displayBottomUpwards&&r,React.createElement("div",{ref:function(e){t.bottomSpacer=e},style:this.buildHeightStyle(n)})))}});module.exports=Infinite,global.Infinite=Infinite; }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"./utils/checkProps":9,"./utils/establish-polyfills":10,"./utils/infiniteHelpers":11,"./utils/scaleEnum":12,"./utils/types":13,"lodash.isfinite":3,"react":undefined,"react-dom":undefined}],2:[function(require,module,exports){ +},{"./utils/checkProps":9,"./utils/establish-polyfills":10,"./utils/infiniteHelpers":11,"./utils/scaleEnum":12,"./utils/types":13,"lodash.isfinite":3,"react":undefined}],2:[function(require,module,exports){ /** * lodash 3.0.4 (Custom Build) * Build: `lodash modern modularize exports="npm" -o ./` diff --git a/dist/react-infinite.min.js b/dist/react-infinite.min.js index 95075d8..c47998d 100644 --- a/dist/react-infinite.min.js +++ b/dist/react-infinite.min.js @@ -1 +1 @@ -!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.Infinite=e()}}(function(){return function e(t,i,n){function o(s,l){if(!i[s]){if(!t[s]){var a="function"==typeof require&&require;if(!l&&a)return a(s,!0);if(r)return r(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var u=i[s]={exports:{}};t[s][0].call(u.exports,function(e){var i=t[s][1][e];return o(i?i:e)},u,u.exports,e,t,i,n)}return i[s].exports}for(var r="function"==typeof require&&require,s=0;s=0||Object.prototype.hasOwnProperty.call(e,n)&&(i[n]=e[n]);return i}var o=i.React||e("react");i.ReactDOM||e("react-dom");e("./utils/establish-polyfills");var r=e("./utils/scaleEnum"),s=e("./utils/infiniteHelpers"),l=e("lodash.isfinite"),a=e("./utils/types").preloadType,c=c=e("./utils/checkProps"),u=o.createClass({displayName:"Infinite",propTypes:{children:o.PropTypes.any,handleScroll:o.PropTypes.func,preloadBatchSize:a,preloadAdditionalHeight:a,elementHeight:o.PropTypes.oneOfType([o.PropTypes.number,o.PropTypes.arrayOf(o.PropTypes.number)]).isRequired,containerHeight:o.PropTypes.number,useWindowAsScrollContainer:o.PropTypes.bool,displayBottomUpwards:o.PropTypes.bool.isRequired,infiniteLoadBeginEdgeOffset:o.PropTypes.number,onInfiniteLoad:o.PropTypes.func,loadingSpinnerDelegate:o.PropTypes.node,isInfiniteLoading:o.PropTypes.bool,timeScrollStateLastsForAfterUserScrolls:o.PropTypes.number,className:o.PropTypes.string,styles:o.PropTypes.shape({scrollableStyle:o.PropTypes.object}).isRequired},statics:{containerHeightScaleFactor:function(e){if(!l(e))throw new Error("The scale factor must be a number.");return{type:r.CONTAINER_HEIGHT_SCALE_FACTOR,amount:e}}},computedProps:{},utils:{},shouldAttachToBottom:!1,preservedScrollState:0,loadingSpinnerHeight:0,deprecationWarned:!1,getDefaultProps:function(){return{handleScroll:function(){},useWindowAsScrollContainer:!1,onInfiniteLoad:function(){},loadingSpinnerDelegate:o.createElement("div",null),displayBottomUpwards:!1,isInfiniteLoading:!1,timeScrollStateLastsForAfterUserScrolls:150,className:"",styles:{}}},getInitialState:function(){var e=this.recomputeInternalStateFromProps(this.props);this.computedProps=e.computedProps,this.utils=e.utils,this.shouldAttachToBottom=this.props.displayBottomUpwards;var t=e.newState;return t.scrollTimeout=void 0,t.isScrolling=!1,t},generateComputedProps:function(e){var t=e.containerHeight,i=e.preloadBatchSize,o=e.preloadAdditionalHeight,s=n(e,["containerHeight","preloadBatchSize","preloadAdditionalHeight"]),l={};t="number"==typeof t?t:0,l.containerHeight=e.useWindowAsScrollContainer?window.innerHeight:t,void 0!==s.infiniteLoadBeginBottomOffset&&(l.infiniteLoadBeginEdgeOffset=s.infiniteLoadBeginBottomOffset,this.deprecationWarned||(console.error("Warning: React Infinite's infiniteLoadBeginBottomOffset prop\n has been deprecated as of 0.6.0. Please use infiniteLoadBeginEdgeOffset.\n Because this is a rather descriptive name, a simple find and replace\n should suffice."),this.deprecationWarned=!0));var a={type:r.CONTAINER_HEIGHT_SCALE_FACTOR,amount:.5},c=i&&i.type?i:a;"number"==typeof i?l.preloadBatchSize=i:"object"==typeof c&&c.type===r.CONTAINER_HEIGHT_SCALE_FACTOR?l.preloadBatchSize=l.containerHeight*c.amount:l.preloadBatchSize=0;var u={type:r.CONTAINER_HEIGHT_SCALE_FACTOR,amount:1},p=o&&o.type?o:u;return"number"==typeof o?l.preloadAdditionalHeight=o:"object"==typeof p&&p.type===r.CONTAINER_HEIGHT_SCALE_FACTOR?l.preloadAdditionalHeight=l.containerHeight*p.amount:l.preloadAdditionalHeight=0,Object.assign(s,l)},generateComputedUtilityFunctions:function(e){var t=this,i={};return i.getLoadingSpinnerHeight=function(){var e=0;return t.loadingSpinner&&(e=t.loadingSpinner.offsetHeight||0),e},e.useWindowAsScrollContainer?(i.subscribeToScrollListener=function(){window.addEventListener("scroll",t.infiniteHandleScroll)},i.unsubscribeFromScrollListener=function(){window.removeEventListener("scroll",t.infiniteHandleScroll)},i.nodeScrollListener=function(){},i.getScrollTop=function(){return window.pageYOffset},i.setScrollTop=function(e){window.scroll(window.pageXOffset,e)},i.scrollShouldBeIgnored=function(){return!1},i.buildScrollableStyle=function(){return{}}):(i.subscribeToScrollListener=function(){},i.unsubscribeFromScrollListener=function(){},i.nodeScrollListener=this.infiniteHandleScroll,i.getScrollTop=function(){return t.scrollable?t.scrollable.scrollTop:0},i.setScrollTop=function(e){t.scrollable&&(t.scrollable.scrollTop=e)},i.scrollShouldBeIgnored=function(e){return e.target!==t.scrollable},i.buildScrollableStyle=function(){return Object.assign({},{height:t.computedProps.containerHeight,overflowX:"hidden",overflowY:"scroll",WebkitOverflowScrolling:"touch"},t.computedProps.styles.scrollableStyle||{})}),i},recomputeInternalStateFromProps:function(e){c(e);var t=this.generateComputedProps(e),i=this.generateComputedUtilityFunctions(e),n={};return n.numberOfChildren=o.Children.count(t.children),n.infiniteComputer=s.createInfiniteComputer(t.elementHeight,t.children,t.displayBottomUpwards),void 0!==t.isInfiniteLoading&&(n.isInfiniteLoading=t.isInfiniteLoading),n.preloadBatchSize=t.preloadBatchSize,n.preloadAdditionalHeight=t.preloadAdditionalHeight,n=Object.assign(n,s.recomputeApertureStateFromOptionsAndScrollTop(n,i.getScrollTop())),{computedProps:t,utils:i,newState:n}},componentWillReceiveProps:function(e){var t=this.recomputeInternalStateFromProps(e);this.computedProps=t.computedProps,this.utils=t.utils,this.setState(t.newState)},componentWillUpdate:function(){this.props.displayBottomUpwards&&(this.preservedScrollState=this.utils.getScrollTop()-this.loadingSpinnerHeight)},componentDidUpdate:function(e,t){if(this.loadingSpinnerHeight=this.utils.getLoadingSpinnerHeight(),this.props.displayBottomUpwards){var i=this.getLowestPossibleScrollTop();this.shouldAttachToBottom&&this.utils.getScrollTop()this.state.infiniteComputer.getTotalScrollableHeight()-this.computedProps.containerHeight-this.computedProps.infiniteLoadBeginEdgeOffset},onInfiniteLoad:function(){this.setState({isInfiniteLoading:!0}),this.computedProps.onInfiniteLoad()},handleScroll:function(e){this.shouldAttachToBottom=this.computedProps.displayBottomUpwards&&e>=this.getLowestPossibleScrollTop(),this.manageScrollTimeouts();var t=s.recomputeApertureStateFromOptionsAndScrollTop(this.state,e);this.passedEdgeForInfiniteScroll(e)&&!this.state.isInfiniteLoading?(this.setState(Object.assign({},t)),this.onInfiniteLoad()):this.setState(t)},buildHeightStyle:function(e){return{width:"100%",height:Math.ceil(e)}},render:function(){var e,t=this;e=this.state.numberOfChildren>1?this.computedProps.children.slice(this.state.displayIndexStart,this.state.displayIndexEnd+1):this.computedProps.children;var i={};this.state.isScrolling&&(i.pointerEvents="none");var n=this.state.infiniteComputer.getTopSpacerHeight(this.state.displayIndexStart),r=this.state.infiniteComputer.getBottomSpacerHeight(this.state.displayIndexEnd);if(this.computedProps.displayBottomUpwards){var s=this.computedProps.containerHeight-this.state.infiniteComputer.getTotalScrollableHeight();s>0&&(n=s-this.loadingSpinnerHeight)}var l=void 0===this.computedProps.infiniteLoadBeginEdgeOffset?null:o.createElement("div",{ref:function(e){t.loadingSpinner=e}},this.state.isInfiniteLoading?this.computedProps.loadingSpinnerDelegate:null);return o.createElement("div",{className:this.computedProps.className,ref:function(e){t.scrollable=e},style:this.utils.buildScrollableStyle(),onScroll:this.utils.nodeScrollListener},o.createElement("div",{ref:function(e){t.topSpsmoothScrollingWrapperacer=e},style:i},o.createElement("div",{ref:function(e){t.topSpacer=e},style:this.buildHeightStyle(n)}),this.computedProps.displayBottomUpwards&&l,e,!this.computedProps.displayBottomUpwards&&l,o.createElement("div",{ref:function(e){t.bottomSpacer=e},style:this.buildHeightStyle(r)})))}});t.exports=u,i.Infinite=u}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./utils/checkProps":9,"./utils/establish-polyfills":10,"./utils/infiniteHelpers":11,"./utils/scaleEnum":12,"./utils/types":13,"lodash.isfinite":3,react:void 0,"react-dom":void 0}],2:[function(e,t,i){function n(e){return!!e&&"object"==typeof e}function o(e,t){var i=null==e?void 0:e[t];return a(i)?i:void 0}function r(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=S}function s(e){return l(e)&&g.call(e)==u}function l(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function a(e){return null!=e&&(s(e)?y.test(d.call(e)):n(e)&&p.test(e))}var c="[object Array]",u="[object Function]",p=/^\[object .+?Constructor\]$/,f=Object.prototype,d=Function.prototype.toString,h=f.hasOwnProperty,g=f.toString,y=RegExp("^"+d.call(h).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),m=o(Array,"isArray"),S=9007199254740991,b=m||function(e){return n(e)&&r(e.length)&&g.call(e)==c};t.exports=b},{}],3:[function(e,t,i){(function(e){function i(e){return"number"==typeof e&&n(e)}var n=e.isFinite;t.exports=i}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],4:[function(e,t,i){"use strict";function n(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}var o=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;t.exports=Object.assign||function(e,t){for(var i,s,l=n(e),a=1;a0?t-1:t}},{key:"getTopSpacerHeight",value:function(e){return e*this.heightData}},{key:"getBottomSpacerHeight",value:function(e){var t=e+1;return Math.max(0,(this.numberOfChildren-t)*this.heightData)}}]),t}(l);t.exports=a},{"./infiniteComputer.js":7}],7:[function(e,t,i){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o=function(){function e(e,t){for(var i=0;it&&(l=r-1)}return i===n.CLOSEST_LOWER&&a>0?o=a-1:i===n.CLOSEST_HIGHER&&l=0||Object.prototype.hasOwnProperty.call(e,n)&&(i[n]=e[n]);return i}var o=i.React||e("react");e("./utils/establish-polyfills");var r=e("./utils/scaleEnum"),s=e("./utils/infiniteHelpers"),l=e("lodash.isfinite"),a=e("./utils/types").preloadType,c=c=e("./utils/checkProps"),u=o.createClass({displayName:"Infinite",propTypes:{children:o.PropTypes.any,handleScroll:o.PropTypes.func,preloadBatchSize:a,preloadAdditionalHeight:a,elementHeight:o.PropTypes.oneOfType([o.PropTypes.number,o.PropTypes.arrayOf(o.PropTypes.number)]).isRequired,containerHeight:o.PropTypes.number,useWindowAsScrollContainer:o.PropTypes.bool,displayBottomUpwards:o.PropTypes.bool.isRequired,infiniteLoadBeginEdgeOffset:o.PropTypes.number,onInfiniteLoad:o.PropTypes.func,loadingSpinnerDelegate:o.PropTypes.node,isInfiniteLoading:o.PropTypes.bool,timeScrollStateLastsForAfterUserScrolls:o.PropTypes.number,className:o.PropTypes.string,styles:o.PropTypes.shape({scrollableStyle:o.PropTypes.object}).isRequired},statics:{containerHeightScaleFactor:function(e){if(!l(e))throw new Error("The scale factor must be a number.");return{type:r.CONTAINER_HEIGHT_SCALE_FACTOR,amount:e}}},computedProps:{},utils:{},shouldAttachToBottom:!1,preservedScrollState:0,loadingSpinnerHeight:0,deprecationWarned:!1,getDefaultProps:function(){return{handleScroll:function(){},useWindowAsScrollContainer:!1,onInfiniteLoad:function(){},loadingSpinnerDelegate:o.createElement("div",null),displayBottomUpwards:!1,isInfiniteLoading:!1,timeScrollStateLastsForAfterUserScrolls:150,className:"",styles:{}}},getInitialState:function(){var e=this.recomputeInternalStateFromProps(this.props);this.computedProps=e.computedProps,this.utils=e.utils,this.shouldAttachToBottom=this.props.displayBottomUpwards;var t=e.newState;return t.scrollTimeout=void 0,t.isScrolling=!1,t},generateComputedProps:function(e){var t=e.containerHeight,i=e.preloadBatchSize,o=e.preloadAdditionalHeight,s=n(e,["containerHeight","preloadBatchSize","preloadAdditionalHeight"]),l={};t="number"==typeof t?t:0,l.containerHeight=e.useWindowAsScrollContainer?window.innerHeight:t,void 0!==s.infiniteLoadBeginBottomOffset&&(l.infiniteLoadBeginEdgeOffset=s.infiniteLoadBeginBottomOffset,this.deprecationWarned||(console.error("Warning: React Infinite's infiniteLoadBeginBottomOffset prop\n has been deprecated as of 0.6.0. Please use infiniteLoadBeginEdgeOffset.\n Because this is a rather descriptive name, a simple find and replace\n should suffice."),this.deprecationWarned=!0));var a={type:r.CONTAINER_HEIGHT_SCALE_FACTOR,amount:.5},c=i&&i.type?i:a;"number"==typeof i?l.preloadBatchSize=i:"object"==typeof c&&c.type===r.CONTAINER_HEIGHT_SCALE_FACTOR?l.preloadBatchSize=l.containerHeight*c.amount:l.preloadBatchSize=0;var u={type:r.CONTAINER_HEIGHT_SCALE_FACTOR,amount:1},p=o&&o.type?o:u;return"number"==typeof o?l.preloadAdditionalHeight=o:"object"==typeof p&&p.type===r.CONTAINER_HEIGHT_SCALE_FACTOR?l.preloadAdditionalHeight=l.containerHeight*p.amount:l.preloadAdditionalHeight=0,Object.assign(s,l)},generateComputedUtilityFunctions:function(e){var t=this,i={};return i.getLoadingSpinnerHeight=function(){var e=0;return t.loadingSpinner&&(e=t.loadingSpinner.offsetHeight||0),e},e.useWindowAsScrollContainer?(i.subscribeToScrollListener=function(){window.addEventListener("scroll",t.infiniteHandleScroll)},i.unsubscribeFromScrollListener=function(){window.removeEventListener("scroll",t.infiniteHandleScroll)},i.nodeScrollListener=function(){},i.getScrollTop=function(){return window.pageYOffset},i.setScrollTop=function(e){window.scroll(window.pageXOffset,e)},i.scrollShouldBeIgnored=function(){return!1},i.buildScrollableStyle=function(){return{}}):(i.subscribeToScrollListener=function(){},i.unsubscribeFromScrollListener=function(){},i.nodeScrollListener=this.infiniteHandleScroll,i.getScrollTop=function(){return t.scrollable?t.scrollable.scrollTop:0},i.setScrollTop=function(e){t.scrollable&&(t.scrollable.scrollTop=e)},i.scrollShouldBeIgnored=function(e){return e.target!==t.scrollable},i.buildScrollableStyle=function(){return Object.assign({},{height:t.computedProps.containerHeight,overflowX:"hidden",overflowY:"scroll",WebkitOverflowScrolling:"touch"},t.computedProps.styles.scrollableStyle||{})}),i},recomputeInternalStateFromProps:function(e){c(e);var t=this.generateComputedProps(e),i=this.generateComputedUtilityFunctions(e),n={};return n.numberOfChildren=o.Children.count(t.children),n.infiniteComputer=s.createInfiniteComputer(t.elementHeight,t.children,t.displayBottomUpwards),void 0!==t.isInfiniteLoading&&(n.isInfiniteLoading=t.isInfiniteLoading),n.preloadBatchSize=t.preloadBatchSize,n.preloadAdditionalHeight=t.preloadAdditionalHeight,n=Object.assign(n,s.recomputeApertureStateFromOptionsAndScrollTop(n,i.getScrollTop())),{computedProps:t,utils:i,newState:n}},componentWillReceiveProps:function(e){var t=this.recomputeInternalStateFromProps(e);this.computedProps=t.computedProps,this.utils=t.utils,this.setState(t.newState)},componentWillUpdate:function(){this.props.displayBottomUpwards&&(this.preservedScrollState=this.utils.getScrollTop()-this.loadingSpinnerHeight)},componentDidUpdate:function(e,t){if(this.loadingSpinnerHeight=this.utils.getLoadingSpinnerHeight(),this.props.displayBottomUpwards){var i=this.getLowestPossibleScrollTop();this.shouldAttachToBottom&&this.utils.getScrollTop()this.state.infiniteComputer.getTotalScrollableHeight()-this.computedProps.containerHeight-this.computedProps.infiniteLoadBeginEdgeOffset},onInfiniteLoad:function(){this.setState({isInfiniteLoading:!0}),this.computedProps.onInfiniteLoad()},handleScroll:function(e){this.shouldAttachToBottom=this.computedProps.displayBottomUpwards&&e>=this.getLowestPossibleScrollTop(),this.manageScrollTimeouts();var t=s.recomputeApertureStateFromOptionsAndScrollTop(this.state,e);this.passedEdgeForInfiniteScroll(e)&&!this.state.isInfiniteLoading?(this.setState(Object.assign({},t)),this.onInfiniteLoad()):this.setState(t)},buildHeightStyle:function(e){return{width:"100%",height:Math.ceil(e)}},render:function(){var e,t=this;e=this.state.numberOfChildren>1?this.computedProps.children.slice(this.state.displayIndexStart,this.state.displayIndexEnd+1):this.computedProps.children;var i={};this.state.isScrolling&&(i.pointerEvents="none");var n=this.state.infiniteComputer.getTopSpacerHeight(this.state.displayIndexStart),r=this.state.infiniteComputer.getBottomSpacerHeight(this.state.displayIndexEnd);if(this.computedProps.displayBottomUpwards){var s=this.computedProps.containerHeight-this.state.infiniteComputer.getTotalScrollableHeight();s>0&&(n=s-this.loadingSpinnerHeight)}var l=void 0===this.computedProps.infiniteLoadBeginEdgeOffset?null:o.createElement("div",{ref:function(e){t.loadingSpinner=e}},this.state.isInfiniteLoading?this.computedProps.loadingSpinnerDelegate:null);return o.createElement("div",{className:this.computedProps.className,ref:function(e){t.scrollable=e},style:this.utils.buildScrollableStyle(),onScroll:this.utils.nodeScrollListener},o.createElement("div",{ref:function(e){t.smoothScrollingWrapper=e},style:i},o.createElement("div",{ref:function(e){t.topSpacer=e},style:this.buildHeightStyle(n)}),this.computedProps.displayBottomUpwards&&l,e,!this.computedProps.displayBottomUpwards&&l,o.createElement("div",{ref:function(e){t.bottomSpacer=e},style:this.buildHeightStyle(r)})))}});t.exports=u,i.Infinite=u}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./utils/checkProps":9,"./utils/establish-polyfills":10,"./utils/infiniteHelpers":11,"./utils/scaleEnum":12,"./utils/types":13,"lodash.isfinite":3,react:void 0}],2:[function(e,t,i){function n(e){return!!e&&"object"==typeof e}function o(e,t){var i=null==e?void 0:e[t];return a(i)?i:void 0}function r(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=S}function s(e){return l(e)&&g.call(e)==u}function l(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function a(e){return null!=e&&(s(e)?y.test(d.call(e)):n(e)&&p.test(e))}var c="[object Array]",u="[object Function]",p=/^\[object .+?Constructor\]$/,f=Object.prototype,d=Function.prototype.toString,h=f.hasOwnProperty,g=f.toString,y=RegExp("^"+d.call(h).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),m=o(Array,"isArray"),S=9007199254740991,b=m||function(e){return n(e)&&r(e.length)&&g.call(e)==c};t.exports=b},{}],3:[function(e,t,i){(function(e){function i(e){return"number"==typeof e&&n(e)}var n=e.isFinite;t.exports=i}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],4:[function(e,t,i){"use strict";function n(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}var o=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;t.exports=Object.assign||function(e,t){for(var i,s,l=n(e),a=1;a0?t-1:t}},{key:"getTopSpacerHeight",value:function(e){return e*this.heightData}},{key:"getBottomSpacerHeight",value:function(e){var t=e+1;return Math.max(0,(this.numberOfChildren-t)*this.heightData)}}]),t}(l);t.exports=a},{"./infiniteComputer.js":7}],7:[function(e,t,i){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o=function(){function e(e,t){for(var i=0;it&&(l=r-1)}return i===n.CLOSEST_LOWER&&a>0?o=a-1:i===n.CLOSEST_HIGHER&&l Date: Tue, 4 Oct 2016 13:26:16 -0400 Subject: [PATCH 05/78] Upgrade Jest and fix tests. --- __tests__/bottom_upwards_infinite_test.js | 46 ++++++++------------- __tests__/infinite_styles_test.js | 9 ++-- __tests__/infinite_test.js | 50 +++++++++++------------ package.json | 2 +- 4 files changed, 48 insertions(+), 59 deletions(-) diff --git a/__tests__/bottom_upwards_infinite_test.js b/__tests__/bottom_upwards_infinite_test.js index e47cd07..74c10e6 100644 --- a/__tests__/bottom_upwards_infinite_test.js +++ b/__tests__/bottom_upwards_infinite_test.js @@ -40,17 +40,14 @@ describe('The Basic Behavior of the Bottom Upwards Display', function() { shallowRenderer.render(infinite); var rootNode = shallowRenderer.getRenderOutput(); - expect(rootNode.props.children.props.children[0]).toEqual( -
- ); + expect(rootNode.props.children.props.children[0].props.style).toEqual({ + width: '100%', + height: 700 + }); }); // jsdom cannot do offsetheight - //it('takes the loading spinner height into account when rendering the space-filling top spacer div', function() { + // it('takes the loading spinner height into account when rendering the space-filling top spacer div', function() { // var infinite = } @@ -78,13 +75,10 @@ describe('The Basic Behavior of the Bottom Upwards Display', function() { shallowRenderer.render(infinite); var rootNode = shallowRenderer.getRenderOutput(); - expect(rootNode.props.children.props.children[0]).toEqual( -
- ); + expect(rootNode.props.children.props.children[0].props.style).toEqual({ + width: '100%', + height: 0 + }); }); it('renders a space-filling top spacer div when the total element height is less than the container height when using the window as the container', function() { @@ -97,13 +91,10 @@ describe('The Basic Behavior of the Bottom Upwards Display', function() { shallowRenderer.render(infinite); var rootNode = shallowRenderer.getRenderOutput(); - expect(rootNode.props.children.props.children[0]).toEqual( -
- ); + expect(rootNode.props.children.props.children[0].props.style).toEqual({ + width: '100%', + height: 700 + }); }); it('does not render a space-filling top spacer div when the total element height begins to exceed the container height when using the window as the container', function() { @@ -117,13 +108,10 @@ describe('The Basic Behavior of the Bottom Upwards Display', function() { shallowRenderer.render(infinite); var rootNode = shallowRenderer.getRenderOutput(); - expect(rootNode.props.children.props.children[0]).toEqual( -
- ); + expect(rootNode.props.children.props.children[0].props.style).toEqual({ + width: '100%', + height: 0 + }); }); }); diff --git a/__tests__/infinite_styles_test.js b/__tests__/infinite_styles_test.js index d201f2e..34ef11b 100644 --- a/__tests__/infinite_styles_test.js +++ b/__tests__/infinite_styles_test.js @@ -21,8 +21,8 @@ var TestUtils = require('react-addons-test-utils'); var Infinite = require('../src/react-infinite.jsx'); -describe("Infinite Styles Override: can override styles on the scrollable container", function() { - it("will be able to override styles on the scrollable container", function() { +describe('Infinite Styles Override: can override styles on the scrollable container', function() { + it('will be able to override styles on the scrollable container', function() { var rootNode = TestUtils.renderIntoDocument( ); - expect(rootNode.refs.scrollable.getAttribute('style')).toEqual('height: 800px; overflow-x: hidden; overflow-y: hidden;') + var styles = rootNode.scrollable._style._values; + expect(styles.height).toEqual('800px'); + expect(styles['overflow-x']).toEqual('hidden'); + expect(styles['overflow-y']).toEqual('hidden'); }); }); diff --git a/__tests__/infinite_test.js b/__tests__/infinite_test.js index 6ef15da..7f9405c 100644 --- a/__tests__/infinite_test.js +++ b/__tests__/infinite_test.js @@ -94,8 +94,8 @@ describe('The Children of the React Infinite Component', function() { ); - expect(rootNode.refs.topSpacer._style.height).toEqual('0px'); - expect(rootNode.refs.bottomSpacer._style.height).toEqual('0px'); + expect(rootNode.topSpacer._style._values.height).toEqual('0px'); + expect(rootNode.bottomSpacer._style._values.height).toEqual('0px'); expect(TestUtils.findRenderedDOMComponentWithClass(rootNode, 'test-div-0')).not.toBeUndefined(); expect(TestUtils.findRenderedDOMComponentWithClass(rootNode, 'test-div-1')).not.toBeUndefined(); @@ -111,8 +111,8 @@ describe('The Children of the React Infinite Component', function() { ); - expect(rootNode.refs.topSpacer._style.height).toEqual('0px'); - expect(rootNode.refs.bottomSpacer._style.height).toEqual('800px'); + expect(rootNode.topSpacer._style._values.height).toEqual('0px'); + expect(rootNode.bottomSpacer._style._values.height).toEqual('800px'); // Why are six nodes rendered? Since we have not scrolled at // all, the extent that React Infinite will render is @@ -133,8 +133,6 @@ describe('The Children of the React Infinite Component', function() { TestUtils.findRenderedDOMComponentWithClass(rootNode, 'test-div-' + i); }).toThrow(); } - - }); it('renders more children when preloadAdditionalHeight is increased beyond its default', function() { @@ -148,8 +146,8 @@ describe('The Children of the React Infinite Component', function() { ); - expect(rootNode.refs.topSpacer._style.height).toEqual('0px'); - expect(rootNode.refs.bottomSpacer._style.height).toEqual('600px'); + expect(rootNode.topSpacer._style._values.height).toEqual('0px'); + expect(rootNode.bottomSpacer._style._values.height).toEqual('600px'); // Why are seven nodes rendered? Since we have not scrolled at // all, the extent that React Infinite will render is @@ -184,8 +182,8 @@ describe('The Children of the React Infinite Component', function() { ); - expect(rootNode.refs.topSpacer._style.height).toEqual('0px'); - expect(rootNode.refs.bottomSpacer._style.height).toEqual('400px'); + expect(rootNode.topSpacer._style._values.height).toEqual('0px'); + expect(rootNode.bottomSpacer._style._values.height).toEqual('400px'); // Why are eight nodes rendered? Since we have not scrolled at // all, the extent that React Infinite will render is @@ -235,8 +233,8 @@ describe('The Scrolling Behavior of the Constant Height React Infinite Component // 1600 pixels: blockEnd, end of block that scrollTop of 1500 pixels is in // 2400 pixels: windowBottom, end of first displayed element // 4000 pixels: end of bottomSpacer element - expect(rootNode.refs.topSpacer._style.height).toEqual('400px'); - expect(rootNode.refs.bottomSpacer._style.height).toEqual('1600px'); + expect(rootNode.topSpacer._style._values.height).toEqual('400px'); + expect(rootNode.bottomSpacer._style._values.height).toEqual('1600px'); // Above the batch and its preloadAdditionalHeight for (var i = 0; i < 2; i++) { @@ -277,8 +275,8 @@ describe('The Scrolling Behavior of the Constant Height React Infinite Component target: rootDomNode }); - expect(rootNode.refs.topSpacer._style.height).toEqual('2800px'); - expect(rootNode.refs.bottomSpacer._style.height).toEqual('0px'); + expect(rootNode.topSpacer._style._values.height).toEqual('2800px'); + expect(rootNode.bottomSpacer._style._values.height).toEqual('0px'); // Above the batch and its preloadAdditionalHeight for (var i = 0; i < 14; i++) { @@ -313,8 +311,8 @@ describe('The Behavior of the Variable Height React Infinite Component', functio // 420 pixels: end of container // 630 pixels: end of windowBottom // 1400 pixels: end of bottomSpacer element - expect(rootNode.refs.topSpacer._style.height).toEqual('0px'); - expect(rootNode.refs.bottomSpacer._style.height).toEqual('675px'); + expect(rootNode.topSpacer._style._values.height).toEqual('0px'); + expect(rootNode.bottomSpacer._style._values.height).toEqual('675px'); // Within the batch and its preloadAdditionalHeight, top and bottom for (var i = 1; i < 11; i++) { @@ -356,8 +354,8 @@ describe('The Behavior of the Variable Height React Infinite Component', functio // 1200 pixels: windowBottom, end of displayed element // 1400 pixels: end of bottomSpacer element - expect(rootNode.refs.topSpacer._style.height).toEqual('40px'); - expect(rootNode.refs.bottomSpacer._style.height).toEqual('100px'); + expect(rootNode.topSpacer._style._values.height).toEqual('40px'); + expect(rootNode.bottomSpacer._style._values.height).toEqual('100px'); // Above the batch and its preloadAdditionalHeight expect(function() { TestUtils.findRenderedDOMComponentWithClass(rootNode, 'test-div-0') }).toThrow(); @@ -407,8 +405,8 @@ describe('The Behavior of the Variable Height React Infinite Component', functio // 1000 pixels: start of block // 1400 pixels: end of block // 1400 pixels: end of windowBottom - expect(rootNode.refs.topSpacer._style.height).toEqual('575px'); - expect(rootNode.refs.bottomSpacer._style.height).toEqual('0px'); + expect(rootNode.topSpacer._style._values.height).toEqual('575px'); + expect(rootNode.bottomSpacer._style._values.height).toEqual('0px'); // Above the batch and its preloadAdditionalHeight for (var i = 0; i < 9; i++) { @@ -535,8 +533,8 @@ describe("Maintaining React Infinite's internal scroll state", function() { {renderHelpers.divGenerator(20, elementHeight)} ); - var wrapper = rootNode.refs.smoothScrollingWrapper; - expect(wrapper._style.pointerEvents).toEqual(''); + var wrapper = rootNode.smoothScrollingWrapper; + expect(wrapper._style._values['pointer-events']).toBeUndefined(); }); it('has pointer-events: none upon scroll', function() { @@ -557,8 +555,8 @@ describe("Maintaining React Infinite's internal scroll state", function() { target: rootDomNode }); - var wrapper = rootNode.refs.smoothScrollingWrapper; - expect(wrapper._style.pointerEvents).toEqual('none'); + var wrapper = rootNode.smoothScrollingWrapper; + expect(wrapper._style._values['pointer-events']).toEqual('none'); }); }); @@ -647,8 +645,8 @@ describe('React Infinite when the window is used as the Container', function() { {renderHelpers.divGenerator(20, elementHeight)} ); - var scrollable = rootNode.refs.scrollable; - expect(scrollable.getAttribute('style')).toEqual(''); + var scrollable = rootNode.scrollable; + expect(scrollable._style._values).toEqual({}); }); diff --git a/package.json b/package.json index ef24da1..fa13a6c 100644 --- a/package.json +++ b/package.json @@ -70,7 +70,7 @@ "gulp-sourcemaps": "^1.2.4", "gulp-uglify": "^1.0.1", "gulp-webserver": "^0.9.1", - "jest-cli": "0.4.19", + "jest-cli": "0.8.2", "moment": "^2.10.6", "react-addons-test-utils": "^15.0.0", "uglifyify": "3.0.1", From d80be7d8ce212b23bc99c4da8899e1fbf1623c41 Mon Sep 17 00:00:00 2001 From: Gareth Tan Date: Tue, 4 Oct 2016 13:26:58 -0400 Subject: [PATCH 06/78] Upgrade Node. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 171bcfc..ce1989c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ sudo: false language: node_js node_js: - - 0.10 + - 6 env: - TEST=1 - TYPECHECK=1 From 4647d7c896039a0906c490ff0af6f256eeff691f Mon Sep 17 00:00:00 2001 From: Gareth Tan Date: Tue, 4 Oct 2016 13:34:56 -0400 Subject: [PATCH 07/78] Exit if a test fails. --- config/travis/test.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/config/travis/test.sh b/config/travis/test.sh index 393930e..995a0f2 100755 --- a/config/travis/test.sh +++ b/config/travis/test.sh @@ -1,6 +1,9 @@ #!/bin/bash +set -e + if [ "$TEST" = 1 ]; then + npm install react react-dom npm run test fi; From 795f80d2054b122eee1e16febb62931b493f9605 Mon Sep 17 00:00:00 2001 From: Gareth Tan Date: Tue, 4 Oct 2016 13:42:48 -0400 Subject: [PATCH 08/78] Upgrade flow and fix typechecking. --- .flowconfig | 1 + package.json | 4 ++-- src/react-infinite.jsx | 6 ++++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.flowconfig b/.flowconfig index a13bd66..65d8b62 100644 --- a/.flowconfig +++ b/.flowconfig @@ -3,6 +3,7 @@ .*/build/.* .*/dist/.* .*/y18n/.* +.*json [include] diff --git a/package.json b/package.json index fa13a6c..3f9e479 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "test": "node ./node_modules/.bin/jest", "lint": "./node_modules/.bin/eslint ./src --ext .jsx --ext .js", "fix": "./node_modules/.bin/eslint --fix --ext .jsx --ext .js ./src ./__tests__ ./pipeline", - "typecheck": "./node_modules/.bin/flow check", + "typecheck": "./node_modules/.bin/flow version && ./node_modules/.bin/flow check", "verify": "npm test && npm run typecheck && npm run lint", "preversion": "npm run verify", "prepublish": "gulp release" @@ -62,7 +62,7 @@ "eslint-config-standard": "^4.1.0", "eslint-plugin-react": "^3.2.3", "eslint-plugin-standard": "^1.2.0", - "flow-bin": "0.22.0", + "flow-bin": "0.33.0", "gulp": "^3.8.8", "gulp-babel": "^5.2.1", "gulp-concat": "^2.4.3", diff --git a/src/react-infinite.jsx b/src/react-infinite.jsx index f98fbb2..7c3d403 100644 --- a/src/react-infinite.jsx +++ b/src/react-infinite.jsx @@ -76,6 +76,12 @@ var Infinite = React.createClass({ loadingSpinnerHeight: 0, deprecationWarned: false, + scrollable: null, + topSpacer: null, + bottomSpacer: null, + smoothScrollingWrapper: null, + loadingSpinner: null, + getDefaultProps(): ReactInfiniteProvidedDefaultProps { return { handleScroll: () => { From ca4c5c342cbc62388f2b7aa9e71b09ad0df39f4a Mon Sep 17 00:00:00 2001 From: Gareth Tan Date: Tue, 4 Oct 2016 13:52:20 -0400 Subject: [PATCH 09/78] New distribution files. --- dist/react-infinite.js | 2 +- dist/react-infinite.min.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/react-infinite.js b/dist/react-infinite.js index 6ea7329..1ca67fd 100644 --- a/dist/react-infinite.js +++ b/dist/react-infinite.js @@ -1,6 +1,6 @@ (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Infinite = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o=0||Object.prototype.hasOwnProperty.call(e,o)&&(i[o]=e[o]);return i}var React=global.React||require("react");require("./utils/establish-polyfills");var scaleEnum=require("./utils/scaleEnum"),infiniteHelpers=require("./utils/infiniteHelpers"),_isFinite=require("lodash.isfinite"),preloadType=require("./utils/types").preloadType,checkProps=checkProps=require("./utils/checkProps"),Infinite=React.createClass({displayName:"Infinite",propTypes:{children:React.PropTypes.any,handleScroll:React.PropTypes.func,preloadBatchSize:preloadType,preloadAdditionalHeight:preloadType,elementHeight:React.PropTypes.oneOfType([React.PropTypes.number,React.PropTypes.arrayOf(React.PropTypes.number)]).isRequired,containerHeight:React.PropTypes.number,useWindowAsScrollContainer:React.PropTypes.bool,displayBottomUpwards:React.PropTypes.bool.isRequired,infiniteLoadBeginEdgeOffset:React.PropTypes.number,onInfiniteLoad:React.PropTypes.func,loadingSpinnerDelegate:React.PropTypes.node,isInfiniteLoading:React.PropTypes.bool,timeScrollStateLastsForAfterUserScrolls:React.PropTypes.number,className:React.PropTypes.string,styles:React.PropTypes.shape({scrollableStyle:React.PropTypes.object}).isRequired},statics:{containerHeightScaleFactor:function(e){if(!_isFinite(e))throw new Error("The scale factor must be a number.");return{type:scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR,amount:e}}},computedProps:{},utils:{},shouldAttachToBottom:!1,preservedScrollState:0,loadingSpinnerHeight:0,deprecationWarned:!1,getDefaultProps:function(){return{handleScroll:function(){},useWindowAsScrollContainer:!1,onInfiniteLoad:function(){},loadingSpinnerDelegate:React.createElement("div",null),displayBottomUpwards:!1,isInfiniteLoading:!1,timeScrollStateLastsForAfterUserScrolls:150,className:"",styles:{}}},getInitialState:function(){var e=this.recomputeInternalStateFromProps(this.props);this.computedProps=e.computedProps,this.utils=e.utils,this.shouldAttachToBottom=this.props.displayBottomUpwards;var t=e.newState;return t.scrollTimeout=void 0,t.isScrolling=!1,t},generateComputedProps:function(e){var t=e.containerHeight,i=e.preloadBatchSize,o=e.preloadAdditionalHeight,n=_objectWithoutProperties(e,["containerHeight","preloadBatchSize","preloadAdditionalHeight"]),s={};t="number"==typeof t?t:0,s.containerHeight=e.useWindowAsScrollContainer?window.innerHeight:t,void 0!==n.infiniteLoadBeginBottomOffset&&(s.infiniteLoadBeginEdgeOffset=n.infiniteLoadBeginBottomOffset,this.deprecationWarned||(console.error("Warning: React Infinite's infiniteLoadBeginBottomOffset prop\n has been deprecated as of 0.6.0. Please use infiniteLoadBeginEdgeOffset.\n Because this is a rather descriptive name, a simple find and replace\n should suffice."),this.deprecationWarned=!0));var r={type:scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR,amount:.5},l=i&&i.type?i:r;"number"==typeof i?s.preloadBatchSize=i:"object"==typeof l&&l.type===scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR?s.preloadBatchSize=s.containerHeight*l.amount:s.preloadBatchSize=0;var a={type:scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR,amount:1},c=o&&o.type?o:a;return"number"==typeof o?s.preloadAdditionalHeight=o:"object"==typeof c&&c.type===scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR?s.preloadAdditionalHeight=s.containerHeight*c.amount:s.preloadAdditionalHeight=0,Object.assign(n,s)},generateComputedUtilityFunctions:function(e){var t=this,i={};return i.getLoadingSpinnerHeight=function(){var e=0;return t.loadingSpinner&&(e=t.loadingSpinner.offsetHeight||0),e},e.useWindowAsScrollContainer?(i.subscribeToScrollListener=function(){window.addEventListener("scroll",t.infiniteHandleScroll)},i.unsubscribeFromScrollListener=function(){window.removeEventListener("scroll",t.infiniteHandleScroll)},i.nodeScrollListener=function(){},i.getScrollTop=function(){return window.pageYOffset},i.setScrollTop=function(e){window.scroll(window.pageXOffset,e)},i.scrollShouldBeIgnored=function(){return!1},i.buildScrollableStyle=function(){return{}}):(i.subscribeToScrollListener=function(){},i.unsubscribeFromScrollListener=function(){},i.nodeScrollListener=this.infiniteHandleScroll,i.getScrollTop=function(){return t.scrollable?t.scrollable.scrollTop:0},i.setScrollTop=function(e){t.scrollable&&(t.scrollable.scrollTop=e)},i.scrollShouldBeIgnored=function(e){return e.target!==t.scrollable},i.buildScrollableStyle=function(){return Object.assign({},{height:t.computedProps.containerHeight,overflowX:"hidden",overflowY:"scroll",WebkitOverflowScrolling:"touch"},t.computedProps.styles.scrollableStyle||{})}),i},recomputeInternalStateFromProps:function(e){checkProps(e);var t=this.generateComputedProps(e),i=this.generateComputedUtilityFunctions(e),o={};return o.numberOfChildren=React.Children.count(t.children),o.infiniteComputer=infiniteHelpers.createInfiniteComputer(t.elementHeight,t.children,t.displayBottomUpwards),void 0!==t.isInfiniteLoading&&(o.isInfiniteLoading=t.isInfiniteLoading),o.preloadBatchSize=t.preloadBatchSize,o.preloadAdditionalHeight=t.preloadAdditionalHeight,o=Object.assign(o,infiniteHelpers.recomputeApertureStateFromOptionsAndScrollTop(o,i.getScrollTop())),{computedProps:t,utils:i,newState:o}},componentWillReceiveProps:function(e){var t=this.recomputeInternalStateFromProps(e);this.computedProps=t.computedProps,this.utils=t.utils,this.setState(t.newState)},componentWillUpdate:function(){this.props.displayBottomUpwards&&(this.preservedScrollState=this.utils.getScrollTop()-this.loadingSpinnerHeight)},componentDidUpdate:function(e,t){if(this.loadingSpinnerHeight=this.utils.getLoadingSpinnerHeight(),this.props.displayBottomUpwards){var i=this.getLowestPossibleScrollTop();this.shouldAttachToBottom&&this.utils.getScrollTop()this.state.infiniteComputer.getTotalScrollableHeight()-this.computedProps.containerHeight-this.computedProps.infiniteLoadBeginEdgeOffset},onInfiniteLoad:function(){this.setState({isInfiniteLoading:!0}),this.computedProps.onInfiniteLoad()},handleScroll:function(e){this.shouldAttachToBottom=this.computedProps.displayBottomUpwards&&e>=this.getLowestPossibleScrollTop(),this.manageScrollTimeouts();var t=infiniteHelpers.recomputeApertureStateFromOptionsAndScrollTop(this.state,e);this.passedEdgeForInfiniteScroll(e)&&!this.state.isInfiniteLoading?(this.setState(Object.assign({},t)),this.onInfiniteLoad()):this.setState(t)},buildHeightStyle:function(e){return{width:"100%",height:Math.ceil(e)}},render:function(){var e,t=this;e=this.state.numberOfChildren>1?this.computedProps.children.slice(this.state.displayIndexStart,this.state.displayIndexEnd+1):this.computedProps.children;var i={};this.state.isScrolling&&(i.pointerEvents="none");var o=this.state.infiniteComputer.getTopSpacerHeight(this.state.displayIndexStart),n=this.state.infiniteComputer.getBottomSpacerHeight(this.state.displayIndexEnd);if(this.computedProps.displayBottomUpwards){var s=this.computedProps.containerHeight-this.state.infiniteComputer.getTotalScrollableHeight();s>0&&(o=s-this.loadingSpinnerHeight)}var r=void 0===this.computedProps.infiniteLoadBeginEdgeOffset?null:React.createElement("div",{ref:function(e){t.loadingSpinner=e}},this.state.isInfiniteLoading?this.computedProps.loadingSpinnerDelegate:null);return React.createElement("div",{className:this.computedProps.className,ref:function(e){t.scrollable=e},style:this.utils.buildScrollableStyle(),onScroll:this.utils.nodeScrollListener},React.createElement("div",{ref:function(e){t.smoothScrollingWrapper=e},style:i},React.createElement("div",{ref:function(e){t.topSpacer=e},style:this.buildHeightStyle(o)}),this.computedProps.displayBottomUpwards&&r,e,!this.computedProps.displayBottomUpwards&&r,React.createElement("div",{ref:function(e){t.bottomSpacer=e},style:this.buildHeightStyle(n)})))}});module.exports=Infinite,global.Infinite=Infinite; +"use strict";function _objectWithoutProperties(e,t){var i={};for(var o in e)t.indexOf(o)>=0||Object.prototype.hasOwnProperty.call(e,o)&&(i[o]=e[o]);return i}var React=global.React||require("react");require("./utils/establish-polyfills");var scaleEnum=require("./utils/scaleEnum"),infiniteHelpers=require("./utils/infiniteHelpers"),_isFinite=require("lodash.isfinite"),preloadType=require("./utils/types").preloadType,checkProps=checkProps=require("./utils/checkProps"),Infinite=React.createClass({displayName:"Infinite",propTypes:{children:React.PropTypes.any,handleScroll:React.PropTypes.func,preloadBatchSize:preloadType,preloadAdditionalHeight:preloadType,elementHeight:React.PropTypes.oneOfType([React.PropTypes.number,React.PropTypes.arrayOf(React.PropTypes.number)]).isRequired,containerHeight:React.PropTypes.number,useWindowAsScrollContainer:React.PropTypes.bool,displayBottomUpwards:React.PropTypes.bool.isRequired,infiniteLoadBeginEdgeOffset:React.PropTypes.number,onInfiniteLoad:React.PropTypes.func,loadingSpinnerDelegate:React.PropTypes.node,isInfiniteLoading:React.PropTypes.bool,timeScrollStateLastsForAfterUserScrolls:React.PropTypes.number,className:React.PropTypes.string,styles:React.PropTypes.shape({scrollableStyle:React.PropTypes.object}).isRequired},statics:{containerHeightScaleFactor:function(e){if(!_isFinite(e))throw new Error("The scale factor must be a number.");return{type:scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR,amount:e}}},computedProps:{},utils:{},shouldAttachToBottom:!1,preservedScrollState:0,loadingSpinnerHeight:0,deprecationWarned:!1,scrollable:null,topSpacer:null,bottomSpacer:null,smoothScrollingWrapper:null,loadingSpinner:null,getDefaultProps:function(){return{handleScroll:function(){},useWindowAsScrollContainer:!1,onInfiniteLoad:function(){},loadingSpinnerDelegate:React.createElement("div",null),displayBottomUpwards:!1,isInfiniteLoading:!1,timeScrollStateLastsForAfterUserScrolls:150,className:"",styles:{}}},getInitialState:function(){var e=this.recomputeInternalStateFromProps(this.props);this.computedProps=e.computedProps,this.utils=e.utils,this.shouldAttachToBottom=this.props.displayBottomUpwards;var t=e.newState;return t.scrollTimeout=void 0,t.isScrolling=!1,t},generateComputedProps:function(e){var t=e.containerHeight,i=e.preloadBatchSize,o=e.preloadAdditionalHeight,n=_objectWithoutProperties(e,["containerHeight","preloadBatchSize","preloadAdditionalHeight"]),r={};t="number"==typeof t?t:0,r.containerHeight=e.useWindowAsScrollContainer?window.innerHeight:t,void 0!==n.infiniteLoadBeginBottomOffset&&(r.infiniteLoadBeginEdgeOffset=n.infiniteLoadBeginBottomOffset,this.deprecationWarned||(console.error("Warning: React Infinite's infiniteLoadBeginBottomOffset prop\n has been deprecated as of 0.6.0. Please use infiniteLoadBeginEdgeOffset.\n Because this is a rather descriptive name, a simple find and replace\n should suffice."),this.deprecationWarned=!0));var s={type:scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR,amount:.5},l=i&&i.type?i:s;"number"==typeof i?r.preloadBatchSize=i:"object"==typeof l&&l.type===scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR?r.preloadBatchSize=r.containerHeight*l.amount:r.preloadBatchSize=0;var a={type:scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR,amount:1},c=o&&o.type?o:a;return"number"==typeof o?r.preloadAdditionalHeight=o:"object"==typeof c&&c.type===scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR?r.preloadAdditionalHeight=r.containerHeight*c.amount:r.preloadAdditionalHeight=0,Object.assign(n,r)},generateComputedUtilityFunctions:function(e){var t=this,i={};return i.getLoadingSpinnerHeight=function(){var e=0;return t.loadingSpinner&&(e=t.loadingSpinner.offsetHeight||0),e},e.useWindowAsScrollContainer?(i.subscribeToScrollListener=function(){window.addEventListener("scroll",t.infiniteHandleScroll)},i.unsubscribeFromScrollListener=function(){window.removeEventListener("scroll",t.infiniteHandleScroll)},i.nodeScrollListener=function(){},i.getScrollTop=function(){return window.pageYOffset},i.setScrollTop=function(e){window.scroll(window.pageXOffset,e)},i.scrollShouldBeIgnored=function(){return!1},i.buildScrollableStyle=function(){return{}}):(i.subscribeToScrollListener=function(){},i.unsubscribeFromScrollListener=function(){},i.nodeScrollListener=this.infiniteHandleScroll,i.getScrollTop=function(){return t.scrollable?t.scrollable.scrollTop:0},i.setScrollTop=function(e){t.scrollable&&(t.scrollable.scrollTop=e)},i.scrollShouldBeIgnored=function(e){return e.target!==t.scrollable},i.buildScrollableStyle=function(){return Object.assign({},{height:t.computedProps.containerHeight,overflowX:"hidden",overflowY:"scroll",WebkitOverflowScrolling:"touch"},t.computedProps.styles.scrollableStyle||{})}),i},recomputeInternalStateFromProps:function(e){checkProps(e);var t=this.generateComputedProps(e),i=this.generateComputedUtilityFunctions(e),o={};return o.numberOfChildren=React.Children.count(t.children),o.infiniteComputer=infiniteHelpers.createInfiniteComputer(t.elementHeight,t.children,t.displayBottomUpwards),void 0!==t.isInfiniteLoading&&(o.isInfiniteLoading=t.isInfiniteLoading),o.preloadBatchSize=t.preloadBatchSize,o.preloadAdditionalHeight=t.preloadAdditionalHeight,o=Object.assign(o,infiniteHelpers.recomputeApertureStateFromOptionsAndScrollTop(o,i.getScrollTop())),{computedProps:t,utils:i,newState:o}},componentWillReceiveProps:function(e){var t=this.recomputeInternalStateFromProps(e);this.computedProps=t.computedProps,this.utils=t.utils,this.setState(t.newState)},componentWillUpdate:function(){this.props.displayBottomUpwards&&(this.preservedScrollState=this.utils.getScrollTop()-this.loadingSpinnerHeight)},componentDidUpdate:function(e,t){if(this.loadingSpinnerHeight=this.utils.getLoadingSpinnerHeight(),this.props.displayBottomUpwards){var i=this.getLowestPossibleScrollTop();this.shouldAttachToBottom&&this.utils.getScrollTop()this.state.infiniteComputer.getTotalScrollableHeight()-this.computedProps.containerHeight-this.computedProps.infiniteLoadBeginEdgeOffset},onInfiniteLoad:function(){this.setState({isInfiniteLoading:!0}),this.computedProps.onInfiniteLoad()},handleScroll:function(e){this.shouldAttachToBottom=this.computedProps.displayBottomUpwards&&e>=this.getLowestPossibleScrollTop(),this.manageScrollTimeouts();var t=infiniteHelpers.recomputeApertureStateFromOptionsAndScrollTop(this.state,e);this.passedEdgeForInfiniteScroll(e)&&!this.state.isInfiniteLoading?(this.setState(Object.assign({},t)),this.onInfiniteLoad()):this.setState(t)},buildHeightStyle:function(e){return{width:"100%",height:Math.ceil(e)}},render:function(){var e,t=this;e=this.state.numberOfChildren>1?this.computedProps.children.slice(this.state.displayIndexStart,this.state.displayIndexEnd+1):this.computedProps.children;var i={};this.state.isScrolling&&(i.pointerEvents="none");var o=this.state.infiniteComputer.getTopSpacerHeight(this.state.displayIndexStart),n=this.state.infiniteComputer.getBottomSpacerHeight(this.state.displayIndexEnd);if(this.computedProps.displayBottomUpwards){var r=this.computedProps.containerHeight-this.state.infiniteComputer.getTotalScrollableHeight();r>0&&(o=r-this.loadingSpinnerHeight)}var s=void 0===this.computedProps.infiniteLoadBeginEdgeOffset?null:React.createElement("div",{ref:function(e){t.loadingSpinner=e}},this.state.isInfiniteLoading?this.computedProps.loadingSpinnerDelegate:null);return React.createElement("div",{className:this.computedProps.className,ref:function(e){t.scrollable=e},style:this.utils.buildScrollableStyle(),onScroll:this.utils.nodeScrollListener},React.createElement("div",{ref:function(e){t.smoothScrollingWrapper=e},style:i},React.createElement("div",{ref:function(e){t.topSpacer=e},style:this.buildHeightStyle(o)}),this.computedProps.displayBottomUpwards&&s,e,!this.computedProps.displayBottomUpwards&&s,React.createElement("div",{ref:function(e){t.bottomSpacer=e},style:this.buildHeightStyle(n)})))}});module.exports=Infinite,global.Infinite=Infinite; }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) diff --git a/dist/react-infinite.min.js b/dist/react-infinite.min.js index c47998d..7b6ae7e 100644 --- a/dist/react-infinite.min.js +++ b/dist/react-infinite.min.js @@ -1 +1 @@ -!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.Infinite=e()}}(function(){return function e(t,i,n){function o(s,l){if(!i[s]){if(!t[s]){var a="function"==typeof require&&require;if(!l&&a)return a(s,!0);if(r)return r(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var u=i[s]={exports:{}};t[s][0].call(u.exports,function(e){var i=t[s][1][e];return o(i?i:e)},u,u.exports,e,t,i,n)}return i[s].exports}for(var r="function"==typeof require&&require,s=0;s=0||Object.prototype.hasOwnProperty.call(e,n)&&(i[n]=e[n]);return i}var o=i.React||e("react");e("./utils/establish-polyfills");var r=e("./utils/scaleEnum"),s=e("./utils/infiniteHelpers"),l=e("lodash.isfinite"),a=e("./utils/types").preloadType,c=c=e("./utils/checkProps"),u=o.createClass({displayName:"Infinite",propTypes:{children:o.PropTypes.any,handleScroll:o.PropTypes.func,preloadBatchSize:a,preloadAdditionalHeight:a,elementHeight:o.PropTypes.oneOfType([o.PropTypes.number,o.PropTypes.arrayOf(o.PropTypes.number)]).isRequired,containerHeight:o.PropTypes.number,useWindowAsScrollContainer:o.PropTypes.bool,displayBottomUpwards:o.PropTypes.bool.isRequired,infiniteLoadBeginEdgeOffset:o.PropTypes.number,onInfiniteLoad:o.PropTypes.func,loadingSpinnerDelegate:o.PropTypes.node,isInfiniteLoading:o.PropTypes.bool,timeScrollStateLastsForAfterUserScrolls:o.PropTypes.number,className:o.PropTypes.string,styles:o.PropTypes.shape({scrollableStyle:o.PropTypes.object}).isRequired},statics:{containerHeightScaleFactor:function(e){if(!l(e))throw new Error("The scale factor must be a number.");return{type:r.CONTAINER_HEIGHT_SCALE_FACTOR,amount:e}}},computedProps:{},utils:{},shouldAttachToBottom:!1,preservedScrollState:0,loadingSpinnerHeight:0,deprecationWarned:!1,getDefaultProps:function(){return{handleScroll:function(){},useWindowAsScrollContainer:!1,onInfiniteLoad:function(){},loadingSpinnerDelegate:o.createElement("div",null),displayBottomUpwards:!1,isInfiniteLoading:!1,timeScrollStateLastsForAfterUserScrolls:150,className:"",styles:{}}},getInitialState:function(){var e=this.recomputeInternalStateFromProps(this.props);this.computedProps=e.computedProps,this.utils=e.utils,this.shouldAttachToBottom=this.props.displayBottomUpwards;var t=e.newState;return t.scrollTimeout=void 0,t.isScrolling=!1,t},generateComputedProps:function(e){var t=e.containerHeight,i=e.preloadBatchSize,o=e.preloadAdditionalHeight,s=n(e,["containerHeight","preloadBatchSize","preloadAdditionalHeight"]),l={};t="number"==typeof t?t:0,l.containerHeight=e.useWindowAsScrollContainer?window.innerHeight:t,void 0!==s.infiniteLoadBeginBottomOffset&&(l.infiniteLoadBeginEdgeOffset=s.infiniteLoadBeginBottomOffset,this.deprecationWarned||(console.error("Warning: React Infinite's infiniteLoadBeginBottomOffset prop\n has been deprecated as of 0.6.0. Please use infiniteLoadBeginEdgeOffset.\n Because this is a rather descriptive name, a simple find and replace\n should suffice."),this.deprecationWarned=!0));var a={type:r.CONTAINER_HEIGHT_SCALE_FACTOR,amount:.5},c=i&&i.type?i:a;"number"==typeof i?l.preloadBatchSize=i:"object"==typeof c&&c.type===r.CONTAINER_HEIGHT_SCALE_FACTOR?l.preloadBatchSize=l.containerHeight*c.amount:l.preloadBatchSize=0;var u={type:r.CONTAINER_HEIGHT_SCALE_FACTOR,amount:1},p=o&&o.type?o:u;return"number"==typeof o?l.preloadAdditionalHeight=o:"object"==typeof p&&p.type===r.CONTAINER_HEIGHT_SCALE_FACTOR?l.preloadAdditionalHeight=l.containerHeight*p.amount:l.preloadAdditionalHeight=0,Object.assign(s,l)},generateComputedUtilityFunctions:function(e){var t=this,i={};return i.getLoadingSpinnerHeight=function(){var e=0;return t.loadingSpinner&&(e=t.loadingSpinner.offsetHeight||0),e},e.useWindowAsScrollContainer?(i.subscribeToScrollListener=function(){window.addEventListener("scroll",t.infiniteHandleScroll)},i.unsubscribeFromScrollListener=function(){window.removeEventListener("scroll",t.infiniteHandleScroll)},i.nodeScrollListener=function(){},i.getScrollTop=function(){return window.pageYOffset},i.setScrollTop=function(e){window.scroll(window.pageXOffset,e)},i.scrollShouldBeIgnored=function(){return!1},i.buildScrollableStyle=function(){return{}}):(i.subscribeToScrollListener=function(){},i.unsubscribeFromScrollListener=function(){},i.nodeScrollListener=this.infiniteHandleScroll,i.getScrollTop=function(){return t.scrollable?t.scrollable.scrollTop:0},i.setScrollTop=function(e){t.scrollable&&(t.scrollable.scrollTop=e)},i.scrollShouldBeIgnored=function(e){return e.target!==t.scrollable},i.buildScrollableStyle=function(){return Object.assign({},{height:t.computedProps.containerHeight,overflowX:"hidden",overflowY:"scroll",WebkitOverflowScrolling:"touch"},t.computedProps.styles.scrollableStyle||{})}),i},recomputeInternalStateFromProps:function(e){c(e);var t=this.generateComputedProps(e),i=this.generateComputedUtilityFunctions(e),n={};return n.numberOfChildren=o.Children.count(t.children),n.infiniteComputer=s.createInfiniteComputer(t.elementHeight,t.children,t.displayBottomUpwards),void 0!==t.isInfiniteLoading&&(n.isInfiniteLoading=t.isInfiniteLoading),n.preloadBatchSize=t.preloadBatchSize,n.preloadAdditionalHeight=t.preloadAdditionalHeight,n=Object.assign(n,s.recomputeApertureStateFromOptionsAndScrollTop(n,i.getScrollTop())),{computedProps:t,utils:i,newState:n}},componentWillReceiveProps:function(e){var t=this.recomputeInternalStateFromProps(e);this.computedProps=t.computedProps,this.utils=t.utils,this.setState(t.newState)},componentWillUpdate:function(){this.props.displayBottomUpwards&&(this.preservedScrollState=this.utils.getScrollTop()-this.loadingSpinnerHeight)},componentDidUpdate:function(e,t){if(this.loadingSpinnerHeight=this.utils.getLoadingSpinnerHeight(),this.props.displayBottomUpwards){var i=this.getLowestPossibleScrollTop();this.shouldAttachToBottom&&this.utils.getScrollTop()this.state.infiniteComputer.getTotalScrollableHeight()-this.computedProps.containerHeight-this.computedProps.infiniteLoadBeginEdgeOffset},onInfiniteLoad:function(){this.setState({isInfiniteLoading:!0}),this.computedProps.onInfiniteLoad()},handleScroll:function(e){this.shouldAttachToBottom=this.computedProps.displayBottomUpwards&&e>=this.getLowestPossibleScrollTop(),this.manageScrollTimeouts();var t=s.recomputeApertureStateFromOptionsAndScrollTop(this.state,e);this.passedEdgeForInfiniteScroll(e)&&!this.state.isInfiniteLoading?(this.setState(Object.assign({},t)),this.onInfiniteLoad()):this.setState(t)},buildHeightStyle:function(e){return{width:"100%",height:Math.ceil(e)}},render:function(){var e,t=this;e=this.state.numberOfChildren>1?this.computedProps.children.slice(this.state.displayIndexStart,this.state.displayIndexEnd+1):this.computedProps.children;var i={};this.state.isScrolling&&(i.pointerEvents="none");var n=this.state.infiniteComputer.getTopSpacerHeight(this.state.displayIndexStart),r=this.state.infiniteComputer.getBottomSpacerHeight(this.state.displayIndexEnd);if(this.computedProps.displayBottomUpwards){var s=this.computedProps.containerHeight-this.state.infiniteComputer.getTotalScrollableHeight();s>0&&(n=s-this.loadingSpinnerHeight)}var l=void 0===this.computedProps.infiniteLoadBeginEdgeOffset?null:o.createElement("div",{ref:function(e){t.loadingSpinner=e}},this.state.isInfiniteLoading?this.computedProps.loadingSpinnerDelegate:null);return o.createElement("div",{className:this.computedProps.className,ref:function(e){t.scrollable=e},style:this.utils.buildScrollableStyle(),onScroll:this.utils.nodeScrollListener},o.createElement("div",{ref:function(e){t.smoothScrollingWrapper=e},style:i},o.createElement("div",{ref:function(e){t.topSpacer=e},style:this.buildHeightStyle(n)}),this.computedProps.displayBottomUpwards&&l,e,!this.computedProps.displayBottomUpwards&&l,o.createElement("div",{ref:function(e){t.bottomSpacer=e},style:this.buildHeightStyle(r)})))}});t.exports=u,i.Infinite=u}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./utils/checkProps":9,"./utils/establish-polyfills":10,"./utils/infiniteHelpers":11,"./utils/scaleEnum":12,"./utils/types":13,"lodash.isfinite":3,react:void 0}],2:[function(e,t,i){function n(e){return!!e&&"object"==typeof e}function o(e,t){var i=null==e?void 0:e[t];return a(i)?i:void 0}function r(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=S}function s(e){return l(e)&&g.call(e)==u}function l(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function a(e){return null!=e&&(s(e)?y.test(d.call(e)):n(e)&&p.test(e))}var c="[object Array]",u="[object Function]",p=/^\[object .+?Constructor\]$/,f=Object.prototype,d=Function.prototype.toString,h=f.hasOwnProperty,g=f.toString,y=RegExp("^"+d.call(h).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),m=o(Array,"isArray"),S=9007199254740991,b=m||function(e){return n(e)&&r(e.length)&&g.call(e)==c};t.exports=b},{}],3:[function(e,t,i){(function(e){function i(e){return"number"==typeof e&&n(e)}var n=e.isFinite;t.exports=i}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],4:[function(e,t,i){"use strict";function n(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}var o=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;t.exports=Object.assign||function(e,t){for(var i,s,l=n(e),a=1;a0?t-1:t}},{key:"getTopSpacerHeight",value:function(e){return e*this.heightData}},{key:"getBottomSpacerHeight",value:function(e){var t=e+1;return Math.max(0,(this.numberOfChildren-t)*this.heightData)}}]),t}(l);t.exports=a},{"./infiniteComputer.js":7}],7:[function(e,t,i){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o=function(){function e(e,t){for(var i=0;it&&(l=r-1)}return i===n.CLOSEST_LOWER&&a>0?o=a-1:i===n.CLOSEST_HIGHER&&l=0||Object.prototype.hasOwnProperty.call(e,n)&&(i[n]=e[n]);return i}var o=i.React||e("react");e("./utils/establish-polyfills");var r=e("./utils/scaleEnum"),l=e("./utils/infiniteHelpers"),s=e("lodash.isfinite"),a=e("./utils/types").preloadType,c=c=e("./utils/checkProps"),u=o.createClass({displayName:"Infinite",propTypes:{children:o.PropTypes.any,handleScroll:o.PropTypes.func,preloadBatchSize:a,preloadAdditionalHeight:a,elementHeight:o.PropTypes.oneOfType([o.PropTypes.number,o.PropTypes.arrayOf(o.PropTypes.number)]).isRequired,containerHeight:o.PropTypes.number,useWindowAsScrollContainer:o.PropTypes.bool,displayBottomUpwards:o.PropTypes.bool.isRequired,infiniteLoadBeginEdgeOffset:o.PropTypes.number,onInfiniteLoad:o.PropTypes.func,loadingSpinnerDelegate:o.PropTypes.node,isInfiniteLoading:o.PropTypes.bool,timeScrollStateLastsForAfterUserScrolls:o.PropTypes.number,className:o.PropTypes.string,styles:o.PropTypes.shape({scrollableStyle:o.PropTypes.object}).isRequired},statics:{containerHeightScaleFactor:function(e){if(!s(e))throw new Error("The scale factor must be a number.");return{type:r.CONTAINER_HEIGHT_SCALE_FACTOR,amount:e}}},computedProps:{},utils:{},shouldAttachToBottom:!1,preservedScrollState:0,loadingSpinnerHeight:0,deprecationWarned:!1,scrollable:null,topSpacer:null,bottomSpacer:null,smoothScrollingWrapper:null,loadingSpinner:null,getDefaultProps:function(){return{handleScroll:function(){},useWindowAsScrollContainer:!1,onInfiniteLoad:function(){},loadingSpinnerDelegate:o.createElement("div",null),displayBottomUpwards:!1,isInfiniteLoading:!1,timeScrollStateLastsForAfterUserScrolls:150,className:"",styles:{}}},getInitialState:function(){var e=this.recomputeInternalStateFromProps(this.props);this.computedProps=e.computedProps,this.utils=e.utils,this.shouldAttachToBottom=this.props.displayBottomUpwards;var t=e.newState;return t.scrollTimeout=void 0,t.isScrolling=!1,t},generateComputedProps:function(e){var t=e.containerHeight,i=e.preloadBatchSize,o=e.preloadAdditionalHeight,l=n(e,["containerHeight","preloadBatchSize","preloadAdditionalHeight"]),s={};t="number"==typeof t?t:0,s.containerHeight=e.useWindowAsScrollContainer?window.innerHeight:t,void 0!==l.infiniteLoadBeginBottomOffset&&(s.infiniteLoadBeginEdgeOffset=l.infiniteLoadBeginBottomOffset,this.deprecationWarned||(console.error("Warning: React Infinite's infiniteLoadBeginBottomOffset prop\n has been deprecated as of 0.6.0. Please use infiniteLoadBeginEdgeOffset.\n Because this is a rather descriptive name, a simple find and replace\n should suffice."),this.deprecationWarned=!0));var a={type:r.CONTAINER_HEIGHT_SCALE_FACTOR,amount:.5},c=i&&i.type?i:a;"number"==typeof i?s.preloadBatchSize=i:"object"==typeof c&&c.type===r.CONTAINER_HEIGHT_SCALE_FACTOR?s.preloadBatchSize=s.containerHeight*c.amount:s.preloadBatchSize=0;var u={type:r.CONTAINER_HEIGHT_SCALE_FACTOR,amount:1},p=o&&o.type?o:u;return"number"==typeof o?s.preloadAdditionalHeight=o:"object"==typeof p&&p.type===r.CONTAINER_HEIGHT_SCALE_FACTOR?s.preloadAdditionalHeight=s.containerHeight*p.amount:s.preloadAdditionalHeight=0,Object.assign(l,s)},generateComputedUtilityFunctions:function(e){var t=this,i={};return i.getLoadingSpinnerHeight=function(){var e=0;return t.loadingSpinner&&(e=t.loadingSpinner.offsetHeight||0),e},e.useWindowAsScrollContainer?(i.subscribeToScrollListener=function(){window.addEventListener("scroll",t.infiniteHandleScroll)},i.unsubscribeFromScrollListener=function(){window.removeEventListener("scroll",t.infiniteHandleScroll)},i.nodeScrollListener=function(){},i.getScrollTop=function(){return window.pageYOffset},i.setScrollTop=function(e){window.scroll(window.pageXOffset,e)},i.scrollShouldBeIgnored=function(){return!1},i.buildScrollableStyle=function(){return{}}):(i.subscribeToScrollListener=function(){},i.unsubscribeFromScrollListener=function(){},i.nodeScrollListener=this.infiniteHandleScroll,i.getScrollTop=function(){return t.scrollable?t.scrollable.scrollTop:0},i.setScrollTop=function(e){t.scrollable&&(t.scrollable.scrollTop=e)},i.scrollShouldBeIgnored=function(e){return e.target!==t.scrollable},i.buildScrollableStyle=function(){return Object.assign({},{height:t.computedProps.containerHeight,overflowX:"hidden",overflowY:"scroll",WebkitOverflowScrolling:"touch"},t.computedProps.styles.scrollableStyle||{})}),i},recomputeInternalStateFromProps:function(e){c(e);var t=this.generateComputedProps(e),i=this.generateComputedUtilityFunctions(e),n={};return n.numberOfChildren=o.Children.count(t.children),n.infiniteComputer=l.createInfiniteComputer(t.elementHeight,t.children,t.displayBottomUpwards),void 0!==t.isInfiniteLoading&&(n.isInfiniteLoading=t.isInfiniteLoading),n.preloadBatchSize=t.preloadBatchSize,n.preloadAdditionalHeight=t.preloadAdditionalHeight,n=Object.assign(n,l.recomputeApertureStateFromOptionsAndScrollTop(n,i.getScrollTop())),{computedProps:t,utils:i,newState:n}},componentWillReceiveProps:function(e){var t=this.recomputeInternalStateFromProps(e);this.computedProps=t.computedProps,this.utils=t.utils,this.setState(t.newState)},componentWillUpdate:function(){this.props.displayBottomUpwards&&(this.preservedScrollState=this.utils.getScrollTop()-this.loadingSpinnerHeight)},componentDidUpdate:function(e,t){if(this.loadingSpinnerHeight=this.utils.getLoadingSpinnerHeight(),this.props.displayBottomUpwards){var i=this.getLowestPossibleScrollTop();this.shouldAttachToBottom&&this.utils.getScrollTop()this.state.infiniteComputer.getTotalScrollableHeight()-this.computedProps.containerHeight-this.computedProps.infiniteLoadBeginEdgeOffset},onInfiniteLoad:function(){this.setState({isInfiniteLoading:!0}),this.computedProps.onInfiniteLoad()},handleScroll:function(e){this.shouldAttachToBottom=this.computedProps.displayBottomUpwards&&e>=this.getLowestPossibleScrollTop(),this.manageScrollTimeouts();var t=l.recomputeApertureStateFromOptionsAndScrollTop(this.state,e);this.passedEdgeForInfiniteScroll(e)&&!this.state.isInfiniteLoading?(this.setState(Object.assign({},t)),this.onInfiniteLoad()):this.setState(t)},buildHeightStyle:function(e){return{width:"100%",height:Math.ceil(e)}},render:function(){var e,t=this;e=this.state.numberOfChildren>1?this.computedProps.children.slice(this.state.displayIndexStart,this.state.displayIndexEnd+1):this.computedProps.children;var i={};this.state.isScrolling&&(i.pointerEvents="none");var n=this.state.infiniteComputer.getTopSpacerHeight(this.state.displayIndexStart),r=this.state.infiniteComputer.getBottomSpacerHeight(this.state.displayIndexEnd);if(this.computedProps.displayBottomUpwards){var l=this.computedProps.containerHeight-this.state.infiniteComputer.getTotalScrollableHeight();l>0&&(n=l-this.loadingSpinnerHeight)}var s=void 0===this.computedProps.infiniteLoadBeginEdgeOffset?null:o.createElement("div",{ref:function(e){t.loadingSpinner=e}},this.state.isInfiniteLoading?this.computedProps.loadingSpinnerDelegate:null);return o.createElement("div",{className:this.computedProps.className,ref:function(e){t.scrollable=e},style:this.utils.buildScrollableStyle(),onScroll:this.utils.nodeScrollListener},o.createElement("div",{ref:function(e){t.smoothScrollingWrapper=e},style:i},o.createElement("div",{ref:function(e){t.topSpacer=e},style:this.buildHeightStyle(n)}),this.computedProps.displayBottomUpwards&&s,e,!this.computedProps.displayBottomUpwards&&s,o.createElement("div",{ref:function(e){t.bottomSpacer=e},style:this.buildHeightStyle(r)})))}});t.exports=u,i.Infinite=u}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./utils/checkProps":9,"./utils/establish-polyfills":10,"./utils/infiniteHelpers":11,"./utils/scaleEnum":12,"./utils/types":13,"lodash.isfinite":3,react:void 0}],2:[function(e,t,i){function n(e){return!!e&&"object"==typeof e}function o(e,t){var i=null==e?void 0:e[t];return a(i)?i:void 0}function r(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=S}function l(e){return s(e)&&g.call(e)==u}function s(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function a(e){return null!=e&&(l(e)?y.test(d.call(e)):n(e)&&p.test(e))}var c="[object Array]",u="[object Function]",p=/^\[object .+?Constructor\]$/,f=Object.prototype,d=Function.prototype.toString,h=f.hasOwnProperty,g=f.toString,y=RegExp("^"+d.call(h).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),m=o(Array,"isArray"),S=9007199254740991,b=m||function(e){return n(e)&&r(e.length)&&g.call(e)==c};t.exports=b},{}],3:[function(e,t,i){(function(e){function i(e){return"number"==typeof e&&n(e)}var n=e.isFinite;t.exports=i}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],4:[function(e,t,i){"use strict";function n(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}var o=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;t.exports=Object.assign||function(e,t){for(var i,l,s=n(e),a=1;a0?t-1:t}},{key:"getTopSpacerHeight",value:function(e){return e*this.heightData}},{key:"getBottomSpacerHeight",value:function(e){var t=e+1;return Math.max(0,(this.numberOfChildren-t)*this.heightData)}}]),t}(s);t.exports=a},{"./infiniteComputer.js":7}],7:[function(e,t,i){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o=function(){function e(e,t){for(var i=0;it&&(s=r-1)}return i===n.CLOSEST_LOWER&&a>0?o=a-1:i===n.CLOSEST_HIGHER&&s Date: Tue, 4 Oct 2016 13:52:32 -0400 Subject: [PATCH 10/78] 0.10.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 3f9e479..86556a8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-infinite", - "version": "0.9.2", + "version": "0.10.0", "description": "A browser-ready efficient scrolling container based on UITableView", "main": "build/react-infinite.js", "repository": { From 5e42eae4b008f78cac6ff71f125d879dae3cec87 Mon Sep 17 00:00:00 2001 From: Dave Schumaker Date: Wed, 4 Jan 2017 16:16:35 -0800 Subject: [PATCH 11/78] Update year in LICENSE.txt to 2017 :) --- LICENSE.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE.txt b/LICENSE.txt index 09d7ac6..6bbccc1 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,4 +1,4 @@ -Copyright (c) 2014-2015, SeatGeek, Inc. +Copyright (c) 2014-2017, SeatGeek, Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: From 436d5d564f60d3d8d53676f5b5576188060dc1fd Mon Sep 17 00:00:00 2001 From: titipakorn Date: Fri, 17 Feb 2017 12:06:20 +0700 Subject: [PATCH 12/78] Fix window is not defined --- src/react-infinite.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/react-infinite.jsx b/src/react-infinite.jsx index 7c3d403..310086d 100644 --- a/src/react-infinite.jsx +++ b/src/react-infinite.jsx @@ -1,7 +1,7 @@ /* @flow */ var React = global.React || require('react'); - +if (typeof window == "undefined") global.window = {}; require('./utils/establish-polyfills'); var scaleEnum = require('./utils/scaleEnum'); var infiniteHelpers = require('./utils/infiniteHelpers'); From 56daa481ab35f6fc94c54c92094ad1c83808d2e8 Mon Sep 17 00:00:00 2001 From: titipakorn Date: Fri, 17 Feb 2017 12:14:40 +0700 Subject: [PATCH 13/78] Fix window is not defined --- src/react-infinite.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/react-infinite.jsx b/src/react-infinite.jsx index 310086d..138d4eb 100644 --- a/src/react-infinite.jsx +++ b/src/react-infinite.jsx @@ -1,7 +1,7 @@ /* @flow */ var React = global.React || require('react'); -if (typeof window == "undefined") global.window = {}; +if (typeof window === 'undefined') {global.window = {}}; require('./utils/establish-polyfills'); var scaleEnum = require('./utils/scaleEnum'); var infiniteHelpers = require('./utils/infiniteHelpers'); From 143192f0975a91b84f31d830003d912a093bb37c Mon Sep 17 00:00:00 2001 From: titipakorn Date: Fri, 17 Feb 2017 12:51:37 +0700 Subject: [PATCH 14/78] Fix window is not defined --- src/react-infinite.jsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/react-infinite.jsx b/src/react-infinite.jsx index 138d4eb..8445d05 100644 --- a/src/react-infinite.jsx +++ b/src/react-infinite.jsx @@ -1,7 +1,9 @@ /* @flow */ var React = global.React || require('react'); -if (typeof window === 'undefined') {global.window = {}}; +if (typeof window === 'undefined') { +global.window = {}; +} require('./utils/establish-polyfills'); var scaleEnum = require('./utils/scaleEnum'); var infiniteHelpers = require('./utils/infiniteHelpers'); From db71c2b9b92fff72866bb91c41825c4fd3577ca4 Mon Sep 17 00:00:00 2001 From: titipakorn Date: Fri, 17 Feb 2017 12:56:01 +0700 Subject: [PATCH 15/78] Fix window is not defined --- src/react-infinite.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/react-infinite.jsx b/src/react-infinite.jsx index 8445d05..7840c14 100644 --- a/src/react-infinite.jsx +++ b/src/react-infinite.jsx @@ -2,7 +2,7 @@ var React = global.React || require('react'); if (typeof window === 'undefined') { -global.window = {}; + global.window = {}; } require('./utils/establish-polyfills'); var scaleEnum = require('./utils/scaleEnum'); From f88e855c70743e8e34dea7802f75b4a329d657e4 Mon Sep 17 00:00:00 2001 From: titipakorn Date: Tue, 21 Feb 2017 16:12:28 +0700 Subject: [PATCH 16/78] update build --- .gitignore | 1 - build/computers/arrayInfiniteComputer.js | 77 ++++ build/computers/constantInfiniteComputer.js | 57 +++ build/computers/infiniteComputer.js | 74 ++++ build/react-infinite.js | 458 ++++++++++++++++++++ build/utils/binaryIndexSearch.js | 43 ++ build/utils/checkProps.js | 25 ++ build/utils/establish-polyfills.js | 16 + build/utils/infiniteHelpers.js | 46 ++ build/utils/scaleEnum.js | 5 + build/utils/types.js | 10 + dist/react-infinite.js | 4 +- dist/react-infinite.min.js | 2 +- 13 files changed, 813 insertions(+), 5 deletions(-) create mode 100644 build/computers/arrayInfiniteComputer.js create mode 100644 build/computers/constantInfiniteComputer.js create mode 100644 build/computers/infiniteComputer.js create mode 100644 build/react-infinite.js create mode 100644 build/utils/binaryIndexSearch.js create mode 100644 build/utils/checkProps.js create mode 100644 build/utils/establish-polyfills.js create mode 100644 build/utils/infiniteHelpers.js create mode 100644 build/utils/scaleEnum.js create mode 100644 build/utils/types.js diff --git a/.gitignore b/.gitignore index ecff5de..8b6c9ef 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ *.map -build coverage node_modules bower_components diff --git a/build/computers/arrayInfiniteComputer.js b/build/computers/arrayInfiniteComputer.js new file mode 100644 index 0000000..ab10ec8 --- /dev/null +++ b/build/computers/arrayInfiniteComputer.js @@ -0,0 +1,77 @@ +'use strict'; + +var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); + +var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } }; + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } + +function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var InfiniteComputer = require('./infiniteComputer.js'), + bs = require('../utils/binaryIndexSearch.js'); + +var ArrayInfiniteComputer = (function (_InfiniteComputer) { + _inherits(ArrayInfiniteComputer, _InfiniteComputer); + + function ArrayInfiniteComputer(heightData, numberOfChildren) { + _classCallCheck(this, ArrayInfiniteComputer); + + _get(Object.getPrototypeOf(ArrayInfiniteComputer.prototype), 'constructor', this).call(this, heightData, numberOfChildren); + this.prefixHeightData = this.heightData.reduce(function (acc, next) { + if (acc.length === 0) { + return [next]; + } else { + acc.push(acc[acc.length - 1] + next); + return acc; + } + }, []); + } + + _createClass(ArrayInfiniteComputer, [{ + key: 'maybeIndexToIndex', + value: function maybeIndexToIndex(index) { + if (typeof index === 'undefined' || index === null) { + return this.prefixHeightData.length - 1; + } else { + return index; + } + } + }, { + key: 'getTotalScrollableHeight', + value: function getTotalScrollableHeight() { + var length = this.prefixHeightData.length; + return length === 0 ? 0 : this.prefixHeightData[length - 1]; + } + }, { + key: 'getDisplayIndexStart', + value: function getDisplayIndexStart(windowTop) { + var foundIndex = bs.binaryIndexSearch(this.prefixHeightData, windowTop, bs.opts.CLOSEST_HIGHER); + return this.maybeIndexToIndex(foundIndex); + } + }, { + key: 'getDisplayIndexEnd', + value: function getDisplayIndexEnd(windowBottom) { + var foundIndex = bs.binaryIndexSearch(this.prefixHeightData, windowBottom, bs.opts.CLOSEST_HIGHER); + return this.maybeIndexToIndex(foundIndex); + } + }, { + key: 'getTopSpacerHeight', + value: function getTopSpacerHeight(displayIndexStart) { + var previous = displayIndexStart - 1; + return previous < 0 ? 0 : this.prefixHeightData[previous]; + } + }, { + key: 'getBottomSpacerHeight', + value: function getBottomSpacerHeight(displayIndexEnd) { + if (displayIndexEnd === -1) { + return 0; + } + return this.getTotalScrollableHeight() - this.prefixHeightData[displayIndexEnd]; + } + }]); + + return ArrayInfiniteComputer; +})(InfiniteComputer); + +module.exports = ArrayInfiniteComputer; \ No newline at end of file diff --git a/build/computers/constantInfiniteComputer.js b/build/computers/constantInfiniteComputer.js new file mode 100644 index 0000000..027f768 --- /dev/null +++ b/build/computers/constantInfiniteComputer.js @@ -0,0 +1,57 @@ +'use strict'; + +var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); + +var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } }; + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } + +function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var InfiniteComputer = require('./infiniteComputer.js'); + +var ConstantInfiniteComputer = (function (_InfiniteComputer) { + _inherits(ConstantInfiniteComputer, _InfiniteComputer); + + function ConstantInfiniteComputer() { + _classCallCheck(this, ConstantInfiniteComputer); + + _get(Object.getPrototypeOf(ConstantInfiniteComputer.prototype), 'constructor', this).apply(this, arguments); + } + + _createClass(ConstantInfiniteComputer, [{ + key: 'getTotalScrollableHeight', + value: function getTotalScrollableHeight() { + return this.heightData * this.numberOfChildren; + } + }, { + key: 'getDisplayIndexStart', + value: function getDisplayIndexStart(windowTop) { + return Math.floor(windowTop / this.heightData); + } + }, { + key: 'getDisplayIndexEnd', + value: function getDisplayIndexEnd(windowBottom) { + var nonZeroIndex = Math.ceil(windowBottom / this.heightData); + if (nonZeroIndex > 0) { + return nonZeroIndex - 1; + } + return nonZeroIndex; + } + }, { + key: 'getTopSpacerHeight', + value: function getTopSpacerHeight(displayIndexStart) { + return displayIndexStart * this.heightData; + } + }, { + key: 'getBottomSpacerHeight', + value: function getBottomSpacerHeight(displayIndexEnd) { + var nonZeroIndex = displayIndexEnd + 1; + return Math.max(0, (this.numberOfChildren - nonZeroIndex) * this.heightData); + } + }]); + + return ConstantInfiniteComputer; +})(InfiniteComputer); + +module.exports = ConstantInfiniteComputer; \ No newline at end of file diff --git a/build/computers/infiniteComputer.js b/build/computers/infiniteComputer.js new file mode 100644 index 0000000..9855731 --- /dev/null +++ b/build/computers/infiniteComputer.js @@ -0,0 +1,74 @@ +// An infinite computer must be able to do the following things: +// 1. getTotalScrollableHeight() +// 2. getDisplayIndexStart() +// 3. getDisplayIndexEnd() + +'use strict'; + +var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } + +var InfiniteComputer = (function () { + function InfiniteComputer(heightData, numberOfChildren) { + _classCallCheck(this, InfiniteComputer); + + this.heightData = heightData; + this.numberOfChildren = numberOfChildren; + } + + _createClass(InfiniteComputer, [{ + key: 'getTotalScrollableHeight', + value: function getTotalScrollableHeight() { + if (process.env.NODE_ENV === 'development') { + throw new Error('getTotalScrollableHeight not implemented.'); + } + } + + /* eslint-disable no-unused-vars */ + }, { + key: 'getDisplayIndexStart', + value: function getDisplayIndexStart(windowTop) { + /* eslint-enable no-unused-vars */ + if (process.env.NODE_ENV === 'development') { + throw new Error('getDisplayIndexStart not implemented.'); + } + } + + /* eslint-disable no-unused-vars */ + }, { + key: 'getDisplayIndexEnd', + value: function getDisplayIndexEnd(windowBottom) { + /* eslint-enable no-unused-vars */ + if (process.env.NODE_ENV === 'development') { + throw new Error('getDisplayIndexEnd not implemented.'); + } + } + + // These are helper methods, and can be calculated from + // the above details. + /* eslint-disable no-unused-vars */ + }, { + key: 'getTopSpacerHeight', + value: function getTopSpacerHeight(displayIndexStart) { + /* eslint-enable no-unused-vars */ + if (process.env.NODE_ENV === 'development') { + throw new Error('getTopSpacerHeight not implemented.'); + } + } + + /* eslint-disable no-unused-vars */ + }, { + key: 'getBottomSpacerHeight', + value: function getBottomSpacerHeight(displayIndexEnd) { + /* eslint-enable no-unused-vars */ + if (process.env.NODE_ENV === 'development') { + throw new Error('getBottomSpacerHeight not implemented.'); + } + } + }]); + + return InfiniteComputer; +})(); + +module.exports = InfiniteComputer; \ No newline at end of file diff --git a/build/react-infinite.js b/build/react-infinite.js new file mode 100644 index 0000000..295b895 --- /dev/null +++ b/build/react-infinite.js @@ -0,0 +1,458 @@ +'use strict'; + +function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } + +var React = global.React || require('react'); +if (typeof window === 'undefined') { + global.window = {}; +} +require('./utils/establish-polyfills'); +var scaleEnum = require('./utils/scaleEnum'); +var infiniteHelpers = require('./utils/infiniteHelpers'); +var _isFinite = require('lodash.isfinite'); + +var preloadType = require('./utils/types').preloadType; +var checkProps = checkProps = require('./utils/checkProps'); + +var Infinite = React.createClass({ + displayName: 'Infinite', + + propTypes: { + children: React.PropTypes.any, + + handleScroll: React.PropTypes.func, + + // preloadBatchSize causes updates only to + // happen each preloadBatchSize pixels of scrolling. + // Set a larger number to cause fewer updates to the + // element list. + preloadBatchSize: preloadType, + // preloadAdditionalHeight determines how much of the + // list above and below the container is preloaded even + // when it is not currently visible to the user. In the + // regular scroll implementation, preloadAdditionalHeight + // is equal to the entire height of the list. + preloadAdditionalHeight: preloadType, // page to screen ratio + + // The provided elementHeight can be either + // 1. a constant: all elements are the same height + // 2. an array containing the height of each element + elementHeight: React.PropTypes.oneOfType([React.PropTypes.number, React.PropTypes.arrayOf(React.PropTypes.number)]).isRequired, + // This is the total height of the visible window. One + // of + containerHeight: React.PropTypes.number, + useWindowAsScrollContainer: React.PropTypes.bool, + + displayBottomUpwards: React.PropTypes.bool.isRequired, + + infiniteLoadBeginEdgeOffset: React.PropTypes.number, + onInfiniteLoad: React.PropTypes.func, + loadingSpinnerDelegate: React.PropTypes.node, + + isInfiniteLoading: React.PropTypes.bool, + timeScrollStateLastsForAfterUserScrolls: React.PropTypes.number, + + className: React.PropTypes.string, + + styles: React.PropTypes.shape({ + scrollableStyle: React.PropTypes.object + }).isRequired + }, + statics: { + containerHeightScaleFactor: function containerHeightScaleFactor(factor) { + if (!_isFinite(factor)) { + throw new Error('The scale factor must be a number.'); + } + return { + type: scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR, + amount: factor + }; + } + }, + + // Properties currently used but which may be + // refactored away in the future. + computedProps: {}, + utils: {}, + shouldAttachToBottom: false, + preservedScrollState: 0, + loadingSpinnerHeight: 0, + deprecationWarned: false, + + scrollable: null, + topSpacer: null, + bottomSpacer: null, + smoothScrollingWrapper: null, + loadingSpinner: null, + + getDefaultProps: function getDefaultProps() { + return { + handleScroll: function handleScroll() {}, + + useWindowAsScrollContainer: false, + + onInfiniteLoad: function onInfiniteLoad() {}, + loadingSpinnerDelegate: React.createElement('div', null), + + displayBottomUpwards: false, + + isInfiniteLoading: false, + timeScrollStateLastsForAfterUserScrolls: 150, + + className: '', + + styles: {} + }; + }, + + // automatic adjust to scroll direction + // give spinner a ReactCSSTransitionGroup + getInitialState: function getInitialState() { + var nextInternalState = this.recomputeInternalStateFromProps(this.props); + + this.computedProps = nextInternalState.computedProps; + this.utils = nextInternalState.utils; + this.shouldAttachToBottom = this.props.displayBottomUpwards; + + var state = nextInternalState.newState; + state.scrollTimeout = undefined; + state.isScrolling = false; + + return state; + }, + + generateComputedProps: function generateComputedProps(props) { + // These are extracted so their type definitions do not conflict. + var containerHeight = props.containerHeight; + var preloadBatchSize = props.preloadBatchSize; + var preloadAdditionalHeight = props.preloadAdditionalHeight; + + var oldProps = _objectWithoutProperties(props, ['containerHeight', 'preloadBatchSize', 'preloadAdditionalHeight']); + + var newProps = {}; + containerHeight = typeof containerHeight === 'number' ? containerHeight : 0; + newProps.containerHeight = props.useWindowAsScrollContainer ? window.innerHeight : containerHeight; + + if (oldProps.infiniteLoadBeginBottomOffset !== undefined) { + newProps.infiniteLoadBeginEdgeOffset = oldProps.infiniteLoadBeginBottomOffset; + if (!this.deprecationWarned) { + console.error('Warning: React Infinite\'s infiniteLoadBeginBottomOffset prop\n has been deprecated as of 0.6.0. Please use infiniteLoadBeginEdgeOffset.\n Because this is a rather descriptive name, a simple find and replace\n should suffice.'); + this.deprecationWarned = true; + } + } + + var defaultPreloadBatchSizeScaling = { + type: scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR, + amount: 0.5 + }; + var batchSize = preloadBatchSize && preloadBatchSize.type ? preloadBatchSize : defaultPreloadBatchSizeScaling; + + if (typeof preloadBatchSize === 'number') { + newProps.preloadBatchSize = preloadBatchSize; + } else if (typeof batchSize === 'object' && batchSize.type === scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR) { + newProps.preloadBatchSize = newProps.containerHeight * batchSize.amount; + } else { + newProps.preloadBatchSize = 0; + } + + var defaultPreloadAdditionalHeightScaling = { + type: scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR, + amount: 1 + }; + var additionalHeight = preloadAdditionalHeight && preloadAdditionalHeight.type ? preloadAdditionalHeight : defaultPreloadAdditionalHeightScaling; + if (typeof preloadAdditionalHeight === 'number') { + newProps.preloadAdditionalHeight = preloadAdditionalHeight; + } else if (typeof additionalHeight === 'object' && additionalHeight.type === scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR) { + newProps.preloadAdditionalHeight = newProps.containerHeight * additionalHeight.amount; + } else { + newProps.preloadAdditionalHeight = 0; + } + + return Object.assign(oldProps, newProps); + }, + + generateComputedUtilityFunctions: function generateComputedUtilityFunctions(props) { + var _this = this; + + var utilities = {}; + utilities.getLoadingSpinnerHeight = function () { + var loadingSpinnerHeight = 0; + if (_this.loadingSpinner) { + loadingSpinnerHeight = _this.loadingSpinner.offsetHeight || 0; + } + return loadingSpinnerHeight; + }; + if (props.useWindowAsScrollContainer) { + utilities.subscribeToScrollListener = function () { + window.addEventListener('scroll', _this.infiniteHandleScroll); + }; + utilities.unsubscribeFromScrollListener = function () { + window.removeEventListener('scroll', _this.infiniteHandleScroll); + }; + utilities.nodeScrollListener = function () {}; + utilities.getScrollTop = function () { + return window.pageYOffset; + }; + utilities.setScrollTop = function (top) { + window.scroll(window.pageXOffset, top); + }; + utilities.scrollShouldBeIgnored = function () { + return false; + }; + utilities.buildScrollableStyle = function () { + return {}; + }; + } else { + utilities.subscribeToScrollListener = function () {}; + utilities.unsubscribeFromScrollListener = function () {}; + utilities.nodeScrollListener = this.infiniteHandleScroll; + utilities.getScrollTop = function () { + return _this.scrollable ? _this.scrollable.scrollTop : 0; + }; + + utilities.setScrollTop = function (top) { + if (_this.scrollable) { + _this.scrollable.scrollTop = top; + } + }; + utilities.scrollShouldBeIgnored = function (event) { + return event.target !== _this.scrollable; + }; + + utilities.buildScrollableStyle = function () { + return Object.assign({}, { + height: _this.computedProps.containerHeight, + overflowX: 'hidden', + overflowY: 'scroll', + WebkitOverflowScrolling: 'touch' + }, _this.computedProps.styles.scrollableStyle || {}); + }; + } + return utilities; + }, + + recomputeInternalStateFromProps: function recomputeInternalStateFromProps(props) { + checkProps(props); + var computedProps = this.generateComputedProps(props); + var utils = this.generateComputedUtilityFunctions(props); + + var newState = {}; + + newState.numberOfChildren = React.Children.count(computedProps.children); + newState.infiniteComputer = infiniteHelpers.createInfiniteComputer(computedProps.elementHeight, computedProps.children, computedProps.displayBottomUpwards); + + if (computedProps.isInfiniteLoading !== undefined) { + newState.isInfiniteLoading = computedProps.isInfiniteLoading; + } + + newState.preloadBatchSize = computedProps.preloadBatchSize; + newState.preloadAdditionalHeight = computedProps.preloadAdditionalHeight; + + newState = Object.assign(newState, infiniteHelpers.recomputeApertureStateFromOptionsAndScrollTop(newState, utils.getScrollTop())); + + return { + computedProps: computedProps, + utils: utils, + newState: newState + }; + }, + + componentWillReceiveProps: function componentWillReceiveProps(nextProps) { + var nextInternalState = this.recomputeInternalStateFromProps(nextProps); + + this.computedProps = nextInternalState.computedProps; + this.utils = nextInternalState.utils; + + this.setState(nextInternalState.newState); + }, + + componentWillUpdate: function componentWillUpdate() { + if (this.props.displayBottomUpwards) { + this.preservedScrollState = this.utils.getScrollTop() - this.loadingSpinnerHeight; + } + }, + + componentDidUpdate: function componentDidUpdate(prevProps, prevState) { + this.loadingSpinnerHeight = this.utils.getLoadingSpinnerHeight(); + + if (this.props.displayBottomUpwards) { + var lowestScrollTop = this.getLowestPossibleScrollTop(); + if (this.shouldAttachToBottom && this.utils.getScrollTop() < lowestScrollTop) { + this.utils.setScrollTop(lowestScrollTop); + } else if (prevProps.isInfiniteLoading && !this.props.isInfiniteLoading) { + this.utils.setScrollTop(this.state.infiniteComputer.getTotalScrollableHeight() - prevState.infiniteComputer.getTotalScrollableHeight() + this.preservedScrollState); + } + } + + var hasLoadedMoreChildren = this.state.numberOfChildren !== prevState.numberOfChildren; + if (hasLoadedMoreChildren) { + var newApertureState = infiniteHelpers.recomputeApertureStateFromOptionsAndScrollTop(this.state, this.utils.getScrollTop()); + this.setState(newApertureState); + } + + var isMissingVisibleRows = hasLoadedMoreChildren && !this.hasAllVisibleItems() && !this.state.isInfiniteLoading; + if (isMissingVisibleRows) { + this.onInfiniteLoad(); + } + }, + + componentDidMount: function componentDidMount() { + this.utils.subscribeToScrollListener(); + + if (!this.hasAllVisibleItems()) { + this.onInfiniteLoad(); + } + + if (this.props.displayBottomUpwards) { + var lowestScrollTop = this.getLowestPossibleScrollTop(); + if (this.shouldAttachToBottom && this.utils.getScrollTop() < lowestScrollTop) { + this.utils.setScrollTop(lowestScrollTop); + } + } + }, + + componentWillUnmount: function componentWillUnmount() { + this.utils.unsubscribeFromScrollListener(); + }, + + infiniteHandleScroll: function infiniteHandleScroll(e) { + if (this.utils.scrollShouldBeIgnored(e)) { + return; + } + this.computedProps.handleScroll(this.scrollable); + this.handleScroll(this.utils.getScrollTop()); + }, + + manageScrollTimeouts: function manageScrollTimeouts() { + // Maintains a series of timeouts to set this.state.isScrolling + // to be true when the element is scrolling. + + if (this.state.scrollTimeout) { + clearTimeout(this.state.scrollTimeout); + } + + var that = this, + scrollTimeout = setTimeout(function () { + that.setState({ + isScrolling: false, + scrollTimeout: undefined + }); + }, this.computedProps.timeScrollStateLastsForAfterUserScrolls); + + this.setState({ + isScrolling: true, + scrollTimeout: scrollTimeout + }); + }, + + getLowestPossibleScrollTop: function getLowestPossibleScrollTop() { + return this.state.infiniteComputer.getTotalScrollableHeight() - this.computedProps.containerHeight; + }, + + hasAllVisibleItems: function hasAllVisibleItems() { + return !(_isFinite(this.computedProps.infiniteLoadBeginEdgeOffset) && this.state.infiniteComputer.getTotalScrollableHeight() < this.computedProps.containerHeight); + }, + + passedEdgeForInfiniteScroll: function passedEdgeForInfiniteScroll(scrollTop) { + if (this.computedProps.displayBottomUpwards) { + return !this.shouldAttachToBottom && scrollTop < this.computedProps.infiniteLoadBeginEdgeOffset; + } else { + return scrollTop > this.state.infiniteComputer.getTotalScrollableHeight() - this.computedProps.containerHeight - this.computedProps.infiniteLoadBeginEdgeOffset; + } + }, + + onInfiniteLoad: function onInfiniteLoad() { + this.setState({ isInfiniteLoading: true }); + this.computedProps.onInfiniteLoad(); + }, + + handleScroll: function handleScroll(scrollTop) { + this.shouldAttachToBottom = this.computedProps.displayBottomUpwards && scrollTop >= this.getLowestPossibleScrollTop(); + + this.manageScrollTimeouts(); + + var newApertureState = infiniteHelpers.recomputeApertureStateFromOptionsAndScrollTop(this.state, scrollTop); + + if (this.passedEdgeForInfiniteScroll(scrollTop) && !this.state.isInfiniteLoading) { + this.setState(Object.assign({}, newApertureState)); + this.onInfiniteLoad(); + } else { + this.setState(newApertureState); + } + }, + + buildHeightStyle: function buildHeightStyle(height) { + return { + width: '100%', + height: Math.ceil(height) + }; + }, + + render: function render() { + var _this2 = this; + + var displayables; + if (this.state.numberOfChildren > 1) { + displayables = this.computedProps.children.slice(this.state.displayIndexStart, this.state.displayIndexEnd + 1); + } else { + displayables = this.computedProps.children; + } + + var infiniteScrollStyles = {}; + if (this.state.isScrolling) { + infiniteScrollStyles.pointerEvents = 'none'; + } + + var topSpacerHeight = this.state.infiniteComputer.getTopSpacerHeight(this.state.displayIndexStart), + bottomSpacerHeight = this.state.infiniteComputer.getBottomSpacerHeight(this.state.displayIndexEnd); + + // This asymmetry is due to a reluctance to use CSS to control + // the bottom alignment + if (this.computedProps.displayBottomUpwards) { + var heightDifference = this.computedProps.containerHeight - this.state.infiniteComputer.getTotalScrollableHeight(); + if (heightDifference > 0) { + topSpacerHeight = heightDifference - this.loadingSpinnerHeight; + } + } + + var loadingSpinner = this.computedProps.infiniteLoadBeginEdgeOffset === undefined ? null : React.createElement( + 'div', + { ref: function (c) { + _this2.loadingSpinner = c; + } }, + this.state.isInfiniteLoading ? this.computedProps.loadingSpinnerDelegate : null + ); + + // topSpacer and bottomSpacer take up the amount of space that the + // rendered elements would have taken up otherwise + return React.createElement( + 'div', + { className: this.computedProps.className, + ref: function (c) { + _this2.scrollable = c; + }, + style: this.utils.buildScrollableStyle(), + onScroll: this.utils.nodeScrollListener }, + React.createElement( + 'div', + { ref: function (c) { + _this2.smoothScrollingWrapper = c; + }, style: infiniteScrollStyles }, + React.createElement('div', { ref: function (c) { + _this2.topSpacer = c; + }, + style: this.buildHeightStyle(topSpacerHeight) }), + this.computedProps.displayBottomUpwards && loadingSpinner, + displayables, + !this.computedProps.displayBottomUpwards && loadingSpinner, + React.createElement('div', { ref: function (c) { + _this2.bottomSpacer = c; + }, + style: this.buildHeightStyle(bottomSpacerHeight) }) + ) + ); + } +}); + +module.exports = Infinite; +global.Infinite = Infinite; \ No newline at end of file diff --git a/build/utils/binaryIndexSearch.js b/build/utils/binaryIndexSearch.js new file mode 100644 index 0000000..a799ce3 --- /dev/null +++ b/build/utils/binaryIndexSearch.js @@ -0,0 +1,43 @@ +"use strict"; + +var opts = { + CLOSEST_LOWER: 1, + CLOSEST_HIGHER: 2 +}; + +var binaryIndexSearch = function binaryIndexSearch(array, /* : Array */ +item, /* : number */ +opt /* : number */) /* : ?number */{ + var index; + + var high = array.length - 1, + low = 0, + middle, + middleItem; + + while (low <= high) { + middle = low + Math.floor((high - low) / 2); + middleItem = array[middle]; + + if (middleItem === item) { + return middle; + } else if (middleItem < item) { + low = middle + 1; + } else if (middleItem > item) { + high = middle - 1; + } + } + + if (opt === opts.CLOSEST_LOWER && low > 0) { + index = low - 1; + } else if (opt === opts.CLOSEST_HIGHER && high < array.length - 1) { + index = high + 1; + } + + return index; +}; + +module.exports = { + binaryIndexSearch: binaryIndexSearch, + opts: opts +}; \ No newline at end of file diff --git a/build/utils/checkProps.js b/build/utils/checkProps.js new file mode 100644 index 0000000..1c74759 --- /dev/null +++ b/build/utils/checkProps.js @@ -0,0 +1,25 @@ +// This module provides a centralized place for +// runtime checking that the props passed to React Infinite +// make the minimum amount of sense. + +'use strict'; + +var React = global.React || require('react'); +var _isFinite = require('lodash.isfinite'); + +module.exports = function (props) { + var rie = 'Invariant Violation: '; + if (!(props.containerHeight || props.useWindowAsScrollContainer)) { + throw new Error(rie + 'Either containerHeight or useWindowAsScrollContainer must be provided.'); + } + + if (!(_isFinite(props.elementHeight) || Array.isArray(props.elementHeight))) { + throw new Error(rie + 'You must provide either a number or an array of numbers as the elementHeight.'); + } + + if (Array.isArray(props.elementHeight)) { + if (React.Children.count(props.children) !== props.elementHeight.length) { + throw new Error(rie + 'There must be as many values provided in the elementHeight prop as there are children.'); + } + } +}; \ No newline at end of file diff --git a/build/utils/establish-polyfills.js b/build/utils/establish-polyfills.js new file mode 100644 index 0000000..7fb950e --- /dev/null +++ b/build/utils/establish-polyfills.js @@ -0,0 +1,16 @@ +/* + A number of polyfills for native functions are consolidated + here. We do this instead of using the libraries directly + because Flow is designed to make its type refinements + with these native functions. + */ + +'use strict'; + +if (!Object.assign) { + Object.assign = require('object-assign'); +} + +if (!Array.isArray) { + Array.isArray = require('lodash.isarray'); +} \ No newline at end of file diff --git a/build/utils/infiniteHelpers.js b/build/utils/infiniteHelpers.js new file mode 100644 index 0000000..9ef7113 --- /dev/null +++ b/build/utils/infiniteHelpers.js @@ -0,0 +1,46 @@ +'use strict'; + +var ConstantInfiniteComputer = require('../computers/constantInfiniteComputer.js'); +var ArrayInfiniteComputer = require('../computers/arrayInfiniteComputer.js'); +var React = global.React || require('react'); + +function createInfiniteComputer(data, children) { + var computer; + var numberOfChildren = React.Children.count(children); + + // This should be guaranteed by checkProps + if (Array.isArray(data)) { + computer = new ArrayInfiniteComputer(data, numberOfChildren); + } else { + computer = new ConstantInfiniteComputer(data, numberOfChildren); + } + return computer; +} + +// Given the scrollTop of the container, computes the state the +// component should be in. The goal is to abstract all of this +// from any actual representation in the DOM. +// The window is the block with any preloadAdditionalHeight +// added to it. +function recomputeApertureStateFromOptionsAndScrollTop(_ref, scrollTop) { + var preloadBatchSize = _ref.preloadBatchSize; + var preloadAdditionalHeight = _ref.preloadAdditionalHeight; + var infiniteComputer = _ref.infiniteComputer; + return (function () { + var blockNumber = preloadBatchSize === 0 ? 0 : Math.floor(scrollTop / preloadBatchSize), + blockStart = preloadBatchSize * blockNumber, + blockEnd = blockStart + preloadBatchSize, + apertureTop = Math.max(0, blockStart - preloadAdditionalHeight), + apertureBottom = Math.min(infiniteComputer.getTotalScrollableHeight(), blockEnd + preloadAdditionalHeight); + + return { + displayIndexStart: infiniteComputer.getDisplayIndexStart(apertureTop), + displayIndexEnd: infiniteComputer.getDisplayIndexEnd(apertureBottom) + }; + })(); +} + +module.exports = { + createInfiniteComputer: createInfiniteComputer, + recomputeApertureStateFromOptionsAndScrollTop: recomputeApertureStateFromOptionsAndScrollTop +}; \ No newline at end of file diff --git a/build/utils/scaleEnum.js b/build/utils/scaleEnum.js new file mode 100644 index 0000000..493b81a --- /dev/null +++ b/build/utils/scaleEnum.js @@ -0,0 +1,5 @@ +'use strict'; + +module.exports = { + CONTAINER_HEIGHT_SCALE_FACTOR: 'containerHeightScaleFactor' +}; \ No newline at end of file diff --git a/build/utils/types.js b/build/utils/types.js new file mode 100644 index 0000000..64ecb35 --- /dev/null +++ b/build/utils/types.js @@ -0,0 +1,10 @@ +'use strict'; + +var React = global.React || require('react'); + +module.exports = { + preloadType: React.PropTypes.oneOfType([React.PropTypes.number, React.PropTypes.shape({ + type: React.PropTypes.oneOf(['containerHeightScaleFactor']).isRequired, + amount: React.PropTypes.number.isRequired + })]) +}; \ No newline at end of file diff --git a/dist/react-infinite.js b/dist/react-infinite.js index 1ca67fd..0c36016 100644 --- a/dist/react-infinite.js +++ b/dist/react-infinite.js @@ -1,8 +1,6 @@ (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Infinite = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o=0||Object.prototype.hasOwnProperty.call(e,o)&&(i[o]=e[o]);return i}var React=global.React||require("react");require("./utils/establish-polyfills");var scaleEnum=require("./utils/scaleEnum"),infiniteHelpers=require("./utils/infiniteHelpers"),_isFinite=require("lodash.isfinite"),preloadType=require("./utils/types").preloadType,checkProps=checkProps=require("./utils/checkProps"),Infinite=React.createClass({displayName:"Infinite",propTypes:{children:React.PropTypes.any,handleScroll:React.PropTypes.func,preloadBatchSize:preloadType,preloadAdditionalHeight:preloadType,elementHeight:React.PropTypes.oneOfType([React.PropTypes.number,React.PropTypes.arrayOf(React.PropTypes.number)]).isRequired,containerHeight:React.PropTypes.number,useWindowAsScrollContainer:React.PropTypes.bool,displayBottomUpwards:React.PropTypes.bool.isRequired,infiniteLoadBeginEdgeOffset:React.PropTypes.number,onInfiniteLoad:React.PropTypes.func,loadingSpinnerDelegate:React.PropTypes.node,isInfiniteLoading:React.PropTypes.bool,timeScrollStateLastsForAfterUserScrolls:React.PropTypes.number,className:React.PropTypes.string,styles:React.PropTypes.shape({scrollableStyle:React.PropTypes.object}).isRequired},statics:{containerHeightScaleFactor:function(e){if(!_isFinite(e))throw new Error("The scale factor must be a number.");return{type:scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR,amount:e}}},computedProps:{},utils:{},shouldAttachToBottom:!1,preservedScrollState:0,loadingSpinnerHeight:0,deprecationWarned:!1,scrollable:null,topSpacer:null,bottomSpacer:null,smoothScrollingWrapper:null,loadingSpinner:null,getDefaultProps:function(){return{handleScroll:function(){},useWindowAsScrollContainer:!1,onInfiniteLoad:function(){},loadingSpinnerDelegate:React.createElement("div",null),displayBottomUpwards:!1,isInfiniteLoading:!1,timeScrollStateLastsForAfterUserScrolls:150,className:"",styles:{}}},getInitialState:function(){var e=this.recomputeInternalStateFromProps(this.props);this.computedProps=e.computedProps,this.utils=e.utils,this.shouldAttachToBottom=this.props.displayBottomUpwards;var t=e.newState;return t.scrollTimeout=void 0,t.isScrolling=!1,t},generateComputedProps:function(e){var t=e.containerHeight,i=e.preloadBatchSize,o=e.preloadAdditionalHeight,n=_objectWithoutProperties(e,["containerHeight","preloadBatchSize","preloadAdditionalHeight"]),r={};t="number"==typeof t?t:0,r.containerHeight=e.useWindowAsScrollContainer?window.innerHeight:t,void 0!==n.infiniteLoadBeginBottomOffset&&(r.infiniteLoadBeginEdgeOffset=n.infiniteLoadBeginBottomOffset,this.deprecationWarned||(console.error("Warning: React Infinite's infiniteLoadBeginBottomOffset prop\n has been deprecated as of 0.6.0. Please use infiniteLoadBeginEdgeOffset.\n Because this is a rather descriptive name, a simple find and replace\n should suffice."),this.deprecationWarned=!0));var s={type:scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR,amount:.5},l=i&&i.type?i:s;"number"==typeof i?r.preloadBatchSize=i:"object"==typeof l&&l.type===scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR?r.preloadBatchSize=r.containerHeight*l.amount:r.preloadBatchSize=0;var a={type:scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR,amount:1},c=o&&o.type?o:a;return"number"==typeof o?r.preloadAdditionalHeight=o:"object"==typeof c&&c.type===scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR?r.preloadAdditionalHeight=r.containerHeight*c.amount:r.preloadAdditionalHeight=0,Object.assign(n,r)},generateComputedUtilityFunctions:function(e){var t=this,i={};return i.getLoadingSpinnerHeight=function(){var e=0;return t.loadingSpinner&&(e=t.loadingSpinner.offsetHeight||0),e},e.useWindowAsScrollContainer?(i.subscribeToScrollListener=function(){window.addEventListener("scroll",t.infiniteHandleScroll)},i.unsubscribeFromScrollListener=function(){window.removeEventListener("scroll",t.infiniteHandleScroll)},i.nodeScrollListener=function(){},i.getScrollTop=function(){return window.pageYOffset},i.setScrollTop=function(e){window.scroll(window.pageXOffset,e)},i.scrollShouldBeIgnored=function(){return!1},i.buildScrollableStyle=function(){return{}}):(i.subscribeToScrollListener=function(){},i.unsubscribeFromScrollListener=function(){},i.nodeScrollListener=this.infiniteHandleScroll,i.getScrollTop=function(){return t.scrollable?t.scrollable.scrollTop:0},i.setScrollTop=function(e){t.scrollable&&(t.scrollable.scrollTop=e)},i.scrollShouldBeIgnored=function(e){return e.target!==t.scrollable},i.buildScrollableStyle=function(){return Object.assign({},{height:t.computedProps.containerHeight,overflowX:"hidden",overflowY:"scroll",WebkitOverflowScrolling:"touch"},t.computedProps.styles.scrollableStyle||{})}),i},recomputeInternalStateFromProps:function(e){checkProps(e);var t=this.generateComputedProps(e),i=this.generateComputedUtilityFunctions(e),o={};return o.numberOfChildren=React.Children.count(t.children),o.infiniteComputer=infiniteHelpers.createInfiniteComputer(t.elementHeight,t.children,t.displayBottomUpwards),void 0!==t.isInfiniteLoading&&(o.isInfiniteLoading=t.isInfiniteLoading),o.preloadBatchSize=t.preloadBatchSize,o.preloadAdditionalHeight=t.preloadAdditionalHeight,o=Object.assign(o,infiniteHelpers.recomputeApertureStateFromOptionsAndScrollTop(o,i.getScrollTop())),{computedProps:t,utils:i,newState:o}},componentWillReceiveProps:function(e){var t=this.recomputeInternalStateFromProps(e);this.computedProps=t.computedProps,this.utils=t.utils,this.setState(t.newState)},componentWillUpdate:function(){this.props.displayBottomUpwards&&(this.preservedScrollState=this.utils.getScrollTop()-this.loadingSpinnerHeight)},componentDidUpdate:function(e,t){if(this.loadingSpinnerHeight=this.utils.getLoadingSpinnerHeight(),this.props.displayBottomUpwards){var i=this.getLowestPossibleScrollTop();this.shouldAttachToBottom&&this.utils.getScrollTop()this.state.infiniteComputer.getTotalScrollableHeight()-this.computedProps.containerHeight-this.computedProps.infiniteLoadBeginEdgeOffset},onInfiniteLoad:function(){this.setState({isInfiniteLoading:!0}),this.computedProps.onInfiniteLoad()},handleScroll:function(e){this.shouldAttachToBottom=this.computedProps.displayBottomUpwards&&e>=this.getLowestPossibleScrollTop(),this.manageScrollTimeouts();var t=infiniteHelpers.recomputeApertureStateFromOptionsAndScrollTop(this.state,e);this.passedEdgeForInfiniteScroll(e)&&!this.state.isInfiniteLoading?(this.setState(Object.assign({},t)),this.onInfiniteLoad()):this.setState(t)},buildHeightStyle:function(e){return{width:"100%",height:Math.ceil(e)}},render:function(){var e,t=this;e=this.state.numberOfChildren>1?this.computedProps.children.slice(this.state.displayIndexStart,this.state.displayIndexEnd+1):this.computedProps.children;var i={};this.state.isScrolling&&(i.pointerEvents="none");var o=this.state.infiniteComputer.getTopSpacerHeight(this.state.displayIndexStart),n=this.state.infiniteComputer.getBottomSpacerHeight(this.state.displayIndexEnd);if(this.computedProps.displayBottomUpwards){var r=this.computedProps.containerHeight-this.state.infiniteComputer.getTotalScrollableHeight();r>0&&(o=r-this.loadingSpinnerHeight)}var s=void 0===this.computedProps.infiniteLoadBeginEdgeOffset?null:React.createElement("div",{ref:function(e){t.loadingSpinner=e}},this.state.isInfiniteLoading?this.computedProps.loadingSpinnerDelegate:null);return React.createElement("div",{className:this.computedProps.className,ref:function(e){t.scrollable=e},style:this.utils.buildScrollableStyle(),onScroll:this.utils.nodeScrollListener},React.createElement("div",{ref:function(e){t.smoothScrollingWrapper=e},style:i},React.createElement("div",{ref:function(e){t.topSpacer=e},style:this.buildHeightStyle(o)}),this.computedProps.displayBottomUpwards&&s,e,!this.computedProps.displayBottomUpwards&&s,React.createElement("div",{ref:function(e){t.bottomSpacer=e},style:this.buildHeightStyle(n)})))}});module.exports=Infinite,global.Infinite=Infinite; - - +"use strict";function _objectWithoutProperties(e,t){var i={};for(var o in e)t.indexOf(o)>=0||Object.prototype.hasOwnProperty.call(e,o)&&(i[o]=e[o]);return i}var React=global.React||require("react");"undefined"==typeof window&&(global.window={}),require("./utils/establish-polyfills");var scaleEnum=require("./utils/scaleEnum"),infiniteHelpers=require("./utils/infiniteHelpers"),_isFinite=require("lodash.isfinite"),preloadType=require("./utils/types").preloadType,checkProps=checkProps=require("./utils/checkProps"),Infinite=React.createClass({displayName:"Infinite",propTypes:{children:React.PropTypes.any,handleScroll:React.PropTypes.func,preloadBatchSize:preloadType,preloadAdditionalHeight:preloadType,elementHeight:React.PropTypes.oneOfType([React.PropTypes.number,React.PropTypes.arrayOf(React.PropTypes.number)]).isRequired,containerHeight:React.PropTypes.number,useWindowAsScrollContainer:React.PropTypes.bool,displayBottomUpwards:React.PropTypes.bool.isRequired,infiniteLoadBeginEdgeOffset:React.PropTypes.number,onInfiniteLoad:React.PropTypes.func,loadingSpinnerDelegate:React.PropTypes.node,isInfiniteLoading:React.PropTypes.bool,timeScrollStateLastsForAfterUserScrolls:React.PropTypes.number,className:React.PropTypes.string,styles:React.PropTypes.shape({scrollableStyle:React.PropTypes.object}).isRequired},statics:{containerHeightScaleFactor:function(e){if(!_isFinite(e))throw new Error("The scale factor must be a number.");return{type:scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR,amount:e}}},computedProps:{},utils:{},shouldAttachToBottom:!1,preservedScrollState:0,loadingSpinnerHeight:0,deprecationWarned:!1,scrollable:null,topSpacer:null,bottomSpacer:null,smoothScrollingWrapper:null,loadingSpinner:null,getDefaultProps:function(){return{handleScroll:function(){},useWindowAsScrollContainer:!1,onInfiniteLoad:function(){},loadingSpinnerDelegate:React.createElement("div",null),displayBottomUpwards:!1,isInfiniteLoading:!1,timeScrollStateLastsForAfterUserScrolls:150,className:"",styles:{}}},getInitialState:function(){var e=this.recomputeInternalStateFromProps(this.props);this.computedProps=e.computedProps,this.utils=e.utils,this.shouldAttachToBottom=this.props.displayBottomUpwards;var t=e.newState;return t.scrollTimeout=void 0,t.isScrolling=!1,t},generateComputedProps:function(e){var t=e.containerHeight,i=e.preloadBatchSize,o=e.preloadAdditionalHeight,n=_objectWithoutProperties(e,["containerHeight","preloadBatchSize","preloadAdditionalHeight"]),r={};t="number"==typeof t?t:0,r.containerHeight=e.useWindowAsScrollContainer?window.innerHeight:t,void 0!==n.infiniteLoadBeginBottomOffset&&(r.infiniteLoadBeginEdgeOffset=n.infiniteLoadBeginBottomOffset,this.deprecationWarned||(console.error("Warning: React Infinite's infiniteLoadBeginBottomOffset prop\n has been deprecated as of 0.6.0. Please use infiniteLoadBeginEdgeOffset.\n Because this is a rather descriptive name, a simple find and replace\n should suffice."),this.deprecationWarned=!0));var s={type:scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR,amount:.5},l=i&&i.type?i:s;"number"==typeof i?r.preloadBatchSize=i:"object"==typeof l&&l.type===scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR?r.preloadBatchSize=r.containerHeight*l.amount:r.preloadBatchSize=0;var a={type:scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR,amount:1},c=o&&o.type?o:a;return"number"==typeof o?r.preloadAdditionalHeight=o:"object"==typeof c&&c.type===scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR?r.preloadAdditionalHeight=r.containerHeight*c.amount:r.preloadAdditionalHeight=0,Object.assign(n,r)},generateComputedUtilityFunctions:function(e){var t=this,i={};return i.getLoadingSpinnerHeight=function(){var e=0;return t.loadingSpinner&&(e=t.loadingSpinner.offsetHeight||0),e},e.useWindowAsScrollContainer?(i.subscribeToScrollListener=function(){window.addEventListener("scroll",t.infiniteHandleScroll)},i.unsubscribeFromScrollListener=function(){window.removeEventListener("scroll",t.infiniteHandleScroll)},i.nodeScrollListener=function(){},i.getScrollTop=function(){return window.pageYOffset},i.setScrollTop=function(e){window.scroll(window.pageXOffset,e)},i.scrollShouldBeIgnored=function(){return!1},i.buildScrollableStyle=function(){return{}}):(i.subscribeToScrollListener=function(){},i.unsubscribeFromScrollListener=function(){},i.nodeScrollListener=this.infiniteHandleScroll,i.getScrollTop=function(){return t.scrollable?t.scrollable.scrollTop:0},i.setScrollTop=function(e){t.scrollable&&(t.scrollable.scrollTop=e)},i.scrollShouldBeIgnored=function(e){return e.target!==t.scrollable},i.buildScrollableStyle=function(){return Object.assign({},{height:t.computedProps.containerHeight,overflowX:"hidden",overflowY:"scroll",WebkitOverflowScrolling:"touch"},t.computedProps.styles.scrollableStyle||{})}),i},recomputeInternalStateFromProps:function(e){checkProps(e);var t=this.generateComputedProps(e),i=this.generateComputedUtilityFunctions(e),o={};return o.numberOfChildren=React.Children.count(t.children),o.infiniteComputer=infiniteHelpers.createInfiniteComputer(t.elementHeight,t.children,t.displayBottomUpwards),void 0!==t.isInfiniteLoading&&(o.isInfiniteLoading=t.isInfiniteLoading),o.preloadBatchSize=t.preloadBatchSize,o.preloadAdditionalHeight=t.preloadAdditionalHeight,o=Object.assign(o,infiniteHelpers.recomputeApertureStateFromOptionsAndScrollTop(o,i.getScrollTop())),{computedProps:t,utils:i,newState:o}},componentWillReceiveProps:function(e){var t=this.recomputeInternalStateFromProps(e);this.computedProps=t.computedProps,this.utils=t.utils,this.setState(t.newState)},componentWillUpdate:function(){this.props.displayBottomUpwards&&(this.preservedScrollState=this.utils.getScrollTop()-this.loadingSpinnerHeight)},componentDidUpdate:function(e,t){if(this.loadingSpinnerHeight=this.utils.getLoadingSpinnerHeight(),this.props.displayBottomUpwards){var i=this.getLowestPossibleScrollTop();this.shouldAttachToBottom&&this.utils.getScrollTop()this.state.infiniteComputer.getTotalScrollableHeight()-this.computedProps.containerHeight-this.computedProps.infiniteLoadBeginEdgeOffset},onInfiniteLoad:function(){this.setState({isInfiniteLoading:!0}),this.computedProps.onInfiniteLoad()},handleScroll:function(e){this.shouldAttachToBottom=this.computedProps.displayBottomUpwards&&e>=this.getLowestPossibleScrollTop(),this.manageScrollTimeouts();var t=infiniteHelpers.recomputeApertureStateFromOptionsAndScrollTop(this.state,e);this.passedEdgeForInfiniteScroll(e)&&!this.state.isInfiniteLoading?(this.setState(Object.assign({},t)),this.onInfiniteLoad()):this.setState(t)},buildHeightStyle:function(e){return{width:"100%",height:Math.ceil(e)}},render:function(){var e,t=this;e=this.state.numberOfChildren>1?this.computedProps.children.slice(this.state.displayIndexStart,this.state.displayIndexEnd+1):this.computedProps.children;var i={};this.state.isScrolling&&(i.pointerEvents="none");var o=this.state.infiniteComputer.getTopSpacerHeight(this.state.displayIndexStart),n=this.state.infiniteComputer.getBottomSpacerHeight(this.state.displayIndexEnd);if(this.computedProps.displayBottomUpwards){var r=this.computedProps.containerHeight-this.state.infiniteComputer.getTotalScrollableHeight();r>0&&(o=r-this.loadingSpinnerHeight)}var s=void 0===this.computedProps.infiniteLoadBeginEdgeOffset?null:React.createElement("div",{ref:function(e){t.loadingSpinner=e}},this.state.isInfiniteLoading?this.computedProps.loadingSpinnerDelegate:null);return React.createElement("div",{className:this.computedProps.className,ref:function(e){t.scrollable=e},style:this.utils.buildScrollableStyle(),onScroll:this.utils.nodeScrollListener},React.createElement("div",{ref:function(e){t.smoothScrollingWrapper=e},style:i},React.createElement("div",{ref:function(e){t.topSpacer=e},style:this.buildHeightStyle(o)}),this.computedProps.displayBottomUpwards&&s,e,!this.computedProps.displayBottomUpwards&&s,React.createElement("div",{ref:function(e){t.bottomSpacer=e},style:this.buildHeightStyle(n)})))}});module.exports=Infinite,global.Infinite=Infinite; }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{"./utils/checkProps":9,"./utils/establish-polyfills":10,"./utils/infiniteHelpers":11,"./utils/scaleEnum":12,"./utils/types":13,"lodash.isfinite":3,"react":undefined}],2:[function(require,module,exports){ /** diff --git a/dist/react-infinite.min.js b/dist/react-infinite.min.js index 7b6ae7e..bb82bc5 100644 --- a/dist/react-infinite.min.js +++ b/dist/react-infinite.min.js @@ -1 +1 @@ -!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.Infinite=e()}}(function(){return function e(t,i,n){function o(l,s){if(!i[l]){if(!t[l]){var a="function"==typeof require&&require;if(!s&&a)return a(l,!0);if(r)return r(l,!0);var c=new Error("Cannot find module '"+l+"'");throw c.code="MODULE_NOT_FOUND",c}var u=i[l]={exports:{}};t[l][0].call(u.exports,function(e){var i=t[l][1][e];return o(i?i:e)},u,u.exports,e,t,i,n)}return i[l].exports}for(var r="function"==typeof require&&require,l=0;l=0||Object.prototype.hasOwnProperty.call(e,n)&&(i[n]=e[n]);return i}var o=i.React||e("react");e("./utils/establish-polyfills");var r=e("./utils/scaleEnum"),l=e("./utils/infiniteHelpers"),s=e("lodash.isfinite"),a=e("./utils/types").preloadType,c=c=e("./utils/checkProps"),u=o.createClass({displayName:"Infinite",propTypes:{children:o.PropTypes.any,handleScroll:o.PropTypes.func,preloadBatchSize:a,preloadAdditionalHeight:a,elementHeight:o.PropTypes.oneOfType([o.PropTypes.number,o.PropTypes.arrayOf(o.PropTypes.number)]).isRequired,containerHeight:o.PropTypes.number,useWindowAsScrollContainer:o.PropTypes.bool,displayBottomUpwards:o.PropTypes.bool.isRequired,infiniteLoadBeginEdgeOffset:o.PropTypes.number,onInfiniteLoad:o.PropTypes.func,loadingSpinnerDelegate:o.PropTypes.node,isInfiniteLoading:o.PropTypes.bool,timeScrollStateLastsForAfterUserScrolls:o.PropTypes.number,className:o.PropTypes.string,styles:o.PropTypes.shape({scrollableStyle:o.PropTypes.object}).isRequired},statics:{containerHeightScaleFactor:function(e){if(!s(e))throw new Error("The scale factor must be a number.");return{type:r.CONTAINER_HEIGHT_SCALE_FACTOR,amount:e}}},computedProps:{},utils:{},shouldAttachToBottom:!1,preservedScrollState:0,loadingSpinnerHeight:0,deprecationWarned:!1,scrollable:null,topSpacer:null,bottomSpacer:null,smoothScrollingWrapper:null,loadingSpinner:null,getDefaultProps:function(){return{handleScroll:function(){},useWindowAsScrollContainer:!1,onInfiniteLoad:function(){},loadingSpinnerDelegate:o.createElement("div",null),displayBottomUpwards:!1,isInfiniteLoading:!1,timeScrollStateLastsForAfterUserScrolls:150,className:"",styles:{}}},getInitialState:function(){var e=this.recomputeInternalStateFromProps(this.props);this.computedProps=e.computedProps,this.utils=e.utils,this.shouldAttachToBottom=this.props.displayBottomUpwards;var t=e.newState;return t.scrollTimeout=void 0,t.isScrolling=!1,t},generateComputedProps:function(e){var t=e.containerHeight,i=e.preloadBatchSize,o=e.preloadAdditionalHeight,l=n(e,["containerHeight","preloadBatchSize","preloadAdditionalHeight"]),s={};t="number"==typeof t?t:0,s.containerHeight=e.useWindowAsScrollContainer?window.innerHeight:t,void 0!==l.infiniteLoadBeginBottomOffset&&(s.infiniteLoadBeginEdgeOffset=l.infiniteLoadBeginBottomOffset,this.deprecationWarned||(console.error("Warning: React Infinite's infiniteLoadBeginBottomOffset prop\n has been deprecated as of 0.6.0. Please use infiniteLoadBeginEdgeOffset.\n Because this is a rather descriptive name, a simple find and replace\n should suffice."),this.deprecationWarned=!0));var a={type:r.CONTAINER_HEIGHT_SCALE_FACTOR,amount:.5},c=i&&i.type?i:a;"number"==typeof i?s.preloadBatchSize=i:"object"==typeof c&&c.type===r.CONTAINER_HEIGHT_SCALE_FACTOR?s.preloadBatchSize=s.containerHeight*c.amount:s.preloadBatchSize=0;var u={type:r.CONTAINER_HEIGHT_SCALE_FACTOR,amount:1},p=o&&o.type?o:u;return"number"==typeof o?s.preloadAdditionalHeight=o:"object"==typeof p&&p.type===r.CONTAINER_HEIGHT_SCALE_FACTOR?s.preloadAdditionalHeight=s.containerHeight*p.amount:s.preloadAdditionalHeight=0,Object.assign(l,s)},generateComputedUtilityFunctions:function(e){var t=this,i={};return i.getLoadingSpinnerHeight=function(){var e=0;return t.loadingSpinner&&(e=t.loadingSpinner.offsetHeight||0),e},e.useWindowAsScrollContainer?(i.subscribeToScrollListener=function(){window.addEventListener("scroll",t.infiniteHandleScroll)},i.unsubscribeFromScrollListener=function(){window.removeEventListener("scroll",t.infiniteHandleScroll)},i.nodeScrollListener=function(){},i.getScrollTop=function(){return window.pageYOffset},i.setScrollTop=function(e){window.scroll(window.pageXOffset,e)},i.scrollShouldBeIgnored=function(){return!1},i.buildScrollableStyle=function(){return{}}):(i.subscribeToScrollListener=function(){},i.unsubscribeFromScrollListener=function(){},i.nodeScrollListener=this.infiniteHandleScroll,i.getScrollTop=function(){return t.scrollable?t.scrollable.scrollTop:0},i.setScrollTop=function(e){t.scrollable&&(t.scrollable.scrollTop=e)},i.scrollShouldBeIgnored=function(e){return e.target!==t.scrollable},i.buildScrollableStyle=function(){return Object.assign({},{height:t.computedProps.containerHeight,overflowX:"hidden",overflowY:"scroll",WebkitOverflowScrolling:"touch"},t.computedProps.styles.scrollableStyle||{})}),i},recomputeInternalStateFromProps:function(e){c(e);var t=this.generateComputedProps(e),i=this.generateComputedUtilityFunctions(e),n={};return n.numberOfChildren=o.Children.count(t.children),n.infiniteComputer=l.createInfiniteComputer(t.elementHeight,t.children,t.displayBottomUpwards),void 0!==t.isInfiniteLoading&&(n.isInfiniteLoading=t.isInfiniteLoading),n.preloadBatchSize=t.preloadBatchSize,n.preloadAdditionalHeight=t.preloadAdditionalHeight,n=Object.assign(n,l.recomputeApertureStateFromOptionsAndScrollTop(n,i.getScrollTop())),{computedProps:t,utils:i,newState:n}},componentWillReceiveProps:function(e){var t=this.recomputeInternalStateFromProps(e);this.computedProps=t.computedProps,this.utils=t.utils,this.setState(t.newState)},componentWillUpdate:function(){this.props.displayBottomUpwards&&(this.preservedScrollState=this.utils.getScrollTop()-this.loadingSpinnerHeight)},componentDidUpdate:function(e,t){if(this.loadingSpinnerHeight=this.utils.getLoadingSpinnerHeight(),this.props.displayBottomUpwards){var i=this.getLowestPossibleScrollTop();this.shouldAttachToBottom&&this.utils.getScrollTop()this.state.infiniteComputer.getTotalScrollableHeight()-this.computedProps.containerHeight-this.computedProps.infiniteLoadBeginEdgeOffset},onInfiniteLoad:function(){this.setState({isInfiniteLoading:!0}),this.computedProps.onInfiniteLoad()},handleScroll:function(e){this.shouldAttachToBottom=this.computedProps.displayBottomUpwards&&e>=this.getLowestPossibleScrollTop(),this.manageScrollTimeouts();var t=l.recomputeApertureStateFromOptionsAndScrollTop(this.state,e);this.passedEdgeForInfiniteScroll(e)&&!this.state.isInfiniteLoading?(this.setState(Object.assign({},t)),this.onInfiniteLoad()):this.setState(t)},buildHeightStyle:function(e){return{width:"100%",height:Math.ceil(e)}},render:function(){var e,t=this;e=this.state.numberOfChildren>1?this.computedProps.children.slice(this.state.displayIndexStart,this.state.displayIndexEnd+1):this.computedProps.children;var i={};this.state.isScrolling&&(i.pointerEvents="none");var n=this.state.infiniteComputer.getTopSpacerHeight(this.state.displayIndexStart),r=this.state.infiniteComputer.getBottomSpacerHeight(this.state.displayIndexEnd);if(this.computedProps.displayBottomUpwards){var l=this.computedProps.containerHeight-this.state.infiniteComputer.getTotalScrollableHeight();l>0&&(n=l-this.loadingSpinnerHeight)}var s=void 0===this.computedProps.infiniteLoadBeginEdgeOffset?null:o.createElement("div",{ref:function(e){t.loadingSpinner=e}},this.state.isInfiniteLoading?this.computedProps.loadingSpinnerDelegate:null);return o.createElement("div",{className:this.computedProps.className,ref:function(e){t.scrollable=e},style:this.utils.buildScrollableStyle(),onScroll:this.utils.nodeScrollListener},o.createElement("div",{ref:function(e){t.smoothScrollingWrapper=e},style:i},o.createElement("div",{ref:function(e){t.topSpacer=e},style:this.buildHeightStyle(n)}),this.computedProps.displayBottomUpwards&&s,e,!this.computedProps.displayBottomUpwards&&s,o.createElement("div",{ref:function(e){t.bottomSpacer=e},style:this.buildHeightStyle(r)})))}});t.exports=u,i.Infinite=u}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./utils/checkProps":9,"./utils/establish-polyfills":10,"./utils/infiniteHelpers":11,"./utils/scaleEnum":12,"./utils/types":13,"lodash.isfinite":3,react:void 0}],2:[function(e,t,i){function n(e){return!!e&&"object"==typeof e}function o(e,t){var i=null==e?void 0:e[t];return a(i)?i:void 0}function r(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=S}function l(e){return s(e)&&g.call(e)==u}function s(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function a(e){return null!=e&&(l(e)?y.test(d.call(e)):n(e)&&p.test(e))}var c="[object Array]",u="[object Function]",p=/^\[object .+?Constructor\]$/,f=Object.prototype,d=Function.prototype.toString,h=f.hasOwnProperty,g=f.toString,y=RegExp("^"+d.call(h).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),m=o(Array,"isArray"),S=9007199254740991,b=m||function(e){return n(e)&&r(e.length)&&g.call(e)==c};t.exports=b},{}],3:[function(e,t,i){(function(e){function i(e){return"number"==typeof e&&n(e)}var n=e.isFinite;t.exports=i}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],4:[function(e,t,i){"use strict";function n(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}var o=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;t.exports=Object.assign||function(e,t){for(var i,l,s=n(e),a=1;a0?t-1:t}},{key:"getTopSpacerHeight",value:function(e){return e*this.heightData}},{key:"getBottomSpacerHeight",value:function(e){var t=e+1;return Math.max(0,(this.numberOfChildren-t)*this.heightData)}}]),t}(s);t.exports=a},{"./infiniteComputer.js":7}],7:[function(e,t,i){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o=function(){function e(e,t){for(var i=0;it&&(s=r-1)}return i===n.CLOSEST_LOWER&&a>0?o=a-1:i===n.CLOSEST_HIGHER&&s=0||Object.prototype.hasOwnProperty.call(e,n)&&(i[n]=e[n]);return i}var o=i.React||e("react");"undefined"==typeof window&&(i.window={}),e("./utils/establish-polyfills");var r=e("./utils/scaleEnum"),l=e("./utils/infiniteHelpers"),s=e("lodash.isfinite"),a=e("./utils/types").preloadType,c=c=e("./utils/checkProps"),u=o.createClass({displayName:"Infinite",propTypes:{children:o.PropTypes.any,handleScroll:o.PropTypes.func,preloadBatchSize:a,preloadAdditionalHeight:a,elementHeight:o.PropTypes.oneOfType([o.PropTypes.number,o.PropTypes.arrayOf(o.PropTypes.number)]).isRequired,containerHeight:o.PropTypes.number,useWindowAsScrollContainer:o.PropTypes.bool,displayBottomUpwards:o.PropTypes.bool.isRequired,infiniteLoadBeginEdgeOffset:o.PropTypes.number,onInfiniteLoad:o.PropTypes.func,loadingSpinnerDelegate:o.PropTypes.node,isInfiniteLoading:o.PropTypes.bool,timeScrollStateLastsForAfterUserScrolls:o.PropTypes.number,className:o.PropTypes.string,styles:o.PropTypes.shape({scrollableStyle:o.PropTypes.object}).isRequired},statics:{containerHeightScaleFactor:function(e){if(!s(e))throw new Error("The scale factor must be a number.");return{type:r.CONTAINER_HEIGHT_SCALE_FACTOR,amount:e}}},computedProps:{},utils:{},shouldAttachToBottom:!1,preservedScrollState:0,loadingSpinnerHeight:0,deprecationWarned:!1,scrollable:null,topSpacer:null,bottomSpacer:null,smoothScrollingWrapper:null,loadingSpinner:null,getDefaultProps:function(){return{handleScroll:function(){},useWindowAsScrollContainer:!1,onInfiniteLoad:function(){},loadingSpinnerDelegate:o.createElement("div",null),displayBottomUpwards:!1,isInfiniteLoading:!1,timeScrollStateLastsForAfterUserScrolls:150,className:"",styles:{}}},getInitialState:function(){var e=this.recomputeInternalStateFromProps(this.props);this.computedProps=e.computedProps,this.utils=e.utils,this.shouldAttachToBottom=this.props.displayBottomUpwards;var t=e.newState;return t.scrollTimeout=void 0,t.isScrolling=!1,t},generateComputedProps:function(e){var t=e.containerHeight,i=e.preloadBatchSize,o=e.preloadAdditionalHeight,l=n(e,["containerHeight","preloadBatchSize","preloadAdditionalHeight"]),s={};t="number"==typeof t?t:0,s.containerHeight=e.useWindowAsScrollContainer?window.innerHeight:t,void 0!==l.infiniteLoadBeginBottomOffset&&(s.infiniteLoadBeginEdgeOffset=l.infiniteLoadBeginBottomOffset,this.deprecationWarned||(console.error("Warning: React Infinite's infiniteLoadBeginBottomOffset prop\n has been deprecated as of 0.6.0. Please use infiniteLoadBeginEdgeOffset.\n Because this is a rather descriptive name, a simple find and replace\n should suffice."),this.deprecationWarned=!0));var a={type:r.CONTAINER_HEIGHT_SCALE_FACTOR,amount:.5},c=i&&i.type?i:a;"number"==typeof i?s.preloadBatchSize=i:"object"==typeof c&&c.type===r.CONTAINER_HEIGHT_SCALE_FACTOR?s.preloadBatchSize=s.containerHeight*c.amount:s.preloadBatchSize=0;var u={type:r.CONTAINER_HEIGHT_SCALE_FACTOR,amount:1},p=o&&o.type?o:u;return"number"==typeof o?s.preloadAdditionalHeight=o:"object"==typeof p&&p.type===r.CONTAINER_HEIGHT_SCALE_FACTOR?s.preloadAdditionalHeight=s.containerHeight*p.amount:s.preloadAdditionalHeight=0,Object.assign(l,s)},generateComputedUtilityFunctions:function(e){var t=this,i={};return i.getLoadingSpinnerHeight=function(){var e=0;return t.loadingSpinner&&(e=t.loadingSpinner.offsetHeight||0),e},e.useWindowAsScrollContainer?(i.subscribeToScrollListener=function(){window.addEventListener("scroll",t.infiniteHandleScroll)},i.unsubscribeFromScrollListener=function(){window.removeEventListener("scroll",t.infiniteHandleScroll)},i.nodeScrollListener=function(){},i.getScrollTop=function(){return window.pageYOffset},i.setScrollTop=function(e){window.scroll(window.pageXOffset,e)},i.scrollShouldBeIgnored=function(){return!1},i.buildScrollableStyle=function(){return{}}):(i.subscribeToScrollListener=function(){},i.unsubscribeFromScrollListener=function(){},i.nodeScrollListener=this.infiniteHandleScroll,i.getScrollTop=function(){return t.scrollable?t.scrollable.scrollTop:0},i.setScrollTop=function(e){t.scrollable&&(t.scrollable.scrollTop=e)},i.scrollShouldBeIgnored=function(e){return e.target!==t.scrollable},i.buildScrollableStyle=function(){return Object.assign({},{height:t.computedProps.containerHeight,overflowX:"hidden",overflowY:"scroll",WebkitOverflowScrolling:"touch"},t.computedProps.styles.scrollableStyle||{})}),i},recomputeInternalStateFromProps:function(e){c(e);var t=this.generateComputedProps(e),i=this.generateComputedUtilityFunctions(e),n={};return n.numberOfChildren=o.Children.count(t.children),n.infiniteComputer=l.createInfiniteComputer(t.elementHeight,t.children,t.displayBottomUpwards),void 0!==t.isInfiniteLoading&&(n.isInfiniteLoading=t.isInfiniteLoading),n.preloadBatchSize=t.preloadBatchSize,n.preloadAdditionalHeight=t.preloadAdditionalHeight,n=Object.assign(n,l.recomputeApertureStateFromOptionsAndScrollTop(n,i.getScrollTop())),{computedProps:t,utils:i,newState:n}},componentWillReceiveProps:function(e){var t=this.recomputeInternalStateFromProps(e);this.computedProps=t.computedProps,this.utils=t.utils,this.setState(t.newState)},componentWillUpdate:function(){this.props.displayBottomUpwards&&(this.preservedScrollState=this.utils.getScrollTop()-this.loadingSpinnerHeight)},componentDidUpdate:function(e,t){if(this.loadingSpinnerHeight=this.utils.getLoadingSpinnerHeight(),this.props.displayBottomUpwards){var i=this.getLowestPossibleScrollTop();this.shouldAttachToBottom&&this.utils.getScrollTop()this.state.infiniteComputer.getTotalScrollableHeight()-this.computedProps.containerHeight-this.computedProps.infiniteLoadBeginEdgeOffset},onInfiniteLoad:function(){this.setState({isInfiniteLoading:!0}),this.computedProps.onInfiniteLoad()},handleScroll:function(e){this.shouldAttachToBottom=this.computedProps.displayBottomUpwards&&e>=this.getLowestPossibleScrollTop(),this.manageScrollTimeouts();var t=l.recomputeApertureStateFromOptionsAndScrollTop(this.state,e);this.passedEdgeForInfiniteScroll(e)&&!this.state.isInfiniteLoading?(this.setState(Object.assign({},t)),this.onInfiniteLoad()):this.setState(t)},buildHeightStyle:function(e){return{width:"100%",height:Math.ceil(e)}},render:function(){var e,t=this;e=this.state.numberOfChildren>1?this.computedProps.children.slice(this.state.displayIndexStart,this.state.displayIndexEnd+1):this.computedProps.children;var i={};this.state.isScrolling&&(i.pointerEvents="none");var n=this.state.infiniteComputer.getTopSpacerHeight(this.state.displayIndexStart),r=this.state.infiniteComputer.getBottomSpacerHeight(this.state.displayIndexEnd);if(this.computedProps.displayBottomUpwards){var l=this.computedProps.containerHeight-this.state.infiniteComputer.getTotalScrollableHeight();l>0&&(n=l-this.loadingSpinnerHeight)}var s=void 0===this.computedProps.infiniteLoadBeginEdgeOffset?null:o.createElement("div",{ref:function(e){t.loadingSpinner=e}},this.state.isInfiniteLoading?this.computedProps.loadingSpinnerDelegate:null);return o.createElement("div",{className:this.computedProps.className,ref:function(e){t.scrollable=e},style:this.utils.buildScrollableStyle(),onScroll:this.utils.nodeScrollListener},o.createElement("div",{ref:function(e){t.smoothScrollingWrapper=e},style:i},o.createElement("div",{ref:function(e){t.topSpacer=e},style:this.buildHeightStyle(n)}),this.computedProps.displayBottomUpwards&&s,e,!this.computedProps.displayBottomUpwards&&s,o.createElement("div",{ref:function(e){t.bottomSpacer=e},style:this.buildHeightStyle(r)})))}});t.exports=u,i.Infinite=u}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./utils/checkProps":9,"./utils/establish-polyfills":10,"./utils/infiniteHelpers":11,"./utils/scaleEnum":12,"./utils/types":13,"lodash.isfinite":3,react:void 0}],2:[function(e,t,i){function n(e){return!!e&&"object"==typeof e}function o(e,t){var i=null==e?void 0:e[t];return a(i)?i:void 0}function r(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=S}function l(e){return s(e)&&g.call(e)==u}function s(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function a(e){return null!=e&&(l(e)?y.test(d.call(e)):n(e)&&p.test(e))}var c="[object Array]",u="[object Function]",p=/^\[object .+?Constructor\]$/,f=Object.prototype,d=Function.prototype.toString,h=f.hasOwnProperty,g=f.toString,y=RegExp("^"+d.call(h).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),m=o(Array,"isArray"),S=9007199254740991,b=m||function(e){return n(e)&&r(e.length)&&g.call(e)==c};t.exports=b},{}],3:[function(e,t,i){(function(e){function i(e){return"number"==typeof e&&n(e)}var n=e.isFinite;t.exports=i}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],4:[function(e,t,i){"use strict";function n(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}var o=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;t.exports=Object.assign||function(e,t){for(var i,l,s=n(e),a=1;a0?t-1:t}},{key:"getTopSpacerHeight",value:function(e){return e*this.heightData}},{key:"getBottomSpacerHeight",value:function(e){var t=e+1;return Math.max(0,(this.numberOfChildren-t)*this.heightData)}}]),t}(s);t.exports=a},{"./infiniteComputer.js":7}],7:[function(e,t,i){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o=function(){function e(e,t){for(var i=0;it&&(s=r-1)}return i===n.CLOSEST_LOWER&&a>0?o=a-1:i===n.CLOSEST_HIGHER&&s Date: Wed, 3 May 2017 15:24:51 -0400 Subject: [PATCH 17/78] react deprecations: PropTypes, createClass - use create-react-class as interim step since codebase is not ready - use prop-types react-addon-test-utils deprecations: createRenderer - use react-dom/test-utils - use react-test-renderer/shallow createRenderer dependencies: - eliminate react-addon-test-utils - add react-test-renderer peerDependencies: - bump react, react-dom to 15.5 - add create-react-class, prop-types --- README.md | 6 +- __tests__/bottom_upwards_infinite_test.js | 4 +- __tests__/infinite_error_test.js | 16 +- __tests__/infinite_styles_test.js | 2 +- __tests__/infinite_test.js | 5 +- dist/react-infinite.js | 321 ---------------------- dist/react-infinite.min.js | 1 - examples/borderless-window.jsx | 6 +- examples/chat.jsx | 6 +- examples/index.jsx | 10 +- examples/window.jsx | 6 +- package.json | 10 +- src/react-infinite.jsx | 36 +-- src/utils/types.js | 12 +- 14 files changed, 61 insertions(+), 380 deletions(-) delete mode 100644 dist/react-infinite.js delete mode 100644 dist/react-infinite.min.js diff --git a/README.md b/README.md index 3868ccc..e24109a 100644 --- a/README.md +++ b/README.md @@ -164,7 +164,9 @@ Code samples are now available in the `/examples` directory for your perusal. Tw To get you started, here is some sample code that implements an infinite scroll with an simulated delay of 2.5 seconds. A [live demo of this example is available](http://chairnerd.seatgeek.com/react-infinite-a-browser-ready-efficient-scrolling-container-based-on-uitableview/) on our blog. ```js -var ListItem = React.createClass({ +var createReactClass = require('create-react-class'); + +var ListItem = createReactClass({ render: function() { return
List Item {this.props.num} @@ -172,7 +174,7 @@ var ListItem = React.createClass({ } }); -var InfiniteList = React.createClass({ +var InfiniteList = createReactClass({ getInitialState: function() { return { elements: this.buildElements(0, 20), diff --git a/__tests__/bottom_upwards_infinite_test.js b/__tests__/bottom_upwards_infinite_test.js index 74c10e6..4d803da 100644 --- a/__tests__/bottom_upwards_infinite_test.js +++ b/__tests__/bottom_upwards_infinite_test.js @@ -12,11 +12,11 @@ jest.dontMock('lodash.isarray'); var React = require('react'); var ReactDOM = require('react-dom'); -var TestUtils = require('react-addons-test-utils'); +var TestUtils = require('react-dom/test-utils'); var Infinite = require('../src/react-infinite.jsx'); var renderHelpers = require('./helpers/renderHelpers'); -var shallowRenderer = TestUtils.createRenderer(); +var shallowRenderer = require('react-test-renderer/shallow').createRenderer(); describe('The Basic Behavior of the Bottom Upwards Display', function() { it('does not throw an error when set', function() { diff --git a/__tests__/infinite_error_test.js b/__tests__/infinite_error_test.js index ef59f0a..3f8ff7f 100644 --- a/__tests__/infinite_error_test.js +++ b/__tests__/infinite_error_test.js @@ -11,16 +11,12 @@ jest.dontMock('lodash.isfinite'); jest.dontMock('lodash.isarray'); var React = require('react'); -var TestUtils = require('react-addons-test-utils'); +var TestUtils = require('react-dom/test-utils'); var Infinite = require('../src/react-infinite.jsx'); -var shallowRenderer; +var shallowRenderer = require('react-test-renderer/shallow').createRenderer(); describe('Errors when the container height is not provided in some way', function() { - beforeEach(function() { - shallowRenderer = TestUtils.createRenderer(); - }); - it('throws an error when neither containerHeight nor useWindowAsScrollContainer is not provided', function() { var errorfulInfinite =
@@ -34,10 +30,6 @@ describe('Errors when the container height is not provided in some way', functio }); describe('Errors when the elementHeight does not make sense', function() { - beforeEach(function() { - shallowRenderer = TestUtils.createRenderer(); - }); - it('throws an error when the elementHeight is neither a number nor an array', function() { var errorfulInfinite = @@ -52,10 +44,6 @@ describe('Errors when the elementHeight does not make sense', function() { }); describe('Errors an error on elementHeight array length mismatch', function() { - beforeEach(function() { - shallowRenderer = TestUtils.createRenderer(); - }); - it('throws an error when the number of children is not equal to the length of the elementHeight array when ', function() { var errorfulInfinite = diff --git a/__tests__/infinite_styles_test.js b/__tests__/infinite_styles_test.js index 34ef11b..6811e5d 100644 --- a/__tests__/infinite_styles_test.js +++ b/__tests__/infinite_styles_test.js @@ -17,7 +17,7 @@ jest.dontMock('lodash.isarray'); jest.dontMock('react-dom'); var React = require('react'); -var TestUtils = require('react-addons-test-utils'); +var TestUtils = require('react-dom/test-utils'); var Infinite = require('../src/react-infinite.jsx'); diff --git a/__tests__/infinite_test.js b/__tests__/infinite_test.js index 7f9405c..0f1a8c0 100644 --- a/__tests__/infinite_test.js +++ b/__tests__/infinite_test.js @@ -12,8 +12,9 @@ jest.dontMock('lodash.isarray'); jest.dontMock('react-dom'); var React = require('react'); +var createReactClass = require('create-react-class'); var ReactDOM = require('react-dom'); -var TestUtils = require('react-addons-test-utils'); +var TestUtils = require('react-dom/test-utils'); var Infinite = require('../src/react-infinite.jsx'); var renderHelpers = require('./helpers/renderHelpers'); @@ -921,7 +922,7 @@ describe('Rerendering React Infinite', function() { }); describe('Requesting all visible rows', function () { - var InfiniteWrapper = React.createClass({ + var InfiniteWrapper = createReactClass({ getInitialState() { return { currentRows: 0, totalRequests: 0 } }, diff --git a/dist/react-infinite.js b/dist/react-infinite.js deleted file mode 100644 index 1ca67fd..0000000 --- a/dist/react-infinite.js +++ /dev/null @@ -1,321 +0,0 @@ -(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Infinite = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o=0||Object.prototype.hasOwnProperty.call(e,o)&&(i[o]=e[o]);return i}var React=global.React||require("react");require("./utils/establish-polyfills");var scaleEnum=require("./utils/scaleEnum"),infiniteHelpers=require("./utils/infiniteHelpers"),_isFinite=require("lodash.isfinite"),preloadType=require("./utils/types").preloadType,checkProps=checkProps=require("./utils/checkProps"),Infinite=React.createClass({displayName:"Infinite",propTypes:{children:React.PropTypes.any,handleScroll:React.PropTypes.func,preloadBatchSize:preloadType,preloadAdditionalHeight:preloadType,elementHeight:React.PropTypes.oneOfType([React.PropTypes.number,React.PropTypes.arrayOf(React.PropTypes.number)]).isRequired,containerHeight:React.PropTypes.number,useWindowAsScrollContainer:React.PropTypes.bool,displayBottomUpwards:React.PropTypes.bool.isRequired,infiniteLoadBeginEdgeOffset:React.PropTypes.number,onInfiniteLoad:React.PropTypes.func,loadingSpinnerDelegate:React.PropTypes.node,isInfiniteLoading:React.PropTypes.bool,timeScrollStateLastsForAfterUserScrolls:React.PropTypes.number,className:React.PropTypes.string,styles:React.PropTypes.shape({scrollableStyle:React.PropTypes.object}).isRequired},statics:{containerHeightScaleFactor:function(e){if(!_isFinite(e))throw new Error("The scale factor must be a number.");return{type:scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR,amount:e}}},computedProps:{},utils:{},shouldAttachToBottom:!1,preservedScrollState:0,loadingSpinnerHeight:0,deprecationWarned:!1,scrollable:null,topSpacer:null,bottomSpacer:null,smoothScrollingWrapper:null,loadingSpinner:null,getDefaultProps:function(){return{handleScroll:function(){},useWindowAsScrollContainer:!1,onInfiniteLoad:function(){},loadingSpinnerDelegate:React.createElement("div",null),displayBottomUpwards:!1,isInfiniteLoading:!1,timeScrollStateLastsForAfterUserScrolls:150,className:"",styles:{}}},getInitialState:function(){var e=this.recomputeInternalStateFromProps(this.props);this.computedProps=e.computedProps,this.utils=e.utils,this.shouldAttachToBottom=this.props.displayBottomUpwards;var t=e.newState;return t.scrollTimeout=void 0,t.isScrolling=!1,t},generateComputedProps:function(e){var t=e.containerHeight,i=e.preloadBatchSize,o=e.preloadAdditionalHeight,n=_objectWithoutProperties(e,["containerHeight","preloadBatchSize","preloadAdditionalHeight"]),r={};t="number"==typeof t?t:0,r.containerHeight=e.useWindowAsScrollContainer?window.innerHeight:t,void 0!==n.infiniteLoadBeginBottomOffset&&(r.infiniteLoadBeginEdgeOffset=n.infiniteLoadBeginBottomOffset,this.deprecationWarned||(console.error("Warning: React Infinite's infiniteLoadBeginBottomOffset prop\n has been deprecated as of 0.6.0. Please use infiniteLoadBeginEdgeOffset.\n Because this is a rather descriptive name, a simple find and replace\n should suffice."),this.deprecationWarned=!0));var s={type:scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR,amount:.5},l=i&&i.type?i:s;"number"==typeof i?r.preloadBatchSize=i:"object"==typeof l&&l.type===scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR?r.preloadBatchSize=r.containerHeight*l.amount:r.preloadBatchSize=0;var a={type:scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR,amount:1},c=o&&o.type?o:a;return"number"==typeof o?r.preloadAdditionalHeight=o:"object"==typeof c&&c.type===scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR?r.preloadAdditionalHeight=r.containerHeight*c.amount:r.preloadAdditionalHeight=0,Object.assign(n,r)},generateComputedUtilityFunctions:function(e){var t=this,i={};return i.getLoadingSpinnerHeight=function(){var e=0;return t.loadingSpinner&&(e=t.loadingSpinner.offsetHeight||0),e},e.useWindowAsScrollContainer?(i.subscribeToScrollListener=function(){window.addEventListener("scroll",t.infiniteHandleScroll)},i.unsubscribeFromScrollListener=function(){window.removeEventListener("scroll",t.infiniteHandleScroll)},i.nodeScrollListener=function(){},i.getScrollTop=function(){return window.pageYOffset},i.setScrollTop=function(e){window.scroll(window.pageXOffset,e)},i.scrollShouldBeIgnored=function(){return!1},i.buildScrollableStyle=function(){return{}}):(i.subscribeToScrollListener=function(){},i.unsubscribeFromScrollListener=function(){},i.nodeScrollListener=this.infiniteHandleScroll,i.getScrollTop=function(){return t.scrollable?t.scrollable.scrollTop:0},i.setScrollTop=function(e){t.scrollable&&(t.scrollable.scrollTop=e)},i.scrollShouldBeIgnored=function(e){return e.target!==t.scrollable},i.buildScrollableStyle=function(){return Object.assign({},{height:t.computedProps.containerHeight,overflowX:"hidden",overflowY:"scroll",WebkitOverflowScrolling:"touch"},t.computedProps.styles.scrollableStyle||{})}),i},recomputeInternalStateFromProps:function(e){checkProps(e);var t=this.generateComputedProps(e),i=this.generateComputedUtilityFunctions(e),o={};return o.numberOfChildren=React.Children.count(t.children),o.infiniteComputer=infiniteHelpers.createInfiniteComputer(t.elementHeight,t.children,t.displayBottomUpwards),void 0!==t.isInfiniteLoading&&(o.isInfiniteLoading=t.isInfiniteLoading),o.preloadBatchSize=t.preloadBatchSize,o.preloadAdditionalHeight=t.preloadAdditionalHeight,o=Object.assign(o,infiniteHelpers.recomputeApertureStateFromOptionsAndScrollTop(o,i.getScrollTop())),{computedProps:t,utils:i,newState:o}},componentWillReceiveProps:function(e){var t=this.recomputeInternalStateFromProps(e);this.computedProps=t.computedProps,this.utils=t.utils,this.setState(t.newState)},componentWillUpdate:function(){this.props.displayBottomUpwards&&(this.preservedScrollState=this.utils.getScrollTop()-this.loadingSpinnerHeight)},componentDidUpdate:function(e,t){if(this.loadingSpinnerHeight=this.utils.getLoadingSpinnerHeight(),this.props.displayBottomUpwards){var i=this.getLowestPossibleScrollTop();this.shouldAttachToBottom&&this.utils.getScrollTop()this.state.infiniteComputer.getTotalScrollableHeight()-this.computedProps.containerHeight-this.computedProps.infiniteLoadBeginEdgeOffset},onInfiniteLoad:function(){this.setState({isInfiniteLoading:!0}),this.computedProps.onInfiniteLoad()},handleScroll:function(e){this.shouldAttachToBottom=this.computedProps.displayBottomUpwards&&e>=this.getLowestPossibleScrollTop(),this.manageScrollTimeouts();var t=infiniteHelpers.recomputeApertureStateFromOptionsAndScrollTop(this.state,e);this.passedEdgeForInfiniteScroll(e)&&!this.state.isInfiniteLoading?(this.setState(Object.assign({},t)),this.onInfiniteLoad()):this.setState(t)},buildHeightStyle:function(e){return{width:"100%",height:Math.ceil(e)}},render:function(){var e,t=this;e=this.state.numberOfChildren>1?this.computedProps.children.slice(this.state.displayIndexStart,this.state.displayIndexEnd+1):this.computedProps.children;var i={};this.state.isScrolling&&(i.pointerEvents="none");var o=this.state.infiniteComputer.getTopSpacerHeight(this.state.displayIndexStart),n=this.state.infiniteComputer.getBottomSpacerHeight(this.state.displayIndexEnd);if(this.computedProps.displayBottomUpwards){var r=this.computedProps.containerHeight-this.state.infiniteComputer.getTotalScrollableHeight();r>0&&(o=r-this.loadingSpinnerHeight)}var s=void 0===this.computedProps.infiniteLoadBeginEdgeOffset?null:React.createElement("div",{ref:function(e){t.loadingSpinner=e}},this.state.isInfiniteLoading?this.computedProps.loadingSpinnerDelegate:null);return React.createElement("div",{className:this.computedProps.className,ref:function(e){t.scrollable=e},style:this.utils.buildScrollableStyle(),onScroll:this.utils.nodeScrollListener},React.createElement("div",{ref:function(e){t.smoothScrollingWrapper=e},style:i},React.createElement("div",{ref:function(e){t.topSpacer=e},style:this.buildHeightStyle(o)}),this.computedProps.displayBottomUpwards&&s,e,!this.computedProps.displayBottomUpwards&&s,React.createElement("div",{ref:function(e){t.bottomSpacer=e},style:this.buildHeightStyle(n)})))}});module.exports=Infinite,global.Infinite=Infinite; - - -}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"./utils/checkProps":9,"./utils/establish-polyfills":10,"./utils/infiniteHelpers":11,"./utils/scaleEnum":12,"./utils/types":13,"lodash.isfinite":3,"react":undefined}],2:[function(require,module,exports){ -/** - * lodash 3.0.4 (Custom Build) - * Build: `lodash modern modularize exports="npm" -o ./` - * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.8.3 - * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ - -/** `Object#toString` result references. */ -var arrayTag = '[object Array]', - funcTag = '[object Function]'; - -/** Used to detect host constructors (Safari > 5). */ -var reIsHostCtor = /^\[object .+?Constructor\]$/; - -/** - * Checks if `value` is object-like. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - */ -function isObjectLike(value) { - return !!value && typeof value == 'object'; -} - -/** Used for native method references. */ -var objectProto = Object.prototype; - -/** Used to resolve the decompiled source of functions. */ -var fnToString = Function.prototype.toString; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** - * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) - * of values. - */ -var objToString = objectProto.toString; - -/** Used to detect if a method is native. */ -var reIsNative = RegExp('^' + - fnToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g, '\\$&') - .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' -); - -/* Native method references for those with the same name as other `lodash` methods. */ -var nativeIsArray = getNative(Array, 'isArray'); - -/** - * Used as the [maximum length](http://ecma-international.org/ecma-262/6.0/#sec-number.max_safe_integer) - * of an array-like value. - */ -var MAX_SAFE_INTEGER = 9007199254740991; - -/** - * Gets the native function at `key` of `object`. - * - * @private - * @param {Object} object The object to query. - * @param {string} key The key of the method to get. - * @returns {*} Returns the function if it's native, else `undefined`. - */ -function getNative(object, key) { - var value = object == null ? undefined : object[key]; - return isNative(value) ? value : undefined; -} - -/** - * Checks if `value` is a valid array-like length. - * - * **Note:** This function is based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. - */ -function isLength(value) { - return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; -} - -/** - * Checks if `value` is classified as an `Array` object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isArray([1, 2, 3]); - * // => true - * - * _.isArray(function() { return arguments; }()); - * // => false - */ -var isArray = nativeIsArray || function(value) { - return isObjectLike(value) && isLength(value.length) && objToString.call(value) == arrayTag; -}; - -/** - * Checks if `value` is classified as a `Function` object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isFunction(_); - * // => true - * - * _.isFunction(/abc/); - * // => false - */ -function isFunction(value) { - // The use of `Object#toString` avoids issues with the `typeof` operator - // in older versions of Chrome and Safari which return 'function' for regexes - // and Safari 8 equivalents which return 'object' for typed array constructors. - return isObject(value) && objToString.call(value) == funcTag; -} - -/** - * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. - * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(1); - * // => false - */ -function isObject(value) { - // Avoid a V8 JIT bug in Chrome 19-20. - // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. - var type = typeof value; - return !!value && (type == 'object' || type == 'function'); -} - -/** - * Checks if `value` is a native function. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a native function, else `false`. - * @example - * - * _.isNative(Array.prototype.push); - * // => true - * - * _.isNative(_); - * // => false - */ -function isNative(value) { - if (value == null) { - return false; - } - if (isFunction(value)) { - return reIsNative.test(fnToString.call(value)); - } - return isObjectLike(value) && reIsHostCtor.test(value); -} - -module.exports = isArray; - -},{}],3:[function(require,module,exports){ -(function (global){ -/** - * lodash 3.2.0 (Custom Build) - * Build: `lodash modern modularize exports="npm" -o ./` - * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.8.3 - * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ - -/* Native method references for those with the same name as other `lodash` methods. */ -var nativeIsFinite = global.isFinite; - -/** - * Checks if `value` is a finite primitive number. - * - * **Note:** This method is based on [`Number.isFinite`](http://ecma-international.org/ecma-262/6.0/#sec-number.isfinite). - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a finite number, else `false`. - * @example - * - * _.isFinite(10); - * // => true - * - * _.isFinite('10'); - * // => false - * - * _.isFinite(true); - * // => false - * - * _.isFinite(Object(10)); - * // => false - * - * _.isFinite(Infinity); - * // => false - */ -function isFinite(value) { - return typeof value == 'number' && nativeIsFinite(value); -} - -module.exports = isFinite; - -}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{}],4:[function(require,module,exports){ -/* eslint-disable no-unused-vars */ -'use strict'; -var hasOwnProperty = Object.prototype.hasOwnProperty; -var propIsEnumerable = Object.prototype.propertyIsEnumerable; - -function toObject(val) { - if (val === null || val === undefined) { - throw new TypeError('Object.assign cannot be called with null or undefined'); - } - - return Object(val); -} - -module.exports = Object.assign || function (target, source) { - var from; - var to = toObject(target); - var symbols; - - for (var s = 1; s < arguments.length; s++) { - from = Object(arguments[s]); - - for (var key in from) { - if (hasOwnProperty.call(from, key)) { - to[key] = from[key]; - } - } - - if (Object.getOwnPropertySymbols) { - symbols = Object.getOwnPropertySymbols(from); - for (var i = 0; i < symbols.length; i++) { - if (propIsEnumerable.call(from, symbols[i])) { - to[symbols[i]] = from[symbols[i]]; - } - } - } - } - - return to; -}; - -},{}],5:[function(require,module,exports){ -"use strict";function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var _createClass=function(){function e(e,t){for(var r=0;r0?e-1:e}},{key:"getTopSpacerHeight",value:function(t){return t*this.heightData}},{key:"getBottomSpacerHeight",value:function(t){var e=t+1;return Math.max(0,(this.numberOfChildren-e)*this.heightData)}}]),e}(InfiniteComputer);module.exports=ConstantInfiniteComputer; - - -},{"./infiniteComputer.js":7}],7:[function(require,module,exports){ -"use strict";function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var _createClass=function(){function e(e,t){for(var n=0;nt&&(a=o-1)}return e===opts.CLOSEST_LOWER&&s>0?n=s-1:e===opts.CLOSEST_HIGHER&&a=0||Object.prototype.hasOwnProperty.call(e,n)&&(i[n]=e[n]);return i}var o=i.React||e("react");e("./utils/establish-polyfills");var r=e("./utils/scaleEnum"),l=e("./utils/infiniteHelpers"),s=e("lodash.isfinite"),a=e("./utils/types").preloadType,c=c=e("./utils/checkProps"),u=o.createClass({displayName:"Infinite",propTypes:{children:o.PropTypes.any,handleScroll:o.PropTypes.func,preloadBatchSize:a,preloadAdditionalHeight:a,elementHeight:o.PropTypes.oneOfType([o.PropTypes.number,o.PropTypes.arrayOf(o.PropTypes.number)]).isRequired,containerHeight:o.PropTypes.number,useWindowAsScrollContainer:o.PropTypes.bool,displayBottomUpwards:o.PropTypes.bool.isRequired,infiniteLoadBeginEdgeOffset:o.PropTypes.number,onInfiniteLoad:o.PropTypes.func,loadingSpinnerDelegate:o.PropTypes.node,isInfiniteLoading:o.PropTypes.bool,timeScrollStateLastsForAfterUserScrolls:o.PropTypes.number,className:o.PropTypes.string,styles:o.PropTypes.shape({scrollableStyle:o.PropTypes.object}).isRequired},statics:{containerHeightScaleFactor:function(e){if(!s(e))throw new Error("The scale factor must be a number.");return{type:r.CONTAINER_HEIGHT_SCALE_FACTOR,amount:e}}},computedProps:{},utils:{},shouldAttachToBottom:!1,preservedScrollState:0,loadingSpinnerHeight:0,deprecationWarned:!1,scrollable:null,topSpacer:null,bottomSpacer:null,smoothScrollingWrapper:null,loadingSpinner:null,getDefaultProps:function(){return{handleScroll:function(){},useWindowAsScrollContainer:!1,onInfiniteLoad:function(){},loadingSpinnerDelegate:o.createElement("div",null),displayBottomUpwards:!1,isInfiniteLoading:!1,timeScrollStateLastsForAfterUserScrolls:150,className:"",styles:{}}},getInitialState:function(){var e=this.recomputeInternalStateFromProps(this.props);this.computedProps=e.computedProps,this.utils=e.utils,this.shouldAttachToBottom=this.props.displayBottomUpwards;var t=e.newState;return t.scrollTimeout=void 0,t.isScrolling=!1,t},generateComputedProps:function(e){var t=e.containerHeight,i=e.preloadBatchSize,o=e.preloadAdditionalHeight,l=n(e,["containerHeight","preloadBatchSize","preloadAdditionalHeight"]),s={};t="number"==typeof t?t:0,s.containerHeight=e.useWindowAsScrollContainer?window.innerHeight:t,void 0!==l.infiniteLoadBeginBottomOffset&&(s.infiniteLoadBeginEdgeOffset=l.infiniteLoadBeginBottomOffset,this.deprecationWarned||(console.error("Warning: React Infinite's infiniteLoadBeginBottomOffset prop\n has been deprecated as of 0.6.0. Please use infiniteLoadBeginEdgeOffset.\n Because this is a rather descriptive name, a simple find and replace\n should suffice."),this.deprecationWarned=!0));var a={type:r.CONTAINER_HEIGHT_SCALE_FACTOR,amount:.5},c=i&&i.type?i:a;"number"==typeof i?s.preloadBatchSize=i:"object"==typeof c&&c.type===r.CONTAINER_HEIGHT_SCALE_FACTOR?s.preloadBatchSize=s.containerHeight*c.amount:s.preloadBatchSize=0;var u={type:r.CONTAINER_HEIGHT_SCALE_FACTOR,amount:1},p=o&&o.type?o:u;return"number"==typeof o?s.preloadAdditionalHeight=o:"object"==typeof p&&p.type===r.CONTAINER_HEIGHT_SCALE_FACTOR?s.preloadAdditionalHeight=s.containerHeight*p.amount:s.preloadAdditionalHeight=0,Object.assign(l,s)},generateComputedUtilityFunctions:function(e){var t=this,i={};return i.getLoadingSpinnerHeight=function(){var e=0;return t.loadingSpinner&&(e=t.loadingSpinner.offsetHeight||0),e},e.useWindowAsScrollContainer?(i.subscribeToScrollListener=function(){window.addEventListener("scroll",t.infiniteHandleScroll)},i.unsubscribeFromScrollListener=function(){window.removeEventListener("scroll",t.infiniteHandleScroll)},i.nodeScrollListener=function(){},i.getScrollTop=function(){return window.pageYOffset},i.setScrollTop=function(e){window.scroll(window.pageXOffset,e)},i.scrollShouldBeIgnored=function(){return!1},i.buildScrollableStyle=function(){return{}}):(i.subscribeToScrollListener=function(){},i.unsubscribeFromScrollListener=function(){},i.nodeScrollListener=this.infiniteHandleScroll,i.getScrollTop=function(){return t.scrollable?t.scrollable.scrollTop:0},i.setScrollTop=function(e){t.scrollable&&(t.scrollable.scrollTop=e)},i.scrollShouldBeIgnored=function(e){return e.target!==t.scrollable},i.buildScrollableStyle=function(){return Object.assign({},{height:t.computedProps.containerHeight,overflowX:"hidden",overflowY:"scroll",WebkitOverflowScrolling:"touch"},t.computedProps.styles.scrollableStyle||{})}),i},recomputeInternalStateFromProps:function(e){c(e);var t=this.generateComputedProps(e),i=this.generateComputedUtilityFunctions(e),n={};return n.numberOfChildren=o.Children.count(t.children),n.infiniteComputer=l.createInfiniteComputer(t.elementHeight,t.children,t.displayBottomUpwards),void 0!==t.isInfiniteLoading&&(n.isInfiniteLoading=t.isInfiniteLoading),n.preloadBatchSize=t.preloadBatchSize,n.preloadAdditionalHeight=t.preloadAdditionalHeight,n=Object.assign(n,l.recomputeApertureStateFromOptionsAndScrollTop(n,i.getScrollTop())),{computedProps:t,utils:i,newState:n}},componentWillReceiveProps:function(e){var t=this.recomputeInternalStateFromProps(e);this.computedProps=t.computedProps,this.utils=t.utils,this.setState(t.newState)},componentWillUpdate:function(){this.props.displayBottomUpwards&&(this.preservedScrollState=this.utils.getScrollTop()-this.loadingSpinnerHeight)},componentDidUpdate:function(e,t){if(this.loadingSpinnerHeight=this.utils.getLoadingSpinnerHeight(),this.props.displayBottomUpwards){var i=this.getLowestPossibleScrollTop();this.shouldAttachToBottom&&this.utils.getScrollTop()this.state.infiniteComputer.getTotalScrollableHeight()-this.computedProps.containerHeight-this.computedProps.infiniteLoadBeginEdgeOffset},onInfiniteLoad:function(){this.setState({isInfiniteLoading:!0}),this.computedProps.onInfiniteLoad()},handleScroll:function(e){this.shouldAttachToBottom=this.computedProps.displayBottomUpwards&&e>=this.getLowestPossibleScrollTop(),this.manageScrollTimeouts();var t=l.recomputeApertureStateFromOptionsAndScrollTop(this.state,e);this.passedEdgeForInfiniteScroll(e)&&!this.state.isInfiniteLoading?(this.setState(Object.assign({},t)),this.onInfiniteLoad()):this.setState(t)},buildHeightStyle:function(e){return{width:"100%",height:Math.ceil(e)}},render:function(){var e,t=this;e=this.state.numberOfChildren>1?this.computedProps.children.slice(this.state.displayIndexStart,this.state.displayIndexEnd+1):this.computedProps.children;var i={};this.state.isScrolling&&(i.pointerEvents="none");var n=this.state.infiniteComputer.getTopSpacerHeight(this.state.displayIndexStart),r=this.state.infiniteComputer.getBottomSpacerHeight(this.state.displayIndexEnd);if(this.computedProps.displayBottomUpwards){var l=this.computedProps.containerHeight-this.state.infiniteComputer.getTotalScrollableHeight();l>0&&(n=l-this.loadingSpinnerHeight)}var s=void 0===this.computedProps.infiniteLoadBeginEdgeOffset?null:o.createElement("div",{ref:function(e){t.loadingSpinner=e}},this.state.isInfiniteLoading?this.computedProps.loadingSpinnerDelegate:null);return o.createElement("div",{className:this.computedProps.className,ref:function(e){t.scrollable=e},style:this.utils.buildScrollableStyle(),onScroll:this.utils.nodeScrollListener},o.createElement("div",{ref:function(e){t.smoothScrollingWrapper=e},style:i},o.createElement("div",{ref:function(e){t.topSpacer=e},style:this.buildHeightStyle(n)}),this.computedProps.displayBottomUpwards&&s,e,!this.computedProps.displayBottomUpwards&&s,o.createElement("div",{ref:function(e){t.bottomSpacer=e},style:this.buildHeightStyle(r)})))}});t.exports=u,i.Infinite=u}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./utils/checkProps":9,"./utils/establish-polyfills":10,"./utils/infiniteHelpers":11,"./utils/scaleEnum":12,"./utils/types":13,"lodash.isfinite":3,react:void 0}],2:[function(e,t,i){function n(e){return!!e&&"object"==typeof e}function o(e,t){var i=null==e?void 0:e[t];return a(i)?i:void 0}function r(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=S}function l(e){return s(e)&&g.call(e)==u}function s(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function a(e){return null!=e&&(l(e)?y.test(d.call(e)):n(e)&&p.test(e))}var c="[object Array]",u="[object Function]",p=/^\[object .+?Constructor\]$/,f=Object.prototype,d=Function.prototype.toString,h=f.hasOwnProperty,g=f.toString,y=RegExp("^"+d.call(h).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),m=o(Array,"isArray"),S=9007199254740991,b=m||function(e){return n(e)&&r(e.length)&&g.call(e)==c};t.exports=b},{}],3:[function(e,t,i){(function(e){function i(e){return"number"==typeof e&&n(e)}var n=e.isFinite;t.exports=i}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],4:[function(e,t,i){"use strict";function n(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}var o=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;t.exports=Object.assign||function(e,t){for(var i,l,s=n(e),a=1;a0?t-1:t}},{key:"getTopSpacerHeight",value:function(e){return e*this.heightData}},{key:"getBottomSpacerHeight",value:function(e){var t=e+1;return Math.max(0,(this.numberOfChildren-t)*this.heightData)}}]),t}(s);t.exports=a},{"./infiniteComputer.js":7}],7:[function(e,t,i){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o=function(){function e(e,t){for(var i=0;it&&(s=r-1)}return i===n.CLOSEST_LOWER&&a>0?o=a-1:i===n.CLOSEST_HIGHER&&s Date: Wed, 3 May 2017 15:44:39 -0400 Subject: [PATCH 18/78] Add prop-types and create-react-class to travis test --- config/travis/test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/travis/test.sh b/config/travis/test.sh index 995a0f2..f57a36a 100755 --- a/config/travis/test.sh +++ b/config/travis/test.sh @@ -3,7 +3,7 @@ set -e if [ "$TEST" = 1 ]; then - npm install react react-dom + npm install react react-dom prop-types create-react-class npm run test fi; From d5d194f185e63f132d2bac0977c68c4d0da9bf25 Mon Sep 17 00:00:00 2001 From: Ken Gregory Date: Wed, 3 May 2017 16:05:21 -0400 Subject: [PATCH 19/78] Attempt to access global for requires --- dist/react-infinite.js | 1904 ++++++++++++++++++++++++++++++++++++ dist/react-infinite.min.js | 2 + src/react-infinite.jsx | 4 +- src/utils/types.js | 2 +- 4 files changed, 1909 insertions(+), 3 deletions(-) create mode 100644 dist/react-infinite.js create mode 100644 dist/react-infinite.min.js diff --git a/dist/react-infinite.js b/dist/react-infinite.js new file mode 100644 index 0000000..5d14624 --- /dev/null +++ b/dist/react-infinite.js @@ -0,0 +1,1904 @@ +(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Infinite = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o=0||Object.prototype.hasOwnProperty.call(e,o)&&(i[o]=e[o]);return i}var React=global.React||require("react"),PropTypes=global.PropTypes||require("prop-types"),createReactClass=global.createReactClass||require("create-react-class");require("./utils/establish-polyfills");var scaleEnum=require("./utils/scaleEnum"),infiniteHelpers=require("./utils/infiniteHelpers"),_isFinite=require("lodash.isfinite"),preloadType=require("./utils/types").preloadType,checkProps=checkProps=require("./utils/checkProps"),Infinite=createReactClass({propTypes:{children:PropTypes.any,handleScroll:PropTypes.func,preloadBatchSize:preloadType,preloadAdditionalHeight:preloadType,elementHeight:PropTypes.oneOfType([PropTypes.number,PropTypes.arrayOf(PropTypes.number)]).isRequired,containerHeight:PropTypes.number,useWindowAsScrollContainer:PropTypes.bool,displayBottomUpwards:PropTypes.bool.isRequired,infiniteLoadBeginEdgeOffset:PropTypes.number,onInfiniteLoad:PropTypes.func,loadingSpinnerDelegate:PropTypes.node,isInfiniteLoading:PropTypes.bool,timeScrollStateLastsForAfterUserScrolls:PropTypes.number,className:PropTypes.string,styles:PropTypes.shape({scrollableStyle:PropTypes.object}).isRequired},statics:{containerHeightScaleFactor:function(e){if(!_isFinite(e))throw new Error("The scale factor must be a number.");return{type:scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR,amount:e}}},computedProps:{},utils:{},shouldAttachToBottom:!1,preservedScrollState:0,loadingSpinnerHeight:0,deprecationWarned:!1,scrollable:null,topSpacer:null,bottomSpacer:null,smoothScrollingWrapper:null,loadingSpinner:null,getDefaultProps:function(){return{handleScroll:function(){},useWindowAsScrollContainer:!1,onInfiniteLoad:function(){},loadingSpinnerDelegate:React.createElement("div",null),displayBottomUpwards:!1,isInfiniteLoading:!1,timeScrollStateLastsForAfterUserScrolls:150,className:"",styles:{}}},getInitialState:function(){var e=this.recomputeInternalStateFromProps(this.props);this.computedProps=e.computedProps,this.utils=e.utils,this.shouldAttachToBottom=this.props.displayBottomUpwards;var t=e.newState;return t.scrollTimeout=void 0,t.isScrolling=!1,t},generateComputedProps:function(e){var t=e.containerHeight,i=e.preloadBatchSize,o=e.preloadAdditionalHeight,n=_objectWithoutProperties(e,["containerHeight","preloadBatchSize","preloadAdditionalHeight"]),r={};t="number"==typeof t?t:0,r.containerHeight=e.useWindowAsScrollContainer?window.innerHeight:t,void 0!==n.infiniteLoadBeginBottomOffset&&(r.infiniteLoadBeginEdgeOffset=n.infiniteLoadBeginBottomOffset,this.deprecationWarned||(console.error("Warning: React Infinite's infiniteLoadBeginBottomOffset prop\n has been deprecated as of 0.6.0. Please use infiniteLoadBeginEdgeOffset.\n Because this is a rather descriptive name, a simple find and replace\n should suffice."),this.deprecationWarned=!0));var s={type:scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR,amount:.5},l=i&&i.type?i:s;"number"==typeof i?r.preloadBatchSize=i:"object"==typeof l&&l.type===scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR?r.preloadBatchSize=r.containerHeight*l.amount:r.preloadBatchSize=0;var a={type:scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR,amount:1},c=o&&o.type?o:a;return"number"==typeof o?r.preloadAdditionalHeight=o:"object"==typeof c&&c.type===scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR?r.preloadAdditionalHeight=r.containerHeight*c.amount:r.preloadAdditionalHeight=0,Object.assign(n,r)},generateComputedUtilityFunctions:function(e){var t=this,i={};return i.getLoadingSpinnerHeight=function(){var e=0;return t.loadingSpinner&&(e=t.loadingSpinner.offsetHeight||0),e},e.useWindowAsScrollContainer?(i.subscribeToScrollListener=function(){window.addEventListener("scroll",t.infiniteHandleScroll)},i.unsubscribeFromScrollListener=function(){window.removeEventListener("scroll",t.infiniteHandleScroll)},i.nodeScrollListener=function(){},i.getScrollTop=function(){return window.pageYOffset},i.setScrollTop=function(e){window.scroll(window.pageXOffset,e)},i.scrollShouldBeIgnored=function(){return!1},i.buildScrollableStyle=function(){return{}}):(i.subscribeToScrollListener=function(){},i.unsubscribeFromScrollListener=function(){},i.nodeScrollListener=this.infiniteHandleScroll,i.getScrollTop=function(){return t.scrollable?t.scrollable.scrollTop:0},i.setScrollTop=function(e){t.scrollable&&(t.scrollable.scrollTop=e)},i.scrollShouldBeIgnored=function(e){return e.target!==t.scrollable},i.buildScrollableStyle=function(){return Object.assign({},{height:t.computedProps.containerHeight,overflowX:"hidden",overflowY:"scroll",WebkitOverflowScrolling:"touch"},t.computedProps.styles.scrollableStyle||{})}),i},recomputeInternalStateFromProps:function(e){checkProps(e);var t=this.generateComputedProps(e),i=this.generateComputedUtilityFunctions(e),o={};return o.numberOfChildren=React.Children.count(t.children),o.infiniteComputer=infiniteHelpers.createInfiniteComputer(t.elementHeight,t.children,t.displayBottomUpwards),void 0!==t.isInfiniteLoading&&(o.isInfiniteLoading=t.isInfiniteLoading),o.preloadBatchSize=t.preloadBatchSize,o.preloadAdditionalHeight=t.preloadAdditionalHeight,o=Object.assign(o,infiniteHelpers.recomputeApertureStateFromOptionsAndScrollTop(o,i.getScrollTop())),{computedProps:t,utils:i,newState:o}},componentWillReceiveProps:function(e){var t=this.recomputeInternalStateFromProps(e);this.computedProps=t.computedProps,this.utils=t.utils,this.setState(t.newState)},componentWillUpdate:function(){this.props.displayBottomUpwards&&(this.preservedScrollState=this.utils.getScrollTop()-this.loadingSpinnerHeight)},componentDidUpdate:function(e,t){if(this.loadingSpinnerHeight=this.utils.getLoadingSpinnerHeight(),this.props.displayBottomUpwards){var i=this.getLowestPossibleScrollTop();this.shouldAttachToBottom&&this.utils.getScrollTop()this.state.infiniteComputer.getTotalScrollableHeight()-this.computedProps.containerHeight-this.computedProps.infiniteLoadBeginEdgeOffset},onInfiniteLoad:function(){this.setState({isInfiniteLoading:!0}),this.computedProps.onInfiniteLoad()},handleScroll:function(e){this.shouldAttachToBottom=this.computedProps.displayBottomUpwards&&e>=this.getLowestPossibleScrollTop(),this.manageScrollTimeouts();var t=infiniteHelpers.recomputeApertureStateFromOptionsAndScrollTop(this.state,e);this.passedEdgeForInfiniteScroll(e)&&!this.state.isInfiniteLoading?(this.setState(Object.assign({},t)),this.onInfiniteLoad()):this.setState(t)},buildHeightStyle:function(e){return{width:"100%",height:Math.ceil(e)}},render:function(){var e,t=this;e=this.state.numberOfChildren>1?this.computedProps.children.slice(this.state.displayIndexStart,this.state.displayIndexEnd+1):this.computedProps.children;var i={};this.state.isScrolling&&(i.pointerEvents="none");var o=this.state.infiniteComputer.getTopSpacerHeight(this.state.displayIndexStart),n=this.state.infiniteComputer.getBottomSpacerHeight(this.state.displayIndexEnd);if(this.computedProps.displayBottomUpwards){var r=this.computedProps.containerHeight-this.state.infiniteComputer.getTotalScrollableHeight();r>0&&(o=r-this.loadingSpinnerHeight)}var s=void 0===this.computedProps.infiniteLoadBeginEdgeOffset?null:React.createElement("div",{ref:function(e){t.loadingSpinner=e}},this.state.isInfiniteLoading?this.computedProps.loadingSpinnerDelegate:null);return React.createElement("div",{className:this.computedProps.className,ref:function(e){t.scrollable=e},style:this.utils.buildScrollableStyle(),onScroll:this.utils.nodeScrollListener},React.createElement("div",{ref:function(e){t.smoothScrollingWrapper=e},style:i},React.createElement("div",{ref:function(e){t.topSpacer=e},style:this.buildHeightStyle(o)}),this.computedProps.displayBottomUpwards&&s,e,!this.computedProps.displayBottomUpwards&&s,React.createElement("div",{ref:function(e){t.bottomSpacer=e},style:this.buildHeightStyle(n)})))}});module.exports=Infinite,global.Infinite=Infinite; +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{"./utils/checkProps":20,"./utils/establish-polyfills":21,"./utils/infiniteHelpers":22,"./utils/scaleEnum":23,"./utils/types":24,"create-react-class":3,"lodash.isfinite":9,"prop-types":14,"react":undefined}],2:[function(require,module,exports){ +(function (process){ +/** + * Copyright 2013-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + */ + +'use strict'; + +var _assign = require('object-assign'); + +var emptyObject = require('fbjs/lib/emptyObject'); +var _invariant = require('fbjs/lib/invariant'); + +if (process.env.NODE_ENV !== 'production') { + var warning = require('fbjs/lib/warning'); +} + +var MIXINS_KEY = 'mixins'; + +// Helper function to allow the creation of anonymous functions which do not +// have .name set to the name of the variable being assigned to. +function identity(fn) { + return fn; +} + +var ReactPropTypeLocationNames; +if (process.env.NODE_ENV !== 'production') { + ReactPropTypeLocationNames = { + prop: 'prop', + context: 'context', + childContext: 'child context', + }; +} else { + ReactPropTypeLocationNames = {}; +} + +function factory(ReactComponent, isValidElement, ReactNoopUpdateQueue) { + /** + * Policies that describe methods in `ReactClassInterface`. + */ + + + var injectedMixins = []; + + /** + * Composite components are higher-level components that compose other composite + * or host components. + * + * To create a new type of `ReactClass`, pass a specification of + * your new class to `React.createClass`. The only requirement of your class + * specification is that you implement a `render` method. + * + * var MyComponent = React.createClass({ + * render: function() { + * return
Hello World
; + * } + * }); + * + * The class specification supports a specific protocol of methods that have + * special meaning (e.g. `render`). See `ReactClassInterface` for + * more the comprehensive protocol. Any other properties and methods in the + * class specification will be available on the prototype. + * + * @interface ReactClassInterface + * @internal + */ + var ReactClassInterface = { + + /** + * An array of Mixin objects to include when defining your component. + * + * @type {array} + * @optional + */ + mixins: 'DEFINE_MANY', + + /** + * An object containing properties and methods that should be defined on + * the component's constructor instead of its prototype (static methods). + * + * @type {object} + * @optional + */ + statics: 'DEFINE_MANY', + + /** + * Definition of prop types for this component. + * + * @type {object} + * @optional + */ + propTypes: 'DEFINE_MANY', + + /** + * Definition of context types for this component. + * + * @type {object} + * @optional + */ + contextTypes: 'DEFINE_MANY', + + /** + * Definition of context types this component sets for its children. + * + * @type {object} + * @optional + */ + childContextTypes: 'DEFINE_MANY', + + // ==== Definition methods ==== + + /** + * Invoked when the component is mounted. Values in the mapping will be set on + * `this.props` if that prop is not specified (i.e. using an `in` check). + * + * This method is invoked before `getInitialState` and therefore cannot rely + * on `this.state` or use `this.setState`. + * + * @return {object} + * @optional + */ + getDefaultProps: 'DEFINE_MANY_MERGED', + + /** + * Invoked once before the component is mounted. The return value will be used + * as the initial value of `this.state`. + * + * getInitialState: function() { + * return { + * isOn: false, + * fooBaz: new BazFoo() + * } + * } + * + * @return {object} + * @optional + */ + getInitialState: 'DEFINE_MANY_MERGED', + + /** + * @return {object} + * @optional + */ + getChildContext: 'DEFINE_MANY_MERGED', + + /** + * Uses props from `this.props` and state from `this.state` to render the + * structure of the component. + * + * No guarantees are made about when or how often this method is invoked, so + * it must not have side effects. + * + * render: function() { + * var name = this.props.name; + * return
Hello, {name}!
; + * } + * + * @return {ReactComponent} + * @nosideeffects + * @required + */ + render: 'DEFINE_ONCE', + + // ==== Delegate methods ==== + + /** + * Invoked when the component is initially created and about to be mounted. + * This may have side effects, but any external subscriptions or data created + * by this method must be cleaned up in `componentWillUnmount`. + * + * @optional + */ + componentWillMount: 'DEFINE_MANY', + + /** + * Invoked when the component has been mounted and has a DOM representation. + * However, there is no guarantee that the DOM node is in the document. + * + * Use this as an opportunity to operate on the DOM when the component has + * been mounted (initialized and rendered) for the first time. + * + * @param {DOMElement} rootNode DOM element representing the component. + * @optional + */ + componentDidMount: 'DEFINE_MANY', + + /** + * Invoked before the component receives new props. + * + * Use this as an opportunity to react to a prop transition by updating the + * state using `this.setState`. Current props are accessed via `this.props`. + * + * componentWillReceiveProps: function(nextProps, nextContext) { + * this.setState({ + * likesIncreasing: nextProps.likeCount > this.props.likeCount + * }); + * } + * + * NOTE: There is no equivalent `componentWillReceiveState`. An incoming prop + * transition may cause a state change, but the opposite is not true. If you + * need it, you are probably looking for `componentWillUpdate`. + * + * @param {object} nextProps + * @optional + */ + componentWillReceiveProps: 'DEFINE_MANY', + + /** + * Invoked while deciding if the component should be updated as a result of + * receiving new props, state and/or context. + * + * Use this as an opportunity to `return false` when you're certain that the + * transition to the new props/state/context will not require a component + * update. + * + * shouldComponentUpdate: function(nextProps, nextState, nextContext) { + * return !equal(nextProps, this.props) || + * !equal(nextState, this.state) || + * !equal(nextContext, this.context); + * } + * + * @param {object} nextProps + * @param {?object} nextState + * @param {?object} nextContext + * @return {boolean} True if the component should update. + * @optional + */ + shouldComponentUpdate: 'DEFINE_ONCE', + + /** + * Invoked when the component is about to update due to a transition from + * `this.props`, `this.state` and `this.context` to `nextProps`, `nextState` + * and `nextContext`. + * + * Use this as an opportunity to perform preparation before an update occurs. + * + * NOTE: You **cannot** use `this.setState()` in this method. + * + * @param {object} nextProps + * @param {?object} nextState + * @param {?object} nextContext + * @param {ReactReconcileTransaction} transaction + * @optional + */ + componentWillUpdate: 'DEFINE_MANY', + + /** + * Invoked when the component's DOM representation has been updated. + * + * Use this as an opportunity to operate on the DOM when the component has + * been updated. + * + * @param {object} prevProps + * @param {?object} prevState + * @param {?object} prevContext + * @param {DOMElement} rootNode DOM element representing the component. + * @optional + */ + componentDidUpdate: 'DEFINE_MANY', + + /** + * Invoked when the component is about to be removed from its parent and have + * its DOM representation destroyed. + * + * Use this as an opportunity to deallocate any external resources. + * + * NOTE: There is no `componentDidUnmount` since your component will have been + * destroyed by that point. + * + * @optional + */ + componentWillUnmount: 'DEFINE_MANY', + + // ==== Advanced methods ==== + + /** + * Updates the component's currently mounted DOM representation. + * + * By default, this implements React's rendering and reconciliation algorithm. + * Sophisticated clients may wish to override this. + * + * @param {ReactReconcileTransaction} transaction + * @internal + * @overridable + */ + updateComponent: 'OVERRIDE_BASE' + + }; + + /** + * Mapping from class specification keys to special processing functions. + * + * Although these are declared like instance properties in the specification + * when defining classes using `React.createClass`, they are actually static + * and are accessible on the constructor instead of the prototype. Despite + * being static, they must be defined outside of the "statics" key under + * which all other static methods are defined. + */ + var RESERVED_SPEC_KEYS = { + displayName: function (Constructor, displayName) { + Constructor.displayName = displayName; + }, + mixins: function (Constructor, mixins) { + if (mixins) { + for (var i = 0; i < mixins.length; i++) { + mixSpecIntoComponent(Constructor, mixins[i]); + } + } + }, + childContextTypes: function (Constructor, childContextTypes) { + if (process.env.NODE_ENV !== 'production') { + validateTypeDef(Constructor, childContextTypes, 'childContext'); + } + Constructor.childContextTypes = _assign({}, Constructor.childContextTypes, childContextTypes); + }, + contextTypes: function (Constructor, contextTypes) { + if (process.env.NODE_ENV !== 'production') { + validateTypeDef(Constructor, contextTypes, 'context'); + } + Constructor.contextTypes = _assign({}, Constructor.contextTypes, contextTypes); + }, + /** + * Special case getDefaultProps which should move into statics but requires + * automatic merging. + */ + getDefaultProps: function (Constructor, getDefaultProps) { + if (Constructor.getDefaultProps) { + Constructor.getDefaultProps = createMergedResultFunction(Constructor.getDefaultProps, getDefaultProps); + } else { + Constructor.getDefaultProps = getDefaultProps; + } + }, + propTypes: function (Constructor, propTypes) { + if (process.env.NODE_ENV !== 'production') { + validateTypeDef(Constructor, propTypes, 'prop'); + } + Constructor.propTypes = _assign({}, Constructor.propTypes, propTypes); + }, + statics: function (Constructor, statics) { + mixStaticSpecIntoComponent(Constructor, statics); + }, + autobind: function () {} }; + + function validateTypeDef(Constructor, typeDef, location) { + for (var propName in typeDef) { + if (typeDef.hasOwnProperty(propName)) { + // use a warning instead of an _invariant so components + // don't show up in prod but only in __DEV__ + process.env.NODE_ENV !== 'production' ? warning(typeof typeDef[propName] === 'function', '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'React.PropTypes.', Constructor.displayName || 'ReactClass', ReactPropTypeLocationNames[location], propName) : void 0; + } + } + } + + function validateMethodOverride(isAlreadyDefined, name) { + var specPolicy = ReactClassInterface.hasOwnProperty(name) ? ReactClassInterface[name] : null; + + // Disallow overriding of base class methods unless explicitly allowed. + if (ReactClassMixin.hasOwnProperty(name)) { + _invariant(specPolicy === 'OVERRIDE_BASE', 'ReactClassInterface: You are attempting to override ' + '`%s` from your class specification. Ensure that your method names ' + 'do not overlap with React methods.', name); + } + + // Disallow defining methods more than once unless explicitly allowed. + if (isAlreadyDefined) { + _invariant(specPolicy === 'DEFINE_MANY' || specPolicy === 'DEFINE_MANY_MERGED', 'ReactClassInterface: You are attempting to define ' + '`%s` on your component more than once. This conflict may be due ' + 'to a mixin.', name); + } + } + + /** + * Mixin helper which handles policy validation and reserved + * specification keys when building React classes. + */ + function mixSpecIntoComponent(Constructor, spec) { + if (!spec) { + if (process.env.NODE_ENV !== 'production') { + var typeofSpec = typeof spec; + var isMixinValid = typeofSpec === 'object' && spec !== null; + + process.env.NODE_ENV !== 'production' ? warning(isMixinValid, '%s: You\'re attempting to include a mixin that is either null ' + 'or not an object. Check the mixins included by the component, ' + 'as well as any mixins they include themselves. ' + 'Expected object but got %s.', Constructor.displayName || 'ReactClass', spec === null ? null : typeofSpec) : void 0; + } + + return; + } + + _invariant(typeof spec !== 'function', 'ReactClass: You\'re attempting to ' + 'use a component class or function as a mixin. Instead, just use a ' + 'regular object.'); + _invariant(!isValidElement(spec), 'ReactClass: You\'re attempting to ' + 'use a component as a mixin. Instead, just use a regular object.'); + + var proto = Constructor.prototype; + var autoBindPairs = proto.__reactAutoBindPairs; + + // By handling mixins before any other properties, we ensure the same + // chaining order is applied to methods with DEFINE_MANY policy, whether + // mixins are listed before or after these methods in the spec. + if (spec.hasOwnProperty(MIXINS_KEY)) { + RESERVED_SPEC_KEYS.mixins(Constructor, spec.mixins); + } + + for (var name in spec) { + if (!spec.hasOwnProperty(name)) { + continue; + } + + if (name === MIXINS_KEY) { + // We have already handled mixins in a special case above. + continue; + } + + var property = spec[name]; + var isAlreadyDefined = proto.hasOwnProperty(name); + validateMethodOverride(isAlreadyDefined, name); + + if (RESERVED_SPEC_KEYS.hasOwnProperty(name)) { + RESERVED_SPEC_KEYS[name](Constructor, property); + } else { + // Setup methods on prototype: + // The following member methods should not be automatically bound: + // 1. Expected ReactClass methods (in the "interface"). + // 2. Overridden methods (that were mixed in). + var isReactClassMethod = ReactClassInterface.hasOwnProperty(name); + var isFunction = typeof property === 'function'; + var shouldAutoBind = isFunction && !isReactClassMethod && !isAlreadyDefined && spec.autobind !== false; + + if (shouldAutoBind) { + autoBindPairs.push(name, property); + proto[name] = property; + } else { + if (isAlreadyDefined) { + var specPolicy = ReactClassInterface[name]; + + // These cases should already be caught by validateMethodOverride. + _invariant(isReactClassMethod && (specPolicy === 'DEFINE_MANY_MERGED' || specPolicy === 'DEFINE_MANY'), 'ReactClass: Unexpected spec policy %s for key %s ' + 'when mixing in component specs.', specPolicy, name); + + // For methods which are defined more than once, call the existing + // methods before calling the new property, merging if appropriate. + if (specPolicy === 'DEFINE_MANY_MERGED') { + proto[name] = createMergedResultFunction(proto[name], property); + } else if (specPolicy === 'DEFINE_MANY') { + proto[name] = createChainedFunction(proto[name], property); + } + } else { + proto[name] = property; + if (process.env.NODE_ENV !== 'production') { + // Add verbose displayName to the function, which helps when looking + // at profiling tools. + if (typeof property === 'function' && spec.displayName) { + proto[name].displayName = spec.displayName + '_' + name; + } + } + } + } + } + } + } + + function mixStaticSpecIntoComponent(Constructor, statics) { + if (!statics) { + return; + } + for (var name in statics) { + var property = statics[name]; + if (!statics.hasOwnProperty(name)) { + continue; + } + + var isReserved = name in RESERVED_SPEC_KEYS; + _invariant(!isReserved, 'ReactClass: You are attempting to define a reserved ' + 'property, `%s`, that shouldn\'t be on the "statics" key. Define it ' + 'as an instance property instead; it will still be accessible on the ' + 'constructor.', name); + + var isInherited = name in Constructor; + _invariant(!isInherited, 'ReactClass: You are attempting to define ' + '`%s` on your component more than once. This conflict may be ' + 'due to a mixin.', name); + Constructor[name] = property; + } + } + + /** + * Merge two objects, but throw if both contain the same key. + * + * @param {object} one The first object, which is mutated. + * @param {object} two The second object + * @return {object} one after it has been mutated to contain everything in two. + */ + function mergeIntoWithNoDuplicateKeys(one, two) { + _invariant(one && two && typeof one === 'object' && typeof two === 'object', 'mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.'); + + for (var key in two) { + if (two.hasOwnProperty(key)) { + _invariant(one[key] === undefined, 'mergeIntoWithNoDuplicateKeys(): ' + 'Tried to merge two objects with the same key: `%s`. This conflict ' + 'may be due to a mixin; in particular, this may be caused by two ' + 'getInitialState() or getDefaultProps() methods returning objects ' + 'with clashing keys.', key); + one[key] = two[key]; + } + } + return one; + } + + /** + * Creates a function that invokes two functions and merges their return values. + * + * @param {function} one Function to invoke first. + * @param {function} two Function to invoke second. + * @return {function} Function that invokes the two argument functions. + * @private + */ + function createMergedResultFunction(one, two) { + return function mergedResult() { + var a = one.apply(this, arguments); + var b = two.apply(this, arguments); + if (a == null) { + return b; + } else if (b == null) { + return a; + } + var c = {}; + mergeIntoWithNoDuplicateKeys(c, a); + mergeIntoWithNoDuplicateKeys(c, b); + return c; + }; + } + + /** + * Creates a function that invokes two functions and ignores their return vales. + * + * @param {function} one Function to invoke first. + * @param {function} two Function to invoke second. + * @return {function} Function that invokes the two argument functions. + * @private + */ + function createChainedFunction(one, two) { + return function chainedFunction() { + one.apply(this, arguments); + two.apply(this, arguments); + }; + } + + /** + * Binds a method to the component. + * + * @param {object} component Component whose method is going to be bound. + * @param {function} method Method to be bound. + * @return {function} The bound method. + */ + function bindAutoBindMethod(component, method) { + var boundMethod = method.bind(component); + if (process.env.NODE_ENV !== 'production') { + boundMethod.__reactBoundContext = component; + boundMethod.__reactBoundMethod = method; + boundMethod.__reactBoundArguments = null; + var componentName = component.constructor.displayName; + var _bind = boundMethod.bind; + boundMethod.bind = function (newThis) { + for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + + // User is trying to bind() an autobound method; we effectively will + // ignore the value of "this" that the user is trying to use, so + // let's warn. + if (newThis !== component && newThis !== null) { + process.env.NODE_ENV !== 'production' ? warning(false, 'bind(): React component methods may only be bound to the ' + 'component instance. See %s', componentName) : void 0; + } else if (!args.length) { + process.env.NODE_ENV !== 'production' ? warning(false, 'bind(): You are binding a component method to the component. ' + 'React does this for you automatically in a high-performance ' + 'way, so you can safely remove this call. See %s', componentName) : void 0; + return boundMethod; + } + var reboundMethod = _bind.apply(boundMethod, arguments); + reboundMethod.__reactBoundContext = component; + reboundMethod.__reactBoundMethod = method; + reboundMethod.__reactBoundArguments = args; + return reboundMethod; + }; + } + return boundMethod; + } + + /** + * Binds all auto-bound methods in a component. + * + * @param {object} component Component whose method is going to be bound. + */ + function bindAutoBindMethods(component) { + var pairs = component.__reactAutoBindPairs; + for (var i = 0; i < pairs.length; i += 2) { + var autoBindKey = pairs[i]; + var method = pairs[i + 1]; + component[autoBindKey] = bindAutoBindMethod(component, method); + } + } + + var IsMountedMixin = { + componentDidMount: function () { + this.__isMounted = true; + }, + componentWillUnmount: function () { + this.__isMounted = false; + } + }; + + /** + * Add more to the ReactClass base class. These are all legacy features and + * therefore not already part of the modern ReactComponent. + */ + var ReactClassMixin = { + + /** + * TODO: This will be deprecated because state should always keep a consistent + * type signature and the only use case for this, is to avoid that. + */ + replaceState: function (newState, callback) { + this.updater.enqueueReplaceState(this, newState, callback); + }, + + /** + * Checks whether or not this composite component is mounted. + * @return {boolean} True if mounted, false otherwise. + * @protected + * @final + */ + isMounted: function () { + if (process.env.NODE_ENV !== 'production') { + process.env.NODE_ENV !== 'production' ? warning(this.__didWarnIsMounted, '%s: isMounted is deprecated. Instead, make sure to clean up ' + 'subscriptions and pending requests in componentWillUnmount to ' + 'prevent memory leaks.', this.constructor && this.constructor.displayName || this.name || 'Component') : void 0; + this.__didWarnIsMounted = true; + } + return !!this.__isMounted; + } + }; + + var ReactClassComponent = function () {}; + _assign(ReactClassComponent.prototype, ReactComponent.prototype, ReactClassMixin); + + /** + * Creates a composite component class given a class specification. + * See https://facebook.github.io/react/docs/top-level-api.html#react.createclass + * + * @param {object} spec Class specification (which must define `render`). + * @return {function} Component constructor function. + * @public + */ + function createClass(spec) { + // To keep our warnings more understandable, we'll use a little hack here to + // ensure that Constructor.name !== 'Constructor'. This makes sure we don't + // unnecessarily identify a class without displayName as 'Constructor'. + var Constructor = identity(function (props, context, updater) { + // This constructor gets overridden by mocks. The argument is used + // by mocks to assert on what gets mounted. + + if (process.env.NODE_ENV !== 'production') { + process.env.NODE_ENV !== 'production' ? warning(this instanceof Constructor, 'Something is calling a React component directly. Use a factory or ' + 'JSX instead. See: https://fb.me/react-legacyfactory') : void 0; + } + + // Wire up auto-binding + if (this.__reactAutoBindPairs.length) { + bindAutoBindMethods(this); + } + + this.props = props; + this.context = context; + this.refs = emptyObject; + this.updater = updater || ReactNoopUpdateQueue; + + this.state = null; + + // ReactClasses doesn't have constructors. Instead, they use the + // getInitialState and componentWillMount methods for initialization. + + var initialState = this.getInitialState ? this.getInitialState() : null; + if (process.env.NODE_ENV !== 'production') { + // We allow auto-mocks to proceed as if they're returning null. + if (initialState === undefined && this.getInitialState._isMockFunction) { + // This is probably bad practice. Consider warning here and + // deprecating this convenience. + initialState = null; + } + } + _invariant(typeof initialState === 'object' && !Array.isArray(initialState), '%s.getInitialState(): must return an object or null', Constructor.displayName || 'ReactCompositeComponent'); + + this.state = initialState; + }); + Constructor.prototype = new ReactClassComponent(); + Constructor.prototype.constructor = Constructor; + Constructor.prototype.__reactAutoBindPairs = []; + + injectedMixins.forEach(mixSpecIntoComponent.bind(null, Constructor)); + + mixSpecIntoComponent(Constructor, IsMountedMixin); + mixSpecIntoComponent(Constructor, spec); + + // Initialize the defaultProps property after all mixins have been merged. + if (Constructor.getDefaultProps) { + Constructor.defaultProps = Constructor.getDefaultProps(); + } + + if (process.env.NODE_ENV !== 'production') { + // This is a tag to indicate that the use of these method names is ok, + // since it's used with createClass. If it's not, then it's likely a + // mistake so we'll warn you to use the static property, property + // initializer or constructor respectively. + if (Constructor.getDefaultProps) { + Constructor.getDefaultProps.isReactClassApproved = {}; + } + if (Constructor.prototype.getInitialState) { + Constructor.prototype.getInitialState.isReactClassApproved = {}; + } + } + + _invariant(Constructor.prototype.render, 'createClass(...): Class specification must implement a `render` method.'); + + if (process.env.NODE_ENV !== 'production') { + process.env.NODE_ENV !== 'production' ? warning(!Constructor.prototype.componentShouldUpdate, '%s has a method called ' + 'componentShouldUpdate(). Did you mean shouldComponentUpdate()? ' + 'The name is phrased as a question because the function is ' + 'expected to return a value.', spec.displayName || 'A component') : void 0; + process.env.NODE_ENV !== 'production' ? warning(!Constructor.prototype.componentWillRecieveProps, '%s has a method called ' + 'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?', spec.displayName || 'A component') : void 0; + } + + // Reduce time spent doing lookups by setting these on the prototype. + for (var methodName in ReactClassInterface) { + if (!Constructor.prototype[methodName]) { + Constructor.prototype[methodName] = null; + } + } + + return Constructor; + } + + return createClass; +} + +module.exports = factory; + +}).call(this,require('_process')) +},{"_process":11,"fbjs/lib/emptyObject":5,"fbjs/lib/invariant":6,"fbjs/lib/warning":7,"object-assign":10}],3:[function(require,module,exports){ +/** + * Copyright 2013-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + */ + +'use strict'; + +var React = require('react'); +var factory = require('./factory'); + +// Hack to grab NoopUpdateQueue from isomorphic React +var ReactNoopUpdateQueue = new React.Component().updater; + +module.exports = factory( + React.Component, + React.isValidElement, + ReactNoopUpdateQueue +); + +},{"./factory":2,"react":undefined}],4:[function(require,module,exports){ +"use strict"; + +/** + * Copyright (c) 2013-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * + */ + +function makeEmptyFunction(arg) { + return function () { + return arg; + }; +} + +/** + * This function accepts and discards inputs; it has no side effects. This is + * primarily useful idiomatically for overridable function endpoints which + * always need to be callable, since JS lacks a null-call idiom ala Cocoa. + */ +var emptyFunction = function emptyFunction() {}; + +emptyFunction.thatReturns = makeEmptyFunction; +emptyFunction.thatReturnsFalse = makeEmptyFunction(false); +emptyFunction.thatReturnsTrue = makeEmptyFunction(true); +emptyFunction.thatReturnsNull = makeEmptyFunction(null); +emptyFunction.thatReturnsThis = function () { + return this; +}; +emptyFunction.thatReturnsArgument = function (arg) { + return arg; +}; + +module.exports = emptyFunction; +},{}],5:[function(require,module,exports){ +(function (process){ +/** + * Copyright (c) 2013-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + */ + +'use strict'; + +var emptyObject = {}; + +if (process.env.NODE_ENV !== 'production') { + Object.freeze(emptyObject); +} + +module.exports = emptyObject; +}).call(this,require('_process')) +},{"_process":11}],6:[function(require,module,exports){ +(function (process){ +/** + * Copyright (c) 2013-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + */ + +'use strict'; + +/** + * Use invariant() to assert state which your program assumes to be true. + * + * Provide sprintf-style format (only %s is supported) and arguments + * to provide information about what broke and what you were + * expecting. + * + * The invariant message will be stripped in production, but the invariant + * will remain to ensure logic does not differ in production. + */ + +var validateFormat = function validateFormat(format) {}; + +if (process.env.NODE_ENV !== 'production') { + validateFormat = function validateFormat(format) { + if (format === undefined) { + throw new Error('invariant requires an error message argument'); + } + }; +} + +function invariant(condition, format, a, b, c, d, e, f) { + validateFormat(format); + + if (!condition) { + var error; + if (format === undefined) { + error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.'); + } else { + var args = [a, b, c, d, e, f]; + var argIndex = 0; + error = new Error(format.replace(/%s/g, function () { + return args[argIndex++]; + })); + error.name = 'Invariant Violation'; + } + + error.framesToPop = 1; // we don't care about invariant's own frame + throw error; + } +} + +module.exports = invariant; +}).call(this,require('_process')) +},{"_process":11}],7:[function(require,module,exports){ +(function (process){ +/** + * Copyright 2014-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + */ + +'use strict'; + +var emptyFunction = require('./emptyFunction'); + +/** + * Similar to invariant but only logs a warning if the condition is not met. + * This can be used to log issues in development environments in critical + * paths. Removing the logging code for production environments will keep the + * same logic and follow the same code paths. + */ + +var warning = emptyFunction; + +if (process.env.NODE_ENV !== 'production') { + (function () { + var printWarning = function printWarning(format) { + for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + + var argIndex = 0; + var message = 'Warning: ' + format.replace(/%s/g, function () { + return args[argIndex++]; + }); + if (typeof console !== 'undefined') { + console.error(message); + } + try { + // --- Welcome to debugging React --- + // This error was thrown as a convenience so that you can use this stack + // to find the callsite that caused this warning to fire. + throw new Error(message); + } catch (x) {} + }; + + warning = function warning(condition, format) { + if (format === undefined) { + throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument'); + } + + if (format.indexOf('Failed Composite propType: ') === 0) { + return; // Ignore CompositeComponent proptype check. + } + + if (!condition) { + for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) { + args[_key2 - 2] = arguments[_key2]; + } + + printWarning.apply(undefined, [format].concat(args)); + } + }; + })(); +} + +module.exports = warning; +}).call(this,require('_process')) +},{"./emptyFunction":4,"_process":11}],8:[function(require,module,exports){ +/** + * lodash 3.0.4 (Custom Build) + * Build: `lodash modern modularize exports="npm" -o ./` + * Copyright 2012-2015 The Dojo Foundation + * Based on Underscore.js 1.8.3 + * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ + +/** `Object#toString` result references. */ +var arrayTag = '[object Array]', + funcTag = '[object Function]'; + +/** Used to detect host constructors (Safari > 5). */ +var reIsHostCtor = /^\[object .+?Constructor\]$/; + +/** + * Checks if `value` is object-like. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + */ +function isObjectLike(value) { + return !!value && typeof value == 'object'; +} + +/** Used for native method references. */ +var objectProto = Object.prototype; + +/** Used to resolve the decompiled source of functions. */ +var fnToString = Function.prototype.toString; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * of values. + */ +var objToString = objectProto.toString; + +/** Used to detect if a method is native. */ +var reIsNative = RegExp('^' + + fnToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g, '\\$&') + .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' +); + +/* Native method references for those with the same name as other `lodash` methods. */ +var nativeIsArray = getNative(Array, 'isArray'); + +/** + * Used as the [maximum length](http://ecma-international.org/ecma-262/6.0/#sec-number.max_safe_integer) + * of an array-like value. + */ +var MAX_SAFE_INTEGER = 9007199254740991; + +/** + * Gets the native function at `key` of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {string} key The key of the method to get. + * @returns {*} Returns the function if it's native, else `undefined`. + */ +function getNative(object, key) { + var value = object == null ? undefined : object[key]; + return isNative(value) ? value : undefined; +} + +/** + * Checks if `value` is a valid array-like length. + * + * **Note:** This function is based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + */ +function isLength(value) { + return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; +} + +/** + * Checks if `value` is classified as an `Array` object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isArray([1, 2, 3]); + * // => true + * + * _.isArray(function() { return arguments; }()); + * // => false + */ +var isArray = nativeIsArray || function(value) { + return isObjectLike(value) && isLength(value.length) && objToString.call(value) == arrayTag; +}; + +/** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ +function isFunction(value) { + // The use of `Object#toString` avoids issues with the `typeof` operator + // in older versions of Chrome and Safari which return 'function' for regexes + // and Safari 8 equivalents which return 'object' for typed array constructors. + return isObject(value) && objToString.call(value) == funcTag; +} + +/** + * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. + * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(1); + * // => false + */ +function isObject(value) { + // Avoid a V8 JIT bug in Chrome 19-20. + // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. + var type = typeof value; + return !!value && (type == 'object' || type == 'function'); +} + +/** + * Checks if `value` is a native function. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, else `false`. + * @example + * + * _.isNative(Array.prototype.push); + * // => true + * + * _.isNative(_); + * // => false + */ +function isNative(value) { + if (value == null) { + return false; + } + if (isFunction(value)) { + return reIsNative.test(fnToString.call(value)); + } + return isObjectLike(value) && reIsHostCtor.test(value); +} + +module.exports = isArray; + +},{}],9:[function(require,module,exports){ +(function (global){ +/** + * lodash 3.2.0 (Custom Build) + * Build: `lodash modern modularize exports="npm" -o ./` + * Copyright 2012-2015 The Dojo Foundation + * Based on Underscore.js 1.8.3 + * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ + +/* Native method references for those with the same name as other `lodash` methods. */ +var nativeIsFinite = global.isFinite; + +/** + * Checks if `value` is a finite primitive number. + * + * **Note:** This method is based on [`Number.isFinite`](http://ecma-international.org/ecma-262/6.0/#sec-number.isfinite). + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a finite number, else `false`. + * @example + * + * _.isFinite(10); + * // => true + * + * _.isFinite('10'); + * // => false + * + * _.isFinite(true); + * // => false + * + * _.isFinite(Object(10)); + * // => false + * + * _.isFinite(Infinity); + * // => false + */ +function isFinite(value) { + return typeof value == 'number' && nativeIsFinite(value); +} + +module.exports = isFinite; + +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{}],10:[function(require,module,exports){ +/* eslint-disable no-unused-vars */ +'use strict'; +var hasOwnProperty = Object.prototype.hasOwnProperty; +var propIsEnumerable = Object.prototype.propertyIsEnumerable; + +function toObject(val) { + if (val === null || val === undefined) { + throw new TypeError('Object.assign cannot be called with null or undefined'); + } + + return Object(val); +} + +module.exports = Object.assign || function (target, source) { + var from; + var to = toObject(target); + var symbols; + + for (var s = 1; s < arguments.length; s++) { + from = Object(arguments[s]); + + for (var key in from) { + if (hasOwnProperty.call(from, key)) { + to[key] = from[key]; + } + } + + if (Object.getOwnPropertySymbols) { + symbols = Object.getOwnPropertySymbols(from); + for (var i = 0; i < symbols.length; i++) { + if (propIsEnumerable.call(from, symbols[i])) { + to[symbols[i]] = from[symbols[i]]; + } + } + } + } + + return to; +}; + +},{}],11:[function(require,module,exports){ +// shim for using process in browser + +var process = module.exports = {}; +var queue = []; +var draining = false; + +function drainQueue() { + if (draining) { + return; + } + draining = true; + var currentQueue; + var len = queue.length; + while(len) { + currentQueue = queue; + queue = []; + var i = -1; + while (++i < len) { + currentQueue[i](); + } + len = queue.length; + } + draining = false; +} +process.nextTick = function (fun) { + queue.push(fun); + if (!draining) { + setTimeout(drainQueue, 0); + } +}; + +process.title = 'browser'; +process.browser = true; +process.env = {}; +process.argv = []; +process.version = ''; // empty string to avoid regexp issues +process.versions = {}; + +function noop() {} + +process.on = noop; +process.addListener = noop; +process.once = noop; +process.off = noop; +process.removeListener = noop; +process.removeAllListeners = noop; +process.emit = noop; + +process.binding = function (name) { + throw new Error('process.binding is not supported'); +}; + +// TODO(shtylman) +process.cwd = function () { return '/' }; +process.chdir = function (dir) { + throw new Error('process.chdir is not supported'); +}; +process.umask = function() { return 0; }; + +},{}],12:[function(require,module,exports){ +(function (process){ +/** + * Copyright 2013-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + +'use strict'; + +var invariant = require('fbjs/lib/invariant'); +var warning = require('fbjs/lib/warning'); + +var ReactPropTypesSecret = require('./lib/ReactPropTypesSecret'); + +var loggedTypeFailures = {}; + +/** + * Assert that the values match with the type specs. + * Error messages are memorized and will only be shown once. + * + * @param {object} typeSpecs Map of name to a ReactPropType + * @param {object} values Runtime values that need to be type-checked + * @param {string} location e.g. "prop", "context", "child context" + * @param {string} componentName Name of the component for error messages. + * @param {?Function} getStack Returns the component stack. + * @private + */ +function checkPropTypes(typeSpecs, values, location, componentName, getStack) { + if (process.env.NODE_ENV !== 'production') { + for (var typeSpecName in typeSpecs) { + if (typeSpecs.hasOwnProperty(typeSpecName)) { + var error; + // Prop type validation may throw. In case they do, we don't want to + // fail the render phase where it didn't fail before. So we log it. + // After these have been cleaned up, we'll let them throw. + try { + // This is intentionally an invariant that gets caught. It's the same + // behavior as without this statement except with a better message. + invariant(typeof typeSpecs[typeSpecName] === 'function', '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'React.PropTypes.', componentName || 'React class', location, typeSpecName); + error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret); + } catch (ex) { + error = ex; + } + process.env.NODE_ENV !== 'production' ? warning(!error || error instanceof Error, '%s: type specification of %s `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error) : void 0; + if (error instanceof Error && !(error.message in loggedTypeFailures)) { + // Only monitor this failure once because there tends to be a lot of the + // same error. + loggedTypeFailures[error.message] = true; + + var stack = getStack ? getStack() : ''; + + process.env.NODE_ENV !== 'production' ? warning(false, 'Failed %s type: %s%s', location, error.message, stack != null ? stack : '') : void 0; + } + } + } + } +} + +module.exports = checkPropTypes; + +}).call(this,require('_process')) +},{"./lib/ReactPropTypesSecret":15,"_process":11,"fbjs/lib/invariant":6,"fbjs/lib/warning":7}],13:[function(require,module,exports){ +(function (process){ +/** + * Copyright 2013-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + +'use strict'; + +var emptyFunction = require('fbjs/lib/emptyFunction'); +var invariant = require('fbjs/lib/invariant'); +var warning = require('fbjs/lib/warning'); + +var ReactPropTypesSecret = require('./lib/ReactPropTypesSecret'); +var checkPropTypes = require('./checkPropTypes'); + +module.exports = function (isValidElement) { + /* global Symbol */ + var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator; + var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec. + + /** + * Returns the iterator method function contained on the iterable object. + * + * Be sure to invoke the function with the iterable as context: + * + * var iteratorFn = getIteratorFn(myIterable); + * if (iteratorFn) { + * var iterator = iteratorFn.call(myIterable); + * ... + * } + * + * @param {?object} maybeIterable + * @return {?function} + */ + function getIteratorFn(maybeIterable) { + var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]); + if (typeof iteratorFn === 'function') { + return iteratorFn; + } + } + + /** + * Collection of methods that allow declaration and validation of props that are + * supplied to React components. Example usage: + * + * var Props = require('ReactPropTypes'); + * var MyArticle = React.createClass({ + * propTypes: { + * // An optional string prop named "description". + * description: Props.string, + * + * // A required enum prop named "category". + * category: Props.oneOf(['News','Photos']).isRequired, + * + * // A prop named "dialog" that requires an instance of Dialog. + * dialog: Props.instanceOf(Dialog).isRequired + * }, + * render: function() { ... } + * }); + * + * A more formal specification of how these methods are used: + * + * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...) + * decl := ReactPropTypes.{type}(.isRequired)? + * + * Each and every declaration produces a function with the same signature. This + * allows the creation of custom validation functions. For example: + * + * var MyLink = React.createClass({ + * propTypes: { + * // An optional string or URI prop named "href". + * href: function(props, propName, componentName) { + * var propValue = props[propName]; + * if (propValue != null && typeof propValue !== 'string' && + * !(propValue instanceof URI)) { + * return new Error( + * 'Expected a string or an URI for ' + propName + ' in ' + + * componentName + * ); + * } + * } + * }, + * render: function() {...} + * }); + * + * @internal + */ + + var ANONYMOUS = '<>'; + + var ReactPropTypes; + + if (process.env.NODE_ENV !== 'production') { + // Keep in sync with production version below + ReactPropTypes = { + array: createPrimitiveTypeChecker('array'), + bool: createPrimitiveTypeChecker('boolean'), + func: createPrimitiveTypeChecker('function'), + number: createPrimitiveTypeChecker('number'), + object: createPrimitiveTypeChecker('object'), + string: createPrimitiveTypeChecker('string'), + symbol: createPrimitiveTypeChecker('symbol'), + + any: createAnyTypeChecker(), + arrayOf: createArrayOfTypeChecker, + element: createElementTypeChecker(), + instanceOf: createInstanceTypeChecker, + node: createNodeChecker(), + objectOf: createObjectOfTypeChecker, + oneOf: createEnumTypeChecker, + oneOfType: createUnionTypeChecker, + shape: createShapeTypeChecker + }; + } else { + var productionTypeChecker = function () { + invariant(false, 'React.PropTypes type checking code is stripped in production.'); + }; + productionTypeChecker.isRequired = productionTypeChecker; + var getProductionTypeChecker = function () { + return productionTypeChecker; + }; + // Keep in sync with development version above + ReactPropTypes = { + array: productionTypeChecker, + bool: productionTypeChecker, + func: productionTypeChecker, + number: productionTypeChecker, + object: productionTypeChecker, + string: productionTypeChecker, + symbol: productionTypeChecker, + + any: productionTypeChecker, + arrayOf: getProductionTypeChecker, + element: productionTypeChecker, + instanceOf: getProductionTypeChecker, + node: productionTypeChecker, + objectOf: getProductionTypeChecker, + oneOf: getProductionTypeChecker, + oneOfType: getProductionTypeChecker, + shape: getProductionTypeChecker + }; + } + + /** + * inlined Object.is polyfill to avoid requiring consumers ship their own + * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is + */ + /*eslint-disable no-self-compare*/ + function is(x, y) { + // SameValue algorithm + if (x === y) { + // Steps 1-5, 7-10 + // Steps 6.b-6.e: +0 != -0 + return x !== 0 || 1 / x === 1 / y; + } else { + // Step 6.a: NaN == NaN + return x !== x && y !== y; + } + } + /*eslint-enable no-self-compare*/ + + /** + * We use an Error-like object for backward compatibility as people may call + * PropTypes directly and inspect their output. However, we don't use real + * Errors anymore. We don't inspect their stack anyway, and creating them + * is prohibitively expensive if they are created too often, such as what + * happens in oneOfType() for any type before the one that matched. + */ + function PropTypeError(message) { + this.message = message; + this.stack = ''; + } + // Make `instanceof Error` still work for returned errors. + PropTypeError.prototype = Error.prototype; + + function createChainableTypeChecker(validate) { + if (process.env.NODE_ENV !== 'production') { + var manualPropTypeCallCache = {}; + } + function checkType(isRequired, props, propName, componentName, location, propFullName, secret) { + componentName = componentName || ANONYMOUS; + propFullName = propFullName || propName; + if (process.env.NODE_ENV !== 'production') { + if (secret !== ReactPropTypesSecret && typeof console !== 'undefined') { + var cacheKey = componentName + ':' + propName; + if (!manualPropTypeCallCache[cacheKey]) { + process.env.NODE_ENV !== 'production' ? warning(false, 'You are manually calling a React.PropTypes validation ' + 'function for the `%s` prop on `%s`. This is deprecated ' + 'and will not work in production with the next major version. ' + 'You may be seeing this warning due to a third-party PropTypes ' + 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.', propFullName, componentName) : void 0; + manualPropTypeCallCache[cacheKey] = true; + } + } + } + if (props[propName] == null) { + if (isRequired) { + if (props[propName] === null) { + return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.')); + } + return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.')); + } + return null; + } else { + return validate(props, propName, componentName, location, propFullName); + } + } + + var chainedCheckType = checkType.bind(null, false); + chainedCheckType.isRequired = checkType.bind(null, true); + + return chainedCheckType; + } + + function createPrimitiveTypeChecker(expectedType) { + function validate(props, propName, componentName, location, propFullName, secret) { + var propValue = props[propName]; + var propType = getPropType(propValue); + if (propType !== expectedType) { + // `propValue` being instance of, say, date/regexp, pass the 'object' + // check, but we can offer a more precise error message here rather than + // 'of type `object`'. + var preciseType = getPreciseType(propValue); + + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.')); + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createAnyTypeChecker() { + return createChainableTypeChecker(emptyFunction.thatReturnsNull); + } + + function createArrayOfTypeChecker(typeChecker) { + function validate(props, propName, componentName, location, propFullName) { + if (typeof typeChecker !== 'function') { + return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.'); + } + var propValue = props[propName]; + if (!Array.isArray(propValue)) { + var propType = getPropType(propValue); + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.')); + } + for (var i = 0; i < propValue.length; i++) { + var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret); + if (error instanceof Error) { + return error; + } + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createElementTypeChecker() { + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName]; + if (!isValidElement(propValue)) { + var propType = getPropType(propValue); + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.')); + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createInstanceTypeChecker(expectedClass) { + function validate(props, propName, componentName, location, propFullName) { + if (!(props[propName] instanceof expectedClass)) { + var expectedClassName = expectedClass.name || ANONYMOUS; + var actualClassName = getClassName(props[propName]); + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.')); + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createEnumTypeChecker(expectedValues) { + if (!Array.isArray(expectedValues)) { + process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid argument supplied to oneOf, expected an instance of array.') : void 0; + return emptyFunction.thatReturnsNull; + } + + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName]; + for (var i = 0; i < expectedValues.length; i++) { + if (is(propValue, expectedValues[i])) { + return null; + } + } + + var valuesString = JSON.stringify(expectedValues); + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.')); + } + return createChainableTypeChecker(validate); + } + + function createObjectOfTypeChecker(typeChecker) { + function validate(props, propName, componentName, location, propFullName) { + if (typeof typeChecker !== 'function') { + return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.'); + } + var propValue = props[propName]; + var propType = getPropType(propValue); + if (propType !== 'object') { + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.')); + } + for (var key in propValue) { + if (propValue.hasOwnProperty(key)) { + var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); + if (error instanceof Error) { + return error; + } + } + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createUnionTypeChecker(arrayOfTypeCheckers) { + if (!Array.isArray(arrayOfTypeCheckers)) { + process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid argument supplied to oneOfType, expected an instance of array.') : void 0; + return emptyFunction.thatReturnsNull; + } + + function validate(props, propName, componentName, location, propFullName) { + for (var i = 0; i < arrayOfTypeCheckers.length; i++) { + var checker = arrayOfTypeCheckers[i]; + if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret) == null) { + return null; + } + } + + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.')); + } + return createChainableTypeChecker(validate); + } + + function createNodeChecker() { + function validate(props, propName, componentName, location, propFullName) { + if (!isNode(props[propName])) { + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.')); + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createShapeTypeChecker(shapeTypes) { + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName]; + var propType = getPropType(propValue); + if (propType !== 'object') { + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.')); + } + for (var key in shapeTypes) { + var checker = shapeTypes[key]; + if (!checker) { + continue; + } + var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); + if (error) { + return error; + } + } + return null; + } + return createChainableTypeChecker(validate); + } + + function isNode(propValue) { + switch (typeof propValue) { + case 'number': + case 'string': + case 'undefined': + return true; + case 'boolean': + return !propValue; + case 'object': + if (Array.isArray(propValue)) { + return propValue.every(isNode); + } + if (propValue === null || isValidElement(propValue)) { + return true; + } + + var iteratorFn = getIteratorFn(propValue); + if (iteratorFn) { + var iterator = iteratorFn.call(propValue); + var step; + if (iteratorFn !== propValue.entries) { + while (!(step = iterator.next()).done) { + if (!isNode(step.value)) { + return false; + } + } + } else { + // Iterator will provide entry [k,v] tuples rather than values. + while (!(step = iterator.next()).done) { + var entry = step.value; + if (entry) { + if (!isNode(entry[1])) { + return false; + } + } + } + } + } else { + return false; + } + + return true; + default: + return false; + } + } + + function isSymbol(propType, propValue) { + // Native Symbol. + if (propType === 'symbol') { + return true; + } + + // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol' + if (propValue['@@toStringTag'] === 'Symbol') { + return true; + } + + // Fallback for non-spec compliant Symbols which are polyfilled. + if (typeof Symbol === 'function' && propValue instanceof Symbol) { + return true; + } + + return false; + } + + // Equivalent of `typeof` but with special handling for array and regexp. + function getPropType(propValue) { + var propType = typeof propValue; + if (Array.isArray(propValue)) { + return 'array'; + } + if (propValue instanceof RegExp) { + // Old webkits (at least until Android 4.0) return 'function' rather than + // 'object' for typeof a RegExp. We'll normalize this here so that /bla/ + // passes PropTypes.object. + return 'object'; + } + if (isSymbol(propType, propValue)) { + return 'symbol'; + } + return propType; + } + + // This handles more types than `getPropType`. Only used for error messages. + // See `createPrimitiveTypeChecker`. + function getPreciseType(propValue) { + var propType = getPropType(propValue); + if (propType === 'object') { + if (propValue instanceof Date) { + return 'date'; + } else if (propValue instanceof RegExp) { + return 'regexp'; + } + } + return propType; + } + + // Returns class name of the object, if any. + function getClassName(propValue) { + if (!propValue.constructor || !propValue.constructor.name) { + return ANONYMOUS; + } + return propValue.constructor.name; + } + + ReactPropTypes.checkPropTypes = checkPropTypes; + ReactPropTypes.PropTypes = ReactPropTypes; + + return ReactPropTypes; +}; + +}).call(this,require('_process')) +},{"./checkPropTypes":12,"./lib/ReactPropTypesSecret":15,"_process":11,"fbjs/lib/emptyFunction":4,"fbjs/lib/invariant":6,"fbjs/lib/warning":7}],14:[function(require,module,exports){ +/** + * Copyright 2013-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + +var React = require('react'); +var factory = require('./factory'); + +module.exports = factory(React.isValidElement); + +},{"./factory":13,"react":undefined}],15:[function(require,module,exports){ +/** + * Copyright 2013-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + +'use strict'; + +const ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'; + +module.exports = ReactPropTypesSecret; + +},{}],16:[function(require,module,exports){ +"use strict";function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var _createClass=function(){function e(e,t){for(var r=0;r0?e-1:e}},{key:"getTopSpacerHeight",value:function(t){return t*this.heightData}},{key:"getBottomSpacerHeight",value:function(t){var e=t+1;return Math.max(0,(this.numberOfChildren-e)*this.heightData)}}]),e}(InfiniteComputer);module.exports=ConstantInfiniteComputer; + + +},{"./infiniteComputer.js":18}],18:[function(require,module,exports){ +"use strict";function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var _createClass=function(){function e(e,t){for(var n=0;nt&&(a=o-1)}return e===opts.CLOSEST_LOWER&&s>0?n=s-1:e===opts.CLOSEST_HIGHER&&a=0||Object.prototype.hasOwnProperty.call(t,o)&&(n[o]=t[o]);return n}var i=n.React||t("react"),r=n.PropTypes||t("prop-types"),a=n.createReactClass||t("create-react-class");t("./utils/establish-polyfills");var s=t("./utils/scaleEnum"),l=t("./utils/infiniteHelpers"),c=t("lodash.isfinite"),u=t("./utils/types").preloadType,p=p=t("./utils/checkProps"),f=a({propTypes:{children:r.any,handleScroll:r.func,preloadBatchSize:u,preloadAdditionalHeight:u,elementHeight:r.oneOfType([r.number,r.arrayOf(r.number)]).isRequired,containerHeight:r.number,useWindowAsScrollContainer:r.bool,displayBottomUpwards:r.bool.isRequired,infiniteLoadBeginEdgeOffset:r.number,onInfiniteLoad:r.func,loadingSpinnerDelegate:r.node,isInfiniteLoading:r.bool,timeScrollStateLastsForAfterUserScrolls:r.number,className:r.string,styles:r.shape({scrollableStyle:r.object}).isRequired},statics:{containerHeightScaleFactor:function(t){if(!c(t))throw new Error("The scale factor must be a number.");return{type:s.CONTAINER_HEIGHT_SCALE_FACTOR,amount:t}}},computedProps:{},utils:{},shouldAttachToBottom:!1,preservedScrollState:0,loadingSpinnerHeight:0,deprecationWarned:!1,scrollable:null,topSpacer:null,bottomSpacer:null,smoothScrollingWrapper:null,loadingSpinner:null,getDefaultProps:function(){return{handleScroll:function(){},useWindowAsScrollContainer:!1,onInfiniteLoad:function(){},loadingSpinnerDelegate:i.createElement("div",null),displayBottomUpwards:!1,isInfiniteLoading:!1,timeScrollStateLastsForAfterUserScrolls:150,className:"",styles:{}}},getInitialState:function(){var t=this.recomputeInternalStateFromProps(this.props);this.computedProps=t.computedProps,this.utils=t.utils,this.shouldAttachToBottom=this.props.displayBottomUpwards;var e=t.newState;return e.scrollTimeout=void 0,e.isScrolling=!1,e},generateComputedProps:function(t){var e=t.containerHeight,n=t.preloadBatchSize,i=t.preloadAdditionalHeight,r=o(t,["containerHeight","preloadBatchSize","preloadAdditionalHeight"]),a={};e="number"==typeof e?e:0,a.containerHeight=t.useWindowAsScrollContainer?window.innerHeight:e,void 0!==r.infiniteLoadBeginBottomOffset&&(a.infiniteLoadBeginEdgeOffset=r.infiniteLoadBeginBottomOffset,this.deprecationWarned||(console.error("Warning: React Infinite's infiniteLoadBeginBottomOffset prop\n has been deprecated as of 0.6.0. Please use infiniteLoadBeginEdgeOffset.\n Because this is a rather descriptive name, a simple find and replace\n should suffice."),this.deprecationWarned=!0));var l={type:s.CONTAINER_HEIGHT_SCALE_FACTOR,amount:.5},c=n&&n.type?n:l;"number"==typeof n?a.preloadBatchSize=n:"object"==typeof c&&c.type===s.CONTAINER_HEIGHT_SCALE_FACTOR?a.preloadBatchSize=a.containerHeight*c.amount:a.preloadBatchSize=0;var u={type:s.CONTAINER_HEIGHT_SCALE_FACTOR,amount:1},p=i&&i.type?i:u;return"number"==typeof i?a.preloadAdditionalHeight=i:"object"==typeof p&&p.type===s.CONTAINER_HEIGHT_SCALE_FACTOR?a.preloadAdditionalHeight=a.containerHeight*p.amount:a.preloadAdditionalHeight=0,Object.assign(r,a)},generateComputedUtilityFunctions:function(t){var e=this,n={};return n.getLoadingSpinnerHeight=function(){var t=0;return e.loadingSpinner&&(t=e.loadingSpinner.offsetHeight||0),t},t.useWindowAsScrollContainer?(n.subscribeToScrollListener=function(){window.addEventListener("scroll",e.infiniteHandleScroll)},n.unsubscribeFromScrollListener=function(){window.removeEventListener("scroll",e.infiniteHandleScroll)},n.nodeScrollListener=function(){},n.getScrollTop=function(){return window.pageYOffset},n.setScrollTop=function(t){window.scroll(window.pageXOffset,t)},n.scrollShouldBeIgnored=function(){return!1},n.buildScrollableStyle=function(){return{}}):(n.subscribeToScrollListener=function(){},n.unsubscribeFromScrollListener=function(){},n.nodeScrollListener=this.infiniteHandleScroll,n.getScrollTop=function(){return e.scrollable?e.scrollable.scrollTop:0},n.setScrollTop=function(t){e.scrollable&&(e.scrollable.scrollTop=t)},n.scrollShouldBeIgnored=function(t){return t.target!==e.scrollable},n.buildScrollableStyle=function(){return Object.assign({},{height:e.computedProps.containerHeight,overflowX:"hidden",overflowY:"scroll",WebkitOverflowScrolling:"touch"},e.computedProps.styles.scrollableStyle||{})}),n},recomputeInternalStateFromProps:function(t){p(t);var e=this.generateComputedProps(t),n=this.generateComputedUtilityFunctions(t),o={};return o.numberOfChildren=i.Children.count(e.children),o.infiniteComputer=l.createInfiniteComputer(e.elementHeight,e.children,e.displayBottomUpwards),void 0!==e.isInfiniteLoading&&(o.isInfiniteLoading=e.isInfiniteLoading),o.preloadBatchSize=e.preloadBatchSize,o.preloadAdditionalHeight=e.preloadAdditionalHeight,o=Object.assign(o,l.recomputeApertureStateFromOptionsAndScrollTop(o,n.getScrollTop())),{computedProps:e,utils:n,newState:o}},componentWillReceiveProps:function(t){var e=this.recomputeInternalStateFromProps(t);this.computedProps=e.computedProps,this.utils=e.utils,this.setState(e.newState)},componentWillUpdate:function(){this.props.displayBottomUpwards&&(this.preservedScrollState=this.utils.getScrollTop()-this.loadingSpinnerHeight)},componentDidUpdate:function(t,e){if(this.loadingSpinnerHeight=this.utils.getLoadingSpinnerHeight(),this.props.displayBottomUpwards){var n=this.getLowestPossibleScrollTop();this.shouldAttachToBottom&&this.utils.getScrollTop()this.state.infiniteComputer.getTotalScrollableHeight()-this.computedProps.containerHeight-this.computedProps.infiniteLoadBeginEdgeOffset},onInfiniteLoad:function(){this.setState({isInfiniteLoading:!0}),this.computedProps.onInfiniteLoad()},handleScroll:function(t){this.shouldAttachToBottom=this.computedProps.displayBottomUpwards&&t>=this.getLowestPossibleScrollTop(),this.manageScrollTimeouts();var e=l.recomputeApertureStateFromOptionsAndScrollTop(this.state,t);this.passedEdgeForInfiniteScroll(t)&&!this.state.isInfiniteLoading?(this.setState(Object.assign({},e)),this.onInfiniteLoad()):this.setState(e)},buildHeightStyle:function(t){return{width:"100%",height:Math.ceil(t)}},render:function(){var t,e=this;t=this.state.numberOfChildren>1?this.computedProps.children.slice(this.state.displayIndexStart,this.state.displayIndexEnd+1):this.computedProps.children;var n={};this.state.isScrolling&&(n.pointerEvents="none");var o=this.state.infiniteComputer.getTopSpacerHeight(this.state.displayIndexStart),r=this.state.infiniteComputer.getBottomSpacerHeight(this.state.displayIndexEnd);if(this.computedProps.displayBottomUpwards){var a=this.computedProps.containerHeight-this.state.infiniteComputer.getTotalScrollableHeight();a>0&&(o=a-this.loadingSpinnerHeight)}var s=void 0===this.computedProps.infiniteLoadBeginEdgeOffset?null:i.createElement("div",{ref:function(t){e.loadingSpinner=t}},this.state.isInfiniteLoading?this.computedProps.loadingSpinnerDelegate:null);return i.createElement("div",{className:this.computedProps.className,ref:function(t){e.scrollable=t},style:this.utils.buildScrollableStyle(),onScroll:this.utils.nodeScrollListener},i.createElement("div",{ref:function(t){e.smoothScrollingWrapper=t},style:n},i.createElement("div",{ref:function(t){e.topSpacer=t},style:this.buildHeightStyle(o)}),this.computedProps.displayBottomUpwards&&s,t,!this.computedProps.displayBottomUpwards&&s,i.createElement("div",{ref:function(t){e.bottomSpacer=t},style:this.buildHeightStyle(r)})))}});e.exports=f,n.Infinite=f}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./utils/checkProps":20,"./utils/establish-polyfills":21,"./utils/infiniteHelpers":22,"./utils/scaleEnum":23,"./utils/types":24,"create-react-class":3,"lodash.isfinite":9,"prop-types":14,react:void 0}],2:[function(t,e,n){(function(n){"use strict";function o(t){return t}function i(t,e,i){function p(t,e,o){for(var i in e)e.hasOwnProperty(i)&&("production"!==n.env.NODE_ENV?l("function"==typeof e[i],"%s: %s type `%s` is invalid; it must be a function, usually from React.PropTypes.",t.displayName||"ReactClass",c[o],i):void 0)}function f(t,e){var n=O.hasOwnProperty(e)?O[e]:null;N.hasOwnProperty(e)&&s("OVERRIDE_BASE"===n,"ReactClassInterface: You are attempting to override `%s` from your class specification. Ensure that your method names do not overlap with React methods.",e),t&&s("DEFINE_MANY"===n||"DEFINE_MANY_MERGED"===n,"ReactClassInterface: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",e)}function d(t,o){if(o){s("function"!=typeof o,"ReactClass: You're attempting to use a component class or function as a mixin. Instead, just use a regular object."),s(!e(o),"ReactClass: You're attempting to use a component as a mixin. Instead, just use a regular object.");var i=t.prototype,r=i.__reactAutoBindPairs;o.hasOwnProperty(u)&&w.mixins(t,o.mixins);for(var a in o)if(o.hasOwnProperty(a)&&a!==u){var c=o[a],p=i.hasOwnProperty(a);if(f(p,a),w.hasOwnProperty(a))w[a](t,c);else{var d=O.hasOwnProperty(a),h="function"==typeof c,y=h&&!d&&!p&&o.autobind!==!1;if(y)r.push(a,c),i[a]=c;else if(p){var v=O[a];s(d&&("DEFINE_MANY_MERGED"===v||"DEFINE_MANY"===v),"ReactClass: Unexpected spec policy %s for key %s when mixing in component specs.",v,a),"DEFINE_MANY_MERGED"===v?i[a]=m(i[a],c):"DEFINE_MANY"===v&&(i[a]=g(i[a],c))}else i[a]=c,"production"!==n.env.NODE_ENV&&"function"==typeof c&&o.displayName&&(i[a].displayName=o.displayName+"_"+a)}}}else if("production"!==n.env.NODE_ENV){var b=typeof o,E="object"===b&&null!==o;"production"!==n.env.NODE_ENV?l(E,"%s: You're attempting to include a mixin that is either null or not an object. Check the mixins included by the component, as well as any mixins they include themselves. Expected object but got %s.",t.displayName||"ReactClass",null===o?null:b):void 0}}function h(t,e){if(e)for(var n in e){var o=e[n];if(e.hasOwnProperty(n)){var i=n in w;s(!i,'ReactClass: You are attempting to define a reserved property, `%s`, that shouldn\'t be on the "statics" key. Define it as an instance property instead; it will still be accessible on the constructor.',n);var r=n in t;s(!r,"ReactClass: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",n),t[n]=o}}}function y(t,e){s(t&&e&&"object"==typeof t&&"object"==typeof e,"mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.");for(var n in e)e.hasOwnProperty(n)&&(s(void 0===t[n],"mergeIntoWithNoDuplicateKeys(): Tried to merge two objects with the same key: `%s`. This conflict may be due to a mixin; in particular, this may be caused by two getInitialState() or getDefaultProps() methods returning objects with clashing keys.",n),t[n]=e[n]);return t}function m(t,e){return function(){var n=t.apply(this,arguments),o=e.apply(this,arguments);if(null==n)return o;if(null==o)return n;var i={};return y(i,n),y(i,o),i}}function g(t,e){return function(){t.apply(this,arguments),e.apply(this,arguments)}}function v(t,e){var o=e.bind(t);if("production"!==n.env.NODE_ENV){o.__reactBoundContext=t,o.__reactBoundMethod=e,o.__reactBoundArguments=null;var i=t.constructor.displayName,r=o.bind;o.bind=function(a){for(var s=arguments.length,c=Array(s>1?s-1:0),u=1;u1?e-1:0),o=1;o2?o-2:0),r=2;r-1&&t%1==0&&t<=v}function a(t){return s(t)&&y.call(t)==u}function s(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function l(t){return null!=t&&(a(t)?m.test(d.call(t)):o(t)&&p.test(t))}var c="[object Array]",u="[object Function]",p=/^\[object .+?Constructor\]$/,f=Object.prototype,d=Function.prototype.toString,h=f.hasOwnProperty,y=f.toString,m=RegExp("^"+d.call(h).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),g=i(Array,"isArray"),v=9007199254740991,b=g||function(t){return o(t)&&r(t.length)&&y.call(t)==c};e.exports=b},{}],9:[function(t,e,n){(function(t){function n(t){return"number"==typeof t&&o(t)}var o=t.isFinite;e.exports=n}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],10:[function(t,e,n){"use strict";function o(t){if(null===t||void 0===t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}var i=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;e.exports=Object.assign||function(t,e){for(var n,a,s=o(t),l=1;l0?e-1:e}},{key:"getTopSpacerHeight",value:function(t){return t*this.heightData}},{key:"getBottomSpacerHeight",value:function(t){var e=t+1;return Math.max(0,(this.numberOfChildren-e)*this.heightData)}}]),e}(s);e.exports=l},{"./infiniteComputer.js":18}],18:[function(t,e,n){"use strict";function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var i=function(){function t(t,e){for(var n=0;ne&&(s=r-1)}return n===o.CLOSEST_LOWER&&l>0?i=l-1:n===o.CLOSEST_HIGHER&&s Date: Wed, 3 May 2017 16:58:16 -0400 Subject: [PATCH 20/78] travis: install peerdependencies --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index ce1989c..81d03f0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,4 +9,5 @@ env: script: - ./config/travis/test.sh +before_install: npm install react react-dom prop-types create-react-class after_success: cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js From 8ff5c5ea98368605a76b32d6600a4284cddb58ec Mon Sep 17 00:00:00 2001 From: Gareth Tan Date: Mon, 15 May 2017 13:58:58 -0400 Subject: [PATCH 21/78] Fix examples. --- examples/borderless-window.html | 1 + examples/borderless-window.jsx | 2 -- examples/chat.html | 1 + examples/chat.jsx | 2 -- examples/example.html | 1 + examples/index.jsx | 2 -- examples/window.html | 1 + examples/window.jsx | 2 -- 8 files changed, 4 insertions(+), 8 deletions(-) diff --git a/examples/borderless-window.html b/examples/borderless-window.html index 6e231ca..1512286 100644 --- a/examples/borderless-window.html +++ b/examples/borderless-window.html @@ -26,6 +26,7 @@
+ diff --git a/examples/borderless-window.jsx b/examples/borderless-window.jsx index 94d9b94..e2f48bb 100644 --- a/examples/borderless-window.jsx +++ b/examples/borderless-window.jsx @@ -1,5 +1,3 @@ -var createReactClass = require('create-react-class'); - var ListItem = createReactClass({ getDefaultProps: function() { return { diff --git a/examples/chat.html b/examples/chat.html index 39f39e9..633d569 100644 --- a/examples/chat.html +++ b/examples/chat.html @@ -26,6 +26,7 @@
+ diff --git a/examples/chat.jsx b/examples/chat.jsx index ee5ef7a..dfaa758 100644 --- a/examples/chat.jsx +++ b/examples/chat.jsx @@ -1,5 +1,3 @@ -var createReactClass = require('create-react-class'); - var ListItem = createReactClass({ getDefaultProps: function() { return { diff --git a/examples/example.html b/examples/example.html index 7ea2007..c7f8cd4 100644 --- a/examples/example.html +++ b/examples/example.html @@ -33,6 +33,7 @@
+ diff --git a/examples/index.jsx b/examples/index.jsx index 2315c82..d81f1de 100644 --- a/examples/index.jsx +++ b/examples/index.jsx @@ -1,5 +1,3 @@ -var createReactClass = require('create-react-class'); - var ListItem = createReactClass({ getDefaultProps: function() { return { diff --git a/examples/window.html b/examples/window.html index febb3f9..1d927a1 100644 --- a/examples/window.html +++ b/examples/window.html @@ -26,6 +26,7 @@
+ diff --git a/examples/window.jsx b/examples/window.jsx index 25dfe85..330fd64 100644 --- a/examples/window.jsx +++ b/examples/window.jsx @@ -1,5 +1,3 @@ -var createReactClass = require('create-react-class'); - var ListItem = createReactClass({ getDefaultProps: function() { return { From 0892a45d58d43e7eca1bf3d5fe67ab352856930d Mon Sep 17 00:00:00 2001 From: Gareth Tan Date: Mon, 15 May 2017 13:59:12 -0400 Subject: [PATCH 22/78] Relax certain version requirements. --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index fac4c24..9fd3c3e 100644 --- a/package.json +++ b/package.json @@ -88,8 +88,8 @@ "peerDependencies": { "react": "^15.5.0", "react-dom": "^15.5.0", - "create-react-class": "15.5.0", - "prop-types": "15.5.0" + "create-react-class": "^15.5.0", + "prop-types": "^15.5.0" }, "browserify": { "transform": [ From b17c7b7666c9045ef5f5248d31d600ca80dcac96 Mon Sep 17 00:00:00 2001 From: Gareth Tan Date: Mon, 15 May 2017 14:41:29 -0400 Subject: [PATCH 23/78] Build new versions. --- dist/react-infinite.js | 384 ++++++++++++++++++++++++++++--------- dist/react-infinite.min.js | 4 +- 2 files changed, 294 insertions(+), 94 deletions(-) diff --git a/dist/react-infinite.js b/dist/react-infinite.js index 5d14624..dbbcfbd 100644 --- a/dist/react-infinite.js +++ b/dist/react-infinite.js @@ -2,7 +2,7 @@ (function (global){ "use strict";function _objectWithoutProperties(e,t){var i={};for(var o in e)t.indexOf(o)>=0||Object.prototype.hasOwnProperty.call(e,o)&&(i[o]=e[o]);return i}var React=global.React||require("react"),PropTypes=global.PropTypes||require("prop-types"),createReactClass=global.createReactClass||require("create-react-class");require("./utils/establish-polyfills");var scaleEnum=require("./utils/scaleEnum"),infiniteHelpers=require("./utils/infiniteHelpers"),_isFinite=require("lodash.isfinite"),preloadType=require("./utils/types").preloadType,checkProps=checkProps=require("./utils/checkProps"),Infinite=createReactClass({propTypes:{children:PropTypes.any,handleScroll:PropTypes.func,preloadBatchSize:preloadType,preloadAdditionalHeight:preloadType,elementHeight:PropTypes.oneOfType([PropTypes.number,PropTypes.arrayOf(PropTypes.number)]).isRequired,containerHeight:PropTypes.number,useWindowAsScrollContainer:PropTypes.bool,displayBottomUpwards:PropTypes.bool.isRequired,infiniteLoadBeginEdgeOffset:PropTypes.number,onInfiniteLoad:PropTypes.func,loadingSpinnerDelegate:PropTypes.node,isInfiniteLoading:PropTypes.bool,timeScrollStateLastsForAfterUserScrolls:PropTypes.number,className:PropTypes.string,styles:PropTypes.shape({scrollableStyle:PropTypes.object}).isRequired},statics:{containerHeightScaleFactor:function(e){if(!_isFinite(e))throw new Error("The scale factor must be a number.");return{type:scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR,amount:e}}},computedProps:{},utils:{},shouldAttachToBottom:!1,preservedScrollState:0,loadingSpinnerHeight:0,deprecationWarned:!1,scrollable:null,topSpacer:null,bottomSpacer:null,smoothScrollingWrapper:null,loadingSpinner:null,getDefaultProps:function(){return{handleScroll:function(){},useWindowAsScrollContainer:!1,onInfiniteLoad:function(){},loadingSpinnerDelegate:React.createElement("div",null),displayBottomUpwards:!1,isInfiniteLoading:!1,timeScrollStateLastsForAfterUserScrolls:150,className:"",styles:{}}},getInitialState:function(){var e=this.recomputeInternalStateFromProps(this.props);this.computedProps=e.computedProps,this.utils=e.utils,this.shouldAttachToBottom=this.props.displayBottomUpwards;var t=e.newState;return t.scrollTimeout=void 0,t.isScrolling=!1,t},generateComputedProps:function(e){var t=e.containerHeight,i=e.preloadBatchSize,o=e.preloadAdditionalHeight,n=_objectWithoutProperties(e,["containerHeight","preloadBatchSize","preloadAdditionalHeight"]),r={};t="number"==typeof t?t:0,r.containerHeight=e.useWindowAsScrollContainer?window.innerHeight:t,void 0!==n.infiniteLoadBeginBottomOffset&&(r.infiniteLoadBeginEdgeOffset=n.infiniteLoadBeginBottomOffset,this.deprecationWarned||(console.error("Warning: React Infinite's infiniteLoadBeginBottomOffset prop\n has been deprecated as of 0.6.0. Please use infiniteLoadBeginEdgeOffset.\n Because this is a rather descriptive name, a simple find and replace\n should suffice."),this.deprecationWarned=!0));var s={type:scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR,amount:.5},l=i&&i.type?i:s;"number"==typeof i?r.preloadBatchSize=i:"object"==typeof l&&l.type===scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR?r.preloadBatchSize=r.containerHeight*l.amount:r.preloadBatchSize=0;var a={type:scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR,amount:1},c=o&&o.type?o:a;return"number"==typeof o?r.preloadAdditionalHeight=o:"object"==typeof c&&c.type===scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR?r.preloadAdditionalHeight=r.containerHeight*c.amount:r.preloadAdditionalHeight=0,Object.assign(n,r)},generateComputedUtilityFunctions:function(e){var t=this,i={};return i.getLoadingSpinnerHeight=function(){var e=0;return t.loadingSpinner&&(e=t.loadingSpinner.offsetHeight||0),e},e.useWindowAsScrollContainer?(i.subscribeToScrollListener=function(){window.addEventListener("scroll",t.infiniteHandleScroll)},i.unsubscribeFromScrollListener=function(){window.removeEventListener("scroll",t.infiniteHandleScroll)},i.nodeScrollListener=function(){},i.getScrollTop=function(){return window.pageYOffset},i.setScrollTop=function(e){window.scroll(window.pageXOffset,e)},i.scrollShouldBeIgnored=function(){return!1},i.buildScrollableStyle=function(){return{}}):(i.subscribeToScrollListener=function(){},i.unsubscribeFromScrollListener=function(){},i.nodeScrollListener=this.infiniteHandleScroll,i.getScrollTop=function(){return t.scrollable?t.scrollable.scrollTop:0},i.setScrollTop=function(e){t.scrollable&&(t.scrollable.scrollTop=e)},i.scrollShouldBeIgnored=function(e){return e.target!==t.scrollable},i.buildScrollableStyle=function(){return Object.assign({},{height:t.computedProps.containerHeight,overflowX:"hidden",overflowY:"scroll",WebkitOverflowScrolling:"touch"},t.computedProps.styles.scrollableStyle||{})}),i},recomputeInternalStateFromProps:function(e){checkProps(e);var t=this.generateComputedProps(e),i=this.generateComputedUtilityFunctions(e),o={};return o.numberOfChildren=React.Children.count(t.children),o.infiniteComputer=infiniteHelpers.createInfiniteComputer(t.elementHeight,t.children,t.displayBottomUpwards),void 0!==t.isInfiniteLoading&&(o.isInfiniteLoading=t.isInfiniteLoading),o.preloadBatchSize=t.preloadBatchSize,o.preloadAdditionalHeight=t.preloadAdditionalHeight,o=Object.assign(o,infiniteHelpers.recomputeApertureStateFromOptionsAndScrollTop(o,i.getScrollTop())),{computedProps:t,utils:i,newState:o}},componentWillReceiveProps:function(e){var t=this.recomputeInternalStateFromProps(e);this.computedProps=t.computedProps,this.utils=t.utils,this.setState(t.newState)},componentWillUpdate:function(){this.props.displayBottomUpwards&&(this.preservedScrollState=this.utils.getScrollTop()-this.loadingSpinnerHeight)},componentDidUpdate:function(e,t){if(this.loadingSpinnerHeight=this.utils.getLoadingSpinnerHeight(),this.props.displayBottomUpwards){var i=this.getLowestPossibleScrollTop();this.shouldAttachToBottom&&this.utils.getScrollTop()this.state.infiniteComputer.getTotalScrollableHeight()-this.computedProps.containerHeight-this.computedProps.infiniteLoadBeginEdgeOffset},onInfiniteLoad:function(){this.setState({isInfiniteLoading:!0}),this.computedProps.onInfiniteLoad()},handleScroll:function(e){this.shouldAttachToBottom=this.computedProps.displayBottomUpwards&&e>=this.getLowestPossibleScrollTop(),this.manageScrollTimeouts();var t=infiniteHelpers.recomputeApertureStateFromOptionsAndScrollTop(this.state,e);this.passedEdgeForInfiniteScroll(e)&&!this.state.isInfiniteLoading?(this.setState(Object.assign({},t)),this.onInfiniteLoad()):this.setState(t)},buildHeightStyle:function(e){return{width:"100%",height:Math.ceil(e)}},render:function(){var e,t=this;e=this.state.numberOfChildren>1?this.computedProps.children.slice(this.state.displayIndexStart,this.state.displayIndexEnd+1):this.computedProps.children;var i={};this.state.isScrolling&&(i.pointerEvents="none");var o=this.state.infiniteComputer.getTopSpacerHeight(this.state.displayIndexStart),n=this.state.infiniteComputer.getBottomSpacerHeight(this.state.displayIndexEnd);if(this.computedProps.displayBottomUpwards){var r=this.computedProps.containerHeight-this.state.infiniteComputer.getTotalScrollableHeight();r>0&&(o=r-this.loadingSpinnerHeight)}var s=void 0===this.computedProps.infiniteLoadBeginEdgeOffset?null:React.createElement("div",{ref:function(e){t.loadingSpinner=e}},this.state.isInfiniteLoading?this.computedProps.loadingSpinnerDelegate:null);return React.createElement("div",{className:this.computedProps.className,ref:function(e){t.scrollable=e},style:this.utils.buildScrollableStyle(),onScroll:this.utils.nodeScrollListener},React.createElement("div",{ref:function(e){t.smoothScrollingWrapper=e},style:i},React.createElement("div",{ref:function(e){t.topSpacer=e},style:this.buildHeightStyle(o)}),this.computedProps.displayBottomUpwards&&s,e,!this.computedProps.displayBottomUpwards&&s,React.createElement("div",{ref:function(e){t.bottomSpacer=e},style:this.buildHeightStyle(n)})))}});module.exports=Infinite,global.Infinite=Infinite; }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"./utils/checkProps":20,"./utils/establish-polyfills":21,"./utils/infiniteHelpers":22,"./utils/scaleEnum":23,"./utils/types":24,"create-react-class":3,"lodash.isfinite":9,"prop-types":14,"react":undefined}],2:[function(require,module,exports){ +},{"./utils/checkProps":22,"./utils/establish-polyfills":23,"./utils/infiniteHelpers":24,"./utils/scaleEnum":25,"./utils/types":26,"create-react-class":3,"lodash.isfinite":10,"prop-types":16,"react":undefined}],2:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. @@ -730,7 +730,7 @@ function factory(ReactComponent, isValidElement, ReactNoopUpdateQueue) { module.exports = factory; }).call(this,require('_process')) -},{"_process":11,"fbjs/lib/emptyObject":5,"fbjs/lib/invariant":6,"fbjs/lib/warning":7,"object-assign":10}],3:[function(require,module,exports){ +},{"_process":12,"fbjs/lib/emptyObject":6,"fbjs/lib/invariant":7,"fbjs/lib/warning":8,"object-assign":4}],3:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -756,6 +756,98 @@ module.exports = factory( ); },{"./factory":2,"react":undefined}],4:[function(require,module,exports){ +/* +object-assign +(c) Sindre Sorhus +@license MIT +*/ + +'use strict'; +/* eslint-disable no-unused-vars */ +var getOwnPropertySymbols = Object.getOwnPropertySymbols; +var hasOwnProperty = Object.prototype.hasOwnProperty; +var propIsEnumerable = Object.prototype.propertyIsEnumerable; + +function toObject(val) { + if (val === null || val === undefined) { + throw new TypeError('Object.assign cannot be called with null or undefined'); + } + + return Object(val); +} + +function shouldUseNative() { + try { + if (!Object.assign) { + return false; + } + + // Detect buggy property enumeration order in older V8 versions. + + // https://bugs.chromium.org/p/v8/issues/detail?id=4118 + var test1 = new String('abc'); // eslint-disable-line no-new-wrappers + test1[5] = 'de'; + if (Object.getOwnPropertyNames(test1)[0] === '5') { + return false; + } + + // https://bugs.chromium.org/p/v8/issues/detail?id=3056 + var test2 = {}; + for (var i = 0; i < 10; i++) { + test2['_' + String.fromCharCode(i)] = i; + } + var order2 = Object.getOwnPropertyNames(test2).map(function (n) { + return test2[n]; + }); + if (order2.join('') !== '0123456789') { + return false; + } + + // https://bugs.chromium.org/p/v8/issues/detail?id=3056 + var test3 = {}; + 'abcdefghijklmnopqrst'.split('').forEach(function (letter) { + test3[letter] = letter; + }); + if (Object.keys(Object.assign({}, test3)).join('') !== + 'abcdefghijklmnopqrst') { + return false; + } + + return true; + } catch (err) { + // We don't expect any of the above to throw, but better to be safe. + return false; + } +} + +module.exports = shouldUseNative() ? Object.assign : function (target, source) { + var from; + var to = toObject(target); + var symbols; + + for (var s = 1; s < arguments.length; s++) { + from = Object(arguments[s]); + + for (var key in from) { + if (hasOwnProperty.call(from, key)) { + to[key] = from[key]; + } + } + + if (getOwnPropertySymbols) { + symbols = getOwnPropertySymbols(from); + for (var i = 0; i < symbols.length; i++) { + if (propIsEnumerable.call(from, symbols[i])) { + to[symbols[i]] = from[symbols[i]]; + } + } + } + } + + return to; +}; + +},{}],5:[function(require,module,exports){ "use strict"; /** @@ -794,7 +886,7 @@ emptyFunction.thatReturnsArgument = function (arg) { }; module.exports = emptyFunction; -},{}],5:[function(require,module,exports){ +},{}],6:[function(require,module,exports){ (function (process){ /** * Copyright (c) 2013-present, Facebook, Inc. @@ -816,7 +908,7 @@ if (process.env.NODE_ENV !== 'production') { module.exports = emptyObject; }).call(this,require('_process')) -},{"_process":11}],6:[function(require,module,exports){ +},{"_process":12}],7:[function(require,module,exports){ (function (process){ /** * Copyright (c) 2013-present, Facebook, Inc. @@ -874,7 +966,7 @@ function invariant(condition, format, a, b, c, d, e, f) { module.exports = invariant; }).call(this,require('_process')) -},{"_process":11}],7:[function(require,module,exports){ +},{"_process":12}],8:[function(require,module,exports){ (function (process){ /** * Copyright 2014-2015, Facebook, Inc. @@ -943,7 +1035,7 @@ if (process.env.NODE_ENV !== 'production') { module.exports = warning; }).call(this,require('_process')) -},{"./emptyFunction":4,"_process":11}],8:[function(require,module,exports){ +},{"./emptyFunction":5,"_process":12}],9:[function(require,module,exports){ /** * lodash 3.0.4 (Custom Build) * Build: `lodash modern modularize exports="npm" -o ./` @@ -1125,7 +1217,7 @@ function isNative(value) { module.exports = isArray; -},{}],9:[function(require,module,exports){ +},{}],10:[function(require,module,exports){ (function (global){ /** * lodash 3.2.0 (Custom Build) @@ -1173,7 +1265,7 @@ function isFinite(value) { module.exports = isFinite; }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{}],10:[function(require,module,exports){ +},{}],11:[function(require,module,exports){ /* eslint-disable no-unused-vars */ 'use strict'; var hasOwnProperty = Object.prototype.hasOwnProperty; @@ -1214,7 +1306,7 @@ module.exports = Object.assign || function (target, source) { return to; }; -},{}],11:[function(require,module,exports){ +},{}],12:[function(require,module,exports){ // shim for using process in browser var process = module.exports = {}; @@ -1274,7 +1366,7 @@ process.chdir = function (dir) { }; process.umask = function() { return 0; }; -},{}],12:[function(require,module,exports){ +},{}],13:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. @@ -1287,12 +1379,12 @@ process.umask = function() { return 0; }; 'use strict'; -var invariant = require('fbjs/lib/invariant'); -var warning = require('fbjs/lib/warning'); - -var ReactPropTypesSecret = require('./lib/ReactPropTypesSecret'); - -var loggedTypeFailures = {}; +if (process.env.NODE_ENV !== 'production') { + var invariant = require('fbjs/lib/invariant'); + var warning = require('fbjs/lib/warning'); + var ReactPropTypesSecret = require('./lib/ReactPropTypesSecret'); + var loggedTypeFailures = {}; +} /** * Assert that the values match with the type specs. @@ -1321,7 +1413,7 @@ function checkPropTypes(typeSpecs, values, location, componentName, getStack) { } catch (ex) { error = ex; } - process.env.NODE_ENV !== 'production' ? warning(!error || error instanceof Error, '%s: type specification of %s `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error) : void 0; + warning(!error || error instanceof Error, '%s: type specification of %s `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error); if (error instanceof Error && !(error.message in loggedTypeFailures)) { // Only monitor this failure once because there tends to be a lot of the // same error. @@ -1329,7 +1421,7 @@ function checkPropTypes(typeSpecs, values, location, componentName, getStack) { var stack = getStack ? getStack() : ''; - process.env.NODE_ENV !== 'production' ? warning(false, 'Failed %s type: %s%s', location, error.message, stack != null ? stack : '') : void 0; + warning(false, 'Failed %s type: %s%s', location, error.message, stack != null ? stack : ''); } } } @@ -1339,7 +1431,68 @@ function checkPropTypes(typeSpecs, values, location, componentName, getStack) { module.exports = checkPropTypes; }).call(this,require('_process')) -},{"./lib/ReactPropTypesSecret":15,"_process":11,"fbjs/lib/invariant":6,"fbjs/lib/warning":7}],13:[function(require,module,exports){ +},{"./lib/ReactPropTypesSecret":17,"_process":12,"fbjs/lib/invariant":7,"fbjs/lib/warning":8}],14:[function(require,module,exports){ +/** + * Copyright 2013-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + +'use strict'; + +var emptyFunction = require('fbjs/lib/emptyFunction'); +var invariant = require('fbjs/lib/invariant'); +var ReactPropTypesSecret = require('./lib/ReactPropTypesSecret'); + +module.exports = function() { + function shim(props, propName, componentName, location, propFullName, secret) { + if (secret === ReactPropTypesSecret) { + // It is still safe when called from React. + return; + } + invariant( + false, + 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' + + 'Use PropTypes.checkPropTypes() to call them. ' + + 'Read more at http://fb.me/use-check-prop-types' + ); + }; + shim.isRequired = shim; + function getShim() { + return shim; + }; + // Important! + // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`. + var ReactPropTypes = { + array: shim, + bool: shim, + func: shim, + number: shim, + object: shim, + string: shim, + symbol: shim, + + any: shim, + arrayOf: getShim, + element: shim, + instanceOf: getShim, + node: shim, + objectOf: getShim, + oneOf: getShim, + oneOfType: getShim, + shape: getShim + }; + + ReactPropTypes.checkPropTypes = emptyFunction; + ReactPropTypes.PropTypes = ReactPropTypes; + + return ReactPropTypes; +}; + +},{"./lib/ReactPropTypesSecret":17,"fbjs/lib/emptyFunction":5,"fbjs/lib/invariant":7}],15:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. @@ -1359,7 +1512,7 @@ var warning = require('fbjs/lib/warning'); var ReactPropTypesSecret = require('./lib/ReactPropTypesSecret'); var checkPropTypes = require('./checkPropTypes'); -module.exports = function (isValidElement) { +module.exports = function(isValidElement, throwOnDirectAccess) { /* global Symbol */ var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator; var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec. @@ -1434,58 +1587,27 @@ module.exports = function (isValidElement) { var ANONYMOUS = '<>'; - var ReactPropTypes; - - if (process.env.NODE_ENV !== 'production') { - // Keep in sync with production version below - ReactPropTypes = { - array: createPrimitiveTypeChecker('array'), - bool: createPrimitiveTypeChecker('boolean'), - func: createPrimitiveTypeChecker('function'), - number: createPrimitiveTypeChecker('number'), - object: createPrimitiveTypeChecker('object'), - string: createPrimitiveTypeChecker('string'), - symbol: createPrimitiveTypeChecker('symbol'), - - any: createAnyTypeChecker(), - arrayOf: createArrayOfTypeChecker, - element: createElementTypeChecker(), - instanceOf: createInstanceTypeChecker, - node: createNodeChecker(), - objectOf: createObjectOfTypeChecker, - oneOf: createEnumTypeChecker, - oneOfType: createUnionTypeChecker, - shape: createShapeTypeChecker - }; - } else { - var productionTypeChecker = function () { - invariant(false, 'React.PropTypes type checking code is stripped in production.'); - }; - productionTypeChecker.isRequired = productionTypeChecker; - var getProductionTypeChecker = function () { - return productionTypeChecker; - }; - // Keep in sync with development version above - ReactPropTypes = { - array: productionTypeChecker, - bool: productionTypeChecker, - func: productionTypeChecker, - number: productionTypeChecker, - object: productionTypeChecker, - string: productionTypeChecker, - symbol: productionTypeChecker, - - any: productionTypeChecker, - arrayOf: getProductionTypeChecker, - element: productionTypeChecker, - instanceOf: getProductionTypeChecker, - node: productionTypeChecker, - objectOf: getProductionTypeChecker, - oneOf: getProductionTypeChecker, - oneOfType: getProductionTypeChecker, - shape: getProductionTypeChecker - }; - } + // Important! + // Keep this list in sync with production version in `./factoryWithThrowingShims.js`. + var ReactPropTypes = { + array: createPrimitiveTypeChecker('array'), + bool: createPrimitiveTypeChecker('boolean'), + func: createPrimitiveTypeChecker('function'), + number: createPrimitiveTypeChecker('number'), + object: createPrimitiveTypeChecker('object'), + string: createPrimitiveTypeChecker('string'), + symbol: createPrimitiveTypeChecker('symbol'), + + any: createAnyTypeChecker(), + arrayOf: createArrayOfTypeChecker, + element: createElementTypeChecker(), + instanceOf: createInstanceTypeChecker, + node: createNodeChecker(), + objectOf: createObjectOfTypeChecker, + oneOf: createEnumTypeChecker, + oneOfType: createUnionTypeChecker, + shape: createShapeTypeChecker + }; /** * inlined Object.is polyfill to avoid requiring consumers ship their own @@ -1522,16 +1644,41 @@ module.exports = function (isValidElement) { function createChainableTypeChecker(validate) { if (process.env.NODE_ENV !== 'production') { var manualPropTypeCallCache = {}; + var manualPropTypeWarningCount = 0; } function checkType(isRequired, props, propName, componentName, location, propFullName, secret) { componentName = componentName || ANONYMOUS; propFullName = propFullName || propName; - if (process.env.NODE_ENV !== 'production') { - if (secret !== ReactPropTypesSecret && typeof console !== 'undefined') { + + if (secret !== ReactPropTypesSecret) { + if (throwOnDirectAccess) { + // New behavior only for users of `prop-types` package + invariant( + false, + 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' + + 'Use `PropTypes.checkPropTypes()` to call them. ' + + 'Read more at http://fb.me/use-check-prop-types' + ); + } else if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined') { + // Old behavior for people using React.PropTypes var cacheKey = componentName + ':' + propName; - if (!manualPropTypeCallCache[cacheKey]) { - process.env.NODE_ENV !== 'production' ? warning(false, 'You are manually calling a React.PropTypes validation ' + 'function for the `%s` prop on `%s`. This is deprecated ' + 'and will not work in production with the next major version. ' + 'You may be seeing this warning due to a third-party PropTypes ' + 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.', propFullName, componentName) : void 0; + if ( + !manualPropTypeCallCache[cacheKey] && + // Avoid spamming the console because they are often not actionable except for lib authors + manualPropTypeWarningCount < 3 + ) { + warning( + false, + 'You are manually calling a React.PropTypes validation ' + + 'function for the `%s` prop on `%s`. This is deprecated ' + + 'and will throw in the standalone `prop-types` package. ' + + 'You may be seeing this warning due to a third-party PropTypes ' + + 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.', + propFullName, + componentName + ); manualPropTypeCallCache[cacheKey] = true; + manualPropTypeWarningCount++; } } } @@ -1669,6 +1816,20 @@ module.exports = function (isValidElement) { return emptyFunction.thatReturnsNull; } + for (var i = 0; i < arrayOfTypeCheckers.length; i++) { + var checker = arrayOfTypeCheckers[i]; + if (typeof checker !== 'function') { + warning( + false, + 'Invalid argument supplid to oneOfType. Expected an array of check functions, but ' + + 'received %s at index %s.', + getPostfixForTypeWarning(checker), + i + ); + return emptyFunction.thatReturnsNull; + } + } + function validate(props, propName, componentName, location, propFullName) { for (var i = 0; i < arrayOfTypeCheckers.length; i++) { var checker = arrayOfTypeCheckers[i]; @@ -1801,6 +1962,9 @@ module.exports = function (isValidElement) { // This handles more types than `getPropType`. Only used for error messages. // See `createPrimitiveTypeChecker`. function getPreciseType(propValue) { + if (typeof propValue === 'undefined' || propValue === null) { + return '' + propValue; + } var propType = getPropType(propValue); if (propType === 'object') { if (propValue instanceof Date) { @@ -1812,6 +1976,23 @@ module.exports = function (isValidElement) { return propType; } + // Returns a string that is postfixed to a warning about an invalid type. + // For example, "undefined" or "of type array" + function getPostfixForTypeWarning(value) { + var type = getPreciseType(value); + switch (type) { + case 'array': + case 'object': + return 'an ' + type; + case 'boolean': + case 'date': + case 'regexp': + return 'a ' + type; + default: + return type; + } + } + // Returns class name of the object, if any. function getClassName(propValue) { if (!propValue.constructor || !propValue.constructor.name) { @@ -1827,7 +2008,8 @@ module.exports = function (isValidElement) { }; }).call(this,require('_process')) -},{"./checkPropTypes":12,"./lib/ReactPropTypesSecret":15,"_process":11,"fbjs/lib/emptyFunction":4,"fbjs/lib/invariant":6,"fbjs/lib/warning":7}],14:[function(require,module,exports){ +},{"./checkPropTypes":13,"./lib/ReactPropTypesSecret":17,"_process":12,"fbjs/lib/emptyFunction":5,"fbjs/lib/invariant":7,"fbjs/lib/warning":8}],16:[function(require,module,exports){ +(function (process){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -1837,12 +2019,30 @@ module.exports = function (isValidElement) { * of patent rights can be found in the PATENTS file in the same directory. */ -var React = require('react'); -var factory = require('./factory'); +if (process.env.NODE_ENV !== 'production') { + var REACT_ELEMENT_TYPE = (typeof Symbol === 'function' && + Symbol.for && + Symbol.for('react.element')) || + 0xeac7; + + var isValidElement = function(object) { + return typeof object === 'object' && + object !== null && + object.$$typeof === REACT_ELEMENT_TYPE; + }; -module.exports = factory(React.isValidElement); + // By explicitly using `prop-types` you are opting into new development behavior. + // http://fb.me/prop-types-in-prod + var throwOnDirectAccess = true; + module.exports = require('./factoryWithTypeCheckers')(isValidElement, throwOnDirectAccess); +} else { + // By explicitly using `prop-types` you are opting into new production behavior. + // http://fb.me/prop-types-in-prod + module.exports = require('./factoryWithThrowingShims')(); +} -},{"./factory":13,"react":undefined}],15:[function(require,module,exports){ +}).call(this,require('_process')) +},{"./factoryWithThrowingShims":14,"./factoryWithTypeCheckers":15,"_process":12}],17:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -1854,51 +2054,51 @@ module.exports = factory(React.isValidElement); 'use strict'; -const ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'; +var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'; module.exports = ReactPropTypesSecret; -},{}],16:[function(require,module,exports){ +},{}],18:[function(require,module,exports){ "use strict";function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var _createClass=function(){function e(e,t){for(var r=0;r0?e-1:e}},{key:"getTopSpacerHeight",value:function(t){return t*this.heightData}},{key:"getBottomSpacerHeight",value:function(t){var e=t+1;return Math.max(0,(this.numberOfChildren-e)*this.heightData)}}]),e}(InfiniteComputer);module.exports=ConstantInfiniteComputer; -},{"./infiniteComputer.js":18}],18:[function(require,module,exports){ +},{"./infiniteComputer.js":20}],20:[function(require,module,exports){ "use strict";function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var _createClass=function(){function e(e,t){for(var n=0;nt&&(a=o-1)}return e===opts.CLOSEST_LOWER&&s>0?n=s-1:e===opts.CLOSEST_HIGHER&&a=0||Object.prototype.hasOwnProperty.call(t,o)&&(n[o]=t[o]);return n}var i=n.React||t("react"),r=n.PropTypes||t("prop-types"),a=n.createReactClass||t("create-react-class");t("./utils/establish-polyfills");var s=t("./utils/scaleEnum"),l=t("./utils/infiniteHelpers"),c=t("lodash.isfinite"),u=t("./utils/types").preloadType,p=p=t("./utils/checkProps"),f=a({propTypes:{children:r.any,handleScroll:r.func,preloadBatchSize:u,preloadAdditionalHeight:u,elementHeight:r.oneOfType([r.number,r.arrayOf(r.number)]).isRequired,containerHeight:r.number,useWindowAsScrollContainer:r.bool,displayBottomUpwards:r.bool.isRequired,infiniteLoadBeginEdgeOffset:r.number,onInfiniteLoad:r.func,loadingSpinnerDelegate:r.node,isInfiniteLoading:r.bool,timeScrollStateLastsForAfterUserScrolls:r.number,className:r.string,styles:r.shape({scrollableStyle:r.object}).isRequired},statics:{containerHeightScaleFactor:function(t){if(!c(t))throw new Error("The scale factor must be a number.");return{type:s.CONTAINER_HEIGHT_SCALE_FACTOR,amount:t}}},computedProps:{},utils:{},shouldAttachToBottom:!1,preservedScrollState:0,loadingSpinnerHeight:0,deprecationWarned:!1,scrollable:null,topSpacer:null,bottomSpacer:null,smoothScrollingWrapper:null,loadingSpinner:null,getDefaultProps:function(){return{handleScroll:function(){},useWindowAsScrollContainer:!1,onInfiniteLoad:function(){},loadingSpinnerDelegate:i.createElement("div",null),displayBottomUpwards:!1,isInfiniteLoading:!1,timeScrollStateLastsForAfterUserScrolls:150,className:"",styles:{}}},getInitialState:function(){var t=this.recomputeInternalStateFromProps(this.props);this.computedProps=t.computedProps,this.utils=t.utils,this.shouldAttachToBottom=this.props.displayBottomUpwards;var e=t.newState;return e.scrollTimeout=void 0,e.isScrolling=!1,e},generateComputedProps:function(t){var e=t.containerHeight,n=t.preloadBatchSize,i=t.preloadAdditionalHeight,r=o(t,["containerHeight","preloadBatchSize","preloadAdditionalHeight"]),a={};e="number"==typeof e?e:0,a.containerHeight=t.useWindowAsScrollContainer?window.innerHeight:e,void 0!==r.infiniteLoadBeginBottomOffset&&(a.infiniteLoadBeginEdgeOffset=r.infiniteLoadBeginBottomOffset,this.deprecationWarned||(console.error("Warning: React Infinite's infiniteLoadBeginBottomOffset prop\n has been deprecated as of 0.6.0. Please use infiniteLoadBeginEdgeOffset.\n Because this is a rather descriptive name, a simple find and replace\n should suffice."),this.deprecationWarned=!0));var l={type:s.CONTAINER_HEIGHT_SCALE_FACTOR,amount:.5},c=n&&n.type?n:l;"number"==typeof n?a.preloadBatchSize=n:"object"==typeof c&&c.type===s.CONTAINER_HEIGHT_SCALE_FACTOR?a.preloadBatchSize=a.containerHeight*c.amount:a.preloadBatchSize=0;var u={type:s.CONTAINER_HEIGHT_SCALE_FACTOR,amount:1},p=i&&i.type?i:u;return"number"==typeof i?a.preloadAdditionalHeight=i:"object"==typeof p&&p.type===s.CONTAINER_HEIGHT_SCALE_FACTOR?a.preloadAdditionalHeight=a.containerHeight*p.amount:a.preloadAdditionalHeight=0,Object.assign(r,a)},generateComputedUtilityFunctions:function(t){var e=this,n={};return n.getLoadingSpinnerHeight=function(){var t=0;return e.loadingSpinner&&(t=e.loadingSpinner.offsetHeight||0),t},t.useWindowAsScrollContainer?(n.subscribeToScrollListener=function(){window.addEventListener("scroll",e.infiniteHandleScroll)},n.unsubscribeFromScrollListener=function(){window.removeEventListener("scroll",e.infiniteHandleScroll)},n.nodeScrollListener=function(){},n.getScrollTop=function(){return window.pageYOffset},n.setScrollTop=function(t){window.scroll(window.pageXOffset,t)},n.scrollShouldBeIgnored=function(){return!1},n.buildScrollableStyle=function(){return{}}):(n.subscribeToScrollListener=function(){},n.unsubscribeFromScrollListener=function(){},n.nodeScrollListener=this.infiniteHandleScroll,n.getScrollTop=function(){return e.scrollable?e.scrollable.scrollTop:0},n.setScrollTop=function(t){e.scrollable&&(e.scrollable.scrollTop=t)},n.scrollShouldBeIgnored=function(t){return t.target!==e.scrollable},n.buildScrollableStyle=function(){return Object.assign({},{height:e.computedProps.containerHeight,overflowX:"hidden",overflowY:"scroll",WebkitOverflowScrolling:"touch"},e.computedProps.styles.scrollableStyle||{})}),n},recomputeInternalStateFromProps:function(t){p(t);var e=this.generateComputedProps(t),n=this.generateComputedUtilityFunctions(t),o={};return o.numberOfChildren=i.Children.count(e.children),o.infiniteComputer=l.createInfiniteComputer(e.elementHeight,e.children,e.displayBottomUpwards),void 0!==e.isInfiniteLoading&&(o.isInfiniteLoading=e.isInfiniteLoading),o.preloadBatchSize=e.preloadBatchSize,o.preloadAdditionalHeight=e.preloadAdditionalHeight,o=Object.assign(o,l.recomputeApertureStateFromOptionsAndScrollTop(o,n.getScrollTop())),{computedProps:e,utils:n,newState:o}},componentWillReceiveProps:function(t){var e=this.recomputeInternalStateFromProps(t);this.computedProps=e.computedProps,this.utils=e.utils,this.setState(e.newState)},componentWillUpdate:function(){this.props.displayBottomUpwards&&(this.preservedScrollState=this.utils.getScrollTop()-this.loadingSpinnerHeight)},componentDidUpdate:function(t,e){if(this.loadingSpinnerHeight=this.utils.getLoadingSpinnerHeight(),this.props.displayBottomUpwards){var n=this.getLowestPossibleScrollTop();this.shouldAttachToBottom&&this.utils.getScrollTop()this.state.infiniteComputer.getTotalScrollableHeight()-this.computedProps.containerHeight-this.computedProps.infiniteLoadBeginEdgeOffset},onInfiniteLoad:function(){this.setState({isInfiniteLoading:!0}),this.computedProps.onInfiniteLoad()},handleScroll:function(t){this.shouldAttachToBottom=this.computedProps.displayBottomUpwards&&t>=this.getLowestPossibleScrollTop(),this.manageScrollTimeouts();var e=l.recomputeApertureStateFromOptionsAndScrollTop(this.state,t);this.passedEdgeForInfiniteScroll(t)&&!this.state.isInfiniteLoading?(this.setState(Object.assign({},e)),this.onInfiniteLoad()):this.setState(e)},buildHeightStyle:function(t){return{width:"100%",height:Math.ceil(t)}},render:function(){var t,e=this;t=this.state.numberOfChildren>1?this.computedProps.children.slice(this.state.displayIndexStart,this.state.displayIndexEnd+1):this.computedProps.children;var n={};this.state.isScrolling&&(n.pointerEvents="none");var o=this.state.infiniteComputer.getTopSpacerHeight(this.state.displayIndexStart),r=this.state.infiniteComputer.getBottomSpacerHeight(this.state.displayIndexEnd);if(this.computedProps.displayBottomUpwards){var a=this.computedProps.containerHeight-this.state.infiniteComputer.getTotalScrollableHeight();a>0&&(o=a-this.loadingSpinnerHeight)}var s=void 0===this.computedProps.infiniteLoadBeginEdgeOffset?null:i.createElement("div",{ref:function(t){e.loadingSpinner=t}},this.state.isInfiniteLoading?this.computedProps.loadingSpinnerDelegate:null);return i.createElement("div",{className:this.computedProps.className,ref:function(t){e.scrollable=t},style:this.utils.buildScrollableStyle(),onScroll:this.utils.nodeScrollListener},i.createElement("div",{ref:function(t){e.smoothScrollingWrapper=t},style:n},i.createElement("div",{ref:function(t){e.topSpacer=t},style:this.buildHeightStyle(o)}),this.computedProps.displayBottomUpwards&&s,t,!this.computedProps.displayBottomUpwards&&s,i.createElement("div",{ref:function(t){e.bottomSpacer=t},style:this.buildHeightStyle(r)})))}});e.exports=f,n.Infinite=f}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./utils/checkProps":20,"./utils/establish-polyfills":21,"./utils/infiniteHelpers":22,"./utils/scaleEnum":23,"./utils/types":24,"create-react-class":3,"lodash.isfinite":9,"prop-types":14,react:void 0}],2:[function(t,e,n){(function(n){"use strict";function o(t){return t}function i(t,e,i){function p(t,e,o){for(var i in e)e.hasOwnProperty(i)&&("production"!==n.env.NODE_ENV?l("function"==typeof e[i],"%s: %s type `%s` is invalid; it must be a function, usually from React.PropTypes.",t.displayName||"ReactClass",c[o],i):void 0)}function f(t,e){var n=O.hasOwnProperty(e)?O[e]:null;N.hasOwnProperty(e)&&s("OVERRIDE_BASE"===n,"ReactClassInterface: You are attempting to override `%s` from your class specification. Ensure that your method names do not overlap with React methods.",e),t&&s("DEFINE_MANY"===n||"DEFINE_MANY_MERGED"===n,"ReactClassInterface: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",e)}function d(t,o){if(o){s("function"!=typeof o,"ReactClass: You're attempting to use a component class or function as a mixin. Instead, just use a regular object."),s(!e(o),"ReactClass: You're attempting to use a component as a mixin. Instead, just use a regular object.");var i=t.prototype,r=i.__reactAutoBindPairs;o.hasOwnProperty(u)&&w.mixins(t,o.mixins);for(var a in o)if(o.hasOwnProperty(a)&&a!==u){var c=o[a],p=i.hasOwnProperty(a);if(f(p,a),w.hasOwnProperty(a))w[a](t,c);else{var d=O.hasOwnProperty(a),h="function"==typeof c,y=h&&!d&&!p&&o.autobind!==!1;if(y)r.push(a,c),i[a]=c;else if(p){var v=O[a];s(d&&("DEFINE_MANY_MERGED"===v||"DEFINE_MANY"===v),"ReactClass: Unexpected spec policy %s for key %s when mixing in component specs.",v,a),"DEFINE_MANY_MERGED"===v?i[a]=m(i[a],c):"DEFINE_MANY"===v&&(i[a]=g(i[a],c))}else i[a]=c,"production"!==n.env.NODE_ENV&&"function"==typeof c&&o.displayName&&(i[a].displayName=o.displayName+"_"+a)}}}else if("production"!==n.env.NODE_ENV){var b=typeof o,E="object"===b&&null!==o;"production"!==n.env.NODE_ENV?l(E,"%s: You're attempting to include a mixin that is either null or not an object. Check the mixins included by the component, as well as any mixins they include themselves. Expected object but got %s.",t.displayName||"ReactClass",null===o?null:b):void 0}}function h(t,e){if(e)for(var n in e){var o=e[n];if(e.hasOwnProperty(n)){var i=n in w;s(!i,'ReactClass: You are attempting to define a reserved property, `%s`, that shouldn\'t be on the "statics" key. Define it as an instance property instead; it will still be accessible on the constructor.',n);var r=n in t;s(!r,"ReactClass: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",n),t[n]=o}}}function y(t,e){s(t&&e&&"object"==typeof t&&"object"==typeof e,"mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.");for(var n in e)e.hasOwnProperty(n)&&(s(void 0===t[n],"mergeIntoWithNoDuplicateKeys(): Tried to merge two objects with the same key: `%s`. This conflict may be due to a mixin; in particular, this may be caused by two getInitialState() or getDefaultProps() methods returning objects with clashing keys.",n),t[n]=e[n]);return t}function m(t,e){return function(){var n=t.apply(this,arguments),o=e.apply(this,arguments);if(null==n)return o;if(null==o)return n;var i={};return y(i,n),y(i,o),i}}function g(t,e){return function(){t.apply(this,arguments),e.apply(this,arguments)}}function v(t,e){var o=e.bind(t);if("production"!==n.env.NODE_ENV){o.__reactBoundContext=t,o.__reactBoundMethod=e,o.__reactBoundArguments=null;var i=t.constructor.displayName,r=o.bind;o.bind=function(a){for(var s=arguments.length,c=Array(s>1?s-1:0),u=1;u1?e-1:0),o=1;o2?o-2:0),r=2;r-1&&t%1==0&&t<=v}function a(t){return s(t)&&y.call(t)==u}function s(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function l(t){return null!=t&&(a(t)?m.test(d.call(t)):o(t)&&p.test(t))}var c="[object Array]",u="[object Function]",p=/^\[object .+?Constructor\]$/,f=Object.prototype,d=Function.prototype.toString,h=f.hasOwnProperty,y=f.toString,m=RegExp("^"+d.call(h).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),g=i(Array,"isArray"),v=9007199254740991,b=g||function(t){return o(t)&&r(t.length)&&y.call(t)==c};e.exports=b},{}],9:[function(t,e,n){(function(t){function n(t){return"number"==typeof t&&o(t)}var o=t.isFinite;e.exports=n}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],10:[function(t,e,n){"use strict";function o(t){if(null===t||void 0===t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}var i=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;e.exports=Object.assign||function(t,e){for(var n,a,s=o(t),l=1;l0?e-1:e}},{key:"getTopSpacerHeight",value:function(t){return t*this.heightData}},{key:"getBottomSpacerHeight",value:function(t){var e=t+1;return Math.max(0,(this.numberOfChildren-e)*this.heightData)}}]),e}(s);e.exports=l},{"./infiniteComputer.js":18}],18:[function(t,e,n){"use strict";function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var i=function(){function t(t,e){for(var n=0;ne&&(s=r-1)}return n===o.CLOSEST_LOWER&&l>0?i=l-1:n===o.CLOSEST_HIGHER&&s=0||Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]);return n}var r=n.React||e("react"),i=n.PropTypes||e("prop-types"),a=n.createReactClass||e("create-react-class");e("./utils/establish-polyfills");var s=e("./utils/scaleEnum"),l=e("./utils/infiniteHelpers"),c=e("lodash.isfinite"),u=e("./utils/types").preloadType,p=p=e("./utils/checkProps"),f=a({propTypes:{children:i.any,handleScroll:i.func,preloadBatchSize:u,preloadAdditionalHeight:u,elementHeight:i.oneOfType([i.number,i.arrayOf(i.number)]).isRequired,containerHeight:i.number,useWindowAsScrollContainer:i.bool,displayBottomUpwards:i.bool.isRequired,infiniteLoadBeginEdgeOffset:i.number,onInfiniteLoad:i.func,loadingSpinnerDelegate:i.node,isInfiniteLoading:i.bool,timeScrollStateLastsForAfterUserScrolls:i.number,className:i.string,styles:i.shape({scrollableStyle:i.object}).isRequired},statics:{containerHeightScaleFactor:function(e){if(!c(e))throw new Error("The scale factor must be a number.");return{type:s.CONTAINER_HEIGHT_SCALE_FACTOR,amount:e}}},computedProps:{},utils:{},shouldAttachToBottom:!1,preservedScrollState:0,loadingSpinnerHeight:0,deprecationWarned:!1,scrollable:null,topSpacer:null,bottomSpacer:null,smoothScrollingWrapper:null,loadingSpinner:null,getDefaultProps:function(){return{handleScroll:function(){},useWindowAsScrollContainer:!1,onInfiniteLoad:function(){},loadingSpinnerDelegate:r.createElement("div",null),displayBottomUpwards:!1,isInfiniteLoading:!1,timeScrollStateLastsForAfterUserScrolls:150,className:"",styles:{}}},getInitialState:function(){var e=this.recomputeInternalStateFromProps(this.props);this.computedProps=e.computedProps,this.utils=e.utils,this.shouldAttachToBottom=this.props.displayBottomUpwards;var t=e.newState;return t.scrollTimeout=void 0,t.isScrolling=!1,t},generateComputedProps:function(e){var t=e.containerHeight,n=e.preloadBatchSize,r=e.preloadAdditionalHeight,i=o(e,["containerHeight","preloadBatchSize","preloadAdditionalHeight"]),a={};t="number"==typeof t?t:0,a.containerHeight=e.useWindowAsScrollContainer?window.innerHeight:t,void 0!==i.infiniteLoadBeginBottomOffset&&(a.infiniteLoadBeginEdgeOffset=i.infiniteLoadBeginBottomOffset,this.deprecationWarned||(console.error("Warning: React Infinite's infiniteLoadBeginBottomOffset prop\n has been deprecated as of 0.6.0. Please use infiniteLoadBeginEdgeOffset.\n Because this is a rather descriptive name, a simple find and replace\n should suffice."),this.deprecationWarned=!0));var l={type:s.CONTAINER_HEIGHT_SCALE_FACTOR,amount:.5},c=n&&n.type?n:l;"number"==typeof n?a.preloadBatchSize=n:"object"==typeof c&&c.type===s.CONTAINER_HEIGHT_SCALE_FACTOR?a.preloadBatchSize=a.containerHeight*c.amount:a.preloadBatchSize=0;var u={type:s.CONTAINER_HEIGHT_SCALE_FACTOR,amount:1},p=r&&r.type?r:u;return"number"==typeof r?a.preloadAdditionalHeight=r:"object"==typeof p&&p.type===s.CONTAINER_HEIGHT_SCALE_FACTOR?a.preloadAdditionalHeight=a.containerHeight*p.amount:a.preloadAdditionalHeight=0,Object.assign(i,a)},generateComputedUtilityFunctions:function(e){var t=this,n={};return n.getLoadingSpinnerHeight=function(){var e=0;return t.loadingSpinner&&(e=t.loadingSpinner.offsetHeight||0),e},e.useWindowAsScrollContainer?(n.subscribeToScrollListener=function(){window.addEventListener("scroll",t.infiniteHandleScroll)},n.unsubscribeFromScrollListener=function(){window.removeEventListener("scroll",t.infiniteHandleScroll)},n.nodeScrollListener=function(){},n.getScrollTop=function(){return window.pageYOffset},n.setScrollTop=function(e){window.scroll(window.pageXOffset,e)},n.scrollShouldBeIgnored=function(){return!1},n.buildScrollableStyle=function(){return{}}):(n.subscribeToScrollListener=function(){},n.unsubscribeFromScrollListener=function(){},n.nodeScrollListener=this.infiniteHandleScroll,n.getScrollTop=function(){return t.scrollable?t.scrollable.scrollTop:0},n.setScrollTop=function(e){t.scrollable&&(t.scrollable.scrollTop=e)},n.scrollShouldBeIgnored=function(e){return e.target!==t.scrollable},n.buildScrollableStyle=function(){return Object.assign({},{height:t.computedProps.containerHeight,overflowX:"hidden",overflowY:"scroll",WebkitOverflowScrolling:"touch"},t.computedProps.styles.scrollableStyle||{})}),n},recomputeInternalStateFromProps:function(e){p(e);var t=this.generateComputedProps(e),n=this.generateComputedUtilityFunctions(e),o={};return o.numberOfChildren=r.Children.count(t.children),o.infiniteComputer=l.createInfiniteComputer(t.elementHeight,t.children,t.displayBottomUpwards),void 0!==t.isInfiniteLoading&&(o.isInfiniteLoading=t.isInfiniteLoading),o.preloadBatchSize=t.preloadBatchSize,o.preloadAdditionalHeight=t.preloadAdditionalHeight,o=Object.assign(o,l.recomputeApertureStateFromOptionsAndScrollTop(o,n.getScrollTop())),{computedProps:t,utils:n,newState:o}},componentWillReceiveProps:function(e){var t=this.recomputeInternalStateFromProps(e);this.computedProps=t.computedProps,this.utils=t.utils,this.setState(t.newState)},componentWillUpdate:function(){this.props.displayBottomUpwards&&(this.preservedScrollState=this.utils.getScrollTop()-this.loadingSpinnerHeight)},componentDidUpdate:function(e,t){if(this.loadingSpinnerHeight=this.utils.getLoadingSpinnerHeight(),this.props.displayBottomUpwards){var n=this.getLowestPossibleScrollTop();this.shouldAttachToBottom&&this.utils.getScrollTop()this.state.infiniteComputer.getTotalScrollableHeight()-this.computedProps.containerHeight-this.computedProps.infiniteLoadBeginEdgeOffset},onInfiniteLoad:function(){this.setState({isInfiniteLoading:!0}),this.computedProps.onInfiniteLoad()},handleScroll:function(e){this.shouldAttachToBottom=this.computedProps.displayBottomUpwards&&e>=this.getLowestPossibleScrollTop(),this.manageScrollTimeouts();var t=l.recomputeApertureStateFromOptionsAndScrollTop(this.state,e);this.passedEdgeForInfiniteScroll(e)&&!this.state.isInfiniteLoading?(this.setState(Object.assign({},t)),this.onInfiniteLoad()):this.setState(t)},buildHeightStyle:function(e){return{width:"100%",height:Math.ceil(e)}},render:function(){var e,t=this;e=this.state.numberOfChildren>1?this.computedProps.children.slice(this.state.displayIndexStart,this.state.displayIndexEnd+1):this.computedProps.children;var n={};this.state.isScrolling&&(n.pointerEvents="none");var o=this.state.infiniteComputer.getTopSpacerHeight(this.state.displayIndexStart),i=this.state.infiniteComputer.getBottomSpacerHeight(this.state.displayIndexEnd);if(this.computedProps.displayBottomUpwards){var a=this.computedProps.containerHeight-this.state.infiniteComputer.getTotalScrollableHeight();a>0&&(o=a-this.loadingSpinnerHeight)}var s=void 0===this.computedProps.infiniteLoadBeginEdgeOffset?null:r.createElement("div",{ref:function(e){t.loadingSpinner=e}},this.state.isInfiniteLoading?this.computedProps.loadingSpinnerDelegate:null);return r.createElement("div",{className:this.computedProps.className,ref:function(e){t.scrollable=e},style:this.utils.buildScrollableStyle(),onScroll:this.utils.nodeScrollListener},r.createElement("div",{ref:function(e){t.smoothScrollingWrapper=e},style:n},r.createElement("div",{ref:function(e){t.topSpacer=e},style:this.buildHeightStyle(o)}),this.computedProps.displayBottomUpwards&&s,e,!this.computedProps.displayBottomUpwards&&s,r.createElement("div",{ref:function(e){t.bottomSpacer=e},style:this.buildHeightStyle(i)})))}});t.exports=f,n.Infinite=f}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./utils/checkProps":22,"./utils/establish-polyfills":23,"./utils/infiniteHelpers":24,"./utils/scaleEnum":25,"./utils/types":26,"create-react-class":3,"lodash.isfinite":10,"prop-types":16,react:void 0}],2:[function(e,t,n){(function(n){"use strict";function o(e){return e}function r(e,t,r){function p(e,t,o){for(var r in t)t.hasOwnProperty(r)&&("production"!==n.env.NODE_ENV?l("function"==typeof t[r],"%s: %s type `%s` is invalid; it must be a function, usually from React.PropTypes.",e.displayName||"ReactClass",c[o],r):void 0)}function f(e,t){var n=O.hasOwnProperty(t)?O[t]:null;_.hasOwnProperty(t)&&s("OVERRIDE_BASE"===n,"ReactClassInterface: You are attempting to override `%s` from your class specification. Ensure that your method names do not overlap with React methods.",t),e&&s("DEFINE_MANY"===n||"DEFINE_MANY_MERGED"===n,"ReactClassInterface: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",t)}function d(e,o){if(o){s("function"!=typeof o,"ReactClass: You're attempting to use a component class or function as a mixin. Instead, just use a regular object."),s(!t(o),"ReactClass: You're attempting to use a component as a mixin. Instead, just use a regular object.");var r=e.prototype,i=r.__reactAutoBindPairs;o.hasOwnProperty(u)&&w.mixins(e,o.mixins);for(var a in o)if(o.hasOwnProperty(a)&&a!==u){var c=o[a],p=r.hasOwnProperty(a);if(f(p,a),w.hasOwnProperty(a))w[a](e,c);else{var d=O.hasOwnProperty(a),h="function"==typeof c,y=h&&!d&&!p&&o.autobind!==!1;if(y)i.push(a,c),r[a]=c;else if(p){var v=O[a];s(d&&("DEFINE_MANY_MERGED"===v||"DEFINE_MANY"===v),"ReactClass: Unexpected spec policy %s for key %s when mixing in component specs.",v,a),"DEFINE_MANY_MERGED"===v?r[a]=m(r[a],c):"DEFINE_MANY"===v&&(r[a]=g(r[a],c))}else r[a]=c,"production"!==n.env.NODE_ENV&&"function"==typeof c&&o.displayName&&(r[a].displayName=o.displayName+"_"+a)}}}else if("production"!==n.env.NODE_ENV){var b=typeof o,S="object"===b&&null!==o;"production"!==n.env.NODE_ENV?l(S,"%s: You're attempting to include a mixin that is either null or not an object. Check the mixins included by the component, as well as any mixins they include themselves. Expected object but got %s.",e.displayName||"ReactClass",null===o?null:b):void 0}}function h(e,t){if(t)for(var n in t){var o=t[n];if(t.hasOwnProperty(n)){var r=n in w;s(!r,'ReactClass: You are attempting to define a reserved property, `%s`, that shouldn\'t be on the "statics" key. Define it as an instance property instead; it will still be accessible on the constructor.',n);var i=n in e;s(!i,"ReactClass: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",n),e[n]=o}}}function y(e,t){s(e&&t&&"object"==typeof e&&"object"==typeof t,"mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.");for(var n in t)t.hasOwnProperty(n)&&(s(void 0===e[n],"mergeIntoWithNoDuplicateKeys(): Tried to merge two objects with the same key: `%s`. This conflict may be due to a mixin; in particular, this may be caused by two getInitialState() or getDefaultProps() methods returning objects with clashing keys.",n),e[n]=t[n]);return e}function m(e,t){return function(){var n=e.apply(this,arguments),o=t.apply(this,arguments);if(null==n)return o;if(null==o)return n;var r={};return y(r,n),y(r,o),r}}function g(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function v(e,t){var o=t.bind(e);if("production"!==n.env.NODE_ENV){o.__reactBoundContext=e,o.__reactBoundMethod=t,o.__reactBoundArguments=null;var r=e.constructor.displayName,i=o.bind;o.bind=function(a){for(var s=arguments.length,c=Array(s>1?s-1:0),u=1;u1?t-1:0),o=1;o2?o-2:0),i=2;i-1&&e%1==0&&e<=v}function a(e){return s(e)&&y.call(e)==u}function s(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function l(e){return null!=e&&(a(e)?m.test(d.call(e)):o(e)&&p.test(e))}var c="[object Array]",u="[object Function]",p=/^\[object .+?Constructor\]$/,f=Object.prototype,d=Function.prototype.toString,h=f.hasOwnProperty,y=f.toString,m=RegExp("^"+d.call(h).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),g=r(Array,"isArray"),v=9007199254740991,b=g||function(e){return o(e)&&i(e.length)&&y.call(e)==c};t.exports=b},{}],10:[function(e,t,n){(function(e){function n(e){return"number"==typeof e&&o(e)}var o=e.isFinite;t.exports=n}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],11:[function(e,t,n){"use strict";function o(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}var r=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;t.exports=Object.assign||function(e,t){for(var n,a,s=o(e),l=1;l0?t-1:t}},{key:"getTopSpacerHeight",value:function(e){return e*this.heightData}},{key:"getBottomSpacerHeight",value:function(e){var t=e+1;return Math.max(0,(this.numberOfChildren-t)*this.heightData)}}]),t}(s);t.exports=l},{"./infiniteComputer.js":20}],20:[function(e,t,n){"use strict";function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var r=function(){function e(e,t){for(var n=0;nt&&(s=i-1)}return n===o.CLOSEST_LOWER&&l>0?r=l-1:n===o.CLOSEST_HIGHER&&s Date: Mon, 15 May 2017 14:41:48 -0400 Subject: [PATCH 24/78] 0.11.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 9fd3c3e..5ed3c0a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-infinite", - "version": "0.10.0", + "version": "0.11.0", "description": "A browser-ready efficient scrolling container based on UITableView", "main": "build/react-infinite.js", "repository": { From 4128f4e065da06c33a472c3418bddf34b5529d24 Mon Sep 17 00:00:00 2001 From: Gareth Tan Date: Wed, 2 Aug 2017 15:59:18 -0400 Subject: [PATCH 25/78] Remove build files. --- .gitignore | 1 + build/computers/arrayInfiniteComputer.js | 77 ---- build/computers/constantInfiniteComputer.js | 57 --- build/computers/infiniteComputer.js | 74 ---- build/react-infinite.js | 458 -------------------- build/utils/binaryIndexSearch.js | 43 -- build/utils/checkProps.js | 25 -- build/utils/establish-polyfills.js | 16 - build/utils/infiniteHelpers.js | 46 -- build/utils/scaleEnum.js | 5 - build/utils/types.js | 10 - 11 files changed, 1 insertion(+), 811 deletions(-) delete mode 100644 build/computers/arrayInfiniteComputer.js delete mode 100644 build/computers/constantInfiniteComputer.js delete mode 100644 build/computers/infiniteComputer.js delete mode 100644 build/react-infinite.js delete mode 100644 build/utils/binaryIndexSearch.js delete mode 100644 build/utils/checkProps.js delete mode 100644 build/utils/establish-polyfills.js delete mode 100644 build/utils/infiniteHelpers.js delete mode 100644 build/utils/scaleEnum.js delete mode 100644 build/utils/types.js diff --git a/.gitignore b/.gitignore index 8b6c9ef..ecff5de 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ *.map +build coverage node_modules bower_components diff --git a/build/computers/arrayInfiniteComputer.js b/build/computers/arrayInfiniteComputer.js deleted file mode 100644 index ab10ec8..0000000 --- a/build/computers/arrayInfiniteComputer.js +++ /dev/null @@ -1,77 +0,0 @@ -'use strict'; - -var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); - -var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } }; - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } - -function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var InfiniteComputer = require('./infiniteComputer.js'), - bs = require('../utils/binaryIndexSearch.js'); - -var ArrayInfiniteComputer = (function (_InfiniteComputer) { - _inherits(ArrayInfiniteComputer, _InfiniteComputer); - - function ArrayInfiniteComputer(heightData, numberOfChildren) { - _classCallCheck(this, ArrayInfiniteComputer); - - _get(Object.getPrototypeOf(ArrayInfiniteComputer.prototype), 'constructor', this).call(this, heightData, numberOfChildren); - this.prefixHeightData = this.heightData.reduce(function (acc, next) { - if (acc.length === 0) { - return [next]; - } else { - acc.push(acc[acc.length - 1] + next); - return acc; - } - }, []); - } - - _createClass(ArrayInfiniteComputer, [{ - key: 'maybeIndexToIndex', - value: function maybeIndexToIndex(index) { - if (typeof index === 'undefined' || index === null) { - return this.prefixHeightData.length - 1; - } else { - return index; - } - } - }, { - key: 'getTotalScrollableHeight', - value: function getTotalScrollableHeight() { - var length = this.prefixHeightData.length; - return length === 0 ? 0 : this.prefixHeightData[length - 1]; - } - }, { - key: 'getDisplayIndexStart', - value: function getDisplayIndexStart(windowTop) { - var foundIndex = bs.binaryIndexSearch(this.prefixHeightData, windowTop, bs.opts.CLOSEST_HIGHER); - return this.maybeIndexToIndex(foundIndex); - } - }, { - key: 'getDisplayIndexEnd', - value: function getDisplayIndexEnd(windowBottom) { - var foundIndex = bs.binaryIndexSearch(this.prefixHeightData, windowBottom, bs.opts.CLOSEST_HIGHER); - return this.maybeIndexToIndex(foundIndex); - } - }, { - key: 'getTopSpacerHeight', - value: function getTopSpacerHeight(displayIndexStart) { - var previous = displayIndexStart - 1; - return previous < 0 ? 0 : this.prefixHeightData[previous]; - } - }, { - key: 'getBottomSpacerHeight', - value: function getBottomSpacerHeight(displayIndexEnd) { - if (displayIndexEnd === -1) { - return 0; - } - return this.getTotalScrollableHeight() - this.prefixHeightData[displayIndexEnd]; - } - }]); - - return ArrayInfiniteComputer; -})(InfiniteComputer); - -module.exports = ArrayInfiniteComputer; \ No newline at end of file diff --git a/build/computers/constantInfiniteComputer.js b/build/computers/constantInfiniteComputer.js deleted file mode 100644 index 027f768..0000000 --- a/build/computers/constantInfiniteComputer.js +++ /dev/null @@ -1,57 +0,0 @@ -'use strict'; - -var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); - -var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } }; - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } - -function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var InfiniteComputer = require('./infiniteComputer.js'); - -var ConstantInfiniteComputer = (function (_InfiniteComputer) { - _inherits(ConstantInfiniteComputer, _InfiniteComputer); - - function ConstantInfiniteComputer() { - _classCallCheck(this, ConstantInfiniteComputer); - - _get(Object.getPrototypeOf(ConstantInfiniteComputer.prototype), 'constructor', this).apply(this, arguments); - } - - _createClass(ConstantInfiniteComputer, [{ - key: 'getTotalScrollableHeight', - value: function getTotalScrollableHeight() { - return this.heightData * this.numberOfChildren; - } - }, { - key: 'getDisplayIndexStart', - value: function getDisplayIndexStart(windowTop) { - return Math.floor(windowTop / this.heightData); - } - }, { - key: 'getDisplayIndexEnd', - value: function getDisplayIndexEnd(windowBottom) { - var nonZeroIndex = Math.ceil(windowBottom / this.heightData); - if (nonZeroIndex > 0) { - return nonZeroIndex - 1; - } - return nonZeroIndex; - } - }, { - key: 'getTopSpacerHeight', - value: function getTopSpacerHeight(displayIndexStart) { - return displayIndexStart * this.heightData; - } - }, { - key: 'getBottomSpacerHeight', - value: function getBottomSpacerHeight(displayIndexEnd) { - var nonZeroIndex = displayIndexEnd + 1; - return Math.max(0, (this.numberOfChildren - nonZeroIndex) * this.heightData); - } - }]); - - return ConstantInfiniteComputer; -})(InfiniteComputer); - -module.exports = ConstantInfiniteComputer; \ No newline at end of file diff --git a/build/computers/infiniteComputer.js b/build/computers/infiniteComputer.js deleted file mode 100644 index 9855731..0000000 --- a/build/computers/infiniteComputer.js +++ /dev/null @@ -1,74 +0,0 @@ -// An infinite computer must be able to do the following things: -// 1. getTotalScrollableHeight() -// 2. getDisplayIndexStart() -// 3. getDisplayIndexEnd() - -'use strict'; - -var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } - -var InfiniteComputer = (function () { - function InfiniteComputer(heightData, numberOfChildren) { - _classCallCheck(this, InfiniteComputer); - - this.heightData = heightData; - this.numberOfChildren = numberOfChildren; - } - - _createClass(InfiniteComputer, [{ - key: 'getTotalScrollableHeight', - value: function getTotalScrollableHeight() { - if (process.env.NODE_ENV === 'development') { - throw new Error('getTotalScrollableHeight not implemented.'); - } - } - - /* eslint-disable no-unused-vars */ - }, { - key: 'getDisplayIndexStart', - value: function getDisplayIndexStart(windowTop) { - /* eslint-enable no-unused-vars */ - if (process.env.NODE_ENV === 'development') { - throw new Error('getDisplayIndexStart not implemented.'); - } - } - - /* eslint-disable no-unused-vars */ - }, { - key: 'getDisplayIndexEnd', - value: function getDisplayIndexEnd(windowBottom) { - /* eslint-enable no-unused-vars */ - if (process.env.NODE_ENV === 'development') { - throw new Error('getDisplayIndexEnd not implemented.'); - } - } - - // These are helper methods, and can be calculated from - // the above details. - /* eslint-disable no-unused-vars */ - }, { - key: 'getTopSpacerHeight', - value: function getTopSpacerHeight(displayIndexStart) { - /* eslint-enable no-unused-vars */ - if (process.env.NODE_ENV === 'development') { - throw new Error('getTopSpacerHeight not implemented.'); - } - } - - /* eslint-disable no-unused-vars */ - }, { - key: 'getBottomSpacerHeight', - value: function getBottomSpacerHeight(displayIndexEnd) { - /* eslint-enable no-unused-vars */ - if (process.env.NODE_ENV === 'development') { - throw new Error('getBottomSpacerHeight not implemented.'); - } - } - }]); - - return InfiniteComputer; -})(); - -module.exports = InfiniteComputer; \ No newline at end of file diff --git a/build/react-infinite.js b/build/react-infinite.js deleted file mode 100644 index 295b895..0000000 --- a/build/react-infinite.js +++ /dev/null @@ -1,458 +0,0 @@ -'use strict'; - -function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } - -var React = global.React || require('react'); -if (typeof window === 'undefined') { - global.window = {}; -} -require('./utils/establish-polyfills'); -var scaleEnum = require('./utils/scaleEnum'); -var infiniteHelpers = require('./utils/infiniteHelpers'); -var _isFinite = require('lodash.isfinite'); - -var preloadType = require('./utils/types').preloadType; -var checkProps = checkProps = require('./utils/checkProps'); - -var Infinite = React.createClass({ - displayName: 'Infinite', - - propTypes: { - children: React.PropTypes.any, - - handleScroll: React.PropTypes.func, - - // preloadBatchSize causes updates only to - // happen each preloadBatchSize pixels of scrolling. - // Set a larger number to cause fewer updates to the - // element list. - preloadBatchSize: preloadType, - // preloadAdditionalHeight determines how much of the - // list above and below the container is preloaded even - // when it is not currently visible to the user. In the - // regular scroll implementation, preloadAdditionalHeight - // is equal to the entire height of the list. - preloadAdditionalHeight: preloadType, // page to screen ratio - - // The provided elementHeight can be either - // 1. a constant: all elements are the same height - // 2. an array containing the height of each element - elementHeight: React.PropTypes.oneOfType([React.PropTypes.number, React.PropTypes.arrayOf(React.PropTypes.number)]).isRequired, - // This is the total height of the visible window. One - // of - containerHeight: React.PropTypes.number, - useWindowAsScrollContainer: React.PropTypes.bool, - - displayBottomUpwards: React.PropTypes.bool.isRequired, - - infiniteLoadBeginEdgeOffset: React.PropTypes.number, - onInfiniteLoad: React.PropTypes.func, - loadingSpinnerDelegate: React.PropTypes.node, - - isInfiniteLoading: React.PropTypes.bool, - timeScrollStateLastsForAfterUserScrolls: React.PropTypes.number, - - className: React.PropTypes.string, - - styles: React.PropTypes.shape({ - scrollableStyle: React.PropTypes.object - }).isRequired - }, - statics: { - containerHeightScaleFactor: function containerHeightScaleFactor(factor) { - if (!_isFinite(factor)) { - throw new Error('The scale factor must be a number.'); - } - return { - type: scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR, - amount: factor - }; - } - }, - - // Properties currently used but which may be - // refactored away in the future. - computedProps: {}, - utils: {}, - shouldAttachToBottom: false, - preservedScrollState: 0, - loadingSpinnerHeight: 0, - deprecationWarned: false, - - scrollable: null, - topSpacer: null, - bottomSpacer: null, - smoothScrollingWrapper: null, - loadingSpinner: null, - - getDefaultProps: function getDefaultProps() { - return { - handleScroll: function handleScroll() {}, - - useWindowAsScrollContainer: false, - - onInfiniteLoad: function onInfiniteLoad() {}, - loadingSpinnerDelegate: React.createElement('div', null), - - displayBottomUpwards: false, - - isInfiniteLoading: false, - timeScrollStateLastsForAfterUserScrolls: 150, - - className: '', - - styles: {} - }; - }, - - // automatic adjust to scroll direction - // give spinner a ReactCSSTransitionGroup - getInitialState: function getInitialState() { - var nextInternalState = this.recomputeInternalStateFromProps(this.props); - - this.computedProps = nextInternalState.computedProps; - this.utils = nextInternalState.utils; - this.shouldAttachToBottom = this.props.displayBottomUpwards; - - var state = nextInternalState.newState; - state.scrollTimeout = undefined; - state.isScrolling = false; - - return state; - }, - - generateComputedProps: function generateComputedProps(props) { - // These are extracted so their type definitions do not conflict. - var containerHeight = props.containerHeight; - var preloadBatchSize = props.preloadBatchSize; - var preloadAdditionalHeight = props.preloadAdditionalHeight; - - var oldProps = _objectWithoutProperties(props, ['containerHeight', 'preloadBatchSize', 'preloadAdditionalHeight']); - - var newProps = {}; - containerHeight = typeof containerHeight === 'number' ? containerHeight : 0; - newProps.containerHeight = props.useWindowAsScrollContainer ? window.innerHeight : containerHeight; - - if (oldProps.infiniteLoadBeginBottomOffset !== undefined) { - newProps.infiniteLoadBeginEdgeOffset = oldProps.infiniteLoadBeginBottomOffset; - if (!this.deprecationWarned) { - console.error('Warning: React Infinite\'s infiniteLoadBeginBottomOffset prop\n has been deprecated as of 0.6.0. Please use infiniteLoadBeginEdgeOffset.\n Because this is a rather descriptive name, a simple find and replace\n should suffice.'); - this.deprecationWarned = true; - } - } - - var defaultPreloadBatchSizeScaling = { - type: scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR, - amount: 0.5 - }; - var batchSize = preloadBatchSize && preloadBatchSize.type ? preloadBatchSize : defaultPreloadBatchSizeScaling; - - if (typeof preloadBatchSize === 'number') { - newProps.preloadBatchSize = preloadBatchSize; - } else if (typeof batchSize === 'object' && batchSize.type === scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR) { - newProps.preloadBatchSize = newProps.containerHeight * batchSize.amount; - } else { - newProps.preloadBatchSize = 0; - } - - var defaultPreloadAdditionalHeightScaling = { - type: scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR, - amount: 1 - }; - var additionalHeight = preloadAdditionalHeight && preloadAdditionalHeight.type ? preloadAdditionalHeight : defaultPreloadAdditionalHeightScaling; - if (typeof preloadAdditionalHeight === 'number') { - newProps.preloadAdditionalHeight = preloadAdditionalHeight; - } else if (typeof additionalHeight === 'object' && additionalHeight.type === scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR) { - newProps.preloadAdditionalHeight = newProps.containerHeight * additionalHeight.amount; - } else { - newProps.preloadAdditionalHeight = 0; - } - - return Object.assign(oldProps, newProps); - }, - - generateComputedUtilityFunctions: function generateComputedUtilityFunctions(props) { - var _this = this; - - var utilities = {}; - utilities.getLoadingSpinnerHeight = function () { - var loadingSpinnerHeight = 0; - if (_this.loadingSpinner) { - loadingSpinnerHeight = _this.loadingSpinner.offsetHeight || 0; - } - return loadingSpinnerHeight; - }; - if (props.useWindowAsScrollContainer) { - utilities.subscribeToScrollListener = function () { - window.addEventListener('scroll', _this.infiniteHandleScroll); - }; - utilities.unsubscribeFromScrollListener = function () { - window.removeEventListener('scroll', _this.infiniteHandleScroll); - }; - utilities.nodeScrollListener = function () {}; - utilities.getScrollTop = function () { - return window.pageYOffset; - }; - utilities.setScrollTop = function (top) { - window.scroll(window.pageXOffset, top); - }; - utilities.scrollShouldBeIgnored = function () { - return false; - }; - utilities.buildScrollableStyle = function () { - return {}; - }; - } else { - utilities.subscribeToScrollListener = function () {}; - utilities.unsubscribeFromScrollListener = function () {}; - utilities.nodeScrollListener = this.infiniteHandleScroll; - utilities.getScrollTop = function () { - return _this.scrollable ? _this.scrollable.scrollTop : 0; - }; - - utilities.setScrollTop = function (top) { - if (_this.scrollable) { - _this.scrollable.scrollTop = top; - } - }; - utilities.scrollShouldBeIgnored = function (event) { - return event.target !== _this.scrollable; - }; - - utilities.buildScrollableStyle = function () { - return Object.assign({}, { - height: _this.computedProps.containerHeight, - overflowX: 'hidden', - overflowY: 'scroll', - WebkitOverflowScrolling: 'touch' - }, _this.computedProps.styles.scrollableStyle || {}); - }; - } - return utilities; - }, - - recomputeInternalStateFromProps: function recomputeInternalStateFromProps(props) { - checkProps(props); - var computedProps = this.generateComputedProps(props); - var utils = this.generateComputedUtilityFunctions(props); - - var newState = {}; - - newState.numberOfChildren = React.Children.count(computedProps.children); - newState.infiniteComputer = infiniteHelpers.createInfiniteComputer(computedProps.elementHeight, computedProps.children, computedProps.displayBottomUpwards); - - if (computedProps.isInfiniteLoading !== undefined) { - newState.isInfiniteLoading = computedProps.isInfiniteLoading; - } - - newState.preloadBatchSize = computedProps.preloadBatchSize; - newState.preloadAdditionalHeight = computedProps.preloadAdditionalHeight; - - newState = Object.assign(newState, infiniteHelpers.recomputeApertureStateFromOptionsAndScrollTop(newState, utils.getScrollTop())); - - return { - computedProps: computedProps, - utils: utils, - newState: newState - }; - }, - - componentWillReceiveProps: function componentWillReceiveProps(nextProps) { - var nextInternalState = this.recomputeInternalStateFromProps(nextProps); - - this.computedProps = nextInternalState.computedProps; - this.utils = nextInternalState.utils; - - this.setState(nextInternalState.newState); - }, - - componentWillUpdate: function componentWillUpdate() { - if (this.props.displayBottomUpwards) { - this.preservedScrollState = this.utils.getScrollTop() - this.loadingSpinnerHeight; - } - }, - - componentDidUpdate: function componentDidUpdate(prevProps, prevState) { - this.loadingSpinnerHeight = this.utils.getLoadingSpinnerHeight(); - - if (this.props.displayBottomUpwards) { - var lowestScrollTop = this.getLowestPossibleScrollTop(); - if (this.shouldAttachToBottom && this.utils.getScrollTop() < lowestScrollTop) { - this.utils.setScrollTop(lowestScrollTop); - } else if (prevProps.isInfiniteLoading && !this.props.isInfiniteLoading) { - this.utils.setScrollTop(this.state.infiniteComputer.getTotalScrollableHeight() - prevState.infiniteComputer.getTotalScrollableHeight() + this.preservedScrollState); - } - } - - var hasLoadedMoreChildren = this.state.numberOfChildren !== prevState.numberOfChildren; - if (hasLoadedMoreChildren) { - var newApertureState = infiniteHelpers.recomputeApertureStateFromOptionsAndScrollTop(this.state, this.utils.getScrollTop()); - this.setState(newApertureState); - } - - var isMissingVisibleRows = hasLoadedMoreChildren && !this.hasAllVisibleItems() && !this.state.isInfiniteLoading; - if (isMissingVisibleRows) { - this.onInfiniteLoad(); - } - }, - - componentDidMount: function componentDidMount() { - this.utils.subscribeToScrollListener(); - - if (!this.hasAllVisibleItems()) { - this.onInfiniteLoad(); - } - - if (this.props.displayBottomUpwards) { - var lowestScrollTop = this.getLowestPossibleScrollTop(); - if (this.shouldAttachToBottom && this.utils.getScrollTop() < lowestScrollTop) { - this.utils.setScrollTop(lowestScrollTop); - } - } - }, - - componentWillUnmount: function componentWillUnmount() { - this.utils.unsubscribeFromScrollListener(); - }, - - infiniteHandleScroll: function infiniteHandleScroll(e) { - if (this.utils.scrollShouldBeIgnored(e)) { - return; - } - this.computedProps.handleScroll(this.scrollable); - this.handleScroll(this.utils.getScrollTop()); - }, - - manageScrollTimeouts: function manageScrollTimeouts() { - // Maintains a series of timeouts to set this.state.isScrolling - // to be true when the element is scrolling. - - if (this.state.scrollTimeout) { - clearTimeout(this.state.scrollTimeout); - } - - var that = this, - scrollTimeout = setTimeout(function () { - that.setState({ - isScrolling: false, - scrollTimeout: undefined - }); - }, this.computedProps.timeScrollStateLastsForAfterUserScrolls); - - this.setState({ - isScrolling: true, - scrollTimeout: scrollTimeout - }); - }, - - getLowestPossibleScrollTop: function getLowestPossibleScrollTop() { - return this.state.infiniteComputer.getTotalScrollableHeight() - this.computedProps.containerHeight; - }, - - hasAllVisibleItems: function hasAllVisibleItems() { - return !(_isFinite(this.computedProps.infiniteLoadBeginEdgeOffset) && this.state.infiniteComputer.getTotalScrollableHeight() < this.computedProps.containerHeight); - }, - - passedEdgeForInfiniteScroll: function passedEdgeForInfiniteScroll(scrollTop) { - if (this.computedProps.displayBottomUpwards) { - return !this.shouldAttachToBottom && scrollTop < this.computedProps.infiniteLoadBeginEdgeOffset; - } else { - return scrollTop > this.state.infiniteComputer.getTotalScrollableHeight() - this.computedProps.containerHeight - this.computedProps.infiniteLoadBeginEdgeOffset; - } - }, - - onInfiniteLoad: function onInfiniteLoad() { - this.setState({ isInfiniteLoading: true }); - this.computedProps.onInfiniteLoad(); - }, - - handleScroll: function handleScroll(scrollTop) { - this.shouldAttachToBottom = this.computedProps.displayBottomUpwards && scrollTop >= this.getLowestPossibleScrollTop(); - - this.manageScrollTimeouts(); - - var newApertureState = infiniteHelpers.recomputeApertureStateFromOptionsAndScrollTop(this.state, scrollTop); - - if (this.passedEdgeForInfiniteScroll(scrollTop) && !this.state.isInfiniteLoading) { - this.setState(Object.assign({}, newApertureState)); - this.onInfiniteLoad(); - } else { - this.setState(newApertureState); - } - }, - - buildHeightStyle: function buildHeightStyle(height) { - return { - width: '100%', - height: Math.ceil(height) - }; - }, - - render: function render() { - var _this2 = this; - - var displayables; - if (this.state.numberOfChildren > 1) { - displayables = this.computedProps.children.slice(this.state.displayIndexStart, this.state.displayIndexEnd + 1); - } else { - displayables = this.computedProps.children; - } - - var infiniteScrollStyles = {}; - if (this.state.isScrolling) { - infiniteScrollStyles.pointerEvents = 'none'; - } - - var topSpacerHeight = this.state.infiniteComputer.getTopSpacerHeight(this.state.displayIndexStart), - bottomSpacerHeight = this.state.infiniteComputer.getBottomSpacerHeight(this.state.displayIndexEnd); - - // This asymmetry is due to a reluctance to use CSS to control - // the bottom alignment - if (this.computedProps.displayBottomUpwards) { - var heightDifference = this.computedProps.containerHeight - this.state.infiniteComputer.getTotalScrollableHeight(); - if (heightDifference > 0) { - topSpacerHeight = heightDifference - this.loadingSpinnerHeight; - } - } - - var loadingSpinner = this.computedProps.infiniteLoadBeginEdgeOffset === undefined ? null : React.createElement( - 'div', - { ref: function (c) { - _this2.loadingSpinner = c; - } }, - this.state.isInfiniteLoading ? this.computedProps.loadingSpinnerDelegate : null - ); - - // topSpacer and bottomSpacer take up the amount of space that the - // rendered elements would have taken up otherwise - return React.createElement( - 'div', - { className: this.computedProps.className, - ref: function (c) { - _this2.scrollable = c; - }, - style: this.utils.buildScrollableStyle(), - onScroll: this.utils.nodeScrollListener }, - React.createElement( - 'div', - { ref: function (c) { - _this2.smoothScrollingWrapper = c; - }, style: infiniteScrollStyles }, - React.createElement('div', { ref: function (c) { - _this2.topSpacer = c; - }, - style: this.buildHeightStyle(topSpacerHeight) }), - this.computedProps.displayBottomUpwards && loadingSpinner, - displayables, - !this.computedProps.displayBottomUpwards && loadingSpinner, - React.createElement('div', { ref: function (c) { - _this2.bottomSpacer = c; - }, - style: this.buildHeightStyle(bottomSpacerHeight) }) - ) - ); - } -}); - -module.exports = Infinite; -global.Infinite = Infinite; \ No newline at end of file diff --git a/build/utils/binaryIndexSearch.js b/build/utils/binaryIndexSearch.js deleted file mode 100644 index a799ce3..0000000 --- a/build/utils/binaryIndexSearch.js +++ /dev/null @@ -1,43 +0,0 @@ -"use strict"; - -var opts = { - CLOSEST_LOWER: 1, - CLOSEST_HIGHER: 2 -}; - -var binaryIndexSearch = function binaryIndexSearch(array, /* : Array */ -item, /* : number */ -opt /* : number */) /* : ?number */{ - var index; - - var high = array.length - 1, - low = 0, - middle, - middleItem; - - while (low <= high) { - middle = low + Math.floor((high - low) / 2); - middleItem = array[middle]; - - if (middleItem === item) { - return middle; - } else if (middleItem < item) { - low = middle + 1; - } else if (middleItem > item) { - high = middle - 1; - } - } - - if (opt === opts.CLOSEST_LOWER && low > 0) { - index = low - 1; - } else if (opt === opts.CLOSEST_HIGHER && high < array.length - 1) { - index = high + 1; - } - - return index; -}; - -module.exports = { - binaryIndexSearch: binaryIndexSearch, - opts: opts -}; \ No newline at end of file diff --git a/build/utils/checkProps.js b/build/utils/checkProps.js deleted file mode 100644 index 1c74759..0000000 --- a/build/utils/checkProps.js +++ /dev/null @@ -1,25 +0,0 @@ -// This module provides a centralized place for -// runtime checking that the props passed to React Infinite -// make the minimum amount of sense. - -'use strict'; - -var React = global.React || require('react'); -var _isFinite = require('lodash.isfinite'); - -module.exports = function (props) { - var rie = 'Invariant Violation: '; - if (!(props.containerHeight || props.useWindowAsScrollContainer)) { - throw new Error(rie + 'Either containerHeight or useWindowAsScrollContainer must be provided.'); - } - - if (!(_isFinite(props.elementHeight) || Array.isArray(props.elementHeight))) { - throw new Error(rie + 'You must provide either a number or an array of numbers as the elementHeight.'); - } - - if (Array.isArray(props.elementHeight)) { - if (React.Children.count(props.children) !== props.elementHeight.length) { - throw new Error(rie + 'There must be as many values provided in the elementHeight prop as there are children.'); - } - } -}; \ No newline at end of file diff --git a/build/utils/establish-polyfills.js b/build/utils/establish-polyfills.js deleted file mode 100644 index 7fb950e..0000000 --- a/build/utils/establish-polyfills.js +++ /dev/null @@ -1,16 +0,0 @@ -/* - A number of polyfills for native functions are consolidated - here. We do this instead of using the libraries directly - because Flow is designed to make its type refinements - with these native functions. - */ - -'use strict'; - -if (!Object.assign) { - Object.assign = require('object-assign'); -} - -if (!Array.isArray) { - Array.isArray = require('lodash.isarray'); -} \ No newline at end of file diff --git a/build/utils/infiniteHelpers.js b/build/utils/infiniteHelpers.js deleted file mode 100644 index 9ef7113..0000000 --- a/build/utils/infiniteHelpers.js +++ /dev/null @@ -1,46 +0,0 @@ -'use strict'; - -var ConstantInfiniteComputer = require('../computers/constantInfiniteComputer.js'); -var ArrayInfiniteComputer = require('../computers/arrayInfiniteComputer.js'); -var React = global.React || require('react'); - -function createInfiniteComputer(data, children) { - var computer; - var numberOfChildren = React.Children.count(children); - - // This should be guaranteed by checkProps - if (Array.isArray(data)) { - computer = new ArrayInfiniteComputer(data, numberOfChildren); - } else { - computer = new ConstantInfiniteComputer(data, numberOfChildren); - } - return computer; -} - -// Given the scrollTop of the container, computes the state the -// component should be in. The goal is to abstract all of this -// from any actual representation in the DOM. -// The window is the block with any preloadAdditionalHeight -// added to it. -function recomputeApertureStateFromOptionsAndScrollTop(_ref, scrollTop) { - var preloadBatchSize = _ref.preloadBatchSize; - var preloadAdditionalHeight = _ref.preloadAdditionalHeight; - var infiniteComputer = _ref.infiniteComputer; - return (function () { - var blockNumber = preloadBatchSize === 0 ? 0 : Math.floor(scrollTop / preloadBatchSize), - blockStart = preloadBatchSize * blockNumber, - blockEnd = blockStart + preloadBatchSize, - apertureTop = Math.max(0, blockStart - preloadAdditionalHeight), - apertureBottom = Math.min(infiniteComputer.getTotalScrollableHeight(), blockEnd + preloadAdditionalHeight); - - return { - displayIndexStart: infiniteComputer.getDisplayIndexStart(apertureTop), - displayIndexEnd: infiniteComputer.getDisplayIndexEnd(apertureBottom) - }; - })(); -} - -module.exports = { - createInfiniteComputer: createInfiniteComputer, - recomputeApertureStateFromOptionsAndScrollTop: recomputeApertureStateFromOptionsAndScrollTop -}; \ No newline at end of file diff --git a/build/utils/scaleEnum.js b/build/utils/scaleEnum.js deleted file mode 100644 index 493b81a..0000000 --- a/build/utils/scaleEnum.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -module.exports = { - CONTAINER_HEIGHT_SCALE_FACTOR: 'containerHeightScaleFactor' -}; \ No newline at end of file diff --git a/build/utils/types.js b/build/utils/types.js deleted file mode 100644 index 64ecb35..0000000 --- a/build/utils/types.js +++ /dev/null @@ -1,10 +0,0 @@ -'use strict'; - -var React = global.React || require('react'); - -module.exports = { - preloadType: React.PropTypes.oneOfType([React.PropTypes.number, React.PropTypes.shape({ - type: React.PropTypes.oneOf(['containerHeightScaleFactor']).isRequired, - amount: React.PropTypes.number.isRequired - })]) -}; \ No newline at end of file From 554bc8389176a0cb8166ab264a262e4bf7a04480 Mon Sep 17 00:00:00 2001 From: Gareth Tan Date: Wed, 2 Aug 2017 16:08:01 -0400 Subject: [PATCH 26/78] Produce committed dist. --- dist/react-infinite.js | 325 +++++++++++++++++++++++++++---------- dist/react-infinite.min.js | 4 +- 2 files changed, 241 insertions(+), 88 deletions(-) diff --git a/dist/react-infinite.js b/dist/react-infinite.js index dbbcfbd..4d57702 100644 --- a/dist/react-infinite.js +++ b/dist/react-infinite.js @@ -1,6 +1,6 @@ (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Infinite = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o=0||Object.prototype.hasOwnProperty.call(e,o)&&(i[o]=e[o]);return i}var React=global.React||require("react"),PropTypes=global.PropTypes||require("prop-types"),createReactClass=global.createReactClass||require("create-react-class");require("./utils/establish-polyfills");var scaleEnum=require("./utils/scaleEnum"),infiniteHelpers=require("./utils/infiniteHelpers"),_isFinite=require("lodash.isfinite"),preloadType=require("./utils/types").preloadType,checkProps=checkProps=require("./utils/checkProps"),Infinite=createReactClass({propTypes:{children:PropTypes.any,handleScroll:PropTypes.func,preloadBatchSize:preloadType,preloadAdditionalHeight:preloadType,elementHeight:PropTypes.oneOfType([PropTypes.number,PropTypes.arrayOf(PropTypes.number)]).isRequired,containerHeight:PropTypes.number,useWindowAsScrollContainer:PropTypes.bool,displayBottomUpwards:PropTypes.bool.isRequired,infiniteLoadBeginEdgeOffset:PropTypes.number,onInfiniteLoad:PropTypes.func,loadingSpinnerDelegate:PropTypes.node,isInfiniteLoading:PropTypes.bool,timeScrollStateLastsForAfterUserScrolls:PropTypes.number,className:PropTypes.string,styles:PropTypes.shape({scrollableStyle:PropTypes.object}).isRequired},statics:{containerHeightScaleFactor:function(e){if(!_isFinite(e))throw new Error("The scale factor must be a number.");return{type:scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR,amount:e}}},computedProps:{},utils:{},shouldAttachToBottom:!1,preservedScrollState:0,loadingSpinnerHeight:0,deprecationWarned:!1,scrollable:null,topSpacer:null,bottomSpacer:null,smoothScrollingWrapper:null,loadingSpinner:null,getDefaultProps:function(){return{handleScroll:function(){},useWindowAsScrollContainer:!1,onInfiniteLoad:function(){},loadingSpinnerDelegate:React.createElement("div",null),displayBottomUpwards:!1,isInfiniteLoading:!1,timeScrollStateLastsForAfterUserScrolls:150,className:"",styles:{}}},getInitialState:function(){var e=this.recomputeInternalStateFromProps(this.props);this.computedProps=e.computedProps,this.utils=e.utils,this.shouldAttachToBottom=this.props.displayBottomUpwards;var t=e.newState;return t.scrollTimeout=void 0,t.isScrolling=!1,t},generateComputedProps:function(e){var t=e.containerHeight,i=e.preloadBatchSize,o=e.preloadAdditionalHeight,n=_objectWithoutProperties(e,["containerHeight","preloadBatchSize","preloadAdditionalHeight"]),r={};t="number"==typeof t?t:0,r.containerHeight=e.useWindowAsScrollContainer?window.innerHeight:t,void 0!==n.infiniteLoadBeginBottomOffset&&(r.infiniteLoadBeginEdgeOffset=n.infiniteLoadBeginBottomOffset,this.deprecationWarned||(console.error("Warning: React Infinite's infiniteLoadBeginBottomOffset prop\n has been deprecated as of 0.6.0. Please use infiniteLoadBeginEdgeOffset.\n Because this is a rather descriptive name, a simple find and replace\n should suffice."),this.deprecationWarned=!0));var s={type:scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR,amount:.5},l=i&&i.type?i:s;"number"==typeof i?r.preloadBatchSize=i:"object"==typeof l&&l.type===scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR?r.preloadBatchSize=r.containerHeight*l.amount:r.preloadBatchSize=0;var a={type:scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR,amount:1},c=o&&o.type?o:a;return"number"==typeof o?r.preloadAdditionalHeight=o:"object"==typeof c&&c.type===scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR?r.preloadAdditionalHeight=r.containerHeight*c.amount:r.preloadAdditionalHeight=0,Object.assign(n,r)},generateComputedUtilityFunctions:function(e){var t=this,i={};return i.getLoadingSpinnerHeight=function(){var e=0;return t.loadingSpinner&&(e=t.loadingSpinner.offsetHeight||0),e},e.useWindowAsScrollContainer?(i.subscribeToScrollListener=function(){window.addEventListener("scroll",t.infiniteHandleScroll)},i.unsubscribeFromScrollListener=function(){window.removeEventListener("scroll",t.infiniteHandleScroll)},i.nodeScrollListener=function(){},i.getScrollTop=function(){return window.pageYOffset},i.setScrollTop=function(e){window.scroll(window.pageXOffset,e)},i.scrollShouldBeIgnored=function(){return!1},i.buildScrollableStyle=function(){return{}}):(i.subscribeToScrollListener=function(){},i.unsubscribeFromScrollListener=function(){},i.nodeScrollListener=this.infiniteHandleScroll,i.getScrollTop=function(){return t.scrollable?t.scrollable.scrollTop:0},i.setScrollTop=function(e){t.scrollable&&(t.scrollable.scrollTop=e)},i.scrollShouldBeIgnored=function(e){return e.target!==t.scrollable},i.buildScrollableStyle=function(){return Object.assign({},{height:t.computedProps.containerHeight,overflowX:"hidden",overflowY:"scroll",WebkitOverflowScrolling:"touch"},t.computedProps.styles.scrollableStyle||{})}),i},recomputeInternalStateFromProps:function(e){checkProps(e);var t=this.generateComputedProps(e),i=this.generateComputedUtilityFunctions(e),o={};return o.numberOfChildren=React.Children.count(t.children),o.infiniteComputer=infiniteHelpers.createInfiniteComputer(t.elementHeight,t.children,t.displayBottomUpwards),void 0!==t.isInfiniteLoading&&(o.isInfiniteLoading=t.isInfiniteLoading),o.preloadBatchSize=t.preloadBatchSize,o.preloadAdditionalHeight=t.preloadAdditionalHeight,o=Object.assign(o,infiniteHelpers.recomputeApertureStateFromOptionsAndScrollTop(o,i.getScrollTop())),{computedProps:t,utils:i,newState:o}},componentWillReceiveProps:function(e){var t=this.recomputeInternalStateFromProps(e);this.computedProps=t.computedProps,this.utils=t.utils,this.setState(t.newState)},componentWillUpdate:function(){this.props.displayBottomUpwards&&(this.preservedScrollState=this.utils.getScrollTop()-this.loadingSpinnerHeight)},componentDidUpdate:function(e,t){if(this.loadingSpinnerHeight=this.utils.getLoadingSpinnerHeight(),this.props.displayBottomUpwards){var i=this.getLowestPossibleScrollTop();this.shouldAttachToBottom&&this.utils.getScrollTop()this.state.infiniteComputer.getTotalScrollableHeight()-this.computedProps.containerHeight-this.computedProps.infiniteLoadBeginEdgeOffset},onInfiniteLoad:function(){this.setState({isInfiniteLoading:!0}),this.computedProps.onInfiniteLoad()},handleScroll:function(e){this.shouldAttachToBottom=this.computedProps.displayBottomUpwards&&e>=this.getLowestPossibleScrollTop(),this.manageScrollTimeouts();var t=infiniteHelpers.recomputeApertureStateFromOptionsAndScrollTop(this.state,e);this.passedEdgeForInfiniteScroll(e)&&!this.state.isInfiniteLoading?(this.setState(Object.assign({},t)),this.onInfiniteLoad()):this.setState(t)},buildHeightStyle:function(e){return{width:"100%",height:Math.ceil(e)}},render:function(){var e,t=this;e=this.state.numberOfChildren>1?this.computedProps.children.slice(this.state.displayIndexStart,this.state.displayIndexEnd+1):this.computedProps.children;var i={};this.state.isScrolling&&(i.pointerEvents="none");var o=this.state.infiniteComputer.getTopSpacerHeight(this.state.displayIndexStart),n=this.state.infiniteComputer.getBottomSpacerHeight(this.state.displayIndexEnd);if(this.computedProps.displayBottomUpwards){var r=this.computedProps.containerHeight-this.state.infiniteComputer.getTotalScrollableHeight();r>0&&(o=r-this.loadingSpinnerHeight)}var s=void 0===this.computedProps.infiniteLoadBeginEdgeOffset?null:React.createElement("div",{ref:function(e){t.loadingSpinner=e}},this.state.isInfiniteLoading?this.computedProps.loadingSpinnerDelegate:null);return React.createElement("div",{className:this.computedProps.className,ref:function(e){t.scrollable=e},style:this.utils.buildScrollableStyle(),onScroll:this.utils.nodeScrollListener},React.createElement("div",{ref:function(e){t.smoothScrollingWrapper=e},style:i},React.createElement("div",{ref:function(e){t.topSpacer=e},style:this.buildHeightStyle(o)}),this.computedProps.displayBottomUpwards&&s,e,!this.computedProps.displayBottomUpwards&&s,React.createElement("div",{ref:function(e){t.bottomSpacer=e},style:this.buildHeightStyle(n)})))}});module.exports=Infinite,global.Infinite=Infinite; +"use strict";function _objectWithoutProperties(e,t){var i={};for(var o in e)t.indexOf(o)>=0||Object.prototype.hasOwnProperty.call(e,o)&&(i[o]=e[o]);return i}var React=global.React||require("react"),PropTypes=global.PropTypes||require("prop-types"),createReactClass=global.createReactClass||require("create-react-class");"undefined"==typeof window&&(global.window={}),require("./utils/establish-polyfills");var scaleEnum=require("./utils/scaleEnum"),infiniteHelpers=require("./utils/infiniteHelpers"),_isFinite=require("lodash.isfinite"),preloadType=require("./utils/types").preloadType,checkProps=checkProps=require("./utils/checkProps"),Infinite=createReactClass({propTypes:{children:PropTypes.any,handleScroll:PropTypes.func,preloadBatchSize:preloadType,preloadAdditionalHeight:preloadType,elementHeight:PropTypes.oneOfType([PropTypes.number,PropTypes.arrayOf(PropTypes.number)]).isRequired,containerHeight:PropTypes.number,useWindowAsScrollContainer:PropTypes.bool,displayBottomUpwards:PropTypes.bool.isRequired,infiniteLoadBeginEdgeOffset:PropTypes.number,onInfiniteLoad:PropTypes.func,loadingSpinnerDelegate:PropTypes.node,isInfiniteLoading:PropTypes.bool,timeScrollStateLastsForAfterUserScrolls:PropTypes.number,className:PropTypes.string,styles:PropTypes.shape({scrollableStyle:PropTypes.object}).isRequired},statics:{containerHeightScaleFactor:function(e){if(!_isFinite(e))throw new Error("The scale factor must be a number.");return{type:scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR,amount:e}}},computedProps:{},utils:{},shouldAttachToBottom:!1,preservedScrollState:0,loadingSpinnerHeight:0,deprecationWarned:!1,scrollable:null,topSpacer:null,bottomSpacer:null,smoothScrollingWrapper:null,loadingSpinner:null,getDefaultProps:function(){return{handleScroll:function(){},useWindowAsScrollContainer:!1,onInfiniteLoad:function(){},loadingSpinnerDelegate:React.createElement("div",null),displayBottomUpwards:!1,isInfiniteLoading:!1,timeScrollStateLastsForAfterUserScrolls:150,className:"",styles:{}}},getInitialState:function(){var e=this.recomputeInternalStateFromProps(this.props);this.computedProps=e.computedProps,this.utils=e.utils,this.shouldAttachToBottom=this.props.displayBottomUpwards;var t=e.newState;return t.scrollTimeout=void 0,t.isScrolling=!1,t},generateComputedProps:function(e){var t=e.containerHeight,i=e.preloadBatchSize,o=e.preloadAdditionalHeight,n=_objectWithoutProperties(e,["containerHeight","preloadBatchSize","preloadAdditionalHeight"]),r={};t="number"==typeof t?t:0,r.containerHeight=e.useWindowAsScrollContainer?window.innerHeight:t,void 0!==n.infiniteLoadBeginBottomOffset&&(r.infiniteLoadBeginEdgeOffset=n.infiniteLoadBeginBottomOffset,this.deprecationWarned||(console.error("Warning: React Infinite's infiniteLoadBeginBottomOffset prop\n has been deprecated as of 0.6.0. Please use infiniteLoadBeginEdgeOffset.\n Because this is a rather descriptive name, a simple find and replace\n should suffice."),this.deprecationWarned=!0));var s={type:scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR,amount:.5},l=i&&i.type?i:s;"number"==typeof i?r.preloadBatchSize=i:"object"==typeof l&&l.type===scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR?r.preloadBatchSize=r.containerHeight*l.amount:r.preloadBatchSize=0;var a={type:scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR,amount:1},c=o&&o.type?o:a;return"number"==typeof o?r.preloadAdditionalHeight=o:"object"==typeof c&&c.type===scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR?r.preloadAdditionalHeight=r.containerHeight*c.amount:r.preloadAdditionalHeight=0,Object.assign(n,r)},generateComputedUtilityFunctions:function(e){var t=this,i={};return i.getLoadingSpinnerHeight=function(){var e=0;return t.loadingSpinner&&(e=t.loadingSpinner.offsetHeight||0),e},e.useWindowAsScrollContainer?(i.subscribeToScrollListener=function(){window.addEventListener("scroll",t.infiniteHandleScroll)},i.unsubscribeFromScrollListener=function(){window.removeEventListener("scroll",t.infiniteHandleScroll)},i.nodeScrollListener=function(){},i.getScrollTop=function(){return window.pageYOffset},i.setScrollTop=function(e){window.scroll(window.pageXOffset,e)},i.scrollShouldBeIgnored=function(){return!1},i.buildScrollableStyle=function(){return{}}):(i.subscribeToScrollListener=function(){},i.unsubscribeFromScrollListener=function(){},i.nodeScrollListener=this.infiniteHandleScroll,i.getScrollTop=function(){return t.scrollable?t.scrollable.scrollTop:0},i.setScrollTop=function(e){t.scrollable&&(t.scrollable.scrollTop=e)},i.scrollShouldBeIgnored=function(e){return e.target!==t.scrollable},i.buildScrollableStyle=function(){return Object.assign({},{height:t.computedProps.containerHeight,overflowX:"hidden",overflowY:"scroll",WebkitOverflowScrolling:"touch"},t.computedProps.styles.scrollableStyle||{})}),i},recomputeInternalStateFromProps:function(e){checkProps(e);var t=this.generateComputedProps(e),i=this.generateComputedUtilityFunctions(e),o={};return o.numberOfChildren=React.Children.count(t.children),o.infiniteComputer=infiniteHelpers.createInfiniteComputer(t.elementHeight,t.children,t.displayBottomUpwards),void 0!==t.isInfiniteLoading&&(o.isInfiniteLoading=t.isInfiniteLoading),o.preloadBatchSize=t.preloadBatchSize,o.preloadAdditionalHeight=t.preloadAdditionalHeight,o=Object.assign(o,infiniteHelpers.recomputeApertureStateFromOptionsAndScrollTop(o,i.getScrollTop())),{computedProps:t,utils:i,newState:o}},componentWillReceiveProps:function(e){var t=this.recomputeInternalStateFromProps(e);this.computedProps=t.computedProps,this.utils=t.utils,this.setState(t.newState)},componentWillUpdate:function(){this.props.displayBottomUpwards&&(this.preservedScrollState=this.utils.getScrollTop()-this.loadingSpinnerHeight)},componentDidUpdate:function(e,t){if(this.loadingSpinnerHeight=this.utils.getLoadingSpinnerHeight(),this.props.displayBottomUpwards){var i=this.getLowestPossibleScrollTop();this.shouldAttachToBottom&&this.utils.getScrollTop()this.state.infiniteComputer.getTotalScrollableHeight()-this.computedProps.containerHeight-this.computedProps.infiniteLoadBeginEdgeOffset},onInfiniteLoad:function(){this.setState({isInfiniteLoading:!0}),this.computedProps.onInfiniteLoad()},handleScroll:function(e){this.shouldAttachToBottom=this.computedProps.displayBottomUpwards&&e>=this.getLowestPossibleScrollTop(),this.manageScrollTimeouts();var t=infiniteHelpers.recomputeApertureStateFromOptionsAndScrollTop(this.state,e);this.passedEdgeForInfiniteScroll(e)&&!this.state.isInfiniteLoading?(this.setState(Object.assign({},t)),this.onInfiniteLoad()):this.setState(t)},buildHeightStyle:function(e){return{width:"100%",height:Math.ceil(e)}},render:function(){var e,t=this;e=this.state.numberOfChildren>1?this.computedProps.children.slice(this.state.displayIndexStart,this.state.displayIndexEnd+1):this.computedProps.children;var i={};this.state.isScrolling&&(i.pointerEvents="none");var o=this.state.infiniteComputer.getTopSpacerHeight(this.state.displayIndexStart),n=this.state.infiniteComputer.getBottomSpacerHeight(this.state.displayIndexEnd);if(this.computedProps.displayBottomUpwards){var r=this.computedProps.containerHeight-this.state.infiniteComputer.getTotalScrollableHeight();r>0&&(o=r-this.loadingSpinnerHeight)}var s=void 0===this.computedProps.infiniteLoadBeginEdgeOffset?null:React.createElement("div",{ref:function(e){t.loadingSpinner=e}},this.state.isInfiniteLoading?this.computedProps.loadingSpinnerDelegate:null);return React.createElement("div",{className:this.computedProps.className,ref:function(e){t.scrollable=e},style:this.utils.buildScrollableStyle(),onScroll:this.utils.nodeScrollListener},React.createElement("div",{ref:function(e){t.smoothScrollingWrapper=e},style:i},React.createElement("div",{ref:function(e){t.topSpacer=e},style:this.buildHeightStyle(o)}),this.computedProps.displayBottomUpwards&&s,e,!this.computedProps.displayBottomUpwards&&s,React.createElement("div",{ref:function(e){t.bottomSpacer=e},style:this.buildHeightStyle(n)})))}});module.exports=Infinite,global.Infinite=Infinite; }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{"./utils/checkProps":22,"./utils/establish-polyfills":23,"./utils/infiniteHelpers":24,"./utils/scaleEnum":25,"./utils/types":26,"create-react-class":3,"lodash.isfinite":10,"prop-types":16,"react":undefined}],2:[function(require,module,exports){ (function (process){ @@ -38,7 +38,7 @@ if (process.env.NODE_ENV !== 'production') { ReactPropTypeLocationNames = { prop: 'prop', context: 'context', - childContext: 'child context', + childContext: 'child context' }; } else { ReactPropTypeLocationNames = {}; @@ -49,7 +49,6 @@ function factory(ReactComponent, isValidElement, ReactNoopUpdateQueue) { * Policies that describe methods in `ReactClassInterface`. */ - var injectedMixins = []; /** @@ -75,7 +74,6 @@ function factory(ReactComponent, isValidElement, ReactNoopUpdateQueue) { * @internal */ var ReactClassInterface = { - /** * An array of Mixin objects to include when defining your component. * @@ -166,7 +164,6 @@ function factory(ReactComponent, isValidElement, ReactNoopUpdateQueue) { * } * * @return {ReactComponent} - * @nosideeffects * @required */ render: 'DEFINE_ONCE', @@ -294,7 +291,6 @@ function factory(ReactComponent, isValidElement, ReactNoopUpdateQueue) { * @overridable */ updateComponent: 'OVERRIDE_BASE' - }; /** @@ -307,71 +303,106 @@ function factory(ReactComponent, isValidElement, ReactNoopUpdateQueue) { * which all other static methods are defined. */ var RESERVED_SPEC_KEYS = { - displayName: function (Constructor, displayName) { + displayName: function(Constructor, displayName) { Constructor.displayName = displayName; }, - mixins: function (Constructor, mixins) { + mixins: function(Constructor, mixins) { if (mixins) { for (var i = 0; i < mixins.length; i++) { mixSpecIntoComponent(Constructor, mixins[i]); } } }, - childContextTypes: function (Constructor, childContextTypes) { + childContextTypes: function(Constructor, childContextTypes) { if (process.env.NODE_ENV !== 'production') { validateTypeDef(Constructor, childContextTypes, 'childContext'); } - Constructor.childContextTypes = _assign({}, Constructor.childContextTypes, childContextTypes); + Constructor.childContextTypes = _assign( + {}, + Constructor.childContextTypes, + childContextTypes + ); }, - contextTypes: function (Constructor, contextTypes) { + contextTypes: function(Constructor, contextTypes) { if (process.env.NODE_ENV !== 'production') { validateTypeDef(Constructor, contextTypes, 'context'); } - Constructor.contextTypes = _assign({}, Constructor.contextTypes, contextTypes); + Constructor.contextTypes = _assign( + {}, + Constructor.contextTypes, + contextTypes + ); }, /** * Special case getDefaultProps which should move into statics but requires * automatic merging. */ - getDefaultProps: function (Constructor, getDefaultProps) { + getDefaultProps: function(Constructor, getDefaultProps) { if (Constructor.getDefaultProps) { - Constructor.getDefaultProps = createMergedResultFunction(Constructor.getDefaultProps, getDefaultProps); + Constructor.getDefaultProps = createMergedResultFunction( + Constructor.getDefaultProps, + getDefaultProps + ); } else { Constructor.getDefaultProps = getDefaultProps; } }, - propTypes: function (Constructor, propTypes) { + propTypes: function(Constructor, propTypes) { if (process.env.NODE_ENV !== 'production') { validateTypeDef(Constructor, propTypes, 'prop'); } Constructor.propTypes = _assign({}, Constructor.propTypes, propTypes); }, - statics: function (Constructor, statics) { + statics: function(Constructor, statics) { mixStaticSpecIntoComponent(Constructor, statics); }, - autobind: function () {} }; + autobind: function() {} + }; function validateTypeDef(Constructor, typeDef, location) { for (var propName in typeDef) { if (typeDef.hasOwnProperty(propName)) { // use a warning instead of an _invariant so components // don't show up in prod but only in __DEV__ - process.env.NODE_ENV !== 'production' ? warning(typeof typeDef[propName] === 'function', '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'React.PropTypes.', Constructor.displayName || 'ReactClass', ReactPropTypeLocationNames[location], propName) : void 0; + if (process.env.NODE_ENV !== 'production') { + warning( + typeof typeDef[propName] === 'function', + '%s: %s type `%s` is invalid; it must be a function, usually from ' + + 'React.PropTypes.', + Constructor.displayName || 'ReactClass', + ReactPropTypeLocationNames[location], + propName + ); + } } } } function validateMethodOverride(isAlreadyDefined, name) { - var specPolicy = ReactClassInterface.hasOwnProperty(name) ? ReactClassInterface[name] : null; + var specPolicy = ReactClassInterface.hasOwnProperty(name) + ? ReactClassInterface[name] + : null; // Disallow overriding of base class methods unless explicitly allowed. if (ReactClassMixin.hasOwnProperty(name)) { - _invariant(specPolicy === 'OVERRIDE_BASE', 'ReactClassInterface: You are attempting to override ' + '`%s` from your class specification. Ensure that your method names ' + 'do not overlap with React methods.', name); + _invariant( + specPolicy === 'OVERRIDE_BASE', + 'ReactClassInterface: You are attempting to override ' + + '`%s` from your class specification. Ensure that your method names ' + + 'do not overlap with React methods.', + name + ); } // Disallow defining methods more than once unless explicitly allowed. if (isAlreadyDefined) { - _invariant(specPolicy === 'DEFINE_MANY' || specPolicy === 'DEFINE_MANY_MERGED', 'ReactClassInterface: You are attempting to define ' + '`%s` on your component more than once. This conflict may be due ' + 'to a mixin.', name); + _invariant( + specPolicy === 'DEFINE_MANY' || specPolicy === 'DEFINE_MANY_MERGED', + 'ReactClassInterface: You are attempting to define ' + + '`%s` on your component more than once. This conflict may be due ' + + 'to a mixin.', + name + ); } } @@ -385,14 +416,33 @@ function factory(ReactComponent, isValidElement, ReactNoopUpdateQueue) { var typeofSpec = typeof spec; var isMixinValid = typeofSpec === 'object' && spec !== null; - process.env.NODE_ENV !== 'production' ? warning(isMixinValid, '%s: You\'re attempting to include a mixin that is either null ' + 'or not an object. Check the mixins included by the component, ' + 'as well as any mixins they include themselves. ' + 'Expected object but got %s.', Constructor.displayName || 'ReactClass', spec === null ? null : typeofSpec) : void 0; + if (process.env.NODE_ENV !== 'production') { + warning( + isMixinValid, + "%s: You're attempting to include a mixin that is either null " + + 'or not an object. Check the mixins included by the component, ' + + 'as well as any mixins they include themselves. ' + + 'Expected object but got %s.', + Constructor.displayName || 'ReactClass', + spec === null ? null : typeofSpec + ); + } } return; } - _invariant(typeof spec !== 'function', 'ReactClass: You\'re attempting to ' + 'use a component class or function as a mixin. Instead, just use a ' + 'regular object.'); - _invariant(!isValidElement(spec), 'ReactClass: You\'re attempting to ' + 'use a component as a mixin. Instead, just use a regular object.'); + _invariant( + typeof spec !== 'function', + "ReactClass: You're attempting to " + + 'use a component class or function as a mixin. Instead, just use a ' + + 'regular object.' + ); + _invariant( + !isValidElement(spec), + "ReactClass: You're attempting to " + + 'use a component as a mixin. Instead, just use a regular object.' + ); var proto = Constructor.prototype; var autoBindPairs = proto.__reactAutoBindPairs; @@ -427,7 +477,11 @@ function factory(ReactComponent, isValidElement, ReactNoopUpdateQueue) { // 2. Overridden methods (that were mixed in). var isReactClassMethod = ReactClassInterface.hasOwnProperty(name); var isFunction = typeof property === 'function'; - var shouldAutoBind = isFunction && !isReactClassMethod && !isAlreadyDefined && spec.autobind !== false; + var shouldAutoBind = + isFunction && + !isReactClassMethod && + !isAlreadyDefined && + spec.autobind !== false; if (shouldAutoBind) { autoBindPairs.push(name, property); @@ -437,7 +491,15 @@ function factory(ReactComponent, isValidElement, ReactNoopUpdateQueue) { var specPolicy = ReactClassInterface[name]; // These cases should already be caught by validateMethodOverride. - _invariant(isReactClassMethod && (specPolicy === 'DEFINE_MANY_MERGED' || specPolicy === 'DEFINE_MANY'), 'ReactClass: Unexpected spec policy %s for key %s ' + 'when mixing in component specs.', specPolicy, name); + _invariant( + isReactClassMethod && + (specPolicy === 'DEFINE_MANY_MERGED' || + specPolicy === 'DEFINE_MANY'), + 'ReactClass: Unexpected spec policy %s for key %s ' + + 'when mixing in component specs.', + specPolicy, + name + ); // For methods which are defined more than once, call the existing // methods before calling the new property, merging if appropriate. @@ -472,10 +534,23 @@ function factory(ReactComponent, isValidElement, ReactNoopUpdateQueue) { } var isReserved = name in RESERVED_SPEC_KEYS; - _invariant(!isReserved, 'ReactClass: You are attempting to define a reserved ' + 'property, `%s`, that shouldn\'t be on the "statics" key. Define it ' + 'as an instance property instead; it will still be accessible on the ' + 'constructor.', name); + _invariant( + !isReserved, + 'ReactClass: You are attempting to define a reserved ' + + 'property, `%s`, that shouldn\'t be on the "statics" key. Define it ' + + 'as an instance property instead; it will still be accessible on the ' + + 'constructor.', + name + ); var isInherited = name in Constructor; - _invariant(!isInherited, 'ReactClass: You are attempting to define ' + '`%s` on your component more than once. This conflict may be ' + 'due to a mixin.', name); + _invariant( + !isInherited, + 'ReactClass: You are attempting to define ' + + '`%s` on your component more than once. This conflict may be ' + + 'due to a mixin.', + name + ); Constructor[name] = property; } } @@ -488,11 +563,22 @@ function factory(ReactComponent, isValidElement, ReactNoopUpdateQueue) { * @return {object} one after it has been mutated to contain everything in two. */ function mergeIntoWithNoDuplicateKeys(one, two) { - _invariant(one && two && typeof one === 'object' && typeof two === 'object', 'mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.'); + _invariant( + one && two && typeof one === 'object' && typeof two === 'object', + 'mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.' + ); for (var key in two) { if (two.hasOwnProperty(key)) { - _invariant(one[key] === undefined, 'mergeIntoWithNoDuplicateKeys(): ' + 'Tried to merge two objects with the same key: `%s`. This conflict ' + 'may be due to a mixin; in particular, this may be caused by two ' + 'getInitialState() or getDefaultProps() methods returning objects ' + 'with clashing keys.', key); + _invariant( + one[key] === undefined, + 'mergeIntoWithNoDuplicateKeys(): ' + + 'Tried to merge two objects with the same key: `%s`. This conflict ' + + 'may be due to a mixin; in particular, this may be caused by two ' + + 'getInitialState() or getDefaultProps() methods returning objects ' + + 'with clashing keys.', + key + ); one[key] = two[key]; } } @@ -553,8 +639,14 @@ function factory(ReactComponent, isValidElement, ReactNoopUpdateQueue) { boundMethod.__reactBoundArguments = null; var componentName = component.constructor.displayName; var _bind = boundMethod.bind; - boundMethod.bind = function (newThis) { - for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + boundMethod.bind = function(newThis) { + for ( + var _len = arguments.length, + args = Array(_len > 1 ? _len - 1 : 0), + _key = 1; + _key < _len; + _key++ + ) { args[_key - 1] = arguments[_key]; } @@ -562,9 +654,24 @@ function factory(ReactComponent, isValidElement, ReactNoopUpdateQueue) { // ignore the value of "this" that the user is trying to use, so // let's warn. if (newThis !== component && newThis !== null) { - process.env.NODE_ENV !== 'production' ? warning(false, 'bind(): React component methods may only be bound to the ' + 'component instance. See %s', componentName) : void 0; + if (process.env.NODE_ENV !== 'production') { + warning( + false, + 'bind(): React component methods may only be bound to the ' + + 'component instance. See %s', + componentName + ); + } } else if (!args.length) { - process.env.NODE_ENV !== 'production' ? warning(false, 'bind(): You are binding a component method to the component. ' + 'React does this for you automatically in a high-performance ' + 'way, so you can safely remove this call. See %s', componentName) : void 0; + if (process.env.NODE_ENV !== 'production') { + warning( + false, + 'bind(): You are binding a component method to the component. ' + + 'React does this for you automatically in a high-performance ' + + 'way, so you can safely remove this call. See %s', + componentName + ); + } return boundMethod; } var reboundMethod = _bind.apply(boundMethod, arguments); @@ -591,11 +698,14 @@ function factory(ReactComponent, isValidElement, ReactNoopUpdateQueue) { } } - var IsMountedMixin = { - componentDidMount: function () { + var IsMountedPreMixin = { + componentDidMount: function() { this.__isMounted = true; - }, - componentWillUnmount: function () { + } + }; + + var IsMountedPostMixin = { + componentWillUnmount: function() { this.__isMounted = false; } }; @@ -605,12 +715,11 @@ function factory(ReactComponent, isValidElement, ReactNoopUpdateQueue) { * therefore not already part of the modern ReactComponent. */ var ReactClassMixin = { - /** * TODO: This will be deprecated because state should always keep a consistent * type signature and the only use case for this, is to avoid that. */ - replaceState: function (newState, callback) { + replaceState: function(newState, callback) { this.updater.enqueueReplaceState(this, newState, callback); }, @@ -620,17 +729,29 @@ function factory(ReactComponent, isValidElement, ReactNoopUpdateQueue) { * @protected * @final */ - isMounted: function () { + isMounted: function() { if (process.env.NODE_ENV !== 'production') { - process.env.NODE_ENV !== 'production' ? warning(this.__didWarnIsMounted, '%s: isMounted is deprecated. Instead, make sure to clean up ' + 'subscriptions and pending requests in componentWillUnmount to ' + 'prevent memory leaks.', this.constructor && this.constructor.displayName || this.name || 'Component') : void 0; + warning( + this.__didWarnIsMounted, + '%s: isMounted is deprecated. Instead, make sure to clean up ' + + 'subscriptions and pending requests in componentWillUnmount to ' + + 'prevent memory leaks.', + (this.constructor && this.constructor.displayName) || + this.name || + 'Component' + ); this.__didWarnIsMounted = true; } return !!this.__isMounted; } }; - var ReactClassComponent = function () {}; - _assign(ReactClassComponent.prototype, ReactComponent.prototype, ReactClassMixin); + var ReactClassComponent = function() {}; + _assign( + ReactClassComponent.prototype, + ReactComponent.prototype, + ReactClassMixin + ); /** * Creates a composite component class given a class specification. @@ -644,12 +765,16 @@ function factory(ReactComponent, isValidElement, ReactNoopUpdateQueue) { // To keep our warnings more understandable, we'll use a little hack here to // ensure that Constructor.name !== 'Constructor'. This makes sure we don't // unnecessarily identify a class without displayName as 'Constructor'. - var Constructor = identity(function (props, context, updater) { + var Constructor = identity(function(props, context, updater) { // This constructor gets overridden by mocks. The argument is used // by mocks to assert on what gets mounted. if (process.env.NODE_ENV !== 'production') { - process.env.NODE_ENV !== 'production' ? warning(this instanceof Constructor, 'Something is calling a React component directly. Use a factory or ' + 'JSX instead. See: https://fb.me/react-legacyfactory') : void 0; + warning( + this instanceof Constructor, + 'Something is calling a React component directly. Use a factory or ' + + 'JSX instead. See: https://fb.me/react-legacyfactory' + ); } // Wire up auto-binding @@ -670,13 +795,20 @@ function factory(ReactComponent, isValidElement, ReactNoopUpdateQueue) { var initialState = this.getInitialState ? this.getInitialState() : null; if (process.env.NODE_ENV !== 'production') { // We allow auto-mocks to proceed as if they're returning null. - if (initialState === undefined && this.getInitialState._isMockFunction) { + if ( + initialState === undefined && + this.getInitialState._isMockFunction + ) { // This is probably bad practice. Consider warning here and // deprecating this convenience. initialState = null; } } - _invariant(typeof initialState === 'object' && !Array.isArray(initialState), '%s.getInitialState(): must return an object or null', Constructor.displayName || 'ReactCompositeComponent'); + _invariant( + typeof initialState === 'object' && !Array.isArray(initialState), + '%s.getInitialState(): must return an object or null', + Constructor.displayName || 'ReactCompositeComponent' + ); this.state = initialState; }); @@ -686,8 +818,9 @@ function factory(ReactComponent, isValidElement, ReactNoopUpdateQueue) { injectedMixins.forEach(mixSpecIntoComponent.bind(null, Constructor)); - mixSpecIntoComponent(Constructor, IsMountedMixin); + mixSpecIntoComponent(Constructor, IsMountedPreMixin); mixSpecIntoComponent(Constructor, spec); + mixSpecIntoComponent(Constructor, IsMountedPostMixin); // Initialize the defaultProps property after all mixins have been merged. if (Constructor.getDefaultProps) { @@ -707,11 +840,26 @@ function factory(ReactComponent, isValidElement, ReactNoopUpdateQueue) { } } - _invariant(Constructor.prototype.render, 'createClass(...): Class specification must implement a `render` method.'); + _invariant( + Constructor.prototype.render, + 'createClass(...): Class specification must implement a `render` method.' + ); if (process.env.NODE_ENV !== 'production') { - process.env.NODE_ENV !== 'production' ? warning(!Constructor.prototype.componentShouldUpdate, '%s has a method called ' + 'componentShouldUpdate(). Did you mean shouldComponentUpdate()? ' + 'The name is phrased as a question because the function is ' + 'expected to return a value.', spec.displayName || 'A component') : void 0; - process.env.NODE_ENV !== 'production' ? warning(!Constructor.prototype.componentWillRecieveProps, '%s has a method called ' + 'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?', spec.displayName || 'A component') : void 0; + warning( + !Constructor.prototype.componentShouldUpdate, + '%s has a method called ' + + 'componentShouldUpdate(). Did you mean shouldComponentUpdate()? ' + + 'The name is phrased as a question because the function is ' + + 'expected to return a value.', + spec.displayName || 'A component' + ); + warning( + !Constructor.prototype.componentWillRecieveProps, + '%s has a method called ' + + 'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?', + spec.displayName || 'A component' + ); } // Reduce time spent doing lookups by setting these on the prototype. @@ -746,6 +894,13 @@ module.exports = factory; var React = require('react'); var factory = require('./factory'); +if (typeof React === 'undefined') { + throw Error( + 'create-react-class could not find the React object. If you are using script tags, ' + + 'make sure that React is being loaded before create-react-class.' + ); +} + // Hack to grab NoopUpdateQueue from isomorphic React var ReactNoopUpdateQueue = new React.Component().updater; @@ -992,45 +1147,43 @@ var emptyFunction = require('./emptyFunction'); var warning = emptyFunction; if (process.env.NODE_ENV !== 'production') { - (function () { - var printWarning = function printWarning(format) { - for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - args[_key - 1] = arguments[_key]; - } - - var argIndex = 0; - var message = 'Warning: ' + format.replace(/%s/g, function () { - return args[argIndex++]; - }); - if (typeof console !== 'undefined') { - console.error(message); - } - try { - // --- Welcome to debugging React --- - // This error was thrown as a convenience so that you can use this stack - // to find the callsite that caused this warning to fire. - throw new Error(message); - } catch (x) {} - }; + var printWarning = function printWarning(format) { + for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } - warning = function warning(condition, format) { - if (format === undefined) { - throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument'); - } + var argIndex = 0; + var message = 'Warning: ' + format.replace(/%s/g, function () { + return args[argIndex++]; + }); + if (typeof console !== 'undefined') { + console.error(message); + } + try { + // --- Welcome to debugging React --- + // This error was thrown as a convenience so that you can use this stack + // to find the callsite that caused this warning to fire. + throw new Error(message); + } catch (x) {} + }; - if (format.indexOf('Failed Composite propType: ') === 0) { - return; // Ignore CompositeComponent proptype check. - } + warning = function warning(condition, format) { + if (format === undefined) { + throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument'); + } - if (!condition) { - for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) { - args[_key2 - 2] = arguments[_key2]; - } + if (format.indexOf('Failed Composite propType: ') === 0) { + return; // Ignore CompositeComponent proptype check. + } - printWarning.apply(undefined, [format].concat(args)); + if (!condition) { + for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) { + args[_key2 - 2] = arguments[_key2]; } - }; - })(); + + printWarning.apply(undefined, [format].concat(args)); + } + }; } module.exports = warning; diff --git a/dist/react-infinite.min.js b/dist/react-infinite.min.js index aa1fc01..f0ee1d2 100644 --- a/dist/react-infinite.min.js +++ b/dist/react-infinite.min.js @@ -1,2 +1,2 @@ -!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.Infinite=e()}}(function(){return function e(t,n,o){function r(a,s){if(!n[a]){if(!t[a]){var l="function"==typeof require&&require;if(!s&&l)return l(a,!0);if(i)return i(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var u=n[a]={exports:{}};t[a][0].call(u.exports,function(e){var n=t[a][1][e];return r(n?n:e)},u,u.exports,e,t,n,o)}return n[a].exports}for(var i="function"==typeof require&&require,a=0;a=0||Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]);return n}var r=n.React||e("react"),i=n.PropTypes||e("prop-types"),a=n.createReactClass||e("create-react-class");e("./utils/establish-polyfills");var s=e("./utils/scaleEnum"),l=e("./utils/infiniteHelpers"),c=e("lodash.isfinite"),u=e("./utils/types").preloadType,p=p=e("./utils/checkProps"),f=a({propTypes:{children:i.any,handleScroll:i.func,preloadBatchSize:u,preloadAdditionalHeight:u,elementHeight:i.oneOfType([i.number,i.arrayOf(i.number)]).isRequired,containerHeight:i.number,useWindowAsScrollContainer:i.bool,displayBottomUpwards:i.bool.isRequired,infiniteLoadBeginEdgeOffset:i.number,onInfiniteLoad:i.func,loadingSpinnerDelegate:i.node,isInfiniteLoading:i.bool,timeScrollStateLastsForAfterUserScrolls:i.number,className:i.string,styles:i.shape({scrollableStyle:i.object}).isRequired},statics:{containerHeightScaleFactor:function(e){if(!c(e))throw new Error("The scale factor must be a number.");return{type:s.CONTAINER_HEIGHT_SCALE_FACTOR,amount:e}}},computedProps:{},utils:{},shouldAttachToBottom:!1,preservedScrollState:0,loadingSpinnerHeight:0,deprecationWarned:!1,scrollable:null,topSpacer:null,bottomSpacer:null,smoothScrollingWrapper:null,loadingSpinner:null,getDefaultProps:function(){return{handleScroll:function(){},useWindowAsScrollContainer:!1,onInfiniteLoad:function(){},loadingSpinnerDelegate:r.createElement("div",null),displayBottomUpwards:!1,isInfiniteLoading:!1,timeScrollStateLastsForAfterUserScrolls:150,className:"",styles:{}}},getInitialState:function(){var e=this.recomputeInternalStateFromProps(this.props);this.computedProps=e.computedProps,this.utils=e.utils,this.shouldAttachToBottom=this.props.displayBottomUpwards;var t=e.newState;return t.scrollTimeout=void 0,t.isScrolling=!1,t},generateComputedProps:function(e){var t=e.containerHeight,n=e.preloadBatchSize,r=e.preloadAdditionalHeight,i=o(e,["containerHeight","preloadBatchSize","preloadAdditionalHeight"]),a={};t="number"==typeof t?t:0,a.containerHeight=e.useWindowAsScrollContainer?window.innerHeight:t,void 0!==i.infiniteLoadBeginBottomOffset&&(a.infiniteLoadBeginEdgeOffset=i.infiniteLoadBeginBottomOffset,this.deprecationWarned||(console.error("Warning: React Infinite's infiniteLoadBeginBottomOffset prop\n has been deprecated as of 0.6.0. Please use infiniteLoadBeginEdgeOffset.\n Because this is a rather descriptive name, a simple find and replace\n should suffice."),this.deprecationWarned=!0));var l={type:s.CONTAINER_HEIGHT_SCALE_FACTOR,amount:.5},c=n&&n.type?n:l;"number"==typeof n?a.preloadBatchSize=n:"object"==typeof c&&c.type===s.CONTAINER_HEIGHT_SCALE_FACTOR?a.preloadBatchSize=a.containerHeight*c.amount:a.preloadBatchSize=0;var u={type:s.CONTAINER_HEIGHT_SCALE_FACTOR,amount:1},p=r&&r.type?r:u;return"number"==typeof r?a.preloadAdditionalHeight=r:"object"==typeof p&&p.type===s.CONTAINER_HEIGHT_SCALE_FACTOR?a.preloadAdditionalHeight=a.containerHeight*p.amount:a.preloadAdditionalHeight=0,Object.assign(i,a)},generateComputedUtilityFunctions:function(e){var t=this,n={};return n.getLoadingSpinnerHeight=function(){var e=0;return t.loadingSpinner&&(e=t.loadingSpinner.offsetHeight||0),e},e.useWindowAsScrollContainer?(n.subscribeToScrollListener=function(){window.addEventListener("scroll",t.infiniteHandleScroll)},n.unsubscribeFromScrollListener=function(){window.removeEventListener("scroll",t.infiniteHandleScroll)},n.nodeScrollListener=function(){},n.getScrollTop=function(){return window.pageYOffset},n.setScrollTop=function(e){window.scroll(window.pageXOffset,e)},n.scrollShouldBeIgnored=function(){return!1},n.buildScrollableStyle=function(){return{}}):(n.subscribeToScrollListener=function(){},n.unsubscribeFromScrollListener=function(){},n.nodeScrollListener=this.infiniteHandleScroll,n.getScrollTop=function(){return t.scrollable?t.scrollable.scrollTop:0},n.setScrollTop=function(e){t.scrollable&&(t.scrollable.scrollTop=e)},n.scrollShouldBeIgnored=function(e){return e.target!==t.scrollable},n.buildScrollableStyle=function(){return Object.assign({},{height:t.computedProps.containerHeight,overflowX:"hidden",overflowY:"scroll",WebkitOverflowScrolling:"touch"},t.computedProps.styles.scrollableStyle||{})}),n},recomputeInternalStateFromProps:function(e){p(e);var t=this.generateComputedProps(e),n=this.generateComputedUtilityFunctions(e),o={};return o.numberOfChildren=r.Children.count(t.children),o.infiniteComputer=l.createInfiniteComputer(t.elementHeight,t.children,t.displayBottomUpwards),void 0!==t.isInfiniteLoading&&(o.isInfiniteLoading=t.isInfiniteLoading),o.preloadBatchSize=t.preloadBatchSize,o.preloadAdditionalHeight=t.preloadAdditionalHeight,o=Object.assign(o,l.recomputeApertureStateFromOptionsAndScrollTop(o,n.getScrollTop())),{computedProps:t,utils:n,newState:o}},componentWillReceiveProps:function(e){var t=this.recomputeInternalStateFromProps(e);this.computedProps=t.computedProps,this.utils=t.utils,this.setState(t.newState)},componentWillUpdate:function(){this.props.displayBottomUpwards&&(this.preservedScrollState=this.utils.getScrollTop()-this.loadingSpinnerHeight)},componentDidUpdate:function(e,t){if(this.loadingSpinnerHeight=this.utils.getLoadingSpinnerHeight(),this.props.displayBottomUpwards){var n=this.getLowestPossibleScrollTop();this.shouldAttachToBottom&&this.utils.getScrollTop()this.state.infiniteComputer.getTotalScrollableHeight()-this.computedProps.containerHeight-this.computedProps.infiniteLoadBeginEdgeOffset},onInfiniteLoad:function(){this.setState({isInfiniteLoading:!0}),this.computedProps.onInfiniteLoad()},handleScroll:function(e){this.shouldAttachToBottom=this.computedProps.displayBottomUpwards&&e>=this.getLowestPossibleScrollTop(),this.manageScrollTimeouts();var t=l.recomputeApertureStateFromOptionsAndScrollTop(this.state,e);this.passedEdgeForInfiniteScroll(e)&&!this.state.isInfiniteLoading?(this.setState(Object.assign({},t)),this.onInfiniteLoad()):this.setState(t)},buildHeightStyle:function(e){return{width:"100%",height:Math.ceil(e)}},render:function(){var e,t=this;e=this.state.numberOfChildren>1?this.computedProps.children.slice(this.state.displayIndexStart,this.state.displayIndexEnd+1):this.computedProps.children;var n={};this.state.isScrolling&&(n.pointerEvents="none");var o=this.state.infiniteComputer.getTopSpacerHeight(this.state.displayIndexStart),i=this.state.infiniteComputer.getBottomSpacerHeight(this.state.displayIndexEnd);if(this.computedProps.displayBottomUpwards){var a=this.computedProps.containerHeight-this.state.infiniteComputer.getTotalScrollableHeight();a>0&&(o=a-this.loadingSpinnerHeight)}var s=void 0===this.computedProps.infiniteLoadBeginEdgeOffset?null:r.createElement("div",{ref:function(e){t.loadingSpinner=e}},this.state.isInfiniteLoading?this.computedProps.loadingSpinnerDelegate:null);return r.createElement("div",{className:this.computedProps.className,ref:function(e){t.scrollable=e},style:this.utils.buildScrollableStyle(),onScroll:this.utils.nodeScrollListener},r.createElement("div",{ref:function(e){t.smoothScrollingWrapper=e},style:n},r.createElement("div",{ref:function(e){t.topSpacer=e},style:this.buildHeightStyle(o)}),this.computedProps.displayBottomUpwards&&s,e,!this.computedProps.displayBottomUpwards&&s,r.createElement("div",{ref:function(e){t.bottomSpacer=e},style:this.buildHeightStyle(i)})))}});t.exports=f,n.Infinite=f}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./utils/checkProps":22,"./utils/establish-polyfills":23,"./utils/infiniteHelpers":24,"./utils/scaleEnum":25,"./utils/types":26,"create-react-class":3,"lodash.isfinite":10,"prop-types":16,react:void 0}],2:[function(e,t,n){(function(n){"use strict";function o(e){return e}function r(e,t,r){function p(e,t,o){for(var r in t)t.hasOwnProperty(r)&&("production"!==n.env.NODE_ENV?l("function"==typeof t[r],"%s: %s type `%s` is invalid; it must be a function, usually from React.PropTypes.",e.displayName||"ReactClass",c[o],r):void 0)}function f(e,t){var n=O.hasOwnProperty(t)?O[t]:null;_.hasOwnProperty(t)&&s("OVERRIDE_BASE"===n,"ReactClassInterface: You are attempting to override `%s` from your class specification. Ensure that your method names do not overlap with React methods.",t),e&&s("DEFINE_MANY"===n||"DEFINE_MANY_MERGED"===n,"ReactClassInterface: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",t)}function d(e,o){if(o){s("function"!=typeof o,"ReactClass: You're attempting to use a component class or function as a mixin. Instead, just use a regular object."),s(!t(o),"ReactClass: You're attempting to use a component as a mixin. Instead, just use a regular object.");var r=e.prototype,i=r.__reactAutoBindPairs;o.hasOwnProperty(u)&&w.mixins(e,o.mixins);for(var a in o)if(o.hasOwnProperty(a)&&a!==u){var c=o[a],p=r.hasOwnProperty(a);if(f(p,a),w.hasOwnProperty(a))w[a](e,c);else{var d=O.hasOwnProperty(a),h="function"==typeof c,y=h&&!d&&!p&&o.autobind!==!1;if(y)i.push(a,c),r[a]=c;else if(p){var v=O[a];s(d&&("DEFINE_MANY_MERGED"===v||"DEFINE_MANY"===v),"ReactClass: Unexpected spec policy %s for key %s when mixing in component specs.",v,a),"DEFINE_MANY_MERGED"===v?r[a]=m(r[a],c):"DEFINE_MANY"===v&&(r[a]=g(r[a],c))}else r[a]=c,"production"!==n.env.NODE_ENV&&"function"==typeof c&&o.displayName&&(r[a].displayName=o.displayName+"_"+a)}}}else if("production"!==n.env.NODE_ENV){var b=typeof o,S="object"===b&&null!==o;"production"!==n.env.NODE_ENV?l(S,"%s: You're attempting to include a mixin that is either null or not an object. Check the mixins included by the component, as well as any mixins they include themselves. Expected object but got %s.",e.displayName||"ReactClass",null===o?null:b):void 0}}function h(e,t){if(t)for(var n in t){var o=t[n];if(t.hasOwnProperty(n)){var r=n in w;s(!r,'ReactClass: You are attempting to define a reserved property, `%s`, that shouldn\'t be on the "statics" key. Define it as an instance property instead; it will still be accessible on the constructor.',n);var i=n in e;s(!i,"ReactClass: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",n),e[n]=o}}}function y(e,t){s(e&&t&&"object"==typeof e&&"object"==typeof t,"mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.");for(var n in t)t.hasOwnProperty(n)&&(s(void 0===e[n],"mergeIntoWithNoDuplicateKeys(): Tried to merge two objects with the same key: `%s`. This conflict may be due to a mixin; in particular, this may be caused by two getInitialState() or getDefaultProps() methods returning objects with clashing keys.",n),e[n]=t[n]);return e}function m(e,t){return function(){var n=e.apply(this,arguments),o=t.apply(this,arguments);if(null==n)return o;if(null==o)return n;var r={};return y(r,n),y(r,o),r}}function g(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function v(e,t){var o=t.bind(e);if("production"!==n.env.NODE_ENV){o.__reactBoundContext=e,o.__reactBoundMethod=t,o.__reactBoundArguments=null;var r=e.constructor.displayName,i=o.bind;o.bind=function(a){for(var s=arguments.length,c=Array(s>1?s-1:0),u=1;u1?t-1:0),o=1;o2?o-2:0),i=2;i-1&&e%1==0&&e<=v}function a(e){return s(e)&&y.call(e)==u}function s(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function l(e){return null!=e&&(a(e)?m.test(d.call(e)):o(e)&&p.test(e))}var c="[object Array]",u="[object Function]",p=/^\[object .+?Constructor\]$/,f=Object.prototype,d=Function.prototype.toString,h=f.hasOwnProperty,y=f.toString,m=RegExp("^"+d.call(h).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),g=r(Array,"isArray"),v=9007199254740991,b=g||function(e){return o(e)&&i(e.length)&&y.call(e)==c};t.exports=b},{}],10:[function(e,t,n){(function(e){function n(e){return"number"==typeof e&&o(e)}var o=e.isFinite;t.exports=n}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],11:[function(e,t,n){"use strict";function o(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}var r=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;t.exports=Object.assign||function(e,t){for(var n,a,s=o(e),l=1;l0?t-1:t}},{key:"getTopSpacerHeight",value:function(e){return e*this.heightData}},{key:"getBottomSpacerHeight",value:function(e){var t=e+1;return Math.max(0,(this.numberOfChildren-t)*this.heightData)}}]),t}(s);t.exports=l},{"./infiniteComputer.js":20}],20:[function(e,t,n){"use strict";function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var r=function(){function e(e,t){for(var n=0;nt&&(s=i-1)}return n===o.CLOSEST_LOWER&&l>0?r=l-1:n===o.CLOSEST_HIGHER&&s=0||Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]);return n}var r=n.React||e("react"),i=n.PropTypes||e("prop-types"),a=n.createReactClass||e("create-react-class");"undefined"==typeof window&&(n.window={}),e("./utils/establish-polyfills");var s=e("./utils/scaleEnum"),l=e("./utils/infiniteHelpers"),c=e("lodash.isfinite"),u=e("./utils/types").preloadType,p=p=e("./utils/checkProps"),f=a({propTypes:{children:i.any,handleScroll:i.func,preloadBatchSize:u,preloadAdditionalHeight:u,elementHeight:i.oneOfType([i.number,i.arrayOf(i.number)]).isRequired,containerHeight:i.number,useWindowAsScrollContainer:i.bool,displayBottomUpwards:i.bool.isRequired,infiniteLoadBeginEdgeOffset:i.number,onInfiniteLoad:i.func,loadingSpinnerDelegate:i.node,isInfiniteLoading:i.bool,timeScrollStateLastsForAfterUserScrolls:i.number,className:i.string,styles:i.shape({scrollableStyle:i.object}).isRequired},statics:{containerHeightScaleFactor:function(e){if(!c(e))throw new Error("The scale factor must be a number.");return{type:s.CONTAINER_HEIGHT_SCALE_FACTOR,amount:e}}},computedProps:{},utils:{},shouldAttachToBottom:!1,preservedScrollState:0,loadingSpinnerHeight:0,deprecationWarned:!1,scrollable:null,topSpacer:null,bottomSpacer:null,smoothScrollingWrapper:null,loadingSpinner:null,getDefaultProps:function(){return{handleScroll:function(){},useWindowAsScrollContainer:!1,onInfiniteLoad:function(){},loadingSpinnerDelegate:r.createElement("div",null),displayBottomUpwards:!1,isInfiniteLoading:!1,timeScrollStateLastsForAfterUserScrolls:150,className:"",styles:{}}},getInitialState:function(){var e=this.recomputeInternalStateFromProps(this.props);this.computedProps=e.computedProps,this.utils=e.utils,this.shouldAttachToBottom=this.props.displayBottomUpwards;var t=e.newState;return t.scrollTimeout=void 0,t.isScrolling=!1,t},generateComputedProps:function(e){var t=e.containerHeight,n=e.preloadBatchSize,r=e.preloadAdditionalHeight,i=o(e,["containerHeight","preloadBatchSize","preloadAdditionalHeight"]),a={};t="number"==typeof t?t:0,a.containerHeight=e.useWindowAsScrollContainer?window.innerHeight:t,void 0!==i.infiniteLoadBeginBottomOffset&&(a.infiniteLoadBeginEdgeOffset=i.infiniteLoadBeginBottomOffset,this.deprecationWarned||(console.error("Warning: React Infinite's infiniteLoadBeginBottomOffset prop\n has been deprecated as of 0.6.0. Please use infiniteLoadBeginEdgeOffset.\n Because this is a rather descriptive name, a simple find and replace\n should suffice."),this.deprecationWarned=!0));var l={type:s.CONTAINER_HEIGHT_SCALE_FACTOR,amount:.5},c=n&&n.type?n:l;"number"==typeof n?a.preloadBatchSize=n:"object"==typeof c&&c.type===s.CONTAINER_HEIGHT_SCALE_FACTOR?a.preloadBatchSize=a.containerHeight*c.amount:a.preloadBatchSize=0;var u={type:s.CONTAINER_HEIGHT_SCALE_FACTOR,amount:1},p=r&&r.type?r:u;return"number"==typeof r?a.preloadAdditionalHeight=r:"object"==typeof p&&p.type===s.CONTAINER_HEIGHT_SCALE_FACTOR?a.preloadAdditionalHeight=a.containerHeight*p.amount:a.preloadAdditionalHeight=0,Object.assign(i,a)},generateComputedUtilityFunctions:function(e){var t=this,n={};return n.getLoadingSpinnerHeight=function(){var e=0;return t.loadingSpinner&&(e=t.loadingSpinner.offsetHeight||0),e},e.useWindowAsScrollContainer?(n.subscribeToScrollListener=function(){window.addEventListener("scroll",t.infiniteHandleScroll)},n.unsubscribeFromScrollListener=function(){window.removeEventListener("scroll",t.infiniteHandleScroll)},n.nodeScrollListener=function(){},n.getScrollTop=function(){return window.pageYOffset},n.setScrollTop=function(e){window.scroll(window.pageXOffset,e)},n.scrollShouldBeIgnored=function(){return!1},n.buildScrollableStyle=function(){return{}}):(n.subscribeToScrollListener=function(){},n.unsubscribeFromScrollListener=function(){},n.nodeScrollListener=this.infiniteHandleScroll,n.getScrollTop=function(){return t.scrollable?t.scrollable.scrollTop:0},n.setScrollTop=function(e){t.scrollable&&(t.scrollable.scrollTop=e)},n.scrollShouldBeIgnored=function(e){return e.target!==t.scrollable},n.buildScrollableStyle=function(){return Object.assign({},{height:t.computedProps.containerHeight,overflowX:"hidden",overflowY:"scroll",WebkitOverflowScrolling:"touch"},t.computedProps.styles.scrollableStyle||{})}),n},recomputeInternalStateFromProps:function(e){p(e);var t=this.generateComputedProps(e),n=this.generateComputedUtilityFunctions(e),o={};return o.numberOfChildren=r.Children.count(t.children),o.infiniteComputer=l.createInfiniteComputer(t.elementHeight,t.children,t.displayBottomUpwards),void 0!==t.isInfiniteLoading&&(o.isInfiniteLoading=t.isInfiniteLoading),o.preloadBatchSize=t.preloadBatchSize,o.preloadAdditionalHeight=t.preloadAdditionalHeight,o=Object.assign(o,l.recomputeApertureStateFromOptionsAndScrollTop(o,n.getScrollTop())),{computedProps:t,utils:n,newState:o}},componentWillReceiveProps:function(e){var t=this.recomputeInternalStateFromProps(e);this.computedProps=t.computedProps,this.utils=t.utils,this.setState(t.newState)},componentWillUpdate:function(){this.props.displayBottomUpwards&&(this.preservedScrollState=this.utils.getScrollTop()-this.loadingSpinnerHeight)},componentDidUpdate:function(e,t){if(this.loadingSpinnerHeight=this.utils.getLoadingSpinnerHeight(),this.props.displayBottomUpwards){var n=this.getLowestPossibleScrollTop();this.shouldAttachToBottom&&this.utils.getScrollTop()this.state.infiniteComputer.getTotalScrollableHeight()-this.computedProps.containerHeight-this.computedProps.infiniteLoadBeginEdgeOffset},onInfiniteLoad:function(){this.setState({isInfiniteLoading:!0}),this.computedProps.onInfiniteLoad()},handleScroll:function(e){this.shouldAttachToBottom=this.computedProps.displayBottomUpwards&&e>=this.getLowestPossibleScrollTop(),this.manageScrollTimeouts();var t=l.recomputeApertureStateFromOptionsAndScrollTop(this.state,e);this.passedEdgeForInfiniteScroll(e)&&!this.state.isInfiniteLoading?(this.setState(Object.assign({},t)),this.onInfiniteLoad()):this.setState(t)},buildHeightStyle:function(e){return{width:"100%",height:Math.ceil(e)}},render:function(){var e,t=this;e=this.state.numberOfChildren>1?this.computedProps.children.slice(this.state.displayIndexStart,this.state.displayIndexEnd+1):this.computedProps.children;var n={};this.state.isScrolling&&(n.pointerEvents="none");var o=this.state.infiniteComputer.getTopSpacerHeight(this.state.displayIndexStart),i=this.state.infiniteComputer.getBottomSpacerHeight(this.state.displayIndexEnd);if(this.computedProps.displayBottomUpwards){var a=this.computedProps.containerHeight-this.state.infiniteComputer.getTotalScrollableHeight();a>0&&(o=a-this.loadingSpinnerHeight)}var s=void 0===this.computedProps.infiniteLoadBeginEdgeOffset?null:r.createElement("div",{ref:function(e){t.loadingSpinner=e}},this.state.isInfiniteLoading?this.computedProps.loadingSpinnerDelegate:null);return r.createElement("div",{className:this.computedProps.className,ref:function(e){t.scrollable=e},style:this.utils.buildScrollableStyle(),onScroll:this.utils.nodeScrollListener},r.createElement("div",{ref:function(e){t.smoothScrollingWrapper=e},style:n},r.createElement("div",{ref:function(e){t.topSpacer=e},style:this.buildHeightStyle(o)}),this.computedProps.displayBottomUpwards&&s,e,!this.computedProps.displayBottomUpwards&&s,r.createElement("div",{ref:function(e){t.bottomSpacer=e},style:this.buildHeightStyle(i)})))}});t.exports=f,n.Infinite=f}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./utils/checkProps":22,"./utils/establish-polyfills":23,"./utils/infiniteHelpers":24,"./utils/scaleEnum":25,"./utils/types":26,"create-react-class":3,"lodash.isfinite":10,"prop-types":16,react:void 0}],2:[function(e,t,n){(function(n){"use strict";function o(e){return e}function r(e,t,r){function p(e,t,o){for(var r in t)t.hasOwnProperty(r)&&"production"!==n.env.NODE_ENV&&l("function"==typeof t[r],"%s: %s type `%s` is invalid; it must be a function, usually from React.PropTypes.",e.displayName||"ReactClass",c[o],r)}function f(e,t){var n=O.hasOwnProperty(t)?O[t]:null;I.hasOwnProperty(t)&&s("OVERRIDE_BASE"===n,"ReactClassInterface: You are attempting to override `%s` from your class specification. Ensure that your method names do not overlap with React methods.",t),e&&s("DEFINE_MANY"===n||"DEFINE_MANY_MERGED"===n,"ReactClassInterface: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",t)}function d(e,o){if(o){s("function"!=typeof o,"ReactClass: You're attempting to use a component class or function as a mixin. Instead, just use a regular object."),s(!t(o),"ReactClass: You're attempting to use a component as a mixin. Instead, just use a regular object.");var r=e.prototype,i=r.__reactAutoBindPairs;o.hasOwnProperty(u)&&w.mixins(e,o.mixins);for(var a in o)if(o.hasOwnProperty(a)&&a!==u){var c=o[a],p=r.hasOwnProperty(a);if(f(p,a),w.hasOwnProperty(a))w[a](e,c);else{var d=O.hasOwnProperty(a),h="function"==typeof c,y=h&&!d&&!p&&o.autobind!==!1;if(y)i.push(a,c),r[a]=c;else if(p){var b=O[a];s(d&&("DEFINE_MANY_MERGED"===b||"DEFINE_MANY"===b),"ReactClass: Unexpected spec policy %s for key %s when mixing in component specs.",b,a),"DEFINE_MANY_MERGED"===b?r[a]=m(r[a],c):"DEFINE_MANY"===b&&(r[a]=g(r[a],c))}else r[a]=c,"production"!==n.env.NODE_ENV&&"function"==typeof c&&o.displayName&&(r[a].displayName=o.displayName+"_"+a)}}}else if("production"!==n.env.NODE_ENV){var v=typeof o,S="object"===v&&null!==o;"production"!==n.env.NODE_ENV&&l(S,"%s: You're attempting to include a mixin that is either null or not an object. Check the mixins included by the component, as well as any mixins they include themselves. Expected object but got %s.",e.displayName||"ReactClass",null===o?null:v)}}function h(e,t){if(t)for(var n in t){var o=t[n];if(t.hasOwnProperty(n)){var r=n in w;s(!r,'ReactClass: You are attempting to define a reserved property, `%s`, that shouldn\'t be on the "statics" key. Define it as an instance property instead; it will still be accessible on the constructor.',n);var i=n in e;s(!i,"ReactClass: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",n),e[n]=o}}}function y(e,t){s(e&&t&&"object"==typeof e&&"object"==typeof t,"mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.");for(var n in t)t.hasOwnProperty(n)&&(s(void 0===e[n],"mergeIntoWithNoDuplicateKeys(): Tried to merge two objects with the same key: `%s`. This conflict may be due to a mixin; in particular, this may be caused by two getInitialState() or getDefaultProps() methods returning objects with clashing keys.",n),e[n]=t[n]);return e}function m(e,t){return function(){var n=e.apply(this,arguments),o=t.apply(this,arguments);if(null==n)return o;if(null==o)return n;var r={};return y(r,n),y(r,o),r}}function g(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function b(e,t){var o=t.bind(e);if("production"!==n.env.NODE_ENV){o.__reactBoundContext=e,o.__reactBoundMethod=t,o.__reactBoundArguments=null;var r=e.constructor.displayName,i=o.bind;o.bind=function(a){for(var s=arguments.length,c=Array(s>1?s-1:0),u=1;u1?t-1:0),o=1;o2?n-2:0),r=2;r-1&&e%1==0&&e<=b}function a(e){return s(e)&&y.call(e)==u}function s(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function l(e){return null!=e&&(a(e)?m.test(d.call(e)):o(e)&&p.test(e))}var c="[object Array]",u="[object Function]",p=/^\[object .+?Constructor\]$/,f=Object.prototype,d=Function.prototype.toString,h=f.hasOwnProperty,y=f.toString,m=RegExp("^"+d.call(h).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),g=r(Array,"isArray"),b=9007199254740991,v=g||function(e){return o(e)&&i(e.length)&&y.call(e)==c};t.exports=v},{}],10:[function(e,t,n){(function(e){function n(e){return"number"==typeof e&&o(e)}var o=e.isFinite;t.exports=n}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],11:[function(e,t,n){"use strict";function o(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}var r=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;t.exports=Object.assign||function(e,t){for(var n,a,s=o(e),l=1;l0?t-1:t}},{key:"getTopSpacerHeight",value:function(e){return e*this.heightData}},{key:"getBottomSpacerHeight",value:function(e){var t=e+1;return Math.max(0,(this.numberOfChildren-t)*this.heightData)}}]),t}(s);t.exports=l},{"./infiniteComputer.js":20}],20:[function(e,t,n){"use strict";function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var r=function(){function e(e,t){for(var n=0;nt&&(s=i-1)}return n===o.CLOSEST_LOWER&&l>0?r=l-1:n===o.CLOSEST_HIGHER&&s Date: Wed, 2 Aug 2017 16:08:48 -0400 Subject: [PATCH 27/78] 0.11.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 5ed3c0a..7df3aa8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-infinite", - "version": "0.11.0", + "version": "0.11.1", "description": "A browser-ready efficient scrolling container based on UITableView", "main": "build/react-infinite.js", "repository": { From 3b1f20043ea38f7a692774526422a8a0588cd9b4 Mon Sep 17 00:00:00 2001 From: Gareth Tan Date: Thu, 3 Aug 2017 17:04:51 -0400 Subject: [PATCH 28/78] Switch to safer method of dealing with window. --- src/react-infinite.jsx | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/react-infinite.jsx b/src/react-infinite.jsx index 8eeca00..6397ab5 100644 --- a/src/react-infinite.jsx +++ b/src/react-infinite.jsx @@ -4,10 +4,20 @@ var React = global.React || require('react'); var PropTypes = global.PropTypes || require('prop-types'); var createReactClass = global.createReactClass || require('create-react-class'); -if (typeof window === 'undefined') { - global.window = {}; +var win; + +if (typeof window !== 'undefined') { + win = window; +} else if (typeof global !== 'undefined') { + win = global; +} else if (typeof self !== 'undefined') { + win = self; +} else { + win = {}; } +var window = win; + require('./utils/establish-polyfills'); var scaleEnum = require('./utils/scaleEnum'); var infiniteHelpers = require('./utils/infiniteHelpers'); From e2bf5bb46d81f9ae3c7474ca1cef3f3ec2d7def3 Mon Sep 17 00:00:00 2001 From: Gareth Tan Date: Thu, 3 Aug 2017 17:10:47 -0400 Subject: [PATCH 29/78] Build new dist bundles. --- dist/react-infinite.js | 2 +- dist/react-infinite.min.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dist/react-infinite.js b/dist/react-infinite.js index 4d57702..270ee16 100644 --- a/dist/react-infinite.js +++ b/dist/react-infinite.js @@ -1,6 +1,6 @@ (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Infinite = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o=0||Object.prototype.hasOwnProperty.call(e,o)&&(i[o]=e[o]);return i}var React=global.React||require("react"),PropTypes=global.PropTypes||require("prop-types"),createReactClass=global.createReactClass||require("create-react-class");"undefined"==typeof window&&(global.window={}),require("./utils/establish-polyfills");var scaleEnum=require("./utils/scaleEnum"),infiniteHelpers=require("./utils/infiniteHelpers"),_isFinite=require("lodash.isfinite"),preloadType=require("./utils/types").preloadType,checkProps=checkProps=require("./utils/checkProps"),Infinite=createReactClass({propTypes:{children:PropTypes.any,handleScroll:PropTypes.func,preloadBatchSize:preloadType,preloadAdditionalHeight:preloadType,elementHeight:PropTypes.oneOfType([PropTypes.number,PropTypes.arrayOf(PropTypes.number)]).isRequired,containerHeight:PropTypes.number,useWindowAsScrollContainer:PropTypes.bool,displayBottomUpwards:PropTypes.bool.isRequired,infiniteLoadBeginEdgeOffset:PropTypes.number,onInfiniteLoad:PropTypes.func,loadingSpinnerDelegate:PropTypes.node,isInfiniteLoading:PropTypes.bool,timeScrollStateLastsForAfterUserScrolls:PropTypes.number,className:PropTypes.string,styles:PropTypes.shape({scrollableStyle:PropTypes.object}).isRequired},statics:{containerHeightScaleFactor:function(e){if(!_isFinite(e))throw new Error("The scale factor must be a number.");return{type:scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR,amount:e}}},computedProps:{},utils:{},shouldAttachToBottom:!1,preservedScrollState:0,loadingSpinnerHeight:0,deprecationWarned:!1,scrollable:null,topSpacer:null,bottomSpacer:null,smoothScrollingWrapper:null,loadingSpinner:null,getDefaultProps:function(){return{handleScroll:function(){},useWindowAsScrollContainer:!1,onInfiniteLoad:function(){},loadingSpinnerDelegate:React.createElement("div",null),displayBottomUpwards:!1,isInfiniteLoading:!1,timeScrollStateLastsForAfterUserScrolls:150,className:"",styles:{}}},getInitialState:function(){var e=this.recomputeInternalStateFromProps(this.props);this.computedProps=e.computedProps,this.utils=e.utils,this.shouldAttachToBottom=this.props.displayBottomUpwards;var t=e.newState;return t.scrollTimeout=void 0,t.isScrolling=!1,t},generateComputedProps:function(e){var t=e.containerHeight,i=e.preloadBatchSize,o=e.preloadAdditionalHeight,n=_objectWithoutProperties(e,["containerHeight","preloadBatchSize","preloadAdditionalHeight"]),r={};t="number"==typeof t?t:0,r.containerHeight=e.useWindowAsScrollContainer?window.innerHeight:t,void 0!==n.infiniteLoadBeginBottomOffset&&(r.infiniteLoadBeginEdgeOffset=n.infiniteLoadBeginBottomOffset,this.deprecationWarned||(console.error("Warning: React Infinite's infiniteLoadBeginBottomOffset prop\n has been deprecated as of 0.6.0. Please use infiniteLoadBeginEdgeOffset.\n Because this is a rather descriptive name, a simple find and replace\n should suffice."),this.deprecationWarned=!0));var s={type:scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR,amount:.5},l=i&&i.type?i:s;"number"==typeof i?r.preloadBatchSize=i:"object"==typeof l&&l.type===scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR?r.preloadBatchSize=r.containerHeight*l.amount:r.preloadBatchSize=0;var a={type:scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR,amount:1},c=o&&o.type?o:a;return"number"==typeof o?r.preloadAdditionalHeight=o:"object"==typeof c&&c.type===scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR?r.preloadAdditionalHeight=r.containerHeight*c.amount:r.preloadAdditionalHeight=0,Object.assign(n,r)},generateComputedUtilityFunctions:function(e){var t=this,i={};return i.getLoadingSpinnerHeight=function(){var e=0;return t.loadingSpinner&&(e=t.loadingSpinner.offsetHeight||0),e},e.useWindowAsScrollContainer?(i.subscribeToScrollListener=function(){window.addEventListener("scroll",t.infiniteHandleScroll)},i.unsubscribeFromScrollListener=function(){window.removeEventListener("scroll",t.infiniteHandleScroll)},i.nodeScrollListener=function(){},i.getScrollTop=function(){return window.pageYOffset},i.setScrollTop=function(e){window.scroll(window.pageXOffset,e)},i.scrollShouldBeIgnored=function(){return!1},i.buildScrollableStyle=function(){return{}}):(i.subscribeToScrollListener=function(){},i.unsubscribeFromScrollListener=function(){},i.nodeScrollListener=this.infiniteHandleScroll,i.getScrollTop=function(){return t.scrollable?t.scrollable.scrollTop:0},i.setScrollTop=function(e){t.scrollable&&(t.scrollable.scrollTop=e)},i.scrollShouldBeIgnored=function(e){return e.target!==t.scrollable},i.buildScrollableStyle=function(){return Object.assign({},{height:t.computedProps.containerHeight,overflowX:"hidden",overflowY:"scroll",WebkitOverflowScrolling:"touch"},t.computedProps.styles.scrollableStyle||{})}),i},recomputeInternalStateFromProps:function(e){checkProps(e);var t=this.generateComputedProps(e),i=this.generateComputedUtilityFunctions(e),o={};return o.numberOfChildren=React.Children.count(t.children),o.infiniteComputer=infiniteHelpers.createInfiniteComputer(t.elementHeight,t.children,t.displayBottomUpwards),void 0!==t.isInfiniteLoading&&(o.isInfiniteLoading=t.isInfiniteLoading),o.preloadBatchSize=t.preloadBatchSize,o.preloadAdditionalHeight=t.preloadAdditionalHeight,o=Object.assign(o,infiniteHelpers.recomputeApertureStateFromOptionsAndScrollTop(o,i.getScrollTop())),{computedProps:t,utils:i,newState:o}},componentWillReceiveProps:function(e){var t=this.recomputeInternalStateFromProps(e);this.computedProps=t.computedProps,this.utils=t.utils,this.setState(t.newState)},componentWillUpdate:function(){this.props.displayBottomUpwards&&(this.preservedScrollState=this.utils.getScrollTop()-this.loadingSpinnerHeight)},componentDidUpdate:function(e,t){if(this.loadingSpinnerHeight=this.utils.getLoadingSpinnerHeight(),this.props.displayBottomUpwards){var i=this.getLowestPossibleScrollTop();this.shouldAttachToBottom&&this.utils.getScrollTop()this.state.infiniteComputer.getTotalScrollableHeight()-this.computedProps.containerHeight-this.computedProps.infiniteLoadBeginEdgeOffset},onInfiniteLoad:function(){this.setState({isInfiniteLoading:!0}),this.computedProps.onInfiniteLoad()},handleScroll:function(e){this.shouldAttachToBottom=this.computedProps.displayBottomUpwards&&e>=this.getLowestPossibleScrollTop(),this.manageScrollTimeouts();var t=infiniteHelpers.recomputeApertureStateFromOptionsAndScrollTop(this.state,e);this.passedEdgeForInfiniteScroll(e)&&!this.state.isInfiniteLoading?(this.setState(Object.assign({},t)),this.onInfiniteLoad()):this.setState(t)},buildHeightStyle:function(e){return{width:"100%",height:Math.ceil(e)}},render:function(){var e,t=this;e=this.state.numberOfChildren>1?this.computedProps.children.slice(this.state.displayIndexStart,this.state.displayIndexEnd+1):this.computedProps.children;var i={};this.state.isScrolling&&(i.pointerEvents="none");var o=this.state.infiniteComputer.getTopSpacerHeight(this.state.displayIndexStart),n=this.state.infiniteComputer.getBottomSpacerHeight(this.state.displayIndexEnd);if(this.computedProps.displayBottomUpwards){var r=this.computedProps.containerHeight-this.state.infiniteComputer.getTotalScrollableHeight();r>0&&(o=r-this.loadingSpinnerHeight)}var s=void 0===this.computedProps.infiniteLoadBeginEdgeOffset?null:React.createElement("div",{ref:function(e){t.loadingSpinner=e}},this.state.isInfiniteLoading?this.computedProps.loadingSpinnerDelegate:null);return React.createElement("div",{className:this.computedProps.className,ref:function(e){t.scrollable=e},style:this.utils.buildScrollableStyle(),onScroll:this.utils.nodeScrollListener},React.createElement("div",{ref:function(e){t.smoothScrollingWrapper=e},style:i},React.createElement("div",{ref:function(e){t.topSpacer=e},style:this.buildHeightStyle(o)}),this.computedProps.displayBottomUpwards&&s,e,!this.computedProps.displayBottomUpwards&&s,React.createElement("div",{ref:function(e){t.bottomSpacer=e},style:this.buildHeightStyle(n)})))}});module.exports=Infinite,global.Infinite=Infinite; +"use strict";function _objectWithoutProperties(e,t){var i={};for(var o in e)t.indexOf(o)>=0||Object.prototype.hasOwnProperty.call(e,o)&&(i[o]=e[o]);return i}var React=global.React||require("react"),PropTypes=global.PropTypes||require("prop-types"),createReactClass=global.createReactClass||require("create-react-class"),win;win=void 0!==window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};var window=win;require("./utils/establish-polyfills");var scaleEnum=require("./utils/scaleEnum"),infiniteHelpers=require("./utils/infiniteHelpers"),_isFinite=require("lodash.isfinite"),preloadType=require("./utils/types").preloadType,checkProps=checkProps=require("./utils/checkProps"),Infinite=createReactClass({propTypes:{children:PropTypes.any,handleScroll:PropTypes.func,preloadBatchSize:preloadType,preloadAdditionalHeight:preloadType,elementHeight:PropTypes.oneOfType([PropTypes.number,PropTypes.arrayOf(PropTypes.number)]).isRequired,containerHeight:PropTypes.number,useWindowAsScrollContainer:PropTypes.bool,displayBottomUpwards:PropTypes.bool.isRequired,infiniteLoadBeginEdgeOffset:PropTypes.number,onInfiniteLoad:PropTypes.func,loadingSpinnerDelegate:PropTypes.node,isInfiniteLoading:PropTypes.bool,timeScrollStateLastsForAfterUserScrolls:PropTypes.number,className:PropTypes.string,styles:PropTypes.shape({scrollableStyle:PropTypes.object}).isRequired},statics:{containerHeightScaleFactor:function(e){if(!_isFinite(e))throw new Error("The scale factor must be a number.");return{type:scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR,amount:e}}},computedProps:{},utils:{},shouldAttachToBottom:!1,preservedScrollState:0,loadingSpinnerHeight:0,deprecationWarned:!1,scrollable:null,topSpacer:null,bottomSpacer:null,smoothScrollingWrapper:null,loadingSpinner:null,getDefaultProps:function(){return{handleScroll:function(){},useWindowAsScrollContainer:!1,onInfiniteLoad:function(){},loadingSpinnerDelegate:React.createElement("div",null),displayBottomUpwards:!1,isInfiniteLoading:!1,timeScrollStateLastsForAfterUserScrolls:150,className:"",styles:{}}},getInitialState:function(){var e=this.recomputeInternalStateFromProps(this.props);this.computedProps=e.computedProps,this.utils=e.utils,this.shouldAttachToBottom=this.props.displayBottomUpwards;var t=e.newState;return t.scrollTimeout=void 0,t.isScrolling=!1,t},generateComputedProps:function(e){var t=e.containerHeight,i=e.preloadBatchSize,o=e.preloadAdditionalHeight,n=_objectWithoutProperties(e,["containerHeight","preloadBatchSize","preloadAdditionalHeight"]),r={};t="number"==typeof t?t:0,r.containerHeight=e.useWindowAsScrollContainer?window.innerHeight:t,void 0!==n.infiniteLoadBeginBottomOffset&&(r.infiniteLoadBeginEdgeOffset=n.infiniteLoadBeginBottomOffset,this.deprecationWarned||(console.error("Warning: React Infinite's infiniteLoadBeginBottomOffset prop\n has been deprecated as of 0.6.0. Please use infiniteLoadBeginEdgeOffset.\n Because this is a rather descriptive name, a simple find and replace\n should suffice."),this.deprecationWarned=!0));var s={type:scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR,amount:.5},l=i&&i.type?i:s;"number"==typeof i?r.preloadBatchSize=i:"object"==typeof l&&l.type===scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR?r.preloadBatchSize=r.containerHeight*l.amount:r.preloadBatchSize=0;var a={type:scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR,amount:1},c=o&&o.type?o:a;return"number"==typeof o?r.preloadAdditionalHeight=o:"object"==typeof c&&c.type===scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR?r.preloadAdditionalHeight=r.containerHeight*c.amount:r.preloadAdditionalHeight=0,Object.assign(n,r)},generateComputedUtilityFunctions:function(e){var t=this,i={};return i.getLoadingSpinnerHeight=function(){var e=0;return t.loadingSpinner&&(e=t.loadingSpinner.offsetHeight||0),e},e.useWindowAsScrollContainer?(i.subscribeToScrollListener=function(){window.addEventListener("scroll",t.infiniteHandleScroll)},i.unsubscribeFromScrollListener=function(){window.removeEventListener("scroll",t.infiniteHandleScroll)},i.nodeScrollListener=function(){},i.getScrollTop=function(){return window.pageYOffset},i.setScrollTop=function(e){window.scroll(window.pageXOffset,e)},i.scrollShouldBeIgnored=function(){return!1},i.buildScrollableStyle=function(){return{}}):(i.subscribeToScrollListener=function(){},i.unsubscribeFromScrollListener=function(){},i.nodeScrollListener=this.infiniteHandleScroll,i.getScrollTop=function(){return t.scrollable?t.scrollable.scrollTop:0},i.setScrollTop=function(e){t.scrollable&&(t.scrollable.scrollTop=e)},i.scrollShouldBeIgnored=function(e){return e.target!==t.scrollable},i.buildScrollableStyle=function(){return Object.assign({},{height:t.computedProps.containerHeight,overflowX:"hidden",overflowY:"scroll",WebkitOverflowScrolling:"touch"},t.computedProps.styles.scrollableStyle||{})}),i},recomputeInternalStateFromProps:function(e){checkProps(e);var t=this.generateComputedProps(e),i=this.generateComputedUtilityFunctions(e),o={};return o.numberOfChildren=React.Children.count(t.children),o.infiniteComputer=infiniteHelpers.createInfiniteComputer(t.elementHeight,t.children,t.displayBottomUpwards),void 0!==t.isInfiniteLoading&&(o.isInfiniteLoading=t.isInfiniteLoading),o.preloadBatchSize=t.preloadBatchSize,o.preloadAdditionalHeight=t.preloadAdditionalHeight,o=Object.assign(o,infiniteHelpers.recomputeApertureStateFromOptionsAndScrollTop(o,i.getScrollTop())),{computedProps:t,utils:i,newState:o}},componentWillReceiveProps:function(e){var t=this.recomputeInternalStateFromProps(e);this.computedProps=t.computedProps,this.utils=t.utils,this.setState(t.newState)},componentWillUpdate:function(){this.props.displayBottomUpwards&&(this.preservedScrollState=this.utils.getScrollTop()-this.loadingSpinnerHeight)},componentDidUpdate:function(e,t){if(this.loadingSpinnerHeight=this.utils.getLoadingSpinnerHeight(),this.props.displayBottomUpwards){var i=this.getLowestPossibleScrollTop();this.shouldAttachToBottom&&this.utils.getScrollTop()this.state.infiniteComputer.getTotalScrollableHeight()-this.computedProps.containerHeight-this.computedProps.infiniteLoadBeginEdgeOffset},onInfiniteLoad:function(){this.setState({isInfiniteLoading:!0}),this.computedProps.onInfiniteLoad()},handleScroll:function(e){this.shouldAttachToBottom=this.computedProps.displayBottomUpwards&&e>=this.getLowestPossibleScrollTop(),this.manageScrollTimeouts();var t=infiniteHelpers.recomputeApertureStateFromOptionsAndScrollTop(this.state,e);this.passedEdgeForInfiniteScroll(e)&&!this.state.isInfiniteLoading?(this.setState(Object.assign({},t)),this.onInfiniteLoad()):this.setState(t)},buildHeightStyle:function(e){return{width:"100%",height:Math.ceil(e)}},render:function(){var e,t=this;e=this.state.numberOfChildren>1?this.computedProps.children.slice(this.state.displayIndexStart,this.state.displayIndexEnd+1):this.computedProps.children;var i={};this.state.isScrolling&&(i.pointerEvents="none");var o=this.state.infiniteComputer.getTopSpacerHeight(this.state.displayIndexStart),n=this.state.infiniteComputer.getBottomSpacerHeight(this.state.displayIndexEnd);if(this.computedProps.displayBottomUpwards){var r=this.computedProps.containerHeight-this.state.infiniteComputer.getTotalScrollableHeight();r>0&&(o=r-this.loadingSpinnerHeight)}var s=void 0===this.computedProps.infiniteLoadBeginEdgeOffset?null:React.createElement("div",{ref:function(e){t.loadingSpinner=e}},this.state.isInfiniteLoading?this.computedProps.loadingSpinnerDelegate:null);return React.createElement("div",{className:this.computedProps.className,ref:function(e){t.scrollable=e},style:this.utils.buildScrollableStyle(),onScroll:this.utils.nodeScrollListener},React.createElement("div",{ref:function(e){t.smoothScrollingWrapper=e},style:i},React.createElement("div",{ref:function(e){t.topSpacer=e},style:this.buildHeightStyle(o)}),this.computedProps.displayBottomUpwards&&s,e,!this.computedProps.displayBottomUpwards&&s,React.createElement("div",{ref:function(e){t.bottomSpacer=e},style:this.buildHeightStyle(n)})))}});module.exports=Infinite,global.Infinite=Infinite; }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{"./utils/checkProps":22,"./utils/establish-polyfills":23,"./utils/infiniteHelpers":24,"./utils/scaleEnum":25,"./utils/types":26,"create-react-class":3,"lodash.isfinite":10,"prop-types":16,"react":undefined}],2:[function(require,module,exports){ (function (process){ diff --git a/dist/react-infinite.min.js b/dist/react-infinite.min.js index f0ee1d2..5fea161 100644 --- a/dist/react-infinite.min.js +++ b/dist/react-infinite.min.js @@ -1,2 +1,2 @@ -!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.Infinite=e()}}(function(){return function e(t,n,o){function r(a,s){if(!n[a]){if(!t[a]){var l="function"==typeof require&&require;if(!s&&l)return l(a,!0);if(i)return i(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var u=n[a]={exports:{}};t[a][0].call(u.exports,function(e){var n=t[a][1][e];return r(n?n:e)},u,u.exports,e,t,n,o)}return n[a].exports}for(var i="function"==typeof require&&require,a=0;a=0||Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]);return n}var r=n.React||e("react"),i=n.PropTypes||e("prop-types"),a=n.createReactClass||e("create-react-class");"undefined"==typeof window&&(n.window={}),e("./utils/establish-polyfills");var s=e("./utils/scaleEnum"),l=e("./utils/infiniteHelpers"),c=e("lodash.isfinite"),u=e("./utils/types").preloadType,p=p=e("./utils/checkProps"),f=a({propTypes:{children:i.any,handleScroll:i.func,preloadBatchSize:u,preloadAdditionalHeight:u,elementHeight:i.oneOfType([i.number,i.arrayOf(i.number)]).isRequired,containerHeight:i.number,useWindowAsScrollContainer:i.bool,displayBottomUpwards:i.bool.isRequired,infiniteLoadBeginEdgeOffset:i.number,onInfiniteLoad:i.func,loadingSpinnerDelegate:i.node,isInfiniteLoading:i.bool,timeScrollStateLastsForAfterUserScrolls:i.number,className:i.string,styles:i.shape({scrollableStyle:i.object}).isRequired},statics:{containerHeightScaleFactor:function(e){if(!c(e))throw new Error("The scale factor must be a number.");return{type:s.CONTAINER_HEIGHT_SCALE_FACTOR,amount:e}}},computedProps:{},utils:{},shouldAttachToBottom:!1,preservedScrollState:0,loadingSpinnerHeight:0,deprecationWarned:!1,scrollable:null,topSpacer:null,bottomSpacer:null,smoothScrollingWrapper:null,loadingSpinner:null,getDefaultProps:function(){return{handleScroll:function(){},useWindowAsScrollContainer:!1,onInfiniteLoad:function(){},loadingSpinnerDelegate:r.createElement("div",null),displayBottomUpwards:!1,isInfiniteLoading:!1,timeScrollStateLastsForAfterUserScrolls:150,className:"",styles:{}}},getInitialState:function(){var e=this.recomputeInternalStateFromProps(this.props);this.computedProps=e.computedProps,this.utils=e.utils,this.shouldAttachToBottom=this.props.displayBottomUpwards;var t=e.newState;return t.scrollTimeout=void 0,t.isScrolling=!1,t},generateComputedProps:function(e){var t=e.containerHeight,n=e.preloadBatchSize,r=e.preloadAdditionalHeight,i=o(e,["containerHeight","preloadBatchSize","preloadAdditionalHeight"]),a={};t="number"==typeof t?t:0,a.containerHeight=e.useWindowAsScrollContainer?window.innerHeight:t,void 0!==i.infiniteLoadBeginBottomOffset&&(a.infiniteLoadBeginEdgeOffset=i.infiniteLoadBeginBottomOffset,this.deprecationWarned||(console.error("Warning: React Infinite's infiniteLoadBeginBottomOffset prop\n has been deprecated as of 0.6.0. Please use infiniteLoadBeginEdgeOffset.\n Because this is a rather descriptive name, a simple find and replace\n should suffice."),this.deprecationWarned=!0));var l={type:s.CONTAINER_HEIGHT_SCALE_FACTOR,amount:.5},c=n&&n.type?n:l;"number"==typeof n?a.preloadBatchSize=n:"object"==typeof c&&c.type===s.CONTAINER_HEIGHT_SCALE_FACTOR?a.preloadBatchSize=a.containerHeight*c.amount:a.preloadBatchSize=0;var u={type:s.CONTAINER_HEIGHT_SCALE_FACTOR,amount:1},p=r&&r.type?r:u;return"number"==typeof r?a.preloadAdditionalHeight=r:"object"==typeof p&&p.type===s.CONTAINER_HEIGHT_SCALE_FACTOR?a.preloadAdditionalHeight=a.containerHeight*p.amount:a.preloadAdditionalHeight=0,Object.assign(i,a)},generateComputedUtilityFunctions:function(e){var t=this,n={};return n.getLoadingSpinnerHeight=function(){var e=0;return t.loadingSpinner&&(e=t.loadingSpinner.offsetHeight||0),e},e.useWindowAsScrollContainer?(n.subscribeToScrollListener=function(){window.addEventListener("scroll",t.infiniteHandleScroll)},n.unsubscribeFromScrollListener=function(){window.removeEventListener("scroll",t.infiniteHandleScroll)},n.nodeScrollListener=function(){},n.getScrollTop=function(){return window.pageYOffset},n.setScrollTop=function(e){window.scroll(window.pageXOffset,e)},n.scrollShouldBeIgnored=function(){return!1},n.buildScrollableStyle=function(){return{}}):(n.subscribeToScrollListener=function(){},n.unsubscribeFromScrollListener=function(){},n.nodeScrollListener=this.infiniteHandleScroll,n.getScrollTop=function(){return t.scrollable?t.scrollable.scrollTop:0},n.setScrollTop=function(e){t.scrollable&&(t.scrollable.scrollTop=e)},n.scrollShouldBeIgnored=function(e){return e.target!==t.scrollable},n.buildScrollableStyle=function(){return Object.assign({},{height:t.computedProps.containerHeight,overflowX:"hidden",overflowY:"scroll",WebkitOverflowScrolling:"touch"},t.computedProps.styles.scrollableStyle||{})}),n},recomputeInternalStateFromProps:function(e){p(e);var t=this.generateComputedProps(e),n=this.generateComputedUtilityFunctions(e),o={};return o.numberOfChildren=r.Children.count(t.children),o.infiniteComputer=l.createInfiniteComputer(t.elementHeight,t.children,t.displayBottomUpwards),void 0!==t.isInfiniteLoading&&(o.isInfiniteLoading=t.isInfiniteLoading),o.preloadBatchSize=t.preloadBatchSize,o.preloadAdditionalHeight=t.preloadAdditionalHeight,o=Object.assign(o,l.recomputeApertureStateFromOptionsAndScrollTop(o,n.getScrollTop())),{computedProps:t,utils:n,newState:o}},componentWillReceiveProps:function(e){var t=this.recomputeInternalStateFromProps(e);this.computedProps=t.computedProps,this.utils=t.utils,this.setState(t.newState)},componentWillUpdate:function(){this.props.displayBottomUpwards&&(this.preservedScrollState=this.utils.getScrollTop()-this.loadingSpinnerHeight)},componentDidUpdate:function(e,t){if(this.loadingSpinnerHeight=this.utils.getLoadingSpinnerHeight(),this.props.displayBottomUpwards){var n=this.getLowestPossibleScrollTop();this.shouldAttachToBottom&&this.utils.getScrollTop()this.state.infiniteComputer.getTotalScrollableHeight()-this.computedProps.containerHeight-this.computedProps.infiniteLoadBeginEdgeOffset},onInfiniteLoad:function(){this.setState({isInfiniteLoading:!0}),this.computedProps.onInfiniteLoad()},handleScroll:function(e){this.shouldAttachToBottom=this.computedProps.displayBottomUpwards&&e>=this.getLowestPossibleScrollTop(),this.manageScrollTimeouts();var t=l.recomputeApertureStateFromOptionsAndScrollTop(this.state,e);this.passedEdgeForInfiniteScroll(e)&&!this.state.isInfiniteLoading?(this.setState(Object.assign({},t)),this.onInfiniteLoad()):this.setState(t)},buildHeightStyle:function(e){return{width:"100%",height:Math.ceil(e)}},render:function(){var e,t=this;e=this.state.numberOfChildren>1?this.computedProps.children.slice(this.state.displayIndexStart,this.state.displayIndexEnd+1):this.computedProps.children;var n={};this.state.isScrolling&&(n.pointerEvents="none");var o=this.state.infiniteComputer.getTopSpacerHeight(this.state.displayIndexStart),i=this.state.infiniteComputer.getBottomSpacerHeight(this.state.displayIndexEnd);if(this.computedProps.displayBottomUpwards){var a=this.computedProps.containerHeight-this.state.infiniteComputer.getTotalScrollableHeight();a>0&&(o=a-this.loadingSpinnerHeight)}var s=void 0===this.computedProps.infiniteLoadBeginEdgeOffset?null:r.createElement("div",{ref:function(e){t.loadingSpinner=e}},this.state.isInfiniteLoading?this.computedProps.loadingSpinnerDelegate:null);return r.createElement("div",{className:this.computedProps.className,ref:function(e){t.scrollable=e},style:this.utils.buildScrollableStyle(),onScroll:this.utils.nodeScrollListener},r.createElement("div",{ref:function(e){t.smoothScrollingWrapper=e},style:n},r.createElement("div",{ref:function(e){t.topSpacer=e},style:this.buildHeightStyle(o)}),this.computedProps.displayBottomUpwards&&s,e,!this.computedProps.displayBottomUpwards&&s,r.createElement("div",{ref:function(e){t.bottomSpacer=e},style:this.buildHeightStyle(i)})))}});t.exports=f,n.Infinite=f}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./utils/checkProps":22,"./utils/establish-polyfills":23,"./utils/infiniteHelpers":24,"./utils/scaleEnum":25,"./utils/types":26,"create-react-class":3,"lodash.isfinite":10,"prop-types":16,react:void 0}],2:[function(e,t,n){(function(n){"use strict";function o(e){return e}function r(e,t,r){function p(e,t,o){for(var r in t)t.hasOwnProperty(r)&&"production"!==n.env.NODE_ENV&&l("function"==typeof t[r],"%s: %s type `%s` is invalid; it must be a function, usually from React.PropTypes.",e.displayName||"ReactClass",c[o],r)}function f(e,t){var n=O.hasOwnProperty(t)?O[t]:null;I.hasOwnProperty(t)&&s("OVERRIDE_BASE"===n,"ReactClassInterface: You are attempting to override `%s` from your class specification. Ensure that your method names do not overlap with React methods.",t),e&&s("DEFINE_MANY"===n||"DEFINE_MANY_MERGED"===n,"ReactClassInterface: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",t)}function d(e,o){if(o){s("function"!=typeof o,"ReactClass: You're attempting to use a component class or function as a mixin. Instead, just use a regular object."),s(!t(o),"ReactClass: You're attempting to use a component as a mixin. Instead, just use a regular object.");var r=e.prototype,i=r.__reactAutoBindPairs;o.hasOwnProperty(u)&&w.mixins(e,o.mixins);for(var a in o)if(o.hasOwnProperty(a)&&a!==u){var c=o[a],p=r.hasOwnProperty(a);if(f(p,a),w.hasOwnProperty(a))w[a](e,c);else{var d=O.hasOwnProperty(a),h="function"==typeof c,y=h&&!d&&!p&&o.autobind!==!1;if(y)i.push(a,c),r[a]=c;else if(p){var b=O[a];s(d&&("DEFINE_MANY_MERGED"===b||"DEFINE_MANY"===b),"ReactClass: Unexpected spec policy %s for key %s when mixing in component specs.",b,a),"DEFINE_MANY_MERGED"===b?r[a]=m(r[a],c):"DEFINE_MANY"===b&&(r[a]=g(r[a],c))}else r[a]=c,"production"!==n.env.NODE_ENV&&"function"==typeof c&&o.displayName&&(r[a].displayName=o.displayName+"_"+a)}}}else if("production"!==n.env.NODE_ENV){var v=typeof o,S="object"===v&&null!==o;"production"!==n.env.NODE_ENV&&l(S,"%s: You're attempting to include a mixin that is either null or not an object. Check the mixins included by the component, as well as any mixins they include themselves. Expected object but got %s.",e.displayName||"ReactClass",null===o?null:v)}}function h(e,t){if(t)for(var n in t){var o=t[n];if(t.hasOwnProperty(n)){var r=n in w;s(!r,'ReactClass: You are attempting to define a reserved property, `%s`, that shouldn\'t be on the "statics" key. Define it as an instance property instead; it will still be accessible on the constructor.',n);var i=n in e;s(!i,"ReactClass: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",n),e[n]=o}}}function y(e,t){s(e&&t&&"object"==typeof e&&"object"==typeof t,"mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.");for(var n in t)t.hasOwnProperty(n)&&(s(void 0===e[n],"mergeIntoWithNoDuplicateKeys(): Tried to merge two objects with the same key: `%s`. This conflict may be due to a mixin; in particular, this may be caused by two getInitialState() or getDefaultProps() methods returning objects with clashing keys.",n),e[n]=t[n]);return e}function m(e,t){return function(){var n=e.apply(this,arguments),o=t.apply(this,arguments);if(null==n)return o;if(null==o)return n;var r={};return y(r,n),y(r,o),r}}function g(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function b(e,t){var o=t.bind(e);if("production"!==n.env.NODE_ENV){o.__reactBoundContext=e,o.__reactBoundMethod=t,o.__reactBoundArguments=null;var r=e.constructor.displayName,i=o.bind;o.bind=function(a){for(var s=arguments.length,c=Array(s>1?s-1:0),u=1;u1?t-1:0),o=1;o2?n-2:0),r=2;r-1&&e%1==0&&e<=b}function a(e){return s(e)&&y.call(e)==u}function s(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function l(e){return null!=e&&(a(e)?m.test(d.call(e)):o(e)&&p.test(e))}var c="[object Array]",u="[object Function]",p=/^\[object .+?Constructor\]$/,f=Object.prototype,d=Function.prototype.toString,h=f.hasOwnProperty,y=f.toString,m=RegExp("^"+d.call(h).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),g=r(Array,"isArray"),b=9007199254740991,v=g||function(e){return o(e)&&i(e.length)&&y.call(e)==c};t.exports=v},{}],10:[function(e,t,n){(function(e){function n(e){return"number"==typeof e&&o(e)}var o=e.isFinite;t.exports=n}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],11:[function(e,t,n){"use strict";function o(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}var r=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;t.exports=Object.assign||function(e,t){for(var n,a,s=o(e),l=1;l0?t-1:t}},{key:"getTopSpacerHeight",value:function(e){return e*this.heightData}},{key:"getBottomSpacerHeight",value:function(e){var t=e+1;return Math.max(0,(this.numberOfChildren-t)*this.heightData)}}]),t}(s);t.exports=l},{"./infiniteComputer.js":20}],20:[function(e,t,n){"use strict";function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var r=function(){function e(e,t){for(var n=0;nt&&(s=i-1)}return n===o.CLOSEST_LOWER&&l>0?r=l-1:n===o.CLOSEST_HIGHER&&s=0||Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]);return n}var r,i=n.React||e("react"),a=n.PropTypes||e("prop-types"),s=n.createReactClass||e("create-react-class");r=void 0!==l?l:"undefined"!=typeof n?n:"undefined"!=typeof self?self:{};var l=r;e("./utils/establish-polyfills");var c=e("./utils/scaleEnum"),u=e("./utils/infiniteHelpers"),p=e("lodash.isfinite"),f=e("./utils/types").preloadType,d=d=e("./utils/checkProps"),h=s({propTypes:{children:a.any,handleScroll:a.func,preloadBatchSize:f,preloadAdditionalHeight:f,elementHeight:a.oneOfType([a.number,a.arrayOf(a.number)]).isRequired,containerHeight:a.number,useWindowAsScrollContainer:a.bool,displayBottomUpwards:a.bool.isRequired,infiniteLoadBeginEdgeOffset:a.number,onInfiniteLoad:a.func,loadingSpinnerDelegate:a.node,isInfiniteLoading:a.bool,timeScrollStateLastsForAfterUserScrolls:a.number,className:a.string,styles:a.shape({scrollableStyle:a.object}).isRequired},statics:{containerHeightScaleFactor:function(e){if(!p(e))throw new Error("The scale factor must be a number.");return{type:c.CONTAINER_HEIGHT_SCALE_FACTOR,amount:e}}},computedProps:{},utils:{},shouldAttachToBottom:!1,preservedScrollState:0,loadingSpinnerHeight:0,deprecationWarned:!1,scrollable:null,topSpacer:null,bottomSpacer:null,smoothScrollingWrapper:null,loadingSpinner:null,getDefaultProps:function(){return{handleScroll:function(){},useWindowAsScrollContainer:!1,onInfiniteLoad:function(){},loadingSpinnerDelegate:i.createElement("div",null),displayBottomUpwards:!1,isInfiniteLoading:!1,timeScrollStateLastsForAfterUserScrolls:150,className:"",styles:{}}},getInitialState:function(){var e=this.recomputeInternalStateFromProps(this.props);this.computedProps=e.computedProps,this.utils=e.utils,this.shouldAttachToBottom=this.props.displayBottomUpwards;var t=e.newState;return t.scrollTimeout=void 0,t.isScrolling=!1,t},generateComputedProps:function(e){var t=e.containerHeight,n=e.preloadBatchSize,r=e.preloadAdditionalHeight,i=o(e,["containerHeight","preloadBatchSize","preloadAdditionalHeight"]),a={};t="number"==typeof t?t:0,a.containerHeight=e.useWindowAsScrollContainer?l.innerHeight:t,void 0!==i.infiniteLoadBeginBottomOffset&&(a.infiniteLoadBeginEdgeOffset=i.infiniteLoadBeginBottomOffset,this.deprecationWarned||(console.error("Warning: React Infinite's infiniteLoadBeginBottomOffset prop\n has been deprecated as of 0.6.0. Please use infiniteLoadBeginEdgeOffset.\n Because this is a rather descriptive name, a simple find and replace\n should suffice."),this.deprecationWarned=!0));var s={type:c.CONTAINER_HEIGHT_SCALE_FACTOR,amount:.5},u=n&&n.type?n:s;"number"==typeof n?a.preloadBatchSize=n:"object"==typeof u&&u.type===c.CONTAINER_HEIGHT_SCALE_FACTOR?a.preloadBatchSize=a.containerHeight*u.amount:a.preloadBatchSize=0;var p={type:c.CONTAINER_HEIGHT_SCALE_FACTOR,amount:1},f=r&&r.type?r:p;return"number"==typeof r?a.preloadAdditionalHeight=r:"object"==typeof f&&f.type===c.CONTAINER_HEIGHT_SCALE_FACTOR?a.preloadAdditionalHeight=a.containerHeight*f.amount:a.preloadAdditionalHeight=0,Object.assign(i,a)},generateComputedUtilityFunctions:function(e){var t=this,n={};return n.getLoadingSpinnerHeight=function(){var e=0;return t.loadingSpinner&&(e=t.loadingSpinner.offsetHeight||0),e},e.useWindowAsScrollContainer?(n.subscribeToScrollListener=function(){l.addEventListener("scroll",t.infiniteHandleScroll)},n.unsubscribeFromScrollListener=function(){l.removeEventListener("scroll",t.infiniteHandleScroll)},n.nodeScrollListener=function(){},n.getScrollTop=function(){return l.pageYOffset},n.setScrollTop=function(e){l.scroll(l.pageXOffset,e)},n.scrollShouldBeIgnored=function(){return!1},n.buildScrollableStyle=function(){return{}}):(n.subscribeToScrollListener=function(){},n.unsubscribeFromScrollListener=function(){},n.nodeScrollListener=this.infiniteHandleScroll,n.getScrollTop=function(){return t.scrollable?t.scrollable.scrollTop:0},n.setScrollTop=function(e){t.scrollable&&(t.scrollable.scrollTop=e)},n.scrollShouldBeIgnored=function(e){return e.target!==t.scrollable},n.buildScrollableStyle=function(){return Object.assign({},{height:t.computedProps.containerHeight,overflowX:"hidden",overflowY:"scroll",WebkitOverflowScrolling:"touch"},t.computedProps.styles.scrollableStyle||{})}),n},recomputeInternalStateFromProps:function(e){d(e);var t=this.generateComputedProps(e),n=this.generateComputedUtilityFunctions(e),o={};return o.numberOfChildren=i.Children.count(t.children),o.infiniteComputer=u.createInfiniteComputer(t.elementHeight,t.children,t.displayBottomUpwards),void 0!==t.isInfiniteLoading&&(o.isInfiniteLoading=t.isInfiniteLoading),o.preloadBatchSize=t.preloadBatchSize,o.preloadAdditionalHeight=t.preloadAdditionalHeight,o=Object.assign(o,u.recomputeApertureStateFromOptionsAndScrollTop(o,n.getScrollTop())),{computedProps:t,utils:n,newState:o}},componentWillReceiveProps:function(e){var t=this.recomputeInternalStateFromProps(e);this.computedProps=t.computedProps,this.utils=t.utils,this.setState(t.newState)},componentWillUpdate:function(){this.props.displayBottomUpwards&&(this.preservedScrollState=this.utils.getScrollTop()-this.loadingSpinnerHeight)},componentDidUpdate:function(e,t){if(this.loadingSpinnerHeight=this.utils.getLoadingSpinnerHeight(),this.props.displayBottomUpwards){var n=this.getLowestPossibleScrollTop();this.shouldAttachToBottom&&this.utils.getScrollTop()this.state.infiniteComputer.getTotalScrollableHeight()-this.computedProps.containerHeight-this.computedProps.infiniteLoadBeginEdgeOffset},onInfiniteLoad:function(){this.setState({isInfiniteLoading:!0}),this.computedProps.onInfiniteLoad()},handleScroll:function(e){this.shouldAttachToBottom=this.computedProps.displayBottomUpwards&&e>=this.getLowestPossibleScrollTop(),this.manageScrollTimeouts();var t=u.recomputeApertureStateFromOptionsAndScrollTop(this.state,e);this.passedEdgeForInfiniteScroll(e)&&!this.state.isInfiniteLoading?(this.setState(Object.assign({},t)),this.onInfiniteLoad()):this.setState(t)},buildHeightStyle:function(e){return{width:"100%",height:Math.ceil(e)}},render:function(){var e,t=this;e=this.state.numberOfChildren>1?this.computedProps.children.slice(this.state.displayIndexStart,this.state.displayIndexEnd+1):this.computedProps.children;var n={};this.state.isScrolling&&(n.pointerEvents="none");var o=this.state.infiniteComputer.getTopSpacerHeight(this.state.displayIndexStart),r=this.state.infiniteComputer.getBottomSpacerHeight(this.state.displayIndexEnd);if(this.computedProps.displayBottomUpwards){var a=this.computedProps.containerHeight-this.state.infiniteComputer.getTotalScrollableHeight();a>0&&(o=a-this.loadingSpinnerHeight)}var s=void 0===this.computedProps.infiniteLoadBeginEdgeOffset?null:i.createElement("div",{ref:function(e){t.loadingSpinner=e}},this.state.isInfiniteLoading?this.computedProps.loadingSpinnerDelegate:null);return i.createElement("div",{className:this.computedProps.className,ref:function(e){t.scrollable=e},style:this.utils.buildScrollableStyle(),onScroll:this.utils.nodeScrollListener},i.createElement("div",{ref:function(e){t.smoothScrollingWrapper=e},style:n},i.createElement("div",{ref:function(e){t.topSpacer=e},style:this.buildHeightStyle(o)}),this.computedProps.displayBottomUpwards&&s,e,!this.computedProps.displayBottomUpwards&&s,i.createElement("div",{ref:function(e){t.bottomSpacer=e},style:this.buildHeightStyle(r)})))}});t.exports=h,n.Infinite=h}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./utils/checkProps":22,"./utils/establish-polyfills":23,"./utils/infiniteHelpers":24,"./utils/scaleEnum":25,"./utils/types":26,"create-react-class":3,"lodash.isfinite":10,"prop-types":16,react:void 0}],2:[function(e,t,n){(function(n){"use strict";function o(e){return e}function r(e,t,r){function p(e,t,o){for(var r in t)t.hasOwnProperty(r)&&"production"!==n.env.NODE_ENV&&l("function"==typeof t[r],"%s: %s type `%s` is invalid; it must be a function, usually from React.PropTypes.",e.displayName||"ReactClass",c[o],r)}function f(e,t){var n=O.hasOwnProperty(t)?O[t]:null;I.hasOwnProperty(t)&&s("OVERRIDE_BASE"===n,"ReactClassInterface: You are attempting to override `%s` from your class specification. Ensure that your method names do not overlap with React methods.",t),e&&s("DEFINE_MANY"===n||"DEFINE_MANY_MERGED"===n,"ReactClassInterface: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",t)}function d(e,o){if(o){s("function"!=typeof o,"ReactClass: You're attempting to use a component class or function as a mixin. Instead, just use a regular object."),s(!t(o),"ReactClass: You're attempting to use a component as a mixin. Instead, just use a regular object.");var r=e.prototype,i=r.__reactAutoBindPairs;o.hasOwnProperty(u)&&w.mixins(e,o.mixins);for(var a in o)if(o.hasOwnProperty(a)&&a!==u){var c=o[a],p=r.hasOwnProperty(a);if(f(p,a),w.hasOwnProperty(a))w[a](e,c);else{var d=O.hasOwnProperty(a),h="function"==typeof c,y=h&&!d&&!p&&o.autobind!==!1;if(y)i.push(a,c),r[a]=c;else if(p){var b=O[a];s(d&&("DEFINE_MANY_MERGED"===b||"DEFINE_MANY"===b),"ReactClass: Unexpected spec policy %s for key %s when mixing in component specs.",b,a),"DEFINE_MANY_MERGED"===b?r[a]=m(r[a],c):"DEFINE_MANY"===b&&(r[a]=g(r[a],c))}else r[a]=c,"production"!==n.env.NODE_ENV&&"function"==typeof c&&o.displayName&&(r[a].displayName=o.displayName+"_"+a)}}}else if("production"!==n.env.NODE_ENV){var v=typeof o,S="object"===v&&null!==o;"production"!==n.env.NODE_ENV&&l(S,"%s: You're attempting to include a mixin that is either null or not an object. Check the mixins included by the component, as well as any mixins they include themselves. Expected object but got %s.",e.displayName||"ReactClass",null===o?null:v)}}function h(e,t){if(t)for(var n in t){var o=t[n];if(t.hasOwnProperty(n)){var r=n in w;s(!r,'ReactClass: You are attempting to define a reserved property, `%s`, that shouldn\'t be on the "statics" key. Define it as an instance property instead; it will still be accessible on the constructor.',n);var i=n in e;s(!i,"ReactClass: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",n),e[n]=o}}}function y(e,t){s(e&&t&&"object"==typeof e&&"object"==typeof t,"mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.");for(var n in t)t.hasOwnProperty(n)&&(s(void 0===e[n],"mergeIntoWithNoDuplicateKeys(): Tried to merge two objects with the same key: `%s`. This conflict may be due to a mixin; in particular, this may be caused by two getInitialState() or getDefaultProps() methods returning objects with clashing keys.",n),e[n]=t[n]);return e}function m(e,t){return function(){var n=e.apply(this,arguments),o=t.apply(this,arguments);if(null==n)return o;if(null==o)return n;var r={};return y(r,n),y(r,o),r}}function g(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function b(e,t){var o=t.bind(e);if("production"!==n.env.NODE_ENV){o.__reactBoundContext=e,o.__reactBoundMethod=t,o.__reactBoundArguments=null;var r=e.constructor.displayName,i=o.bind;o.bind=function(a){for(var s=arguments.length,c=Array(s>1?s-1:0),u=1;u1?t-1:0),o=1;o2?n-2:0),r=2;r-1&&e%1==0&&e<=b}function a(e){return s(e)&&y.call(e)==u}function s(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function l(e){return null!=e&&(a(e)?m.test(d.call(e)):o(e)&&p.test(e))}var c="[object Array]",u="[object Function]",p=/^\[object .+?Constructor\]$/,f=Object.prototype,d=Function.prototype.toString,h=f.hasOwnProperty,y=f.toString,m=RegExp("^"+d.call(h).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),g=r(Array,"isArray"),b=9007199254740991,v=g||function(e){return o(e)&&i(e.length)&&y.call(e)==c};t.exports=v},{}],10:[function(e,t,n){(function(e){function n(e){return"number"==typeof e&&o(e)}var o=e.isFinite;t.exports=n}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],11:[function(e,t,n){"use strict";function o(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}var r=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;t.exports=Object.assign||function(e,t){for(var n,a,s=o(e),l=1;l0?t-1:t}},{key:"getTopSpacerHeight",value:function(e){return e*this.heightData}},{key:"getBottomSpacerHeight",value:function(e){var t=e+1;return Math.max(0,(this.numberOfChildren-t)*this.heightData)}}]),t}(s);t.exports=l},{"./infiniteComputer.js":20}],20:[function(e,t,n){"use strict";function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var r=function(){function e(e,t){for(var n=0;nt&&(s=i-1)}return n===o.CLOSEST_LOWER&&l>0?r=l-1:n===o.CLOSEST_HIGHER&&s Date: Thu, 3 Aug 2017 17:33:59 -0400 Subject: [PATCH 30/78] Refactor and fix typechecking. --- package.json | 2 +- src/react-infinite.jsx | 24 ++++++------------------ src/utils/checkProps.js | 4 +++- src/utils/scaleEnum.js | 2 ++ src/utils/window.js | 13 +++++++++++++ 5 files changed, 25 insertions(+), 20 deletions(-) create mode 100644 src/utils/window.js diff --git a/package.json b/package.json index 7df3aa8..1084994 100644 --- a/package.json +++ b/package.json @@ -62,7 +62,7 @@ "eslint-config-standard": "^4.1.0", "eslint-plugin-react": "^3.2.3", "eslint-plugin-standard": "^1.2.0", - "flow-bin": "0.33.0", + "flow-bin": "0.52.0", "gulp": "^3.8.8", "gulp-babel": "^5.2.1", "gulp-concat": "^2.4.3", diff --git a/src/react-infinite.jsx b/src/react-infinite.jsx index 6397ab5..d2c3109 100644 --- a/src/react-infinite.jsx +++ b/src/react-infinite.jsx @@ -1,22 +1,11 @@ /* @flow */ + var React = global.React || require('react'); var PropTypes = global.PropTypes || require('prop-types'); var createReactClass = global.createReactClass || require('create-react-class'); -var win; - -if (typeof window !== 'undefined') { - win = window; -} else if (typeof global !== 'undefined') { - win = global; -} else if (typeof self !== 'undefined') { - win = self; -} else { - win = {}; -} - -var window = win; +var window = require('./utils/window'); require('./utils/establish-polyfills'); var scaleEnum = require('./utils/scaleEnum'); @@ -249,16 +238,15 @@ var Infinite = createReactClass({ newState: ReactInfiniteState } { checkProps(props); - var computedProps = this.generateComputedProps(props); - var utils = this.generateComputedUtilityFunctions(props); + var computedProps: ReactInfiniteComputedProps = this.generateComputedProps(props); + var utils: ReactInfiniteUtilityFunctions = this.generateComputedUtilityFunctions(props); var newState = {}; newState.numberOfChildren = React.Children.count(computedProps.children); newState.infiniteComputer = infiniteHelpers.createInfiniteComputer( computedProps.elementHeight, - computedProps.children, - computedProps.displayBottomUpwards + computedProps.children ); if (computedProps.isInfiniteLoading !== undefined) { @@ -422,7 +410,7 @@ var Infinite = createReactClass({ }; }, - render(): React.Element { + render() { var displayables; if (this.state.numberOfChildren > 1) { displayables = this.computedProps.children.slice(this.state.displayIndexStart, diff --git a/src/utils/checkProps.js b/src/utils/checkProps.js index 3bce93b..44f9f20 100644 --- a/src/utils/checkProps.js +++ b/src/utils/checkProps.js @@ -1,3 +1,5 @@ +/* @flow */ + // This module provides a centralized place for // runtime checking that the props passed to React Infinite // make the minimum amount of sense. @@ -5,7 +7,7 @@ var React = global.React || require('react'); var _isFinite = require('lodash.isfinite'); -module.exports = function(props) { +module.exports = function(props: ReactInfiniteProps) { var rie = 'Invariant Violation: '; if (!(props.containerHeight || props.useWindowAsScrollContainer)) { throw new Error(rie + 'Either containerHeight or useWindowAsScrollContainer must be provided.'); diff --git a/src/utils/scaleEnum.js b/src/utils/scaleEnum.js index 73e3213..4c8e3b9 100644 --- a/src/utils/scaleEnum.js +++ b/src/utils/scaleEnum.js @@ -1,3 +1,5 @@ +/* @flow */ + module.exports = { CONTAINER_HEIGHT_SCALE_FACTOR: 'containerHeightScaleFactor' }; diff --git a/src/utils/window.js b/src/utils/window.js new file mode 100644 index 0000000..25a05aa --- /dev/null +++ b/src/utils/window.js @@ -0,0 +1,13 @@ +var win; + +if (typeof window !== 'undefined') { + win = window; +} else if (typeof global !== 'undefined') { + win = global; +} else if (typeof self !== 'undefined'){ + win = self; +} else { + win = {}; +} + +module.exports = win; From 17f5143238f2378ffb800fd99172efa0c1cc2802 Mon Sep 17 00:00:00 2001 From: Gareth Tan Date: Thu, 3 Aug 2017 17:50:22 -0400 Subject: [PATCH 31/78] Fix tests. --- __tests__/bottom_upwards_infinite_test.js | 1 + __tests__/infinite_error_test.js | 1 + __tests__/infinite_styles_test.js | 1 + __tests__/infinite_test.js | 1 + 4 files changed, 4 insertions(+) diff --git a/__tests__/bottom_upwards_infinite_test.js b/__tests__/bottom_upwards_infinite_test.js index 4d803da..9400620 100644 --- a/__tests__/bottom_upwards_infinite_test.js +++ b/__tests__/bottom_upwards_infinite_test.js @@ -7,6 +7,7 @@ jest.dontMock('../src/computers/arrayInfiniteComputer.js'); jest.dontMock('../src/utils/binaryIndexSearch.js'); jest.dontMock('../src/utils/infiniteHelpers.js'); jest.dontMock('./helpers/renderHelpers.js'); +jest.dontMock('../src/utils/window.js'); jest.dontMock('lodash.isfinite'); jest.dontMock('lodash.isarray'); diff --git a/__tests__/infinite_error_test.js b/__tests__/infinite_error_test.js index 3f8ff7f..51ac9f9 100644 --- a/__tests__/infinite_error_test.js +++ b/__tests__/infinite_error_test.js @@ -7,6 +7,7 @@ jest.dontMock('../src/react-infinite.jsx'); jest.dontMock('../src/utils/checkProps'); +jest.dontMock('../src/utils/window.js'); jest.dontMock('lodash.isfinite'); jest.dontMock('lodash.isarray'); diff --git a/__tests__/infinite_styles_test.js b/__tests__/infinite_styles_test.js index 6811e5d..525786b 100644 --- a/__tests__/infinite_styles_test.js +++ b/__tests__/infinite_styles_test.js @@ -11,6 +11,7 @@ jest.dontMock('../src/computers/constantInfiniteComputer.js'); jest.dontMock('../src/computers/arrayInfiniteComputer.js'); jest.dontMock('../src/utils/binaryIndexSearch.js'); jest.dontMock('../src/utils/infiniteHelpers.js'); +jest.dontMock('../src/utils/window.js'); jest.dontMock('./helpers/renderHelpers.js'); jest.dontMock('lodash.isfinite'); jest.dontMock('lodash.isarray'); diff --git a/__tests__/infinite_test.js b/__tests__/infinite_test.js index 0f1a8c0..207dbe0 100644 --- a/__tests__/infinite_test.js +++ b/__tests__/infinite_test.js @@ -7,6 +7,7 @@ jest.dontMock('../src/computers/arrayInfiniteComputer.js'); jest.dontMock('../src/utils/binaryIndexSearch.js'); jest.dontMock('../src/utils/infiniteHelpers.js'); jest.dontMock('./helpers/renderHelpers.js'); +jest.dontMock('../src/utils/window.js'); jest.dontMock('lodash.isfinite'); jest.dontMock('lodash.isarray'); jest.dontMock('react-dom'); From 468bb05389ded59edd6642dccee2cc18a0de55c6 Mon Sep 17 00:00:00 2001 From: Gareth Tan Date: Thu, 3 Aug 2017 17:54:17 -0400 Subject: [PATCH 32/78] Fix lint. --- src/utils/window.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/window.js b/src/utils/window.js index 25a05aa..594f621 100644 --- a/src/utils/window.js +++ b/src/utils/window.js @@ -4,7 +4,7 @@ if (typeof window !== 'undefined') { win = window; } else if (typeof global !== 'undefined') { win = global; -} else if (typeof self !== 'undefined'){ +} else if (typeof self !== 'undefined') { win = self; } else { win = {}; From d66ddd6ad0b14a2509212c5d01b68a3124303e66 Mon Sep 17 00:00:00 2001 From: Gareth Tan Date: Thu, 3 Aug 2017 17:59:05 -0400 Subject: [PATCH 33/78] Add new dist bundles. --- dist/react-infinite.js | 12 +++++++++--- dist/react-infinite.min.js | 4 ++-- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/dist/react-infinite.js b/dist/react-infinite.js index 270ee16..4e55aff 100644 --- a/dist/react-infinite.js +++ b/dist/react-infinite.js @@ -1,8 +1,8 @@ (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Infinite = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o=0||Object.prototype.hasOwnProperty.call(e,o)&&(i[o]=e[o]);return i}var React=global.React||require("react"),PropTypes=global.PropTypes||require("prop-types"),createReactClass=global.createReactClass||require("create-react-class"),win;win=void 0!==window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};var window=win;require("./utils/establish-polyfills");var scaleEnum=require("./utils/scaleEnum"),infiniteHelpers=require("./utils/infiniteHelpers"),_isFinite=require("lodash.isfinite"),preloadType=require("./utils/types").preloadType,checkProps=checkProps=require("./utils/checkProps"),Infinite=createReactClass({propTypes:{children:PropTypes.any,handleScroll:PropTypes.func,preloadBatchSize:preloadType,preloadAdditionalHeight:preloadType,elementHeight:PropTypes.oneOfType([PropTypes.number,PropTypes.arrayOf(PropTypes.number)]).isRequired,containerHeight:PropTypes.number,useWindowAsScrollContainer:PropTypes.bool,displayBottomUpwards:PropTypes.bool.isRequired,infiniteLoadBeginEdgeOffset:PropTypes.number,onInfiniteLoad:PropTypes.func,loadingSpinnerDelegate:PropTypes.node,isInfiniteLoading:PropTypes.bool,timeScrollStateLastsForAfterUserScrolls:PropTypes.number,className:PropTypes.string,styles:PropTypes.shape({scrollableStyle:PropTypes.object}).isRequired},statics:{containerHeightScaleFactor:function(e){if(!_isFinite(e))throw new Error("The scale factor must be a number.");return{type:scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR,amount:e}}},computedProps:{},utils:{},shouldAttachToBottom:!1,preservedScrollState:0,loadingSpinnerHeight:0,deprecationWarned:!1,scrollable:null,topSpacer:null,bottomSpacer:null,smoothScrollingWrapper:null,loadingSpinner:null,getDefaultProps:function(){return{handleScroll:function(){},useWindowAsScrollContainer:!1,onInfiniteLoad:function(){},loadingSpinnerDelegate:React.createElement("div",null),displayBottomUpwards:!1,isInfiniteLoading:!1,timeScrollStateLastsForAfterUserScrolls:150,className:"",styles:{}}},getInitialState:function(){var e=this.recomputeInternalStateFromProps(this.props);this.computedProps=e.computedProps,this.utils=e.utils,this.shouldAttachToBottom=this.props.displayBottomUpwards;var t=e.newState;return t.scrollTimeout=void 0,t.isScrolling=!1,t},generateComputedProps:function(e){var t=e.containerHeight,i=e.preloadBatchSize,o=e.preloadAdditionalHeight,n=_objectWithoutProperties(e,["containerHeight","preloadBatchSize","preloadAdditionalHeight"]),r={};t="number"==typeof t?t:0,r.containerHeight=e.useWindowAsScrollContainer?window.innerHeight:t,void 0!==n.infiniteLoadBeginBottomOffset&&(r.infiniteLoadBeginEdgeOffset=n.infiniteLoadBeginBottomOffset,this.deprecationWarned||(console.error("Warning: React Infinite's infiniteLoadBeginBottomOffset prop\n has been deprecated as of 0.6.0. Please use infiniteLoadBeginEdgeOffset.\n Because this is a rather descriptive name, a simple find and replace\n should suffice."),this.deprecationWarned=!0));var s={type:scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR,amount:.5},l=i&&i.type?i:s;"number"==typeof i?r.preloadBatchSize=i:"object"==typeof l&&l.type===scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR?r.preloadBatchSize=r.containerHeight*l.amount:r.preloadBatchSize=0;var a={type:scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR,amount:1},c=o&&o.type?o:a;return"number"==typeof o?r.preloadAdditionalHeight=o:"object"==typeof c&&c.type===scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR?r.preloadAdditionalHeight=r.containerHeight*c.amount:r.preloadAdditionalHeight=0,Object.assign(n,r)},generateComputedUtilityFunctions:function(e){var t=this,i={};return i.getLoadingSpinnerHeight=function(){var e=0;return t.loadingSpinner&&(e=t.loadingSpinner.offsetHeight||0),e},e.useWindowAsScrollContainer?(i.subscribeToScrollListener=function(){window.addEventListener("scroll",t.infiniteHandleScroll)},i.unsubscribeFromScrollListener=function(){window.removeEventListener("scroll",t.infiniteHandleScroll)},i.nodeScrollListener=function(){},i.getScrollTop=function(){return window.pageYOffset},i.setScrollTop=function(e){window.scroll(window.pageXOffset,e)},i.scrollShouldBeIgnored=function(){return!1},i.buildScrollableStyle=function(){return{}}):(i.subscribeToScrollListener=function(){},i.unsubscribeFromScrollListener=function(){},i.nodeScrollListener=this.infiniteHandleScroll,i.getScrollTop=function(){return t.scrollable?t.scrollable.scrollTop:0},i.setScrollTop=function(e){t.scrollable&&(t.scrollable.scrollTop=e)},i.scrollShouldBeIgnored=function(e){return e.target!==t.scrollable},i.buildScrollableStyle=function(){return Object.assign({},{height:t.computedProps.containerHeight,overflowX:"hidden",overflowY:"scroll",WebkitOverflowScrolling:"touch"},t.computedProps.styles.scrollableStyle||{})}),i},recomputeInternalStateFromProps:function(e){checkProps(e);var t=this.generateComputedProps(e),i=this.generateComputedUtilityFunctions(e),o={};return o.numberOfChildren=React.Children.count(t.children),o.infiniteComputer=infiniteHelpers.createInfiniteComputer(t.elementHeight,t.children,t.displayBottomUpwards),void 0!==t.isInfiniteLoading&&(o.isInfiniteLoading=t.isInfiniteLoading),o.preloadBatchSize=t.preloadBatchSize,o.preloadAdditionalHeight=t.preloadAdditionalHeight,o=Object.assign(o,infiniteHelpers.recomputeApertureStateFromOptionsAndScrollTop(o,i.getScrollTop())),{computedProps:t,utils:i,newState:o}},componentWillReceiveProps:function(e){var t=this.recomputeInternalStateFromProps(e);this.computedProps=t.computedProps,this.utils=t.utils,this.setState(t.newState)},componentWillUpdate:function(){this.props.displayBottomUpwards&&(this.preservedScrollState=this.utils.getScrollTop()-this.loadingSpinnerHeight)},componentDidUpdate:function(e,t){if(this.loadingSpinnerHeight=this.utils.getLoadingSpinnerHeight(),this.props.displayBottomUpwards){var i=this.getLowestPossibleScrollTop();this.shouldAttachToBottom&&this.utils.getScrollTop()this.state.infiniteComputer.getTotalScrollableHeight()-this.computedProps.containerHeight-this.computedProps.infiniteLoadBeginEdgeOffset},onInfiniteLoad:function(){this.setState({isInfiniteLoading:!0}),this.computedProps.onInfiniteLoad()},handleScroll:function(e){this.shouldAttachToBottom=this.computedProps.displayBottomUpwards&&e>=this.getLowestPossibleScrollTop(),this.manageScrollTimeouts();var t=infiniteHelpers.recomputeApertureStateFromOptionsAndScrollTop(this.state,e);this.passedEdgeForInfiniteScroll(e)&&!this.state.isInfiniteLoading?(this.setState(Object.assign({},t)),this.onInfiniteLoad()):this.setState(t)},buildHeightStyle:function(e){return{width:"100%",height:Math.ceil(e)}},render:function(){var e,t=this;e=this.state.numberOfChildren>1?this.computedProps.children.slice(this.state.displayIndexStart,this.state.displayIndexEnd+1):this.computedProps.children;var i={};this.state.isScrolling&&(i.pointerEvents="none");var o=this.state.infiniteComputer.getTopSpacerHeight(this.state.displayIndexStart),n=this.state.infiniteComputer.getBottomSpacerHeight(this.state.displayIndexEnd);if(this.computedProps.displayBottomUpwards){var r=this.computedProps.containerHeight-this.state.infiniteComputer.getTotalScrollableHeight();r>0&&(o=r-this.loadingSpinnerHeight)}var s=void 0===this.computedProps.infiniteLoadBeginEdgeOffset?null:React.createElement("div",{ref:function(e){t.loadingSpinner=e}},this.state.isInfiniteLoading?this.computedProps.loadingSpinnerDelegate:null);return React.createElement("div",{className:this.computedProps.className,ref:function(e){t.scrollable=e},style:this.utils.buildScrollableStyle(),onScroll:this.utils.nodeScrollListener},React.createElement("div",{ref:function(e){t.smoothScrollingWrapper=e},style:i},React.createElement("div",{ref:function(e){t.topSpacer=e},style:this.buildHeightStyle(o)}),this.computedProps.displayBottomUpwards&&s,e,!this.computedProps.displayBottomUpwards&&s,React.createElement("div",{ref:function(e){t.bottomSpacer=e},style:this.buildHeightStyle(n)})))}});module.exports=Infinite,global.Infinite=Infinite; +"use strict";function _objectWithoutProperties(e,t){var i={};for(var o in e)t.indexOf(o)>=0||Object.prototype.hasOwnProperty.call(e,o)&&(i[o]=e[o]);return i}var React=global.React||require("react"),PropTypes=global.PropTypes||require("prop-types"),createReactClass=global.createReactClass||require("create-react-class"),window=require("./utils/window");require("./utils/establish-polyfills");var scaleEnum=require("./utils/scaleEnum"),infiniteHelpers=require("./utils/infiniteHelpers"),_isFinite=require("lodash.isfinite"),preloadType=require("./utils/types").preloadType,checkProps=checkProps=require("./utils/checkProps"),Infinite=createReactClass({propTypes:{children:PropTypes.any,handleScroll:PropTypes.func,preloadBatchSize:preloadType,preloadAdditionalHeight:preloadType,elementHeight:PropTypes.oneOfType([PropTypes.number,PropTypes.arrayOf(PropTypes.number)]).isRequired,containerHeight:PropTypes.number,useWindowAsScrollContainer:PropTypes.bool,displayBottomUpwards:PropTypes.bool.isRequired,infiniteLoadBeginEdgeOffset:PropTypes.number,onInfiniteLoad:PropTypes.func,loadingSpinnerDelegate:PropTypes.node,isInfiniteLoading:PropTypes.bool,timeScrollStateLastsForAfterUserScrolls:PropTypes.number,className:PropTypes.string,styles:PropTypes.shape({scrollableStyle:PropTypes.object}).isRequired},statics:{containerHeightScaleFactor:function(e){if(!_isFinite(e))throw new Error("The scale factor must be a number.");return{type:scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR,amount:e}}},computedProps:{},utils:{},shouldAttachToBottom:!1,preservedScrollState:0,loadingSpinnerHeight:0,deprecationWarned:!1,scrollable:null,topSpacer:null,bottomSpacer:null,smoothScrollingWrapper:null,loadingSpinner:null,getDefaultProps:function(){return{handleScroll:function(){},useWindowAsScrollContainer:!1,onInfiniteLoad:function(){},loadingSpinnerDelegate:React.createElement("div",null),displayBottomUpwards:!1,isInfiniteLoading:!1,timeScrollStateLastsForAfterUserScrolls:150,className:"",styles:{}}},getInitialState:function(){var e=this.recomputeInternalStateFromProps(this.props);this.computedProps=e.computedProps,this.utils=e.utils,this.shouldAttachToBottom=this.props.displayBottomUpwards;var t=e.newState;return t.scrollTimeout=void 0,t.isScrolling=!1,t},generateComputedProps:function(e){var t=e.containerHeight,i=e.preloadBatchSize,o=e.preloadAdditionalHeight,n=_objectWithoutProperties(e,["containerHeight","preloadBatchSize","preloadAdditionalHeight"]),r={};t="number"==typeof t?t:0,r.containerHeight=e.useWindowAsScrollContainer?window.innerHeight:t,void 0!==n.infiniteLoadBeginBottomOffset&&(r.infiniteLoadBeginEdgeOffset=n.infiniteLoadBeginBottomOffset,this.deprecationWarned||(console.error("Warning: React Infinite's infiniteLoadBeginBottomOffset prop\n has been deprecated as of 0.6.0. Please use infiniteLoadBeginEdgeOffset.\n Because this is a rather descriptive name, a simple find and replace\n should suffice."),this.deprecationWarned=!0));var s={type:scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR,amount:.5},l=i&&i.type?i:s;"number"==typeof i?r.preloadBatchSize=i:"object"==typeof l&&l.type===scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR?r.preloadBatchSize=r.containerHeight*l.amount:r.preloadBatchSize=0;var a={type:scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR,amount:1},c=o&&o.type?o:a;return"number"==typeof o?r.preloadAdditionalHeight=o:"object"==typeof c&&c.type===scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR?r.preloadAdditionalHeight=r.containerHeight*c.amount:r.preloadAdditionalHeight=0,Object.assign(n,r)},generateComputedUtilityFunctions:function(e){var t=this,i={};return i.getLoadingSpinnerHeight=function(){var e=0;return t.loadingSpinner&&(e=t.loadingSpinner.offsetHeight||0),e},e.useWindowAsScrollContainer?(i.subscribeToScrollListener=function(){window.addEventListener("scroll",t.infiniteHandleScroll)},i.unsubscribeFromScrollListener=function(){window.removeEventListener("scroll",t.infiniteHandleScroll)},i.nodeScrollListener=function(){},i.getScrollTop=function(){return window.pageYOffset},i.setScrollTop=function(e){window.scroll(window.pageXOffset,e)},i.scrollShouldBeIgnored=function(){return!1},i.buildScrollableStyle=function(){return{}}):(i.subscribeToScrollListener=function(){},i.unsubscribeFromScrollListener=function(){},i.nodeScrollListener=this.infiniteHandleScroll,i.getScrollTop=function(){return t.scrollable?t.scrollable.scrollTop:0},i.setScrollTop=function(e){t.scrollable&&(t.scrollable.scrollTop=e)},i.scrollShouldBeIgnored=function(e){return e.target!==t.scrollable},i.buildScrollableStyle=function(){return Object.assign({},{height:t.computedProps.containerHeight,overflowX:"hidden",overflowY:"scroll",WebkitOverflowScrolling:"touch"},t.computedProps.styles.scrollableStyle||{})}),i},recomputeInternalStateFromProps:function(e){checkProps(e);var t=this.generateComputedProps(e),i=this.generateComputedUtilityFunctions(e),o={};return o.numberOfChildren=React.Children.count(t.children),o.infiniteComputer=infiniteHelpers.createInfiniteComputer(t.elementHeight,t.children),void 0!==t.isInfiniteLoading&&(o.isInfiniteLoading=t.isInfiniteLoading),o.preloadBatchSize=t.preloadBatchSize,o.preloadAdditionalHeight=t.preloadAdditionalHeight,o=Object.assign(o,infiniteHelpers.recomputeApertureStateFromOptionsAndScrollTop(o,i.getScrollTop())),{computedProps:t,utils:i,newState:o}},componentWillReceiveProps:function(e){var t=this.recomputeInternalStateFromProps(e);this.computedProps=t.computedProps,this.utils=t.utils,this.setState(t.newState)},componentWillUpdate:function(){this.props.displayBottomUpwards&&(this.preservedScrollState=this.utils.getScrollTop()-this.loadingSpinnerHeight)},componentDidUpdate:function(e,t){if(this.loadingSpinnerHeight=this.utils.getLoadingSpinnerHeight(),this.props.displayBottomUpwards){var i=this.getLowestPossibleScrollTop();this.shouldAttachToBottom&&this.utils.getScrollTop()this.state.infiniteComputer.getTotalScrollableHeight()-this.computedProps.containerHeight-this.computedProps.infiniteLoadBeginEdgeOffset},onInfiniteLoad:function(){this.setState({isInfiniteLoading:!0}),this.computedProps.onInfiniteLoad()},handleScroll:function(e){this.shouldAttachToBottom=this.computedProps.displayBottomUpwards&&e>=this.getLowestPossibleScrollTop(),this.manageScrollTimeouts();var t=infiniteHelpers.recomputeApertureStateFromOptionsAndScrollTop(this.state,e);this.passedEdgeForInfiniteScroll(e)&&!this.state.isInfiniteLoading?(this.setState(Object.assign({},t)),this.onInfiniteLoad()):this.setState(t)},buildHeightStyle:function(e){return{width:"100%",height:Math.ceil(e)}},render:function(){var e,t=this;e=this.state.numberOfChildren>1?this.computedProps.children.slice(this.state.displayIndexStart,this.state.displayIndexEnd+1):this.computedProps.children;var i={};this.state.isScrolling&&(i.pointerEvents="none");var o=this.state.infiniteComputer.getTopSpacerHeight(this.state.displayIndexStart),n=this.state.infiniteComputer.getBottomSpacerHeight(this.state.displayIndexEnd);if(this.computedProps.displayBottomUpwards){var r=this.computedProps.containerHeight-this.state.infiniteComputer.getTotalScrollableHeight();r>0&&(o=r-this.loadingSpinnerHeight)}var s=void 0===this.computedProps.infiniteLoadBeginEdgeOffset?null:React.createElement("div",{ref:function(e){t.loadingSpinner=e}},this.state.isInfiniteLoading?this.computedProps.loadingSpinnerDelegate:null);return React.createElement("div",{className:this.computedProps.className,ref:function(e){t.scrollable=e},style:this.utils.buildScrollableStyle(),onScroll:this.utils.nodeScrollListener},React.createElement("div",{ref:function(e){t.smoothScrollingWrapper=e},style:i},React.createElement("div",{ref:function(e){t.topSpacer=e},style:this.buildHeightStyle(o)}),this.computedProps.displayBottomUpwards&&s,e,!this.computedProps.displayBottomUpwards&&s,React.createElement("div",{ref:function(e){t.bottomSpacer=e},style:this.buildHeightStyle(n)})))}});module.exports=Infinite,global.Infinite=Infinite; }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"./utils/checkProps":22,"./utils/establish-polyfills":23,"./utils/infiniteHelpers":24,"./utils/scaleEnum":25,"./utils/types":26,"create-react-class":3,"lodash.isfinite":10,"prop-types":16,"react":undefined}],2:[function(require,module,exports){ +},{"./utils/checkProps":22,"./utils/establish-polyfills":23,"./utils/infiniteHelpers":24,"./utils/scaleEnum":25,"./utils/types":26,"./utils/window":27,"create-react-class":3,"lodash.isfinite":10,"prop-types":16,"react":undefined}],2:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. @@ -2253,5 +2253,11 @@ module.exports = ReactPropTypesSecret; }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"prop-types":16}]},{},[1])(1) +},{"prop-types":16}],27:[function(require,module,exports){ +(function (global){ +"use strict";var win;win="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},module.exports=win; + + +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{}]},{},[1])(1) }); \ No newline at end of file diff --git a/dist/react-infinite.min.js b/dist/react-infinite.min.js index 5fea161..6c2af6f 100644 --- a/dist/react-infinite.min.js +++ b/dist/react-infinite.min.js @@ -1,2 +1,2 @@ -!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.Infinite=e()}}(function(){return function e(t,n,o){function r(a,s){if(!n[a]){if(!t[a]){var l="function"==typeof require&&require;if(!s&&l)return l(a,!0);if(i)return i(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var u=n[a]={exports:{}};t[a][0].call(u.exports,function(e){var n=t[a][1][e];return r(n?n:e)},u,u.exports,e,t,n,o)}return n[a].exports}for(var i="function"==typeof require&&require,a=0;a=0||Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]);return n}var r,i=n.React||e("react"),a=n.PropTypes||e("prop-types"),s=n.createReactClass||e("create-react-class");r=void 0!==l?l:"undefined"!=typeof n?n:"undefined"!=typeof self?self:{};var l=r;e("./utils/establish-polyfills");var c=e("./utils/scaleEnum"),u=e("./utils/infiniteHelpers"),p=e("lodash.isfinite"),f=e("./utils/types").preloadType,d=d=e("./utils/checkProps"),h=s({propTypes:{children:a.any,handleScroll:a.func,preloadBatchSize:f,preloadAdditionalHeight:f,elementHeight:a.oneOfType([a.number,a.arrayOf(a.number)]).isRequired,containerHeight:a.number,useWindowAsScrollContainer:a.bool,displayBottomUpwards:a.bool.isRequired,infiniteLoadBeginEdgeOffset:a.number,onInfiniteLoad:a.func,loadingSpinnerDelegate:a.node,isInfiniteLoading:a.bool,timeScrollStateLastsForAfterUserScrolls:a.number,className:a.string,styles:a.shape({scrollableStyle:a.object}).isRequired},statics:{containerHeightScaleFactor:function(e){if(!p(e))throw new Error("The scale factor must be a number.");return{type:c.CONTAINER_HEIGHT_SCALE_FACTOR,amount:e}}},computedProps:{},utils:{},shouldAttachToBottom:!1,preservedScrollState:0,loadingSpinnerHeight:0,deprecationWarned:!1,scrollable:null,topSpacer:null,bottomSpacer:null,smoothScrollingWrapper:null,loadingSpinner:null,getDefaultProps:function(){return{handleScroll:function(){},useWindowAsScrollContainer:!1,onInfiniteLoad:function(){},loadingSpinnerDelegate:i.createElement("div",null),displayBottomUpwards:!1,isInfiniteLoading:!1,timeScrollStateLastsForAfterUserScrolls:150,className:"",styles:{}}},getInitialState:function(){var e=this.recomputeInternalStateFromProps(this.props);this.computedProps=e.computedProps,this.utils=e.utils,this.shouldAttachToBottom=this.props.displayBottomUpwards;var t=e.newState;return t.scrollTimeout=void 0,t.isScrolling=!1,t},generateComputedProps:function(e){var t=e.containerHeight,n=e.preloadBatchSize,r=e.preloadAdditionalHeight,i=o(e,["containerHeight","preloadBatchSize","preloadAdditionalHeight"]),a={};t="number"==typeof t?t:0,a.containerHeight=e.useWindowAsScrollContainer?l.innerHeight:t,void 0!==i.infiniteLoadBeginBottomOffset&&(a.infiniteLoadBeginEdgeOffset=i.infiniteLoadBeginBottomOffset,this.deprecationWarned||(console.error("Warning: React Infinite's infiniteLoadBeginBottomOffset prop\n has been deprecated as of 0.6.0. Please use infiniteLoadBeginEdgeOffset.\n Because this is a rather descriptive name, a simple find and replace\n should suffice."),this.deprecationWarned=!0));var s={type:c.CONTAINER_HEIGHT_SCALE_FACTOR,amount:.5},u=n&&n.type?n:s;"number"==typeof n?a.preloadBatchSize=n:"object"==typeof u&&u.type===c.CONTAINER_HEIGHT_SCALE_FACTOR?a.preloadBatchSize=a.containerHeight*u.amount:a.preloadBatchSize=0;var p={type:c.CONTAINER_HEIGHT_SCALE_FACTOR,amount:1},f=r&&r.type?r:p;return"number"==typeof r?a.preloadAdditionalHeight=r:"object"==typeof f&&f.type===c.CONTAINER_HEIGHT_SCALE_FACTOR?a.preloadAdditionalHeight=a.containerHeight*f.amount:a.preloadAdditionalHeight=0,Object.assign(i,a)},generateComputedUtilityFunctions:function(e){var t=this,n={};return n.getLoadingSpinnerHeight=function(){var e=0;return t.loadingSpinner&&(e=t.loadingSpinner.offsetHeight||0),e},e.useWindowAsScrollContainer?(n.subscribeToScrollListener=function(){l.addEventListener("scroll",t.infiniteHandleScroll)},n.unsubscribeFromScrollListener=function(){l.removeEventListener("scroll",t.infiniteHandleScroll)},n.nodeScrollListener=function(){},n.getScrollTop=function(){return l.pageYOffset},n.setScrollTop=function(e){l.scroll(l.pageXOffset,e)},n.scrollShouldBeIgnored=function(){return!1},n.buildScrollableStyle=function(){return{}}):(n.subscribeToScrollListener=function(){},n.unsubscribeFromScrollListener=function(){},n.nodeScrollListener=this.infiniteHandleScroll,n.getScrollTop=function(){return t.scrollable?t.scrollable.scrollTop:0},n.setScrollTop=function(e){t.scrollable&&(t.scrollable.scrollTop=e)},n.scrollShouldBeIgnored=function(e){return e.target!==t.scrollable},n.buildScrollableStyle=function(){return Object.assign({},{height:t.computedProps.containerHeight,overflowX:"hidden",overflowY:"scroll",WebkitOverflowScrolling:"touch"},t.computedProps.styles.scrollableStyle||{})}),n},recomputeInternalStateFromProps:function(e){d(e);var t=this.generateComputedProps(e),n=this.generateComputedUtilityFunctions(e),o={};return o.numberOfChildren=i.Children.count(t.children),o.infiniteComputer=u.createInfiniteComputer(t.elementHeight,t.children,t.displayBottomUpwards),void 0!==t.isInfiniteLoading&&(o.isInfiniteLoading=t.isInfiniteLoading),o.preloadBatchSize=t.preloadBatchSize,o.preloadAdditionalHeight=t.preloadAdditionalHeight,o=Object.assign(o,u.recomputeApertureStateFromOptionsAndScrollTop(o,n.getScrollTop())),{computedProps:t,utils:n,newState:o}},componentWillReceiveProps:function(e){var t=this.recomputeInternalStateFromProps(e);this.computedProps=t.computedProps,this.utils=t.utils,this.setState(t.newState)},componentWillUpdate:function(){this.props.displayBottomUpwards&&(this.preservedScrollState=this.utils.getScrollTop()-this.loadingSpinnerHeight)},componentDidUpdate:function(e,t){if(this.loadingSpinnerHeight=this.utils.getLoadingSpinnerHeight(),this.props.displayBottomUpwards){var n=this.getLowestPossibleScrollTop();this.shouldAttachToBottom&&this.utils.getScrollTop()this.state.infiniteComputer.getTotalScrollableHeight()-this.computedProps.containerHeight-this.computedProps.infiniteLoadBeginEdgeOffset},onInfiniteLoad:function(){this.setState({isInfiniteLoading:!0}),this.computedProps.onInfiniteLoad()},handleScroll:function(e){this.shouldAttachToBottom=this.computedProps.displayBottomUpwards&&e>=this.getLowestPossibleScrollTop(),this.manageScrollTimeouts();var t=u.recomputeApertureStateFromOptionsAndScrollTop(this.state,e);this.passedEdgeForInfiniteScroll(e)&&!this.state.isInfiniteLoading?(this.setState(Object.assign({},t)),this.onInfiniteLoad()):this.setState(t)},buildHeightStyle:function(e){return{width:"100%",height:Math.ceil(e)}},render:function(){var e,t=this;e=this.state.numberOfChildren>1?this.computedProps.children.slice(this.state.displayIndexStart,this.state.displayIndexEnd+1):this.computedProps.children;var n={};this.state.isScrolling&&(n.pointerEvents="none");var o=this.state.infiniteComputer.getTopSpacerHeight(this.state.displayIndexStart),r=this.state.infiniteComputer.getBottomSpacerHeight(this.state.displayIndexEnd);if(this.computedProps.displayBottomUpwards){var a=this.computedProps.containerHeight-this.state.infiniteComputer.getTotalScrollableHeight();a>0&&(o=a-this.loadingSpinnerHeight)}var s=void 0===this.computedProps.infiniteLoadBeginEdgeOffset?null:i.createElement("div",{ref:function(e){t.loadingSpinner=e}},this.state.isInfiniteLoading?this.computedProps.loadingSpinnerDelegate:null);return i.createElement("div",{className:this.computedProps.className,ref:function(e){t.scrollable=e},style:this.utils.buildScrollableStyle(),onScroll:this.utils.nodeScrollListener},i.createElement("div",{ref:function(e){t.smoothScrollingWrapper=e},style:n},i.createElement("div",{ref:function(e){t.topSpacer=e},style:this.buildHeightStyle(o)}),this.computedProps.displayBottomUpwards&&s,e,!this.computedProps.displayBottomUpwards&&s,i.createElement("div",{ref:function(e){t.bottomSpacer=e},style:this.buildHeightStyle(r)})))}});t.exports=h,n.Infinite=h}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./utils/checkProps":22,"./utils/establish-polyfills":23,"./utils/infiniteHelpers":24,"./utils/scaleEnum":25,"./utils/types":26,"create-react-class":3,"lodash.isfinite":10,"prop-types":16,react:void 0}],2:[function(e,t,n){(function(n){"use strict";function o(e){return e}function r(e,t,r){function p(e,t,o){for(var r in t)t.hasOwnProperty(r)&&"production"!==n.env.NODE_ENV&&l("function"==typeof t[r],"%s: %s type `%s` is invalid; it must be a function, usually from React.PropTypes.",e.displayName||"ReactClass",c[o],r)}function f(e,t){var n=O.hasOwnProperty(t)?O[t]:null;I.hasOwnProperty(t)&&s("OVERRIDE_BASE"===n,"ReactClassInterface: You are attempting to override `%s` from your class specification. Ensure that your method names do not overlap with React methods.",t),e&&s("DEFINE_MANY"===n||"DEFINE_MANY_MERGED"===n,"ReactClassInterface: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",t)}function d(e,o){if(o){s("function"!=typeof o,"ReactClass: You're attempting to use a component class or function as a mixin. Instead, just use a regular object."),s(!t(o),"ReactClass: You're attempting to use a component as a mixin. Instead, just use a regular object.");var r=e.prototype,i=r.__reactAutoBindPairs;o.hasOwnProperty(u)&&w.mixins(e,o.mixins);for(var a in o)if(o.hasOwnProperty(a)&&a!==u){var c=o[a],p=r.hasOwnProperty(a);if(f(p,a),w.hasOwnProperty(a))w[a](e,c);else{var d=O.hasOwnProperty(a),h="function"==typeof c,y=h&&!d&&!p&&o.autobind!==!1;if(y)i.push(a,c),r[a]=c;else if(p){var b=O[a];s(d&&("DEFINE_MANY_MERGED"===b||"DEFINE_MANY"===b),"ReactClass: Unexpected spec policy %s for key %s when mixing in component specs.",b,a),"DEFINE_MANY_MERGED"===b?r[a]=m(r[a],c):"DEFINE_MANY"===b&&(r[a]=g(r[a],c))}else r[a]=c,"production"!==n.env.NODE_ENV&&"function"==typeof c&&o.displayName&&(r[a].displayName=o.displayName+"_"+a)}}}else if("production"!==n.env.NODE_ENV){var v=typeof o,S="object"===v&&null!==o;"production"!==n.env.NODE_ENV&&l(S,"%s: You're attempting to include a mixin that is either null or not an object. Check the mixins included by the component, as well as any mixins they include themselves. Expected object but got %s.",e.displayName||"ReactClass",null===o?null:v)}}function h(e,t){if(t)for(var n in t){var o=t[n];if(t.hasOwnProperty(n)){var r=n in w;s(!r,'ReactClass: You are attempting to define a reserved property, `%s`, that shouldn\'t be on the "statics" key. Define it as an instance property instead; it will still be accessible on the constructor.',n);var i=n in e;s(!i,"ReactClass: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",n),e[n]=o}}}function y(e,t){s(e&&t&&"object"==typeof e&&"object"==typeof t,"mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.");for(var n in t)t.hasOwnProperty(n)&&(s(void 0===e[n],"mergeIntoWithNoDuplicateKeys(): Tried to merge two objects with the same key: `%s`. This conflict may be due to a mixin; in particular, this may be caused by two getInitialState() or getDefaultProps() methods returning objects with clashing keys.",n),e[n]=t[n]);return e}function m(e,t){return function(){var n=e.apply(this,arguments),o=t.apply(this,arguments);if(null==n)return o;if(null==o)return n;var r={};return y(r,n),y(r,o),r}}function g(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function b(e,t){var o=t.bind(e);if("production"!==n.env.NODE_ENV){o.__reactBoundContext=e,o.__reactBoundMethod=t,o.__reactBoundArguments=null;var r=e.constructor.displayName,i=o.bind;o.bind=function(a){for(var s=arguments.length,c=Array(s>1?s-1:0),u=1;u1?t-1:0),o=1;o2?n-2:0),r=2;r-1&&e%1==0&&e<=b}function a(e){return s(e)&&y.call(e)==u}function s(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function l(e){return null!=e&&(a(e)?m.test(d.call(e)):o(e)&&p.test(e))}var c="[object Array]",u="[object Function]",p=/^\[object .+?Constructor\]$/,f=Object.prototype,d=Function.prototype.toString,h=f.hasOwnProperty,y=f.toString,m=RegExp("^"+d.call(h).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),g=r(Array,"isArray"),b=9007199254740991,v=g||function(e){return o(e)&&i(e.length)&&y.call(e)==c};t.exports=v},{}],10:[function(e,t,n){(function(e){function n(e){return"number"==typeof e&&o(e)}var o=e.isFinite;t.exports=n}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],11:[function(e,t,n){"use strict";function o(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}var r=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;t.exports=Object.assign||function(e,t){for(var n,a,s=o(e),l=1;l0?t-1:t}},{key:"getTopSpacerHeight",value:function(e){return e*this.heightData}},{key:"getBottomSpacerHeight",value:function(e){var t=e+1;return Math.max(0,(this.numberOfChildren-t)*this.heightData)}}]),t}(s);t.exports=l},{"./infiniteComputer.js":20}],20:[function(e,t,n){"use strict";function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var r=function(){function e(e,t){for(var n=0;nt&&(s=i-1)}return n===o.CLOSEST_LOWER&&l>0?r=l-1:n===o.CLOSEST_HIGHER&&s=0||Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]);return n}var r=n.React||e("react"),i=n.PropTypes||e("prop-types"),a=n.createReactClass||e("create-react-class"),s=e("./utils/window");e("./utils/establish-polyfills");var l=e("./utils/scaleEnum"),c=e("./utils/infiniteHelpers"),u=e("lodash.isfinite"),p=e("./utils/types").preloadType,f=f=e("./utils/checkProps"),d=a({propTypes:{children:i.any,handleScroll:i.func,preloadBatchSize:p,preloadAdditionalHeight:p,elementHeight:i.oneOfType([i.number,i.arrayOf(i.number)]).isRequired,containerHeight:i.number,useWindowAsScrollContainer:i.bool,displayBottomUpwards:i.bool.isRequired,infiniteLoadBeginEdgeOffset:i.number,onInfiniteLoad:i.func,loadingSpinnerDelegate:i.node,isInfiniteLoading:i.bool,timeScrollStateLastsForAfterUserScrolls:i.number,className:i.string,styles:i.shape({scrollableStyle:i.object}).isRequired},statics:{containerHeightScaleFactor:function(e){if(!u(e))throw new Error("The scale factor must be a number.");return{type:l.CONTAINER_HEIGHT_SCALE_FACTOR,amount:e}}},computedProps:{},utils:{},shouldAttachToBottom:!1,preservedScrollState:0,loadingSpinnerHeight:0,deprecationWarned:!1,scrollable:null,topSpacer:null,bottomSpacer:null,smoothScrollingWrapper:null,loadingSpinner:null,getDefaultProps:function(){return{handleScroll:function(){},useWindowAsScrollContainer:!1,onInfiniteLoad:function(){},loadingSpinnerDelegate:r.createElement("div",null),displayBottomUpwards:!1,isInfiniteLoading:!1,timeScrollStateLastsForAfterUserScrolls:150,className:"",styles:{}}},getInitialState:function(){var e=this.recomputeInternalStateFromProps(this.props);this.computedProps=e.computedProps,this.utils=e.utils,this.shouldAttachToBottom=this.props.displayBottomUpwards;var t=e.newState;return t.scrollTimeout=void 0,t.isScrolling=!1,t},generateComputedProps:function(e){var t=e.containerHeight,n=e.preloadBatchSize,r=e.preloadAdditionalHeight,i=o(e,["containerHeight","preloadBatchSize","preloadAdditionalHeight"]),a={};t="number"==typeof t?t:0,a.containerHeight=e.useWindowAsScrollContainer?s.innerHeight:t,void 0!==i.infiniteLoadBeginBottomOffset&&(a.infiniteLoadBeginEdgeOffset=i.infiniteLoadBeginBottomOffset,this.deprecationWarned||(console.error("Warning: React Infinite's infiniteLoadBeginBottomOffset prop\n has been deprecated as of 0.6.0. Please use infiniteLoadBeginEdgeOffset.\n Because this is a rather descriptive name, a simple find and replace\n should suffice."),this.deprecationWarned=!0));var c={type:l.CONTAINER_HEIGHT_SCALE_FACTOR,amount:.5},u=n&&n.type?n:c;"number"==typeof n?a.preloadBatchSize=n:"object"==typeof u&&u.type===l.CONTAINER_HEIGHT_SCALE_FACTOR?a.preloadBatchSize=a.containerHeight*u.amount:a.preloadBatchSize=0;var p={type:l.CONTAINER_HEIGHT_SCALE_FACTOR,amount:1},f=r&&r.type?r:p;return"number"==typeof r?a.preloadAdditionalHeight=r:"object"==typeof f&&f.type===l.CONTAINER_HEIGHT_SCALE_FACTOR?a.preloadAdditionalHeight=a.containerHeight*f.amount:a.preloadAdditionalHeight=0,Object.assign(i,a)},generateComputedUtilityFunctions:function(e){var t=this,n={};return n.getLoadingSpinnerHeight=function(){var e=0;return t.loadingSpinner&&(e=t.loadingSpinner.offsetHeight||0),e},e.useWindowAsScrollContainer?(n.subscribeToScrollListener=function(){s.addEventListener("scroll",t.infiniteHandleScroll)},n.unsubscribeFromScrollListener=function(){s.removeEventListener("scroll",t.infiniteHandleScroll)},n.nodeScrollListener=function(){},n.getScrollTop=function(){return s.pageYOffset},n.setScrollTop=function(e){s.scroll(s.pageXOffset,e)},n.scrollShouldBeIgnored=function(){return!1},n.buildScrollableStyle=function(){return{}}):(n.subscribeToScrollListener=function(){},n.unsubscribeFromScrollListener=function(){},n.nodeScrollListener=this.infiniteHandleScroll,n.getScrollTop=function(){return t.scrollable?t.scrollable.scrollTop:0},n.setScrollTop=function(e){t.scrollable&&(t.scrollable.scrollTop=e)},n.scrollShouldBeIgnored=function(e){return e.target!==t.scrollable},n.buildScrollableStyle=function(){return Object.assign({},{height:t.computedProps.containerHeight,overflowX:"hidden",overflowY:"scroll",WebkitOverflowScrolling:"touch"},t.computedProps.styles.scrollableStyle||{})}),n},recomputeInternalStateFromProps:function(e){f(e);var t=this.generateComputedProps(e),n=this.generateComputedUtilityFunctions(e),o={};return o.numberOfChildren=r.Children.count(t.children),o.infiniteComputer=c.createInfiniteComputer(t.elementHeight,t.children),void 0!==t.isInfiniteLoading&&(o.isInfiniteLoading=t.isInfiniteLoading),o.preloadBatchSize=t.preloadBatchSize,o.preloadAdditionalHeight=t.preloadAdditionalHeight,o=Object.assign(o,c.recomputeApertureStateFromOptionsAndScrollTop(o,n.getScrollTop())),{computedProps:t,utils:n,newState:o}},componentWillReceiveProps:function(e){var t=this.recomputeInternalStateFromProps(e);this.computedProps=t.computedProps,this.utils=t.utils,this.setState(t.newState)},componentWillUpdate:function(){this.props.displayBottomUpwards&&(this.preservedScrollState=this.utils.getScrollTop()-this.loadingSpinnerHeight)},componentDidUpdate:function(e,t){if(this.loadingSpinnerHeight=this.utils.getLoadingSpinnerHeight(),this.props.displayBottomUpwards){var n=this.getLowestPossibleScrollTop();this.shouldAttachToBottom&&this.utils.getScrollTop()this.state.infiniteComputer.getTotalScrollableHeight()-this.computedProps.containerHeight-this.computedProps.infiniteLoadBeginEdgeOffset},onInfiniteLoad:function(){this.setState({isInfiniteLoading:!0}),this.computedProps.onInfiniteLoad()},handleScroll:function(e){this.shouldAttachToBottom=this.computedProps.displayBottomUpwards&&e>=this.getLowestPossibleScrollTop(),this.manageScrollTimeouts();var t=c.recomputeApertureStateFromOptionsAndScrollTop(this.state,e);this.passedEdgeForInfiniteScroll(e)&&!this.state.isInfiniteLoading?(this.setState(Object.assign({},t)),this.onInfiniteLoad()):this.setState(t)},buildHeightStyle:function(e){return{width:"100%",height:Math.ceil(e)}},render:function(){var e,t=this;e=this.state.numberOfChildren>1?this.computedProps.children.slice(this.state.displayIndexStart,this.state.displayIndexEnd+1):this.computedProps.children;var n={};this.state.isScrolling&&(n.pointerEvents="none");var o=this.state.infiniteComputer.getTopSpacerHeight(this.state.displayIndexStart),i=this.state.infiniteComputer.getBottomSpacerHeight(this.state.displayIndexEnd);if(this.computedProps.displayBottomUpwards){var a=this.computedProps.containerHeight-this.state.infiniteComputer.getTotalScrollableHeight();a>0&&(o=a-this.loadingSpinnerHeight)}var s=void 0===this.computedProps.infiniteLoadBeginEdgeOffset?null:r.createElement("div",{ref:function(e){t.loadingSpinner=e}},this.state.isInfiniteLoading?this.computedProps.loadingSpinnerDelegate:null);return r.createElement("div",{className:this.computedProps.className,ref:function(e){t.scrollable=e},style:this.utils.buildScrollableStyle(),onScroll:this.utils.nodeScrollListener},r.createElement("div",{ref:function(e){t.smoothScrollingWrapper=e},style:n},r.createElement("div",{ref:function(e){t.topSpacer=e},style:this.buildHeightStyle(o)}),this.computedProps.displayBottomUpwards&&s,e,!this.computedProps.displayBottomUpwards&&s,r.createElement("div",{ref:function(e){t.bottomSpacer=e},style:this.buildHeightStyle(i)})))}});t.exports=d,n.Infinite=d}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./utils/checkProps":22,"./utils/establish-polyfills":23,"./utils/infiniteHelpers":24,"./utils/scaleEnum":25,"./utils/types":26,"./utils/window":27,"create-react-class":3,"lodash.isfinite":10,"prop-types":16,react:void 0}],2:[function(e,t,n){(function(n){"use strict";function o(e){return e}function r(e,t,r){function p(e,t,o){for(var r in t)t.hasOwnProperty(r)&&"production"!==n.env.NODE_ENV&&l("function"==typeof t[r],"%s: %s type `%s` is invalid; it must be a function, usually from React.PropTypes.",e.displayName||"ReactClass",c[o],r)}function f(e,t){var n=O.hasOwnProperty(t)?O[t]:null;I.hasOwnProperty(t)&&s("OVERRIDE_BASE"===n,"ReactClassInterface: You are attempting to override `%s` from your class specification. Ensure that your method names do not overlap with React methods.",t),e&&s("DEFINE_MANY"===n||"DEFINE_MANY_MERGED"===n,"ReactClassInterface: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",t)}function d(e,o){if(o){s("function"!=typeof o,"ReactClass: You're attempting to use a component class or function as a mixin. Instead, just use a regular object."),s(!t(o),"ReactClass: You're attempting to use a component as a mixin. Instead, just use a regular object.");var r=e.prototype,i=r.__reactAutoBindPairs;o.hasOwnProperty(u)&&w.mixins(e,o.mixins);for(var a in o)if(o.hasOwnProperty(a)&&a!==u){var c=o[a],p=r.hasOwnProperty(a);if(f(p,a),w.hasOwnProperty(a))w[a](e,c);else{var d=O.hasOwnProperty(a),h="function"==typeof c,y=h&&!d&&!p&&o.autobind!==!1;if(y)i.push(a,c),r[a]=c;else if(p){var b=O[a];s(d&&("DEFINE_MANY_MERGED"===b||"DEFINE_MANY"===b),"ReactClass: Unexpected spec policy %s for key %s when mixing in component specs.",b,a),"DEFINE_MANY_MERGED"===b?r[a]=m(r[a],c):"DEFINE_MANY"===b&&(r[a]=g(r[a],c))}else r[a]=c,"production"!==n.env.NODE_ENV&&"function"==typeof c&&o.displayName&&(r[a].displayName=o.displayName+"_"+a)}}}else if("production"!==n.env.NODE_ENV){var v=typeof o,S="object"===v&&null!==o;"production"!==n.env.NODE_ENV&&l(S,"%s: You're attempting to include a mixin that is either null or not an object. Check the mixins included by the component, as well as any mixins they include themselves. Expected object but got %s.",e.displayName||"ReactClass",null===o?null:v)}}function h(e,t){if(t)for(var n in t){var o=t[n];if(t.hasOwnProperty(n)){var r=n in w;s(!r,'ReactClass: You are attempting to define a reserved property, `%s`, that shouldn\'t be on the "statics" key. Define it as an instance property instead; it will still be accessible on the constructor.',n);var i=n in e;s(!i,"ReactClass: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",n),e[n]=o}}}function y(e,t){s(e&&t&&"object"==typeof e&&"object"==typeof t,"mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.");for(var n in t)t.hasOwnProperty(n)&&(s(void 0===e[n],"mergeIntoWithNoDuplicateKeys(): Tried to merge two objects with the same key: `%s`. This conflict may be due to a mixin; in particular, this may be caused by two getInitialState() or getDefaultProps() methods returning objects with clashing keys.",n),e[n]=t[n]);return e}function m(e,t){return function(){var n=e.apply(this,arguments),o=t.apply(this,arguments);if(null==n)return o;if(null==o)return n;var r={};return y(r,n),y(r,o),r}}function g(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function b(e,t){var o=t.bind(e);if("production"!==n.env.NODE_ENV){o.__reactBoundContext=e,o.__reactBoundMethod=t,o.__reactBoundArguments=null;var r=e.constructor.displayName,i=o.bind;o.bind=function(a){for(var s=arguments.length,c=Array(s>1?s-1:0),u=1;u1?t-1:0),o=1;o2?n-2:0),r=2;r-1&&e%1==0&&e<=b}function a(e){return s(e)&&y.call(e)==u}function s(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function l(e){return null!=e&&(a(e)?m.test(d.call(e)):o(e)&&p.test(e))}var c="[object Array]",u="[object Function]",p=/^\[object .+?Constructor\]$/,f=Object.prototype,d=Function.prototype.toString,h=f.hasOwnProperty,y=f.toString,m=RegExp("^"+d.call(h).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),g=r(Array,"isArray"),b=9007199254740991,v=g||function(e){return o(e)&&i(e.length)&&y.call(e)==c};t.exports=v},{}],10:[function(e,t,n){(function(e){function n(e){return"number"==typeof e&&o(e)}var o=e.isFinite;t.exports=n}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],11:[function(e,t,n){"use strict";function o(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}var r=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;t.exports=Object.assign||function(e,t){for(var n,a,s=o(e),l=1;l0?t-1:t}},{key:"getTopSpacerHeight",value:function(e){return e*this.heightData}},{key:"getBottomSpacerHeight",value:function(e){var t=e+1;return Math.max(0,(this.numberOfChildren-t)*this.heightData)}}]),t}(s);t.exports=l},{"./infiniteComputer.js":20}],20:[function(e,t,n){"use strict";function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var r=function(){function e(e,t){for(var n=0;nt&&(s=i-1)}return n===o.CLOSEST_LOWER&&l>0?r=l-1:n===o.CLOSEST_HIGHER&&s Date: Thu, 3 Aug 2017 17:59:23 -0400 Subject: [PATCH 34/78] 0.11.2 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 1084994..f93e75c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-infinite", - "version": "0.11.1", + "version": "0.11.2", "description": "A browser-ready efficient scrolling container based on UITableView", "main": "build/react-infinite.js", "repository": { From 963d01525f8152954a4c41e9bc9c0adbc54652da Mon Sep 17 00:00:00 2001 From: Gareth Tan Date: Fri, 4 Aug 2017 00:21:16 -0400 Subject: [PATCH 35/78] Refactor methods into functions. --- src/react-infinite.jsx | 71 ++---------------------------------- src/utils/infiniteHelpers.js | 59 +++++++++++++++++++++++++++++- 2 files changed, 61 insertions(+), 69 deletions(-) diff --git a/src/react-infinite.jsx b/src/react-infinite.jsx index d2c3109..e1e2729 100644 --- a/src/react-infinite.jsx +++ b/src/react-infinite.jsx @@ -1,6 +1,5 @@ /* @flow */ - var React = global.React || require('react'); var PropTypes = global.PropTypes || require('prop-types'); var createReactClass = global.createReactClass || require('create-react-class'); @@ -125,63 +124,6 @@ var Infinite = createReactClass({ return state; }, - generateComputedProps(props: ReactInfiniteProps): ReactInfiniteComputedProps { - // These are extracted so their type definitions do not conflict. - var {containerHeight, - preloadBatchSize, - preloadAdditionalHeight, - ...oldProps} = props; - - var newProps = {}; - containerHeight = typeof containerHeight === 'number' ? containerHeight : 0; - newProps.containerHeight = props.useWindowAsScrollContainer - ? window.innerHeight : containerHeight; - - if (oldProps.infiniteLoadBeginBottomOffset !== undefined) { - newProps.infiniteLoadBeginEdgeOffset = oldProps.infiniteLoadBeginBottomOffset; - if (!this.deprecationWarned) { - console.error(`Warning: React Infinite's infiniteLoadBeginBottomOffset prop - has been deprecated as of 0.6.0. Please use infiniteLoadBeginEdgeOffset. - Because this is a rather descriptive name, a simple find and replace - should suffice.`); - this.deprecationWarned = true; - } - } - - var defaultPreloadBatchSizeScaling = { - type: scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR, - amount: 0.5 - }; - var batchSize = preloadBatchSize && preloadBatchSize.type - ? preloadBatchSize - : defaultPreloadBatchSizeScaling; - - if (typeof preloadBatchSize === 'number') { - newProps.preloadBatchSize = preloadBatchSize; - } else if (typeof batchSize === 'object' && batchSize.type === scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR) { - newProps.preloadBatchSize = newProps.containerHeight * batchSize.amount; - } else { - newProps.preloadBatchSize = 0; - } - - var defaultPreloadAdditionalHeightScaling = { - type: scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR, - amount: 1 - }; - var additionalHeight = preloadAdditionalHeight && preloadAdditionalHeight.type - ? preloadAdditionalHeight - : defaultPreloadAdditionalHeightScaling; - if (typeof preloadAdditionalHeight === 'number') { - newProps.preloadAdditionalHeight = preloadAdditionalHeight; - } else if (typeof additionalHeight === 'object' && additionalHeight.type === scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR) { - newProps.preloadAdditionalHeight = newProps.containerHeight * additionalHeight.amount; - } else { - newProps.preloadAdditionalHeight = 0; - } - - return Object.assign(oldProps, newProps); - }, - generateComputedUtilityFunctions(props: ReactInfiniteProps): ReactInfiniteUtilityFunctions { var utilities = {}; utilities.getLoadingSpinnerHeight = () => { @@ -238,7 +180,7 @@ var Infinite = createReactClass({ newState: ReactInfiniteState } { checkProps(props); - var computedProps: ReactInfiniteComputedProps = this.generateComputedProps(props); + var computedProps: ReactInfiniteComputedProps = infiniteHelpers.generateComputedProps(props); var utils: ReactInfiniteUtilityFunctions = this.generateComputedUtilityFunctions(props); var newState = {}; @@ -403,13 +345,6 @@ var Infinite = createReactClass({ } }, - buildHeightStyle(height: number): CSSStyle { - return { - width: '100%', - height: Math.ceil(height) - }; - }, - render() { var displayables; if (this.state.numberOfChildren > 1) { @@ -450,12 +385,12 @@ var Infinite = createReactClass({ onScroll={this.utils.nodeScrollListener}>
{ this.smoothScrollingWrapper = c; }} style={infiniteScrollStyles}>
{ this.topSpacer = c; }} - style={this.buildHeightStyle(topSpacerHeight)}/> + style={infiniteHelpers.buildHeightStyle(topSpacerHeight)}/> {this.computedProps.displayBottomUpwards && loadingSpinner} {displayables} {!this.computedProps.displayBottomUpwards && loadingSpinner}
{ this.bottomSpacer = c; }} - style={this.buildHeightStyle(bottomSpacerHeight)}/> + style={infiniteHelpers.buildHeightStyle(bottomSpacerHeight)}/>
; } diff --git a/src/utils/infiniteHelpers.js b/src/utils/infiniteHelpers.js index 3d9e8bf..7c3c6d6 100644 --- a/src/utils/infiniteHelpers.js +++ b/src/utils/infiniteHelpers.js @@ -2,7 +2,9 @@ var ConstantInfiniteComputer = require('../computers/constantInfiniteComputer.js'); var ArrayInfiniteComputer = require('../computers/arrayInfiniteComputer.js'); +var scaleEnum = require('./scaleEnum'); var React = global.React || require('react'); +var window = require('./window'); function createInfiniteComputer(data: ElementHeight, children: any): InfiniteComputer { @@ -48,7 +50,62 @@ function recomputeApertureStateFromOptionsAndScrollTop({ }; } +function generateComputedProps(props: ReactInfiniteProps): ReactInfiniteComputedProps { + // These are extracted so their type definitions do not conflict. + var {containerHeight, + preloadBatchSize, + preloadAdditionalHeight, + ...oldProps} = props; + + var newProps = {}; + containerHeight = typeof containerHeight === 'number' ? containerHeight : 0; + newProps.containerHeight = props.useWindowAsScrollContainer + ? window.innerHeight : containerHeight; + + var defaultPreloadBatchSizeScaling = { + type: scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR, + amount: 0.5 + }; + var batchSize = preloadBatchSize && preloadBatchSize.type + ? preloadBatchSize + : defaultPreloadBatchSizeScaling; + + if (typeof preloadBatchSize === 'number') { + newProps.preloadBatchSize = preloadBatchSize; + } else if (typeof batchSize === 'object' && batchSize.type === scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR) { + newProps.preloadBatchSize = newProps.containerHeight * batchSize.amount; + } else { + newProps.preloadBatchSize = 0; + } + + var defaultPreloadAdditionalHeightScaling = { + type: scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR, + amount: 1 + }; + var additionalHeight = preloadAdditionalHeight && preloadAdditionalHeight.type + ? preloadAdditionalHeight + : defaultPreloadAdditionalHeightScaling; + if (typeof preloadAdditionalHeight === 'number') { + newProps.preloadAdditionalHeight = preloadAdditionalHeight; + } else if (typeof additionalHeight === 'object' && additionalHeight.type === scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR) { + newProps.preloadAdditionalHeight = newProps.containerHeight * additionalHeight.amount; + } else { + newProps.preloadAdditionalHeight = 0; + } + + return Object.assign(oldProps, newProps); +} + +function buildHeightStyle(height: number): CSSStyle { + return { + width: '100%', + height: Math.ceil(height) + }; +} + module.exports = { createInfiniteComputer, - recomputeApertureStateFromOptionsAndScrollTop + recomputeApertureStateFromOptionsAndScrollTop, + generateComputedProps, + buildHeightStyle }; From c0f276012cacd1d36e4afe90bc8f21608766606c Mon Sep 17 00:00:00 2001 From: Gareth Tan Date: Fri, 4 Aug 2017 00:26:24 -0400 Subject: [PATCH 36/78] Remove annotation. --- src/react-infinite.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/react-infinite.jsx b/src/react-infinite.jsx index e1e2729..0f846aa 100644 --- a/src/react-infinite.jsx +++ b/src/react-infinite.jsx @@ -180,7 +180,7 @@ var Infinite = createReactClass({ newState: ReactInfiniteState } { checkProps(props); - var computedProps: ReactInfiniteComputedProps = infiniteHelpers.generateComputedProps(props); + var computedProps = infiniteHelpers.generateComputedProps(props); var utils: ReactInfiniteUtilityFunctions = this.generateComputedUtilityFunctions(props); var newState = {}; From 4194edb27812b44c7711d588bc78a314ce005d34 Mon Sep 17 00:00:00 2001 From: Gareth Tan Date: Fri, 4 Aug 2017 00:30:17 -0400 Subject: [PATCH 37/78] Finally remove deprecated prop. --- README.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/README.md b/README.md index e24109a..0b72ad4 100644 --- a/README.md +++ b/README.md @@ -124,9 +124,6 @@ When working with the window as the scroll container, it is sometimes useful to #### **Function** `handleScroll(DOMNode node)` Defaults to `function(){}`. A function that is called when the container is scrolled, i.e. when the `onScroll` event of the infinite scrolling container is fired. The only argument passed to it is the native DOM [Node](https://developer.mozilla.org/en-US/docs/Web/API/Node) of the scrolling container. -#### **Number** `infiniteLoadBeginBottomOffset` -**Deprecated as of 0.6.0. Please use `infiniteLoadBeginEdgeOffset`, which is identical but renamed.** - #### **Number** `infiniteLoadBeginEdgeOffset` Defaults to `undefined`, which means that infinite loading is disabled. To disable infinite loading, do not provide this property or set it to undefined. From 4ae144872d9867fe22fb4284ced8782a74cdc4f4 Mon Sep 17 00:00:00 2001 From: Gareth Tan Date: Fri, 4 Aug 2017 02:15:13 -0400 Subject: [PATCH 38/78] Continue upgrading to Jest 20. --- __tests__/__snapshots__/infinite_test.js.snap | 865 ++++++++++++++++++ __tests__/infinite_test.js | 194 +--- package.json | 2 +- 3 files changed, 909 insertions(+), 152 deletions(-) create mode 100644 __tests__/__snapshots__/infinite_test.js.snap diff --git a/__tests__/__snapshots__/infinite_test.js.snap b/__tests__/__snapshots__/infinite_test.js.snap new file mode 100644 index 0000000..ab183de --- /dev/null +++ b/__tests__/__snapshots__/infinite_test.js.snap @@ -0,0 +1,865 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`The Behavior of the Variable Height React Infinite Component hides elements when the user has not yet scrolled 1`] = ` +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+`; + +exports[`The Behavior of the Variable Height React Infinite Component hides visible elements when the user scrolls sufficiently 1`] = ` +} + onInfiniteLoad={[Function]} + styles={Object {}} + timeScrollStateLastsForAfterUserScrolls={150} + useWindowAsScrollContainer={false} +> +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +`; + +exports[`The Children of the React Infinite Component renders its children when no hiding behavior is required 1`] = ` +
+
+
+
+
+
+
+
+`; + +exports[`The Children of the React Infinite Component renders its children when some DOM nodes are hidden 1`] = ` +
+
+
+
+
+
+
+
+
+
+
+
+`; + +exports[`The Children of the React Infinite Component renders more children when preloadAdditionalHeight is increased beyond its default 1`] = ` +
+
+
+
+
+
+
+
+
+
+
+
+
+`; + +exports[`The Children of the React Infinite Component renders more children when preloadBatchSize is increased beyond its default 1`] = ` +
+
+
+
+
+
+
+
+
+
+
+
+
+
+`; + +exports[`The Scrolling Behavior of the Constant Height React Infinite Component functions correctly at the end of its range 1`] = ` +} + onInfiniteLoad={[Function]} + styles={Object {}} + timeScrollStateLastsForAfterUserScrolls={150} + useWindowAsScrollContainer={false} +> +
+
+
+
+
+
+
+
+
+
+
+
+ +`; + +exports[`The Scrolling Behavior of the Constant Height React Infinite Component hides visible elements when the user scrolls sufficiently 1`] = ` +} + onInfiniteLoad={[Function]} + styles={Object {}} + timeScrollStateLastsForAfterUserScrolls={150} + useWindowAsScrollContainer={false} +> +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +`; diff --git a/__tests__/infinite_test.js b/__tests__/infinite_test.js index 207dbe0..b0e0259 100644 --- a/__tests__/infinite_test.js +++ b/__tests__/infinite_test.js @@ -11,12 +11,19 @@ jest.dontMock('../src/utils/window.js'); jest.dontMock('lodash.isfinite'); jest.dontMock('lodash.isarray'); jest.dontMock('react-dom'); +jest.dontMock('react-test-renderer'); +jest.dontMock('enzyme'); +jest.dontMock('enzyme-to-json'); var React = require('react'); var createReactClass = require('create-react-class'); +var renderer = require('react-test-renderer'); var ReactDOM = require('react-dom'); +var enzyme = require('enzyme'); var TestUtils = require('react-dom/test-utils'); var Infinite = require('../src/react-infinite.jsx'); +var toJson = require('enzyme-to-json'); + var renderHelpers = require('./helpers/renderHelpers'); @@ -87,7 +94,7 @@ describe('Rendering the React Infinite Component Wrapper', function() { describe('The Children of the React Infinite Component', function() { it('renders its children when no hiding behavior is required', function() { - var rootNode = TestUtils.renderIntoDocument( + const rootNode = renderer.create( @@ -96,16 +103,13 @@ describe('The Children of the React Infinite Component', function() { ); - expect(rootNode.topSpacer._style._values.height).toEqual('0px'); - expect(rootNode.bottomSpacer._style._values.height).toEqual('0px'); - - expect(TestUtils.findRenderedDOMComponentWithClass(rootNode, 'test-div-0')).not.toBeUndefined(); - expect(TestUtils.findRenderedDOMComponentWithClass(rootNode, 'test-div-1')).not.toBeUndefined(); + const tree = rootNode.toJSON(); + expect(tree).toMatchSnapshot(); }); it('renders its children when some DOM nodes are hidden', function() { - var elementHeight = 200; - var rootNode = TestUtils.renderIntoDocument( + const elementHeight = 200; + const rootNode = renderer.create( @@ -113,9 +117,6 @@ describe('The Children of the React Infinite Component', function() { ); - expect(rootNode.topSpacer._style._values.height).toEqual('0px'); - expect(rootNode.bottomSpacer._style._values.height).toEqual('800px'); - // Why are six nodes rendered? Since we have not scrolled at // all, the extent that React Infinite will render is // preloadBatchSize + preloadAdditionalHeight below the container. @@ -124,22 +125,13 @@ describe('The Children of the React Infinite Component', function() { // preloadAdditionalHeight defaults to the containerHeight, 800 pixels // // Their sum is 1200 pixels, or 6 200-pixel elements. - for (var i = 0; i < 6; i++) { - expect(function() { - TestUtils.findRenderedDOMComponentWithClass(rootNode, 'test-div-' + i); - }).not.toThrow(); - } - - for (var i = 6; i < 10; i++) { - expect(function() { - TestUtils.findRenderedDOMComponentWithClass(rootNode, 'test-div-' + i); - }).toThrow(); - } + const tree = rootNode.toJSON(); + expect(tree).toMatchSnapshot(); }); it('renders more children when preloadAdditionalHeight is increased beyond its default', function() { - var elementHeight = 200; - var rootNode = TestUtils.renderIntoDocument( + const elementHeight = 200; + const rootNode = renderer.create( ); - expect(rootNode.topSpacer._style._values.height).toEqual('0px'); - expect(rootNode.bottomSpacer._style._values.height).toEqual('600px'); - // Why are seven nodes rendered? Since we have not scrolled at // all, the extent that React Infinite will render is // preloadBatchSize + preloadAdditionalHeight below the container. @@ -159,23 +148,13 @@ describe('The Children of the React Infinite Component', function() { // preloadAdditionalHeight is declared as 1000 pixels // // Their sum is 1400 pixels, or 7 200-pixel elements. - - for (var i = 0; i < 7; i++) { - expect(function() { - TestUtils.findRenderedDOMComponentWithClass(rootNode, 'test-div-' + i); - }).not.toThrow(); - } - - for (var i = 7; i < 10; i++) { - expect(function() { - TestUtils.findRenderedDOMComponentWithClass(rootNode, 'test-div-' + i); - }).toThrow(); - } + const tree = rootNode.toJSON(); + expect(tree).toMatchSnapshot(); }); it('renders more children when preloadBatchSize is increased beyond its default', function() { - var elementHeight = 200; - var rootNode = TestUtils.renderIntoDocument( + const elementHeight = 200; + const rootNode = renderer.create( ); - expect(rootNode.topSpacer._style._values.height).toEqual('0px'); - expect(rootNode.bottomSpacer._style._values.height).toEqual('400px'); - // Why are eight nodes rendered? Since we have not scrolled at // all, the extent that React Infinite will render is // preloadBatchSize + preloadAdditionalHeight below the container. @@ -195,25 +171,15 @@ describe('The Children of the React Infinite Component', function() { // preloadAdditionalHeight defaults to containerHeight, 800 pixels // // Their sum is 1600 pixels, or 8 200-pixel elements. - for (var i = 0; i < 8; i++) { - expect(function() { - TestUtils.findRenderedDOMComponentWithClass(rootNode, 'test-div-' + i); - }).not.toThrow(); - } - - for (var i = 8; i < 10; i++) { - expect(function() { - TestUtils.findRenderedDOMComponentWithClass(rootNode, 'test-div-' + i); - }).toThrow(); - } - + const tree = rootNode.toJSON(); + expect(tree).toMatchSnapshot(); }); }); describe('The Scrolling Behavior of the Constant Height React Infinite Component', function() { it('hides visible elements when the user scrolls sufficiently', function() { - var elementHeight = 200; - var rootNode = TestUtils.renderIntoDocument( + const elementHeight = 200; + const rootNode = enzyme.mount( @@ -221,9 +187,9 @@ describe('The Scrolling Behavior of the Constant Height React Infinite Component ); - var rootDomNode = ReactDOM.findDOMNode(rootNode); + const rootDomNode = rootNode.getDOMNode(); rootDomNode.scrollTop = 1500; - TestUtils.Simulate.scroll(rootDomNode, { + rootNode.simulate('scroll', { target: rootDomNode }); @@ -235,34 +201,14 @@ describe('The Scrolling Behavior of the Constant Height React Infinite Component // 1600 pixels: blockEnd, end of block that scrollTop of 1500 pixels is in // 2400 pixels: windowBottom, end of first displayed element // 4000 pixels: end of bottomSpacer element - expect(rootNode.topSpacer._style._values.height).toEqual('400px'); - expect(rootNode.bottomSpacer._style._values.height).toEqual('1600px'); - - // Above the batch and its preloadAdditionalHeight - for (var i = 0; i < 2; i++) { - expect(function() { - TestUtils.findRenderedDOMComponentWithClass(rootNode, 'test-div-' + i); - }).toThrow(); - } - - // Within the batch and its preloadAdditionalHeight, top and bottom - for (var i = 2; i < 12; i++) { - expect(function() { - TestUtils.findRenderedDOMComponentWithClass(rootNode, 'test-div-' + i); - }).not.toThrow(); - } - - // Below the batch and its preloadAdditionalHeight - for (var i = 12; i < 20; i++) { - expect(function() { - TestUtils.findRenderedDOMComponentWithClass(rootNode, 'test-div-' + i); - }).toThrow(); - } + // expect(rootNode.topSpacer._style._values.height).toEqual('400px'); + // expect(rootNode.bottomSpacer._style._values.height).toEqual('1600px'); + expect(toJson.mountToJson(rootNode)).toMatchSnapshot(); }); it('functions correctly at the end of its range', function() { - var elementHeight = 200; - var rootNode = TestUtils.renderIntoDocument( + const elementHeight = 200; + const rootNode = enzyme.mount( @@ -271,36 +217,21 @@ describe('The Scrolling Behavior of the Constant Height React Infinite Component ); // The total scrollable height here is 4000 pixels - var rootDomNode = ReactDOM.findDOMNode(rootNode); + const rootDomNode = rootNode.getDOMNode(); rootDomNode.scrollTop = 3600; - TestUtils.Simulate.scroll(rootDomNode, { + rootNode.simulate('scroll', { target: rootDomNode }); - expect(rootNode.topSpacer._style._values.height).toEqual('2800px'); - expect(rootNode.bottomSpacer._style._values.height).toEqual('0px'); - - // Above the batch and its preloadAdditionalHeight - for (var i = 0; i < 14; i++) { - expect(function() { - TestUtils.findRenderedDOMComponentWithClass(rootNode, 'test-div-' + i); - }).toThrow(); - } - - // Within the batch and its preloadAdditionalHeight, top and bottom - for (var i = 14; i < 20; i++) { - expect(function() { - TestUtils.findRenderedDOMComponentWithClass(rootNode, 'test-div-' + i); - }).not.toThrow(); - } + expect(toJson.mountToJson(rootNode)).toMatchSnapshot(); }); }); describe('The Behavior of the Variable Height React Infinite Component', function() { it('hides elements when the user has not yet scrolled', function() { // 20 40 200 300 350 500 525 550 575 600 725 805 880 900 1050 1300 1400 (16) - var elementHeight = [20, 20, 160, 100, 50, 150, 25, 25, 25, 25, 125, 80, 75, 20, 150, 250, 100]; - var rootNode = TestUtils.renderIntoDocument( + const elementHeight = [20, 20, 160, 100, 50, 150, 25, 25, 25, 25, 125, 80, 75, 20, 150, 250, 100]; + const rootNode = renderer.create( @@ -313,28 +244,14 @@ describe('The Behavior of the Variable Height React Infinite Component', functio // 420 pixels: end of container // 630 pixels: end of windowBottom // 1400 pixels: end of bottomSpacer element - expect(rootNode.topSpacer._style._values.height).toEqual('0px'); - expect(rootNode.bottomSpacer._style._values.height).toEqual('675px'); - - // Within the batch and its preloadAdditionalHeight, top and bottom - for (var i = 1; i < 11; i++) { - expect(function() { - TestUtils.findRenderedDOMComponentWithClass(rootNode, 'test-div-' + i); - }).not.toThrow(); - } - - // Below the batch and its preloadAdditionalHeight - for (var i = 11; i < 16; i++) { - expect(function() { - TestUtils.findRenderedDOMComponentWithClass(rootNode, 'test-div-' + i); - }).toThrow(); - } + const tree = rootNode.toJSON(); + expect(tree).toMatchSnapshot(); }); it('hides visible elements when the user scrolls sufficiently', function() { // 20 40 200 300 350 500 525 550 575 600 725 805 880 900 1050 1300 1400 (17) - var elementHeight = [20, 20, 160, 100, 50, 150, 25, 25, 25, 25, 125, 80, 75, 20, 150, 250, 100]; - var rootNode = TestUtils.renderIntoDocument( + const elementHeight = [20, 20, 160, 100, 50, 150, 25, 25, 25, 25, 125, 80, 75, 20, 150, 250, 100]; + const rootNode = enzyme.mount( @@ -342,9 +259,9 @@ describe('The Behavior of the Variable Height React Infinite Component', functio ); - var rootDomNode = ReactDOM.findDOMNode(rootNode); + const rootDomNode = rootNode.getDOMNode(); rootDomNode.scrollTop = 700; - TestUtils.Simulate.scroll(rootDomNode, { + rootNode.simulate('scroll', { target: rootDomNode }); @@ -355,32 +272,7 @@ describe('The Behavior of the Variable Height React Infinite Component', functio // 800 pixels: blockEnd, end of the block that the scrollTop of 700 pixels is in // 1200 pixels: windowBottom, end of displayed element // 1400 pixels: end of bottomSpacer element - - expect(rootNode.topSpacer._style._values.height).toEqual('40px'); - expect(rootNode.bottomSpacer._style._values.height).toEqual('100px'); - - // Above the batch and its preloadAdditionalHeight - expect(function() { TestUtils.findRenderedDOMComponentWithClass(rootNode, 'test-div-0') }).toThrow(); - expect(function() { TestUtils.findRenderedDOMComponentWithClass(rootNode, 'test-div-1') }).toThrow(); - - // Within the batch and its preloadAdditionalHeight, top and bottom - expect(function() { TestUtils.findRenderedDOMComponentWithClass(rootNode, 'test-div-2') }).not.toThrow(); - expect(function() { TestUtils.findRenderedDOMComponentWithClass(rootNode, 'test-div-3');}).not.toThrow(); - expect(function() { TestUtils.findRenderedDOMComponentWithClass(rootNode, 'test-div-4') }).not.toThrow(); - expect(function() { TestUtils.findRenderedDOMComponentWithClass(rootNode, 'test-div-5');}).not.toThrow(); - expect(function() { TestUtils.findRenderedDOMComponentWithClass(rootNode, 'test-div-6');}).not.toThrow(); - expect(function() { TestUtils.findRenderedDOMComponentWithClass(rootNode, 'test-div-7');}).not.toThrow(); - expect(function() { TestUtils.findRenderedDOMComponentWithClass(rootNode, 'test-div-8') }).not.toThrow(); - expect(function() { TestUtils.findRenderedDOMComponentWithClass(rootNode, 'test-div-9');}).not.toThrow(); - expect(function() { TestUtils.findRenderedDOMComponentWithClass(rootNode, 'test-div-10') }).not.toThrow(); - expect(function() { TestUtils.findRenderedDOMComponentWithClass(rootNode, 'test-div-11') }).not.toThrow(); - expect(function() { TestUtils.findRenderedDOMComponentWithClass(rootNode, 'test-div-12') }).not.toThrow(); - expect(function() { TestUtils.findRenderedDOMComponentWithClass(rootNode, 'test-div-13') }).not.toThrow(); - expect(function() { TestUtils.findRenderedDOMComponentWithClass(rootNode, 'test-div-14');}).not.toThrow(); - expect(function() { TestUtils.findRenderedDOMComponentWithClass(rootNode, 'test-div-15') }).not.toThrow(); - - // Below the batch and its preloadAdditionalHeight - expect(function() { TestUtils.findRenderedDOMComponentWithClass(rootNode, 'test-div-16');}).toThrow(); + expect(toJson.mountToJson(rootNode)).toMatchSnapshot(); }); it('functions correctly at the end of its range', function() { diff --git a/package.json b/package.json index f93e75c..b8dc8fa 100644 --- a/package.json +++ b/package.json @@ -70,7 +70,7 @@ "gulp-sourcemaps": "^1.2.4", "gulp-uglify": "^1.0.1", "gulp-webserver": "^0.9.1", - "jest-cli": "0.8.2", + "jest-cli": "20.0.4", "moment": "^2.10.6", "react-test-renderer": "15.5.4", "uglifyify": "3.0.1", From d3c5557e66d058d4b978eb986d931572ff6455d1 Mon Sep 17 00:00:00 2001 From: Gareth Tan Date: Fri, 4 Aug 2017 09:39:53 -0400 Subject: [PATCH 39/78] Continue updating tests. --- __tests__/__snapshots__/infinite_test.js.snap | 138 ++++++++++++++++++ __tests__/infinite_test.js | 25 +--- 2 files changed, 143 insertions(+), 20 deletions(-) diff --git a/__tests__/__snapshots__/infinite_test.js.snap b/__tests__/__snapshots__/infinite_test.js.snap index ab183de..32abfdf 100644 --- a/__tests__/__snapshots__/infinite_test.js.snap +++ b/__tests__/__snapshots__/infinite_test.js.snap @@ -1,5 +1,143 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP +exports[`The Behavior of the Variable Height React Infinite Component functions correctly at the end of its range 1`] = ` +} + onInfiniteLoad={[Function]} + styles={Object {}} + timeScrollStateLastsForAfterUserScrolls={150} + useWindowAsScrollContainer={false} +> +
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +`; + exports[`The Behavior of the Variable Height React Infinite Component hides elements when the user has not yet scrolled 1`] = `
@@ -287,9 +287,9 @@ describe('The Behavior of the Variable Height React Infinite Component', functio ); // The total scrollable height here is 4000 pixels - var rootDomNode = ReactDOM.findDOMNode(rootNode); + const rootDomNode = rootNode.getDOMNode(); rootDomNode.scrollTop = 1000; - TestUtils.Simulate.scroll(rootDomNode, { + rootNode.simulate('scroll', { target: rootDomNode }); @@ -299,22 +299,7 @@ describe('The Behavior of the Variable Height React Infinite Component', functio // 1000 pixels: start of block // 1400 pixels: end of block // 1400 pixels: end of windowBottom - expect(rootNode.topSpacer._style._values.height).toEqual('575px'); - expect(rootNode.bottomSpacer._style._values.height).toEqual('0px'); - - // Above the batch and its preloadAdditionalHeight - for (var i = 0; i < 9; i++) { - expect(function() { - TestUtils.findRenderedDOMComponentWithClass(rootNode, 'test-div-' + i); - }).toThrow(); - } - - // Within the batch and its preloadAdditionalHeight, top and bottom - for (var i = 9; i < 15; i++) { - expect(function() { - TestUtils.findRenderedDOMComponentWithClass(rootNode, 'test-div-' + i); - }).not.toThrow(); - } + expect(toJson.mountToJson(rootNode)).toMatchSnapshot(); }); }); From beb4770aa41f9226b2dd333435968d52b75c7225 Mon Sep 17 00:00:00 2001 From: Gareth Tan Date: Fri, 4 Aug 2017 10:54:03 -0400 Subject: [PATCH 40/78] Fix pointer events tests. --- __tests__/__snapshots__/infinite_test.js.snap | 186 ++++++++++++++++++ __tests__/infinite_test.js | 66 +++---- 2 files changed, 215 insertions(+), 37 deletions(-) diff --git a/__tests__/__snapshots__/infinite_test.js.snap b/__tests__/__snapshots__/infinite_test.js.snap index 32abfdf..6b8463f 100644 --- a/__tests__/__snapshots__/infinite_test.js.snap +++ b/__tests__/__snapshots__/infinite_test.js.snap @@ -1,5 +1,191 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP +exports[`Maintaining React Infinite's internal scroll state has does not have pointer-events: none by default 1`] = ` +
+
+
+
+
+
+
+
+
+
+
+
+`; + +exports[`Maintaining React Infinite's internal scroll state has pointer-events: none upon scroll 1`] = ` +} + onInfiniteLoad={[Function]} + styles={Object {}} + timeScrollStateLastsForAfterUserScrolls={10000} + useWindowAsScrollContainer={false} +> +
+
+
+
+
+
+
+
+
+
+
+
+ +`; + exports[`The Behavior of the Variable Height React Infinite Component functions correctly at the end of its range 1`] = ` ); - var rootDomNode = ReactDOM.findDOMNode(rootNode); + const rootDomNode = rootNode.getDOMNode(); rootDomNode.scrollTop = 300; - TestUtils.Simulate.scroll(rootDomNode, { + rootNode.simulate('scroll', { target: rootDomNode }); @@ -328,9 +327,9 @@ describe("React Infinite's Infinite Scroll Capabilities", function() { }); it('triggers the onInfiniteLoad function when scrolling past infiniteLoadBeginEdgeOffset', function() { - var infiniteSpy = jasmine.createSpy('infiniteSpy'); - var elementHeight = 200; - var rootNode = TestUtils.renderIntoDocument( + const infiniteSpy = jasmine.createSpy('infiniteSpy'); + const elementHeight = 200; + const rootNode = enzyme.mount( ); - var rootDomNode = ReactDOM.findDOMNode(rootNode); + const rootDomNode = rootNode.getDOMNode(); rootDomNode.scrollTop = 3600; - TestUtils.Simulate.scroll(rootDomNode, { + rootNode.simulate('scroll', { target: rootDomNode }); @@ -350,9 +349,9 @@ describe("React Infinite's Infinite Scroll Capabilities", function() { }); it('does not always display the loadingSpinnerDelegate', function() { - var infiniteSpy = jasmine.createSpy('infiniteSpy'); - var elementHeight = 200; - var rootNode = TestUtils.renderIntoDocument( + const infiniteSpy = jasmine.createSpy('infiniteSpy'); + const elementHeight = 200; + const rootNode = enzyme.mount( ); - var rootDomNode = ReactDOM.findDOMNode(rootNode); + const rootDomNode = rootNode.getDOMNode(); rootDomNode.scrollTop = 100; - TestUtils.Simulate.scroll(rootDomNode, { + rootNode.simulate('scroll', { target: rootDomNode }); - expect(function() { - TestUtils.findRenderedDOMComponentWithClass(rootNode, 'delegate-div'); - }).toThrow(); + expect(rootNode.find('.delegate-div').exists()).toBe(false); }); it('displays the loadingSpinnerDelegate when isInfiniteLoading', function() { var infiniteSpy = jasmine.createSpy('infiniteSpy'); var elementHeight = 200; - var rootNode = TestUtils.renderIntoDocument( + var rootNode = enzyme.mount( ); - var rootDomNode = ReactDOM.findDOMNode(rootNode); + const rootDomNode = rootNode.getDOMNode(); rootDomNode.scrollTop = 3600; - TestUtils.Simulate.scroll(rootDomNode, { + rootNode.simulate('scroll', { target: rootDomNode }); - expect(function() { - TestUtils.findRenderedDOMComponentWithClass(rootNode, 'delegate-div'); - }).not.toThrow(); + expect(rootNode.find('.delegate-div').exists()).toBe(true); }); }); describe("Maintaining React Infinite's internal scroll state", function() { it('has does not have pointer-events: none by default', function() { - var infiniteSpy = jasmine.createSpy('infiniteSpy'); - var elementHeight = 200; - var rootNode = TestUtils.renderIntoDocument( + const elementHeight = 200; + const rootNode = renderer.create( ); - var wrapper = rootNode.smoothScrollingWrapper; - expect(wrapper._style._values['pointer-events']).toBeUndefined(); + + expect(rootNode).toMatchSnapshot(); }); it('has pointer-events: none upon scroll', function() { - var infiniteSpy = jasmine.createSpy('infiniteSpy'); - var elementHeight = 200; - var rootNode = TestUtils.renderIntoDocument( + const elementHeight = 200; + const rootNode = enzyme.mount( ); - var rootDomNode = ReactDOM.findDOMNode(rootNode); + const rootDomNode = rootNode.getDOMNode(); rootDomNode.scrollTop = 100; - TestUtils.Simulate.scroll(rootDomNode, { + rootNode.simulate('scroll', { target: rootDomNode }); - var wrapper = rootNode.smoothScrollingWrapper; - expect(wrapper._style._values['pointer-events']).toEqual('none'); + expect(toJson.mountToJson(rootNode)).toMatchSnapshot(); }); }); From 10598ec46d2e31a3b18ea06362ccf8ad2c809826 Mon Sep 17 00:00:00 2001 From: Gareth Tan Date: Fri, 4 Aug 2017 11:26:02 -0400 Subject: [PATCH 41/78] Remove mocking and imports. --- __tests__/infinite_test.js | 41 +++++++++++--------------------------- 1 file changed, 12 insertions(+), 29 deletions(-) diff --git a/__tests__/infinite_test.js b/__tests__/infinite_test.js index 8d0a00e..0b17b67 100644 --- a/__tests__/infinite_test.js +++ b/__tests__/infinite_test.js @@ -1,31 +1,14 @@ /* eslint-env jest, jasmine */ -jest.dontMock('../src/react-infinite.jsx'); -jest.dontMock('../src/computers/infiniteComputer.js'); -jest.dontMock('../src/computers/constantInfiniteComputer.js'); -jest.dontMock('../src/computers/arrayInfiniteComputer.js'); -jest.dontMock('../src/utils/binaryIndexSearch.js'); -jest.dontMock('../src/utils/infiniteHelpers.js'); -jest.dontMock('./helpers/renderHelpers.js'); -jest.dontMock('../src/utils/window.js'); -jest.dontMock('lodash.isfinite'); -jest.dontMock('lodash.isarray'); -jest.dontMock('react-dom'); -jest.dontMock('react-test-renderer'); -jest.dontMock('enzyme'); -jest.dontMock('enzyme-to-json'); - -var React = require('react'); -var createReactClass = require('create-react-class'); -var renderer = require('react-test-renderer'); -var ReactDOM = require('react-dom'); -var enzyme = require('enzyme'); -var TestUtils = require('react-dom/test-utils'); -var Infinite = require('../src/react-infinite.jsx'); -var toJson = require('enzyme-to-json'); - - -var renderHelpers = require('./helpers/renderHelpers'); +import React from 'react'; +import createReactClass from 'create-react-class'; +import renderer from 'react-test-renderer'; +import ReactDOM from 'react-dom'; +import enzyme from 'enzyme'; +import TestUtils from 'react-dom/test-utils'; +import Infinite from '../src/react-infinite.jsx'; +import toJson from 'enzyme-to-json'; +import renderHelpers from './helpers/renderHelpers'; describe('Rendering the React Infinite Component Wrapper', function() { it('does not throw an error when given no children', function() { @@ -459,10 +442,10 @@ describe('Handling infinite scrolling', function() { }); it('considers a scroll to have occurred when the container itself is scrolled', function() { - var infiniteSpy = jasmine.createSpy('infiniteSpy'); - var elementHeight = 200; + const infiniteSpy = jasmine.createSpy('infiniteSpy'); + const elementHeight = 200; - var rootNode = TestUtils.renderIntoDocument( + const rootNode = TestUtils.renderIntoDocument( Date: Fri, 4 Aug 2017 11:39:50 -0400 Subject: [PATCH 42/78] Continue working on tests. --- __tests__/__snapshots__/infinite_test.js.snap | 77 +++++++++++++++ __tests__/infinite_test.js | 97 ++++++++----------- 2 files changed, 120 insertions(+), 54 deletions(-) diff --git a/__tests__/__snapshots__/infinite_test.js.snap b/__tests__/__snapshots__/infinite_test.js.snap index 6b8463f..f733d8a 100644 --- a/__tests__/__snapshots__/infinite_test.js.snap +++ b/__tests__/__snapshots__/infinite_test.js.snap @@ -186,6 +186,83 @@ exports[`Maintaining React Infinite's internal scroll state has pointer-events: `; +exports[`React Infinite when the window is used as the Container does not attach a scrollable style 1`] = ` +
+
+
+
+
+
+
+
+
+
+
+
+`; + exports[`The Behavior of the Variable Height React Infinite Component functions correctly at the end of its range 1`] = ` @@ -186,12 +186,12 @@ describe('The Scrolling Behavior of the Constant Height React Infinite Component // 4000 pixels: end of bottomSpacer element // expect(rootNode.topSpacer._style._values.height).toEqual('400px'); // expect(rootNode.bottomSpacer._style._values.height).toEqual('1600px'); - expect(toJson.mountToJson(rootNode)).toMatchSnapshot(); + expect(mountToJson(rootNode)).toMatchSnapshot(); }); it('functions correctly at the end of its range', function() { const elementHeight = 200; - const rootNode = enzyme.mount( + const rootNode = mount( @@ -206,7 +206,7 @@ describe('The Scrolling Behavior of the Constant Height React Infinite Component target: rootDomNode }); - expect(toJson.mountToJson(rootNode)).toMatchSnapshot(); + expect(mountToJson(rootNode)).toMatchSnapshot(); }); }); @@ -234,7 +234,7 @@ describe('The Behavior of the Variable Height React Infinite Component', functio it('hides visible elements when the user scrolls sufficiently', function() { // 20 40 200 300 350 500 525 550 575 600 725 805 880 900 1050 1300 1400 (17) const elementHeight = [20, 20, 160, 100, 50, 150, 25, 25, 25, 25, 125, 80, 75, 20, 150, 250, 100]; - const rootNode = enzyme.mount( + const rootNode = mount( @@ -255,13 +255,13 @@ describe('The Behavior of the Variable Height React Infinite Component', functio // 800 pixels: blockEnd, end of the block that the scrollTop of 700 pixels is in // 1200 pixels: windowBottom, end of displayed element // 1400 pixels: end of bottomSpacer element - expect(toJson.mountToJson(rootNode)).toMatchSnapshot(); + expect(mountToJson(rootNode)).toMatchSnapshot(); }); it('functions correctly at the end of its range', function() { // 20 40 200 300 350 500 525 550 575 600 725 805 880 900 1050 1300 1400 (16) const elementHeight = [20, 20, 160, 100, 50, 150, 25, 25, 25, 25, 125, 80, 75, 20, 150, 250, 100]; - const rootNode = enzyme.mount( + const rootNode = mount( @@ -282,7 +282,7 @@ describe('The Behavior of the Variable Height React Infinite Component', functio // 1000 pixels: start of block // 1400 pixels: end of block // 1400 pixels: end of windowBottom - expect(toJson.mountToJson(rootNode)).toMatchSnapshot(); + expect(mountToJson(rootNode)).toMatchSnapshot(); }); }); @@ -290,7 +290,7 @@ describe("React Infinite's Infinite Scroll Capabilities", function() { it('infiniteLoadBeginEdgeOffset does not always trigger infinite load on scroll', function() { const infiniteSpy = jasmine.createSpy('infiniteSpy'); const elementHeight = 200; - const rootNode = enzyme.mount( + const rootNode = mount( - - ); - }); - - waitsFor(function() { - return infiniteSpy.callCount > 0; - }); + const infiniteSpy = jasmine.createSpy('infiniteSpy'); + const elementHeight = 200; + mount( + + + ); - runs(function() { - expect(infiniteSpy).toHaveBeenCalled(); - }); + expect(infiniteSpy).toHaveBeenCalled(); }); it('considers a scroll to have occurred when the container itself is scrolled', function() { const infiniteSpy = jasmine.createSpy('infiniteSpy'); const elementHeight = 200; - const rootNode = TestUtils.renderIntoDocument( + const rootNode = mount( ); - var properDiv = TestUtils.findRenderedDOMComponentWithClass(rootNode, 'correct-class-name'); + const properDiv = rootNode.find('.correct-class-name').getDOMNode(); properDiv.scrollTop = 100; - TestUtils.Simulate.scroll(properDiv, { - target: ReactDOM.findDOMNode(properDiv) + rootNode.simulate('scroll', { + target: properDiv }); expect(infiniteSpy).toHaveBeenCalled(); }); it('does not consider an infinite scroll to have occurred when one of its children scrolls', function() { - var infiniteSpy = jasmine.createSpy('infiniteSpy'); - var elementHeight = 200; + const infiniteSpy = jasmine.createSpy('infiniteSpy'); + const elementHeight = 200; - var rootNode = TestUtils.renderIntoDocument( + const rootNode = mount( ); - var childDiv = TestUtils.findRenderedDOMComponentWithClass(rootNode, 'test-div-0'); + const childDiv = rootNode.find('.test-div-0').getDOMNode(); childDiv.scrollTop = 100; - TestUtils.Simulate.scroll(childDiv, { - target: ReactDOM.findDOMNode(childDiv) + rootNode.simulate('scroll', { + target: childDiv }); expect(infiniteSpy).not.toHaveBeenCalled(); @@ -489,9 +479,9 @@ describe('Handling infinite scrolling', function() { }); describe('React Infinite when the window is used as the Container', function() { - var elementHeight = 200; + const elementHeight = 200; it('does not attach a scrollable style', function() { - var rootNode = TestUtils.renderIntoDocument( + const rootNode = renderer.create( ); - var scrollable = rootNode.scrollable; - expect(scrollable._style._values).toEqual({}); + expect(rootNode).toMatchSnapshot(); }); From dc5dc646cb8c70834f3b054a561ae5a15dd7d14b Mon Sep 17 00:00:00 2001 From: Gareth Tan Date: Fri, 4 Aug 2017 12:16:10 -0400 Subject: [PATCH 43/78] Continue with tests. --- __tests__/__snapshots__/infinite_test.js.snap | 90 +++++++++++++++++++ __tests__/infinite_test.js | 81 ++++++----------- 2 files changed, 116 insertions(+), 55 deletions(-) diff --git a/__tests__/__snapshots__/infinite_test.js.snap b/__tests__/__snapshots__/infinite_test.js.snap index f733d8a..8e0f8c7 100644 --- a/__tests__/__snapshots__/infinite_test.js.snap +++ b/__tests__/__snapshots__/infinite_test.js.snap @@ -263,6 +263,96 @@ exports[`React Infinite when the window is used as the Container does not attach
`; +exports[`React Infinite when the window is used as the Container hides DOM elements that are below the visible range of the window 1`] = ` +} + onInfiniteLoad={[Function]} + styles={Object {}} + timeScrollStateLastsForAfterUserScrolls={10000} + useWindowAsScrollContainer={true} +> +
+
+
+
+
+
+
+
+
+
+
+
+ +`; + exports[`The Behavior of the Variable Height React Infinite Component functions correctly at the end of its range 1`] = ` - {renderHelpers.divGenerator(20, elementHeight)} - - ); + const listenerTriggered = new Promise((resolve, reject) => { + window.addEventListener = function(event, f) { + if (event === 'scroll') { + resolve(f); + } + }; }); - waitsFor(function() { - return !!scrollListener; - }); + mount( + + {renderHelpers.divGenerator(20, elementHeight)} + + ); - runs(function() { + return listenerTriggered.then((listener) => { window.pageYOffset = 200; - scrollListener(); + listener(); expect(infiniteSpy).toHaveBeenCalled(); + window.addEventListener = oldAdd; }); }); it('hides DOM elements that are below the visible range of the window', function() { - var infiniteSpy = jasmine.createSpy('infiniteSpy'); - var elementHeight = 200; + const elementHeight = 200; window.innerHeight = 800; - var oldAdd = window.addEventListener; - var scrollListener; - - // I would very much like to know if there - // is a better way of doing this. - window.addEventListener = function(event, f) { - if (event === 'scroll') { - scrollListener = f; - } - }; - - var rootNode = TestUtils.renderIntoDocument( + const rootNode = mount( {renderHelpers.divGenerator(20, elementHeight)} - ); - - for (var i = 0; i < 6; i++) { - expect(function() { - TestUtils.findRenderedDOMComponentWithClass(rootNode, 'test-div-' + i); - }).not.toThrow(); - } + + ); - for (var i = 6; i < 10; i++) { - expect(function() { - TestUtils.findRenderedDOMComponentWithClass(rootNode, 'test-div-' + i); - }).toThrow(); - } + expect(mountToJson(rootNode)).toMatchSnapshot(); }); it('alters the elements displayed when a scroll has occurred', function() { From 892fde2599b02c563a2c6bf30c0f94dfaf9e07e7 Mon Sep 17 00:00:00 2001 From: Gareth Tan Date: Fri, 4 Aug 2017 21:36:05 -0400 Subject: [PATCH 44/78] Update infinite tests. --- __tests__/__snapshots__/infinite_test.js.snap | 216 ++++++++++++++++++ __tests__/infinite_test.js | 139 +++++------ 2 files changed, 268 insertions(+), 87 deletions(-) diff --git a/__tests__/__snapshots__/infinite_test.js.snap b/__tests__/__snapshots__/infinite_test.js.snap index 8e0f8c7..261e10a 100644 --- a/__tests__/__snapshots__/infinite_test.js.snap +++ b/__tests__/__snapshots__/infinite_test.js.snap @@ -186,6 +186,222 @@ exports[`Maintaining React Infinite's internal scroll state has pointer-events: `; +exports[`React Infinite when the window is used as the Container alters the elements displayed when a scroll has occurred 1`] = ` +} + onInfiniteLoad={[Function]} + styles={Object {}} + timeScrollStateLastsForAfterUserScrolls={10000} + useWindowAsScrollContainer={true} +> +
+
+
+
+
+
+
+
+
+
+
+
+ +`; + +exports[`React Infinite when the window is used as the Container alters the elements displayed when a scroll has occurred 2`] = ` +} + onInfiniteLoad={[Function]} + styles={Object {}} + timeScrollStateLastsForAfterUserScrolls={10000} + useWindowAsScrollContainer={true} +> +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +`; + exports[`React Infinite when the window is used as the Container does not attach a scrollable style 1`] = `
- {renderHelpers.divGenerator(20, elementHeight)} - - ); - - for (var i = 0; i < 6; i++) { - expect(function() { - TestUtils.findRenderedDOMComponentWithClass(rootNode, 'test-div-' + i); - }).not.toThrow(); - } - - for (var i = 6; i < 20; i++) { - expect(function() { - TestUtils.findRenderedDOMComponentWithClass(rootNode, 'test-div-' + i); - }).toThrow(); - } - }); - - waitsFor(function() { - return !!scrollListener; + const listenerTriggered = new Promise((resolve, reject) => { + window.addEventListener = function(event, f) { + if (event === 'scroll') { + resolve(f); + } + }; }); - runs(function() { - window.pageYOffset = 1500; - scrollListener(); - - for (var i = 0; i < 2; i++) { - expect(function() { - TestUtils.findRenderedDOMComponentWithClass(rootNode, 'test-div-' + i); - }).toThrow(); - } + var rootNode = mount( + + {renderHelpers.divGenerator(20, elementHeight)} + + ); - for (var i = 2; i < 12; i++) { - expect(function() { - TestUtils.findRenderedDOMComponentWithClass(rootNode, 'test-div-' + i); - }).not.toThrow(); - } + expect(mountToJson(rootNode)).toMatchSnapshot(); - // Below the batch and its preloadAdditionalHeight - for (var i = 12; i < 20; i++) { - expect(function() { - TestUtils.findRenderedDOMComponentWithClass(rootNode, 'test-div-' + i); - }).toThrow(); - } + return listenerTriggered.then((listener) => { + window.pageYOffset = 1500; + listener(); + expect(mountToJson(rootNode)).toMatchSnapshot(); + window.addEventListener = oldAdd; }); }); }); describe("Specifying React Infinite's preload amounts", function() { it('has correct preload batch size defaults', function() { - var infinite = TestUtils.renderIntoDocument( + var infinite = mount( @@ -622,11 +587,11 @@ describe("Specifying React Infinite's preload amounts", function() { ); - expect(infinite.computedProps.preloadBatchSize).toEqual(400); + expect(infinite.instance().computedProps.preloadBatchSize).toEqual(400); }); it('can use a number to set preload batch size', function() { - var infinite = TestUtils.renderIntoDocument( + var infinite = mount( ); - expect(infinite.computedProps.preloadBatchSize).toEqual(742); + expect(infinite.instance().computedProps.preloadBatchSize).toEqual(742); }); it('can be used with a preload batch size scale factor', function() { - var infinite = TestUtils.renderIntoDocument( + var infinite = mount( ); - expect(infinite.computedProps.preloadBatchSize).toEqual(3200); + expect(infinite.instance().computedProps.preloadBatchSize).toEqual(3200); }); it('has correct preload additional height defaults', function() { - var infinite = TestUtils.renderIntoDocument( + var infinite = mount( @@ -663,11 +628,11 @@ describe("Specifying React Infinite's preload amounts", function() { ); - expect(infinite.computedProps.preloadAdditionalHeight).toEqual(800); + expect(infinite.instance().computedProps.preloadAdditionalHeight).toEqual(800); }); it('can use a number to set preload additional height', function() { - var infinite = TestUtils.renderIntoDocument( + var infinite = mount( ); - expect(infinite.computedProps.preloadAdditionalHeight).toEqual(465); + expect(infinite.instance().computedProps.preloadAdditionalHeight).toEqual(465); }); it('can be used with a preload additional height scale factor', function() { - var infinite = TestUtils.renderIntoDocument( + var infinite = mount( ); - expect(infinite.computedProps.preloadAdditionalHeight).toEqual(750); + expect(infinite.instance().computedProps.preloadAdditionalHeight).toEqual(750); }); }); describe('Rerendering React Infinite', function() { it('updates the infinite computer', function() { - var rootNode = TestUtils.renderIntoDocument( + var rootNode = mount( ); - expect(rootNode.state.infiniteComputer.heightData).toEqual(17); - expect(rootNode.state.infiniteComputer.numberOfChildren).toEqual(20); + expect(rootNode.state().infiniteComputer.heightData).toEqual(17); + expect(rootNode.state().infiniteComputer.numberOfChildren).toEqual(20); - rootNode = TestUtils.renderIntoDocument( + rootNode = mount( ); - expect(rootNode.state.infiniteComputer.numberOfChildren).toEqual(74); + expect(rootNode.state().infiniteComputer.numberOfChildren).toEqual(74); - rootNode = TestUtils.renderIntoDocument( - } className={"correct-class-name"}> - {renderHelpers.divGenerator(74, 17)} + {renderHelpers.divGenerator(12, 17)} ); - expect(rootNode.state.infiniteComputer.heightData).toEqual([10, 20, 30]); + expect(rootNode.state().infiniteComputer.heightData).toEqual([10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120]); }); }); -describe('Requesting all visible rows', function () { +describe('Requesting all visible rows', function() { var InfiniteWrapper = createReactClass({ getInitialState() { return { currentRows: 0, totalRequests: 0 } @@ -766,35 +731,35 @@ describe('Requesting all visible rows', function () { }); it('will request all possible rows until the scroll height is met', function () { - var rootNode = TestUtils.renderIntoDocument( + var rootNode = mount( ); - expect(rootNode.state.totalRequests).toEqual(10); - expect(rootNode.state.currentRows).toEqual(10); + expect(rootNode.state().totalRequests).toEqual(10); + expect(rootNode.state().currentRows).toEqual(10); }); it('will stop requesting when no further rows are provided', function () { - var rootNode = TestUtils.renderIntoDocument( + var rootNode = mount( ); - expect(rootNode.state.totalRequests).toEqual(4); - expect(rootNode.state.currentRows).toEqual(3); + expect(rootNode.state().totalRequests).toEqual(4); + expect(rootNode.state().currentRows).toEqual(3); }); it('will work when no possible rows can be loaded', function () { - var rootNode = TestUtils.renderIntoDocument( + var rootNode = mount( ); - expect(rootNode.state.totalRequests).toEqual(1); - expect(rootNode.state.currentRows).toEqual(0); + expect(rootNode.state().totalRequests).toEqual(1); + expect(rootNode.state().currentRows).toEqual(0); }); }); From aff218f41ec5725cbea67eeb511cf41bb7eda07e Mon Sep 17 00:00:00 2001 From: Gareth Tan Date: Fri, 4 Aug 2017 21:42:16 -0400 Subject: [PATCH 45/78] Update infinite tests. --- __tests__/__snapshots__/infinite_test.js.snap | 38 ++++++++++++++ __tests__/infinite_test.js | 52 +++++++++---------- 2 files changed, 64 insertions(+), 26 deletions(-) diff --git a/__tests__/__snapshots__/infinite_test.js.snap b/__tests__/__snapshots__/infinite_test.js.snap index 261e10a..b2e14cc 100644 --- a/__tests__/__snapshots__/infinite_test.js.snap +++ b/__tests__/__snapshots__/infinite_test.js.snap @@ -569,6 +569,44 @@ exports[`React Infinite when the window is used as the Container hides DOM eleme `; +exports[`Rendering the React Infinite Component Wrapper renders itself into the DOM with the correct container styles 1`] = ` +
+
+
+
+
+
+
+
+`; + exports[`The Behavior of the Variable Height React Infinite Component functions correctly at the end of its range 1`] = ` @@ -24,7 +24,7 @@ describe('Rendering the React Infinite Component Wrapper', function() { it('does not throw an error when given only one child', function() { expect(function() { - TestUtils.renderIntoDocument( + renderer.create( @@ -35,7 +35,7 @@ describe('Rendering the React Infinite Component Wrapper', function() { }); it('renders itself into the DOM with the correct container styles', function() { - var infinite = TestUtils.renderIntoDocument( + const infinite = renderer.create( @@ -44,15 +44,11 @@ describe('Rendering the React Infinite Component Wrapper', function() { ); - var rootScrollable = TestUtils.findRenderedDOMComponentWithClass(infinite, 'root-scrollable-node'); - expect(rootScrollable.style.height).toEqual('800px'); - expect(rootScrollable.style.overflowX).toEqual('hidden'); - expect(rootScrollable.style.overflowY).toEqual('scroll'); - expect(rootScrollable.style.WebkitOverflowScrolling).toEqual('touch'); + expect(infinite).toMatchSnapshot(); }); it('applies the provided class name to the root node', function() { - var infinite = TestUtils.renderIntoDocument( + const infinite = TestUtils.renderIntoDocument( @@ -61,17 +57,21 @@ describe('Rendering the React Infinite Component Wrapper', function() { ); - expect(infinite.props.className).toEqual('correct-class-name'); + expect(infinite).toMatchSnapshot(); }); it('allows preloadBatchSize to be zero', function() { - var renderedInfinite = TestUtils.renderIntoDocument(
  • Test1
  • Test2
  • ); - TestUtils.Simulate.scroll(ReactDOM.findDOMNode(renderedInfinite)); + const rootDomNode = rootNode.getDOMNode(); + rootDomNode.scrollTop = 1500; + rootNode.simulate('scroll', { + target: rootDomNode + }); }); }); @@ -542,10 +542,10 @@ describe('React Infinite when the window is used as the Container', function() { }); it('alters the elements displayed when a scroll has occurred', function() { - var infiniteSpy = jasmine.createSpy('infiniteSpy'); - var elementHeight = 200; + const infiniteSpy = jasmine.createSpy('infiniteSpy'); + const elementHeight = 200; - var oldAdd = window.addEventListener; + const oldAdd = window.addEventListener; const listenerTriggered = new Promise((resolve, reject) => { window.addEventListener = function(event, f) { @@ -555,7 +555,7 @@ describe('React Infinite when the window is used as the Container', function() { }; }); - var rootNode = mount( + const rootNode = mount( @@ -591,7 +591,7 @@ describe("Specifying React Infinite's preload amounts", function() { }); it('can use a number to set preload batch size', function() { - var infinite = mount( + const infinite = mount( @@ -632,7 +632,7 @@ describe("Specifying React Infinite's preload amounts", function() { }); it('can use a number to set preload additional height', function() { - var infinite = mount( + const infinite = mount( @@ -742,7 +742,7 @@ describe('Requesting all visible rows', function() { }); it('will stop requesting when no further rows are provided', function () { - var rootNode = mount( + const rootNode = mount( @@ -753,7 +753,7 @@ describe('Requesting all visible rows', function() { }); it('will work when no possible rows can be loaded', function () { - var rootNode = mount( + const rootNode = mount( From 196f5c532bf1a2058025692eea92d1a89f520420 Mon Sep 17 00:00:00 2001 From: Gareth Tan Date: Fri, 4 Aug 2017 22:06:12 -0400 Subject: [PATCH 46/78] Fix bottom upwards tests. --- .../bottom_upwards_infinite_test.js.snap | 298 ++++++++++++++++++ __tests__/__snapshots__/infinite_test.js.snap | 38 +++ __tests__/bottom_upwards_infinite_test.js | 266 ++++++---------- __tests__/infinite_test.js | 4 +- 4 files changed, 442 insertions(+), 164 deletions(-) create mode 100644 __tests__/__snapshots__/bottom_upwards_infinite_test.js.snap diff --git a/__tests__/__snapshots__/bottom_upwards_infinite_test.js.snap b/__tests__/__snapshots__/bottom_upwards_infinite_test.js.snap new file mode 100644 index 0000000..d3bd56e --- /dev/null +++ b/__tests__/__snapshots__/bottom_upwards_infinite_test.js.snap @@ -0,0 +1,298 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`The Basic Behavior of the Bottom Upwards Display does not render a space-filling top spacer div when the total element height begins to exceed the container height 1`] = ` +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +`; + +exports[`The Basic Behavior of the Bottom Upwards Display does not render a space-filling top spacer div when the total element height begins to exceed the container height when using the window as the container 1`] = ` +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +`; + +exports[`The Basic Behavior of the Bottom Upwards Display renders a space-filling top spacer div when the total element height is less than the container height 1`] = ` +
    +
    +
    +
    +
    +
    +
    +`; + +exports[`The Basic Behavior of the Bottom Upwards Display renders a space-filling top spacer div when the total element height is less than the container height when using the window as the container 1`] = ` +
    +
    +
    +
    +
    +
    +
    +`; diff --git a/__tests__/__snapshots__/infinite_test.js.snap b/__tests__/__snapshots__/infinite_test.js.snap index b2e14cc..ac9624b 100644 --- a/__tests__/__snapshots__/infinite_test.js.snap +++ b/__tests__/__snapshots__/infinite_test.js.snap @@ -569,6 +569,44 @@ exports[`React Infinite when the window is used as the Container hides DOM eleme `; +exports[`Rendering the React Infinite Component Wrapper applies the provided class name to the root node 1`] = ` +
    +
    +
    +
    +
    +
    +
    +
    +`; + exports[`Rendering the React Infinite Component Wrapper renders itself into the DOM with the correct container styles 1`] = `
    {renderHelpers.divGenerator(1, 100)} - ; - shallowRenderer.render(infinite); + ); - var rootNode = shallowRenderer.getRenderOutput(); - expect(rootNode.props.children.props.children[0].props.style).toEqual({ - width: '100%', - height: 700 - }); + expect(infinite).toMatchSnapshot(); }); // jsdom cannot do offsetheight @@ -68,51 +53,35 @@ describe('The Basic Behavior of the Bottom Upwards Display', function() { //}); it('does not render a space-filling top spacer div when the total element height begins to exceed the container height', function() { - var infinite = + var infinite = renderer.create( {renderHelpers.divGenerator(9, 100)} - ; - shallowRenderer.render(infinite); - - var rootNode = shallowRenderer.getRenderOutput(); - expect(rootNode.props.children.props.children[0].props.style).toEqual({ - width: '100%', - height: 0 - }); + ); + expect(infinite).toMatchSnapshot(); }); it('renders a space-filling top spacer div when the total element height is less than the container height when using the window as the container', function() { - var infinite = {renderHelpers.divGenerator(1, 100)} - ; - shallowRenderer.render(infinite); + ); - var rootNode = shallowRenderer.getRenderOutput(); - expect(rootNode.props.children.props.children[0].props.style).toEqual({ - width: '100%', - height: 700 - }); + expect(infinite).toMatchSnapshot(); }); it('does not render a space-filling top spacer div when the total element height begins to exceed the container height when using the window as the container', function() { - var infinite = {renderHelpers.divGenerator(9, 100)} - ; - shallowRenderer.render(infinite); + ); - var rootNode = shallowRenderer.getRenderOutput(); - expect(rootNode.props.children.props.children[0].props.style).toEqual({ - width: '100%', - height: 0 - }); + expect(infinite).toMatchSnapshot(); }); }); @@ -120,7 +89,7 @@ describe('The Bottom Scroll Preserving Behavior of the Bottom Upwards Display', // Check that it handles browser elasticity as well it('keeps the scroll attached to the bottom even when the element is capable of scrolling upwards', function() { - var rootNode = TestUtils.renderIntoDocument( + const rootNode = mount( @@ -128,34 +97,28 @@ describe('The Bottom Scroll Preserving Behavior of the Bottom Upwards Display', ); - var rootDomNode = ReactDOM.findDOMNode(rootNode); - expect(rootDomNode.scrollTop).toEqual(1200); + expect(rootNode.getDOMNode().scrollTop).toEqual(1200); }); it('keeps the scroll attached to the bottom even when the element is capable of scrolling upwards when the window is used as the container', function () { window.scroll = jest.genMockFunction(); window.innerHeight = 768; - runs(function () { - TestUtils.renderIntoDocument( - - {renderHelpers.divGenerator(20, 100)} - - ) - }); - waitsFor(function() { - return window.scroll.mock.calls.length > 0; - }); + mount( + + {renderHelpers.divGenerator(20, 100)} + + ); - runs(function() { + return Promise.resolve().then(() => { expect(window.scroll).lastCalledWith(0, 2000 - 768); }); }); it('allows upwards scrolling to proceed once the user starts scrolling', function() { - var rootNode = TestUtils.renderIntoDocument( + const rootNode = mount( @@ -163,20 +126,22 @@ describe('The Bottom Scroll Preserving Behavior of the Bottom Upwards Display', ); - var rootDOMNode = ReactDOM.findDOMNode(rootNode); - rootDOMNode.scrollTop = 504; - TestUtils.Simulate.scroll(rootDOMNode, { - target: rootDOMNode + const rootDomNode = rootNode.getDOMNode(); + // Secretly set the scroll to 504 without telling the component + rootDomNode.scrollTop = 504; + // Simulates the user scrolling upwards to 504 + rootNode.simulate('scroll', { + target: rootDomNode }); - expect(rootDOMNode.scrollTop).toEqual(504); + expect(rootDomNode.scrollTop).toEqual(504); }); }); describe('The Infinite Loading Triggering Behavior of the Bottom Upwards Display', function() { it('triggers when the user passes the required point when scrolling upwards', function() { - var infiniteLoader = jest.genMockFunction(); - var rootNode = TestUtils.renderIntoDocument( + const infiniteLoader = jest.genMockFunction(); + const rootNode = mount( ); - var rootDOMNode = ReactDOM.findDOMNode(rootNode); - rootDOMNode.scrollTop = 299; - TestUtils.Simulate.scroll(rootDOMNode, { - target: rootDOMNode + const rootDomNode = rootNode.getDOMNode(); + rootDomNode.scrollTop = 299; + rootNode.simulate('scroll', { + target: rootDomNode }); expect(infiniteLoader.mock.calls.length).toEqual(1); }); it('does not trigger when the user does not pass the required point when scrolling upwards', function() { - var infiniteLoader = jest.genMockFunction(); - var rootNode = TestUtils.renderIntoDocument( + const infiniteLoader = jest.genMockFunction(); + const rootNode = mount( ); - var rootDOMNode = ReactDOM.findDOMNode(rootNode); - rootDOMNode.scrollTop = 301; - TestUtils.Simulate.scroll(rootDOMNode, { - target: rootDOMNode + const rootDomNode = rootNode.getDOMNode(); + rootDomNode.scrollTop = 301; + rootNode.simulate('scroll', { + target: rootDomNode }); expect(infiniteLoader.mock.calls.length).toEqual(0); @@ -219,53 +184,43 @@ describe('The Infinite Loading Triggering Behavior of the Bottom Upwards Display it('triggers when the user passes the required point when the window is used as the scroll container', function() { var infiniteLoader = jest.genMockFunction(); - var rootNode; - var scrollListener; - - window.addEventListener = function(event, f) { - if (event === 'scroll') { - scrollListener = f; - } - }; - - runs(function() { - rootNode = TestUtils.renderIntoDocument( - - {renderHelpers.divGenerator(20, 100)} - - ); + const listenerTriggered = new Promise((resolve, reject) => { + window.addEventListener = function(event, f) { + if (event === 'scroll') { + resolve(f); + } + }; }); - waitsFor(function() { - return !!scrollListener; - }); + mount( + + {renderHelpers.divGenerator(20, 100)} + + ); - runs(function() { + return listenerTriggered.then((listener) => { window.pageYOffset = 299; - scrollListener(); - + listener(); expect(infiniteLoader.mock.calls.length).toEqual(1); }); }); it('does not trigger when the user does not pass the required point when the window is used as the scroll container', function() { - var infiniteLoader = jest.genMockFunction(); - - var rootNode; - var scrollListener; - - window.addEventListener = function(event, f) { - if (event === 'scroll') { - scrollListener = f; - } - }; + const infiniteLoader = jest.genMockFunction(); + + const listenerTriggered = new Promise((resolve, reject) => { + window.addEventListener = function(event, f) { + if (event === 'scroll') { + resolve(f); + } + }; + }); - runs(function() { - rootNode = TestUtils.renderIntoDocument( + mount( {renderHelpers.divGenerator(20, 100)} - ); - }); - - waitsFor(function() { - return !!scrollListener; - }); + ); - runs(function() { + return listenerTriggered.then((listener) => { window.pageYOffset = 301; - scrollListener(); + listener(); expect(infiniteLoader.mock.calls.length).toEqual(0); }); @@ -319,7 +269,7 @@ describe('The Infinite Loading Scroll Maintenance Behavior of the Bottom Upwards expect(infiniteLoader.mock.calls.length).toEqual(1); - //The parent component acknowledges that the component + // The parent component acknowledges that the component // is in the infinite loading state rootNode = ReactDOM.render( - {divs} - , - renderNode - ); + const listenerTriggered = new Promise((resolve, reject) => { + window.addEventListener = function(event, f) { + if (event === 'scroll') { + resolve(f); + } + }; }); - waitsFor(function() { - return !!scrollListener; - }); + ReactDOM.render( + + {divs} + , + renderNode + ); - runs(function() { + return listenerTriggered.then((listener) => { window.pageYOffset = 298; - scrollListener(); + listener(); + expect(infiniteLoader.mock.calls.length).toEqual(1); - rootNode = ReactDOM.render( + ReactDOM.render( From e238a94faf424cfb7e50dc846435164b0014b915 Mon Sep 17 00:00:00 2001 From: Gareth Tan Date: Fri, 4 Aug 2017 22:14:08 -0400 Subject: [PATCH 47/78] Continue upgrading tests. --- .../infinite_styles_test.js.snap | 43 +++++++++++++++++++ __tests__/infinite_error_test.js | 20 +++------ __tests__/infinite_styles_test.js | 26 +++-------- 3 files changed, 54 insertions(+), 35 deletions(-) create mode 100644 __tests__/__snapshots__/infinite_styles_test.js.snap diff --git a/__tests__/__snapshots__/infinite_styles_test.js.snap b/__tests__/__snapshots__/infinite_styles_test.js.snap new file mode 100644 index 0000000..a1e3e59 --- /dev/null +++ b/__tests__/__snapshots__/infinite_styles_test.js.snap @@ -0,0 +1,43 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Infinite Styles Override: can override styles on the scrollable container will be able to override styles on the scrollable container 1`] = ` +
    +
    +
    +
    +
    +
    +
    +
    +`; diff --git a/__tests__/infinite_error_test.js b/__tests__/infinite_error_test.js index 51ac9f9..4598486 100644 --- a/__tests__/infinite_error_test.js +++ b/__tests__/infinite_error_test.js @@ -5,17 +5,9 @@ // do not make sense. This logic is centralized in checkProps, and // throws an error. -jest.dontMock('../src/react-infinite.jsx'); -jest.dontMock('../src/utils/checkProps'); -jest.dontMock('../src/utils/window.js'); -jest.dontMock('lodash.isfinite'); -jest.dontMock('lodash.isarray'); - -var React = require('react'); -var TestUtils = require('react-dom/test-utils'); -var Infinite = require('../src/react-infinite.jsx'); - -var shallowRenderer = require('react-test-renderer/shallow').createRenderer(); +import React from 'react'; +import Infinite from '../src/react-infinite.jsx'; +import renderer from 'react-test-renderer'; describe('Errors when the container height is not provided in some way', function() { it('throws an error when neither containerHeight nor useWindowAsScrollContainer is not provided', function() { @@ -25,7 +17,7 @@ describe('Errors when the container height is not provided in some way', functio ; expect(function() { - shallowRenderer.render(errorfulInfinite); + renderer.create(errorfulInfinite); }).toThrow('Invariant Violation: Either containerHeight or useWindowAsScrollContainer must be provided.'); }); }); @@ -39,7 +31,7 @@ describe('Errors when the elementHeight does not make sense', function() { ; expect(function() { - shallowRenderer.render(errorfulInfinite); + renderer.create(errorfulInfinite); }).toThrow('Invariant Violation: You must provide either a number or an array of numbers as the elementHeight.'); }); }); @@ -53,7 +45,7 @@ describe('Errors an error on elementHeight array length mismatch', function() { ; expect(function() { - shallowRenderer.render(errorfulInfinite); + renderer.create(errorfulInfinite); }).toThrow('Invariant Violation: There must be as many values provided in the elementHeight prop as there are children.'); }); }); diff --git a/__tests__/infinite_styles_test.js b/__tests__/infinite_styles_test.js index 525786b..20a76f1 100644 --- a/__tests__/infinite_styles_test.js +++ b/__tests__/infinite_styles_test.js @@ -5,26 +5,13 @@ // do not make sense. This logic is centralized in checkProps, and // throws an error. -jest.dontMock('../src/react-infinite.jsx'); -jest.dontMock('../src/computers/infiniteComputer.js'); -jest.dontMock('../src/computers/constantInfiniteComputer.js'); -jest.dontMock('../src/computers/arrayInfiniteComputer.js'); -jest.dontMock('../src/utils/binaryIndexSearch.js'); -jest.dontMock('../src/utils/infiniteHelpers.js'); -jest.dontMock('../src/utils/window.js'); -jest.dontMock('./helpers/renderHelpers.js'); -jest.dontMock('lodash.isfinite'); -jest.dontMock('lodash.isarray'); -jest.dontMock('react-dom'); - -var React = require('react'); -var TestUtils = require('react-dom/test-utils'); -var Infinite = require('../src/react-infinite.jsx'); - +import React from 'react'; +import Infinite from '../src/react-infinite.jsx'; +import renderer from 'react-test-renderer'; describe('Infinite Styles Override: can override styles on the scrollable container', function() { it('will be able to override styles on the scrollable container', function() { - var rootNode = TestUtils.renderIntoDocument( + const rootNode = renderer.create( ); - var styles = rootNode.scrollable._style._values; - expect(styles.height).toEqual('800px'); - expect(styles['overflow-x']).toEqual('hidden'); - expect(styles['overflow-y']).toEqual('hidden'); + expect(rootNode).toMatchSnapshot(); }); }); From bd10e421758a66bd4f220363eea5827085f1d2df Mon Sep 17 00:00:00 2001 From: Gareth Tan Date: Fri, 4 Aug 2017 22:34:03 -0400 Subject: [PATCH 48/78] Add fixes. --- .travis.yml | 2 +- package.json | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index 81d03f0..ac9d396 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,5 +9,5 @@ env: script: - ./config/travis/test.sh -before_install: npm install react react-dom prop-types create-react-class +before_install: npm install react react-dom prop-types create-react-class enzyme enzyme-to-json after_success: cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js diff --git a/package.json b/package.json index b8dc8fa..ca779c9 100644 --- a/package.json +++ b/package.json @@ -30,18 +30,16 @@ "prepublish": "gulp release" }, "jest": { - "scriptPreprocessor": "/node_modules/babel-jest", - "testPathDirs": [ + "transform": { + ".*": "/node_modules/babel-jest" + }, + "roots": [ "/__tests__", "/src" ], "testPathIgnorePatterns": [ "/__tests__/helpers" ], - "testFileExtensions": [ - "js", - "jsx" - ], "unmockedModulePathPatterns": [ "/node_modules/react" ], @@ -57,6 +55,8 @@ "coveralls": "^2.11.2", "del": "2.0.2", "envify": "3.4.0", + "enzyme": "2.9.1", + "enzyme-to-json": "1.5.1", "eslint": "1.9.0", "eslint-config-semistandard": "^5.0.0", "eslint-config-standard": "^4.1.0", From b8b7abf414f01a0001364b0fc888c33c3330c8d5 Mon Sep 17 00:00:00 2001 From: Gareth Tan Date: Sat, 5 Aug 2017 00:00:40 -0400 Subject: [PATCH 49/78] Convert to ES2015 class. --- src/react-infinite.jsx | 176 ++++++++++++---------- src/utils/infiniteHelpers.js | 5 + src/utils/types.js | 11 -- typelib/component/react_infinite_types.js | 17 ++- 4 files changed, 109 insertions(+), 100 deletions(-) delete mode 100644 src/utils/types.js diff --git a/src/react-infinite.jsx b/src/react-infinite.jsx index 0f846aa..ef328e2 100644 --- a/src/react-infinite.jsx +++ b/src/react-infinite.jsx @@ -2,7 +2,6 @@ var React = global.React || require('react'); var PropTypes = global.PropTypes || require('prop-types'); -var createReactClass = global.createReactClass || require('create-react-class'); var window = require('./utils/window'); @@ -11,11 +10,12 @@ var scaleEnum = require('./utils/scaleEnum'); var infiniteHelpers = require('./utils/infiniteHelpers'); var _isFinite = require('lodash.isfinite'); -var preloadType = require('./utils/types').preloadType; var checkProps = checkProps = require('./utils/checkProps'); -var Infinite = createReactClass({ - propTypes: { +class Infinite extends React.Component { + state: ReactInfiniteState; + + static propTypes = { children: PropTypes.any, handleScroll: PropTypes.func, @@ -24,13 +24,25 @@ var Infinite = createReactClass({ // happen each preloadBatchSize pixels of scrolling. // Set a larger number to cause fewer updates to the // element list. - preloadBatchSize: preloadType, + preloadBatchSize: PropTypes.oneOfType([ + PropTypes.number, + PropTypes.shape({ + type: PropTypes.oneOf(['containerHeightScaleFactor']).isRequired, + amount: PropTypes.number.isRequired + }) + ]), // preloadAdditionalHeight determines how much of the // list above and below the container is preloaded even // when it is not currently visible to the user. In the // regular scroll implementation, preloadAdditionalHeight // is equal to the entire height of the list. - preloadAdditionalHeight: preloadType, // page to screen ratio + preloadAdditionalHeight: PropTypes.oneOfType([ + PropTypes.number, + PropTypes.shape({ + type: PropTypes.oneOf(['containerHeightScaleFactor']).isRequired, + amount: PropTypes.number.isRequired + }) + ]), // page to screen ratio // The provided elementHeight can be either // 1. a constant: all elements are the same height @@ -58,73 +70,68 @@ var Infinite = createReactClass({ styles: PropTypes.shape({ scrollableStyle: PropTypes.object }).isRequired - }, - statics: { - containerHeightScaleFactor(factor) { - if (!_isFinite(factor)) { - throw new Error('The scale factor must be a number.'); - } - return { - type: scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR, - amount: factor - }; - } - }, + }; - // Properties currently used but which may be - // refactored away in the future. - computedProps: {}, - utils: {}, - shouldAttachToBottom: false, - preservedScrollState: 0, - loadingSpinnerHeight: 0, - deprecationWarned: false, - - scrollable: null, - topSpacer: null, - bottomSpacer: null, - smoothScrollingWrapper: null, - loadingSpinner: null, - - getDefaultProps(): ReactInfiniteProvidedDefaultProps { + static containerHeightScaleFactor(factor) { + if (!_isFinite(factor)) { + throw new Error('The scale factor must be a number.'); + } return { - handleScroll: () => { - }, + type: scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR, + amount: factor + }; + } - useWindowAsScrollContainer: false, + static defaultProps = { + handleScroll: () => {}, - onInfiniteLoad: () => { - }, - loadingSpinnerDelegate:
    , + useWindowAsScrollContainer: false, - displayBottomUpwards: false, + onInfiniteLoad: () => {}, + loadingSpinnerDelegate:
    , - isInfiniteLoading: false, - timeScrollStateLastsForAfterUserScrolls: 150, + displayBottomUpwards: false, - className: '', + isInfiniteLoading: false, + timeScrollStateLastsForAfterUserScrolls: 150, - styles: {} - }; - }, + className: '', + + styles: {} + }; - // automatic adjust to scroll direction - // give spinner a ReactCSSTransitionGroup - getInitialState() { - var nextInternalState = this.recomputeInternalStateFromProps(this.props); + constructor(props: ReactInfiniteProps) { + super(props); + const nextInternalState = this.recomputeInternalStateFromProps(props); this.computedProps = nextInternalState.computedProps; this.utils = nextInternalState.utils; - this.shouldAttachToBottom = this.props.displayBottomUpwards; + this.shouldAttachToBottom = props.displayBottomUpwards; - var state = nextInternalState.newState; + const state = nextInternalState.newState; state.scrollTimeout = undefined; state.isScrolling = false; - return state; - }, + this.state = state; + } + + // Properties currently used but which may be + // refactored away in the future. + computedProps: ReactInfiniteComputedProps; - generateComputedUtilityFunctions(props: ReactInfiniteProps): ReactInfiniteUtilityFunctions { + utils: ReactInfiniteUtilityFunctions; + shouldAttachToBottom = false; + preservedScrollState = 0; + loadingSpinnerHeight = 0; + + // Refs + scrollable: HTMLDivElement; + topSpacer: HTMLDivElement; + bottomSpacer: HTMLDivElement; + smoothScrollingWrapper: HTMLDivElement; + loadingSpinner: HTMLDivElement; + + generateComputedUtilityFunctions = (props: ReactInfiniteProps): ReactInfiniteUtilityFunctions => { var utilities = {}; utilities.getLoadingSpinnerHeight = () => { var loadingSpinnerHeight = 0; @@ -172,13 +179,13 @@ var Infinite = createReactClass({ }; } return utilities; - }, + }; - recomputeInternalStateFromProps(props: ReactInfiniteProps): { + recomputeInternalStateFromProps = (props: ReactInfiniteProps): { computedProps: ReactInfiniteComputedProps, utils: ReactInfiniteUtilityFunctions, newState: ReactInfiniteState - } { + } => { checkProps(props); var computedProps = infiniteHelpers.generateComputedProps(props); var utils: ReactInfiniteUtilityFunctions = this.generateComputedUtilityFunctions(props); @@ -207,7 +214,7 @@ var Infinite = createReactClass({ utils, newState }; - }, + }; componentWillReceiveProps(nextProps: ReactInfiniteProps) { var nextInternalState = this.recomputeInternalStateFromProps(nextProps); @@ -216,13 +223,13 @@ var Infinite = createReactClass({ this.utils = nextInternalState.utils; this.setState(nextInternalState.newState); - }, + } componentWillUpdate() { if (this.props.displayBottomUpwards) { this.preservedScrollState = this.utils.getScrollTop() - this.loadingSpinnerHeight; } - }, + } componentDidUpdate(prevProps: ReactInfiniteProps, prevState: ReactInfiniteState) { this.loadingSpinnerHeight = this.utils.getLoadingSpinnerHeight(); @@ -251,7 +258,7 @@ var Infinite = createReactClass({ if (isMissingVisibleRows) { this.onInfiniteLoad(); } - }, + } componentDidMount() { this.utils.subscribeToScrollListener(); @@ -266,21 +273,21 @@ var Infinite = createReactClass({ this.utils.setScrollTop(lowestScrollTop); } } - }, + } componentWillUnmount() { this.utils.unsubscribeFromScrollListener(); - }, + } - infiniteHandleScroll(e: SyntheticEvent) { + infiniteHandleScroll = (e: SyntheticEvent) => { if (this.utils.scrollShouldBeIgnored(e)) { return; } this.computedProps.handleScroll(this.scrollable); this.handleScroll(this.utils.getScrollTop()); - }, + }; - manageScrollTimeouts() { + manageScrollTimeouts = () => { // Maintains a series of timeouts to set this.state.isScrolling // to be true when the element is scrolling. @@ -300,33 +307,38 @@ var Infinite = createReactClass({ isScrolling: true, scrollTimeout: scrollTimeout }); - }, + }; - getLowestPossibleScrollTop(): number { + getLowestPossibleScrollTop = (): number => { return this.state.infiniteComputer.getTotalScrollableHeight() - this.computedProps.containerHeight; - }, + }; - hasAllVisibleItems(): boolean { + hasAllVisibleItems = (): boolean => { return !(_isFinite(this.computedProps.infiniteLoadBeginEdgeOffset) && this.state.infiniteComputer.getTotalScrollableHeight() < this.computedProps.containerHeight); - }, + }; + + passedEdgeForInfiniteScroll = (scrollTop: number): boolean => { + const edgeOffset = this.computedProps.infiniteLoadBeginEdgeOffset; + if (typeof edgeOffset !== 'number') { + return false; + } - passedEdgeForInfiniteScroll(scrollTop: number): boolean { if (this.computedProps.displayBottomUpwards) { - return !this.shouldAttachToBottom && scrollTop < this.computedProps.infiniteLoadBeginEdgeOffset; + return !this.shouldAttachToBottom && scrollTop < edgeOffset; } else { return scrollTop > this.state.infiniteComputer.getTotalScrollableHeight() - this.computedProps.containerHeight - - this.computedProps.infiniteLoadBeginEdgeOffset; + edgeOffset; } - }, + }; - onInfiniteLoad() { + onInfiniteLoad = () => { this.setState({ isInfiniteLoading: true }); this.computedProps.onInfiniteLoad(); - }, + }; - handleScroll(scrollTop: number) { + handleScroll = (scrollTop: number) => { this.shouldAttachToBottom = this.computedProps.displayBottomUpwards && scrollTop >= this.getLowestPossibleScrollTop(); @@ -343,7 +355,7 @@ var Infinite = createReactClass({ } else { this.setState(newApertureState); } - }, + }; render() { var displayables; @@ -394,7 +406,7 @@ var Infinite = createReactClass({
    ; } -}); +} module.exports = Infinite; global.Infinite = Infinite; diff --git a/src/utils/infiniteHelpers.js b/src/utils/infiniteHelpers.js index 7c3c6d6..782845b 100644 --- a/src/utils/infiniteHelpers.js +++ b/src/utils/infiniteHelpers.js @@ -55,6 +55,8 @@ function generateComputedProps(props: ReactInfiniteProps): ReactInfiniteComputed var {containerHeight, preloadBatchSize, preloadAdditionalHeight, + handleScroll, + onInfiniteLoad, ...oldProps} = props; var newProps = {}; @@ -62,6 +64,9 @@ function generateComputedProps(props: ReactInfiniteProps): ReactInfiniteComputed newProps.containerHeight = props.useWindowAsScrollContainer ? window.innerHeight : containerHeight; + newProps.handleScroll = handleScroll || (() => {}); + newProps.onInfiniteLoad = onInfiniteLoad || (() => {}); + var defaultPreloadBatchSizeScaling = { type: scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR, amount: 0.5 diff --git a/src/utils/types.js b/src/utils/types.js deleted file mode 100644 index 32b940a..0000000 --- a/src/utils/types.js +++ /dev/null @@ -1,11 +0,0 @@ -var PropTypes = global.PropTypes || require('prop-types'); - -module.exports = { - preloadType: PropTypes.oneOfType([ - PropTypes.number, - PropTypes.shape({ - type: PropTypes.oneOf(['containerHeightScaleFactor']).isRequired, - amount: PropTypes.number.isRequired - }) - ]) -}; diff --git a/typelib/component/react_infinite_types.js b/typelib/component/react_infinite_types.js index 35573fa..d18a3f8 100644 --- a/typelib/component/react_infinite_types.js +++ b/typelib/component/react_infinite_types.js @@ -1,9 +1,9 @@ import type React from 'react'; -type PreloadType = number | { +type PreloadType = number | {| type: string, amount: number -}; +|}; type ElementHeight = number | Array; type CSSStyle = {[key: string]: string | number}; @@ -62,13 +62,13 @@ type ReactInfiniteProps = { className?: string, styles: { - scrollableStyle?: Object + scrollableStyle?: CSSStyle } }; type ReactInfiniteComputedProps = { children: any, - handleScroll?: (event: any) => any, + handleScroll: (event: any) => any, preloadBatchSize: number, preloadAdditionalHeight: number, @@ -80,13 +80,16 @@ type ReactInfiniteComputedProps = { displayBottomUpwards: boolean, infiniteLoadBeginEdgeOffset?: number, - onInfiniteLoad?: () => any, - loadingSpinnerDelegate?: React.Element, + onInfiniteLoad: () => any, + loadingSpinnerDelegate?: React.Element<*>, isInfiniteLoading?: boolean, timeScrollStateLastsForAfterUserScrolls?: number, - className?: string + className?: string, + styles: { + scrollableStyle?: CSSStyle + } }; type ReactInfiniteState = { From 9c80491e0f3dc5bef6b50bfc60b5baf1f1d496bc Mon Sep 17 00:00:00 2001 From: Gareth Tan Date: Sat, 5 Aug 2017 00:24:32 -0400 Subject: [PATCH 50/78] Fix tests after component upgrade. --- .babelrc | 4 +++ __tests__/__snapshots__/infinite_test.js.snap | 32 +++++++++---------- 2 files changed, 20 insertions(+), 16 deletions(-) create mode 100644 .babelrc diff --git a/.babelrc b/.babelrc new file mode 100644 index 0000000..a3c05ee --- /dev/null +++ b/.babelrc @@ -0,0 +1,4 @@ +{ + "presets": ["es2015", "flow", "react"], + "plugins": ["transform-class-properties", "transform-object-rest-spread"] +} diff --git a/__tests__/__snapshots__/infinite_test.js.snap b/__tests__/__snapshots__/infinite_test.js.snap index ac9624b..ef13e77 100644 --- a/__tests__/__snapshots__/infinite_test.js.snap +++ b/__tests__/__snapshots__/infinite_test.js.snap @@ -85,7 +85,7 @@ exports[`Maintaining React Infinite's internal scroll state has does not have po `; exports[`Maintaining React Infinite's internal scroll state has pointer-events: none upon scroll 1`] = ` -
    - + `; exports[`React Infinite when the window is used as the Container alters the elements displayed when a scroll has occurred 1`] = ` -
    - +
    `; exports[`React Infinite when the window is used as the Container alters the elements displayed when a scroll has occurred 2`] = ` -
    - + `; exports[`React Infinite when the window is used as the Container does not attach a scrollable style 1`] = ` @@ -480,7 +480,7 @@ exports[`React Infinite when the window is used as the Container does not attach `; exports[`React Infinite when the window is used as the Container hides DOM elements that are below the visible range of the window 1`] = ` -
    - + `; exports[`Rendering the React Infinite Component Wrapper applies the provided class name to the root node 1`] = ` @@ -646,7 +646,7 @@ exports[`Rendering the React Infinite Component Wrapper renders itself into the `; exports[`The Behavior of the Variable Height React Infinite Component functions correctly at the end of its range 1`] = ` -
    - + `; exports[`The Behavior of the Variable Height React Infinite Component hides elements when the user has not yet scrolled 1`] = ` @@ -908,7 +908,7 @@ exports[`The Behavior of the Variable Height React Infinite Component hides elem `; exports[`The Behavior of the Variable Height React Infinite Component hides visible elements when the user scrolls sufficiently 1`] = ` -
    - + `; exports[`The Children of the React Infinite Component renders its children when no hiding behavior is required 1`] = ` @@ -1412,7 +1412,7 @@ exports[`The Children of the React Infinite Component renders more children when `; exports[`The Scrolling Behavior of the Constant Height React Infinite Component functions correctly at the end of its range 1`] = ` -
    - + `; exports[`The Scrolling Behavior of the Constant Height React Infinite Component hides visible elements when the user scrolls sufficiently 1`] = ` -
    - + `; From 507a2b659959b16e288b0af338ec00409a5b12c4 Mon Sep 17 00:00:00 2001 From: Gareth Tan Date: Sat, 5 Aug 2017 00:25:25 -0400 Subject: [PATCH 51/78] Update package.json. --- package.json | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index ca779c9..aeb2321 100644 --- a/package.json +++ b/package.json @@ -21,10 +21,10 @@ }, "browser": "build/react-infinite.js", "scripts": { - "test": "./node_modules/.bin/jest", - "lint": "./node_modules/.bin/eslint ./src --ext .jsx --ext .js", - "fix": "./node_modules/.bin/eslint --fix --ext .jsx --ext .js ./src ./__tests__ ./pipeline", - "typecheck": "./node_modules/.bin/flow version && ./node_modules/.bin/flow check", + "test": "jest", + "lint": "eslint ./src --ext .jsx --ext .js", + "fix": "eslint --fix --ext .jsx --ext .js ./src ./__tests__ ./pipeline", + "typecheck": "flow version && flow check", "verify": "npm test && npm run typecheck && npm run lint", "preversion": "npm run verify", "prepublish": "gulp release" @@ -49,7 +49,11 @@ "homepage": "https://github.com/seatgeek/react-infinite", "devDependencies": { "babel-eslint": "^4.0.7", - "babel-jest": "^5.3.0", + "babel-jest": "20.0.3", + "babel-plugin-transform-class-properties": "6.24.1", + "babel-plugin-transform-object-rest-spread": "6.23.0", + "babel-preset-es2015": "6.24.1", + "babel-preset-react": "6.24.1", "babelify": "^6.3.0", "browserify": "^9.0.3", "coveralls": "^2.11.2", @@ -81,14 +85,17 @@ "yargs": "^1.3.2" }, "dependencies": { + "create-react-class": "15.6.0", "lodash.isarray": "3.0.4", "lodash.isfinite": "3.2.0", - "object-assign": "4.0.1" + "object-assign": "4.0.1", + "prop-types": "15.5.10", + "react": "15.6.1", + "react-dom": "15.6.1" }, "peerDependencies": { "react": "^15.5.0", "react-dom": "^15.5.0", - "create-react-class": "^15.5.0", "prop-types": "^15.5.0" }, "browserify": { From 9dbfb557f4e2a495fcc432a1056bf2badff28639 Mon Sep 17 00:00:00 2001 From: Gareth Tan Date: Sat, 5 Aug 2017 00:59:05 -0400 Subject: [PATCH 52/78] Upgrade ESLint to standard SeatGeek configuration. --- .eslintrc | 47 ++++++++--------------------------------------- package.json | 11 +++++------ 2 files changed, 13 insertions(+), 45 deletions(-) diff --git a/.eslintrc b/.eslintrc index cf2d27b..fff6d27 100644 --- a/.eslintrc +++ b/.eslintrc @@ -1,52 +1,21 @@ { "parser": "babel-eslint", - - "rules": { - "curly": [2, "all"], - "indent": [2, 2, {"VariableDeclarator": 2}], - "linebreak-style": [2, "unix"], - "one-var": 0, - "space-before-function-paren": [2, "never"], - - "react/jsx-boolean-value": 1, - "react/jsx-curly-spacing": [2, "never"], - "react/jsx-no-undef": 1, - "react/no-danger": 1, - "react/react-in-jsx-scope": 1 - }, - "globals": { "require": false, "module": false, - "global": false, - - "SyntheticEvent": false, - "ReactElement": false, - - "PreloadType": false, - "ElementHeight": false, - "CSSStyle": false, - "ReactInfiniteUtilityFunctions": false, - "ReactInfiniteProvidedDefaultProps": false, - "ReactInfiniteProps": false, - "ReactInfiniteComputedProps": false, - "ReactInfiniteState": false, - "InfiniteComputer": false + "global": false }, - "env": { "es6": true, "browser": true }, - - "extends": ["semistandard"], - - "ecmaFeatures": { - "jsx": true, - "experimentalObjectRestSpread": true - }, - + "extends": [ + "seatgeek-standard", + "seatgeek-react-standard" + ], "plugins": [ - "react" + "react", + "prettier" ] } + diff --git a/package.json b/package.json index aeb2321..df17154 100644 --- a/package.json +++ b/package.json @@ -48,7 +48,7 @@ }, "homepage": "https://github.com/seatgeek/react-infinite", "devDependencies": { - "babel-eslint": "^4.0.7", + "babel-eslint": "7.2.3", "babel-jest": "20.0.3", "babel-plugin-transform-class-properties": "6.24.1", "babel-plugin-transform-object-rest-spread": "6.23.0", @@ -61,11 +61,10 @@ "envify": "3.4.0", "enzyme": "2.9.1", "enzyme-to-json": "1.5.1", - "eslint": "1.9.0", - "eslint-config-semistandard": "^5.0.0", - "eslint-config-standard": "^4.1.0", - "eslint-plugin-react": "^3.2.3", - "eslint-plugin-standard": "^1.2.0", + "eslint": "4.3.0", + "eslint-config-seatgeek-react-standard": "4.0.0", + "eslint-config-seatgeek-standard": "5.0.0", + "eslint-plugin-react": "7.1.0", "flow-bin": "0.52.0", "gulp": "^3.8.8", "gulp-babel": "^5.2.1", From f020bab9c1b6fc6b8b40f7faeed47bb691145178 Mon Sep 17 00:00:00 2001 From: Gareth Tan Date: Sat, 5 Aug 2017 01:06:09 -0400 Subject: [PATCH 53/78] Fix flowtype linting. --- .eslintrc | 7 ++++++- package.json | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.eslintrc b/.eslintrc index fff6d27..05355d9 100644 --- a/.eslintrc +++ b/.eslintrc @@ -9,13 +9,18 @@ "es6": true, "browser": true }, + "rules": { + "react/no-did-update-set-state": "off", + "flowtype/define-flow-type": 1 + }, "extends": [ "seatgeek-standard", "seatgeek-react-standard" ], "plugins": [ "react", - "prettier" + "prettier", + "flowtype" ] } diff --git a/package.json b/package.json index df17154..abece61 100644 --- a/package.json +++ b/package.json @@ -62,6 +62,7 @@ "enzyme": "2.9.1", "enzyme-to-json": "1.5.1", "eslint": "4.3.0", + "eslint-plugin-flowtype": "2.35.0", "eslint-config-seatgeek-react-standard": "4.0.0", "eslint-config-seatgeek-standard": "5.0.0", "eslint-plugin-react": "7.1.0", From 5f940cc55ab19809caa1bb596b09f41927b84cd6 Mon Sep 17 00:00:00 2001 From: Gareth Tan Date: Sat, 5 Aug 2017 01:07:02 -0400 Subject: [PATCH 54/78] Format with prettier. --- __tests__/array_infinite_computer_test.js | 21 +- __tests__/binary_search_test.js | 131 +++- __tests__/bottom_upwards_infinite_test.js | 230 ++++--- __tests__/constant_infinite_computer_test.js | 18 +- __tests__/helpers/renderHelpers.js | 12 +- __tests__/infinite_error_test.js | 47 +- __tests__/infinite_styles_test.js | 14 +- __tests__/infinite_test.js | 667 ++++++++++++------- pipeline/browserify.js | 73 +- src/computers/arrayInfiniteComputer.js | 18 +- src/computers/constantInfiniteComputer.js | 5 +- src/computers/infiniteComputer.js | 8 +- src/react-infinite.jsx | 208 ++++-- src/utils/binaryIndexSearch.js | 14 +- src/utils/checkProps.js | 15 +- src/utils/infiniteHelpers.js | 94 ++- 16 files changed, 991 insertions(+), 584 deletions(-) diff --git a/__tests__/array_infinite_computer_test.js b/__tests__/array_infinite_computer_test.js index 4b77f0c..f9863ef 100644 --- a/__tests__/array_infinite_computer_test.js +++ b/__tests__/array_infinite_computer_test.js @@ -31,22 +31,30 @@ describe('Array Infinite Computer', () => { describe('getDisplayIndexStart()', () => { it('computes the correct display index when precisely at element border', () => { - var aic = new ArrayInfiniteComputer([20, 30, 40, 50, 60, 70, 80, 90, 100], 8); + var aic = new ArrayInfiniteComputer( + [20, 30, 40, 50, 60, 70, 80, 90, 100], + 8 + ); expect(aic.getDisplayIndexStart(200)).toEqual(4); }); it('computes the correct display index when not precisely at element border', () => { - var aic = new ArrayInfiniteComputer([20, 30, 40, 50, 60, 70, 80, 90, 100], 8); + var aic = new ArrayInfiniteComputer( + [20, 30, 40, 50, 60, 70, 80, 90, 100], + 8 + ); expect(aic.getDisplayIndexStart(130)).toEqual(3); }); it('computes a zero display index correctly', () => { - var aic = new ArrayInfiniteComputer([20, 30, 40, 50, 60, 70, 80, 90, 100], 8); + var aic = new ArrayInfiniteComputer( + [20, 30, 40, 50, 60, 70, 80, 90, 100], + 8 + ); expect(aic.getDisplayIndexStart(0)).toEqual(0); }); - - it('computes a zero display index correctly', () => { + it('computes a zero display index correctly with one array element', () => { var aic = new ArrayInfiniteComputer([20], 1); expect(aic.getDisplayIndexStart(10)).toEqual(0); }); @@ -82,8 +90,7 @@ describe('Array Infinite Computer', () => { expect(aic.getDisplayIndexEnd(0)).toEqual(-1); }); - xit('computes indexes correctly with zero-height elements', () => { - }); + // xit('computes indexes correctly with zero-height elements', () => {}); }); describe('getTopSpacerHeight()', () => { diff --git a/__tests__/binary_search_test.js b/__tests__/binary_search_test.js index 0793e36..e97767e 100644 --- a/__tests__/binary_search_test.js +++ b/__tests__/binary_search_test.js @@ -3,10 +3,9 @@ jest.dontMock('../src/utils/binaryIndexSearch.js'); var bs = require('../src/utils/binaryIndexSearch.js'), - binaryIndexSearch = bs.binaryIndexSearch; + binaryIndexSearch = bs.binaryIndexSearch; describe('Binary Index Search', function() { - describe('arrays of length 0', function() { var array; @@ -67,47 +66,107 @@ describe('Binary Index Search', function() { }); it('is able to find the closest lower element, or the element itself', function() { - expect(binaryIndexSearch(evenArray, 27, bs.opts.CLOSEST_LOWER)).toBeUndefined(); - expect(binaryIndexSearch(evenArray, 47, bs.opts.CLOSEST_LOWER)).toEqual(0); - expect(binaryIndexSearch(evenArray, 49, bs.opts.CLOSEST_LOWER)).toEqual(1); - expect(binaryIndexSearch(evenArray, 200, bs.opts.CLOSEST_LOWER)).toEqual(2); - expect(binaryIndexSearch(evenArray, 3049, bs.opts.CLOSEST_LOWER)).toEqual(3); - - expect(binaryIndexSearch(evenArray, 28, bs.opts.CLOSEST_LOWER)).toEqual(0); - expect(binaryIndexSearch(evenArray, 48, bs.opts.CLOSEST_LOWER)).toEqual(1); - expect(binaryIndexSearch(evenArray, 192, bs.opts.CLOSEST_LOWER)).toEqual(2); - expect(binaryIndexSearch(evenArray, 2048, bs.opts.CLOSEST_LOWER)).toEqual(3); - - expect(binaryIndexSearch(oddArray, 5, bs.opts.CLOSEST_LOWER)).toBeUndefined(); - expect(binaryIndexSearch(oddArray, 200, bs.opts.CLOSEST_LOWER)).toEqual(0); - expect(binaryIndexSearch(oddArray, 204, bs.opts.CLOSEST_LOWER)).toEqual(1); - expect(binaryIndexSearch(oddArray, 10192, bs.opts.CLOSEST_LOWER)).toEqual(2); + expect( + binaryIndexSearch(evenArray, 27, bs.opts.CLOSEST_LOWER) + ).toBeUndefined(); + expect(binaryIndexSearch(evenArray, 47, bs.opts.CLOSEST_LOWER)).toEqual( + 0 + ); + expect(binaryIndexSearch(evenArray, 49, bs.opts.CLOSEST_LOWER)).toEqual( + 1 + ); + expect(binaryIndexSearch(evenArray, 200, bs.opts.CLOSEST_LOWER)).toEqual( + 2 + ); + expect(binaryIndexSearch(evenArray, 3049, bs.opts.CLOSEST_LOWER)).toEqual( + 3 + ); + + expect(binaryIndexSearch(evenArray, 28, bs.opts.CLOSEST_LOWER)).toEqual( + 0 + ); + expect(binaryIndexSearch(evenArray, 48, bs.opts.CLOSEST_LOWER)).toEqual( + 1 + ); + expect(binaryIndexSearch(evenArray, 192, bs.opts.CLOSEST_LOWER)).toEqual( + 2 + ); + expect(binaryIndexSearch(evenArray, 2048, bs.opts.CLOSEST_LOWER)).toEqual( + 3 + ); + + expect( + binaryIndexSearch(oddArray, 5, bs.opts.CLOSEST_LOWER) + ).toBeUndefined(); + expect(binaryIndexSearch(oddArray, 200, bs.opts.CLOSEST_LOWER)).toEqual( + 0 + ); + expect(binaryIndexSearch(oddArray, 204, bs.opts.CLOSEST_LOWER)).toEqual( + 1 + ); + expect(binaryIndexSearch(oddArray, 10192, bs.opts.CLOSEST_LOWER)).toEqual( + 2 + ); expect(binaryIndexSearch(oddArray, 11, bs.opts.CLOSEST_LOWER)).toEqual(0); - expect(binaryIndexSearch(oddArray, 203, bs.opts.CLOSEST_LOWER)).toEqual(1); - expect(binaryIndexSearch(oddArray, 482, bs.opts.CLOSEST_LOWER)).toEqual(2); + expect(binaryIndexSearch(oddArray, 203, bs.opts.CLOSEST_LOWER)).toEqual( + 1 + ); + expect(binaryIndexSearch(oddArray, 482, bs.opts.CLOSEST_LOWER)).toEqual( + 2 + ); }); it('is able to find the closest higher element, or the element itself', function() { - expect(binaryIndexSearch(evenArray, 0, bs.opts.CLOSEST_HIGHER)).toEqual(0); - expect(binaryIndexSearch(evenArray, 40, bs.opts.CLOSEST_HIGHER)).toEqual(1); - expect(binaryIndexSearch(evenArray, 100, bs.opts.CLOSEST_HIGHER)).toEqual(2); - expect(binaryIndexSearch(evenArray, 2000, bs.opts.CLOSEST_HIGHER)).toEqual(3); - expect(binaryIndexSearch(evenArray, 4823, bs.opts.CLOSEST_HIGHER)).toBeUndefined(); - - expect(binaryIndexSearch(evenArray, 28, bs.opts.CLOSEST_HIGHER)).toEqual(0); - expect(binaryIndexSearch(evenArray, 48, bs.opts.CLOSEST_HIGHER)).toEqual(1); - expect(binaryIndexSearch(evenArray, 192, bs.opts.CLOSEST_HIGHER)).toEqual(2); - expect(binaryIndexSearch(evenArray, 2048, bs.opts.CLOSEST_HIGHER)).toEqual(3); + expect(binaryIndexSearch(evenArray, 0, bs.opts.CLOSEST_HIGHER)).toEqual( + 0 + ); + expect(binaryIndexSearch(evenArray, 40, bs.opts.CLOSEST_HIGHER)).toEqual( + 1 + ); + expect(binaryIndexSearch(evenArray, 100, bs.opts.CLOSEST_HIGHER)).toEqual( + 2 + ); + expect( + binaryIndexSearch(evenArray, 2000, bs.opts.CLOSEST_HIGHER) + ).toEqual(3); + expect( + binaryIndexSearch(evenArray, 4823, bs.opts.CLOSEST_HIGHER) + ).toBeUndefined(); + + expect(binaryIndexSearch(evenArray, 28, bs.opts.CLOSEST_HIGHER)).toEqual( + 0 + ); + expect(binaryIndexSearch(evenArray, 48, bs.opts.CLOSEST_HIGHER)).toEqual( + 1 + ); + expect(binaryIndexSearch(evenArray, 192, bs.opts.CLOSEST_HIGHER)).toEqual( + 2 + ); + expect( + binaryIndexSearch(evenArray, 2048, bs.opts.CLOSEST_HIGHER) + ).toEqual(3); expect(binaryIndexSearch(oddArray, 2, bs.opts.CLOSEST_HIGHER)).toEqual(0); - expect(binaryIndexSearch(oddArray, 100, bs.opts.CLOSEST_HIGHER)).toEqual(1); - expect(binaryIndexSearch(oddArray, 300, bs.opts.CLOSEST_HIGHER)).toEqual(2); - expect(binaryIndexSearch(oddArray, 692, bs.opts.CLOSEST_HIGHER)).toBeUndefined(); - - expect(binaryIndexSearch(oddArray, 11, bs.opts.CLOSEST_HIGHER)).toEqual(0); - expect(binaryIndexSearch(oddArray, 203, bs.opts.CLOSEST_HIGHER)).toEqual(1); - expect(binaryIndexSearch(oddArray, 482, bs.opts.CLOSEST_HIGHER)).toEqual(2); + expect(binaryIndexSearch(oddArray, 100, bs.opts.CLOSEST_HIGHER)).toEqual( + 1 + ); + expect(binaryIndexSearch(oddArray, 300, bs.opts.CLOSEST_HIGHER)).toEqual( + 2 + ); + expect( + binaryIndexSearch(oddArray, 692, bs.opts.CLOSEST_HIGHER) + ).toBeUndefined(); + + expect(binaryIndexSearch(oddArray, 11, bs.opts.CLOSEST_HIGHER)).toEqual( + 0 + ); + expect(binaryIndexSearch(oddArray, 203, bs.opts.CLOSEST_HIGHER)).toEqual( + 1 + ); + expect(binaryIndexSearch(oddArray, 482, bs.opts.CLOSEST_HIGHER)).toEqual( + 2 + ); }); }); }); diff --git a/__tests__/bottom_upwards_infinite_test.js b/__tests__/bottom_upwards_infinite_test.js index 9e706ff..d5594c5 100644 --- a/__tests__/bottom_upwards_infinite_test.js +++ b/__tests__/bottom_upwards_infinite_test.js @@ -13,21 +13,22 @@ describe('The Basic Behavior of the Bottom Upwards Display', function() { it('does not throw an error when set', function() { expect(function() { renderer.create( - - + ); }).not.toThrow(); }); it('renders a space-filling top spacer div when the total element height is less than the container height', function() { - var infinite = renderer.create( - {renderHelpers.divGenerator(1, 100)} - ); + var infinite = renderer.create( + + {renderHelpers.divGenerator(1, 100)} + + ); expect(infinite).toMatchSnapshot(); }); @@ -50,36 +51,44 @@ describe('The Basic Behavior of the Bottom Upwards Display', function() { // height: 600 // }}/> // ); - //}); + // }); it('does not render a space-filling top spacer div when the total element height begins to exceed the container height', function() { - var infinite = renderer.create( - {renderHelpers.divGenerator(9, 100)} - ); + var infinite = renderer.create( + + {renderHelpers.divGenerator(9, 100)} + + ); expect(infinite).toMatchSnapshot(); }); it('renders a space-filling top spacer div when the total element height is less than the container height when using the window as the container', function() { - var infinite = renderer.create( - {renderHelpers.divGenerator(1, 100)} - ); + var infinite = renderer.create( + + {renderHelpers.divGenerator(1, 100)} + + ); expect(infinite).toMatchSnapshot(); }); it('does not render a space-filling top spacer div when the total element height begins to exceed the container height when using the window as the container', function() { - var infinite = renderer.create( - {renderHelpers.divGenerator(9, 100)} - ); + var infinite = renderer.create( + + {renderHelpers.divGenerator(9, 100)} + + ); expect(infinite).toMatchSnapshot(); }); @@ -90,9 +99,7 @@ describe('The Bottom Scroll Preserving Behavior of the Bottom Upwards Display', it('keeps the scroll attached to the bottom even when the element is capable of scrolling upwards', function() { const rootNode = mount( - + {renderHelpers.divGenerator(20, 100)} ); @@ -100,14 +107,16 @@ describe('The Bottom Scroll Preserving Behavior of the Bottom Upwards Display', expect(rootNode.getDOMNode().scrollTop).toEqual(1200); }); - it('keeps the scroll attached to the bottom even when the element is capable of scrolling upwards when the window is used as the container', function () { + it('keeps the scroll attached to the bottom even when the element is capable of scrolling upwards when the window is used as the container', function() { window.scroll = jest.genMockFunction(); window.innerHeight = 768; mount( - + {renderHelpers.divGenerator(20, 100)} ); @@ -119,9 +128,7 @@ describe('The Bottom Scroll Preserving Behavior of the Bottom Upwards Display', it('allows upwards scrolling to proceed once the user starts scrolling', function() { const rootNode = mount( - + {renderHelpers.divGenerator(20, 100)} ); @@ -142,11 +149,13 @@ describe('The Infinite Loading Triggering Behavior of the Bottom Upwards Display it('triggers when the user passes the required point when scrolling upwards', function() { const infiniteLoader = jest.genMockFunction(); const rootNode = mount( - + {renderHelpers.divGenerator(20, 100)} ); @@ -163,11 +172,13 @@ describe('The Infinite Loading Triggering Behavior of the Bottom Upwards Display it('does not trigger when the user does not pass the required point when scrolling upwards', function() { const infiniteLoader = jest.genMockFunction(); const rootNode = mount( - + {renderHelpers.divGenerator(20, 100)} ); @@ -193,16 +204,18 @@ describe('The Infinite Loading Triggering Behavior of the Bottom Upwards Display }); mount( - + {renderHelpers.divGenerator(20, 100)} ); - return listenerTriggered.then((listener) => { + return listenerTriggered.then(listener => { window.pageYOffset = 299; listener(); expect(infiniteLoader.mock.calls.length).toEqual(1); @@ -221,16 +234,18 @@ describe('The Infinite Loading Triggering Behavior of the Bottom Upwards Display }); mount( - - {renderHelpers.divGenerator(20, 100)} - + + {renderHelpers.divGenerator(20, 100)} + ); - return listenerTriggered.then((listener) => { + return listenerTriggered.then(listener => { window.pageYOffset = 301; listener(); @@ -251,11 +266,13 @@ describe('The Infinite Loading Scroll Maintenance Behavior of the Bottom Upwards it('scrolls to the correct place after new components come in', function() { var infiniteLoader = jest.genMockFunction(); var rootNode = ReactDOM.render( - + {divs} , renderNode @@ -272,13 +289,15 @@ describe('The Infinite Loading Scroll Maintenance Behavior of the Bottom Upwards // The parent component acknowledges that the component // is in the infinite loading state rootNode = ReactDOM.render( - } - containerHeight={800} - displayBottomUpwards> + } + containerHeight={800} + displayBottomUpwards + > {divs} , renderNode @@ -287,12 +306,14 @@ describe('The Infinite Loading Scroll Maintenance Behavior of the Bottom Upwards // The component is now in the infinite loading state. We // disable infinite loading and give it new divs. rootNode = ReactDOM.render( - + {renderHelpers.divGenerator(30, 100)} , renderNode @@ -317,45 +338,52 @@ describe('The Infinite Loading Scroll Maintenance Behavior of the Bottom Upwards }); ReactDOM.render( - + {divs} , renderNode ); - return listenerTriggered.then((listener) => { + return listenerTriggered.then(listener => { window.pageYOffset = 298; listener(); expect(infiniteLoader.mock.calls.length).toEqual(1); ReactDOM.render( - } - useWindowAsScrollContainer - displayBottomUpwards> + } + useWindowAsScrollContainer + displayBottomUpwards + > {divs} , renderNode ); ReactDOM.render( - + {renderHelpers.divGenerator(30, 100)} , - renderNode); + renderNode + ); expect(window.scroll).lastCalledWith(0, 1000 + 298); }); diff --git a/__tests__/constant_infinite_computer_test.js b/__tests__/constant_infinite_computer_test.js index 5d99094..c3ae33d 100644 --- a/__tests__/constant_infinite_computer_test.js +++ b/__tests__/constant_infinite_computer_test.js @@ -6,7 +6,6 @@ jest.dontMock('../src/computers/infiniteComputer.js'); var ConstantInfiniteComputer = require('../src/computers/constantInfiniteComputer.js'); describe('Constant Infinite Computer', () => { - describe('getTotalScrollableHeight()', () => { it('provides the correct sum of its children', () => { var cic = new ConstantInfiniteComputer(26, 92); @@ -54,23 +53,14 @@ describe('Constant Infinite Computer', () => { }); describe('getTopSpacerHeight()', () => { - it('correctly computes a zero top spacer height', () => { - - }); + it('correctly computes a zero top spacer height', () => {}); - it('correctly computes a regular top spacer height', () => { - - }); + it('correctly computes a regular top spacer height', () => {}); }); describe('getBottomSpacerHeight()', () => { - it('correctly computes a zero bottom spacer height', () => { + it('correctly computes a zero bottom spacer height', () => {}); - }); - - it('correctly computes a regular bottom spacer height', () => { - - }); + it('correctly computes a regular bottom spacer height', () => {}); }); - }); diff --git a/__tests__/helpers/renderHelpers.js b/__tests__/helpers/renderHelpers.js index 52b2a57..bed528f 100644 --- a/__tests__/helpers/renderHelpers.js +++ b/__tests__/helpers/renderHelpers.js @@ -4,7 +4,9 @@ module.exports = { divGenerator: function(number = 10, height = 100) { var divArray = []; for (var i = 0; i < number; i++) { - divArray.push(
    ); + divArray.push( +
    + ); } return divArray; @@ -12,7 +14,13 @@ module.exports = { variableDivGenerator: function(heights) { var divArray = []; for (var i = 0; i < heights.length; i++) { - divArray.push(
    ); + divArray.push( +
    + ); } return divArray; } diff --git a/__tests__/infinite_error_test.js b/__tests__/infinite_error_test.js index 4598486..323f7ef 100644 --- a/__tests__/infinite_error_test.js +++ b/__tests__/infinite_error_test.js @@ -11,41 +11,54 @@ import renderer from 'react-test-renderer'; describe('Errors when the container height is not provided in some way', function() { it('throws an error when neither containerHeight nor useWindowAsScrollContainer is not provided', function() { - var errorfulInfinite = -
    -
    - ; + var errorfulInfinite = ( + +
    +
    + + ); expect(function() { renderer.create(errorfulInfinite); - }).toThrow('Invariant Violation: Either containerHeight or useWindowAsScrollContainer must be provided.'); + }).toThrow( + 'Invariant Violation: Either containerHeight or useWindowAsScrollContainer must be provided.' + ); }); }); describe('Errors when the elementHeight does not make sense', function() { it('throws an error when the elementHeight is neither a number nor an array', function() { - var errorfulInfinite = -
    -
    - ; + var errorfulInfinite = ( + +
    +
    + + ); expect(function() { renderer.create(errorfulInfinite); - }).toThrow('Invariant Violation: You must provide either a number or an array of numbers as the elementHeight.'); + }).toThrow( + 'Invariant Violation: You must provide either a number or an array of numbers as the elementHeight.' + ); }); }); describe('Errors an error on elementHeight array length mismatch', function() { it('throws an error when the number of children is not equal to the length of the elementHeight array when ', function() { - var errorfulInfinite = -
    -
    - ; + var errorfulInfinite = ( + +
    +
    + + ); expect(function() { renderer.create(errorfulInfinite); - }).toThrow('Invariant Violation: There must be as many values provided in the elementHeight prop as there are children.'); + }).toThrow( + 'Invariant Violation: There must be as many values provided in the elementHeight prop as there are children.' + ); }); }); diff --git a/__tests__/infinite_styles_test.js b/__tests__/infinite_styles_test.js index 20a76f1..60cfee1 100644 --- a/__tests__/infinite_styles_test.js +++ b/__tests__/infinite_styles_test.js @@ -12,12 +12,14 @@ import renderer from 'react-test-renderer'; describe('Infinite Styles Override: can override styles on the scrollable container', function() { it('will be able to override styles on the scrollable container', function() { const rootNode = renderer.create( - -
    -
    + +
    +
    ); diff --git a/__tests__/infinite_test.js b/__tests__/infinite_test.js index 0c5cd6a..f95a8df 100644 --- a/__tests__/infinite_test.js +++ b/__tests__/infinite_test.js @@ -5,17 +5,18 @@ import createReactClass from 'create-react-class'; import renderer from 'react-test-renderer'; import { mount } from 'enzyme'; import Infinite from '../src/react-infinite.jsx'; -import {mountToJson} from 'enzyme-to-json'; +import { mountToJson } from 'enzyme-to-json'; import renderHelpers from './helpers/renderHelpers'; describe('Rendering the React Infinite Component Wrapper', function() { it('does not throw an error when given no children', function() { expect(function() { renderer.create( - - + ); }).not.toThrow(); }); @@ -23,10 +24,12 @@ describe('Rendering the React Infinite Component Wrapper', function() { it('does not throw an error when given only one child', function() { expect(function() { renderer.create( - -
    + +
    ); }).not.toThrow(); @@ -34,36 +37,45 @@ describe('Rendering the React Infinite Component Wrapper', function() { it('renders itself into the DOM with the correct container styles', function() { const infinite = renderer.create( - -
    -
    - - ); + +
    +
    + + ); expect(infinite).toMatchSnapshot(); }); it('applies the provided class name to the root node', function() { const infinite = renderer.create( - -
    -
    - - ); + +
    +
    + + ); expect(infinite).toMatchSnapshot(); }); it('allows preloadBatchSize to be zero', function() { - const rootNode = mount( -
  • Test1
  • -
  • Test2
  • -
    ); + const rootNode = mount( + +
  • Test1
  • +
  • Test2
  • +
    + ); const rootDomNode = rootNode.getDOMNode(); rootDomNode.scrollTop = 1500; @@ -76,13 +88,15 @@ describe('Rendering the React Infinite Component Wrapper', function() { describe('The Children of the React Infinite Component', function() { it('renders its children when no hiding behavior is required', function() { const rootNode = renderer.create( - -
    -
    - - ); + +
    +
    + + ); const tree = rootNode.toJSON(); expect(tree).toMatchSnapshot(); @@ -91,12 +105,14 @@ describe('The Children of the React Infinite Component', function() { it('renders its children when some DOM nodes are hidden', function() { const elementHeight = 200; const rootNode = renderer.create( - - {renderHelpers.divGenerator(10, elementHeight)} - - ); + + {renderHelpers.divGenerator(10, elementHeight)} + + ); // Why are six nodes rendered? Since we have not scrolled at // all, the extent that React Infinite will render is @@ -113,13 +129,15 @@ describe('The Children of the React Infinite Component', function() { it('renders more children when preloadAdditionalHeight is increased beyond its default', function() { const elementHeight = 200; const rootNode = renderer.create( - - {renderHelpers.divGenerator(10, elementHeight)} - - ); + + {renderHelpers.divGenerator(10, elementHeight)} + + ); // Why are seven nodes rendered? Since we have not scrolled at // all, the extent that React Infinite will render is @@ -136,13 +154,15 @@ describe('The Children of the React Infinite Component', function() { it('renders more children when preloadBatchSize is increased beyond its default', function() { const elementHeight = 200; const rootNode = renderer.create( - - {renderHelpers.divGenerator(10, elementHeight)} - - ); + + {renderHelpers.divGenerator(10, elementHeight)} + + ); // Why are eight nodes rendered? Since we have not scrolled at // all, the extent that React Infinite will render is @@ -161,12 +181,14 @@ describe('The Scrolling Behavior of the Constant Height React Infinite Component it('hides visible elements when the user scrolls sufficiently', function() { const elementHeight = 200; const rootNode = mount( - - {renderHelpers.divGenerator(20, elementHeight)} - - ); + + {renderHelpers.divGenerator(20, elementHeight)} + + ); const rootDomNode = rootNode.getDOMNode(); rootDomNode.scrollTop = 1500; @@ -190,12 +212,14 @@ describe('The Scrolling Behavior of the Constant Height React Infinite Component it('functions correctly at the end of its range', function() { const elementHeight = 200; const rootNode = mount( - - {renderHelpers.divGenerator(20, elementHeight)} - - ); + + {renderHelpers.divGenerator(20, elementHeight)} + + ); // The total scrollable height here is 4000 pixels const rootDomNode = rootNode.getDOMNode(); @@ -210,15 +234,35 @@ describe('The Scrolling Behavior of the Constant Height React Infinite Component describe('The Behavior of the Variable Height React Infinite Component', function() { it('hides elements when the user has not yet scrolled', function() { - // 20 40 200 300 350 500 525 550 575 600 725 805 880 900 1050 1300 1400 (16) - const elementHeight = [20, 20, 160, 100, 50, 150, 25, 25, 25, 25, 125, 80, 75, 20, 150, 250, 100]; + // 20 40 200 300 350 500 525 550 575 600 725 805 880 900 1050 1300 1400 (16) + const elementHeight = [ + 20, + 20, + 160, + 100, + 50, + 150, + 25, + 25, + 25, + 25, + 125, + 80, + 75, + 20, + 150, + 250, + 100 + ]; const rootNode = renderer.create( - - {renderHelpers.variableDivGenerator(elementHeight)} - - ); + + {renderHelpers.variableDivGenerator(elementHeight)} + + ); // Schematic // 0 pixels: start of topSpacer element, start of windowTop @@ -230,15 +274,35 @@ describe('The Behavior of the Variable Height React Infinite Component', functio }); it('hides visible elements when the user scrolls sufficiently', function() { - // 20 40 200 300 350 500 525 550 575 600 725 805 880 900 1050 1300 1400 (17) - const elementHeight = [20, 20, 160, 100, 50, 150, 25, 25, 25, 25, 125, 80, 75, 20, 150, 250, 100]; + // 20 40 200 300 350 500 525 550 575 600 725 805 880 900 1050 1300 1400 (17) + const elementHeight = [ + 20, + 20, + 160, + 100, + 50, + 150, + 25, + 25, + 25, + 25, + 125, + 80, + 75, + 20, + 150, + 250, + 100 + ]; const rootNode = mount( - - {renderHelpers.variableDivGenerator(elementHeight)} - - ); + + {renderHelpers.variableDivGenerator(elementHeight)} + + ); const rootDomNode = rootNode.getDOMNode(); rootDomNode.scrollTop = 700; @@ -257,15 +321,35 @@ describe('The Behavior of the Variable Height React Infinite Component', functio }); it('functions correctly at the end of its range', function() { - // 20 40 200 300 350 500 525 550 575 600 725 805 880 900 1050 1300 1400 (16) - const elementHeight = [20, 20, 160, 100, 50, 150, 25, 25, 25, 25, 125, 80, 75, 20, 150, 250, 100]; + // 20 40 200 300 350 500 525 550 575 600 725 805 880 900 1050 1300 1400 (16) + const elementHeight = [ + 20, + 20, + 160, + 100, + 50, + 150, + 25, + 25, + 25, + 25, + 125, + 80, + 75, + 20, + 150, + 250, + 100 + ]; const rootNode = mount( - - {renderHelpers.variableDivGenerator(elementHeight)} - - ); + + {renderHelpers.variableDivGenerator(elementHeight)} + + ); // The total scrollable height here is 4000 pixels const rootDomNode = rootNode.getDOMNode(); @@ -289,14 +373,16 @@ describe("React Infinite's Infinite Scroll Capabilities", function() { const infiniteSpy = jasmine.createSpy('infiniteSpy'); const elementHeight = 200; const rootNode = mount( - - {renderHelpers.divGenerator(20, elementHeight)} - - ); + + {renderHelpers.divGenerator(20, elementHeight)} + + ); const rootDomNode = rootNode.getDOMNode(); rootDomNode.scrollTop = 300; @@ -311,14 +397,16 @@ describe("React Infinite's Infinite Scroll Capabilities", function() { const infiniteSpy = jasmine.createSpy('infiniteSpy'); const elementHeight = 200; const rootNode = mount( - - {renderHelpers.divGenerator(20, elementHeight)} - - ); + + {renderHelpers.divGenerator(20, elementHeight)} + + ); const rootDomNode = rootNode.getDOMNode(); rootDomNode.scrollTop = 3600; @@ -333,15 +421,17 @@ describe("React Infinite's Infinite Scroll Capabilities", function() { const infiniteSpy = jasmine.createSpy('infiniteSpy'); const elementHeight = 200; const rootNode = mount( - } - className={"correct-class-name"}> - {renderHelpers.divGenerator(20, elementHeight)} - - ); + } + className={'correct-class-name'} + > + {renderHelpers.divGenerator(20, elementHeight)} + + ); const rootDomNode = rootNode.getDOMNode(); rootDomNode.scrollTop = 100; @@ -356,15 +446,17 @@ describe("React Infinite's Infinite Scroll Capabilities", function() { const infiniteSpy = jasmine.createSpy('infiniteSpy'); const elementHeight = 200; const rootNode = mount( - } - className={"correct-class-name"}> - {renderHelpers.divGenerator(20, elementHeight)} - - ); + } + className={'correct-class-name'} + > + {renderHelpers.divGenerator(20, elementHeight)} + + ); const rootDomNode = rootNode.getDOMNode(); rootDomNode.scrollTop = 3600; @@ -380,13 +472,15 @@ describe("Maintaining React Infinite's internal scroll state", function() { it('has does not have pointer-events: none by default', function() { const elementHeight = 200; const rootNode = renderer.create( - - {renderHelpers.divGenerator(20, elementHeight)} - - ); + + {renderHelpers.divGenerator(20, elementHeight)} + + ); expect(rootNode).toMatchSnapshot(); }); @@ -394,13 +488,15 @@ describe("Maintaining React Infinite's internal scroll state", function() { it('has pointer-events: none upon scroll', function() { const elementHeight = 200; const rootNode = mount( - - {renderHelpers.divGenerator(20, elementHeight)} - - ); + + {renderHelpers.divGenerator(20, elementHeight)} + + ); const rootDomNode = rootNode.getDOMNode(); rootDomNode.scrollTop = 100; @@ -417,13 +513,14 @@ describe('Handling infinite scrolling', function() { const infiniteSpy = jasmine.createSpy('infiniteSpy'); const elementHeight = 200; mount( - - + ); expect(infiniteSpy).toHaveBeenCalled(); @@ -434,14 +531,16 @@ describe('Handling infinite scrolling', function() { const elementHeight = 200; const rootNode = mount( - - {renderHelpers.divGenerator(20, elementHeight)} - - ); + + {renderHelpers.divGenerator(20, elementHeight)} + + ); const properDiv = rootNode.find('.correct-class-name').getDOMNode(); properDiv.scrollTop = 100; @@ -457,14 +556,16 @@ describe('Handling infinite scrolling', function() { const elementHeight = 200; const rootNode = mount( - - {renderHelpers.divGenerator(20, elementHeight)} - - ); + + {renderHelpers.divGenerator(20, elementHeight)} + + ); const childDiv = rootNode.find('.test-div-0').getDOMNode(); childDiv.scrollTop = 100; @@ -480,17 +581,19 @@ describe('React Infinite when the window is used as the Container', function() { const elementHeight = 200; it('does not attach a scrollable style', function() { const rootNode = renderer.create( - + {renderHelpers.divGenerator(20, elementHeight)} - ); + + ); expect(rootNode).toMatchSnapshot(); }); - it('considers a scroll to have occurred when the window is scrolled', function() { const infiniteSpy = jasmine.createSpy('infiniteSpy'); const elementHeight = 200; @@ -506,16 +609,18 @@ describe('React Infinite when the window is used as the Container', function() { }); mount( - + {renderHelpers.divGenerator(20, elementHeight)} ); - return listenerTriggered.then((listener) => { + return listenerTriggered.then(listener => { window.pageYOffset = 200; listener(); expect(infiniteSpy).toHaveBeenCalled(); @@ -528,10 +633,12 @@ describe('React Infinite when the window is used as the Container', function() { window.innerHeight = 800; const rootNode = mount( - + {renderHelpers.divGenerator(20, elementHeight)} ); @@ -554,18 +661,20 @@ describe('React Infinite when the window is used as the Container', function() { }); const rootNode = mount( - + {renderHelpers.divGenerator(20, elementHeight)} ); expect(mountToJson(rootNode)).toMatchSnapshot(); - return listenerTriggered.then((listener) => { + return listenerTriggered.then(listener => { window.pageYOffset = 1500; listener(); expect(mountToJson(rootNode)).toMatchSnapshot(); @@ -577,11 +686,13 @@ describe('React Infinite when the window is used as the Container', function() { describe("Specifying React Infinite's preload amounts", function() { it('has correct preload batch size defaults', function() { const infinite = mount( - -
    -
    + +
    +
    ); @@ -590,12 +701,14 @@ describe("Specifying React Infinite's preload amounts", function() { it('can use a number to set preload batch size', function() { const infinite = mount( - -
    -
    + +
    +
    ); @@ -604,12 +717,14 @@ describe("Specifying React Infinite's preload amounts", function() { it('can be used with a preload batch size scale factor', function() { const infinite = mount( - -
    -
    + +
    +
    ); @@ -618,89 +733,120 @@ describe("Specifying React Infinite's preload amounts", function() { it('has correct preload additional height defaults', function() { const infinite = mount( - -
    -
    + +
    +
    ); - expect(infinite.instance().computedProps.preloadAdditionalHeight).toEqual(800); + expect(infinite.instance().computedProps.preloadAdditionalHeight).toEqual( + 800 + ); }); it('can use a number to set preload additional height', function() { const infinite = mount( - -
    -
    + +
    +
    ); - expect(infinite.instance().computedProps.preloadAdditionalHeight).toEqual(465); + expect(infinite.instance().computedProps.preloadAdditionalHeight).toEqual( + 465 + ); }); it('can be used with a preload additional height scale factor', function() { const infinite = mount( - -
    -
    + +
    +
    ); - expect(infinite.instance().computedProps.preloadAdditionalHeight).toEqual(750); + expect(infinite.instance().computedProps.preloadAdditionalHeight).toEqual( + 750 + ); }); }); describe('Rerendering React Infinite', function() { it('updates the infinite computer', function() { var rootNode = mount( - } - className={"correct-class-name"}> - {renderHelpers.divGenerator(20, 17)} - - ); + } + className={'correct-class-name'} + > + {renderHelpers.divGenerator(20, 17)} + + ); expect(rootNode.state().infiniteComputer.heightData).toEqual(17); expect(rootNode.state().infiniteComputer.numberOfChildren).toEqual(20); rootNode = mount( - } - className={"correct-class-name"}> + } + className={'correct-class-name'} + > {renderHelpers.divGenerator(74, 17)} ); expect(rootNode.state().infiniteComputer.numberOfChildren).toEqual(74); rootNode = mount( - } - className={"correct-class-name"}> + } + className={'correct-class-name'} + > {renderHelpers.divGenerator(12, 17)} ); - expect(rootNode.state().infiniteComputer.heightData).toEqual([10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120]); + expect(rootNode.state().infiniteComputer.heightData).toEqual([ + 10, + 20, + 30, + 40, + 50, + 60, + 70, + 80, + 90, + 100, + 110, + 120 + ]); }); }); describe('Requesting all visible rows', function() { const InfiniteWrapper = createReactClass({ getInitialState() { - return { currentRows: 0, totalRequests: 0 } + return { currentRows: 0, totalRequests: 0 }; }, onInfiniteLoad() { @@ -717,44 +863,47 @@ describe('Requesting all visible rows', function() { render() { return ( - - {renderHelpers.divGenerator(this.state.currentRows, this.props.elementHeight)} + + {renderHelpers.divGenerator( + this.state.currentRows, + this.props.elementHeight + )} ); } }); - it('will request all possible rows until the scroll height is met', function () { + it('will request all possible rows until the scroll height is met', function() { const rootNode = mount( - + ); expect(rootNode.state().totalRequests).toEqual(10); expect(rootNode.state().currentRows).toEqual(10); }); - it('will stop requesting when no further rows are provided', function () { + it('will stop requesting when no further rows are provided', function() { const rootNode = mount( - + ); expect(rootNode.state().totalRequests).toEqual(4); expect(rootNode.state().currentRows).toEqual(3); }); - it('will work when no possible rows can be loaded', function () { + it('will work when no possible rows can be loaded', function() { const rootNode = mount( - + ); expect(rootNode.state().totalRequests).toEqual(1); diff --git a/pipeline/browserify.js b/pipeline/browserify.js index b21571c..4cc7bd4 100644 --- a/pipeline/browserify.js +++ b/pipeline/browserify.js @@ -15,47 +15,70 @@ function transformBundle(root, envObject) { root = root.bundle(); if (envObject.development) { - root.pipe(sourcestream('react-infinite.js')) - .pipe(buffer()) - .pipe(sourcemaps.init()) - .pipe(sourcemaps.write('.')) - .pipe(size({ + root + .pipe(sourcestream('react-infinite.js')) + .pipe(buffer()) + .pipe(sourcemaps.init()) + .pipe(sourcemaps.write('.')) + .pipe( + size({ title: 'Development bundle' - })) - .pipe(gulp.dest('dist')); + }) + ) + .pipe(gulp.dest('dist')); } if (envObject.production || envObject.release) { - root.pipe(sourcestream('react-infinite.min.js')) - .pipe(buffer()) - .pipe(uglify()) - .pipe(size({ + root + .pipe(sourcestream('react-infinite.min.js')) + .pipe(buffer()) + .pipe(uglify()) + .pipe( + size({ title: 'Release minified bundle' - })) - .pipe(gulp.dest('dist')); + }) + ) + .pipe(gulp.dest('dist')); } if (envObject.release) { - root.pipe(sourcestream('react-infinite.js')) + root + .pipe(sourcestream('react-infinite.js')) .pipe(buffer()) - .pipe(size({ - title: 'Release unminified bundle' - })) + .pipe( + size({ + title: 'Release unminified bundle' + }) + ) .pipe(gulp.dest('dist')); } } module.exports = function(shouldWatch, envObject, files) { - var watchFunction = shouldWatch ? watchify : function(x) { return x; }; + var watchFunction = shouldWatch + ? watchify + : function(x) { + return x; + }; var watchArgs = shouldWatch ? watchify.args : undefined; return function() { - var root = watchFunction(browserify({ - entries: files, - standalone: 'Infinite' - }, watchArgs)) + var root = watchFunction( + browserify( + { + entries: files, + standalone: 'Infinite' + }, + watchArgs + ) + ) .transform(babelify) - .transform(envify({ - NODE_ENV: envObject.production || envObject.release ? 'production' : 'development' - })) + .transform( + envify({ + NODE_ENV: + envObject.production || envObject.release + ? 'production' + : 'development' + }) + ) .exclude('react') .exclude('react-dom'); diff --git a/src/computers/arrayInfiniteComputer.js b/src/computers/arrayInfiniteComputer.js index 32e9aa7..89d0744 100644 --- a/src/computers/arrayInfiniteComputer.js +++ b/src/computers/arrayInfiniteComputer.js @@ -1,7 +1,7 @@ /* @flow */ var InfiniteComputer = require('./infiniteComputer.js'), - bs = require('../utils/binaryIndexSearch.js'); + bs = require('../utils/binaryIndexSearch.js'); class ArrayInfiniteComputer extends InfiniteComputer { prefixHeightData: Array; @@ -32,12 +32,20 @@ class ArrayInfiniteComputer extends InfiniteComputer { } getDisplayIndexStart(windowTop: number): number { - var foundIndex = bs.binaryIndexSearch(this.prefixHeightData, windowTop, bs.opts.CLOSEST_HIGHER); + var foundIndex = bs.binaryIndexSearch( + this.prefixHeightData, + windowTop, + bs.opts.CLOSEST_HIGHER + ); return this.maybeIndexToIndex(foundIndex); } getDisplayIndexEnd(windowBottom: number): number { - var foundIndex = bs.binaryIndexSearch(this.prefixHeightData, windowBottom, bs.opts.CLOSEST_HIGHER); + var foundIndex = bs.binaryIndexSearch( + this.prefixHeightData, + windowBottom, + bs.opts.CLOSEST_HIGHER + ); return this.maybeIndexToIndex(foundIndex); } @@ -50,7 +58,9 @@ class ArrayInfiniteComputer extends InfiniteComputer { if (displayIndexEnd === -1) { return 0; } - return this.getTotalScrollableHeight() - this.prefixHeightData[displayIndexEnd]; + return ( + this.getTotalScrollableHeight() - this.prefixHeightData[displayIndexEnd] + ); } } diff --git a/src/computers/constantInfiniteComputer.js b/src/computers/constantInfiniteComputer.js index e656dde..1b9ac69 100644 --- a/src/computers/constantInfiniteComputer.js +++ b/src/computers/constantInfiniteComputer.js @@ -25,7 +25,10 @@ class ConstantInfiniteComputer extends InfiniteComputer { getBottomSpacerHeight(displayIndexEnd: number): number { var nonZeroIndex = displayIndexEnd + 1; - return Math.max(0, (this.numberOfChildren - nonZeroIndex) * this.heightData); + return Math.max( + 0, + (this.numberOfChildren - nonZeroIndex) * this.heightData + ); } } diff --git a/src/computers/infiniteComputer.js b/src/computers/infiniteComputer.js index fda9087..42594e7 100644 --- a/src/computers/infiniteComputer.js +++ b/src/computers/infiniteComputer.js @@ -17,7 +17,7 @@ class InfiniteComputer { /* eslint-disable no-unused-vars */ getDisplayIndexStart(windowTop) { - /* eslint-enable no-unused-vars */ + /* eslint-enable no-unused-vars */ if (process.env.NODE_ENV === 'development') { throw new Error('getDisplayIndexStart not implemented.'); } @@ -25,7 +25,7 @@ class InfiniteComputer { /* eslint-disable no-unused-vars */ getDisplayIndexEnd(windowBottom) { - /* eslint-enable no-unused-vars */ + /* eslint-enable no-unused-vars */ if (process.env.NODE_ENV === 'development') { throw new Error('getDisplayIndexEnd not implemented.'); } @@ -35,7 +35,7 @@ class InfiniteComputer { // the above details. /* eslint-disable no-unused-vars */ getTopSpacerHeight(displayIndexStart) { - /* eslint-enable no-unused-vars */ + /* eslint-enable no-unused-vars */ if (process.env.NODE_ENV === 'development') { throw new Error('getTopSpacerHeight not implemented.'); } @@ -43,7 +43,7 @@ class InfiniteComputer { /* eslint-disable no-unused-vars */ getBottomSpacerHeight(displayIndexEnd) { - /* eslint-enable no-unused-vars */ + /* eslint-enable no-unused-vars */ if (process.env.NODE_ENV === 'development') { throw new Error('getBottomSpacerHeight not implemented.'); } diff --git a/src/react-infinite.jsx b/src/react-infinite.jsx index ef328e2..c8071ab 100644 --- a/src/react-infinite.jsx +++ b/src/react-infinite.jsx @@ -10,9 +10,13 @@ var scaleEnum = require('./utils/scaleEnum'); var infiniteHelpers = require('./utils/infiniteHelpers'); var _isFinite = require('lodash.isfinite'); -var checkProps = checkProps = require('./utils/checkProps'); +var checkProps = require('./utils/checkProps'); -class Infinite extends React.Component { +class Infinite extends React.Component< + ReactInfiniteProvidedDefaultProps, + ReactInfiniteProps, + ReactInfiniteState +> { state: ReactInfiniteState; static propTypes = { @@ -88,7 +92,7 @@ class Infinite extends React.Component {}, - loadingSpinnerDelegate:
    , + loadingSpinnerDelegate:
    , displayBottomUpwards: false, @@ -131,7 +135,9 @@ class Infinite extends React.Component { + generateComputedUtilityFunctions = ( + props: ReactInfiniteProps + ): ReactInfiniteUtilityFunctions => { var utilities = {}; utilities.getLoadingSpinnerHeight = () => { var loadingSpinnerHeight = 0; @@ -149,7 +155,7 @@ class Infinite extends React.Component {}; utilities.getScrollTop = () => window.pageYOffset; - utilities.setScrollTop = (top) => { + utilities.setScrollTop = top => { window.scroll(window.pageXOffset, top); }; utilities.scrollShouldBeIgnored = () => false; @@ -162,33 +168,42 @@ class Infinite extends React.Component { + utilities.setScrollTop = top => { if (this.scrollable) { this.scrollable.scrollTop = top; } }; - utilities.scrollShouldBeIgnored = event => event.target !== this.scrollable; + utilities.scrollShouldBeIgnored = event => + event.target !== this.scrollable; utilities.buildScrollableStyle = () => { - return Object.assign({}, { - height: this.computedProps.containerHeight, - overflowX: 'hidden', - overflowY: 'scroll', - WebkitOverflowScrolling: 'touch' - }, this.computedProps.styles.scrollableStyle || {}); + return Object.assign( + {}, + { + height: this.computedProps.containerHeight, + overflowX: 'hidden', + overflowY: 'scroll', + WebkitOverflowScrolling: 'touch' + }, + this.computedProps.styles.scrollableStyle || {} + ); }; } return utilities; }; - recomputeInternalStateFromProps = (props: ReactInfiniteProps): { + recomputeInternalStateFromProps = ( + props: ReactInfiniteProps + ): { computedProps: ReactInfiniteComputedProps, utils: ReactInfiniteUtilityFunctions, newState: ReactInfiniteState - } => { + } => { checkProps(props); var computedProps = infiniteHelpers.generateComputedProps(props); - var utils: ReactInfiniteUtilityFunctions = this.generateComputedUtilityFunctions(props); + var utils: ReactInfiniteUtilityFunctions = this.generateComputedUtilityFunctions( + props + ); var newState = {}; @@ -205,9 +220,13 @@ class Infinite extends React.Component { - that.setState({ - isScrolling: false, - scrollTimeout: undefined - }); - }, this.computedProps.timeScrollStateLastsForAfterUserScrolls); + scrollTimeout = setTimeout(() => { + that.setState({ + isScrolling: false, + scrollTimeout: undefined + }); + }, this.computedProps.timeScrollStateLastsForAfterUserScrolls); this.setState({ isScrolling: true, @@ -310,12 +345,18 @@ class Infinite extends React.Component { - return this.state.infiniteComputer.getTotalScrollableHeight() - this.computedProps.containerHeight; + return ( + this.state.infiniteComputer.getTotalScrollableHeight() - + this.computedProps.containerHeight + ); }; hasAllVisibleItems = (): boolean => { - return !(_isFinite(this.computedProps.infiniteLoadBeginEdgeOffset) && - this.state.infiniteComputer.getTotalScrollableHeight() < this.computedProps.containerHeight); + return !( + _isFinite(this.computedProps.infiniteLoadBeginEdgeOffset) && + this.state.infiniteComputer.getTotalScrollableHeight() < + this.computedProps.containerHeight + ); }; passedEdgeForInfiniteScroll = (scrollTop: number): boolean => { @@ -327,9 +368,12 @@ class Infinite extends React.Component this.state.infiniteComputer.getTotalScrollableHeight() - + return ( + scrollTop > + this.state.infiniteComputer.getTotalScrollableHeight() - this.computedProps.containerHeight - - edgeOffset; + edgeOffset + ); } }; @@ -339,8 +383,9 @@ class Infinite extends React.Component { - this.shouldAttachToBottom = this.computedProps.displayBottomUpwards && - scrollTop >= this.getLowestPossibleScrollTop(); + this.shouldAttachToBottom = + this.computedProps.displayBottomUpwards && + scrollTop >= this.getLowestPossibleScrollTop(); this.manageScrollTimeouts(); @@ -349,7 +394,10 @@ class Infinite extends React.Component 1) { - displayables = this.computedProps.children.slice(this.state.displayIndexStart, - this.state.displayIndexEnd + 1); + displayables = this.computedProps.children.slice( + this.state.displayIndexStart, + this.state.displayIndexEnd + 1 + ); } else { displayables = this.computedProps.children; } @@ -371,40 +421,72 @@ class Infinite extends React.Component 0) { topSpacerHeight = heightDifference - this.loadingSpinnerHeight; } } - var loadingSpinner = this.computedProps.infiniteLoadBeginEdgeOffset === undefined - ? null - :
    { this.loadingSpinner = c; }}> - {this.state.isInfiniteLoading ? this.computedProps.loadingSpinnerDelegate : null} -
    ; + var loadingSpinner = + this.computedProps.infiniteLoadBeginEdgeOffset === undefined + ? null + :
    { + this.loadingSpinner = c; + }} + > + {this.state.isInfiniteLoading + ? this.computedProps.loadingSpinnerDelegate + : null} +
    ; // topSpacer and bottomSpacer take up the amount of space that the // rendered elements would have taken up otherwise - return
    { this.scrollable = c; }} - style={this.utils.buildScrollableStyle()} - onScroll={this.utils.nodeScrollListener}> -
    { this.smoothScrollingWrapper = c; }} style={infiniteScrollStyles}> -
    { this.topSpacer = c; }} - style={infiniteHelpers.buildHeightStyle(topSpacerHeight)}/> - {this.computedProps.displayBottomUpwards && loadingSpinner} + return ( +
    { + this.scrollable = c; + }} + style={this.utils.buildScrollableStyle()} + onScroll={this.utils.nodeScrollListener} + > +
    { + this.smoothScrollingWrapper = c; + }} + style={infiniteScrollStyles} + > +
    { + this.topSpacer = c; + }} + style={infiniteHelpers.buildHeightStyle(topSpacerHeight)} + /> + {this.computedProps.displayBottomUpwards && loadingSpinner} {displayables} - {!this.computedProps.displayBottomUpwards && loadingSpinner} -
    { this.bottomSpacer = c; }} - style={infiniteHelpers.buildHeightStyle(bottomSpacerHeight)}/> + {!this.computedProps.displayBottomUpwards && loadingSpinner} +
    { + this.bottomSpacer = c; + }} + style={infiniteHelpers.buildHeightStyle(bottomSpacerHeight)} + /> +
    -
    ; + ); } } diff --git a/src/utils/binaryIndexSearch.js b/src/utils/binaryIndexSearch.js index 1f6b0a8..0f67b05 100644 --- a/src/utils/binaryIndexSearch.js +++ b/src/utils/binaryIndexSearch.js @@ -5,15 +5,17 @@ var opts = { CLOSEST_HIGHER: 2 }; -var binaryIndexSearch = function(array/* : Array */, - item/* : number */, - opt/* : number */)/* : ?number */ { +var binaryIndexSearch = function( + array /* : Array */, + item /* : number */, + opt /* : number */ +) /* : ?number */ { var index; var high = array.length - 1, - low = 0, - middle, - middleItem; + low = 0, + middle, + middleItem; while (low <= high) { middle = low + Math.floor((high - low) / 2); diff --git a/src/utils/checkProps.js b/src/utils/checkProps.js index 44f9f20..1923d00 100644 --- a/src/utils/checkProps.js +++ b/src/utils/checkProps.js @@ -10,16 +10,25 @@ var _isFinite = require('lodash.isfinite'); module.exports = function(props: ReactInfiniteProps) { var rie = 'Invariant Violation: '; if (!(props.containerHeight || props.useWindowAsScrollContainer)) { - throw new Error(rie + 'Either containerHeight or useWindowAsScrollContainer must be provided.'); + throw new Error( + rie + + 'Either containerHeight or useWindowAsScrollContainer must be provided.' + ); } if (!(_isFinite(props.elementHeight) || Array.isArray(props.elementHeight))) { - throw new Error(rie + 'You must provide either a number or an array of numbers as the elementHeight.'); + throw new Error( + rie + + 'You must provide either a number or an array of numbers as the elementHeight.' + ); } if (Array.isArray(props.elementHeight)) { if (React.Children.count(props.children) !== props.elementHeight.length) { - throw new Error(rie + 'There must be as many values provided in the elementHeight prop as there are children.'); + throw new Error( + rie + + 'There must be as many values provided in the elementHeight prop as there are children.' + ); } } }; diff --git a/src/utils/infiniteHelpers.js b/src/utils/infiniteHelpers.js index 782845b..1d0ad29 100644 --- a/src/utils/infiniteHelpers.js +++ b/src/utils/infiniteHelpers.js @@ -6,8 +6,10 @@ var scaleEnum = require('./scaleEnum'); var React = global.React || require('react'); var window = require('./window'); -function createInfiniteComputer(data: ElementHeight, - children: any): InfiniteComputer { +function createInfiniteComputer( + data: ElementHeight, + children: any +): InfiniteComputer { var computer; var numberOfChildren = React.Children.count(children); @@ -25,24 +27,30 @@ function createInfiniteComputer(data: ElementHeight, // from any actual representation in the DOM. // The window is the block with any preloadAdditionalHeight // added to it. -function recomputeApertureStateFromOptionsAndScrollTop({ - preloadBatchSize, - preloadAdditionalHeight, - infiniteComputer +function recomputeApertureStateFromOptionsAndScrollTop( + { + preloadBatchSize, + preloadAdditionalHeight, + infiniteComputer }: { - preloadBatchSize: number; - preloadAdditionalHeight: number; - infiniteComputer: InfiniteComputer; - }, scrollTop: number): { - displayIndexStart: number; - displayIndexEnd: number; - } { - var blockNumber = preloadBatchSize === 0 ? 0 : Math.floor(scrollTop / preloadBatchSize), - blockStart = preloadBatchSize * blockNumber, - blockEnd = blockStart + preloadBatchSize, - apertureTop = Math.max(0, blockStart - preloadAdditionalHeight), - apertureBottom = Math.min(infiniteComputer.getTotalScrollableHeight(), - blockEnd + preloadAdditionalHeight); + preloadBatchSize: number, + preloadAdditionalHeight: number, + infiniteComputer: InfiniteComputer + }, + scrollTop: number +): { + displayIndexStart: number, + displayIndexEnd: number +} { + var blockNumber = + preloadBatchSize === 0 ? 0 : Math.floor(scrollTop / preloadBatchSize), + blockStart = preloadBatchSize * blockNumber, + blockEnd = blockStart + preloadBatchSize, + apertureTop = Math.max(0, blockStart - preloadAdditionalHeight), + apertureBottom = Math.min( + infiniteComputer.getTotalScrollableHeight(), + blockEnd + preloadAdditionalHeight + ); return { displayIndexStart: infiniteComputer.getDisplayIndexStart(apertureTop), @@ -50,19 +58,24 @@ function recomputeApertureStateFromOptionsAndScrollTop({ }; } -function generateComputedProps(props: ReactInfiniteProps): ReactInfiniteComputedProps { +function generateComputedProps( + props: ReactInfiniteProps +): ReactInfiniteComputedProps { // These are extracted so their type definitions do not conflict. - var {containerHeight, - preloadBatchSize, - preloadAdditionalHeight, - handleScroll, - onInfiniteLoad, - ...oldProps} = props; + var { + containerHeight, + preloadBatchSize, + preloadAdditionalHeight, + handleScroll, + onInfiniteLoad, + ...oldProps + } = props; var newProps = {}; containerHeight = typeof containerHeight === 'number' ? containerHeight : 0; newProps.containerHeight = props.useWindowAsScrollContainer - ? window.innerHeight : containerHeight; + ? window.innerHeight + : containerHeight; newProps.handleScroll = handleScroll || (() => {}); newProps.onInfiniteLoad = onInfiniteLoad || (() => {}); @@ -71,13 +84,17 @@ function generateComputedProps(props: ReactInfiniteProps): ReactInfiniteComputed type: scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR, amount: 0.5 }; - var batchSize = preloadBatchSize && preloadBatchSize.type - ? preloadBatchSize - : defaultPreloadBatchSizeScaling; + var batchSize = + preloadBatchSize && preloadBatchSize.type + ? preloadBatchSize + : defaultPreloadBatchSizeScaling; if (typeof preloadBatchSize === 'number') { newProps.preloadBatchSize = preloadBatchSize; - } else if (typeof batchSize === 'object' && batchSize.type === scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR) { + } else if ( + typeof batchSize === 'object' && + batchSize.type === scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR + ) { newProps.preloadBatchSize = newProps.containerHeight * batchSize.amount; } else { newProps.preloadBatchSize = 0; @@ -87,13 +104,18 @@ function generateComputedProps(props: ReactInfiniteProps): ReactInfiniteComputed type: scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR, amount: 1 }; - var additionalHeight = preloadAdditionalHeight && preloadAdditionalHeight.type - ? preloadAdditionalHeight - : defaultPreloadAdditionalHeightScaling; + var additionalHeight = + preloadAdditionalHeight && preloadAdditionalHeight.type + ? preloadAdditionalHeight + : defaultPreloadAdditionalHeightScaling; if (typeof preloadAdditionalHeight === 'number') { newProps.preloadAdditionalHeight = preloadAdditionalHeight; - } else if (typeof additionalHeight === 'object' && additionalHeight.type === scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR) { - newProps.preloadAdditionalHeight = newProps.containerHeight * additionalHeight.amount; + } else if ( + typeof additionalHeight === 'object' && + additionalHeight.type === scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR + ) { + newProps.preloadAdditionalHeight = + newProps.containerHeight * additionalHeight.amount; } else { newProps.preloadAdditionalHeight = 0; } From 807ce281ab0b342112dd3c69d9943adf7890616e Mon Sep 17 00:00:00 2001 From: Gareth Tan Date: Sat, 5 Aug 2017 01:10:44 -0400 Subject: [PATCH 55/78] Fix dependencies. --- package.json | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index abece61..81be95f 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,12 @@ "typecheck": "flow version && flow check", "verify": "npm test && npm run typecheck && npm run lint", "preversion": "npm run verify", - "prepublish": "gulp release" + "prepublish": "gulp release", + "lint-staged": "lint-staged", + "precommit": "lint-staged" + }, + "lint-staged": { + "*.js": "npm run fix" }, "jest": { "transform": { @@ -62,9 +67,9 @@ "enzyme": "2.9.1", "enzyme-to-json": "1.5.1", "eslint": "4.3.0", - "eslint-plugin-flowtype": "2.35.0", "eslint-config-seatgeek-react-standard": "4.0.0", "eslint-config-seatgeek-standard": "5.0.0", + "eslint-plugin-flowtype": "2.35.0", "eslint-plugin-react": "7.1.0", "flow-bin": "0.52.0", "gulp": "^3.8.8", @@ -74,7 +79,9 @@ "gulp-sourcemaps": "^1.2.4", "gulp-uglify": "^1.0.1", "gulp-webserver": "^0.9.1", + "husky": "0.14.3", "jest-cli": "20.0.4", + "lint-staged": "4.0.2", "moment": "^2.10.6", "react-test-renderer": "15.5.4", "uglifyify": "3.0.1", @@ -85,13 +92,9 @@ "yargs": "^1.3.2" }, "dependencies": { - "create-react-class": "15.6.0", "lodash.isarray": "3.0.4", "lodash.isfinite": "3.2.0", - "object-assign": "4.0.1", - "prop-types": "15.5.10", - "react": "15.6.1", - "react-dom": "15.6.1" + "object-assign": "4.0.1" }, "peerDependencies": { "react": "^15.5.0", From 49f2a6a1e89baa5eda2ba79923ad9a2148b3186d Mon Sep 17 00:00:00 2001 From: Gareth Tan Date: Sat, 5 Aug 2017 01:11:30 -0400 Subject: [PATCH 56/78] Add JSX files. --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 81be95f..a20e00b 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,8 @@ "precommit": "lint-staged" }, "lint-staged": { - "*.js": "npm run fix" + "*.js": "npm run fix", + "*.jsx": "npm run fix" }, "jest": { "transform": { From c857799f3c7aa2af81d773e3adca551dd9c6d9c9 Mon Sep 17 00:00:00 2001 From: Gareth Tan Date: Sat, 5 Aug 2017 01:19:48 -0400 Subject: [PATCH 57/78] Cache node_modules and install dependencies. --- .travis.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index ac9d396..192028c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,10 @@ sudo: false language: node_js node_js: - - 6 + - lts/* +cache: + directories: + - node_modules env: - TEST=1 - TYPECHECK=1 @@ -9,5 +12,5 @@ env: script: - ./config/travis/test.sh -before_install: npm install react react-dom prop-types create-react-class enzyme enzyme-to-json +before_install: npm install react react-dom prop-types && npm install after_success: cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js From 8e5483e94b87c850a4573ff580fa508caf6d22a3 Mon Sep 17 00:00:00 2001 From: Gareth Tan Date: Sat, 5 Aug 2017 01:27:19 -0400 Subject: [PATCH 58/78] Fix Gulpfile. --- Gulpfile.js | 58 ++++++++++++++++++++++++++++------------------------- 1 file changed, 31 insertions(+), 27 deletions(-) diff --git a/Gulpfile.js b/Gulpfile.js index 5d06542..fb1748d 100644 --- a/Gulpfile.js +++ b/Gulpfile.js @@ -5,9 +5,10 @@ var del = require('del'); var browserifyCreator = require('./pipeline/browserify'); -var args = require('yargs').alias('P', 'production') - .alias('D', 'development') - .alias('E', 'example').argv; +var args = require('yargs') + .alias('P', 'production') + .alias('D', 'development') + .alias('E', 'example').argv; var envObject = { production: args.production, @@ -20,7 +21,10 @@ var buildFunction = browserifyCreator(false, envObject, INFINITE_SOURCE); gulp.task('build-bundle', buildFunction); gulp.task('cleanly-build-bundle', ['clean'], buildFunction); -gulp.task('watch-develop-bundle', browserifyCreator(true, {development: true}, INFINITE_SOURCE)); +gulp.task( + 'watch-develop-bundle', + browserifyCreator(true, { development: true }, INFINITE_SOURCE) +); // This task builds everything for release: the dist // folder is populated with react-infinite.js and @@ -28,9 +32,10 @@ gulp.task('watch-develop-bundle', browserifyCreator(true, {development: true}, I // provided with a copy of the source transpiled to ES5. gulp.task('release', ['cleanly-build-bundle'], function() { // Transpile CommonJS files to ES5 with React's tools. - gulp.src(['./src/**/*.js', './src/**/*.jsx']) - .pipe(babel()) - .pipe(gulp.dest('build')); + gulp + .src(['./src/**/*.js', './src/**/*.jsx']) + .pipe(babel()) + .pipe(gulp.dest('build')); }); gulp.task('clean', function() { @@ -40,31 +45,30 @@ gulp.task('clean', function() { // This task is used to build the examples. It is used // in the development watch function as well. gulp.task('examples', function() { - gulp.src('./examples/*.jsx') - .pipe(babel()) - .pipe(gulp.dest('examples')); + gulp.src('./examples/*.jsx').pipe(babel()).pipe(gulp.dest('examples')); }); gulp.task('server', function() { - gulp.src(__dirname) - .pipe(server({ - port: 8080, - directoryListing: true, - livereload: { - enable: true, - filter: function(filename) { - if (filename.match(__dirname + '/examples')) { - return true; - // The examples draw from /dist, which should change - // when the source files change - } else if (filename.match(__dirname + '/dist')) { - return true; - } else { - return false; - } + gulp.src(__dirname).pipe( + server({ + port: 8080, + directoryListing: true, + livereload: { + enable: true, + filter: function(filename) { + if (filename.match(__dirname + '/examples')) { + return true; + // The examples draw from /dist, which should change + // when the source files change + } else if (filename.match(__dirname + '/dist')) { + return true; + } else { + return false; } } - })); + } + }) + ); }); // This task is used for development. When run, it sets up From 3c366e932f465d0efedb192f052060e3ac0fbecc Mon Sep 17 00:00:00 2001 From: Gareth Tan Date: Sat, 5 Aug 2017 01:32:11 -0400 Subject: [PATCH 59/78] Upgrade build pipeline. --- package.json | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index a20e00b..e19d9c8 100644 --- a/package.json +++ b/package.json @@ -26,6 +26,7 @@ "fix": "eslint --fix --ext .jsx --ext .js ./src ./__tests__ ./pipeline", "typecheck": "flow version && flow check", "verify": "npm test && npm run typecheck && npm run lint", + "develop": "gulp develop", "preversion": "npm run verify", "prepublish": "gulp release", "lint-staged": "lint-staged", @@ -60,9 +61,10 @@ "babel-plugin-transform-object-rest-spread": "6.23.0", "babel-preset-es2015": "6.24.1", "babel-preset-react": "6.24.1", - "babelify": "^6.3.0", + "babelify": "7.3.0", "browserify": "^9.0.3", "coveralls": "^2.11.2", + "create-react-class": "15.6.0", "del": "2.0.2", "envify": "3.4.0", "enzyme": "2.9.1", @@ -74,7 +76,7 @@ "eslint-plugin-react": "7.1.0", "flow-bin": "0.52.0", "gulp": "^3.8.8", - "gulp-babel": "^5.2.1", + "gulp-babel": "6.1.2", "gulp-concat": "^2.4.3", "gulp-size": "^2.0.0", "gulp-sourcemaps": "^1.2.4", From ec2bcbdc7280c17b379f186fee8466e0690134ac Mon Sep 17 00:00:00 2001 From: Gareth Tan Date: Sat, 5 Aug 2017 01:40:43 -0400 Subject: [PATCH 60/78] Add Cypress. --- .travis.yml | 4 +++- config/travis/test.sh | 5 +++++ cypress.json | 3 +++ cypress/integration/basic_infinite_spec.js | 0 4 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 cypress.json create mode 100644 cypress/integration/basic_infinite_spec.js diff --git a/.travis.yml b/.travis.yml index 192028c..005a303 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,7 +9,9 @@ env: - TEST=1 - TYPECHECK=1 - LINT=1 - + - BROWSER=1 +before_install: + - npm install -g cypress-cli script: - ./config/travis/test.sh before_install: npm install react react-dom prop-types && npm install diff --git a/config/travis/test.sh b/config/travis/test.sh index f57a36a..3a2cfd0 100755 --- a/config/travis/test.sh +++ b/config/travis/test.sh @@ -14,3 +14,8 @@ fi; if [ "$LINT" = 1 ]; then npm run lint fi; + +if [ "$BROWSER" = 1 ]; then + npm run develop + cypress run --record --key +fi; diff --git a/cypress.json b/cypress.json new file mode 100644 index 0000000..7b39078 --- /dev/null +++ b/cypress.json @@ -0,0 +1,3 @@ +{ + "projectId": "gor1eu" +} diff --git a/cypress/integration/basic_infinite_spec.js b/cypress/integration/basic_infinite_spec.js new file mode 100644 index 0000000..e69de29 From 5c6ebabeca8a1659ea885a51715e6325f89f2e9f Mon Sep 17 00:00:00 2001 From: Gareth Tan Date: Sat, 5 Aug 2017 01:42:03 -0400 Subject: [PATCH 61/78] Add first spec. --- cypress/integration/basic_infinite_spec.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/cypress/integration/basic_infinite_spec.js b/cypress/integration/basic_infinite_spec.js index e69de29..c707794 100644 --- a/cypress/integration/basic_infinite_spec.js +++ b/cypress/integration/basic_infinite_spec.js @@ -0,0 +1,22 @@ +/* eslint-disable */ + +describe('React Infinite Basic Lists', function() { + + it('is able to render a basic list', function () { + cy.visit('http://localhost:8080/examples/example.html'); + + cy.get("#infinite-example-one").as('basic'); + + // Shows only + for (var i = 0; i < 8; i++) { + cy.get('@basic').should('contain', `List Item ${i}`); + } + + cy.get('@basic').should('not.contain', 'List Item 8') + .should('not.contain', 'List Item 9'); + + cy.get('@basic').then($con => { + $con.get(0).scrollTop = 400; + }); + }); +}); From 6ee181e67f5ecb7901dc22206be0eea28828c305 Mon Sep 17 00:00:00 2001 From: Gareth Tan Date: Sat, 5 Aug 2017 01:57:16 -0400 Subject: [PATCH 62/78] Fix for cypress. --- .travis.yml | 3 --- config/travis/test.sh | 7 +++++-- package.json | 1 - 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 005a303..137954a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,9 +10,6 @@ env: - TYPECHECK=1 - LINT=1 - BROWSER=1 -before_install: - - npm install -g cypress-cli script: - ./config/travis/test.sh -before_install: npm install react react-dom prop-types && npm install after_success: cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js diff --git a/config/travis/test.sh b/config/travis/test.sh index 3a2cfd0..de112de 100755 --- a/config/travis/test.sh +++ b/config/travis/test.sh @@ -3,19 +3,22 @@ set -e if [ "$TEST" = 1 ]; then - npm install react react-dom prop-types create-react-class + npm install react react-dom prop-types && npm install npm run test fi; if [ "$TYPECHECK" = 1 ]; then + npm install flow-bin npm run typecheck fi; if [ "$LINT" = 1 ]; then + npm install react react-dom prop-types && npm install npm run lint fi; if [ "$BROWSER" = 1 ]; then - npm run develop + npm install -g cypress-cli http-server + http-server --silent & cypress run --record --key fi; diff --git a/package.json b/package.json index e19d9c8..71ed769 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,6 @@ "fix": "eslint --fix --ext .jsx --ext .js ./src ./__tests__ ./pipeline", "typecheck": "flow version && flow check", "verify": "npm test && npm run typecheck && npm run lint", - "develop": "gulp develop", "preversion": "npm run verify", "prepublish": "gulp release", "lint-staged": "lint-staged", From b2cc7acccaf03f4b6cc139d7ae5e3cb8f6393467 Mon Sep 17 00:00:00 2001 From: Gareth Tan Date: Sat, 5 Aug 2017 02:00:09 -0400 Subject: [PATCH 63/78] Remove argument. --- config/travis/test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/travis/test.sh b/config/travis/test.sh index de112de..f2da3fa 100755 --- a/config/travis/test.sh +++ b/config/travis/test.sh @@ -20,5 +20,5 @@ fi; if [ "$BROWSER" = 1 ]; then npm install -g cypress-cli http-server http-server --silent & - cypress run --record --key + cypress run --record fi; From 6ca75e96559b0c91bdae79525812f243c879ef08 Mon Sep 17 00:00:00 2001 From: Gareth Tan Date: Sat, 5 Aug 2017 02:04:05 -0400 Subject: [PATCH 64/78] Install peer dependencies. --- config/travis/test.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/config/travis/test.sh b/config/travis/test.sh index f2da3fa..9153361 100755 --- a/config/travis/test.sh +++ b/config/travis/test.sh @@ -19,6 +19,7 @@ fi; if [ "$BROWSER" = 1 ]; then npm install -g cypress-cli http-server + npm install react react-dom create-react-class http-server --silent & cypress run --record fi; From 22ae28f1ccba1c8f9000fb2fba87a36dba38e1e3 Mon Sep 17 00:00:00 2001 From: Gareth Tan Date: Sat, 5 Aug 2017 02:04:38 -0400 Subject: [PATCH 65/78] Tweak config. --- config/travis/test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/travis/test.sh b/config/travis/test.sh index 9153361..9cbdf49 100755 --- a/config/travis/test.sh +++ b/config/travis/test.sh @@ -1,6 +1,6 @@ #!/bin/bash -set -e +set -ex if [ "$TEST" = 1 ]; then npm install react react-dom prop-types && npm install From 3848461efe5c42517b14f00570325b7784f490b4 Mon Sep 17 00:00:00 2001 From: Gareth Tan Date: Sat, 5 Aug 2017 02:10:57 -0400 Subject: [PATCH 66/78] Cache cypress and build examples. --- .travis.yml | 1 + config/travis/test.sh | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 137954a..ada911a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,6 +5,7 @@ node_js: cache: directories: - node_modules + - /home/travis/.cypress/Cypress env: - TEST=1 - TYPECHECK=1 diff --git a/config/travis/test.sh b/config/travis/test.sh index 9cbdf49..6dba768 100755 --- a/config/travis/test.sh +++ b/config/travis/test.sh @@ -19,7 +19,8 @@ fi; if [ "$BROWSER" = 1 ]; then npm install -g cypress-cli http-server - npm install react react-dom create-react-class + npm install react react-dom create-react-class gulp + gulp examples http-server --silent & cypress run --record fi; From 4e8b6bbd5108a62308cd1948a490ec9260cd8b63 Mon Sep 17 00:00:00 2001 From: Gareth Tan Date: Sun, 6 Aug 2017 00:18:00 -0400 Subject: [PATCH 67/78] Exclude prop-types from the build. --- pipeline/browserify.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pipeline/browserify.js b/pipeline/browserify.js index 4cc7bd4..341dbeb 100644 --- a/pipeline/browserify.js +++ b/pipeline/browserify.js @@ -80,7 +80,8 @@ module.exports = function(shouldWatch, envObject, files) { }) ) .exclude('react') - .exclude('react-dom'); + .exclude('react-dom') + .exclude('prop-types'); if (envObject.production || envObject.release) { root = root.transform('uglifyify'); From b324f73ecdc5573a0ab0a8d054b107262680fb26 Mon Sep 17 00:00:00 2001 From: Gareth Tan Date: Sun, 6 Aug 2017 00:26:55 -0400 Subject: [PATCH 68/78] Package and package lock updates. --- package-lock.json | 11578 ++++++++++++++++++++++++++++++++++++++++++++ package.json | 1 + 2 files changed, 11579 insertions(+) create mode 100644 package-lock.json diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..b725636 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,11578 @@ +{ + "name": "react-infinite", + "version": "0.11.2", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@gulp-sourcemaps/map-sources": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@gulp-sourcemaps/map-sources/-/map-sources-1.0.0.tgz", + "integrity": "sha1-iQrnxdjId/bThIYCFazp1+yUW9o=", + "dev": true, + "requires": { + "normalize-path": "2.1.1", + "through2": "2.0.3" + }, + "dependencies": { + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "readable-stream": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.3.tgz", + "integrity": "sha512-m+qzzcn7KUxEmd1gMbchF+Y2eIUbieUaxkWtptyHywrX0rE8QEYqPC07Vuy4Wm32/xE16NcdBctb8S0Xe/5IeQ==", + "dev": true, + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "1.0.0", + "process-nextick-args": "1.0.7", + "safe-buffer": "5.1.1", + "string_decoder": "1.0.3", + "util-deprecate": "1.0.2" + } + }, + "string_decoder": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", + "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", + "dev": true, + "requires": { + "safe-buffer": "5.1.1" + } + }, + "through2": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.3.tgz", + "integrity": "sha1-AARWmzfHx0ujnEPzzteNGtlBQL4=", + "dev": true, + "requires": { + "readable-stream": "2.3.3", + "xtend": "4.0.1" + } + }, + "xtend": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", + "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=", + "dev": true + } + } + }, + "abab": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/abab/-/abab-1.0.3.tgz", + "integrity": "sha1-uB3l9ydOxOdW15fNg08wNkJyTl0=", + "dev": true + }, + "accepts": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.3.tgz", + "integrity": "sha1-w8p0NJOGSMPg2cHjKN1otiLChMo=", + "dev": true, + "requires": { + "mime-types": "2.1.16", + "negotiator": "0.6.1" + } + }, + "acorn": { + "version": "4.0.13", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-4.0.13.tgz", + "integrity": "sha1-EFSVrlNh1pe9GVyCUZLhrX8lN4c=", + "dev": true + }, + "acorn-globals": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-3.1.0.tgz", + "integrity": "sha1-/YJw9x+7SZawBPqIDuXUZXOnMb8=", + "dev": true, + "requires": { + "acorn": "4.0.13" + } + }, + "acorn-jsx": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-3.0.1.tgz", + "integrity": "sha1-r9+UiPsezvyDSPb7IvRk4ypYs2s=", + "dev": true, + "requires": { + "acorn": "3.3.0" + }, + "dependencies": { + "acorn": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-3.3.0.tgz", + "integrity": "sha1-ReN/s56No/JbruP/U2niu18iAXo=", + "dev": true + } + } + }, + "ajv": { + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.2.2.tgz", + "integrity": "sha1-R8aNaehvXZUxA7AHSpQw3GPaXjk=", + "dev": true, + "requires": { + "co": "4.6.0", + "fast-deep-equal": "1.0.0", + "json-schema-traverse": "0.3.1", + "json-stable-stringify": "1.0.1" + }, + "dependencies": { + "json-stable-stringify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz", + "integrity": "sha1-mnWdOcXy/1A/1TAGRu1EX4jE+a8=", + "dev": true, + "requires": { + "jsonify": "0.0.0" + } + } + } + }, + "ajv-keywords": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-1.5.1.tgz", + "integrity": "sha1-MU3QpLM2j609/NxU7eYXG4htrzw=", + "dev": true + }, + "align-text": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz", + "integrity": "sha1-DNkKVhCT810KmSVsIrcGlDP60Rc=", + "dev": true, + "requires": { + "kind-of": "3.2.2", + "longest": "1.0.1", + "repeat-string": "1.6.1" + } + }, + "amdefine": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz", + "integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=", + "dev": true + }, + "ansi-escapes": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-2.0.0.tgz", + "integrity": "sha1-W65SvkJIeN2Xg+iRDj/Cki6DyBs=", + "dev": true + }, + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + }, + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", + "dev": true + }, + "anymatch": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-1.3.2.tgz", + "integrity": "sha512-0XNayC8lTHQ2OI8aljNCN3sSx6hsr/1+rlcDAotXJR7C1oZZHCNsfpbKwMjRA3Uqb5tF1Rae2oloTr4xpq+WjA==", + "dev": true, + "requires": { + "micromatch": "2.3.11", + "normalize-path": "2.1.1" + } + }, + "app-root-path": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/app-root-path/-/app-root-path-2.0.1.tgz", + "integrity": "sha1-zWLc+OT9WkF+/GZNLlsQZTxlG0Y=", + "dev": true + }, + "append-transform": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/append-transform/-/append-transform-0.4.0.tgz", + "integrity": "sha1-126/jKlNJ24keja61EpLdKthGZE=", + "dev": true, + "requires": { + "default-require-extensions": "1.0.0" + } + }, + "archy": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz", + "integrity": "sha1-+cjBN1fMHde8N5rHeyxipcKGjEA=", + "dev": true + }, + "argparse": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.9.tgz", + "integrity": "sha1-c9g7wmP4bpf4zE9rrhsOkKfSLIY=", + "dev": true, + "requires": { + "sprintf-js": "1.0.3" + } + }, + "arr-diff": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz", + "integrity": "sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=", + "dev": true, + "requires": { + "arr-flatten": "1.1.0" + } + }, + "arr-flatten": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", + "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", + "dev": true + }, + "array-differ": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/array-differ/-/array-differ-1.0.0.tgz", + "integrity": "sha1-7/UuN1gknTO+QCuLuOVkuytdQDE=", + "dev": true + }, + "array-each": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/array-each/-/array-each-1.0.1.tgz", + "integrity": "sha1-p5SvDAWrF1KEbudTofIRoFugxE8=", + "dev": true + }, + "array-equal": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/array-equal/-/array-equal-1.0.0.tgz", + "integrity": "sha1-jCpe8kcv2ep0KwTHenUJO6J1fJM=", + "dev": true + }, + "array-filter": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/array-filter/-/array-filter-0.0.1.tgz", + "integrity": "sha1-fajPLiZijtcygDWB/SH2fKzS7uw=", + "dev": true + }, + "array-find-index": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.2.tgz", + "integrity": "sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E=", + "dev": true + }, + "array-map": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/array-map/-/array-map-0.0.0.tgz", + "integrity": "sha1-iKK6tz0c97zVwbEYoAP2b2ZfpmI=", + "dev": true + }, + "array-reduce": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/array-reduce/-/array-reduce-0.0.0.tgz", + "integrity": "sha1-FziZ0//Rx9k4PkR5Ul2+J4yrXys=", + "dev": true + }, + "array-slice": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/array-slice/-/array-slice-1.0.0.tgz", + "integrity": "sha1-5zA08A3MH0CHYAj9IP6ud71LfC8=", + "dev": true + }, + "array-union": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", + "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", + "dev": true, + "requires": { + "array-uniq": "1.0.3" + } + }, + "array-uniq": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", + "integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=", + "dev": true + }, + "array-unique": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz", + "integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=", + "dev": true + }, + "arrify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", + "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", + "dev": true + }, + "asap": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz", + "integrity": "sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY=", + "dev": true + }, + "asn1": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.3.tgz", + "integrity": "sha1-2sh4dxPJlmhJ/IGAd36+nB3fO4Y=", + "dev": true + }, + "asn1.js": { + "version": "4.9.1", + "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-4.9.1.tgz", + "integrity": "sha1-SLokC0WpKA6UdImQull9IWYX/UA=", + "dev": true, + "requires": { + "bn.js": "4.11.7", + "inherits": "2.0.3", + "minimalistic-assert": "1.0.0" + } + }, + "assert": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/assert/-/assert-1.3.0.tgz", + "integrity": "sha1-A5OaYiWCqBLMICMgoLmlbJuBWEk=", + "dev": true, + "requires": { + "util": "0.10.3" + } + }, + "assert-plus": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.2.0.tgz", + "integrity": "sha1-104bh+ev/A24qttwIfP+SBAasjQ=", + "dev": true + }, + "astw": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/astw/-/astw-2.2.0.tgz", + "integrity": "sha1-e9QXhNMkk5h66yOba04cV6hzuRc=", + "dev": true, + "requires": { + "acorn": "4.0.13" + } + }, + "async": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/async/-/async-2.5.0.tgz", + "integrity": "sha512-e+lJAJeNWuPCNyxZKOBdaJGyLGHugXVQtrAwtuAe2vhxTYxFTKE73p8JuTmdH0qdQZtDvI4dhJwjZc5zsfIsYw==", + "dev": true, + "requires": { + "lodash": "4.17.4" + } + }, + "async-each": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.1.tgz", + "integrity": "sha1-GdOGodntxufByF04iu28xW0zYC0=", + "dev": true + }, + "asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", + "dev": true + }, + "atob": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/atob/-/atob-1.1.3.tgz", + "integrity": "sha1-lfE2KbEsOlGl0hWr3OKqnzL4B3M=", + "dev": true + }, + "aws-sign2": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.6.0.tgz", + "integrity": "sha1-FDQt0428yU0OW4fXY81jYSwOeU8=", + "dev": true + }, + "aws4": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.6.0.tgz", + "integrity": "sha1-g+9cqGCysy5KDe7e6MdxudtXRx4=", + "dev": true + }, + "babel-code-frame": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.22.0.tgz", + "integrity": "sha1-AnYgvuVnqIwyVhV05/0IAdMxGOQ=", + "dev": true, + "requires": { + "chalk": "1.1.3", + "esutils": "2.0.2", + "js-tokens": "3.0.2" + } + }, + "babel-core": { + "version": "6.25.0", + "resolved": "https://registry.npmjs.org/babel-core/-/babel-core-6.25.0.tgz", + "integrity": "sha1-fdQrBGPHQunVKW3rPsZ6kyLa1yk=", + "dev": true, + "requires": { + "babel-code-frame": "6.22.0", + "babel-generator": "6.25.0", + "babel-helpers": "6.24.1", + "babel-messages": "6.23.0", + "babel-register": "6.24.1", + "babel-runtime": "6.25.0", + "babel-template": "6.25.0", + "babel-traverse": "6.25.0", + "babel-types": "6.25.0", + "babylon": "6.17.4", + "convert-source-map": "1.5.0", + "debug": "2.6.8", + "json5": "0.5.1", + "lodash": "4.17.4", + "minimatch": "3.0.4", + "path-is-absolute": "1.0.1", + "private": "0.1.7", + "slash": "1.0.0", + "source-map": "0.5.6" + }, + "dependencies": { + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "1.1.8" + } + } + } + }, + "babel-eslint": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/babel-eslint/-/babel-eslint-7.2.3.tgz", + "integrity": "sha1-sv4tgBJkcPXBlELcdXJTqJdxCCc=", + "dev": true, + "requires": { + "babel-code-frame": "6.22.0", + "babel-traverse": "6.25.0", + "babel-types": "6.25.0", + "babylon": "6.17.4" + } + }, + "babel-generator": { + "version": "6.25.0", + "resolved": "https://registry.npmjs.org/babel-generator/-/babel-generator-6.25.0.tgz", + "integrity": "sha1-M6GvcNXyiQrrRlpKd5PB32qeqfw=", + "dev": true, + "requires": { + "babel-messages": "6.23.0", + "babel-runtime": "6.25.0", + "babel-types": "6.25.0", + "detect-indent": "4.0.0", + "jsesc": "1.3.0", + "lodash": "4.17.4", + "source-map": "0.5.6", + "trim-right": "1.0.1" + } + }, + "babel-helper-builder-react-jsx": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-builder-react-jsx/-/babel-helper-builder-react-jsx-6.24.1.tgz", + "integrity": "sha1-CteRfjPI11HmRtrKTnfMGTd9LLw=", + "dev": true, + "requires": { + "babel-runtime": "6.25.0", + "babel-types": "6.25.0", + "esutils": "2.0.2" + } + }, + "babel-helper-call-delegate": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-call-delegate/-/babel-helper-call-delegate-6.24.1.tgz", + "integrity": "sha1-7Oaqzdx25Bw0YfiL/Fdb0Nqi340=", + "dev": true, + "requires": { + "babel-helper-hoist-variables": "6.24.1", + "babel-runtime": "6.25.0", + "babel-traverse": "6.25.0", + "babel-types": "6.25.0" + } + }, + "babel-helper-define-map": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-define-map/-/babel-helper-define-map-6.24.1.tgz", + "integrity": "sha1-epdH8ljYlH0y1RX2qhx70CIEoIA=", + "dev": true, + "requires": { + "babel-helper-function-name": "6.24.1", + "babel-runtime": "6.25.0", + "babel-types": "6.25.0", + "lodash": "4.17.4" + } + }, + "babel-helper-function-name": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-function-name/-/babel-helper-function-name-6.24.1.tgz", + "integrity": "sha1-00dbjAPtmCQqJbSDUasYOZ01gKk=", + "dev": true, + "requires": { + "babel-helper-get-function-arity": "6.24.1", + "babel-runtime": "6.25.0", + "babel-template": "6.25.0", + "babel-traverse": "6.25.0", + "babel-types": "6.25.0" + } + }, + "babel-helper-get-function-arity": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-get-function-arity/-/babel-helper-get-function-arity-6.24.1.tgz", + "integrity": "sha1-j3eCqpNAfEHTqlCQj4mwMbG2hT0=", + "dev": true, + "requires": { + "babel-runtime": "6.25.0", + "babel-types": "6.25.0" + } + }, + "babel-helper-hoist-variables": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-hoist-variables/-/babel-helper-hoist-variables-6.24.1.tgz", + "integrity": "sha1-HssnaJydJVE+rbyZFKc/VAi+enY=", + "dev": true, + "requires": { + "babel-runtime": "6.25.0", + "babel-types": "6.25.0" + } + }, + "babel-helper-optimise-call-expression": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-optimise-call-expression/-/babel-helper-optimise-call-expression-6.24.1.tgz", + "integrity": "sha1-96E0J7qfc/j0+pk8VKl4gtEkQlc=", + "dev": true, + "requires": { + "babel-runtime": "6.25.0", + "babel-types": "6.25.0" + } + }, + "babel-helper-regex": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-regex/-/babel-helper-regex-6.24.1.tgz", + "integrity": "sha1-024i+rEAjXnYhkjjIRaGgShFbOg=", + "dev": true, + "requires": { + "babel-runtime": "6.25.0", + "babel-types": "6.25.0", + "lodash": "4.17.4" + } + }, + "babel-helper-replace-supers": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-replace-supers/-/babel-helper-replace-supers-6.24.1.tgz", + "integrity": "sha1-v22/5Dk40XNpohPKiov3S2qQqxo=", + "dev": true, + "requires": { + "babel-helper-optimise-call-expression": "6.24.1", + "babel-messages": "6.23.0", + "babel-runtime": "6.25.0", + "babel-template": "6.25.0", + "babel-traverse": "6.25.0", + "babel-types": "6.25.0" + } + }, + "babel-helpers": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helpers/-/babel-helpers-6.24.1.tgz", + "integrity": "sha1-NHHenK7DiOXIUOWX5Yom3fN2ArI=", + "dev": true, + "requires": { + "babel-runtime": "6.25.0", + "babel-template": "6.25.0" + } + }, + "babel-jest": { + "version": "20.0.3", + "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-20.0.3.tgz", + "integrity": "sha1-5KA7E9wQOJ4UD8ZF0J/8TO0wFnE=", + "dev": true, + "requires": { + "babel-core": "6.25.0", + "babel-plugin-istanbul": "4.1.4", + "babel-preset-jest": "20.0.3" + } + }, + "babel-messages": { + "version": "6.23.0", + "resolved": "https://registry.npmjs.org/babel-messages/-/babel-messages-6.23.0.tgz", + "integrity": "sha1-8830cDhYA1sqKVHG7F7fbGLyYw4=", + "dev": true, + "requires": { + "babel-runtime": "6.25.0" + } + }, + "babel-plugin-check-es2015-constants": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-check-es2015-constants/-/babel-plugin-check-es2015-constants-6.22.0.tgz", + "integrity": "sha1-NRV7EBQm/S/9PaP3XH0ekYNbv4o=", + "dev": true, + "requires": { + "babel-runtime": "6.25.0" + } + }, + "babel-plugin-istanbul": { + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-4.1.4.tgz", + "integrity": "sha1-GN3oS/POMp/d8/QQP66SFFbY5Yc=", + "dev": true, + "requires": { + "find-up": "2.1.0", + "istanbul-lib-instrument": "1.7.4", + "test-exclude": "4.1.1" + }, + "dependencies": { + "find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "dev": true, + "requires": { + "locate-path": "2.0.0" + } + } + } + }, + "babel-plugin-jest-hoist": { + "version": "20.0.3", + "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-20.0.3.tgz", + "integrity": "sha1-r+3IU70/jcNUjqZx++adA8wsF2c=", + "dev": true + }, + "babel-plugin-syntax-class-properties": { + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-class-properties/-/babel-plugin-syntax-class-properties-6.13.0.tgz", + "integrity": "sha1-1+sjt5oxf4VDlixQW4J8fWysJ94=", + "dev": true + }, + "babel-plugin-syntax-flow": { + "version": "6.18.0", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-flow/-/babel-plugin-syntax-flow-6.18.0.tgz", + "integrity": "sha1-TDqyCiryaqIM0lmVw5jE63AxDI0=", + "dev": true + }, + "babel-plugin-syntax-jsx": { + "version": "6.18.0", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-jsx/-/babel-plugin-syntax-jsx-6.18.0.tgz", + "integrity": "sha1-CvMqmm4Tyno/1QaeYtew9Y0NiUY=", + "dev": true + }, + "babel-plugin-syntax-object-rest-spread": { + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-object-rest-spread/-/babel-plugin-syntax-object-rest-spread-6.13.0.tgz", + "integrity": "sha1-/WU28rzhODb/o6VFjEkDpZe7O/U=", + "dev": true + }, + "babel-plugin-transform-class-properties": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-class-properties/-/babel-plugin-transform-class-properties-6.24.1.tgz", + "integrity": "sha1-anl2PqYdM9NvN7YRqp3vgagbRqw=", + "dev": true, + "requires": { + "babel-helper-function-name": "6.24.1", + "babel-plugin-syntax-class-properties": "6.13.0", + "babel-runtime": "6.25.0", + "babel-template": "6.25.0" + } + }, + "babel-plugin-transform-es2015-arrow-functions": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-arrow-functions/-/babel-plugin-transform-es2015-arrow-functions-6.22.0.tgz", + "integrity": "sha1-RSaSy3EdX3ncf4XkQM5BufJE0iE=", + "dev": true, + "requires": { + "babel-runtime": "6.25.0" + } + }, + "babel-plugin-transform-es2015-block-scoped-functions": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-block-scoped-functions/-/babel-plugin-transform-es2015-block-scoped-functions-6.22.0.tgz", + "integrity": "sha1-u8UbSflk1wy42OC5ToICRs46YUE=", + "dev": true, + "requires": { + "babel-runtime": "6.25.0" + } + }, + "babel-plugin-transform-es2015-block-scoping": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-block-scoping/-/babel-plugin-transform-es2015-block-scoping-6.24.1.tgz", + "integrity": "sha1-dsKV3DpHQbFmWt/TFnIV3P8ypXY=", + "dev": true, + "requires": { + "babel-runtime": "6.25.0", + "babel-template": "6.25.0", + "babel-traverse": "6.25.0", + "babel-types": "6.25.0", + "lodash": "4.17.4" + } + }, + "babel-plugin-transform-es2015-classes": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-classes/-/babel-plugin-transform-es2015-classes-6.24.1.tgz", + "integrity": "sha1-WkxYpQyclGHlZLSyo7+ryXolhNs=", + "dev": true, + "requires": { + "babel-helper-define-map": "6.24.1", + "babel-helper-function-name": "6.24.1", + "babel-helper-optimise-call-expression": "6.24.1", + "babel-helper-replace-supers": "6.24.1", + "babel-messages": "6.23.0", + "babel-runtime": "6.25.0", + "babel-template": "6.25.0", + "babel-traverse": "6.25.0", + "babel-types": "6.25.0" + } + }, + "babel-plugin-transform-es2015-computed-properties": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-computed-properties/-/babel-plugin-transform-es2015-computed-properties-6.24.1.tgz", + "integrity": "sha1-b+Ko0WiV1WNPTNmZttNICjCBWbM=", + "dev": true, + "requires": { + "babel-runtime": "6.25.0", + "babel-template": "6.25.0" + } + }, + "babel-plugin-transform-es2015-destructuring": { + "version": "6.23.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-destructuring/-/babel-plugin-transform-es2015-destructuring-6.23.0.tgz", + "integrity": "sha1-mXux8auWf2gtKwh2/jWNYOdlxW0=", + "dev": true, + "requires": { + "babel-runtime": "6.25.0" + } + }, + "babel-plugin-transform-es2015-duplicate-keys": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-duplicate-keys/-/babel-plugin-transform-es2015-duplicate-keys-6.24.1.tgz", + "integrity": "sha1-c+s9MQypaePvnskcU3QabxV2Qj4=", + "dev": true, + "requires": { + "babel-runtime": "6.25.0", + "babel-types": "6.25.0" + } + }, + "babel-plugin-transform-es2015-for-of": { + "version": "6.23.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-for-of/-/babel-plugin-transform-es2015-for-of-6.23.0.tgz", + "integrity": "sha1-9HyVsrYT3x0+zC/bdXNiPHUkhpE=", + "dev": true, + "requires": { + "babel-runtime": "6.25.0" + } + }, + "babel-plugin-transform-es2015-function-name": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-function-name/-/babel-plugin-transform-es2015-function-name-6.24.1.tgz", + "integrity": "sha1-g0yJhTvDaxrw86TF26qU/Y6sqos=", + "dev": true, + "requires": { + "babel-helper-function-name": "6.24.1", + "babel-runtime": "6.25.0", + "babel-types": "6.25.0" + } + }, + "babel-plugin-transform-es2015-literals": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-literals/-/babel-plugin-transform-es2015-literals-6.22.0.tgz", + "integrity": "sha1-T1SgLWzWbPkVKAAZox0xklN3yi4=", + "dev": true, + "requires": { + "babel-runtime": "6.25.0" + } + }, + "babel-plugin-transform-es2015-modules-amd": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-amd/-/babel-plugin-transform-es2015-modules-amd-6.24.1.tgz", + "integrity": "sha1-Oz5UAXI5hC1tGcMBHEvS8AoA0VQ=", + "dev": true, + "requires": { + "babel-plugin-transform-es2015-modules-commonjs": "6.24.1", + "babel-runtime": "6.25.0", + "babel-template": "6.25.0" + } + }, + "babel-plugin-transform-es2015-modules-commonjs": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.24.1.tgz", + "integrity": "sha1-0+MQtA72ZKNmIiAAl8bUQCmPK/4=", + "dev": true, + "requires": { + "babel-plugin-transform-strict-mode": "6.24.1", + "babel-runtime": "6.25.0", + "babel-template": "6.25.0", + "babel-types": "6.25.0" + } + }, + "babel-plugin-transform-es2015-modules-systemjs": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-systemjs/-/babel-plugin-transform-es2015-modules-systemjs-6.24.1.tgz", + "integrity": "sha1-/4mhQrkRmpBhlfXxBuzzBdlAfSM=", + "dev": true, + "requires": { + "babel-helper-hoist-variables": "6.24.1", + "babel-runtime": "6.25.0", + "babel-template": "6.25.0" + } + }, + "babel-plugin-transform-es2015-modules-umd": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-umd/-/babel-plugin-transform-es2015-modules-umd-6.24.1.tgz", + "integrity": "sha1-rJl+YoXNGO1hdq22B9YCNErThGg=", + "dev": true, + "requires": { + "babel-plugin-transform-es2015-modules-amd": "6.24.1", + "babel-runtime": "6.25.0", + "babel-template": "6.25.0" + } + }, + "babel-plugin-transform-es2015-object-super": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-object-super/-/babel-plugin-transform-es2015-object-super-6.24.1.tgz", + "integrity": "sha1-JM72muIcuDp/hgPa0CH1cusnj40=", + "dev": true, + "requires": { + "babel-helper-replace-supers": "6.24.1", + "babel-runtime": "6.25.0" + } + }, + "babel-plugin-transform-es2015-parameters": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-parameters/-/babel-plugin-transform-es2015-parameters-6.24.1.tgz", + "integrity": "sha1-V6w1GrScrxSpfNE7CfZv3wpiXys=", + "dev": true, + "requires": { + "babel-helper-call-delegate": "6.24.1", + "babel-helper-get-function-arity": "6.24.1", + "babel-runtime": "6.25.0", + "babel-template": "6.25.0", + "babel-traverse": "6.25.0", + "babel-types": "6.25.0" + } + }, + "babel-plugin-transform-es2015-shorthand-properties": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-shorthand-properties/-/babel-plugin-transform-es2015-shorthand-properties-6.24.1.tgz", + "integrity": "sha1-JPh11nIch2YbvZmkYi5R8U3jiqA=", + "dev": true, + "requires": { + "babel-runtime": "6.25.0", + "babel-types": "6.25.0" + } + }, + "babel-plugin-transform-es2015-spread": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-spread/-/babel-plugin-transform-es2015-spread-6.22.0.tgz", + "integrity": "sha1-1taKmfia7cRTbIGlQujdnxdG+NE=", + "dev": true, + "requires": { + "babel-runtime": "6.25.0" + } + }, + "babel-plugin-transform-es2015-sticky-regex": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-sticky-regex/-/babel-plugin-transform-es2015-sticky-regex-6.24.1.tgz", + "integrity": "sha1-AMHNsaynERLN8M9hJsLta0V8zbw=", + "dev": true, + "requires": { + "babel-helper-regex": "6.24.1", + "babel-runtime": "6.25.0", + "babel-types": "6.25.0" + } + }, + "babel-plugin-transform-es2015-template-literals": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-template-literals/-/babel-plugin-transform-es2015-template-literals-6.22.0.tgz", + "integrity": "sha1-qEs0UPfp+PH2g51taH2oS7EjbY0=", + "dev": true, + "requires": { + "babel-runtime": "6.25.0" + } + }, + "babel-plugin-transform-es2015-typeof-symbol": { + "version": "6.23.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-typeof-symbol/-/babel-plugin-transform-es2015-typeof-symbol-6.23.0.tgz", + "integrity": "sha1-3sCfHN3/lLUqxz1QXITfWdzOs3I=", + "dev": true, + "requires": { + "babel-runtime": "6.25.0" + } + }, + "babel-plugin-transform-es2015-unicode-regex": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-unicode-regex/-/babel-plugin-transform-es2015-unicode-regex-6.24.1.tgz", + "integrity": "sha1-04sS9C6nMj9yk4fxinxa4frrNek=", + "dev": true, + "requires": { + "babel-helper-regex": "6.24.1", + "babel-runtime": "6.25.0", + "regexpu-core": "2.0.0" + } + }, + "babel-plugin-transform-flow-strip-types": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-flow-strip-types/-/babel-plugin-transform-flow-strip-types-6.22.0.tgz", + "integrity": "sha1-hMtnKTXUNxT9wyvOhFaNh0Qc988=", + "dev": true, + "requires": { + "babel-plugin-syntax-flow": "6.18.0", + "babel-runtime": "6.25.0" + } + }, + "babel-plugin-transform-object-rest-spread": { + "version": "6.23.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-object-rest-spread/-/babel-plugin-transform-object-rest-spread-6.23.0.tgz", + "integrity": "sha1-h11ryb52HFiirj/u5dxIldjH+SE=", + "dev": true, + "requires": { + "babel-plugin-syntax-object-rest-spread": "6.13.0", + "babel-runtime": "6.25.0" + } + }, + "babel-plugin-transform-react-display-name": { + "version": "6.25.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-react-display-name/-/babel-plugin-transform-react-display-name-6.25.0.tgz", + "integrity": "sha1-Z+K/Hx6ck6sI25Z5LgU5K/LMKNE=", + "dev": true, + "requires": { + "babel-runtime": "6.25.0" + } + }, + "babel-plugin-transform-react-jsx": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-react-jsx/-/babel-plugin-transform-react-jsx-6.24.1.tgz", + "integrity": "sha1-hAoCjn30YN/DotKfDA2R9jduZqM=", + "dev": true, + "requires": { + "babel-helper-builder-react-jsx": "6.24.1", + "babel-plugin-syntax-jsx": "6.18.0", + "babel-runtime": "6.25.0" + } + }, + "babel-plugin-transform-react-jsx-self": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-react-jsx-self/-/babel-plugin-transform-react-jsx-self-6.22.0.tgz", + "integrity": "sha1-322AqdomEqEh5t3XVYvL7PBuY24=", + "dev": true, + "requires": { + "babel-plugin-syntax-jsx": "6.18.0", + "babel-runtime": "6.25.0" + } + }, + "babel-plugin-transform-react-jsx-source": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-react-jsx-source/-/babel-plugin-transform-react-jsx-source-6.22.0.tgz", + "integrity": "sha1-ZqwSFT9c0tF7PBkmj0vwGX9E7NY=", + "dev": true, + "requires": { + "babel-plugin-syntax-jsx": "6.18.0", + "babel-runtime": "6.25.0" + } + }, + "babel-plugin-transform-regenerator": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-regenerator/-/babel-plugin-transform-regenerator-6.24.1.tgz", + "integrity": "sha1-uNowWtQ8PJm0hI5P5AN7dw0jxBg=", + "dev": true, + "requires": { + "regenerator-transform": "0.9.11" + } + }, + "babel-plugin-transform-strict-mode": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-strict-mode/-/babel-plugin-transform-strict-mode-6.24.1.tgz", + "integrity": "sha1-1fr3qleKZbvlkc9e2uBKDGcCB1g=", + "dev": true, + "requires": { + "babel-runtime": "6.25.0", + "babel-types": "6.25.0" + } + }, + "babel-preset-es2015": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-preset-es2015/-/babel-preset-es2015-6.24.1.tgz", + "integrity": "sha1-1EBQ1rwsn+6nAqrzjXJ6AhBTiTk=", + "dev": true, + "requires": { + "babel-plugin-check-es2015-constants": "6.22.0", + "babel-plugin-transform-es2015-arrow-functions": "6.22.0", + "babel-plugin-transform-es2015-block-scoped-functions": "6.22.0", + "babel-plugin-transform-es2015-block-scoping": "6.24.1", + "babel-plugin-transform-es2015-classes": "6.24.1", + "babel-plugin-transform-es2015-computed-properties": "6.24.1", + "babel-plugin-transform-es2015-destructuring": "6.23.0", + "babel-plugin-transform-es2015-duplicate-keys": "6.24.1", + "babel-plugin-transform-es2015-for-of": "6.23.0", + "babel-plugin-transform-es2015-function-name": "6.24.1", + "babel-plugin-transform-es2015-literals": "6.22.0", + "babel-plugin-transform-es2015-modules-amd": "6.24.1", + "babel-plugin-transform-es2015-modules-commonjs": "6.24.1", + "babel-plugin-transform-es2015-modules-systemjs": "6.24.1", + "babel-plugin-transform-es2015-modules-umd": "6.24.1", + "babel-plugin-transform-es2015-object-super": "6.24.1", + "babel-plugin-transform-es2015-parameters": "6.24.1", + "babel-plugin-transform-es2015-shorthand-properties": "6.24.1", + "babel-plugin-transform-es2015-spread": "6.22.0", + "babel-plugin-transform-es2015-sticky-regex": "6.24.1", + "babel-plugin-transform-es2015-template-literals": "6.22.0", + "babel-plugin-transform-es2015-typeof-symbol": "6.23.0", + "babel-plugin-transform-es2015-unicode-regex": "6.24.1", + "babel-plugin-transform-regenerator": "6.24.1" + } + }, + "babel-preset-flow": { + "version": "6.23.0", + "resolved": "https://registry.npmjs.org/babel-preset-flow/-/babel-preset-flow-6.23.0.tgz", + "integrity": "sha1-5xIYiHCFrpoktb5Baa/7WZgWxJ0=", + "dev": true, + "requires": { + "babel-plugin-transform-flow-strip-types": "6.22.0" + } + }, + "babel-preset-jest": { + "version": "20.0.3", + "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-20.0.3.tgz", + "integrity": "sha1-y6yq3stdaJyh4d4TYOv8ZoYsF4o=", + "dev": true, + "requires": { + "babel-plugin-jest-hoist": "20.0.3" + } + }, + "babel-preset-react": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-preset-react/-/babel-preset-react-6.24.1.tgz", + "integrity": "sha1-umnfrqRfw+xjm2pOzqbhdwLJE4A=", + "dev": true, + "requires": { + "babel-plugin-syntax-jsx": "6.18.0", + "babel-plugin-transform-react-display-name": "6.25.0", + "babel-plugin-transform-react-jsx": "6.24.1", + "babel-plugin-transform-react-jsx-self": "6.22.0", + "babel-plugin-transform-react-jsx-source": "6.22.0", + "babel-preset-flow": "6.23.0" + } + }, + "babel-register": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-register/-/babel-register-6.24.1.tgz", + "integrity": "sha1-fhDhOi9xBlvfrVoXh7pFvKbe118=", + "dev": true, + "requires": { + "babel-core": "6.25.0", + "babel-runtime": "6.25.0", + "core-js": "2.4.1", + "home-or-tmp": "2.0.0", + "lodash": "4.17.4", + "mkdirp": "0.5.1", + "source-map-support": "0.4.15" + }, + "dependencies": { + "core-js": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.4.1.tgz", + "integrity": "sha1-TekR5mew6ukSTjQlS1OupvxhjT4=", + "dev": true + } + } + }, + "babel-runtime": { + "version": "6.25.0", + "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.25.0.tgz", + "integrity": "sha1-M7mOql1IK7AajRqmtDetKwGuxBw=", + "dev": true, + "requires": { + "core-js": "2.4.1", + "regenerator-runtime": "0.10.5" + }, + "dependencies": { + "core-js": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.4.1.tgz", + "integrity": "sha1-TekR5mew6ukSTjQlS1OupvxhjT4=", + "dev": true + } + } + }, + "babel-template": { + "version": "6.25.0", + "resolved": "https://registry.npmjs.org/babel-template/-/babel-template-6.25.0.tgz", + "integrity": "sha1-ZlJBFmt8KqTGGdceGSlpVSsQwHE=", + "dev": true, + "requires": { + "babel-runtime": "6.25.0", + "babel-traverse": "6.25.0", + "babel-types": "6.25.0", + "babylon": "6.17.4", + "lodash": "4.17.4" + } + }, + "babel-traverse": { + "version": "6.25.0", + "resolved": "https://registry.npmjs.org/babel-traverse/-/babel-traverse-6.25.0.tgz", + "integrity": "sha1-IldJfi/NGbie3BPEyROB+VEklvE=", + "dev": true, + "requires": { + "babel-code-frame": "6.22.0", + "babel-messages": "6.23.0", + "babel-runtime": "6.25.0", + "babel-types": "6.25.0", + "babylon": "6.17.4", + "debug": "2.6.8", + "globals": "9.18.0", + "invariant": "2.2.2", + "lodash": "4.17.4" + } + }, + "babel-types": { + "version": "6.25.0", + "resolved": "https://registry.npmjs.org/babel-types/-/babel-types-6.25.0.tgz", + "integrity": "sha1-cK+ySNVmDl0Y+BHZHIMDtUE0oY4=", + "dev": true, + "requires": { + "babel-runtime": "6.25.0", + "esutils": "2.0.2", + "lodash": "4.17.4", + "to-fast-properties": "1.0.3" + } + }, + "babelify": { + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/babelify/-/babelify-7.3.0.tgz", + "integrity": "sha1-qlau3nBn/XvVSWZu4W3ChQh+iOU=", + "dev": true, + "requires": { + "babel-core": "6.25.0", + "object-assign": "4.0.1" + } + }, + "babylon": { + "version": "6.17.4", + "resolved": "https://registry.npmjs.org/babylon/-/babylon-6.17.4.tgz", + "integrity": "sha512-kChlV+0SXkjE0vUn9OZ7pBMWRFd8uq3mZe8x1K6jhuNcAFAtEnjchFAqB+dYEXKyd+JpT6eppRR78QAr5gTsUw==", + "dev": true + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true + }, + "base62": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/base62/-/base62-0.1.1.tgz", + "integrity": "sha1-e0F0wvlESXU7EcJlHAg9qEGnsIQ=", + "dev": true + }, + "Base64": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/Base64/-/Base64-0.2.1.tgz", + "integrity": "sha1-ujpCMHCOGGcFBl5mur3Uw1z2ACg=", + "dev": true + }, + "base64-js": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-0.0.8.tgz", + "integrity": "sha1-EQHpVE9KdrG8OybUUsqW16NeeXg=", + "dev": true + }, + "batch": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/batch/-/batch-0.6.1.tgz", + "integrity": "sha1-3DQxT05nkxgJP8dgJyUl+UvyXBY=", + "dev": true + }, + "bcrypt-pbkdf": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz", + "integrity": "sha1-Y7xdy2EzG5K8Bf1SiVPDNGKgb40=", + "dev": true, + "optional": true, + "requires": { + "tweetnacl": "0.14.5" + } + }, + "beeper": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/beeper/-/beeper-1.1.1.tgz", + "integrity": "sha1-5tXqjF2tABMEpwsiY4RH9pyy+Ak=", + "dev": true + }, + "binary-extensions": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.9.0.tgz", + "integrity": "sha1-ZlBsFs5vTWkopbPNajPKQelB43s=", + "dev": true + }, + "bl": { + "version": "0.9.5", + "resolved": "https://registry.npmjs.org/bl/-/bl-0.9.5.tgz", + "integrity": "sha1-wGt5evCF6gC8Unr8jvzxHeIjIFQ=", + "dev": true, + "requires": { + "readable-stream": "1.0.34" + }, + "dependencies": { + "readable-stream": { + "version": "1.0.34", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", + "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", + "dev": true, + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "0.0.1", + "string_decoder": "0.10.31" + } + } + } + }, + "bn.js": { + "version": "4.11.7", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.7.tgz", + "integrity": "sha512-LxFiV5mefv0ley0SzqkOPR1bC4EbpPx8LkOz5vMe/Yi15t5hzwgO/G+tc7wOtL4PZTYjwHu8JnEiSLumuSjSfA==", + "dev": true + }, + "body-parser": { + "version": "1.8.4", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.8.4.tgz", + "integrity": "sha1-1JfgS8E7P5qL2McLsM3Bby4CiJg=", + "dev": true, + "requires": { + "bytes": "1.0.0", + "depd": "0.4.5", + "iconv-lite": "0.4.4", + "media-typer": "0.3.0", + "on-finished": "2.1.0", + "qs": "2.2.4", + "raw-body": "1.3.0", + "type-is": "1.5.7" + }, + "dependencies": { + "depd": { + "version": "0.4.5", + "resolved": "https://registry.npmjs.org/depd/-/depd-0.4.5.tgz", + "integrity": "sha1-GmZLUziLSmVz6K5ntfdnxpPKl/E=", + "dev": true + }, + "ee-first": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.0.5.tgz", + "integrity": "sha1-jJshKJjYzZ8alDZlDOe+ICyen/A=", + "dev": true + }, + "iconv-lite": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.4.tgz", + "integrity": "sha1-6V8uQdsHNfwhZS94J6XuMuY8g6g=", + "dev": true + }, + "on-finished": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.1.0.tgz", + "integrity": "sha1-DFOfCSkej/rd4MiiWFD7LO3HAi0=", + "dev": true, + "requires": { + "ee-first": "1.0.5" + } + }, + "qs": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/qs/-/qs-2.2.4.tgz", + "integrity": "sha1-Lp+800tUDjQhySTs0B6QqpdTGcg=", + "dev": true + } + } + }, + "boolbase": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", + "integrity": "sha1-aN/1++YMUes3cl6p4+0xDcwed24=", + "dev": true + }, + "boom": { + "version": "2.10.1", + "resolved": "https://registry.npmjs.org/boom/-/boom-2.10.1.tgz", + "integrity": "sha1-OciRjO/1eZ+D+UkqhI9iWt0Mdm8=", + "dev": true, + "requires": { + "hoek": "2.16.3" + } + }, + "brace-expansion": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.8.tgz", + "integrity": "sha1-wHshHHyVLsH479Uad+8NHTmQopI=", + "dev": true, + "requires": { + "balanced-match": "1.0.0", + "concat-map": "0.0.1" + } + }, + "braces": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz", + "integrity": "sha1-uneWLhLf+WnWt2cR6RS3N4V79qc=", + "dev": true, + "requires": { + "expand-range": "1.8.2", + "preserve": "0.2.0", + "repeat-element": "1.1.2" + } + }, + "brorand": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", + "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=", + "dev": true + }, + "browser-pack": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/browser-pack/-/browser-pack-4.0.4.tgz", + "integrity": "sha1-ja6VogykOz/qIB+qbPqoT/Sg1IQ=", + "dev": true, + "requires": { + "combine-source-map": "0.3.0", + "concat-stream": "1.4.10", + "defined": "1.0.0", + "JSONStream": "1.3.1", + "through2": "0.5.1", + "umd": "3.0.1" + }, + "dependencies": { + "JSONStream": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.1.tgz", + "integrity": "sha1-cH92HgHa6eFvG8+TcDt4xwlmV5o=", + "dev": true, + "requires": { + "jsonparse": "1.3.1", + "through": "2.3.8" + } + }, + "readable-stream": { + "version": "1.0.34", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", + "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", + "dev": true, + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "0.0.1", + "string_decoder": "0.10.31" + } + }, + "through2": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/through2/-/through2-0.5.1.tgz", + "integrity": "sha1-390BLrnHAOIyP9M084rGIqs3Lac=", + "dev": true, + "requires": { + "readable-stream": "1.0.34", + "xtend": "3.0.0" + } + } + } + }, + "browser-resolve": { + "version": "1.11.2", + "resolved": "https://registry.npmjs.org/browser-resolve/-/browser-resolve-1.11.2.tgz", + "integrity": "sha1-j/CbCixCFxihBRwmCzLkj0QpOM4=", + "dev": true, + "requires": { + "resolve": "1.1.7" + }, + "dependencies": { + "resolve": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz", + "integrity": "sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs=", + "dev": true + } + } + }, + "browserify": { + "version": "9.0.8", + "resolved": "https://registry.npmjs.org/browserify/-/browserify-9.0.8.tgz", + "integrity": "sha1-kYWen2A4RFnq1VTfic/wPHNPFZs=", + "dev": true, + "requires": { + "assert": "1.3.0", + "browser-pack": "4.0.4", + "browser-resolve": "1.11.2", + "browserify-zlib": "0.1.4", + "buffer": "3.6.0", + "builtins": "0.0.7", + "commondir": "0.0.1", + "concat-stream": "1.4.10", + "console-browserify": "1.1.0", + "constants-browserify": "0.0.1", + "crypto-browserify": "3.11.1", + "deep-equal": "1.0.1", + "defined": "0.0.0", + "deps-sort": "1.3.9", + "domain-browser": "1.1.7", + "duplexer2": "0.0.2", + "events": "1.0.2", + "glob": "4.5.3", + "has": "1.0.1", + "http-browserify": "1.7.0", + "https-browserify": "0.0.1", + "inherits": "2.0.3", + "insert-module-globals": "6.6.3", + "isarray": "0.0.1", + "JSONStream": "0.10.0", + "labeled-stream-splicer": "1.0.2", + "module-deps": "3.9.1", + "os-browserify": "0.1.2", + "parents": "1.0.1", + "path-browserify": "0.0.0", + "process": "0.10.1", + "punycode": "1.2.4", + "querystring-es3": "0.2.1", + "read-only-stream": "1.1.1", + "readable-stream": "1.1.14", + "resolve": "1.4.0", + "shallow-copy": "0.0.1", + "shasum": "1.0.2", + "shell-quote": "0.0.1", + "stream-browserify": "1.0.0", + "string_decoder": "0.10.31", + "subarg": "1.0.0", + "syntax-error": "1.3.0", + "through2": "1.1.1", + "timers-browserify": "1.4.2", + "tty-browserify": "0.0.0", + "url": "0.10.3", + "util": "0.10.3", + "vm-browserify": "0.0.4", + "xtend": "3.0.0" + }, + "dependencies": { + "defined": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/defined/-/defined-0.0.0.tgz", + "integrity": "sha1-817qfXBekzuvE7LwOz+D2SFAOz4=", + "dev": true + }, + "glob": { + "version": "4.5.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-4.5.3.tgz", + "integrity": "sha1-xstz0yJsHv7wTePFbQEvAzd+4V8=", + "dev": true, + "requires": { + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "2.0.10", + "once": "1.4.0" + } + } + } + }, + "browserify-aes": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.0.6.tgz", + "integrity": "sha1-Xncl297x/Vkw1OurSFZ85FHEigo=", + "dev": true, + "requires": { + "buffer-xor": "1.0.3", + "cipher-base": "1.0.4", + "create-hash": "1.1.3", + "evp_bytestokey": "1.0.0", + "inherits": "2.0.3" + } + }, + "browserify-cipher": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.0.0.tgz", + "integrity": "sha1-mYgkSHS/XtTijalWZtzWasj8Njo=", + "dev": true, + "requires": { + "browserify-aes": "1.0.6", + "browserify-des": "1.0.0", + "evp_bytestokey": "1.0.0" + } + }, + "browserify-des": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/browserify-des/-/browserify-des-1.0.0.tgz", + "integrity": "sha1-2qJ3cXRwki7S/hhZQRihdUOXId0=", + "dev": true, + "requires": { + "cipher-base": "1.0.4", + "des.js": "1.0.0", + "inherits": "2.0.3" + } + }, + "browserify-rsa": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.0.1.tgz", + "integrity": "sha1-IeCr+vbyApzy+vsTNWenAdQTVSQ=", + "dev": true, + "requires": { + "bn.js": "4.11.7", + "randombytes": "2.0.5" + } + }, + "browserify-sign": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.0.4.tgz", + "integrity": "sha1-qk62jl17ZYuqa/alfmMMvXqT0pg=", + "dev": true, + "requires": { + "bn.js": "4.11.7", + "browserify-rsa": "4.0.1", + "create-hash": "1.1.3", + "create-hmac": "1.1.6", + "elliptic": "6.4.0", + "inherits": "2.0.3", + "parse-asn1": "5.1.0" + } + }, + "browserify-zlib": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.1.4.tgz", + "integrity": "sha1-uzX4pRn2AOD6a4SFJByXnQFB+y0=", + "dev": true, + "requires": { + "pako": "0.2.9" + } + }, + "bser": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/bser/-/bser-2.0.0.tgz", + "integrity": "sha1-mseNPtXZFYBP2HrLFYvHlxR6Fxk=", + "dev": true, + "requires": { + "node-int64": "0.4.0" + } + }, + "buffer": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-3.6.0.tgz", + "integrity": "sha1-pyyTb3e5a/UvX357RnGAYoVR3vs=", + "dev": true, + "requires": { + "base64-js": "0.0.8", + "ieee754": "1.1.8", + "isarray": "1.0.0" + }, + "dependencies": { + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + } + } + }, + "buffer-xor": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", + "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=", + "dev": true + }, + "builtin-modules": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", + "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=", + "dev": true + }, + "builtin-status-codes": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz", + "integrity": "sha1-hZgoeOIbmOHGZCXgPQF0eI9Wnug=", + "dev": true + }, + "builtins": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/builtins/-/builtins-0.0.7.tgz", + "integrity": "sha1-NVIZzWzxjb58Acx/0tznZc/cVJo=", + "dev": true + }, + "bytes": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-1.0.0.tgz", + "integrity": "sha1-NWnt6Lo0MV+rmcPpLLBMciDeH6g=", + "dev": true + }, + "cached-path-relative": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/cached-path-relative/-/cached-path-relative-1.0.1.tgz", + "integrity": "sha1-0JxLUoAKpMB44t2BqGmqyQ0uVOc=", + "dev": true + }, + "caller-path": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/caller-path/-/caller-path-0.1.0.tgz", + "integrity": "sha1-lAhe9jWB7NPaqSREqP6U6CV3dR8=", + "dev": true, + "requires": { + "callsites": "0.2.0" + } + }, + "callsites": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-0.2.0.tgz", + "integrity": "sha1-r6uWJikQp/M8GaV3WCXGnzTjUMo=", + "dev": true + }, + "camelcase": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz", + "integrity": "sha1-m7UwTS4LVmmLLHWLCKPqqdqlijk=", + "dev": true + }, + "camelcase-keys": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-2.1.0.tgz", + "integrity": "sha1-MIvur/3ygRkFHvodkyITyRuPkuc=", + "dev": true, + "requires": { + "camelcase": "2.1.1", + "map-obj": "1.0.1" + }, + "dependencies": { + "camelcase": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-2.1.1.tgz", + "integrity": "sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8=", + "dev": true + } + } + }, + "caseless": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.11.0.tgz", + "integrity": "sha1-cVuW6phBWTzDMGeSP17GDr2k99c=", + "dev": true + }, + "center-align": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/center-align/-/center-align-0.1.3.tgz", + "integrity": "sha1-qg0yYptu6XIgBBHL1EYckHvCt60=", + "dev": true, + "requires": { + "align-text": "0.1.4", + "lazy-cache": "1.0.4" + } + }, + "chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "dev": true, + "requires": { + "ansi-styles": "2.2.1", + "escape-string-regexp": "1.0.5", + "has-ansi": "2.0.0", + "strip-ansi": "3.0.1", + "supports-color": "2.0.0" + } + }, + "cheerio": { + "version": "0.22.0", + "resolved": "https://registry.npmjs.org/cheerio/-/cheerio-0.22.0.tgz", + "integrity": "sha1-qbqoYKP5tZWmuBsahocxIe06Jp4=", + "dev": true, + "requires": { + "css-select": "1.2.0", + "dom-serializer": "0.1.0", + "entities": "1.1.1", + "htmlparser2": "3.9.2", + "lodash.assignin": "4.2.0", + "lodash.bind": "4.2.1", + "lodash.defaults": "4.2.0", + "lodash.filter": "4.6.0", + "lodash.flatten": "4.4.0", + "lodash.foreach": "4.5.0", + "lodash.map": "4.6.0", + "lodash.merge": "4.6.0", + "lodash.pick": "4.4.0", + "lodash.reduce": "4.6.0", + "lodash.reject": "4.6.0", + "lodash.some": "4.6.0" + }, + "dependencies": { + "lodash.defaults": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/lodash.defaults/-/lodash.defaults-4.2.0.tgz", + "integrity": "sha1-0JF4cW/+pN3p5ft7N/bwgCJ0WAw=", + "dev": true + } + } + }, + "chokidar": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-1.7.0.tgz", + "integrity": "sha1-eY5ol3gVHIB2tLNg5e3SjNortGg=", + "dev": true, + "requires": { + "anymatch": "1.3.2", + "async-each": "1.0.1", + "fsevents": "1.1.2", + "glob-parent": "2.0.0", + "inherits": "2.0.3", + "is-binary-path": "1.0.1", + "is-glob": "2.0.1", + "path-is-absolute": "1.0.1", + "readdirp": "2.1.0" + } + }, + "ci-info": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-1.0.0.tgz", + "integrity": "sha1-3FKF8rTiUYIWg2gcOBwziPRuxTQ=", + "dev": true + }, + "cipher-base": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", + "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", + "dev": true, + "requires": { + "inherits": "2.0.3", + "safe-buffer": "5.1.1" + } + }, + "circular-json": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/circular-json/-/circular-json-0.3.3.tgz", + "integrity": "sha512-UZK3NBx2Mca+b5LsG7bY183pHWt5Y1xts4P3Pz7ENTwGVnJOUWbRb3ocjvX7hx9tq/yTAdclXm9sZ38gNuem4A==", + "dev": true + }, + "cli-cursor": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", + "integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=", + "dev": true, + "requires": { + "restore-cursor": "2.0.0" + } + }, + "cli-spinners": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-0.1.2.tgz", + "integrity": "sha1-u3ZNiOGF+54eaiofGXcjGPYF4xw=", + "dev": true + }, + "cli-truncate": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-0.2.1.tgz", + "integrity": "sha1-nxXPuwcFAFNpIWxiasfQWrkN1XQ=", + "dev": true, + "requires": { + "slice-ansi": "0.0.4", + "string-width": "1.0.2" + }, + "dependencies": { + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "dev": true, + "requires": { + "number-is-nan": "1.0.1" + } + }, + "string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "dev": true, + "requires": { + "code-point-at": "1.1.0", + "is-fullwidth-code-point": "1.0.0", + "strip-ansi": "3.0.1" + } + } + } + }, + "cli-width": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.1.0.tgz", + "integrity": "sha1-sjTKIJsp72b8UY2bmNWEewDt8Ao=", + "dev": true + }, + "cliui": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-2.1.0.tgz", + "integrity": "sha1-S0dXYP+AJkx2LDoXGQMukcf+oNE=", + "dev": true, + "requires": { + "center-align": "0.1.3", + "right-align": "0.1.3", + "wordwrap": "0.0.2" + } + }, + "clone": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.2.tgz", + "integrity": "sha1-Jgt6meux7f4kdTgXX3gyQ8sZ0Uk=", + "dev": true + }, + "clone-buffer": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/clone-buffer/-/clone-buffer-1.0.0.tgz", + "integrity": "sha1-4+JbIHrE5wGvch4staFnksrD3Fg=", + "dev": true + }, + "clone-stats": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/clone-stats/-/clone-stats-0.0.1.tgz", + "integrity": "sha1-uI+UqCzzi4eR1YBG6kAprYjKmdE=", + "dev": true + }, + "cloneable-readable": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/cloneable-readable/-/cloneable-readable-1.0.0.tgz", + "integrity": "sha1-pikNQT8hemEjL5XkWP84QYz7ARc=", + "dev": true, + "requires": { + "inherits": "2.0.3", + "process-nextick-args": "1.0.7", + "through2": "2.0.3" + }, + "dependencies": { + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "readable-stream": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.3.tgz", + "integrity": "sha512-m+qzzcn7KUxEmd1gMbchF+Y2eIUbieUaxkWtptyHywrX0rE8QEYqPC07Vuy4Wm32/xE16NcdBctb8S0Xe/5IeQ==", + "dev": true, + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "1.0.0", + "process-nextick-args": "1.0.7", + "safe-buffer": "5.1.1", + "string_decoder": "1.0.3", + "util-deprecate": "1.0.2" + } + }, + "string_decoder": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", + "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", + "dev": true, + "requires": { + "safe-buffer": "5.1.1" + } + }, + "through2": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.3.tgz", + "integrity": "sha1-AARWmzfHx0ujnEPzzteNGtlBQL4=", + "dev": true, + "requires": { + "readable-stream": "2.3.3", + "xtend": "4.0.1" + } + }, + "xtend": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", + "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=", + "dev": true + } + } + }, + "co": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", + "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=", + "dev": true + }, + "code-point-at": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", + "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", + "dev": true + }, + "color-convert": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.0.tgz", + "integrity": "sha1-Gsz5fdc5uYO/mU1W/sj5WFNkG3o=", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "combine-source-map": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/combine-source-map/-/combine-source-map-0.3.0.tgz", + "integrity": "sha1-2edPWT2c1DgHMSy12EbUUe+qnrc=", + "dev": true, + "requires": { + "convert-source-map": "0.3.5", + "inline-source-map": "0.3.1", + "source-map": "0.1.43" + }, + "dependencies": { + "convert-source-map": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-0.3.5.tgz", + "integrity": "sha1-8dgClQr33SYxof6+BZZVDIarMZA=", + "dev": true + }, + "source-map": { + "version": "0.1.43", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.1.43.tgz", + "integrity": "sha1-wkvBRspRfBRx9drL4lcbK3+eM0Y=", + "dev": true, + "requires": { + "amdefine": "1.0.1" + } + } + } + }, + "combined-stream": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.5.tgz", + "integrity": "sha1-k4NwpXtKUd6ix3wV1cX9+JUWQAk=", + "dev": true, + "requires": { + "delayed-stream": "1.0.0" + } + }, + "commander": { + "version": "2.11.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.11.0.tgz", + "integrity": "sha512-b0553uYA5YAEGgyYIGYROzKQ7X5RAqedkfjiZxwi0kL1g3bOaBNNZfYkzt/CL0umgD5wc9Jec2FbB98CjkMRvQ==", + "dev": true + }, + "commondir": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/commondir/-/commondir-0.0.1.tgz", + "integrity": "sha1-ifAP3NUbUZxXhzP+xWPmptp/W+I=", + "dev": true + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "concat-stream": { + "version": "1.4.10", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.4.10.tgz", + "integrity": "sha1-rMO79WAsuMyYDGrIQPp9hgPj7zY=", + "dev": true, + "requires": { + "inherits": "2.0.3", + "readable-stream": "1.1.14", + "typedarray": "0.0.6" + } + }, + "concat-with-sourcemaps": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/concat-with-sourcemaps/-/concat-with-sourcemaps-1.0.4.tgz", + "integrity": "sha1-9Vs74q60dgGxCi1SWcz7cP0vHdY=", + "dev": true, + "requires": { + "source-map": "0.5.6" + } + }, + "connect": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/connect/-/connect-3.6.2.tgz", + "integrity": "sha1-aU6NIGgb/kkCgsiriGvpjwn0L+c=", + "dev": true, + "requires": { + "debug": "2.6.7", + "finalhandler": "1.0.3", + "parseurl": "1.3.1", + "utils-merge": "1.0.0" + }, + "dependencies": { + "debug": { + "version": "2.6.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.7.tgz", + "integrity": "sha1-krrR9tBbu2u6Isyoi80OyJTChh4=", + "dev": true, + "requires": { + "ms": "2.0.0" + } + } + } + }, + "connect-livereload": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/connect-livereload/-/connect-livereload-0.4.1.tgz", + "integrity": "sha1-D4oagWvJuv+uRjfM6pF0Yv41kXo=", + "dev": true + }, + "console-browserify": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.1.0.tgz", + "integrity": "sha1-8CQcRXMKn8YyOyBtvzjtx0HQuxA=", + "dev": true, + "requires": { + "date-now": "0.1.4" + } + }, + "constants-browserify": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/constants-browserify/-/constants-browserify-0.0.1.tgz", + "integrity": "sha1-kld9tSe6bEzwpFaNhLwDH0QeIfI=", + "dev": true + }, + "contains-path": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/contains-path/-/contains-path-0.1.0.tgz", + "integrity": "sha1-/ozxhP9mcLa67wGp1IYaXL7EEgo=", + "dev": true + }, + "content-type-parser": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/content-type-parser/-/content-type-parser-1.0.1.tgz", + "integrity": "sha1-w+VpiMU8ZRJ/tG1AMqOpACRv3JQ=", + "dev": true + }, + "convert-source-map": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.5.0.tgz", + "integrity": "sha1-ms1whRxtXf3ZPZKC5e35SgP/RrU=", + "dev": true + }, + "core-js": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-1.2.7.tgz", + "integrity": "sha1-ZSKUwUZR2yj6k70tX/KYOk8IxjY=", + "dev": true + }, + "core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "dev": true + }, + "cosmiconfig": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-1.1.0.tgz", + "integrity": "sha1-DeoPmATv37kp+7GxiOJVU+oFPTc=", + "dev": true, + "requires": { + "graceful-fs": "4.1.11", + "js-yaml": "3.6.1", + "minimist": "1.2.0", + "object-assign": "4.0.1", + "os-homedir": "1.0.2", + "parse-json": "2.2.0", + "pinkie-promise": "2.0.1", + "require-from-string": "1.2.1" + } + }, + "coveralls": { + "version": "2.13.1", + "resolved": "https://registry.npmjs.org/coveralls/-/coveralls-2.13.1.tgz", + "integrity": "sha1-1wu5rMGDXsTwY/+drFQjwXsR8Xg=", + "dev": true, + "requires": { + "js-yaml": "3.6.1", + "lcov-parse": "0.0.10", + "log-driver": "1.2.5", + "minimist": "1.2.0", + "request": "2.79.0" + } + }, + "create-ecdh": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.0.tgz", + "integrity": "sha1-iIxyNZbN92EvZJgjPuvXo1MBc30=", + "dev": true, + "requires": { + "bn.js": "4.11.7", + "elliptic": "6.4.0" + } + }, + "create-hash": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.1.3.tgz", + "integrity": "sha1-YGBCrIuSYnUPSDyt2rD1gZFy2P0=", + "dev": true, + "requires": { + "cipher-base": "1.0.4", + "inherits": "2.0.3", + "ripemd160": "2.0.1", + "sha.js": "2.4.8" + } + }, + "create-hmac": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.6.tgz", + "integrity": "sha1-rLniIaThe9sHbpBlfEK5PjcmzwY=", + "dev": true, + "requires": { + "cipher-base": "1.0.4", + "create-hash": "1.1.3", + "inherits": "2.0.3", + "ripemd160": "2.0.1", + "safe-buffer": "5.1.1", + "sha.js": "2.4.8" + } + }, + "create-react-class": { + "version": "15.6.0", + "resolved": "https://registry.npmjs.org/create-react-class/-/create-react-class-15.6.0.tgz", + "integrity": "sha1-q0SEl8JlZuHilBPogyB9V8/nvtQ=", + "dev": true, + "requires": { + "fbjs": "0.8.14", + "loose-envify": "1.3.1", + "object-assign": "4.1.1" + }, + "dependencies": { + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true + } + } + }, + "cross-spawn": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", + "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", + "dev": true, + "requires": { + "lru-cache": "4.1.1", + "shebang-command": "1.2.0", + "which": "1.3.0" + }, + "dependencies": { + "lru-cache": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.1.tgz", + "integrity": "sha512-q4spe4KTfsAS1SUHLO0wz8Qiyf1+vMIAgpRYioFYDMNqKfHQbg+AVDH3i4fvpl71/P1L0dBl+fQi+P37UYf0ew==", + "dev": true, + "requires": { + "pseudomap": "1.0.2", + "yallist": "2.1.2" + } + } + } + }, + "cryptiles": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-2.0.5.tgz", + "integrity": "sha1-O9/s3GCBR8HGcgL6KR59ylnqo7g=", + "dev": true, + "requires": { + "boom": "2.10.1" + } + }, + "crypto-browserify": { + "version": "3.11.1", + "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.11.1.tgz", + "integrity": "sha512-Na7ZlwCOqoaW5RwUK1WpXws2kv8mNhWdTlzob0UXulk6G9BDbyiJaGTYBIX61Ozn9l1EPPJpICZb4DaOpT9NlQ==", + "dev": true, + "requires": { + "browserify-cipher": "1.0.0", + "browserify-sign": "4.0.4", + "create-ecdh": "4.0.0", + "create-hash": "1.1.3", + "create-hmac": "1.1.6", + "diffie-hellman": "5.0.2", + "inherits": "2.0.3", + "pbkdf2": "3.0.13", + "public-encrypt": "4.0.0", + "randombytes": "2.0.5" + } + }, + "css": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/css/-/css-2.2.1.tgz", + "integrity": "sha1-c6TIHehdtmTU7mdPfUcIXjstVdw=", + "dev": true, + "requires": { + "inherits": "2.0.3", + "source-map": "0.1.43", + "source-map-resolve": "0.3.1", + "urix": "0.1.0" + }, + "dependencies": { + "source-map": { + "version": "0.1.43", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.1.43.tgz", + "integrity": "sha1-wkvBRspRfBRx9drL4lcbK3+eM0Y=", + "dev": true, + "requires": { + "amdefine": "1.0.1" + } + } + } + }, + "css-select": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/css-select/-/css-select-1.2.0.tgz", + "integrity": "sha1-KzoRBTnFNV8c2NMUYj6HCxIeyFg=", + "dev": true, + "requires": { + "boolbase": "1.0.0", + "css-what": "2.1.0", + "domutils": "1.5.1", + "nth-check": "1.0.1" + } + }, + "css-what": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/css-what/-/css-what-2.1.0.tgz", + "integrity": "sha1-lGfQMsOM+u+58teVASUwYvh/ob0=", + "dev": true + }, + "cssom": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.3.2.tgz", + "integrity": "sha1-uANhcMefB6kP8vFuIihAJ6JDhIs=", + "dev": true + }, + "cssstyle": { + "version": "0.2.37", + "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-0.2.37.tgz", + "integrity": "sha1-VBCXI0yyUTyDzu06zdwn/yeYfVQ=", + "dev": true, + "requires": { + "cssom": "0.3.2" + } + }, + "currently-unhandled": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/currently-unhandled/-/currently-unhandled-0.4.1.tgz", + "integrity": "sha1-mI3zP+qxke95mmE2nddsF635V+o=", + "dev": true, + "requires": { + "array-find-index": "1.0.2" + } + }, + "dashdash": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", + "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", + "dev": true, + "requires": { + "assert-plus": "1.0.0" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "dev": true + } + } + }, + "date-fns": { + "version": "1.28.5", + "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-1.28.5.tgz", + "integrity": "sha1-JXz8RdMi30XvVlhmWWfuhBzXP68=", + "dev": true + }, + "date-now": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/date-now/-/date-now-0.1.4.tgz", + "integrity": "sha1-6vQ5/U1ISK105cx9vvIAZyueNFs=", + "dev": true + }, + "dateformat": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-2.0.0.tgz", + "integrity": "sha1-J0Pjq7XD/CRi5SfcpEXgTp9N7hc=", + "dev": true + }, + "deap": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/deap/-/deap-1.0.0.tgz", + "integrity": "sha1-sUi/gkMKJ2mbdIOgPra2dYW/yIg=", + "dev": true + }, + "debug": { + "version": "2.6.8", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.8.tgz", + "integrity": "sha1-5zFTHKLt4n0YgiJCfaF4IdaP9Pw=", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "debug-fabulous": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/debug-fabulous/-/debug-fabulous-0.0.4.tgz", + "integrity": "sha1-+gccXYdIRoVCSAdCHKSxawsaB2M=", + "dev": true, + "requires": { + "debug": "2.6.8", + "lazy-debug-legacy": "0.0.1", + "object-assign": "4.1.0" + }, + "dependencies": { + "object-assign": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.0.tgz", + "integrity": "sha1-ejs9DpgGPUP0wD8uiubNUahog6A=", + "dev": true + } + } + }, + "decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", + "dev": true + }, + "deep-equal": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.0.1.tgz", + "integrity": "sha1-9dJgKStmDghO/0zbyfCK0yR0SLU=", + "dev": true + }, + "deep-is": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", + "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", + "dev": true + }, + "default-require-extensions": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/default-require-extensions/-/default-require-extensions-1.0.0.tgz", + "integrity": "sha1-836hXT4T/9m0N9M+GnW1+5eHTLg=", + "dev": true, + "requires": { + "strip-bom": "2.0.0" + }, + "dependencies": { + "strip-bom": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", + "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", + "dev": true, + "requires": { + "is-utf8": "0.2.1" + } + } + } + }, + "defaults": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.3.tgz", + "integrity": "sha1-xlYFHpgX2f8I7YgUd/P+QBnz730=", + "dev": true, + "requires": { + "clone": "1.0.2" + } + }, + "define-properties": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.2.tgz", + "integrity": "sha1-g6c/L+pWmJj7c3GTyPhzyvbUXJQ=", + "dev": true, + "requires": { + "foreach": "2.0.5", + "object-keys": "1.0.11" + } + }, + "defined": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/defined/-/defined-1.0.0.tgz", + "integrity": "sha1-yY2bzvdWdBiOEQlpFRGZ45sfppM=", + "dev": true + }, + "del": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/del/-/del-2.0.2.tgz", + "integrity": "sha1-bNxo2wAoK5LY6CoO2f/x0zMZNCQ=", + "dev": true, + "requires": { + "globby": "3.0.1", + "is-path-cwd": "1.0.0", + "is-path-in-cwd": "1.0.0", + "object-assign": "4.0.1", + "pify": "2.3.0", + "pinkie-promise": "1.0.0", + "rimraf": "2.6.1" + }, + "dependencies": { + "pinkie": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-1.0.0.tgz", + "integrity": "sha1-Wkfyi6EBXQIBvae/DzWOR77Ix+Q=", + "dev": true + }, + "pinkie-promise": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-1.0.0.tgz", + "integrity": "sha1-0dpn9UglY7t89X8oauKCLs+/NnA=", + "dev": true, + "requires": { + "pinkie": "1.0.0" + } + } + } + }, + "delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", + "dev": true + }, + "depd": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.0.tgz", + "integrity": "sha1-4b2Cxqq2ztlluXuIsX7T5SjKGMM=", + "dev": true + }, + "deprecated": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/deprecated/-/deprecated-0.0.1.tgz", + "integrity": "sha1-+cmvVGSvoeepcUWKi97yqpTVuxk=", + "dev": true + }, + "deps-sort": { + "version": "1.3.9", + "resolved": "https://registry.npmjs.org/deps-sort/-/deps-sort-1.3.9.tgz", + "integrity": "sha1-Kd//U+F7Nq7K51MK27v2IsLtGnE=", + "dev": true, + "requires": { + "JSONStream": "1.3.1", + "shasum": "1.0.2", + "subarg": "1.0.0", + "through2": "1.1.1" + }, + "dependencies": { + "JSONStream": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.1.tgz", + "integrity": "sha1-cH92HgHa6eFvG8+TcDt4xwlmV5o=", + "dev": true, + "requires": { + "jsonparse": "1.3.1", + "through": "2.3.8" + } + } + } + }, + "des.js": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.0.tgz", + "integrity": "sha1-wHTS4qpqipoH29YfmhXCzYPsjsw=", + "dev": true, + "requires": { + "inherits": "2.0.3", + "minimalistic-assert": "1.0.0" + } + }, + "destroy": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", + "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=", + "dev": true + }, + "detect-file": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/detect-file/-/detect-file-0.1.0.tgz", + "integrity": "sha1-STXe39lIhkjgBrASlWbpOGcR6mM=", + "dev": true, + "requires": { + "fs-exists-sync": "0.1.0" + } + }, + "detect-indent": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-4.0.0.tgz", + "integrity": "sha1-920GQ1LN9Docts5hnE7jqUdd4gg=", + "dev": true, + "requires": { + "repeating": "2.0.1" + } + }, + "detect-newline": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-2.1.0.tgz", + "integrity": "sha1-9B8cEL5LAOh7XxPaaAdZ8sW/0+I=", + "dev": true + }, + "detective": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/detective/-/detective-4.5.0.tgz", + "integrity": "sha1-blqMaybmx6JUsca210kNmOyR7dE=", + "dev": true, + "requires": { + "acorn": "4.0.13", + "defined": "1.0.0" + } + }, + "diff": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-3.3.0.tgz", + "integrity": "sha512-w0XZubFWn0Adlsapj9EAWX0FqWdO4tz8kc3RiYdWLh4k/V8PTb6i0SMgXt0vRM3zyKnT8tKO7mUlieRQHIjMNg==", + "dev": true + }, + "diffie-hellman": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.2.tgz", + "integrity": "sha1-tYNXOScM/ias9jIJn97SoH8gnl4=", + "dev": true, + "requires": { + "bn.js": "4.11.7", + "miller-rabin": "4.0.0", + "randombytes": "2.0.5" + } + }, + "doctrine": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.0.0.tgz", + "integrity": "sha1-xz2NKQnSIpHhoAejlYBNqLZl/mM=", + "dev": true, + "requires": { + "esutils": "2.0.2", + "isarray": "1.0.0" + }, + "dependencies": { + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + } + } + }, + "dom-serializer": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.1.0.tgz", + "integrity": "sha1-BzxpdUbOB4DOI75KKOKT5AvDDII=", + "dev": true, + "requires": { + "domelementtype": "1.1.3", + "entities": "1.1.1" + }, + "dependencies": { + "domelementtype": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.1.3.tgz", + "integrity": "sha1-vSh3PiZCiBrsUVRJJCmcXNgiGFs=", + "dev": true + } + } + }, + "domain-browser": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.1.7.tgz", + "integrity": "sha1-hnqksJP6oF8d4IwG9NeyH9+GmLw=", + "dev": true + }, + "domelementtype": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.3.0.tgz", + "integrity": "sha1-sXrtguirWeUt2cGbF1bg/BhyBMI=", + "dev": true + }, + "domhandler": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-2.4.1.tgz", + "integrity": "sha1-iS5HAAqZvlW783dP/qBWHYh5wlk=", + "dev": true, + "requires": { + "domelementtype": "1.3.0" + } + }, + "domutils": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-1.5.1.tgz", + "integrity": "sha1-3NhIiib1Y9YQeeSMn3t+Mjc2gs8=", + "dev": true, + "requires": { + "dom-serializer": "0.1.0", + "domelementtype": "1.3.0" + } + }, + "duplexer": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.1.tgz", + "integrity": "sha1-rOb/gIwc5mtX0ev5eXessCM0z8E=", + "dev": true + }, + "duplexer2": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.0.2.tgz", + "integrity": "sha1-xhTc9n4vsUmVqRcR5aYX6KYKMds=", + "dev": true, + "requires": { + "readable-stream": "1.1.14" + } + }, + "ecc-jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz", + "integrity": "sha1-D8c6ntXw1Tw4GTOYUj735UN3dQU=", + "dev": true, + "optional": true, + "requires": { + "jsbn": "0.1.1" + } + }, + "ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=", + "dev": true + }, + "elegant-spinner": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/elegant-spinner/-/elegant-spinner-1.0.1.tgz", + "integrity": "sha1-2wQ1IcldfjA/2PNFvtwzSc+wcp4=", + "dev": true + }, + "elliptic": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.4.0.tgz", + "integrity": "sha1-ysmvh2LIWDYYcAPI3+GT5eLq5d8=", + "dev": true, + "requires": { + "bn.js": "4.11.7", + "brorand": "1.1.0", + "hash.js": "1.1.3", + "hmac-drbg": "1.0.1", + "inherits": "2.0.3", + "minimalistic-assert": "1.0.0", + "minimalistic-crypto-utils": "1.0.1" + } + }, + "encodeurl": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.1.tgz", + "integrity": "sha1-eePVhlU0aQn+bw9Fpd5oEDspTSA=", + "dev": true + }, + "encoding": { + "version": "0.1.12", + "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.12.tgz", + "integrity": "sha1-U4tm8+5izRq1HsMjgp0flIDHS+s=", + "dev": true, + "requires": { + "iconv-lite": "0.4.18" + } + }, + "end-of-stream": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-0.1.5.tgz", + "integrity": "sha1-jhdyBsPICDfYVjLouTWd/osvbq8=", + "dev": true, + "requires": { + "once": "1.3.3" + }, + "dependencies": { + "once": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/once/-/once-1.3.3.tgz", + "integrity": "sha1-suJhVXzkwxTsgwTz+oJmPkKXyiA=", + "dev": true, + "requires": { + "wrappy": "1.0.2" + } + } + } + }, + "entities": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.1.tgz", + "integrity": "sha1-blwtClYhtdra7O+AuQ7ftc13cvA=", + "dev": true + }, + "envify": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/envify/-/envify-3.4.0.tgz", + "integrity": "sha1-oL7VIiJSkHagL6v2zgDu9C17ZzQ=", + "dev": true, + "requires": { + "jstransform": "10.1.0", + "through": "2.3.8" + } + }, + "enzyme": { + "version": "2.9.1", + "resolved": "https://registry.npmjs.org/enzyme/-/enzyme-2.9.1.tgz", + "integrity": "sha1-B9XOaRJBJA+4F78sSxjW5TAkDfY=", + "dev": true, + "requires": { + "cheerio": "0.22.0", + "function.prototype.name": "1.0.3", + "is-subset": "0.1.1", + "lodash": "4.17.4", + "object-is": "1.0.1", + "object.assign": "4.0.4", + "object.entries": "1.0.4", + "object.values": "1.0.4", + "prop-types": "15.5.10", + "uuid": "3.1.0" + } + }, + "enzyme-to-json": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/enzyme-to-json/-/enzyme-to-json-1.5.1.tgz", + "integrity": "sha1-409NEmuz9Gls44ALUfntg99wh5k=", + "dev": true, + "requires": { + "lodash.filter": "4.6.0", + "lodash.isnil": "4.0.0", + "lodash.isplainobject": "4.0.6", + "lodash.omitby": "4.6.0", + "lodash.range": "3.2.0", + "object-values": "1.0.0", + "object.entries": "1.0.4" + } + }, + "errno": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/errno/-/errno-0.1.4.tgz", + "integrity": "sha1-uJbiOp5ei6M4cfyZar02NfyaHH0=", + "dev": true, + "requires": { + "prr": "0.0.0" + } + }, + "error-ex": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.1.tgz", + "integrity": "sha1-+FWobOYa3E6GIcPNoh56dhLDqNw=", + "dev": true, + "requires": { + "is-arrayish": "0.2.1" + } + }, + "es-abstract": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.8.0.tgz", + "integrity": "sha512-Cf9/h5MrXtExM20gSS55YFrGKCyPrRBjIVBtVyy8vmlsDfe0NPKMWj65tPLgzyfPuapWxh5whpXCtW4+AW5mRg==", + "dev": true, + "requires": { + "es-to-primitive": "1.1.1", + "function-bind": "1.1.0", + "has": "1.0.1", + "is-callable": "1.1.3", + "is-regex": "1.0.4" + } + }, + "es-to-primitive": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.1.1.tgz", + "integrity": "sha1-RTVSSKiJeQNLZ5Lhm7gfK3l13Q0=", + "dev": true, + "requires": { + "is-callable": "1.1.3", + "is-date-object": "1.0.1", + "is-symbol": "1.0.1" + } + }, + "escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=", + "dev": true + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + }, + "escodegen": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.8.1.tgz", + "integrity": "sha1-WltTr0aTEQvrsIZ6o0MN07cKEBg=", + "dev": true, + "requires": { + "esprima": "2.7.3", + "estraverse": "1.9.3", + "esutils": "2.0.2", + "optionator": "0.8.2", + "source-map": "0.2.0" + }, + "dependencies": { + "esprima": { + "version": "2.7.3", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-2.7.3.tgz", + "integrity": "sha1-luO3DVd59q1JzQMmc9HDEnZ7pYE=", + "dev": true + }, + "estraverse": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-1.9.3.tgz", + "integrity": "sha1-r2fy3JIlgkFZUJJgkaQAXSnJu0Q=", + "dev": true + }, + "source-map": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.2.0.tgz", + "integrity": "sha1-2rc/vPwrqBm03gO9b26qSBZLP50=", + "dev": true, + "optional": true, + "requires": { + "amdefine": "1.0.1" + } + } + } + }, + "eslint": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-4.3.0.tgz", + "integrity": "sha1-/NfJY3a780yF7mftABKimWQrEI8=", + "dev": true, + "requires": { + "ajv": "5.2.2", + "babel-code-frame": "6.22.0", + "chalk": "1.1.3", + "concat-stream": "1.6.0", + "cross-spawn": "5.1.0", + "debug": "2.6.8", + "doctrine": "2.0.0", + "eslint-scope": "3.7.1", + "espree": "3.5.0", + "esquery": "1.0.0", + "estraverse": "4.2.0", + "esutils": "2.0.2", + "file-entry-cache": "2.0.0", + "functional-red-black-tree": "1.0.1", + "glob": "7.1.2", + "globals": "9.18.0", + "ignore": "3.3.3", + "imurmurhash": "0.1.4", + "inquirer": "3.2.1", + "is-resolvable": "1.0.0", + "js-yaml": "3.9.1", + "json-stable-stringify": "1.0.1", + "levn": "0.3.0", + "lodash": "4.17.4", + "minimatch": "3.0.4", + "mkdirp": "0.5.1", + "natural-compare": "1.4.0", + "optionator": "0.8.2", + "path-is-inside": "1.0.2", + "pluralize": "4.0.0", + "progress": "2.0.0", + "require-uncached": "1.0.3", + "semver": "5.4.1", + "strip-json-comments": "2.0.1", + "table": "4.0.1", + "text-table": "0.2.0" + }, + "dependencies": { + "concat-stream": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.0.tgz", + "integrity": "sha1-CqxmL9Ur54lk1VMvaUeE5wEQrPc=", + "dev": true, + "requires": { + "inherits": "2.0.3", + "readable-stream": "2.3.3", + "typedarray": "0.0.6" + } + }, + "glob": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", + "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "dev": true, + "requires": { + "fs.realpath": "1.0.0", + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" + } + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "js-yaml": { + "version": "3.9.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.9.1.tgz", + "integrity": "sha512-CbcG379L1e+mWBnLvHWWeLs8GyV/EMw862uLI3c+GxVyDHWZcjZinwuBd3iW2pgxgIlksW/1vNJa4to+RvDOww==", + "dev": true, + "requires": { + "argparse": "1.0.9", + "esprima": "4.0.0" + } + }, + "json-stable-stringify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz", + "integrity": "sha1-mnWdOcXy/1A/1TAGRu1EX4jE+a8=", + "dev": true, + "requires": { + "jsonify": "0.0.0" + } + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "1.1.8" + } + }, + "readable-stream": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.3.tgz", + "integrity": "sha512-m+qzzcn7KUxEmd1gMbchF+Y2eIUbieUaxkWtptyHywrX0rE8QEYqPC07Vuy4Wm32/xE16NcdBctb8S0Xe/5IeQ==", + "dev": true, + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "1.0.0", + "process-nextick-args": "1.0.7", + "safe-buffer": "5.1.1", + "string_decoder": "1.0.3", + "util-deprecate": "1.0.2" + } + }, + "semver": { + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.4.1.tgz", + "integrity": "sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg==", + "dev": true + }, + "string_decoder": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", + "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", + "dev": true, + "requires": { + "safe-buffer": "5.1.1" + } + } + } + }, + "eslint-config-prettier": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-2.3.0.tgz", + "integrity": "sha1-t1seq+oMi5ezRANkfuJds0m52KA=", + "dev": true, + "requires": { + "get-stdin": "5.0.1" + }, + "dependencies": { + "get-stdin": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-5.0.1.tgz", + "integrity": "sha1-Ei4WFZHiH/TFJTAwVpPyDmOTo5g=", + "dev": true + } + } + }, + "eslint-config-seatgeek-react-standard": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/eslint-config-seatgeek-react-standard/-/eslint-config-seatgeek-react-standard-4.0.0.tgz", + "integrity": "sha512-LgIUB9mqhbqArnb1TSlNAgCTa7r7CmqTboRlH4l0y/cJiagwqXYyjPjxkSiaAtsw73mINhWfOK5H/4UrObqgvw==", + "dev": true, + "requires": { + "eslint": "4.3.0", + "eslint-plugin-prettier": "2.1.2", + "eslint-plugin-react": "7.1.0", + "prettier": "1.5.3" + } + }, + "eslint-config-seatgeek-standard": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/eslint-config-seatgeek-standard/-/eslint-config-seatgeek-standard-5.0.0.tgz", + "integrity": "sha512-buzxswK2IqQ3/3H6BE66UZrLDh329UAeUzOjPI1f5bGD94rhcW1OB0qYYbqL6XBQlF1BKwSqZ9M2cddmLPxMEA==", + "dev": true, + "requires": { + "eslint": "4.3.0", + "eslint-config-prettier": "2.3.0", + "eslint-config-standard": "10.2.1", + "eslint-plugin-import": "2.7.0", + "eslint-plugin-jest": "20.0.3", + "eslint-plugin-node": "5.1.1", + "eslint-plugin-prettier": "2.1.2", + "eslint-plugin-promise": "3.5.0", + "eslint-plugin-standard": "3.0.1" + }, + "dependencies": { + "eslint-config-standard": { + "version": "10.2.1", + "resolved": "https://registry.npmjs.org/eslint-config-standard/-/eslint-config-standard-10.2.1.tgz", + "integrity": "sha1-wGHk0GbzedwXzVYsZOgZtN1FRZE=", + "dev": true + }, + "eslint-plugin-standard": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-standard/-/eslint-plugin-standard-3.0.1.tgz", + "integrity": "sha1-NNDJFbRe3G8BA5PH7vOCOwhWXPI=", + "dev": true + } + } + }, + "eslint-import-resolver-node": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.1.tgz", + "integrity": "sha512-yUtXS15gIcij68NmXmP9Ni77AQuCN0itXbCc/jWd8C6/yKZaSNXicpC8cgvjnxVdmfsosIXrjpzFq7GcDryb6A==", + "dev": true, + "requires": { + "debug": "2.6.8", + "resolve": "1.4.0" + } + }, + "eslint-module-utils": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.1.1.tgz", + "integrity": "sha512-jDI/X5l/6D1rRD/3T43q8Qgbls2nq5km5KSqiwlyUbGo5+04fXhMKdCPhjwbqAa6HXWaMxj8Q4hQDIh7IadJQw==", + "dev": true, + "requires": { + "debug": "2.6.8", + "pkg-dir": "1.0.0" + } + }, + "eslint-plugin-flowtype": { + "version": "2.35.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-flowtype/-/eslint-plugin-flowtype-2.35.0.tgz", + "integrity": "sha512-zjXGjOsHds8b84C0Ad3VViKh+sUA9PeXKHwPRlSLwwSX0v1iUJf/6IX7wxc+w2T2tnDH8PT6B/YgtcEuNI3ssA==", + "dev": true, + "requires": { + "lodash": "4.17.4" + } + }, + "eslint-plugin-import": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.7.0.tgz", + "integrity": "sha512-HGYmpU9f/zJaQiKNQOVfHUh2oLWW3STBrCgH0sHTX1xtsxYlH1zjLh8FlQGEIdZSdTbUMaV36WaZ6ImXkenGxQ==", + "dev": true, + "requires": { + "builtin-modules": "1.1.1", + "contains-path": "0.1.0", + "debug": "2.6.8", + "doctrine": "1.5.0", + "eslint-import-resolver-node": "0.3.1", + "eslint-module-utils": "2.1.1", + "has": "1.0.1", + "lodash.cond": "4.5.2", + "minimatch": "3.0.4", + "read-pkg-up": "2.0.0" + }, + "dependencies": { + "doctrine": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-1.5.0.tgz", + "integrity": "sha1-N53Ocw9hZvds76TmcHoVmwLFpvo=", + "dev": true, + "requires": { + "esutils": "2.0.2", + "isarray": "1.0.0" + } + }, + "find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "dev": true, + "requires": { + "locate-path": "2.0.0" + } + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "load-json-file": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz", + "integrity": "sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg=", + "dev": true, + "requires": { + "graceful-fs": "4.1.11", + "parse-json": "2.2.0", + "pify": "2.3.0", + "strip-bom": "3.0.0" + } + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "1.1.8" + } + }, + "path-type": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-2.0.0.tgz", + "integrity": "sha1-8BLMuEFbcJb8LaoQVMPXI4lZTHM=", + "dev": true, + "requires": { + "pify": "2.3.0" + } + }, + "read-pkg": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-2.0.0.tgz", + "integrity": "sha1-jvHAYjxqbbDcZxPEv6xGMysjaPg=", + "dev": true, + "requires": { + "load-json-file": "2.0.0", + "normalize-package-data": "2.4.0", + "path-type": "2.0.0" + } + }, + "read-pkg-up": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-2.0.0.tgz", + "integrity": "sha1-a3KoBImE4MQeeVEP1en6mbO1Sb4=", + "dev": true, + "requires": { + "find-up": "2.1.0", + "read-pkg": "2.0.0" + } + }, + "strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", + "dev": true + } + } + }, + "eslint-plugin-jest": { + "version": "20.0.3", + "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-20.0.3.tgz", + "integrity": "sha1-7BXrpqwKtEpn6/bgJnLKnX58uik=", + "dev": true + }, + "eslint-plugin-node": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-node/-/eslint-plugin-node-5.1.1.tgz", + "integrity": "sha512-3xdoEbPyyQNyGhhqttjgSO3cU/non8QDBJF8ttGaHM2h8CaY5zFIngtqW6ZbLEIvhpoFPDVwiQg61b8zanx5zQ==", + "dev": true, + "requires": { + "ignore": "3.3.3", + "minimatch": "3.0.4", + "resolve": "1.4.0", + "semver": "5.3.0" + }, + "dependencies": { + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "1.1.8" + } + }, + "semver": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.3.0.tgz", + "integrity": "sha1-myzl094C0XxgEq0yaqa00M9U+U8=", + "dev": true + } + } + }, + "eslint-plugin-prettier": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-2.1.2.tgz", + "integrity": "sha1-S5D07n+Sv74ukmAX4cpA62KJZeo=", + "dev": true, + "requires": { + "fast-diff": "1.1.1", + "jest-docblock": "20.0.3" + } + }, + "eslint-plugin-promise": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-promise/-/eslint-plugin-promise-3.5.0.tgz", + "integrity": "sha1-ePu2/+BHIBYnVp6FpsU3OvKmj8o=", + "dev": true + }, + "eslint-plugin-react": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.1.0.tgz", + "integrity": "sha1-J3cKzzn1/UnNCvQIPOWBBOs5DUw=", + "dev": true, + "requires": { + "doctrine": "2.0.0", + "has": "1.0.1", + "jsx-ast-utils": "1.4.1" + } + }, + "eslint-plugin-standard": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-standard/-/eslint-plugin-standard-3.0.1.tgz", + "integrity": "sha1-NNDJFbRe3G8BA5PH7vOCOwhWXPI=" + }, + "eslint-scope": { + "version": "3.7.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-3.7.1.tgz", + "integrity": "sha1-PWPD7f2gLgbgGkUq2IyqzHzctug=", + "dev": true, + "requires": { + "esrecurse": "4.2.0", + "estraverse": "4.2.0" + } + }, + "espree": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-3.5.0.tgz", + "integrity": "sha1-mDWGJb3QVYYeon4oZ+pyn69GPY0=", + "dev": true, + "requires": { + "acorn": "5.1.1", + "acorn-jsx": "3.0.1" + }, + "dependencies": { + "acorn": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.1.1.tgz", + "integrity": "sha512-vOk6uEMctu0vQrvuSqFdJyqj1Q0S5VTDL79qtjo+DhRr+1mmaD+tluFSCZqhvi/JUhXSzoZN2BhtstaPEeE8cw==", + "dev": true + } + } + }, + "esprima": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.0.tgz", + "integrity": "sha512-oftTcaMu/EGrEIu904mWteKIv8vMuOgGYo7EhVJJN00R/EED9DCua/xxHRdYnKtcECzVg7xOWhflvJMnqcFZjw==", + "dev": true + }, + "esquery": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.0.0.tgz", + "integrity": "sha1-z7qLV9f7qT8XKYqKAGoEzaE9gPo=", + "dev": true, + "requires": { + "estraverse": "4.2.0" + } + }, + "esrecurse": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.0.tgz", + "integrity": "sha1-+pVo2Y04I/mkHZHpAtyrnqblsWM=", + "dev": true, + "requires": { + "estraverse": "4.2.0", + "object-assign": "4.0.1" + } + }, + "estraverse": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", + "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=", + "dev": true + }, + "esutils": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", + "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", + "dev": true + }, + "etag": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.0.tgz", + "integrity": "sha1-b2Ma7zNtbEY2K1F2QETOIWvjwFE=", + "dev": true + }, + "events": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/events/-/events-1.0.2.tgz", + "integrity": "sha1-dYSdz+k9EPsFfDAFWv29UdBqjiQ=", + "dev": true + }, + "evp_bytestokey": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.0.tgz", + "integrity": "sha1-SXtmrZ/vZc18CKYYCCS6FHa2blM=", + "dev": true, + "requires": { + "create-hash": "1.1.3" + } + }, + "exec-sh": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/exec-sh/-/exec-sh-0.2.0.tgz", + "integrity": "sha1-FPdd4/INKG75MwmbLOUKkDWc7xA=", + "dev": true, + "requires": { + "merge": "1.2.0" + } + }, + "execa": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-0.7.0.tgz", + "integrity": "sha1-lEvs00zEHuMqY6n68nrVpl/Fl3c=", + "dev": true, + "requires": { + "cross-spawn": "5.1.0", + "get-stream": "3.0.0", + "is-stream": "1.1.0", + "npm-run-path": "2.0.2", + "p-finally": "1.0.0", + "signal-exit": "3.0.2", + "strip-eof": "1.0.0" + } + }, + "exit-hook": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/exit-hook/-/exit-hook-1.1.1.tgz", + "integrity": "sha1-8FyiM7SMBdVP/wd2XfhQfpXAL/g=", + "dev": true + }, + "expand-brackets": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz", + "integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=", + "dev": true, + "requires": { + "is-posix-bracket": "0.1.1" + } + }, + "expand-range": { + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/expand-range/-/expand-range-1.8.2.tgz", + "integrity": "sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc=", + "dev": true, + "requires": { + "fill-range": "2.2.3" + } + }, + "expand-tilde": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/expand-tilde/-/expand-tilde-1.2.2.tgz", + "integrity": "sha1-C4HrqJflo9MdHD0QL48BRB5VlEk=", + "dev": true, + "requires": { + "os-homedir": "1.0.2" + } + }, + "extend": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.1.tgz", + "integrity": "sha1-p1Xqe8Gt/MWjHOfnYtuq3F5jZEQ=", + "dev": true + }, + "external-editor": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-2.0.4.tgz", + "integrity": "sha1-HtkZnanL/i7y96MbL96LDRI2iXI=", + "dev": true, + "requires": { + "iconv-lite": "0.4.18", + "jschardet": "1.5.0", + "tmp": "0.0.31" + } + }, + "extglob": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz", + "integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=", + "dev": true, + "requires": { + "is-extglob": "1.0.0" + } + }, + "extsprintf": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", + "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", + "dev": true + }, + "fancy-log": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/fancy-log/-/fancy-log-1.3.0.tgz", + "integrity": "sha1-Rb4X0Cu5kX1gzP/UmVyZnmyMmUg=", + "dev": true, + "requires": { + "chalk": "1.1.3", + "time-stamp": "1.1.0" + } + }, + "fast-deep-equal": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.0.0.tgz", + "integrity": "sha1-liVqO8l1WV6zbYLpkp0GDYk0Of8=", + "dev": true + }, + "fast-diff": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.1.1.tgz", + "integrity": "sha1-CuoOTmBbaiGJ8Ok21Lf7rxt8/Zs=", + "dev": true + }, + "fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", + "dev": true + }, + "faye-websocket": { + "version": "0.7.3", + "resolved": "https://registry.npmjs.org/faye-websocket/-/faye-websocket-0.7.3.tgz", + "integrity": "sha1-zEB0x/Sk39A69U3WXDVLE1EyzhE=", + "dev": true, + "requires": { + "websocket-driver": "0.6.5" + } + }, + "fb-watchman": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.0.tgz", + "integrity": "sha1-VOmr99+i8mzZsWNsWIwa/AXeXVg=", + "dev": true, + "requires": { + "bser": "2.0.0" + } + }, + "fbjs": { + "version": "0.8.14", + "resolved": "https://registry.npmjs.org/fbjs/-/fbjs-0.8.14.tgz", + "integrity": "sha1-0dviviVMNakeCfMfnNUKQLKg7Rw=", + "dev": true, + "requires": { + "core-js": "1.2.7", + "isomorphic-fetch": "2.2.1", + "loose-envify": "1.3.1", + "object-assign": "4.1.1", + "promise": "7.3.1", + "setimmediate": "1.0.5", + "ua-parser-js": "0.7.14" + }, + "dependencies": { + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true + } + } + }, + "figures": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", + "integrity": "sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=", + "dev": true, + "requires": { + "escape-string-regexp": "1.0.5" + } + }, + "file-entry-cache": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-2.0.0.tgz", + "integrity": "sha1-w5KZDD5oR4PYOLjISkXYoEhFg2E=", + "dev": true, + "requires": { + "flat-cache": "1.2.2", + "object-assign": "4.0.1" + } + }, + "filename-regex": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/filename-regex/-/filename-regex-2.0.1.tgz", + "integrity": "sha1-wcS5vuPglyXdsQa3XB4wH+LxiyY=", + "dev": true + }, + "fileset": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/fileset/-/fileset-2.0.3.tgz", + "integrity": "sha1-jnVIqW08wjJ+5eZ0FocjozO7oqA=", + "dev": true, + "requires": { + "glob": "7.1.2", + "minimatch": "3.0.4" + }, + "dependencies": { + "glob": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", + "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "dev": true, + "requires": { + "fs.realpath": "1.0.0", + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" + } + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "1.1.8" + } + } + } + }, + "fill-range": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-2.2.3.tgz", + "integrity": "sha1-ULd9/X5Gm8dJJHCWNpn+eoSFpyM=", + "dev": true, + "requires": { + "is-number": "2.1.0", + "isobject": "2.1.0", + "randomatic": "1.1.7", + "repeat-element": "1.1.2", + "repeat-string": "1.6.1" + } + }, + "finalhandler": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.0.3.tgz", + "integrity": "sha1-70fneVDpmXgOhgIqVg4yF+DQzIk=", + "dev": true, + "requires": { + "debug": "2.6.7", + "encodeurl": "1.0.1", + "escape-html": "1.0.3", + "on-finished": "2.3.0", + "parseurl": "1.3.1", + "statuses": "1.3.1", + "unpipe": "1.0.0" + }, + "dependencies": { + "debug": { + "version": "2.6.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.7.tgz", + "integrity": "sha1-krrR9tBbu2u6Isyoi80OyJTChh4=", + "dev": true, + "requires": { + "ms": "2.0.0" + } + } + } + }, + "find-index": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/find-index/-/find-index-0.1.1.tgz", + "integrity": "sha1-Z101iyyjiS15Whq0cjL4tuLg3eQ=", + "dev": true + }, + "find-up": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", + "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", + "dev": true, + "requires": { + "path-exists": "2.1.0", + "pinkie-promise": "2.0.1" + }, + "dependencies": { + "path-exists": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", + "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", + "dev": true, + "requires": { + "pinkie-promise": "2.0.1" + } + } + } + }, + "findup-sync": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-0.4.3.tgz", + "integrity": "sha1-QAQ5Kee8YK3wt/SCfExudaDeyhI=", + "dev": true, + "requires": { + "detect-file": "0.1.0", + "is-glob": "2.0.1", + "micromatch": "2.3.11", + "resolve-dir": "0.1.1" + } + }, + "fined": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fined/-/fined-1.1.0.tgz", + "integrity": "sha1-s33IRLdqL15wgeiE98CuNE8VNHY=", + "dev": true, + "requires": { + "expand-tilde": "2.0.2", + "is-plain-object": "2.0.4", + "object.defaults": "1.1.0", + "object.pick": "1.2.0", + "parse-filepath": "1.0.1" + }, + "dependencies": { + "expand-tilde": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/expand-tilde/-/expand-tilde-2.0.2.tgz", + "integrity": "sha1-l+gBqgUt8CRU3kawK/YhZCzchQI=", + "dev": true, + "requires": { + "homedir-polyfill": "1.0.1" + } + } + } + }, + "first-chunk-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/first-chunk-stream/-/first-chunk-stream-1.0.0.tgz", + "integrity": "sha1-Wb+1DNkF9g18OUzT2ayqtOatk04=", + "dev": true + }, + "flagged-respawn": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/flagged-respawn/-/flagged-respawn-0.3.2.tgz", + "integrity": "sha1-/xke3c1wiKZ1smEP/8l2vpuAdLU=", + "dev": true + }, + "flat-cache": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-1.2.2.tgz", + "integrity": "sha1-+oZxTnLCHbiGAXYezy9VXRq8a5Y=", + "dev": true, + "requires": { + "circular-json": "0.3.3", + "del": "2.0.2", + "graceful-fs": "4.1.11", + "write": "0.2.1" + } + }, + "flow-bin": { + "version": "0.52.0", + "resolved": "https://registry.npmjs.org/flow-bin/-/flow-bin-0.52.0.tgz", + "integrity": "sha1-ttmr6LzR7lxi3zhkUaTiVTytw6M=", + "dev": true + }, + "for-in": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", + "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", + "dev": true + }, + "for-own": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/for-own/-/for-own-0.1.5.tgz", + "integrity": "sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4=", + "dev": true, + "requires": { + "for-in": "1.0.2" + } + }, + "foreach": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/foreach/-/foreach-2.0.5.tgz", + "integrity": "sha1-C+4AUBiusmDQo6865ljdATbsG5k=", + "dev": true + }, + "forever-agent": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", + "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", + "dev": true + }, + "form-data": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.1.4.tgz", + "integrity": "sha1-M8GDrPGTJ27KqYFDpp6Uv+4XUNE=", + "dev": true, + "requires": { + "asynckit": "0.4.0", + "combined-stream": "1.0.5", + "mime-types": "2.1.16" + } + }, + "fresh": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.0.tgz", + "integrity": "sha1-9HTKXmqSRtb9jglTz6m5yAWvp44=", + "dev": true + }, + "fs-exists-sync": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/fs-exists-sync/-/fs-exists-sync-0.1.0.tgz", + "integrity": "sha1-mC1ok6+RjnLQjeyehnP/K1qNat0=", + "dev": true + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "fsevents": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.1.2.tgz", + "integrity": "sha512-Sn44E5wQW4bTHXvQmvSHwqbuiXtduD6Rrjm2ZtUEGbyrig+nUH3t/QD4M4/ZXViY556TBpRgZkHLDx3JxPwxiw==", + "dev": true, + "optional": true, + "requires": { + "nan": "2.6.2", + "node-pre-gyp": "0.6.36" + }, + "dependencies": { + "abbrev": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.0.tgz", + "integrity": "sha1-0FVMIlZjbi9W58LlrRg/hZQo2B8=", + "dev": true, + "optional": true + }, + "ajv": { + "version": "4.11.8", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-4.11.8.tgz", + "integrity": "sha1-gv+wKynmYq5TvcIK8VlHcGc5xTY=", + "dev": true, + "optional": true, + "requires": { + "co": "4.6.0", + "json-stable-stringify": "1.0.1" + } + }, + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + }, + "aproba": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.1.1.tgz", + "integrity": "sha1-ldNgDwdxCqDpKYxyatXs8urLq6s=", + "dev": true, + "optional": true + }, + "are-we-there-yet": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.4.tgz", + "integrity": "sha1-u13KOCu5TwXhUZQ3PRb9O6HKEQ0=", + "dev": true, + "optional": true, + "requires": { + "delegates": "1.0.0", + "readable-stream": "2.2.9" + } + }, + "asn1": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.3.tgz", + "integrity": "sha1-2sh4dxPJlmhJ/IGAd36+nB3fO4Y=", + "dev": true, + "optional": true + }, + "assert-plus": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.2.0.tgz", + "integrity": "sha1-104bh+ev/A24qttwIfP+SBAasjQ=", + "dev": true, + "optional": true + }, + "asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", + "dev": true, + "optional": true + }, + "aws-sign2": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.6.0.tgz", + "integrity": "sha1-FDQt0428yU0OW4fXY81jYSwOeU8=", + "dev": true, + "optional": true + }, + "aws4": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.6.0.tgz", + "integrity": "sha1-g+9cqGCysy5KDe7e6MdxudtXRx4=", + "dev": true, + "optional": true + }, + "balanced-match": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.4.2.tgz", + "integrity": "sha1-yz8+PHMtwPAe5wtAPzAuYddwmDg=", + "dev": true + }, + "bcrypt-pbkdf": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz", + "integrity": "sha1-Y7xdy2EzG5K8Bf1SiVPDNGKgb40=", + "dev": true, + "optional": true, + "requires": { + "tweetnacl": "0.14.5" + } + }, + "block-stream": { + "version": "0.0.9", + "resolved": "https://registry.npmjs.org/block-stream/-/block-stream-0.0.9.tgz", + "integrity": "sha1-E+v+d4oDIFz+A3UUgeu0szAMEmo=", + "dev": true, + "requires": { + "inherits": "2.0.3" + } + }, + "boom": { + "version": "2.10.1", + "resolved": "https://registry.npmjs.org/boom/-/boom-2.10.1.tgz", + "integrity": "sha1-OciRjO/1eZ+D+UkqhI9iWt0Mdm8=", + "dev": true, + "requires": { + "hoek": "2.16.3" + } + }, + "brace-expansion": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.7.tgz", + "integrity": "sha1-Pv/DxQ4ABTH7cg6v+A8K6O8jz1k=", + "dev": true, + "requires": { + "balanced-match": "0.4.2", + "concat-map": "0.0.1" + } + }, + "buffer-shims": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/buffer-shims/-/buffer-shims-1.0.0.tgz", + "integrity": "sha1-mXjOMXOIxkmth5MCjDR37wRKi1E=", + "dev": true + }, + "caseless": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", + "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", + "dev": true, + "optional": true + }, + "co": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", + "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=", + "dev": true, + "optional": true + }, + "code-point-at": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", + "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", + "dev": true + }, + "combined-stream": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.5.tgz", + "integrity": "sha1-k4NwpXtKUd6ix3wV1cX9+JUWQAk=", + "dev": true, + "requires": { + "delayed-stream": "1.0.0" + } + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "console-control-strings": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", + "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=", + "dev": true + }, + "core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "dev": true + }, + "cryptiles": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-2.0.5.tgz", + "integrity": "sha1-O9/s3GCBR8HGcgL6KR59ylnqo7g=", + "dev": true, + "optional": true, + "requires": { + "boom": "2.10.1" + } + }, + "dashdash": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", + "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", + "dev": true, + "optional": true, + "requires": { + "assert-plus": "1.0.0" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "dev": true, + "optional": true + } + } + }, + "debug": { + "version": "2.6.8", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.8.tgz", + "integrity": "sha1-5zFTHKLt4n0YgiJCfaF4IdaP9Pw=", + "dev": true, + "optional": true, + "requires": { + "ms": "2.0.0" + } + }, + "deep-extend": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.4.2.tgz", + "integrity": "sha1-SLaZwn4zS/ifEIkr5DL25MfTSn8=", + "dev": true, + "optional": true + }, + "delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", + "dev": true + }, + "delegates": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", + "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=", + "dev": true, + "optional": true + }, + "ecc-jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz", + "integrity": "sha1-D8c6ntXw1Tw4GTOYUj735UN3dQU=", + "dev": true, + "optional": true, + "requires": { + "jsbn": "0.1.1" + } + }, + "extend": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.1.tgz", + "integrity": "sha1-p1Xqe8Gt/MWjHOfnYtuq3F5jZEQ=", + "dev": true, + "optional": true + }, + "extsprintf": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.0.2.tgz", + "integrity": "sha1-4QgOBljjALBilJkMxw4VAiNf1VA=", + "dev": true + }, + "forever-agent": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", + "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", + "dev": true, + "optional": true + }, + "form-data": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.1.4.tgz", + "integrity": "sha1-M8GDrPGTJ27KqYFDpp6Uv+4XUNE=", + "dev": true, + "optional": true, + "requires": { + "asynckit": "0.4.0", + "combined-stream": "1.0.5", + "mime-types": "2.1.15" + } + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "fstream": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.11.tgz", + "integrity": "sha1-XB+x8RdHcRTwYyoOtLcbPLD9MXE=", + "dev": true, + "requires": { + "graceful-fs": "4.1.11", + "inherits": "2.0.3", + "mkdirp": "0.5.1", + "rimraf": "2.6.1" + } + }, + "fstream-ignore": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/fstream-ignore/-/fstream-ignore-1.0.5.tgz", + "integrity": "sha1-nDHa40dnAY/h0kmyTa2mfQktoQU=", + "dev": true, + "optional": true, + "requires": { + "fstream": "1.0.11", + "inherits": "2.0.3", + "minimatch": "3.0.4" + } + }, + "gauge": { + "version": "2.7.4", + "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", + "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", + "dev": true, + "optional": true, + "requires": { + "aproba": "1.1.1", + "console-control-strings": "1.1.0", + "has-unicode": "2.0.1", + "object-assign": "4.1.1", + "signal-exit": "3.0.2", + "string-width": "1.0.2", + "strip-ansi": "3.0.1", + "wide-align": "1.1.2" + } + }, + "getpass": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", + "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", + "dev": true, + "optional": true, + "requires": { + "assert-plus": "1.0.0" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "dev": true, + "optional": true + } + } + }, + "glob": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", + "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "dev": true, + "requires": { + "fs.realpath": "1.0.0", + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" + } + }, + "graceful-fs": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", + "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", + "dev": true + }, + "har-schema": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-1.0.5.tgz", + "integrity": "sha1-0mMTX0MwfALGAq/I/pWXDAFRNp4=", + "dev": true, + "optional": true + }, + "har-validator": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-4.2.1.tgz", + "integrity": "sha1-M0gdDxu/9gDdID11gSpqX7oALio=", + "dev": true, + "optional": true, + "requires": { + "ajv": "4.11.8", + "har-schema": "1.0.5" + } + }, + "has-unicode": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", + "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=", + "dev": true, + "optional": true + }, + "hawk": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/hawk/-/hawk-3.1.3.tgz", + "integrity": "sha1-B4REvXwWQLD+VA0sm3PVlnjo4cQ=", + "dev": true, + "optional": true, + "requires": { + "boom": "2.10.1", + "cryptiles": "2.0.5", + "hoek": "2.16.3", + "sntp": "1.0.9" + } + }, + "hoek": { + "version": "2.16.3", + "resolved": "https://registry.npmjs.org/hoek/-/hoek-2.16.3.tgz", + "integrity": "sha1-ILt0A9POo5jpHcRxCo/xuCdKJe0=", + "dev": true + }, + "http-signature": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.1.1.tgz", + "integrity": "sha1-33LiZwZs0Kxn+3at+OE0qPvPkb8=", + "dev": true, + "optional": true, + "requires": { + "assert-plus": "0.2.0", + "jsprim": "1.4.0", + "sshpk": "1.13.0" + } + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "requires": { + "once": "1.4.0", + "wrappy": "1.0.2" + } + }, + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "dev": true + }, + "ini": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.4.tgz", + "integrity": "sha1-BTfLedr1m1mhpRff9wbIbsA5Fi4=", + "dev": true, + "optional": true + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "dev": true, + "requires": { + "number-is-nan": "1.0.1" + } + }, + "is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", + "dev": true, + "optional": true + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "isstream": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", + "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", + "dev": true, + "optional": true + }, + "jodid25519": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/jodid25519/-/jodid25519-1.0.2.tgz", + "integrity": "sha1-BtSRIlUJNBlHfUJWM2BuDpB4KWc=", + "dev": true, + "optional": true, + "requires": { + "jsbn": "0.1.1" + } + }, + "jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", + "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", + "dev": true, + "optional": true + }, + "json-schema": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", + "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=", + "dev": true, + "optional": true + }, + "json-stable-stringify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz", + "integrity": "sha1-mnWdOcXy/1A/1TAGRu1EX4jE+a8=", + "dev": true, + "optional": true, + "requires": { + "jsonify": "0.0.0" + } + }, + "json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", + "dev": true, + "optional": true + }, + "jsonify": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz", + "integrity": "sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM=", + "dev": true, + "optional": true + }, + "jsprim": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.0.tgz", + "integrity": "sha1-o7h+QCmNjDgFUtjMdiigu5WiKRg=", + "dev": true, + "optional": true, + "requires": { + "assert-plus": "1.0.0", + "extsprintf": "1.0.2", + "json-schema": "0.2.3", + "verror": "1.3.6" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "dev": true, + "optional": true + } + } + }, + "mime-db": { + "version": "1.27.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.27.0.tgz", + "integrity": "sha1-gg9XIpa70g7CXtVeW13oaeVDbrE=", + "dev": true + }, + "mime-types": { + "version": "2.1.15", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.15.tgz", + "integrity": "sha1-pOv1BkCUVpI3uM9wBGd20J/JKu0=", + "dev": true, + "requires": { + "mime-db": "1.27.0" + } + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "1.1.7" + } + }, + "minimist": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "dev": true + }, + "mkdirp": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "dev": true, + "requires": { + "minimist": "0.0.8" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true, + "optional": true + }, + "node-pre-gyp": { + "version": "0.6.36", + "resolved": "https://registry.npmjs.org/node-pre-gyp/-/node-pre-gyp-0.6.36.tgz", + "integrity": "sha1-22BBEst04NR3VU6bUFsXq936t4Y=", + "dev": true, + "optional": true, + "requires": { + "mkdirp": "0.5.1", + "nopt": "4.0.1", + "npmlog": "4.1.0", + "rc": "1.2.1", + "request": "2.81.0", + "rimraf": "2.6.1", + "semver": "5.3.0", + "tar": "2.2.1", + "tar-pack": "3.4.0" + } + }, + "nopt": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.1.tgz", + "integrity": "sha1-0NRoWv1UFRk8jHUFYC0NF81kR00=", + "dev": true, + "optional": true, + "requires": { + "abbrev": "1.1.0", + "osenv": "0.1.4" + } + }, + "npmlog": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.0.tgz", + "integrity": "sha512-ocolIkZYZt8UveuiDS0yAkkIjid1o7lPG8cYm05yNYzBn8ykQtaiPMEGp8fY9tKdDgm8okpdKzkvu1y9hUYugA==", + "dev": true, + "optional": true, + "requires": { + "are-we-there-yet": "1.1.4", + "console-control-strings": "1.1.0", + "gauge": "2.7.4", + "set-blocking": "2.0.0" + } + }, + "number-is-nan": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", + "dev": true + }, + "oauth-sign": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.2.tgz", + "integrity": "sha1-Rqarfwrq2N6unsBWV4C31O/rnUM=", + "dev": true, + "optional": true + }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true, + "optional": true + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "requires": { + "wrappy": "1.0.2" + } + }, + "os-homedir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", + "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", + "dev": true, + "optional": true + }, + "os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", + "dev": true, + "optional": true + }, + "osenv": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.4.tgz", + "integrity": "sha1-Qv5tWVPfBsgGS+bxdsPQWqqjRkQ=", + "dev": true, + "optional": true, + "requires": { + "os-homedir": "1.0.2", + "os-tmpdir": "1.0.2" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true + }, + "performance-now": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-0.2.0.tgz", + "integrity": "sha1-M+8wxcd9TqIcWlOGnZG1bY8lVeU=", + "dev": true, + "optional": true + }, + "process-nextick-args": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz", + "integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M=", + "dev": true + }, + "punycode": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", + "dev": true, + "optional": true + }, + "qs": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.4.0.tgz", + "integrity": "sha1-E+JtKK1rD/qpExLNO/cI7TUecjM=", + "dev": true, + "optional": true + }, + "rc": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.1.tgz", + "integrity": "sha1-LgPo5C7kULjLPc5lvhv4l04d/ZU=", + "dev": true, + "optional": true, + "requires": { + "deep-extend": "0.4.2", + "ini": "1.3.4", + "minimist": "1.2.0", + "strip-json-comments": "2.0.1" + }, + "dependencies": { + "minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "dev": true, + "optional": true + } + } + }, + "readable-stream": { + "version": "2.2.9", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.2.9.tgz", + "integrity": "sha1-z3jsb0ptHrQ9JkiMrJfwQudLf8g=", + "dev": true, + "requires": { + "buffer-shims": "1.0.0", + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "1.0.0", + "process-nextick-args": "1.0.7", + "string_decoder": "1.0.1", + "util-deprecate": "1.0.2" + } + }, + "request": { + "version": "2.81.0", + "resolved": "https://registry.npmjs.org/request/-/request-2.81.0.tgz", + "integrity": "sha1-xpKJRqDgbF+Nb4qTM0af/aRimKA=", + "dev": true, + "optional": true, + "requires": { + "aws-sign2": "0.6.0", + "aws4": "1.6.0", + "caseless": "0.12.0", + "combined-stream": "1.0.5", + "extend": "3.0.1", + "forever-agent": "0.6.1", + "form-data": "2.1.4", + "har-validator": "4.2.1", + "hawk": "3.1.3", + "http-signature": "1.1.1", + "is-typedarray": "1.0.0", + "isstream": "0.1.2", + "json-stringify-safe": "5.0.1", + "mime-types": "2.1.15", + "oauth-sign": "0.8.2", + "performance-now": "0.2.0", + "qs": "6.4.0", + "safe-buffer": "5.0.1", + "stringstream": "0.0.5", + "tough-cookie": "2.3.2", + "tunnel-agent": "0.6.0", + "uuid": "3.0.1" + } + }, + "rimraf": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.1.tgz", + "integrity": "sha1-wjOOxkPfeht/5cVPqG9XQopV8z0=", + "dev": true, + "requires": { + "glob": "7.1.2" + } + }, + "safe-buffer": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.0.1.tgz", + "integrity": "sha1-0mPKVGls2KMGtcplUekt5XkY++c=", + "dev": true + }, + "semver": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.3.0.tgz", + "integrity": "sha1-myzl094C0XxgEq0yaqa00M9U+U8=", + "dev": true, + "optional": true + }, + "set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", + "dev": true, + "optional": true + }, + "signal-exit": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", + "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", + "dev": true, + "optional": true + }, + "sntp": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/sntp/-/sntp-1.0.9.tgz", + "integrity": "sha1-ZUEYTMkK7qbG57NeJlkIJEPGYZg=", + "dev": true, + "optional": true, + "requires": { + "hoek": "2.16.3" + } + }, + "sshpk": { + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.13.0.tgz", + "integrity": "sha1-/yo+T9BEl1Vf7Zezmg/YL6+zozw=", + "dev": true, + "optional": true, + "requires": { + "asn1": "0.2.3", + "assert-plus": "1.0.0", + "bcrypt-pbkdf": "1.0.1", + "dashdash": "1.14.1", + "ecc-jsbn": "0.1.1", + "getpass": "0.1.7", + "jodid25519": "1.0.2", + "jsbn": "0.1.1", + "tweetnacl": "0.14.5" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "dev": true, + "optional": true + } + } + }, + "string_decoder": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.1.tgz", + "integrity": "sha1-YuIA8DmVWmgQ2N8KM//A8BNmLZg=", + "dev": true, + "requires": { + "safe-buffer": "5.0.1" + } + }, + "string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "dev": true, + "requires": { + "code-point-at": "1.1.0", + "is-fullwidth-code-point": "1.0.0", + "strip-ansi": "3.0.1" + } + }, + "stringstream": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz", + "integrity": "sha1-TkhM1N5aC7vuGORjB3EKioFiGHg=", + "dev": true, + "optional": true + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "2.1.1" + } + }, + "strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", + "dev": true, + "optional": true + }, + "tar": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/tar/-/tar-2.2.1.tgz", + "integrity": "sha1-jk0qJWwOIYXGsYrWlK7JaLg8sdE=", + "dev": true, + "requires": { + "block-stream": "0.0.9", + "fstream": "1.0.11", + "inherits": "2.0.3" + } + }, + "tar-pack": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/tar-pack/-/tar-pack-3.4.0.tgz", + "integrity": "sha1-I74tf2cagzk3bL2wuP4/3r8xeYQ=", + "dev": true, + "optional": true, + "requires": { + "debug": "2.6.8", + "fstream": "1.0.11", + "fstream-ignore": "1.0.5", + "once": "1.4.0", + "readable-stream": "2.2.9", + "rimraf": "2.6.1", + "tar": "2.2.1", + "uid-number": "0.0.6" + } + }, + "tough-cookie": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.2.tgz", + "integrity": "sha1-8IH3bkyFcg5sN6X6ztc3FQ2EByo=", + "dev": true, + "optional": true, + "requires": { + "punycode": "1.4.1" + } + }, + "tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", + "dev": true, + "optional": true, + "requires": { + "safe-buffer": "5.0.1" + } + }, + "tweetnacl": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", + "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", + "dev": true, + "optional": true + }, + "uid-number": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/uid-number/-/uid-number-0.0.6.tgz", + "integrity": "sha1-DqEOgDXo61uOREnwbaHHMGY7qoE=", + "dev": true, + "optional": true + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "dev": true + }, + "uuid": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.0.1.tgz", + "integrity": "sha1-ZUS7ot/ajBzxfmKaOjBeK7H+5sE=", + "dev": true, + "optional": true + }, + "verror": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/verror/-/verror-1.3.6.tgz", + "integrity": "sha1-z/XfEpRtKX0rqu+qJoniW+AcAFw=", + "dev": true, + "optional": true, + "requires": { + "extsprintf": "1.0.2" + } + }, + "wide-align": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.2.tgz", + "integrity": "sha512-ijDLlyQ7s6x1JgCLur53osjm/UXUYD9+0PbYKrBsYisYXzCxN+HC3mYDNy/dWdmf3AwqwU3CXwDCvsNgGK1S0w==", + "dev": true, + "optional": true, + "requires": { + "string-width": "1.0.2" + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + } + } + }, + "function-bind": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.0.tgz", + "integrity": "sha1-FhdnFMgBeY5Ojyz391KUZ7tKV3E=", + "dev": true + }, + "function.prototype.name": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.0.3.tgz", + "integrity": "sha512-5EblxZUdioXi2JiMZ9FUbwYj40eQ9MFHyzFLBSPdlRl3SO8l7SLWuAnQ/at/1Wi4hjJwME/C5WpF2ZfAc8nGNw==", + "dev": true, + "requires": { + "define-properties": "1.1.2", + "function-bind": "1.1.0", + "is-callable": "1.1.3" + } + }, + "functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", + "dev": true + }, + "gaze": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/gaze/-/gaze-0.5.2.tgz", + "integrity": "sha1-QLcJU30k0dRXZ9takIaJ3+aaxE8=", + "dev": true, + "requires": { + "globule": "0.1.0" + } + }, + "generate-function": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/generate-function/-/generate-function-2.0.0.tgz", + "integrity": "sha1-aFj+fAlpt9TpCTM3ZHrHn2DfvnQ=", + "dev": true + }, + "generate-object-property": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/generate-object-property/-/generate-object-property-1.2.0.tgz", + "integrity": "sha1-nA4cQDCM6AT0eDYYuTf6iPmdUNA=", + "dev": true, + "requires": { + "is-property": "1.0.2" + } + }, + "get-caller-file": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.2.tgz", + "integrity": "sha1-9wLmMSfn4jHBYKgMFVSstw1QR+U=", + "dev": true + }, + "get-stdin": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz", + "integrity": "sha1-uWjGsKBDhDJJAui/Gl3zJXmkUP4=", + "dev": true + }, + "get-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", + "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=", + "dev": true + }, + "getpass": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", + "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", + "dev": true, + "requires": { + "assert-plus": "1.0.0" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "dev": true + } + } + }, + "glob": { + "version": "5.0.15", + "resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz", + "integrity": "sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E=", + "dev": true, + "requires": { + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "2.0.10", + "once": "1.4.0", + "path-is-absolute": "1.0.1" + } + }, + "glob-base": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/glob-base/-/glob-base-0.3.0.tgz", + "integrity": "sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q=", + "dev": true, + "requires": { + "glob-parent": "2.0.0", + "is-glob": "2.0.1" + } + }, + "glob-parent": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz", + "integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=", + "dev": true, + "requires": { + "is-glob": "2.0.1" + } + }, + "glob-stream": { + "version": "3.1.18", + "resolved": "https://registry.npmjs.org/glob-stream/-/glob-stream-3.1.18.tgz", + "integrity": "sha1-kXCl8St5Awb9/lmPMT+PeVT9FDs=", + "dev": true, + "requires": { + "glob": "4.5.3", + "glob2base": "0.0.12", + "minimatch": "2.0.10", + "ordered-read-streams": "0.1.0", + "through2": "0.6.5", + "unique-stream": "1.0.0" + }, + "dependencies": { + "glob": { + "version": "4.5.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-4.5.3.tgz", + "integrity": "sha1-xstz0yJsHv7wTePFbQEvAzd+4V8=", + "dev": true, + "requires": { + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "2.0.10", + "once": "1.4.0" + } + }, + "readable-stream": { + "version": "1.0.34", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", + "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", + "dev": true, + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "0.0.1", + "string_decoder": "0.10.31" + } + }, + "through2": { + "version": "0.6.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-0.6.5.tgz", + "integrity": "sha1-QaucZ7KdVyCQcUEOHXp6lozTrUg=", + "dev": true, + "requires": { + "readable-stream": "1.0.34", + "xtend": "4.0.1" + } + }, + "xtend": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", + "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=", + "dev": true + } + } + }, + "glob-watcher": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/glob-watcher/-/glob-watcher-0.0.6.tgz", + "integrity": "sha1-uVtKjfdLOcgymLDAXJeLTZo7cQs=", + "dev": true, + "requires": { + "gaze": "0.5.2" + } + }, + "glob2base": { + "version": "0.0.12", + "resolved": "https://registry.npmjs.org/glob2base/-/glob2base-0.0.12.tgz", + "integrity": "sha1-nUGbPijxLoOjYhZKJ3BVkiycDVY=", + "dev": true, + "requires": { + "find-index": "0.1.1" + } + }, + "global-modules": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-0.2.3.tgz", + "integrity": "sha1-6lo77ULG1s6ZWk+KEmm12uIjgo0=", + "dev": true, + "requires": { + "global-prefix": "0.1.5", + "is-windows": "0.2.0" + } + }, + "global-prefix": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-0.1.5.tgz", + "integrity": "sha1-jTvGuNo8qBEqFg2NSW/wRiv+948=", + "dev": true, + "requires": { + "homedir-polyfill": "1.0.1", + "ini": "1.3.4", + "is-windows": "0.2.0", + "which": "1.3.0" + } + }, + "globals": { + "version": "9.18.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-9.18.0.tgz", + "integrity": "sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ==", + "dev": true + }, + "globby": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/globby/-/globby-3.0.1.tgz", + "integrity": "sha1-IJSvhCHhkVIVDViT62QWsxLZoi8=", + "dev": true, + "requires": { + "array-union": "1.0.2", + "arrify": "1.0.1", + "glob": "5.0.15", + "object-assign": "4.0.1", + "pify": "2.3.0", + "pinkie-promise": "1.0.0" + }, + "dependencies": { + "pinkie": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-1.0.0.tgz", + "integrity": "sha1-Wkfyi6EBXQIBvae/DzWOR77Ix+Q=", + "dev": true + }, + "pinkie-promise": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-1.0.0.tgz", + "integrity": "sha1-0dpn9UglY7t89X8oauKCLs+/NnA=", + "dev": true, + "requires": { + "pinkie": "1.0.0" + } + } + } + }, + "globule": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/globule/-/globule-0.1.0.tgz", + "integrity": "sha1-2cjt3h2nnRJaFRt5UzuXhnY0auU=", + "dev": true, + "requires": { + "glob": "3.1.21", + "lodash": "1.0.2", + "minimatch": "0.2.14" + }, + "dependencies": { + "glob": { + "version": "3.1.21", + "resolved": "https://registry.npmjs.org/glob/-/glob-3.1.21.tgz", + "integrity": "sha1-0p4KBV3qUTj00H7UDomC6DwgZs0=", + "dev": true, + "requires": { + "graceful-fs": "1.2.3", + "inherits": "1.0.2", + "minimatch": "0.2.14" + } + }, + "graceful-fs": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-1.2.3.tgz", + "integrity": "sha1-FaSAaldUfLLS2/J/QuiajDRRs2Q=", + "dev": true + }, + "inherits": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-1.0.2.tgz", + "integrity": "sha1-ykMJ2t7mtUzAuNJH6NfHoJdb3Js=", + "dev": true + }, + "lodash": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-1.0.2.tgz", + "integrity": "sha1-j1dWDIO1n8JwvT1WG2kAQ0MOJVE=", + "dev": true + }, + "minimatch": { + "version": "0.2.14", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.2.14.tgz", + "integrity": "sha1-x054BXT2PG+aCQ6Q775u9TpqdWo=", + "dev": true, + "requires": { + "lru-cache": "2.7.3", + "sigmund": "1.0.1" + } + } + } + }, + "glogg": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/glogg/-/glogg-1.0.0.tgz", + "integrity": "sha1-f+DxmfV6yQbPUS/urY+Q7kooT8U=", + "dev": true, + "requires": { + "sparkles": "1.0.0" + } + }, + "graceful-fs": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", + "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", + "dev": true + }, + "growly": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/growly/-/growly-1.3.0.tgz", + "integrity": "sha1-8QdIy+dq+WS3yWyTxrzCivEgwIE=", + "dev": true + }, + "gulp": { + "version": "3.9.1", + "resolved": "https://registry.npmjs.org/gulp/-/gulp-3.9.1.tgz", + "integrity": "sha1-VxzkWSjdQK9lFPxAEYZgFsE4RbQ=", + "dev": true, + "requires": { + "archy": "1.0.0", + "chalk": "1.1.3", + "deprecated": "0.0.1", + "gulp-util": "3.0.8", + "interpret": "1.0.3", + "liftoff": "2.3.0", + "minimist": "1.2.0", + "orchestrator": "0.3.8", + "pretty-hrtime": "1.0.3", + "semver": "4.3.6", + "tildify": "1.2.0", + "v8flags": "2.1.1", + "vinyl-fs": "0.3.14" + } + }, + "gulp-babel": { + "version": "6.1.2", + "resolved": "https://registry.npmjs.org/gulp-babel/-/gulp-babel-6.1.2.tgz", + "integrity": "sha1-fAF25Lo/JExgWIoMSzIKRdGt784=", + "dev": true, + "requires": { + "babel-core": "6.25.0", + "gulp-util": "3.0.8", + "object-assign": "4.0.1", + "replace-ext": "0.0.1", + "through2": "2.0.3", + "vinyl-sourcemaps-apply": "0.2.1" + }, + "dependencies": { + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "readable-stream": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.3.tgz", + "integrity": "sha512-m+qzzcn7KUxEmd1gMbchF+Y2eIUbieUaxkWtptyHywrX0rE8QEYqPC07Vuy4Wm32/xE16NcdBctb8S0Xe/5IeQ==", + "dev": true, + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "1.0.0", + "process-nextick-args": "1.0.7", + "safe-buffer": "5.1.1", + "string_decoder": "1.0.3", + "util-deprecate": "1.0.2" + } + }, + "string_decoder": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", + "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", + "dev": true, + "requires": { + "safe-buffer": "5.1.1" + } + }, + "through2": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.3.tgz", + "integrity": "sha1-AARWmzfHx0ujnEPzzteNGtlBQL4=", + "dev": true, + "requires": { + "readable-stream": "2.3.3", + "xtend": "4.0.1" + } + }, + "xtend": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", + "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=", + "dev": true + } + } + }, + "gulp-concat": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/gulp-concat/-/gulp-concat-2.6.1.tgz", + "integrity": "sha1-Yz0WyV2IUEYorQJmVmPO5aR5M1M=", + "dev": true, + "requires": { + "concat-with-sourcemaps": "1.0.4", + "through2": "2.0.3", + "vinyl": "2.1.0" + }, + "dependencies": { + "clone": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.1.tgz", + "integrity": "sha1-0hfR6WERjjrJpLi7oyhVU79kfNs=", + "dev": true + }, + "clone-stats": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/clone-stats/-/clone-stats-1.0.0.tgz", + "integrity": "sha1-s3gt/4u1R04Yuba/D9/ngvh3doA=", + "dev": true + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "readable-stream": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.3.tgz", + "integrity": "sha512-m+qzzcn7KUxEmd1gMbchF+Y2eIUbieUaxkWtptyHywrX0rE8QEYqPC07Vuy4Wm32/xE16NcdBctb8S0Xe/5IeQ==", + "dev": true, + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "1.0.0", + "process-nextick-args": "1.0.7", + "safe-buffer": "5.1.1", + "string_decoder": "1.0.3", + "util-deprecate": "1.0.2" + } + }, + "replace-ext": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-1.0.0.tgz", + "integrity": "sha1-3mMSg3P8v3w8z6TeWkgMRaZ5WOs=", + "dev": true + }, + "string_decoder": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", + "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", + "dev": true, + "requires": { + "safe-buffer": "5.1.1" + } + }, + "through2": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.3.tgz", + "integrity": "sha1-AARWmzfHx0ujnEPzzteNGtlBQL4=", + "dev": true, + "requires": { + "readable-stream": "2.3.3", + "xtend": "4.0.1" + } + }, + "vinyl": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-2.1.0.tgz", + "integrity": "sha1-Ah+cLPlR1rk5lDyJ617lrdT9kkw=", + "dev": true, + "requires": { + "clone": "2.1.1", + "clone-buffer": "1.0.0", + "clone-stats": "1.0.0", + "cloneable-readable": "1.0.0", + "remove-trailing-separator": "1.0.2", + "replace-ext": "1.0.0" + } + }, + "xtend": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", + "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=", + "dev": true + } + } + }, + "gulp-size": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/gulp-size/-/gulp-size-2.1.0.tgz", + "integrity": "sha1-HCtk8X+QcdWr2Z0VS3s0gfj7oSg=", + "dev": true, + "requires": { + "chalk": "1.1.3", + "gulp-util": "3.0.8", + "gzip-size": "3.0.0", + "object-assign": "4.0.1", + "pretty-bytes": "3.0.1", + "stream-counter": "1.0.0", + "through2": "2.0.3" + }, + "dependencies": { + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "readable-stream": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.3.tgz", + "integrity": "sha512-m+qzzcn7KUxEmd1gMbchF+Y2eIUbieUaxkWtptyHywrX0rE8QEYqPC07Vuy4Wm32/xE16NcdBctb8S0Xe/5IeQ==", + "dev": true, + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "1.0.0", + "process-nextick-args": "1.0.7", + "safe-buffer": "5.1.1", + "string_decoder": "1.0.3", + "util-deprecate": "1.0.2" + } + }, + "string_decoder": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", + "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", + "dev": true, + "requires": { + "safe-buffer": "5.1.1" + } + }, + "through2": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.3.tgz", + "integrity": "sha1-AARWmzfHx0ujnEPzzteNGtlBQL4=", + "dev": true, + "requires": { + "readable-stream": "2.3.3", + "xtend": "4.0.1" + } + }, + "xtend": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", + "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=", + "dev": true + } + } + }, + "gulp-sourcemaps": { + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/gulp-sourcemaps/-/gulp-sourcemaps-1.12.0.tgz", + "integrity": "sha1-eG+XyUoPloSSRl1wVY4EJCxnlZg=", + "dev": true, + "requires": { + "@gulp-sourcemaps/map-sources": "1.0.0", + "acorn": "4.0.13", + "convert-source-map": "1.5.0", + "css": "2.2.1", + "debug-fabulous": "0.0.4", + "detect-newline": "2.1.0", + "graceful-fs": "4.1.11", + "source-map": "0.5.6", + "strip-bom": "2.0.0", + "through2": "2.0.3", + "vinyl": "1.2.0" + }, + "dependencies": { + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "readable-stream": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.3.tgz", + "integrity": "sha512-m+qzzcn7KUxEmd1gMbchF+Y2eIUbieUaxkWtptyHywrX0rE8QEYqPC07Vuy4Wm32/xE16NcdBctb8S0Xe/5IeQ==", + "dev": true, + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "1.0.0", + "process-nextick-args": "1.0.7", + "safe-buffer": "5.1.1", + "string_decoder": "1.0.3", + "util-deprecate": "1.0.2" + } + }, + "string_decoder": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", + "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", + "dev": true, + "requires": { + "safe-buffer": "5.1.1" + } + }, + "strip-bom": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", + "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", + "dev": true, + "requires": { + "is-utf8": "0.2.1" + } + }, + "through2": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.3.tgz", + "integrity": "sha1-AARWmzfHx0ujnEPzzteNGtlBQL4=", + "dev": true, + "requires": { + "readable-stream": "2.3.3", + "xtend": "4.0.1" + } + }, + "vinyl": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-1.2.0.tgz", + "integrity": "sha1-XIgDbPVl5d8FVYv8kR+GVt8hiIQ=", + "dev": true, + "requires": { + "clone": "1.0.2", + "clone-stats": "0.0.1", + "replace-ext": "0.0.1" + } + }, + "xtend": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", + "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=", + "dev": true + } + } + }, + "gulp-uglify": { + "version": "1.5.4", + "resolved": "https://registry.npmjs.org/gulp-uglify/-/gulp-uglify-1.5.4.tgz", + "integrity": "sha1-UkeI2HZm0J+dDCH7IXf5ADmmWMk=", + "dev": true, + "requires": { + "deap": "1.0.0", + "fancy-log": "1.3.0", + "gulp-util": "3.0.8", + "isobject": "2.1.0", + "through2": "2.0.3", + "uglify-js": "2.6.4", + "uglify-save-license": "0.4.1", + "vinyl-sourcemaps-apply": "0.2.1" + }, + "dependencies": { + "async": { + "version": "0.2.10", + "resolved": "https://registry.npmjs.org/async/-/async-0.2.10.tgz", + "integrity": "sha1-trvgsGdLnXGXCMo43owjfLUmw9E=", + "dev": true + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "readable-stream": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.3.tgz", + "integrity": "sha512-m+qzzcn7KUxEmd1gMbchF+Y2eIUbieUaxkWtptyHywrX0rE8QEYqPC07Vuy4Wm32/xE16NcdBctb8S0Xe/5IeQ==", + "dev": true, + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "1.0.0", + "process-nextick-args": "1.0.7", + "safe-buffer": "5.1.1", + "string_decoder": "1.0.3", + "util-deprecate": "1.0.2" + } + }, + "string_decoder": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", + "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", + "dev": true, + "requires": { + "safe-buffer": "5.1.1" + } + }, + "through2": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.3.tgz", + "integrity": "sha1-AARWmzfHx0ujnEPzzteNGtlBQL4=", + "dev": true, + "requires": { + "readable-stream": "2.3.3", + "xtend": "4.0.1" + } + }, + "uglify-js": { + "version": "2.6.4", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.6.4.tgz", + "integrity": "sha1-ZeovswWck5RpLxX+2HwrNsFrmt8=", + "dev": true, + "requires": { + "async": "0.2.10", + "source-map": "0.5.6", + "uglify-to-browserify": "1.0.2", + "yargs": "3.10.0" + } + }, + "window-size": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.0.tgz", + "integrity": "sha1-VDjNLqk7IC76Ohn+iIeu58lPnJ0=", + "dev": true + }, + "xtend": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", + "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=", + "dev": true + }, + "yargs": { + "version": "3.10.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-3.10.0.tgz", + "integrity": "sha1-9+572FfdfB0tOMDnTvvWgdFDH9E=", + "dev": true, + "requires": { + "camelcase": "1.2.1", + "cliui": "2.1.0", + "decamelize": "1.2.0", + "window-size": "0.1.0" + } + } + } + }, + "gulp-util": { + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/gulp-util/-/gulp-util-3.0.8.tgz", + "integrity": "sha1-AFTh50RQLifATBh8PsxQXdVLu08=", + "dev": true, + "requires": { + "array-differ": "1.0.0", + "array-uniq": "1.0.3", + "beeper": "1.1.1", + "chalk": "1.1.3", + "dateformat": "2.0.0", + "fancy-log": "1.3.0", + "gulplog": "1.0.0", + "has-gulplog": "0.1.0", + "lodash._reescape": "3.0.0", + "lodash._reevaluate": "3.0.0", + "lodash._reinterpolate": "3.0.0", + "lodash.template": "3.6.2", + "minimist": "1.2.0", + "multipipe": "0.1.2", + "object-assign": "3.0.0", + "replace-ext": "0.0.1", + "through2": "2.0.3", + "vinyl": "0.5.3" + }, + "dependencies": { + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "object-assign": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-3.0.0.tgz", + "integrity": "sha1-m+3VygiXlJvKR+f/QIBi1Un1h/I=", + "dev": true + }, + "readable-stream": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.3.tgz", + "integrity": "sha512-m+qzzcn7KUxEmd1gMbchF+Y2eIUbieUaxkWtptyHywrX0rE8QEYqPC07Vuy4Wm32/xE16NcdBctb8S0Xe/5IeQ==", + "dev": true, + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "1.0.0", + "process-nextick-args": "1.0.7", + "safe-buffer": "5.1.1", + "string_decoder": "1.0.3", + "util-deprecate": "1.0.2" + } + }, + "string_decoder": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", + "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", + "dev": true, + "requires": { + "safe-buffer": "5.1.1" + } + }, + "through2": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.3.tgz", + "integrity": "sha1-AARWmzfHx0ujnEPzzteNGtlBQL4=", + "dev": true, + "requires": { + "readable-stream": "2.3.3", + "xtend": "4.0.1" + } + }, + "xtend": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", + "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=", + "dev": true + } + } + }, + "gulp-webserver": { + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/gulp-webserver/-/gulp-webserver-0.9.1.tgz", + "integrity": "sha1-4JmSFl2XxYZWFtZCoWAVKbA2cGQ=", + "dev": true, + "requires": { + "connect": "3.6.2", + "connect-livereload": "0.4.1", + "gulp-util": "2.2.20", + "isarray": "0.0.1", + "node.extend": "1.1.6", + "open": "0.0.5", + "proxy-middleware": "0.5.1", + "serve-index": "1.9.0", + "serve-static": "1.12.3", + "through2": "0.5.1", + "tiny-lr": "0.1.4", + "watch": "0.11.0" + }, + "dependencies": { + "ansi-regex": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-0.2.1.tgz", + "integrity": "sha1-DY6UaWej2BQ/k+JOKYUl/BsiNfk=", + "dev": true + }, + "ansi-styles": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-1.1.0.tgz", + "integrity": "sha1-6uy/Zs1waIJ2Cy9GkVgrj1XXp94=", + "dev": true + }, + "chalk": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-0.5.1.tgz", + "integrity": "sha1-Zjs6ZItotV0EaQ1JFnqoN4WPIXQ=", + "dev": true, + "requires": { + "ansi-styles": "1.1.0", + "escape-string-regexp": "1.0.5", + "has-ansi": "0.1.0", + "strip-ansi": "0.3.0", + "supports-color": "0.2.0" + } + }, + "dateformat": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-1.0.12.tgz", + "integrity": "sha1-nxJLZ1lMk3/3BpMuSmQsyo27/uk=", + "dev": true, + "requires": { + "get-stdin": "4.0.1", + "meow": "3.7.0" + } + }, + "gulp-util": { + "version": "2.2.20", + "resolved": "https://registry.npmjs.org/gulp-util/-/gulp-util-2.2.20.tgz", + "integrity": "sha1-1xRuVyiRC9jwR6awseVJvCLb1kw=", + "dev": true, + "requires": { + "chalk": "0.5.1", + "dateformat": "1.0.12", + "lodash._reinterpolate": "2.4.1", + "lodash.template": "2.4.1", + "minimist": "0.2.0", + "multipipe": "0.1.2", + "through2": "0.5.1", + "vinyl": "0.2.3" + } + }, + "has-ansi": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-0.1.0.tgz", + "integrity": "sha1-hPJlqujA5qiKEtcCKJS3VoiUxi4=", + "dev": true, + "requires": { + "ansi-regex": "0.2.1" + } + }, + "lodash._reinterpolate": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/lodash._reinterpolate/-/lodash._reinterpolate-2.4.1.tgz", + "integrity": "sha1-TxInqlqHEfxjL1sHofRgequLMiI=", + "dev": true + }, + "lodash.escape": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/lodash.escape/-/lodash.escape-2.4.1.tgz", + "integrity": "sha1-LOEsXghNsKV92l5dHu659dF1o7Q=", + "dev": true, + "requires": { + "lodash._escapehtmlchar": "2.4.1", + "lodash._reunescapedhtml": "2.4.1", + "lodash.keys": "2.4.1" + } + }, + "lodash.keys": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/lodash.keys/-/lodash.keys-2.4.1.tgz", + "integrity": "sha1-SN6kbfj/djKxDXBrissmWR4rNyc=", + "dev": true, + "requires": { + "lodash._isnative": "2.4.1", + "lodash._shimkeys": "2.4.1", + "lodash.isobject": "2.4.1" + } + }, + "lodash.template": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/lodash.template/-/lodash.template-2.4.1.tgz", + "integrity": "sha1-nmEQB+32KRKal0qzxIuBez4c8g0=", + "dev": true, + "requires": { + "lodash._escapestringchar": "2.4.1", + "lodash._reinterpolate": "2.4.1", + "lodash.defaults": "2.4.1", + "lodash.escape": "2.4.1", + "lodash.keys": "2.4.1", + "lodash.templatesettings": "2.4.1", + "lodash.values": "2.4.1" + } + }, + "lodash.templatesettings": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/lodash.templatesettings/-/lodash.templatesettings-2.4.1.tgz", + "integrity": "sha1-6nbHXRHrhtTb6JqDiTu4YZKaxpk=", + "dev": true, + "requires": { + "lodash._reinterpolate": "2.4.1", + "lodash.escape": "2.4.1" + } + }, + "minimist": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.2.0.tgz", + "integrity": "sha1-Tf/lJdriuGTGbC4jxicdev3s784=", + "dev": true + }, + "readable-stream": { + "version": "1.0.34", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", + "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", + "dev": true, + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "0.0.1", + "string_decoder": "0.10.31" + } + }, + "strip-ansi": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-0.3.0.tgz", + "integrity": "sha1-JfSOoiynkYfzF0pNuHWTR7sSYiA=", + "dev": true, + "requires": { + "ansi-regex": "0.2.1" + } + }, + "supports-color": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-0.2.0.tgz", + "integrity": "sha1-2S3iaU6z9nMjlz1649i1W0wiGQo=", + "dev": true + }, + "through2": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/through2/-/through2-0.5.1.tgz", + "integrity": "sha1-390BLrnHAOIyP9M084rGIqs3Lac=", + "dev": true, + "requires": { + "readable-stream": "1.0.34", + "xtend": "3.0.0" + } + }, + "vinyl": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-0.2.3.tgz", + "integrity": "sha1-vKk4IJWC7FpJrVOKAPofEl5RMlI=", + "dev": true, + "requires": { + "clone-stats": "0.0.1" + } + }, + "watch": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/watch/-/watch-0.11.0.tgz", + "integrity": "sha1-6NugkbdFZ5mjr1eXi5hud+EyBAY=", + "dev": true + } + } + }, + "gulplog": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/gulplog/-/gulplog-1.0.0.tgz", + "integrity": "sha1-4oxNRdBey77YGDY86PnFkmIp/+U=", + "dev": true, + "requires": { + "glogg": "1.0.0" + } + }, + "gzip-size": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/gzip-size/-/gzip-size-3.0.0.tgz", + "integrity": "sha1-VGGI6b3DN/Zzdy+BZgRks4nc5SA=", + "dev": true, + "requires": { + "duplexer": "0.1.1" + } + }, + "handlebars": { + "version": "4.0.10", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.0.10.tgz", + "integrity": "sha1-PTDHGLCaPZbyPqTMH0A8TTup/08=", + "dev": true, + "requires": { + "async": "1.5.2", + "optimist": "0.6.1", + "source-map": "0.4.4", + "uglify-js": "2.8.29" + }, + "dependencies": { + "async": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", + "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=", + "dev": true + }, + "source-map": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz", + "integrity": "sha1-66T12pwNyZneaAMti092FzZSA2s=", + "dev": true, + "requires": { + "amdefine": "1.0.1" + } + } + } + }, + "har-validator": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-2.0.6.tgz", + "integrity": "sha1-zcvAgYgmWtEZtqWnyKtw7s+10n0=", + "dev": true, + "requires": { + "chalk": "1.1.3", + "commander": "2.11.0", + "is-my-json-valid": "2.16.0", + "pinkie-promise": "2.0.1" + } + }, + "has": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.1.tgz", + "integrity": "sha1-hGFzP1OLCDfJNh45qauelwTcLyg=", + "dev": true, + "requires": { + "function-bind": "1.1.0" + } + }, + "has-ansi": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", + "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", + "dev": true, + "requires": { + "ansi-regex": "2.1.1" + } + }, + "has-flag": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", + "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=", + "dev": true + }, + "has-gulplog": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/has-gulplog/-/has-gulplog-0.1.0.tgz", + "integrity": "sha1-ZBTIKRNpfaUVkDl9r7EvIpZ4Ec4=", + "dev": true, + "requires": { + "sparkles": "1.0.0" + } + }, + "hash-base": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-2.0.2.tgz", + "integrity": "sha1-ZuodhW206KVHDK32/OI65SRO8uE=", + "dev": true, + "requires": { + "inherits": "2.0.3" + } + }, + "hash.js": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.3.tgz", + "integrity": "sha512-/UETyP0W22QILqS+6HowevwhEFJ3MBJnwTf75Qob9Wz9t0DPuisL8kW8YZMK62dHAKE1c1p+gY1TtOLY+USEHA==", + "dev": true, + "requires": { + "inherits": "2.0.3", + "minimalistic-assert": "1.0.0" + } + }, + "hawk": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/hawk/-/hawk-3.1.3.tgz", + "integrity": "sha1-B4REvXwWQLD+VA0sm3PVlnjo4cQ=", + "dev": true, + "requires": { + "boom": "2.10.1", + "cryptiles": "2.0.5", + "hoek": "2.16.3", + "sntp": "1.0.9" + } + }, + "hmac-drbg": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", + "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", + "dev": true, + "requires": { + "hash.js": "1.1.3", + "minimalistic-assert": "1.0.0", + "minimalistic-crypto-utils": "1.0.1" + } + }, + "hoek": { + "version": "2.16.3", + "resolved": "https://registry.npmjs.org/hoek/-/hoek-2.16.3.tgz", + "integrity": "sha1-ILt0A9POo5jpHcRxCo/xuCdKJe0=", + "dev": true + }, + "home-or-tmp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/home-or-tmp/-/home-or-tmp-2.0.0.tgz", + "integrity": "sha1-42w/LSyufXRqhX440Y1fMqeILbg=", + "dev": true, + "requires": { + "os-homedir": "1.0.2", + "os-tmpdir": "1.0.2" + } + }, + "homedir-polyfill": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.1.tgz", + "integrity": "sha1-TCu8inWJmP7r9e1oWA921GdotLw=", + "dev": true, + "requires": { + "parse-passwd": "1.0.0" + } + }, + "hosted-git-info": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.5.0.tgz", + "integrity": "sha512-pNgbURSuab90KbTqvRPsseaTxOJCZBD0a7t+haSN33piP9cCM4l0CqdzAif2hUqm716UovKB2ROmiabGAKVXyg==", + "dev": true + }, + "html-encoding-sniffer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-1.0.1.tgz", + "integrity": "sha1-eb96eF6klf5mFl5zQVPzY/9UN9o=", + "dev": true, + "requires": { + "whatwg-encoding": "1.0.1" + } + }, + "htmlescape": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/htmlescape/-/htmlescape-1.1.1.tgz", + "integrity": "sha1-OgPtwiFLyjtmQko+eVk0lQnLA1E=", + "dev": true + }, + "htmlparser2": { + "version": "3.9.2", + "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.9.2.tgz", + "integrity": "sha1-G9+HrMoPP55T+k/M6w9LTLsAszg=", + "dev": true, + "requires": { + "domelementtype": "1.3.0", + "domhandler": "2.4.1", + "domutils": "1.5.1", + "entities": "1.1.1", + "inherits": "2.0.3", + "readable-stream": "2.3.3" + }, + "dependencies": { + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "readable-stream": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.3.tgz", + "integrity": "sha512-m+qzzcn7KUxEmd1gMbchF+Y2eIUbieUaxkWtptyHywrX0rE8QEYqPC07Vuy4Wm32/xE16NcdBctb8S0Xe/5IeQ==", + "dev": true, + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "1.0.0", + "process-nextick-args": "1.0.7", + "safe-buffer": "5.1.1", + "string_decoder": "1.0.3", + "util-deprecate": "1.0.2" + } + }, + "string_decoder": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", + "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", + "dev": true, + "requires": { + "safe-buffer": "5.1.1" + } + } + } + }, + "http-browserify": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/http-browserify/-/http-browserify-1.7.0.tgz", + "integrity": "sha1-M3la3nLfiKz7/TZ3PO/tp2RzWyA=", + "dev": true, + "requires": { + "Base64": "0.2.1", + "inherits": "2.0.3" + } + }, + "http-errors": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.1.tgz", + "integrity": "sha1-X4uO2YrKVFZWv1cplzh/kEpyIlc=", + "dev": true, + "requires": { + "depd": "1.1.0", + "inherits": "2.0.3", + "setprototypeof": "1.0.3", + "statuses": "1.3.1" + } + }, + "http-signature": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.1.1.tgz", + "integrity": "sha1-33LiZwZs0Kxn+3at+OE0qPvPkb8=", + "dev": true, + "requires": { + "assert-plus": "0.2.0", + "jsprim": "1.4.1", + "sshpk": "1.13.1" + } + }, + "https-browserify": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-0.0.1.tgz", + "integrity": "sha1-P5E2XKvmC3ftDruiS0VOPgnZWoI=", + "dev": true + }, + "husky": { + "version": "0.14.3", + "resolved": "https://registry.npmjs.org/husky/-/husky-0.14.3.tgz", + "integrity": "sha512-e21wivqHpstpoiWA/Yi8eFti8E+sQDSS53cpJsPptPs295QTOQR0ZwnHo2TXy1XOpZFD9rPOd3NpmqTK6uMLJA==", + "dev": true, + "requires": { + "is-ci": "1.0.10", + "normalize-path": "1.0.0", + "strip-indent": "2.0.0" + }, + "dependencies": { + "normalize-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-1.0.0.tgz", + "integrity": "sha1-MtDkcvkf80VwHBWoMRAY07CpA3k=", + "dev": true + }, + "strip-indent": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-2.0.0.tgz", + "integrity": "sha1-XvjbKV0B5u1sv3qrlpmNeCJSe2g=", + "dev": true + } + } + }, + "iconv-lite": { + "version": "0.4.18", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.18.tgz", + "integrity": "sha512-sr1ZQph3UwHTR0XftSbK85OvBbxe/abLGzEnPENCQwmHf7sck8Oyu4ob3LgBxWWxRoM+QszeUyl7jbqapu2TqA==", + "dev": true + }, + "ieee754": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.8.tgz", + "integrity": "sha1-vjPUCsEO8ZJnAfbwii2G+/0a0+Q=", + "dev": true + }, + "ignore": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.3.tgz", + "integrity": "sha1-QyNS5XrM2HqzEQ6C0/6g5HgSFW0=", + "dev": true + }, + "imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "dev": true + }, + "indent-string": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-2.1.0.tgz", + "integrity": "sha1-ji1INIdCEhtKghi3oTfppSBJ3IA=", + "dev": true, + "requires": { + "repeating": "2.0.1" + }, + "dependencies": { + "repeating": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz", + "integrity": "sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo=", + "dev": true, + "requires": { + "is-finite": "1.0.2" + } + } + } + }, + "indexof": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/indexof/-/indexof-0.0.1.tgz", + "integrity": "sha1-gtwzbSMrkGIXnQWrMpOmYFn9Q10=", + "dev": true + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "requires": { + "once": "1.4.0", + "wrappy": "1.0.2" + } + }, + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "dev": true + }, + "ini": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.4.tgz", + "integrity": "sha1-BTfLedr1m1mhpRff9wbIbsA5Fi4=", + "dev": true + }, + "inline-source-map": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/inline-source-map/-/inline-source-map-0.3.1.tgz", + "integrity": "sha1-pSi1FOaJ/OkNswiehw2S9Sestes=", + "dev": true, + "requires": { + "source-map": "0.3.0" + }, + "dependencies": { + "source-map": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.3.0.tgz", + "integrity": "sha1-hYb7mloAXltQHiHNGLbyG0V60fk=", + "dev": true, + "requires": { + "amdefine": "1.0.1" + } + } + } + }, + "inquirer": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-3.2.1.tgz", + "integrity": "sha512-QgW3eiPN8gpj/K5vVpHADJJgrrF0ho/dZGylikGX7iqAdRgC9FVKYKWFLx6hZDBFcOLEoSqINYrVPeFAeG/PdA==", + "dev": true, + "requires": { + "ansi-escapes": "2.0.0", + "chalk": "2.0.1", + "cli-cursor": "2.1.0", + "cli-width": "2.1.0", + "external-editor": "2.0.4", + "figures": "2.0.0", + "lodash": "4.17.4", + "mute-stream": "0.0.7", + "run-async": "2.3.0", + "rx-lite": "4.0.8", + "rx-lite-aggregates": "4.0.8", + "string-width": "2.1.1", + "strip-ansi": "4.0.0", + "through": "2.3.8" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "ansi-styles": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", + "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", + "dev": true, + "requires": { + "color-convert": "1.9.0" + } + }, + "chalk": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.0.1.tgz", + "integrity": "sha512-Mp+FXEI+FrwY/XYV45b2YD3E8i3HwnEAoFcM0qlZzq/RZ9RwWitt2Y/c7cqRAz70U7hfekqx6qNYthuKFO6K0g==", + "dev": true, + "requires": { + "ansi-styles": "3.2.0", + "escape-string-regexp": "1.0.5", + "supports-color": "4.2.1" + } + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "3.0.0" + } + }, + "supports-color": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.2.1.tgz", + "integrity": "sha512-qxzYsob3yv6U+xMzPrv170y8AwGP7i74g+pbixCfD6rgso8BscLT2qXIuz6TpOaiJZ3mFgT5O9lyT9nMU4LfaA==", + "dev": true, + "requires": { + "has-flag": "2.0.0" + } + } + } + }, + "insert-module-globals": { + "version": "6.6.3", + "resolved": "https://registry.npmjs.org/insert-module-globals/-/insert-module-globals-6.6.3.tgz", + "integrity": "sha1-IGOOKaMPntHKLjqCX7wsulJG3fw=", + "dev": true, + "requires": { + "combine-source-map": "0.6.1", + "concat-stream": "1.4.10", + "is-buffer": "1.1.5", + "JSONStream": "1.3.1", + "lexical-scope": "1.2.0", + "process": "0.11.10", + "through2": "1.1.1", + "xtend": "4.0.1" + }, + "dependencies": { + "combine-source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/combine-source-map/-/combine-source-map-0.6.1.tgz", + "integrity": "sha1-m0oJwxYDPXaODxHgKfonMOB5rZY=", + "dev": true, + "requires": { + "convert-source-map": "1.1.3", + "inline-source-map": "0.5.0", + "lodash.memoize": "3.0.4", + "source-map": "0.4.4" + } + }, + "convert-source-map": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.1.3.tgz", + "integrity": "sha1-SCnId+n+SbMWHzvzZziI4gRpmGA=", + "dev": true + }, + "inline-source-map": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/inline-source-map/-/inline-source-map-0.5.0.tgz", + "integrity": "sha1-Skxd2OT7Xps82mDIIt+tyu5m4K8=", + "dev": true, + "requires": { + "source-map": "0.4.4" + } + }, + "JSONStream": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.1.tgz", + "integrity": "sha1-cH92HgHa6eFvG8+TcDt4xwlmV5o=", + "dev": true, + "requires": { + "jsonparse": "1.3.1", + "through": "2.3.8" + } + }, + "process": { + "version": "0.11.10", + "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", + "integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=", + "dev": true + }, + "source-map": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz", + "integrity": "sha1-66T12pwNyZneaAMti092FzZSA2s=", + "dev": true, + "requires": { + "amdefine": "1.0.1" + } + }, + "xtend": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", + "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=", + "dev": true + } + } + }, + "interpret": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.0.3.tgz", + "integrity": "sha1-y8NcYu7uc/Gat7EKgBURQBr8D5A=", + "dev": true + }, + "invariant": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.2.tgz", + "integrity": "sha1-nh9WrArNtr8wMwbzOL47IErmA2A=", + "dev": true, + "requires": { + "loose-envify": "1.3.1" + } + }, + "invert-kv": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", + "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=", + "dev": true + }, + "is": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/is/-/is-3.2.1.tgz", + "integrity": "sha1-0Kwq1V63sL7JJqUmb2xmKqqD3KU=", + "dev": true + }, + "is-absolute": { + "version": "0.2.6", + "resolved": "https://registry.npmjs.org/is-absolute/-/is-absolute-0.2.6.tgz", + "integrity": "sha1-IN5p89uULvLYe5wto28XIjWxtes=", + "dev": true, + "requires": { + "is-relative": "0.2.1", + "is-windows": "0.2.0" + } + }, + "is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", + "dev": true + }, + "is-binary-path": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", + "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", + "dev": true, + "requires": { + "binary-extensions": "1.9.0" + } + }, + "is-buffer": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.5.tgz", + "integrity": "sha1-Hzsm72E7IUuIy8ojzGwB2Hlh7sw=", + "dev": true + }, + "is-builtin-module": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz", + "integrity": "sha1-VAVy0096wxGfj3bDDLwbHgN6/74=", + "dev": true, + "requires": { + "builtin-modules": "1.1.1" + } + }, + "is-callable": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.3.tgz", + "integrity": "sha1-hut1OSgF3cM69xySoO7fdO52BLI=", + "dev": true + }, + "is-ci": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-1.0.10.tgz", + "integrity": "sha1-9zkzayYyNlBhqdSCcM1WrjNpMY4=", + "dev": true, + "requires": { + "ci-info": "1.0.0" + } + }, + "is-date-object": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.1.tgz", + "integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=", + "dev": true + }, + "is-dotfile": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-dotfile/-/is-dotfile-1.0.3.tgz", + "integrity": "sha1-pqLzL/0t+wT1yiXs0Pa4PPeYoeE=", + "dev": true + }, + "is-equal-shallow": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz", + "integrity": "sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ=", + "dev": true, + "requires": { + "is-primitive": "2.0.0" + } + }, + "is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", + "dev": true + }, + "is-extglob": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", + "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", + "dev": true + }, + "is-finite": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.2.tgz", + "integrity": "sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko=", + "dev": true, + "requires": { + "number-is-nan": "1.0.1" + } + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "is-glob": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", + "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", + "dev": true, + "requires": { + "is-extglob": "1.0.0" + } + }, + "is-my-json-valid": { + "version": "2.16.0", + "resolved": "https://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.16.0.tgz", + "integrity": "sha1-8Hndm/2uZe4gOKrorLyGqxCeNpM=", + "dev": true, + "requires": { + "generate-function": "2.0.0", + "generate-object-property": "1.2.0", + "jsonpointer": "4.0.1", + "xtend": "4.0.1" + }, + "dependencies": { + "xtend": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", + "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=", + "dev": true + } + } + }, + "is-number": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz", + "integrity": "sha1-Afy7s5NGOlSPL0ZszhbezknbkI8=", + "dev": true, + "requires": { + "kind-of": "3.2.2" + } + }, + "is-path-cwd": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-1.0.0.tgz", + "integrity": "sha1-0iXsIxMuie3Tj9p2dHLmLmXxEG0=", + "dev": true + }, + "is-path-in-cwd": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-path-in-cwd/-/is-path-in-cwd-1.0.0.tgz", + "integrity": "sha1-ZHdYK4IU1gI0YJRWcAO+ip6sBNw=", + "dev": true, + "requires": { + "is-path-inside": "1.0.0" + } + }, + "is-path-inside": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-1.0.0.tgz", + "integrity": "sha1-/AbloWg/vaE95mev9xe7wQpI838=", + "dev": true, + "requires": { + "path-is-inside": "1.0.2" + } + }, + "is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "dev": true, + "requires": { + "isobject": "3.0.1" + }, + "dependencies": { + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + } + } + }, + "is-posix-bracket": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz", + "integrity": "sha1-MzTceXdDaOkvAW5vvAqI9c1ua8Q=", + "dev": true + }, + "is-primitive": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-primitive/-/is-primitive-2.0.0.tgz", + "integrity": "sha1-IHurkWOEmcB7Kt8kCkGochADRXU=", + "dev": true + }, + "is-promise": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz", + "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=", + "dev": true + }, + "is-property": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz", + "integrity": "sha1-V/4cTkhHTt1lsJkR8msc1Ald2oQ=", + "dev": true + }, + "is-regex": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.4.tgz", + "integrity": "sha1-VRdIm1RwkbCTDglWVM7SXul+lJE=", + "dev": true, + "requires": { + "has": "1.0.1" + } + }, + "is-relative": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-relative/-/is-relative-0.2.1.tgz", + "integrity": "sha1-0n9MfVFtF1+2ENuEu+7yPDvJeqU=", + "dev": true, + "requires": { + "is-unc-path": "0.1.2" + } + }, + "is-resolvable": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-resolvable/-/is-resolvable-1.0.0.tgz", + "integrity": "sha1-jfV8YeouPFAUCNEA+wE8+NbgzGI=", + "dev": true, + "requires": { + "tryit": "1.0.3" + } + }, + "is-stream": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", + "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", + "dev": true + }, + "is-subset": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-subset/-/is-subset-0.1.1.tgz", + "integrity": "sha1-ilkRfZMt4d4A8kX83TnOQ/HpOaY=", + "dev": true + }, + "is-symbol": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.1.tgz", + "integrity": "sha1-PMWfAAJRlLarLjjbrmaJJWtmBXI=", + "dev": true + }, + "is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", + "dev": true + }, + "is-unc-path": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/is-unc-path/-/is-unc-path-0.1.2.tgz", + "integrity": "sha1-arBTpyVzwQJQ/0FqOBTDUXivObk=", + "dev": true, + "requires": { + "unc-path-regex": "0.1.2" + } + }, + "is-utf8": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", + "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=", + "dev": true + }, + "is-windows": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-0.2.0.tgz", + "integrity": "sha1-3hqm1j6indJIc3tp8f+LgALSEIw=", + "dev": true + }, + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", + "dev": true + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, + "isobject": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", + "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", + "dev": true, + "requires": { + "isarray": "1.0.0" + }, + "dependencies": { + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + } + } + }, + "isomorphic-fetch": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/isomorphic-fetch/-/isomorphic-fetch-2.2.1.tgz", + "integrity": "sha1-YRrhrPFPXoH3KVB0coGf6XM1WKk=", + "dev": true, + "requires": { + "node-fetch": "1.7.1", + "whatwg-fetch": "2.0.3" + } + }, + "isstream": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", + "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", + "dev": true + }, + "istanbul-api": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/istanbul-api/-/istanbul-api-1.1.11.tgz", + "integrity": "sha1-/MC0YeKzvaceMFFVE4I4doJX2d4=", + "dev": true, + "requires": { + "async": "2.5.0", + "fileset": "2.0.3", + "istanbul-lib-coverage": "1.1.1", + "istanbul-lib-hook": "1.0.7", + "istanbul-lib-instrument": "1.7.4", + "istanbul-lib-report": "1.1.1", + "istanbul-lib-source-maps": "1.2.1", + "istanbul-reports": "1.1.1", + "js-yaml": "3.9.1", + "mkdirp": "0.5.1", + "once": "1.4.0" + }, + "dependencies": { + "js-yaml": { + "version": "3.9.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.9.1.tgz", + "integrity": "sha512-CbcG379L1e+mWBnLvHWWeLs8GyV/EMw862uLI3c+GxVyDHWZcjZinwuBd3iW2pgxgIlksW/1vNJa4to+RvDOww==", + "dev": true, + "requires": { + "argparse": "1.0.9", + "esprima": "4.0.0" + } + } + } + }, + "istanbul-lib-coverage": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-1.1.1.tgz", + "integrity": "sha512-0+1vDkmzxqJIn5rcoEqapSB4DmPxE31EtI2dF2aCkV5esN9EWHxZ0dwgDClivMXJqE7zaYQxq30hj5L0nlTN5Q==", + "dev": true + }, + "istanbul-lib-hook": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/istanbul-lib-hook/-/istanbul-lib-hook-1.0.7.tgz", + "integrity": "sha512-3U2HB9y1ZV9UmFlE12Fx+nPtFqIymzrqCksrXujm3NVbAZIJg/RfYgO1XiIa0mbmxTjWpVEVlkIZJ25xVIAfkQ==", + "dev": true, + "requires": { + "append-transform": "0.4.0" + } + }, + "istanbul-lib-instrument": { + "version": "1.7.4", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-1.7.4.tgz", + "integrity": "sha1-6f2SDkdn89Ge3HZeLWs/XMvQ7qg=", + "dev": true, + "requires": { + "babel-generator": "6.25.0", + "babel-template": "6.25.0", + "babel-traverse": "6.25.0", + "babel-types": "6.25.0", + "babylon": "6.17.4", + "istanbul-lib-coverage": "1.1.1", + "semver": "5.4.1" + }, + "dependencies": { + "semver": { + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.4.1.tgz", + "integrity": "sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg==", + "dev": true + } + } + }, + "istanbul-lib-report": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-1.1.1.tgz", + "integrity": "sha512-tvF+YmCmH4thnez6JFX06ujIA19WPa9YUiwjc1uALF2cv5dmE3It8b5I8Ob7FHJ70H9Y5yF+TDkVa/mcADuw1Q==", + "dev": true, + "requires": { + "istanbul-lib-coverage": "1.1.1", + "mkdirp": "0.5.1", + "path-parse": "1.0.5", + "supports-color": "3.2.3" + }, + "dependencies": { + "has-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", + "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=", + "dev": true + }, + "supports-color": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.2.3.tgz", + "integrity": "sha1-ZawFBLOVQXHYpklGsq48u4pfVPY=", + "dev": true, + "requires": { + "has-flag": "1.0.0" + } + } + } + }, + "istanbul-lib-source-maps": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-1.2.1.tgz", + "integrity": "sha512-mukVvSXCn9JQvdJl8wP/iPhqig0MRtuWuD4ZNKo6vB2Ik//AmhAKe3QnPN02dmkRe3lTudFk3rzoHhwU4hb94w==", + "dev": true, + "requires": { + "debug": "2.6.8", + "istanbul-lib-coverage": "1.1.1", + "mkdirp": "0.5.1", + "rimraf": "2.6.1", + "source-map": "0.5.6" + } + }, + "istanbul-reports": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-1.1.1.tgz", + "integrity": "sha512-P8G873A0kW24XRlxHVGhMJBhQ8gWAec+dae7ZxOBzxT4w+a9ATSPvRVK3LB1RAJ9S8bg2tOyWHAGW40Zd2dKfw==", + "dev": true, + "requires": { + "handlebars": "4.0.10" + } + }, + "jest-changed-files": { + "version": "20.0.3", + "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-20.0.3.tgz", + "integrity": "sha1-k5TVzGXEOEBhSb7xv01Sto4D4/g=", + "dev": true + }, + "jest-cli": { + "version": "20.0.4", + "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-20.0.4.tgz", + "integrity": "sha1-5TKxnYiuW8bEF+iwWTpv6VSx3JM=", + "dev": true, + "requires": { + "ansi-escapes": "1.4.0", + "callsites": "2.0.0", + "chalk": "1.1.3", + "graceful-fs": "4.1.11", + "is-ci": "1.0.10", + "istanbul-api": "1.1.11", + "istanbul-lib-coverage": "1.1.1", + "istanbul-lib-instrument": "1.7.4", + "istanbul-lib-source-maps": "1.2.1", + "jest-changed-files": "20.0.3", + "jest-config": "20.0.4", + "jest-docblock": "20.0.3", + "jest-environment-jsdom": "20.0.3", + "jest-haste-map": "20.0.4", + "jest-jasmine2": "20.0.4", + "jest-message-util": "20.0.3", + "jest-regex-util": "20.0.3", + "jest-resolve-dependencies": "20.0.3", + "jest-runtime": "20.0.4", + "jest-snapshot": "20.0.3", + "jest-util": "20.0.3", + "micromatch": "2.3.11", + "node-notifier": "5.1.2", + "pify": "2.3.0", + "slash": "1.0.0", + "string-length": "1.0.1", + "throat": "3.2.0", + "which": "1.3.0", + "worker-farm": "1.4.1", + "yargs": "7.1.0" + }, + "dependencies": { + "ansi-escapes": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-1.4.0.tgz", + "integrity": "sha1-06ioOzGapneTZisT52HHkRQiMG4=", + "dev": true + }, + "callsites": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-2.0.0.tgz", + "integrity": "sha1-BuuE8A7qQT2oav/vrL/7Ngk7PFA=", + "dev": true + }, + "camelcase": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz", + "integrity": "sha1-MvxLn82vhF/N9+c7uXysImHwqwo=", + "dev": true + }, + "cliui": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", + "integrity": "sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0=", + "dev": true, + "requires": { + "string-width": "1.0.2", + "strip-ansi": "3.0.1", + "wrap-ansi": "2.1.0" + } + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "dev": true, + "requires": { + "number-is-nan": "1.0.1" + } + }, + "string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "dev": true, + "requires": { + "code-point-at": "1.1.0", + "is-fullwidth-code-point": "1.0.0", + "strip-ansi": "3.0.1" + } + }, + "yargs": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-7.1.0.tgz", + "integrity": "sha1-a6MY6xaWFyf10oT46gA+jWFU0Mg=", + "dev": true, + "requires": { + "camelcase": "3.0.0", + "cliui": "3.2.0", + "decamelize": "1.2.0", + "get-caller-file": "1.0.2", + "os-locale": "1.4.0", + "read-pkg-up": "1.0.1", + "require-directory": "2.1.1", + "require-main-filename": "1.0.1", + "set-blocking": "2.0.0", + "string-width": "1.0.2", + "which-module": "1.0.0", + "y18n": "3.2.1", + "yargs-parser": "5.0.0" + } + } + } + }, + "jest-config": { + "version": "20.0.4", + "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-20.0.4.tgz", + "integrity": "sha1-43kwqyIXyRNgXv8T5712PsSPruo=", + "dev": true, + "requires": { + "chalk": "1.1.3", + "glob": "7.1.2", + "jest-environment-jsdom": "20.0.3", + "jest-environment-node": "20.0.3", + "jest-jasmine2": "20.0.4", + "jest-matcher-utils": "20.0.3", + "jest-regex-util": "20.0.3", + "jest-resolve": "20.0.4", + "jest-validate": "20.0.3", + "pretty-format": "20.0.3" + }, + "dependencies": { + "glob": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", + "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "dev": true, + "requires": { + "fs.realpath": "1.0.0", + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" + } + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "1.1.8" + } + } + } + }, + "jest-diff": { + "version": "20.0.3", + "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-20.0.3.tgz", + "integrity": "sha1-gfKI/Z5nXw+yPHXxwrGURf5YZhc=", + "dev": true, + "requires": { + "chalk": "1.1.3", + "diff": "3.3.0", + "jest-matcher-utils": "20.0.3", + "pretty-format": "20.0.3" + } + }, + "jest-docblock": { + "version": "20.0.3", + "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-20.0.3.tgz", + "integrity": "sha1-F76phDQswz2DxQ++FUXqDvqkRxI=", + "dev": true + }, + "jest-environment-jsdom": { + "version": "20.0.3", + "resolved": "https://registry.npmjs.org/jest-environment-jsdom/-/jest-environment-jsdom-20.0.3.tgz", + "integrity": "sha1-BIqKwS7iJfcZBBdxODS7mZeH3pk=", + "dev": true, + "requires": { + "jest-mock": "20.0.3", + "jest-util": "20.0.3", + "jsdom": "9.12.0" + } + }, + "jest-environment-node": { + "version": "20.0.3", + "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-20.0.3.tgz", + "integrity": "sha1-1Ii8RhKvLCRumG6K52caCZFj1AM=", + "dev": true, + "requires": { + "jest-mock": "20.0.3", + "jest-util": "20.0.3" + } + }, + "jest-haste-map": { + "version": "20.0.4", + "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-20.0.4.tgz", + "integrity": "sha1-ZT61XIic48Ah97lGk/IKQVm63wM=", + "dev": true, + "requires": { + "fb-watchman": "2.0.0", + "graceful-fs": "4.1.11", + "jest-docblock": "20.0.3", + "micromatch": "2.3.11", + "sane": "1.6.0", + "worker-farm": "1.4.1" + } + }, + "jest-jasmine2": { + "version": "20.0.4", + "resolved": "https://registry.npmjs.org/jest-jasmine2/-/jest-jasmine2-20.0.4.tgz", + "integrity": "sha1-/MWxQReA2RHQQpAu8YWehS5g1eE=", + "dev": true, + "requires": { + "chalk": "1.1.3", + "graceful-fs": "4.1.11", + "jest-diff": "20.0.3", + "jest-matcher-utils": "20.0.3", + "jest-matchers": "20.0.3", + "jest-message-util": "20.0.3", + "jest-snapshot": "20.0.3", + "once": "1.4.0", + "p-map": "1.1.1" + } + }, + "jest-matcher-utils": { + "version": "20.0.3", + "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-20.0.3.tgz", + "integrity": "sha1-s6a443yld4A7CDKpixZPRLeBVhI=", + "dev": true, + "requires": { + "chalk": "1.1.3", + "pretty-format": "20.0.3" + } + }, + "jest-matchers": { + "version": "20.0.3", + "resolved": "https://registry.npmjs.org/jest-matchers/-/jest-matchers-20.0.3.tgz", + "integrity": "sha1-ymnbHDLbWm9wf6XgQBq7VXAN/WA=", + "dev": true, + "requires": { + "jest-diff": "20.0.3", + "jest-matcher-utils": "20.0.3", + "jest-message-util": "20.0.3", + "jest-regex-util": "20.0.3" + } + }, + "jest-message-util": { + "version": "20.0.3", + "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-20.0.3.tgz", + "integrity": "sha1-auwoRDBvyw5udNV5bBAG2W/dgxw=", + "dev": true, + "requires": { + "chalk": "1.1.3", + "micromatch": "2.3.11", + "slash": "1.0.0" + } + }, + "jest-mock": { + "version": "20.0.3", + "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-20.0.3.tgz", + "integrity": "sha1-i8Bw6QQUqhVcEajWTIaaDVxx2lk=", + "dev": true + }, + "jest-regex-util": { + "version": "20.0.3", + "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-20.0.3.tgz", + "integrity": "sha1-hburXRM+RGJbGfr4xqpRItCF12I=", + "dev": true + }, + "jest-resolve": { + "version": "20.0.4", + "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-20.0.4.tgz", + "integrity": "sha1-lEiz6La6/BVHlETGSZBFt//ll6U=", + "dev": true, + "requires": { + "browser-resolve": "1.11.2", + "is-builtin-module": "1.0.0", + "resolve": "1.4.0" + } + }, + "jest-resolve-dependencies": { + "version": "20.0.3", + "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-20.0.3.tgz", + "integrity": "sha1-bhSntxevDyyzZnxUneQK8Bexcjo=", + "dev": true, + "requires": { + "jest-regex-util": "20.0.3" + } + }, + "jest-runtime": { + "version": "20.0.4", + "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-20.0.4.tgz", + "integrity": "sha1-osgCIZxCA/dU3xQE5JAYYWnRJNg=", + "dev": true, + "requires": { + "babel-core": "6.25.0", + "babel-jest": "20.0.3", + "babel-plugin-istanbul": "4.1.4", + "chalk": "1.1.3", + "convert-source-map": "1.5.0", + "graceful-fs": "4.1.11", + "jest-config": "20.0.4", + "jest-haste-map": "20.0.4", + "jest-regex-util": "20.0.3", + "jest-resolve": "20.0.4", + "jest-util": "20.0.3", + "json-stable-stringify": "1.0.1", + "micromatch": "2.3.11", + "strip-bom": "3.0.0", + "yargs": "7.1.0" + }, + "dependencies": { + "camelcase": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz", + "integrity": "sha1-MvxLn82vhF/N9+c7uXysImHwqwo=", + "dev": true + }, + "cliui": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", + "integrity": "sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0=", + "dev": true, + "requires": { + "string-width": "1.0.2", + "strip-ansi": "3.0.1", + "wrap-ansi": "2.1.0" + } + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "dev": true, + "requires": { + "number-is-nan": "1.0.1" + } + }, + "json-stable-stringify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz", + "integrity": "sha1-mnWdOcXy/1A/1TAGRu1EX4jE+a8=", + "dev": true, + "requires": { + "jsonify": "0.0.0" + } + }, + "string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "dev": true, + "requires": { + "code-point-at": "1.1.0", + "is-fullwidth-code-point": "1.0.0", + "strip-ansi": "3.0.1" + } + }, + "strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", + "dev": true + }, + "yargs": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-7.1.0.tgz", + "integrity": "sha1-a6MY6xaWFyf10oT46gA+jWFU0Mg=", + "dev": true, + "requires": { + "camelcase": "3.0.0", + "cliui": "3.2.0", + "decamelize": "1.2.0", + "get-caller-file": "1.0.2", + "os-locale": "1.4.0", + "read-pkg-up": "1.0.1", + "require-directory": "2.1.1", + "require-main-filename": "1.0.1", + "set-blocking": "2.0.0", + "string-width": "1.0.2", + "which-module": "1.0.0", + "y18n": "3.2.1", + "yargs-parser": "5.0.0" + } + } + } + }, + "jest-snapshot": { + "version": "20.0.3", + "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-20.0.3.tgz", + "integrity": "sha1-W4R+GtsaTZCFKn+fElCG4YfHZWY=", + "dev": true, + "requires": { + "chalk": "1.1.3", + "jest-diff": "20.0.3", + "jest-matcher-utils": "20.0.3", + "jest-util": "20.0.3", + "natural-compare": "1.4.0", + "pretty-format": "20.0.3" + } + }, + "jest-util": { + "version": "20.0.3", + "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-20.0.3.tgz", + "integrity": "sha1-DAf32A2C9OWmfG+LnD/n9lz9Mq0=", + "dev": true, + "requires": { + "chalk": "1.1.3", + "graceful-fs": "4.1.11", + "jest-message-util": "20.0.3", + "jest-mock": "20.0.3", + "jest-validate": "20.0.3", + "leven": "2.1.0", + "mkdirp": "0.5.1" + } + }, + "jest-validate": { + "version": "20.0.3", + "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-20.0.3.tgz", + "integrity": "sha1-0M/R3k9XnymEhJJcKA+PHZTsPKs=", + "dev": true, + "requires": { + "chalk": "1.1.3", + "jest-matcher-utils": "20.0.3", + "leven": "2.1.0", + "pretty-format": "20.0.3" + } + }, + "js-tokens": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", + "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=", + "dev": true + }, + "js-yaml": { + "version": "3.6.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.6.1.tgz", + "integrity": "sha1-bl/mfYsgXOTSL60Ft3geja3MSzA=", + "dev": true, + "requires": { + "argparse": "1.0.9", + "esprima": "2.7.3" + }, + "dependencies": { + "esprima": { + "version": "2.7.3", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-2.7.3.tgz", + "integrity": "sha1-luO3DVd59q1JzQMmc9HDEnZ7pYE=", + "dev": true + } + } + }, + "jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", + "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", + "dev": true, + "optional": true + }, + "jschardet": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/jschardet/-/jschardet-1.5.0.tgz", + "integrity": "sha512-+Q8JsoEQbrdE+a/gg1F9XO92gcKXgpE5UACqr0sIubjDmBEkd+OOWPGzQeMrWSLxd73r4dHxBeRW7edHu5LmJQ==", + "dev": true + }, + "jsdom": { + "version": "9.12.0", + "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-9.12.0.tgz", + "integrity": "sha1-6MVG//ywbADUgzyoRBD+1/igl9Q=", + "dev": true, + "requires": { + "abab": "1.0.3", + "acorn": "4.0.13", + "acorn-globals": "3.1.0", + "array-equal": "1.0.0", + "content-type-parser": "1.0.1", + "cssom": "0.3.2", + "cssstyle": "0.2.37", + "escodegen": "1.8.1", + "html-encoding-sniffer": "1.0.1", + "nwmatcher": "1.4.1", + "parse5": "1.5.1", + "request": "2.79.0", + "sax": "1.2.4", + "symbol-tree": "3.2.2", + "tough-cookie": "2.3.2", + "webidl-conversions": "4.0.1", + "whatwg-encoding": "1.0.1", + "whatwg-url": "4.8.0", + "xml-name-validator": "2.0.1" + } + }, + "jsesc": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-1.3.0.tgz", + "integrity": "sha1-RsP+yMGJKxKwgz25vHYiF226s0s=", + "dev": true + }, + "json-schema": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", + "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=", + "dev": true + }, + "json-schema-traverse": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz", + "integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A=", + "dev": true + }, + "json-stable-stringify": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-0.0.1.tgz", + "integrity": "sha1-YRwj6BTbN1Un34URk9tZ3Sryf0U=", + "dev": true, + "requires": { + "jsonify": "0.0.0" + } + }, + "json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", + "dev": true + }, + "json5": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-0.5.1.tgz", + "integrity": "sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE=", + "dev": true + }, + "jsonify": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz", + "integrity": "sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM=", + "dev": true + }, + "jsonparse": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz", + "integrity": "sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA=", + "dev": true + }, + "jsonpointer": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/jsonpointer/-/jsonpointer-4.0.1.tgz", + "integrity": "sha1-T9kss04OnbPInIYi7PUfm5eMbLk=", + "dev": true + }, + "JSONStream": { + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-0.10.0.tgz", + "integrity": "sha1-dDSdDYlSK3HzDwoD/5vSDKbxKsA=", + "dev": true, + "requires": { + "jsonparse": "0.0.5", + "through": "2.3.8" + }, + "dependencies": { + "jsonparse": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-0.0.5.tgz", + "integrity": "sha1-MwVCrT8KZUZlt3jz6y2an6UHrGQ=", + "dev": true + } + } + }, + "jsprim": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", + "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", + "dev": true, + "requires": { + "assert-plus": "1.0.0", + "extsprintf": "1.3.0", + "json-schema": "0.2.3", + "verror": "1.10.0" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "dev": true + } + } + }, + "jstransform": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/jstransform/-/jstransform-10.1.0.tgz", + "integrity": "sha1-tMSb9j8WLBCLA0g5moc3xxOwqDo=", + "dev": true, + "requires": { + "base62": "0.1.1", + "esprima-fb": "13001.1001.0-dev-harmony-fb", + "source-map": "0.1.31" + }, + "dependencies": { + "esprima-fb": { + "version": "13001.1001.0-dev-harmony-fb", + "resolved": "https://registry.npmjs.org/esprima-fb/-/esprima-fb-13001.1001.0-dev-harmony-fb.tgz", + "integrity": "sha1-YzrNtA2b1NuKHB1owGqUKVn60rA=", + "dev": true + }, + "source-map": { + "version": "0.1.31", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.1.31.tgz", + "integrity": "sha1-n3BNDWnZ4TioG63267T94z0VHGE=", + "dev": true, + "requires": { + "amdefine": "1.0.1" + } + } + } + }, + "jsx-ast-utils": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-1.4.1.tgz", + "integrity": "sha1-OGchPo3Xm/Ho8jAMDPwe+xgsDfE=", + "dev": true + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "1.1.5" + } + }, + "labeled-stream-splicer": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/labeled-stream-splicer/-/labeled-stream-splicer-1.0.2.tgz", + "integrity": "sha1-RhUzFTd4SYHo/SZOHzpDTE4N3WU=", + "dev": true, + "requires": { + "inherits": "2.0.3", + "isarray": "0.0.1", + "stream-splicer": "1.3.2" + } + }, + "lazy-cache": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/lazy-cache/-/lazy-cache-1.0.4.tgz", + "integrity": "sha1-odePw6UEdMuAhF07O24dpJpEbo4=", + "dev": true + }, + "lazy-debug-legacy": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/lazy-debug-legacy/-/lazy-debug-legacy-0.0.1.tgz", + "integrity": "sha1-U3cWwHduTPeePtG2IfdljCkRsbE=", + "dev": true + }, + "lcid": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", + "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", + "dev": true, + "requires": { + "invert-kv": "1.0.0" + } + }, + "lcov-parse": { + "version": "0.0.10", + "resolved": "https://registry.npmjs.org/lcov-parse/-/lcov-parse-0.0.10.tgz", + "integrity": "sha1-GwuP+ayceIklBYK3C3ExXZ2m2aM=", + "dev": true + }, + "leven": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/leven/-/leven-2.1.0.tgz", + "integrity": "sha1-wuep93IJTe6dNCAq6KzORoeHVYA=", + "dev": true + }, + "levn": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", + "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", + "dev": true, + "requires": { + "prelude-ls": "1.1.2", + "type-check": "0.3.2" + } + }, + "lexical-scope": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/lexical-scope/-/lexical-scope-1.2.0.tgz", + "integrity": "sha1-/Ope3HBKSzqHls3KQZw6CvryLfQ=", + "dev": true, + "requires": { + "astw": "2.2.0" + } + }, + "liftoff": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/liftoff/-/liftoff-2.3.0.tgz", + "integrity": "sha1-qY8v9nGD2Lp8+soQVIvX/wVQs4U=", + "dev": true, + "requires": { + "extend": "3.0.1", + "findup-sync": "0.4.3", + "fined": "1.1.0", + "flagged-respawn": "0.3.2", + "lodash.isplainobject": "4.0.6", + "lodash.isstring": "4.0.1", + "lodash.mapvalues": "4.6.0", + "rechoir": "0.6.2", + "resolve": "1.4.0" + }, + "dependencies": { + "lodash.isplainobject": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", + "integrity": "sha1-fFJqUtibRcRcxpC4gWO+BJf1UMs=", + "dev": true + } + } + }, + "lint-staged": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-4.0.2.tgz", + "integrity": "sha1-joPhHp4WVsCbYRf22w1V/UlgocA=", + "dev": true, + "requires": { + "app-root-path": "2.0.1", + "cosmiconfig": "1.1.0", + "execa": "0.7.0", + "listr": "0.12.0", + "lodash.chunk": "4.2.0", + "minimatch": "3.0.4", + "npm-which": "3.0.1", + "p-map": "1.1.1", + "staged-git-files": "0.0.4" + }, + "dependencies": { + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "1.1.8" + } + } + } + }, + "listr": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/listr/-/listr-0.12.0.tgz", + "integrity": "sha1-a84sD1YD+klYDqF81qAMwOX6RRo=", + "dev": true, + "requires": { + "chalk": "1.1.3", + "cli-truncate": "0.2.1", + "figures": "1.7.0", + "indent-string": "2.1.0", + "is-promise": "2.1.0", + "is-stream": "1.1.0", + "listr-silent-renderer": "1.1.1", + "listr-update-renderer": "0.2.0", + "listr-verbose-renderer": "0.4.0", + "log-symbols": "1.0.2", + "log-update": "1.0.2", + "ora": "0.2.3", + "p-map": "1.1.1", + "rxjs": "5.4.2", + "stream-to-observable": "0.1.0", + "strip-ansi": "3.0.1" + }, + "dependencies": { + "figures": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-1.7.0.tgz", + "integrity": "sha1-y+Hjr/zxzUS4DK3+0o3Hk6lwHS4=", + "dev": true, + "requires": { + "escape-string-regexp": "1.0.5", + "object-assign": "4.1.1" + } + }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true + } + } + }, + "listr-silent-renderer": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/listr-silent-renderer/-/listr-silent-renderer-1.1.1.tgz", + "integrity": "sha1-kktaN1cVN3C/Go4/v3S4u/P5JC4=", + "dev": true + }, + "listr-update-renderer": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/listr-update-renderer/-/listr-update-renderer-0.2.0.tgz", + "integrity": "sha1-yoDhd5tOcCZoB+ju0a1qvjmFUPk=", + "dev": true, + "requires": { + "chalk": "1.1.3", + "cli-truncate": "0.2.1", + "elegant-spinner": "1.0.1", + "figures": "1.7.0", + "indent-string": "3.2.0", + "log-symbols": "1.0.2", + "log-update": "1.0.2", + "strip-ansi": "3.0.1" + }, + "dependencies": { + "figures": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-1.7.0.tgz", + "integrity": "sha1-y+Hjr/zxzUS4DK3+0o3Hk6lwHS4=", + "dev": true, + "requires": { + "escape-string-regexp": "1.0.5", + "object-assign": "4.1.1" + } + }, + "indent-string": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-3.2.0.tgz", + "integrity": "sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok=", + "dev": true + }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true + } + } + }, + "listr-verbose-renderer": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/listr-verbose-renderer/-/listr-verbose-renderer-0.4.0.tgz", + "integrity": "sha1-RNwBuww0oDxXIVTU0Izemx3FYg8=", + "dev": true, + "requires": { + "chalk": "1.1.3", + "cli-cursor": "1.0.2", + "date-fns": "1.28.5", + "figures": "1.7.0" + }, + "dependencies": { + "cli-cursor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-1.0.2.tgz", + "integrity": "sha1-ZNo/fValRBLll5S9Ytw1KV6PKYc=", + "dev": true, + "requires": { + "restore-cursor": "1.0.1" + } + }, + "figures": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-1.7.0.tgz", + "integrity": "sha1-y+Hjr/zxzUS4DK3+0o3Hk6lwHS4=", + "dev": true, + "requires": { + "escape-string-regexp": "1.0.5", + "object-assign": "4.1.1" + } + }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true + }, + "onetime": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-1.1.0.tgz", + "integrity": "sha1-ofeDj4MUxRbwXs78vEzP4EtO14k=", + "dev": true + }, + "restore-cursor": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-1.0.1.tgz", + "integrity": "sha1-NGYfRohjJ/7SmRR5FSJS35LapUE=", + "dev": true, + "requires": { + "exit-hook": "1.1.1", + "onetime": "1.1.0" + } + } + } + }, + "load-json-file": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", + "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", + "dev": true, + "requires": { + "graceful-fs": "4.1.11", + "parse-json": "2.2.0", + "pify": "2.3.0", + "pinkie-promise": "2.0.1", + "strip-bom": "2.0.0" + }, + "dependencies": { + "strip-bom": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", + "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", + "dev": true, + "requires": { + "is-utf8": "0.2.1" + } + } + } + }, + "locate-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "dev": true, + "requires": { + "p-locate": "2.0.0", + "path-exists": "3.0.0" + } + }, + "lodash": { + "version": "4.17.4", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.4.tgz", + "integrity": "sha1-eCA6TRwyiuHYbcpkYONptX9AVa4=", + "dev": true + }, + "lodash._basecopy": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/lodash._basecopy/-/lodash._basecopy-3.0.1.tgz", + "integrity": "sha1-jaDmqHbPNEwK2KVIghEd08XHyjY=", + "dev": true + }, + "lodash._basetostring": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/lodash._basetostring/-/lodash._basetostring-3.0.1.tgz", + "integrity": "sha1-0YYdh3+CSlL2aYMtyvPuFVZqB9U=", + "dev": true + }, + "lodash._basevalues": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/lodash._basevalues/-/lodash._basevalues-3.0.0.tgz", + "integrity": "sha1-W3dXYoAr3j0yl1A+JjAIIP32Ybc=", + "dev": true + }, + "lodash._escapehtmlchar": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/lodash._escapehtmlchar/-/lodash._escapehtmlchar-2.4.1.tgz", + "integrity": "sha1-32fDu2t+jh6DGrSL+geVuSr+iZ0=", + "dev": true, + "requires": { + "lodash._htmlescapes": "2.4.1" + } + }, + "lodash._escapestringchar": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/lodash._escapestringchar/-/lodash._escapestringchar-2.4.1.tgz", + "integrity": "sha1-7P4iYYoq3lC/7qQ5N+Ud9m8O23I=", + "dev": true + }, + "lodash._getnative": { + "version": "3.9.1", + "resolved": "https://registry.npmjs.org/lodash._getnative/-/lodash._getnative-3.9.1.tgz", + "integrity": "sha1-VwvH3t5G1hzc3mh9ZdPuy6o6r/U=", + "dev": true + }, + "lodash._htmlescapes": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/lodash._htmlescapes/-/lodash._htmlescapes-2.4.1.tgz", + "integrity": "sha1-MtFL8IRLbeb4tioFG09nwii2JMs=", + "dev": true + }, + "lodash._isiterateecall": { + "version": "3.0.9", + "resolved": "https://registry.npmjs.org/lodash._isiterateecall/-/lodash._isiterateecall-3.0.9.tgz", + "integrity": "sha1-UgOte6Ql+uhCRg5pbbnPPmqsBXw=", + "dev": true + }, + "lodash._isnative": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/lodash._isnative/-/lodash._isnative-2.4.1.tgz", + "integrity": "sha1-PqZAS3hKe+g2x7V1gOHN95sUgyw=", + "dev": true + }, + "lodash._objecttypes": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/lodash._objecttypes/-/lodash._objecttypes-2.4.1.tgz", + "integrity": "sha1-fAt/admKH3ZSn4kLDNsbTf7BHBE=", + "dev": true + }, + "lodash._reescape": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/lodash._reescape/-/lodash._reescape-3.0.0.tgz", + "integrity": "sha1-Kx1vXf4HyKNVdT5fJ/rH8c3hYWo=", + "dev": true + }, + "lodash._reevaluate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/lodash._reevaluate/-/lodash._reevaluate-3.0.0.tgz", + "integrity": "sha1-WLx0xAZklTrgsSTYBpltrKQx4u0=", + "dev": true + }, + "lodash._reinterpolate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz", + "integrity": "sha1-DM8tiRZq8Ds2Y8eWU4t1rG4RTZ0=", + "dev": true + }, + "lodash._reunescapedhtml": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/lodash._reunescapedhtml/-/lodash._reunescapedhtml-2.4.1.tgz", + "integrity": "sha1-dHxPxAED6zu4oJduVx96JlnpO6c=", + "dev": true, + "requires": { + "lodash._htmlescapes": "2.4.1", + "lodash.keys": "2.4.1" + }, + "dependencies": { + "lodash.keys": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/lodash.keys/-/lodash.keys-2.4.1.tgz", + "integrity": "sha1-SN6kbfj/djKxDXBrissmWR4rNyc=", + "dev": true, + "requires": { + "lodash._isnative": "2.4.1", + "lodash._shimkeys": "2.4.1", + "lodash.isobject": "2.4.1" + } + } + } + }, + "lodash._root": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/lodash._root/-/lodash._root-3.0.1.tgz", + "integrity": "sha1-+6HEUkwZ7ppfgTa0YJ8BfPTe1pI=", + "dev": true + }, + "lodash._shimkeys": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/lodash._shimkeys/-/lodash._shimkeys-2.4.1.tgz", + "integrity": "sha1-bpzJZm/wgfC1psl4uD4kLmlJ0gM=", + "dev": true, + "requires": { + "lodash._objecttypes": "2.4.1" + } + }, + "lodash.assignin": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/lodash.assignin/-/lodash.assignin-4.2.0.tgz", + "integrity": "sha1-uo31+4QesKPoBEIysOJjqNxqKKI=", + "dev": true + }, + "lodash.bind": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/lodash.bind/-/lodash.bind-4.2.1.tgz", + "integrity": "sha1-euMBfpOWIqwxt9fX3LGzTbFpDTU=", + "dev": true + }, + "lodash.chunk": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/lodash.chunk/-/lodash.chunk-4.2.0.tgz", + "integrity": "sha1-ZuXOH3btJ7QwPYxlEujRIW6BBrw=", + "dev": true + }, + "lodash.cond": { + "version": "4.5.2", + "resolved": "https://registry.npmjs.org/lodash.cond/-/lodash.cond-4.5.2.tgz", + "integrity": "sha1-9HGh2khr5g9quVXRcRVSPdHSVdU=", + "dev": true + }, + "lodash.defaults": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/lodash.defaults/-/lodash.defaults-2.4.1.tgz", + "integrity": "sha1-p+iIXwXmiFEUS24SqPNngCa8TFQ=", + "dev": true, + "requires": { + "lodash._objecttypes": "2.4.1", + "lodash.keys": "2.4.1" + }, + "dependencies": { + "lodash.keys": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/lodash.keys/-/lodash.keys-2.4.1.tgz", + "integrity": "sha1-SN6kbfj/djKxDXBrissmWR4rNyc=", + "dev": true, + "requires": { + "lodash._isnative": "2.4.1", + "lodash._shimkeys": "2.4.1", + "lodash.isobject": "2.4.1" + } + } + } + }, + "lodash.escape": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/lodash.escape/-/lodash.escape-3.2.0.tgz", + "integrity": "sha1-mV7g3BjBtIzJLv+ucaEKq1tIdpg=", + "dev": true, + "requires": { + "lodash._root": "3.0.1" + } + }, + "lodash.filter": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/lodash.filter/-/lodash.filter-4.6.0.tgz", + "integrity": "sha1-ZosdSYFgOuHMWm+nYBQ+SAtMSs4=", + "dev": true + }, + "lodash.flatten": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/lodash.flatten/-/lodash.flatten-4.4.0.tgz", + "integrity": "sha1-8xwiIlqWMtK7+OSt2+8kCqdlph8=", + "dev": true + }, + "lodash.foreach": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.foreach/-/lodash.foreach-4.5.0.tgz", + "integrity": "sha1-Gmo16s5AEoDH8G3d7DUWWrJ+PlM=", + "dev": true + }, + "lodash.isarguments": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz", + "integrity": "sha1-L1c9hcaiQon/AGY7SRwdM4/zRYo=", + "dev": true + }, + "lodash.isarray": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/lodash.isarray/-/lodash.isarray-3.0.4.tgz", + "integrity": "sha1-eeTriMNqgSKvhvhEqpvNhRtfu1U=" + }, + "lodash.isfinite": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/lodash.isfinite/-/lodash.isfinite-3.2.0.tgz", + "integrity": "sha1-qmn/uTo36C+rDOGIYmVfkXTO0zk=" + }, + "lodash.isnil": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/lodash.isnil/-/lodash.isnil-4.0.0.tgz", + "integrity": "sha1-SeKM1VkBNFjIFMVHnTxmOiG/qmw=", + "dev": true + }, + "lodash.isobject": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/lodash.isobject/-/lodash.isobject-2.4.1.tgz", + "integrity": "sha1-Wi5H/mmVPx7mMafrof5k0tBlWPU=", + "dev": true, + "requires": { + "lodash._objecttypes": "2.4.1" + } + }, + "lodash.isplainobject": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", + "integrity": "sha1-fFJqUtibRcRcxpC4gWO+BJf1UMs=", + "dev": true + }, + "lodash.isstring": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz", + "integrity": "sha1-1SfftUVuynzJu5XV2ur4i6VKVFE=", + "dev": true + }, + "lodash.keys": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/lodash.keys/-/lodash.keys-3.1.2.tgz", + "integrity": "sha1-TbwEcrFWvlCgsoaFXRvQsMZWCYo=", + "dev": true, + "requires": { + "lodash._getnative": "3.9.1", + "lodash.isarguments": "3.1.0", + "lodash.isarray": "3.0.4" + } + }, + "lodash.map": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/lodash.map/-/lodash.map-4.6.0.tgz", + "integrity": "sha1-dx7Hg540c9nEzeKLGTlMNWL09tM=", + "dev": true + }, + "lodash.mapvalues": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/lodash.mapvalues/-/lodash.mapvalues-4.6.0.tgz", + "integrity": "sha1-G6+lAF3p3W9PJmaMMMo3IwzJaJw=", + "dev": true + }, + "lodash.memoize": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-3.0.4.tgz", + "integrity": "sha1-LcvSwofLwKVcxCMovQxzYVDVPj8=", + "dev": true + }, + "lodash.merge": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.0.tgz", + "integrity": "sha1-aYhLoUSsM/5plzemCG3v+t0PicU=", + "dev": true + }, + "lodash.omitby": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/lodash.omitby/-/lodash.omitby-4.6.0.tgz", + "integrity": "sha1-XBX/R1StVVAWtTwEExHo8HkgR5E=", + "dev": true + }, + "lodash.pick": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/lodash.pick/-/lodash.pick-4.4.0.tgz", + "integrity": "sha1-UvBWEP/53tQiYRRB7R/BI6AwAbM=", + "dev": true + }, + "lodash.range": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/lodash.range/-/lodash.range-3.2.0.tgz", + "integrity": "sha1-9GHliPZmg/fq3q3lE+OKaaVloV0=", + "dev": true + }, + "lodash.reduce": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/lodash.reduce/-/lodash.reduce-4.6.0.tgz", + "integrity": "sha1-8atrg5KZrUj3hKu/R2WW8DuRTTs=", + "dev": true + }, + "lodash.reject": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/lodash.reject/-/lodash.reject-4.6.0.tgz", + "integrity": "sha1-gNZJLcFHCGS79YNTO2UfQqn1JBU=", + "dev": true + }, + "lodash.restparam": { + "version": "3.6.1", + "resolved": "https://registry.npmjs.org/lodash.restparam/-/lodash.restparam-3.6.1.tgz", + "integrity": "sha1-k2pOMJ7zMKdkXtQUWYbIWuWyCAU=", + "dev": true + }, + "lodash.some": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/lodash.some/-/lodash.some-4.6.0.tgz", + "integrity": "sha1-G7nzFO9ri63tE7VJFpsqlF62jk0=", + "dev": true + }, + "lodash.template": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/lodash.template/-/lodash.template-3.6.2.tgz", + "integrity": "sha1-+M3sxhaaJVvpCYrosMU9N4kx0U8=", + "dev": true, + "requires": { + "lodash._basecopy": "3.0.1", + "lodash._basetostring": "3.0.1", + "lodash._basevalues": "3.0.0", + "lodash._isiterateecall": "3.0.9", + "lodash._reinterpolate": "3.0.0", + "lodash.escape": "3.2.0", + "lodash.keys": "3.1.2", + "lodash.restparam": "3.6.1", + "lodash.templatesettings": "3.1.1" + } + }, + "lodash.templatesettings": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/lodash.templatesettings/-/lodash.templatesettings-3.1.1.tgz", + "integrity": "sha1-+zB4RHU7Zrnxr6VOJix0UwfbqOU=", + "dev": true, + "requires": { + "lodash._reinterpolate": "3.0.0", + "lodash.escape": "3.2.0" + } + }, + "lodash.values": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/lodash.values/-/lodash.values-2.4.1.tgz", + "integrity": "sha1-q/UUQ2s8twUAFieXjLzzCxKA7qQ=", + "dev": true, + "requires": { + "lodash.keys": "2.4.1" + }, + "dependencies": { + "lodash.keys": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/lodash.keys/-/lodash.keys-2.4.1.tgz", + "integrity": "sha1-SN6kbfj/djKxDXBrissmWR4rNyc=", + "dev": true, + "requires": { + "lodash._isnative": "2.4.1", + "lodash._shimkeys": "2.4.1", + "lodash.isobject": "2.4.1" + } + } + } + }, + "log-driver": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/log-driver/-/log-driver-1.2.5.tgz", + "integrity": "sha1-euTsJXMC/XkNVXyxDJcQDYV7AFY=", + "dev": true + }, + "log-symbols": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-1.0.2.tgz", + "integrity": "sha1-N2/3tY6jCGoPCfrMdGF+ylAeGhg=", + "dev": true, + "requires": { + "chalk": "1.1.3" + } + }, + "log-update": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/log-update/-/log-update-1.0.2.tgz", + "integrity": "sha1-GZKfZMQJPS0ucHWh2tivWcKWuNE=", + "dev": true, + "requires": { + "ansi-escapes": "1.4.0", + "cli-cursor": "1.0.2" + }, + "dependencies": { + "ansi-escapes": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-1.4.0.tgz", + "integrity": "sha1-06ioOzGapneTZisT52HHkRQiMG4=", + "dev": true + }, + "cli-cursor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-1.0.2.tgz", + "integrity": "sha1-ZNo/fValRBLll5S9Ytw1KV6PKYc=", + "dev": true, + "requires": { + "restore-cursor": "1.0.1" + } + }, + "onetime": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-1.1.0.tgz", + "integrity": "sha1-ofeDj4MUxRbwXs78vEzP4EtO14k=", + "dev": true + }, + "restore-cursor": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-1.0.1.tgz", + "integrity": "sha1-NGYfRohjJ/7SmRR5FSJS35LapUE=", + "dev": true, + "requires": { + "exit-hook": "1.1.1", + "onetime": "1.1.0" + } + } + } + }, + "longest": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz", + "integrity": "sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc=", + "dev": true + }, + "loose-envify": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.3.1.tgz", + "integrity": "sha1-0aitM/qc4OcT1l/dCsi3SNR4yEg=", + "dev": true, + "requires": { + "js-tokens": "3.0.2" + }, + "dependencies": { + "js-tokens": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", + "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=", + "dev": true + } + } + }, + "loud-rejection": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/loud-rejection/-/loud-rejection-1.6.0.tgz", + "integrity": "sha1-W0b4AUft7leIcPCG0Eghz5mOVR8=", + "dev": true, + "requires": { + "currently-unhandled": "0.4.1", + "signal-exit": "3.0.2" + } + }, + "lru-cache": { + "version": "2.7.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.7.3.tgz", + "integrity": "sha1-bUUk6LlV+V1PW1iFHOId1y+06VI=", + "dev": true + }, + "makeerror": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/makeerror/-/makeerror-1.0.11.tgz", + "integrity": "sha1-4BpckQnyr3lmDk6LlYd5AYT1qWw=", + "dev": true, + "requires": { + "tmpl": "1.0.4" + } + }, + "map-cache": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", + "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", + "dev": true + }, + "map-obj": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", + "integrity": "sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=", + "dev": true + }, + "media-typer": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=", + "dev": true + }, + "meow": { + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/meow/-/meow-3.7.0.tgz", + "integrity": "sha1-cstmi0JSKCkKu/qFaJJYcwioAfs=", + "dev": true, + "requires": { + "camelcase-keys": "2.1.0", + "decamelize": "1.2.0", + "loud-rejection": "1.6.0", + "map-obj": "1.0.1", + "minimist": "1.2.0", + "normalize-package-data": "2.4.0", + "object-assign": "4.0.1", + "read-pkg-up": "1.0.1", + "redent": "1.0.0", + "trim-newlines": "1.0.0" + } + }, + "merge": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/merge/-/merge-1.2.0.tgz", + "integrity": "sha1-dTHjnUlJwoGma4xabgJl6LBYlNo=", + "dev": true + }, + "micromatch": { + "version": "2.3.11", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz", + "integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=", + "dev": true, + "requires": { + "arr-diff": "2.0.0", + "array-unique": "0.2.1", + "braces": "1.8.5", + "expand-brackets": "0.1.5", + "extglob": "0.3.2", + "filename-regex": "2.0.1", + "is-extglob": "1.0.0", + "is-glob": "2.0.1", + "kind-of": "3.2.2", + "normalize-path": "2.1.1", + "object.omit": "2.0.1", + "parse-glob": "3.0.4", + "regex-cache": "0.4.3" + } + }, + "miller-rabin": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.0.tgz", + "integrity": "sha1-SmL7HUKTPAVYOYL0xxb2+55sbT0=", + "dev": true, + "requires": { + "bn.js": "4.11.7", + "brorand": "1.1.0" + } + }, + "mime": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.3.4.tgz", + "integrity": "sha1-EV+eO2s9rylZmDyzjxSaLUDrXVM=", + "dev": true + }, + "mime-db": { + "version": "1.29.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.29.0.tgz", + "integrity": "sha1-SNJtI1WJZRcErFkWygYAGRQmaHg=", + "dev": true + }, + "mime-types": { + "version": "2.1.16", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.16.tgz", + "integrity": "sha1-K4WKUuXs1RbbiXrCvodIeDBpjiM=", + "dev": true, + "requires": { + "mime-db": "1.29.0" + } + }, + "mimic-fn": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.1.0.tgz", + "integrity": "sha1-5md4PZLonb00KBi1IwudYqZyrRg=", + "dev": true + }, + "minimalistic-assert": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.0.tgz", + "integrity": "sha1-cCvi3aazf0g2vLP121ZkG2Sh09M=", + "dev": true + }, + "minimalistic-crypto-utils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", + "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=", + "dev": true + }, + "minimatch": { + "version": "2.0.10", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-2.0.10.tgz", + "integrity": "sha1-jQh8OcazjAAbl/ynzm0OHoCvusc=", + "dev": true, + "requires": { + "brace-expansion": "1.1.8" + } + }, + "minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "dev": true + }, + "mkdirp": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "dev": true, + "requires": { + "minimist": "0.0.8" + }, + "dependencies": { + "minimist": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "dev": true + } + } + }, + "module-deps": { + "version": "3.9.1", + "resolved": "https://registry.npmjs.org/module-deps/-/module-deps-3.9.1.tgz", + "integrity": "sha1-6nXK+RmQkNJbDVUStaysuW5/h/M=", + "dev": true, + "requires": { + "browser-resolve": "1.11.2", + "concat-stream": "1.4.10", + "defined": "1.0.0", + "detective": "4.5.0", + "duplexer2": "0.0.2", + "inherits": "2.0.3", + "JSONStream": "1.3.1", + "parents": "1.0.1", + "readable-stream": "1.1.14", + "resolve": "1.4.0", + "stream-combiner2": "1.0.2", + "subarg": "1.0.0", + "through2": "1.1.1", + "xtend": "4.0.1" + }, + "dependencies": { + "JSONStream": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.1.tgz", + "integrity": "sha1-cH92HgHa6eFvG8+TcDt4xwlmV5o=", + "dev": true, + "requires": { + "jsonparse": "1.3.1", + "through": "2.3.8" + } + }, + "xtend": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", + "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=", + "dev": true + } + } + }, + "moment": { + "version": "2.18.1", + "resolved": "https://registry.npmjs.org/moment/-/moment-2.18.1.tgz", + "integrity": "sha1-w2GT3Tzhwu7SrbfIAtu8d6gbHA8=", + "dev": true + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "multipipe": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/multipipe/-/multipipe-0.1.2.tgz", + "integrity": "sha1-Ko8t33Du1WTf8tV/HhoTfZ8FB4s=", + "dev": true, + "requires": { + "duplexer2": "0.0.2" + } + }, + "mute-stream": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz", + "integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=", + "dev": true + }, + "nan": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.6.2.tgz", + "integrity": "sha1-5P805slf37WuzAjeZZb0NgWn20U=", + "dev": true, + "optional": true + }, + "natives": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/natives/-/natives-1.1.0.tgz", + "integrity": "sha1-6f+EFBimsux6SV6TmYT3jxY+bjE=", + "dev": true + }, + "natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", + "dev": true + }, + "negotiator": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.1.tgz", + "integrity": "sha1-KzJxhOiZIQEXeyhWP7XnECrNDKk=", + "dev": true + }, + "node-fetch": { + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-1.7.1.tgz", + "integrity": "sha512-j8XsFGCLw79vWXkZtMSmmLaOk9z5SQ9bV/tkbZVCqvgwzrjAGq66igobLofHtF63NvMTp2WjytpsNTGKa+XRIQ==", + "dev": true, + "requires": { + "encoding": "0.1.12", + "is-stream": "1.1.0" + } + }, + "node-int64": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", + "integrity": "sha1-h6kGXNs1XTGC2PlM4RGIuCXGijs=", + "dev": true + }, + "node-notifier": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/node-notifier/-/node-notifier-5.1.2.tgz", + "integrity": "sha1-L6nhJgX6EACdRFSdb82KY93g5P8=", + "dev": true, + "requires": { + "growly": "1.3.0", + "semver": "5.4.1", + "shellwords": "0.1.0", + "which": "1.3.0" + }, + "dependencies": { + "semver": { + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.4.1.tgz", + "integrity": "sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg==", + "dev": true + } + } + }, + "node.extend": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/node.extend/-/node.extend-1.1.6.tgz", + "integrity": "sha1-p7iCyC1sk6SGOlUEvV3o7IYli5Y=", + "dev": true, + "requires": { + "is": "3.2.1" + } + }, + "normalize-package-data": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.4.0.tgz", + "integrity": "sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw==", + "dev": true, + "requires": { + "hosted-git-info": "2.5.0", + "is-builtin-module": "1.0.0", + "semver": "4.3.6", + "validate-npm-package-license": "3.0.1" + } + }, + "normalize-path": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", + "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", + "dev": true, + "requires": { + "remove-trailing-separator": "1.0.2" + } + }, + "npm-path": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/npm-path/-/npm-path-2.0.3.tgz", + "integrity": "sha1-Fc/04ciaONp39W9gVbJPl137K74=", + "dev": true, + "requires": { + "which": "1.3.0" + } + }, + "npm-run-path": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", + "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", + "dev": true, + "requires": { + "path-key": "2.0.1" + } + }, + "npm-which": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/npm-which/-/npm-which-3.0.1.tgz", + "integrity": "sha1-kiXybsOihcIJyuZ8OxGmtKtxQKo=", + "dev": true, + "requires": { + "commander": "2.11.0", + "npm-path": "2.0.3", + "which": "1.3.0" + } + }, + "nth-check": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-1.0.1.tgz", + "integrity": "sha1-mSms32KPwsQQmN6rgqxYDPFJquQ=", + "dev": true, + "requires": { + "boolbase": "1.0.0" + } + }, + "number-is-nan": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", + "dev": true + }, + "nwmatcher": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/nwmatcher/-/nwmatcher-1.4.1.tgz", + "integrity": "sha1-eumwew6oBNt+JfBctf5Al9TklJ8=", + "dev": true + }, + "oauth-sign": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.2.tgz", + "integrity": "sha1-Rqarfwrq2N6unsBWV4C31O/rnUM=", + "dev": true + }, + "object-assign": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.0.1.tgz", + "integrity": "sha1-mVBEVsNZi1ytT8WcJuipuxB/4L0=" + }, + "object-is": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/object-is/-/object-is-1.0.1.tgz", + "integrity": "sha1-CqYOyZiaCz7Xlc9NBvYs8a1lObY=", + "dev": true + }, + "object-keys": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.0.11.tgz", + "integrity": "sha1-xUYBd4rVYPEULODgG8yotW0TQm0=", + "dev": true + }, + "object-values": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/object-values/-/object-values-1.0.0.tgz", + "integrity": "sha1-cq+DljARnluYw7AruMJ+MjcVgQU=", + "dev": true + }, + "object.assign": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.0.4.tgz", + "integrity": "sha1-scnMBE7xuf5jYG/BQau7MuFHMMw=", + "dev": true, + "requires": { + "define-properties": "1.1.2", + "function-bind": "1.1.0", + "object-keys": "1.0.11" + } + }, + "object.defaults": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/object.defaults/-/object.defaults-1.1.0.tgz", + "integrity": "sha1-On+GgzS0B96gbaFtiNXNKeQ1/s8=", + "dev": true, + "requires": { + "array-each": "1.0.1", + "array-slice": "1.0.0", + "for-own": "1.0.0", + "isobject": "3.0.1" + }, + "dependencies": { + "for-own": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/for-own/-/for-own-1.0.0.tgz", + "integrity": "sha1-xjMy9BXO3EsE2/5wz4NklMU8tEs=", + "dev": true, + "requires": { + "for-in": "1.0.2" + } + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + } + } + }, + "object.entries": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/object.entries/-/object.entries-1.0.4.tgz", + "integrity": "sha1-G/mk3SKI9bM/Opk9JXZh8F0WGl8=", + "dev": true, + "requires": { + "define-properties": "1.1.2", + "es-abstract": "1.8.0", + "function-bind": "1.1.0", + "has": "1.0.1" + } + }, + "object.omit": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.1.tgz", + "integrity": "sha1-Gpx0SCnznbuFjHbKNXmuKlTr0fo=", + "dev": true, + "requires": { + "for-own": "0.1.5", + "is-extendable": "0.1.1" + } + }, + "object.pick": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.2.0.tgz", + "integrity": "sha1-tTkr7peC2m2ft9avr1OXefEjTCs=", + "dev": true, + "requires": { + "isobject": "2.1.0" + } + }, + "object.values": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.0.4.tgz", + "integrity": "sha1-5STaCbT2b/Bd9FdUbscqyZ8TBpo=", + "dev": true, + "requires": { + "define-properties": "1.1.2", + "es-abstract": "1.8.0", + "function-bind": "1.1.0", + "has": "1.0.1" + } + }, + "on-finished": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", + "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", + "dev": true, + "requires": { + "ee-first": "1.1.1" + } + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "requires": { + "wrappy": "1.0.2" + } + }, + "onetime": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", + "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=", + "dev": true, + "requires": { + "mimic-fn": "1.1.0" + } + }, + "open": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/open/-/open-0.0.5.tgz", + "integrity": "sha1-QsPhjslUZra/DcQvOilFw/DK2Pw=", + "dev": true + }, + "optimist": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz", + "integrity": "sha1-2j6nRob6IaGaERwybpDrFaAZZoY=", + "dev": true, + "requires": { + "minimist": "0.0.10", + "wordwrap": "0.0.2" + }, + "dependencies": { + "minimist": { + "version": "0.0.10", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz", + "integrity": "sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8=", + "dev": true + } + } + }, + "optionator": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz", + "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=", + "dev": true, + "requires": { + "deep-is": "0.1.3", + "fast-levenshtein": "2.0.6", + "levn": "0.3.0", + "prelude-ls": "1.1.2", + "type-check": "0.3.2", + "wordwrap": "1.0.0" + }, + "dependencies": { + "wordwrap": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", + "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", + "dev": true + } + } + }, + "ora": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/ora/-/ora-0.2.3.tgz", + "integrity": "sha1-N1J9Igrc1Tw5tzVx11QVbV22V6Q=", + "dev": true, + "requires": { + "chalk": "1.1.3", + "cli-cursor": "1.0.2", + "cli-spinners": "0.1.2", + "object-assign": "4.0.1" + }, + "dependencies": { + "cli-cursor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-1.0.2.tgz", + "integrity": "sha1-ZNo/fValRBLll5S9Ytw1KV6PKYc=", + "dev": true, + "requires": { + "restore-cursor": "1.0.1" + } + }, + "onetime": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-1.1.0.tgz", + "integrity": "sha1-ofeDj4MUxRbwXs78vEzP4EtO14k=", + "dev": true + }, + "restore-cursor": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-1.0.1.tgz", + "integrity": "sha1-NGYfRohjJ/7SmRR5FSJS35LapUE=", + "dev": true, + "requires": { + "exit-hook": "1.1.1", + "onetime": "1.1.0" + } + } + } + }, + "orchestrator": { + "version": "0.3.8", + "resolved": "https://registry.npmjs.org/orchestrator/-/orchestrator-0.3.8.tgz", + "integrity": "sha1-FOfp4nZPcxX7rBhOUGx6pt+UrX4=", + "dev": true, + "requires": { + "end-of-stream": "0.1.5", + "sequencify": "0.0.7", + "stream-consume": "0.1.0" + } + }, + "ordered-read-streams": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/ordered-read-streams/-/ordered-read-streams-0.1.0.tgz", + "integrity": "sha1-/VZamvjrRHO6abbtijQ1LLVS8SY=", + "dev": true + }, + "os-browserify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.1.2.tgz", + "integrity": "sha1-ScoCk+CxlZCl9d4Qx/JlphfY/lQ=", + "dev": true + }, + "os-homedir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", + "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", + "dev": true + }, + "os-locale": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz", + "integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=", + "dev": true, + "requires": { + "lcid": "1.0.0" + } + }, + "os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", + "dev": true + }, + "outpipe": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/outpipe/-/outpipe-1.1.1.tgz", + "integrity": "sha1-UM+GFjZeh+Ax4ppeyTOaPaRyX6I=", + "dev": true, + "requires": { + "shell-quote": "1.6.1" + }, + "dependencies": { + "shell-quote": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.6.1.tgz", + "integrity": "sha1-9HgZSczkAmlxJ0MOo7PFR29IF2c=", + "dev": true, + "requires": { + "array-filter": "0.0.1", + "array-map": "0.0.0", + "array-reduce": "0.0.0", + "jsonify": "0.0.0" + } + } + } + }, + "p-finally": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", + "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", + "dev": true + }, + "p-limit": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.1.0.tgz", + "integrity": "sha1-sH/y2aXYi+yAYDWJWiurZqJ5iLw=", + "dev": true + }, + "p-locate": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "dev": true, + "requires": { + "p-limit": "1.1.0" + } + }, + "p-map": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-1.1.1.tgz", + "integrity": "sha1-BfXkrpegaDcbwqXMhr+9vBnErno=", + "dev": true + }, + "pako": { + "version": "0.2.9", + "resolved": "https://registry.npmjs.org/pako/-/pako-0.2.9.tgz", + "integrity": "sha1-8/dSL073gjSNqBYbrZ7P1Rv4OnU=", + "dev": true + }, + "parents": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parents/-/parents-1.0.1.tgz", + "integrity": "sha1-/t1NK/GTp3dF/nHjcdc8MwfZx1E=", + "dev": true, + "requires": { + "path-platform": "0.11.15" + } + }, + "parse-asn1": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.0.tgz", + "integrity": "sha1-N8T5t+06tlx0gXtfJICTf7+XxxI=", + "dev": true, + "requires": { + "asn1.js": "4.9.1", + "browserify-aes": "1.0.6", + "create-hash": "1.1.3", + "evp_bytestokey": "1.0.0", + "pbkdf2": "3.0.13" + } + }, + "parse-filepath": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parse-filepath/-/parse-filepath-1.0.1.tgz", + "integrity": "sha1-FZ1hVdQ5BNFsEO9piRHaHpGWm3M=", + "dev": true, + "requires": { + "is-absolute": "0.2.6", + "map-cache": "0.2.2", + "path-root": "0.1.1" + } + }, + "parse-glob": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz", + "integrity": "sha1-ssN2z7EfNVE7rdFz7wu246OIORw=", + "dev": true, + "requires": { + "glob-base": "0.3.0", + "is-dotfile": "1.0.3", + "is-extglob": "1.0.0", + "is-glob": "2.0.1" + } + }, + "parse-json": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", + "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", + "dev": true, + "requires": { + "error-ex": "1.3.1" + } + }, + "parse-passwd": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz", + "integrity": "sha1-bVuTSkVpk7I9N/QKOC1vFmao5cY=", + "dev": true + }, + "parse5": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-1.5.1.tgz", + "integrity": "sha1-m387DeMr543CQBsXVzzK8Pb1nZQ=", + "dev": true + }, + "parseurl": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.1.tgz", + "integrity": "sha1-yKuMkiO6NIiKpkopeyiFO+wY2lY=", + "dev": true + }, + "path-browserify": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-0.0.0.tgz", + "integrity": "sha1-oLhwcpquIUAFt9UDLsLLuw+0RRo=", + "dev": true + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true + }, + "path-is-inside": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", + "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=", + "dev": true + }, + "path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", + "dev": true + }, + "path-parse": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.5.tgz", + "integrity": "sha1-PBrfhx6pzWyUMbbqK9dKD/BVxME=", + "dev": true + }, + "path-platform": { + "version": "0.11.15", + "resolved": "https://registry.npmjs.org/path-platform/-/path-platform-0.11.15.tgz", + "integrity": "sha1-6GQhf3TDaFDwhSt43Hv31KVyG/I=", + "dev": true + }, + "path-root": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/path-root/-/path-root-0.1.1.tgz", + "integrity": "sha1-mkpoFMrBwM1zNgqV8yCDyOpHRbc=", + "dev": true, + "requires": { + "path-root-regex": "0.1.2" + } + }, + "path-root-regex": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/path-root-regex/-/path-root-regex-0.1.2.tgz", + "integrity": "sha1-v8zcjfWxLcUsi0PsONGNcsBLqW0=", + "dev": true + }, + "path-type": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", + "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=", + "dev": true, + "requires": { + "graceful-fs": "4.1.11", + "pify": "2.3.0", + "pinkie-promise": "2.0.1" + } + }, + "pbkdf2": { + "version": "3.0.13", + "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.0.13.tgz", + "integrity": "sha512-+dCHxDH+djNtjgWmvVC/my3SYBAKpKNqKSjLkp+GtWWYe4XPE+e/PSD2aCanlEZZnqPk2uekTKNC/ccbwd2X2Q==", + "dev": true, + "requires": { + "create-hash": "1.1.3", + "create-hmac": "1.1.6", + "ripemd160": "2.0.1", + "safe-buffer": "5.1.1", + "sha.js": "2.4.8" + } + }, + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true + }, + "pinkie": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", + "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", + "dev": true + }, + "pinkie-promise": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", + "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", + "dev": true, + "requires": { + "pinkie": "2.0.4" + } + }, + "pkg-dir": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-1.0.0.tgz", + "integrity": "sha1-ektQio1bstYp1EcFb/TpyTFM89Q=", + "dev": true, + "requires": { + "find-up": "1.1.2" + } + }, + "pluralize": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-4.0.0.tgz", + "integrity": "sha1-WbcIwcAZCi9pLxx2GMRGsFL9F2I=", + "dev": true + }, + "prelude-ls": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", + "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", + "dev": true + }, + "preserve": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/preserve/-/preserve-0.2.0.tgz", + "integrity": "sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks=", + "dev": true + }, + "prettier": { + "version": "1.5.3", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.5.3.tgz", + "integrity": "sha1-WdrcaDNF7GuI+IuU7Urn4do5S/4=", + "dev": true + }, + "pretty-bytes": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-3.0.1.tgz", + "integrity": "sha1-J9AAjXeAY6C0gRuzXHnxvV1fvM8=", + "dev": true, + "requires": { + "number-is-nan": "1.0.1" + } + }, + "pretty-format": { + "version": "20.0.3", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-20.0.3.tgz", + "integrity": "sha1-Ag41ClYKH+GpjcO+tsz/s4beixQ=", + "dev": true, + "requires": { + "ansi-regex": "2.1.1", + "ansi-styles": "3.2.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", + "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", + "dev": true, + "requires": { + "color-convert": "1.9.0" + } + } + } + }, + "pretty-hrtime": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz", + "integrity": "sha1-t+PqQkNaTJsnWdmeDyAesZWALuE=", + "dev": true + }, + "private": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/private/-/private-0.1.7.tgz", + "integrity": "sha1-aM5eih7woju1cMwoU3tTMqumPvE=", + "dev": true + }, + "process": { + "version": "0.10.1", + "resolved": "https://registry.npmjs.org/process/-/process-0.10.1.tgz", + "integrity": "sha1-hCRXzFHP7XLcd1r+6vuMYDQ3JyU=", + "dev": true + }, + "process-nextick-args": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz", + "integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M=", + "dev": true + }, + "progress": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.0.tgz", + "integrity": "sha1-ihvjZr+Pwj2yvSPxDG/pILQ4nR8=", + "dev": true + }, + "promise": { + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/promise/-/promise-7.3.1.tgz", + "integrity": "sha512-nolQXZ/4L+bP/UGlkfaIujX9BKxGwmQ9OT4mOt5yvy8iK1h3wqTEJCijzGANTCCl9nWjY41juyAn2K3Q1hLLTg==", + "dev": true, + "requires": { + "asap": "2.0.6" + } + }, + "prop-types": { + "version": "15.5.10", + "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.5.10.tgz", + "integrity": "sha1-J5ffwxJhguOpXj37suiT3ddFYVQ=", + "dev": true, + "requires": { + "fbjs": "0.8.14", + "loose-envify": "1.3.1" + } + }, + "proxy-middleware": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/proxy-middleware/-/proxy-middleware-0.5.1.tgz", + "integrity": "sha1-2iTV1Ywd3xPa0jfH7KUDhJ6uqQM=", + "dev": true + }, + "prr": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/prr/-/prr-0.0.0.tgz", + "integrity": "sha1-GoS4WQgyVQFBGFPQCB7j+obikmo=", + "dev": true + }, + "pseudomap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", + "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=", + "dev": true + }, + "public-encrypt": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.0.tgz", + "integrity": "sha1-OfaZ86RlYN1eusvKaTyvfGXBjMY=", + "dev": true, + "requires": { + "bn.js": "4.11.7", + "browserify-rsa": "4.0.1", + "create-hash": "1.1.3", + "parse-asn1": "5.1.0", + "randombytes": "2.0.5" + } + }, + "punycode": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.2.4.tgz", + "integrity": "sha1-VACKyXKux0F13vnLpt9/qdORh0A=", + "dev": true + }, + "qs": { + "version": "6.3.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.3.2.tgz", + "integrity": "sha1-51vV9uJoEioqDgvaYwslUMFmUCw=", + "dev": true + }, + "querystring": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", + "integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=", + "dev": true + }, + "querystring-es3": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/querystring-es3/-/querystring-es3-0.2.1.tgz", + "integrity": "sha1-nsYfeQSYdXB9aUFFlv2Qek1xHnM=", + "dev": true + }, + "randomatic": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-1.1.7.tgz", + "integrity": "sha512-D5JUjPyJbaJDkuAazpVnSfVkLlpeO3wDlPROTMLGKG1zMFNFRgrciKo1ltz/AzNTkqE0HzDx655QOL51N06how==", + "dev": true, + "requires": { + "is-number": "3.0.0", + "kind-of": "4.0.0" + }, + "dependencies": { + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "requires": { + "kind-of": "3.2.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "1.1.5" + } + } + } + }, + "kind-of": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", + "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", + "dev": true, + "requires": { + "is-buffer": "1.1.5" + } + } + } + }, + "randombytes": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.0.5.tgz", + "integrity": "sha512-8T7Zn1AhMsQ/HI1SjcCfT/t4ii3eAqco3yOcSzS4mozsOz69lHLsoMXmF9nZgnFanYscnSlUSgs8uZyKzpE6kg==", + "dev": true, + "requires": { + "safe-buffer": "5.1.1" + } + }, + "range-parser": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.0.tgz", + "integrity": "sha1-9JvmtIeJTdxA3MlKMi9hEJLgDV4=", + "dev": true + }, + "raw-body": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-1.3.0.tgz", + "integrity": "sha1-l4IwoValVI9C7vFN4i0PT2EAg9E=", + "dev": true, + "requires": { + "bytes": "1.0.0", + "iconv-lite": "0.4.4" + }, + "dependencies": { + "iconv-lite": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.4.tgz", + "integrity": "sha1-6V8uQdsHNfwhZS94J6XuMuY8g6g=", + "dev": true + } + } + }, + "react-test-renderer": { + "version": "15.5.4", + "resolved": "https://registry.npmjs.org/react-test-renderer/-/react-test-renderer-15.5.4.tgz", + "integrity": "sha1-1OuyP2E9aF6o9TkBCcLSD798g7w=", + "dev": true, + "requires": { + "fbjs": "0.8.14", + "object-assign": "4.1.1" + }, + "dependencies": { + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true + } + } + }, + "read-only-stream": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/read-only-stream/-/read-only-stream-1.1.1.tgz", + "integrity": "sha1-Xad8eZ7ROI0++IoYRxu1kk+KC6E=", + "dev": true, + "requires": { + "readable-stream": "1.1.14", + "readable-wrap": "1.0.0" + } + }, + "read-pkg": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", + "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=", + "dev": true, + "requires": { + "load-json-file": "1.1.0", + "normalize-package-data": "2.4.0", + "path-type": "1.1.0" + } + }, + "read-pkg-up": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", + "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=", + "dev": true, + "requires": { + "find-up": "1.1.2", + "read-pkg": "1.1.0" + } + }, + "readable-stream": { + "version": "1.1.14", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", + "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", + "dev": true, + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "0.0.1", + "string_decoder": "0.10.31" + } + }, + "readable-wrap": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/readable-wrap/-/readable-wrap-1.0.0.tgz", + "integrity": "sha1-O1ohHGMeEjA6VJkcgGwX564ga/8=", + "dev": true, + "requires": { + "readable-stream": "1.1.14" + } + }, + "readdirp": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.1.0.tgz", + "integrity": "sha1-TtCtBg3zBzMAxIRANz9y0cxkLXg=", + "dev": true, + "requires": { + "graceful-fs": "4.1.11", + "minimatch": "3.0.4", + "readable-stream": "2.3.3", + "set-immediate-shim": "1.0.1" + }, + "dependencies": { + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "1.1.8" + } + }, + "readable-stream": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.3.tgz", + "integrity": "sha512-m+qzzcn7KUxEmd1gMbchF+Y2eIUbieUaxkWtptyHywrX0rE8QEYqPC07Vuy4Wm32/xE16NcdBctb8S0Xe/5IeQ==", + "dev": true, + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "1.0.0", + "process-nextick-args": "1.0.7", + "safe-buffer": "5.1.1", + "string_decoder": "1.0.3", + "util-deprecate": "1.0.2" + } + }, + "string_decoder": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", + "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", + "dev": true, + "requires": { + "safe-buffer": "5.1.1" + } + } + } + }, + "rechoir": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", + "integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=", + "dev": true, + "requires": { + "resolve": "1.4.0" + } + }, + "redent": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/redent/-/redent-1.0.0.tgz", + "integrity": "sha1-z5Fqsf1fHxbfsggi3W7H9zDCr94=", + "dev": true, + "requires": { + "indent-string": "2.1.0", + "strip-indent": "1.0.1" + } + }, + "regenerate": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.3.2.tgz", + "integrity": "sha1-0ZQcZ7rUN+G+dkM63Vs4X5WxkmA=", + "dev": true + }, + "regenerator-runtime": { + "version": "0.10.5", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz", + "integrity": "sha1-M2w+/BIgrc7dosn6tntaeVWjNlg=", + "dev": true + }, + "regenerator-transform": { + "version": "0.9.11", + "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.9.11.tgz", + "integrity": "sha1-On0GdSDLe3F2dp61/4aGkb7+EoM=", + "dev": true, + "requires": { + "babel-runtime": "6.25.0", + "babel-types": "6.25.0", + "private": "0.1.7" + } + }, + "regex-cache": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.3.tgz", + "integrity": "sha1-mxpsNdTQ3871cRrmUejp09cRQUU=", + "dev": true, + "requires": { + "is-equal-shallow": "0.1.3", + "is-primitive": "2.0.0" + } + }, + "regexpu-core": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-2.0.0.tgz", + "integrity": "sha1-SdA4g3uNz4v6W5pCE5k45uoq4kA=", + "dev": true, + "requires": { + "regenerate": "1.3.2", + "regjsgen": "0.2.0", + "regjsparser": "0.1.5" + } + }, + "regjsgen": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.2.0.tgz", + "integrity": "sha1-bAFq3qxVT3WCP+N6wFuS1aTtsfc=", + "dev": true + }, + "regjsparser": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.1.5.tgz", + "integrity": "sha1-fuj4Tcb6eS0/0K4ijSS9lJ6tIFw=", + "dev": true, + "requires": { + "jsesc": "0.5.0" + }, + "dependencies": { + "jsesc": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", + "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=", + "dev": true + } + } + }, + "remove-trailing-separator": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.0.2.tgz", + "integrity": "sha1-abBi2XhyetFNxrVrpKt3L9jXBRE=", + "dev": true + }, + "repeat-element": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.2.tgz", + "integrity": "sha1-7wiaF40Ug7quTZPrmLT55OEdmQo=", + "dev": true + }, + "repeat-string": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", + "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", + "dev": true + }, + "repeating": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz", + "integrity": "sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo=", + "dev": true, + "requires": { + "is-finite": "1.0.2" + } + }, + "replace-ext": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-0.0.1.tgz", + "integrity": "sha1-KbvZIHinOfC8zitO5B6DeVNSKSQ=", + "dev": true + }, + "request": { + "version": "2.79.0", + "resolved": "https://registry.npmjs.org/request/-/request-2.79.0.tgz", + "integrity": "sha1-Tf5b9r6LjNw3/Pk+BLZVd3InEN4=", + "dev": true, + "requires": { + "aws-sign2": "0.6.0", + "aws4": "1.6.0", + "caseless": "0.11.0", + "combined-stream": "1.0.5", + "extend": "3.0.1", + "forever-agent": "0.6.1", + "form-data": "2.1.4", + "har-validator": "2.0.6", + "hawk": "3.1.3", + "http-signature": "1.1.1", + "is-typedarray": "1.0.0", + "isstream": "0.1.2", + "json-stringify-safe": "5.0.1", + "mime-types": "2.1.16", + "oauth-sign": "0.8.2", + "qs": "6.3.2", + "stringstream": "0.0.5", + "tough-cookie": "2.3.2", + "tunnel-agent": "0.4.3", + "uuid": "3.1.0" + } + }, + "require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", + "dev": true + }, + "require-from-string": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-1.2.1.tgz", + "integrity": "sha1-UpyczvJzgK3+yaL5ZbZJu+5jZBg=", + "dev": true + }, + "require-main-filename": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", + "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=", + "dev": true + }, + "require-uncached": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/require-uncached/-/require-uncached-1.0.3.tgz", + "integrity": "sha1-Tg1W1slmL9MeQwEcS5WqSZVUIdM=", + "dev": true, + "requires": { + "caller-path": "0.1.0", + "resolve-from": "1.0.1" + } + }, + "resolve": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.4.0.tgz", + "integrity": "sha512-aW7sVKPufyHqOmyyLzg/J+8606v5nevBgaliIlV7nUpVMsDnoBGV/cbSLNjZAg9q0Cfd/+easKVKQ8vOu8fn1Q==", + "dev": true, + "requires": { + "path-parse": "1.0.5" + } + }, + "resolve-dir": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/resolve-dir/-/resolve-dir-0.1.1.tgz", + "integrity": "sha1-shklmlYC+sXFxJatiUpujMQwJh4=", + "dev": true, + "requires": { + "expand-tilde": "1.2.2", + "global-modules": "0.2.3" + } + }, + "resolve-from": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-1.0.1.tgz", + "integrity": "sha1-Jsv+k10a7uq7Kbw/5a6wHpPUQiY=", + "dev": true + }, + "resolve-url": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", + "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", + "dev": true + }, + "restore-cursor": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", + "integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=", + "dev": true, + "requires": { + "onetime": "2.0.1", + "signal-exit": "3.0.2" + } + }, + "right-align": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/right-align/-/right-align-0.1.3.tgz", + "integrity": "sha1-YTObci/mo1FWiSENJOFMlhSGE+8=", + "dev": true, + "requires": { + "align-text": "0.1.4" + } + }, + "rimraf": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.1.tgz", + "integrity": "sha1-wjOOxkPfeht/5cVPqG9XQopV8z0=", + "dev": true, + "requires": { + "glob": "7.1.2" + }, + "dependencies": { + "glob": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", + "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "dev": true, + "requires": { + "fs.realpath": "1.0.0", + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" + } + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "1.1.8" + } + } + } + }, + "ripemd160": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.1.tgz", + "integrity": "sha1-D0WEKVxTo2KK9+bXmsohzlfRxuc=", + "dev": true, + "requires": { + "hash-base": "2.0.2", + "inherits": "2.0.3" + } + }, + "run-async": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.3.0.tgz", + "integrity": "sha1-A3GrSuC91yDUFm19/aZP96RFpsA=", + "dev": true, + "requires": { + "is-promise": "2.1.0" + } + }, + "rx-lite": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/rx-lite/-/rx-lite-4.0.8.tgz", + "integrity": "sha1-Cx4Rr4vESDbwSmQH6S2kJGe3lEQ=", + "dev": true + }, + "rx-lite-aggregates": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/rx-lite-aggregates/-/rx-lite-aggregates-4.0.8.tgz", + "integrity": "sha1-dTuHqJoRyVRnxKwWJsTvxOBcZ74=", + "dev": true, + "requires": { + "rx-lite": "4.0.8" + } + }, + "rxjs": { + "version": "5.4.2", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-5.4.2.tgz", + "integrity": "sha1-KjI2/L8D31e64G/Wly/ZnlwI/Pc=", + "dev": true, + "requires": { + "symbol-observable": "1.0.4" + } + }, + "safe-buffer": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", + "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==", + "dev": true + }, + "sane": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/sane/-/sane-1.6.0.tgz", + "integrity": "sha1-lhDEUjB6E10pwf3+JUcDQYDEZ3U=", + "dev": true, + "requires": { + "anymatch": "1.3.2", + "exec-sh": "0.2.0", + "fb-watchman": "1.9.2", + "minimatch": "3.0.4", + "minimist": "1.2.0", + "walker": "1.0.7", + "watch": "0.10.0" + }, + "dependencies": { + "bser": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/bser/-/bser-1.0.2.tgz", + "integrity": "sha1-OBEWlwsqbe6lZG3RXdcnhES1YWk=", + "dev": true, + "requires": { + "node-int64": "0.4.0" + } + }, + "fb-watchman": { + "version": "1.9.2", + "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-1.9.2.tgz", + "integrity": "sha1-okz0eCf4LTj7Waaa1wt247auc4M=", + "dev": true, + "requires": { + "bser": "1.0.2" + } + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "1.1.8" + } + }, + "watch": { + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/watch/-/watch-0.10.0.tgz", + "integrity": "sha1-d3mLLaD5kQ1ZXxrOWwwiWFIfIdw=", + "dev": true + } + } + }, + "sax": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", + "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", + "dev": true + }, + "semver": { + "version": "4.3.6", + "resolved": "https://registry.npmjs.org/semver/-/semver-4.3.6.tgz", + "integrity": "sha1-MAvG4OhjdPe6YQaLWx7NV/xlMto=", + "dev": true + }, + "send": { + "version": "0.15.3", + "resolved": "https://registry.npmjs.org/send/-/send-0.15.3.tgz", + "integrity": "sha1-UBP5+ZAj31DRvZiSwZ4979HVMwk=", + "dev": true, + "requires": { + "debug": "2.6.7", + "depd": "1.1.0", + "destroy": "1.0.4", + "encodeurl": "1.0.1", + "escape-html": "1.0.3", + "etag": "1.8.0", + "fresh": "0.5.0", + "http-errors": "1.6.1", + "mime": "1.3.4", + "ms": "2.0.0", + "on-finished": "2.3.0", + "range-parser": "1.2.0", + "statuses": "1.3.1" + }, + "dependencies": { + "debug": { + "version": "2.6.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.7.tgz", + "integrity": "sha1-krrR9tBbu2u6Isyoi80OyJTChh4=", + "dev": true, + "requires": { + "ms": "2.0.0" + } + } + } + }, + "sequencify": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/sequencify/-/sequencify-0.0.7.tgz", + "integrity": "sha1-kM/xnQLgcCf9dn9erT57ldHnOAw=", + "dev": true + }, + "serve-index": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/serve-index/-/serve-index-1.9.0.tgz", + "integrity": "sha1-0rKA/FYNYW7oG0i/D6gqvtJIXOc=", + "dev": true, + "requires": { + "accepts": "1.3.3", + "batch": "0.6.1", + "debug": "2.6.8", + "escape-html": "1.0.3", + "http-errors": "1.6.1", + "mime-types": "2.1.16", + "parseurl": "1.3.1" + } + }, + "serve-static": { + "version": "1.12.3", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.12.3.tgz", + "integrity": "sha1-n0uhni8wMMVH+K+ZEHg47DjVseI=", + "dev": true, + "requires": { + "encodeurl": "1.0.1", + "escape-html": "1.0.3", + "parseurl": "1.3.1", + "send": "0.15.3" + } + }, + "set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", + "dev": true + }, + "set-immediate-shim": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz", + "integrity": "sha1-SysbJ+uAip+NzEgaWOXlb1mfP2E=", + "dev": true + }, + "setimmediate": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", + "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=", + "dev": true + }, + "setprototypeof": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.0.3.tgz", + "integrity": "sha1-ZlZ+NwQ+608E2RvWWMDL77VbjgQ=", + "dev": true + }, + "sha.js": { + "version": "2.4.8", + "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.8.tgz", + "integrity": "sha1-NwaMLEdra69ALRSknGf1l5IfY08=", + "dev": true, + "requires": { + "inherits": "2.0.3" + } + }, + "shallow-copy": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/shallow-copy/-/shallow-copy-0.0.1.tgz", + "integrity": "sha1-QV9CcC1z2BAzApLMXuhurhoRoXA=", + "dev": true + }, + "shasum": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/shasum/-/shasum-1.0.2.tgz", + "integrity": "sha1-5wEjENj0F/TetXEhUOVni4euVl8=", + "dev": true, + "requires": { + "json-stable-stringify": "0.0.1", + "sha.js": "2.4.8" + } + }, + "shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "dev": true, + "requires": { + "shebang-regex": "1.0.0" + } + }, + "shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", + "dev": true + }, + "shell-quote": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-0.0.1.tgz", + "integrity": "sha1-GkEZbzwDM8SCMjWT1ohuzxU92YY=", + "dev": true + }, + "shellwords": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/shellwords/-/shellwords-0.1.0.tgz", + "integrity": "sha1-Zq/Ue2oSky2Qccv9mKUueFzQuhQ=", + "dev": true + }, + "sigmund": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/sigmund/-/sigmund-1.0.1.tgz", + "integrity": "sha1-P/IfGYytIXX587eBhT/ZTQ0ZtZA=", + "dev": true + }, + "signal-exit": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", + "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", + "dev": true + }, + "slash": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-1.0.0.tgz", + "integrity": "sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU=", + "dev": true + }, + "slice-ansi": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-0.0.4.tgz", + "integrity": "sha1-7b+JA/ZvfOL46v1s7tZeJkyDGzU=", + "dev": true + }, + "sntp": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/sntp/-/sntp-1.0.9.tgz", + "integrity": "sha1-ZUEYTMkK7qbG57NeJlkIJEPGYZg=", + "dev": true, + "requires": { + "hoek": "2.16.3" + } + }, + "source-map": { + "version": "0.5.6", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.6.tgz", + "integrity": "sha1-dc449SvwczxafwwRjYEzSiu19BI=", + "dev": true + }, + "source-map-resolve": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.3.1.tgz", + "integrity": "sha1-YQ9hIqRFuN1RU1oqcbeD38Ekh2E=", + "dev": true, + "requires": { + "atob": "1.1.3", + "resolve-url": "0.2.1", + "source-map-url": "0.3.0", + "urix": "0.1.0" + } + }, + "source-map-support": { + "version": "0.4.15", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.4.15.tgz", + "integrity": "sha1-AyAt9lwG0r2MfsI2KhkwVv7407E=", + "dev": true, + "requires": { + "source-map": "0.5.6" + } + }, + "source-map-url": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.3.0.tgz", + "integrity": "sha1-fsrxO1e80J2opAxdJp2zN5nUqvk=", + "dev": true + }, + "sparkles": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/sparkles/-/sparkles-1.0.0.tgz", + "integrity": "sha1-Gsu/tZJDbRC76PeFt8xvgoFQEsM=", + "dev": true + }, + "spdx-correct": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-1.0.2.tgz", + "integrity": "sha1-SzBz2TP/UfORLwOsVRlJikFQ20A=", + "dev": true, + "requires": { + "spdx-license-ids": "1.2.2" + } + }, + "spdx-expression-parse": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-1.0.4.tgz", + "integrity": "sha1-m98vIOH0DtRH++JzJmGR/O1RYmw=", + "dev": true + }, + "spdx-license-ids": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-1.2.2.tgz", + "integrity": "sha1-yd96NCRZSt5r0RkA1ZZpbcBrrFc=", + "dev": true + }, + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "dev": true + }, + "sshpk": { + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.13.1.tgz", + "integrity": "sha1-US322mKHFEMW3EwY/hzx2UBzm+M=", + "dev": true, + "requires": { + "asn1": "0.2.3", + "assert-plus": "1.0.0", + "bcrypt-pbkdf": "1.0.1", + "dashdash": "1.14.1", + "ecc-jsbn": "0.1.1", + "getpass": "0.1.7", + "jsbn": "0.1.1", + "tweetnacl": "0.14.5" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "dev": true + } + } + }, + "staged-git-files": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/staged-git-files/-/staged-git-files-0.0.4.tgz", + "integrity": "sha1-15fhtVHKemOd7AI33G60u5vhfTU=", + "dev": true + }, + "statuses": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.3.1.tgz", + "integrity": "sha1-+vUbnrdKrvOzrPStX2Gr8ky3uT4=", + "dev": true + }, + "stream-browserify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-1.0.0.tgz", + "integrity": "sha1-v5tKv7QrJ011FHnkTg/yZWtvEZM=", + "dev": true, + "requires": { + "inherits": "2.0.3", + "readable-stream": "1.1.14" + } + }, + "stream-combiner2": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/stream-combiner2/-/stream-combiner2-1.0.2.tgz", + "integrity": "sha1-unKmtQy/q/qVD8i8h2BL0B62BnE=", + "dev": true, + "requires": { + "duplexer2": "0.0.2", + "through2": "0.5.1" + }, + "dependencies": { + "readable-stream": { + "version": "1.0.34", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", + "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", + "dev": true, + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "0.0.1", + "string_decoder": "0.10.31" + } + }, + "through2": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/through2/-/through2-0.5.1.tgz", + "integrity": "sha1-390BLrnHAOIyP9M084rGIqs3Lac=", + "dev": true, + "requires": { + "readable-stream": "1.0.34", + "xtend": "3.0.0" + } + } + } + }, + "stream-consume": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/stream-consume/-/stream-consume-0.1.0.tgz", + "integrity": "sha1-pB6tGm1ggc63n2WwYZAbbY89HQ8=", + "dev": true + }, + "stream-counter": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/stream-counter/-/stream-counter-1.0.0.tgz", + "integrity": "sha1-kc8lac5NxQYf6816yyY5SloRR1E=", + "dev": true + }, + "stream-http": { + "version": "2.7.2", + "resolved": "https://registry.npmjs.org/stream-http/-/stream-http-2.7.2.tgz", + "integrity": "sha512-c0yTD2rbQzXtSsFSVhtpvY/vS6u066PcXOX9kBB3mSO76RiUQzL340uJkGBWnlBg4/HZzqiUXtaVA7wcRcJgEw==", + "dev": true, + "requires": { + "builtin-status-codes": "3.0.0", + "inherits": "2.0.3", + "readable-stream": "2.3.3", + "to-arraybuffer": "1.0.1", + "xtend": "4.0.1" + }, + "dependencies": { + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "readable-stream": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.3.tgz", + "integrity": "sha512-m+qzzcn7KUxEmd1gMbchF+Y2eIUbieUaxkWtptyHywrX0rE8QEYqPC07Vuy4Wm32/xE16NcdBctb8S0Xe/5IeQ==", + "dev": true, + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "1.0.0", + "process-nextick-args": "1.0.7", + "safe-buffer": "5.1.1", + "string_decoder": "1.0.3", + "util-deprecate": "1.0.2" + } + }, + "string_decoder": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", + "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", + "dev": true, + "requires": { + "safe-buffer": "5.1.1" + } + }, + "xtend": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", + "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=", + "dev": true + } + } + }, + "stream-splicer": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/stream-splicer/-/stream-splicer-1.3.2.tgz", + "integrity": "sha1-PARBvhW5v04iYnXm3IOWR0VUZmE=", + "dev": true, + "requires": { + "indexof": "0.0.1", + "inherits": "2.0.3", + "isarray": "0.0.1", + "readable-stream": "1.1.14", + "readable-wrap": "1.0.0", + "through2": "1.1.1" + } + }, + "stream-to-observable": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/stream-to-observable/-/stream-to-observable-0.1.0.tgz", + "integrity": "sha1-Rb8dny19wJvtgfHDB8Qw5ouEz/4=", + "dev": true + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", + "dev": true + }, + "string-length": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/string-length/-/string-length-1.0.1.tgz", + "integrity": "sha1-VpcPscOFWOnnC3KL894mmsRa36w=", + "dev": true, + "requires": { + "strip-ansi": "3.0.1" + } + }, + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "2.0.0", + "strip-ansi": "4.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "3.0.0" + } + } + } + }, + "stringstream": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz", + "integrity": "sha1-TkhM1N5aC7vuGORjB3EKioFiGHg=", + "dev": true + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "2.1.1" + } + }, + "strip-bom": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-1.0.0.tgz", + "integrity": "sha1-hbiGLzhEtabV7IRnqTWYFzo295Q=", + "dev": true, + "requires": { + "first-chunk-stream": "1.0.0", + "is-utf8": "0.2.1" + } + }, + "strip-eof": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", + "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", + "dev": true + }, + "strip-indent": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-1.0.1.tgz", + "integrity": "sha1-DHlipq3vp7vUrDZkYKY4VSrhoKI=", + "dev": true, + "requires": { + "get-stdin": "4.0.1" + } + }, + "strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", + "dev": true + }, + "subarg": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/subarg/-/subarg-1.0.0.tgz", + "integrity": "sha1-9izxdYHplrSPyWVpn1TAauJouNI=", + "dev": true, + "requires": { + "minimist": "1.2.0" + } + }, + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", + "dev": true + }, + "symbol-observable": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-1.0.4.tgz", + "integrity": "sha1-Kb9hXUqnEhvdiYsi1LP5vE4qoD0=", + "dev": true + }, + "symbol-tree": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.2.tgz", + "integrity": "sha1-rifbOPZgp64uHDt9G8KQgZuFGeY=", + "dev": true + }, + "syntax-error": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/syntax-error/-/syntax-error-1.3.0.tgz", + "integrity": "sha1-HtkmbE1AvnXcVb+bsct3Biu5bKE=", + "dev": true, + "requires": { + "acorn": "4.0.13" + } + }, + "table": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/table/-/table-4.0.1.tgz", + "integrity": "sha1-qBFsEz+sLGH0pCCrbN9cTWHw5DU=", + "dev": true, + "requires": { + "ajv": "4.11.8", + "ajv-keywords": "1.5.1", + "chalk": "1.1.3", + "lodash": "4.17.4", + "slice-ansi": "0.0.4", + "string-width": "2.1.1" + }, + "dependencies": { + "ajv": { + "version": "4.11.8", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-4.11.8.tgz", + "integrity": "sha1-gv+wKynmYq5TvcIK8VlHcGc5xTY=", + "dev": true, + "requires": { + "co": "4.6.0", + "json-stable-stringify": "1.0.1" + } + }, + "json-stable-stringify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz", + "integrity": "sha1-mnWdOcXy/1A/1TAGRu1EX4jE+a8=", + "dev": true, + "requires": { + "jsonify": "0.0.0" + } + } + } + }, + "test-exclude": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-4.1.1.tgz", + "integrity": "sha512-35+Asrsk3XHJDBgf/VRFexPgh3UyETv8IAn/LRTiZjVy6rjPVqdEk8dJcJYBzl1w0XCJM48lvTy8SfEsCWS4nA==", + "dev": true, + "requires": { + "arrify": "1.0.1", + "micromatch": "2.3.11", + "object-assign": "4.1.1", + "read-pkg-up": "1.0.1", + "require-main-filename": "1.0.1" + }, + "dependencies": { + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true + } + } + }, + "text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", + "dev": true + }, + "throat": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/throat/-/throat-3.2.0.tgz", + "integrity": "sha512-/EY8VpvlqJ+sFtLPeOgc8Pl7kQVOWv0woD87KTXVHPIAE842FGT+rokxIhe8xIUP1cfgrkt0as0vDLjDiMtr8w==", + "dev": true + }, + "through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", + "dev": true + }, + "through2": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/through2/-/through2-1.1.1.tgz", + "integrity": "sha1-CEfLxESfNAVXTb3M2buEG4OsNUU=", + "dev": true, + "requires": { + "readable-stream": "1.1.14", + "xtend": "4.0.1" + }, + "dependencies": { + "xtend": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", + "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=", + "dev": true + } + } + }, + "tildify": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/tildify/-/tildify-1.2.0.tgz", + "integrity": "sha1-3OwD9V3Km3qj5bBPIYF+tW5jWIo=", + "dev": true, + "requires": { + "os-homedir": "1.0.2" + } + }, + "time-stamp": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/time-stamp/-/time-stamp-1.1.0.tgz", + "integrity": "sha1-dkpaEa9QVhkhsTPztE5hhofg9cM=", + "dev": true + }, + "timers-browserify": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-1.4.2.tgz", + "integrity": "sha1-ycWLV1voQHN1y14kYtrO50NZ9B0=", + "dev": true, + "requires": { + "process": "0.11.10" + }, + "dependencies": { + "process": { + "version": "0.11.10", + "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", + "integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=", + "dev": true + } + } + }, + "tiny-lr": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/tiny-lr/-/tiny-lr-0.1.4.tgz", + "integrity": "sha1-bkHX5n39CHjl4LN+N6BtZ+MJ/00=", + "dev": true, + "requires": { + "body-parser": "1.8.4", + "debug": "0.8.1", + "faye-websocket": "0.7.3", + "parseurl": "1.3.1", + "qs": "2.2.5" + }, + "dependencies": { + "debug": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-0.8.1.tgz", + "integrity": "sha1-IP9NJvXkIstoobrLu2EDmtjBwTA=", + "dev": true + }, + "qs": { + "version": "2.2.5", + "resolved": "https://registry.npmjs.org/qs/-/qs-2.2.5.tgz", + "integrity": "sha1-EIirr53MCuWuRbcJ5sa1iIsjkjw=", + "dev": true + } + } + }, + "tmp": { + "version": "0.0.31", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.31.tgz", + "integrity": "sha1-jzirlDjhcxXl29izZX6L+yd65Kc=", + "dev": true, + "requires": { + "os-tmpdir": "1.0.2" + } + }, + "tmpl": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.4.tgz", + "integrity": "sha1-I2QN17QtAEM5ERQIIOXPRA5SHdE=", + "dev": true + }, + "to-arraybuffer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz", + "integrity": "sha1-fSKbH8xjfkZsoIEYCDanqr/4P0M=", + "dev": true + }, + "to-fast-properties": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-1.0.3.tgz", + "integrity": "sha1-uDVx+k2MJbguIxsG46MFXeTKGkc=", + "dev": true + }, + "tough-cookie": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.2.tgz", + "integrity": "sha1-8IH3bkyFcg5sN6X6ztc3FQ2EByo=", + "dev": true, + "requires": { + "punycode": "1.4.1" + }, + "dependencies": { + "punycode": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", + "dev": true + } + } + }, + "tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=", + "dev": true + }, + "trim-newlines": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-1.0.0.tgz", + "integrity": "sha1-WIeWa7WCpFA6QetST301ARgVphM=", + "dev": true + }, + "trim-right": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/trim-right/-/trim-right-1.0.1.tgz", + "integrity": "sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM=", + "dev": true + }, + "tryit": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/tryit/-/tryit-1.0.3.tgz", + "integrity": "sha1-OTvnMKlEb9Hq1tpZoBQwjzbCics=", + "dev": true + }, + "tty-browserify": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.0.tgz", + "integrity": "sha1-oVe6QC2iTpv5V/mqadUk7tQpAaY=", + "dev": true + }, + "tunnel-agent": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.4.3.tgz", + "integrity": "sha1-Y3PbdpCf5XDgjXNYM2Xtgop07us=", + "dev": true + }, + "tweetnacl": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", + "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", + "dev": true, + "optional": true + }, + "type-check": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", + "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", + "dev": true, + "requires": { + "prelude-ls": "1.1.2" + } + }, + "type-is": { + "version": "1.5.7", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.5.7.tgz", + "integrity": "sha1-uTaKWTzG730GReeLL0xky+zQXpA=", + "dev": true, + "requires": { + "media-typer": "0.3.0", + "mime-types": "2.0.14" + }, + "dependencies": { + "mime-db": { + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.12.0.tgz", + "integrity": "sha1-PQxjGA9FjrENMlqqN9fFiuMS6dc=", + "dev": true + }, + "mime-types": { + "version": "2.0.14", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.0.14.tgz", + "integrity": "sha1-MQ4VnbI+B3+Lsit0jav6SVcUCqY=", + "dev": true, + "requires": { + "mime-db": "1.12.0" + } + } + } + }, + "typedarray": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", + "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", + "dev": true + }, + "ua-parser-js": { + "version": "0.7.14", + "resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-0.7.14.tgz", + "integrity": "sha1-EQ1T+kw/MmwSEpK76skE0uAzh8o=", + "dev": true + }, + "uglify-js": { + "version": "2.8.29", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.8.29.tgz", + "integrity": "sha1-KcVzMUgFe7Th913zW3qcty5qWd0=", + "dev": true, + "requires": { + "source-map": "0.5.6", + "uglify-to-browserify": "1.0.2", + "yargs": "3.10.0" + }, + "dependencies": { + "window-size": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.0.tgz", + "integrity": "sha1-VDjNLqk7IC76Ohn+iIeu58lPnJ0=", + "dev": true + }, + "yargs": { + "version": "3.10.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-3.10.0.tgz", + "integrity": "sha1-9+572FfdfB0tOMDnTvvWgdFDH9E=", + "dev": true, + "requires": { + "camelcase": "1.2.1", + "cliui": "2.1.0", + "decamelize": "1.2.0", + "window-size": "0.1.0" + } + } + } + }, + "uglify-save-license": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/uglify-save-license/-/uglify-save-license-0.4.1.tgz", + "integrity": "sha1-lXJsF8xv0XHDYX479NjYKqjEzOE=", + "dev": true + }, + "uglify-to-browserify": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz", + "integrity": "sha1-bgkk1r2mta/jSeOabWMoUKD4grc=", + "dev": true + }, + "uglifyify": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/uglifyify/-/uglifyify-3.0.1.tgz", + "integrity": "sha1-id1kZ+OjOHW3jDXYEFX1vSFxYFc=", + "dev": true, + "requires": { + "convert-source-map": "0.2.6", + "extend": "1.3.0", + "minimatch": "0.3.0", + "through": "2.3.8", + "uglify-js": "2.8.29" + }, + "dependencies": { + "convert-source-map": { + "version": "0.2.6", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-0.2.6.tgz", + "integrity": "sha1-rg7XNuimNEpYtQqJRyPeXIUd4tQ=", + "dev": true + }, + "extend": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/extend/-/extend-1.3.0.tgz", + "integrity": "sha1-0VFvsP9WJNLr+RI+odrFoZlABPg=", + "dev": true + }, + "minimatch": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.3.0.tgz", + "integrity": "sha1-J12O2qxPG7MyZHIInnlJyDlGmd0=", + "dev": true, + "requires": { + "lru-cache": "2.7.3", + "sigmund": "1.0.1" + } + } + } + }, + "umd": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/umd/-/umd-3.0.1.tgz", + "integrity": "sha1-iuVW4RAR9jwllnCKiDclnwGz1g4=", + "dev": true + }, + "unc-path-regex": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/unc-path-regex/-/unc-path-regex-0.1.2.tgz", + "integrity": "sha1-5z3T17DXxe2G+6xrCufYxqadUPo=", + "dev": true + }, + "unique-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unique-stream/-/unique-stream-1.0.0.tgz", + "integrity": "sha1-1ZpKdUJ0R9mqbJHnAmP40mpLEEs=", + "dev": true + }, + "unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=", + "dev": true + }, + "urix": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", + "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", + "dev": true + }, + "url": { + "version": "0.10.3", + "resolved": "https://registry.npmjs.org/url/-/url-0.10.3.tgz", + "integrity": "sha1-Ah5NnHcF8hu/N9A861h2dAJ3TGQ=", + "dev": true, + "requires": { + "punycode": "1.3.2", + "querystring": "0.2.0" + }, + "dependencies": { + "punycode": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", + "integrity": "sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0=", + "dev": true + } + } + }, + "user-home": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/user-home/-/user-home-1.1.1.tgz", + "integrity": "sha1-K1viOjK2Onyd640PKNSFcko98ZA=", + "dev": true + }, + "util": { + "version": "0.10.3", + "resolved": "https://registry.npmjs.org/util/-/util-0.10.3.tgz", + "integrity": "sha1-evsa/lCAUkZInj23/g7TeTNqwPk=", + "dev": true, + "requires": { + "inherits": "2.0.1" + }, + "dependencies": { + "inherits": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz", + "integrity": "sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE=", + "dev": true + } + } + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "dev": true + }, + "utils-merge": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.0.tgz", + "integrity": "sha1-ApT7kiu5N1FTVBxPcJYjHyh8ivg=", + "dev": true + }, + "uuid": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.1.0.tgz", + "integrity": "sha512-DIWtzUkw04M4k3bf1IcpS2tngXEL26YUD2M0tMDUpnUrz2hgzUBlD55a4FjdLGPvfHxS6uluGWvaVEqgBcVa+g==", + "dev": true + }, + "v8flags": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/v8flags/-/v8flags-2.1.1.tgz", + "integrity": "sha1-qrGh+jDUX4jdMhFIh1rALAtV5bQ=", + "dev": true, + "requires": { + "user-home": "1.1.1" + } + }, + "validate-npm-package-license": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.1.tgz", + "integrity": "sha1-KAS6vnEq0zeUWaz74kdGqywwP7w=", + "dev": true, + "requires": { + "spdx-correct": "1.0.2", + "spdx-expression-parse": "1.0.4" + } + }, + "verror": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", + "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", + "dev": true, + "requires": { + "assert-plus": "1.0.0", + "core-util-is": "1.0.2", + "extsprintf": "1.3.0" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "dev": true + } + } + }, + "vinyl": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-0.5.3.tgz", + "integrity": "sha1-sEVbOPxeDPMNQyUTLkYZcMIJHN4=", + "dev": true, + "requires": { + "clone": "1.0.2", + "clone-stats": "0.0.1", + "replace-ext": "0.0.1" + } + }, + "vinyl-buffer": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/vinyl-buffer/-/vinyl-buffer-1.0.0.tgz", + "integrity": "sha1-ygZ+oIQx1QdyKx3lCD9gJhbrwjQ=", + "dev": true, + "requires": { + "bl": "0.9.5", + "through2": "0.6.5" + }, + "dependencies": { + "readable-stream": { + "version": "1.0.34", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", + "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", + "dev": true, + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "0.0.1", + "string_decoder": "0.10.31" + } + }, + "through2": { + "version": "0.6.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-0.6.5.tgz", + "integrity": "sha1-QaucZ7KdVyCQcUEOHXp6lozTrUg=", + "dev": true, + "requires": { + "readable-stream": "1.0.34", + "xtend": "4.0.1" + } + }, + "xtend": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", + "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=", + "dev": true + } + } + }, + "vinyl-fs": { + "version": "0.3.14", + "resolved": "https://registry.npmjs.org/vinyl-fs/-/vinyl-fs-0.3.14.tgz", + "integrity": "sha1-mmhRzhysHBzqX+hsCTHWIMLPqeY=", + "dev": true, + "requires": { + "defaults": "1.0.3", + "glob-stream": "3.1.18", + "glob-watcher": "0.0.6", + "graceful-fs": "3.0.11", + "mkdirp": "0.5.1", + "strip-bom": "1.0.0", + "through2": "0.6.5", + "vinyl": "0.4.6" + }, + "dependencies": { + "clone": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/clone/-/clone-0.2.0.tgz", + "integrity": "sha1-xhJqkK1Pctv1rNskPMN3JP6T/B8=", + "dev": true + }, + "graceful-fs": { + "version": "3.0.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-3.0.11.tgz", + "integrity": "sha1-dhPHeKGv6mLyXGMKCG1/Osu92Bg=", + "dev": true, + "requires": { + "natives": "1.1.0" + } + }, + "readable-stream": { + "version": "1.0.34", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", + "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", + "dev": true, + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "0.0.1", + "string_decoder": "0.10.31" + } + }, + "through2": { + "version": "0.6.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-0.6.5.tgz", + "integrity": "sha1-QaucZ7KdVyCQcUEOHXp6lozTrUg=", + "dev": true, + "requires": { + "readable-stream": "1.0.34", + "xtend": "4.0.1" + } + }, + "vinyl": { + "version": "0.4.6", + "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-0.4.6.tgz", + "integrity": "sha1-LzVsh6VQolVGHza76ypbqL94SEc=", + "dev": true, + "requires": { + "clone": "0.2.0", + "clone-stats": "0.0.1" + } + }, + "xtend": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", + "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=", + "dev": true + } + } + }, + "vinyl-source-stream": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/vinyl-source-stream/-/vinyl-source-stream-1.1.0.tgz", + "integrity": "sha1-RMvlEIIFJ53rDFZTwJSiiHk4sas=", + "dev": true, + "requires": { + "through2": "0.6.5", + "vinyl": "0.4.6" + }, + "dependencies": { + "clone": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/clone/-/clone-0.2.0.tgz", + "integrity": "sha1-xhJqkK1Pctv1rNskPMN3JP6T/B8=", + "dev": true + }, + "readable-stream": { + "version": "1.0.34", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", + "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", + "dev": true, + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "0.0.1", + "string_decoder": "0.10.31" + } + }, + "through2": { + "version": "0.6.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-0.6.5.tgz", + "integrity": "sha1-QaucZ7KdVyCQcUEOHXp6lozTrUg=", + "dev": true, + "requires": { + "readable-stream": "1.0.34", + "xtend": "4.0.1" + } + }, + "vinyl": { + "version": "0.4.6", + "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-0.4.6.tgz", + "integrity": "sha1-LzVsh6VQolVGHza76ypbqL94SEc=", + "dev": true, + "requires": { + "clone": "0.2.0", + "clone-stats": "0.0.1" + } + }, + "xtend": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", + "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=", + "dev": true + } + } + }, + "vinyl-sourcemaps-apply": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/vinyl-sourcemaps-apply/-/vinyl-sourcemaps-apply-0.2.1.tgz", + "integrity": "sha1-q2VJ1h0XLCsbh75cUI0jnI74dwU=", + "dev": true, + "requires": { + "source-map": "0.5.6" + } + }, + "vm-browserify": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-0.0.4.tgz", + "integrity": "sha1-XX6kW7755Kb/ZflUOOCofDV9WnM=", + "dev": true, + "requires": { + "indexof": "0.0.1" + } + }, + "walker": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/walker/-/walker-1.0.7.tgz", + "integrity": "sha1-L3+bj9ENZ3JisYqITijRlhjgKPs=", + "dev": true, + "requires": { + "makeerror": "1.0.11" + } + }, + "watch": { + "version": "0.16.0", + "resolved": "https://registry.npmjs.org/watch/-/watch-0.16.0.tgz", + "integrity": "sha1-ly+Y6rrlYQwRb2QyRQ7qkd9oq3E=", + "dev": true, + "requires": { + "exec-sh": "0.2.0", + "minimist": "1.2.0" + } + }, + "watchify": { + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/watchify/-/watchify-3.9.0.tgz", + "integrity": "sha1-8HX9LoqGrN6Eztum5cKgvt1SPZ4=", + "dev": true, + "requires": { + "anymatch": "1.3.2", + "browserify": "14.4.0", + "chokidar": "1.7.0", + "defined": "1.0.0", + "outpipe": "1.1.1", + "through2": "2.0.3", + "xtend": "4.0.1" + }, + "dependencies": { + "assert": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/assert/-/assert-1.4.1.tgz", + "integrity": "sha1-mZEtWRg2tab1s0XA8H7vwI/GXZE=", + "dev": true, + "requires": { + "util": "0.10.3" + } + }, + "base64-js": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.2.1.tgz", + "integrity": "sha512-dwVUVIXsBZXwTuwnXI9RK8sBmgq09NDHzyR9SAph9eqk76gKK2JSQmZARC2zRC81JC2QTtxD0ARU5qTS25gIGw==", + "dev": true + }, + "browser-pack": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/browser-pack/-/browser-pack-6.0.2.tgz", + "integrity": "sha1-+GzWzvT1MAyOY+B6TVEvZfv/RTE=", + "dev": true, + "requires": { + "combine-source-map": "0.7.2", + "defined": "1.0.0", + "JSONStream": "1.3.1", + "through2": "2.0.3", + "umd": "3.0.1" + } + }, + "browserify": { + "version": "14.4.0", + "resolved": "https://registry.npmjs.org/browserify/-/browserify-14.4.0.tgz", + "integrity": "sha1-CJo0Y69Y0OSNjNQHCz90ZU1avKk=", + "dev": true, + "requires": { + "assert": "1.4.1", + "browser-pack": "6.0.2", + "browser-resolve": "1.11.2", + "browserify-zlib": "0.1.4", + "buffer": "5.0.6", + "cached-path-relative": "1.0.1", + "concat-stream": "1.5.2", + "console-browserify": "1.1.0", + "constants-browserify": "1.0.0", + "crypto-browserify": "3.11.1", + "defined": "1.0.0", + "deps-sort": "2.0.0", + "domain-browser": "1.1.7", + "duplexer2": "0.1.4", + "events": "1.1.1", + "glob": "7.1.2", + "has": "1.0.1", + "htmlescape": "1.1.1", + "https-browserify": "1.0.0", + "inherits": "2.0.3", + "insert-module-globals": "7.0.1", + "JSONStream": "1.3.1", + "labeled-stream-splicer": "2.0.0", + "module-deps": "4.1.1", + "os-browserify": "0.1.2", + "parents": "1.0.1", + "path-browserify": "0.0.0", + "process": "0.11.10", + "punycode": "1.4.1", + "querystring-es3": "0.2.1", + "read-only-stream": "2.0.0", + "readable-stream": "2.3.3", + "resolve": "1.4.0", + "shasum": "1.0.2", + "shell-quote": "1.6.1", + "stream-browserify": "2.0.1", + "stream-http": "2.7.2", + "string_decoder": "1.0.3", + "subarg": "1.0.0", + "syntax-error": "1.3.0", + "through2": "2.0.3", + "timers-browserify": "1.4.2", + "tty-browserify": "0.0.0", + "url": "0.11.0", + "util": "0.10.3", + "vm-browserify": "0.0.4", + "xtend": "4.0.1" + } + }, + "buffer": { + "version": "5.0.6", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.0.6.tgz", + "integrity": "sha1-LqZp9+7Atu2gWwj4tf9mGyhXNYg=", + "dev": true, + "requires": { + "base64-js": "1.2.1", + "ieee754": "1.1.8" + } + }, + "combine-source-map": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/combine-source-map/-/combine-source-map-0.7.2.tgz", + "integrity": "sha1-CHAxKFazB6h8xKxIbzqaYq7MwJ4=", + "dev": true, + "requires": { + "convert-source-map": "1.1.3", + "inline-source-map": "0.6.2", + "lodash.memoize": "3.0.4", + "source-map": "0.5.6" + } + }, + "concat-stream": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.5.2.tgz", + "integrity": "sha1-cIl4Yk2FavQaWnQd790mHadSwmY=", + "dev": true, + "requires": { + "inherits": "2.0.3", + "readable-stream": "2.0.6", + "typedarray": "0.0.6" + }, + "dependencies": { + "readable-stream": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.0.6.tgz", + "integrity": "sha1-j5A0HmilPMySh4jaz80Rs265t44=", + "dev": true, + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "1.0.0", + "process-nextick-args": "1.0.7", + "string_decoder": "0.10.31", + "util-deprecate": "1.0.2" + } + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", + "dev": true + } + } + }, + "constants-browserify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/constants-browserify/-/constants-browserify-1.0.0.tgz", + "integrity": "sha1-wguW2MYXdIqvHBYCF2DNJ/y4y3U=", + "dev": true + }, + "convert-source-map": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.1.3.tgz", + "integrity": "sha1-SCnId+n+SbMWHzvzZziI4gRpmGA=", + "dev": true + }, + "deps-sort": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/deps-sort/-/deps-sort-2.0.0.tgz", + "integrity": "sha1-CRckkC6EZYJg65EHSMzNGvbiH7U=", + "dev": true, + "requires": { + "JSONStream": "1.3.1", + "shasum": "1.0.2", + "subarg": "1.0.0", + "through2": "2.0.3" + } + }, + "duplexer2": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.1.4.tgz", + "integrity": "sha1-ixLauHjA1p4+eJEFFmKjL8a93ME=", + "dev": true, + "requires": { + "readable-stream": "2.3.3" + } + }, + "events": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/events/-/events-1.1.1.tgz", + "integrity": "sha1-nr23Y1rQmccNzEwqH1AEKI6L2SQ=", + "dev": true + }, + "glob": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", + "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "dev": true, + "requires": { + "fs.realpath": "1.0.0", + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" + } + }, + "https-browserify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz", + "integrity": "sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM=", + "dev": true + }, + "inline-source-map": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/inline-source-map/-/inline-source-map-0.6.2.tgz", + "integrity": "sha1-+Tk0ccGKedFyT4Y/o4tYY3Ct4qU=", + "dev": true, + "requires": { + "source-map": "0.5.6" + } + }, + "insert-module-globals": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/insert-module-globals/-/insert-module-globals-7.0.1.tgz", + "integrity": "sha1-wDv04BywhtW15azorQr+eInWOMM=", + "dev": true, + "requires": { + "combine-source-map": "0.7.2", + "concat-stream": "1.5.2", + "is-buffer": "1.1.5", + "JSONStream": "1.3.1", + "lexical-scope": "1.2.0", + "process": "0.11.10", + "through2": "2.0.3", + "xtend": "4.0.1" + } + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "JSONStream": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.1.tgz", + "integrity": "sha1-cH92HgHa6eFvG8+TcDt4xwlmV5o=", + "dev": true, + "requires": { + "jsonparse": "1.3.1", + "through": "2.3.8" + } + }, + "labeled-stream-splicer": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/labeled-stream-splicer/-/labeled-stream-splicer-2.0.0.tgz", + "integrity": "sha1-pS4dE4AkwAuGscDJH2d5GLiuClk=", + "dev": true, + "requires": { + "inherits": "2.0.3", + "isarray": "0.0.1", + "stream-splicer": "2.0.0" + }, + "dependencies": { + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", + "dev": true + } + } + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "1.1.8" + } + }, + "module-deps": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/module-deps/-/module-deps-4.1.1.tgz", + "integrity": "sha1-IyFYM/HaE/1gbMuAh7RIUty4If0=", + "dev": true, + "requires": { + "browser-resolve": "1.11.2", + "cached-path-relative": "1.0.1", + "concat-stream": "1.5.2", + "defined": "1.0.0", + "detective": "4.5.0", + "duplexer2": "0.1.4", + "inherits": "2.0.3", + "JSONStream": "1.3.1", + "parents": "1.0.1", + "readable-stream": "2.3.3", + "resolve": "1.4.0", + "stream-combiner2": "1.1.1", + "subarg": "1.0.0", + "through2": "2.0.3", + "xtend": "4.0.1" + } + }, + "process": { + "version": "0.11.10", + "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", + "integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=", + "dev": true + }, + "punycode": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", + "dev": true + }, + "read-only-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/read-only-stream/-/read-only-stream-2.0.0.tgz", + "integrity": "sha1-JyT9aoET1zdkrCiNQ4YnDB2/F/A=", + "dev": true, + "requires": { + "readable-stream": "2.3.3" + } + }, + "readable-stream": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.3.tgz", + "integrity": "sha512-m+qzzcn7KUxEmd1gMbchF+Y2eIUbieUaxkWtptyHywrX0rE8QEYqPC07Vuy4Wm32/xE16NcdBctb8S0Xe/5IeQ==", + "dev": true, + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "1.0.0", + "process-nextick-args": "1.0.7", + "safe-buffer": "5.1.1", + "string_decoder": "1.0.3", + "util-deprecate": "1.0.2" + } + }, + "shell-quote": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.6.1.tgz", + "integrity": "sha1-9HgZSczkAmlxJ0MOo7PFR29IF2c=", + "dev": true, + "requires": { + "array-filter": "0.0.1", + "array-map": "0.0.0", + "array-reduce": "0.0.0", + "jsonify": "0.0.0" + } + }, + "stream-browserify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-2.0.1.tgz", + "integrity": "sha1-ZiZu5fm9uZQKTkUUyvtDu3Hlyds=", + "dev": true, + "requires": { + "inherits": "2.0.3", + "readable-stream": "2.3.3" + } + }, + "stream-combiner2": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/stream-combiner2/-/stream-combiner2-1.1.1.tgz", + "integrity": "sha1-+02KFCDqNidk4hrUeAOXvry0HL4=", + "dev": true, + "requires": { + "duplexer2": "0.1.4", + "readable-stream": "2.3.3" + } + }, + "stream-splicer": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/stream-splicer/-/stream-splicer-2.0.0.tgz", + "integrity": "sha1-G2O+Q4oTPktnHMGTUZdgAXWRDYM=", + "dev": true, + "requires": { + "inherits": "2.0.3", + "readable-stream": "2.3.3" + } + }, + "string_decoder": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", + "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", + "dev": true, + "requires": { + "safe-buffer": "5.1.1" + } + }, + "through2": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.3.tgz", + "integrity": "sha1-AARWmzfHx0ujnEPzzteNGtlBQL4=", + "dev": true, + "requires": { + "readable-stream": "2.3.3", + "xtend": "4.0.1" + } + }, + "url": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/url/-/url-0.11.0.tgz", + "integrity": "sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE=", + "dev": true, + "requires": { + "punycode": "1.3.2", + "querystring": "0.2.0" + }, + "dependencies": { + "punycode": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", + "integrity": "sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0=", + "dev": true + } + } + }, + "xtend": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", + "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=", + "dev": true + } + } + }, + "webidl-conversions": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.1.tgz", + "integrity": "sha1-gBWherg+fhsxFjhIas6B2mziBqA=", + "dev": true + }, + "websocket-driver": { + "version": "0.6.5", + "resolved": "https://registry.npmjs.org/websocket-driver/-/websocket-driver-0.6.5.tgz", + "integrity": "sha1-XLJVbOuF9Dc8bYI4qmkchFThOjY=", + "dev": true, + "requires": { + "websocket-extensions": "0.1.1" + } + }, + "websocket-extensions": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/websocket-extensions/-/websocket-extensions-0.1.1.tgz", + "integrity": "sha1-domUmcGEtu91Q3fC27DNbLVdKec=", + "dev": true + }, + "whatwg-encoding": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-1.0.1.tgz", + "integrity": "sha1-PGxFGhmO567FWx7GHQkgxngBpfQ=", + "dev": true, + "requires": { + "iconv-lite": "0.4.13" + }, + "dependencies": { + "iconv-lite": { + "version": "0.4.13", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.13.tgz", + "integrity": "sha1-H4irpKsLFQjoMSrMOTRfNumS4vI=", + "dev": true + } + } + }, + "whatwg-fetch": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-2.0.3.tgz", + "integrity": "sha1-nITsLc9oGH/wC8ZOEnS0QhduHIQ=", + "dev": true + }, + "whatwg-url": { + "version": "4.8.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-4.8.0.tgz", + "integrity": "sha1-0pgaqRSMHgCkHFphMRZqtGg7vMA=", + "dev": true, + "requires": { + "tr46": "0.0.3", + "webidl-conversions": "3.0.1" + }, + "dependencies": { + "webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=", + "dev": true + } + } + }, + "which": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.0.tgz", + "integrity": "sha512-xcJpopdamTuY5duC/KnTTNBraPK54YwpenP4lzxU8H91GudWpFv38u0CKjclE1Wi2EH2EDz5LRcHcKbCIzqGyg==", + "dev": true, + "requires": { + "isexe": "2.0.0" + } + }, + "which-module": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-1.0.0.tgz", + "integrity": "sha1-u6Y8qGGUiZT/MHc2CJ47lgJsKk8=", + "dev": true + }, + "wordwrap": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz", + "integrity": "sha1-t5Zpu0LstAn4PVg8rVLKF+qhZD8=", + "dev": true + }, + "worker-farm": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/worker-farm/-/worker-farm-1.4.1.tgz", + "integrity": "sha512-tgFAtgOYLPutkAyzgpS6VJFL5HY+0ui1Tvua+fITgz8ByaJTMFGtazR6xxQfwfiAcbwE+2fLG/K49wc2TfwCNw==", + "dev": true, + "requires": { + "errno": "0.1.4", + "xtend": "4.0.1" + }, + "dependencies": { + "xtend": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", + "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=", + "dev": true + } + } + }, + "wrap-ansi": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", + "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", + "dev": true, + "requires": { + "string-width": "1.0.2", + "strip-ansi": "3.0.1" + }, + "dependencies": { + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "dev": true, + "requires": { + "number-is-nan": "1.0.1" + } + }, + "string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "dev": true, + "requires": { + "code-point-at": "1.1.0", + "is-fullwidth-code-point": "1.0.0", + "strip-ansi": "3.0.1" + } + } + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + }, + "write": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/write/-/write-0.2.1.tgz", + "integrity": "sha1-X8A4KOJkzqP+kUVUdvejxWbLB1c=", + "dev": true, + "requires": { + "mkdirp": "0.5.1" + } + }, + "xml-name-validator": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-2.0.1.tgz", + "integrity": "sha1-TYuPHszTQZqjYgYb7O9RXh5VljU=", + "dev": true + }, + "xtend": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-3.0.0.tgz", + "integrity": "sha1-XM50B7r2Qsunvs2laBEcST9ZZlo=", + "dev": true + }, + "y18n": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz", + "integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE=", + "dev": true + }, + "yallist": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", + "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=", + "dev": true + }, + "yargs": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-1.3.3.tgz", + "integrity": "sha1-BU3oth8i7v23IHBZ6u+da4P7kxo=", + "dev": true + }, + "yargs-parser": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-5.0.0.tgz", + "integrity": "sha1-J17PDX/+Bcd+ZOfIbkzZS/DhIoo=", + "dev": true, + "requires": { + "camelcase": "3.0.0" + }, + "dependencies": { + "camelcase": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz", + "integrity": "sha1-MvxLn82vhF/N9+c7uXysImHwqwo=", + "dev": true + } + } + } + } +} diff --git a/package.json b/package.json index 71ed769..c55c3c7 100644 --- a/package.json +++ b/package.json @@ -73,6 +73,7 @@ "eslint-config-seatgeek-standard": "5.0.0", "eslint-plugin-flowtype": "2.35.0", "eslint-plugin-react": "7.1.0", + "eslint-plugin-standard": "3.0.1", "flow-bin": "0.52.0", "gulp": "^3.8.8", "gulp-babel": "6.1.2", From 9549cd354afd41932724438d6722e38fc0f4cfb6 Mon Sep 17 00:00:00 2001 From: Gareth Tan Date: Sun, 6 Aug 2017 00:35:15 -0400 Subject: [PATCH 69/78] Touch up tests and eslint. --- __tests__/infinite_test.js | 20 +++++++++----------- cypress/.eslintrc | 8 ++++++++ cypress/integration/basic_infinite_spec.js | 11 +++++------ package.json | 4 ++-- 4 files changed, 24 insertions(+), 19 deletions(-) create mode 100644 cypress/.eslintrc diff --git a/__tests__/infinite_test.js b/__tests__/infinite_test.js index f95a8df..9bc50ad 100644 --- a/__tests__/infinite_test.js +++ b/__tests__/infinite_test.js @@ -204,8 +204,6 @@ describe('The Scrolling Behavior of the Constant Height React Infinite Component // 1600 pixels: blockEnd, end of block that scrollTop of 1500 pixels is in // 2400 pixels: windowBottom, end of first displayed element // 4000 pixels: end of bottomSpacer element - // expect(rootNode.topSpacer._style._values.height).toEqual('400px'); - // expect(rootNode.bottomSpacer._style._values.height).toEqual('1600px'); expect(mountToJson(rootNode)).toMatchSnapshot(); }); @@ -370,7 +368,7 @@ describe('The Behavior of the Variable Height React Infinite Component', functio describe("React Infinite's Infinite Scroll Capabilities", function() { it('infiniteLoadBeginEdgeOffset does not always trigger infinite load on scroll', function() { - const infiniteSpy = jasmine.createSpy('infiniteSpy'); + const infiniteSpy = jest.fn(); const elementHeight = 200; const rootNode = mount( { diff --git a/package.json b/package.json index c55c3c7..f7573df 100644 --- a/package.json +++ b/package.json @@ -22,8 +22,8 @@ "browser": "build/react-infinite.js", "scripts": { "test": "jest", - "lint": "eslint ./src --ext .jsx --ext .js", - "fix": "eslint --fix --ext .jsx --ext .js ./src ./__tests__ ./pipeline", + "lint": "eslint --ext .jsx --ext .js ./src ./__tests__ ./pipeline ./cypress", + "fix": "eslint --fix --ext .jsx --ext .js ./src ./__tests__ ./pipeline ./cypress", "typecheck": "flow version && flow check", "verify": "npm test && npm run typecheck && npm run lint", "preversion": "npm run verify", From fa40c97bc081e315f7dd97c858afa92fa1625c3e Mon Sep 17 00:00:00 2001 From: Gareth Tan Date: Sun, 6 Aug 2017 01:04:38 -0400 Subject: [PATCH 70/78] Focus on specific properties. --- __tests__/__snapshots__/infinite_test.js.snap | 186 ------------------ __tests__/infinite_test.js | 14 +- 2 files changed, 10 insertions(+), 190 deletions(-) diff --git a/__tests__/__snapshots__/infinite_test.js.snap b/__tests__/__snapshots__/infinite_test.js.snap index ef13e77..09ff4f9 100644 --- a/__tests__/__snapshots__/infinite_test.js.snap +++ b/__tests__/__snapshots__/infinite_test.js.snap @@ -1,191 +1,5 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`Maintaining React Infinite's internal scroll state has does not have pointer-events: none by default 1`] = ` -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -`; - -exports[`Maintaining React Infinite's internal scroll state has pointer-events: none upon scroll 1`] = ` -} - onInfiniteLoad={[Function]} - styles={Object {}} - timeScrollStateLastsForAfterUserScrolls={10000} - useWindowAsScrollContainer={false} -> -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - -`; - exports[`React Infinite when the window is used as the Container alters the elements displayed when a scroll has occurred 1`] = ` ); - expect(rootNode).toMatchSnapshot(); + expect( + rootNode.find('.correct-class-name').childAt(0).props().style + .pointerEvents + ).toBeUndefined(); }); it('has pointer-events: none upon scroll', function() { @@ -502,7 +505,10 @@ describe("Maintaining React Infinite's internal scroll state", function() { target: rootDomNode }); - expect(mountToJson(rootNode)).toMatchSnapshot(); + expect( + rootNode.find('.correct-class-name').childAt(0).props().style + .pointerEvents + ).toEqual('none'); }); }); From 1dcfb89139df5dd417cf8df69727f94f54fd866a Mon Sep 17 00:00:00 2001 From: Gareth Tan Date: Sun, 6 Aug 2017 01:12:56 -0400 Subject: [PATCH 71/78] Update examples. --- examples/borderless-window.html | 1 + examples/chat.html | 1 + examples/example.html | 1 + examples/window.html | 1 + 4 files changed, 4 insertions(+) diff --git a/examples/borderless-window.html b/examples/borderless-window.html index 1512286..19447c0 100644 --- a/examples/borderless-window.html +++ b/examples/borderless-window.html @@ -27,6 +27,7 @@ + diff --git a/examples/chat.html b/examples/chat.html index 633d569..c005b1f 100644 --- a/examples/chat.html +++ b/examples/chat.html @@ -27,6 +27,7 @@ + diff --git a/examples/example.html b/examples/example.html index c7f8cd4..ff8b73a 100644 --- a/examples/example.html +++ b/examples/example.html @@ -34,6 +34,7 @@ + diff --git a/examples/window.html b/examples/window.html index 1d927a1..1ea2fb6 100644 --- a/examples/window.html +++ b/examples/window.html @@ -27,6 +27,7 @@ + From 1596a17ef090de17ef24080ce63482e9efc936fb Mon Sep 17 00:00:00 2001 From: Gareth Tan Date: Sun, 6 Aug 2017 10:44:28 -0400 Subject: [PATCH 72/78] Strip prop types for production builds. --- .babelrc | 7 ++++++- config/travis/test.sh | 2 +- package-lock.json | 12 +++++++++++- package.json | 1 + 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/.babelrc b/.babelrc index a3c05ee..eb5188a 100644 --- a/.babelrc +++ b/.babelrc @@ -1,4 +1,9 @@ { "presets": ["es2015", "flow", "react"], - "plugins": ["transform-class-properties", "transform-object-rest-spread"] + "plugins": ["transform-class-properties", "transform-object-rest-spread"], + "env": { + "production": { + "plugins": ["transform-react-remove-prop-types"] + } + } } diff --git a/config/travis/test.sh b/config/travis/test.sh index 6dba768..a80905d 100755 --- a/config/travis/test.sh +++ b/config/travis/test.sh @@ -19,7 +19,7 @@ fi; if [ "$BROWSER" = 1 ]; then npm install -g cypress-cli http-server - npm install react react-dom create-react-class gulp + npm install react react-dom create-react-class prop-types gulp gulp examples http-server --silent & cypress run --record diff --git a/package-lock.json b/package-lock.json index b725636..801ea9e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -967,6 +967,15 @@ "babel-runtime": "6.25.0" } }, + "babel-plugin-transform-react-remove-prop-types": { + "version": "0.4.8", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-react-remove-prop-types/-/babel-plugin-transform-react-remove-prop-types-0.4.8.tgz", + "integrity": "sha1-Cv8EvB1lZOxJzyO8/7mcEYgZWNs=", + "dev": true, + "requires": { + "babel-traverse": "6.25.0" + } + }, "babel-plugin-transform-regenerator": { "version": "6.24.1", "resolved": "https://registry.npmjs.org/babel-plugin-transform-regenerator/-/babel-plugin-transform-regenerator-6.24.1.tgz", @@ -3212,7 +3221,8 @@ "eslint-plugin-standard": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/eslint-plugin-standard/-/eslint-plugin-standard-3.0.1.tgz", - "integrity": "sha1-NNDJFbRe3G8BA5PH7vOCOwhWXPI=" + "integrity": "sha1-NNDJFbRe3G8BA5PH7vOCOwhWXPI=", + "dev": true }, "eslint-scope": { "version": "3.7.1", diff --git a/package.json b/package.json index f7573df..087c853 100644 --- a/package.json +++ b/package.json @@ -58,6 +58,7 @@ "babel-jest": "20.0.3", "babel-plugin-transform-class-properties": "6.24.1", "babel-plugin-transform-object-rest-spread": "6.23.0", + "babel-plugin-transform-react-remove-prop-types": "0.4.8", "babel-preset-es2015": "6.24.1", "babel-preset-react": "6.24.1", "babelify": "7.3.0", From ac57ec0297c25055e84f0372b1e4450e5681e7fc Mon Sep 17 00:00:00 2001 From: Gareth Tan Date: Mon, 7 Aug 2017 10:58:56 -0400 Subject: [PATCH 73/78] Prepare new dist files. --- dist/react-infinite.js | 1976 +----------------------------------- dist/react-infinite.min.js | 3 +- 2 files changed, 17 insertions(+), 1962 deletions(-) diff --git a/dist/react-infinite.js b/dist/react-infinite.js index 4e55aff..d05b860 100644 --- a/dist/react-infinite.js +++ b/dist/react-infinite.js @@ -1,1194 +1,8 @@ (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Infinite = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o=0||Object.prototype.hasOwnProperty.call(e,o)&&(i[o]=e[o]);return i}var React=global.React||require("react"),PropTypes=global.PropTypes||require("prop-types"),createReactClass=global.createReactClass||require("create-react-class"),window=require("./utils/window");require("./utils/establish-polyfills");var scaleEnum=require("./utils/scaleEnum"),infiniteHelpers=require("./utils/infiniteHelpers"),_isFinite=require("lodash.isfinite"),preloadType=require("./utils/types").preloadType,checkProps=checkProps=require("./utils/checkProps"),Infinite=createReactClass({propTypes:{children:PropTypes.any,handleScroll:PropTypes.func,preloadBatchSize:preloadType,preloadAdditionalHeight:preloadType,elementHeight:PropTypes.oneOfType([PropTypes.number,PropTypes.arrayOf(PropTypes.number)]).isRequired,containerHeight:PropTypes.number,useWindowAsScrollContainer:PropTypes.bool,displayBottomUpwards:PropTypes.bool.isRequired,infiniteLoadBeginEdgeOffset:PropTypes.number,onInfiniteLoad:PropTypes.func,loadingSpinnerDelegate:PropTypes.node,isInfiniteLoading:PropTypes.bool,timeScrollStateLastsForAfterUserScrolls:PropTypes.number,className:PropTypes.string,styles:PropTypes.shape({scrollableStyle:PropTypes.object}).isRequired},statics:{containerHeightScaleFactor:function(e){if(!_isFinite(e))throw new Error("The scale factor must be a number.");return{type:scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR,amount:e}}},computedProps:{},utils:{},shouldAttachToBottom:!1,preservedScrollState:0,loadingSpinnerHeight:0,deprecationWarned:!1,scrollable:null,topSpacer:null,bottomSpacer:null,smoothScrollingWrapper:null,loadingSpinner:null,getDefaultProps:function(){return{handleScroll:function(){},useWindowAsScrollContainer:!1,onInfiniteLoad:function(){},loadingSpinnerDelegate:React.createElement("div",null),displayBottomUpwards:!1,isInfiniteLoading:!1,timeScrollStateLastsForAfterUserScrolls:150,className:"",styles:{}}},getInitialState:function(){var e=this.recomputeInternalStateFromProps(this.props);this.computedProps=e.computedProps,this.utils=e.utils,this.shouldAttachToBottom=this.props.displayBottomUpwards;var t=e.newState;return t.scrollTimeout=void 0,t.isScrolling=!1,t},generateComputedProps:function(e){var t=e.containerHeight,i=e.preloadBatchSize,o=e.preloadAdditionalHeight,n=_objectWithoutProperties(e,["containerHeight","preloadBatchSize","preloadAdditionalHeight"]),r={};t="number"==typeof t?t:0,r.containerHeight=e.useWindowAsScrollContainer?window.innerHeight:t,void 0!==n.infiniteLoadBeginBottomOffset&&(r.infiniteLoadBeginEdgeOffset=n.infiniteLoadBeginBottomOffset,this.deprecationWarned||(console.error("Warning: React Infinite's infiniteLoadBeginBottomOffset prop\n has been deprecated as of 0.6.0. Please use infiniteLoadBeginEdgeOffset.\n Because this is a rather descriptive name, a simple find and replace\n should suffice."),this.deprecationWarned=!0));var s={type:scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR,amount:.5},l=i&&i.type?i:s;"number"==typeof i?r.preloadBatchSize=i:"object"==typeof l&&l.type===scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR?r.preloadBatchSize=r.containerHeight*l.amount:r.preloadBatchSize=0;var a={type:scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR,amount:1},c=o&&o.type?o:a;return"number"==typeof o?r.preloadAdditionalHeight=o:"object"==typeof c&&c.type===scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR?r.preloadAdditionalHeight=r.containerHeight*c.amount:r.preloadAdditionalHeight=0,Object.assign(n,r)},generateComputedUtilityFunctions:function(e){var t=this,i={};return i.getLoadingSpinnerHeight=function(){var e=0;return t.loadingSpinner&&(e=t.loadingSpinner.offsetHeight||0),e},e.useWindowAsScrollContainer?(i.subscribeToScrollListener=function(){window.addEventListener("scroll",t.infiniteHandleScroll)},i.unsubscribeFromScrollListener=function(){window.removeEventListener("scroll",t.infiniteHandleScroll)},i.nodeScrollListener=function(){},i.getScrollTop=function(){return window.pageYOffset},i.setScrollTop=function(e){window.scroll(window.pageXOffset,e)},i.scrollShouldBeIgnored=function(){return!1},i.buildScrollableStyle=function(){return{}}):(i.subscribeToScrollListener=function(){},i.unsubscribeFromScrollListener=function(){},i.nodeScrollListener=this.infiniteHandleScroll,i.getScrollTop=function(){return t.scrollable?t.scrollable.scrollTop:0},i.setScrollTop=function(e){t.scrollable&&(t.scrollable.scrollTop=e)},i.scrollShouldBeIgnored=function(e){return e.target!==t.scrollable},i.buildScrollableStyle=function(){return Object.assign({},{height:t.computedProps.containerHeight,overflowX:"hidden",overflowY:"scroll",WebkitOverflowScrolling:"touch"},t.computedProps.styles.scrollableStyle||{})}),i},recomputeInternalStateFromProps:function(e){checkProps(e);var t=this.generateComputedProps(e),i=this.generateComputedUtilityFunctions(e),o={};return o.numberOfChildren=React.Children.count(t.children),o.infiniteComputer=infiniteHelpers.createInfiniteComputer(t.elementHeight,t.children),void 0!==t.isInfiniteLoading&&(o.isInfiniteLoading=t.isInfiniteLoading),o.preloadBatchSize=t.preloadBatchSize,o.preloadAdditionalHeight=t.preloadAdditionalHeight,o=Object.assign(o,infiniteHelpers.recomputeApertureStateFromOptionsAndScrollTop(o,i.getScrollTop())),{computedProps:t,utils:i,newState:o}},componentWillReceiveProps:function(e){var t=this.recomputeInternalStateFromProps(e);this.computedProps=t.computedProps,this.utils=t.utils,this.setState(t.newState)},componentWillUpdate:function(){this.props.displayBottomUpwards&&(this.preservedScrollState=this.utils.getScrollTop()-this.loadingSpinnerHeight)},componentDidUpdate:function(e,t){if(this.loadingSpinnerHeight=this.utils.getLoadingSpinnerHeight(),this.props.displayBottomUpwards){var i=this.getLowestPossibleScrollTop();this.shouldAttachToBottom&&this.utils.getScrollTop()this.state.infiniteComputer.getTotalScrollableHeight()-this.computedProps.containerHeight-this.computedProps.infiniteLoadBeginEdgeOffset},onInfiniteLoad:function(){this.setState({isInfiniteLoading:!0}),this.computedProps.onInfiniteLoad()},handleScroll:function(e){this.shouldAttachToBottom=this.computedProps.displayBottomUpwards&&e>=this.getLowestPossibleScrollTop(),this.manageScrollTimeouts();var t=infiniteHelpers.recomputeApertureStateFromOptionsAndScrollTop(this.state,e);this.passedEdgeForInfiniteScroll(e)&&!this.state.isInfiniteLoading?(this.setState(Object.assign({},t)),this.onInfiniteLoad()):this.setState(t)},buildHeightStyle:function(e){return{width:"100%",height:Math.ceil(e)}},render:function(){var e,t=this;e=this.state.numberOfChildren>1?this.computedProps.children.slice(this.state.displayIndexStart,this.state.displayIndexEnd+1):this.computedProps.children;var i={};this.state.isScrolling&&(i.pointerEvents="none");var o=this.state.infiniteComputer.getTopSpacerHeight(this.state.displayIndexStart),n=this.state.infiniteComputer.getBottomSpacerHeight(this.state.displayIndexEnd);if(this.computedProps.displayBottomUpwards){var r=this.computedProps.containerHeight-this.state.infiniteComputer.getTotalScrollableHeight();r>0&&(o=r-this.loadingSpinnerHeight)}var s=void 0===this.computedProps.infiniteLoadBeginEdgeOffset?null:React.createElement("div",{ref:function(e){t.loadingSpinner=e}},this.state.isInfiniteLoading?this.computedProps.loadingSpinnerDelegate:null);return React.createElement("div",{className:this.computedProps.className,ref:function(e){t.scrollable=e},style:this.utils.buildScrollableStyle(),onScroll:this.utils.nodeScrollListener},React.createElement("div",{ref:function(e){t.smoothScrollingWrapper=e},style:i},React.createElement("div",{ref:function(e){t.topSpacer=e},style:this.buildHeightStyle(o)}),this.computedProps.displayBottomUpwards&&s,e,!this.computedProps.displayBottomUpwards&&s,React.createElement("div",{ref:function(e){t.bottomSpacer=e},style:this.buildHeightStyle(n)})))}});module.exports=Infinite,global.Infinite=Infinite; +"use strict";function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var _createClass=function(){function e(e,t){for(var i=0;i1?this.computedProps.children.slice(this.state.displayIndexStart,this.state.displayIndexEnd+1):this.computedProps.children;var i={};this.state.isScrolling&&(i.pointerEvents="none");var o=this.state.infiniteComputer.getTopSpacerHeight(this.state.displayIndexStart),n=this.state.infiniteComputer.getBottomSpacerHeight(this.state.displayIndexEnd);if(this.computedProps.displayBottomUpwards){var r=this.computedProps.containerHeight-this.state.infiniteComputer.getTotalScrollableHeight();r>0&&(o=r-this.loadingSpinnerHeight)}var s=void 0===this.computedProps.infiniteLoadBeginEdgeOffset?null:React.createElement("div",{ref:function(e){t.loadingSpinner=e}},this.state.isInfiniteLoading?this.computedProps.loadingSpinnerDelegate:null);return React.createElement("div",{className:this.computedProps.className,ref:function(e){t.scrollable=e},style:this.utils.buildScrollableStyle(),onScroll:this.utils.nodeScrollListener},React.createElement("div",{ref:function(e){t.smoothScrollingWrapper=e},style:i},React.createElement("div",{ref:function(e){t.topSpacer=e},style:infiniteHelpers.buildHeightStyle(o)}),this.computedProps.displayBottomUpwards&&s,e,!this.computedProps.displayBottomUpwards&&s,React.createElement("div",{ref:function(e){t.bottomSpacer=e},style:infiniteHelpers.buildHeightStyle(n)})))}}]),t}(React.Component);Infinite.propTypes={children:PropTypes.any,handleScroll:PropTypes.func,preloadBatchSize:PropTypes.oneOfType([PropTypes.number,PropTypes.shape({type:PropTypes.oneOf(["containerHeightScaleFactor"]).isRequired,amount:PropTypes.number.isRequired})]),preloadAdditionalHeight:PropTypes.oneOfType([PropTypes.number,PropTypes.shape({type:PropTypes.oneOf(["containerHeightScaleFactor"]).isRequired,amount:PropTypes.number.isRequired})]),elementHeight:PropTypes.oneOfType([PropTypes.number,PropTypes.arrayOf(PropTypes.number)]).isRequired,containerHeight:PropTypes.number,useWindowAsScrollContainer:PropTypes.bool,displayBottomUpwards:PropTypes.bool.isRequired,infiniteLoadBeginEdgeOffset:PropTypes.number,onInfiniteLoad:PropTypes.func,loadingSpinnerDelegate:PropTypes.node,isInfiniteLoading:PropTypes.bool,timeScrollStateLastsForAfterUserScrolls:PropTypes.number,className:PropTypes.string,styles:PropTypes.shape({scrollableStyle:PropTypes.object}).isRequired},Infinite.defaultProps={handleScroll:function(){},useWindowAsScrollContainer:!1,onInfiniteLoad:function(){},loadingSpinnerDelegate:React.createElement("div",null),displayBottomUpwards:!1,isInfiniteLoading:!1,timeScrollStateLastsForAfterUserScrolls:150,className:"",styles:{}};var _initialiseProps=function(){var e=this;this.shouldAttachToBottom=!1,this.preservedScrollState=0,this.loadingSpinnerHeight=0,this.generateComputedUtilityFunctions=function(t){var i={};return i.getLoadingSpinnerHeight=function(){var t=0;return e.loadingSpinner&&(t=e.loadingSpinner.offsetHeight||0),t},t.useWindowAsScrollContainer?(i.subscribeToScrollListener=function(){window.addEventListener("scroll",e.infiniteHandleScroll)},i.unsubscribeFromScrollListener=function(){window.removeEventListener("scroll",e.infiniteHandleScroll)},i.nodeScrollListener=function(){},i.getScrollTop=function(){return window.pageYOffset},i.setScrollTop=function(e){window.scroll(window.pageXOffset,e)},i.scrollShouldBeIgnored=function(){return!1},i.buildScrollableStyle=function(){return{}}):(i.subscribeToScrollListener=function(){},i.unsubscribeFromScrollListener=function(){},i.nodeScrollListener=e.infiniteHandleScroll,i.getScrollTop=function(){return e.scrollable?e.scrollable.scrollTop:0},i.setScrollTop=function(t){e.scrollable&&(e.scrollable.scrollTop=t)},i.scrollShouldBeIgnored=function(t){return t.target!==e.scrollable},i.buildScrollableStyle=function(){return Object.assign({},{height:e.computedProps.containerHeight,overflowX:"hidden",overflowY:"scroll",WebkitOverflowScrolling:"touch"},e.computedProps.styles.scrollableStyle||{})}),i},this.recomputeInternalStateFromProps=function(t){checkProps(t);var i=infiniteHelpers.generateComputedProps(t),o=e.generateComputedUtilityFunctions(t),n={};return n.numberOfChildren=React.Children.count(i.children),n.infiniteComputer=infiniteHelpers.createInfiniteComputer(i.elementHeight,i.children),void 0!==i.isInfiniteLoading&&(n.isInfiniteLoading=i.isInfiniteLoading),n.preloadBatchSize=i.preloadBatchSize,n.preloadAdditionalHeight=i.preloadAdditionalHeight,n=Object.assign(n,infiniteHelpers.recomputeApertureStateFromOptionsAndScrollTop(n,o.getScrollTop())),{computedProps:i,utils:o,newState:n}},this.infiniteHandleScroll=function(t){e.utils.scrollShouldBeIgnored(t)||(e.computedProps.handleScroll(e.scrollable),e.handleScroll(e.utils.getScrollTop()))},this.manageScrollTimeouts=function(){e.state.scrollTimeout&&clearTimeout(e.state.scrollTimeout);var t=e,i=setTimeout(function(){t.setState({isScrolling:!1,scrollTimeout:void 0})},e.computedProps.timeScrollStateLastsForAfterUserScrolls);e.setState({isScrolling:!0,scrollTimeout:i})},this.getLowestPossibleScrollTop=function(){return e.state.infiniteComputer.getTotalScrollableHeight()-e.computedProps.containerHeight},this.hasAllVisibleItems=function(){return!(_isFinite(e.computedProps.infiniteLoadBeginEdgeOffset)&&e.state.infiniteComputer.getTotalScrollableHeight()e.state.infiniteComputer.getTotalScrollableHeight()-e.computedProps.containerHeight-i)},this.onInfiniteLoad=function(){e.setState({isInfiniteLoading:!0}),e.computedProps.onInfiniteLoad()},this.handleScroll=function(t){e.shouldAttachToBottom=e.computedProps.displayBottomUpwards&&t>=e.getLowestPossibleScrollTop(),e.manageScrollTimeouts();var i=infiniteHelpers.recomputeApertureStateFromOptionsAndScrollTop(e.state,t);e.passedEdgeForInfiniteScroll(t)&&!e.state.isInfiniteLoading?(e.setState(Object.assign({},i)),e.onInfiniteLoad()):e.setState(i)}};module.exports=Infinite,global.Infinite=Infinite; }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"./utils/checkProps":22,"./utils/establish-polyfills":23,"./utils/infiniteHelpers":24,"./utils/scaleEnum":25,"./utils/types":26,"./utils/window":27,"create-react-class":3,"lodash.isfinite":10,"prop-types":16,"react":undefined}],2:[function(require,module,exports){ -(function (process){ -/** - * Copyright 2013-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ - -'use strict'; - -var _assign = require('object-assign'); - -var emptyObject = require('fbjs/lib/emptyObject'); -var _invariant = require('fbjs/lib/invariant'); - -if (process.env.NODE_ENV !== 'production') { - var warning = require('fbjs/lib/warning'); -} - -var MIXINS_KEY = 'mixins'; - -// Helper function to allow the creation of anonymous functions which do not -// have .name set to the name of the variable being assigned to. -function identity(fn) { - return fn; -} - -var ReactPropTypeLocationNames; -if (process.env.NODE_ENV !== 'production') { - ReactPropTypeLocationNames = { - prop: 'prop', - context: 'context', - childContext: 'child context' - }; -} else { - ReactPropTypeLocationNames = {}; -} - -function factory(ReactComponent, isValidElement, ReactNoopUpdateQueue) { - /** - * Policies that describe methods in `ReactClassInterface`. - */ - - var injectedMixins = []; - - /** - * Composite components are higher-level components that compose other composite - * or host components. - * - * To create a new type of `ReactClass`, pass a specification of - * your new class to `React.createClass`. The only requirement of your class - * specification is that you implement a `render` method. - * - * var MyComponent = React.createClass({ - * render: function() { - * return
    Hello World
    ; - * } - * }); - * - * The class specification supports a specific protocol of methods that have - * special meaning (e.g. `render`). See `ReactClassInterface` for - * more the comprehensive protocol. Any other properties and methods in the - * class specification will be available on the prototype. - * - * @interface ReactClassInterface - * @internal - */ - var ReactClassInterface = { - /** - * An array of Mixin objects to include when defining your component. - * - * @type {array} - * @optional - */ - mixins: 'DEFINE_MANY', - - /** - * An object containing properties and methods that should be defined on - * the component's constructor instead of its prototype (static methods). - * - * @type {object} - * @optional - */ - statics: 'DEFINE_MANY', - - /** - * Definition of prop types for this component. - * - * @type {object} - * @optional - */ - propTypes: 'DEFINE_MANY', - - /** - * Definition of context types for this component. - * - * @type {object} - * @optional - */ - contextTypes: 'DEFINE_MANY', - - /** - * Definition of context types this component sets for its children. - * - * @type {object} - * @optional - */ - childContextTypes: 'DEFINE_MANY', - - // ==== Definition methods ==== - - /** - * Invoked when the component is mounted. Values in the mapping will be set on - * `this.props` if that prop is not specified (i.e. using an `in` check). - * - * This method is invoked before `getInitialState` and therefore cannot rely - * on `this.state` or use `this.setState`. - * - * @return {object} - * @optional - */ - getDefaultProps: 'DEFINE_MANY_MERGED', - - /** - * Invoked once before the component is mounted. The return value will be used - * as the initial value of `this.state`. - * - * getInitialState: function() { - * return { - * isOn: false, - * fooBaz: new BazFoo() - * } - * } - * - * @return {object} - * @optional - */ - getInitialState: 'DEFINE_MANY_MERGED', - - /** - * @return {object} - * @optional - */ - getChildContext: 'DEFINE_MANY_MERGED', - - /** - * Uses props from `this.props` and state from `this.state` to render the - * structure of the component. - * - * No guarantees are made about when or how often this method is invoked, so - * it must not have side effects. - * - * render: function() { - * var name = this.props.name; - * return
    Hello, {name}!
    ; - * } - * - * @return {ReactComponent} - * @required - */ - render: 'DEFINE_ONCE', - - // ==== Delegate methods ==== - - /** - * Invoked when the component is initially created and about to be mounted. - * This may have side effects, but any external subscriptions or data created - * by this method must be cleaned up in `componentWillUnmount`. - * - * @optional - */ - componentWillMount: 'DEFINE_MANY', - - /** - * Invoked when the component has been mounted and has a DOM representation. - * However, there is no guarantee that the DOM node is in the document. - * - * Use this as an opportunity to operate on the DOM when the component has - * been mounted (initialized and rendered) for the first time. - * - * @param {DOMElement} rootNode DOM element representing the component. - * @optional - */ - componentDidMount: 'DEFINE_MANY', - - /** - * Invoked before the component receives new props. - * - * Use this as an opportunity to react to a prop transition by updating the - * state using `this.setState`. Current props are accessed via `this.props`. - * - * componentWillReceiveProps: function(nextProps, nextContext) { - * this.setState({ - * likesIncreasing: nextProps.likeCount > this.props.likeCount - * }); - * } - * - * NOTE: There is no equivalent `componentWillReceiveState`. An incoming prop - * transition may cause a state change, but the opposite is not true. If you - * need it, you are probably looking for `componentWillUpdate`. - * - * @param {object} nextProps - * @optional - */ - componentWillReceiveProps: 'DEFINE_MANY', - - /** - * Invoked while deciding if the component should be updated as a result of - * receiving new props, state and/or context. - * - * Use this as an opportunity to `return false` when you're certain that the - * transition to the new props/state/context will not require a component - * update. - * - * shouldComponentUpdate: function(nextProps, nextState, nextContext) { - * return !equal(nextProps, this.props) || - * !equal(nextState, this.state) || - * !equal(nextContext, this.context); - * } - * - * @param {object} nextProps - * @param {?object} nextState - * @param {?object} nextContext - * @return {boolean} True if the component should update. - * @optional - */ - shouldComponentUpdate: 'DEFINE_ONCE', - - /** - * Invoked when the component is about to update due to a transition from - * `this.props`, `this.state` and `this.context` to `nextProps`, `nextState` - * and `nextContext`. - * - * Use this as an opportunity to perform preparation before an update occurs. - * - * NOTE: You **cannot** use `this.setState()` in this method. - * - * @param {object} nextProps - * @param {?object} nextState - * @param {?object} nextContext - * @param {ReactReconcileTransaction} transaction - * @optional - */ - componentWillUpdate: 'DEFINE_MANY', - - /** - * Invoked when the component's DOM representation has been updated. - * - * Use this as an opportunity to operate on the DOM when the component has - * been updated. - * - * @param {object} prevProps - * @param {?object} prevState - * @param {?object} prevContext - * @param {DOMElement} rootNode DOM element representing the component. - * @optional - */ - componentDidUpdate: 'DEFINE_MANY', - - /** - * Invoked when the component is about to be removed from its parent and have - * its DOM representation destroyed. - * - * Use this as an opportunity to deallocate any external resources. - * - * NOTE: There is no `componentDidUnmount` since your component will have been - * destroyed by that point. - * - * @optional - */ - componentWillUnmount: 'DEFINE_MANY', - - // ==== Advanced methods ==== - - /** - * Updates the component's currently mounted DOM representation. - * - * By default, this implements React's rendering and reconciliation algorithm. - * Sophisticated clients may wish to override this. - * - * @param {ReactReconcileTransaction} transaction - * @internal - * @overridable - */ - updateComponent: 'OVERRIDE_BASE' - }; - - /** - * Mapping from class specification keys to special processing functions. - * - * Although these are declared like instance properties in the specification - * when defining classes using `React.createClass`, they are actually static - * and are accessible on the constructor instead of the prototype. Despite - * being static, they must be defined outside of the "statics" key under - * which all other static methods are defined. - */ - var RESERVED_SPEC_KEYS = { - displayName: function(Constructor, displayName) { - Constructor.displayName = displayName; - }, - mixins: function(Constructor, mixins) { - if (mixins) { - for (var i = 0; i < mixins.length; i++) { - mixSpecIntoComponent(Constructor, mixins[i]); - } - } - }, - childContextTypes: function(Constructor, childContextTypes) { - if (process.env.NODE_ENV !== 'production') { - validateTypeDef(Constructor, childContextTypes, 'childContext'); - } - Constructor.childContextTypes = _assign( - {}, - Constructor.childContextTypes, - childContextTypes - ); - }, - contextTypes: function(Constructor, contextTypes) { - if (process.env.NODE_ENV !== 'production') { - validateTypeDef(Constructor, contextTypes, 'context'); - } - Constructor.contextTypes = _assign( - {}, - Constructor.contextTypes, - contextTypes - ); - }, - /** - * Special case getDefaultProps which should move into statics but requires - * automatic merging. - */ - getDefaultProps: function(Constructor, getDefaultProps) { - if (Constructor.getDefaultProps) { - Constructor.getDefaultProps = createMergedResultFunction( - Constructor.getDefaultProps, - getDefaultProps - ); - } else { - Constructor.getDefaultProps = getDefaultProps; - } - }, - propTypes: function(Constructor, propTypes) { - if (process.env.NODE_ENV !== 'production') { - validateTypeDef(Constructor, propTypes, 'prop'); - } - Constructor.propTypes = _assign({}, Constructor.propTypes, propTypes); - }, - statics: function(Constructor, statics) { - mixStaticSpecIntoComponent(Constructor, statics); - }, - autobind: function() {} - }; - - function validateTypeDef(Constructor, typeDef, location) { - for (var propName in typeDef) { - if (typeDef.hasOwnProperty(propName)) { - // use a warning instead of an _invariant so components - // don't show up in prod but only in __DEV__ - if (process.env.NODE_ENV !== 'production') { - warning( - typeof typeDef[propName] === 'function', - '%s: %s type `%s` is invalid; it must be a function, usually from ' + - 'React.PropTypes.', - Constructor.displayName || 'ReactClass', - ReactPropTypeLocationNames[location], - propName - ); - } - } - } - } - - function validateMethodOverride(isAlreadyDefined, name) { - var specPolicy = ReactClassInterface.hasOwnProperty(name) - ? ReactClassInterface[name] - : null; - - // Disallow overriding of base class methods unless explicitly allowed. - if (ReactClassMixin.hasOwnProperty(name)) { - _invariant( - specPolicy === 'OVERRIDE_BASE', - 'ReactClassInterface: You are attempting to override ' + - '`%s` from your class specification. Ensure that your method names ' + - 'do not overlap with React methods.', - name - ); - } - - // Disallow defining methods more than once unless explicitly allowed. - if (isAlreadyDefined) { - _invariant( - specPolicy === 'DEFINE_MANY' || specPolicy === 'DEFINE_MANY_MERGED', - 'ReactClassInterface: You are attempting to define ' + - '`%s` on your component more than once. This conflict may be due ' + - 'to a mixin.', - name - ); - } - } - - /** - * Mixin helper which handles policy validation and reserved - * specification keys when building React classes. - */ - function mixSpecIntoComponent(Constructor, spec) { - if (!spec) { - if (process.env.NODE_ENV !== 'production') { - var typeofSpec = typeof spec; - var isMixinValid = typeofSpec === 'object' && spec !== null; - - if (process.env.NODE_ENV !== 'production') { - warning( - isMixinValid, - "%s: You're attempting to include a mixin that is either null " + - 'or not an object. Check the mixins included by the component, ' + - 'as well as any mixins they include themselves. ' + - 'Expected object but got %s.', - Constructor.displayName || 'ReactClass', - spec === null ? null : typeofSpec - ); - } - } - - return; - } - - _invariant( - typeof spec !== 'function', - "ReactClass: You're attempting to " + - 'use a component class or function as a mixin. Instead, just use a ' + - 'regular object.' - ); - _invariant( - !isValidElement(spec), - "ReactClass: You're attempting to " + - 'use a component as a mixin. Instead, just use a regular object.' - ); - - var proto = Constructor.prototype; - var autoBindPairs = proto.__reactAutoBindPairs; - - // By handling mixins before any other properties, we ensure the same - // chaining order is applied to methods with DEFINE_MANY policy, whether - // mixins are listed before or after these methods in the spec. - if (spec.hasOwnProperty(MIXINS_KEY)) { - RESERVED_SPEC_KEYS.mixins(Constructor, spec.mixins); - } - - for (var name in spec) { - if (!spec.hasOwnProperty(name)) { - continue; - } - - if (name === MIXINS_KEY) { - // We have already handled mixins in a special case above. - continue; - } - - var property = spec[name]; - var isAlreadyDefined = proto.hasOwnProperty(name); - validateMethodOverride(isAlreadyDefined, name); - - if (RESERVED_SPEC_KEYS.hasOwnProperty(name)) { - RESERVED_SPEC_KEYS[name](Constructor, property); - } else { - // Setup methods on prototype: - // The following member methods should not be automatically bound: - // 1. Expected ReactClass methods (in the "interface"). - // 2. Overridden methods (that were mixed in). - var isReactClassMethod = ReactClassInterface.hasOwnProperty(name); - var isFunction = typeof property === 'function'; - var shouldAutoBind = - isFunction && - !isReactClassMethod && - !isAlreadyDefined && - spec.autobind !== false; - - if (shouldAutoBind) { - autoBindPairs.push(name, property); - proto[name] = property; - } else { - if (isAlreadyDefined) { - var specPolicy = ReactClassInterface[name]; - - // These cases should already be caught by validateMethodOverride. - _invariant( - isReactClassMethod && - (specPolicy === 'DEFINE_MANY_MERGED' || - specPolicy === 'DEFINE_MANY'), - 'ReactClass: Unexpected spec policy %s for key %s ' + - 'when mixing in component specs.', - specPolicy, - name - ); - - // For methods which are defined more than once, call the existing - // methods before calling the new property, merging if appropriate. - if (specPolicy === 'DEFINE_MANY_MERGED') { - proto[name] = createMergedResultFunction(proto[name], property); - } else if (specPolicy === 'DEFINE_MANY') { - proto[name] = createChainedFunction(proto[name], property); - } - } else { - proto[name] = property; - if (process.env.NODE_ENV !== 'production') { - // Add verbose displayName to the function, which helps when looking - // at profiling tools. - if (typeof property === 'function' && spec.displayName) { - proto[name].displayName = spec.displayName + '_' + name; - } - } - } - } - } - } - } - - function mixStaticSpecIntoComponent(Constructor, statics) { - if (!statics) { - return; - } - for (var name in statics) { - var property = statics[name]; - if (!statics.hasOwnProperty(name)) { - continue; - } - - var isReserved = name in RESERVED_SPEC_KEYS; - _invariant( - !isReserved, - 'ReactClass: You are attempting to define a reserved ' + - 'property, `%s`, that shouldn\'t be on the "statics" key. Define it ' + - 'as an instance property instead; it will still be accessible on the ' + - 'constructor.', - name - ); - - var isInherited = name in Constructor; - _invariant( - !isInherited, - 'ReactClass: You are attempting to define ' + - '`%s` on your component more than once. This conflict may be ' + - 'due to a mixin.', - name - ); - Constructor[name] = property; - } - } - - /** - * Merge two objects, but throw if both contain the same key. - * - * @param {object} one The first object, which is mutated. - * @param {object} two The second object - * @return {object} one after it has been mutated to contain everything in two. - */ - function mergeIntoWithNoDuplicateKeys(one, two) { - _invariant( - one && two && typeof one === 'object' && typeof two === 'object', - 'mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.' - ); - - for (var key in two) { - if (two.hasOwnProperty(key)) { - _invariant( - one[key] === undefined, - 'mergeIntoWithNoDuplicateKeys(): ' + - 'Tried to merge two objects with the same key: `%s`. This conflict ' + - 'may be due to a mixin; in particular, this may be caused by two ' + - 'getInitialState() or getDefaultProps() methods returning objects ' + - 'with clashing keys.', - key - ); - one[key] = two[key]; - } - } - return one; - } - - /** - * Creates a function that invokes two functions and merges their return values. - * - * @param {function} one Function to invoke first. - * @param {function} two Function to invoke second. - * @return {function} Function that invokes the two argument functions. - * @private - */ - function createMergedResultFunction(one, two) { - return function mergedResult() { - var a = one.apply(this, arguments); - var b = two.apply(this, arguments); - if (a == null) { - return b; - } else if (b == null) { - return a; - } - var c = {}; - mergeIntoWithNoDuplicateKeys(c, a); - mergeIntoWithNoDuplicateKeys(c, b); - return c; - }; - } - - /** - * Creates a function that invokes two functions and ignores their return vales. - * - * @param {function} one Function to invoke first. - * @param {function} two Function to invoke second. - * @return {function} Function that invokes the two argument functions. - * @private - */ - function createChainedFunction(one, two) { - return function chainedFunction() { - one.apply(this, arguments); - two.apply(this, arguments); - }; - } - - /** - * Binds a method to the component. - * - * @param {object} component Component whose method is going to be bound. - * @param {function} method Method to be bound. - * @return {function} The bound method. - */ - function bindAutoBindMethod(component, method) { - var boundMethod = method.bind(component); - if (process.env.NODE_ENV !== 'production') { - boundMethod.__reactBoundContext = component; - boundMethod.__reactBoundMethod = method; - boundMethod.__reactBoundArguments = null; - var componentName = component.constructor.displayName; - var _bind = boundMethod.bind; - boundMethod.bind = function(newThis) { - for ( - var _len = arguments.length, - args = Array(_len > 1 ? _len - 1 : 0), - _key = 1; - _key < _len; - _key++ - ) { - args[_key - 1] = arguments[_key]; - } - - // User is trying to bind() an autobound method; we effectively will - // ignore the value of "this" that the user is trying to use, so - // let's warn. - if (newThis !== component && newThis !== null) { - if (process.env.NODE_ENV !== 'production') { - warning( - false, - 'bind(): React component methods may only be bound to the ' + - 'component instance. See %s', - componentName - ); - } - } else if (!args.length) { - if (process.env.NODE_ENV !== 'production') { - warning( - false, - 'bind(): You are binding a component method to the component. ' + - 'React does this for you automatically in a high-performance ' + - 'way, so you can safely remove this call. See %s', - componentName - ); - } - return boundMethod; - } - var reboundMethod = _bind.apply(boundMethod, arguments); - reboundMethod.__reactBoundContext = component; - reboundMethod.__reactBoundMethod = method; - reboundMethod.__reactBoundArguments = args; - return reboundMethod; - }; - } - return boundMethod; - } - - /** - * Binds all auto-bound methods in a component. - * - * @param {object} component Component whose method is going to be bound. - */ - function bindAutoBindMethods(component) { - var pairs = component.__reactAutoBindPairs; - for (var i = 0; i < pairs.length; i += 2) { - var autoBindKey = pairs[i]; - var method = pairs[i + 1]; - component[autoBindKey] = bindAutoBindMethod(component, method); - } - } - - var IsMountedPreMixin = { - componentDidMount: function() { - this.__isMounted = true; - } - }; - - var IsMountedPostMixin = { - componentWillUnmount: function() { - this.__isMounted = false; - } - }; - - /** - * Add more to the ReactClass base class. These are all legacy features and - * therefore not already part of the modern ReactComponent. - */ - var ReactClassMixin = { - /** - * TODO: This will be deprecated because state should always keep a consistent - * type signature and the only use case for this, is to avoid that. - */ - replaceState: function(newState, callback) { - this.updater.enqueueReplaceState(this, newState, callback); - }, - - /** - * Checks whether or not this composite component is mounted. - * @return {boolean} True if mounted, false otherwise. - * @protected - * @final - */ - isMounted: function() { - if (process.env.NODE_ENV !== 'production') { - warning( - this.__didWarnIsMounted, - '%s: isMounted is deprecated. Instead, make sure to clean up ' + - 'subscriptions and pending requests in componentWillUnmount to ' + - 'prevent memory leaks.', - (this.constructor && this.constructor.displayName) || - this.name || - 'Component' - ); - this.__didWarnIsMounted = true; - } - return !!this.__isMounted; - } - }; - - var ReactClassComponent = function() {}; - _assign( - ReactClassComponent.prototype, - ReactComponent.prototype, - ReactClassMixin - ); - - /** - * Creates a composite component class given a class specification. - * See https://facebook.github.io/react/docs/top-level-api.html#react.createclass - * - * @param {object} spec Class specification (which must define `render`). - * @return {function} Component constructor function. - * @public - */ - function createClass(spec) { - // To keep our warnings more understandable, we'll use a little hack here to - // ensure that Constructor.name !== 'Constructor'. This makes sure we don't - // unnecessarily identify a class without displayName as 'Constructor'. - var Constructor = identity(function(props, context, updater) { - // This constructor gets overridden by mocks. The argument is used - // by mocks to assert on what gets mounted. - - if (process.env.NODE_ENV !== 'production') { - warning( - this instanceof Constructor, - 'Something is calling a React component directly. Use a factory or ' + - 'JSX instead. See: https://fb.me/react-legacyfactory' - ); - } - - // Wire up auto-binding - if (this.__reactAutoBindPairs.length) { - bindAutoBindMethods(this); - } - - this.props = props; - this.context = context; - this.refs = emptyObject; - this.updater = updater || ReactNoopUpdateQueue; - - this.state = null; - - // ReactClasses doesn't have constructors. Instead, they use the - // getInitialState and componentWillMount methods for initialization. - - var initialState = this.getInitialState ? this.getInitialState() : null; - if (process.env.NODE_ENV !== 'production') { - // We allow auto-mocks to proceed as if they're returning null. - if ( - initialState === undefined && - this.getInitialState._isMockFunction - ) { - // This is probably bad practice. Consider warning here and - // deprecating this convenience. - initialState = null; - } - } - _invariant( - typeof initialState === 'object' && !Array.isArray(initialState), - '%s.getInitialState(): must return an object or null', - Constructor.displayName || 'ReactCompositeComponent' - ); - - this.state = initialState; - }); - Constructor.prototype = new ReactClassComponent(); - Constructor.prototype.constructor = Constructor; - Constructor.prototype.__reactAutoBindPairs = []; - - injectedMixins.forEach(mixSpecIntoComponent.bind(null, Constructor)); - - mixSpecIntoComponent(Constructor, IsMountedPreMixin); - mixSpecIntoComponent(Constructor, spec); - mixSpecIntoComponent(Constructor, IsMountedPostMixin); - - // Initialize the defaultProps property after all mixins have been merged. - if (Constructor.getDefaultProps) { - Constructor.defaultProps = Constructor.getDefaultProps(); - } - - if (process.env.NODE_ENV !== 'production') { - // This is a tag to indicate that the use of these method names is ok, - // since it's used with createClass. If it's not, then it's likely a - // mistake so we'll warn you to use the static property, property - // initializer or constructor respectively. - if (Constructor.getDefaultProps) { - Constructor.getDefaultProps.isReactClassApproved = {}; - } - if (Constructor.prototype.getInitialState) { - Constructor.prototype.getInitialState.isReactClassApproved = {}; - } - } - - _invariant( - Constructor.prototype.render, - 'createClass(...): Class specification must implement a `render` method.' - ); - - if (process.env.NODE_ENV !== 'production') { - warning( - !Constructor.prototype.componentShouldUpdate, - '%s has a method called ' + - 'componentShouldUpdate(). Did you mean shouldComponentUpdate()? ' + - 'The name is phrased as a question because the function is ' + - 'expected to return a value.', - spec.displayName || 'A component' - ); - warning( - !Constructor.prototype.componentWillRecieveProps, - '%s has a method called ' + - 'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?', - spec.displayName || 'A component' - ); - } - - // Reduce time spent doing lookups by setting these on the prototype. - for (var methodName in ReactClassInterface) { - if (!Constructor.prototype[methodName]) { - Constructor.prototype[methodName] = null; - } - } - - return Constructor; - } - - return createClass; -} - -module.exports = factory; - -}).call(this,require('_process')) -},{"_process":12,"fbjs/lib/emptyObject":6,"fbjs/lib/invariant":7,"fbjs/lib/warning":8,"object-assign":4}],3:[function(require,module,exports){ -/** - * Copyright 2013-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ - -'use strict'; - -var React = require('react'); -var factory = require('./factory'); - -if (typeof React === 'undefined') { - throw Error( - 'create-react-class could not find the React object. If you are using script tags, ' + - 'make sure that React is being loaded before create-react-class.' - ); -} - -// Hack to grab NoopUpdateQueue from isomorphic React -var ReactNoopUpdateQueue = new React.Component().updater; - -module.exports = factory( - React.Component, - React.isValidElement, - ReactNoopUpdateQueue -); - -},{"./factory":2,"react":undefined}],4:[function(require,module,exports){ -/* -object-assign -(c) Sindre Sorhus -@license MIT -*/ - -'use strict'; -/* eslint-disable no-unused-vars */ -var getOwnPropertySymbols = Object.getOwnPropertySymbols; -var hasOwnProperty = Object.prototype.hasOwnProperty; -var propIsEnumerable = Object.prototype.propertyIsEnumerable; - -function toObject(val) { - if (val === null || val === undefined) { - throw new TypeError('Object.assign cannot be called with null or undefined'); - } - - return Object(val); -} - -function shouldUseNative() { - try { - if (!Object.assign) { - return false; - } - - // Detect buggy property enumeration order in older V8 versions. - - // https://bugs.chromium.org/p/v8/issues/detail?id=4118 - var test1 = new String('abc'); // eslint-disable-line no-new-wrappers - test1[5] = 'de'; - if (Object.getOwnPropertyNames(test1)[0] === '5') { - return false; - } - - // https://bugs.chromium.org/p/v8/issues/detail?id=3056 - var test2 = {}; - for (var i = 0; i < 10; i++) { - test2['_' + String.fromCharCode(i)] = i; - } - var order2 = Object.getOwnPropertyNames(test2).map(function (n) { - return test2[n]; - }); - if (order2.join('') !== '0123456789') { - return false; - } - - // https://bugs.chromium.org/p/v8/issues/detail?id=3056 - var test3 = {}; - 'abcdefghijklmnopqrst'.split('').forEach(function (letter) { - test3[letter] = letter; - }); - if (Object.keys(Object.assign({}, test3)).join('') !== - 'abcdefghijklmnopqrst') { - return false; - } - - return true; - } catch (err) { - // We don't expect any of the above to throw, but better to be safe. - return false; - } -} - -module.exports = shouldUseNative() ? Object.assign : function (target, source) { - var from; - var to = toObject(target); - var symbols; - - for (var s = 1; s < arguments.length; s++) { - from = Object(arguments[s]); - - for (var key in from) { - if (hasOwnProperty.call(from, key)) { - to[key] = from[key]; - } - } - - if (getOwnPropertySymbols) { - symbols = getOwnPropertySymbols(from); - for (var i = 0; i < symbols.length; i++) { - if (propIsEnumerable.call(from, symbols[i])) { - to[symbols[i]] = from[symbols[i]]; - } - } - } - } - - return to; -}; - -},{}],5:[function(require,module,exports){ -"use strict"; - -/** - * Copyright (c) 2013-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * - */ - -function makeEmptyFunction(arg) { - return function () { - return arg; - }; -} - -/** - * This function accepts and discards inputs; it has no side effects. This is - * primarily useful idiomatically for overridable function endpoints which - * always need to be callable, since JS lacks a null-call idiom ala Cocoa. - */ -var emptyFunction = function emptyFunction() {}; - -emptyFunction.thatReturns = makeEmptyFunction; -emptyFunction.thatReturnsFalse = makeEmptyFunction(false); -emptyFunction.thatReturnsTrue = makeEmptyFunction(true); -emptyFunction.thatReturnsNull = makeEmptyFunction(null); -emptyFunction.thatReturnsThis = function () { - return this; -}; -emptyFunction.thatReturnsArgument = function (arg) { - return arg; -}; - -module.exports = emptyFunction; -},{}],6:[function(require,module,exports){ -(function (process){ -/** - * Copyright (c) 2013-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ - -'use strict'; - -var emptyObject = {}; - -if (process.env.NODE_ENV !== 'production') { - Object.freeze(emptyObject); -} - -module.exports = emptyObject; -}).call(this,require('_process')) -},{"_process":12}],7:[function(require,module,exports){ -(function (process){ -/** - * Copyright (c) 2013-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ - -'use strict'; - -/** - * Use invariant() to assert state which your program assumes to be true. - * - * Provide sprintf-style format (only %s is supported) and arguments - * to provide information about what broke and what you were - * expecting. - * - * The invariant message will be stripped in production, but the invariant - * will remain to ensure logic does not differ in production. - */ - -var validateFormat = function validateFormat(format) {}; - -if (process.env.NODE_ENV !== 'production') { - validateFormat = function validateFormat(format) { - if (format === undefined) { - throw new Error('invariant requires an error message argument'); - } - }; -} - -function invariant(condition, format, a, b, c, d, e, f) { - validateFormat(format); - - if (!condition) { - var error; - if (format === undefined) { - error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.'); - } else { - var args = [a, b, c, d, e, f]; - var argIndex = 0; - error = new Error(format.replace(/%s/g, function () { - return args[argIndex++]; - })); - error.name = 'Invariant Violation'; - } - - error.framesToPop = 1; // we don't care about invariant's own frame - throw error; - } -} - -module.exports = invariant; -}).call(this,require('_process')) -},{"_process":12}],8:[function(require,module,exports){ -(function (process){ -/** - * Copyright 2014-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ - -'use strict'; - -var emptyFunction = require('./emptyFunction'); - -/** - * Similar to invariant but only logs a warning if the condition is not met. - * This can be used to log issues in development environments in critical - * paths. Removing the logging code for production environments will keep the - * same logic and follow the same code paths. - */ - -var warning = emptyFunction; - -if (process.env.NODE_ENV !== 'production') { - var printWarning = function printWarning(format) { - for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - args[_key - 1] = arguments[_key]; - } - - var argIndex = 0; - var message = 'Warning: ' + format.replace(/%s/g, function () { - return args[argIndex++]; - }); - if (typeof console !== 'undefined') { - console.error(message); - } - try { - // --- Welcome to debugging React --- - // This error was thrown as a convenience so that you can use this stack - // to find the callsite that caused this warning to fire. - throw new Error(message); - } catch (x) {} - }; - - warning = function warning(condition, format) { - if (format === undefined) { - throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument'); - } - - if (format.indexOf('Failed Composite propType: ') === 0) { - return; // Ignore CompositeComponent proptype check. - } - - if (!condition) { - for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) { - args[_key2 - 2] = arguments[_key2]; - } - - printWarning.apply(undefined, [format].concat(args)); - } - }; -} - -module.exports = warning; -}).call(this,require('_process')) -},{"./emptyFunction":5,"_process":12}],9:[function(require,module,exports){ +},{"./utils/checkProps":9,"./utils/establish-polyfills":10,"./utils/infiniteHelpers":11,"./utils/scaleEnum":12,"./utils/window":13,"lodash.isfinite":3,"prop-types":undefined,"react":undefined}],2:[function(require,module,exports){ /** * lodash 3.0.4 (Custom Build) * Build: `lodash modern modularize exports="npm" -o ./` @@ -1370,7 +184,7 @@ function isNative(value) { module.exports = isArray; -},{}],10:[function(require,module,exports){ +},{}],3:[function(require,module,exports){ (function (global){ /** * lodash 3.2.0 (Custom Build) @@ -1418,7 +232,7 @@ function isFinite(value) { module.exports = isFinite; }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{}],11:[function(require,module,exports){ +},{}],4:[function(require,module,exports){ /* eslint-disable no-unused-vars */ 'use strict'; var hasOwnProperty = Object.prototype.hasOwnProperty; @@ -1459,801 +273,43 @@ module.exports = Object.assign || function (target, source) { return to; }; -},{}],12:[function(require,module,exports){ -// shim for using process in browser - -var process = module.exports = {}; -var queue = []; -var draining = false; - -function drainQueue() { - if (draining) { - return; - } - draining = true; - var currentQueue; - var len = queue.length; - while(len) { - currentQueue = queue; - queue = []; - var i = -1; - while (++i < len) { - currentQueue[i](); - } - len = queue.length; - } - draining = false; -} -process.nextTick = function (fun) { - queue.push(fun); - if (!draining) { - setTimeout(drainQueue, 0); - } -}; - -process.title = 'browser'; -process.browser = true; -process.env = {}; -process.argv = []; -process.version = ''; // empty string to avoid regexp issues -process.versions = {}; - -function noop() {} - -process.on = noop; -process.addListener = noop; -process.once = noop; -process.off = noop; -process.removeListener = noop; -process.removeAllListeners = noop; -process.emit = noop; - -process.binding = function (name) { - throw new Error('process.binding is not supported'); -}; - -// TODO(shtylman) -process.cwd = function () { return '/' }; -process.chdir = function (dir) { - throw new Error('process.chdir is not supported'); -}; -process.umask = function() { return 0; }; - -},{}],13:[function(require,module,exports){ -(function (process){ -/** - * Copyright 2013-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -'use strict'; - -if (process.env.NODE_ENV !== 'production') { - var invariant = require('fbjs/lib/invariant'); - var warning = require('fbjs/lib/warning'); - var ReactPropTypesSecret = require('./lib/ReactPropTypesSecret'); - var loggedTypeFailures = {}; -} - -/** - * Assert that the values match with the type specs. - * Error messages are memorized and will only be shown once. - * - * @param {object} typeSpecs Map of name to a ReactPropType - * @param {object} values Runtime values that need to be type-checked - * @param {string} location e.g. "prop", "context", "child context" - * @param {string} componentName Name of the component for error messages. - * @param {?Function} getStack Returns the component stack. - * @private - */ -function checkPropTypes(typeSpecs, values, location, componentName, getStack) { - if (process.env.NODE_ENV !== 'production') { - for (var typeSpecName in typeSpecs) { - if (typeSpecs.hasOwnProperty(typeSpecName)) { - var error; - // Prop type validation may throw. In case they do, we don't want to - // fail the render phase where it didn't fail before. So we log it. - // After these have been cleaned up, we'll let them throw. - try { - // This is intentionally an invariant that gets caught. It's the same - // behavior as without this statement except with a better message. - invariant(typeof typeSpecs[typeSpecName] === 'function', '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'React.PropTypes.', componentName || 'React class', location, typeSpecName); - error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret); - } catch (ex) { - error = ex; - } - warning(!error || error instanceof Error, '%s: type specification of %s `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error); - if (error instanceof Error && !(error.message in loggedTypeFailures)) { - // Only monitor this failure once because there tends to be a lot of the - // same error. - loggedTypeFailures[error.message] = true; - - var stack = getStack ? getStack() : ''; - - warning(false, 'Failed %s type: %s%s', location, error.message, stack != null ? stack : ''); - } - } - } - } -} - -module.exports = checkPropTypes; - -}).call(this,require('_process')) -},{"./lib/ReactPropTypesSecret":17,"_process":12,"fbjs/lib/invariant":7,"fbjs/lib/warning":8}],14:[function(require,module,exports){ -/** - * Copyright 2013-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -'use strict'; - -var emptyFunction = require('fbjs/lib/emptyFunction'); -var invariant = require('fbjs/lib/invariant'); -var ReactPropTypesSecret = require('./lib/ReactPropTypesSecret'); - -module.exports = function() { - function shim(props, propName, componentName, location, propFullName, secret) { - if (secret === ReactPropTypesSecret) { - // It is still safe when called from React. - return; - } - invariant( - false, - 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' + - 'Use PropTypes.checkPropTypes() to call them. ' + - 'Read more at http://fb.me/use-check-prop-types' - ); - }; - shim.isRequired = shim; - function getShim() { - return shim; - }; - // Important! - // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`. - var ReactPropTypes = { - array: shim, - bool: shim, - func: shim, - number: shim, - object: shim, - string: shim, - symbol: shim, - - any: shim, - arrayOf: getShim, - element: shim, - instanceOf: getShim, - node: shim, - objectOf: getShim, - oneOf: getShim, - oneOfType: getShim, - shape: getShim - }; - - ReactPropTypes.checkPropTypes = emptyFunction; - ReactPropTypes.PropTypes = ReactPropTypes; - - return ReactPropTypes; -}; - -},{"./lib/ReactPropTypesSecret":17,"fbjs/lib/emptyFunction":5,"fbjs/lib/invariant":7}],15:[function(require,module,exports){ -(function (process){ -/** - * Copyright 2013-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -'use strict'; - -var emptyFunction = require('fbjs/lib/emptyFunction'); -var invariant = require('fbjs/lib/invariant'); -var warning = require('fbjs/lib/warning'); - -var ReactPropTypesSecret = require('./lib/ReactPropTypesSecret'); -var checkPropTypes = require('./checkPropTypes'); - -module.exports = function(isValidElement, throwOnDirectAccess) { - /* global Symbol */ - var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator; - var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec. - - /** - * Returns the iterator method function contained on the iterable object. - * - * Be sure to invoke the function with the iterable as context: - * - * var iteratorFn = getIteratorFn(myIterable); - * if (iteratorFn) { - * var iterator = iteratorFn.call(myIterable); - * ... - * } - * - * @param {?object} maybeIterable - * @return {?function} - */ - function getIteratorFn(maybeIterable) { - var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]); - if (typeof iteratorFn === 'function') { - return iteratorFn; - } - } - - /** - * Collection of methods that allow declaration and validation of props that are - * supplied to React components. Example usage: - * - * var Props = require('ReactPropTypes'); - * var MyArticle = React.createClass({ - * propTypes: { - * // An optional string prop named "description". - * description: Props.string, - * - * // A required enum prop named "category". - * category: Props.oneOf(['News','Photos']).isRequired, - * - * // A prop named "dialog" that requires an instance of Dialog. - * dialog: Props.instanceOf(Dialog).isRequired - * }, - * render: function() { ... } - * }); - * - * A more formal specification of how these methods are used: - * - * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...) - * decl := ReactPropTypes.{type}(.isRequired)? - * - * Each and every declaration produces a function with the same signature. This - * allows the creation of custom validation functions. For example: - * - * var MyLink = React.createClass({ - * propTypes: { - * // An optional string or URI prop named "href". - * href: function(props, propName, componentName) { - * var propValue = props[propName]; - * if (propValue != null && typeof propValue !== 'string' && - * !(propValue instanceof URI)) { - * return new Error( - * 'Expected a string or an URI for ' + propName + ' in ' + - * componentName - * ); - * } - * } - * }, - * render: function() {...} - * }); - * - * @internal - */ - - var ANONYMOUS = '<>'; - - // Important! - // Keep this list in sync with production version in `./factoryWithThrowingShims.js`. - var ReactPropTypes = { - array: createPrimitiveTypeChecker('array'), - bool: createPrimitiveTypeChecker('boolean'), - func: createPrimitiveTypeChecker('function'), - number: createPrimitiveTypeChecker('number'), - object: createPrimitiveTypeChecker('object'), - string: createPrimitiveTypeChecker('string'), - symbol: createPrimitiveTypeChecker('symbol'), - - any: createAnyTypeChecker(), - arrayOf: createArrayOfTypeChecker, - element: createElementTypeChecker(), - instanceOf: createInstanceTypeChecker, - node: createNodeChecker(), - objectOf: createObjectOfTypeChecker, - oneOf: createEnumTypeChecker, - oneOfType: createUnionTypeChecker, - shape: createShapeTypeChecker - }; - - /** - * inlined Object.is polyfill to avoid requiring consumers ship their own - * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is - */ - /*eslint-disable no-self-compare*/ - function is(x, y) { - // SameValue algorithm - if (x === y) { - // Steps 1-5, 7-10 - // Steps 6.b-6.e: +0 != -0 - return x !== 0 || 1 / x === 1 / y; - } else { - // Step 6.a: NaN == NaN - return x !== x && y !== y; - } - } - /*eslint-enable no-self-compare*/ - - /** - * We use an Error-like object for backward compatibility as people may call - * PropTypes directly and inspect their output. However, we don't use real - * Errors anymore. We don't inspect their stack anyway, and creating them - * is prohibitively expensive if they are created too often, such as what - * happens in oneOfType() for any type before the one that matched. - */ - function PropTypeError(message) { - this.message = message; - this.stack = ''; - } - // Make `instanceof Error` still work for returned errors. - PropTypeError.prototype = Error.prototype; - - function createChainableTypeChecker(validate) { - if (process.env.NODE_ENV !== 'production') { - var manualPropTypeCallCache = {}; - var manualPropTypeWarningCount = 0; - } - function checkType(isRequired, props, propName, componentName, location, propFullName, secret) { - componentName = componentName || ANONYMOUS; - propFullName = propFullName || propName; - - if (secret !== ReactPropTypesSecret) { - if (throwOnDirectAccess) { - // New behavior only for users of `prop-types` package - invariant( - false, - 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' + - 'Use `PropTypes.checkPropTypes()` to call them. ' + - 'Read more at http://fb.me/use-check-prop-types' - ); - } else if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined') { - // Old behavior for people using React.PropTypes - var cacheKey = componentName + ':' + propName; - if ( - !manualPropTypeCallCache[cacheKey] && - // Avoid spamming the console because they are often not actionable except for lib authors - manualPropTypeWarningCount < 3 - ) { - warning( - false, - 'You are manually calling a React.PropTypes validation ' + - 'function for the `%s` prop on `%s`. This is deprecated ' + - 'and will throw in the standalone `prop-types` package. ' + - 'You may be seeing this warning due to a third-party PropTypes ' + - 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.', - propFullName, - componentName - ); - manualPropTypeCallCache[cacheKey] = true; - manualPropTypeWarningCount++; - } - } - } - if (props[propName] == null) { - if (isRequired) { - if (props[propName] === null) { - return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.')); - } - return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.')); - } - return null; - } else { - return validate(props, propName, componentName, location, propFullName); - } - } - - var chainedCheckType = checkType.bind(null, false); - chainedCheckType.isRequired = checkType.bind(null, true); - - return chainedCheckType; - } - - function createPrimitiveTypeChecker(expectedType) { - function validate(props, propName, componentName, location, propFullName, secret) { - var propValue = props[propName]; - var propType = getPropType(propValue); - if (propType !== expectedType) { - // `propValue` being instance of, say, date/regexp, pass the 'object' - // check, but we can offer a more precise error message here rather than - // 'of type `object`'. - var preciseType = getPreciseType(propValue); - - return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.')); - } - return null; - } - return createChainableTypeChecker(validate); - } - - function createAnyTypeChecker() { - return createChainableTypeChecker(emptyFunction.thatReturnsNull); - } - - function createArrayOfTypeChecker(typeChecker) { - function validate(props, propName, componentName, location, propFullName) { - if (typeof typeChecker !== 'function') { - return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.'); - } - var propValue = props[propName]; - if (!Array.isArray(propValue)) { - var propType = getPropType(propValue); - return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.')); - } - for (var i = 0; i < propValue.length; i++) { - var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret); - if (error instanceof Error) { - return error; - } - } - return null; - } - return createChainableTypeChecker(validate); - } - - function createElementTypeChecker() { - function validate(props, propName, componentName, location, propFullName) { - var propValue = props[propName]; - if (!isValidElement(propValue)) { - var propType = getPropType(propValue); - return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.')); - } - return null; - } - return createChainableTypeChecker(validate); - } - - function createInstanceTypeChecker(expectedClass) { - function validate(props, propName, componentName, location, propFullName) { - if (!(props[propName] instanceof expectedClass)) { - var expectedClassName = expectedClass.name || ANONYMOUS; - var actualClassName = getClassName(props[propName]); - return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.')); - } - return null; - } - return createChainableTypeChecker(validate); - } - - function createEnumTypeChecker(expectedValues) { - if (!Array.isArray(expectedValues)) { - process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid argument supplied to oneOf, expected an instance of array.') : void 0; - return emptyFunction.thatReturnsNull; - } - - function validate(props, propName, componentName, location, propFullName) { - var propValue = props[propName]; - for (var i = 0; i < expectedValues.length; i++) { - if (is(propValue, expectedValues[i])) { - return null; - } - } - - var valuesString = JSON.stringify(expectedValues); - return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.')); - } - return createChainableTypeChecker(validate); - } - - function createObjectOfTypeChecker(typeChecker) { - function validate(props, propName, componentName, location, propFullName) { - if (typeof typeChecker !== 'function') { - return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.'); - } - var propValue = props[propName]; - var propType = getPropType(propValue); - if (propType !== 'object') { - return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.')); - } - for (var key in propValue) { - if (propValue.hasOwnProperty(key)) { - var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); - if (error instanceof Error) { - return error; - } - } - } - return null; - } - return createChainableTypeChecker(validate); - } - - function createUnionTypeChecker(arrayOfTypeCheckers) { - if (!Array.isArray(arrayOfTypeCheckers)) { - process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid argument supplied to oneOfType, expected an instance of array.') : void 0; - return emptyFunction.thatReturnsNull; - } - - for (var i = 0; i < arrayOfTypeCheckers.length; i++) { - var checker = arrayOfTypeCheckers[i]; - if (typeof checker !== 'function') { - warning( - false, - 'Invalid argument supplid to oneOfType. Expected an array of check functions, but ' + - 'received %s at index %s.', - getPostfixForTypeWarning(checker), - i - ); - return emptyFunction.thatReturnsNull; - } - } - - function validate(props, propName, componentName, location, propFullName) { - for (var i = 0; i < arrayOfTypeCheckers.length; i++) { - var checker = arrayOfTypeCheckers[i]; - if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret) == null) { - return null; - } - } - - return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.')); - } - return createChainableTypeChecker(validate); - } - - function createNodeChecker() { - function validate(props, propName, componentName, location, propFullName) { - if (!isNode(props[propName])) { - return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.')); - } - return null; - } - return createChainableTypeChecker(validate); - } - - function createShapeTypeChecker(shapeTypes) { - function validate(props, propName, componentName, location, propFullName) { - var propValue = props[propName]; - var propType = getPropType(propValue); - if (propType !== 'object') { - return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.')); - } - for (var key in shapeTypes) { - var checker = shapeTypes[key]; - if (!checker) { - continue; - } - var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); - if (error) { - return error; - } - } - return null; - } - return createChainableTypeChecker(validate); - } - - function isNode(propValue) { - switch (typeof propValue) { - case 'number': - case 'string': - case 'undefined': - return true; - case 'boolean': - return !propValue; - case 'object': - if (Array.isArray(propValue)) { - return propValue.every(isNode); - } - if (propValue === null || isValidElement(propValue)) { - return true; - } - - var iteratorFn = getIteratorFn(propValue); - if (iteratorFn) { - var iterator = iteratorFn.call(propValue); - var step; - if (iteratorFn !== propValue.entries) { - while (!(step = iterator.next()).done) { - if (!isNode(step.value)) { - return false; - } - } - } else { - // Iterator will provide entry [k,v] tuples rather than values. - while (!(step = iterator.next()).done) { - var entry = step.value; - if (entry) { - if (!isNode(entry[1])) { - return false; - } - } - } - } - } else { - return false; - } - - return true; - default: - return false; - } - } - - function isSymbol(propType, propValue) { - // Native Symbol. - if (propType === 'symbol') { - return true; - } - - // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol' - if (propValue['@@toStringTag'] === 'Symbol') { - return true; - } - - // Fallback for non-spec compliant Symbols which are polyfilled. - if (typeof Symbol === 'function' && propValue instanceof Symbol) { - return true; - } - - return false; - } - - // Equivalent of `typeof` but with special handling for array and regexp. - function getPropType(propValue) { - var propType = typeof propValue; - if (Array.isArray(propValue)) { - return 'array'; - } - if (propValue instanceof RegExp) { - // Old webkits (at least until Android 4.0) return 'function' rather than - // 'object' for typeof a RegExp. We'll normalize this here so that /bla/ - // passes PropTypes.object. - return 'object'; - } - if (isSymbol(propType, propValue)) { - return 'symbol'; - } - return propType; - } - - // This handles more types than `getPropType`. Only used for error messages. - // See `createPrimitiveTypeChecker`. - function getPreciseType(propValue) { - if (typeof propValue === 'undefined' || propValue === null) { - return '' + propValue; - } - var propType = getPropType(propValue); - if (propType === 'object') { - if (propValue instanceof Date) { - return 'date'; - } else if (propValue instanceof RegExp) { - return 'regexp'; - } - } - return propType; - } - - // Returns a string that is postfixed to a warning about an invalid type. - // For example, "undefined" or "of type array" - function getPostfixForTypeWarning(value) { - var type = getPreciseType(value); - switch (type) { - case 'array': - case 'object': - return 'an ' + type; - case 'boolean': - case 'date': - case 'regexp': - return 'a ' + type; - default: - return type; - } - } - - // Returns class name of the object, if any. - function getClassName(propValue) { - if (!propValue.constructor || !propValue.constructor.name) { - return ANONYMOUS; - } - return propValue.constructor.name; - } - - ReactPropTypes.checkPropTypes = checkPropTypes; - ReactPropTypes.PropTypes = ReactPropTypes; - - return ReactPropTypes; -}; - -}).call(this,require('_process')) -},{"./checkPropTypes":13,"./lib/ReactPropTypesSecret":17,"_process":12,"fbjs/lib/emptyFunction":5,"fbjs/lib/invariant":7,"fbjs/lib/warning":8}],16:[function(require,module,exports){ -(function (process){ -/** - * Copyright 2013-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -if (process.env.NODE_ENV !== 'production') { - var REACT_ELEMENT_TYPE = (typeof Symbol === 'function' && - Symbol.for && - Symbol.for('react.element')) || - 0xeac7; - - var isValidElement = function(object) { - return typeof object === 'object' && - object !== null && - object.$$typeof === REACT_ELEMENT_TYPE; - }; - - // By explicitly using `prop-types` you are opting into new development behavior. - // http://fb.me/prop-types-in-prod - var throwOnDirectAccess = true; - module.exports = require('./factoryWithTypeCheckers')(isValidElement, throwOnDirectAccess); -} else { - // By explicitly using `prop-types` you are opting into new production behavior. - // http://fb.me/prop-types-in-prod - module.exports = require('./factoryWithThrowingShims')(); -} - -}).call(this,require('_process')) -},{"./factoryWithThrowingShims":14,"./factoryWithTypeCheckers":15,"_process":12}],17:[function(require,module,exports){ -/** - * Copyright 2013-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -'use strict'; - -var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'; - -module.exports = ReactPropTypesSecret; - -},{}],18:[function(require,module,exports){ -"use strict";function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var _createClass=function(){function e(e,t){for(var r=0;r0?e-1:e}},{key:"getTopSpacerHeight",value:function(t){return t*this.heightData}},{key:"getBottomSpacerHeight",value:function(t){var e=t+1;return Math.max(0,(this.numberOfChildren-e)*this.heightData)}}]),e}(InfiniteComputer);module.exports=ConstantInfiniteComputer; +},{"../utils/binaryIndexSearch.js":8,"./infiniteComputer.js":7}],6:[function(require,module,exports){ +"use strict";function _classCallCheck(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var _createClass=function(){function t(t,e){for(var n=0;n0?e-1:e}},{key:"getTopSpacerHeight",value:function(t){return t*this.heightData}},{key:"getBottomSpacerHeight",value:function(t){var e=t+1;return Math.max(0,(this.numberOfChildren-e)*this.heightData)}}]),e}(InfiniteComputer);module.exports=ConstantInfiniteComputer; -},{"./infiniteComputer.js":20}],20:[function(require,module,exports){ +},{"./infiniteComputer.js":7}],7:[function(require,module,exports){ "use strict";function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var _createClass=function(){function e(e,t){for(var n=0;nt&&(a=o-1)}return e===opts.CLOSEST_LOWER&&s>0?n=s-1:e===opts.CLOSEST_HIGHER&&a=0||Object.prototype.hasOwnProperty.call(e,n)&&(o[n]=e[n]);return o}function createInfiniteComputer(e,t){var o=React.Children.count(t);return Array.isArray(e)?new ArrayInfiniteComputer(e,o):new ConstantInfiniteComputer(e,o)}function recomputeApertureStateFromOptionsAndScrollTop(e,t){var o=e.preloadBatchSize,n=e.preloadAdditionalHeight,r=e.infiniteComputer,i=0===o?0:Math.floor(t/o),a=o*i,p=a+o,l=Math.max(0,a-n),u=Math.min(r.getTotalScrollableHeight(),p+n);return{displayIndexStart:r.getDisplayIndexStart(l),displayIndexEnd:r.getDisplayIndexEnd(u)}}function generateComputedProps(e){var t=e.containerHeight,o=e.preloadBatchSize,n=e.preloadAdditionalHeight,r=e.handleScroll,i=e.onInfiniteLoad,a=_objectWithoutProperties(e,["containerHeight","preloadBatchSize","preloadAdditionalHeight","handleScroll","onInfiniteLoad"]),p={};t="number"==typeof t?t:0,p.containerHeight=e.useWindowAsScrollContainer?window.innerHeight:t,p.handleScroll=r||function(){},p.onInfiniteLoad=i||function(){};var l={type:scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR,amount:.5},u=o&&o.type?o:l;"number"==typeof o?p.preloadBatchSize=o:"object"===(void 0===u?"undefined":_typeof(u))&&u.type===scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR?p.preloadBatchSize=p.containerHeight*u.amount:p.preloadBatchSize=0;var c={type:scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR,amount:1},d=n&&n.type?n:c;return"number"==typeof n?p.preloadAdditionalHeight=n:"object"===(void 0===d?"undefined":_typeof(d))&&d.type===scaleEnum.CONTAINER_HEIGHT_SCALE_FACTOR?p.preloadAdditionalHeight=p.containerHeight*d.amount:p.preloadAdditionalHeight=0,Object.assign(a,p)}function buildHeightStyle(e){return{width:"100%",height:Math.ceil(e)}}var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ConstantInfiniteComputer=require("../computers/constantInfiniteComputer.js"),ArrayInfiniteComputer=require("../computers/arrayInfiniteComputer.js"),scaleEnum=require("./scaleEnum"),React=global.React||require("react"),window=require("./window");module.exports={createInfiniteComputer:createInfiniteComputer,recomputeApertureStateFromOptionsAndScrollTop:recomputeApertureStateFromOptionsAndScrollTop,generateComputedProps:generateComputedProps,buildHeightStyle:buildHeightStyle}; }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"../computers/arrayInfiniteComputer.js":18,"../computers/constantInfiniteComputer.js":19,"react":undefined}],25:[function(require,module,exports){ +},{"../computers/arrayInfiniteComputer.js":5,"../computers/constantInfiniteComputer.js":6,"./scaleEnum":12,"./window":13,"react":undefined}],12:[function(require,module,exports){ "use strict";module.exports={CONTAINER_HEIGHT_SCALE_FACTOR:"containerHeightScaleFactor"}; -},{}],26:[function(require,module,exports){ -(function (global){ -"use strict";var PropTypes=global.PropTypes||require("prop-types");module.exports={preloadType:PropTypes.oneOfType([PropTypes.number,PropTypes.shape({type:PropTypes.oneOf(["containerHeightScaleFactor"]).isRequired,amount:PropTypes.number.isRequired})])}; - - -}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"prop-types":16}],27:[function(require,module,exports){ +},{}],13:[function(require,module,exports){ (function (global){ "use strict";var win;win="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},module.exports=win; diff --git a/dist/react-infinite.min.js b/dist/react-infinite.min.js index 6c2af6f..4ec48b3 100644 --- a/dist/react-infinite.min.js +++ b/dist/react-infinite.min.js @@ -1,2 +1 @@ -!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.Infinite=e()}}(function(){return function e(t,n,o){function r(a,s){if(!n[a]){if(!t[a]){var l="function"==typeof require&&require;if(!s&&l)return l(a,!0);if(i)return i(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var u=n[a]={exports:{}};t[a][0].call(u.exports,function(e){var n=t[a][1][e];return r(n?n:e)},u,u.exports,e,t,n,o)}return n[a].exports}for(var i="function"==typeof require&&require,a=0;a=0||Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]);return n}var r=n.React||e("react"),i=n.PropTypes||e("prop-types"),a=n.createReactClass||e("create-react-class"),s=e("./utils/window");e("./utils/establish-polyfills");var l=e("./utils/scaleEnum"),c=e("./utils/infiniteHelpers"),u=e("lodash.isfinite"),p=e("./utils/types").preloadType,f=f=e("./utils/checkProps"),d=a({propTypes:{children:i.any,handleScroll:i.func,preloadBatchSize:p,preloadAdditionalHeight:p,elementHeight:i.oneOfType([i.number,i.arrayOf(i.number)]).isRequired,containerHeight:i.number,useWindowAsScrollContainer:i.bool,displayBottomUpwards:i.bool.isRequired,infiniteLoadBeginEdgeOffset:i.number,onInfiniteLoad:i.func,loadingSpinnerDelegate:i.node,isInfiniteLoading:i.bool,timeScrollStateLastsForAfterUserScrolls:i.number,className:i.string,styles:i.shape({scrollableStyle:i.object}).isRequired},statics:{containerHeightScaleFactor:function(e){if(!u(e))throw new Error("The scale factor must be a number.");return{type:l.CONTAINER_HEIGHT_SCALE_FACTOR,amount:e}}},computedProps:{},utils:{},shouldAttachToBottom:!1,preservedScrollState:0,loadingSpinnerHeight:0,deprecationWarned:!1,scrollable:null,topSpacer:null,bottomSpacer:null,smoothScrollingWrapper:null,loadingSpinner:null,getDefaultProps:function(){return{handleScroll:function(){},useWindowAsScrollContainer:!1,onInfiniteLoad:function(){},loadingSpinnerDelegate:r.createElement("div",null),displayBottomUpwards:!1,isInfiniteLoading:!1,timeScrollStateLastsForAfterUserScrolls:150,className:"",styles:{}}},getInitialState:function(){var e=this.recomputeInternalStateFromProps(this.props);this.computedProps=e.computedProps,this.utils=e.utils,this.shouldAttachToBottom=this.props.displayBottomUpwards;var t=e.newState;return t.scrollTimeout=void 0,t.isScrolling=!1,t},generateComputedProps:function(e){var t=e.containerHeight,n=e.preloadBatchSize,r=e.preloadAdditionalHeight,i=o(e,["containerHeight","preloadBatchSize","preloadAdditionalHeight"]),a={};t="number"==typeof t?t:0,a.containerHeight=e.useWindowAsScrollContainer?s.innerHeight:t,void 0!==i.infiniteLoadBeginBottomOffset&&(a.infiniteLoadBeginEdgeOffset=i.infiniteLoadBeginBottomOffset,this.deprecationWarned||(console.error("Warning: React Infinite's infiniteLoadBeginBottomOffset prop\n has been deprecated as of 0.6.0. Please use infiniteLoadBeginEdgeOffset.\n Because this is a rather descriptive name, a simple find and replace\n should suffice."),this.deprecationWarned=!0));var c={type:l.CONTAINER_HEIGHT_SCALE_FACTOR,amount:.5},u=n&&n.type?n:c;"number"==typeof n?a.preloadBatchSize=n:"object"==typeof u&&u.type===l.CONTAINER_HEIGHT_SCALE_FACTOR?a.preloadBatchSize=a.containerHeight*u.amount:a.preloadBatchSize=0;var p={type:l.CONTAINER_HEIGHT_SCALE_FACTOR,amount:1},f=r&&r.type?r:p;return"number"==typeof r?a.preloadAdditionalHeight=r:"object"==typeof f&&f.type===l.CONTAINER_HEIGHT_SCALE_FACTOR?a.preloadAdditionalHeight=a.containerHeight*f.amount:a.preloadAdditionalHeight=0,Object.assign(i,a)},generateComputedUtilityFunctions:function(e){var t=this,n={};return n.getLoadingSpinnerHeight=function(){var e=0;return t.loadingSpinner&&(e=t.loadingSpinner.offsetHeight||0),e},e.useWindowAsScrollContainer?(n.subscribeToScrollListener=function(){s.addEventListener("scroll",t.infiniteHandleScroll)},n.unsubscribeFromScrollListener=function(){s.removeEventListener("scroll",t.infiniteHandleScroll)},n.nodeScrollListener=function(){},n.getScrollTop=function(){return s.pageYOffset},n.setScrollTop=function(e){s.scroll(s.pageXOffset,e)},n.scrollShouldBeIgnored=function(){return!1},n.buildScrollableStyle=function(){return{}}):(n.subscribeToScrollListener=function(){},n.unsubscribeFromScrollListener=function(){},n.nodeScrollListener=this.infiniteHandleScroll,n.getScrollTop=function(){return t.scrollable?t.scrollable.scrollTop:0},n.setScrollTop=function(e){t.scrollable&&(t.scrollable.scrollTop=e)},n.scrollShouldBeIgnored=function(e){return e.target!==t.scrollable},n.buildScrollableStyle=function(){return Object.assign({},{height:t.computedProps.containerHeight,overflowX:"hidden",overflowY:"scroll",WebkitOverflowScrolling:"touch"},t.computedProps.styles.scrollableStyle||{})}),n},recomputeInternalStateFromProps:function(e){f(e);var t=this.generateComputedProps(e),n=this.generateComputedUtilityFunctions(e),o={};return o.numberOfChildren=r.Children.count(t.children),o.infiniteComputer=c.createInfiniteComputer(t.elementHeight,t.children),void 0!==t.isInfiniteLoading&&(o.isInfiniteLoading=t.isInfiniteLoading),o.preloadBatchSize=t.preloadBatchSize,o.preloadAdditionalHeight=t.preloadAdditionalHeight,o=Object.assign(o,c.recomputeApertureStateFromOptionsAndScrollTop(o,n.getScrollTop())),{computedProps:t,utils:n,newState:o}},componentWillReceiveProps:function(e){var t=this.recomputeInternalStateFromProps(e);this.computedProps=t.computedProps,this.utils=t.utils,this.setState(t.newState)},componentWillUpdate:function(){this.props.displayBottomUpwards&&(this.preservedScrollState=this.utils.getScrollTop()-this.loadingSpinnerHeight)},componentDidUpdate:function(e,t){if(this.loadingSpinnerHeight=this.utils.getLoadingSpinnerHeight(),this.props.displayBottomUpwards){var n=this.getLowestPossibleScrollTop();this.shouldAttachToBottom&&this.utils.getScrollTop()this.state.infiniteComputer.getTotalScrollableHeight()-this.computedProps.containerHeight-this.computedProps.infiniteLoadBeginEdgeOffset},onInfiniteLoad:function(){this.setState({isInfiniteLoading:!0}),this.computedProps.onInfiniteLoad()},handleScroll:function(e){this.shouldAttachToBottom=this.computedProps.displayBottomUpwards&&e>=this.getLowestPossibleScrollTop(),this.manageScrollTimeouts();var t=c.recomputeApertureStateFromOptionsAndScrollTop(this.state,e);this.passedEdgeForInfiniteScroll(e)&&!this.state.isInfiniteLoading?(this.setState(Object.assign({},t)),this.onInfiniteLoad()):this.setState(t)},buildHeightStyle:function(e){return{width:"100%",height:Math.ceil(e)}},render:function(){var e,t=this;e=this.state.numberOfChildren>1?this.computedProps.children.slice(this.state.displayIndexStart,this.state.displayIndexEnd+1):this.computedProps.children;var n={};this.state.isScrolling&&(n.pointerEvents="none");var o=this.state.infiniteComputer.getTopSpacerHeight(this.state.displayIndexStart),i=this.state.infiniteComputer.getBottomSpacerHeight(this.state.displayIndexEnd);if(this.computedProps.displayBottomUpwards){var a=this.computedProps.containerHeight-this.state.infiniteComputer.getTotalScrollableHeight();a>0&&(o=a-this.loadingSpinnerHeight)}var s=void 0===this.computedProps.infiniteLoadBeginEdgeOffset?null:r.createElement("div",{ref:function(e){t.loadingSpinner=e}},this.state.isInfiniteLoading?this.computedProps.loadingSpinnerDelegate:null);return r.createElement("div",{className:this.computedProps.className,ref:function(e){t.scrollable=e},style:this.utils.buildScrollableStyle(),onScroll:this.utils.nodeScrollListener},r.createElement("div",{ref:function(e){t.smoothScrollingWrapper=e},style:n},r.createElement("div",{ref:function(e){t.topSpacer=e},style:this.buildHeightStyle(o)}),this.computedProps.displayBottomUpwards&&s,e,!this.computedProps.displayBottomUpwards&&s,r.createElement("div",{ref:function(e){t.bottomSpacer=e},style:this.buildHeightStyle(i)})))}});t.exports=d,n.Infinite=d}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./utils/checkProps":22,"./utils/establish-polyfills":23,"./utils/infiniteHelpers":24,"./utils/scaleEnum":25,"./utils/types":26,"./utils/window":27,"create-react-class":3,"lodash.isfinite":10,"prop-types":16,react:void 0}],2:[function(e,t,n){(function(n){"use strict";function o(e){return e}function r(e,t,r){function p(e,t,o){for(var r in t)t.hasOwnProperty(r)&&"production"!==n.env.NODE_ENV&&l("function"==typeof t[r],"%s: %s type `%s` is invalid; it must be a function, usually from React.PropTypes.",e.displayName||"ReactClass",c[o],r)}function f(e,t){var n=O.hasOwnProperty(t)?O[t]:null;I.hasOwnProperty(t)&&s("OVERRIDE_BASE"===n,"ReactClassInterface: You are attempting to override `%s` from your class specification. Ensure that your method names do not overlap with React methods.",t),e&&s("DEFINE_MANY"===n||"DEFINE_MANY_MERGED"===n,"ReactClassInterface: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",t)}function d(e,o){if(o){s("function"!=typeof o,"ReactClass: You're attempting to use a component class or function as a mixin. Instead, just use a regular object."),s(!t(o),"ReactClass: You're attempting to use a component as a mixin. Instead, just use a regular object.");var r=e.prototype,i=r.__reactAutoBindPairs;o.hasOwnProperty(u)&&w.mixins(e,o.mixins);for(var a in o)if(o.hasOwnProperty(a)&&a!==u){var c=o[a],p=r.hasOwnProperty(a);if(f(p,a),w.hasOwnProperty(a))w[a](e,c);else{var d=O.hasOwnProperty(a),h="function"==typeof c,y=h&&!d&&!p&&o.autobind!==!1;if(y)i.push(a,c),r[a]=c;else if(p){var b=O[a];s(d&&("DEFINE_MANY_MERGED"===b||"DEFINE_MANY"===b),"ReactClass: Unexpected spec policy %s for key %s when mixing in component specs.",b,a),"DEFINE_MANY_MERGED"===b?r[a]=m(r[a],c):"DEFINE_MANY"===b&&(r[a]=g(r[a],c))}else r[a]=c,"production"!==n.env.NODE_ENV&&"function"==typeof c&&o.displayName&&(r[a].displayName=o.displayName+"_"+a)}}}else if("production"!==n.env.NODE_ENV){var v=typeof o,S="object"===v&&null!==o;"production"!==n.env.NODE_ENV&&l(S,"%s: You're attempting to include a mixin that is either null or not an object. Check the mixins included by the component, as well as any mixins they include themselves. Expected object but got %s.",e.displayName||"ReactClass",null===o?null:v)}}function h(e,t){if(t)for(var n in t){var o=t[n];if(t.hasOwnProperty(n)){var r=n in w;s(!r,'ReactClass: You are attempting to define a reserved property, `%s`, that shouldn\'t be on the "statics" key. Define it as an instance property instead; it will still be accessible on the constructor.',n);var i=n in e;s(!i,"ReactClass: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",n),e[n]=o}}}function y(e,t){s(e&&t&&"object"==typeof e&&"object"==typeof t,"mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.");for(var n in t)t.hasOwnProperty(n)&&(s(void 0===e[n],"mergeIntoWithNoDuplicateKeys(): Tried to merge two objects with the same key: `%s`. This conflict may be due to a mixin; in particular, this may be caused by two getInitialState() or getDefaultProps() methods returning objects with clashing keys.",n),e[n]=t[n]);return e}function m(e,t){return function(){var n=e.apply(this,arguments),o=t.apply(this,arguments);if(null==n)return o;if(null==o)return n;var r={};return y(r,n),y(r,o),r}}function g(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function b(e,t){var o=t.bind(e);if("production"!==n.env.NODE_ENV){o.__reactBoundContext=e,o.__reactBoundMethod=t,o.__reactBoundArguments=null;var r=e.constructor.displayName,i=o.bind;o.bind=function(a){for(var s=arguments.length,c=Array(s>1?s-1:0),u=1;u1?t-1:0),o=1;o2?n-2:0),r=2;r-1&&e%1==0&&e<=b}function a(e){return s(e)&&y.call(e)==u}function s(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function l(e){return null!=e&&(a(e)?m.test(d.call(e)):o(e)&&p.test(e))}var c="[object Array]",u="[object Function]",p=/^\[object .+?Constructor\]$/,f=Object.prototype,d=Function.prototype.toString,h=f.hasOwnProperty,y=f.toString,m=RegExp("^"+d.call(h).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),g=r(Array,"isArray"),b=9007199254740991,v=g||function(e){return o(e)&&i(e.length)&&y.call(e)==c};t.exports=v},{}],10:[function(e,t,n){(function(e){function n(e){return"number"==typeof e&&o(e)}var o=e.isFinite;t.exports=n}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],11:[function(e,t,n){"use strict";function o(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}var r=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;t.exports=Object.assign||function(e,t){for(var n,a,s=o(e),l=1;l0?t-1:t}},{key:"getTopSpacerHeight",value:function(e){return e*this.heightData}},{key:"getBottomSpacerHeight",value:function(e){var t=e+1;return Math.max(0,(this.numberOfChildren-t)*this.heightData)}}]),t}(s);t.exports=l},{"./infiniteComputer.js":20}],20:[function(e,t,n){"use strict";function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var r=function(){function e(e,t){for(var n=0;nt&&(s=i-1)}return n===o.CLOSEST_LOWER&&l>0?r=l-1:n===o.CLOSEST_HIGHER&&s1?this.computedProps.children.slice(this.state.displayIndexStart,this.state.displayIndexEnd+1):this.computedProps.children;var n={};this.state.isScrolling&&(n.pointerEvents="none");var o=this.state.infiniteComputer.getTopSpacerHeight(this.state.displayIndexStart),i=this.state.infiniteComputer.getBottomSpacerHeight(this.state.displayIndexEnd);if(this.computedProps.displayBottomUpwards){var r=this.computedProps.containerHeight-this.state.infiniteComputer.getTotalScrollableHeight();r>0&&(o=r-this.loadingSpinnerHeight)}var l=void 0===this.computedProps.infiniteLoadBeginEdgeOffset?null:a.createElement("div",{ref:function(e){t.loadingSpinner=e}},this.state.isInfiniteLoading?this.computedProps.loadingSpinnerDelegate:null);return a.createElement("div",{className:this.computedProps.className,ref:function(e){t.scrollable=e},style:this.utils.buildScrollableStyle(),onScroll:this.utils.nodeScrollListener},a.createElement("div",{ref:function(e){t.smoothScrollingWrapper=e},style:n},a.createElement("div",{ref:function(e){t.topSpacer=e},style:p.buildHeightStyle(o)}),this.computedProps.displayBottomUpwards&&l,e,!this.computedProps.displayBottomUpwards&&l,a.createElement("div",{ref:function(e){t.bottomSpacer=e},style:p.buildHeightStyle(i)})))}}]),t}(a.Component);h.propTypes={children:s.any,handleScroll:s.func,preloadBatchSize:s.oneOfType([s.number,s.shape({type:s.oneOf(["containerHeightScaleFactor"]).isRequired,amount:s.number.isRequired})]),preloadAdditionalHeight:s.oneOfType([s.number,s.shape({type:s.oneOf(["containerHeightScaleFactor"]).isRequired,amount:s.number.isRequired})]),elementHeight:s.oneOfType([s.number,s.arrayOf(s.number)]).isRequired,containerHeight:s.number,useWindowAsScrollContainer:s.bool,displayBottomUpwards:s.bool.isRequired,infiniteLoadBeginEdgeOffset:s.number,onInfiniteLoad:s.func,loadingSpinnerDelegate:s.node,isInfiniteLoading:s.bool,timeScrollStateLastsForAfterUserScrolls:s.number,className:s.string,styles:s.shape({scrollableStyle:s.object}).isRequired},h.defaultProps={handleScroll:function(){},useWindowAsScrollContainer:!1,onInfiniteLoad:function(){},loadingSpinnerDelegate:a.createElement("div",null),displayBottomUpwards:!1,isInfiniteLoading:!1,timeScrollStateLastsForAfterUserScrolls:150,className:"",styles:{}};var g=function(){var e=this;this.shouldAttachToBottom=!1,this.preservedScrollState=0,this.loadingSpinnerHeight=0,this.generateComputedUtilityFunctions=function(t){var n={};return n.getLoadingSpinnerHeight=function(){var t=0;return e.loadingSpinner&&(t=e.loadingSpinner.offsetHeight||0),t},t.useWindowAsScrollContainer?(n.subscribeToScrollListener=function(){u.addEventListener("scroll",e.infiniteHandleScroll)},n.unsubscribeFromScrollListener=function(){u.removeEventListener("scroll",e.infiniteHandleScroll)},n.nodeScrollListener=function(){},n.getScrollTop=function(){return u.pageYOffset},n.setScrollTop=function(e){u.scroll(u.pageXOffset,e)},n.scrollShouldBeIgnored=function(){return!1},n.buildScrollableStyle=function(){return{}}):(n.subscribeToScrollListener=function(){},n.unsubscribeFromScrollListener=function(){},n.nodeScrollListener=e.infiniteHandleScroll,n.getScrollTop=function(){return e.scrollable?e.scrollable.scrollTop:0},n.setScrollTop=function(t){e.scrollable&&(e.scrollable.scrollTop=t)},n.scrollShouldBeIgnored=function(t){return t.target!==e.scrollable},n.buildScrollableStyle=function(){return Object.assign({},{height:e.computedProps.containerHeight,overflowX:"hidden",overflowY:"scroll",WebkitOverflowScrolling:"touch"},e.computedProps.styles.scrollableStyle||{})}),n},this.recomputeInternalStateFromProps=function(t){d(t);var n=p.generateComputedProps(t),o=e.generateComputedUtilityFunctions(t),i={};return i.numberOfChildren=a.Children.count(n.children),i.infiniteComputer=p.createInfiniteComputer(n.elementHeight,n.children),void 0!==n.isInfiniteLoading&&(i.isInfiniteLoading=n.isInfiniteLoading),i.preloadBatchSize=n.preloadBatchSize,i.preloadAdditionalHeight=n.preloadAdditionalHeight,i=Object.assign(i,p.recomputeApertureStateFromOptionsAndScrollTop(i,o.getScrollTop())),{computedProps:n,utils:o,newState:i}},this.infiniteHandleScroll=function(t){e.utils.scrollShouldBeIgnored(t)||(e.computedProps.handleScroll(e.scrollable),e.handleScroll(e.utils.getScrollTop()))},this.manageScrollTimeouts=function(){e.state.scrollTimeout&&clearTimeout(e.state.scrollTimeout);var t=e,n=setTimeout(function(){t.setState({isScrolling:!1,scrollTimeout:void 0})},e.computedProps.timeScrollStateLastsForAfterUserScrolls);e.setState({isScrolling:!0,scrollTimeout:n})},this.getLowestPossibleScrollTop=function(){return e.state.infiniteComputer.getTotalScrollableHeight()-e.computedProps.containerHeight},this.hasAllVisibleItems=function(){return!(f(e.computedProps.infiniteLoadBeginEdgeOffset)&&e.state.infiniteComputer.getTotalScrollableHeight()e.state.infiniteComputer.getTotalScrollableHeight()-e.computedProps.containerHeight-n)},this.onInfiniteLoad=function(){e.setState({isInfiniteLoading:!0}),e.computedProps.onInfiniteLoad()},this.handleScroll=function(t){e.shouldAttachToBottom=e.computedProps.displayBottomUpwards&&t>=e.getLowestPossibleScrollTop(),e.manageScrollTimeouts();var n=p.recomputeApertureStateFromOptionsAndScrollTop(e.state,t);e.passedEdgeForInfiniteScroll(t)&&!e.state.isInfiniteLoading?(e.setState(Object.assign({},n)),e.onInfiniteLoad()):e.setState(n)}};t.exports=h,n.Infinite=h}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./utils/checkProps":9,"./utils/establish-polyfills":10,"./utils/infiniteHelpers":11,"./utils/scaleEnum":12,"./utils/window":13,"lodash.isfinite":3,"prop-types":void 0,react:void 0}],2:[function(e,t,n){function o(e){return!!e&&"object"==typeof e}function i(e,t){var n=null==e?void 0:e[t];return s(n)?n:void 0}function r(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=b}function l(e){return a(e)&&g.call(e)==c}function a(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function s(e){return null!=e&&(l(e)?y.test(d.call(e)):o(e)&&p.test(e))}var u="[object Array]",c="[object Function]",p=/^\[object .+?Constructor\]$/,f=Object.prototype,d=Function.prototype.toString,h=f.hasOwnProperty,g=f.toString,y=RegExp("^"+d.call(h).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),m=i(Array,"isArray"),b=9007199254740991,S=m||function(e){return o(e)&&r(e.length)&&g.call(e)==u};t.exports=S},{}],3:[function(e,t,n){(function(e){function n(e){return"number"==typeof e&&o(e)}var o=e.isFinite;t.exports=n}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],4:[function(e,t,n){"use strict";function o(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}var i=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;t.exports=Object.assign||function(e,t){for(var n,l,a=o(e),s=1;s0?t-1:t}},{key:"getTopSpacerHeight",value:function(e){return e*this.heightData}},{key:"getBottomSpacerHeight",value:function(e){var t=e+1;return Math.max(0,(this.numberOfChildren-t)*this.heightData)}}]),t}(a);t.exports=s},{"./infiniteComputer.js":7}],7:[function(e,t,n){"use strict";function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var i=function(){function e(e,t){for(var n=0;nt&&(a=r-1)}return n===o.CLOSEST_LOWER&&s>0?i=s-1:n===o.CLOSEST_HIGHER&&a=0||Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]);return n}function i(e,t){var n=f.Children.count(t);return Array.isArray(e)?new c(e,n):new u(e,n)}function r(e,t){var n=e.preloadBatchSize,o=e.preloadAdditionalHeight,i=e.infiniteComputer,r=0===n?0:Math.floor(t/n),l=n*r,a=l+n,s=Math.max(0,l-o),u=Math.min(i.getTotalScrollableHeight(),a+o);return{displayIndexStart:i.getDisplayIndexStart(s),displayIndexEnd:i.getDisplayIndexEnd(u)}}function l(e){var t=e.containerHeight,n=e.preloadBatchSize,i=e.preloadAdditionalHeight,r=e.handleScroll,l=e.onInfiniteLoad,a=o(e,["containerHeight","preloadBatchSize","preloadAdditionalHeight","handleScroll","onInfiniteLoad"]),u={};t="number"==typeof t?t:0,u.containerHeight=e.useWindowAsScrollContainer?d.innerHeight:t,u.handleScroll=r||function(){},u.onInfiniteLoad=l||function(){};var c={type:p.CONTAINER_HEIGHT_SCALE_FACTOR,amount:.5},f=n&&n.type?n:c;"number"==typeof n?u.preloadBatchSize=n:"object"===(void 0===f?"undefined":s(f))&&f.type===p.CONTAINER_HEIGHT_SCALE_FACTOR?u.preloadBatchSize=u.containerHeight*f.amount:u.preloadBatchSize=0;var h={type:p.CONTAINER_HEIGHT_SCALE_FACTOR,amount:1},g=i&&i.type?i:h;return"number"==typeof i?u.preloadAdditionalHeight=i:"object"===(void 0===g?"undefined":s(g))&&g.type===p.CONTAINER_HEIGHT_SCALE_FACTOR?u.preloadAdditionalHeight=u.containerHeight*g.amount:u.preloadAdditionalHeight=0,Object.assign(a,u)}function a(e){return{width:"100%",height:Math.ceil(e)}}var s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u=e("../computers/constantInfiniteComputer.js"),c=e("../computers/arrayInfiniteComputer.js"),p=e("./scaleEnum"),f=n.React||e("react"),d=e("./window");t.exports={createInfiniteComputer:i,recomputeApertureStateFromOptionsAndScrollTop:r,generateComputedProps:l,buildHeightStyle:a}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../computers/arrayInfiniteComputer.js":5,"../computers/constantInfiniteComputer.js":6,"./scaleEnum":12,"./window":13,react:void 0}],12:[function(e,t,n){"use strict";t.exports={CONTAINER_HEIGHT_SCALE_FACTOR:"containerHeightScaleFactor"}},{}],13:[function(e,t,n){(function(e){"use strict";var n;n="undefined"!=typeof window?window:"undefined"!=typeof e?e:"undefined"!=typeof self?self:{},t.exports=n}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)}); \ No newline at end of file From 29f658d404c686fc96dbd37b80c1d13616e7a81d Mon Sep 17 00:00:00 2001 From: Gareth Tan Date: Mon, 7 Aug 2017 11:02:26 -0400 Subject: [PATCH 74/78] Ignore additional files. --- .flowconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/.flowconfig b/.flowconfig index 65d8b62..0671382 100644 --- a/.flowconfig +++ b/.flowconfig @@ -3,6 +3,7 @@ .*/build/.* .*/dist/.* .*/y18n/.* +.*/babel-plugin-transform-react-remove-prop-types/.* .*json [include] From ef8d2d2ea4bcb7559fe153baa8ce0402aabe1400 Mon Sep 17 00:00:00 2001 From: Gareth Tan Date: Mon, 7 Aug 2017 11:02:44 -0400 Subject: [PATCH 75/78] 0.12.0 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 801ea9e..8dd8ec6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "react-infinite", - "version": "0.11.2", + "version": "0.12.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 087c853..a12ea0f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-infinite", - "version": "0.11.2", + "version": "0.12.0", "description": "A browser-ready efficient scrolling container based on UITableView", "main": "build/react-infinite.js", "repository": { From 919459f7b94062661b2e68ac93ede18e2ec205b4 Mon Sep 17 00:00:00 2001 From: Thomas Huston Date: Wed, 2 Aug 2017 15:21:32 -0400 Subject: [PATCH 76/78] Start listening to window scroll events when useWindowAsScrollContainer changes after the component has mounted. --- __tests__/__snapshots__/infinite_test.js.snap | 193 ++++++++++++++++++ __tests__/infinite_test.js | 40 ++++ src/react-infinite.jsx | 7 + 3 files changed, 240 insertions(+) diff --git a/__tests__/__snapshots__/infinite_test.js.snap b/__tests__/__snapshots__/infinite_test.js.snap index 09ff4f9..31a717f 100644 --- a/__tests__/__snapshots__/infinite_test.js.snap +++ b/__tests__/__snapshots__/infinite_test.js.snap @@ -383,6 +383,199 @@ exports[`React Infinite when the window is used as the Container hides DOM eleme
    `; +exports[`React Infinite when the window is used as the Container reacts to window scroll events when useWindowAsScrollContainer is enabled after the initial render 1`] = ` +} + onInfiniteLoad={[Function]} + styles={Object {}} + timeScrollStateLastsForAfterUserScrolls={10000} + useWindowAsScrollContainer={false} +> +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + +`; + +exports[`React Infinite when the window is used as the Container reacts to window scroll events when useWindowAsScrollContainer is enabled after the initial render 2`] = ` +} + onInfiniteLoad={[Function]} + styles={Object {}} + timeScrollStateLastsForAfterUserScrolls={10000} + useWindowAsScrollContainer={true} +> +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + +`; + exports[`Rendering the React Infinite Component Wrapper applies the provided class name to the root node 1`] = `
    { + window.addEventListener = function(event, f) { + if (event === 'scroll') { + resolve(f); + } + }; + }); + + const rootNode = mount( + + {renderHelpers.divGenerator(20, elementHeight)} + + ); + + expect(mountToJson(rootNode)).toMatchSnapshot(); + + rootNode.setProps({ + useWindowAsScrollContainer: true + }); + + return listenerTriggered.then(listener => { + window.pageYOffset = 200; + listener(); + expect(mountToJson(rootNode)).toMatchSnapshot(); + window.addEventListener = oldAdd; + }); + }); }); describe("Specifying React Infinite's preload amounts", function() { diff --git a/src/react-infinite.jsx b/src/react-infinite.jsx index c8071ab..2f0ec04 100644 --- a/src/react-infinite.jsx +++ b/src/react-infinite.jsx @@ -257,6 +257,13 @@ class Infinite extends React.Component< ) { this.loadingSpinnerHeight = this.utils.getLoadingSpinnerHeight(); + if ( + !prevProps.useWindowAsScrollContainer && + this.props.useWindowAsScrollContainer + ) { + this.utils.subscribeToScrollListener(); + } + if (this.props.displayBottomUpwards) { var lowestScrollTop = this.getLowestPossibleScrollTop(); if ( From 8278fee623fcbe22091b817f97cc4230c7d2f6db Mon Sep 17 00:00:00 2001 From: Gareth Tan Date: Mon, 7 Aug 2017 11:44:14 -0400 Subject: [PATCH 77/78] 0.12.1 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 8dd8ec6..cfdb57b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "react-infinite", - "version": "0.12.0", + "version": "0.12.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index a12ea0f..c2bc62e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-infinite", - "version": "0.12.0", + "version": "0.12.1", "description": "A browser-ready efficient scrolling container based on UITableView", "main": "build/react-infinite.js", "repository": { From 48182b46e7a64831aaca756d51a9e29fa4db1244 Mon Sep 17 00:00:00 2001 From: Gareth Tan Date: Mon, 7 Aug 2017 11:44:48 -0400 Subject: [PATCH 78/78] Update dist files. --- dist/react-infinite.js | 2 +- dist/react-infinite.min.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/react-infinite.js b/dist/react-infinite.js index d05b860..61c38f1 100644 --- a/dist/react-infinite.js +++ b/dist/react-infinite.js @@ -1,6 +1,6 @@ (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Infinite = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o1?this.computedProps.children.slice(this.state.displayIndexStart,this.state.displayIndexEnd+1):this.computedProps.children;var i={};this.state.isScrolling&&(i.pointerEvents="none");var o=this.state.infiniteComputer.getTopSpacerHeight(this.state.displayIndexStart),n=this.state.infiniteComputer.getBottomSpacerHeight(this.state.displayIndexEnd);if(this.computedProps.displayBottomUpwards){var r=this.computedProps.containerHeight-this.state.infiniteComputer.getTotalScrollableHeight();r>0&&(o=r-this.loadingSpinnerHeight)}var s=void 0===this.computedProps.infiniteLoadBeginEdgeOffset?null:React.createElement("div",{ref:function(e){t.loadingSpinner=e}},this.state.isInfiniteLoading?this.computedProps.loadingSpinnerDelegate:null);return React.createElement("div",{className:this.computedProps.className,ref:function(e){t.scrollable=e},style:this.utils.buildScrollableStyle(),onScroll:this.utils.nodeScrollListener},React.createElement("div",{ref:function(e){t.smoothScrollingWrapper=e},style:i},React.createElement("div",{ref:function(e){t.topSpacer=e},style:infiniteHelpers.buildHeightStyle(o)}),this.computedProps.displayBottomUpwards&&s,e,!this.computedProps.displayBottomUpwards&&s,React.createElement("div",{ref:function(e){t.bottomSpacer=e},style:infiniteHelpers.buildHeightStyle(n)})))}}]),t}(React.Component);Infinite.propTypes={children:PropTypes.any,handleScroll:PropTypes.func,preloadBatchSize:PropTypes.oneOfType([PropTypes.number,PropTypes.shape({type:PropTypes.oneOf(["containerHeightScaleFactor"]).isRequired,amount:PropTypes.number.isRequired})]),preloadAdditionalHeight:PropTypes.oneOfType([PropTypes.number,PropTypes.shape({type:PropTypes.oneOf(["containerHeightScaleFactor"]).isRequired,amount:PropTypes.number.isRequired})]),elementHeight:PropTypes.oneOfType([PropTypes.number,PropTypes.arrayOf(PropTypes.number)]).isRequired,containerHeight:PropTypes.number,useWindowAsScrollContainer:PropTypes.bool,displayBottomUpwards:PropTypes.bool.isRequired,infiniteLoadBeginEdgeOffset:PropTypes.number,onInfiniteLoad:PropTypes.func,loadingSpinnerDelegate:PropTypes.node,isInfiniteLoading:PropTypes.bool,timeScrollStateLastsForAfterUserScrolls:PropTypes.number,className:PropTypes.string,styles:PropTypes.shape({scrollableStyle:PropTypes.object}).isRequired},Infinite.defaultProps={handleScroll:function(){},useWindowAsScrollContainer:!1,onInfiniteLoad:function(){},loadingSpinnerDelegate:React.createElement("div",null),displayBottomUpwards:!1,isInfiniteLoading:!1,timeScrollStateLastsForAfterUserScrolls:150,className:"",styles:{}};var _initialiseProps=function(){var e=this;this.shouldAttachToBottom=!1,this.preservedScrollState=0,this.loadingSpinnerHeight=0,this.generateComputedUtilityFunctions=function(t){var i={};return i.getLoadingSpinnerHeight=function(){var t=0;return e.loadingSpinner&&(t=e.loadingSpinner.offsetHeight||0),t},t.useWindowAsScrollContainer?(i.subscribeToScrollListener=function(){window.addEventListener("scroll",e.infiniteHandleScroll)},i.unsubscribeFromScrollListener=function(){window.removeEventListener("scroll",e.infiniteHandleScroll)},i.nodeScrollListener=function(){},i.getScrollTop=function(){return window.pageYOffset},i.setScrollTop=function(e){window.scroll(window.pageXOffset,e)},i.scrollShouldBeIgnored=function(){return!1},i.buildScrollableStyle=function(){return{}}):(i.subscribeToScrollListener=function(){},i.unsubscribeFromScrollListener=function(){},i.nodeScrollListener=e.infiniteHandleScroll,i.getScrollTop=function(){return e.scrollable?e.scrollable.scrollTop:0},i.setScrollTop=function(t){e.scrollable&&(e.scrollable.scrollTop=t)},i.scrollShouldBeIgnored=function(t){return t.target!==e.scrollable},i.buildScrollableStyle=function(){return Object.assign({},{height:e.computedProps.containerHeight,overflowX:"hidden",overflowY:"scroll",WebkitOverflowScrolling:"touch"},e.computedProps.styles.scrollableStyle||{})}),i},this.recomputeInternalStateFromProps=function(t){checkProps(t);var i=infiniteHelpers.generateComputedProps(t),o=e.generateComputedUtilityFunctions(t),n={};return n.numberOfChildren=React.Children.count(i.children),n.infiniteComputer=infiniteHelpers.createInfiniteComputer(i.elementHeight,i.children),void 0!==i.isInfiniteLoading&&(n.isInfiniteLoading=i.isInfiniteLoading),n.preloadBatchSize=i.preloadBatchSize,n.preloadAdditionalHeight=i.preloadAdditionalHeight,n=Object.assign(n,infiniteHelpers.recomputeApertureStateFromOptionsAndScrollTop(n,o.getScrollTop())),{computedProps:i,utils:o,newState:n}},this.infiniteHandleScroll=function(t){e.utils.scrollShouldBeIgnored(t)||(e.computedProps.handleScroll(e.scrollable),e.handleScroll(e.utils.getScrollTop()))},this.manageScrollTimeouts=function(){e.state.scrollTimeout&&clearTimeout(e.state.scrollTimeout);var t=e,i=setTimeout(function(){t.setState({isScrolling:!1,scrollTimeout:void 0})},e.computedProps.timeScrollStateLastsForAfterUserScrolls);e.setState({isScrolling:!0,scrollTimeout:i})},this.getLowestPossibleScrollTop=function(){return e.state.infiniteComputer.getTotalScrollableHeight()-e.computedProps.containerHeight},this.hasAllVisibleItems=function(){return!(_isFinite(e.computedProps.infiniteLoadBeginEdgeOffset)&&e.state.infiniteComputer.getTotalScrollableHeight()e.state.infiniteComputer.getTotalScrollableHeight()-e.computedProps.containerHeight-i)},this.onInfiniteLoad=function(){e.setState({isInfiniteLoading:!0}),e.computedProps.onInfiniteLoad()},this.handleScroll=function(t){e.shouldAttachToBottom=e.computedProps.displayBottomUpwards&&t>=e.getLowestPossibleScrollTop(),e.manageScrollTimeouts();var i=infiniteHelpers.recomputeApertureStateFromOptionsAndScrollTop(e.state,t);e.passedEdgeForInfiniteScroll(t)&&!e.state.isInfiniteLoading?(e.setState(Object.assign({},i)),e.onInfiniteLoad()):e.setState(i)}};module.exports=Infinite,global.Infinite=Infinite; +"use strict";function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var _createClass=function(){function e(e,t){for(var i=0;i1?this.computedProps.children.slice(this.state.displayIndexStart,this.state.displayIndexEnd+1):this.computedProps.children;var i={};this.state.isScrolling&&(i.pointerEvents="none");var o=this.state.infiniteComputer.getTopSpacerHeight(this.state.displayIndexStart),n=this.state.infiniteComputer.getBottomSpacerHeight(this.state.displayIndexEnd);if(this.computedProps.displayBottomUpwards){var r=this.computedProps.containerHeight-this.state.infiniteComputer.getTotalScrollableHeight();r>0&&(o=r-this.loadingSpinnerHeight)}var s=void 0===this.computedProps.infiniteLoadBeginEdgeOffset?null:React.createElement("div",{ref:function(e){t.loadingSpinner=e}},this.state.isInfiniteLoading?this.computedProps.loadingSpinnerDelegate:null);return React.createElement("div",{className:this.computedProps.className,ref:function(e){t.scrollable=e},style:this.utils.buildScrollableStyle(),onScroll:this.utils.nodeScrollListener},React.createElement("div",{ref:function(e){t.smoothScrollingWrapper=e},style:i},React.createElement("div",{ref:function(e){t.topSpacer=e},style:infiniteHelpers.buildHeightStyle(o)}),this.computedProps.displayBottomUpwards&&s,e,!this.computedProps.displayBottomUpwards&&s,React.createElement("div",{ref:function(e){t.bottomSpacer=e},style:infiniteHelpers.buildHeightStyle(n)})))}}]),t}(React.Component);Infinite.propTypes={children:PropTypes.any,handleScroll:PropTypes.func,preloadBatchSize:PropTypes.oneOfType([PropTypes.number,PropTypes.shape({type:PropTypes.oneOf(["containerHeightScaleFactor"]).isRequired,amount:PropTypes.number.isRequired})]),preloadAdditionalHeight:PropTypes.oneOfType([PropTypes.number,PropTypes.shape({type:PropTypes.oneOf(["containerHeightScaleFactor"]).isRequired,amount:PropTypes.number.isRequired})]),elementHeight:PropTypes.oneOfType([PropTypes.number,PropTypes.arrayOf(PropTypes.number)]).isRequired,containerHeight:PropTypes.number,useWindowAsScrollContainer:PropTypes.bool,displayBottomUpwards:PropTypes.bool.isRequired,infiniteLoadBeginEdgeOffset:PropTypes.number,onInfiniteLoad:PropTypes.func,loadingSpinnerDelegate:PropTypes.node,isInfiniteLoading:PropTypes.bool,timeScrollStateLastsForAfterUserScrolls:PropTypes.number,className:PropTypes.string,styles:PropTypes.shape({scrollableStyle:PropTypes.object}).isRequired},Infinite.defaultProps={handleScroll:function(){},useWindowAsScrollContainer:!1,onInfiniteLoad:function(){},loadingSpinnerDelegate:React.createElement("div",null),displayBottomUpwards:!1,isInfiniteLoading:!1,timeScrollStateLastsForAfterUserScrolls:150,className:"",styles:{}};var _initialiseProps=function(){var e=this;this.shouldAttachToBottom=!1,this.preservedScrollState=0,this.loadingSpinnerHeight=0,this.generateComputedUtilityFunctions=function(t){var i={};return i.getLoadingSpinnerHeight=function(){var t=0;return e.loadingSpinner&&(t=e.loadingSpinner.offsetHeight||0),t},t.useWindowAsScrollContainer?(i.subscribeToScrollListener=function(){window.addEventListener("scroll",e.infiniteHandleScroll)},i.unsubscribeFromScrollListener=function(){window.removeEventListener("scroll",e.infiniteHandleScroll)},i.nodeScrollListener=function(){},i.getScrollTop=function(){return window.pageYOffset},i.setScrollTop=function(e){window.scroll(window.pageXOffset,e)},i.scrollShouldBeIgnored=function(){return!1},i.buildScrollableStyle=function(){return{}}):(i.subscribeToScrollListener=function(){},i.unsubscribeFromScrollListener=function(){},i.nodeScrollListener=e.infiniteHandleScroll,i.getScrollTop=function(){return e.scrollable?e.scrollable.scrollTop:0},i.setScrollTop=function(t){e.scrollable&&(e.scrollable.scrollTop=t)},i.scrollShouldBeIgnored=function(t){return t.target!==e.scrollable},i.buildScrollableStyle=function(){return Object.assign({},{height:e.computedProps.containerHeight,overflowX:"hidden",overflowY:"scroll",WebkitOverflowScrolling:"touch"},e.computedProps.styles.scrollableStyle||{})}),i},this.recomputeInternalStateFromProps=function(t){checkProps(t);var i=infiniteHelpers.generateComputedProps(t),o=e.generateComputedUtilityFunctions(t),n={};return n.numberOfChildren=React.Children.count(i.children),n.infiniteComputer=infiniteHelpers.createInfiniteComputer(i.elementHeight,i.children),void 0!==i.isInfiniteLoading&&(n.isInfiniteLoading=i.isInfiniteLoading),n.preloadBatchSize=i.preloadBatchSize,n.preloadAdditionalHeight=i.preloadAdditionalHeight,n=Object.assign(n,infiniteHelpers.recomputeApertureStateFromOptionsAndScrollTop(n,o.getScrollTop())),{computedProps:i,utils:o,newState:n}},this.infiniteHandleScroll=function(t){e.utils.scrollShouldBeIgnored(t)||(e.computedProps.handleScroll(e.scrollable),e.handleScroll(e.utils.getScrollTop()))},this.manageScrollTimeouts=function(){e.state.scrollTimeout&&clearTimeout(e.state.scrollTimeout);var t=e,i=setTimeout(function(){t.setState({isScrolling:!1,scrollTimeout:void 0})},e.computedProps.timeScrollStateLastsForAfterUserScrolls);e.setState({isScrolling:!0,scrollTimeout:i})},this.getLowestPossibleScrollTop=function(){return e.state.infiniteComputer.getTotalScrollableHeight()-e.computedProps.containerHeight},this.hasAllVisibleItems=function(){return!(_isFinite(e.computedProps.infiniteLoadBeginEdgeOffset)&&e.state.infiniteComputer.getTotalScrollableHeight()e.state.infiniteComputer.getTotalScrollableHeight()-e.computedProps.containerHeight-i)},this.onInfiniteLoad=function(){e.setState({isInfiniteLoading:!0}),e.computedProps.onInfiniteLoad()},this.handleScroll=function(t){e.shouldAttachToBottom=e.computedProps.displayBottomUpwards&&t>=e.getLowestPossibleScrollTop(),e.manageScrollTimeouts();var i=infiniteHelpers.recomputeApertureStateFromOptionsAndScrollTop(e.state,t);e.passedEdgeForInfiniteScroll(t)&&!e.state.isInfiniteLoading?(e.setState(Object.assign({},i)),e.onInfiniteLoad()):e.setState(i)}};module.exports=Infinite,global.Infinite=Infinite; }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{"./utils/checkProps":9,"./utils/establish-polyfills":10,"./utils/infiniteHelpers":11,"./utils/scaleEnum":12,"./utils/window":13,"lodash.isfinite":3,"prop-types":undefined,"react":undefined}],2:[function(require,module,exports){ /** diff --git a/dist/react-infinite.min.js b/dist/react-infinite.min.js index 4ec48b3..22c7e30 100644 --- a/dist/react-infinite.min.js +++ b/dist/react-infinite.min.js @@ -1 +1 @@ -!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.Infinite=e()}}(function(){return function e(t,n,o){function i(l,a){if(!n[l]){if(!t[l]){var s="function"==typeof require&&require;if(!a&&s)return s(l,!0);if(r)return r(l,!0);var u=new Error("Cannot find module '"+l+"'");throw u.code="MODULE_NOT_FOUND",u}var c=n[l]={exports:{}};t[l][0].call(c.exports,function(e){var n=t[l][1][e];return i(n?n:e)},c,c.exports,e,t,n,o)}return n[l].exports}for(var r="function"==typeof require&&require,l=0;l1?this.computedProps.children.slice(this.state.displayIndexStart,this.state.displayIndexEnd+1):this.computedProps.children;var n={};this.state.isScrolling&&(n.pointerEvents="none");var o=this.state.infiniteComputer.getTopSpacerHeight(this.state.displayIndexStart),i=this.state.infiniteComputer.getBottomSpacerHeight(this.state.displayIndexEnd);if(this.computedProps.displayBottomUpwards){var r=this.computedProps.containerHeight-this.state.infiniteComputer.getTotalScrollableHeight();r>0&&(o=r-this.loadingSpinnerHeight)}var l=void 0===this.computedProps.infiniteLoadBeginEdgeOffset?null:a.createElement("div",{ref:function(e){t.loadingSpinner=e}},this.state.isInfiniteLoading?this.computedProps.loadingSpinnerDelegate:null);return a.createElement("div",{className:this.computedProps.className,ref:function(e){t.scrollable=e},style:this.utils.buildScrollableStyle(),onScroll:this.utils.nodeScrollListener},a.createElement("div",{ref:function(e){t.smoothScrollingWrapper=e},style:n},a.createElement("div",{ref:function(e){t.topSpacer=e},style:p.buildHeightStyle(o)}),this.computedProps.displayBottomUpwards&&l,e,!this.computedProps.displayBottomUpwards&&l,a.createElement("div",{ref:function(e){t.bottomSpacer=e},style:p.buildHeightStyle(i)})))}}]),t}(a.Component);h.propTypes={children:s.any,handleScroll:s.func,preloadBatchSize:s.oneOfType([s.number,s.shape({type:s.oneOf(["containerHeightScaleFactor"]).isRequired,amount:s.number.isRequired})]),preloadAdditionalHeight:s.oneOfType([s.number,s.shape({type:s.oneOf(["containerHeightScaleFactor"]).isRequired,amount:s.number.isRequired})]),elementHeight:s.oneOfType([s.number,s.arrayOf(s.number)]).isRequired,containerHeight:s.number,useWindowAsScrollContainer:s.bool,displayBottomUpwards:s.bool.isRequired,infiniteLoadBeginEdgeOffset:s.number,onInfiniteLoad:s.func,loadingSpinnerDelegate:s.node,isInfiniteLoading:s.bool,timeScrollStateLastsForAfterUserScrolls:s.number,className:s.string,styles:s.shape({scrollableStyle:s.object}).isRequired},h.defaultProps={handleScroll:function(){},useWindowAsScrollContainer:!1,onInfiniteLoad:function(){},loadingSpinnerDelegate:a.createElement("div",null),displayBottomUpwards:!1,isInfiniteLoading:!1,timeScrollStateLastsForAfterUserScrolls:150,className:"",styles:{}};var g=function(){var e=this;this.shouldAttachToBottom=!1,this.preservedScrollState=0,this.loadingSpinnerHeight=0,this.generateComputedUtilityFunctions=function(t){var n={};return n.getLoadingSpinnerHeight=function(){var t=0;return e.loadingSpinner&&(t=e.loadingSpinner.offsetHeight||0),t},t.useWindowAsScrollContainer?(n.subscribeToScrollListener=function(){u.addEventListener("scroll",e.infiniteHandleScroll)},n.unsubscribeFromScrollListener=function(){u.removeEventListener("scroll",e.infiniteHandleScroll)},n.nodeScrollListener=function(){},n.getScrollTop=function(){return u.pageYOffset},n.setScrollTop=function(e){u.scroll(u.pageXOffset,e)},n.scrollShouldBeIgnored=function(){return!1},n.buildScrollableStyle=function(){return{}}):(n.subscribeToScrollListener=function(){},n.unsubscribeFromScrollListener=function(){},n.nodeScrollListener=e.infiniteHandleScroll,n.getScrollTop=function(){return e.scrollable?e.scrollable.scrollTop:0},n.setScrollTop=function(t){e.scrollable&&(e.scrollable.scrollTop=t)},n.scrollShouldBeIgnored=function(t){return t.target!==e.scrollable},n.buildScrollableStyle=function(){return Object.assign({},{height:e.computedProps.containerHeight,overflowX:"hidden",overflowY:"scroll",WebkitOverflowScrolling:"touch"},e.computedProps.styles.scrollableStyle||{})}),n},this.recomputeInternalStateFromProps=function(t){d(t);var n=p.generateComputedProps(t),o=e.generateComputedUtilityFunctions(t),i={};return i.numberOfChildren=a.Children.count(n.children),i.infiniteComputer=p.createInfiniteComputer(n.elementHeight,n.children),void 0!==n.isInfiniteLoading&&(i.isInfiniteLoading=n.isInfiniteLoading),i.preloadBatchSize=n.preloadBatchSize,i.preloadAdditionalHeight=n.preloadAdditionalHeight,i=Object.assign(i,p.recomputeApertureStateFromOptionsAndScrollTop(i,o.getScrollTop())),{computedProps:n,utils:o,newState:i}},this.infiniteHandleScroll=function(t){e.utils.scrollShouldBeIgnored(t)||(e.computedProps.handleScroll(e.scrollable),e.handleScroll(e.utils.getScrollTop()))},this.manageScrollTimeouts=function(){e.state.scrollTimeout&&clearTimeout(e.state.scrollTimeout);var t=e,n=setTimeout(function(){t.setState({isScrolling:!1,scrollTimeout:void 0})},e.computedProps.timeScrollStateLastsForAfterUserScrolls);e.setState({isScrolling:!0,scrollTimeout:n})},this.getLowestPossibleScrollTop=function(){return e.state.infiniteComputer.getTotalScrollableHeight()-e.computedProps.containerHeight},this.hasAllVisibleItems=function(){return!(f(e.computedProps.infiniteLoadBeginEdgeOffset)&&e.state.infiniteComputer.getTotalScrollableHeight()e.state.infiniteComputer.getTotalScrollableHeight()-e.computedProps.containerHeight-n)},this.onInfiniteLoad=function(){e.setState({isInfiniteLoading:!0}),e.computedProps.onInfiniteLoad()},this.handleScroll=function(t){e.shouldAttachToBottom=e.computedProps.displayBottomUpwards&&t>=e.getLowestPossibleScrollTop(),e.manageScrollTimeouts();var n=p.recomputeApertureStateFromOptionsAndScrollTop(e.state,t);e.passedEdgeForInfiniteScroll(t)&&!e.state.isInfiniteLoading?(e.setState(Object.assign({},n)),e.onInfiniteLoad()):e.setState(n)}};t.exports=h,n.Infinite=h}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./utils/checkProps":9,"./utils/establish-polyfills":10,"./utils/infiniteHelpers":11,"./utils/scaleEnum":12,"./utils/window":13,"lodash.isfinite":3,"prop-types":void 0,react:void 0}],2:[function(e,t,n){function o(e){return!!e&&"object"==typeof e}function i(e,t){var n=null==e?void 0:e[t];return s(n)?n:void 0}function r(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=b}function l(e){return a(e)&&g.call(e)==c}function a(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function s(e){return null!=e&&(l(e)?y.test(d.call(e)):o(e)&&p.test(e))}var u="[object Array]",c="[object Function]",p=/^\[object .+?Constructor\]$/,f=Object.prototype,d=Function.prototype.toString,h=f.hasOwnProperty,g=f.toString,y=RegExp("^"+d.call(h).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),m=i(Array,"isArray"),b=9007199254740991,S=m||function(e){return o(e)&&r(e.length)&&g.call(e)==u};t.exports=S},{}],3:[function(e,t,n){(function(e){function n(e){return"number"==typeof e&&o(e)}var o=e.isFinite;t.exports=n}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],4:[function(e,t,n){"use strict";function o(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}var i=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;t.exports=Object.assign||function(e,t){for(var n,l,a=o(e),s=1;s0?t-1:t}},{key:"getTopSpacerHeight",value:function(e){return e*this.heightData}},{key:"getBottomSpacerHeight",value:function(e){var t=e+1;return Math.max(0,(this.numberOfChildren-t)*this.heightData)}}]),t}(a);t.exports=s},{"./infiniteComputer.js":7}],7:[function(e,t,n){"use strict";function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var i=function(){function e(e,t){for(var n=0;nt&&(a=r-1)}return n===o.CLOSEST_LOWER&&s>0?i=s-1:n===o.CLOSEST_HIGHER&&a=0||Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]);return n}function i(e,t){var n=f.Children.count(t);return Array.isArray(e)?new c(e,n):new u(e,n)}function r(e,t){var n=e.preloadBatchSize,o=e.preloadAdditionalHeight,i=e.infiniteComputer,r=0===n?0:Math.floor(t/n),l=n*r,a=l+n,s=Math.max(0,l-o),u=Math.min(i.getTotalScrollableHeight(),a+o);return{displayIndexStart:i.getDisplayIndexStart(s),displayIndexEnd:i.getDisplayIndexEnd(u)}}function l(e){var t=e.containerHeight,n=e.preloadBatchSize,i=e.preloadAdditionalHeight,r=e.handleScroll,l=e.onInfiniteLoad,a=o(e,["containerHeight","preloadBatchSize","preloadAdditionalHeight","handleScroll","onInfiniteLoad"]),u={};t="number"==typeof t?t:0,u.containerHeight=e.useWindowAsScrollContainer?d.innerHeight:t,u.handleScroll=r||function(){},u.onInfiniteLoad=l||function(){};var c={type:p.CONTAINER_HEIGHT_SCALE_FACTOR,amount:.5},f=n&&n.type?n:c;"number"==typeof n?u.preloadBatchSize=n:"object"===(void 0===f?"undefined":s(f))&&f.type===p.CONTAINER_HEIGHT_SCALE_FACTOR?u.preloadBatchSize=u.containerHeight*f.amount:u.preloadBatchSize=0;var h={type:p.CONTAINER_HEIGHT_SCALE_FACTOR,amount:1},g=i&&i.type?i:h;return"number"==typeof i?u.preloadAdditionalHeight=i:"object"===(void 0===g?"undefined":s(g))&&g.type===p.CONTAINER_HEIGHT_SCALE_FACTOR?u.preloadAdditionalHeight=u.containerHeight*g.amount:u.preloadAdditionalHeight=0,Object.assign(a,u)}function a(e){return{width:"100%",height:Math.ceil(e)}}var s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u=e("../computers/constantInfiniteComputer.js"),c=e("../computers/arrayInfiniteComputer.js"),p=e("./scaleEnum"),f=n.React||e("react"),d=e("./window");t.exports={createInfiniteComputer:i,recomputeApertureStateFromOptionsAndScrollTop:r,generateComputedProps:l,buildHeightStyle:a}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../computers/arrayInfiniteComputer.js":5,"../computers/constantInfiniteComputer.js":6,"./scaleEnum":12,"./window":13,react:void 0}],12:[function(e,t,n){"use strict";t.exports={CONTAINER_HEIGHT_SCALE_FACTOR:"containerHeightScaleFactor"}},{}],13:[function(e,t,n){(function(e){"use strict";var n;n="undefined"!=typeof window?window:"undefined"!=typeof e?e:"undefined"!=typeof self?self:{},t.exports=n}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)}); \ No newline at end of file +!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.Infinite=e()}}(function(){return function e(t,n,o){function i(l,a){if(!n[l]){if(!t[l]){var s="function"==typeof require&&require;if(!a&&s)return s(l,!0);if(r)return r(l,!0);var u=new Error("Cannot find module '"+l+"'");throw u.code="MODULE_NOT_FOUND",u}var c=n[l]={exports:{}};t[l][0].call(c.exports,function(e){var n=t[l][1][e];return i(n?n:e)},c,c.exports,e,t,n,o)}return n[l].exports}for(var r="function"==typeof require&&require,l=0;l1?this.computedProps.children.slice(this.state.displayIndexStart,this.state.displayIndexEnd+1):this.computedProps.children;var n={};this.state.isScrolling&&(n.pointerEvents="none");var o=this.state.infiniteComputer.getTopSpacerHeight(this.state.displayIndexStart),i=this.state.infiniteComputer.getBottomSpacerHeight(this.state.displayIndexEnd);if(this.computedProps.displayBottomUpwards){var r=this.computedProps.containerHeight-this.state.infiniteComputer.getTotalScrollableHeight();r>0&&(o=r-this.loadingSpinnerHeight)}var l=void 0===this.computedProps.infiniteLoadBeginEdgeOffset?null:a.createElement("div",{ref:function(e){t.loadingSpinner=e}},this.state.isInfiniteLoading?this.computedProps.loadingSpinnerDelegate:null);return a.createElement("div",{className:this.computedProps.className,ref:function(e){t.scrollable=e},style:this.utils.buildScrollableStyle(),onScroll:this.utils.nodeScrollListener},a.createElement("div",{ref:function(e){t.smoothScrollingWrapper=e},style:n},a.createElement("div",{ref:function(e){t.topSpacer=e},style:p.buildHeightStyle(o)}),this.computedProps.displayBottomUpwards&&l,e,!this.computedProps.displayBottomUpwards&&l,a.createElement("div",{ref:function(e){t.bottomSpacer=e},style:p.buildHeightStyle(i)})))}}]),t}(a.Component);h.propTypes={children:s.any,handleScroll:s.func,preloadBatchSize:s.oneOfType([s.number,s.shape({type:s.oneOf(["containerHeightScaleFactor"]).isRequired,amount:s.number.isRequired})]),preloadAdditionalHeight:s.oneOfType([s.number,s.shape({type:s.oneOf(["containerHeightScaleFactor"]).isRequired,amount:s.number.isRequired})]),elementHeight:s.oneOfType([s.number,s.arrayOf(s.number)]).isRequired,containerHeight:s.number,useWindowAsScrollContainer:s.bool,displayBottomUpwards:s.bool.isRequired,infiniteLoadBeginEdgeOffset:s.number,onInfiniteLoad:s.func,loadingSpinnerDelegate:s.node,isInfiniteLoading:s.bool,timeScrollStateLastsForAfterUserScrolls:s.number,className:s.string,styles:s.shape({scrollableStyle:s.object}).isRequired},h.defaultProps={handleScroll:function(){},useWindowAsScrollContainer:!1,onInfiniteLoad:function(){},loadingSpinnerDelegate:a.createElement("div",null),displayBottomUpwards:!1,isInfiniteLoading:!1,timeScrollStateLastsForAfterUserScrolls:150,className:"",styles:{}};var g=function(){var e=this;this.shouldAttachToBottom=!1,this.preservedScrollState=0,this.loadingSpinnerHeight=0,this.generateComputedUtilityFunctions=function(t){var n={};return n.getLoadingSpinnerHeight=function(){var t=0;return e.loadingSpinner&&(t=e.loadingSpinner.offsetHeight||0),t},t.useWindowAsScrollContainer?(n.subscribeToScrollListener=function(){u.addEventListener("scroll",e.infiniteHandleScroll)},n.unsubscribeFromScrollListener=function(){u.removeEventListener("scroll",e.infiniteHandleScroll)},n.nodeScrollListener=function(){},n.getScrollTop=function(){return u.pageYOffset},n.setScrollTop=function(e){u.scroll(u.pageXOffset,e)},n.scrollShouldBeIgnored=function(){return!1},n.buildScrollableStyle=function(){return{}}):(n.subscribeToScrollListener=function(){},n.unsubscribeFromScrollListener=function(){},n.nodeScrollListener=e.infiniteHandleScroll,n.getScrollTop=function(){return e.scrollable?e.scrollable.scrollTop:0},n.setScrollTop=function(t){e.scrollable&&(e.scrollable.scrollTop=t)},n.scrollShouldBeIgnored=function(t){return t.target!==e.scrollable},n.buildScrollableStyle=function(){return Object.assign({},{height:e.computedProps.containerHeight,overflowX:"hidden",overflowY:"scroll",WebkitOverflowScrolling:"touch"},e.computedProps.styles.scrollableStyle||{})}),n},this.recomputeInternalStateFromProps=function(t){d(t);var n=p.generateComputedProps(t),o=e.generateComputedUtilityFunctions(t),i={};return i.numberOfChildren=a.Children.count(n.children),i.infiniteComputer=p.createInfiniteComputer(n.elementHeight,n.children),void 0!==n.isInfiniteLoading&&(i.isInfiniteLoading=n.isInfiniteLoading),i.preloadBatchSize=n.preloadBatchSize,i.preloadAdditionalHeight=n.preloadAdditionalHeight,i=Object.assign(i,p.recomputeApertureStateFromOptionsAndScrollTop(i,o.getScrollTop())),{computedProps:n,utils:o,newState:i}},this.infiniteHandleScroll=function(t){e.utils.scrollShouldBeIgnored(t)||(e.computedProps.handleScroll(e.scrollable),e.handleScroll(e.utils.getScrollTop()))},this.manageScrollTimeouts=function(){e.state.scrollTimeout&&clearTimeout(e.state.scrollTimeout);var t=e,n=setTimeout(function(){t.setState({isScrolling:!1,scrollTimeout:void 0})},e.computedProps.timeScrollStateLastsForAfterUserScrolls);e.setState({isScrolling:!0,scrollTimeout:n})},this.getLowestPossibleScrollTop=function(){return e.state.infiniteComputer.getTotalScrollableHeight()-e.computedProps.containerHeight},this.hasAllVisibleItems=function(){return!(f(e.computedProps.infiniteLoadBeginEdgeOffset)&&e.state.infiniteComputer.getTotalScrollableHeight()e.state.infiniteComputer.getTotalScrollableHeight()-e.computedProps.containerHeight-n)},this.onInfiniteLoad=function(){e.setState({isInfiniteLoading:!0}),e.computedProps.onInfiniteLoad()},this.handleScroll=function(t){e.shouldAttachToBottom=e.computedProps.displayBottomUpwards&&t>=e.getLowestPossibleScrollTop(),e.manageScrollTimeouts();var n=p.recomputeApertureStateFromOptionsAndScrollTop(e.state,t);e.passedEdgeForInfiniteScroll(t)&&!e.state.isInfiniteLoading?(e.setState(Object.assign({},n)),e.onInfiniteLoad()):e.setState(n)}};t.exports=h,n.Infinite=h}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./utils/checkProps":9,"./utils/establish-polyfills":10,"./utils/infiniteHelpers":11,"./utils/scaleEnum":12,"./utils/window":13,"lodash.isfinite":3,"prop-types":void 0,react:void 0}],2:[function(e,t,n){function o(e){return!!e&&"object"==typeof e}function i(e,t){var n=null==e?void 0:e[t];return s(n)?n:void 0}function r(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=b}function l(e){return a(e)&&g.call(e)==c}function a(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function s(e){return null!=e&&(l(e)?y.test(d.call(e)):o(e)&&p.test(e))}var u="[object Array]",c="[object Function]",p=/^\[object .+?Constructor\]$/,f=Object.prototype,d=Function.prototype.toString,h=f.hasOwnProperty,g=f.toString,y=RegExp("^"+d.call(h).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),m=i(Array,"isArray"),b=9007199254740991,S=m||function(e){return o(e)&&r(e.length)&&g.call(e)==u};t.exports=S},{}],3:[function(e,t,n){(function(e){function n(e){return"number"==typeof e&&o(e)}var o=e.isFinite;t.exports=n}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],4:[function(e,t,n){"use strict";function o(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}var i=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;t.exports=Object.assign||function(e,t){for(var n,l,a=o(e),s=1;s0?t-1:t}},{key:"getTopSpacerHeight",value:function(e){return e*this.heightData}},{key:"getBottomSpacerHeight",value:function(e){var t=e+1;return Math.max(0,(this.numberOfChildren-t)*this.heightData)}}]),t}(a);t.exports=s},{"./infiniteComputer.js":7}],7:[function(e,t,n){"use strict";function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var i=function(){function e(e,t){for(var n=0;nt&&(a=r-1)}return n===o.CLOSEST_LOWER&&s>0?i=s-1:n===o.CLOSEST_HIGHER&&a=0||Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]);return n}function i(e,t){var n=f.Children.count(t);return Array.isArray(e)?new c(e,n):new u(e,n)}function r(e,t){var n=e.preloadBatchSize,o=e.preloadAdditionalHeight,i=e.infiniteComputer,r=0===n?0:Math.floor(t/n),l=n*r,a=l+n,s=Math.max(0,l-o),u=Math.min(i.getTotalScrollableHeight(),a+o);return{displayIndexStart:i.getDisplayIndexStart(s),displayIndexEnd:i.getDisplayIndexEnd(u)}}function l(e){var t=e.containerHeight,n=e.preloadBatchSize,i=e.preloadAdditionalHeight,r=e.handleScroll,l=e.onInfiniteLoad,a=o(e,["containerHeight","preloadBatchSize","preloadAdditionalHeight","handleScroll","onInfiniteLoad"]),u={};t="number"==typeof t?t:0,u.containerHeight=e.useWindowAsScrollContainer?d.innerHeight:t,u.handleScroll=r||function(){},u.onInfiniteLoad=l||function(){};var c={type:p.CONTAINER_HEIGHT_SCALE_FACTOR,amount:.5},f=n&&n.type?n:c;"number"==typeof n?u.preloadBatchSize=n:"object"===(void 0===f?"undefined":s(f))&&f.type===p.CONTAINER_HEIGHT_SCALE_FACTOR?u.preloadBatchSize=u.containerHeight*f.amount:u.preloadBatchSize=0;var h={type:p.CONTAINER_HEIGHT_SCALE_FACTOR,amount:1},g=i&&i.type?i:h;return"number"==typeof i?u.preloadAdditionalHeight=i:"object"===(void 0===g?"undefined":s(g))&&g.type===p.CONTAINER_HEIGHT_SCALE_FACTOR?u.preloadAdditionalHeight=u.containerHeight*g.amount:u.preloadAdditionalHeight=0,Object.assign(a,u)}function a(e){return{width:"100%",height:Math.ceil(e)}}var s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u=e("../computers/constantInfiniteComputer.js"),c=e("../computers/arrayInfiniteComputer.js"),p=e("./scaleEnum"),f=n.React||e("react"),d=e("./window");t.exports={createInfiniteComputer:i,recomputeApertureStateFromOptionsAndScrollTop:r,generateComputedProps:l,buildHeightStyle:a}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../computers/arrayInfiniteComputer.js":5,"../computers/constantInfiniteComputer.js":6,"./scaleEnum":12,"./window":13,react:void 0}],12:[function(e,t,n){"use strict";t.exports={CONTAINER_HEIGHT_SCALE_FACTOR:"containerHeightScaleFactor"}},{}],13:[function(e,t,n){(function(e){"use strict";var n;n="undefined"!=typeof window?window:"undefined"!=typeof e?e:"undefined"!=typeof self?self:{},t.exports=n}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)}); \ No newline at end of file