react-abohook-fullpage 1.1.8 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs.js CHANGED
@@ -1,6 +1,6 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("react");var Y={exports:{}},j={};var X;function oe(){if(X)return j;X=1;var r=Symbol.for("react.transitional.element"),o=Symbol.for("react.fragment");function i(d,a,u){var n=null;if(u!==void 0&&(n=""+u),a.key!==void 0&&(n=""+a.key),"key"in a){u={};for(var m in a)m!=="key"&&(u[m]=a[m])}else u=a;return a=u.ref,{$$typeof:r,type:d,key:n,ref:a!==void 0?a:null,props:u}}return j.Fragment=o,j.jsx=i,j.jsxs=i,j}var F={};var B;function ae(){return B||(B=1,process.env.NODE_ENV!=="production"&&(function(){function r(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===te?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case y:return"Fragment";case p:return"Profiler";case R:return"StrictMode";case N:return"Suspense";case L:return"SuspenseList";case ee:return"Activity"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case A:return"Portal";case P:return e.displayName||"Context";case v:return(e._context.displayName||"Context")+".Consumer";case x:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case E:return t=e.displayName||null,t!==null?t:r(e.type)||"Memo";case I:t=e._payload,e=e._init;try{return r(e(t))}catch{}}return null}function o(e){return""+e}function i(e){try{o(e);var t=!1}catch{t=!0}if(t){t=console;var s=t.error,l=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return s.call(t,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",l),o(e)}}function d(e){if(e===y)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===I)return"<...>";try{var t=r(e);return t?"<"+t+">":"<...>"}catch{return"<...>"}}function a(){var e=$.A;return e===null?null:e.getOwner()}function u(){return Error("react-stack-top-frame")}function n(e){if(z.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return!1}return e.key!==void 0}function m(e,t){function s(){G||(G=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",t))}s.isReactWarning=!0,Object.defineProperty(e,"key",{get:s,configurable:!0})}function b(){var e=r(this.type);return q[e]||(q[e]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),e=this.props.ref,e!==void 0?e:null}function T(e,t,s,l,C,M){var c=s.ref;return e={$$typeof:g,type:e,key:t,props:s,_owner:l},(c!==void 0?c:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:b}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:C}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:M}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function h(e,t,s,l,C,M){var c=t.children;if(c!==void 0)if(l)if(re(c)){for(l=0;l<c.length;l++)w(c[l]);Object.freeze&&Object.freeze(c)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else w(c);if(z.call(t,"key")){c=r(e);var O=Object.keys(t).filter(function(ne){return ne!=="key"});l=0<O.length?"{key: someKey, "+O.join(": ..., ")+": ...}":"{key: someKey}",H[c+l]||(O=0<O.length?"{"+O.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react");var C={exports:{}},O={};var H;function oe(){if(H)return O;H=1;var r=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function u(c,a,l){var o=null;if(l!==void 0&&(o=""+l),a.key!==void 0&&(o=""+a.key),"key"in a){l={};for(var w in a)w!=="key"&&(l[w]=a[w])}else l=a;return a=l.ref,{$$typeof:r,type:c,key:o,ref:a!==void 0?a:null,props:l}}return O.Fragment=n,O.jsx=u,O.jsxs=u,O}var j={};var X;function ae(){return X||(X=1,process.env.NODE_ENV!=="production"&&(function(){function r(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===te?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case T:return"Fragment";case E:return"Profiler";case v:return"StrictMode";case N:return"Suspense";case m:return"SuspenseList";case ee:return"Activity"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case y:return"Portal";case k:return e.displayName||"Context";case P:return(e._context.displayName||"Context")+".Consumer";case F:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case K:return t=e.displayName||null,t!==null?t:r(e.type)||"Memo";case Y:t=e._payload,e=e._init;try{return r(e(t))}catch{}}return null}function n(e){return""+e}function u(e){try{n(e);var t=!1}catch{t=!0}if(t){t=console;var s=t.error,f=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return s.call(t,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",f),n(e)}}function c(e){if(e===T)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===Y)return"<...>";try{var t=r(e);return t?"<"+t+">":"<...>"}catch{return"<...>"}}function a(){var e=I.A;return e===null?null:e.getOwner()}function l(){return Error("react-stack-top-frame")}function o(e){if(W.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return!1}return e.key!==void 0}function w(e,t){function s(){z||(z=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",t))}s.isReactWarning=!0,Object.defineProperty(e,"key",{get:s,configurable:!0})}function h(){var e=r(this.type);return G[e]||(G[e]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),e=this.props.ref,e!==void 0?e:null}function b(e,t,s,f,L,D){var d=s.ref;return e={$$typeof:g,type:e,key:t,props:s,_owner:f},(d!==void 0?d:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:h}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:L}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:D}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function p(e,t,s,f,L,D){var d=t.children;if(d!==void 0)if(f)if(re(d)){for(f=0;f<d.length;f++)x(d[f]);Object.freeze&&Object.freeze(d)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else x(d);if(W.call(t,"key")){d=r(e);var A=Object.keys(t).filter(function(ne){return ne!=="key"});f=0<A.length?"{key: someKey, "+A.join(": ..., ")+": ...}":"{key: someKey}",J[d+f]||(A=0<A.length?"{"+A.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
2
2
  let props = %s;
3
3
  <%s {...props} />
4
4
  React keys must be passed directly to JSX without using spread:
5
5
  let props = %s;
6
- <%s key={someKey} {...props} />`,l,c,O,c),H[c+l]=!0)}if(c=null,s!==void 0&&(i(s),c=""+s),n(t)&&(i(t.key),c=""+t.key),"key"in t){s={};for(var U in t)U!=="key"&&(s[U]=t[U])}else s=t;return c&&m(s,typeof e=="function"?e.displayName||e.name||"Unknown":e),T(e,c,s,a(),C,M)}function w(e){S(e)?e._store&&(e._store.validated=1):typeof e=="object"&&e!==null&&e.$$typeof===I&&(e._payload.status==="fulfilled"?S(e._payload.value)&&e._payload.value._store&&(e._payload.value._store.validated=1):e._store&&(e._store.validated=1))}function S(e){return typeof e=="object"&&e!==null&&e.$$typeof===g}var k=f,g=Symbol.for("react.transitional.element"),A=Symbol.for("react.portal"),y=Symbol.for("react.fragment"),R=Symbol.for("react.strict_mode"),p=Symbol.for("react.profiler"),v=Symbol.for("react.consumer"),P=Symbol.for("react.context"),x=Symbol.for("react.forward_ref"),N=Symbol.for("react.suspense"),L=Symbol.for("react.suspense_list"),E=Symbol.for("react.memo"),I=Symbol.for("react.lazy"),ee=Symbol.for("react.activity"),te=Symbol.for("react.client.reference"),$=k.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,z=Object.prototype.hasOwnProperty,re=Array.isArray,D=console.createTask?console.createTask:function(){return null};k={react_stack_bottom_frame:function(e){return e()}};var G,q={},J=k.react_stack_bottom_frame.bind(k,u)(),V=D(d(u)),H={};F.Fragment=y,F.jsx=function(e,t,s){var l=1e4>$.recentlyCreatedOwnerStacks++;return h(e,t,s,!1,l?Error("react-stack-top-frame"):J,l?D(d(e)):V)},F.jsxs=function(e,t,s){var l=1e4>$.recentlyCreatedOwnerStacks++;return h(e,t,s,!0,l?Error("react-stack-top-frame"):J,l?D(d(e)):V)}})()),F}var Z;function se(){return Z||(Z=1,process.env.NODE_ENV==="production"?Y.exports=oe():Y.exports=ae()),Y.exports}var _=se();const ie=50,ue=(r,o,i,d=700,a,u)=>{const[n,m]=f.useState(0),[b,T]=f.useState(!0),h=f.useRef(!1),[w,S]=f.useState(0),k=o&&n+1===r,g=f.useRef(0),A=f.useRef(0),y=f.useRef(!1),R=f.useRef(null),p=(v,P)=>{if(v<0||v>=r||h.current)return;const x=P===2;h.current=!0,S(n),m(v),k?v===3||n===r-1?m(x?w:v):m(w):m(v),o&&r===v+1?T(!1):T(!0),setTimeout(()=>{h.current=!1},d)};return f.useEffect(()=>{i&&i(n);const v=E=>{if(!u){if(h.current)return E.preventDefault();E.deltaY>0?p(n+1,2):p(n-1,2)}},P=E=>{u||h.current||(E.key==="ArrowDown"&&p(n+1,2),E.key==="ArrowUp"&&p(n-1,2))},x=E=>{u||(g.current=E.touches[0].clientY,y.current=!1)},N=E=>{u||(A.current=E.touches[0].clientY,y.current=!0)},L=()=>{if(u||!y.current)return;const E=g.current-A.current;Math.abs(E)>=ie&&(E>0?p(n+1,2):p(n-1,2))};return window.addEventListener("wheel",v,{passive:!1}),window.addEventListener("keydown",P),window.addEventListener("touchstart",x,{passive:!0}),window.addEventListener("touchmove",N,{passive:!0}),window.addEventListener("touchend",L),()=>{window.removeEventListener("wheel",v),window.removeEventListener("keydown",P),window.removeEventListener("touchstart",x),window.removeEventListener("touchmove",N),window.removeEventListener("touchend",L)}},[n,r,o,i]),f.useEffect(()=>{if(!a)return;const v=P=>{if(h.current&&b)return;const x=P.target;R.current&&!R.current.contains(x)&&!b&&(m(w),T(!0))};return setTimeout(()=>{document.addEventListener("click",v)},300),()=>{document.removeEventListener("click",v)}},[w,b,a]),{active:n,goToSection:p,isHiddenFooter:b,footerRef:R}},le=(r=!1)=>{f.useEffect(()=>{if(r)return;const o=i=>i.preventDefault();return window.addEventListener("contextmenu",o),()=>{window.removeEventListener("contextmenu",o)}},[r])};function ce({children:r,index:o,active:i,isHiddenFooter:d}){return _.jsx("section",{style:{position:"relative",width:"100%",height:"100vh",overflow:"hidden",filter:o===i||d?"blur(0px)":"blur(6px)"},children:r})}const fe=f.memo(ce);function de({sectionsLen:r,active:o,goToSection:i,direction:d="right"}){const a=d==="bottom";return _.jsx("div",{style:{position:"fixed",right:d==="right"?24:d==="bottom"?"50%":void 0,left:d==="left"?24:void 0,top:a?void 0:"50%",bottom:a?"5%":void 0,transform:"translateY(-50%)",display:"flex",flexDirection:a?"row":"column",gap:"16px",zIndex:50},children:Array.from({length:r}).map((u,n)=>_.jsx("button",{disabled:n===o,"aria-label":"navigation dot",onClick:()=>i(n,1),style:{width:"16px",height:"16px",display:"flex",alignItems:"center",justifyContent:"center",padding:0,border:"none",background:"none",cursor:"pointer",userSelect:"none"},children:_.jsx("span",{style:{width:"10px",height:"10px",borderRadius:"50%",backgroundColor:o===n?"white":"rgba(255,255,255,0.4)",transform:o===n?"scale(1.25)":"scale(1)",transition:"all 0.3s ease"}})},n))})}const me=f.memo(de);function ve({children:r}){return _.jsx("div",{style:{position:"relative",width:"100%",height:"100vh",overflow:"hidden",background:"transparent"},children:r})}const Q=f.memo(ve);Q.__FULLPAGE_SECTION__=!0;function Ee({children:r,styles:o,height:i="30%",backgroundColor:d="yellow",footerRef:a}){return _.jsx("div",{ref:a,style:{position:"absolute",width:"100%",height:i,backgroundColor:d,bottom:0,zIndex:50,...o},children:r},"fullpage-footer")}const K=f.memo(Ee);K.__FULLPAGE_FOOTER__=!0;function _e({children:r,isHiddenFooter:o}){const i=o?2500:600;return _.jsx("div",{style:{position:"absolute",left:0,bottom:0,width:"100%",height:"100vh",zIndex:50,transform:o?"translateY(100%)":"translateY(0)",transition:`transform ${i}ms cubic-bezier(0.22,1,0.36,1)`,willChange:"transform",pointerEvents:o?"none":"auto"},children:r})}const he=f.memo(_e);function W({children:r,onChange:o,directionDots:i="right",enableContextMenu:d=!0,duration:a=700,closeOutside:u=!1,disable:n=!1}){const m=f.Children.toArray(r),b=m.filter(R=>!R.type.__FULLPAGE_FOOTER__),T=m.find(R=>R.type.__FULLPAGE_FOOTER__);le(d);const h=!!T,w=b.length+(h?1:0),{active:S,goToSection:k,isHiddenFooter:g,footerRef:A}=ue(w,h,o,a,u,n),y=T?f.cloneElement(T,{footerRef:A}):null;return _.jsxs(_.Fragment,{children:[_.jsxs("div",{style:{position:"relative",height:"100vh",width:"100%",overflow:"hidden"},children:[_.jsx("div",{style:{height:`${b.length*100}vh`,transform:g?`translateY(-${S*100}vh)`:`translateY(-${b.length-100}vh)`,transition:"transform 700ms cubic-bezier(0.22,1,0.36,1)"},children:b.map((R,p)=>_.jsx(fe,{index:p,active:S,isHiddenFooter:g,children:R},p))}),T&&_.jsx(he,{isHiddenFooter:g,children:y})]}),_.jsx(me,{sectionsLen:w,active:S,goToSection:k,direction:i})]})}W.Section=Q;W.Footer=K;exports.FullPage=W;
6
+ <%s key={someKey} {...props} />`,f,d,A,d),J[d+f]=!0)}if(d=null,s!==void 0&&(u(s),d=""+s),o(t)&&(u(t.key),d=""+t.key),"key"in t){s={};for(var M in t)M!=="key"&&(s[M]=t[M])}else s=t;return d&&w(s,typeof e=="function"?e.displayName||e.name||"Unknown":e),b(e,d,s,a(),L,D)}function x(e){S(e)?e._store&&(e._store.validated=1):typeof e=="object"&&e!==null&&e.$$typeof===Y&&(e._payload.status==="fulfilled"?S(e._payload.value)&&e._payload.value._store&&(e._payload.value._store.validated=1):e._store&&(e._store.validated=1))}function S(e){return typeof e=="object"&&e!==null&&e.$$typeof===g}var R=i,g=Symbol.for("react.transitional.element"),y=Symbol.for("react.portal"),T=Symbol.for("react.fragment"),v=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),P=Symbol.for("react.consumer"),k=Symbol.for("react.context"),F=Symbol.for("react.forward_ref"),N=Symbol.for("react.suspense"),m=Symbol.for("react.suspense_list"),K=Symbol.for("react.memo"),Y=Symbol.for("react.lazy"),ee=Symbol.for("react.activity"),te=Symbol.for("react.client.reference"),I=R.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,W=Object.prototype.hasOwnProperty,re=Array.isArray,$=console.createTask?console.createTask:function(){return null};R={react_stack_bottom_frame:function(e){return e()}};var z,G={},V=R.react_stack_bottom_frame.bind(R,l)(),q=$(c(l)),J={};j.Fragment=T,j.jsx=function(e,t,s){var f=1e4>I.recentlyCreatedOwnerStacks++;return p(e,t,s,!1,f?Error("react-stack-top-frame"):V,f?$(c(e)):q)},j.jsxs=function(e,t,s){var f=1e4>I.recentlyCreatedOwnerStacks++;return p(e,t,s,!0,f?Error("react-stack-top-frame"):V,f?$(c(e)):q)}})()),j}var B;function se(){return B||(B=1,process.env.NODE_ENV==="production"?C.exports=oe():C.exports=ae()),C.exports}var _=se();const ie=50,ue=(r,n,u,c=700,a,l)=>{const[o,w]=i.useState(0),[h,b]=i.useState(!0),p=i.useRef(!1),[x,S]=i.useState(0),R=i.useRef(0),g=i.useRef(0),y=i.useRef(!1),T=i.useRef(null),v=(E,P)=>{E<0||E>=r||p.current||(p.current=!0,S(o),w(E),n&&E===r-1?b(!1):b(!0),setTimeout(()=>{p.current=!1},c))};return i.useEffect(()=>{u?.(o);const E=m=>{if(!l){if(p.current){m.preventDefault();return}Math.abs(m.deltaY)<2||(m.preventDefault(),m.deltaY>0?v(o+1):v(o-1))}},P=m=>{l||p.current||(m.key==="ArrowDown"&&v(o+1),m.key==="ArrowUp"&&v(o-1))},k=m=>{l||(R.current=m.touches[0].clientY,y.current=!1)},F=m=>{l||(g.current=m.touches[0].clientY,y.current=!0)},N=()=>{if(l||!y.current||p.current)return;const m=R.current-g.current;Math.abs(m)>=ie&&(m>0?v(o+1):v(o-1))};return window.addEventListener("wheel",E,{passive:!1}),window.addEventListener("keydown",P),window.addEventListener("touchstart",k,{passive:!0}),window.addEventListener("touchmove",F,{passive:!0}),window.addEventListener("touchend",N),()=>{window.removeEventListener("wheel",E),window.removeEventListener("keydown",P),window.removeEventListener("touchstart",k),window.removeEventListener("touchmove",F),window.removeEventListener("touchend",N)}},[o,r,n,u,l,c]),i.useEffect(()=>{if(!a)return;const E=P=>{if(p.current&&h)return;const k=P.target;T.current&&!T.current.contains(k)&&!h&&(w(x),b(!0))};return setTimeout(()=>{document.addEventListener("click",E)},300),()=>{document.removeEventListener("click",E)}},[x,h,a]),{active:o,goToSection:v,isHiddenFooter:h,footerRef:T}},le=(r=!1)=>{i.useEffect(()=>{if(r)return;const n=u=>u.preventDefault();return window.addEventListener("contextmenu",n),()=>{window.removeEventListener("contextmenu",n)}},[r])};function ce({children:r,index:n,active:u,isHiddenFooter:c}){return _.jsx("section",{style:{position:"relative",width:"100%",height:"100vh",overflow:"hidden",filter:n===u||c?"blur(0px)":"blur(6px)"},children:r})}const fe=i.memo(ce);function de({sectionsLen:r,active:n,goToSection:u,direction:c="right"}){const a=c==="bottom";return _.jsx("div",{style:{position:"fixed",right:c==="right"?24:c==="bottom"?"50%":void 0,left:c==="left"?24:void 0,top:a?void 0:"50%",bottom:a?"5%":void 0,transform:"translateY(-50%)",display:"flex",flexDirection:a?"row":"column",gap:"16px",zIndex:50},children:Array.from({length:r}).map((l,o)=>_.jsx("button",{disabled:o===n,"aria-label":"navigation dot",onClick:()=>u(o,1),style:{width:"16px",height:"16px",display:"flex",alignItems:"center",justifyContent:"center",padding:0,border:"none",background:"none",cursor:"pointer",userSelect:"none"},children:_.jsx("span",{style:{width:"10px",height:"10px",borderRadius:"50%",backgroundColor:n===o?"white":"rgba(255,255,255,0.4)",transform:n===o?"scale(1.25)":"scale(1)",transition:"all 0.3s ease"}})},o))})}const me=i.memo(de);function ve({children:r}){return _.jsx("div",{style:{position:"relative",width:"100%",height:"100vh",overflow:"hidden",background:"transparent"},children:r})}const Z=i.memo(ve);Z.__FULLPAGE_SECTION__=!0;function Ee({children:r,styles:n,height:u="30%",backgroundColor:c="yellow",footerRef:a}){return _.jsx("div",{ref:a,style:{position:"absolute",width:"100%",height:u,backgroundColor:c,bottom:0,zIndex:50,...n},children:r},"fullpage-footer")}const Q=i.memo(Ee);Q.__FULLPAGE_FOOTER__=!0;function _e(r){process.env.NODE_ENV!=="production"&&r.forEach(n=>{if(i.isValidElement(n)&&!n.type.__FULLPAGE_SECTION__)throw console.warn("[FullPage] You must wrap content inside <FullPage.Section />"),new Error("[FullPage] You must wrap content inside <FullPage.Section />")})}function he({children:r,isHiddenFooter:n}){const u=n?2500:600;return _.jsx("div",{style:{position:"absolute",left:0,bottom:0,width:"100%",height:"100vh",zIndex:50,transform:n?"translateY(100%)":"translateY(0)",transition:`transform ${u}ms cubic-bezier(0.22,1,0.36,1)`,willChange:"transform",pointerEvents:n?"none":"auto"},children:r})}const pe=i.memo(he);function U({children:r,onChange:n,directionDots:u="right",enableContextMenu:c=!0,duration:a=700,closeOutside:l=!1,disable:o=!1}){const w=i.Children.toArray(r),h=w.filter(v=>v.type.__FULLPAGE_SECTION__),b=w.find(v=>v.type.__FULLPAGE_FOOTER__);le(c),i.useEffect(()=>(_e(h),()=>{}),[h]);const p=!!b,x=h.length+(p?1:0),{active:S,goToSection:R,isHiddenFooter:g,footerRef:y}=ue(x,p,n,a,l,o),T=b?i.cloneElement(b,{footerRef:y}):null;return _.jsxs(_.Fragment,{children:[_.jsxs("div",{style:{position:"relative",height:"100vh",width:"100%",overflow:"hidden"},children:[_.jsx("div",{style:{height:`${h.length*100}vh`,transform:g?`translateY(-${S*100}vh)`:`translateY(-${(h.length-1)*100}vh)`,transition:`transform ${a}ms cubic-bezier(0.22,1,0.36,1)`},children:h.map((v,E)=>_.jsx(fe,{index:E,active:S,isHiddenFooter:g,children:v},E))}),b&&_.jsx(pe,{isHiddenFooter:g,children:T})]}),_.jsx(me,{sectionsLen:x,active:S,goToSection:R,direction:u})]})}U.Section=Z;U.Footer=Q;exports.FullPage=U;
package/dist/index.es.js CHANGED
@@ -1,46 +1,46 @@
1
- import G, { useEffect as J, useState as z, useRef as O, memo as F } from "react";
2
- var I = { exports: {} }, j = {};
3
- var Q;
1
+ import I, { useEffect as $, useState as G, useRef as A, memo as N } from "react";
2
+ var Y = { exports: {} }, O = {};
3
+ var Z;
4
4
  function le() {
5
- if (Q) return j;
6
- Q = 1;
7
- var r = /* @__PURE__ */ Symbol.for("react.transitional.element"), o = /* @__PURE__ */ Symbol.for("react.fragment");
8
- function i(f, a, l) {
9
- var n = null;
10
- if (l !== void 0 && (n = "" + l), a.key !== void 0 && (n = "" + a.key), "key" in a) {
5
+ if (Z) return O;
6
+ Z = 1;
7
+ var r = /* @__PURE__ */ Symbol.for("react.transitional.element"), n = /* @__PURE__ */ Symbol.for("react.fragment");
8
+ function i(u, a, l) {
9
+ var o = null;
10
+ if (l !== void 0 && (o = "" + l), a.key !== void 0 && (o = "" + a.key), "key" in a) {
11
11
  l = {};
12
- for (var d in a)
13
- d !== "key" && (l[d] = a[d]);
12
+ for (var p in a)
13
+ p !== "key" && (l[p] = a[p]);
14
14
  } else l = a;
15
15
  return a = l.ref, {
16
16
  $$typeof: r,
17
- type: f,
18
- key: n,
17
+ type: u,
18
+ key: o,
19
19
  ref: a !== void 0 ? a : null,
20
20
  props: l
21
21
  };
22
22
  }
23
- return j.Fragment = o, j.jsx = i, j.jsxs = i, j;
23
+ return O.Fragment = n, O.jsx = i, O.jsxs = i, O;
24
24
  }
25
- var N = {};
26
- var K;
25
+ var j = {};
26
+ var Q;
27
27
  function ue() {
28
- return K || (K = 1, process.env.NODE_ENV !== "production" && (function() {
28
+ return Q || (Q = 1, process.env.NODE_ENV !== "production" && (function() {
29
29
  function r(e) {
30
30
  if (e == null) return null;
31
31
  if (typeof e == "function")
32
32
  return e.$$typeof === ae ? null : e.displayName || e.name || null;
33
33
  if (typeof e == "string") return e;
34
34
  switch (e) {
35
- case g:
35
+ case R:
36
36
  return "Fragment";
37
- case h:
37
+ case m:
38
38
  return "Profiler";
39
- case w:
39
+ case v:
40
40
  return "StrictMode";
41
41
  case L:
42
42
  return "Suspense";
43
- case C:
43
+ case d:
44
44
  return "SuspenseList";
45
45
  case oe:
46
46
  return "Activity";
@@ -49,18 +49,18 @@ function ue() {
49
49
  switch (typeof e.tag == "number" && console.error(
50
50
  "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
51
51
  ), e.$$typeof) {
52
- case A:
52
+ case y:
53
53
  return "Portal";
54
- case S:
54
+ case k:
55
55
  return e.displayName || "Context";
56
- case v:
56
+ case S:
57
57
  return (e._context.displayName || "Context") + ".Consumer";
58
- case x:
58
+ case F:
59
59
  var t = e.render;
60
60
  return e = e.displayName, e || (e = t.displayName || t.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
61
- case m:
61
+ case ne:
62
62
  return t = e.displayName || null, t !== null ? t : r(e.type) || "Memo";
63
- case $:
63
+ case D:
64
64
  t = e._payload, e = e._init;
65
65
  try {
66
66
  return r(e(t));
@@ -69,29 +69,29 @@ function ue() {
69
69
  }
70
70
  return null;
71
71
  }
72
- function o(e) {
72
+ function n(e) {
73
73
  return "" + e;
74
74
  }
75
75
  function i(e) {
76
76
  try {
77
- o(e);
77
+ n(e);
78
78
  var t = !1;
79
79
  } catch {
80
80
  t = !0;
81
81
  }
82
82
  if (t) {
83
83
  t = console;
84
- var s = t.error, u = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
84
+ var s = t.error, c = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
85
85
  return s.call(
86
86
  t,
87
87
  "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
88
- u
89
- ), o(e);
88
+ c
89
+ ), n(e);
90
90
  }
91
91
  }
92
- function f(e) {
93
- if (e === g) return "<>";
94
- if (typeof e == "object" && e !== null && e.$$typeof === $)
92
+ function u(e) {
93
+ if (e === R) return "<>";
94
+ if (typeof e == "object" && e !== null && e.$$typeof === D)
95
95
  return "<...>";
96
96
  try {
97
97
  var t = r(e);
@@ -101,22 +101,22 @@ function ue() {
101
101
  }
102
102
  }
103
103
  function a() {
104
- var e = D.A;
104
+ var e = M.A;
105
105
  return e === null ? null : e.getOwner();
106
106
  }
107
107
  function l() {
108
108
  return Error("react-stack-top-frame");
109
109
  }
110
- function n(e) {
110
+ function o(e) {
111
111
  if (V.call(e, "key")) {
112
112
  var t = Object.getOwnPropertyDescriptor(e, "key").get;
113
113
  if (t && t.isReactWarning) return !1;
114
114
  }
115
115
  return e.key !== void 0;
116
116
  }
117
- function d(e, t) {
117
+ function p(e, t) {
118
118
  function s() {
119
- q || (q = !0, console.error(
119
+ J || (J = !0, console.error(
120
120
  "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
121
121
  t
122
122
  ));
@@ -126,23 +126,23 @@ function ue() {
126
126
  configurable: !0
127
127
  });
128
128
  }
129
- function p() {
129
+ function _() {
130
130
  var e = r(this.type);
131
- return H[e] || (H[e] = !0, console.error(
131
+ return q[e] || (q[e] = !0, console.error(
132
132
  "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
133
133
  )), e = this.props.ref, e !== void 0 ? e : null;
134
134
  }
135
- function R(e, t, s, u, Y, U) {
136
- var c = s.ref;
135
+ function w(e, t, s, c, C, W) {
136
+ var f = s.ref;
137
137
  return e = {
138
- $$typeof: T,
138
+ $$typeof: g,
139
139
  type: e,
140
140
  key: t,
141
141
  props: s,
142
- _owner: u
143
- }, (c !== void 0 ? c : null) !== null ? Object.defineProperty(e, "ref", {
142
+ _owner: c
143
+ }, (f !== void 0 ? f : null) !== null ? Object.defineProperty(e, "ref", {
144
144
  enumerable: !1,
145
- get: p
145
+ get: _
146
146
  }) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
147
147
  configurable: !1,
148
148
  enumerable: !1,
@@ -157,164 +157,165 @@ function ue() {
157
157
  configurable: !1,
158
158
  enumerable: !1,
159
159
  writable: !0,
160
- value: Y
160
+ value: C
161
161
  }), Object.defineProperty(e, "_debugTask", {
162
162
  configurable: !1,
163
163
  enumerable: !1,
164
164
  writable: !0,
165
- value: U
165
+ value: W
166
166
  }), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
167
167
  }
168
- function _(e, t, s, u, Y, U) {
169
- var c = t.children;
170
- if (c !== void 0)
171
- if (u)
172
- if (se(c)) {
173
- for (u = 0; u < c.length; u++)
174
- b(c[u]);
175
- Object.freeze && Object.freeze(c);
168
+ function h(e, t, s, c, C, W) {
169
+ var f = t.children;
170
+ if (f !== void 0)
171
+ if (c)
172
+ if (se(f)) {
173
+ for (c = 0; c < f.length; c++)
174
+ T(f[c]);
175
+ Object.freeze && Object.freeze(f);
176
176
  } else
177
177
  console.error(
178
178
  "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
179
179
  );
180
- else b(c);
180
+ else T(f);
181
181
  if (V.call(t, "key")) {
182
- c = r(e);
182
+ f = r(e);
183
183
  var P = Object.keys(t).filter(function(ie) {
184
184
  return ie !== "key";
185
185
  });
186
- u = 0 < P.length ? "{key: someKey, " + P.join(": ..., ") + ": ...}" : "{key: someKey}", Z[c + u] || (P = 0 < P.length ? "{" + P.join(": ..., ") + ": ...}" : "{}", console.error(
186
+ c = 0 < P.length ? "{key: someKey, " + P.join(": ..., ") + ": ...}" : "{key: someKey}", B[f + c] || (P = 0 < P.length ? "{" + P.join(": ..., ") + ": ...}" : "{}", console.error(
187
187
  `A props object containing a "key" prop is being spread into JSX:
188
188
  let props = %s;
189
189
  <%s {...props} />
190
190
  React keys must be passed directly to JSX without using spread:
191
191
  let props = %s;
192
192
  <%s key={someKey} {...props} />`,
193
- u,
194
193
  c,
194
+ f,
195
195
  P,
196
- c
197
- ), Z[c + u] = !0);
196
+ f
197
+ ), B[f + c] = !0);
198
198
  }
199
- if (c = null, s !== void 0 && (i(s), c = "" + s), n(t) && (i(t.key), c = "" + t.key), "key" in t) {
199
+ if (f = null, s !== void 0 && (i(s), f = "" + s), o(t) && (i(t.key), f = "" + t.key), "key" in t) {
200
200
  s = {};
201
- for (var W in t)
202
- W !== "key" && (s[W] = t[W]);
201
+ for (var z in t)
202
+ z !== "key" && (s[z] = t[z]);
203
203
  } else s = t;
204
- return c && d(
204
+ return f && p(
205
205
  s,
206
206
  typeof e == "function" ? e.displayName || e.name || "Unknown" : e
207
- ), R(
207
+ ), w(
208
208
  e,
209
- c,
209
+ f,
210
210
  s,
211
211
  a(),
212
- Y,
213
- U
212
+ C,
213
+ W
214
214
  );
215
215
  }
216
- function b(e) {
217
- y(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e !== null && e.$$typeof === $ && (e._payload.status === "fulfilled" ? y(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
216
+ function T(e) {
217
+ x(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e !== null && e.$$typeof === D && (e._payload.status === "fulfilled" ? x(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
218
218
  }
219
- function y(e) {
220
- return typeof e == "object" && e !== null && e.$$typeof === T;
219
+ function x(e) {
220
+ return typeof e == "object" && e !== null && e.$$typeof === g;
221
221
  }
222
- var k = G, T = /* @__PURE__ */ Symbol.for("react.transitional.element"), A = /* @__PURE__ */ Symbol.for("react.portal"), g = /* @__PURE__ */ Symbol.for("react.fragment"), w = /* @__PURE__ */ Symbol.for("react.strict_mode"), h = /* @__PURE__ */ Symbol.for("react.profiler"), v = /* @__PURE__ */ Symbol.for("react.consumer"), S = /* @__PURE__ */ Symbol.for("react.context"), x = /* @__PURE__ */ Symbol.for("react.forward_ref"), L = /* @__PURE__ */ Symbol.for("react.suspense"), C = /* @__PURE__ */ Symbol.for("react.suspense_list"), m = /* @__PURE__ */ Symbol.for("react.memo"), $ = /* @__PURE__ */ Symbol.for("react.lazy"), oe = /* @__PURE__ */ Symbol.for("react.activity"), ae = /* @__PURE__ */ Symbol.for("react.client.reference"), D = k.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, V = Object.prototype.hasOwnProperty, se = Array.isArray, M = console.createTask ? console.createTask : function() {
222
+ var b = I, g = /* @__PURE__ */ Symbol.for("react.transitional.element"), y = /* @__PURE__ */ Symbol.for("react.portal"), R = /* @__PURE__ */ Symbol.for("react.fragment"), v = /* @__PURE__ */ Symbol.for("react.strict_mode"), m = /* @__PURE__ */ Symbol.for("react.profiler"), S = /* @__PURE__ */ Symbol.for("react.consumer"), k = /* @__PURE__ */ Symbol.for("react.context"), F = /* @__PURE__ */ Symbol.for("react.forward_ref"), L = /* @__PURE__ */ Symbol.for("react.suspense"), d = /* @__PURE__ */ Symbol.for("react.suspense_list"), ne = /* @__PURE__ */ Symbol.for("react.memo"), D = /* @__PURE__ */ Symbol.for("react.lazy"), oe = /* @__PURE__ */ Symbol.for("react.activity"), ae = /* @__PURE__ */ Symbol.for("react.client.reference"), M = b.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, V = Object.prototype.hasOwnProperty, se = Array.isArray, U = console.createTask ? console.createTask : function() {
223
223
  return null;
224
224
  };
225
- k = {
225
+ b = {
226
226
  react_stack_bottom_frame: function(e) {
227
227
  return e();
228
228
  }
229
229
  };
230
- var q, H = {}, X = k.react_stack_bottom_frame.bind(
231
- k,
230
+ var J, q = {}, H = b.react_stack_bottom_frame.bind(
231
+ b,
232
232
  l
233
- )(), B = M(f(l)), Z = {};
234
- N.Fragment = g, N.jsx = function(e, t, s) {
235
- var u = 1e4 > D.recentlyCreatedOwnerStacks++;
236
- return _(
233
+ )(), X = U(u(l)), B = {};
234
+ j.Fragment = R, j.jsx = function(e, t, s) {
235
+ var c = 1e4 > M.recentlyCreatedOwnerStacks++;
236
+ return h(
237
237
  e,
238
238
  t,
239
239
  s,
240
240
  !1,
241
- u ? Error("react-stack-top-frame") : X,
242
- u ? M(f(e)) : B
241
+ c ? Error("react-stack-top-frame") : H,
242
+ c ? U(u(e)) : X
243
243
  );
244
- }, N.jsxs = function(e, t, s) {
245
- var u = 1e4 > D.recentlyCreatedOwnerStacks++;
246
- return _(
244
+ }, j.jsxs = function(e, t, s) {
245
+ var c = 1e4 > M.recentlyCreatedOwnerStacks++;
246
+ return h(
247
247
  e,
248
248
  t,
249
249
  s,
250
250
  !0,
251
- u ? Error("react-stack-top-frame") : X,
252
- u ? M(f(e)) : B
251
+ c ? Error("react-stack-top-frame") : H,
252
+ c ? U(u(e)) : X
253
253
  );
254
254
  };
255
- })()), N;
255
+ })()), j;
256
256
  }
257
- var ee;
257
+ var K;
258
258
  function ce() {
259
- return ee || (ee = 1, process.env.NODE_ENV === "production" ? I.exports = le() : I.exports = ue()), I.exports;
259
+ return K || (K = 1, process.env.NODE_ENV === "production" ? Y.exports = le() : Y.exports = ue()), Y.exports;
260
260
  }
261
261
  var E = ce();
262
- const fe = 50, de = (r, o, i, f = 700, a, l) => {
263
- const [n, d] = z(0), [p, R] = z(!0), _ = O(!1), [b, y] = z(0), k = o && n + 1 === r, T = O(0), A = O(0), g = O(!1), w = O(null), h = (v, S) => {
264
- if (v < 0 || v >= r || _.current) return;
265
- const x = S === 2;
266
- _.current = !0, y(n), d(v), k ? v === 3 || n === r - 1 ? d(x ? b : v) : d(b) : d(v), o && r === v + 1 ? R(!1) : R(!0), setTimeout(() => {
267
- _.current = !1;
268
- }, f);
262
+ const fe = 50, de = (r, n, i, u = 700, a, l) => {
263
+ const [o, p] = G(0), [_, w] = G(!0), h = A(!1), [T, x] = G(0), b = A(0), g = A(0), y = A(!1), R = A(null), v = (m, S) => {
264
+ m < 0 || m >= r || h.current || (h.current = !0, x(o), p(m), n && m === r - 1 ? w(!1) : w(!0), setTimeout(() => {
265
+ h.current = !1;
266
+ }, u));
269
267
  };
270
- return J(() => {
271
- i && i(n);
272
- const v = (m) => {
268
+ return $(() => {
269
+ i?.(o);
270
+ const m = (d) => {
273
271
  if (!l) {
274
- if (_.current) return m.preventDefault();
275
- m.deltaY > 0 ? h(n + 1, 2) : h(n - 1, 2);
272
+ if (h.current) {
273
+ d.preventDefault();
274
+ return;
275
+ }
276
+ Math.abs(d.deltaY) < 2 || (d.preventDefault(), d.deltaY > 0 ? v(o + 1) : v(o - 1));
276
277
  }
277
- }, S = (m) => {
278
- l || _.current || (m.key === "ArrowDown" && h(n + 1, 2), m.key === "ArrowUp" && h(n - 1, 2));
279
- }, x = (m) => {
280
- l || (T.current = m.touches[0].clientY, g.current = !1);
281
- }, L = (m) => {
282
- l || (A.current = m.touches[0].clientY, g.current = !0);
283
- }, C = () => {
284
- if (l || !g.current) return;
285
- const m = T.current - A.current;
286
- Math.abs(m) >= fe && (m > 0 ? h(n + 1, 2) : h(n - 1, 2));
278
+ }, S = (d) => {
279
+ l || h.current || (d.key === "ArrowDown" && v(o + 1), d.key === "ArrowUp" && v(o - 1));
280
+ }, k = (d) => {
281
+ l || (b.current = d.touches[0].clientY, y.current = !1);
282
+ }, F = (d) => {
283
+ l || (g.current = d.touches[0].clientY, y.current = !0);
284
+ }, L = () => {
285
+ if (l || !y.current || h.current) return;
286
+ const d = b.current - g.current;
287
+ Math.abs(d) >= fe && (d > 0 ? v(o + 1) : v(o - 1));
287
288
  };
288
- return window.addEventListener("wheel", v, { passive: !1 }), window.addEventListener("keydown", S), window.addEventListener("touchstart", x, { passive: !0 }), window.addEventListener("touchmove", L, { passive: !0 }), window.addEventListener("touchend", C), () => {
289
- window.removeEventListener("wheel", v), window.removeEventListener("keydown", S), window.removeEventListener("touchstart", x), window.removeEventListener("touchmove", L), window.removeEventListener("touchend", C);
289
+ return window.addEventListener("wheel", m, { passive: !1 }), window.addEventListener("keydown", S), window.addEventListener("touchstart", k, { passive: !0 }), window.addEventListener("touchmove", F, { passive: !0 }), window.addEventListener("touchend", L), () => {
290
+ window.removeEventListener("wheel", m), window.removeEventListener("keydown", S), window.removeEventListener("touchstart", k), window.removeEventListener("touchmove", F), window.removeEventListener("touchend", L);
290
291
  };
291
- }, [n, r, o, i]), J(() => {
292
+ }, [o, r, n, i, l, u]), $(() => {
292
293
  if (!a) return;
293
- const v = (S) => {
294
- if (_.current && p) return;
295
- const x = S.target;
296
- w.current && !w.current.contains(x) && !p && (d(b), R(!0));
294
+ const m = (S) => {
295
+ if (h.current && _) return;
296
+ const k = S.target;
297
+ R.current && !R.current.contains(k) && !_ && (p(T), w(!0));
297
298
  };
298
299
  return setTimeout(() => {
299
- document.addEventListener("click", v);
300
+ document.addEventListener("click", m);
300
301
  }, 300), () => {
301
- document.removeEventListener("click", v);
302
+ document.removeEventListener("click", m);
302
303
  };
303
- }, [b, p, a]), { active: n, goToSection: h, isHiddenFooter: p, footerRef: w };
304
+ }, [T, _, a]), { active: o, goToSection: v, isHiddenFooter: _, footerRef: R };
304
305
  }, ve = (r = !1) => {
305
- J(() => {
306
+ $(() => {
306
307
  if (r) return;
307
- const o = (i) => i.preventDefault();
308
- return window.addEventListener("contextmenu", o), () => {
309
- window.removeEventListener("contextmenu", o);
308
+ const n = (i) => i.preventDefault();
309
+ return window.addEventListener("contextmenu", n), () => {
310
+ window.removeEventListener("contextmenu", n);
310
311
  };
311
312
  }, [r]);
312
313
  };
313
314
  function me({
314
315
  children: r,
315
- index: o,
316
+ index: n,
316
317
  active: i,
317
- isHiddenFooter: f
318
+ isHiddenFooter: u
318
319
  }) {
319
320
  return /* @__PURE__ */ E.jsx(
320
321
  "section",
@@ -324,27 +325,27 @@ function me({
324
325
  width: "100%",
325
326
  height: "100vh",
326
327
  overflow: "hidden",
327
- filter: o === i || f ? "blur(0px)" : "blur(6px)"
328
+ filter: n === i || u ? "blur(0px)" : "blur(6px)"
328
329
  },
329
330
  children: r
330
331
  }
331
332
  );
332
333
  }
333
- const Ee = F(me);
334
+ const Ee = N(me);
334
335
  function _e({
335
336
  sectionsLen: r,
336
- active: o,
337
+ active: n,
337
338
  goToSection: i,
338
- direction: f = "right"
339
+ direction: u = "right"
339
340
  }) {
340
- const a = f === "bottom";
341
+ const a = u === "bottom";
341
342
  return /* @__PURE__ */ E.jsx(
342
343
  "div",
343
344
  {
344
345
  style: {
345
346
  position: "fixed",
346
- right: f === "right" ? 24 : f === "bottom" ? "50%" : void 0,
347
- left: f === "left" ? 24 : void 0,
347
+ right: u === "right" ? 24 : u === "bottom" ? "50%" : void 0,
348
+ left: u === "left" ? 24 : void 0,
348
349
  top: a ? void 0 : "50%",
349
350
  bottom: a ? "5%" : void 0,
350
351
  transform: "translateY(-50%)",
@@ -353,12 +354,12 @@ function _e({
353
354
  gap: "16px",
354
355
  zIndex: 50
355
356
  },
356
- children: Array.from({ length: r }).map((l, n) => /* @__PURE__ */ E.jsx(
357
+ children: Array.from({ length: r }).map((l, o) => /* @__PURE__ */ E.jsx(
357
358
  "button",
358
359
  {
359
- disabled: n === o,
360
+ disabled: o === n,
360
361
  "aria-label": "navigation dot",
361
- onClick: () => i(n, 1),
362
+ onClick: () => i(o, 1),
362
363
  style: {
363
364
  width: "16px",
364
365
  height: "16px",
@@ -378,19 +379,19 @@ function _e({
378
379
  width: "10px",
379
380
  height: "10px",
380
381
  borderRadius: "50%",
381
- backgroundColor: o === n ? "white" : "rgba(255,255,255,0.4)",
382
- transform: o === n ? "scale(1.25)" : "scale(1)",
382
+ backgroundColor: n === o ? "white" : "rgba(255,255,255,0.4)",
383
+ transform: n === o ? "scale(1.25)" : "scale(1)",
383
384
  transition: "all 0.3s ease"
384
385
  }
385
386
  }
386
387
  )
387
388
  },
388
- n
389
+ o
389
390
  ))
390
391
  }
391
392
  );
392
393
  }
393
- const he = F(_e);
394
+ const he = N(_e);
394
395
  function pe({ children: r }) {
395
396
  return /* @__PURE__ */ E.jsx(
396
397
  "div",
@@ -406,13 +407,13 @@ function pe({ children: r }) {
406
407
  }
407
408
  );
408
409
  }
409
- const te = F(pe);
410
- te.__FULLPAGE_SECTION__ = !0;
411
- function be({
410
+ const ee = N(pe);
411
+ ee.__FULLPAGE_SECTION__ = !0;
412
+ function we({
412
413
  children: r,
413
- styles: o,
414
+ styles: n,
414
415
  height: i = "30%",
415
- backgroundColor: f = "yellow",
416
+ backgroundColor: u = "yellow",
416
417
  footerRef: a
417
418
  }) {
418
419
  return /* @__PURE__ */ E.jsx(
@@ -423,20 +424,30 @@ function be({
423
424
  position: "absolute",
424
425
  width: "100%",
425
426
  height: i,
426
- backgroundColor: f,
427
+ backgroundColor: u,
427
428
  bottom: 0,
428
429
  zIndex: 50,
429
- ...o
430
+ ...n
430
431
  },
431
432
  children: r
432
433
  },
433
434
  "fullpage-footer"
434
435
  );
435
436
  }
436
- const re = F(be);
437
- re.__FULLPAGE_FOOTER__ = !0;
438
- function we({ children: r, isHiddenFooter: o }) {
439
- const i = o ? 2500 : 600;
437
+ const te = N(we);
438
+ te.__FULLPAGE_FOOTER__ = !0;
439
+ function be(r) {
440
+ process.env.NODE_ENV !== "production" && r.forEach((n) => {
441
+ if (I.isValidElement(n) && !n.type.__FULLPAGE_SECTION__)
442
+ throw console.warn(
443
+ "[FullPage] You must wrap content inside <FullPage.Section />"
444
+ ), new Error(
445
+ "[FullPage] You must wrap content inside <FullPage.Section />"
446
+ );
447
+ });
448
+ }
449
+ function ge({ children: r, isHiddenFooter: n }) {
450
+ const i = n ? 2500 : 600;
440
451
  return /* @__PURE__ */ E.jsx(
441
452
  "div",
442
453
  {
@@ -447,39 +458,40 @@ function we({ children: r, isHiddenFooter: o }) {
447
458
  width: "100%",
448
459
  height: "100vh",
449
460
  zIndex: 50,
450
- transform: o ? "translateY(100%)" : "translateY(0)",
461
+ transform: n ? "translateY(100%)" : "translateY(0)",
451
462
  transition: `transform ${i}ms cubic-bezier(0.22,1,0.36,1)`,
452
463
  willChange: "transform",
453
- pointerEvents: o ? "none" : "auto"
464
+ pointerEvents: n ? "none" : "auto"
454
465
  },
455
466
  children: r
456
467
  }
457
468
  );
458
469
  }
459
- const Re = F(we);
460
- function ne({
470
+ const Re = N(ge);
471
+ function re({
461
472
  children: r,
462
- onChange: o,
473
+ onChange: n,
463
474
  directionDots: i = "right",
464
- enableContextMenu: f = !0,
475
+ enableContextMenu: u = !0,
465
476
  duration: a = 700,
466
477
  closeOutside: l = !1,
467
- disable: n = !1
478
+ disable: o = !1
468
479
  }) {
469
- const d = G.Children.toArray(r), p = d.filter(
470
- (w) => !w.type.__FULLPAGE_FOOTER__
471
- ), R = d.find(
472
- (w) => w.type.__FULLPAGE_FOOTER__
480
+ const p = I.Children.toArray(r), _ = p.filter(
481
+ (v) => v.type.__FULLPAGE_SECTION__
482
+ ), w = p.find(
483
+ (v) => v.type.__FULLPAGE_FOOTER__
473
484
  );
474
- ve(f);
475
- const _ = !!R, b = p.length + (_ ? 1 : 0), { active: y, goToSection: k, isHiddenFooter: T, footerRef: A } = de(
476
- b,
477
- _,
478
- o,
485
+ ve(u), $(() => (be(_), () => {
486
+ }), [_]);
487
+ const h = !!w, T = _.length + (h ? 1 : 0), { active: x, goToSection: b, isHiddenFooter: g, footerRef: y } = de(
488
+ T,
489
+ h,
490
+ n,
479
491
  a,
480
492
  l,
481
- n
482
- ), g = R ? G.cloneElement(R, { footerRef: A }) : null;
493
+ o
494
+ ), R = w ? I.cloneElement(w, { footerRef: y }) : null;
483
495
  return /* @__PURE__ */ E.jsxs(E.Fragment, { children: [
484
496
  /* @__PURE__ */ E.jsxs(
485
497
  "div",
@@ -495,39 +507,39 @@ function ne({
495
507
  "div",
496
508
  {
497
509
  style: {
498
- height: `${p.length * 100}vh`,
499
- transform: T ? `translateY(-${y * 100}vh)` : `translateY(-${p.length - 100}vh)`,
500
- transition: "transform 700ms cubic-bezier(0.22,1,0.36,1)"
510
+ height: `${_.length * 100}vh`,
511
+ transform: g ? `translateY(-${x * 100}vh)` : `translateY(-${(_.length - 1) * 100}vh)`,
512
+ transition: `transform ${a}ms cubic-bezier(0.22,1,0.36,1)`
501
513
  },
502
- children: p.map((w, h) => /* @__PURE__ */ E.jsx(
514
+ children: _.map((v, m) => /* @__PURE__ */ E.jsx(
503
515
  Ee,
504
516
  {
505
- index: h,
506
- active: y,
507
- isHiddenFooter: T,
508
- children: w
517
+ index: m,
518
+ active: x,
519
+ isHiddenFooter: g,
520
+ children: v
509
521
  },
510
- h
522
+ m
511
523
  ))
512
524
  }
513
525
  ),
514
- R && /* @__PURE__ */ E.jsx(Re, { isHiddenFooter: T, children: g })
526
+ w && /* @__PURE__ */ E.jsx(Re, { isHiddenFooter: g, children: R })
515
527
  ]
516
528
  }
517
529
  ),
518
530
  /* @__PURE__ */ E.jsx(
519
531
  he,
520
532
  {
521
- sectionsLen: b,
522
- active: y,
523
- goToSection: k,
533
+ sectionsLen: T,
534
+ active: x,
535
+ goToSection: b,
524
536
  direction: i
525
537
  }
526
538
  )
527
539
  ] });
528
540
  }
529
- ne.Section = te;
530
- ne.Footer = re;
541
+ re.Section = ee;
542
+ re.Footer = te;
531
543
  export {
532
- ne as FullPage
544
+ re as FullPage
533
545
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-abohook-fullpage",
3
- "version": "1.1.8",
3
+ "version": "1.2.0",
4
4
  "description": "React FullPage scroll component with parallax and navigation dots",
5
5
  "author": "Mostafa Ahmed",
6
6
  "license": "MIT",