@gem-sdk/components 3.0.26 → 3.1.0-staging.1137
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/cjs/accordion/common/helpers.js +1 -1
- package/dist/cjs/accordion/components/AccordionItem.liquid.js +7 -7
- package/dist/cjs/accordion/hooks/useAccordionItem.js +1 -1
- package/dist/cjs/article/components/ArticleImage.js +1 -1
- package/dist/cjs/article/components/ArticleImage.liquid.js +4 -4
- package/dist/cjs/article/settings/configs/article-list/presets.js +1 -1
- package/dist/cjs/dialog/common/classes.js +1 -1
- package/dist/cjs/dialog/components/Dialog.js +1 -1
- package/dist/cjs/dialog/components/Dialog.liquid.js +1 -1
- package/dist/cjs/grid/components/row/common/classes.js +1 -1
- package/dist/cjs/grid/components/row/common/helpers.js +1 -1
- package/dist/cjs/grid/components/row/common/styles.js +1 -1
- package/dist/cjs/hero-banner/common/classes.js +1 -1
- package/dist/cjs/hero-banner/common/helpers.js +1 -1
- package/dist/cjs/hero-banner/common/styles.js +1 -1
- package/dist/cjs/hero-banner/components/HeroBanner.liquid.js +7 -7
- package/dist/cjs/hero-banner/settings/configs/settings.js +1 -1
- package/dist/cjs/icon-list-v2/common/helpers.js +1 -1
- package/dist/cjs/icon-list-v2/components/IconList.js +1 -1
- package/dist/cjs/icon-list-v2/hooks/useIconLineHeight.js +1 -1
- package/dist/cjs/image/common/attrs.js +1 -1
- package/dist/cjs/product/components/dynamic-checkout/Button.liquid.js +1 -1
- package/dist/cjs/product/components/product-description/hooks/useGpDescription.js +1 -1
- package/dist/cjs/product/components/product-images-v2/common/common.js +1 -1
- package/dist/cjs/product/components/product-list/ProductList.liquid.js +30 -22
- package/dist/cjs/product/components/product-list/common/helpers.js +1 -1
- package/dist/cjs/product/components/product-quantity/common/classes.js +1 -1
- package/dist/cjs/product/settings/product-list/configs/settings-v2.js +1 -1
- package/dist/cjs/text/common/styles.js +1 -1
- package/dist/cjs/video/components/LiteVimeoEmbed.liquid.js +6 -6
- package/dist/esm/accordion/common/helpers.js +1 -1
- package/dist/esm/accordion/components/AccordionItem.liquid.js +3 -3
- package/dist/esm/accordion/hooks/useAccordionItem.js +1 -1
- package/dist/esm/article/components/ArticleImage.js +1 -1
- package/dist/esm/article/components/ArticleImage.liquid.js +4 -4
- package/dist/esm/article/settings/configs/article-list/presets.js +1 -1
- package/dist/esm/dialog/common/classes.js +1 -1
- package/dist/esm/dialog/components/Dialog.js +1 -1
- package/dist/esm/dialog/components/Dialog.liquid.js +1 -1
- package/dist/esm/grid/components/row/common/classes.js +1 -1
- package/dist/esm/grid/components/row/common/helpers.js +1 -1
- package/dist/esm/grid/components/row/common/styles.js +1 -1
- package/dist/esm/hero-banner/common/classes.js +1 -1
- package/dist/esm/hero-banner/common/helpers.js +1 -1
- package/dist/esm/hero-banner/common/styles.js +1 -1
- package/dist/esm/hero-banner/components/HeroBanner.liquid.js +10 -10
- package/dist/esm/hero-banner/settings/configs/settings.js +1 -1
- package/dist/esm/icon-list-v2/common/helpers.js +1 -1
- package/dist/esm/icon-list-v2/components/IconList.js +1 -1
- package/dist/esm/icon-list-v2/hooks/useIconLineHeight.js +1 -1
- package/dist/esm/image/common/attrs.js +1 -1
- package/dist/esm/product/components/dynamic-checkout/Button.liquid.js +1 -1
- package/dist/esm/product/components/product-description/hooks/useGpDescription.js +1 -1
- package/dist/esm/product/components/product-images-v2/common/common.js +1 -1
- package/dist/esm/product/components/product-list/ProductList.liquid.js +32 -24
- package/dist/esm/product/components/product-list/common/helpers.js +1 -1
- package/dist/esm/product/components/product-quantity/common/classes.js +1 -1
- package/dist/esm/product/settings/product-list/configs/settings-v2.js +1 -1
- package/dist/esm/text/common/styles.js +1 -1
- package/dist/esm/video/components/LiteVimeoEmbed.liquid.js +5 -5
- package/dist/types/index.d.ts +1 -0
- package/package.json +4 -4
|
@@ -143,4 +143,4 @@ let SettingsV2=[{id:"setting",controls:[{id:"layout",type:"layout-banner",device
|
|
|
143
143
|
d="M4.39584 15.625C3.36031 15.625 2.52084 14.7855 2.52084 13.75V12.5C2.52084 11.4645 3.36031 10.625 4.39584 10.625H14.3958C15.4314 10.625 16.2708 11.4645 16.2708 12.5V13.75C16.2708 14.7855 15.4314 15.625 14.3958 15.625H4.39584ZM3.77084 13.75C3.77084 14.0952 4.05066 14.375 4.39584 14.375H14.3958C14.741 14.375 15.0208 14.0952 15.0208 13.75V12.5C15.0208 12.1548 14.741 11.875 14.3958 11.875H4.39584C4.05066 11.875 3.77084 12.1548 3.77084 12.5V13.75Z"
|
|
144
144
|
fill="currentColor"
|
|
145
145
|
/>
|
|
146
|
-
</svg> `,tooltip:"Align right"}],devices:{desktop:{default:"center"}}},{id:"seo",type:"group",label:"SEO",controls:[{id:"alt",label:"Alt Text",type:"textarea",minHeight:56,autoHeight:!0,placeholder:"E.g: Classic white crewneck t-shirt with minimalist design",default:void 0},{id:"title",label:"Image title",info:"Show title when hover to image",type:"textarea",minHeight:56,autoHeight:!0,placeholder:"E.g: White t-shirt",default:void 0}]},{id:"ratioOptions",type:"ratio",min:1,useUnit:!1,useLink:!1,devices:{desktop:{default:{width:"16",height:"9"}}}},{id:"aspectRatio",type:"select",label:"Ratio",options:[{label:"Original",value:"auto"},{label:"Square",value:"1/1"},{label:"3:2",value:"3/2"},{label:"4:3",value:"4/3"},{label:"16:9",value:"16/9"},{label:"21:9",value:"21/9"},{label:"2:3",value:"2/3"},{label:"3:4",value:"3/4"},{label:"9:16",value:"9/16"},{label:"Cover",value:"cover"},{label:"Custom",value:"custom"}],devices:{desktop:{default:"16/9"},mobile:{default:"auto"}}},{id:"contentBanner",type:"banner",message:"The background image should be taller than the Hero Banner",closable:!0}]},{id:"style",controls:[{id:"sizeSetting",type:"size-setting",label:"",devices:{desktop:{default:{shape:"original",widthHeightLinked:!1,width:"100%"}},mobile:{default:{shape:"custom",width:"100%"}}},settingConfig:{width:{displayOptions:["full","default"],name:"Width"},height:{displayOptions:["fit-content","fit-screen"],name:"Height"},shape:{displayOptions:["original","custom"],name:"Frame",shapeTitleConfig:{original:"As banner source"}}},hiddenSettings:["padding","gap"]},{id:"background",type:"background-media",ignoreReRender:!0,showVideo:!0,showDeviceControl:!0,devices:{desktop:{default:{type:"image",image:{src:"https://cdn.shopify.com/s/files/1/2005/9307/files/background_settings.jpg",width:1920,height:900},size:"cover",position:{x:50,y:50},repeat:"no-repeat",attachment:"scroll",video:"",videoHtml5:"",videoType:"youtube",loop:!0,lazyLoad:!1}}},compoDefaultValue:{desktop:{default:{type:"image",color:"bg-2",image:{src:"https://cdn.shopify.com/s/files/1/2005/9307/files/background_settings.jpg",width:1920,height:900},size:"cover",position:{x:50,y:50},repeat:"no-repeat",attachment:"scroll",video:"https://youtu.be/KOxfzBp72uk",videoHtml5:"https://cdn.shopify.com/videos/c/o/v/92a407d4e0c94a288eb54cac18c387dc.mp4",videoType:"youtube",loop:!0,lazyLoad:!1}}}},{id:"hoverEffect",type:"toggle",default:!1},{id:"hoverEffectScale",type:"input:slider",label:"Zoom Value",units:["%"],min:100,max:200,step:5,default:"120%"},{id:"hoverEffectDuration",label:"Zoom Time",type:"input:unit",units:["s"],min:0,default:.5,
|
|
146
|
+
</svg> `,tooltip:"Align right"}],devices:{desktop:{default:"center"}}},{id:"seo",type:"group",label:"SEO",controls:[{id:"alt",label:"Alt Text",type:"textarea",minHeight:56,autoHeight:!0,placeholder:"E.g: Classic white crewneck t-shirt with minimalist design",default:void 0},{id:"title",label:"Image title",info:"Show title when hover to image",type:"textarea",minHeight:56,autoHeight:!0,placeholder:"E.g: White t-shirt",default:void 0}]},{id:"ratioOptions",type:"ratio",min:1,useUnit:!1,useLink:!1,devices:{desktop:{default:{width:"16",height:"9"}}}},{id:"aspectRatio",type:"select",label:"Ratio",options:[{label:"Original",value:"auto"},{label:"Square",value:"1/1"},{label:"3:2",value:"3/2"},{label:"4:3",value:"4/3"},{label:"16:9",value:"16/9"},{label:"21:9",value:"21/9"},{label:"2:3",value:"2/3"},{label:"3:4",value:"3/4"},{label:"9:16",value:"9/16"},{label:"Cover",value:"cover"},{label:"Custom",value:"custom"}],devices:{desktop:{default:"16/9"},mobile:{default:"auto"}}},{id:"contentBanner",type:"banner",message:"The background image should be taller than the Hero Banner",closable:!0}]},{id:"style",controls:[{id:"sizeSetting",type:"size-setting",label:"",devices:{desktop:{default:{shape:"original",widthHeightLinked:!1,width:"100%"}},mobile:{default:{shape:"custom",width:"100%"}}},settingConfig:{width:{displayOptions:["full","default"],name:"Width"},height:{displayOptions:["fit-content","fit-screen"],name:"Height"},shape:{displayOptions:["original","custom"],name:"Frame",shapeTitleConfig:{original:"As banner source"}}},hiddenSettings:["padding","gap"]},{id:"background",type:"background-media",ignoreReRender:!0,showVideo:!0,showDeviceControl:!0,devices:{desktop:{default:{type:"image",image:{src:"https://cdn.shopify.com/s/files/1/2005/9307/files/background_settings.jpg",width:1920,height:900},size:"cover",position:{x:50,y:50},repeat:"no-repeat",attachment:"scroll",video:"",videoHtml5:"",videoType:"youtube",loop:!0,lazyLoad:!1}}},compoDefaultValue:{desktop:{default:{type:"image",color:"bg-2",image:{src:"https://cdn.shopify.com/s/files/1/2005/9307/files/background_settings.jpg",width:1920,height:900},size:"cover",position:{x:50,y:50},repeat:"no-repeat",attachment:"scroll",video:"https://youtu.be/KOxfzBp72uk",videoHtml5:"https://cdn.shopify.com/videos/c/o/v/92a407d4e0c94a288eb54cac18c387dc.mp4",videoType:"youtube",loop:!0,lazyLoad:!1}}}},{id:"hoverEffect",type:"toggle",default:!1},{id:"hoverEffectScale",type:"input:slider",label:"Zoom Value",units:["%"],min:100,max:200,step:5,default:"120%"},{id:"hoverEffectDuration",label:"Zoom Time",type:"input:unit",units:["s"],min:0,default:.5,inputType:"number",placeholder:"",disableAutoValue:!0},{id:"height",label:"Height",type:"input:unit",units:["px"],placeholder:"Auto",devices:{desktop:{default:void 0}},info:"Full Width: To set Hero Banner full width, first you drag & drop a Section element from left sidebar, then make it full-width, after that you put your Hero Banner inside Section you have created."},{id:"contentPosition1Col",label:"Content Position",type:"option:value",options:[{label:"Top",value:"top",iconName:"gp-align-top"},{label:"Center",value:"center",iconName:"gp-align-center-vertical"},{label:"Bottom",value:"bottom",iconName:"gp-align-bottom"},{label:"Space between",value:"space-between",iconName:"gp-justify-content-space-between"}],devices:{desktop:{default:"center"}}},{id:"contentPosition2Col",label:"Content Position",type:"option:value",options:[{label:"Top",value:"top",iconName:"gp-align-top"},{label:"Center",value:"center",iconName:"gp-align-center-vertical"},{label:"Bottom",value:"bottom",iconName:"gp-align-bottom"},{label:"Space between",value:"space-between",iconName:"gp-justify-content-space-between"}],devices:{desktop:{default:"center"}}},{id:"wrapperWidth",type:"input:unit-width",label:"Width",placeholder:"Auto",min:0,units:["px","%"],devices:{desktop:{default:void 0},tablet:{default:void 0},mobile:{default:void 0}}},{id:"contentWidth",type:"dropdown:input",label:"Width",inputType:"number",units:["px","%"],hideUnit:!1,devices:{desktop:{default:"default"},tablet:{default:"default"},mobile:{default:"default"}},displayOptions:[{label:"Full",value:"100%",showValue:!0},{label:"Default",value:"default",showValue:!0}]},{id:"verticalGutter",type:"input:unit",units:["px"],min:0,label:"Spacing",devices:{desktop:{default:"32px"}}},{id:"overlayEnable",type:"toggle",default:!1},{id:"overlayOpacity",label:"Opacity",type:"input:slider",min:0,max:100,units:["%"],step:1,default:{normal:"20%"},state:{normal:!0,hover:!0},compoDefaultValue:{normal:"20%",hover:"20%"}},{id:"overlayColor",label:"Color",type:"color-picker-v2",state:{normal:!0,hover:!0}},{id:"borderBg",type:"border-v2",label:"Border",compoDefaultValue:{border:"solid",color:"line-3",width:"1px",borderWidth:"1px"}},{id:"cornerBg",type:"corner-v2",label:"Corner",default:{radiusType:"none"}},{id:"hasActiveShadow",type:"toggle",label:"Enable Button Shadow",default:!1},{id:"shadowBg",type:"shadow-v2",label:"Button Shadow",compoDefaultValue:{type:"shadow-1",distance:"4px",blur:"4px",spread:"0px",color:"rgba(18, 18, 18, 0.2)",angle:45,enable:!0}},{id:"contentPadding",type:"padding-v2",devices:{desktop:{default:{top:"4px",left:"16px",bottom:"4px",right:"16px",linked:!1}},mobile:{default:{top:"16px",left:"16px",bottom:"16px",right:"16px",linked:!1}}},compoDefaultValue:{desktop:{default:{top:"4px",left:"16px",bottom:"4px",right:"16px",linked:!1}},mobile:{default:{top:"16px",left:"16px",bottom:"16px",right:"16px",linked:!1}}}}]}];export{SettingsV2};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{DEVICES as t,composePositionLineHeight as
|
|
1
|
+
import{DEVICES as t,composePositionLineHeight as o}from"@gem-sdk/core";import{getDynamicSourceLocales as e,getStaticLocale as n}from"../../helpers.js";let composeIconWith=t=>({...t,desktop:t?.desktop??0,tablet:t?.tablet??t?.desktop??0,mobile:t?.mobile??t?.tablet??t?.desktop??0}),getTextIconNotFound=t=>"react"===t?"Icons not found":n("IconList","icons_not_found"),getTextIconTranslations=({setting:t,builderProps:o,pageContext:n,key:i,type:s})=>{let{childItem:l,translate:c}=t??{};return"react"===s?l?.[i]:e({val:l?.[i],uid:o?.uid,settingId:`childItem_${i}`,pageContext:n,translate:c,isReplaceLocationOrigin:!0})},getvalueMap=({setting:t})=>{let{childConfig:o,iconType:e,iconSvg:n}=t??{};return e&&"matching"!==e?"different"===e?o:void 0:Array(o?.length).fill(n)},composePostionIconList=(e,n,i)=>{let s={...i,desktop:i?.desktop??0,tablet:i?.tablet??i?.desktop??0,mobile:i?.mobile??i?.tablet??i?.desktop??0},l={};return t.forEach(t=>{o({compose:l,lineHeight:e,device:t,position:n,iconWidth:s})}),l};export{composeIconWith,composePostionIconList,getTextIconNotFound,getTextIconTranslations,getvalueMap};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import{jsx as e,jsxs as t}from"react/jsx-runtime";import{useGetProductId as s}from"../../hooks/useGetProductId.js";import o from"../../text/components/Text.js";import{createClass as i,createStyle as r,createAttr as m,If as l}from"@gem-sdk/system";import{getClassWraplistIcon as n,getClassColListIcon as a,getClassWrapItemIcon as c,getClassWrapIcon as d,getClassIcon as p,getClassTextItem as h}from"../common/classes.js";import{getStyleContainerIconlistMain as u,getStyleWraplistIcon as f,getStyleColListIcon as y,getStyleIcon as g,getStyleWrapIcon as j,getStyleWrapItemIcon as v,getStyleTypoText as N}from"../common/styles.js";import{getvalueMap as x,composePostionIconList as I,getTextIconTranslations as L,getTextIconNotFound as k}from"../common/helpers.js";import{useIconLineHeight as
|
|
2
|
+
import{jsx as e,jsxs as t}from"react/jsx-runtime";import{useGetProductId as s}from"../../hooks/useGetProductId.js";import o from"../../text/components/Text.js";import{createClass as i,createStyle as r,createAttr as m,If as l}from"@gem-sdk/system";import{getClassWraplistIcon as n,getClassColListIcon as a,getClassWrapItemIcon as c,getClassWrapIcon as d,getClassIcon as p,getClassTextItem as h}from"../common/classes.js";import{getStyleContainerIconlistMain as u,getStyleWraplistIcon as f,getStyleColListIcon as y,getStyleIcon as g,getStyleWrapIcon as j,getStyleWrapItemIcon as v,getStyleTypoText as N}from"../common/styles.js";import{getvalueMap as x,composePostionIconList as I,getTextIconTranslations as L,getTextIconNotFound as k,composeIconWith as w}from"../common/helpers.js";import{useIconLineHeight as S}from"../hooks/useIconLineHeight.js";let IconListV2=T=>{let{builderProps:W,builderAttrs:$,style:H,setting:V,styles:_,pageContext:q,advanced:C}=T,G=i({[W?.uid??""]:!0}),M=i(n()),P=i(a()),b=i(c({builderProps:W})),z=i(d()),A=i(p()),B=i(h({setting:V})),D=r(u({styles:_,style:H,type:"react",advanced:C})),E=r(f({styles:_})),F=r(y({styles:_})),J=r(g({styles:_,setting:V})),K=N({setting:V}),O=m({...$}),Q=k("react"),R=x({setting:V}),{ref:U,lineHeight:X}=S({iconWidth:w(V?.iconWidth)}),Y=I(X,_?.position,V?.iconWidth),{refContainer:Z,productID:ee}=s(),et=r({...j({styles:_,setting:V}),...Y.content}),es=r({...v({styles:_}),...Y.wrapper});return e("div",{...O,...W,"data-id":W?.uid,style:D,className:G,ref:Z,children:l(!R||!R.length,e("div",{children:Q}),e("div",{className:M,style:E,children:e("div",{className:P,style:F,children:R?.map((s,i)=>{let r=L({setting:V,builderProps:W,pageContext:q,key:i,type:"react"});return t("div",{"data-index":i,className:b,style:es,children:[e("div",{className:z,style:et,children:e("span",{style:J,className:A,dangerouslySetInnerHTML:{__html:s}})}),e(o,{setting:{text:r?.toString(),htmlTag:"div",options:{useState:!0,uniqueId:`${W?.uid}-${i}-${ee}`,productID:ee,customClass:{wrapper:"gp-w-full"}}},styles:K,className:B,ref:U})]},i)})})}))})};export{IconListV2 as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useRef as
|
|
1
|
+
import{useCurrentDevice as e}from"@gem-sdk/core";import{useRef as t,useState as r,useEffect as o}from"react";let useIconLineHeight=({iconWidth:i})=>{let n=t(null),[l,u]=r(""),c=e();return o(()=>{if(n?.current){let e=window.getComputedStyle(n?.current).getPropertyValue("line-height");u(e)}},[i,c]),{ref:n,lineHeight:l}};export{useIconLineHeight};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{HREF_TO_SALES_PAGE as t}from"../../constant.js";import{getAspectRatio as e,getNewBackupFileKey as r,getImageSrc as a,safeStringify as s,NEXT_IMAGE_CONFIG as i,getSrcSet as l,createBlurDataURL as o,IMAGE_PLACEHOLDER as g}from"./helpers.js";import{createAttr as p}from"@gem-sdk/system";import{handleClickLink as n}from"../../helpers.js";import{PRIORITY_LOAD_ATTRS as c}from"../constants.js";let getContainerAttrs=(t,e)=>({...t,...e&&{"data-id":e}}),getLinkWrapperAttrs=({urlData:e,imageLink:r,title:a,isLiquid:s=!1})=>{let i=s?{...e,...r?.noFollow&&{rel:"nofollow"},title:a}:{setting:e,title:a};return r?.type!=="go-to-sales-page"?r?.link?i:{}:s?{href:t,target:"_self"}:{setting:{href:t,target:"_self"}}},getImageLiquidAttrs=({pageContext:t,enableLazyLoadImage:e=!1})=>({...t&&{pageContext:t},...e&&{enableLazyLoadImage:e}}),getAdaptiveImageAttrs=({styles:t,setting:i,mode:l,isLiquid:o})=>{let{alt:g,srcSet:p,priority:u,qualityPercent:d,qualityType:m}=i??{},A=e({styles:t,setting:i}),y=()=>{n(i?.imageLink,l)},k=p?.desktop?.backupFileKey?r(p?.desktop?.backupFileKey??"",p?.desktop?.src??""):"",L=o?a({src:p?.desktop?.src,backupFileKey:k,backupFilePath:p?.desktop?.backupFilePath,storage:p?.desktop?.storage}):p?.desktop?.src??"",F=u?{}:{"base-src":L??"","quality-type":s(m),"quality-percent":s(d)};return{pictureClass:"gp-contents",...g&&{alt:g},...p&&{srcSet:p},...u&&c,...F,...t?.objectFit&&{layout:t.objectFit},onClick:y,aspectRatio:A}},getNextImageAttrs=({styles:t,setting:r})=>{let{objectFit:a}=t??{},{vw:s,alt:i,title:l,quality:o,priority:g,isNotLazyload:p,qualityType:n,qualityPercent:c}=r??{},u=e({styles:t,setting:r});return{...r?.image,...s&&{vw:s},...i&&{alt:i},...l&&{title:l},...o&&{quality:o},...g&&{priority:g},isNotLazyload:p,setting:{aspectRatio:u,layout:a,qualityType:n,qualityPercent:c}}},getNextImageLiquidAttrs=t=>{let{srcset:e,setting:g,storage:n,baseSrc:c,priority:u,customAttrs:d,width:m=2237,height:A=1678,isNotLazyload:y,backupFileKey:k,backupFilePath:L,srcIsLiquidCode:F,enableLazyLoadImage:b,alt:f,title:h,src:I=i.DEFAULT_SRC,sizes:q=i.DEFAULT_SIZES}=t,E=!y&&b&&!u,T=()=>{let t=k?r(k??"",I):"",s=F?c:a({src:I,backupFileKey:t,backupFilePath:L,storage:n}),i=F?I:l(t??"",n??"THEME",I),g={sizes:"100vw",src:o(m,A),...s&&!u?{"base-src":s}:{},...s?{"data-src":s}:{},...i?{"data-srcset":i}:{}},p={sizes:q,src:s??"",isNotLazyload:"true",srcset:e??"",...s&&!u?{"base-src":s}:{},...u?{loading:"eager",fetchpriority:"high"}:{loading:"lazy"}};return{"data-sizes":"auto",...E?g:p}},_=()=>{let{qualityPercent:t,qualityType:e}=g??{},r=!u&&e&&t?{"quality-type":s(e),"quality-percent":s(t)}:{"quality-type":"","quality-percent":""};return{...f&&{alt:f},...h&&{title:h},width:m,height:A,draggable:"false",...r}};return p({...d,..._(),...T()})},getNextImageReactAttrs=t=>{let{width:e=i.DEFAULT_WIDTH_PROPS,height:r=i.DEFAULT_HEIGHT_PROPS,quality:a,priority:s,isNotLazyload:l,enableLazyLoadImage:o,base64:n=g,alt:c=i.DEFAULT_ALT,src:
|
|
1
|
+
import{HREF_TO_SALES_PAGE as t}from"../../constant.js";import{getAspectRatio as e,getNewBackupFileKey as r,getImageSrc as a,safeStringify as s,NEXT_IMAGE_CONFIG as i,getSrcSet as l,createBlurDataURL as o,IMAGE_PLACEHOLDER as g}from"./helpers.js";import{createAttr as p}from"@gem-sdk/system";import{handleClickLink as n}from"../../helpers.js";import{PRIORITY_LOAD_ATTRS as c}from"../constants.js";let getContainerAttrs=(t,e)=>({...t,...e&&{"data-id":e}}),getLinkWrapperAttrs=({urlData:e,imageLink:r,title:a,isLiquid:s=!1})=>{let i=s?{...e,...r?.noFollow&&{rel:"nofollow"},title:a}:{setting:e,title:a};return r?.type!=="go-to-sales-page"?r?.link?i:{}:s?{href:t,target:"_self"}:{setting:{href:t,target:"_self"}}},getImageLiquidAttrs=({pageContext:t,enableLazyLoadImage:e=!1})=>({...t&&{pageContext:t},...e&&{enableLazyLoadImage:e}}),getAdaptiveImageAttrs=({styles:t,setting:i,mode:l,isLiquid:o})=>{let{alt:g,srcSet:p,priority:u,qualityPercent:d,qualityType:m}=i??{},A=e({styles:t,setting:i}),y=()=>{n(i?.imageLink,l)},k=p?.desktop?.backupFileKey?r(p?.desktop?.backupFileKey??"",p?.desktop?.src??""):"",L=o?a({src:p?.desktop?.src,backupFileKey:k,backupFilePath:p?.desktop?.backupFilePath,storage:p?.desktop?.storage}):p?.desktop?.src??"",F=u?{}:{"base-src":L??"","quality-type":s(m),"quality-percent":s(d)};return{pictureClass:"gp-contents",...g&&{alt:g},...p&&{srcSet:p},...u&&c,...F,...t?.objectFit&&{layout:t.objectFit},onClick:y,aspectRatio:A}},getNextImageAttrs=({styles:t,setting:r})=>{let{objectFit:a}=t??{},{vw:s,alt:i,title:l,quality:o,priority:g,isNotLazyload:p,qualityType:n,qualityPercent:c}=r??{},u=e({styles:t,setting:r});return{...r?.image,...s&&{vw:s},...i&&{alt:i},...l&&{title:l},...o&&{quality:o},...g&&{priority:g},isNotLazyload:p,setting:{aspectRatio:u,layout:a,qualityType:n,qualityPercent:c}}},getNextImageLiquidAttrs=t=>{let{srcset:e,setting:g,storage:n,baseSrc:c,priority:u,customAttrs:d,width:m=2237,height:A=1678,isNotLazyload:y,backupFileKey:k,backupFilePath:L,srcIsLiquidCode:F,enableLazyLoadImage:b,alt:f,title:h,src:I=i.DEFAULT_SRC,sizes:q=i.DEFAULT_SIZES}=t,E=!y&&b&&!u,T=()=>{let t=k?r(k??"",I):"",s=F?c:a({src:I,backupFileKey:t,backupFilePath:L,storage:n}),i=F?I:l(t??"",n??"THEME",I),g={sizes:"100vw",src:o(m,A),...s&&!u?{"base-src":s}:{},...s?{"data-src":s}:{},...i?{"data-srcset":i}:{}},p={sizes:q,src:s??"",isNotLazyload:"true",srcset:e??"",...s&&!u?{"base-src":s}:{},...u?{loading:"eager",fetchpriority:"high"}:{loading:"lazy"}};return{"data-sizes":"auto",...E?g:p}},_=()=>{let{qualityPercent:t,qualityType:e}=g??{},r=!u&&e&&t?{"quality-type":s(e),"quality-percent":s(t)}:{"quality-type":"","quality-percent":""};return{...f&&{alt:f},...h&&{title:h},width:m,height:A,draggable:"false",...r}};return p({...d,..._(),...T()})},getNextImageReactAttrs=t=>{let{width:e=i.DEFAULT_WIDTH_PROPS,height:r=i.DEFAULT_HEIGHT_PROPS,quality:a,priority:s,isNotLazyload:l,enableLazyLoadImage:o,base64:n=g,alt:c=i.DEFAULT_ALT,title:u,src:d=i.DEFAULT_SRC}=t,m=!l&&o&&!s,A=()=>{let t={loading:"lazy",placeholder:"blur",...n&&{blurDataURL:n}},e={loading:"eager",fetchpriority:"high"};return{...m?t:e}},y=()=>({src:d,alt:c,title:u,width:e,height:r,quality:a}),k=y(),L=p(A());return{...k,...L}};export{getAdaptiveImageAttrs,getContainerAttrs,getImageLiquidAttrs,getLinkWrapperAttrs,getNextImageAttrs,getNextImageLiquidAttrs,getNextImageReactAttrs};
|
|
@@ -7,7 +7,7 @@ import{template as t,isLocalEnv as s,baseAssetURL as a}from"@gem-sdk/core";impor
|
|
|
7
7
|
assign supported_payment_methods = shop.enabled_payment_types
|
|
8
8
|
-%}
|
|
9
9
|
`)}
|
|
10
|
-
<gp-product-dynamic data-id="${_?.uid}" data-translate-label=
|
|
10
|
+
<gp-product-dynamic data-id="${_?.uid}" data-translate-label='${$}' class="${u?.cssClass}" gp-data='${JSON.stringify(S).replaceAll("'","'")}
|
|
11
11
|
'>
|
|
12
12
|
<div class="${v}">
|
|
13
13
|
{{ form | payment_button }}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useRef as e,useState as t,useCallback as r,useEffect as i}from"react";import{DESCRIPTION_LINE_HEIGHT_DEFAULT as l}from"../common/helpers.js";import{useProduct as n,useCurrentDevice as o,getResponsiveValueByScreen as
|
|
1
|
+
import{useRef as e,useState as t,useCallback as r,useEffect as i}from"react";import{DESCRIPTION_LINE_HEIGHT_DEFAULT as l}from"../common/helpers.js";import{useProduct as n,useCurrentDevice as o,getResponsiveValueByScreen as p,useProductShopifyEditLink as u,useEditorMode as m,isSafari as s}from"@gem-sdk/core";let useGpDescription=c=>{let a=e(null),[h,g]=t(!1),[d,y]=t(!1),H=n(),f=o(),x=p(c?.hasLineClamp,f),w=p(c?.lineClamp,f),{redirectProductShopifyLink:C}=u(),D=m(),G=r(()=>{if(!a.current)return l;let e=window.getComputedStyle(a.current).getPropertyValue("line-height");return Math.ceil(parseFloat(e))},[]),M=r(e=>x&&w&&e?`${w*e}px`:"auto",[x,w]),P=()=>{if(!a.current)return;let e=G();h?a.current.style.maxHeight=M(e):a.current.style.maxHeight="none",g(e=>!e)};return i(()=>{let e=G();M(e)},[c?.typo?.custom,M,G]),i(()=>{let e=a.current;if(g(!1),!e)return;let t=x&&H?.descriptionHtml;t?setTimeout(()=>{let t=e?.scrollHeight??0,r=e?.clientHeight??0,i=r<t,l=window.getComputedStyle(e).getPropertyValue("line-height"),n=parseInt(l,10)||1,o=Math.round((t??0)/n),p=void 0!==w&&w<o,u=s()?p:i;e.style.maxHeight=M(n),w&&u?y(()=>!0):y(()=>!1)},100):e.style.maxHeight="none"},[x,w,H?.description,H?.descriptionHtml,G,M,g,y]),{ref:a,open:h,isShowViewMore:d,handleToggleShowMore:P,mode:D,redirectProductShopifyLink:C}};export{useGpDescription};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getResponsiveValueByScreen as e,makeAspectRatio as t,makeStyleResponsive as o,removeNullUndefined as i,DEVICES as r}from"@gem-sdk/core";let getTypeWidthDevice=e=>{let t=e?.desktop,o=e?.tablet===void 0?t:e?.tablet,i=e?.mobile===void 0?o:e?.mobile;return{desktop:t,tablet:o,mobile:i}},convertUnitToNumber=(e,t)=>{if(!e)return t;if("number"==typeof e)return e;let o=e.replaceAll("px","").replaceAll("%","").replaceAll("rem","").replaceAll("em","");return isNaN(Number(o))?t:Number(o)},convertSpacing=e=>e?{desktop:convertUnitToNumber(e.desktop,5),tablet:convertUnitToNumber(e.tablet,5),mobile:convertUnitToNumber(e.mobile,5)}:{desktop:5},getDisplayStyle=(e,t)=>{let o={},i=["desktop","mobile","tablet"];return i.forEach(i=>{o={...o,[`--d${"desktop"===i?"":`-${i}`}`]:`${e(i)?"none":t}`}}),o},checkAddOverFlowClass=e=>{let t=e?.["--radius"],o=e?.["--bblr"]||"0px",i=e?.["--bbrr"]||"0px",r=e?.["--btlr"]||"0px",l=e?.["--btrr"]||"0px";return t&&!t.toString().includes("none")&&"0"!==t.toString()||"0px"!==o||"0px"!==i||"0px"!==r||"0px"!==l},getAspectRatio=o=>{let i={},r=["desktop","mobile","tablet"];return r.forEach(t=>{let r=e(o,t)?.shapeValue;if(r)i={...i,[t]:r};else{let r=e(o,t)?.shape;switch(r){case"square":i={...i,[t]:"1/1"};break;case"vertical":i={...i,[t]:"3/4"};break;case"horizontal":i={...i,[t]:"4/3"};break;case"original":i={...i,[t]:""}}}}),t(i)},getStyleGridLayout=t=>{let o={"--gtc":"minmax(0, 12fr)","--gtc-tablet":"minmax(0, 12fr)","--gtc-mobile":"minmax(0, 12fr)"};if(!t.isHiddenGalleryImages){let i=!1;r.forEach(r=>{let l=e(t.position,r),a=e(t.ratioLayout,r),n=e(t.ratioLayoutRight,r),s="desktop"===r?"--gtc":`--gtc-${r}`,d="desktop"===r?"--gtr":`--gtr-${r}`,u="left"===l?a:n,c=["left","right"].includes(l||"");c&&u?(i=!0,Object.assign(o={...o,[s]:`minmax(0, ${u[0]}fr) minmax(0, ${u[1]}fr)`},{[d]:"fit-content(0)"})):i&&Object.assign(o,{[d]:"unset"})})}return o},getStyleGridOrderForFeature=t=>{let o={"--o":"0","--o-tablet":"0","--o-mobile":"0"},i=["desktop","mobile","tablet"];return i.forEach(i=>{let r=e(t.position,i),l="desktop"===i?"--o":`--o-${i}`;o={...o,[l]:"left"===r?"1":"0"}}),o},getStyleGridOrderForGallery=t=>{let o={"--o":"1","--o-tablet":"1","--o-mobile":"1"},i=["desktop","mobile","tablet"];return i.forEach(i=>{let r=e(t.position,i),l="desktop"===i?"--o":`--o-${i}`;o={...o,[l]:"left"===r?"0":"1"}}),o},getSrcImage=e=>`{{${e} |
|
|
1
|
+
import{getResponsiveValueByScreen as e,makeAspectRatio as t,makeStyleResponsive as o,removeNullUndefined as i,DEVICES as r}from"@gem-sdk/core";let getTypeWidthDevice=e=>{let t=e?.desktop,o=e?.tablet===void 0?t:e?.tablet,i=e?.mobile===void 0?o:e?.mobile;return{desktop:t,tablet:o,mobile:i}},convertUnitToNumber=(e,t)=>{if(!e)return t;if("number"==typeof e)return e;let o=e.replaceAll("px","").replaceAll("%","").replaceAll("rem","").replaceAll("em","");return isNaN(Number(o))?t:Number(o)},convertSpacing=e=>e?{desktop:convertUnitToNumber(e.desktop,5),tablet:convertUnitToNumber(e.tablet,5),mobile:convertUnitToNumber(e.mobile,5)}:{desktop:5},getDisplayStyle=(e,t)=>{let o={},i=["desktop","mobile","tablet"];return i.forEach(i=>{o={...o,[`--d${"desktop"===i?"":`-${i}`}`]:`${e(i)?"none":t}`}}),o},checkAddOverFlowClass=e=>{let t=e?.["--radius"],o=e?.["--bblr"]||"0px",i=e?.["--bbrr"]||"0px",r=e?.["--btlr"]||"0px",l=e?.["--btrr"]||"0px";return t&&!t.toString().includes("none")&&"0"!==t.toString()||"0px"!==o||"0px"!==i||"0px"!==r||"0px"!==l},getAspectRatio=o=>{let i={},r=["desktop","mobile","tablet"];return r.forEach(t=>{let r=e(o,t)?.shapeValue;if(r)i={...i,[t]:r};else{let r=e(o,t)?.shape;switch(r){case"square":i={...i,[t]:"1/1"};break;case"vertical":i={...i,[t]:"3/4"};break;case"horizontal":i={...i,[t]:"4/3"};break;case"original":i={...i,[t]:""}}}}),t(i)},getStyleGridLayout=t=>{let o={"--gtc":"minmax(0, 12fr)","--gtc-tablet":"minmax(0, 12fr)","--gtc-mobile":"minmax(0, 12fr)"};if(!t.isHiddenGalleryImages){let i=!1;r.forEach(r=>{let l=e(t.position,r),a=e(t.ratioLayout,r),n=e(t.ratioLayoutRight,r),s="desktop"===r?"--gtc":`--gtc-${r}`,d="desktop"===r?"--gtr":`--gtr-${r}`,u="left"===l?a:n,c=["left","right"].includes(l||"");c&&u?(i=!0,Object.assign(o={...o,[s]:`minmax(0, ${u[0]}fr) minmax(0, ${u[1]}fr)`},{[d]:"fit-content(0)"})):i&&Object.assign(o,{[d]:"unset"})})}return o},getStyleGridOrderForFeature=t=>{let o={"--o":"0","--o-tablet":"0","--o-mobile":"0"},i=["desktop","mobile","tablet"];return i.forEach(i=>{let r=e(t.position,i),l="desktop"===i?"--o":`--o-${i}`;o={...o,[l]:"left"===r?"1":"0"}}),o},getStyleGridOrderForGallery=t=>{let o={"--o":"1","--o-tablet":"1","--o-mobile":"1"},i=["desktop","mobile","tablet"];return i.forEach(i=>{let r=e(t.position,i),l="desktop"===i?"--o":`--o-${i}`;o={...o,[l]:"left"===r?"0":"1"}}),o},getSrcImage=e=>`{{${e} | image_url: width: 480}}, {{${e} | image_url: width: 768}}, {{${e} | image_url: width: 1024}}, {{${e} | image_url: width: 1440}}`,convertSpacingForIndisdeLayout=e=>{let t=parseInt(e)?`${2*parseInt(e)}px`:`${e} * 2`;return t},getStyleInsideLayout=(t,r,l)=>{let a=["desktop","mobile","tablet"],n={},s={},d={},u={},c={},g={};return a.forEach(o=>{let i=e(t,o),a=e(r,o)?.width,m=e(l,o);if(n={...n,[o]:["inside-bottom","inside-left","inside-right"].includes(i)?"absolute":"static"},["inside-bottom"].includes(i)){let e=convertSpacingForIndisdeLayout(m);a=`calc(100% - ${e})`}["bottom-center","two-col","one-col"].includes(i)&&(a="100%"),d={...d,[o]:"inside-bottom"===i?`${m}`:"auto"},u={...u,[o]:["inside-left","inside-right"].includes(i)?`${m}`:"auto"},g={...g,[o]:["inside-bottom","inside-left"].includes(i)?`${m}`:"auto"},c={...c,[o]:"inside-right"===i?`${m}`:"auto"},s={...s,[o]:a}}),{...o("pos",n),...o("w",i(s)),...o("bottom",i(d)),...o("top",i(u)),...o("left",i(g)),...o("right",i(c))}},getConditionRenderGalleryImages=(t,o)=>{let i=["desktop","mobile","tablet"],r=!0,l=!1;return i.forEach(i=>{let a=e(t,i),n=e(o,i);a&&"only-feature"!==a&&(r=!1),(["two-col","one-col"].includes(a)||"images"===n)&&(l=!0)}),{isOnlyFeatureAllDevices:r,isRenderGalleryGrid:l}},setDefaultWhenUndefineSetting=e=>({...e,setting:{...e.setting}}),getValueFromValueContainUnit=e=>{let t=e.match(/\d+/g);return t?t[0]:e},getPaddingBottomByShapeSetting=t=>{let o=getAspectRatio(t),i={desktop:"auto",mobile:"auto",tablet:"auto"},r=["desktop","mobile","tablet"];return r.forEach(r=>{let l=e(t,r),a=l?.height,n=l?.width||"",s=getValueFromValueContainUnit(a||""),d=n.toString().match(/px/g)?getValueFromValueContainUnit(n):n;if(a&&n&&!isNaN(Number(s))&&!isNaN(Number(d))){i={...i,[r]:`${Number(s)/Number(d)*100}%`};return}if(a&&!isNaN(Number(s))){i={...i,[r]:a};return}let u=o?.[r]!=="auto"&&o?.[r]?o?.[r]?.split("/").reverse().join("/"):"{%if largestRatio == 0%} 100 / 100 {%else%} {{largestRatio}} {%endif%}";i={...i,[r]:`calc((${u})*100%)`}}),i};export{checkAddOverFlowClass,convertSpacing,convertSpacingForIndisdeLayout,convertUnitToNumber,getAspectRatio,getConditionRenderGalleryImages,getDisplayStyle,getPaddingBottomByShapeSetting,getSrcImage,getStyleGridLayout,getStyleGridOrderForFeature,getStyleGridOrderForGallery,getStyleInsideLayout,getTypeWidthDevice,setDefaultWhenUndefineSetting};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{template as e,RenderIf as s,isLocalEnv as t,baseAssetURL as i}from"@gem-sdk/core";import{getSettingPreloadData as d,getStaticLocale as o}from"../../../helpers.js";import{If as r}from"@gem-sdk/system";import a from"./ProductListCarouselLayout.liquid.js";import n from"./ProductListGridLayout.liquid.js";import{getStyle as c}from"./common/styles.js";import{getClass as l}from"./common/classes.js";import{getDataLiquid as u}from"./common/helpers.js";let ProductList=g=>{let{setting:p,styles:f,pageContext:m}=g
|
|
1
|
+
import{template as e,RenderIf as s,isLocalEnv as t,baseAssetURL as i}from"@gem-sdk/core";import{getSettingPreloadData as d,getStaticLocale as o}from"../../../helpers.js";import{If as r}from"@gem-sdk/system";import a from"./ProductListCarouselLayout.liquid.js";import n from"./ProductListGridLayout.liquid.js";import{getStyle as c}from"./common/styles.js";import{getClass as l}from"./common/classes.js";import{getDataLiquid as u}from"./common/helpers.js";let ProductList=g=>{let{setting:p,styles:f,pageContext:m}=g,$=m?.pageType==="GP_FUNNEL_PAGE";if($)return"";let{hasRelatedExclude:P,relatedExcludeTrim:h,collectionID:_,isLatestProducts:y,isGrid:v,numberOfProducts:E,productListId:k,productListHandles:x,sortedBy:S,isReverse:b,productSrc:L,productNumber:A,isSorted:R,relatedTag:I,collectionHandle:F}=u(g),j=()=>e`
|
|
2
2
|
${s("RelatedProduct"===L,`
|
|
3
3
|
assign relatedTag = '${I}'
|
|
4
4
|
assign assignProduct = product
|
|
@@ -9,7 +9,7 @@ import{template as e,RenderIf as s,isLocalEnv as t,baseAssetURL as i}from"@gem-s
|
|
|
9
9
|
assign handleAssignProduct = assignProduct.handle
|
|
10
10
|
case relatedTag
|
|
11
11
|
when 'collection'
|
|
12
|
-
assign hasRelatedExclude = ${
|
|
12
|
+
assign hasRelatedExclude = ${P}
|
|
13
13
|
if hasRelatedExclude
|
|
14
14
|
assign relatedExclude = '${h}'
|
|
15
15
|
else
|
|
@@ -63,7 +63,7 @@ import{template as e,RenderIf as s,isLocalEnv as t,baseAssetURL as i}from"@gem-s
|
|
|
63
63
|
endfor
|
|
64
64
|
when 'tags'
|
|
65
65
|
assign tagsAssignProduct = assignProduct.tags
|
|
66
|
-
assign hasRelatedExclude = ${
|
|
66
|
+
assign hasRelatedExclude = ${P}
|
|
67
67
|
if hasRelatedExclude
|
|
68
68
|
assign relatedExclude = '${h}'
|
|
69
69
|
else
|
|
@@ -95,7 +95,24 @@ import{template as e,RenderIf as s,isLocalEnv as t,baseAssetURL as i}from"@gem-s
|
|
|
95
95
|
assign products = products
|
|
96
96
|
endpaginate
|
|
97
97
|
`)}
|
|
98
|
-
`,
|
|
98
|
+
`,w=()=>{let s=F?`
|
|
99
|
+
assign target_collection = collections['${F}']
|
|
100
|
+
if target_collection == empty
|
|
101
|
+
for collection in collections
|
|
102
|
+
if collection.id == ${_}
|
|
103
|
+
assign target_collection = collection
|
|
104
|
+
break
|
|
105
|
+
endif
|
|
106
|
+
endfor
|
|
107
|
+
endif
|
|
108
|
+
`:`
|
|
109
|
+
for collection in collections
|
|
110
|
+
if collection.id == ${_}
|
|
111
|
+
assign target_collection = collection
|
|
112
|
+
break
|
|
113
|
+
endif
|
|
114
|
+
endfor
|
|
115
|
+
`;return e`
|
|
99
116
|
{%- liquid
|
|
100
117
|
assign productHandles = '${x.toString()}'| split: ','
|
|
101
118
|
assign products = null
|
|
@@ -103,18 +120,14 @@ import{template as e,RenderIf as s,isLocalEnv as t,baseAssetURL as i}from"@gem-s
|
|
|
103
120
|
assign productSrc = '${L}'
|
|
104
121
|
assign c = 0
|
|
105
122
|
assign limit = ${A??4}
|
|
123
|
+
|
|
106
124
|
if request.page_type == 'collection' or preview_page_type == 'collection'
|
|
107
125
|
assign target_collection = collection
|
|
108
126
|
if target_collection == empty or target_collection == null
|
|
109
127
|
if '${_.toLowerCase()}' == 'latest'
|
|
110
128
|
assign target_collection = collections | sort: 'updated_at' ${b?"| reverse":""} | first
|
|
111
129
|
else
|
|
112
|
-
|
|
113
|
-
if collection.id == ${_}
|
|
114
|
-
assign target_collection = collection
|
|
115
|
-
break
|
|
116
|
-
endif
|
|
117
|
-
endfor
|
|
130
|
+
${s}
|
|
118
131
|
endif
|
|
119
132
|
endif
|
|
120
133
|
paginate target_collection.products by ${E||4}
|
|
@@ -122,7 +135,7 @@ import{template as e,RenderIf as s,isLocalEnv as t,baseAssetURL as i}from"@gem-s
|
|
|
122
135
|
endpaginate
|
|
123
136
|
else
|
|
124
137
|
if productSrc == 'RelatedProduct'
|
|
125
|
-
${
|
|
138
|
+
${j()}
|
|
126
139
|
elsif productSrc == 'PickProduct'
|
|
127
140
|
unless ${y}
|
|
128
141
|
assign products = null | sort
|
|
@@ -142,12 +155,7 @@ import{template as e,RenderIf as s,isLocalEnv as t,baseAssetURL as i}from"@gem-s
|
|
|
142
155
|
if '${_.toLowerCase()}' == 'latest'
|
|
143
156
|
assign target_collection = collections | sort: 'updated_at' ${b?"| reverse":""} | first
|
|
144
157
|
else
|
|
145
|
-
|
|
146
|
-
if collection.id == ${_}
|
|
147
|
-
assign target_collection = collection
|
|
148
|
-
break
|
|
149
|
-
endif
|
|
150
|
-
endfor
|
|
158
|
+
${s}
|
|
151
159
|
endif
|
|
152
160
|
paginate target_collection.products by ${E||4}
|
|
153
161
|
assign products = target_collection.products ${R?S:""} ${b?"| reverse":""}
|
|
@@ -155,7 +163,7 @@ import{template as e,RenderIf as s,isLocalEnv as t,baseAssetURL as i}from"@gem-s
|
|
|
155
163
|
endif
|
|
156
164
|
endif
|
|
157
165
|
-%}
|
|
158
|
-
|
|
166
|
+
`},{productListWrapStyle:H,productListContentStyle:q,productListWrapAlignStyle:G}=c(g),{productListWrapClass:B}=l(g),T=()=>e`
|
|
159
167
|
{%- if products == null -%}
|
|
160
168
|
{%- if count == 0 and ${k.length} == 0 -%}
|
|
161
169
|
{% if '${L}' == 'RelatedProduct' -%}
|
|
@@ -178,17 +186,17 @@ import{template as e,RenderIf as s,isLocalEnv as t,baseAssetURL as i}from"@gem-s
|
|
|
178
186
|
|
|
179
187
|
${s(!!f?.preloadBgImage,`${s(!!f?.backgroundImage?.desktop?.image?.src,`<link rel="preload" href="${f?.backgroundImage?.desktop?.image?.src}" as="image" />`)}${s(!!f?.backgroundImage?.tablet?.image?.src,`<link rel="preload" href="${f?.backgroundImage?.tablet?.image?.src}" as="image" />`)}${s(!!f?.backgroundImage?.mobile?.image?.src,`<link rel="preload" href="${f?.backgroundImage?.mobile?.image?.src}" as="image" />`)}`)}
|
|
180
188
|
<div
|
|
181
|
-
class="${
|
|
182
|
-
style="${
|
|
189
|
+
class="${B}"
|
|
190
|
+
style="${H}"
|
|
183
191
|
>
|
|
184
|
-
<div class='gp-flex gp-w-full' style="${
|
|
192
|
+
<div class='gp-flex gp-w-full' style="${G}">
|
|
185
193
|
<div
|
|
186
|
-
style="${
|
|
194
|
+
style="${q}"
|
|
187
195
|
>
|
|
188
196
|
{%- assign gpBkProduct = product -%}
|
|
189
197
|
{%- assign gpBkProducts = products -%}
|
|
190
|
-
${
|
|
191
|
-
${
|
|
198
|
+
${w()}
|
|
199
|
+
${T()}
|
|
192
200
|
{%- assign product = gpBkProduct -%}
|
|
193
201
|
{%- assign products = gpBkProducts -%}
|
|
194
202
|
</div>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getSizeSetting as t}from"../../../helpers/product.js";import{convertUnitToNumber as e}from"../../product-images/common/productFeaturedImage.js";import{getUpdatedDotStyle as o}from"../../../../carousel/components/dot/common/helpers.js";let getData=e=>{let{setting:
|
|
1
|
+
import{getSizeSetting as t}from"../../../helpers/product.js";import{convertUnitToNumber as e}from"../../product-images/common/productFeaturedImage.js";import{getUpdatedDotStyle as o}from"../../../../carousel/components/dot/common/helpers.js";let getData=e=>{let{setting:d,styles:r}=e,c=d?.productSetting??{},l="RelatedProduct"===c.productSrc,i=o(d?.dot,d?.dotStyle),a={dotSize:{desktop:12},dotGapToCarousel:{desktop:16},arrowIconSize:{desktop:24},showWhenHover:!1,rtl:!1,...d};delete a.childItem;let u={...r,sizeSetting:{...t({adaptiveHeight:r?.adaptiveHeight,height:r?.height,fullWidth:{desktop:!0}})},spacing:r?.spacing};return delete u.backgroundColor,delete u.backgroundImage,{isRelatedProduct:l,productSetting:c,dotStyle:i,carouselConfigSetting:a,carouselConfigStyle:u}},getDataLiquid=t=>{let{setting:o,styles:d}=t,r=o?.productSetting,c=r?.relatedTag,l=r?.hasRelatedExclude,i=(c&&"collection"===c[0]?r?.relatedCollectionExclude:r?.relatedTagsExclude)??"",a=i?.split(",").map(t=>t.trim()).toString(),u=r?.productSrc??"Collection",p=r?.collectionId?.replace(PREFIX_COLLECTION_ID,"")??"latest",n=r?.productSrc==="PickProduct"&&r?.productIds?.length===0,s=d?.layout==="grid",g=e(o?.numberOfProducts,4),I="PickProduct"===u&&r?.productIds?.length?r?.productIds.map(t=>t.replace(PREFIX_PRODUCT_ID,"")):[],m="PickProduct"===u&&r?.productHandles?.length?r?.productHandles:[],P=o?.orderBy&&o?.orderBy!=="none",h=(r?.productSrc==="Collection"||r?.productSrc==="DynamicCollection")&&P?o?.orderBy?.split("_"):"none",C=P&&h?.[0]==="TITLE"?"| sort: 'title'":"| sort: 'updated_at'",D=h?.[h.length-1]==="DESC",E=()=>"PickProduct"===u?n?4:r?.numOfSelectedProducts??4:g;return{hasRelatedExclude:l,relatedExcludeTrim:a,collectionID:p,isLatestProducts:n,isGrid:s,numberOfProducts:g,productListId:I,productListHandles:m,sortedBy:C,isReverse:D,productSrc:u,productSetting:r,isSorted:P,relatedTag:c,productNumber:E(),collectionHandle:r?.collectionHandle}},PREFIX_COLLECTION_ID="gid://shopify/Collection/",PREFIX_PRODUCT_ID="gid://shopify/Product/";export{PREFIX_COLLECTION_ID,PREFIX_PRODUCT_ID,getData,getDataLiquid};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{composeTypographyClassName as e,handleConvertClassColor as t,getGlobalColorStateClass as p,composeClasses as l}from"@gem-sdk/core";let getInputClasses=({styles:
|
|
1
|
+
import{composeTypographyClassName as e,handleConvertClassColor as t,getGlobalColorStateClass as p,composeClasses as l}from"@gem-sdk/core";let getInputClasses=({styles:s,borderBtn:g,inputBackgroundColor:n,textColor:r,isDisabled:a})=>{let o="gp-flex gp-w-full gp-shrink-[99999] gp-appearance-none gp-items-center gp-text-center gp-outline-none focus-visible:gp-shadow-none focus-visible:gp-outline-none gp-transition-all gp-duration-150 hover:gp-text-black disabled:gp-cursor-not-allowed",i=e(s?.typo,s?.typography),u=t(g),c=p("bg",n),f=p("text",r);return u&&(o+=` ${u} `),i&&(o+=` ${i} `),c&&(o+=` ${c} `),f&&(o+=` ${f} `),a&&(o+="gp-cursor-not-allowed"),{...l(o)}},getButtonClass=({borderBtn:e,buttonBackgroundColor:s,iconColor:g,buttonSide:n,isDisabled:r})=>{let a=`gp-flex gp-aspect-square gp-h-full disabled:gp-cursor-not-allowed ${r?"gp-cursor-not-allowed":"gp-cursor-pointer"} gp-items-center gp-justify-center gp-outline-none ${"left"===n?"gp-minus":"gp-plus"} `,o=t(e),i=p("bg",s),u=p("text",g);return o&&(a+=` ${o} `),i&&(a+=` ${i} `),u&&(a+=` ${u} `),{...l(a)}},getContainerClasses=e=>({...l(`quantityClass gp-relative gp-inline-flex gp-h-12 gp-w-full gp-bg-transparent gp-transition-all gp-duration-150 data-[disabled=true]:gp-opacity-60 ${e??""}`)}),getWrapperClasses=()=>({...l("gp-inline-flex gp-w-full gp-overflow-hidden")}),getIconWrapperClasses=()=>({...l("gp-inline-flex gp-items-center gp-justify-center [&>*]:gp-h-full [&>*]:gp-w-full")});export{getButtonClass,getContainerClasses,getIconWrapperClasses,getInputClasses,getWrapperClasses};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{CarouselSettingsV2Setting as e,CarouselSettingsV2Style as t}from"../../../../carousel/settings/configs/settings-v2.js";let ProductListSettingsV2=[{id:"setting",controls:[{id:"productSetting",type:"product-list",label:"Select product list",default:{productSrc:"PickProduct",productIds:[],collectionId:"Latest",relatedType:"related-product",relatedTag:["collection"],hasRelatedExclude:!1}},{id:"slidesToShow",type:"input:slider",min:1,max:6,isNumber:!0,label:"Products per rows ",devices:{desktop:{default:4},tablet:{default:3},mobile:{default:2}}},{id:"numberOfProducts",type:"input:slider",min:1,max:50,label:"Number of products",isNumber:!0,default:10,ignoreMax:!0},{id:"sameHeight",label:"Enable same height",type:"select",options:[{label:"Same height",value:!0},{label:"Fit content height",value:!1}],default:!0},...e]},{id:"style",controls:[{id:"layout",label:"Layout",type:"layout-selector",iconViewBox:"0 0 78 52",itemPerRow:2,itemSpacing:"large",default:"grid",options:[{label:"Grid",value:"grid",iconName:"gp-grid-layout"},{label:"Slider",value:"slider",iconName:"gp-slider-layout"}]},{id:"width",type:"dropdown:input",label:"Width",inputType:"number",units:["px","%"],hideUnit:!1,isRowWith:!0,devices:{desktop:{default:"default"}},displayOptions:[{label:"Full",value:"100%",showValue:!0},{label:"Default",value:"default",showValue:!0}]},{id:"height",label:"Height",type:"dropdown:input",inputType:"number",units:["px"],displayOptions:[{label:"Fit content",value:"Auto"}],devices:{}},{id:"horizontalGutter",label:"Row gap",type:"input:unit",fallbackValue:!0,min:0,units:["px","%"],devices:{desktop:{default:"16px"},mobile:{default:"16px"}}},{id:"verticalGutter",label:"Column gap",type:"input:unit",units:["px","%"],fallbackValue:!0,min:0,devices:{desktop:{default:"16px"},mobile:{default:"16px"}}},{id:"backgroundColor",type:"color-picker-v2",devices:{desktop:{default:"transparent"}},compoDefaultValue:{desktop:{default:"#DDDDDD"}},enableGradient:!0},{id:"backgroundImage",type:"background-image",devices:{desktop:{default:{}}},compoDefaultValue:{desktop:{default:{type:"image",image:{src:"https://cdn.shopify.com/s/files/1/2005/9307/files/background_settings.jpg",width:1200,height:480,hiddenSEO:!0},repeat:"no-repeat",size:"cover",position:{x:50,y:50},attachment:"scroll",preload:!1}}}},{id:"preloadBgImage",type:"toggle",label:"Preload",default:!1},{id:"align",label:"Align",type:"segment",options:[{label:"Left",value:"left",type:"align",tooltip:"Align left"},{label:"Center",value:"center",type:"align",tooltip:"Align center"},{label:"Right",value:"right",type:"align",tooltip:"Align right"}],devices:{desktop:{default:"center"}}},...t]}];export{ProductListSettingsV2};
|
|
1
|
+
import{CarouselSettingsV2Setting as e,CarouselSettingsV2Style as t}from"../../../../carousel/settings/configs/settings-v2.js";let ProductListSettingsV2=[{id:"setting",controls:[{id:"productSetting",type:"product-list",label:"Select product list",default:{productSrc:"PickProduct",productIds:[],collectionId:"Latest",collectionHandle:"",relatedType:"related-product",relatedTag:["collection"],hasRelatedExclude:!1}},{id:"slidesToShow",type:"input:slider",min:1,max:6,isNumber:!0,label:"Products per rows ",devices:{desktop:{default:4},tablet:{default:3},mobile:{default:2}}},{id:"numberOfProducts",type:"input:slider",min:1,max:50,label:"Number of products",isNumber:!0,default:10,ignoreMax:!0},{id:"sameHeight",label:"Enable same height",type:"select",options:[{label:"Same height",value:!0},{label:"Fit content height",value:!1}],default:!0},...e]},{id:"style",controls:[{id:"layout",label:"Layout",type:"layout-selector",iconViewBox:"0 0 78 52",itemPerRow:2,itemSpacing:"large",default:"grid",options:[{label:"Grid",value:"grid",iconName:"gp-grid-layout"},{label:"Slider",value:"slider",iconName:"gp-slider-layout"}]},{id:"width",type:"dropdown:input",label:"Width",inputType:"number",units:["px","%"],hideUnit:!1,isRowWith:!0,devices:{desktop:{default:"default"}},displayOptions:[{label:"Full",value:"100%",showValue:!0},{label:"Default",value:"default",showValue:!0}]},{id:"height",label:"Height",type:"dropdown:input",inputType:"number",units:["px"],displayOptions:[{label:"Fit content",value:"Auto"}],devices:{}},{id:"horizontalGutter",label:"Row gap",type:"input:unit",fallbackValue:!0,min:0,units:["px","%"],devices:{desktop:{default:"16px"},mobile:{default:"16px"}}},{id:"verticalGutter",label:"Column gap",type:"input:unit",units:["px","%"],fallbackValue:!0,min:0,devices:{desktop:{default:"16px"},mobile:{default:"16px"}}},{id:"backgroundColor",type:"color-picker-v2",devices:{desktop:{default:"transparent"}},compoDefaultValue:{desktop:{default:"#DDDDDD"}},enableGradient:!0},{id:"backgroundImage",type:"background-image",devices:{desktop:{default:{}}},compoDefaultValue:{desktop:{default:{type:"image",image:{src:"https://cdn.shopify.com/s/files/1/2005/9307/files/background_settings.jpg",width:1200,height:480,hiddenSEO:!0},repeat:"no-repeat",size:"cover",position:{x:50,y:50},attachment:"scroll",preload:!1}}}},{id:"preloadBgImage",type:"toggle",label:"Preload",default:!1},{id:"align",label:"Align",type:"segment",options:[{label:"Left",value:"left",type:"align",tooltip:"Align left"},{label:"Center",value:"center",type:"align",tooltip:"Align center"},{label:"Right",value:"right",type:"align",tooltip:"Align right"}],devices:{desktop:{default:"center"}}},...t]}];export{ProductListSettingsV2};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{makeStyle as e,makeStyleResponsive as t,makeGlobalSize as r,getSingleColorVariable as o,composeBorderResponsive as l,composeRadiusResponsive as i,getResponsiveStyleShadowWithoutState as n,getStyleShadow as a,makeLineClamp as d,getGlobalColorStyle as
|
|
1
|
+
import{makeStyle as e,makeStyleResponsive as t,makeGlobalSize as r,getSingleColorVariable as o,composeBorderResponsive as l,composeRadiusResponsive as i,getResponsiveStyleShadowWithoutState as n,getStyleShadow as a,makeLineClamp as d,getGlobalColorStyle as y,getGlobalColorStateStyle as h,composeTypographyStyle as s,getStyleBackgroundByDevice as p,getGradientBgrStyleByDevice as c,filterHoverVariables as u}from"@gem-sdk/core";import{formatThickness as g}from"./helpers.js";function filterTruthyStyles(e){return Object.fromEntries(Object.entries(e||{}).filter(([,e])=>!!e))}let getStyle=(r,o)=>{let l={...e({mr:r?.spacing,mb:r?.spacing}),...t("ta",r?.align),...o,"--dynamic-source-color":"#F4F4F4"};return filterTruthyStyles(l)},getContainerStyle=(e,r)=>{let{tagWidth:o}=r??{},l={...t("jc",e?.align),...o};return filterTruthyStyles(l)},getTextStyle=(S,w)=>{let m=r(w?.globalSize),b=[S?.lineThrough&&"line-through",S?.typo?.attrs?.underline&&"underline"].filter(Boolean),f={...m?.width?.["--w"]?m.width:{"--w":"100%"},...e({tdc:o(S?.lineColor?.normal),tdt:g(S?.thickness)}),...l(S?.shapeBorder),...i(S?.shapeRounded),...n(S?.shapeBoxShadow,"box-shadow",S?.shapeBoxShadow),...a({value:S?.typo?.custom?.textShadow,styleAppliedFor:"text-shadow",isEnableShadow:S?.typo?.custom?.hasShadowText}),...t("ta",S?.textAlign),...t("line-clamp",d(S?.lineClamp,S?.hasLineClamp)),...S?.textColor?y(S.textColor):h("c",S?.color),...s(S?.typo,S?.typography),"word-break":"break-word",...p(w?.background),...m.padding,...c(w?.background,{desktop:!0,tablet:!0,mobile:!0}),overflow:"hidden",...S?.opacityPrice&&{opacity:`${S?.opacityPrice}%`},...e({tdl:b.join(" ")})};return S?.enableHoverEffect?filterTruthyStyles(f):u(f)},getTextStyleInline=e=>{let t={...s(e?.typo),"word-break":"break-word",overflow:"hidden"};return filterTruthyStyles(t)};export{getContainerStyle,getStyle,getTextStyle,getTextStyleInline};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import{template as e,RenderIf as t,isLocalEnv as s,baseAssetURL as
|
|
1
|
+
import{template as e,RenderIf as t,isLocalEnv as s,baseAssetURL as i}from"@gem-sdk/core";import{getSettingPreloadData as l}from"../../helpers.js";import{createStateOrContext as r,createStyle as a,createClass as m,If as o}from"@gem-sdk/system";import{getArticleVimeoClasses as p,getImageVimeoClasses as c,getButtonVimeoClasses as d,getIframeVimeoClasses as g}from"../common/classes.js";import{getIframeVimeoStyle as f,getArticleVimeoStyle as n}from"../common/styles.js";import{getVimeoParams as y}from"../common/helpers.js";import $ from"../../image/components/NextImage.liquid.js";let LiteVimeoEmbed=b=>{let{title:h,id:u,lazy:v,aspectRatio:S,autoplay:j,muted:w,thumbnailLink:E,poster:x}=b,{iframeSrc:L}=y(b),k=!v,I=b.thumbnail,N=r({id:u,thumbnail:E,lazy:v,iframeSrc:L,title:h,autoplay:j,muted:w,style:b?.vimeoStyleIframe||""}),V=a({...f(S)}),A=a({...n(S,"")}),T=m({...p(I,S)}),C=m({...c(k)}),G=m({...d(k)}),M=m({...g()});return e`
|
|
2
2
|
<gp-lite-vimeo-embed gp-data='${JSON.stringify(N)}'>
|
|
3
3
|
<article
|
|
4
4
|
aria-hidden
|
|
5
5
|
class="${T}"
|
|
6
|
-
data-title="${
|
|
6
|
+
data-title="${h}"
|
|
7
7
|
style="${A}"
|
|
8
8
|
>
|
|
9
|
-
${$({src:I,alt:x?.altText,title:x?.imageTitle,className:C,isDisableAspectStyle:!0,enableLazyLoadImage:!0,priority:x?.preload})}
|
|
9
|
+
${$({src:I,alt:x?.altText,title:x?.imageTitle,className:C,isDisableAspectStyle:!0,enableLazyLoadImage:!0,priority:x?.preload,height:x?.height,width:x?.width})}
|
|
10
10
|
${o(!k,e`
|
|
11
11
|
<button type="button" class="${G}" aria-label="Play">
|
|
12
12
|
<svg class="gp-w-5 gp-text-white" viewBox="0 0 24 24">
|
|
@@ -19,7 +19,7 @@ import{template as e,RenderIf as t,isLocalEnv as s,baseAssetURL as l}from"@gem-s
|
|
|
19
19
|
${o(k,e`
|
|
20
20
|
<iframe
|
|
21
21
|
style="${V}"
|
|
22
|
-
title="${
|
|
22
|
+
title="${h}"
|
|
23
23
|
frameborder="0"
|
|
24
24
|
allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture"
|
|
25
25
|
allowfullscreen
|
|
@@ -28,5 +28,5 @@ import{template as e,RenderIf as t,isLocalEnv as s,baseAssetURL as l}from"@gem-s
|
|
|
28
28
|
></iframe>`)}
|
|
29
29
|
</article>
|
|
30
30
|
</gp-lite-vimeo-embed>
|
|
31
|
-
${t(s,`<script ${
|
|
31
|
+
${t(s,`<script ${l('class="gps-link" delay',"src")}="{{ 'gp-lite-vimeo-embed-v7-5.js' | asset_url }}" defer="defer"></script>`,`<script ${l('class="gps-link" delay',"src")}="${i}/assets-v2/gp-lite-vimeo-embed-v7-5.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}" defer="defer"></script>`)}
|
|
32
32
|
`};export{LiteVimeoEmbed as default};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -3622,6 +3622,7 @@ type OriginalSettingProps$2 = {
|
|
|
3622
3622
|
productSrc?: ProductSource;
|
|
3623
3623
|
productIds?: string[];
|
|
3624
3624
|
collectionId?: string;
|
|
3625
|
+
collectionHandle?: string;
|
|
3625
3626
|
productHandles?: string[];
|
|
3626
3627
|
numOfSelectedProducts?: number;
|
|
3627
3628
|
relatedTag?: RelatedCondition[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gem-sdk/components",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.1.0-staging.1137",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "dist/cjs/index.js",
|
|
@@ -25,9 +25,9 @@
|
|
|
25
25
|
"scan-all-text": "rollup -c ./scripts/rollup.config.settings.mjs && node ./scripts/scan-all-text && node ./scripts/scan-all-text"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@gem-sdk/core": "3.0.
|
|
29
|
-
"@gem-sdk/styles": "3.0.
|
|
30
|
-
"@gem-sdk/system": "3.0.
|
|
28
|
+
"@gem-sdk/core": "3.1.0-staging.1137",
|
|
29
|
+
"@gem-sdk/styles": "3.1.0-staging.1137",
|
|
30
|
+
"@gem-sdk/system": "3.1.0-staging.1137",
|
|
31
31
|
"tsup": "^8.5.0",
|
|
32
32
|
"@types/react-transition-group": "^4.4.12",
|
|
33
33
|
"xlsx": "^0.18.5"
|