Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@tanem/react-nprogress

Package Overview
Dependencies
Maintainers
1
Versions
212
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tanem/react-nprogress - npm Package Compare versions

Comparing version 3.0.6 to 3.0.7-beta.1

5

dist/react-nprogress.cjs.development.js

@@ -8,2 +8,3 @@ 'use strict';

var _objectWithoutPropertiesLoose = _interopDefault(require('@babel/runtime/helpers/objectWithoutPropertiesLoose'));
var _extends = _interopDefault(require('@babel/runtime/helpers/extends'));
var React = require('react');

@@ -186,5 +187,5 @@ var reactUse = require('react-use');

} else {
setState({
setState(_extends({}, initialState, {
sideEffect: start
});
}));
}

@@ -191,0 +192,0 @@ }, [isAnimating]);

2

dist/react-nprogress.cjs.production.js

@@ -1,2 +0,2 @@

"use strict";function _interopDefault(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var handle,_objectWithoutPropertiesLoose=_interopDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose")),React=require("react"),reactUse=require("react-use"),hoistNonReactStatics=_interopDefault(require("hoist-non-react-statics")),clamp=function(e,n,t){return e=(e=e<=t?e:t)>=n?e:n},increment=function(e){var n=0;return e>=0&&e<.2?n=.1:e>=.2&&e<.5?n=.04:e>=.5&&e<.8?n=.02:e>=.8&&e<.99&&(n=.005),clamp(e+n,0,.994)},isRunning=!1,pending=[],next=function e(){isRunning=!0;var n=pending.shift();if(n)return n(e);isRunning=!1},clear=function(){isRunning=!1,pending=[]},queue=function(e){pending.push(e),isRunning||1!==pending.length||next()},cancel=function(){handle&&window.cancelAnimationFrame(handle)},timeout=function(e,n){var t;handle=window.requestAnimationFrame(function i(r){r-(t=t||r)>n?e():handle=window.requestAnimationFrame(i)})},noop=function(){},initialState={isFinished:!1,progress:0,sideEffect:noop},cleanup=function(){cancel(),clear()},useNProgress=function(e){var n=void 0===e?{}:e,t=n.animationDuration,i=void 0===t?200:t,r=n.incrementDuration,o=void 0===r?800:r,u=n.isAnimating,s=void 0!==u&&u,c=n.minimum,a=void 0===c?.08:c,f=reactUse.useGetSetState(initialState),d=f[0],p=f[1],l=function(e){if(1===(e=clamp(e,a,1)))return cleanup(),queue(function(n){p({progress:e,sideEffect:function(){return timeout(n,i)}})}),void queue(function(){p({isFinished:!0,sideEffect:cleanup})});queue(function(n){p({progress:e,sideEffect:function(){return timeout(n,i)}})})},g=function(){l(increment(d().progress))},h=function(){!function e(){g(),queue(function(n){timeout(function(){e(),n()},o)})}()},m=React.useRef(noop);return React.useEffect(function(){m.current=g}),reactUse.useEffectOnce(function(){return s&&h(),cleanup}),reactUse.useUpdateEffect(function(){d().sideEffect()},[d().sideEffect]),reactUse.useUpdateEffect(function(){s?p({sideEffect:h}):l(1)},[s]),{animationDuration:i,isFinished:d().isFinished,progress:d().progress}},NProgress=function(e){var n=e.children,t=_objectWithoutPropertiesLoose(e,["children"]);return n(useNProgress(t))};function withNProgress(e){var n=function(n){var t=useNProgress(n);return React.createElement(e,Object.assign({},n,t))};return hoistNonReactStatics(n,e),n}exports.NProgress=NProgress,exports.useNProgress=useNProgress,exports.withNProgress=withNProgress;
"use strict";function _interopDefault(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var handle,_objectWithoutPropertiesLoose=_interopDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose")),_extends=_interopDefault(require("@babel/runtime/helpers/extends")),React=require("react"),reactUse=require("react-use"),hoistNonReactStatics=_interopDefault(require("hoist-non-react-statics")),clamp=function(e,n,t){return e=(e=e<=t?e:t)>=n?e:n},increment=function(e){var n=0;return e>=0&&e<.2?n=.1:e>=.2&&e<.5?n=.04:e>=.5&&e<.8?n=.02:e>=.8&&e<.99&&(n=.005),clamp(e+n,0,.994)},isRunning=!1,pending=[],next=function e(){isRunning=!0;var n=pending.shift();if(n)return n(e);isRunning=!1},clear=function(){isRunning=!1,pending=[]},queue=function(e){pending.push(e),isRunning||1!==pending.length||next()},cancel=function(){handle&&window.cancelAnimationFrame(handle)},timeout=function(e,n){var t;handle=window.requestAnimationFrame(function i(r){r-(t=t||r)>n?e():handle=window.requestAnimationFrame(i)})},noop=function(){},initialState={isFinished:!1,progress:0,sideEffect:noop},cleanup=function(){cancel(),clear()},useNProgress=function(e){var n=void 0===e?{}:e,t=n.animationDuration,i=void 0===t?200:t,r=n.incrementDuration,o=void 0===r?800:r,u=n.isAnimating,s=void 0!==u&&u,c=n.minimum,a=void 0===c?.08:c,f=reactUse.useGetSetState(initialState),d=f[0],p=f[1],l=function(e){if(1===(e=clamp(e,a,1)))return cleanup(),queue(function(n){p({progress:e,sideEffect:function(){return timeout(n,i)}})}),void queue(function(){p({isFinished:!0,sideEffect:cleanup})});queue(function(n){p({progress:e,sideEffect:function(){return timeout(n,i)}})})},g=function(){l(increment(d().progress))},h=function(){!function e(){g(),queue(function(n){timeout(function(){e(),n()},o)})}()},m=React.useRef(noop);return React.useEffect(function(){m.current=g}),reactUse.useEffectOnce(function(){return s&&h(),cleanup}),reactUse.useUpdateEffect(function(){d().sideEffect()},[d().sideEffect]),reactUse.useUpdateEffect(function(){s?p(_extends({},initialState,{sideEffect:h})):l(1)},[s]),{animationDuration:i,isFinished:d().isFinished,progress:d().progress}},NProgress=function(e){var n=e.children,t=_objectWithoutPropertiesLoose(e,["children"]);return n(useNProgress(t))};function withNProgress(e){var n=function(n){var t=useNProgress(n);return React.createElement(e,Object.assign({},n,t))};return hoistNonReactStatics(n,e),n}exports.NProgress=NProgress,exports.useNProgress=useNProgress,exports.withNProgress=withNProgress;
//# sourceMappingURL=react-nprogress.cjs.production.js.map
import _objectWithoutPropertiesLoose from '@babel/runtime/helpers/objectWithoutPropertiesLoose';
import _extends from '@babel/runtime/helpers/extends';
import { useRef, useEffect, createElement } from 'react';

@@ -179,5 +180,5 @@ import { useGetSetState, useEffectOnce, useUpdateEffect } from 'react-use';

} else {
setState({
setState(_extends({}, initialState, {
sideEffect: start
});
}));
}

@@ -184,0 +185,0 @@ }, [isAnimating]);

@@ -26,2 +26,32 @@ (function (global, factory) {

function unwrapExports (x) {
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
}
function createCommonjsModule(fn, module) {
return module = { exports: {} }, fn(module, module.exports), module.exports;
}
var _extends_1 = createCommonjsModule(function (module) {
function _extends() {
module.exports = _extends = Object.assign || function (target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
};
return _extends.apply(this, arguments);
}
module.exports = _extends;
});
var useUpdateEffect = function (effect, deps) {

@@ -50,10 +80,2 @@ var isInitialMount = React.useRef(true);

function unwrapExports (x) {
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
}
function createCommonjsModule(fn, module) {
return module = { exports: {} }, fn(module, module.exports), module.exports;
}
var __assign = (undefined && undefined.__assign) || function () {

@@ -268,5 +290,5 @@ __assign = Object.assign || function(t) {

} else {
setState({
setState(_extends_1({}, initialState, {
sideEffect: start
});
}));
}

@@ -273,0 +295,0 @@ }, [isAnimating]);

@@ -1,2 +0,2 @@

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],t):t((e=e||self).NProgress={},e.React)}(this,function(e,t){"use strict";var r=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)t.indexOf(r=i[n])>=0||(o[r]=e[r]);return o},n=function(e,r){var n=t.useRef(!0);t.useEffect(function(){if(!n.current)return e();n.current=!1},r)};function o(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function i(e,t){return e(t={exports:{}},t.exports),t.exports}var c,f=function(){return(f=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},u=function(e){void 0===e&&(e={});var r,n=(r=t.useState(0)[1],t.useCallback(function(){return r(function(e){return e+1})},[])),o=t.useRef(f({},e));return[t.useCallback(function(){return o.current},[]),t.useCallback(function(e){e&&(Object.assign(o.current,e),n())},[])]},s=function(e,t,r){return e=(e=e<=r?e:r)>=t?e:t},a=!1,p=[],l=function(e){p.push(e),a||1!==p.length||function e(){a=!0;var t=p.shift();if(t)return t(e);a=!1}()},y=function(e,t){var r;c=window.requestAnimationFrame(function n(o){o-(r=r||o)>t?e():c=window.requestAnimationFrame(n)})},d=function(){},m={isFinished:!1,progress:0,sideEffect:d},v=function(){c&&window.cancelAnimationFrame(c),a=!1,p=[]},b=function(e){var r=void 0===e?{}:e,o=r.animationDuration,i=void 0===o?200:o,c=r.incrementDuration,f=void 0===c?800:c,a=r.isAnimating,p=void 0!==a&&a,b=r.minimum,g=void 0===b?.08:b,P=u(m),h=P[0],S=P[1],O=function(e){if(1===(e=s(e,g,1)))return v(),l(function(t){S({progress:e,sideEffect:function(){return y(t,i)}})}),void l(function(){S({isFinished:!0,sideEffect:v})});l(function(t){S({progress:e,sideEffect:function(){return y(t,i)}})})},$=function(){var e,t;O((e=h().progress,t=0,e>=0&&e<.2?t=.1:e>=.2&&e<.5?t=.04:e>=.5&&e<.8?t=.02:e>=.8&&e<.99&&(t=.005),s(e+t,0,.994)))},w=function(){!function e(){$(),l(function(t){y(function(){e(),t()},f)})}()},j=t.useRef(d);return t.useEffect(function(){j.current=$}),t.useEffect(function(){return p&&w(),v},[]),n(function(){h().sideEffect()},[h().sideEffect]),n(function(){p?S({sideEffect:w}):O(1)},[p]),{animationDuration:i,isFinished:h().isFinished,progress:h().progress}},g=i(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof Symbol&&Symbol.for,n=r?Symbol.for("react.element"):60103,o=r?Symbol.for("react.portal"):60106,i=r?Symbol.for("react.fragment"):60107,c=r?Symbol.for("react.strict_mode"):60108,f=r?Symbol.for("react.profiler"):60114,u=r?Symbol.for("react.provider"):60109,s=r?Symbol.for("react.context"):60110,a=r?Symbol.for("react.async_mode"):60111,p=r?Symbol.for("react.concurrent_mode"):60111,l=r?Symbol.for("react.forward_ref"):60112,y=r?Symbol.for("react.suspense"):60113,d=r?Symbol.for("react.memo"):60115,m=r?Symbol.for("react.lazy"):60116;function v(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case n:switch(e=e.type){case a:case p:case i:case f:case c:case y:return e;default:switch(e=e&&e.$$typeof){case s:case l:case u:return e;default:return t}}case m:case d:case o:return t}}}function b(e){return v(e)===p}t.typeOf=v,t.AsyncMode=a,t.ConcurrentMode=p,t.ContextConsumer=s,t.ContextProvider=u,t.Element=n,t.ForwardRef=l,t.Fragment=i,t.Lazy=m,t.Memo=d,t.Portal=o,t.Profiler=f,t.StrictMode=c,t.Suspense=y,t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===i||e===p||e===f||e===c||e===y||"object"==typeof e&&null!==e&&(e.$$typeof===m||e.$$typeof===d||e.$$typeof===u||e.$$typeof===s||e.$$typeof===l)},t.isAsyncMode=function(e){return b(e)||v(e)===a},t.isConcurrentMode=b,t.isContextConsumer=function(e){return v(e)===s},t.isContextProvider=function(e){return v(e)===u},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===n},t.isForwardRef=function(e){return v(e)===l},t.isFragment=function(e){return v(e)===i},t.isLazy=function(e){return v(e)===m},t.isMemo=function(e){return v(e)===d},t.isPortal=function(e){return v(e)===o},t.isProfiler=function(e){return v(e)===f},t.isStrictMode=function(e){return v(e)===c},t.isSuspense=function(e){return v(e)===y}});o(g);var P=i(function(e,t){});o(P);var h=i(function(e){e.exports=g}),S={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},O={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},$={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},w={};function j(e){return h.isMemo(e)?$:w[e.$$typeof]||S}w[h.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0};var x=Object.defineProperty,E=Object.getOwnPropertyNames,F=Object.getOwnPropertySymbols,C=Object.getOwnPropertyDescriptor,M=Object.getPrototypeOf,_=Object.prototype;var N=function e(t,r,n){if("string"!=typeof r){if(_){var o=M(r);o&&o!==_&&e(t,o,n)}var i=E(r);F&&(i=i.concat(F(r)));for(var c=j(t),f=j(r),u=0;u<i.length;++u){var s=i[u];if(!(O[s]||n&&n[s]||f&&f[s]||c&&c[s])){var a=C(r,s);try{x(t,s,a)}catch(e){}}}return t}return t};e.NProgress=function(e){var t=e.children,n=r(e,["children"]);return t(b(n))},e.useNProgress=b,e.withNProgress=function(e){var r=function(r){var n=b(r);return t.createElement(e,Object.assign({},r,n))};return N(r,e),r},Object.defineProperty(e,"__esModule",{value:!0})});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],t):t((e=e||self).NProgress={},e.React)}(this,function(e,t){"use strict";var r=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)t.indexOf(r=i[n])>=0||(o[r]=e[r]);return o};function n(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function o(e,t){return e(t={exports:{}},t.exports),t.exports}var i,c=o(function(e){function t(){return e.exports=t=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},t.apply(this,arguments)}e.exports=t}),f=function(e,r){var n=t.useRef(!0);t.useEffect(function(){if(!n.current)return e();n.current=!1},r)},u=function(){return(u=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},s=function(e){void 0===e&&(e={});var r,n=(r=t.useState(0)[1],t.useCallback(function(){return r(function(e){return e+1})},[])),o=t.useRef(u({},e));return[t.useCallback(function(){return o.current},[]),t.useCallback(function(e){e&&(Object.assign(o.current,e),n())},[])]},a=function(e,t,r){return e=(e=e<=r?e:r)>=t?e:t},p=!1,l=[],y=function(e){l.push(e),p||1!==l.length||function e(){p=!0;var t=l.shift();if(t)return t(e);p=!1}()},d=function(e,t){var r;i=window.requestAnimationFrame(function n(o){o-(r=r||o)>t?e():i=window.requestAnimationFrame(n)})},m=function(){},v={isFinished:!1,progress:0,sideEffect:m},b=function(){i&&window.cancelAnimationFrame(i),p=!1,l=[]},g=function(e){var r=void 0===e?{}:e,n=r.animationDuration,o=void 0===n?200:n,i=r.incrementDuration,u=void 0===i?800:i,p=r.isAnimating,l=void 0!==p&&p,g=r.minimum,h=void 0===g?.08:g,O=s(v),P=O[0],S=O[1],$=function(e){if(1===(e=a(e,h,1)))return b(),y(function(t){S({progress:e,sideEffect:function(){return d(t,o)}})}),void y(function(){S({isFinished:!0,sideEffect:b})});y(function(t){S({progress:e,sideEffect:function(){return d(t,o)}})})},j=function(){var e,t;$((e=P().progress,t=0,e>=0&&e<.2?t=.1:e>=.2&&e<.5?t=.04:e>=.5&&e<.8?t=.02:e>=.8&&e<.99&&(t=.005),a(e+t,0,.994)))},w=function(){!function e(){j(),y(function(t){d(function(){e(),t()},u)})}()},x=t.useRef(m);return t.useEffect(function(){x.current=j}),t.useEffect(function(){return l&&w(),b},[]),f(function(){P().sideEffect()},[P().sideEffect]),f(function(){l?S(c({},v,{sideEffect:w})):$(1)},[l]),{animationDuration:o,isFinished:P().isFinished,progress:P().progress}},h=o(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof Symbol&&Symbol.for,n=r?Symbol.for("react.element"):60103,o=r?Symbol.for("react.portal"):60106,i=r?Symbol.for("react.fragment"):60107,c=r?Symbol.for("react.strict_mode"):60108,f=r?Symbol.for("react.profiler"):60114,u=r?Symbol.for("react.provider"):60109,s=r?Symbol.for("react.context"):60110,a=r?Symbol.for("react.async_mode"):60111,p=r?Symbol.for("react.concurrent_mode"):60111,l=r?Symbol.for("react.forward_ref"):60112,y=r?Symbol.for("react.suspense"):60113,d=r?Symbol.for("react.memo"):60115,m=r?Symbol.for("react.lazy"):60116;function v(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case n:switch(e=e.type){case a:case p:case i:case f:case c:case y:return e;default:switch(e=e&&e.$$typeof){case s:case l:case u:return e;default:return t}}case m:case d:case o:return t}}}function b(e){return v(e)===p}t.typeOf=v,t.AsyncMode=a,t.ConcurrentMode=p,t.ContextConsumer=s,t.ContextProvider=u,t.Element=n,t.ForwardRef=l,t.Fragment=i,t.Lazy=m,t.Memo=d,t.Portal=o,t.Profiler=f,t.StrictMode=c,t.Suspense=y,t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===i||e===p||e===f||e===c||e===y||"object"==typeof e&&null!==e&&(e.$$typeof===m||e.$$typeof===d||e.$$typeof===u||e.$$typeof===s||e.$$typeof===l)},t.isAsyncMode=function(e){return b(e)||v(e)===a},t.isConcurrentMode=b,t.isContextConsumer=function(e){return v(e)===s},t.isContextProvider=function(e){return v(e)===u},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===n},t.isForwardRef=function(e){return v(e)===l},t.isFragment=function(e){return v(e)===i},t.isLazy=function(e){return v(e)===m},t.isMemo=function(e){return v(e)===d},t.isPortal=function(e){return v(e)===o},t.isProfiler=function(e){return v(e)===f},t.isStrictMode=function(e){return v(e)===c},t.isSuspense=function(e){return v(e)===y}});n(h);var O=o(function(e,t){});n(O);var P=o(function(e){e.exports=h}),S={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},j={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},w={};function x(e){return P.isMemo(e)?j:w[e.$$typeof]||S}w[P.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0};var E=Object.defineProperty,F=Object.getOwnPropertyNames,C=Object.getOwnPropertySymbols,M=Object.getOwnPropertyDescriptor,_=Object.getPrototypeOf,N=Object.prototype;var D=function e(t,r,n){if("string"!=typeof r){if(N){var o=_(r);o&&o!==N&&e(t,o,n)}var i=F(r);C&&(i=i.concat(C(r)));for(var c=x(t),f=x(r),u=0;u<i.length;++u){var s=i[u];if(!($[s]||n&&n[s]||f&&f[s]||c&&c[s])){var a=M(r,s);try{E(t,s,a)}catch(e){}}}return t}return t};e.NProgress=function(e){var t=e.children,n=r(e,["children"]);return t(g(n))},e.useNProgress=g,e.withNProgress=function(e){var r=function(r){var n=g(r);return t.createElement(e,Object.assign({},r,n))};return D(r,e),r},Object.defineProperty(e,"__esModule",{value:!0})});
//# sourceMappingURL=react-nprogress.umd.production.js.map
{
"name": "@tanem/react-nprogress",
"version": "3.0.6",
"version": "3.0.7-beta.1",
"description": "A React primitive for building slim progress bars.",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc