@gem-sdk/components 2.0.0-staging.830 → 2.0.0-staging.831

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.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var core=require("@gem-sdk/core"),React=require("react");const useSticky=e=>{let{width:t,position:o}=e??{},s=core.makeStyleResponsive("w",t),a=core.usePageStore(e=>"interaction"===e.sidebarMode),l=core.useCurrentDevice(),p=(e,t)=>({[`--left${t}`]:"top"==e?"0":"50%",[`--t${t}`]:"top"==e?"unset":"translateX(-50%)"}),i=React.useMemo(()=>({...p(o?.desktop,""),...p(o?.tablet??o?.desktop,"-tablet"),...p(o?.mobile??o?.tablet??o?.desktop,"-mobile")}),[o?.desktop,o?.mobile,o?.tablet]),b=React.useMemo(()=>{if(a&&o?.[l]==="top")return"40px"},[l,a,o]),d=React.useMemo(()=>({"--d":e?.display?.desktop==="after-first-cart-button"?"none":"block","--d-tablet":e?.display?.tablet??e?.display?.desktop==="after-first-cart-button"?"none":"block","--d-mobile":e?.display?.mobile??e?.display?.tablet??e?.display?.desktop==="after-first-cart-button"?"none":"block"}),[e?.display?.desktop,e?.display?.mobile,e?.display?.tablet]),r=React.useMemo(()=>({"--top":b??"auto","--top-tablet":b??"auto","--top-mobile":b??"auto",[`--${o?.desktop}`]:b??"0px",[`--${o?.tablet??o?.desktop}-tablet`]:b??"0px",[`--${o?.mobile??o?.tablet??o?.desktop}-mobile`]:b??"0px"}),[b,o?.desktop,o?.mobile,o?.tablet]),c=e=>"top"==e?"sticky":"fixed",u=React.useMemo(()=>({"--pos":c(o?.desktop),"--pos-tablet":c(o?.tablet??o?.desktop),"--pos-mobile":c(o?.mobile??o?.tablet??o?.desktop)}),[o?.desktop,o?.mobile,o?.tablet]);return{w:s,displayStyle:r,positionStyle:u,getCSSAlign:i,makeDisplaySettingStyles:d}};exports.default=useSticky;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var core=require("@gem-sdk/core"),React=require("react");const useSticky=e=>{let{width:t,position:o}=e??{},s=core.makeStyleResponsive("w",t),l=core.usePageStore(e=>"interaction"===e.sidebarMode),a=core.useCurrentDevice(),p=(e,t)=>({[`--left${t}`]:"top"==e?"0":"50%",[`--t${t}`]:"top"==e?"unset":"translateX(-50%)"}),i=React.useMemo(()=>({...p(o?.desktop,""),...p(o?.tablet??o?.desktop,"-tablet"),...p(o?.mobile??o?.tablet??o?.desktop,"-mobile")}),[o?.desktop,o?.mobile,o?.tablet]),b=React.useMemo(()=>{if(l&&o?.[a]==="top")return"40px"},[a,l,o]),d=React.useMemo(()=>({"--d":(e?.display?.desktop,"block"),"--d-tablet":(e?.display?.tablet??e?.display?.desktop,"block"),"--d-mobile":(e?.display?.mobile??e?.display?.tablet??e?.display?.desktop,"block")}),[e?.display?.desktop,e?.display?.mobile,e?.display?.tablet]),r=React.useMemo(()=>({"--top":b??"auto","--top-tablet":b??"auto","--top-mobile":b??"auto",[`--${o?.desktop}`]:b??"0px",[`--${o?.tablet??o?.desktop}-tablet`]:b??"0px",[`--${o?.mobile??o?.tablet??o?.desktop}-mobile`]:b??"0px"}),[b,o?.desktop,o?.mobile,o?.tablet]),k=e=>"top"==e?"sticky":"fixed",c=React.useMemo(()=>({"--pos":k(o?.desktop),"--pos-tablet":k(o?.tablet??o?.desktop),"--pos-mobile":k(o?.mobile??o?.tablet??o?.desktop)}),[o?.desktop,o?.mobile,o?.tablet]);return{w:s,displayStyle:r,positionStyle:c,getCSSAlign:i,makeDisplaySettingStyles:d}};exports.default=useSticky;
@@ -1 +1 @@
1
- import{makeStyleResponsive as t,usePageStore as e,useCurrentDevice as o}from"@gem-sdk/core";import{useMemo as l}from"react";let useSticky=a=>{let{width:p,position:s}=a??{},b=t("w",p),i=e(t=>"interaction"===t.sidebarMode),d=o(),k=(t,e)=>({[`--left${e}`]:"top"==t?"0":"50%",[`--t${e}`]:"top"==t?"unset":"translateX(-50%)"}),r=l(()=>({...k(s?.desktop,""),...k(s?.tablet??s?.desktop,"-tablet"),...k(s?.mobile??s?.tablet??s?.desktop,"-mobile")}),[s?.desktop,s?.mobile,s?.tablet]),m=l(()=>{if(i&&s?.[d]==="top")return"40px"},[d,i,s]),n=l(()=>({"--d":a?.display?.desktop==="after-first-cart-button"?"none":"block","--d-tablet":a?.display?.tablet??a?.display?.desktop==="after-first-cart-button"?"none":"block","--d-mobile":a?.display?.mobile??a?.display?.tablet??a?.display?.desktop==="after-first-cart-button"?"none":"block"}),[a?.display?.desktop,a?.display?.mobile,a?.display?.tablet]),c=l(()=>({"--top":m??"auto","--top-tablet":m??"auto","--top-mobile":m??"auto",[`--${s?.desktop}`]:m??"0px",[`--${s?.tablet??s?.desktop}-tablet`]:m??"0px",[`--${s?.mobile??s?.tablet??s?.desktop}-mobile`]:m??"0px"}),[m,s?.desktop,s?.mobile,s?.tablet]),f=t=>"top"==t?"sticky":"fixed",u=l(()=>({"--pos":f(s?.desktop),"--pos-tablet":f(s?.tablet??s?.desktop),"--pos-mobile":f(s?.mobile??s?.tablet??s?.desktop)}),[s?.desktop,s?.mobile,s?.tablet]);return{w:b,displayStyle:c,positionStyle:u,getCSSAlign:r,makeDisplaySettingStyles:n}};export{useSticky as default};
1
+ import{makeStyleResponsive as t,usePageStore as e,useCurrentDevice as o}from"@gem-sdk/core";import{useMemo as l}from"react";let useSticky=p=>{let{width:a,position:s}=p??{},b=t("w",a),d=e(t=>"interaction"===t.sidebarMode),i=o(),k=(t,e)=>({[`--left${e}`]:"top"==t?"0":"50%",[`--t${e}`]:"top"==t?"unset":"translateX(-50%)"}),m=l(()=>({...k(s?.desktop,""),...k(s?.tablet??s?.desktop,"-tablet"),...k(s?.mobile??s?.tablet??s?.desktop,"-mobile")}),[s?.desktop,s?.mobile,s?.tablet]),r=l(()=>{if(d&&s?.[i]==="top")return"40px"},[i,d,s]),y=l(()=>({"--d":(p?.display?.desktop,"block"),"--d-tablet":(p?.display?.tablet??p?.display?.desktop,"block"),"--d-mobile":(p?.display?.mobile??p?.display?.tablet??p?.display?.desktop,"block")}),[p?.display?.desktop,p?.display?.mobile,p?.display?.tablet]),c=l(()=>({"--top":r??"auto","--top-tablet":r??"auto","--top-mobile":r??"auto",[`--${s?.desktop}`]:r??"0px",[`--${s?.tablet??s?.desktop}-tablet`]:r??"0px",[`--${s?.mobile??s?.tablet??s?.desktop}-mobile`]:r??"0px"}),[r,s?.desktop,s?.mobile,s?.tablet]),u=t=>"top"==t?"sticky":"fixed",f=l(()=>({"--pos":u(s?.desktop),"--pos-tablet":u(s?.tablet??s?.desktop),"--pos-mobile":u(s?.mobile??s?.tablet??s?.desktop)}),[s?.desktop,s?.mobile,s?.tablet]);return{w:b,displayStyle:c,positionStyle:f,getCSSAlign:m,makeDisplaySettingStyles:y}};export{useSticky as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/components",
3
- "version": "2.0.0-staging.830",
3
+ "version": "2.0.0-staging.831",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",