Comparing version 2.3.0 to 2.4.0
@@ -5,2 +5,12 @@ # Change Log | ||
<a name="2.4.0"></a> | ||
# [2.4.0](https://gitlab.com/iiroj/app-bar/compare/v2.3.0...v2.4.0) (2019-01-04) | ||
### Features | ||
* use terser instead of babel-minify ([6487a6f](https://gitlab.com/iiroj/app-bar/commit/6487a6f)) | ||
<a name="2.3.0"></a> | ||
@@ -7,0 +17,0 @@ # [2.3.0](https://gitlab.com/iiroj/app-bar/compare/v2.2.1...v2.3.0) (2019-01-03) |
@@ -1,1 +0,1 @@ | ||
"use strict";var React=require("react"),extendStatics=function(a,c){return extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,c){a.__proto__=c}||function(a,c){for(var b in c)c.hasOwnProperty(b)&&(a[b]=c[b])},extendStatics(a,c)};function __extends(a,c){function b(){this.constructor=a}extendStatics(a,c),a.prototype=null===c?Object.create(c):(b.prototype=c.prototype,new b)}var __assign=function(){return __assign=Object.assign||function(a){for(var b,c=1,d=arguments.length;c<d;c++)for(var e in b=arguments[c],b)Object.prototype.hasOwnProperty.call(b,e)&&(a[e]=b[e]);return a},__assign.apply(this,arguments)};function __rest(a,b){var c={};for(var d in a)Object.prototype.hasOwnProperty.call(a,d)&&0>b.indexOf(d)&&(c[d]=a[d]);if(null!=a&&"function"==typeof Object.getOwnPropertySymbols)for(var e=0,d=Object.getOwnPropertySymbols(a);e<d.length;e++)0>b.indexOf(d[e])&&(c[d[e]]=a[d[e]]);return c}var AppBar=function(a){function b(){var b=null!==a&&a.apply(this,arguments)||this;return b.state={position:"unfixed",scroll:0,ref:b.props.innerRef||React.createRef(),top:0},b.animateTop=function(){var a=Math.min,c=Math.max,d=b.state.ref.current;if(d&&!b.props.disabled){var e=window.pageYOffset;if(!(0>e)){var f,g=d.classList,h=b.state.scroll,i=0<e-h?"down":"up",j=b.state.top+h-e,k=d.getBoundingClientRect(),l=k.height,m=k.top;"down"===i?(f=c(j,-l),!g.contains("hidden")&&j<-l&&(g.remove("pinned"),g.remove("unfixed"),g.add("hidden"),b.setState({position:"hidden"}))):(f=a(j,0),!g.contains("pinned")&&j>-l&&(g.remove("hidden"),g.remove("unfixed"),g.add("pinned"),b.setState({position:"pinned"}))),!g.contains("unfixed")&&(0<m||0===e)&&(g.remove("hidden"),g.remove("pinned"),g.add("unfixed"),b.setState({position:"unfixed"})),b.setState({scroll:e,top:f})}}},b.handleScroll=function(){return window.requestAnimationFrame(b.animateTop)},b}return __extends(b,a),b.prototype.addEventListener=function(){var a=this;"undefined"!=typeof window&&this.setState({scroll:window.pageYOffset},function(){return window.addEventListener("scroll",a.handleScroll)})},b.prototype.removeEventListener=function(){"undefined"!=typeof window&&window.removeEventListener("scroll",this.handleScroll)},b.prototype.componentDidMount=function(){this.props.disabled||this.addEventListener();var a=this.state.ref.current;if(a){var b=a.getBoundingClientRect(),c=b.height,d=b.top;0<=d?a.classList.add("unfixed"):d<-c?(a.classList.add("hidden"),this.setState({position:"hidden"})):(a.classList.add("pinned"),this.setState({position:"pinned"}))}},b.prototype.componentDidUpdate=function(a){var b=a.disabled,c=this.props.disabled;c===b||(c?this.removeEventListener():this.addEventListener())},b.prototype.componentWillUnmount=function(){this.props.disabled||this.removeEventListener()},b.prototype.render=function(){var a=this.props,b=a.children,c=a.innerRef,d=__rest(a,["children","innerRef"]),e=this.state,f=e.position,g=e.ref,h=e.top;return React.createElement("nav",__assign({ref:g,style:{position:"sticky",top:h+"px"}},d),"function"==typeof b?b(f):b)},b.defaultProps={disabled:!1},b}(React.PureComponent),index=React.forwardRef(function(a,b){return React.createElement(AppBar,__assign({},a,{innerRef:b}))});module.exports=index; | ||
"use strict";var React=require("react"),extendStatics=function(e,t){return(extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function __extends(e,t){function n(){this.constructor=e}extendStatics(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var __assign=function(){return(__assign=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function __rest(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&(n[i[o]]=e[i[o]])}return n}var AppBar=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={position:"unfixed",scroll:0,ref:t.props.innerRef||React.createRef(),top:0},t.animateTop=function(){var e=t.state.ref.current;if(e&&!t.props.disabled){var n=window.pageYOffset;if(!(n<0)){var i,o=e.classList,r=t.state.scroll,s=n-r>0?"down":"up",a=t.state.top+r-n,d=e.getBoundingClientRect(),p=d.height,c=d.top;"down"===s?(i=Math.max(a,-p),!o.contains("hidden")&&a<-p&&(o.remove("pinned"),o.remove("unfixed"),o.add("hidden"),t.setState({position:"hidden"}))):(i=Math.min(a,0),!o.contains("pinned")&&a>-p&&(o.remove("hidden"),o.remove("unfixed"),o.add("pinned"),t.setState({position:"pinned"}))),!o.contains("unfixed")&&(c>0||0===n)&&(o.remove("hidden"),o.remove("pinned"),o.add("unfixed"),t.setState({position:"unfixed"})),t.setState({scroll:n,top:i})}}},t.handleScroll=function(){return window.requestAnimationFrame(t.animateTop)},t}return __extends(t,e),t.prototype.addEventListener=function(){var e=this;"undefined"!=typeof window&&this.setState({scroll:window.pageYOffset},function(){return window.addEventListener("scroll",e.handleScroll)})},t.prototype.removeEventListener=function(){"undefined"!=typeof window&&window.removeEventListener("scroll",this.handleScroll)},t.prototype.componentDidMount=function(){this.props.disabled||this.addEventListener();var e=this.state.ref.current;if(e){var t=e.getBoundingClientRect(),n=t.height,i=t.top;i>=0?e.classList.add("unfixed"):i<-n?(e.classList.add("hidden"),this.setState({position:"hidden"})):(e.classList.add("pinned"),this.setState({position:"pinned"}))}},t.prototype.componentDidUpdate=function(e){var t=e.disabled,n=this.props.disabled;n!==t&&(n?this.removeEventListener():this.addEventListener())},t.prototype.componentWillUnmount=function(){this.props.disabled||this.removeEventListener()},t.prototype.render=function(){var e=this.props,t=e.children,n=(e.innerRef,__rest(e,["children","innerRef"])),i=this.state,o=i.position,r=i.ref,s={position:"sticky",top:i.top+"px"};return React.createElement("nav",__assign({ref:r,style:s},n),"function"==typeof t?t(o):t)},t.defaultProps={disabled:!1},t}(React.PureComponent),index=React.forwardRef(function(e,t){return React.createElement(AppBar,__assign({},e,{innerRef:t}))});module.exports=index; |
@@ -1,1 +0,1 @@ | ||
import{forwardRef,createElement,createRef,PureComponent}from"react";var extendStatics=function(a,c){return extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,c){a.__proto__=c}||function(a,c){for(var b in c)c.hasOwnProperty(b)&&(a[b]=c[b])},extendStatics(a,c)};function __extends(a,c){function b(){this.constructor=a}extendStatics(a,c),a.prototype=null===c?Object.create(c):(b.prototype=c.prototype,new b)}var __assign=function(){return __assign=Object.assign||function(a){for(var b,c=1,d=arguments.length;c<d;c++)for(var e in b=arguments[c],b)Object.prototype.hasOwnProperty.call(b,e)&&(a[e]=b[e]);return a},__assign.apply(this,arguments)};function __rest(a,b){var c={};for(var d in a)Object.prototype.hasOwnProperty.call(a,d)&&0>b.indexOf(d)&&(c[d]=a[d]);if(null!=a&&"function"==typeof Object.getOwnPropertySymbols)for(var e=0,d=Object.getOwnPropertySymbols(a);e<d.length;e++)0>b.indexOf(d[e])&&(c[d[e]]=a[d[e]]);return c}var AppBar=function(a){function b(){var b=null!==a&&a.apply(this,arguments)||this;return b.state={position:"unfixed",scroll:0,ref:b.props.innerRef||createRef(),top:0},b.animateTop=function(){var a=Math.min,c=Math.max,d=b.state.ref.current;if(d&&!b.props.disabled){var e=window.pageYOffset;if(!(0>e)){var f,g=d.classList,h=b.state.scroll,i=0<e-h?"down":"up",j=b.state.top+h-e,k=d.getBoundingClientRect(),l=k.height,m=k.top;"down"===i?(f=c(j,-l),!g.contains("hidden")&&j<-l&&(g.remove("pinned"),g.remove("unfixed"),g.add("hidden"),b.setState({position:"hidden"}))):(f=a(j,0),!g.contains("pinned")&&j>-l&&(g.remove("hidden"),g.remove("unfixed"),g.add("pinned"),b.setState({position:"pinned"}))),!g.contains("unfixed")&&(0<m||0===e)&&(g.remove("hidden"),g.remove("pinned"),g.add("unfixed"),b.setState({position:"unfixed"})),b.setState({scroll:e,top:f})}}},b.handleScroll=function(){return window.requestAnimationFrame(b.animateTop)},b}return __extends(b,a),b.prototype.addEventListener=function(){var a=this;"undefined"!=typeof window&&this.setState({scroll:window.pageYOffset},function(){return window.addEventListener("scroll",a.handleScroll)})},b.prototype.removeEventListener=function(){"undefined"!=typeof window&&window.removeEventListener("scroll",this.handleScroll)},b.prototype.componentDidMount=function(){this.props.disabled||this.addEventListener();var a=this.state.ref.current;if(a){var b=a.getBoundingClientRect(),c=b.height,d=b.top;0<=d?a.classList.add("unfixed"):d<-c?(a.classList.add("hidden"),this.setState({position:"hidden"})):(a.classList.add("pinned"),this.setState({position:"pinned"}))}},b.prototype.componentDidUpdate=function(a){var b=a.disabled,c=this.props.disabled;c===b||(c?this.removeEventListener():this.addEventListener())},b.prototype.componentWillUnmount=function(){this.props.disabled||this.removeEventListener()},b.prototype.render=function(){var a=this.props,b=a.children,c=a.innerRef,d=__rest(a,["children","innerRef"]),e=this.state,f=e.position,g=e.ref,h=e.top;return createElement("nav",__assign({ref:g,style:{position:"sticky",top:h+"px"}},d),"function"==typeof b?b(f):b)},b.defaultProps={disabled:!1},b}(PureComponent),index=forwardRef(function(a,b){return createElement(AppBar,__assign({},a,{innerRef:b}))});export default index; | ||
import{forwardRef as t,createElement as e,createRef as n,PureComponent as o}from"react";var i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};var r=function(){return(r=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};var s=function(t){function o(){var e=null!==t&&t.apply(this,arguments)||this;return e.state={position:"unfixed",scroll:0,ref:e.props.innerRef||n(),top:0},e.animateTop=function(){var t=e.state.ref.current;if(t&&!e.props.disabled){var n=window.pageYOffset;if(!(n<0)){var o,i=t.classList,r=e.state.scroll,s=n-r>0?"down":"up",d=e.state.top+r-n,p=t.getBoundingClientRect(),a=p.height,f=p.top;"down"===s?(o=Math.max(d,-a),!i.contains("hidden")&&d<-a&&(i.remove("pinned"),i.remove("unfixed"),i.add("hidden"),e.setState({position:"hidden"}))):(o=Math.min(d,0),!i.contains("pinned")&&d>-a&&(i.remove("hidden"),i.remove("unfixed"),i.add("pinned"),e.setState({position:"pinned"}))),!i.contains("unfixed")&&(f>0||0===n)&&(i.remove("hidden"),i.remove("pinned"),i.add("unfixed"),e.setState({position:"unfixed"})),e.setState({scroll:n,top:o})}}},e.handleScroll=function(){return window.requestAnimationFrame(e.animateTop)},e}return function(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}(o,t),o.prototype.addEventListener=function(){var t=this;"undefined"!=typeof window&&this.setState({scroll:window.pageYOffset},function(){return window.addEventListener("scroll",t.handleScroll)})},o.prototype.removeEventListener=function(){"undefined"!=typeof window&&window.removeEventListener("scroll",this.handleScroll)},o.prototype.componentDidMount=function(){this.props.disabled||this.addEventListener();var t=this.state.ref.current;if(t){var e=t.getBoundingClientRect(),n=e.height,o=e.top;o>=0?t.classList.add("unfixed"):o<-n?(t.classList.add("hidden"),this.setState({position:"hidden"})):(t.classList.add("pinned"),this.setState({position:"pinned"}))}},o.prototype.componentDidUpdate=function(t){var e=t.disabled,n=this.props.disabled;n!==e&&(n?this.removeEventListener():this.addEventListener())},o.prototype.componentWillUnmount=function(){this.props.disabled||this.removeEventListener()},o.prototype.render=function(){var t=this.props,n=t.children,o=(t.innerRef,function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(t);i<o.length;i++)e.indexOf(o[i])<0&&(n[o[i]]=t[o[i]])}return n}(t,["children","innerRef"])),i=this.state,s=i.position,d=i.ref,p=i.top;return e("nav",r({ref:d,style:{position:"sticky",top:p+"px"}},o),"function"==typeof n?n(s):n)},o.defaultProps={disabled:!1},o}(o);export default t(function(t,n){return e(s,r({},t,{innerRef:n}))}); |
@@ -1,1 +0,1 @@ | ||
(function(a,b){"object"==typeof exports&&"undefined"!=typeof module?module.exports=b(require("react")):"function"==typeof define&&define.amd?define(["react"],b):(a=a||self,a.appBar=b(a.React))})(this,function(a){"use strict";function b(a,c){function b(){this.constructor=a}e(a,c),a.prototype=null===c?Object.create(c):(b.prototype=c.prototype,new b)}function c(a,b){var c={};for(var d in a)Object.prototype.hasOwnProperty.call(a,d)&&0>b.indexOf(d)&&(c[d]=a[d]);if(null!=a&&"function"==typeof Object.getOwnPropertySymbols)for(var e=0,d=Object.getOwnPropertySymbols(a);e<d.length;e++)0>b.indexOf(d[e])&&(c[d[e]]=a[d[e]]);return c}var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,c){a.__proto__=c}||function(a,c){for(var b in c)c.hasOwnProperty(b)&&(a[b]=c[b])},f=Object.assign||function(a){for(var b,c=1,d=arguments.length;c<d;c++)for(var e in b=arguments[c],b)Object.prototype.hasOwnProperty.call(b,e)&&(a[e]=b[e]);return a},g=function(d){function e(){var b=null!==d&&d.apply(this,arguments)||this;return b.state={position:"unfixed",scroll:0,ref:b.props.innerRef||a.createRef(),top:0},b.animateTop=function(){var a=Math.min,c=Math.max,d=b.state.ref.current;if(d&&!b.props.disabled){var e=window.pageYOffset;if(!(0>e)){var f,g=d.classList,h=b.state.scroll,i=0<e-h?"down":"up",j=b.state.top+h-e,k=d.getBoundingClientRect(),l=k.height,m=k.top;"down"===i?(f=c(j,-l),!g.contains("hidden")&&j<-l&&(g.remove("pinned"),g.remove("unfixed"),g.add("hidden"),b.setState({position:"hidden"}))):(f=a(j,0),!g.contains("pinned")&&j>-l&&(g.remove("hidden"),g.remove("unfixed"),g.add("pinned"),b.setState({position:"pinned"}))),!g.contains("unfixed")&&(0<m||0===e)&&(g.remove("hidden"),g.remove("pinned"),g.add("unfixed"),b.setState({position:"unfixed"})),b.setState({scroll:e,top:f})}}},b.handleScroll=function(){return window.requestAnimationFrame(b.animateTop)},b}return b(e,d),e.prototype.addEventListener=function(){var a=this;"undefined"!=typeof window&&this.setState({scroll:window.pageYOffset},function(){return window.addEventListener("scroll",a.handleScroll)})},e.prototype.removeEventListener=function(){"undefined"!=typeof window&&window.removeEventListener("scroll",this.handleScroll)},e.prototype.componentDidMount=function(){this.props.disabled||this.addEventListener();var a=this.state.ref.current;if(a){var b=a.getBoundingClientRect(),c=b.height,d=b.top;0<=d?a.classList.add("unfixed"):d<-c?(a.classList.add("hidden"),this.setState({position:"hidden"})):(a.classList.add("pinned"),this.setState({position:"pinned"}))}},e.prototype.componentDidUpdate=function(a){var b=a.disabled,c=this.props.disabled;c===b||(c?this.removeEventListener():this.addEventListener())},e.prototype.componentWillUnmount=function(){this.props.disabled||this.removeEventListener()},e.prototype.render=function(){var b=this.props,d=b.children,e=b.innerRef,g=c(b,["children","innerRef"]),h=this.state,i=h.position,j=h.ref,k=h.top;return a.createElement("nav",f({ref:j,style:{position:"sticky",top:k+"px"}},g),"function"==typeof d?d(i):d)},e.defaultProps={disabled:!1},e}(a.PureComponent),h=a.forwardRef(function(b,c){return a.createElement(g,f({},b,{innerRef:c}))});return h}); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):(e=e||self).appBar=t(e.React)}(this,function(e){"use strict";var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};var n=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e};var o=function(o){function i(){var t=null!==o&&o.apply(this,arguments)||this;return t.state={position:"unfixed",scroll:0,ref:t.props.innerRef||e.createRef(),top:0},t.animateTop=function(){var e=t.state.ref.current;if(e&&!t.props.disabled){var n=window.pageYOffset;if(!(n<0)){var o,i=e.classList,r=t.state.scroll,s=n-r>0?"down":"up",d=t.state.top+r-n,a=e.getBoundingClientRect(),p=a.height,f=a.top;"down"===s?(o=Math.max(d,-p),!i.contains("hidden")&&d<-p&&(i.remove("pinned"),i.remove("unfixed"),i.add("hidden"),t.setState({position:"hidden"}))):(o=Math.min(d,0),!i.contains("pinned")&&d>-p&&(i.remove("hidden"),i.remove("unfixed"),i.add("pinned"),t.setState({position:"pinned"}))),!i.contains("unfixed")&&(f>0||0===n)&&(i.remove("hidden"),i.remove("pinned"),i.add("unfixed"),t.setState({position:"unfixed"})),t.setState({scroll:n,top:o})}}},t.handleScroll=function(){return window.requestAnimationFrame(t.animateTop)},t}return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}(i,o),i.prototype.addEventListener=function(){var e=this;"undefined"!=typeof window&&this.setState({scroll:window.pageYOffset},function(){return window.addEventListener("scroll",e.handleScroll)})},i.prototype.removeEventListener=function(){"undefined"!=typeof window&&window.removeEventListener("scroll",this.handleScroll)},i.prototype.componentDidMount=function(){this.props.disabled||this.addEventListener();var e=this.state.ref.current;if(e){var t=e.getBoundingClientRect(),n=t.height,o=t.top;o>=0?e.classList.add("unfixed"):o<-n?(e.classList.add("hidden"),this.setState({position:"hidden"})):(e.classList.add("pinned"),this.setState({position:"pinned"}))}},i.prototype.componentDidUpdate=function(e){var t=e.disabled,n=this.props.disabled;n!==t&&(n?this.removeEventListener():this.addEventListener())},i.prototype.componentWillUnmount=function(){this.props.disabled||this.removeEventListener()},i.prototype.render=function(){var t=this.props,o=t.children,i=(t.innerRef,function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(e);i<o.length;i++)t.indexOf(o[i])<0&&(n[o[i]]=e[o[i]])}return n}(t,["children","innerRef"])),r=this.state,s=r.position,d=r.ref,a={position:"sticky",top:r.top+"px"};return e.createElement("nav",n({ref:d,style:a},i),"function"==typeof o?o(s):o)},i.defaultProps={disabled:!1},i}(e.PureComponent);return e.forwardRef(function(t,i){return e.createElement(o,n({},t,{innerRef:i}))})}); |
{ | ||
"name": "app-bar", | ||
"version": "2.3.0", | ||
"version": "2.4.0", | ||
"description": "An app bar for React that stays out of your way", | ||
@@ -41,5 +41,5 @@ "license": "MIT", | ||
"rollup": "^1.0.1", | ||
"rollup-plugin-babel-minify": "^6.2.0", | ||
"rollup-plugin-commonjs": "^9.2.0", | ||
"rollup-plugin-node-resolve": "^4.0.0", | ||
"rollup-plugin-terser": "^4.0.1", | ||
"rollup-plugin-typescript2": "^0.18.1", | ||
@@ -46,0 +46,0 @@ "standard-version": "^4.4.0", |
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
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
2
23363
8
54