@gem-sdk/components 19.0.0-staging.8 → 19.1.0-dev.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/accordion/components/Accordion.liquid.js +4 -5
- package/dist/cjs/builder.js +1 -1
- package/dist/cjs/button/components/Button.liquid.js +15 -15
- package/dist/cjs/carousel/components/root/Carousel.liquid.js +5 -4
- package/dist/cjs/carousel-v3/common/selectors.js +1 -0
- 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/dot/common/helpers.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 +6 -5
- package/dist/cjs/carousel-v3/components/root/CarouselEmbla.liquid.js +24 -0
- package/dist/cjs/carousel-v3/components/root/common/attrs.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/cart/components/shop-pay-button/ShopPayButton.liquid.js +2 -2
- package/dist/cjs/collection/components/collection-description/CollectionDescription.liquid.js +7 -8
- package/dist/cjs/collection/components/collection-paginator/CollectionPaginator.liquid.js +4 -3
- package/dist/cjs/collection/components/collection-toolbar/CollectionToolbar.liquid.js +1 -1
- package/dist/cjs/countdown-timer/components/Countdown.liquid.js +16 -15
- package/dist/cjs/estimate-delivery/common/helpers.js +1 -1
- package/dist/cjs/grid/components/row/Row.liquid.js +16 -11
- 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/components/HeroBanner.js +1 -1
- package/dist/cjs/hero-banner/components/HeroBanner.liquid.js +11 -11
- package/dist/cjs/hero-banner/components/HeroBannerItem.js +1 -1
- package/dist/cjs/hero-banner/components/HeroBannerItem.liquid.js +9 -9
- package/dist/cjs/icon-list-v2/components/IconList.liquid.js +5 -5
- package/dist/cjs/image/common/attrs.js +1 -1
- package/dist/cjs/image/components/AdaptiveImage.js +1 -1
- package/dist/cjs/image/components/AdaptiveImage.liquid.js +8 -8
- package/dist/cjs/image/components/Image.liquid.js +10 -10
- package/dist/cjs/image/components/NextImage.js +1 -1
- package/dist/cjs/image/components/NextImage.liquid.js +2 -2
- package/dist/cjs/image/settings/configs/ui-v2.js +1 -1
- package/dist/cjs/image-comparison/components/CompareImage.liquid.js +11 -11
- package/dist/cjs/image-comparison/settings/configs/ui-v2.js +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/index.liquid.js +1 -1
- package/dist/cjs/marquee/components/Marquee.liquid.js +21 -21
- package/dist/cjs/post-purchase/product/components/ProductTitle.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/product/components/ProductImages.liquid.js +9 -9
- package/dist/cjs/product/components/dynamic-checkout/Button.liquid.js +9 -9
- package/dist/cjs/product/components/file-upload/UploadFile.liquid.js +2 -3
- package/dist/cjs/product/components/product-badge/ProductBadge.js +1 -1
- package/dist/cjs/product/components/product-badge/ProductBadge.liquid.js +15 -15
- package/dist/cjs/product/components/product-badge/common/classes.js +1 -1
- package/dist/cjs/product/components/product-badge/utils/renderBadgeILP.js +1 -1
- package/dist/cjs/product/components/product-badge/utils/renderBadgeLiquid.js +7 -5
- package/dist/cjs/product/components/product-bundle/ProductBundleDiscount.liquid.js +4 -3
- package/dist/cjs/product/components/product-button/ProductButton.liquid.js +8 -7
- 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 +3 -4
- package/dist/cjs/product/components/product-description/hooks/useGpDescription.js +1 -1
- package/dist/cjs/product/components/product-discount-tag/ProductDiscountTag.liquid.js +5 -5
- package/dist/cjs/product/components/product-images-v2/ProductImagesV2.liquid.js +19 -19
- package/dist/cjs/product/components/product-images-v2/components/feature-gallery/FeatureImageWithGallery.liquid.js +5 -5
- package/dist/cjs/product/components/product-images-v2/components/gallery-carousel/GalleryCarousel.liquid.js +1 -1
- package/dist/cjs/product/components/product-images-v2/components/gallery-grid/GalleryGrid.liquid.js +5 -5
- package/dist/cjs/product/components/product-images-v3/ProductImageV3.js +2 -2
- package/dist/cjs/product/components/product-images-v3/ProductImagesV3.liquid.js +19 -19
- package/dist/cjs/product/components/product-images-v3/ProductImagesV3Embla.liquid.js +44 -0
- 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/common/getBorderActiveCss.js +2 -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/ProductFeaturedImageCarousel.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 +1 -2
- package/dist/cjs/product/components/product-images-v3/components/feature-gallery/FeatureImageWithGallery.js +1 -1
- 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/feature-gallery/FeatureImageWithGalleryEmbla.liquid.js +119 -0
- package/dist/cjs/product/components/product-images-v3/components/feature-only/OnlyFeatureImage.js +1 -1
- package/dist/cjs/product/components/product-images-v3/components/gallery-carousel/GalleryCarousel.js +1 -1
- package/dist/cjs/product/components/product-images-v3/components/gallery-carousel/GalleryCarousel.liquid.js +3 -3
- package/dist/cjs/product/components/product-images-v3/components/gallery-carousel/GalleryCarouselEmbla.liquid.js +46 -0
- package/dist/cjs/product/components/product-images-v3/components/gallery-grid/GalleryGrid.liquid.js +10 -10
- package/dist/cjs/product/components/product-images-v3/components/lightbox/ProductImagesLightBox.js +1 -1
- package/dist/cjs/product/components/product-images-v3/hooks/useGalleryCarousel.js +1 -1
- package/dist/cjs/product/components/product-images-v3/hooks/useProductFeaturedImageCarousel.js +1 -1
- package/dist/cjs/product/components/product-images-v3/hooks/useProductGalleryGrid.js +1 -1
- package/dist/cjs/product/components/product-list/ProductList.js +1 -1
- package/dist/cjs/product/components/product-list/ProductList.liquid.js +10 -9
- package/dist/cjs/product/components/product-list/ProductListCarouselItem.liquid.js +5 -6
- package/dist/cjs/product/components/product-list/ProductListGridItem.liquid.js +7 -8
- package/dist/cjs/product/components/product-list/ProductListGridLayout.liquid.js +6 -4
- package/dist/cjs/product/components/product-list-v3/ProductList.js +1 -1
- package/dist/cjs/product/components/product-list-v3/ProductList.liquid.js +10 -9
- package/dist/cjs/product/components/product-list-v3/ProductListCarouselItem.liquid.js +6 -6
- package/dist/cjs/product/components/product-list-v3/ProductListCarouselLayout.liquid.js +6 -6
- package/dist/cjs/product/components/product-list-v3/ProductListGridItem.liquid.js +7 -8
- package/dist/cjs/product/components/product-list-v3/ProductListGridLayout.liquid.js +6 -4
- package/dist/cjs/product/components/product-price/ProductPrice.liquid.js +4 -4
- package/dist/cjs/product/components/product-sku/Sku.liquid.js +4 -3
- package/dist/cjs/product/components/product-title/ProductTitle.liquid.js +7 -8
- 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/components/product-variants/ProductVariants.liquid.js +27 -27
- package/dist/cjs/product/components/product-wrap/Product.liquid.js +7 -4
- 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/components/Sticky.liquid.js +4 -5
- package/dist/cjs/sticky/hooks/useSticky.js +1 -1
- package/dist/cjs/tab/components/Tabs.liquid.js +7 -6
- package/dist/cjs/text/components/Text.liquid.js +3 -3
- 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/configs/AppstleLoyaltyRewardProgram.js +1 -0
- 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/video/components/HTML5Embed.js +1 -1
- package/dist/cjs/video/components/HTML5Embed.liquid.js +12 -12
- package/dist/cjs/video/components/LiteVimeoEmbed.liquid.js +11 -10
- package/dist/cjs/video/components/LiteYouTubeEmbed.js +1 -1
- package/dist/cjs/video/components/LiteYouTubeEmbed.liquid.js +14 -13
- package/dist/cjs/video/components/Video.liquid.js +1 -1
- package/dist/esm/accordion/components/Accordion.liquid.js +8 -9
- package/dist/esm/builder.js +1 -1
- package/dist/esm/button/components/Button.liquid.js +22 -22
- package/dist/esm/carousel/components/root/Carousel.liquid.js +4 -3
- package/dist/esm/carousel-v3/common/selectors.js +1 -0
- 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/dot/common/helpers.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 +6 -5
- package/dist/esm/carousel-v3/components/root/CarouselEmbla.liquid.js +24 -0
- package/dist/esm/carousel-v3/components/root/common/attrs.js +1 -1
- 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/cart/components/shop-pay-button/ShopPayButton.liquid.js +2 -2
- package/dist/esm/collection/components/collection-description/CollectionDescription.liquid.js +6 -7
- package/dist/esm/collection/components/collection-paginator/CollectionPaginator.liquid.js +4 -3
- package/dist/esm/collection/components/collection-toolbar/CollectionToolbar.liquid.js +3 -3
- package/dist/esm/countdown-timer/components/Countdown.liquid.js +21 -20
- package/dist/esm/estimate-delivery/common/helpers.js +1 -1
- package/dist/esm/grid/components/row/Row.liquid.js +16 -11
- 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/components/HeroBanner.js +1 -1
- package/dist/esm/hero-banner/components/HeroBanner.liquid.js +12 -12
- package/dist/esm/hero-banner/components/HeroBannerItem.js +1 -1
- package/dist/esm/hero-banner/components/HeroBannerItem.liquid.js +10 -10
- package/dist/esm/icon-list-v2/components/IconList.liquid.js +3 -3
- package/dist/esm/image/common/attrs.js +1 -1
- package/dist/esm/image/components/AdaptiveImage.js +1 -1
- package/dist/esm/image/components/AdaptiveImage.liquid.js +11 -11
- package/dist/esm/image/components/Image.liquid.js +10 -10
- package/dist/esm/image/components/NextImage.js +1 -1
- package/dist/esm/image/components/NextImage.liquid.js +1 -1
- package/dist/esm/image/settings/configs/ui-v2.js +1 -1
- package/dist/esm/image-comparison/components/CompareImage.liquid.js +12 -12
- package/dist/esm/image-comparison/settings/configs/ui-v2.js +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.liquid.js +1 -1
- package/dist/esm/marquee/components/Marquee.liquid.js +21 -21
- package/dist/esm/post-purchase/product/components/ProductTitle.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/product/components/ProductImages.liquid.js +12 -12
- package/dist/esm/product/components/dynamic-checkout/Button.liquid.js +14 -14
- package/dist/esm/product/components/file-upload/UploadFile.liquid.js +3 -4
- package/dist/esm/product/components/product-badge/ProductBadge.js +1 -1
- package/dist/esm/product/components/product-badge/ProductBadge.liquid.js +12 -12
- package/dist/esm/product/components/product-badge/common/classes.js +1 -1
- package/dist/esm/product/components/product-badge/utils/renderBadgeILP.js +1 -1
- package/dist/esm/product/components/product-badge/utils/renderBadgeLiquid.js +5 -3
- package/dist/esm/product/components/product-bundle/ProductBundleDiscount.liquid.js +8 -7
- package/dist/esm/product/components/product-button/ProductButton.liquid.js +7 -6
- 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 +5 -6
- package/dist/esm/product/components/product-description/hooks/useGpDescription.js +1 -1
- package/dist/esm/product/components/product-discount-tag/ProductDiscountTag.liquid.js +8 -8
- package/dist/esm/product/components/product-images-v2/ProductImagesV2.liquid.js +21 -21
- package/dist/esm/product/components/product-images-v2/components/feature-gallery/FeatureImageWithGallery.liquid.js +5 -5
- package/dist/esm/product/components/product-images-v2/components/gallery-carousel/GalleryCarousel.liquid.js +1 -1
- package/dist/esm/product/components/product-images-v2/components/gallery-grid/GalleryGrid.liquid.js +5 -5
- package/dist/esm/product/components/product-images-v3/ProductImageV3.js +2 -2
- package/dist/esm/product/components/product-images-v3/ProductImagesV3.liquid.js +22 -22
- package/dist/esm/product/components/product-images-v3/ProductImagesV3Embla.liquid.js +44 -0
- 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/common/getBorderActiveCss.js +2 -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/ProductFeaturedImageCarousel.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 +1 -2
- package/dist/esm/product/components/product-images-v3/components/feature-gallery/FeatureImageWithGallery.js +1 -1
- 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/feature-gallery/FeatureImageWithGalleryEmbla.liquid.js +119 -0
- package/dist/esm/product/components/product-images-v3/components/feature-only/OnlyFeatureImage.js +1 -1
- package/dist/esm/product/components/product-images-v3/components/gallery-carousel/GalleryCarousel.js +1 -1
- package/dist/esm/product/components/product-images-v3/components/gallery-carousel/GalleryCarousel.liquid.js +3 -3
- package/dist/esm/product/components/product-images-v3/components/gallery-carousel/GalleryCarouselEmbla.liquid.js +46 -0
- package/dist/esm/product/components/product-images-v3/components/gallery-grid/GalleryGrid.liquid.js +10 -10
- package/dist/esm/product/components/product-images-v3/components/lightbox/ProductImagesLightBox.js +1 -1
- package/dist/esm/product/components/product-images-v3/hooks/useGalleryCarousel.js +1 -1
- package/dist/esm/product/components/product-images-v3/hooks/useProductFeaturedImageCarousel.js +1 -1
- package/dist/esm/product/components/product-images-v3/hooks/useProductGalleryGrid.js +1 -1
- package/dist/esm/product/components/product-list/ProductList.js +1 -1
- package/dist/esm/product/components/product-list/ProductList.liquid.js +18 -17
- package/dist/esm/product/components/product-list/ProductListCarouselItem.liquid.js +5 -6
- package/dist/esm/product/components/product-list/ProductListGridItem.liquid.js +7 -8
- package/dist/esm/product/components/product-list/ProductListGridLayout.liquid.js +9 -7
- package/dist/esm/product/components/product-list-v3/ProductList.js +1 -1
- package/dist/esm/product/components/product-list-v3/ProductList.liquid.js +18 -17
- package/dist/esm/product/components/product-list-v3/ProductListCarouselItem.liquid.js +6 -6
- package/dist/esm/product/components/product-list-v3/ProductListCarouselLayout.liquid.js +9 -9
- package/dist/esm/product/components/product-list-v3/ProductListGridItem.liquid.js +7 -8
- package/dist/esm/product/components/product-list-v3/ProductListGridLayout.liquid.js +9 -7
- package/dist/esm/product/components/product-price/ProductPrice.liquid.js +3 -3
- package/dist/esm/product/components/product-sku/Sku.liquid.js +6 -5
- package/dist/esm/product/components/product-title/ProductTitle.liquid.js +5 -6
- 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/components/product-variants/ProductVariants.liquid.js +44 -44
- package/dist/esm/product/components/product-wrap/Product.liquid.js +18 -15
- 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/components/Sticky.liquid.js +11 -12
- package/dist/esm/sticky/hooks/useSticky.js +1 -1
- package/dist/esm/tab/components/Tabs.liquid.js +12 -11
- package/dist/esm/text/components/Text.liquid.js +3 -3
- 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/configs/AppstleLoyaltyRewardProgram.js +1 -0
- 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/video/components/HTML5Embed.js +1 -1
- package/dist/esm/video/components/HTML5Embed.liquid.js +12 -12
- package/dist/esm/video/components/LiteVimeoEmbed.liquid.js +16 -15
- package/dist/esm/video/components/LiteYouTubeEmbed.js +1 -1
- package/dist/esm/video/components/LiteYouTubeEmbed.liquid.js +11 -10
- package/dist/esm/video/components/Video.liquid.js +1 -1
- package/dist/types/index.d.ts +39 -13
- package/package.json +5 -5
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import{cls as
|
|
1
|
+
import{cls as t,makeStyle as e,RenderIf as i,isLocalEnv as r,baseAssetURL as s,template as o,getResponsiveValueByScreen as l}from"@gem-sdk/core";import{getFlexDirection as a}from"../helpers/product-image.js";import{checkAddOverFlowClass as p,getStyleAlignment as d,getDisplayStyle as m}from"./product-images/common/helpers.js";import g from"./product-images/ProductFeaturedImage.liquid.js";import u from"./product-images/ProductGalleryCarousel.liquid.js";import c from"./product-images/ProductGalleryGrid.liquid.js";import{getStyleGallerySpacing as n,getStyleWidthForGallery as f}from"./product-images/common/productGallery.js";import{getSettingPreloadData as y}from"../../helpers.js";let b=b=>{let{setting:j,styles:$,builderProps:h,style:v}=b,S={...b.styles,...b.setting},w={...b.styles,...b.setting},x=t=>l($?.position,t),I=`
|
|
2
2
|
{
|
|
3
3
|
"id":${JSON.stringify(h?.uid)},
|
|
4
|
-
"setting":${JSON.stringify(
|
|
5
|
-
"styles":${JSON.stringify(
|
|
6
|
-
"product":{{ product | json
|
|
4
|
+
"setting":${JSON.stringify(j)},
|
|
5
|
+
"styles":${JSON.stringify($)},
|
|
6
|
+
"product":{{ product | json }}
|
|
7
7
|
}
|
|
8
8
|
`;return o`
|
|
9
9
|
{% assign featured_image = product.featured_image %}
|
|
@@ -11,19 +11,19 @@ import{cls as e,makeStyle as t,RenderIf as i,isLocalEnv as r,baseAssetURL as s,t
|
|
|
11
11
|
{% assign featured_image = variant.featured_image %}
|
|
12
12
|
{%- endif -%}
|
|
13
13
|
<gp-product-images
|
|
14
|
-
gp-data='${I}'
|
|
15
14
|
style="${{...v}}"
|
|
16
|
-
class="${
|
|
15
|
+
class="${t({"gp-overflow-hidden":p(v)})}"
|
|
17
16
|
>
|
|
17
|
+
<script gp-data type="application/json">${I}</script>
|
|
18
18
|
<div
|
|
19
|
-
class="${
|
|
20
|
-
style="${{...d(
|
|
19
|
+
class="${t("gp-flex gp-w-full",{...a(b)})}"
|
|
20
|
+
style="${{...d($?.align,$?.position)}}"
|
|
21
21
|
>
|
|
22
22
|
${g({...S})}
|
|
23
23
|
{%- if product.media.size > 1 -%}
|
|
24
24
|
<div
|
|
25
|
-
class="${
|
|
26
|
-
style="${{...
|
|
25
|
+
class="${t("gallery-wrapper gp-product-images-gallery gp-inline-flex gp-h-fit gp-max-w-full",{"gp-justify-start":"bottom-left"==x("desktop"),"tablet:gp-justify-start":"bottom-left"==x("tablet"),"mobile:gp-justify-start":"bottom-left"==x("mobile"),"gp-justify-center":"bottom-center"==x("desktop"),"tablet:gp-justify-center":"bottom-center"==x("tablet"),"mobile:gp-justify-center":"bottom-center"==x("mobile"),"gp-mx-auto":"bottom-center"==x("desktop"),"tablet:gp-mx-auto":"bottom-center"==x("tablet"),"mobile:gp-mx-auto":"bottom-center"==x("mobile")})}"
|
|
26
|
+
style="${{...e({fs:"1.23"}),...m(t=>!!j?.galleryVisible&&!l(j?.galleryVisible,t),"inline-flex"),...f({galleryVisible:j?.galleryVisible,featureImageVisible:j?.featureImageVisible,position:$?.position,width:$?.width,widthHorizontalLayout:$?.widthHorizontalLayout}),...n($?.position,$?.gallerySpacing)}}"
|
|
27
27
|
>
|
|
28
28
|
${u({builderPropUID:h?.uid,...w})}
|
|
29
29
|
${c({builderPropUID:h?.uid,...w})}
|
|
@@ -31,5 +31,5 @@ import{cls as e,makeStyle as t,RenderIf as i,isLocalEnv as r,baseAssetURL as s,t
|
|
|
31
31
|
{%- endif -%}
|
|
32
32
|
</div>
|
|
33
33
|
</gp-product-images>
|
|
34
|
-
${i(r,`<script ${
|
|
35
|
-
`};export{
|
|
34
|
+
${i(r,`<script ${y('class="gps-link" delay',"src")}="{{ 'gp-product-images.js' | asset_url }}" defer="defer"></script>`,`<script ${y('class="gps-link" delay',"src")}="${s}/assets-v2/gp-product-images.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}" defer="defer"></script>`)}
|
|
35
|
+
`};export{b as default};
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import{
|
|
2
|
-
${
|
|
3
|
-
${
|
|
4
|
-
${
|
|
1
|
+
import{dataStringify as t,isLocalEnv as s,baseAssetURL as a,template as i}from"@gem-sdk/core";import{createClass as e,createStateOrContext as o,Liquid as n,LiquidFor as r,If as l}from"@gem-sdk/system";import{getSettingPreloadData as p}from"../../../helpers.js";import{getButtonClasses as d}from"./common/classes.js";import{getButtonStyles as m}from"./common/styles.js";let c=({setting:c,advanced:u,styles:y,builderProps:_,className:g=""})=>{let f=e({...!!g&&{[g]:!0},...d({styles:y,uid:_?.uid})}),$=m({styles:y,uid:_?.uid}),v=o({setting:{label:c?.label},totalVariant:"{{total_combinations}}"});return i`
|
|
2
|
+
${n("{%- assign total_combinations = 1 -%}")}
|
|
3
|
+
${r("option in product.options_with_values","{%- assign total_combinations = total_combinations | times: option.values.size -%}")}
|
|
4
|
+
${n(`
|
|
5
5
|
{%- liquid
|
|
6
6
|
assign inventory_quantity = variant.inventory_quantity | default: 0
|
|
7
7
|
assign supported_payment_methods = shop.enabled_payment_types
|
|
8
8
|
-%}
|
|
9
9
|
`)}
|
|
10
|
-
<gp-product-dynamic data-id="${
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
10
|
+
<gp-product-dynamic data-id="${_?.uid}" data-translate-label='${c?.label}' class="${u?.cssClass}">
|
|
11
|
+
<script gp-data type="application/json">${t(v)}</script>
|
|
12
|
+
<div class="${f}">
|
|
13
|
+
{{ form | payment_button }}
|
|
14
|
+
</div>
|
|
15
|
+
{% style %}
|
|
16
|
+
${$}
|
|
17
|
+
{% endstyle %}
|
|
18
18
|
</gp-product-dynamic>
|
|
19
|
-
${l(
|
|
20
|
-
`};export{
|
|
19
|
+
${l(s,`<script ${p('class="gps-link" delay',"src")}="{{ 'gp-product-dynamic-v7-5.js' | asset_url }}" defer="defer"></script>`,`<script ${p('class="gps-link" delay',"src")}="${a}/assets-v2/gp-product-dynamic-v7-5.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}" defer="defer"></script>`)}
|
|
20
|
+
`};export{c as default};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import{template as e,RenderIf as s,isLocalEnv as i,baseAssetURL as l}from"@gem-sdk/core";import{getSettingPreloadData as r}from"../../../helpers.js";import{createClass as t,createStyle as d,createAttr as o,createStateOrContext as a,If as c}from"@gem-sdk/system";import{createLayoutClasses as v,createTypoClasses as f,createPreviewClasses as
|
|
2
|
-
<gp-file-upload
|
|
3
|
-
|
|
4
|
-
>
|
|
1
|
+
import{template as e,RenderIf as s,isLocalEnv as i,baseAssetURL as l}from"@gem-sdk/core";import{getSettingPreloadData as r}from"../../../helpers.js";import{createClass as t,createStyle as d,createAttr as o,createStateOrContext as a,If as c}from"@gem-sdk/system";import{createLayoutClasses as v,createTypoClasses as f,createPreviewClasses as p,createPreviewItemClasses as m,createPreviewRemoveClasses as $,createMessageClasses as n,createContentWidthClasses as u,createInputClasses as g,composeClasses as y,createWrapContainerClasses as b,createIconContentClasses as j}from"./common/classes.js";import{createLayoutStyles as E,createTypoStyles as H,createMessageStyles as S,createContainerStyles as h,createWrapContentWidthStyles as k,createContentWithStyles as q,createIconContainerStyles as w,createIconContentStyles as F}from"./common/style.js";import{getInputAttr as O}from"./common/attr.js";import{removeHoverStyles as x,getDisplayText as R}from"./common/helpers.js";let I=({setting:I,styles:P,builderProps:C,pageContext:J})=>{let L=t(v(I,C?.uid)),N=d({...x(E(I,P),P?.enableHoverEffect)}),U=t(f(P)),V=d({...x(H(P),P?.enableHoverEffect)}),_=t(p()),z=t(m()),A=t($()),B=t(n()),D=d(S()),G=t(u()),K=t(g()),M=t(y("gp-flex gp-items-center")),Q=o({...O(I?.isRequired,I?.numberOfFiles)}),T=d({...x(h(P?.align,P?.textColor),P?.enableHoverEffect)}),W=d({...x(k(I),P?.enableHoverEffect)}),X=t(b(C?.uid)),Y=d({...x(q(I,P),P?.enableHoverEffect)}),Z=d({...x(w(I),P?.enableHoverEffect)}),ee=t(j()),es=d({...x(F(I,P),P?.enableHoverEffect)}),ei=R("Liquid",{uid:C?.uid,setting:I,styles:P,pageContext:J}),el=a({settings:{isShowPreviewImage:I?.isShowPreviewImage,numberOfFiles:I?.numberOfFiles,isRequired:I?.isRequired}});return e`
|
|
2
|
+
<gp-file-upload>
|
|
3
|
+
<script gp-data type="application/json">${JSON.stringify(el)}</script>
|
|
5
4
|
<div class="${X}" style="${T}">
|
|
6
5
|
<input ${Q} class="${K}">
|
|
7
6
|
<div class="${M}" style="${W}">
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import{jsxs as e,jsx as s}from"react/jsx-runtime";import{useI18nStore as m,useProduct as o,useCurrentVariant as t,useMoneyFormat as r,useCurrentDevice as
|
|
2
|
+
import{jsxs as e,jsx as s}from"react/jsx-runtime";import{useI18nStore as m,useProduct as o,useCurrentVariant as t,useMoneyFormat as r,useCurrentDevice as i,useProductBundleDiscount as l,useEditorMode as a,useRenderMode as c,usePageType as n,useSafeGetProductListSettings as d,filterToolbarPreview as p}from"@gem-sdk/core";import{getBadgeContent as h,getIsNoDiscountState as y}from"./utils/common.js";import"./constants.js";import f from"../../../common/components/NoDataState.js";import N from"../../../common/components/TooltipHover.js";import{createClass as j,createStyle as u,createAttr as g,If as v}from"@gem-sdk/system";import{getEditTooltipAttrs as T,getSubWrapperAttrs as k,getContainerAttrs as x,getTextContentAttrs as C,getImageAttr as H}from"./common/attrs.js";import{getContainerClasses as S,getWrapperClasses as b,getSubWrapperClass as w,getTextContainerClasses as A,getTextWrapperClasses as B,getTextContentClasses as D,getImageContainerClasses as I,getImageClasses as M}from"./common/classes.js";import{getContainerStyle as P,getSubWrapperStyle as q,getContentStyleInternal as z,getTextBadgeWrapperStyles as E,getTextContentStyle as F,getImageContainerStyles as G}from"./common/styles.js";let J=J=>{let{t:K}=m(),{setting:L,styles:O,children:Q,builderAttrs:R,...U}=J,V=o(),W=t(),{moneyFormat:X}=r(),Y=i(),{useProductCompareAtPrice:Z}=l(),$=U?.["bundle-item"],_=a(),{isEditMode:ee}=c(),es="STATIC"===n(),{settings:em}=d(),eo=em?.sameHeight,et=h({detail:V,currentVariant:W,bundleItem:$,useProductCompareAtPrice:Z},L?.displayContent,X),er=y({props:J,product:V,currentVariant:W,moneyFormat:X,useProductCompareAtPrice:Z}),ei=j({...S({mode:_,isInstant:es,product:V,currentVariant:W,props:J,isSameHeightInProductList:eo})}),el=u({...P(J)}),ea=g({...T(J,ee)}),ec=j({...b(J)}),en=j({...w(J,Y)}),ed=u({...q({props:J,product:V,currentVariant:W,isEditMode:ee})}),ep=g({...k(J,V)}),eh=z(J),ey=j({...A()}),ef=g({...x(J)}),eN=j({...B()}),ej=u({...E({setting:L,styles:O})}),eu=j({...D(O)}),eg=u({...F({setting:L,styles:O})}),ev=g({...C()}),eT=j({...I()}),ek=u({...G({setting:L,styles:O})}),ex=j({...M()}),eC=g({...H({setting:L})});return V?e("div",{...ef,style:el,className:ei,children:[v(ee&&er,s(N,{...ea,children:s(f,{...R,elementType:"secondary",description:K("No discount"),rawMode:!0})}),s("div",{className:ec,children:e("div",{...ep,className:en,style:ed,children:[s("style",{children:eh}),v(L?.shape!=="image",s("div",{className:ey,children:s("div",{className:eN,style:ej,children:s("pre",{...ev,className:eu,style:eg,children:et})})}),s("div",{className:eT,style:ek,children:s("img",{...eC,className:ex,alt:""})}))]})})),p(Q,!0)]}):null};export{J as default};
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{sanitizeLiquid as e,dataStringify as t,RenderIf as s,template as i,isLocalEnv as r,baseAssetURL as a}from"@gem-sdk/core";import{getDynamicSourceLocales as o,getSettingPreloadData as c}from"../../../helpers.js";import{generateBadgeContent as n}from"./utils/generateLiquidContent.js";import{renderBadgeInFirstTime as p}from"./utils/renderBadgeLiquid.js";import{createClass as d,createStyle as l,createAttr as u,createStateOrContext as m}from"@gem-sdk/system";import{IS_LIQUID as g}from"./constants.js";import{getContainerStyle as y,getSubWrapperStyle as $,getContentStyleInternal as v,getTextBadgeWrapperStyles as f,getTextContentStyle as j,getImageContainerStyles as P}from"./common/styles.js";import{getContainerClasses as S,getWrapperClasses as D,getSubWrapperClass as V,getTextContainerClasses as b,getTextWrapperClasses as h,getTextContentClasses as C,getImageContainerClasses as I,getImageClasses as L}from"./common/classes.js";import{getSubWrapperAttrs as T,getContainerAttrs as k,getTextContentAttrs as q,getImageAttr as A}from"./common/attrs.js";import{checkDiscountContentProductBadge as E}from"./utils/common.js";import{ProductBadge as K}from"../../settings/product-badge/configs/translate.js";let N=N=>{let{styles:_,setting:B,builderProps:O,pageContext:Q}=N,w=B?.shape!=="image",G=w&&B?.displayContent?.trim()==="",H=E(B?.displayContent),J=d({...S({isInstant:!1,props:N})}),x=l({...y(N,g)}),M=d({...D(N)}),R=d({...V(N)}),Y=l({...$({props:N})}),z=u({...T(N)}),F=v(N),U=d({...b()}),W=u({...k(N)}),X=d({...h()}),Z=l({...f({setting:B,styles:_})}),ee=d({...C(_)}),et=l({...j({setting:B,styles:_})}),es=u({...q()}),ei=d({...I()}),er=l({...P({setting:B,styles:_})}),ea=d({...L()}),eo=u({...A({setting:B})}),ec=m({minPrice:"{{ minPriceValue | replace: '\"', '\\\"' | escape }}",variantIDs:'{{ product.variants | map: "id" | json | escape }}',variantInventoryQuantities:'{{ product.variants | map: "inventory_quantity" | json | escape }}',amountDiscount:"{{amountDiscountValue | replace: '\"', '\\\"' | escape }}",percentDiscount:"{{percentDiscountValue}}",price:"{{price}}",displayTrigger:JSON.parse(JSON.stringify(B?.displayTrigger).replaceAll("'","'")),uid:N.builderProps?.uid,productCreatedAt:'{{product.created_at | date: "%Y-%m-%d" }}',productTags:"{{ product.tags | join: \",\" | replace: '\"', '\\\"' | escape }}",isTextBadge:w,isSettingSameHeightProductList:"{{ isSettingSameHeightProductList }}"}),{displayContent:en}=B??{},ep=o({val:en?.trim(),uid:O?.uid,settingId:K?.displayContent?.id,isLiquid:!0,pageContext:Q});return i`
|
|
2
2
|
{% if product %}
|
|
3
3
|
${n(ep,Q?.isPreviewing)}
|
|
4
|
-
${p(
|
|
4
|
+
${p(B?.displayTrigger,!G,H)}
|
|
5
5
|
<gp-product-badge
|
|
6
6
|
${{...W}}
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
data-display-content="${Q?.isPreviewing?ep:t(`{{${ep}}}`)}"
|
|
7
|
+
class="${J} {{ className }}"
|
|
8
|
+
style="${x}"
|
|
9
|
+
data-display-content="${Q?.isPreviewing?ep:e(`{{${ep}}}`)}"
|
|
11
10
|
>
|
|
12
|
-
<
|
|
11
|
+
<script gp-data type="application/json">${t(ec)}</script>
|
|
12
|
+
<div class="${M}">
|
|
13
13
|
<div
|
|
14
|
-
${{...
|
|
15
|
-
class="${
|
|
16
|
-
style="${
|
|
14
|
+
${{...z}}
|
|
15
|
+
class="${R}"
|
|
16
|
+
style="${Y}"
|
|
17
17
|
>
|
|
18
|
-
<style>${
|
|
18
|
+
<style>${F}</style>
|
|
19
19
|
${s(w,i`
|
|
20
20
|
<div class="${U}">
|
|
21
21
|
<div
|
|
@@ -36,4 +36,4 @@ import{dataStringify as e,sanitizeLiquid as t,RenderIf as s,template as i,isLoca
|
|
|
36
36
|
</gp-product-badge>
|
|
37
37
|
${s(r,`<script ${c('class="gps-link" delay',"src")}="{{ 'gp-product-badge-v7-5.js' | asset_url }}" defer="defer"></script>`,`<script ${c('class="gps-link" delay',"src")}="${a}/assets-v2/gp-product-badge-v7-5.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}" defer="defer"></script>`)}
|
|
38
38
|
{% endif %}
|
|
39
|
-
`};export{
|
|
39
|
+
`};export{N as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{composeClasses as e,composeTypographyClassName as t}from"@gem-sdk/core";import{toggleBadge as
|
|
1
|
+
import{composeClasses as e,composeTypographyClassName as t}from"@gem-sdk/core";import{toggleBadge as r}from"../utils/renderBadgeILP.js";import{getAlignShape as s,getShapePlacementClass as g}from"../utils/common.js";let l=({mode:t,isInstant:s,product:g,currentVariant:l,props:i,isSameHeightInProductList:p})=>{let{setting:o,builderProps:a}=i,n="gp-shrink-0 product-badge ",d=!t&&s?r({triggers:o?.displayTrigger,productDetail:g,productVariant:l,isSameHeightInProductList:p}):`${a?.uid}`,u=a?.builderData?.advanced?.cssClass||"";return d&&(n+=`${d} `),u&&(n+=`${u} `),a?.uid&&(n+=`${a?.uid} `),o?.positionWithImage==="inside"&&(n+="inside-image "),{...e(n)}},i=()=>({...e("gp-w-full gp-h-full gp-overflow-hidden product-badge-item")}),p=()=>({...e("gp-w-full gp-h-full gp-flex gp-items-center gp-justify-center gp-overflow-hidden")}),o=r=>{let s="gp-break-words gp-text-center ",g=t(r?.typo);return g&&(s+=`${g} `),{...e(s)}},a=()=>({...e("product-badge-item gp-w-full gp-h-full gp-overflow-hidden")}),n=()=>({...e("gp-object-cover gp-w-full gp-h-full gp-pointer-events-none")}),d=t=>{let{styles:r,setting:g}=t,{align:l}=r??{},i=g?.positionWithImage==="outside",p=i?"gp-flex ":"gp-h-full",o=s(l);return i&&o&&(p+=`${o} `),{...e(p)}},u=(t,r)=>{let{setting:s,style:l}=t,i=s?.positionWithImage==="inside",p=!i&&r?g(i,l,r):"gp-h-full";return{...e(p)}};export{l as getContainerClasses,n as getImageClasses,a as getImageContainerClasses,u as getSubWrapperClass,i as getTextContainerClasses,o as getTextContentClasses,p as getTextWrapperClasses,d as getWrapperClasses};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{CompareType as e}from"../types.js";let t=(e,t,o)=>{let
|
|
1
|
+
import{CompareType as e}from"../types.js";let t=({triggers:e,productDetail:t,productVariant:o,isSameHeightInProductList:n})=>{let i=r(e,t,o);return i?"":n?"!gp-invisible":"!gp-hidden"},r=(e,t,r)=>{if(!r)return;let o=t?.createdAt||"",n=t?.tags||[],p={...r,product_created_at:o,product_tags:n},d=e?.map(e=>{switch(e?.triggerEvent){case"inventory_status":return i(p,e);case"discount_price":return a(p,e);case"price_range":return c(p,e);case"creation_date":return u(p,e);case"product_tags":return m(p,e);default:return!1}});return d?.every(e=>!0===e)},o=(e,t,r)=>{switch(r){case"exact":return e===t.from;case"above":return e>t.from;case"below":return e<t.from;case"exact_or_above":return e>=t.from;case"exact_or_below":return e<=t.from;case"between":return e>=t.from&&e<=t.to;default:return!1}},n=t=>t===e.ABOVE?0:t===e.BELOW?2:1,i=(t,r)=>{if(void 0===t.inventoryQuantity)return!1;if("in_stock"===r.type){if(!1===t.manageInventory||t.inventoryPolicy?.toLowerCase()=="continue")return!0;if(r.conditionType===e.BELOW||r.conditionType===e.EXACT_OR_BELOW){let i=n(r.conditionType);return o(t?.inventoryQuantity,{from:1,to:Number(r.from)-i+1},e.BETWEEN)}return o(t?.inventoryQuantity,{from:Number(r.from),to:Number(r?.to)},r.conditionType)}return!1!==t.manageInventory&&t.inventoryPolicy?.toLowerCase()!="continue"&&o(t.inventoryQuantity,{from:0,to:0},e.EXACT_OR_BELOW)},a=(e,t)=>{if(e?.compare_at_price===void 0||void 0===e.price||e.compare_at_price<e.price)return!1;let r=(e.compare_at_price-e.price)/100,n=r/(e.compare_at_price/100),i="fixed"===t.discountType?r:Math.round(100*n);return o(i,{from:Number(t.from),to:Number(t.to)},t.conditionType)},c=(e,t)=>{if(void 0===e.price)return!1;let r=e.price/100;return o(r,{from:Number(t.from),to:Number(t.to)},t.conditionType)},u=(t,r)=>{if(!t.product_created_at)return!1;let n=new Date(new Date(t.product_created_at).setHours(0,0,0,0)),i=new Date(r.from),a=new Date(r.to),c=n.getTime();if("exact_date"===r.type)return o(c,{from:i.getTime(),to:0},e.EXACT);if("duration"===r.type){let e=new Date().setHours(0,0,0,0),t=(e-n.getTime())/864e5;if(t>=0&&t<=Number(r.days))return!0}return!(i.getTime()>=a.getTime())&&o(c,{from:i.getTime(),to:a.getTime()},e.BETWEEN)},m=(e,t)=>{let r=e.product_tags||[],o=t.searchTag;return o.some(e=>r.includes(e))};export{r as checkShowBadge,t as toggleBadge};
|
|
@@ -27,10 +27,12 @@ import{CompareType as e}from"../types.js";let i=i=>i===e.ABOVE?0:i===e.BELOW?2:1
|
|
|
27
27
|
{% endif %}
|
|
28
28
|
{% if isShow and isNotDiscount == false %}
|
|
29
29
|
{% assign className = "" %}
|
|
30
|
+
{% elsif isSettingSameHeightProductList %}
|
|
31
|
+
{% assign className = "!gp-invisible" %}
|
|
30
32
|
{% else %}
|
|
31
33
|
{% assign className = "!gp-hidden" %}
|
|
32
34
|
{% endif %}
|
|
33
|
-
`,s=e=>e?.length?e.map(e=>{switch(e?.triggerEvent){case"discount_price":return t(e);case"price_range":return o(e);case"inventory_status":return g(e);case"product_tags":return
|
|
35
|
+
`,s=e=>e?.length?e.map(e=>{switch(e?.triggerEvent){case"discount_price":return t(e);case"price_range":return o(e);case"inventory_status":return g(e);case"product_tags":return c(e);case"creation_date":return d(e);default:return""}}).join(" "):"",a=e=>e.replace(/[%$]/g,""),r=()=>`
|
|
34
36
|
{% assign enabled = false %}
|
|
35
37
|
{% case conditionType %}
|
|
36
38
|
{% when "exact" %}
|
|
@@ -131,7 +133,7 @@ import{CompareType as e}from"../types.js";let i=i=>i===e.ABOVE?0:i===e.BELOW?2:1
|
|
|
131
133
|
{% assign conditionTriggers = conditionTriggers | append: "," | append: false %}
|
|
132
134
|
{% endif %}
|
|
133
135
|
|
|
134
|
-
`},
|
|
136
|
+
`},c=e=>{let{searchTag:i}=e,n=i.map(e=>e.replaceAll("'","'")).join(", ");return`
|
|
135
137
|
{% assign productTags = product.tags | escape %}
|
|
136
138
|
{% assign searchTag = '${n}' %}
|
|
137
139
|
{% for tag in productTags %}
|
|
@@ -141,7 +143,7 @@ import{CompareType as e}from"../types.js";let i=i=>i===e.ABOVE?0:i===e.BELOW?2:1
|
|
|
141
143
|
{% endif %}
|
|
142
144
|
{% endfor %}
|
|
143
145
|
{% assign conditionTriggers = conditionTriggers | append: "," | append: isProductTag %}
|
|
144
|
-
`},
|
|
146
|
+
`},d=e=>{let{days:i,from:n,to:s,type:t,conditionType:o}=e;return`
|
|
145
147
|
{% assign type = "${t}" %}
|
|
146
148
|
{% assign days = ${a(i)} %}
|
|
147
149
|
{% assign from = "${n}" | date: "%Y-%m-%d" | date: "%s" | times: 1000 %}
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import{template as t,RenderIf as e,isLocalEnv as s,baseAssetURL as r}from"@gem-sdk/core";import{getSettingPreloadData as
|
|
1
|
+
import{template as t,RenderIf as e,isLocalEnv as s,baseAssetURL as r}from"@gem-sdk/core";import{getSettingPreloadData as a}from"../../../helpers.js";import{createStyle as d,createClass as o,createStateOrContext as p,Liquid as i,LiquidIf as n}from"@gem-sdk/system";import{getSizeSettings as l,getContainerStyles as c}from"./common/styles.js";import{getContainerClasses as u}from"./common/classes.js";import m from"./ProductBundleDiscountChildrenItem.liquid.js";let f=({rawChildren:f,setting:g,styles:I,advanced:$,style:P})=>{let y=g?.hasPreSelectItem?g?.selectItemDefault??0:-1,S=t=>y===t,_=(t,e)=>m({rawChildrenItem:f?.[e],setting:g,styles:I,isSelected:S(e),bundleItem:t}),h=d(l(I)?.gap),B=o(u(g,$?.cssClass)),j=d(c(h,I,P)),A=p({styles:I,settings:{useProductCompareAtPrice:g?.useProductCompareAtPrice,selectItemDefault:g?.selectItemDefault,hideNoDiscountItem:g?.hideNoDiscountItem,hasPreSelectItem:g?.hasPreSelectItem,iconItemColor:g?.iconItemColor,applyToInBetweenQuantities:g?.applyToInBetweenQuantities}});return t`
|
|
2
2
|
<gp-product-bundle-discount
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
style="${j}"
|
|
4
|
+
class="${B}"
|
|
5
|
+
>
|
|
6
|
+
<script gp-data type="application/json">${JSON.stringify(A)}</script>
|
|
7
|
+
${i(`
|
|
7
8
|
{%- assign gempages_product_bundle = product.metafields.gp_discount.gp_discount_selected_products -%}
|
|
8
9
|
{% assign productBundleItem = gempages_product_bundle | split: '($1)' %}
|
|
9
10
|
`)}
|
|
10
11
|
${f?.map((e,s)=>t`
|
|
11
12
|
{% for productBundle in productBundleItem %}
|
|
12
|
-
${
|
|
13
|
+
${i(`
|
|
13
14
|
{% assign attrs = productBundle | split: '($3)' %}
|
|
14
15
|
{% assign parsedAttrs = '' %}
|
|
15
16
|
{% for attr in attrs %}
|
|
@@ -28,6 +29,6 @@ import{template as t,RenderIf as e,isLocalEnv as s,baseAssetURL as r}from"@gem-s
|
|
|
28
29
|
</gp-product-bundle-discount>
|
|
29
30
|
|
|
30
31
|
{% if productBundleItem %}
|
|
31
|
-
${e(s,`<script ${
|
|
32
|
+
${e(s,`<script ${a('class="gps-link" delay',"src")}="{{ 'gp-product-bundle-discount-v7-5.js' | asset_url }}" defer="defer"></script>`,`<script ${a('class="gps-link" delay',"src")}="${r}/assets-v2/gp-product-bundle-discount-v7-5.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}" defer="defer"></script>`)}
|
|
32
33
|
{% endif %}
|
|
33
34
|
`};export{f as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
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
|
|
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 a,baseAssetURL as o}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 d}from"./helpers/getButtonDynamicSourceLocales.js";import{SoldOutButton as m}from"./SoldOutButton.liquid.js";import{AddToCartButton as g}from"./AddToCartButton.liquid.js";let f=f=>{let{setting:$,builderProps:y,style:b,styles:v,pageContext:_}=f,{wrapStyle:h,restStyle:S}=t(b),{outOfStockButtonLabel:j,unavailableButtonLabel:q,variantSelectionRequiredMessage:k,successMessage:E,errorMessage:A}=d({setting:$,pageContext:_,builderProps:y}),{urlData:M}=c("",$?.actionEffect==="open-cart-drawer"?{link:"/cart",target:"_self"}:$?.customURL),B=i(e({styles:v,setting:$})),G=s(E??$?.successMessage),P=s(A??$?.errorMessage),w=s(k??$?.variantSelectionRequiredMessage);return r`
|
|
2
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
|
|
@@ -8,18 +8,19 @@ import{getSplitStyle as t}from"./common/styles.js";import{getGPProductButtonStat
|
|
|
8
8
|
<gp-product-button
|
|
9
9
|
style="${h}"
|
|
10
10
|
gp-data-wrapper="true"
|
|
11
|
-
gp-href="${
|
|
11
|
+
gp-href="${M.href}"
|
|
12
12
|
class="gp-product-button"
|
|
13
13
|
gp-label-out-of-stock="${j}"
|
|
14
|
-
gp-label-unavailable="${
|
|
15
|
-
gp-data='${JSON.stringify(B)}'
|
|
14
|
+
gp-label-unavailable="${q}"
|
|
16
15
|
data-variant-selection-required-message="${w}"
|
|
17
16
|
gp-enable-third-partycart="{{shop.metafields.GEMPAGES.enableThirdPartyCart}}"
|
|
18
17
|
gp-error-message="${P}"
|
|
19
18
|
gp-success-message="${G}"
|
|
19
|
+
data-variant-selection-required-message="${k}"
|
|
20
20
|
>
|
|
21
|
+
<script gp-data type="application/json">${JSON.stringify(B).replaceAll("'","'")}</script>
|
|
21
22
|
${g({...f,style:S})}
|
|
22
|
-
${
|
|
23
|
+
${m({...f,style:S,label:j})}
|
|
23
24
|
</gp-product-button>
|
|
24
|
-
${p(
|
|
25
|
+
${p(a,`<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")}="${o}/assets-v2/gp-product-button-v7-5.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}" defer="defer"></script>`)}
|
|
25
26
|
`};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
|
|
1
|
+
import{makeStyleResponsive as e,makeLineClamp as t,dataStringify as s,template as i,baseAssetURL as o,isLocalEnv as p}from"@gem-sdk/core";import{getDynamicSourceLocales as r,createSettingId as a,getSettingPreloadData as n}from"../../../helpers.js";import{createClass as d,createStyle as l,createAttr as c,createStateOrContext as m,LiquidIf as $,Liquid as u,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 y,getStaticCss as C}from"./common/styles.js";import{ICON_SVG as j}from"./common/helpers.js";import{ProductDescription as b}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(y({setting:S})),R=c({"data-id":`${L?.uid}`}),z=c({"data-gp-text":""}),{textDescriptionCss:B,gpDescriptionCss:F}=C(),J="product.description == blank",K=r({val:E,uid:L?.uid,settingId:a({id:b?.viewMoreText?.id}),pageContext:T??{}}),Q=r({val:P,uid:L?.uid,settingId:a({id:b?.viewLessText?.id}),pageContext:T??{}}),U=m({setting:{lineClamp:S?.lineClamp,hasLineClamp:S?.hasLineClamp,viewMoreText:K,viewLessText:Q,enableViewMoreIcon:S?.enableViewMoreIcon},textStyle:H});return $(J,"",u(i`
|
|
2
2
|
<gp-product-description
|
|
3
3
|
${R}
|
|
4
4
|
class="${A}"
|
|
5
|
-
gp-data='${s(U).replaceAll("'","'")}'
|
|
6
5
|
data-view-more-text="${K}"
|
|
7
6
|
data-view-less-text="${Q}"
|
|
8
7
|
>
|
|
9
|
-
<
|
|
10
|
-
<style>${F}</style>
|
|
8
|
+
<script gp-data type="application/json">${s(U).replaceAll("'","'")}</script>
|
|
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}}
|
|
@@ -16,9 +15,9 @@ import{makeStyleResponsive as e,makeLineClamp as t,dataStringify as s,template a
|
|
|
16
15
|
<span class="${_}">
|
|
17
16
|
${v(!1,Q?.toString(),K?.toString())}
|
|
18
17
|
</span>
|
|
19
|
-
${v(S?.enableViewMoreIcon,i`<span class="${q}">${
|
|
18
|
+
${v(S?.enableViewMoreIcon,i`<span class="${q}">${j}</span>`," ")}
|
|
20
19
|
</button>`)}`)}
|
|
21
20
|
</gp-product-description>
|
|
22
21
|
|
|
23
|
-
${(()=>{let e=
|
|
22
|
+
${(()=>{let e=p?"{{ 'gp-product-description-v7-5.js' | asset_url }}":`${o}/assets-v2/gp-product-description-v7-5.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}`;return`<script ${n('class="gps-link" delay',"src")}="${e}" defer="defer"></script>`})()}
|
|
24
23
|
`))};export{M as default};
|
|
@@ -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,14 +1,14 @@
|
|
|
1
|
-
import{template as e,baseAssetURL as i,isLocalEnv as s}from"@gem-sdk/core";import{getDynamicSourceLocales as a,createSettingId as r,getSettingPreloadData as t}from"../../../helpers.js";import p from"../../../text/components/Text.liquid.js";import{createStyle as n,createClass as c,LiquidIf as o,Liquid as d,If as l}from"@gem-sdk/system";import{getWrapperTextClass as u,getContainerClass as g,getProductTagClass as f}from"./common/classes.js";import{getRootClass as m,getWrapperTextStyle as v,getContainerStyle as x}from"./common/styles.js";import{ProductTag as
|
|
1
|
+
import{template as e,baseAssetURL as i,isLocalEnv as s}from"@gem-sdk/core";import{getDynamicSourceLocales as a,createSettingId as r,getSettingPreloadData as t}from"../../../helpers.js";import p from"../../../text/components/Text.liquid.js";import{createStyle as n,createClass as c,LiquidIf as o,Liquid as d,If as l}from"@gem-sdk/system";import{getWrapperTextClass as u,getContainerClass as g,getProductTagClass as f}from"./common/classes.js";import{getRootClass as m,getWrapperTextStyle as v,getContainerStyle as x}from"./common/styles.js";import{ProductTag as y}from"../../settings/product-discount-tag/configs/translate.js";let $=({setting:$,styles:S,builderProps:P,advanced:V,pageContext:_})=>{let{customContent:h}=$??{},j=$?.moneyWithCurrentFormat?"money_with_currency":"money",C=y?.customContent?.id?a({val:h?.prefix,uid:P?.uid,settingId:r({id:y.customContent.id,suffix:"prefix"}),isLiquid:!0,pageContext:_??{}}):h?.prefix,F=y?.customContent?.id?a({val:h?.suffix,uid:P?.uid,settingId:r({id:y.customContent.id,suffix:"suffix"}),isLiquid:!0,pageContext:_??{}}):h?.suffix,M=n(m(S)),q=n(v(S)),w=n(x(S)),E=c(u(S)),N=c(g()),O=c(f(V)),T=h?.unit==="percentage";return e`
|
|
2
2
|
{% liquid
|
|
3
3
|
assign price = variant.price | times: 1.0
|
|
4
4
|
assign salePrice = variant.compare_at_price | times: 1.0
|
|
5
5
|
assign priceSave = salePrice | minus: price
|
|
6
|
-
assign prefixVal = ${_?.isPreviewing?JSON.stringify(
|
|
6
|
+
assign prefixVal = ${_?.isPreviewing?JSON.stringify(C):C}
|
|
7
7
|
assign suffixVal = ${_?.isPreviewing?JSON.stringify(F):F}
|
|
8
8
|
%}
|
|
9
|
-
${o("salePrice == null or price == null",d(`{% assign pricePercentage = prefixVal ${l(T,"| append: ' 0% '",`| ${
|
|
10
|
-
{% assign pricePercentage = prefixVal | append: ' ' | append: salePercent | append: '% ' | append: suffixVal %}`,o("priceSave > 0",`{% assign priceSaveMoney = priceSave | ${
|
|
11
|
-
{% assign pricePercentage = prefixVal | append: ' ' | append: priceSaveMoney | append: ' ' | append: suffixVal %}`,`{% assign priceSaveMoney = 0 | ${
|
|
9
|
+
${o("salePrice == null or price == null",d(`{% assign pricePercentage = prefixVal ${l(T,"| append: ' 0% '",`| ${j} | append: ' '`)} | append: suffixVal %}`),`${l(T,`{% assign salePercent = priceSave | divided_by: salePrice | times: 100 | round %}
|
|
10
|
+
{% assign pricePercentage = prefixVal | append: ' ' | append: salePercent | append: '% ' | append: suffixVal %}`,o("priceSave > 0",`{% assign priceSaveMoney = priceSave | ${j} %}
|
|
11
|
+
{% assign pricePercentage = prefixVal | append: ' ' | append: priceSaveMoney | append: ' ' | append: suffixVal %}`,`{% assign priceSaveMoney = 0 | ${j} %}
|
|
12
12
|
{% assign pricePercentage = prefixVal | append: ' ' | append: priceSaveMoney | append: ' ' | append: suffixVal %}`))}`)}
|
|
13
13
|
|
|
14
14
|
<gp-product-tag
|
|
@@ -16,15 +16,15 @@ import{template as e,baseAssetURL as i,isLocalEnv as s}from"@gem-sdk/core";impor
|
|
|
16
16
|
style="${M}"
|
|
17
17
|
data-id="${P?.uid}"
|
|
18
18
|
data-disabled="${o(`${l(T,"salePercent","priceSave")} > 0`,"false","true")}"
|
|
19
|
-
gp-data='{"setting":${JSON.stringify(y).replaceAll("'","'")}, "id": "${P?.uid}", "locale": "{{shop.locale}}", "currency": "{{shop.currency}}", "moneyFormat": "{{ ${y?.moneyWithCurrentFormat?"shop.money_with_currency_format":"shop.money_format"} | replace: '"', '\\"' | escape }}"}'
|
|
20
19
|
price-save="{{priceSave}}"
|
|
21
20
|
>
|
|
21
|
+
<script gp-data type="application/json">{"setting":${JSON.stringify($).replaceAll("'","'")}, "id": "${P?.uid}", "locale": "{{shop.locale}}", "currency": "{{shop.currency}}", "moneyFormat": "{{ ${$?.moneyWithCurrentFormat?"shop.money_with_currency_format":"shop.money_format"} | replace: '"', '\\"' | escape }}"}'</script>
|
|
22
22
|
<div class="${N}" style="${w}">
|
|
23
23
|
<div class="${E}" style="${q}">
|
|
24
|
-
${p({styles:S,id:`p-tag-${P?.uid}`,setting:{
|
|
24
|
+
${p({styles:S,id:`p-tag-${P?.uid}`,setting:{...$,text:"{{ pricePercentage }}",excludeFlex:!0,isForceValue:!0}})}
|
|
25
25
|
</div>
|
|
26
26
|
</div>
|
|
27
27
|
|
|
28
28
|
</gp-product-tag>
|
|
29
29
|
${(()=>{let e=s?"{{ 'gp-product-tag-v7-5.js' | asset_url }}":`${i}/assets-v2/gp-product-tag-v7-5.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}`;return`<script ${t('class="gps-link" delay',"src")}="${e}" defer="defer"></script>`})()}
|
|
30
|
-
`};export{
|
|
30
|
+
`};export{$ as default};
|
|
@@ -1,44 +1,44 @@
|
|
|
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}from"./common/common.js";import l from"./components/feature-gallery/FeatureImageWithGallery.liquid.js";import d from"./components/gallery-carousel/GalleryCarousel.liquid.js";import m from"./components/gallery-grid/GalleryGrid.liquid.js";import{filterPageContext as c,getSettingPreloadData as u}from"../../../helpers.js";import{getShapeByLayout as n,sizeSettingDefaultForNewLayout as g}from"./common/productGallery.js";import{getProductImagesClassName as f}from"./composables/getProductImagesClassName.js";import{getProductImagesStyles as y}from"./composables/getProductImagesStyles.js";import{createAttr as $,LiquidIf as h,createClass as j,If as S,Liquid as v}from"@gem-sdk/system";import{getBorderActiveCss as F}from"./common/getBorderActiveCss.js";import{getStyleOfObject as I}from"../../helpers/function.js";let C=C=>{let P=p(C),{setting:G,styles:D,builderProps:b,style:z}=P,{rawChildren:O,pageContext:_}=C,N={...G,...D},A=`
|
|
2
2
|
{
|
|
3
3
|
"id":${JSON.stringify(b?.uid)},
|
|
4
4
|
"pageContext": ${JSON.stringify(c(_))},
|
|
5
5
|
"setting":${JSON.stringify(G)},
|
|
6
6
|
"styles":${JSON.stringify(D)},
|
|
7
|
-
"productUrl":{{product.url | json
|
|
8
|
-
"product":{{product | json
|
|
9
|
-
"collectionUrl": {{ collection.url | json
|
|
10
|
-
"collection": {{ collection | json
|
|
7
|
+
"productUrl":{{product.url | json }},
|
|
8
|
+
"product":{{product | json }},
|
|
9
|
+
"collectionUrl": {{ collection.url | json }},
|
|
10
|
+
"collection": {{ collection | json }}
|
|
11
11
|
}
|
|
12
|
-
`,
|
|
13
|
-
${
|
|
12
|
+
`,B=$({"section-id":"{{section.id}}","data-id":`${b?.uid}`}),{isOnlyFeatureAllDevices:U,isRenderGalleryGrid:k}=i(N?.position,G?.type),q=k?{}:$({"data-only-image":h("product.media.size > 1","false","true")}),{wrapperClasses:E,productImagesGalleryClasses:J}=f(C),w=j({"gp-grid gp-w-full !gp-m-0 gp-relative":!0}),T=j({"gp-w-full !gp-m-0 gp-relative":!0}),{wrapContainerStyle:x,wrapContainerStyleOnlyOneImage:L,galleryImageStyle:M}=y(N),R=n({shape:N.shape,shapeForBottom:N.shapeForBottom,shapeFor1Col:N.shapeFor1Col,shapeFor2Col:N.shapeFor2Col,shapeForFtOnly:N.shapeForFtOnly,shapeForInsideBottom:N.shapeForInsideBottom??g,shapeForInside:N.shapeForInside??g},N.position),V=a(N.position,R,N?.spacing),W=()=>r`
|
|
13
|
+
${t({uid:b?.uid||"",customProps:O?.[0].customProps},O?.map(e=>{if(e)return r`${s({...e,isInsideProductImage:!0,imageData:{imageShape:D?.ftShape,imageAlign:D?.align,imageLayout:D?.position},dotData:{dotSize:G?.ftDotSize,dotGapToCarousel:G?.ftDotGapToCarousel,dotStyle:G?.ftDotStyle}})}`}))}
|
|
14
14
|
`;return r`
|
|
15
|
-
${
|
|
15
|
+
${S(G?.borderActive?.border!=="none",h("product.media.size > 1",`<style>${F({settings:N,uid:b?.uid,type:"Liquid"})}</style>`),"")}
|
|
16
16
|
${v(`
|
|
17
17
|
{% assign featured_image = product.featured_image %}
|
|
18
18
|
${h("variant != null and variant.featured_image != null","{% assign featured_image = variant.featured_image %}")}
|
|
19
19
|
`)}
|
|
20
20
|
<gp-product-images
|
|
21
|
-
|
|
22
|
-
${{...U}}
|
|
21
|
+
${{...B}}
|
|
23
22
|
style="${{...z}}"
|
|
24
|
-
class="${
|
|
23
|
+
class="${E}"
|
|
25
24
|
>
|
|
25
|
+
<script gp-data type="application/json">${A}</script>
|
|
26
26
|
<div
|
|
27
|
-
class="${h("product.media.size > 1",`${
|
|
28
|
-
style="${h("product.media.size > 1",I(
|
|
27
|
+
class="${h("product.media.size > 1",`${w}`,`${T}`)}"
|
|
28
|
+
style="${h("product.media.size > 1",I(x),I(L))}"
|
|
29
29
|
>
|
|
30
|
-
${l({builderPropUID:`gp-carousel-${b?.uid}`,...
|
|
31
|
-
${
|
|
30
|
+
${l({builderPropUID:`gp-carousel-${b?.uid}`,...N,children:W(),pageContext:_})}
|
|
31
|
+
${S(!U,r`
|
|
32
32
|
<div
|
|
33
|
-
class="${
|
|
34
|
-
style="${I(
|
|
35
|
-
${{...
|
|
33
|
+
class="${J}"
|
|
34
|
+
style="${I(M)}"
|
|
35
|
+
${{...q}}
|
|
36
36
|
>
|
|
37
|
-
${h("product.media.size > 1",d({builderPropUID:`gp-gallery-${b?.uid}`,...
|
|
38
|
-
${
|
|
37
|
+
${h("product.media.size > 1",d({builderPropUID:`gp-gallery-${b?.uid}`,...N,pageContext:_}))}
|
|
38
|
+
${S(k,m({builderPropUID:b?.uid,wrapperStyle:{...V},children:W(),...N,pageContext:_}))}
|
|
39
39
|
</div>
|
|
40
40
|
`)}
|
|
41
41
|
</div>
|
|
42
42
|
</gp-product-images>
|
|
43
|
-
${
|
|
43
|
+
${S(e,`<script ${u('class="gps-link" delay',"src")}="{{ 'gp-product-images-v7-5.js' | asset_url }}" defer="defer"></script>`,`<script ${u('class="gps-link" delay',"src")}="${o}/assets-v2/gp-product-images-v7-5.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}" defer="defer"></script>`)}
|
|
44
44
|
`};export{C as default};
|