@gem-sdk/components 19.0.0-staging.3 → 19.0.0-staging.31
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/builder.js +1 -1
- package/dist/cjs/carousel-v3/components/arrow/Arrow.liquid.js +8 -8
- package/dist/cjs/carousel-v3/components/arrow/common/classes.js +1 -1
- package/dist/cjs/carousel-v3/components/item/CarouselItem.js +1 -1
- package/dist/cjs/carousel-v3/components/root/Carousel.js +1 -1
- package/dist/cjs/carousel-v3/components/root/Carousel.liquid.js +1 -1
- package/dist/cjs/carousel-v3/components/root/common/helpers.js +1 -1
- package/dist/cjs/carousel-v3/components/swiper/Swiper.js +1 -1
- package/dist/cjs/carousel-v3/hooks/useCarousel.js +1 -1
- package/dist/cjs/carousel-v3/index.js +1 -1
- package/dist/cjs/carousel-v3/settings/configs/ui-v2.js +1 -1
- package/dist/cjs/code/common/helpers.js +1 -0
- package/dist/cjs/code/common/styles.js +1 -1
- package/dist/cjs/code/hooks/useCSSCode.js +4 -10
- package/dist/cjs/estimate-delivery/common/helpers.js +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/index.liquid.js +1 -1
- package/dist/cjs/post-purchase/link/components/PostPurchaseLink.js +1 -1
- package/dist/cjs/post-purchase/link/settings/configs/settings.js +1 -1
- package/dist/cjs/post-purchase/link/settings/configs/ui-v2.js +1 -1
- package/dist/cjs/post-purchase/product/components/product-offer/components/ProductOfferItem.js +1 -1
- package/dist/cjs/post-purchase/product/components/product-offer/context/PrdOfferSubscriptionPresenceContext.js +2 -0
- package/dist/cjs/post-purchase/product/components/product-offer/helpers/scanSubscriptionBlocks.js +1 -0
- package/dist/cjs/post-purchase/product/components/product-offer/hooks/useProductOfferSubscriptionBlocksObserver.js +1 -0
- package/dist/cjs/post-purchase/product/components/product-subscription/hooks/useSubscriptionVisibility.js +1 -1
- package/dist/cjs/post-purchase/product/components/product-variant/components/variants/DropdownOption.js +1 -1
- package/dist/cjs/product/components/product-button/ProductButton.liquid.js +11 -8
- package/dist/cjs/product/components/product-button/common/helpers.js +1 -1
- package/dist/cjs/product/components/product-button/hooks/useAddToCart.js +1 -1
- package/dist/cjs/product/components/product-description/ProductDescription.js +1 -1
- package/dist/cjs/product/components/product-description/ProductDescription.liquid.js +2 -3
- package/dist/cjs/product/components/product-description/hooks/useGpDescription.js +1 -1
- package/dist/cjs/product/components/product-images-v3/ProductImagesV3.liquid.js +16 -14
- package/dist/cjs/product/components/product-images-v3/common/classes.js +1 -1
- package/dist/cjs/product/components/product-images-v3/common/common.js +1 -1
- package/dist/cjs/product/components/product-images-v3/components/child/ProductFeatureVideo.js +1 -1
- package/dist/cjs/product/components/product-images-v3/components/child/ProductFeaturedImageOnly.js +1 -1
- package/dist/cjs/product/components/product-images-v3/components/child/ProductGalleryGrid.js +2 -2
- package/dist/cjs/product/components/product-images-v3/components/feature-gallery/FeatureImageWithGallery.liquid.js +29 -29
- package/dist/cjs/product/components/product-images-v3/components/gallery-carousel/GalleryCarousel.liquid.js +8 -8
- package/dist/cjs/product/components/product-images-v3/components/gallery-grid/GalleryGrid.liquid.js +7 -7
- package/dist/cjs/product/components/product-images-v3/components/lightbox/ProductImagesLightBox.js +1 -1
- package/dist/cjs/product/components/product-list-v3/ProductListCarouselLayout.liquid.js +6 -6
- package/dist/cjs/product/components/product-list-v3/common/classes.js +1 -1
- package/dist/cjs/product/components/product-variants/OptionVariantsNewFormat.liquid.js +11 -12
- package/dist/cjs/product/components/product-variants/OptionVariantsOldFormat.liquid.js +11 -10
- package/dist/cjs/product/index.js +1 -1
- package/dist/cjs/product/settings/product-image-v3/configs/ui-v2.js +1 -1
- package/dist/cjs/sticky/hooks/useSticky.js +1 -1
- package/dist/cjs/third-party/components/AppstleLoyaltyRewardProgram.js +2 -0
- package/dist/cjs/third-party/components/AppstleLoyaltyRewardProgram.liquid.js +16 -0
- package/dist/cjs/third-party/components/EcomsendBackInStockAlert.js +1 -1
- package/dist/cjs/third-party/configs/AppstleLoyaltyRewardProgram.js +1 -0
- package/dist/cjs/third-party/configs/EcomsendBackInStockAlert.js +1 -1
- package/dist/cjs/third-party/index.js +1 -1
- package/dist/cjs/third-party/next.js +1 -1
- package/dist/cjs/third-party/settings/AppstleLoyaltyRewardProgram/index.js +4 -0
- package/dist/cjs/third-party/settings/AppstleLoyaltyRewardProgram/uiV2.js +1 -0
- package/dist/cjs/third-party/settings/EcomsendBackInStockAlert/index.js +4 -4
- package/dist/esm/builder.js +1 -1
- package/dist/esm/carousel-v3/components/arrow/Arrow.liquid.js +6 -6
- package/dist/esm/carousel-v3/components/arrow/common/classes.js +1 -1
- package/dist/esm/carousel-v3/components/item/CarouselItem.js +1 -1
- package/dist/esm/carousel-v3/components/root/Carousel.js +1 -1
- package/dist/esm/carousel-v3/components/root/Carousel.liquid.js +4 -4
- package/dist/esm/carousel-v3/components/root/common/helpers.js +1 -1
- package/dist/esm/carousel-v3/components/swiper/Swiper.js +1 -1
- package/dist/esm/carousel-v3/hooks/useCarousel.js +1 -1
- package/dist/esm/carousel-v3/index.js +1 -1
- package/dist/esm/carousel-v3/settings/configs/ui-v2.js +1 -1
- package/dist/esm/code/common/helpers.js +1 -0
- package/dist/esm/code/common/styles.js +1 -1
- package/dist/esm/code/hooks/useCSSCode.js +4 -10
- package/dist/esm/estimate-delivery/common/helpers.js +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.liquid.js +1 -1
- package/dist/esm/post-purchase/link/components/PostPurchaseLink.js +1 -1
- package/dist/esm/post-purchase/link/settings/configs/settings.js +1 -1
- package/dist/esm/post-purchase/link/settings/configs/ui-v2.js +1 -1
- package/dist/esm/post-purchase/product/components/product-offer/components/ProductOfferItem.js +1 -1
- package/dist/esm/post-purchase/product/components/product-offer/context/PrdOfferSubscriptionPresenceContext.js +2 -0
- package/dist/esm/post-purchase/product/components/product-offer/helpers/scanSubscriptionBlocks.js +1 -0
- package/dist/esm/post-purchase/product/components/product-offer/hooks/useProductOfferSubscriptionBlocksObserver.js +1 -0
- package/dist/esm/post-purchase/product/components/product-subscription/hooks/useSubscriptionVisibility.js +1 -1
- package/dist/esm/post-purchase/product/components/product-variant/components/variants/DropdownOption.js +1 -1
- package/dist/esm/product/components/product-button/ProductButton.liquid.js +11 -8
- package/dist/esm/product/components/product-button/common/helpers.js +1 -1
- package/dist/esm/product/components/product-button/hooks/useAddToCart.js +1 -1
- package/dist/esm/product/components/product-description/ProductDescription.js +1 -1
- package/dist/esm/product/components/product-description/ProductDescription.liquid.js +3 -4
- package/dist/esm/product/components/product-description/hooks/useGpDescription.js +1 -1
- package/dist/esm/product/components/product-images-v3/ProductImagesV3.liquid.js +28 -26
- package/dist/esm/product/components/product-images-v3/common/classes.js +1 -1
- package/dist/esm/product/components/product-images-v3/common/common.js +1 -1
- package/dist/esm/product/components/product-images-v3/components/child/ProductFeatureVideo.js +1 -1
- package/dist/esm/product/components/product-images-v3/components/child/ProductFeaturedImageOnly.js +1 -1
- package/dist/esm/product/components/product-images-v3/components/child/ProductGalleryGrid.js +2 -2
- package/dist/esm/product/components/product-images-v3/components/feature-gallery/FeatureImageWithGallery.liquid.js +45 -45
- package/dist/esm/product/components/product-images-v3/components/gallery-carousel/GalleryCarousel.liquid.js +14 -14
- package/dist/esm/product/components/product-images-v3/components/gallery-grid/GalleryGrid.liquid.js +7 -7
- package/dist/esm/product/components/product-images-v3/components/lightbox/ProductImagesLightBox.js +1 -1
- package/dist/esm/product/components/product-list-v3/ProductListCarouselLayout.liquid.js +9 -9
- package/dist/esm/product/components/product-list-v3/common/classes.js +1 -1
- package/dist/esm/product/components/product-variants/OptionVariantsNewFormat.liquid.js +11 -12
- package/dist/esm/product/components/product-variants/OptionVariantsOldFormat.liquid.js +11 -10
- package/dist/esm/product/index.js +1 -1
- package/dist/esm/product/settings/product-image-v3/configs/ui-v2.js +1 -1
- package/dist/esm/sticky/hooks/useSticky.js +1 -1
- package/dist/esm/third-party/components/AppstleLoyaltyRewardProgram.js +2 -0
- package/dist/esm/third-party/components/AppstleLoyaltyRewardProgram.liquid.js +16 -0
- package/dist/esm/third-party/components/EcomsendBackInStockAlert.js +1 -1
- package/dist/esm/third-party/configs/AppstleLoyaltyRewardProgram.js +1 -0
- package/dist/esm/third-party/configs/EcomsendBackInStockAlert.js +1 -1
- package/dist/esm/third-party/index.js +1 -1
- package/dist/esm/third-party/next.js +1 -1
- package/dist/esm/third-party/settings/AppstleLoyaltyRewardProgram/index.js +4 -0
- package/dist/esm/third-party/settings/AppstleLoyaltyRewardProgram/uiV2.js +1 -0
- package/dist/esm/third-party/settings/EcomsendBackInStockAlert/index.js +4 -4
- package/dist/types/index.d.ts +29 -4
- package/package.json +5 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useMemo as e,useEffect as
|
|
1
|
+
import{useMemo as e,useEffect as i}from"react";import{useProductStore as l,useProduct as o}from"@gem-sdk/core";import{SubscriptionEnum as s}from"../../../constants/index.js";import{useProductOfferSubscriptionPresence as r}from"../../product-offer/context/PrdOfferSubscriptionPresenceContext.js";import{useSellingPlanOptions as t}from"./useSellingPlanOptions.js";import{useSubscriptionSellingType as n}from"../../../hooks/useSubscriptionSellingType.js";let p=({setting:p})=>{let S=l(e=>e.setSubscriptionSellingType),{isOneTime:T,subscriptionSellingType:m}=n(),O=t(p),c=o(),u=r(),I=O&&O.length>0,g=u.hasBoth,f=e(()=>c?.requiresSellingPlan,[c?.requiresSellingPlan]),E=e(()=>T?s.ONE_TIME:s.SUBSCRIPTION,[T]);i(()=>{m||(p?.sellingType===s.ONE_TIME?S(s.ONE_TIME):S(p?.sellingType??s.SUBSCRIPTION))},[S,p?.sellingType,m]);let a=!!u.hasSubscriptionBlock&&!u.hasOneTimeBlock&&m===s.ONE_TIME;i(()=>{a&&S(s.SUBSCRIPTION)},[S,a]);let y=p?.sellingType===s.SUBSCRIPTION&&!I,N=p?.sellingType===s.ONE_TIME&&f;return{selectedType:E,shouldShowRadio:!f&&I&&g,isOneTimeHidden:N,requiresSellingPlan:f,isOnetimeOnly:!I&&!f,hasNoSellingPlanOptions:y,setSubscriptionSellingType:S}};export{p as useSubscriptionVisibility};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import{jsx as e}from"react/jsx-runtime";import{useVariantOutStock as t}from"@gem-sdk/core";import"react";let
|
|
2
|
+
import{jsx as e}from"react/jsx-runtime";import{useVariantOutStock as t,cls as o}from"@gem-sdk/core";import"react";let r=({optionPosition:r,optionNumber:a,value:l,optionName:i,isSoldOutMark:p})=>{let m=t(i??"",l?.label??"",{position:r||0,optionNumber:a||0}),n=!m&&p;return e("option",{className:o("gp-text-[14px]",n?"":"gp-text-black"),disabled:n,value:l?.label,children:l?.label},l?.id)};export{r as default};
|
|
@@ -1,22 +1,25 @@
|
|
|
1
|
-
import{getSplitStyle as t}from"./common/styles.js";import{getGPProductButtonState as
|
|
2
|
-
${
|
|
1
|
+
import{getSplitStyle as t}from"./common/styles.js";import{getGPProductButtonState as e,escapeSingleQuoteForAttr as s}from"./common/helpers.js";import{template as r,isLocalEnv as o,baseAssetURL as a}from"@gem-sdk/core";import{createStateOrContext as i,Liquid as n,LiquidFor as l,If as p}from"@gem-sdk/system";import{getInsertLinkData as c,getSettingPreloadData as u}from"../../../helpers.js";import{getButtonDynamicSourceLocales as m}from"./helpers/getButtonDynamicSourceLocales.js";import{SoldOutButton as d}from"./SoldOutButton.liquid.js";import{AddToCartButton as g}from"./AddToCartButton.liquid.js";let f=f=>{let{setting:$,builderProps:b,style:y,styles:v,pageContext:_}=f,{wrapStyle:h,restStyle:S}=t(y),{outOfStockButtonLabel:j,unavailableButtonLabel:k,variantSelectionRequiredMessage:q,successMessage:E,errorMessage:M}=m({setting:$,pageContext:_,builderProps:b}),{urlData:A}=c("",$?.actionEffect==="open-cart-drawer"?{link:"/cart",target:"_self"}:$?.customURL),B=i(e({styles:v,setting:$})),G=s(E??$?.successMessage),P=s(M??$?.errorMessage),w=s(q??$?.variantSelectionRequiredMessage);return r`
|
|
2
|
+
${n("{%- assign total_combinations = 1 -%}")}
|
|
3
3
|
${l("option in product.options_with_values","{%- assign total_combinations = total_combinations | times: option.values.size -%}")}
|
|
4
4
|
{%- liquid
|
|
5
5
|
assign inventory_quantity = variant.inventory_quantity | default: 0
|
|
6
6
|
assign is_in_stock = variant.available
|
|
7
7
|
-%}
|
|
8
8
|
<gp-product-button
|
|
9
|
-
style="${
|
|
9
|
+
style="${h}"
|
|
10
10
|
gp-data-wrapper="true"
|
|
11
11
|
gp-href="${A.href}"
|
|
12
12
|
class="gp-product-button"
|
|
13
|
-
gp-label-out-of-stock="${
|
|
14
|
-
gp-label-unavailable="${
|
|
13
|
+
gp-label-out-of-stock="${j}"
|
|
14
|
+
gp-label-unavailable="${k}"
|
|
15
15
|
gp-data='${JSON.stringify(B)}'
|
|
16
|
+
data-variant-selection-required-message="${w}"
|
|
16
17
|
gp-enable-third-partycart="{{shop.metafields.GEMPAGES.enableThirdPartyCart}}"
|
|
18
|
+
gp-error-message="${P}"
|
|
19
|
+
gp-success-message="${G}"
|
|
17
20
|
>
|
|
18
|
-
${
|
|
19
|
-
${
|
|
21
|
+
${g({...f,style:S})}
|
|
22
|
+
${d({...f,style:S,label:j})}
|
|
20
23
|
</gp-product-button>
|
|
21
|
-
${
|
|
24
|
+
${p(o,`<script ${u('class="gps-link" delay',"src")}="{{ 'gp-product-button-v7-5.js' | asset_url }}" defer="defer"></script>`,`<script ${u('class="gps-link" delay',"src")}="${a}/assets-v2/gp-product-button-v7-5.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}" defer="defer"></script>`)}
|
|
22
25
|
`};export{f as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{SEPARATOR as e}from"./constants.js";let t=/^\s*\{\{[\s\S]*\}\}\s*$/,r=e=>e.replace(/\s*\}\}\s*$/,"| escape
|
|
1
|
+
import{SEPARATOR as e}from"./constants.js";let t=/^\s*\{\{[\s\S]*\}\}\s*$/,r=e=>e.replace(/\s*\}\}\s*$/,"| escape }}"),o=e=>{if(null==e)return e;let o=e.toString();return t.test(o)?r(o):o.replaceAll("'","'").replaceAll("’","'").replaceAll('"',""")},a=e=>e?.enableIcon===!0,l=e=>({lineThrough:!1,typo:s(e?.priceTypo)}),i=e=>({lineThrough:!0,typo:s(e?.compareAtPriceTypo),opacityPrice:e?.opacityPrice}),c=({styles:e,setting:t})=>({styles:{errorTypo:e?.errorTypo,successTypo:e?.successTypo},setting:{errorType:t?.errorType,actionEffect:t?.actionEffect,enableMessage:t?.enableMessage,label:o(t?.label),outOfStockLabel:o(t?.outOfStockLabel),customURL:{link:o(t?.customURL?.link),target:t?.customURL?.target}},variantID:"{{variant.id}}",disabled:"{{variant.available}}",totalVariant:"{{total_combinations}}"}),n=t=>({dot:e.DOT,"vertical-line":e.VERTICAL_LINE,"horizontal-line":e.HORIZONTAL_LINE})[t??"horizontal-line"]??e.HORIZONTAL_LINE,s=e=>(e?.attrs&&e?.attrs.color&&delete e.attrs.color,e);export{a as checkIconVisibility,o as escapeSingleQuoteForAttr,c as getGPProductButtonState,i as getRenderComparePriceSettings,l as getRenderRegularPriceSettings,n as renderSeparator};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useRenderMode as e,useProduct as t,useCurrency as r,useQuantity as i,useProductProperties as
|
|
1
|
+
import{useRenderMode as e,useProduct as t,useCurrency as r,useQuantity as i,useProductProperties as a,useCurrentVariant as s,useHasPreSelected as o,useStickyStore as u,useProductStore as n,useCreateCart as l,useAddToCart as d,convertDecimalToNumber as m,useCurrentVariantInStock as c}from"@gem-sdk/core";import{useRef as p,useEffect as f,useCallback as b}from"react";import{addToCartTracking as v}from"../../../helpers/tracking.js";import{useDispatchInteractionEvent as g,useDispatchCustomEvent as k}from"./useDispatchAfterSubmitEvent.js";import{useCartMessage as D}from"./useCartMessage.js";import{useCartOperations as I}from"./useCartOperations.js";let E=({styles:E,setting:y,builderProps:S})=>{let j=p(null),{isEditMode:C,isPreviewSharePageMode:M}=e(),h=t(),{currency:w}=r(),{quantity:A}=i(),L=a(),O=s(),{hasPreSelected:q}=o(),x=u(e=>e.setElement),B=u(e=>e.removeElement),T=n(e=>e.updateIsSubmit),U=g(S?.uid),V=k({product:h,currentVariant:O,quantity:A}),{showMessage:z,notiComponent:F}=D(E,y),{handleSuccess:G,handleError:H,cartId:J}=I({setting:y,showMessage:z,dispatchInteractionEvent:U,dispatchCustomEvent:V}),{isMutating:K,trigger:N}=l({onSuccess:G,onError:H}),{isMutating:P,trigger:Q}=d({onSuccess:G,onError:H});f(()=>{let e=j.current;if(!(!e||e.closest(".sticky-wrapper"))&&S?.uid&&S.builderData?.advanced)return x({id:S.uid,element:e,deviceVisibility:S.builderData.advanced.d}),()=>{S?.uid&&B(S.uid)}},[]);let R=b(()=>{if(!O?.baseID||!A||!h?.baseID||void 0!==q&&!q||C||M)return;let e=L?.some(e=>e.required&&!e.value);if(T(!0),e)return;let t=L?.filter(e=>!!e.value)?.map(e=>({key:e.key,value:e.value}));v({quantity:A,currency:w,id:h?.baseID,name:h?.title,brand:h?.vendor,sku:O.sku,price:m(O?.price),variant:O.title});let r={quantity:A,attributes:t,variantId:O.baseID};y?.actionEffect!=="buy-now"&&J?Q({cartId:J,lines:[r]}):N({items:[r]})},[C,M,J,w,A,L,q,h?.title,h?.vendor,h?.baseID,O?.sku,O?.price,O?.title,O?.baseID,y?.actionEffect,N,Q,T]),W=c(),X=O?y?.outOfStockLabel:"Unavailable";return{addToCartRef:j,isLoading:K||P,isInStock:W,notiComponent:F,outOfStockLabel:X,addToCart:R}};export{E as useBtnAddToCart};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import{jsx as e,Fragment as t,jsxs as s}from"react/jsx-runtime";import{useProduct as o,useCurrentDevice as i,getResponsiveValueByScreen as r,useI18nStore as m,makeStyleResponsive as c,makeLineClamp as n}from"@gem-sdk/core";import l from"../../../common/components/NoDataState.js";import{ICON_SVG as a}from"./common/helpers.js";import{createClass as p,createStyle as d,createAttr as h,If as u}from"@gem-sdk/system";import{getClasses as y,getButtonClasses as g,getClassPreBuilt as f}from"./common/classes.js";import{getTextStyle as x,getButtonStyle as k,getStaticCss as N}from"./common/styles.js";import{useGpDescription as j}from"./hooks/useGpDescription.js";let w=w=>{let{setting:L,advanced:b,builderProps:v}=w,{htmlTag:C}=L??{},H=o(),T=i(),M=r(L?.hasLineClamp,T),{ref:_,open:D,isShowViewMore:I,handleToggleShowMore:S,mode:A,redirectProductShopifyLink:P}=j(L),{t:q}=m(),G=p({"gp-product-description":!0,[b?.cssClass]:!0}),V=p(y({setting:L,isLiquid:!1})),$=p(g({setting:L})),z=p({"gp-show-more-text":!0}),B=p({"gp-show-more-icon gp-ml-1":!0,...D?{"gp-rotate-180":!0}:{}}),E=p(f()),F=d({...x({setting:L})
|
|
2
|
+
import{jsx as e,Fragment as t,jsxs as s}from"react/jsx-runtime";import{useProduct as o,useCurrentDevice as i,getResponsiveValueByScreen as r,useI18nStore as m,makeStyleResponsive as c,makeLineClamp as n}from"@gem-sdk/core";import l from"../../../common/components/NoDataState.js";import{ICON_SVG as a}from"./common/helpers.js";import{createClass as p,createStyle as d,createAttr as h,If as u}from"@gem-sdk/system";import{getClasses as y,getButtonClasses as g,getClassPreBuilt as f}from"./common/classes.js";import{getTextStyle as x,getButtonStyle as k,getStaticCss as N}from"./common/styles.js";import{useGpDescription as j}from"./hooks/useGpDescription.js";let w=w=>{let{setting:L,advanced:b,builderProps:v}=w,{htmlTag:C}=L??{},H=o(),T=i(),M=r(L?.hasLineClamp,T),{ref:_,open:D,isShowViewMore:I,handleToggleShowMore:S,mode:A,redirectProductShopifyLink:P}=j(L),{t:q}=m(),G=p({"gp-product-description":!0,[b?.cssClass]:!0}),V=p(y({setting:L,isLiquid:!1})),$=p(g({setting:L})),z=p({"gp-show-more-text":!0}),B=p({"gp-show-more-icon gp-ml-1":!0,...D?{"gp-rotate-180":!0}:{}}),E=p(f()),F=d({...x({setting:L}),...!D&&I?c("line-clamp",n(L?.lineClamp,L?.hasLineClamp)):{}}),J=d(k({setting:L})),K=h({"data-id":`${v?.uid}`}),O=h({"data-gp-text":""}),{gpDescriptionCss:Q,textDescriptionCss:R}=N(),U=!H?.descriptionHtml;return U&&"edit"===A?e(l,{elementType:"secondary",description:q("Highlight key benefits with product description."),descriptionActions:[{text:q("Add description"),callback:P},{text:q("sync data"),callback:"syncProduct"}]}):e(t,{children:u(U,"",s("div",{...K,className:G,children:[e("style",{children:R}),e("style",{children:Q}),e("div",{className:E}),e("html"===C?"div":"p",{ref:_,...O,className:V,style:F,dangerouslySetInnerHTML:{__html:H?.descriptionHtml||""}}),u(M&&I,s("button",{className:$,style:J,onClick:S,children:[e("span",{className:z,children:u(D,L?.viewLessText||"",L?.viewMoreText)}),u(L?.enableViewMoreIcon,e("span",{className:B,dangerouslySetInnerHTML:{__html:a}}))]})," ")]}))})};export{w as default};
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import{makeStyleResponsive as e,makeLineClamp as t,dataStringify as s,template as i,baseAssetURL as o,isLocalEnv as r}from"@gem-sdk/core";import{getDynamicSourceLocales as p,createSettingId as a,getSettingPreloadData as n}from"../../../helpers.js";import{createClass as d,createStyle as l,createAttr as c,createStateOrContext as m,LiquidIf as
|
|
1
|
+
import{makeStyleResponsive as e,makeLineClamp as t,dataStringify as s,template as i,baseAssetURL as o,isLocalEnv as r}from"@gem-sdk/core";import{getDynamicSourceLocales as p,createSettingId as a,getSettingPreloadData as n}from"../../../helpers.js";import{createClass as d,createStyle as l,createAttr as c,createStateOrContext as m,LiquidIf as u,Liquid as $,LiquidUnless as g,If as v}from"@gem-sdk/system";import{getClasses as f,getButtonClasses as x,getClassPreBuilt as w}from"./common/classes.js";import{getTextStyle as h,getButtonStyle as C,getStaticCss as y}from"./common/styles.js";import{ICON_SVG as b}from"./common/helpers.js";import{ProductDescription as j}from"../../settings/product-description/configs/translate.js";let M=M=>{let{setting:S,advanced:I,builderProps:L,pageContext:T}=M,{htmlTag:k,viewMoreText:E,viewLessText:P}=S??{},V="html"===k?"div":"p",A=d({"gp-product-description":!0,[I?.cssClass]:!0}),D=d(f({setting:S,isLiquid:!0})),G=d(x({setting:S})),_=d({"gp-show-more-text":!0}),q=d({"gp-show-more-icon gp-ml-1":!0}),H=l({...h({setting:S,renderMaxHeight:!0}),...e("line-clamp",t(S?.lineClamp,S?.hasLineClamp))}),N=d(w()),O=l(C({setting:S})),R=c({"data-id":`${L?.uid}`}),z=c({"data-gp-text":""}),{textDescriptionCss:B,gpDescriptionCss:F}=y(),J="product.description == blank",K=p({val:E,uid:L?.uid,settingId:a({id:j?.viewMoreText?.id}),pageContext:T??{}}),Q=p({val:P,uid:L?.uid,settingId:a({id:j?.viewLessText?.id}),pageContext:T??{}}),U=m({setting:{lineClamp:S?.lineClamp,hasLineClamp:S?.hasLineClamp,viewMoreText:K,viewLessText:Q,enableViewMoreIcon:S?.enableViewMoreIcon},textStyle:H});return u(J,"",$(i`
|
|
2
2
|
<gp-product-description
|
|
3
3
|
${R}
|
|
4
4
|
class="${A}"
|
|
5
|
-
gp-data='${s(U).replaceAll("'","
|
|
5
|
+
gp-data='${s(U).replaceAll("'","\\u0027")}'
|
|
6
6
|
data-view-more-text="${K}"
|
|
7
7
|
data-view-less-text="${Q}"
|
|
8
8
|
>
|
|
9
|
-
<style>${B}</style>
|
|
10
|
-
<style>${F}</style>
|
|
9
|
+
<style>${B}${F}</style>
|
|
11
10
|
<div class="${N}" ></div>
|
|
12
11
|
${g("product","<p>Product not found</p>",i`<${V} ${z} class="${D}" style="${H}">
|
|
13
12
|
{{product.description}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useRef as e,useState as t,useCallback as r,useEffect as
|
|
1
|
+
import{useRef as e,useState as t,useCallback as r,useEffect as i}from"react";import{useProduct as n,useCurrentDevice as l,getResponsiveValueByScreen as o,useProductShopifyEditLink as s,useEditorMode as m}from"@gem-sdk/core";let c=c=>{let{htmlTag:a,transform:u,typo:p,typography:y}=c??{},g=e(null),H=e(!1),[d,f]=t(!1),[w,h]=t(!1),x=n(),O=l(),P=o(c?.hasLineClamp,O),S=o(c?.lineClamp,O),v=o(p?.custom?.lineHeight,O),J=JSON.stringify(p),N=JSON.stringify(y),b=JSON.stringify(u),{redirectProductShopifyLink:A}=s(),C=m(),F=r(()=>{if(!g.current)return;let e=!d;H.current=e,g.current.style.maxHeight=e?"none":"",f(e)},[d]);return i(()=>{H.current=!1,f(!1)},[P,S,x?.descriptionHtml]),i(()=>{let e=g.current;if(!e)return;if(!P||!x?.descriptionHtml||!S){e.style.maxHeight="",h(!1);return}let t=()=>{if(H.current){e.style.maxHeight="none";return}e.style.maxHeight="";let t=e.style.getPropertyValue("--line-clamp");e.style.setProperty("--line-clamp",String(S));let r=e.scrollHeight-e.clientHeight>1;""!==t?e.style.setProperty("--line-clamp",t):e.style.removeProperty("--line-clamp"),h(r)},r=window.requestAnimationFrame(t),i=window.setTimeout(t,100),n=new ResizeObserver(()=>{t()});return n.observe(e),()=>{window.cancelAnimationFrame(r),window.clearTimeout(i),n.disconnect()}},[P,S,x?.descriptionHtml,v,a,b,J,N]),{ref:g,open:d,isShowViewMore:w,handleToggleShowMore:F,mode:C,redirectProductShopifyLink:A}};export{c as useGpDescription};
|
|
@@ -1,44 +1,46 @@
|
|
|
1
|
-
import{isLocalEnv as e,baseAssetURL as o,template as r,WrapRenderChildren as
|
|
1
|
+
import{isLocalEnv as e,baseAssetURL as o,template as r,WrapRenderChildren as t,RenderChildren as s}from"@gem-sdk/core";import{getConditionRenderGalleryImages as i,getStyleInsideLayout as a,setDefaultWhenUndefineSetting as p,getProductBadgeVisibilityStyle as l}from"./common/common.js";import d from"./components/feature-gallery/FeatureImageWithGallery.liquid.js";import m from"./components/gallery-carousel/GalleryCarousel.liquid.js";import c from"./components/gallery-grid/GalleryGrid.liquid.js";import{filterPageContext as u,getSettingPreloadData as n}from"../../../helpers.js";import{getShapeByLayout as g,sizeSettingDefaultForNewLayout as f}from"./common/productGallery.js";import{getProductImagesClassName as $}from"./composables/getProductImagesClassName.js";import{getProductImagesStyles as y}from"./composables/getProductImagesStyles.js";import{createAttr as h,LiquidIf as v,createClass as S,If as j,Liquid as F}from"@gem-sdk/system";import{getBorderActiveCss as I}from"./common/getBorderActiveCss.js";import{getStyleOfObject as C}from"../../helpers/function.js";let P=P=>{let G=p(P),{setting:D,styles:b,builderProps:z,style:O}=G,{rawChildren:_,pageContext:N}=P,{enableLazyLoadImage:A}=N??{},B={...D,...b},U=`
|
|
2
2
|
{
|
|
3
|
-
"id":${JSON.stringify(
|
|
4
|
-
"pageContext": ${JSON.stringify(
|
|
5
|
-
"setting":${JSON.stringify(
|
|
6
|
-
"styles":${JSON.stringify(
|
|
3
|
+
"id":${JSON.stringify(z?.uid)},
|
|
4
|
+
"pageContext": ${JSON.stringify(u(N))},
|
|
5
|
+
"setting":${JSON.stringify(D)},
|
|
6
|
+
"styles":${JSON.stringify(b)},
|
|
7
7
|
"productUrl":{{product.url | json | escape}},
|
|
8
8
|
"product":{{product | json | escape}},
|
|
9
9
|
"collectionUrl": {{ collection.url | json | escape }},
|
|
10
10
|
"collection": {{ collection | json | escape}}
|
|
11
11
|
}
|
|
12
|
-
`,
|
|
13
|
-
${
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
`,k=h({"section-id":"{{section.id}}","data-id":`${z?.uid}`}),{isOnlyFeatureAllDevices:q,isRenderGalleryGrid:E}=i(B?.position,D?.type),J=E?{}:h({"data-only-image":v("product.media.size > 1","false","true")}),{wrapperClasses:w,productImagesGalleryClasses:T}=$(P),x=S({"gp-grid gp-w-full !gp-m-0 gp-relative":!0}),L=S({"gp-w-full !gp-m-0 gp-relative":!0}),{wrapContainerStyle:M,wrapContainerStyleOnlyOneImage:R,galleryImageStyle:V}=y(B),W=g({shape:B.shape,shapeForBottom:B.shapeForBottom,shapeFor1Col:B.shapeFor1Col,shapeFor2Col:B.shapeFor2Col,shapeForFtOnly:B.shapeForFtOnly,shapeForInsideBottom:B.shapeForInsideBottom??f,shapeForInside:B.shapeForInside??f},B.position),H=a(B.position,W,B?.spacing),K=e=>{let o=l(B?.position,e);return r`
|
|
13
|
+
<div style="${C(o)}">
|
|
14
|
+
${t({uid:z?.uid||"",customProps:_?.[0].customProps},_?.map(e=>{if(e)return r`${s({...e,isInsideProductImage:!0,imageData:{imageShape:b?.ftShape,imageAlign:b?.align,imageLayout:b?.position},dotData:{dotSize:D?.ftDotSize,dotGapToCarousel:D?.ftDotGapToCarousel,dotStyle:D?.ftDotStyle}})}`}))}
|
|
15
|
+
</div>
|
|
16
|
+
`};return r`
|
|
17
|
+
${j(D?.borderActive?.border!=="none",v("product.media.size > 1",`<style>${I({settings:B,uid:z?.uid,type:"Liquid"})}</style>`),"")}
|
|
18
|
+
${F(`
|
|
17
19
|
{% assign featured_image = product.featured_image %}
|
|
18
|
-
${
|
|
20
|
+
${v("variant != null and variant.featured_image != null","{% assign featured_image = variant.featured_image %}")}
|
|
19
21
|
`)}
|
|
20
22
|
<gp-product-images-v3
|
|
21
|
-
gp-data='${
|
|
22
|
-
${{...
|
|
23
|
-
style="${{...
|
|
24
|
-
class="${
|
|
23
|
+
gp-data='${U}'
|
|
24
|
+
${{...k}}
|
|
25
|
+
style="${{...O}}"
|
|
26
|
+
class="${w}"
|
|
25
27
|
>
|
|
26
28
|
<div
|
|
27
|
-
class="${
|
|
28
|
-
style="${
|
|
29
|
+
class="${v("product.media.size > 1",`${x}`,`${L}`)}"
|
|
30
|
+
style="${v("product.media.size > 1",C(M),C(R))}"
|
|
29
31
|
>
|
|
30
|
-
${
|
|
31
|
-
${
|
|
32
|
+
${d({builderPropUID:`gp-carousel-${z?.uid}`,...B,children:K("feature"),enableLazyLoadImage:A})}
|
|
33
|
+
${j(!q,r`
|
|
32
34
|
<div
|
|
33
|
-
class="${
|
|
34
|
-
style="${
|
|
35
|
-
${{...
|
|
35
|
+
class="${T}"
|
|
36
|
+
style="${C(V)}"
|
|
37
|
+
${{...J}}
|
|
36
38
|
>
|
|
37
|
-
${
|
|
38
|
-
${
|
|
39
|
+
${v("product.media.size > 1",m({builderPropUID:`gp-gallery-${z?.uid}`,...B,enableLazyLoadImage:A}))}
|
|
40
|
+
${j(E,c({builderPropUID:z?.uid,wrapperStyle:{...H},children:K("grid"),...B,enableLazyLoadImage:A}))}
|
|
39
41
|
</div>
|
|
40
42
|
`)}
|
|
41
43
|
</div>
|
|
42
44
|
</gp-product-images-v3>
|
|
43
|
-
${
|
|
44
|
-
`};export{
|
|
45
|
+
${j(e,`<script ${n('class="gps-link" delay',"src")}="{{ 'gp-product-images-v3-v7-5.js' | asset_url }}" defer="defer"></script>`,`<script ${n('class="gps-link" delay',"src")}="${o}/assets-v2/gp-product-images-v3-v7-5.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}" defer="defer"></script>`)}
|
|
46
|
+
`};export{P as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{DEVICES as e,getResponsiveValueByScreen as l}from"@gem-sdk/core";function t(e){return e.split(" ").reduce((e,l)=>(e[l]=!0,e),{})}let r=({extraClass:e,isAddOverFlowClass:l=!1})=>{let r="gp-relative gp-w-full";return e&&(r+=` ${e}`),l&&(r+=" gp-overflow-hidden"),t(r)},g=({extraClass:e})=>{let l="gallery-wrapper gp-product-images-gallery gp-flex gp-overflow-hidden gp-max-w-full gp-max-h-full data-[only-image=true]:gp-hidden";return e&&(l+=` ${e}`),t(l)},p=({extraClass:e})=>{let l="product-feature-image grid-gallery gp-flex !gp-h-fit gp-w-full gp-flex-wrap scrollbar-track:gp-rounded-2xl scrollbar-thumb:gp-rounded-2xl scrollbar-thumb:gp-bg-gray-400 gp-z-1";return e&&(l+=` ${e}`),t(l)},a=({extraClass:e})=>{let l="gp-flex !gp-h-fit gp-relative gp-overflow-hidden";return e&&(l+=` ${e}`),t(l)},s=({extraClass:e})=>{let l="gp-flex gp-h-fit gp-max-w-full gp-overflow-hidden";return e&&(l+=` ${e}`),t(l)},i=({extraClass:e})=>{let l="`gp-flex-1 gp-w-full gp-feature-image-carousel";return e&&(l+=` ${e}`),t(l)},o=({setting:r,extraClass:g})=>{let p=g??"";return e.forEach(e=>{let t=l(r?.ftNavigationPosition,e),g="desktop"!==e?`${e}:`:"";"outside"===t?p+=` ${g}gp-px-[16px]`:p+=` ${g}gp-px-0`}),t(p)},u=({settings:r,extraClass:g})=>{let p=g??"gp-flex-1 gp-w-full carousel-gallery";return e.forEach(e=>{let t=l(r?.navigationPosition,e),g=l(r?.type,e),a=l(r?.position,e),s="desktop"!==e?`${e}:`:"";"outside"===t&&"slider"===g&&["bottom-center"].includes(a||"")?p+=` ${s}gp-px-[16px]`:p+=` ${s}gp-px-0`}),t(p)},f=({extraClass:e})=>{let l="gp-image-item gp-flex gp-items-center gp-justify-center gp-group gp-relative gp-overflow-hidden gp-cursor-pointer";return e&&(l+=` ${e}`),t(l)},n=({extraClass:e})=>{let l="gp-group gp-z-0 gp-flex !gp-min-w-full !gp-max-w-full gp-w-full gp-relative gp-items-start gp-justify-center gp-overflow-hidden gp-outline-1 -gp-outline-offset-1 gp-image-item gp-ft-image-item data-[outline=active]:gp-outline";return e&&(l+=` ${e}`),t(l)};export{n as getFeaturedCarouselItemClasses,i as getFeaturedImageCarouselClasses,o as getFeaturedImageClasses,u as getFeaturedImageGalleryClasses,a as getFtImageWithGalleryClasses,p as getGalleryGridWrapperClasses,f as getGalleryItemClasses,g as getGalleryWrapperClasses,s as getImageGalleryWrapperClasses,r as getWrapperClasses};
|
|
1
|
+
import{DEVICES as e,getResponsiveValueByScreen as l}from"@gem-sdk/core";function t(e){return e.split(" ").reduce((e,l)=>(e[l]=!0,e),{})}let r=({extraClass:e,isAddOverFlowClass:l=!1})=>{let r="gp-relative gp-w-full";return e&&(r+=` ${e}`),l&&(r+=" gp-overflow-hidden"),t(r)},g=({extraClass:e})=>{let l="gallery-wrapper gp-product-images-gallery gp-flex gp-overflow-hidden gp-max-w-full gp-max-h-full data-[only-image=true]:gp-hidden";return e&&(l+=` ${e}`),t(l)},p=({extraClass:e})=>{let l="product-feature-image grid-gallery gp-flex !gp-h-fit gp-w-full gp-flex-wrap scrollbar-track:gp-rounded-2xl scrollbar-thumb:gp-rounded-2xl scrollbar-thumb:gp-bg-gray-400 gp-z-1";return e&&(l+=` ${e}`),t(l)},a=({extraClass:e})=>{let l="gp-flex !gp-h-fit gp-relative gp-overflow-hidden";return e&&(l+=` ${e}`),t(l)},s=({extraClass:e})=>{let l="gp-flex gp-h-fit gp-max-w-full gp-overflow-hidden";return e&&(l+=` ${e}`),t(l)},i=({extraClass:e})=>{let l="`gp-flex-1 gp-w-full gp-feature-image-carousel";return e&&(l+=` ${e}`),t(l)},o=({setting:r,extraClass:g})=>{let p=g??"";return e.forEach(e=>{let t=l(r?.ftNavigationPosition,e),g="desktop"!==e?`${e}:`:"";"outside"===t?p+=` ${g}gp-px-[16px]`:p+=` ${g}gp-px-0`}),t(p)},u=({settings:r,extraClass:g})=>{let p=g??"gp-flex-1 gp-w-full carousel-gallery";return e.forEach(e=>{let t=l(r?.navigationPosition,e),g=l(r?.type,e),a=l(r?.position,e),s="desktop"!==e?`${e}:`:"";"outside"===t&&"slider"===g&&["bottom-center"].includes(a||"")?p+=` ${s}gp-px-[16px]`:p+=` ${s}gp-px-0`}),t(p)},f=({extraClass:e})=>{let l="gp-image-item gp-flex gp-items-center gp-justify-center gp-group gp-relative gp-overflow-hidden gp-cursor-pointer";return e&&(l+=` ${e}`),t(l)},n=({extraClass:e})=>{let l="gp-group gp-z-0 gp-flex !gp-min-w-full !gp-max-w-full gp-w-full gp-relative gp-items-start gp-justify-center gp-overflow-hidden gp-outline-1 -gp-outline-offset-1 gp-image-item gp-ft-image-item data-[outline=active]:gp-outline";return e&&(l+=` ${e}`),t(l)},d="gp-flex gp-items-center gp-justify-center";export{d as FEATURE_MEDIA_CENTER_CLASSES,n as getFeaturedCarouselItemClasses,i as getFeaturedImageCarouselClasses,o as getFeaturedImageClasses,u as getFeaturedImageGalleryClasses,a as getFtImageWithGalleryClasses,p as getGalleryGridWrapperClasses,f as getGalleryItemClasses,g as getGalleryWrapperClasses,s as getImageGalleryWrapperClasses,r as getWrapperClasses};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getResponsiveValueByScreen as e,makeAspectRatio as t,DEVICES as
|
|
1
|
+
import{getResponsiveValueByScreen as e,makeAspectRatio as t,DEVICES as o,makeStyleResponsive as l,removeNullUndefined as r}from"@gem-sdk/core";let i=["one-col","two-col"],a=e=>"one-col"===e||"two-col"===e,n=e=>{let t=e?.desktop,o=e?.tablet===void 0?t:e?.tablet,l=e?.mobile===void 0?o:e?.mobile;return{desktop:t,tablet:o,mobile:l}},s=(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)},d=e=>{if(!e)return{desktop:5};let t=s(e.desktop,5),o=s(e.tablet,t),l=s(e.mobile,o);return{desktop:t,tablet:o,mobile:l}},u=(e,t)=>{let o={};return["desktop","mobile","tablet"].forEach(l=>{o={...o,[`--d${"desktop"===l?"":`-${l}`}`]:`${e(l)?"none":t}`}}),o},b=e=>{let t=e?.["--radius"],o=e?.["--bblr"]||"0px",l=e?.["--bbrr"]||"0px",r=e?.["--btlr"]||"0px",i=e?.["--btrr"]||"0px";return t&&!t.toString().includes("none")&&"0"!==t.toString()||"0px"!==o||"0px"!==l||"0px"!==r||"0px"!==i},c=o=>{let l={};return["desktop","mobile","tablet"].forEach(t=>{let r=e(o,t)?.shapeValue;if(r)l={...l,[t]:r};else{let r=e(o,t)?.shape;switch(r){case"square":l={...l,[t]:"1/1"};break;case"vertical":l={...l,[t]:"3/4"};break;case"horizontal":l={...l,[t]:"4/3"};break;case"original":l={...l,[t]:""}}}}),t(l)},m=t=>{let l={"--gtc":"minmax(0, 12fr)","--gtc-tablet":"minmax(0, 12fr)","--gtc-mobile":"minmax(0, 12fr)"};if(!t.isHiddenGalleryImages){let r=!1;o.forEach(o=>{let i=e(t.position,o),a=e(t.ratioLayout,o),n=e(t.ratioLayoutRight,o),s="desktop"===o?"--gtc":`--gtc-${o}`,d="desktop"===o?"--gtr":`--gtr-${o}`,u="left"===i?a:n,b=["left","right"].includes(i||"");b&&u?(r=!0,Object.assign(l={...l,[s]:`minmax(0, ${u[0]}fr) minmax(0, ${u[1]}fr)`},{[d]:"fit-content(0)"})):r&&Object.assign(l,{[d]:"unset"})})}return l},g=t=>{let o={"--o":"0","--o-tablet":"0","--o-mobile":"0"};return["desktop","mobile","tablet"].forEach(l=>{let r=e(t.position,l),i="desktop"===l?"--o":`--o-${l}`;o={...o,[i]:"left"===r?"1":"0"}}),o},p=t=>{let o={"--o":"1","--o-tablet":"1","--o-mobile":"1"};return["desktop","mobile","tablet"].forEach(l=>{let r=e(t.position,l),i="desktop"===l?"--o":`--o-${l}`;o={...o,[i]:"left"===r?"0":"1"}}),o},f=e=>`{{${e} | image_url: width: 480}} 480w, {{${e} | image_url: width: 768}} 768w, {{${e} | image_url: width: 1024}} 1024w, {{${e} | image_url: width: 1440}} 1440w`,h=e=>{let t=parseInt(e)?`${2*parseInt(e)}px`:`${e} * 2`;return t},k=(t,o,a)=>{let n={},s={},d={},u={},b={},c={};return["desktop","mobile","tablet"].forEach(l=>{let r=e(t,l),m=e(o,l)?.width,g=e(a,l);if(n={...n,[l]:["inside-bottom","inside-left","inside-right"].includes(r)?"absolute":"static"},["inside-bottom"].includes(r)){let e=h(g);m=`calc(100% - ${e})`}["bottom-center",...i].includes(r)&&(m="100%"),d={...d,[l]:"inside-bottom"===r?`${g}`:"auto"},u={...u,[l]:["inside-left","inside-right"].includes(r)?`${g}`:"auto"},c={...c,[l]:["inside-bottom","inside-left"].includes(r)?`${g}`:"auto"},b={...b,[l]:"inside-right"===r?`${g}`:"auto"},s={...s,[l]:m}}),{...l("pos",n),...l("w",r(s)),...l("bottom",r(d)),...l("top",r(u)),...l("left",r(c)),...l("right",r(b))}},y=(t,o)=>{let l=!0,r=!1;return["desktop","mobile","tablet"].forEach(i=>{let n=e(t,i),s=e(o,i);n&&"only-feature"!==n&&(l=!1),(a(n)||"images"===s)&&(r=!0)}),{isOnlyFeatureAllDevices:l,isRenderGalleryGrid:r}},$=(t,o)=>{let l=e(t,o);return a(l)},x=(e,t="feature")=>{let r={desktop:"none",tablet:"none",mobile:"none"};return o.forEach(o=>{let l=$(e,o);r[o]=("grid"===t?l:!l)?"block":"none"}),l("d",r)},N=e=>({...e,setting:{...e.setting}}),S=e=>{let t=e.match(/\d+/g);return t?t[0]:e},w=t=>{let o=c(t),l={desktop:"auto",mobile:"auto",tablet:"auto"};return["desktop","mobile","tablet"].forEach(r=>{let i=e(t,r),a=i?.height,n=i?.width||"",s=S(a||""),d=n.toString().match(/px/g)?S(n):n;if(a&&n&&!isNaN(Number(s))&&!isNaN(Number(d))){l={...l,[r]:`${Number(s)/Number(d)*100}%`};return}if(a&&!isNaN(Number(s))){l={...l,[r]:a};return}let u=o?.[r]!=="auto"&&o?.[r]?o?.[r]?.split("/").reverse().join("/"):"{%if largestRatio == 0%} 100 / 100 {%else%} {{largestRatio}} {%endif%}";l={...l,[r]:`calc((${u})*100%)`}}),l},E=["only-feature",...i],v=t=>{let l={};return o.forEach(o=>{let r=e(t,o);l[o]=null==r||!E.includes(r)}),l};export{b as checkAddOverFlowClass,d as convertSpacing,h as convertSpacingForIndisdeLayout,s as convertUnitToNumber,c as getAspectRatio,y as getConditionRenderGalleryImages,u as getDisplayStyle,v as getGalleryCarouselShouldInitByLayout,w as getPaddingBottomByShapeSetting,x as getProductBadgeVisibilityStyle,f as getSrcImage,m as getStyleGridLayout,g as getStyleGridOrderForFeature,p as getStyleGridOrderForGallery,k as getStyleInsideLayout,n as getTypeWidthDevice,N as setDefaultWhenUndefineSetting};
|
package/dist/esm/product/components/product-images-v3/components/child/ProductFeatureVideo.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{memo as o,useMemo as r}from"react";import"@gem-sdk/core";import"next/link";import t from"../../../../../video/components/Video.js";import{FEATURE_MEDIA_CENTER_CLASSES as l}from"../../common/classes.js";var m=o(o=>{let{url:m,aspectRatio:i,thumbnail:s}=o,u=r(()=>m.includes("youtu.be")?"youtube":m.includes("vimeo")?"vimeo":"html5",[m]);return e("div",{className:`gp-w-full gp-h-full ${l}`,children:e(t,{setting:{type:u,html5Url:m,youtubeUrl:m,vimeoUrl:m,preload:!0,controls:!0,aspectRatio:i,poster:s?{src:s}:void 0},className:"gp-w-full"})})});export{m as default};
|
package/dist/esm/product/components/product-images-v3/components/child/ProductFeaturedImageOnly.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import{jsx as e,Fragment as t,jsxs as o}from"react/jsx-runtime";import{useProduct as r,useCurrentDevice as i,useShopStore as a,useRenderMode as c,getResponsiveValueByScreen as n,cls as s,makeStyle as h}from"@gem-sdk/core";import{memo as l,useMemo as f,useCallback as p}from"react";import m from"../../../../../image/components/NextImage.js";import g from"./MediaIcon.js";import{isFeatureMedia as d,getZoomImageClass as y,getZoomLenClass as u}from"../../common/productFeaturedImage.js";import v from"./ProductFeatureVideo.js";let E={src:"https://cdn.shopify.com/s/assets/no-image-2048-5e88c1b20e087fb7bbe9a3771824e743c244f437e4f8ba93bbf7b11b53f7824c_large.gif",id:"noImageError",width:480,height:480,alt:"no image",contentType:"IMAGE"};var T=l(({image:l,imageShowWhenHover:T,setting:w,aspectRatio:b})=>{var I;let x=r(),L=i(),j=a(e=>e.storefrontUrl),{isEditMode:N,isPreviewSharePageMode:O}=c(),k=f(()=>"none"!==n(w.ftClickOpenLightBox,L),[L,w.ftClickOpenLightBox]),R=f(()=>!N&&["VIDEO","EXTERNAL_VIDEO"].includes(l?.contentType||"")&&!k,[N,l?.contentType,k]),$=f(()=>l?{...l,src:R?l.src:d(l?.contentType)?l?.previewImage:l.src}:E,[l,R]),z=f(()=>{if(O)return"javascript:void(0)";if(!j)return"#";let e=new URL(j);return x?`${e.protocol}//${e.host}/products/${x.handle}`:"#"},[j,x,O]),A=f(()=>w?.hoverEffect!=="none"&&!d($?.contentType),[$?.contentType,w?.hoverEffect]),B=f(()=>w?.hoverEffect=="zoom"&&w?.zoomType=="glasses"&&!d($?.contentType),[$?.contentType,w?.hoverEffect,w?.zoomType]),C=p(e=>"IMAGE"!==e.contentType?e.previewImage:e.src,[]),F=f(()=>T?"other"!==w.hoverEffect?C($):C(T):E.src,[T,$,w.hoverEffect,C]);return e(t,{children:(I=e(t,{children:R?e(v,{type:$?.contentType,url:$.src??"",aspectRatio:b}):o(t,{children:[e(m,{draggable:"false",src:$.src,width:$?.width,height:$?.height,alt:$?.alt,setting:{aspectRatio:b,layout:w?.ftLayout},priority:w?.preload,className:"featured-image-only",style:{width:"100%",height:"100%",cursor:"pointer"}}),e(g,{contentType:$?.contentType??""}),A&&e(m,{draggable:"false",src:F,width:w?.hoverEffect==="other"?T?.width:$.width,height:w?.hoverEffect==="other"?T?.height:$.height,alt:w?.hoverEffect==="other"?T?.alt:$.alt,setting:{layout:w.ftLayout,aspectRatio:b},style:{width:"100%",height:"100%"},className:s("hover-image featured-image-only !gp-max-w-none",y()),priority:w?.preload}),B&&e("div",{className:s(u(),"room-len"),style:{...h({bgi:`url("${$?.src}")`})}})]})}),"product-link"===n(w.ftClickOpenLightBox,L)?e("a",{title:x?.title,href:z,className:"gp-w-full",children:I}):I)})});export{T as default};
|
|
2
|
+
import{jsx as e,Fragment as t,jsxs as o}from"react/jsx-runtime";import{useProduct as r,useCurrentDevice as i,useShopStore as a,useRenderMode as c,getResponsiveValueByScreen as n,cls as s,makeStyle as h}from"@gem-sdk/core";import{memo as l,useMemo as f,useCallback as p}from"react";import m from"../../../../../image/components/NextImage.js";import g from"./MediaIcon.js";import{isFeatureMedia as d,getZoomImageClass as y,getZoomLenClass as u}from"../../common/productFeaturedImage.js";import v from"./ProductFeatureVideo.js";let E={src:"https://cdn.shopify.com/s/assets/no-image-2048-5e88c1b20e087fb7bbe9a3771824e743c244f437e4f8ba93bbf7b11b53f7824c_large.gif",id:"noImageError",width:480,height:480,alt:"no image",contentType:"IMAGE"};var T=l(({image:l,imageShowWhenHover:T,setting:w,aspectRatio:b})=>{var I;let x=r(),L=i(),j=a(e=>e.storefrontUrl),{isEditMode:N,isPreviewSharePageMode:O}=c(),k=f(()=>"none"!==n(w.ftClickOpenLightBox,L),[L,w.ftClickOpenLightBox]),R=f(()=>!N&&["VIDEO","EXTERNAL_VIDEO"].includes(l?.contentType||"")&&!k,[N,l?.contentType,k]),$=f(()=>l?{...l,src:R?l.src:d(l?.contentType)?l?.previewImage:l.src}:E,[l,R]),z=f(()=>{if(O)return"javascript:void(0)";if(!j)return"#";let e=new URL(j);return x?`${e.protocol}//${e.host}/products/${x.handle}`:"#"},[j,x,O]),A=f(()=>w?.hoverEffect!=="none"&&!d($?.contentType),[$?.contentType,w?.hoverEffect]),B=f(()=>w?.hoverEffect=="zoom"&&w?.zoomType=="glasses"&&!d($?.contentType),[$?.contentType,w?.hoverEffect,w?.zoomType]),C=p(e=>"IMAGE"!==e.contentType?e.previewImage:e.src,[]),F=f(()=>T?"other"!==w.hoverEffect?C($):C(T):E.src,[T,$,w.hoverEffect,C]);return e(t,{children:(I=e(t,{children:R?e(v,{type:$?.contentType,url:$.src??"",thumbnail:$?.previewImage,aspectRatio:b}):o(t,{children:[e(m,{draggable:"false",src:$.src,width:$?.width,height:$?.height,alt:$?.alt,setting:{aspectRatio:b,layout:w?.ftLayout},priority:w?.preload,className:"featured-image-only",style:{width:"100%",height:"100%",cursor:"pointer"}}),e(g,{contentType:$?.contentType??""}),A&&e(m,{draggable:"false",src:F,width:w?.hoverEffect==="other"?T?.width:$.width,height:w?.hoverEffect==="other"?T?.height:$.height,alt:w?.hoverEffect==="other"?T?.alt:$.alt,setting:{layout:w.ftLayout,aspectRatio:b},style:{width:"100%",height:"100%"},className:s("hover-image featured-image-only !gp-max-w-none",y()),priority:w?.preload}),B&&e("div",{className:s(u(),"room-len"),style:{...h({bgi:`url("${$?.src}")`})}})]})}),"product-link"===n(w.ftClickOpenLightBox,L)?e("a",{title:x?.title,href:z,className:"gp-w-full",children:I}):I)})});export{T as default};
|
package/dist/esm/product/components/product-images-v3/components/child/ProductGalleryGrid.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as e,Fragment as o,jsxs as t}from"react/jsx-runtime";import{useCurrentDevice as r,
|
|
2
|
-
${
|
|
1
|
+
import{jsx as e,Fragment as o,jsxs as t}from"react/jsx-runtime";import{useCurrentDevice as r,useRenderMode as i,getResponsiveValueByScreen as a,cls as m,makeStyle as l}from"@gem-sdk/core";import{memo as c}from"react";import{getAspectRatio as s}from"../../common/common.js";import n from"../../../../../image/components/NextImage.js";import d from"../lightbox/ButtonOpenLightBox.js";import p from"./MediaIcon.js";import g from"./ProductFeatureVideo.js";import{isFeatureMedia as h,getZoomImageClass as y,getZoomLenClass as u}from"../../common/productFeaturedImage.js";import{handleMouseOut as f,handleMouseMove as v}from"../../common/hoverAction.js";import{getProductImagesClassName as j}from"../../composables/getProductImagesClassName.js";import{getProductImagesStyles as T}from"../../composables/getProductImagesStyles.js";import{useProductGalleryGrid as w}from"../../hooks/useProductGalleryGrid.js";var I=c(c=>{let{builderPropUID:I,productImages:E,onHandleClick:b,activeIndexFromFeatureImage:x,children:N,isHiddenInteraction:O,...P}=c,{isDisplay:k,shapeByLayout:G,imageActiveIndex:M,enableOpenLightBox:R,isEnableBorderActive:$,filteredProductImages:z}=w(c),A=r(),{isEditMode:B}=i(),H=["one-col","two-col"].includes(a(P.position,A)||""),{galleryGridWrapperClasses:L,galleryItemClasses:V}=j(P),{galleryGridStyles:Z,galleryGridItemStyles:C}=T(P);return e(o,{children:k&&t("div",{"data-slot":"children","data-id":I,className:L,style:Z,"gp-data-hidden":`${O}`,children:[z?.map((r,i)=>{let c=i===M,j=h(r.contentType)?r.previewImage:r.src,T=!B&&H&&!R&&["VIDEO","EXTERNAL_VIDEO"].includes(r?.contentType||"");return t("div",{"aria-hidden":!0,className:V(`gp-gallery-image-item gem-slider-item-${I}
|
|
2
|
+
${c&&$?"gem-slider-item-active":""}`),onClick:()=>b(r?.id||"",R),style:C,onMouseMove:e=>v(e,{hoverEffect:P.galleryHoverEffect,zoom:P.galleryZoom,zoomType:P.galleryZoomType}),onMouseOut:e=>f(e),"data-border":c&&P?.borderActive?"active":"deactive",children:[T?e(g,{type:r?.contentType,url:r?.src??"",thumbnail:r?.previewImage,aspectRatio:s(G)}):t(o,{children:[e(n,{src:j,width:r?.width,height:r?.height,alt:r?.alt,setting:{aspectRatio:s(G),layout:P?.layout},style:{width:"100%",height:"100%"}},r?.id),e(p,{contentType:r?.contentType||""})]}),P?.galleryHoverEffect!=="none"&&!h(r?.contentType)&&e(n,{src:j,width:r?.width,height:r?.height,alt:r?.alt,setting:{layout:P.layout,aspectRatio:s(G)},className:m("hover-image !gp-max-w-none",y())}),P?.galleryHoverEffect=="zoom"&&P?.galleryZoomType=="glasses"&&["one-col","two-col"].includes(a(P.position,A)||"")&&!h(r?.contentType)&&e("div",{className:m(u(),"room-len"),style:{...l({bgi:`url("${r?.src}")`})}}),a(P?.clickOpenLightBox,A)&&e(d,{})]},r?.id)}),N]})})});export{I as default};
|
|
@@ -1,70 +1,70 @@
|
|
|
1
|
-
import{makeStyleResponsive as e,cls as a,template as i}from"@gem-sdk/core";import{getAspectRatio as t,getPaddingBottomByShapeSetting as r,getSrcImage as s}from"../../common/common.js";import{checkRenderFeaturedCarousel as d,getZoomImageClass as o,getZoomLenClass as u,getVideoHeight as m}from"../../common/productFeaturedImage.js";import l from"../../../../../video/components/HTML5Embed.liquid.js";import
|
|
1
|
+
import{makeStyleResponsive as e,cls as a,template as i}from"@gem-sdk/core";import{getAspectRatio as t,getPaddingBottomByShapeSetting as r,getSrcImage as s}from"../../common/common.js";import{checkRenderFeaturedCarousel as d,getZoomImageClass as o,getZoomLenClass as u,getVideoHeight as m}from"../../common/productFeaturedImage.js";import{FEATURE_MEDIA_CENTER_CLASSES as l}from"../../common/classes.js";import p from"../../../../../video/components/HTML5Embed.liquid.js";import g from"../../../../../image/components/Modal3d.liquid.js";import n from"../../../../../image/components/NextImage.liquid.js";import c from"../../../../../image/components/Video.liquid.js";import{getStyleOfObject as f}from"../../../../helpers/function.js";import{getProductImagesStyles as h}from"../../composables/getProductImagesStyles.js";import{getProductImagesClassName as y}from"../../composables/getProductImagesClassName.js";import{getProductImagesAttr as M}from"../../composables/getProductImagesAttr.js";import{If as _,LiquidIf as w,LiquidFor as v,Liquid as b,createStyle as $}from"@gem-sdk/system";import I from"../../../../../carousel-v3/components/root/Carousel.liquid.js";import x from"../../../../../carousel-v3/components/item/CarouselItem.liquid.js";let q=({builderPropUID:q,children:S,enableLazyLoadImage:z,...j})=>{let{featuredImageCarouselClasses:L,galleryItemClasses:P,featuredCarouselItemClasses:R}=y({...j,builderProps:{uid:q}}),{featuredImageCarouselStyle:T,featureImageStyle:W,featureImageCarouselOnlyOneImageStyle:C,featureImageOnlyOneImageStyle:N,featureImageCarouselItemStyle:k}=h(j),{featuredImageCarouselSettingAttrs:E}=M(j),O=t(j.ftShape),A=_("other"==j.hoverEffect,w("product.media.size > 1","group-hover:gp-opacity-0")),D=()=>`
|
|
2
2
|
{% case featureMedia.media_type %}
|
|
3
3
|
{% when 'image' %}
|
|
4
|
-
${
|
|
4
|
+
${B()}
|
|
5
5
|
{% when 'external_video' %}
|
|
6
6
|
{% assign mediaSourceVideo = featureMedia | external_video_url %}
|
|
7
|
-
${
|
|
7
|
+
${H()}
|
|
8
8
|
{% when 'video' %}
|
|
9
9
|
{% assign mediaSourceVideo = featureMedia.sources.last.url %}
|
|
10
|
-
${
|
|
10
|
+
${F()}
|
|
11
11
|
{% when 'model' %}
|
|
12
|
-
${
|
|
12
|
+
${V()}
|
|
13
13
|
{% else %}
|
|
14
|
-
${
|
|
14
|
+
${J()}
|
|
15
15
|
{% endcase %}
|
|
16
|
-
`,
|
|
17
|
-
${
|
|
18
|
-
${
|
|
19
|
-
${
|
|
16
|
+
`,V=()=>g({src:w("featureMedia.sources.first.url contains '.glb'","{{ featureMedia.sources.first.url }}","{{featureMedia.sources.last.url}}"),alt:"{{featureMedia.preview_image.alt}}",poster:"{{featureMedia.preview_image.src | product_img_url: '1024x1024'}}",cameraControls:!0,arStatus:"not-presenting",style:{width:"100%"},aspectRatio:O}),H=()=>c({src:"{{mediaSourceVideo}}",alt:"{{featureMedia.alt | escape}}",autoplay:!1,allowfullscreen:!0,controls:!0,style:{width:"100%",height:"100%"},aspectRatio:O}),F=()=>{let a=$({...m({ftLayout:j?.ftLayout,ftShape:j?.ftShape}),...e("objf",j?.ftLayout)}),i=$({...m({ftLayout:j?.ftLayout,ftShape:j?.ftShape})});return p({src:"{{mediaSourceVideo}}",title:"{{featureMedia.alt | escape}}",autoplay:!1,controls:!0,thumbnail:"{{featureMedia.preview_image.src | product_img_url: '1024x1024'}}",isCheckLoaded:!0,wrapperStyles:i,poster:{altText:"{{featureMedia.alt | escape}}"},style:{width:"100%","max-height":"100%",...a},className:"gp-invisible"})},B=()=>i`
|
|
17
|
+
${G(a("gp-w-full gp-transition-opacity",A,"{{shouldHidden}}"))}
|
|
18
|
+
${_(j?.hoverEffect!=="none",`<div class="${a("zoom-element !gp-max-w-none",o())}">
|
|
19
|
+
${G("image-zoom",!0)}
|
|
20
20
|
</div>`," ")}
|
|
21
|
-
${
|
|
22
|
-
`,
|
|
21
|
+
${_(j?.hoverEffect=="zoom"&&j?.zoomType=="glasses",`<div class="${a("zoom-lens-element",u())}" style="opacity: 0; background-image: url('{{ featureMedia.src | img_url: "1024x1024"}}')"></div>`," ")}
|
|
22
|
+
`,G=(e,a)=>i`
|
|
23
23
|
{% assign src = featureMedia.src %}
|
|
24
|
-
${
|
|
25
|
-
{% assign other_image_index = ${
|
|
24
|
+
${_(a&&"other"==j.hoverEffect,`{% assign media_length = product.media | size %}
|
|
25
|
+
{% assign other_image_index = ${j.otherImage} | plus: 0 %}
|
|
26
26
|
{% if other_image_index >= media_length %}
|
|
27
27
|
{% assign other_image_index = media_length | minus: 1 %}
|
|
28
28
|
{% endif %}
|
|
29
29
|
{% assign otherImage = product.media[other_image_index] %}
|
|
30
|
-
${
|
|
30
|
+
${w("otherImage.media_type != 'image'","{% assign src = otherImage.preview_image.src %}","{% assign src = otherImage.src %}")}
|
|
31
31
|
`)}
|
|
32
|
-
${
|
|
33
|
-
${
|
|
34
|
-
${
|
|
35
|
-
${
|
|
32
|
+
${n({srcIsLiquidCode:!0,src:w("src != null",s("src"),"https://cdn.shopify.com/s/assets/no-image-2048-5e88c1b20e087fb7bbe9a3771824e743c244f437e4f8ba93bbf7b11b53f7824c_large.gif"),id:w("featureMedia != null","{{featureMedia.id}}"),width:"{{featureMedia.width}}",height:"{{featureMedia.height}}",alt:"{{featureMedia.alt | escape}}",srcset:`${s("src")}`,baseSrc:"{{src | image_url}}",sizes:"(max-width: 768px) 50vw, 100vw",setting:{layout:j?.ftLayout,aspectRatio:O,qualityType:j?.qualityType,qualityPercent:j?.qualityPercent},priority:j?.preload,className:`gp-w-full gp-h-full gp-absolute gp-top-0 gp-left-0 featured-image-only gp-cursor-pointer !gp-rounded-none ${e??""}`,enableLazyLoadImage:z})}`,J=()=>i`
|
|
33
|
+
${n({srcIsLiquidCode:!0,src:"https://cdn.shopify.com/s/assets/no-image-2048-5e88c1b20e087fb7bbe9a3771824e743c244f437e4f8ba93bbf7b11b53f7824c_large.gif",alt:"No Image",sizes:"(max-width: 768px) 50vw, 100vw",setting:{layout:j?.ftLayout,aspectRatio:O,qualityType:j?.qualityType,qualityPercent:j?.qualityPercent},priority:j?.preload,className:"gp-w-full gp-h-full gp-absolute gp-top-0 gp-left-0 featured-image-only gp-cursor-pointer !gp-rounded-none",enableLazyLoadImage:z})}`,K=r(j.ftShape),Q=d(j),U="gp-featured-image-wrapper",X=w("product.media.size > 0",`{% assign largestRatio = 0 %}
|
|
34
|
+
${v("featureMedia in product.media",`
|
|
35
|
+
${w("featureMedia.media_type == 'video' and featureMedia.preview_image",`{% assign height = featureMedia.preview_image.height | times: 1.0 %}
|
|
36
36
|
{% assign width = featureMedia.preview_image.width | times: 1.0 %}`,`{% assign height = featureMedia.height | times: 1.0 %}
|
|
37
37
|
{% assign width = featureMedia.width | times: 1.0 %}`)}
|
|
38
38
|
{% assign ratio = height | divided_by: width %}
|
|
39
|
-
${
|
|
39
|
+
${w("ratio > largestRatio","{% assign largestRatio = ratio %}")}
|
|
40
40
|
`)}
|
|
41
|
-
${
|
|
41
|
+
${v("featureMedia in product.media",`${w("featureMedia.media_type == 'image'",`${v("image in product.images",w("image.src == featureMedia.src","{% assign imageID = image.id %}{% break %}"))}`,"{% assign imageID = '' %}")}
|
|
42
42
|
|
|
43
|
-
${
|
|
43
|
+
${b(`{% assign productImageWidth = 0 %}
|
|
44
44
|
{% case featureMedia.media_type %}
|
|
45
45
|
{% when 'image' %}
|
|
46
46
|
{% assign productImageWidth = featureMedia.width %}
|
|
47
47
|
{% else %}
|
|
48
48
|
{% assign productImageWidth = featureMedia.preview_image.width %}
|
|
49
49
|
{% endcase %}`)}
|
|
50
|
-
${
|
|
50
|
+
${x({id:"{{section.id}}-{{imageID}}",contentType:"productImage",className:`${P("gp-ft-image-item !gp-min-w-full !gp-max-w-full ")}`,parentId:`ft-${q}-{{section.id}}-{{product.id}}`,style:k,customStyle:{width:"{{productImageWidth}}px"},children:`
|
|
51
51
|
<div
|
|
52
|
-
class="gp-w-full gp-relative ${
|
|
53
|
-
style="${
|
|
52
|
+
class="gp-w-full gp-relative ${w("featureMedia == null or featureMedia.media_type == 'image'","{{ 'gp-h-0' }}","{{ 'gp-h-full !gp-pb-0' }}")} ${w("featureMedia.media_type == 'video' or featureMedia.media_type == 'external_video'",`{{ '${l}' }}`)}"
|
|
53
|
+
style="${f(e("pb",K))}"
|
|
54
54
|
>
|
|
55
|
-
${
|
|
55
|
+
${D()}
|
|
56
56
|
</div>
|
|
57
57
|
`})}`)}
|
|
58
|
-
`,
|
|
58
|
+
`,n({src:"https://cdn.shopify.com/s/assets/no-image-2048-5e88c1b20e087fb7bbe9a3771824e743c244f437e4f8ba93bbf7b11b53f7824c_large.gif",id:"noImageError",width:"480",height:"480",alt:"no image",priority:j?.preload,setting:{layout:j?.ftLayout,aspectRatio:O,qualityType:j?.qualityType,qualityPercent:j?.qualityPercent},style:{height:"100%"},className:"gp-w-full featured-image-only !gp-rounded-none",customLazyload:!0,enableLazyLoadImage:z}));return b(`
|
|
59
59
|
{% capture featureImageOnlyOne %}
|
|
60
|
-
${
|
|
60
|
+
${b(`
|
|
61
61
|
{% assign featureMedia = variant.featured_media %}
|
|
62
62
|
{% unless featureMedia %}
|
|
63
63
|
{% assign featureMedia = product.featured_media %}
|
|
64
64
|
{% endunless %}
|
|
65
|
-
${
|
|
65
|
+
${w("product.media.size > 1",(()=>{switch(j?.preDisplay){case"1st-images":return`
|
|
66
66
|
{% assign featureMedia = product.media.first %}
|
|
67
|
-
`;case"1st-3d-mode":return
|
|
67
|
+
`;case"1st-3d-mode":return v("media in product.media",w("media.media_type == 'model'","{% assign featureMedia = media %}{% break %}"));case"1st-video":return v("media in product.media",w("media.media_type == 'video' or media.media_type == 'external_video'","{% assign featureMedia = media %}{% break %}"));default:return`
|
|
68
68
|
{% assign featureMedia = variant.featured_media %}
|
|
69
69
|
{% unless featureMedia %}
|
|
70
70
|
{% assign featureMedia = product.featured_media %}
|
|
@@ -74,7 +74,7 @@ import{makeStyleResponsive as e,cls as a,template as i}from"@gem-sdk/core";impor
|
|
|
74
74
|
{% assign height = featureMedia.height | times: 1.0 %}
|
|
75
75
|
{% assign width = featureMedia.width | times: 1.0 %}
|
|
76
76
|
{% assign ratio = height | divided_by: width %}
|
|
77
|
-
${
|
|
77
|
+
${w("ratio > largestRatio","{% assign largestRatio = ratio %}")}
|
|
78
78
|
{% assign productImageWidth = 0 %}
|
|
79
79
|
{% case featureMedia.media_type %}
|
|
80
80
|
{% when 'image' %}
|
|
@@ -82,38 +82,38 @@ import{makeStyleResponsive as e,cls as a,template as i}from"@gem-sdk/core";impor
|
|
|
82
82
|
{% else %}
|
|
83
83
|
{% assign productImageWidth = featureMedia.preview_image.width %}
|
|
84
84
|
{% endcase %}
|
|
85
|
-
${
|
|
85
|
+
${w("featureMedia == null","{% assign productImageWidth = 1600 %}")}
|
|
86
86
|
<div
|
|
87
87
|
class='gp-feature-image-carousel gp-feature-image-only'
|
|
88
|
-
style="${
|
|
88
|
+
style="${f(W)}"
|
|
89
89
|
>
|
|
90
90
|
<div
|
|
91
91
|
class="gp-relative"
|
|
92
|
-
style="${
|
|
92
|
+
style="${f(N)}"
|
|
93
93
|
>
|
|
94
|
-
${
|
|
94
|
+
${S}
|
|
95
95
|
<div
|
|
96
96
|
type="gp-feature-image-only"
|
|
97
97
|
product-id="{{product.id}}"
|
|
98
98
|
product-media="{{product.media.size}}"
|
|
99
|
-
class="${
|
|
100
|
-
style="${
|
|
99
|
+
class="${R(U)}"
|
|
100
|
+
style="${f(C)}"
|
|
101
101
|
>
|
|
102
102
|
<div
|
|
103
|
-
class="gp-w-full gp-relative ${
|
|
104
|
-
style="${
|
|
103
|
+
class="gp-w-full gp-relative ${w("featureMedia == null or featureMedia.media_type == 'image'","{{ 'gp-h-0' }}","{{ 'gp-h-full !gp-pb-0' }}")}"
|
|
104
|
+
style="${f(e("pb",K))} ${w("featureMedia.media_type == 'video' or featureMedia.media_type == 'external_video'","{{ 'display: flex; align-items: center; justify-content: center' }}")}"
|
|
105
105
|
>
|
|
106
|
-
${
|
|
106
|
+
${D()}
|
|
107
107
|
</div>
|
|
108
108
|
</div>
|
|
109
109
|
</div>
|
|
110
110
|
</div>
|
|
111
111
|
`)}
|
|
112
112
|
{% endcapture %}
|
|
113
|
-
${
|
|
114
|
-
${
|
|
115
|
-
${
|
|
113
|
+
${w("product.media.size > 1",`
|
|
114
|
+
${_(Q,`
|
|
115
|
+
${I({builderProps:{uid:q},rootId:`ft-${q}-{{section.id}}-{{product.id}}`,conditionAppendJs:"product.media.size > 1",wrapperClass:U,rootClass:`${L}`,rootAttrs:{type:"gp-feature-image-carousel","product-id":"{{product.id}}","product-media":"{{product.media.size}}"},isHiddenArrowWhenDisabled:!0,setting:E,rootStyles:W,styles:T,style:{playSpeed:600},disableMarginAuto:!0,children:X,productBadgeLiquid:S||"",carouselType:"feature_image"})}
|
|
116
116
|
`," ")}
|
|
117
|
-
${
|
|
117
|
+
${_(!Q,"{{ featureImageOnlyOne }}"," ")}
|
|
118
118
|
`,"{{ featureImageOnlyOne }}")}
|
|
119
|
-
`)};export{
|
|
119
|
+
`)};export{q as default};
|