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

@studio-freight/react-lenis

Package Overview
Dependencies
Maintainers
4
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@studio-freight/react-lenis - npm Package Compare versions

Comparing version 0.0.34 to 0.0.35

2

dist/react-lenis.js

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

var e=require("@studio-freight/hamo"),r=require("@studio-freight/lenis"),t=require("prop-types"),n=require("react"),a=require("zustand"),u=require("clsx");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=/*#__PURE__*/o(r),l=/*#__PURE__*/o(t),i=/*#__PURE__*/o(n),f=/*#__PURE__*/o(u);function s(){return s=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},s.apply(this,arguments)}var d=["children","root","options","autoRaf","rafPriority","className"],v=n.createContext(),p=a.create(function(){return{}}),b=n.forwardRef(function(r,t){var a=r.children,u=r.root,o=void 0!==u&&u,l=r.options,b=void 0===l?{}:l,m=r.autoRaf,y=void 0===m||m,h=r.rafPriority,k=void 0===h?0:h,C=r.className,g=function(e,r){if(null==e)return{};var t,n,a={},u=Object.keys(e);for(n=0;n<u.length;n++)r.indexOf(t=u[n])>=0||(a[t]=e[t]);return a}(r,d),x=n.useRef(),R=n.useRef(),E=n.useState(),N=E[0],O=E[1],j=n.useRef([]),q=n.useCallback(function(e,r){j.current.push({callback:e,priority:r}),j.current.sort(function(e,r){return e.priority-r.priority})},[]),L=n.useCallback(function(e){j.current=j.current.filter(function(r){return r.callback!==e})},[]);n.useImperativeHandle(t,function(){return N},[N]),n.useEffect(function(){var e=new c.default(s({},b,!o&&{wrapper:x.current,content:R.current}));return O(e),function(){e.destroy(),O(void 0)}},[o,JSON.stringify(b)]),e.useFrame(function(e){y&&(null==N||N.raf(e))},k),n.useEffect(function(){o&&N&&p.setState({lenis:N,addCallback:q,removeCallback:L})},[o,N,q,L]);var P=n.useCallback(function(e){for(var r=0;r<j.current.length;r++)j.current[r].callback(e)},[]);n.useEffect(function(){return null==N||N.on("scroll",P),function(){null==N||N.off("scroll",P)}},[N,P]);var w=n.useCallback(function(){x.current&&(x.current.className=f.default(null==N?void 0:N.className,C))},[N,C]);return n.useEffect(function(){return w(),null==N||N.on("className change",w),function(){null==N||N.off("className change",w)}},[N,w]),/*#__PURE__*/i.default.createElement(v.Provider,{value:{lenis:N,addCallback:q,removeCallback:L}},o?a:/*#__PURE__*/i.default.createElement("div",s({ref:x},g),/*#__PURE__*/i.default.createElement("div",{ref:R},a)))});b.displayName="ReactLenis",b.propTypes={children:l.default.node,root:l.default.bool,options:l.default.object,autoRaf:l.default.bool,rafPriority:l.default.number},exports.Lenis=b,exports.LenisContext=v,exports.ReactLenis=b,exports.useLenis=function(e,r,t){void 0===r&&(r=[]),void 0===t&&(t=0);var a,u,o=(a=n.useContext(v),u=p(),null!=a?a:u),c=o.lenis,l=o.addCallback,i=o.removeCallback;return n.useEffect(function(){if(e&&l&&i&&c)return l(e,t),e(c),function(){i(e)}},[c,l,i,t].concat(r)),c};
var e=require("@studio-freight/hamo"),r=require("@studio-freight/lenis"),t=require("prop-types"),n=require("react"),a=require("zustand"),u=require("clsx");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=/*#__PURE__*/o(r),c=/*#__PURE__*/o(t),i=/*#__PURE__*/o(n),f=/*#__PURE__*/o(u);function s(){return s=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},s.apply(this,arguments)}var d=["children","root","options","autoRaf","rafPriority","className"],v=n.createContext(),p=a.create(function(){return{}}),b=n.forwardRef(function(r,t){var a=r.children,u=r.root,o=void 0!==u&&u,c=r.options,b=void 0===c?{}:c,m=r.autoRaf,y=void 0===m||m,h=r.rafPriority,k=void 0===h?0:h,C=r.className,g=function(e,r){if(null==e)return{};var t,n,a={},u=Object.keys(e);for(n=0;n<u.length;n++)r.indexOf(t=u[n])>=0||(a[t]=e[t]);return a}(r,d),N=n.useRef(),x=n.useRef(),R=n.useState(),E=R[0],O=R[1],j=n.useRef([]),q=n.useCallback(function(e,r){j.current.push({callback:e,priority:r}),j.current.sort(function(e,r){return e.priority-r.priority})},[]),L=n.useCallback(function(e){j.current=j.current.filter(function(r){return r.callback!==e})},[]);n.useImperativeHandle(t,function(){return E},[E]),n.useEffect(function(){var e=new l.default(s({},b,!o&&{wrapper:N.current,content:x.current}));return O(e),function(){e.destroy(),O(void 0)}},[o,JSON.stringify(b)]),e.useFrame(function(e){y&&(null==E||E.raf(e))},k),n.useEffect(function(){o&&E&&p.setState({lenis:E,addCallback:q,removeCallback:L})},[o,E,q,L]);var P=n.useCallback(function(e){for(var r=0;r<j.current.length;r++)j.current[r].callback(e)},[]);n.useEffect(function(){return null==E||E.on("scroll",P),function(){null==E||E.off("scroll",P)}},[E,P]);var w=n.useCallback(function(){N.current&&(N.current.className=f.default(null==E?void 0:E.className,C))},[E,C]);return n.useEffect(function(){return w(),null==E||E.on("className change",w),function(){null==E||E.off("className change",w)}},[E,w]),/*#__PURE__*/i.default.createElement(v.Provider,{value:{lenis:E,addCallback:q,removeCallback:L}},o?a:/*#__PURE__*/i.default.createElement("div",s({ref:N,className:f.default(null==E?void 0:E.className,C)},g),/*#__PURE__*/i.default.createElement("div",{ref:x},a)))});b.displayName="ReactLenis",b.propTypes={children:c.default.node,root:c.default.bool,options:c.default.object,autoRaf:c.default.bool,rafPriority:c.default.number},exports.Lenis=b,exports.LenisContext=v,exports.ReactLenis=b,exports.useLenis=function(e,r,t){void 0===r&&(r=[]),void 0===t&&(t=0);var a,u,o=(a=n.useContext(v),u=p(),null!=a?a:u),l=o.lenis,c=o.addCallback,i=o.removeCallback;return n.useEffect(function(){if(e&&c&&i&&l)return c(e,t),e(l),function(){i(e)}},[l,c,i,t].concat(r)),l};
//# sourceMappingURL=react-lenis.js.map

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

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@studio-freight/hamo"),require("@studio-freight/lenis"),require("prop-types"),require("react"),require("zustand"),require("clsx")):"function"==typeof define&&define.amd?define(["exports","@studio-freight/hamo","@studio-freight/lenis","prop-types","react","zustand","clsx"],t):t((e||self).reactLenis={},e.hamo,e.Lenis,e.propTypes,e.react,e.zustand,e.clsx)}(this,function(e,t,n,r,a,o,u){function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=/*#__PURE__*/i(n),l=/*#__PURE__*/i(r),f=/*#__PURE__*/i(a),s=/*#__PURE__*/i(u);function d(){return d=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},d.apply(this,arguments)}var p=["children","root","options","autoRaf","rafPriority","className"],v=a.createContext(),b=o.create(function(){return{}}),y=a.forwardRef(function(e,n){var r=e.children,o=e.root,u=void 0!==o&&o,i=e.options,l=void 0===i?{}:i,y=e.autoRaf,h=void 0===y||y,m=e.rafPriority,g=void 0===m?0:m,k=e.className,C=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)t.indexOf(n=o[r])>=0||(a[n]=e[n]);return a}(e,p),x=a.useRef(),R=a.useRef(),E=a.useState(),N=E[0],j=E[1],L=a.useRef([]),O=a.useCallback(function(e,t){L.current.push({callback:e,priority:t}),L.current.sort(function(e,t){return e.priority-t.priority})},[]),q=a.useCallback(function(e){L.current=L.current.filter(function(t){return t.callback!==e})},[]);a.useImperativeHandle(n,function(){return N},[N]),a.useEffect(function(){var e=new c.default(d({},l,!u&&{wrapper:x.current,content:R.current}));return j(e),function(){e.destroy(),j(void 0)}},[u,JSON.stringify(l)]),t.useFrame(function(e){h&&(null==N||N.raf(e))},g),a.useEffect(function(){u&&N&&b.setState({lenis:N,addCallback:O,removeCallback:q})},[u,N,O,q]);var P=a.useCallback(function(e){for(var t=0;t<L.current.length;t++)L.current[t].callback(e)},[]);a.useEffect(function(){return null==N||N.on("scroll",P),function(){null==N||N.off("scroll",P)}},[N,P]);var w=a.useCallback(function(){x.current&&(x.current.className=s.default(null==N?void 0:N.className,k))},[N,k]);return a.useEffect(function(){return w(),null==N||N.on("className change",w),function(){null==N||N.off("className change",w)}},[N,w]),/*#__PURE__*/f.default.createElement(v.Provider,{value:{lenis:N,addCallback:O,removeCallback:q}},u?r:/*#__PURE__*/f.default.createElement("div",d({ref:x},C),/*#__PURE__*/f.default.createElement("div",{ref:R},r)))});y.displayName="ReactLenis",y.propTypes={children:l.default.node,root:l.default.bool,options:l.default.object,autoRaf:l.default.bool,rafPriority:l.default.number},e.Lenis=y,e.LenisContext=v,e.ReactLenis=y,e.useLenis=function(e,t,n){void 0===t&&(t=[]),void 0===n&&(n=0);var r,o,u=(r=a.useContext(v),o=b(),null!=r?r:o),i=u.lenis,c=u.addCallback,l=u.removeCallback;return a.useEffect(function(){if(e&&c&&l&&i)return c(e,n),e(i),function(){l(e)}},[i,c,l,n].concat(t)),i}});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@studio-freight/hamo"),require("@studio-freight/lenis"),require("prop-types"),require("react"),require("zustand"),require("clsx")):"function"==typeof define&&define.amd?define(["exports","@studio-freight/hamo","@studio-freight/lenis","prop-types","react","zustand","clsx"],t):t((e||self).reactLenis={},e.hamo,e.Lenis,e.propTypes,e.react,e.zustand,e.clsx)}(this,function(e,t,n,r,a,u,o){function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=/*#__PURE__*/i(n),c=/*#__PURE__*/i(r),f=/*#__PURE__*/i(a),s=/*#__PURE__*/i(o);function d(){return d=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},d.apply(this,arguments)}var p=["children","root","options","autoRaf","rafPriority","className"],v=a.createContext(),b=u.create(function(){return{}}),m=a.forwardRef(function(e,n){var r=e.children,u=e.root,o=void 0!==u&&u,i=e.options,c=void 0===i?{}:i,m=e.autoRaf,y=void 0===m||m,h=e.rafPriority,g=void 0===h?0:h,k=e.className,C=function(e,t){if(null==e)return{};var n,r,a={},u=Object.keys(e);for(r=0;r<u.length;r++)t.indexOf(n=u[r])>=0||(a[n]=e[n]);return a}(e,p),x=a.useRef(),N=a.useRef(),R=a.useState(),E=R[0],j=R[1],L=a.useRef([]),O=a.useCallback(function(e,t){L.current.push({callback:e,priority:t}),L.current.sort(function(e,t){return e.priority-t.priority})},[]),q=a.useCallback(function(e){L.current=L.current.filter(function(t){return t.callback!==e})},[]);a.useImperativeHandle(n,function(){return E},[E]),a.useEffect(function(){var e=new l.default(d({},c,!o&&{wrapper:x.current,content:N.current}));return j(e),function(){e.destroy(),j(void 0)}},[o,JSON.stringify(c)]),t.useFrame(function(e){y&&(null==E||E.raf(e))},g),a.useEffect(function(){o&&E&&b.setState({lenis:E,addCallback:O,removeCallback:q})},[o,E,O,q]);var P=a.useCallback(function(e){for(var t=0;t<L.current.length;t++)L.current[t].callback(e)},[]);a.useEffect(function(){return null==E||E.on("scroll",P),function(){null==E||E.off("scroll",P)}},[E,P]);var w=a.useCallback(function(){x.current&&(x.current.className=s.default(null==E?void 0:E.className,k))},[E,k]);return a.useEffect(function(){return w(),null==E||E.on("className change",w),function(){null==E||E.off("className change",w)}},[E,w]),/*#__PURE__*/f.default.createElement(v.Provider,{value:{lenis:E,addCallback:O,removeCallback:q}},o?r:/*#__PURE__*/f.default.createElement("div",d({ref:x,className:s.default(null==E?void 0:E.className,k)},C),/*#__PURE__*/f.default.createElement("div",{ref:N},r)))});m.displayName="ReactLenis",m.propTypes={children:c.default.node,root:c.default.bool,options:c.default.object,autoRaf:c.default.bool,rafPriority:c.default.number},e.Lenis=m,e.LenisContext=v,e.ReactLenis=m,e.useLenis=function(e,t,n){void 0===t&&(t=[]),void 0===n&&(n=0);var r,u,o=(r=a.useContext(v),u=b(),null!=r?r:u),i=o.lenis,l=o.addCallback,c=o.removeCallback;return a.useEffect(function(){if(e&&l&&c&&i)return l(e,n),e(i),function(){c(e)}},[i,l,c,n].concat(t)),i}});
//# sourceMappingURL=react-lenis.umd.js.map
{
"name": "@studio-freight/react-lenis",
"version": "0.0.34",
"version": "0.0.35",
"description": "a react wrapper for lenis smooth scroll library",

@@ -5,0 +5,0 @@ "files": [

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

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