From 13676cb607249ff1ba0ef65b72618834ae5eb64c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Roche?= Date: Wed, 28 Feb 2024 19:25:14 +0100 Subject: [PATCH] @studio-freight/react-lenis@0.0.46-dev.1 --- packages/react-lenis/dist/react-lenis.cjs.js | 2 +- packages/react-lenis/dist/react-lenis.mjs | 2 +- packages/react-lenis/dist/react-lenis.umd.js | 2 +- packages/react-lenis/package.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/react-lenis/dist/react-lenis.cjs.js b/packages/react-lenis/dist/react-lenis.cjs.js index 01143588..1d9400c9 100644 --- a/packages/react-lenis/dist/react-lenis.cjs.js +++ b/packages/react-lenis/dist/react-lenis.cjs.js @@ -1,2 +1,2 @@ -"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@studio-freight/hamo"),r=require("@studio-freight/lenis"),t=require("clsx"),n=require("react"),s=require("zustand");"function"==typeof SuppressedError&&SuppressedError;"undefined"!=typeof window&&(window.reactLenisVersion="0.0.46-dev.0");const a=n.createContext(),l=s.create((()=>({})));const c=n.forwardRef(((s,c)=>{var{children:o,root:u=!1,options:i={},autoRaf:f=!0,rafPriority:p=0,className:d}=s,b=function(e,r){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&r.indexOf(n)<0&&(t[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(n=Object.getOwnPropertySymbols(e);s{k.current.push({callback:e,priority:r}),k.current.sort(((e,r)=>e.priority-r.priority))}),[]),g=n.useCallback((e=>{k.current=k.current.filter((r=>r.callback!==e))}),[]);n.useImperativeHandle(c,(()=>({wrapper:m.current,content:y.current,lenis:v})),[v]),n.useEffect((()=>{const e=new r(Object.assign(Object.assign({},i),!u&&{wrapper:m.current,content:y.current}));return O(e),()=>{e.destroy(),O(void 0)}}),[u,JSON.stringify(i)]),e.useFrame((e=>{f&&(null==v||v.raf(e))}),p),n.useEffect((()=>{u&&v&&l.setState({lenis:v,addCallback:C,removeCallback:g})}),[u,v,C,g]);const x=n.useCallback((e=>{for(let r=0;r(null==v||v.on("scroll",x),()=>{null==v||v.off("scroll",x)})),[v,x]);const h=n.useCallback((()=>{m.current&&(m.current.className=t(null==v?void 0:v.className,d))}),[v,d]);return n.useEffect((()=>(h(),null==v||v.on("className change",h),()=>{null==v||v.off("className change",h)})),[v,h]),n.createElement(a.Provider,{value:{lenis:v,addCallback:C,removeCallback:g}},u?o:n.createElement("div",Object.assign({ref:m,className:t(null==v?void 0:v.className,d)},b),n.createElement("div",{ref:y},o)))}));exports.Lenis=c,exports.LenisContext=a,exports.ReactLenis=c,exports.default=c,exports.useLenis=function(e,r=[],t=0){const{lenis:s,addCallback:c,removeCallback:o}=function(){const e=n.useContext(a),r=l();return null!=e?e:r}();return n.useEffect((()=>{if(e&&c&&o&&s)return c(e,t),e(s),()=>{o(e)}}),[s,c,o,t,...r]),s}; +"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@studio-freight/hamo"),r=require("@studio-freight/lenis"),t=require("clsx"),n=require("react"),s=require("zustand");"function"==typeof SuppressedError&&SuppressedError;"undefined"!=typeof window&&(window.reactLenisVersion="0.0.46-dev.1");const a=n.createContext(),l=s.create((()=>({})));const c=n.forwardRef(((s,c)=>{var{children:o,root:u=!1,options:i={},autoRaf:f=!0,rafPriority:p=0,className:d}=s,b=function(e,r){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&r.indexOf(n)<0&&(t[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(n=Object.getOwnPropertySymbols(e);s{k.current.push({callback:e,priority:r}),k.current.sort(((e,r)=>e.priority-r.priority))}),[]),g=n.useCallback((e=>{k.current=k.current.filter((r=>r.callback!==e))}),[]);n.useImperativeHandle(c,(()=>({wrapper:m.current,content:y.current,lenis:v})),[v]),n.useEffect((()=>{const e=new r(Object.assign(Object.assign({},i),!u&&{wrapper:m.current,content:y.current}));return O(e),()=>{e.destroy(),O(void 0)}}),[u,JSON.stringify(i)]),e.useFrame((e=>{f&&(null==v||v.raf(e))}),p),n.useEffect((()=>{u&&v&&l.setState({lenis:v,addCallback:C,removeCallback:g})}),[u,v,C,g]);const x=n.useCallback((e=>{for(let r=0;r(null==v||v.on("scroll",x),()=>{null==v||v.off("scroll",x)})),[v,x]);const h=n.useCallback((()=>{m.current&&(m.current.className=t(null==v?void 0:v.className,d))}),[v,d]);return n.useEffect((()=>(h(),null==v||v.on("className change",h),()=>{null==v||v.off("className change",h)})),[v,h]),n.createElement(a.Provider,{value:{lenis:v,addCallback:C,removeCallback:g}},u?o:n.createElement("div",Object.assign({ref:m,className:t(null==v?void 0:v.className,d)},b),n.createElement("div",{ref:y},o)))}));exports.Lenis=c,exports.LenisContext=a,exports.ReactLenis=c,exports.default=c,exports.useLenis=function(e,r=[],t=0){const{lenis:s,addCallback:c,removeCallback:o}=function(){const e=n.useContext(a),r=l();return null!=e?e:r}();return n.useEffect((()=>{if(e&&c&&o&&s)return c(e,t),e(s),()=>{o(e)}}),[s,c,o,t,...r]),s}; //# sourceMappingURL=react-lenis.cjs.js.map diff --git a/packages/react-lenis/dist/react-lenis.mjs b/packages/react-lenis/dist/react-lenis.mjs index 93c694ce..35281a13 100644 --- a/packages/react-lenis/dist/react-lenis.mjs +++ b/packages/react-lenis/dist/react-lenis.mjs @@ -1,2 +1,2 @@ -import{useFrame as r}from"@studio-freight/hamo";import e from"@studio-freight/lenis";import t from"clsx";import n,{createContext as o,useEffect as l,forwardRef as a,useRef as c,useState as s,useCallback as i,useImperativeHandle as u,useContext as f}from"react";import{create as p}from"zustand";"function"==typeof SuppressedError&&SuppressedError;"undefined"!=typeof window&&(window.reactLenisVersion="0.0.46-dev.0");const d=o(),m=p((()=>({})));function b(r,e=[],t=0){const{lenis:n,addCallback:o,removeCallback:a}=function(){const r=f(d),e=m();return null!=r?r:e}();return l((()=>{if(r&&o&&a&&n)return o(r,t),r(n),()=>{a(r)}}),[n,o,a,t,...e]),n}const y=a(((o,a)=>{var{children:f,root:p=!1,options:b={},autoRaf:y=!0,rafPriority:v=0,className:O}=o,g=function(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(null!=r&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(r);o{j.current.push({callback:r,priority:e}),j.current.sort(((r,e)=>r.priority-e.priority))}),[]),E=i((r=>{j.current=j.current.filter((e=>e.callback!==r))}),[]);u(a,(()=>({wrapper:h.current,content:w.current,lenis:k})),[k]),l((()=>{const r=new e(Object.assign(Object.assign({},b),!p&&{wrapper:h.current,content:w.current}));return N(r),()=>{r.destroy(),N(void 0)}}),[p,JSON.stringify(b)]),r((r=>{y&&(null==k||k.raf(r))}),v),l((()=>{p&&k&&m.setState({lenis:k,addCallback:C,removeCallback:E})}),[p,k,C,E]);const P=i((r=>{for(let e=0;e(null==k||k.on("scroll",P),()=>{null==k||k.off("scroll",P)})),[k,P]);const S=i((()=>{h.current&&(h.current.className=t(null==k?void 0:k.className,O))}),[k,O]);return l((()=>(S(),null==k||k.on("className change",S),()=>{null==k||k.off("className change",S)})),[k,S]),n.createElement(d.Provider,{value:{lenis:k,addCallback:C,removeCallback:E}},p?f:n.createElement("div",Object.assign({ref:h,className:t(null==k?void 0:k.className,O)},g),n.createElement("div",{ref:w},f)))}));export{y as Lenis,d as LenisContext,y as ReactLenis,y as default,b as useLenis}; +import{useFrame as r}from"@studio-freight/hamo";import e from"@studio-freight/lenis";import t from"clsx";import n,{createContext as o,useEffect as l,forwardRef as a,useRef as c,useState as s,useCallback as i,useImperativeHandle as u,useContext as f}from"react";import{create as p}from"zustand";"function"==typeof SuppressedError&&SuppressedError;"undefined"!=typeof window&&(window.reactLenisVersion="0.0.46-dev.1");const d=o(),m=p((()=>({})));function b(r,e=[],t=0){const{lenis:n,addCallback:o,removeCallback:a}=function(){const r=f(d),e=m();return null!=r?r:e}();return l((()=>{if(r&&o&&a&&n)return o(r,t),r(n),()=>{a(r)}}),[n,o,a,t,...e]),n}const y=a(((o,a)=>{var{children:f,root:p=!1,options:b={},autoRaf:y=!0,rafPriority:v=0,className:O}=o,g=function(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(null!=r&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(r);o{j.current.push({callback:r,priority:e}),j.current.sort(((r,e)=>r.priority-e.priority))}),[]),E=i((r=>{j.current=j.current.filter((e=>e.callback!==r))}),[]);u(a,(()=>({wrapper:h.current,content:w.current,lenis:k})),[k]),l((()=>{const r=new e(Object.assign(Object.assign({},b),!p&&{wrapper:h.current,content:w.current}));return N(r),()=>{r.destroy(),N(void 0)}}),[p,JSON.stringify(b)]),r((r=>{y&&(null==k||k.raf(r))}),v),l((()=>{p&&k&&m.setState({lenis:k,addCallback:C,removeCallback:E})}),[p,k,C,E]);const P=i((r=>{for(let e=0;e(null==k||k.on("scroll",P),()=>{null==k||k.off("scroll",P)})),[k,P]);const S=i((()=>{h.current&&(h.current.className=t(null==k?void 0:k.className,O))}),[k,O]);return l((()=>(S(),null==k||k.on("className change",S),()=>{null==k||k.off("className change",S)})),[k,S]),n.createElement(d.Provider,{value:{lenis:k,addCallback:C,removeCallback:E}},p?f:n.createElement("div",Object.assign({ref:h,className:t(null==k?void 0:k.className,O)},g),n.createElement("div",{ref:w},f)))}));export{y as Lenis,d as LenisContext,y as ReactLenis,y as default,b as useLenis}; //# sourceMappingURL=react-lenis.mjs.map diff --git a/packages/react-lenis/dist/react-lenis.umd.js b/packages/react-lenis/dist/react-lenis.umd.js index 34afd4a1..16e0aa06 100644 --- a/packages/react-lenis/dist/react-lenis.umd.js +++ b/packages/react-lenis/dist/react-lenis.umd.js @@ -1,2 +1,2 @@ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@studio-freight/hamo"),require("@studio-freight/lenis"),require("clsx"),require("react"),require("zustand")):"function"==typeof define&&define.amd?define(["exports","@studio-freight/hamo","@studio-freight/lenis","clsx","react","zustand"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ReactLenis={},e.hamo,e.Lenis,e.cn,e.React,e.zustand)}(this,(function(e,t,r,n,s,a){"use strict";"function"==typeof SuppressedError&&SuppressedError;"undefined"!=typeof window&&(window.reactLenisVersion="0.0.46-dev.0");const o=s.createContext(),c=a.create((()=>({})));const l=s.forwardRef(((e,a)=>{var{children:l,root:i=!1,options:u={},autoRaf:f=!0,rafPriority:d=0,className:p}=e,b=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(n=Object.getOwnPropertySymbols(e);s{g.current.push({callback:e,priority:t}),g.current.sort(((e,t)=>e.priority-t.priority))}),[]),k=s.useCallback((e=>{g.current=g.current.filter((t=>t.callback!==e))}),[]);s.useImperativeHandle(a,(()=>({wrapper:m.current,content:y.current,lenis:h})),[h]),s.useEffect((()=>{const e=new r(Object.assign(Object.assign({},u),!i&&{wrapper:m.current,content:y.current}));return v(e),()=>{e.destroy(),v(void 0)}}),[i,JSON.stringify(u)]),t.useFrame((e=>{f&&(null==h||h.raf(e))}),d),s.useEffect((()=>{i&&h&&c.setState({lenis:h,addCallback:O,removeCallback:k})}),[i,h,O,k]);const C=s.useCallback((e=>{for(let t=0;t(null==h||h.on("scroll",C),()=>{null==h||h.off("scroll",C)})),[h,C]);const w=s.useCallback((()=>{m.current&&(m.current.className=n(null==h?void 0:h.className,p))}),[h,p]);return s.useEffect((()=>(w(),null==h||h.on("className change",w),()=>{null==h||h.off("className change",w)})),[h,w]),s.createElement(o.Provider,{value:{lenis:h,addCallback:O,removeCallback:k}},i?l:s.createElement("div",Object.assign({ref:m,className:n(null==h?void 0:h.className,p)},b),s.createElement("div",{ref:y},l)))}));e.Lenis=l,e.LenisContext=o,e.ReactLenis=l,e.default=l,e.useLenis=function(e,t=[],r=0){const{lenis:n,addCallback:a,removeCallback:l}=function(){const e=s.useContext(o),t=c();return null!=e?e:t}();return s.useEffect((()=>{if(e&&a&&l&&n)return a(e,r),e(n),()=>{l(e)}}),[n,a,l,r,...t]),n},Object.defineProperty(e,"__esModule",{value:!0})})); +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@studio-freight/hamo"),require("@studio-freight/lenis"),require("clsx"),require("react"),require("zustand")):"function"==typeof define&&define.amd?define(["exports","@studio-freight/hamo","@studio-freight/lenis","clsx","react","zustand"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ReactLenis={},e.hamo,e.Lenis,e.cn,e.React,e.zustand)}(this,(function(e,t,r,n,s,a){"use strict";"function"==typeof SuppressedError&&SuppressedError;"undefined"!=typeof window&&(window.reactLenisVersion="0.0.46-dev.1");const o=s.createContext(),c=a.create((()=>({})));const l=s.forwardRef(((e,a)=>{var{children:l,root:i=!1,options:u={},autoRaf:f=!0,rafPriority:d=0,className:p}=e,b=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(n=Object.getOwnPropertySymbols(e);s{g.current.push({callback:e,priority:t}),g.current.sort(((e,t)=>e.priority-t.priority))}),[]),k=s.useCallback((e=>{g.current=g.current.filter((t=>t.callback!==e))}),[]);s.useImperativeHandle(a,(()=>({wrapper:m.current,content:y.current,lenis:h})),[h]),s.useEffect((()=>{const e=new r(Object.assign(Object.assign({},u),!i&&{wrapper:m.current,content:y.current}));return v(e),()=>{e.destroy(),v(void 0)}}),[i,JSON.stringify(u)]),t.useFrame((e=>{f&&(null==h||h.raf(e))}),d),s.useEffect((()=>{i&&h&&c.setState({lenis:h,addCallback:O,removeCallback:k})}),[i,h,O,k]);const C=s.useCallback((e=>{for(let t=0;t(null==h||h.on("scroll",C),()=>{null==h||h.off("scroll",C)})),[h,C]);const w=s.useCallback((()=>{m.current&&(m.current.className=n(null==h?void 0:h.className,p))}),[h,p]);return s.useEffect((()=>(w(),null==h||h.on("className change",w),()=>{null==h||h.off("className change",w)})),[h,w]),s.createElement(o.Provider,{value:{lenis:h,addCallback:O,removeCallback:k}},i?l:s.createElement("div",Object.assign({ref:m,className:n(null==h?void 0:h.className,p)},b),s.createElement("div",{ref:y},l)))}));e.Lenis=l,e.LenisContext=o,e.ReactLenis=l,e.default=l,e.useLenis=function(e,t=[],r=0){const{lenis:n,addCallback:a,removeCallback:l}=function(){const e=s.useContext(o),t=c();return null!=e?e:t}();return s.useEffect((()=>{if(e&&a&&l&&n)return a(e,r),e(n),()=>{l(e)}}),[n,a,l,r,...t]),n},Object.defineProperty(e,"__esModule",{value:!0})})); //# sourceMappingURL=react-lenis.umd.js.map diff --git a/packages/react-lenis/package.json b/packages/react-lenis/package.json index 97993db8..b25c7feb 100644 --- a/packages/react-lenis/package.json +++ b/packages/react-lenis/package.json @@ -1,6 +1,6 @@ { "name": "@studio-freight/react-lenis", - "version": "0.0.46-dev.0", + "version": "0.0.46-dev.1", "repository": { "type": "git", "url": "git+https://github.com/darkroomengineering/lenis.git"