@tanem/react-nprogress
Advanced tools
Comparing version 5.0.17 to 5.0.18
'use strict'; | ||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
var _objectWithoutPropertiesLoose = require('@babel/runtime/helpers/objectWithoutPropertiesLoose'); | ||
@@ -10,6 +8,3 @@ var _extends = require('@babel/runtime/helpers/extends'); | ||
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } | ||
function _interopNamespace(e) { | ||
if (e && e.__esModule) return e; | ||
function _interopNamespaceDefault(e) { | ||
var n = Object.create(null); | ||
@@ -27,10 +22,7 @@ if (e) { | ||
} | ||
n["default"] = e; | ||
n.default = e; | ||
return Object.freeze(n); | ||
} | ||
var _objectWithoutPropertiesLoose__default = /*#__PURE__*/_interopDefaultLegacy(_objectWithoutPropertiesLoose); | ||
var _extends__default = /*#__PURE__*/_interopDefaultLegacy(_extends); | ||
var React__namespace = /*#__PURE__*/_interopNamespace(React); | ||
var hoistNonReactStatics__default = /*#__PURE__*/_interopDefaultLegacy(hoistNonReactStatics); | ||
var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React); | ||
@@ -133,3 +125,3 @@ var clamp = function clamp(num, lower, upper) { | ||
var update = useUpdate(); | ||
var state = React.useRef(_extends__default["default"]({}, initialState)); | ||
var state = React.useRef(_extends({}, initialState)); | ||
var get = React.useCallback(function () { | ||
@@ -270,3 +262,3 @@ return state.current; | ||
} else { | ||
setState(_extends__default["default"]({}, initialState, { | ||
setState(_extends({}, initialState, { | ||
sideEffect: start | ||
@@ -286,3 +278,3 @@ })); | ||
var children = _ref.children, | ||
restProps = _objectWithoutPropertiesLoose__default["default"](_ref, _excluded); | ||
restProps = _objectWithoutPropertiesLoose(_ref, _excluded); | ||
var renderProps = useNProgress(restProps); | ||
@@ -295,5 +287,5 @@ return children(renderProps); | ||
var hookProps = useNProgress(props); | ||
return /*#__PURE__*/React__namespace.createElement(BaseComponent, _extends__default["default"]({}, props, hookProps)); | ||
return /*#__PURE__*/React__namespace.createElement(BaseComponent, _extends({}, props, hookProps)); | ||
}; | ||
hoistNonReactStatics__default["default"](WithNProgress, BaseComponent); | ||
hoistNonReactStatics(WithNProgress, BaseComponent); | ||
return WithNProgress; | ||
@@ -300,0 +292,0 @@ } |
@@ -1,2 +0,2 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _objectWithoutPropertiesLoose=require("@babel/runtime/helpers/objectWithoutPropertiesLoose"),_extends=require("@babel/runtime/helpers/extends"),React=require("react"),hoistNonReactStatics=require("hoist-non-react-statics");function _interopDefaultLegacy(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function _interopNamespace(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var _objectWithoutPropertiesLoose__default=_interopDefaultLegacy(_objectWithoutPropertiesLoose),_extends__default=_interopDefaultLegacy(_extends),React__namespace=_interopNamespace(React),hoistNonReactStatics__default=_interopDefaultLegacy(hoistNonReactStatics),clamp=function(e,t,n){return e=(e=e<=n?e:n)>=t?e:t},createQueue=function(){var e=!1,t=[],n=function n(){e=!0;var r=t.shift();if(r)return r(n);e=!1};return{clear:function(){e=!1,t=[]},enqueue:function(r){t.push(r),e||1!==t.length||n()}}},createTimeout=function(){var e;return{cancel:function(){e&&window.cancelAnimationFrame(e)},schedule:function(t,n){var r;e=window.requestAnimationFrame((function u(c){c-(r=r||c)>n?t():e=window.requestAnimationFrame(u)}))}}},increment=function(e){var t=0;return e>=0&&e<.2?t=.1:e>=.2&&e<.5?t=.04:e>=.5&&e<.8?t=.02:e>=.8&&e<.99&&(t=.005),clamp(e+t,0,.994)},useEffectOnce=function(e){React.useEffect(e,[])},incrementParameter=function(e){return++e%1e6},useUpdate=function(){var e=React.useState(0)[1];return React.useCallback((function(){return e(incrementParameter)}),[])},useGetSetState=function(e){void 0===e&&(e={});var t=useUpdate(),n=React.useRef(_extends__default.default({},e));return[React.useCallback((function(){return n.current}),[]),React.useCallback((function(e){e&&(Object.assign(n.current,e),t())}),[])]},useFirstMountState=function(){var e=React.useRef(!0);return e.current?(e.current=!1,!0):e.current},useUpdateEffect=function(e,t){var n=useFirstMountState();React.useEffect((function(){if(!n)return e()}),t)},noop=function(){},initialState={isFinished:!0,progress:0,sideEffect:noop},useNProgress=function(e){var t=void 0===e?{}:e,n=t.animationDuration,r=void 0===n?200:n,u=t.incrementDuration,c=void 0===u?800:u,i=t.isAnimating,a=void 0!==i&&i,o=t.minimum,s=void 0===o?.08:o,f=useGetSetState(initialState),l=f[0],d=f[1],p=React.useRef(null),_=React.useRef(null);useEffectOnce((function(){p.current=createQueue(),_.current=createTimeout()}));var v=React.useCallback((function(){var e,t;null==(e=_.current)||e.cancel(),null==(t=p.current)||t.clear()}),[]),m=React.useCallback((function(e){var t,n,u;if(1===(e=clamp(e,s,1)))return v(),null==(n=p.current)||n.enqueue((function(t){d({progress:e,sideEffect:function(){var e;return null==(e=_.current)?void 0:e.schedule(t,r)}})})),void(null==(u=p.current)||u.enqueue((function(){d({isFinished:!0,sideEffect:v})})));null==(t=p.current)||t.enqueue((function(t){d({isFinished:!1,progress:e,sideEffect:function(){var e;return null==(e=_.current)?void 0:e.schedule(t,r)}})}))}),[r,v,s,p,d,_]),h=React.useCallback((function(){m(increment(l().progress))}),[l,m]),R=React.useCallback((function(){!function e(){var t;h(),null==(t=p.current)||t.enqueue((function(t){var n;null==(n=_.current)||n.schedule((function(){e(),t()}),c)}))}()}),[c,p,_,h]),g=React.useRef(noop),b=l().sideEffect;return React.useEffect((function(){g.current=h})),useEffectOnce((function(){return a&&R(),v})),useUpdateEffect((function(){l().sideEffect()}),[l,b]),useUpdateEffect((function(){a?d(_extends__default.default({},initialState,{sideEffect:R})):m(1)}),[a,m,d,R]),{animationDuration:r,isFinished:l().isFinished,progress:l().progress}},_excluded=["children"],NProgress=function(e){var t=e.children,n=_objectWithoutPropertiesLoose__default.default(e,_excluded);return t(useNProgress(n))};function withNProgress(e){var t=function(t){var n=useNProgress(t);return React__namespace.createElement(e,_extends__default.default({},t,n))};return hoistNonReactStatics__default.default(t,e),t}exports.NProgress=NProgress,exports.useNProgress=useNProgress,exports.withNProgress=withNProgress; | ||
"use strict";var _objectWithoutPropertiesLoose=require("@babel/runtime/helpers/objectWithoutPropertiesLoose"),_extends=require("@babel/runtime/helpers/extends"),React=require("react"),hoistNonReactStatics=require("hoist-non-react-statics");function _interopNamespaceDefault(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var React__namespace=_interopNamespaceDefault(React),clamp=function(e,t,n){return e=(e=e<=n?e:n)>=t?e:t},createQueue=function(){var e=!1,t=[],n=function n(){e=!0;var r=t.shift();if(r)return r(n);e=!1};return{clear:function(){e=!1,t=[]},enqueue:function(r){t.push(r),e||1!==t.length||n()}}},createTimeout=function(){var e;return{cancel:function(){e&&window.cancelAnimationFrame(e)},schedule:function(t,n){var r;e=window.requestAnimationFrame((function u(c){c-(r=r||c)>n?t():e=window.requestAnimationFrame(u)}))}}},increment=function(e){var t=0;return e>=0&&e<.2?t=.1:e>=.2&&e<.5?t=.04:e>=.5&&e<.8?t=.02:e>=.8&&e<.99&&(t=.005),clamp(e+t,0,.994)},useEffectOnce=function(e){React.useEffect(e,[])},incrementParameter=function(e){return++e%1e6},useUpdate=function(){var e=React.useState(0)[1];return React.useCallback((function(){return e(incrementParameter)}),[])},useGetSetState=function(e){void 0===e&&(e={});var t=useUpdate(),n=React.useRef(_extends({},e));return[React.useCallback((function(){return n.current}),[]),React.useCallback((function(e){e&&(Object.assign(n.current,e),t())}),[])]},useFirstMountState=function(){var e=React.useRef(!0);return e.current?(e.current=!1,!0):e.current},useUpdateEffect=function(e,t){var n=useFirstMountState();React.useEffect((function(){if(!n)return e()}),t)},noop=function(){},initialState={isFinished:!0,progress:0,sideEffect:noop},useNProgress=function(e){var t=void 0===e?{}:e,n=t.animationDuration,r=void 0===n?200:n,u=t.incrementDuration,c=void 0===u?800:u,i=t.isAnimating,a=void 0!==i&&i,s=t.minimum,o=void 0===s?.08:s,f=useGetSetState(initialState),l=f[0],d=f[1],p=React.useRef(null),v=React.useRef(null);useEffectOnce((function(){p.current=createQueue(),v.current=createTimeout()}));var m=React.useCallback((function(){var e,t;null==(e=v.current)||e.cancel(),null==(t=p.current)||t.clear()}),[]),R=React.useCallback((function(e){var t,n,u;if(1===(e=clamp(e,o,1)))return m(),null==(n=p.current)||n.enqueue((function(t){d({progress:e,sideEffect:function(){var e;return null==(e=v.current)?void 0:e.schedule(t,r)}})})),void(null==(u=p.current)||u.enqueue((function(){d({isFinished:!0,sideEffect:m})})));null==(t=p.current)||t.enqueue((function(t){d({isFinished:!1,progress:e,sideEffect:function(){var e;return null==(e=v.current)?void 0:e.schedule(t,r)}})}))}),[r,m,o,p,d,v]),h=React.useCallback((function(){R(increment(l().progress))}),[l,R]),g=React.useCallback((function(){!function e(){var t;h(),null==(t=p.current)||t.enqueue((function(t){var n;null==(n=v.current)||n.schedule((function(){e(),t()}),c)}))}()}),[c,p,v,h]),b=React.useRef(noop),E=l().sideEffect;return React.useEffect((function(){b.current=h})),useEffectOnce((function(){return a&&g(),m})),useUpdateEffect((function(){l().sideEffect()}),[l,E]),useUpdateEffect((function(){a?d(_extends({},initialState,{sideEffect:g})):R(1)}),[a,R,d,g]),{animationDuration:r,isFinished:l().isFinished,progress:l().progress}},_excluded=["children"],NProgress=function(e){var t=e.children,n=_objectWithoutPropertiesLoose(e,_excluded);return t(useNProgress(n))};function withNProgress(e){var t=function(t){var n=useNProgress(t);return React__namespace.createElement(e,_extends({},t,n))};return hoistNonReactStatics(t,e),t}exports.NProgress=NProgress,exports.useNProgress=useNProgress,exports.withNProgress=withNProgress; | ||
//# sourceMappingURL=react-nprogress.cjs.production.js.map |
@@ -7,4 +7,3 @@ (function (global, factory) { | ||
function _interopNamespace(e) { | ||
if (e && e.__esModule) return e; | ||
function _interopNamespaceDefault(e) { | ||
var n = Object.create(null); | ||
@@ -22,7 +21,7 @@ if (e) { | ||
} | ||
n["default"] = e; | ||
n.default = e; | ||
return Object.freeze(n); | ||
} | ||
var React__namespace = /*#__PURE__*/_interopNamespace(React); | ||
var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React); | ||
@@ -622,5 +621,3 @@ function _objectWithoutPropertiesLoose(source, excluded) { | ||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
})); | ||
//# sourceMappingURL=react-nprogress.umd.development.js.map |
@@ -1,2 +0,2 @@ | ||
!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],r):r((e="undefined"!=typeof globalThis?globalThis:e||self).NProgress={},e.React)}(this,(function(e,r){"use strict";function t(e){if(e&&e.__esModule)return e;var r=Object.create(null);return e&&Object.keys(e).forEach((function(t){if("default"!==t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})}})),r.default=e,Object.freeze(r)}var n=t(r);function o(){return o=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},o.apply(this,arguments)}var u,c=function(e,r,t){return e=(e=e<=t?e:t)>=r?e:r},i=function(){var e=!1,r=[],t=function t(){e=!0;var n=r.shift();if(n)return n(t);e=!1};return{clear:function(){e=!1,r=[]},enqueue:function(n){r.push(n),e||1!==r.length||t()}}},f=function(e){r.useEffect(e,[])},a=function(e){return++e%1e6},s=function(e){void 0===e&&(e={});var t,n=(t=r.useState(0)[1],r.useCallback((function(){return t(a)}),[])),u=r.useRef(o({},e));return[r.useCallback((function(){return u.current}),[]),r.useCallback((function(e){e&&(Object.assign(u.current,e),n())}),[])]},l=function(e,t){var n,o=(n=r.useRef(!0)).current?(n.current=!1,!0):n.current;r.useEffect((function(){if(!o)return e()}),t)},p=function(){},y={isFinished:!0,progress:0,sideEffect:p},d=function(e){var t=void 0===e?{}:e,n=t.animationDuration,u=void 0===n?200:n,a=t.incrementDuration,d=void 0===a?800:a,m=t.isAnimating,b=void 0!==m&&m,v=t.minimum,g=void 0===v?.08:v,h=s(y),$=h[0],S=h[1],O=r.useRef(null),P=r.useRef(null);f((function(){var e;O.current=i(),P.current={cancel:function(){e&&window.cancelAnimationFrame(e)},schedule:function(r,t){var n;e=window.requestAnimationFrame((function o(u){u-(n=n||u)>t?r():e=window.requestAnimationFrame(o)}))}}}));var j=r.useCallback((function(){var e,r;null==(e=P.current)||e.cancel(),null==(r=O.current)||r.clear()}),[]),w=r.useCallback((function(e){var r,t,n;if(1===(e=c(e,g,1)))return j(),null==(t=O.current)||t.enqueue((function(r){S({progress:e,sideEffect:function(){var e;return null==(e=P.current)?void 0:e.schedule(r,u)}})})),void(null==(n=O.current)||n.enqueue((function(){S({isFinished:!0,sideEffect:j})})));null==(r=O.current)||r.enqueue((function(r){S({isFinished:!1,progress:e,sideEffect:function(){var e;return null==(e=P.current)?void 0:e.schedule(r,u)}})}))}),[u,j,g,O,S,P]),x=r.useCallback((function(){var e,r;w((e=$().progress,r=0,e>=0&&e<.2?r=.1:e>=.2&&e<.5?r=.04:e>=.5&&e<.8?r=.02:e>=.8&&e<.99&&(r=.005),c(e+r,0,.994)))}),[$,w]),C=r.useCallback((function(){!function e(){var r;x(),null==(r=O.current)||r.enqueue((function(r){var t;null==(t=P.current)||t.schedule((function(){e(),r()}),d)}))}()}),[d,O,P,x]),E=r.useRef(p),F=$().sideEffect;return r.useEffect((function(){E.current=x})),f((function(){return b&&C(),j})),l((function(){$().sideEffect()}),[$,F]),l((function(){b?S(o({},y,{sideEffect:C})):w(1)}),[b,w,S,C]),{animationDuration:u,isFinished:$().isFinished,progress:$().progress}},m=["children"],b={exports:{}},v={};!function(e){e.exports=function(){if(u)return v;u=1;var e="function"==typeof Symbol&&Symbol.for,r=e?Symbol.for("react.element"):60103,t=e?Symbol.for("react.portal"):60106,n=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,c=e?Symbol.for("react.profiler"):60114,i=e?Symbol.for("react.provider"):60109,f=e?Symbol.for("react.context"):60110,a=e?Symbol.for("react.async_mode"):60111,s=e?Symbol.for("react.concurrent_mode"):60111,l=e?Symbol.for("react.forward_ref"):60112,p=e?Symbol.for("react.suspense"):60113,y=e?Symbol.for("react.suspense_list"):60120,d=e?Symbol.for("react.memo"):60115,m=e?Symbol.for("react.lazy"):60116,b=e?Symbol.for("react.block"):60121,g=e?Symbol.for("react.fundamental"):60117,h=e?Symbol.for("react.responder"):60118,$=e?Symbol.for("react.scope"):60119;function S(e){if("object"==typeof e&&null!==e){var u=e.$$typeof;switch(u){case r:switch(e=e.type){case a:case s:case n:case c:case o:case p:return e;default:switch(e=e&&e.$$typeof){case f:case l:case m:case d:case i:return e;default:return u}}case t:return u}}}function O(e){return S(e)===s}return v.AsyncMode=a,v.ConcurrentMode=s,v.ContextConsumer=f,v.ContextProvider=i,v.Element=r,v.ForwardRef=l,v.Fragment=n,v.Lazy=m,v.Memo=d,v.Portal=t,v.Profiler=c,v.StrictMode=o,v.Suspense=p,v.isAsyncMode=function(e){return O(e)||S(e)===a},v.isConcurrentMode=O,v.isContextConsumer=function(e){return S(e)===f},v.isContextProvider=function(e){return S(e)===i},v.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},v.isForwardRef=function(e){return S(e)===l},v.isFragment=function(e){return S(e)===n},v.isLazy=function(e){return S(e)===m},v.isMemo=function(e){return S(e)===d},v.isPortal=function(e){return S(e)===t},v.isProfiler=function(e){return S(e)===c},v.isStrictMode=function(e){return S(e)===o},v.isSuspense=function(e){return S(e)===p},v.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===n||e===s||e===c||e===o||e===p||e===y||"object"==typeof e&&null!==e&&(e.$$typeof===m||e.$$typeof===d||e.$$typeof===i||e.$$typeof===f||e.$$typeof===l||e.$$typeof===g||e.$$typeof===h||e.$$typeof===$||e.$$typeof===b)},v.typeOf=S,v}()}(b);var g=b.exports,h={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},$={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},S={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},O={};function P(e){return g.isMemo(e)?S:O[e.$$typeof]||h}O[g.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},O[g.Memo]=S;var j=Object.defineProperty,w=Object.getOwnPropertyNames,x=Object.getOwnPropertySymbols,C=Object.getOwnPropertyDescriptor,E=Object.getPrototypeOf,F=Object.prototype;var M=function e(r,t,n){if("string"!=typeof t){if(F){var o=E(t);o&&o!==F&&e(r,o,n)}var u=w(t);x&&(u=u.concat(x(t)));for(var c=P(r),i=P(t),f=0;f<u.length;++f){var a=u[f];if(!($[a]||n&&n[a]||i&&i[a]||c&&c[a])){var s=C(t,a);try{j(r,a,s)}catch(e){}}}}return r};e.NProgress=function(e){var r=e.children,t=function(e,r){if(null==e)return{};var t,n,o={},u=Object.keys(e);for(n=0;n<u.length;n++)r.indexOf(t=u[n])>=0||(o[t]=e[t]);return o}(e,m);return r(d(t))},e.useNProgress=d,e.withNProgress=function(e){var r=function(r){var t=d(r);return n.createElement(e,o({},r,t))};return M(r,e),r},Object.defineProperty(e,"__esModule",{value:!0})})); | ||
!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],r):r((e="undefined"!=typeof globalThis?globalThis:e||self).NProgress={},e.React)}(this,(function(e,r){"use strict";function t(e){var r=Object.create(null);return e&&Object.keys(e).forEach((function(t){if("default"!==t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})}})),r.default=e,Object.freeze(r)}var n=t(r);function o(){return o=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},o.apply(this,arguments)}var u,c=function(e,r,t){return e=(e=e<=t?e:t)>=r?e:r},i=function(){var e=!1,r=[],t=function t(){e=!0;var n=r.shift();if(n)return n(t);e=!1};return{clear:function(){e=!1,r=[]},enqueue:function(n){r.push(n),e||1!==r.length||t()}}},f=function(e){r.useEffect(e,[])},a=function(e){return++e%1e6},s=function(e){void 0===e&&(e={});var t,n=(t=r.useState(0)[1],r.useCallback((function(){return t(a)}),[])),u=r.useRef(o({},e));return[r.useCallback((function(){return u.current}),[]),r.useCallback((function(e){e&&(Object.assign(u.current,e),n())}),[])]},l=function(e,t){var n,o=(n=r.useRef(!0)).current?(n.current=!1,!0):n.current;r.useEffect((function(){if(!o)return e()}),t)},p=function(){},y={isFinished:!0,progress:0,sideEffect:p},d=function(e){var t=void 0===e?{}:e,n=t.animationDuration,u=void 0===n?200:n,a=t.incrementDuration,d=void 0===a?800:a,m=t.isAnimating,b=void 0!==m&&m,v=t.minimum,g=void 0===v?.08:v,h=s(y),$=h[0],S=h[1],O=r.useRef(null),P=r.useRef(null);f((function(){var e;O.current=i(),P.current={cancel:function(){e&&window.cancelAnimationFrame(e)},schedule:function(r,t){var n;e=window.requestAnimationFrame((function o(u){u-(n=n||u)>t?r():e=window.requestAnimationFrame(o)}))}}}));var j=r.useCallback((function(){var e,r;null==(e=P.current)||e.cancel(),null==(r=O.current)||r.clear()}),[]),w=r.useCallback((function(e){var r,t,n;if(1===(e=c(e,g,1)))return j(),null==(t=O.current)||t.enqueue((function(r){S({progress:e,sideEffect:function(){var e;return null==(e=P.current)?void 0:e.schedule(r,u)}})})),void(null==(n=O.current)||n.enqueue((function(){S({isFinished:!0,sideEffect:j})})));null==(r=O.current)||r.enqueue((function(r){S({isFinished:!1,progress:e,sideEffect:function(){var e;return null==(e=P.current)?void 0:e.schedule(r,u)}})}))}),[u,j,g,O,S,P]),x=r.useCallback((function(){var e,r;w((e=$().progress,r=0,e>=0&&e<.2?r=.1:e>=.2&&e<.5?r=.04:e>=.5&&e<.8?r=.02:e>=.8&&e<.99&&(r=.005),c(e+r,0,.994)))}),[$,w]),C=r.useCallback((function(){!function e(){var r;x(),null==(r=O.current)||r.enqueue((function(r){var t;null==(t=P.current)||t.schedule((function(){e(),r()}),d)}))}()}),[d,O,P,x]),E=r.useRef(p),F=$().sideEffect;return r.useEffect((function(){E.current=x})),f((function(){return b&&C(),j})),l((function(){$().sideEffect()}),[$,F]),l((function(){b?S(o({},y,{sideEffect:C})):w(1)}),[b,w,S,C]),{animationDuration:u,isFinished:$().isFinished,progress:$().progress}},m=["children"],b={exports:{}},v={};!function(e){e.exports=function(){if(u)return v;u=1;var e="function"==typeof Symbol&&Symbol.for,r=e?Symbol.for("react.element"):60103,t=e?Symbol.for("react.portal"):60106,n=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,c=e?Symbol.for("react.profiler"):60114,i=e?Symbol.for("react.provider"):60109,f=e?Symbol.for("react.context"):60110,a=e?Symbol.for("react.async_mode"):60111,s=e?Symbol.for("react.concurrent_mode"):60111,l=e?Symbol.for("react.forward_ref"):60112,p=e?Symbol.for("react.suspense"):60113,y=e?Symbol.for("react.suspense_list"):60120,d=e?Symbol.for("react.memo"):60115,m=e?Symbol.for("react.lazy"):60116,b=e?Symbol.for("react.block"):60121,g=e?Symbol.for("react.fundamental"):60117,h=e?Symbol.for("react.responder"):60118,$=e?Symbol.for("react.scope"):60119;function S(e){if("object"==typeof e&&null!==e){var u=e.$$typeof;switch(u){case r:switch(e=e.type){case a:case s:case n:case c:case o:case p:return e;default:switch(e=e&&e.$$typeof){case f:case l:case m:case d:case i:return e;default:return u}}case t:return u}}}function O(e){return S(e)===s}return v.AsyncMode=a,v.ConcurrentMode=s,v.ContextConsumer=f,v.ContextProvider=i,v.Element=r,v.ForwardRef=l,v.Fragment=n,v.Lazy=m,v.Memo=d,v.Portal=t,v.Profiler=c,v.StrictMode=o,v.Suspense=p,v.isAsyncMode=function(e){return O(e)||S(e)===a},v.isConcurrentMode=O,v.isContextConsumer=function(e){return S(e)===f},v.isContextProvider=function(e){return S(e)===i},v.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},v.isForwardRef=function(e){return S(e)===l},v.isFragment=function(e){return S(e)===n},v.isLazy=function(e){return S(e)===m},v.isMemo=function(e){return S(e)===d},v.isPortal=function(e){return S(e)===t},v.isProfiler=function(e){return S(e)===c},v.isStrictMode=function(e){return S(e)===o},v.isSuspense=function(e){return S(e)===p},v.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===n||e===s||e===c||e===o||e===p||e===y||"object"==typeof e&&null!==e&&(e.$$typeof===m||e.$$typeof===d||e.$$typeof===i||e.$$typeof===f||e.$$typeof===l||e.$$typeof===g||e.$$typeof===h||e.$$typeof===$||e.$$typeof===b)},v.typeOf=S,v}()}(b);var g=b.exports,h={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},$={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},S={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},O={};function P(e){return g.isMemo(e)?S:O[e.$$typeof]||h}O[g.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},O[g.Memo]=S;var j=Object.defineProperty,w=Object.getOwnPropertyNames,x=Object.getOwnPropertySymbols,C=Object.getOwnPropertyDescriptor,E=Object.getPrototypeOf,F=Object.prototype;var k=function e(r,t,n){if("string"!=typeof t){if(F){var o=E(t);o&&o!==F&&e(r,o,n)}var u=w(t);x&&(u=u.concat(x(t)));for(var c=P(r),i=P(t),f=0;f<u.length;++f){var a=u[f];if(!($[a]||n&&n[a]||i&&i[a]||c&&c[a])){var s=C(t,a);try{j(r,a,s)}catch(e){}}}}return r};e.NProgress=function(e){var r=e.children,t=function(e,r){if(null==e)return{};var t,n,o={},u=Object.keys(e);for(n=0;n<u.length;n++)r.indexOf(t=u[n])>=0||(o[t]=e[t]);return o}(e,m);return r(d(t))},e.useNProgress=d,e.withNProgress=function(e){var r=function(r){var t=d(r);return n.createElement(e,o({},r,t))};return k(r,e),r}})); | ||
//# sourceMappingURL=react-nprogress.umd.production.js.map |
{ | ||
"name": "@tanem/react-nprogress", | ||
"version": "5.0.17", | ||
"version": "5.0.18", | ||
"description": "A React primitive for building slim progress bars.", | ||
@@ -82,10 +82,11 @@ "main": "dist/index.js", | ||
"@rollup/plugin-replace": "5.0.1", | ||
"@rollup/plugin-terser": "0.1.0", | ||
"@testing-library/react": "13.4.0", | ||
"@types/hoist-non-react-statics": "3.3.1", | ||
"@types/jest": "29.2.2", | ||
"@types/jest": "29.2.3", | ||
"@types/mock-raf": "1.0.3", | ||
"@types/react": "18.0.25", | ||
"@types/react-dom": "18.0.8", | ||
"@typescript-eslint/eslint-plugin": "5.42.1", | ||
"@typescript-eslint/parser": "5.42.1", | ||
"@types/react-dom": "18.0.9", | ||
"@typescript-eslint/eslint-plugin": "5.43.0", | ||
"@typescript-eslint/parser": "5.43.0", | ||
"babel-core": "6.26.3", | ||
@@ -97,4 +98,4 @@ "eslint": "8.27.0", | ||
"eslint-plugin-simple-import-sort": "8.0.0", | ||
"jest": "29.3.0", | ||
"jest-environment-jsdom": "29.3.0", | ||
"jest": "29.3.1", | ||
"jest-environment-jsdom": "29.3.1", | ||
"mock-raf": "1.0.1", | ||
@@ -106,8 +107,7 @@ "npm-run-all": "4.1.5", | ||
"react-test-renderer": "18.2.0", | ||
"regenerator-runtime": "0.13.10", | ||
"rollup": "2.79.1", | ||
"regenerator-runtime": "0.13.11", | ||
"rollup": "3.3.0", | ||
"rollup-plugin-sourcemaps": "0.6.3", | ||
"rollup-plugin-terser": "7.0.2", | ||
"shx": "0.3.4", | ||
"tanem-scripts": "6.0.62", | ||
"tanem-scripts": "6.0.63", | ||
"ts-jest": "29.0.3", | ||
@@ -114,0 +114,0 @@ "typescript": "4.8.4" |
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
175718
1196