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.36 to 0.0.37

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 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};
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,className:c.default.string},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,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}});
!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),N=a.useRef(),x=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:N.current,content:x.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(){N.current&&(N.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:N,className:s.default(null==E?void 0:E.className,k)},C),/*#__PURE__*/f.default.createElement("div",{ref:x},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,className:c.default.string},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

@@ -215,4 +215,5 @@ /**

* @param {number=} [rafPriority=0] Priority of Lenis.raf call (lower priority callbacks are called first)
* @param {string=} [className] Class name to be applied to the wrapper
*/
export const ReactLenis: any;
export { ReactLenis as Lenis };
{
"name": "@studio-freight/react-lenis",
"version": "0.0.36",
"version": "0.0.37",
"description": "a react wrapper for lenis smooth scroll library",

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

@@ -0,0 +0,0 @@ <!-- [![Bibliotheca](https://assets.studiofreight.com/bibliotheca/header.png)](https://github.com/studio-freight/bibliotheca) -->

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