@gem-sdk/components 23.1.3 → 24.0.0-staging.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/article/components/ArticleImage.js +1 -1
- package/dist/cjs/article/components/ArticleImage.liquid.js +6 -6
- package/dist/cjs/article/components/ArticleList.js +1 -1
- package/dist/cjs/article/index.js +1 -1
- package/dist/cjs/article/settings/configs/article-image/settings.js +1 -1
- package/dist/cjs/article/settings/configs/article-image/ui-v2.js +1 -1
- package/dist/cjs/cart/components/CartList.js +1 -1
- package/dist/cjs/cart/index.js +1 -1
- package/dist/cjs/collection/index.js +1 -1
- package/dist/cjs/common/components/Loading.js +1 -1
- package/dist/cjs/common/const.js +1 -1
- package/dist/cjs/common/helpers.js +1 -0
- package/dist/cjs/common/hooks/useElementWidth.js +1 -0
- package/dist/cjs/common/hooks/useLoadingProgress.js +1 -0
- package/dist/cjs/grid/components/row/Row.liquid.js +12 -12
- package/dist/cjs/grid/components/section/Section.js +1 -1
- package/dist/cjs/grid/index.js +1 -1
- package/dist/cjs/header/components/kind/basic/index.js +1 -1
- package/dist/cjs/header/components/kind/modern/index.js +1 -1
- package/dist/cjs/header/index.js +1 -1
- package/dist/cjs/hero-banner/common/styles.js +1 -1
- package/dist/cjs/hero-banner/components/HeroBannerItem.js +1 -1
- package/dist/cjs/hero-banner/components/HeroBannerItem.liquid.js +5 -5
- package/dist/cjs/hero-banner/index.js +1 -1
- package/dist/cjs/image/common/adaptiveSources.js +1 -0
- package/dist/cjs/image/common/attrs.js +1 -1
- package/dist/cjs/image/common/classes.js +1 -1
- package/dist/cjs/image/common/helpers.js +2 -2
- package/dist/cjs/image/common/liquidSrcset.js +1 -0
- package/dist/cjs/image/common/listContext.js +1 -0
- package/dist/cjs/image/common/listImageContext.js +1 -0
- package/dist/cjs/image/common/sizes.js +1 -0
- package/dist/cjs/image/common/srcset.js +1 -0
- package/dist/cjs/image/components/AdaptiveImage.js +1 -1
- package/dist/cjs/image/components/AdaptiveImage.liquid.js +10 -12
- package/dist/cjs/image/components/Image.js +1 -1
- 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 +4 -5
- package/dist/cjs/image/constants.js +1 -1
- package/dist/cjs/image/index.js +1 -1
- package/dist/cjs/image/settings/configs/settings.js +1 -1
- package/dist/cjs/image/settings/configs/ui-v2.js +1 -1
- package/dist/cjs/image-comparison/common/attrs.js +1 -1
- package/dist/cjs/image-comparison/components/CompareImage.js +1 -1
- package/dist/cjs/image-comparison/components/CompareImage.liquid.js +14 -14
- package/dist/cjs/image-comparison/components/ImageComparison.liquid.js +3 -3
- package/dist/cjs/image-comparison/index.js +1 -1
- package/dist/cjs/image-comparison/settings/configs/settings.js +1 -1
- package/dist/cjs/image-comparison/settings/configs/ui-v2.js +1 -1
- package/dist/cjs/post-purchase/callout-banner/index.js +1 -1
- package/dist/cjs/post-purchase/product/components/ProductPrice.js +1 -1
- package/dist/cjs/post-purchase/product/components/ProductQuantity.js +1 -1
- package/dist/cjs/post-purchase/product/components/product-offer/components/ProductOffer.js +1 -1
- package/dist/cjs/post-purchase/product/components/product-offer/helpers/getOfferErrorText.js +1 -0
- package/dist/cjs/post-purchase/product/components/product-offer/hooks/useProductOfferData.js +1 -1
- package/dist/cjs/post-purchase/product/hooks/useHandleQuantity.js +1 -1
- package/dist/cjs/post-purchase/product/index.js +1 -1
- package/dist/cjs/post-purchase/product/settings/product-quantity/configs/settings.js +1 -1
- package/dist/cjs/post-purchase/product/settings/product-quantity/configs/ui-v2.js +1 -1
- package/dist/cjs/product/components/product-badge/ProductBadge.js +1 -1
- package/dist/cjs/product/components/product-badge/common/styles.js +1 -1
- package/dist/cjs/product/components/product-discount-tag/ProductDiscountTag.js +1 -1
- package/dist/cjs/product/components/product-images/ProductImagesLightBox.js +1 -1
- package/dist/cjs/product/components/product-images-v2/common/common.js +1 -1
- package/dist/cjs/product/components/product-images-v2/components/child/ProductFeaturedImageOnly.js +1 -1
- package/dist/cjs/product/components/product-images-v2/components/child/ProductGalleryGrid.js +1 -1
- package/dist/cjs/product/components/product-images-v2/components/feature-gallery/FeatureImageWithGallery.liquid.js +42 -42
- package/dist/cjs/product/components/product-images-v2/components/gallery-carousel/GalleryCarousel.js +1 -1
- package/dist/cjs/product/components/product-images-v2/components/gallery-carousel/GalleryCarousel.liquid.js +13 -13
- package/dist/cjs/product/components/product-images-v2/components/gallery-grid/GalleryGrid.liquid.js +23 -23
- package/dist/cjs/product/components/product-images-v2/components/lightbox/ProductImagesLightBox.js +1 -1
- package/dist/cjs/product/components/product-images-v3/ProductImagesV3.liquid.js +3 -3
- package/dist/cjs/product/components/product-images-v3/common/common.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 -1
- package/dist/cjs/product/components/product-images-v3/components/feature-gallery/FeatureImageWithGallery.liquid.js +39 -39
- package/dist/cjs/product/components/product-images-v3/components/feature-gallery/FeatureImageWithGalleryEmbla.liquid.js +38 -38
- 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 +12 -12
- package/dist/cjs/product/components/product-images-v3/components/gallery-carousel/GalleryCarouselEmbla.liquid.js +12 -12
- package/dist/cjs/product/components/product-images-v3/components/gallery-grid/GalleryGrid.liquid.js +23 -23
- package/dist/cjs/product/components/product-images-v3/components/lightbox/ProductImagesLightBox.js +1 -1
- package/dist/cjs/product/components/product-list/ProductList.js +1 -1
- package/dist/cjs/product/components/product-list/ProductListCarouselLayout.js +1 -1
- package/dist/cjs/product/components/product-list/ProductListCarouselLayout.liquid.js +9 -7
- package/dist/cjs/product/components/product-list/ProductListGridLayout.js +1 -1
- package/dist/cjs/product/components/product-list/ProductListGridLayout.liquid.js +16 -14
- package/dist/cjs/product/components/product-list/common/helpers.js +1 -1
- package/dist/cjs/product/components/product-list/common/imagePriority.js +17 -0
- package/dist/cjs/product/components/product-list/common/imagePriorityHints.js +1 -0
- package/dist/cjs/product/components/product-list-v3/ProductList.js +1 -1
- package/dist/cjs/product/components/product-list-v3/ProductListCarouselLayout.js +1 -1
- package/dist/cjs/product/components/product-list-v3/ProductListCarouselLayout.liquid.js +11 -9
- package/dist/cjs/product/components/product-list-v3/ProductListGridLayout.js +1 -1
- package/dist/cjs/product/components/product-list-v3/ProductListGridLayout.liquid.js +16 -14
- package/dist/cjs/product/components/product-wrap/Product.js +1 -1
- package/dist/cjs/product/components/product-wrap/hook/useProductSetting.js +1 -1
- package/dist/cjs/product/index.js +1 -1
- package/dist/cjs/product/settings/product-image-v2/configs/setting-v2/index.js +1 -1
- package/dist/cjs/product/settings/product-image-v2/configs/ui-v2.js +1 -1
- package/dist/cjs/product/settings/product-image-v3/configs/setting-v2/index.js +1 -1
- package/dist/cjs/product/settings/product-image-v3/configs/ui-v2.js +1 -1
- package/dist/cjs/video/components/HTML5Embed.js +1 -1
- package/dist/cjs/video/components/HTML5Embed.liquid.js +9 -9
- package/dist/cjs/video/components/LiteVimeoEmbed.liquid.js +11 -11
- package/dist/cjs/video/components/LiteYouTubeEmbed.js +1 -1
- package/dist/cjs/video/components/LiteYouTubeEmbed.liquid.js +11 -11
- package/dist/cjs/video/components/Video.liquid.js +1 -1
- package/dist/esm/article/components/ArticleImage.js +1 -1
- package/dist/esm/article/components/ArticleImage.liquid.js +7 -7
- package/dist/esm/article/components/ArticleList.js +1 -1
- package/dist/esm/article/index.js +1 -1
- package/dist/esm/article/settings/configs/article-image/settings.js +1 -1
- package/dist/esm/article/settings/configs/article-image/ui-v2.js +1 -1
- package/dist/esm/cart/components/CartList.js +1 -1
- package/dist/esm/cart/index.js +1 -1
- package/dist/esm/collection/index.js +1 -1
- package/dist/esm/common/components/Loading.js +1 -1
- package/dist/esm/common/const.js +1 -1
- package/dist/esm/common/helpers.js +1 -0
- package/dist/esm/common/hooks/useElementWidth.js +1 -0
- package/dist/esm/common/hooks/useLoadingProgress.js +1 -0
- package/dist/esm/grid/components/row/Row.liquid.js +10 -10
- package/dist/esm/grid/components/section/Section.js +1 -1
- package/dist/esm/grid/index.js +1 -1
- package/dist/esm/header/components/kind/basic/index.js +1 -1
- package/dist/esm/header/components/kind/modern/index.js +1 -1
- package/dist/esm/header/index.js +1 -1
- package/dist/esm/hero-banner/common/styles.js +1 -1
- package/dist/esm/hero-banner/components/HeroBannerItem.js +1 -1
- package/dist/esm/hero-banner/components/HeroBannerItem.liquid.js +10 -10
- package/dist/esm/hero-banner/index.js +1 -1
- package/dist/esm/image/common/adaptiveSources.js +1 -0
- package/dist/esm/image/common/attrs.js +1 -1
- package/dist/esm/image/common/classes.js +1 -1
- package/dist/esm/image/common/helpers.js +2 -2
- package/dist/esm/image/common/liquidSrcset.js +1 -0
- package/dist/esm/image/common/listContext.js +1 -0
- package/dist/esm/image/common/listImageContext.js +1 -0
- package/dist/esm/image/common/sizes.js +1 -0
- package/dist/esm/image/common/srcset.js +1 -0
- package/dist/esm/image/components/AdaptiveImage.js +1 -1
- package/dist/esm/image/components/AdaptiveImage.liquid.js +11 -13
- package/dist/esm/image/components/Image.js +1 -1
- package/dist/esm/image/components/Image.liquid.js +3 -3
- package/dist/esm/image/components/NextImage.js +1 -1
- package/dist/esm/image/components/NextImage.liquid.js +5 -6
- package/dist/esm/image/constants.js +1 -1
- package/dist/esm/image/index.js +1 -1
- package/dist/esm/image/settings/configs/settings.js +1 -1
- package/dist/esm/image/settings/configs/ui-v2.js +1 -1
- package/dist/esm/image-comparison/common/attrs.js +1 -1
- package/dist/esm/image-comparison/components/CompareImage.js +1 -1
- package/dist/esm/image-comparison/components/CompareImage.liquid.js +17 -17
- package/dist/esm/image-comparison/components/ImageComparison.liquid.js +3 -3
- package/dist/esm/image-comparison/index.js +1 -1
- package/dist/esm/image-comparison/settings/configs/settings.js +1 -1
- package/dist/esm/image-comparison/settings/configs/ui-v2.js +1 -1
- package/dist/esm/post-purchase/callout-banner/index.js +1 -1
- package/dist/esm/post-purchase/product/components/ProductPrice.js +1 -1
- package/dist/esm/post-purchase/product/components/ProductQuantity.js +1 -1
- package/dist/esm/post-purchase/product/components/product-offer/components/ProductOffer.js +1 -1
- package/dist/esm/post-purchase/product/components/product-offer/helpers/getOfferErrorText.js +1 -0
- package/dist/esm/post-purchase/product/components/product-offer/hooks/useProductOfferData.js +1 -1
- package/dist/esm/post-purchase/product/hooks/useHandleQuantity.js +1 -1
- package/dist/esm/post-purchase/product/index.js +1 -1
- package/dist/esm/post-purchase/product/settings/product-quantity/configs/settings.js +1 -1
- package/dist/esm/post-purchase/product/settings/product-quantity/configs/ui-v2.js +1 -1
- package/dist/esm/product/components/product-badge/ProductBadge.js +1 -1
- package/dist/esm/product/components/product-badge/common/styles.js +1 -1
- package/dist/esm/product/components/product-discount-tag/ProductDiscountTag.js +1 -1
- package/dist/esm/product/components/product-images/ProductImagesLightBox.js +1 -1
- package/dist/esm/product/components/product-images-v2/common/common.js +1 -1
- package/dist/esm/product/components/product-images-v2/components/child/ProductFeaturedImageOnly.js +1 -1
- package/dist/esm/product/components/product-images-v2/components/child/ProductGalleryGrid.js +1 -1
- package/dist/esm/product/components/product-images-v2/components/feature-gallery/FeatureImageWithGallery.liquid.js +24 -24
- package/dist/esm/product/components/product-images-v2/components/gallery-carousel/GalleryCarousel.js +1 -1
- package/dist/esm/product/components/product-images-v2/components/gallery-carousel/GalleryCarousel.liquid.js +13 -13
- package/dist/esm/product/components/product-images-v2/components/gallery-grid/GalleryGrid.liquid.js +29 -29
- package/dist/esm/product/components/product-images-v2/components/lightbox/ProductImagesLightBox.js +1 -1
- package/dist/esm/product/components/product-images-v3/ProductImagesV3.liquid.js +3 -3
- package/dist/esm/product/components/product-images-v3/common/common.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 -1
- package/dist/esm/product/components/product-images-v3/components/feature-gallery/FeatureImageWithGallery.liquid.js +24 -24
- package/dist/esm/product/components/product-images-v3/components/feature-gallery/FeatureImageWithGalleryEmbla.liquid.js +24 -24
- 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 +5 -5
- package/dist/esm/product/components/product-images-v3/components/gallery-carousel/GalleryCarouselEmbla.liquid.js +5 -5
- package/dist/esm/product/components/product-images-v3/components/gallery-grid/GalleryGrid.liquid.js +30 -30
- package/dist/esm/product/components/product-images-v3/components/lightbox/ProductImagesLightBox.js +1 -1
- package/dist/esm/product/components/product-list/ProductList.js +1 -1
- package/dist/esm/product/components/product-list/ProductListCarouselLayout.js +1 -1
- package/dist/esm/product/components/product-list/ProductListCarouselLayout.liquid.js +11 -9
- package/dist/esm/product/components/product-list/ProductListGridLayout.js +1 -1
- package/dist/esm/product/components/product-list/ProductListGridLayout.liquid.js +18 -16
- package/dist/esm/product/components/product-list/common/helpers.js +1 -1
- package/dist/esm/product/components/product-list/common/imagePriority.js +17 -0
- package/dist/esm/product/components/product-list/common/imagePriorityHints.js +1 -0
- package/dist/esm/product/components/product-list-v3/ProductList.js +1 -1
- package/dist/esm/product/components/product-list-v3/ProductListCarouselLayout.js +1 -1
- package/dist/esm/product/components/product-list-v3/ProductListCarouselLayout.liquid.js +12 -10
- package/dist/esm/product/components/product-list-v3/ProductListGridLayout.js +1 -1
- package/dist/esm/product/components/product-list-v3/ProductListGridLayout.liquid.js +18 -16
- package/dist/esm/product/components/product-wrap/Product.js +1 -1
- package/dist/esm/product/components/product-wrap/hook/useProductSetting.js +1 -1
- package/dist/esm/product/index.js +1 -1
- package/dist/esm/product/settings/product-image-v2/configs/setting-v2/index.js +1 -1
- package/dist/esm/product/settings/product-image-v2/configs/ui-v2.js +1 -1
- package/dist/esm/product/settings/product-image-v3/configs/setting-v2/index.js +1 -1
- package/dist/esm/product/settings/product-image-v3/configs/ui-v2.js +1 -1
- package/dist/esm/video/components/HTML5Embed.js +1 -1
- package/dist/esm/video/components/HTML5Embed.liquid.js +9 -9
- package/dist/esm/video/components/LiteVimeoEmbed.liquid.js +11 -11
- package/dist/esm/video/components/LiteYouTubeEmbed.js +1 -1
- package/dist/esm/video/components/LiteYouTubeEmbed.liquid.js +9 -9
- package/dist/esm/video/components/Video.liquid.js +1 -1
- package/dist/types/index.d.ts +20 -5
- package/package.json +11 -8
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import{getArticleVimeoClasses as e,getImageVimeoClasses as t,getButtonVimeoClasses as s,getIframeVimeoClasses as i}from"../common/classes.js";import{createStateOrContext as r,createStyle as l,createClass as a,If as m}from"@gem-sdk/system";import{getIframeVimeoStyle as o,getArticleVimeoStyle as p}from"../common/styles.js";import{template as c,RenderIf as d,isLocalEnv as n,baseAssetURL as f}from"@gem-sdk/core";import g from"../../image/components/NextImage.liquid.js";import{getSettingPreloadData as y}from"../../helpers.js";import{getVimeoParams as $}from"../common/helpers.js";let h=h=>{let{title:u,id:b,lazy:v,aspectRatio:j,autoplay:S,muted:w,thumbnailLink:x,poster:E,translatedVideoUrl:k
|
|
1
|
+
import{getArticleVimeoClasses as e,getImageVimeoClasses as t,getButtonVimeoClasses as s,getIframeVimeoClasses as i}from"../common/classes.js";import{createStateOrContext as r,createStyle as l,createClass as a,If as m}from"@gem-sdk/system";import{getIframeVimeoStyle as o,getArticleVimeoStyle as p}from"../common/styles.js";import{template as c,RenderIf as d,isLocalEnv as n,baseAssetURL as f}from"@gem-sdk/core";import g from"../../image/components/NextImage.liquid.js";import{getSettingPreloadData as y}from"../../helpers.js";import{getVimeoParams as $}from"../common/helpers.js";let h=h=>{let{title:u,id:b,lazy:v,aspectRatio:j,autoplay:S,muted:w,thumbnailLink:x,poster:E,translatedVideoUrl:k}=h,{iframeSrc:N}=$(h),A=!v,I=h.thumbnail,T=r({id:b,thumbnail:x,lazy:v,iframeSrc:N,title:u,autoplay:S,muted:w,style:h?.vimeoStyleIframe||"",translatedVideoUrl:k}),V=l({...o(j)}),C=l({...p(j,"")}),G=a({...e(I,j)}),L=a({...t(A)}),M=a({...s(A)}),O=a({...i()});return c`
|
|
2
2
|
<gp-lite-vimeo-embed>
|
|
3
|
-
<script gp-data type="application/json">${JSON.stringify(
|
|
3
|
+
<script gp-data type="application/json">${JSON.stringify(T)}</script>
|
|
4
4
|
<article
|
|
5
5
|
aria-hidden
|
|
6
|
-
class="${
|
|
6
|
+
class="${G}"
|
|
7
7
|
data-title="${u}"
|
|
8
|
-
style="${
|
|
8
|
+
style="${C}"
|
|
9
9
|
>
|
|
10
|
-
${g({src:
|
|
11
|
-
${m(!
|
|
12
|
-
<button type="button" class="${
|
|
10
|
+
${g({src:I,alt:E?.altText,title:E?.imageTitle,className:L,isDisableAspectStyle:!0,priority:E?.preload,height:E?.height,width:E?.width})}
|
|
11
|
+
${m(!A,c`
|
|
12
|
+
<button type="button" class="${M}" aria-label="Play">
|
|
13
13
|
<svg class="gp-w-5 gp-text-white" viewBox="0 0 24 24">
|
|
14
14
|
<path
|
|
15
15
|
fill="currentColor"
|
|
@@ -17,15 +17,15 @@ import{getArticleVimeoClasses as e,getImageVimeoClasses as t,getButtonVimeoClass
|
|
|
17
17
|
/>
|
|
18
18
|
</svg>
|
|
19
19
|
</button>`)}
|
|
20
|
-
${m(
|
|
20
|
+
${m(A,c`
|
|
21
21
|
<iframe
|
|
22
|
-
style="${
|
|
22
|
+
style="${V}"
|
|
23
23
|
title="${u}"
|
|
24
24
|
frameborder="0"
|
|
25
25
|
allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture"
|
|
26
26
|
allowfullscreen
|
|
27
|
-
src="${
|
|
28
|
-
class="${
|
|
27
|
+
src="${N}"
|
|
28
|
+
class="${O}"
|
|
29
29
|
></iframe>`)}
|
|
30
30
|
</article>
|
|
31
31
|
</gp-lite-vimeo-embed>
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import{jsxs as e,jsx as t}from"react/jsx-runtime";import{useEditorMode as r}from"@gem-sdk/core";import a from"react-youtube";import{getButtonYoutubeClasses as o,getImageYoutubeClasses as i,getArticleYoutubeClasses as l,getIframeYoutubeClasses as s,getYoutubeContentClasses as m}from"../common/classes.js";import{getYoutubeParams as n,isSettingLoop as c,covertStrParamsToObj as u}from"../common/helpers.js";import{getIframeYoutubeStyle as d,getArticleYoutubeStyle as p}from"../common/styles.js";import f from"../hooks/useLiteYoutubeEmbed.js";import{createClass as y,createStyle as h}from"@gem-sdk/system";import
|
|
2
|
+
import{jsxs as e,jsx as t}from"react/jsx-runtime";import{useEditorMode as r}from"@gem-sdk/core";import a from"react-youtube";import{getButtonYoutubeClasses as o,getImageYoutubeClasses as i,getArticleYoutubeClasses as l,getIframeYoutubeClasses as s,getYoutubeContentClasses as m}from"../common/classes.js";import{getYoutubeParams as n,isSettingLoop as c,covertStrParamsToObj as u}from"../common/helpers.js";import{getIframeYoutubeStyle as d,getArticleYoutubeStyle as p}from"../common/styles.js";import f from"../hooks/useLiteYoutubeEmbed.js";import{createClass as y,createStyle as h}from"@gem-sdk/system";import b from"../../image/components/NextImage.js";let g=g=>{let C=r(),v="edit"!==C,{style:w,poster:N,iframeClass:j,wrapperClass:k,title:x}=g,{preload:B}=N||{},{videoId:S,paramsImp:E,posterUrl:T,iframeSrc:V}=n(g),{iframe:H,intervalPlay:I,warmConnections:M,isVideoStarted:D,videoDuration:L,addIframe:P}=f(g,E,S),Y=y({...o(H)}),z=y({...i()}),A=y({...l(B&&v||!1,k)}),F=y({...s(j)}),O=h({...d(w)}),R=h({...p(w,T)}),q=y({...m()});return e("article",{"aria-hidden":!0,className:A,"data-title":x,style:R,onPointerOver:M,onClick:P,children:[t(b,{src:T,alt:N?.altText,title:N?.imageTitle,priority:v&&B,className:z,isDisableAspectStyle:!0}),t("button",{type:"button","aria-label":"Play",className:Y,children:e("svg",{height:"100%",version:"1.1",viewBox:"0 0 68 48",width:"100%",children:[t("path",{d:"M66.52,7.74c-0.78-2.93-2.49-5.41-5.42-6.19C55.79,.13,34,0,34,0S12.21,.13,6.9,1.55 C3.97,2.33,2.27,4.81,1.48,7.74C0.06,13.05,0,24,0,24s0.06,10.95,1.48,16.26c0.78,2.93,2.49,5.41,5.42,6.19 C12.21,47.87,34,48,34,48s21.79-0.13,27.1-1.55c2.93-0.78,4.64-3.26,5.42-6.19C67.94,34.95,68,24,68,24S67.94,13.05,66.52,7.74z",fill:"#f00"}),t("path",{d:"M 45,24 27,14 27,34",fill:"#fff"})]})}),H&&(()=>{if(g.isHeroBanner&&c(E))return t(a,{videoId:S,title:x,iframeClassName:F,style:O,className:q,opts:{host:"https://www.youtube-nocookie.com",playerVars:{autoplay:1,state:1,controls:0,mute:1,...u(E)}},onReady:e=>{if(e.target.playVideo(),L.current=Math.floor(e.target.getDuration()),g.isHeroBanner){let t=e.target.getIframe();if(t){let e=t.closest("div.hero-banner-container");if(e){let r=new CustomEvent("youtube-iframe-ready",{detail:{iframe:t},bubbles:!0,cancelable:!0});e.dispatchEvent(r)}}}},onStateChange:e=>{let t=e.target;D.current||(t.playVideo(),D.current=!0,I(e)),0===e.data&&(L.current=t.getCurrentTime(),t.playVideo(),I(e))}});let e=t("iframe",{className:F,style:O,title:x,frameBorder:"0",allow:"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,src:V});return g.isHeroBanner?t("div",{className:q,children:e}):e})()]})};export{g as default};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import{getButtonYoutubeClasses as e,getImageYoutubeClasses as t,getArticleYoutubeClasses as s,getIframeYoutubeClasses as r,getYoutubeContentClasses as i}from"../common/classes.js";import{createStateOrContext as a,createClass as l,createStyle as o,If as p}from"@gem-sdk/system";import{getIframeYoutubeStyle as m,getArticleYoutubeStyle as c}from"../common/styles.js";import{RenderIf as d,isLocalEnv as n,baseAssetURL as u,template as
|
|
1
|
+
import{getButtonYoutubeClasses as e,getImageYoutubeClasses as t,getArticleYoutubeClasses as s,getIframeYoutubeClasses as r,getYoutubeContentClasses as i}from"../common/classes.js";import{createStateOrContext as a,createClass as l,createStyle as o,If as p}from"@gem-sdk/system";import{getIframeYoutubeStyle as m,getArticleYoutubeStyle as c}from"../common/styles.js";import{RenderIf as d,isLocalEnv as n,baseAssetURL as u,template as f}from"@gem-sdk/core";import y from"../../image/components/NextImage.liquid.js";import{getSettingPreloadData as $}from"../../helpers.js";import{getYoutubeParams as g}from"../common/helpers.js";let b=b=>{let{style:h,iframeClass:v,wrapperClass:S,title:j,poster:w,translatedVideoUrl:C,autoplay:E}=b,k=`gp-video-${b.uid}`,{posterUrl:x,iframeSrc:z}=g(b),B=!!b.thumbnail,N=w?.preload,T=a({lazy:b.lazy,hasThumbnail:B,style:h,title:j,iframeSrc:z,translatedVideoUrl:C,autoplay:E,isHeroBanner:b.isHeroBanner}),A=!b.lazy&&(!B||!!b.autoplay),H=l({...e(A)}),M=l({...t()}),G=l({...s(N||!1,S)}),I=l({...r(v)}),O=o({...m(h)}),P=o({...c(h,x)}),_=l({...i()});return f`
|
|
2
2
|
<gp-lite-youtube-embed>
|
|
3
|
-
<script gp-data type="application/json">${JSON.stringify(
|
|
3
|
+
<script gp-data type="application/json">${JSON.stringify(T)}</script>
|
|
4
4
|
<article
|
|
5
5
|
aria-hidden
|
|
6
|
-
class="${
|
|
6
|
+
class="${G}"
|
|
7
7
|
data-title="${j}"
|
|
8
8
|
style="${P}"
|
|
9
9
|
>
|
|
10
|
-
${
|
|
11
|
-
<button type="button" aria-label="Play" class="${
|
|
10
|
+
${y({id:k,src:x,alt:w?.altText,title:w?.imageTitle,priority:w?.preload,className:M,isDisableAspectStyle:!0})}
|
|
11
|
+
<button type="button" aria-label="Play" class="${H}">
|
|
12
12
|
<svg height="100%" version="1.1" viewBox="0 0 68 48" width="100%">
|
|
13
13
|
<path
|
|
14
14
|
d="M66.52,7.74c-0.78-2.93-2.49-5.41-5.42-6.19C55.79,.13,34,0,34,0S12.21,.13,6.9,1.55 C3.97,2.33,2.27,4.81,1.48,7.74C0.06,13.05,0,24,0,24s0.06,10.95,1.48,16.26c0.78,2.93,2.49,5.41,5.42,6.19 C12.21,47.87,34,48,34,48s21.79-0.13,27.1-1.55c2.93-0.78,4.64-3.26,5.42-6.19C67.94,34.95,68,24,68,24S67.94,13.05,66.52,7.74z"
|
|
@@ -17,18 +17,18 @@ import{getButtonYoutubeClasses as e,getImageYoutubeClasses as t,getArticleYoutub
|
|
|
17
17
|
<path d="M 45,24 27,14 27,34" fill="#fff"></path>
|
|
18
18
|
</svg>
|
|
19
19
|
</button>
|
|
20
|
-
${p(
|
|
20
|
+
${p(A,(()=>{let e=f`
|
|
21
21
|
<iframe
|
|
22
22
|
id="player-wrapper-${b.uid}"
|
|
23
|
-
class="${
|
|
23
|
+
class="${I}"
|
|
24
24
|
style="${O}"
|
|
25
25
|
title="${j}"
|
|
26
26
|
frameborder="0"
|
|
27
27
|
allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture"
|
|
28
28
|
allowfullscreen
|
|
29
|
-
src="${
|
|
29
|
+
src="${z}"
|
|
30
30
|
></iframe>
|
|
31
|
-
`;return b.isHeroBanner?
|
|
31
|
+
`;return b.isHeroBanner?f`
|
|
32
32
|
<div class="${_}">${e}</div>
|
|
33
33
|
`:e})())}
|
|
34
34
|
</article>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import{getSettingTranslatedVideoAndThumbnail as t,getAspectRatioSettings as e,getVimeoVideoId as o,vimeoVideoRegex as i,getYoutubeVideoId as s,youtubeVideoRegex as l,parseTimeVideo as m,fallbackImageVideoUrl as a}from"../common/helpers.js";import{template as r,hasTranslatedLiquid as d}from"@gem-sdk/core";import{getStyle as u,getYoutubeStyle as n,getVimeoStyle as c,getHtml5Style as p,getFallBackImageStyle as f}from"../common/styles.js";import{getFallbackImageClasses as y,getClasses as b}from"../common/classes.js";import{createAttr as j,createStyle as h,createClass as k}from"@gem-sdk/system";import V from"../../image/components/NextImage.liquid.js";import{getImageSrc as $}from"../../image/common/helpers.js";import v from"./LiteYouTubeEmbed.liquid.js";import g from"./LiteVimeoEmbed.liquid.js";import L from"./HTML5Embed.liquid.js";import{getAttr as N}from"../common/attrs.js";let q=({className:q,setting:C,style:x,builderAttrs:z,builderProps:E,advanced:F,pageContext:I})=>{let R=t({setting:C,uid:E?.uid,pageContext:I??{}}),{youtubeUrl:w="",vimeoUrl:T="",html5Url:U,autoplay:H=!1,loopVideo:M=!1,controls:O=!1,mute:P,poster:S,startTime:Y,endTime:A,lazy:B,type:D}=R??{},{youtubeUrlTranslated:G,vimeoUrlTranslated:J}=R,K=$(S),{cssClass:Q}=F??{},W=e(R?.ratioOptions,R?.aspectRatio),X=j({...N({uid:E?.uid||""})}),Z=h({...u(R,x)}),_=h({...n(W)}),tt=h({...c(W)}),te=h({...p(W)}),to=h({...f(C?.aspectRatio)}),ti=k({...y()}),ts=k({...b({className:q,builderProps:E,isInstantLP:!1,advancedCssClass:Q})});return r`
|
|
2
2
|
<div
|
|
3
3
|
${{...z}} ${{...X}} class="${ts}" style="${Z}">
|
|
4
|
-
${(()=>{switch(D){case"youtube":{let t=s(w),e=d(G);if((!l.test(w)||!t)&&!e)return V({src:a,alt:"Fallback video",className:ti,style:to});let o="";return M&&(o+=`&loop=1&playlist=${t}`),Y&&(o+=`&start=${m(Y)}`),A&&(o+=`&end=${m(A)}`),v({uid:E?.uid,id:t??"",translatedVideoUrl:e?G:"",autoplay:H,title:"Video",controls:O,params:o,adNetwork:!1,noCookie:!0,muted:!P,thumbnail:K,lazy:B??!0,poster:S,style:_
|
|
4
|
+
${(()=>{switch(D){case"youtube":{let t=s(w),e=d(G);if((!l.test(w)||!t)&&!e)return V({src:a,alt:"Fallback video",className:ti,style:to});let o="";return M&&(o+=`&loop=1&playlist=${t}`),Y&&(o+=`&start=${m(Y)}`),A&&(o+=`&end=${m(A)}`),v({uid:E?.uid,id:t??"",translatedVideoUrl:e?G:"",autoplay:H,title:"Video",controls:O,params:o,adNetwork:!1,noCookie:!0,muted:!P,thumbnail:K,lazy:B??!0,poster:S,style:_})}case"vimeo":{let t=o(T),e=d(J);if((!i.test(T)||!t)&&!e)return V({src:a,alt:"Fallback video",className:ti,style:to});return g({muted:!P,loop:M,controls:O,thumbnail:K,thumbnailLink:S?.src,autoplay:H,lazy:B??!0,id:t??"",translatedVideoUrl:e?J:"",title:"Video",aspectRatio:W,poster:S,vimeoStyleIframe:tt})}case"html5":if(!U)return V({src:a,alt:"Fallback video",className:ti,style:to});return L({uid:E?.uid,muted:!P,loop:M,controls:O,autoplay:H,src:U,thumbnail:K,title:"Video",poster:S,lazy:B??!0,isVideoComponent:!0,style:te})}})()}
|
|
5
5
|
</div>
|
|
6
6
|
`};export{q as default};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -101,6 +101,19 @@ type SharedProps = {
|
|
|
101
101
|
};
|
|
102
102
|
type MixedProps$1 = Omit<React.ImgHTMLAttributes<HTMLImageElement>, 'children' | 'width' | 'height' | 'as' | 'src' | 'srcSet'>;
|
|
103
103
|
type ImgProps = SharedProps & MixedProps$1;
|
|
104
|
+
type ImageSizeTarget = 'Image' | 'HeroBanner' | 'ImageComparison' | 'ProductFeatureImage' | 'GalleryList' | 'ArticleImage';
|
|
105
|
+
/** The sidebar "Quality" setting shared by Image, ImageComparison and ProductImages. */
|
|
106
|
+
type ImageQualityProps = {
|
|
107
|
+
qualityType?: ObjectDevices<QualityType$3 | string>;
|
|
108
|
+
qualityPercent?: ObjectDevices<number | string>;
|
|
109
|
+
};
|
|
110
|
+
/**
|
|
111
|
+
* `sizeTarget` picks the per-device `srcset` width table; Quality scales it
|
|
112
|
+
* (High 1, Medium 0.7, Custom percent/100, Finest = original file only).
|
|
113
|
+
*/
|
|
114
|
+
type ImageSizeProps = ImageQualityProps & {
|
|
115
|
+
sizeTarget?: ImageSizeTarget;
|
|
116
|
+
};
|
|
104
117
|
type ImageStyleProps$1 = {
|
|
105
118
|
shape?: ObjectDevices<SizeSettingGlobal>;
|
|
106
119
|
customAspectRadio?: ObjectDevices<Ratio>;
|
|
@@ -163,8 +176,8 @@ type ImageProps = BasePropsWrap<ImageSettingProps$1, ImageStyleProps$1> & {
|
|
|
163
176
|
onLoad?: React.ReactEventHandler<any>;
|
|
164
177
|
} & {
|
|
165
178
|
advanced?: any;
|
|
166
|
-
}
|
|
167
|
-
type ImageLiquidProps = ImageProps & {
|
|
179
|
+
} & Pick<ImageSizeProps, 'sizeTarget'>;
|
|
180
|
+
type ImageLiquidProps = ImageProps & Pick<ImageSizeProps, 'sizeTarget'> & {
|
|
168
181
|
pageContext?: PageContext;
|
|
169
182
|
};
|
|
170
183
|
|
|
@@ -3319,6 +3332,7 @@ declare const PostPurchaseProductPriceBreakdown: React.FC<PostPurchaseProductPri
|
|
|
3319
3332
|
type PostPurchaseProductQuantitySettingProps = {
|
|
3320
3333
|
title?: string;
|
|
3321
3334
|
defaultQtyValue?: number;
|
|
3335
|
+
updatePrice?: boolean;
|
|
3322
3336
|
};
|
|
3323
3337
|
type PostPurchaseProductQuantityStyleProps = {
|
|
3324
3338
|
fullWidth?: ObjectDevices<boolean>;
|
|
@@ -3495,13 +3509,13 @@ type PostPurchaseProductPriceProps = BasePropsWrap<PostPurchaseProductPriceSetti
|
|
|
3495
3509
|
children?: ReactNode;
|
|
3496
3510
|
};
|
|
3497
3511
|
|
|
3498
|
-
declare const PostPurchaseProductQuantity: React.FC<PostPurchaseProductQuantityProps>;
|
|
3512
|
+
declare const PostPurchaseProductQuantity: React$1.FC<PostPurchaseProductQuantityProps>;
|
|
3499
3513
|
|
|
3500
3514
|
declare const PostPurchaseProductImages: (props: PostPurchaseProductImagesProps) => React.JSX.Element;
|
|
3501
3515
|
|
|
3502
3516
|
declare const PostPurchaseProductTitle: React.FC<PostPurchaseProductTitleProps>;
|
|
3503
3517
|
|
|
3504
|
-
declare const PostPurchaseProductPrice: React.FC<PostPurchaseProductPriceProps>;
|
|
3518
|
+
declare const PostPurchaseProductPrice: React$1.FC<PostPurchaseProductPriceProps>;
|
|
3505
3519
|
|
|
3506
3520
|
declare const PostPurchaseAcceptButton: (props: PostPurchaseButtonProps) => React.JSX.Element;
|
|
3507
3521
|
|
|
@@ -4186,6 +4200,7 @@ type ProductBadgeStyleProps = {
|
|
|
4186
4200
|
};
|
|
4187
4201
|
type ProductBadgeProps = BasePropsWrap<ProductBadgeSettingProps, ProductBadgeStyleProps> & {
|
|
4188
4202
|
isInsideProductImage?: boolean;
|
|
4203
|
+
isInsideImageList?: boolean;
|
|
4189
4204
|
navigationPosition?: ObjectDevices<'inside' | 'outside' | 'none'>;
|
|
4190
4205
|
children?: React.ReactNode;
|
|
4191
4206
|
imageData: {
|
|
@@ -6814,7 +6829,7 @@ declare const IconListHoz: (props: IconListHozProps) => string;
|
|
|
6814
6829
|
|
|
6815
6830
|
declare const IconListV2$1: (props: IconListProps) => string;
|
|
6816
6831
|
|
|
6817
|
-
declare const Image$1: ({ style, styles, setting, advanced, className, pageContext, builderAttrs, builderProps, }: ImageLiquidProps) => string;
|
|
6832
|
+
declare const Image$1: ({ style, styles, setting, advanced, className, sizeTarget, pageContext, builderAttrs, builderProps, }: ImageLiquidProps) => string;
|
|
6818
6833
|
|
|
6819
6834
|
declare const ImageComparison$1: ({ setting, styles, builderProps, advanced, pageContext, ...props }: ImageComparisonProps) => string;
|
|
6820
6835
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gem-sdk/components",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "24.0.0-staging.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "dist/cjs/index.js",
|
|
@@ -12,16 +12,18 @@
|
|
|
12
12
|
"prebuild": "yarn cleanup",
|
|
13
13
|
"build": "rollup -c ./scripts/rollup.config.mjs --environment NODE_ENV:production",
|
|
14
14
|
"cleanup": "rimraf es dist lib",
|
|
15
|
-
"format": "
|
|
15
|
+
"format": "oxfmt \"./src/**/*.{ts,tsx}\"",
|
|
16
16
|
"generate-tailwind": "node ./scripts/generateTailwind.js",
|
|
17
17
|
"i18n:extract": "rollup -c ./scripts/rollup.config.settings.mjs && node ./scripts/translate/extract-texts-to-locales.js && node ./scripts/translate/en-keys-usage.js",
|
|
18
18
|
"lint": "oxlint --format=stylish ./src",
|
|
19
19
|
"post:publish": "node ./scripts/convert-publish.js",
|
|
20
20
|
"pre:publish": "node ./scripts/convert-publish.js -p",
|
|
21
21
|
"relationship": "rollup -c ./scripts/rollup.config.settings.mjs && node ./scripts/element-relationship/index.js",
|
|
22
|
-
"test": "jest -c ./../../helpers/jest.config.ts",
|
|
22
|
+
"test": "jest -c ./../../helpers/jest.config.ts && yarn test:data",
|
|
23
|
+
"test:data": "NODE_OPTIONS=--experimental-vm-modules GP_BASE_ASSET_URL=https://assets.gemcommerce.xyz jest -c ./../../helpers/jest.config.ts --testPathPatterns data.liquid.test",
|
|
24
|
+
"test:data:update": "yarn test:data -u",
|
|
23
25
|
"test:watch": "jest -c ./../../helpers/jest.config.ts --watch",
|
|
24
|
-
"type-check": "
|
|
26
|
+
"type-check": "tsc --noEmit",
|
|
25
27
|
"update-img-src-3rd": "node ./scripts/update-img-src-3rd.js",
|
|
26
28
|
"watch": "rollup -c ./scripts/rollup.config.mjs -w"
|
|
27
29
|
},
|
|
@@ -32,9 +34,10 @@
|
|
|
32
34
|
"react-youtube": "10.1.0"
|
|
33
35
|
},
|
|
34
36
|
"devDependencies": {
|
|
35
|
-
"@gem-sdk/core": "
|
|
36
|
-
"@gem-sdk/styles": "
|
|
37
|
-
"@gem-sdk/system": "
|
|
37
|
+
"@gem-sdk/core": "24.0.0-staging.0",
|
|
38
|
+
"@gem-sdk/styles": "24.0.0-staging.0",
|
|
39
|
+
"@gem-sdk/system": "24.0.0-staging.0",
|
|
40
|
+
"@shopify/prettier-plugin-liquid": "^1.10.3",
|
|
38
41
|
"@thedutchcoder/postcss-rem-to-px": "0.0.2",
|
|
39
42
|
"@types/react-transition-group": "^4.4.12",
|
|
40
43
|
"autoprefixer": "10.4.23",
|
|
@@ -45,7 +48,7 @@
|
|
|
45
48
|
"postcss-prefixwrap": "1.57.2"
|
|
46
49
|
},
|
|
47
50
|
"peerDependencies": {
|
|
48
|
-
"next": "
|
|
51
|
+
"next": "16.4.2"
|
|
49
52
|
},
|
|
50
53
|
"module": "dist/esm/index.js",
|
|
51
54
|
"exports": {
|