react-scrollable-feed
Advanced tools
Comparing version 2.0.1 to 2.0.2
@@ -10,2 +10,3 @@ import * as React from 'react'; | ||
onScroll?: (isAtBottom: boolean) => void; | ||
debug?: boolean; | ||
}; | ||
@@ -12,0 +13,0 @@ type ScrollableFeedComponentProps = React.PropsWithChildren<ScrollableFeedProps>; |
@@ -1,2 +0,2 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):(e||self).reactScrollableFeed=t(e.react)}(this,function(e){function t(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach(function(o){if("default"!==o){var r=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,r.get?r:{enumerable:!0,get:function(){return e[o]}})}}),t.default=e,t}var o=/*#__PURE__*/t(e);function r(e,t){return r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},r(e,t)}var n=/*#__PURE__*/function(e){var t,n;function i(t){var r;return(r=e.call(this,t)||this).wrapperRef=void 0,r.bottomRef=void 0,r.bottomRef=/*#__PURE__*/o.createRef(),r.wrapperRef=/*#__PURE__*/o.createRef(),r.handleScroll=r.handleScroll.bind(function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(r)),console.log("Component cstr"),r}n=e,(t=i).prototype=Object.create(n.prototype),t.prototype.constructor=t,r(t,n);var c=i.prototype;return c.getSnapshotBeforeUpdate=function(){return console.log("Component ",this.getSnapshotBeforeUpdate.name),!(!this.wrapperRef.current||!this.bottomRef.current)&&i.isViewable(this.wrapperRef.current,this.bottomRef.current,this.props.viewableDetectionEpsilon)},c.componentDidUpdate=function(e,t,o){console.log("Component ",this.componentDidUpdate.name);var r=this.props,n=r.forceScroll;(0,r.changeDetectionFilter)(e,this.props)&&(n||o)&&this.bottomRef.current&&this.wrapperRef.current&&this.scrollParentToChild(this.wrapperRef.current,this.bottomRef.current)},c.componentDidMount=function(){console.log("Component ",this.componentDidMount.name),this.bottomRef.current&&this.wrapperRef.current&&this.scrollParentToChild(this.wrapperRef.current,this.bottomRef.current)},c.scrollParentToChild=function(e,t){if(!i.isViewable(e,t,this.props.viewableDetectionEpsilon)){var o=e.getBoundingClientRect(),r=t.getBoundingClientRect(),n=this.props,c=n.animateScroll,l=n.onScrollComplete;c&&(c(e,r.top+e.scrollTop-o.top),l())}},i.isViewable=function(e,t,o){o=o||0;var r=e.getBoundingClientRect(),n=t.getBoundingClientRect();return n.top>=r.top&&r.top+e.clientHeight-n.top+o>=0},c.handleScroll=function(){var e=this.props,t=e.onScroll;t&&this.bottomRef.current&&this.wrapperRef.current&&t(i.isViewable(this.wrapperRef.current,this.bottomRef.current,e.viewableDetectionEpsilon))},c.scrollToBottom=function(){this.bottomRef.current&&this.wrapperRef.current&&this.scrollParentToChild(this.wrapperRef.current,this.bottomRef.current)},c.render=function(){console.log("Component ",this.render.name);var e=this.props;/*#__PURE__*/return o.createElement("div",{className:e.className,style:{maxHeight:"inherit",height:"inherit",overflowY:"auto"},ref:this.wrapperRef,onScroll:this.handleScroll},e.children,/*#__PURE__*/o.createElement("div",{ref:this.bottomRef}))},i}(o.Component);return n.defaultProps={forceScroll:!1,animateScroll:function(e,t){e.scrollBy?e.scrollBy({top:t}):e.scrollTop=t},onScrollComplete:function(){},changeDetectionFilter:function(){return!0},viewableDetectionEpsilon:2,onScroll:function(){}},n}); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):(e||self).reactScrollableFeed=t(e.react)}(this,function(e){function t(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach(function(o){if("default"!==o){var r=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,r.get?r:{enumerable:!0,get:function(){return e[o]}})}}),t.default=e,t}var o=/*#__PURE__*/t(e);function r(e,t){return r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},r(e,t)}var n=/*#__PURE__*/function(e){var t,n;function i(t){var r;return(r=e.call(this,t)||this).wrapperRef=void 0,r.bottomRef=void 0,r.bottomRef=/*#__PURE__*/o.createRef(),r.wrapperRef=/*#__PURE__*/o.createRef(),r.handleScroll=r.handleScroll.bind(function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(r)),r.props.debug&&console.log("Component cstr"),r}n=e,(t=i).prototype=Object.create(n.prototype),t.prototype.constructor=t,r(t,n);var c=i.prototype;return c.getSnapshotBeforeUpdate=function(){return this.props.debug&&console.log("Component ",this.getSnapshotBeforeUpdate.name),!(!this.wrapperRef.current||!this.bottomRef.current)&&i.isViewable(this.wrapperRef.current,this.bottomRef.current,this.props.viewableDetectionEpsilon)},c.componentDidUpdate=function(e,t,o){this.props.debug&&console.log("Component ",this.componentDidUpdate.name);var r=this.props,n=r.forceScroll;(0,r.changeDetectionFilter)(e,this.props)&&(n||o)&&this.bottomRef.current&&this.wrapperRef.current&&this.scrollParentToChild(this.wrapperRef.current,this.bottomRef.current)},c.componentDidMount=function(){this.props.debug&&console.log("Component ",this.componentDidMount.name),this.bottomRef.current&&this.wrapperRef.current&&this.scrollParentToChild(this.wrapperRef.current,this.bottomRef.current)},c.scrollParentToChild=function(e,t){if(!i.isViewable(e,t,this.props.viewableDetectionEpsilon)){var o=e.getBoundingClientRect(),r=t.getBoundingClientRect(),n=this.props,c=n.animateScroll,l=n.onScrollComplete;c&&(c(e,r.top+e.scrollTop-o.top),l())}},i.isViewable=function(e,t,o){o=o||0;var r=e.getBoundingClientRect(),n=t.getBoundingClientRect();return n.top>=r.top&&r.top+e.clientHeight-n.top+o>=0},c.handleScroll=function(){var e=this.props,t=e.onScroll;t&&this.bottomRef.current&&this.wrapperRef.current&&t(i.isViewable(this.wrapperRef.current,this.bottomRef.current,e.viewableDetectionEpsilon))},c.scrollToBottom=function(){this.bottomRef.current&&this.wrapperRef.current&&this.scrollParentToChild(this.wrapperRef.current,this.bottomRef.current)},c.render=function(){this.props.debug&&console.log("Component ",this.render.name);var e=this.props;/*#__PURE__*/return o.createElement("div",{className:e.className,style:{maxHeight:"inherit",height:"inherit",overflowY:"auto"},ref:this.wrapperRef,onScroll:this.handleScroll},e.children,/*#__PURE__*/o.createElement("div",{ref:this.bottomRef}))},i}(o.Component);return n.defaultProps={forceScroll:!1,animateScroll:function(e,t){e.scrollBy?e.scrollBy({top:t}):e.scrollTop=t},onScrollComplete:function(){},changeDetectionFilter:function(){return!0},viewableDetectionEpsilon:2,onScroll:function(){}},n}); | ||
//# sourceMappingURL=index.umd.js.map |
{ | ||
"name": "react-scrollable-feed", | ||
"version": "2.0.1", | ||
"version": "2.0.2", | ||
"description": "", | ||
"homepage": "https://dizco.github.io/react-scrollable-feed/", | ||
"type": "module", | ||
@@ -20,4 +21,2 @@ "source": "src/index.tsx", | ||
"prepare": "npm run build", | ||
"predeploy": "cd example && npm install && npm run build", | ||
"deploy": "gh-pages -d example/build", | ||
"cypress:open": "cross-env CYPRESS_CRASH_REPORTS=0 cypress open", | ||
@@ -41,3 +40,2 @@ "cypress:run": "cross-env CYPRESS_CRASH_REPORTS=0 cypress run" | ||
"cypress": "^13.6.2", | ||
"gh-pages": "^6.1.1", | ||
"microbundle": "^0.15.1" | ||
@@ -44,0 +42,0 @@ }, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
59781
4
97
2
0