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

react-use-presentation

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-use-presentation - npm Package Compare versions

Comparing version 1.4.1 to 1.4.2

dist/setupTests.d.ts

7

CHANGELOG.md

@@ -5,2 +5,9 @@ # Changelog

### [1.4.2](https://github.com/olavoparno/react-use-presentation/compare/v1.4.1...v1.4.2) (2022-11-17)
### Bug Fixes
* upgrade @material-ui/core from 4.12.1 to 4.12.3 ([49f83b4](https://github.com/olavoparno/react-use-presentation/commit/49f83b40a52ce107d034ed40a3e40385a15dd34d))
### [1.4.1](https://github.com/olavoparno/react-use-presentation/compare/v1.4.0...v1.4.1) (2021-03-10)

@@ -7,0 +14,0 @@

2

dist/index.es.js

@@ -15,3 +15,3 @@ import{useState as n,useRef as t,useCallback as e,useEffect as r,cloneElement as o,useMemo as i}from"react";

PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var u=function(){return(u=Object.assign||function(n){for(var t,e=1,r=arguments.length;e<r;e++)for(var o in t=arguments[e])Object.prototype.hasOwnProperty.call(t,o)&&(n[o]=t[o]);return n}).apply(this,arguments)};function a(n,t,e,r){return new(e||(e=Promise))((function(o,i){function u(n){try{c(r.next(n))}catch(n){i(n)}}function a(n){try{c(r.throw(n))}catch(n){i(n)}}function c(n){var t;n.done?o(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(u,a)}c((r=r.apply(n,t||[])).next())}))}function c(n,t){var e,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(e)throw new TypeError("Generator is already executing.");for(;u;)try{if(e=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=u.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=t.call(n,u)}catch(n){i=[6,n],r=0}finally{e=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}function l(l){var s=this,f=l.framesOptions,v=l.startTrigger,p=l.startDelay,h=void 0===p?void 0:p,d=l.isLoop,m=void 0!==d&&d,b=l.callback,y=void 0===b?void 0:b,w=n(null),g=w[0],x=w[1],k=(null==f?void 0:f.length)||0,O=t(f),P=e((function(){return y&&"function"==typeof y?y():null}),[y]),T=e((function(n){return a(s,void 0,void 0,(function(){var t,e,r,o;return c(this,(function(i){switch(i.label){case 0:return t=n[0],e=n.slice(1),r=(null===(o=O.current)||void 0===o?void 0:o.indexOf(t))+1,x(u(u({},t),{currentFrame:r})),[4,new Promise((function(n){return setTimeout(n,t.time)}))];case 1:return i.sent(),e.length?[4,T(e)]:[3,3];case 2:i.sent(),i.label=3;case 3:return P(),[2]}}))}))}),[P]),F=e((function(){return a(s,void 0,void 0,(function(){var n;return c(this,(function(t){switch(t.label){case 0:return n=O.current,h?[4,new Promise((function(n){return setTimeout(n,h)}))]:[3,2];case 1:t.sent(),t.label=2;case 2:return[4,T(n)];case 3:return t.sent(),m&&F(),[2]}}))}))}),[h,m,T]);r((function(){var n=!0;return k>0&&v&&n&&F(),function(){n=!1}}),[k,v,F]);var j=e((function(n){var t=n.children,e=n.className,r=t?"animation-frame with-children":"animation-frame";return(null==g?void 0:g.component)?o(g.component,{className:e?r+" "+e:r},t||g.component):null}),[g]);return i((function(){var n=(null!=g?g:{currentFrame:0}).currentFrame;return[j,n,k]}),[j,g,k])}export default l;
***************************************************************************** */var u=function(){return(u=Object.assign||function(n){for(var t,e=1,r=arguments.length;e<r;e++)for(var o in t=arguments[e])Object.prototype.hasOwnProperty.call(t,o)&&(n[o]=t[o]);return n}).apply(this,arguments)};function a(n,t,e,r){return new(e||(e=Promise))((function(o,i){function u(n){try{c(r.next(n))}catch(n){i(n)}}function a(n){try{c(r.throw(n))}catch(n){i(n)}}function c(n){var t;n.done?o(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(u,a)}c((r=r.apply(n,t||[])).next())}))}function c(n,t){var e,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(e)throw new TypeError("Generator is already executing.");for(;u;)try{if(e=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=u.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=t.call(n,u)}catch(n){i=[6,n],r=0}finally{e=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}function l(l){var s=this,f=l.framesOptions,v=l.startTrigger,p=l.startDelay,h=void 0===p?void 0:p,d=l.isLoop,m=void 0!==d&&d,b=l.callback,y=void 0===b?void 0:b,w=n(null),g=w[0],x=w[1],k=(null==f?void 0:f.length)||0,O=t(f),P=e((function(){return y&&"function"==typeof y?y():null}),[y]),T=e((function(n){return a(s,void 0,void 0,(function(){var t,e,r,o;return c(this,(function(i){switch(i.label){case 0:return t=n[0],e=n.slice(1),r=((null===(o=O.current)||void 0===o?void 0:o.indexOf(t))||0)+1,x(u(u({},t),{currentFrame:r})),[4,new Promise((function(n){return setTimeout(n,t.time)}))];case 1:return i.sent(),e.length?[4,T(e)]:[3,3];case 2:i.sent(),i.label=3;case 3:return P(),[2]}}))}))}),[P]),F=e((function(){return a(s,void 0,void 0,(function(){var n;return c(this,(function(t){switch(t.label){case 0:return n=O.current,h?[4,new Promise((function(n){return setTimeout(n,h)}))]:[3,2];case 1:t.sent(),t.label=2;case 2:return[4,T(n)];case 3:return t.sent(),m&&F(),[2]}}))}))}),[h,m,T]);r((function(){var n=!0;return k>0&&v&&n&&F(),function(){n=!1}}),[k,v,F]);var j=e((function(n){var t=n.children,e=n.className,r=t?"animation-frame with-children":"animation-frame";return(null==g?void 0:g.component)?o(g.component,{className:e?r+" "+e:r},t||g.component):null}),[g]);return i((function(){var n=(null!=g?g:{currentFrame:0}).currentFrame;return[j,n,k]}),[j,g,k])}export default l;
//# sourceMappingURL=index.es.js.map

@@ -15,3 +15,3 @@ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),n=function(){return(n=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e}).apply(this,arguments)};

PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */function t(e,n,t,r){return new(t||(t=Promise))((function(o,u){function a(e){try{c(r.next(e))}catch(e){u(e)}}function i(e){try{c(r.throw(e))}catch(e){u(e)}}function c(e){var n;e.done?o(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(a,i)}c((r=r.apply(e,n||[])).next())}))}function r(e,n){var t,r,o,u,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return u={next:i(0),throw:i(1),return:i(2)},"function"==typeof Symbol&&(u[Symbol.iterator]=function(){return this}),u;function i(u){return function(i){return function(u){if(t)throw new TypeError("Generator is already executing.");for(;a;)try{if(t=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return a.label++,{value:u[1],done:!1};case 5:a.label++,r=u[1],u=[0];continue;case 7:u=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==u[0]&&2!==u[0])){a=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){a.label=u[1];break}if(6===u[0]&&a.label<o[1]){a.label=o[1],o=u;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(u);break}o[2]&&a.ops.pop(),a.trys.pop();continue}u=n.call(e,a)}catch(e){u=[6,e],r=0}finally{t=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,i])}}}exports.default=function(o){var u=this,a=o.framesOptions,i=o.startTrigger,c=o.startDelay,l=void 0===c?void 0:c,s=o.isLoop,f=void 0!==s&&s,v=o.callback,p=void 0===v?void 0:v,h=e.useState(null),b=h[0],d=h[1],m=(null==a?void 0:a.length)||0,y=e.useRef(a),w=e.useCallback((function(){return p&&"function"==typeof p?p():null}),[p]),g=e.useCallback((function(e){return t(u,void 0,void 0,(function(){var t,o,u,a;return r(this,(function(r){switch(r.label){case 0:return t=e[0],o=e.slice(1),u=(null===(a=y.current)||void 0===a?void 0:a.indexOf(t))+1,d(n(n({},t),{currentFrame:u})),[4,new Promise((function(e){return setTimeout(e,t.time)}))];case 1:return r.sent(),o.length?[4,g(o)]:[3,3];case 2:r.sent(),r.label=3;case 3:return w(),[2]}}))}))}),[w]),k=e.useCallback((function(){return t(u,void 0,void 0,(function(){var e;return r(this,(function(n){switch(n.label){case 0:return e=y.current,l?[4,new Promise((function(e){return setTimeout(e,l)}))]:[3,2];case 1:n.sent(),n.label=2;case 2:return[4,g(e)];case 3:return n.sent(),f&&k(),[2]}}))}))}),[l,f,g]);e.useEffect((function(){var e=!0;return m>0&&i&&e&&k(),function(){e=!1}}),[m,i,k]);var x=e.useCallback((function(n){var t=n.children,r=n.className,o=t?"animation-frame with-children":"animation-frame";return(null==b?void 0:b.component)?e.cloneElement(b.component,{className:r?o+" "+r:o},t||b.component):null}),[b]);return e.useMemo((function(){var e=(null!=b?b:{currentFrame:0}).currentFrame;return[x,e,m]}),[x,b,m])};
***************************************************************************** */function t(e,n,t,r){return new(t||(t=Promise))((function(o,u){function a(e){try{c(r.next(e))}catch(e){u(e)}}function i(e){try{c(r.throw(e))}catch(e){u(e)}}function c(e){var n;e.done?o(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(a,i)}c((r=r.apply(e,n||[])).next())}))}function r(e,n){var t,r,o,u,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return u={next:i(0),throw:i(1),return:i(2)},"function"==typeof Symbol&&(u[Symbol.iterator]=function(){return this}),u;function i(u){return function(i){return function(u){if(t)throw new TypeError("Generator is already executing.");for(;a;)try{if(t=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return a.label++,{value:u[1],done:!1};case 5:a.label++,r=u[1],u=[0];continue;case 7:u=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==u[0]&&2!==u[0])){a=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){a.label=u[1];break}if(6===u[0]&&a.label<o[1]){a.label=o[1],o=u;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(u);break}o[2]&&a.ops.pop(),a.trys.pop();continue}u=n.call(e,a)}catch(e){u=[6,e],r=0}finally{t=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,i])}}}exports.default=function(o){var u=this,a=o.framesOptions,i=o.startTrigger,c=o.startDelay,l=void 0===c?void 0:c,s=o.isLoop,f=void 0!==s&&s,v=o.callback,p=void 0===v?void 0:v,h=e.useState(null),b=h[0],d=h[1],m=(null==a?void 0:a.length)||0,y=e.useRef(a),w=e.useCallback((function(){return p&&"function"==typeof p?p():null}),[p]),g=e.useCallback((function(e){return t(u,void 0,void 0,(function(){var t,o,u,a;return r(this,(function(r){switch(r.label){case 0:return t=e[0],o=e.slice(1),u=((null===(a=y.current)||void 0===a?void 0:a.indexOf(t))||0)+1,d(n(n({},t),{currentFrame:u})),[4,new Promise((function(e){return setTimeout(e,t.time)}))];case 1:return r.sent(),o.length?[4,g(o)]:[3,3];case 2:r.sent(),r.label=3;case 3:return w(),[2]}}))}))}),[w]),k=e.useCallback((function(){return t(u,void 0,void 0,(function(){var e;return r(this,(function(n){switch(n.label){case 0:return e=y.current,l?[4,new Promise((function(e){return setTimeout(e,l)}))]:[3,2];case 1:n.sent(),n.label=2;case 2:return[4,g(e)];case 3:return n.sent(),f&&k(),[2]}}))}))}),[l,f,g]);e.useEffect((function(){var e=!0;return m>0&&i&&e&&k(),function(){e=!1}}),[m,i,k]);var x=e.useCallback((function(n){var t=n.children,r=n.className,o=t?"animation-frame with-children":"animation-frame";return(null==b?void 0:b.component)?e.cloneElement(b.component,{className:r?o+" "+r:o},t||b.component):null}),[b]);return e.useMemo((function(){var e=(null!=b?b:{currentFrame:0}).currentFrame;return[x,e,m]}),[x,b,m])};
//# sourceMappingURL=index.js.map
{
"name": "react-use-presentation",
"version": "1.4.1",
"version": "1.4.2",
"description": "Create pure HTML (React enriched if you will) presentations.",

@@ -24,10 +24,5 @@ "author": "Olavo Parno",

],
"husky": {
"hooks": {
"pre-commit": "npm run lint && npm run test:coverage && npm run make-badges && git add 'README.md'"
}
},
"lint-staged": {
"*.{js,ts,tsx}": [
"eslint --fix src/**/*.{js,jsx,ts,tsx}"
"*.{ts,tsx}": [
"eslint --fix src/**/*.{ts,tsx}"
]

@@ -37,11 +32,11 @@ },

"test": "cross-env CI=1 react-scripts test --env=jsdom",
"test:coverage": "npm run test -- --coverage",
"test:coverage": "npm run test -- --coverage --watchAll=false",
"prebuild": "rm -rf dist",
"build": "rollup -c && tsc -d --emitDeclarationOnly --noEmit false --declarationDir dist",
"start": "rollup -c -w",
"prepare": "npm run build",
"prepare": "husky install && npm run build",
"predeploy": "cd example && npm install && npm run build",
"deploy": "gh-pages -d example/build",
"format": "prettier --write src/**/*.{js,jsx,ts,tsx}",
"lint": "eslint --fix src/**/*.{js,jsx,ts,tsx}",
"format": "prettier --write src/**/*.{ts,tsx}",
"lint": "eslint --fix src/**/*.{ts,tsx}",
"release": "standard-version",

@@ -56,45 +51,44 @@ "make-badges": "istanbul-badges-readme"

},
"dependencies": {},
"peerDependencies": {
"react": "^17.0.1"
"react": "^17.0.2 || ^18"
},
"devDependencies": {
"@babel/core": "^7.13.10",
"@babel/runtime": "^7.13.10",
"@babel/core": "^7.14.6",
"@babel/runtime": "^7.14.6",
"@rollup/plugin-babel": "^5.3.0",
"@rollup/plugin-commonjs": "^17.1.0",
"@rollup/plugin-node-resolve": "^11.2.0",
"@rollup/plugin-typescript": "^8.2.0",
"@rollup/plugin-commonjs": "^19.0.0",
"@rollup/plugin-node-resolve": "^13.0.0",
"@rollup/plugin-typescript": "^8.2.1",
"@rollup/plugin-url": "^6.0.0",
"@testing-library/jest-dom": "^5.11.9",
"@testing-library/react": "^11.2.5",
"@testing-library/react-hooks": "^5.1.0",
"@types/jest": "^26.0.20",
"@types/react": "^17.0.3",
"@typescript-eslint/eslint-plugin": "^4.17.0",
"@typescript-eslint/parser": "^4.17.0",
"@testing-library/jest-dom": "^5.14.1",
"@testing-library/react": "^12.0.0",
"@testing-library/react-hooks": "^7.0.1",
"@types/jest": "^26.0.24",
"@types/react": "^17.0.14",
"@typescript-eslint/eslint-plugin": "^4.28.3",
"@typescript-eslint/parser": "^4.28.3",
"cross-env": "^7.0.3",
"eslint": "^7.21.0",
"eslint": "^7.30.0",
"eslint-config-airbnb": "^18.2.1",
"eslint-config-airbnb-typescript-prettier": "^4.1.0",
"eslint-config-prettier": "^8.1.0",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-import": "^2.23.4",
"eslint-plugin-jsx-a11y": "^6.4.1",
"eslint-plugin-prettier": "^3.3.1",
"eslint-plugin-react": "^7.22.0",
"eslint-plugin-react": "^7.24.0",
"eslint-plugin-react-hooks": "^4.2.0",
"gh-pages": "^3.1.0",
"husky": "^5.1.3",
"istanbul-badges-readme": "^1.2.0",
"prettier": "^2.2.1",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"eslint-config-airbnb-typescript-prettier": "^4.2.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-prettier": "^3.4.0",
"gh-pages": "^3.2.3",
"husky": "^7.0.1",
"istanbul-badges-readme": "^1.4.0",
"prettier": "^2.3.2",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-scripts": "^4.0.3",
"rollup": "^2.41.0",
"rollup": "^2.53.1",
"rollup-plugin-peer-deps-external": "^2.2.4",
"rollup-plugin-terser": "^7.0.2",
"standard-version": "^9.1.1",
"tslib": "^2.1.0",
"tslib": "^2.3.0",
"standard-version": "^9.3.0",
"typescript": "^4.2.3"
}
}

@@ -13,3 +13,3 @@ <img align="right" alt="traffic" src="https://pv-badge.herokuapp.com/total.svg?repo_id=olavoparno-react-use-presentation"/>

| --------------------------------------------------------------------------- | ------------------------------------------------------------------------- | -------------------------------------------------------------------------- | ---------------------------------------------------------------------- |
| ![Statements](https://img.shields.io/badge/Coverage-100%25-brightgreen.svg) | ![Branches](https://img.shields.io/badge/Coverage-100%25-brightgreen.svg) | ![Functions](https://img.shields.io/badge/Coverage-100%25-brightgreen.svg) | ![Lines](https://img.shields.io/badge/Coverage-100%25-brightgreen.svg) |
| ![Statements](https://img.shields.io/badge/statements-100%25-brightgreen.svg) | ![Branches](https://img.shields.io/badge/branches-100%25-brightgreen.svg) | ![Functions](https://img.shields.io/badge/functions-100%25-brightgreen.svg) | ![Lines](https://img.shields.io/badge/lines-100%25-brightgreen.svg) |

@@ -16,0 +16,0 @@ ## Table of Contents

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