@gem-sdk/components 2.0.0-dev.693 → 2.0.0-dev.694

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.
Files changed (176) hide show
  1. package/dist/cjs/builder.js +6 -12
  2. package/dist/cjs/index.js +32 -34
  3. package/dist/cjs/index.liquid.js +10 -16
  4. package/dist/cjs/next.js +1 -3
  5. package/dist/cjs/product/components/ProductImagesV2/common/common.js +2 -1
  6. package/dist/cjs/product/index.js +4 -6
  7. package/dist/cjs/product/next.js +0 -4
  8. package/dist/cjs/setting.js +76 -78
  9. package/dist/esm/builder.js +0 -6
  10. package/dist/esm/index.js +0 -1
  11. package/dist/esm/index.liquid.js +0 -3
  12. package/dist/esm/next.js +1 -3
  13. package/dist/esm/product/components/ProductImagesV2/common/common.js +2 -1
  14. package/dist/esm/product/index.js +24 -26
  15. package/dist/esm/product/next.js +0 -4
  16. package/dist/esm/setting.js +0 -2
  17. package/dist/types/index.d.ts +116 -551
  18. package/package.json +1 -1
  19. package/dist/cjs/product/components/ProductImagesV3/common/common.js +0 -360
  20. package/dist/cjs/product/components/ProductImagesV3/common/getAttr.js +0 -192
  21. package/dist/cjs/product/components/ProductImagesV3/common/getBorderActiveCss.js +0 -26
  22. package/dist/cjs/product/components/ProductImagesV3/common/getClasses.js +0 -94
  23. package/dist/cjs/product/components/ProductImagesV3/common/getStyle.js +0 -303
  24. package/dist/cjs/product/components/ProductImagesV3/common/hoverAction.js +0 -95
  25. package/dist/cjs/product/components/ProductImagesV3/common/productFeaturedImage.js +0 -59
  26. package/dist/cjs/product/components/ProductImagesV3/common/productGallery.js +0 -266
  27. package/dist/cjs/product/components/ProductImagesV3/components/child/MediaIcon.js +0 -63
  28. package/dist/cjs/product/components/ProductImagesV3/components/child/ProductFeatureVideo.js +0 -36
  29. package/dist/cjs/product/components/ProductImagesV3/components/child/ProductFeaturedImageCarousel.js +0 -109
  30. package/dist/cjs/product/components/ProductImagesV3/components/child/ProductFeaturedImageOnly.js +0 -139
  31. package/dist/cjs/product/components/ProductImagesV3/components/child/ProductGalleryGrid.js +0 -100
  32. package/dist/cjs/product/components/ProductImagesV3/components/feature-gallery/FeatureImageWithGallery.js +0 -77
  33. package/dist/cjs/product/components/ProductImagesV3/components/feature-gallery/FeatureImageWithGallery.liquid.js +0 -300
  34. package/dist/cjs/product/components/ProductImagesV3/components/feature-only/OnlyFeatureImage.js +0 -44
  35. package/dist/cjs/product/components/ProductImagesV3/components/gallery-carousel/GalleryCarousel.js +0 -83
  36. package/dist/cjs/product/components/ProductImagesV3/components/gallery-carousel/GalleryCarousel.liquid.js +0 -182
  37. package/dist/cjs/product/components/ProductImagesV3/components/gallery-grid/GalleryGrid.js +0 -30
  38. package/dist/cjs/product/components/ProductImagesV3/components/gallery-grid/GalleryGrid.liquid.js +0 -239
  39. package/dist/cjs/product/components/ProductImagesV3/components/lightbox/ButtonOpenLightBox.js +0 -28
  40. package/dist/cjs/product/components/ProductImagesV3/components/lightbox/ProductImagesLightBox.js +0 -144
  41. package/dist/cjs/product/components/ProductImagesV3/composables/getProductImagesAttr.js +0 -14
  42. package/dist/cjs/product/components/ProductImagesV3/composables/getProductImagesClassName.js +0 -54
  43. package/dist/cjs/product/components/ProductImagesV3/composables/getProductImagesStyles.js +0 -53
  44. package/dist/cjs/product/components/ProductImagesV3/hooks/useFeatureImageWithGallery.js +0 -55
  45. package/dist/cjs/product/components/ProductImagesV3/hooks/useFilterImagesByVariant.js +0 -41
  46. package/dist/cjs/product/components/ProductImagesV3/hooks/useGalleryCarousel.js +0 -134
  47. package/dist/cjs/product/components/ProductImagesV3/hooks/useProductFeaturedImageCarousel.js +0 -203
  48. package/dist/cjs/product/components/ProductImagesV3/hooks/useProductGalleryGrid.js +0 -87
  49. package/dist/cjs/product/components/ProductImagesV3/index.js +0 -291
  50. package/dist/cjs/product/components/ProductImagesV3/index.liquid.js +0 -153
  51. package/dist/cjs/product/setting/product-image-v3/ProductFeatureImage.js +0 -252
  52. package/dist/cjs/product/setting/product-image-v3/ProductGalleryImage.js +0 -251
  53. package/dist/cjs/product/setting/product-image-v3/ProductImages.js +0 -74
  54. package/dist/cjs/product/setting/product-image-v3/configs/setting-v2/ProductFeatureImage.js +0 -388
  55. package/dist/cjs/product/setting/product-image-v3/configs/setting-v2/ProductGalleryImage.js +0 -519
  56. package/dist/cjs/product/setting/product-image-v3/configs/setting-v2/index.js +0 -337
  57. package/dist/cjs/product/setting/product-image-v3/configs/ui/FeatureNavigation.js +0 -118
  58. package/dist/cjs/product/setting/product-image-v3/configs/ui/ImageListNavigation.js +0 -119
  59. package/dist/cjs/product/setting/product-image-v3/configs/uiV1.js +0 -237
  60. package/dist/cjs/product/setting/product-image-v3/configs/uiV2.js +0 -491
  61. package/dist/cjs/swiper-carousel/arrow/Arrow.js +0 -52
  62. package/dist/cjs/swiper-carousel/arrow/Arrow.liquid.js +0 -46
  63. package/dist/cjs/swiper-carousel/arrow/common/common.js +0 -119
  64. package/dist/cjs/swiper-carousel/arrow/common/getClass.js +0 -50
  65. package/dist/cjs/swiper-carousel/arrow/common/getStyle.js +0 -84
  66. package/dist/cjs/swiper-carousel/carousel-item/SwiperItem.js +0 -34
  67. package/dist/cjs/swiper-carousel/carousel-item/SwiperItem.liquid.js +0 -38
  68. package/dist/cjs/swiper-carousel/carousel-item/common/getClass.js +0 -29
  69. package/dist/cjs/swiper-carousel/carousel-item/common/getStyle.js +0 -79
  70. package/dist/cjs/swiper-carousel/carousel-item/hook/useCarouseItem.js +0 -22
  71. package/dist/cjs/swiper-carousel/components/common/carousel.js +0 -98
  72. package/dist/cjs/swiper-carousel/components/const/index.js +0 -5
  73. package/dist/cjs/swiper-carousel/components/hooks/useTrackPreviewPause.js +0 -34
  74. package/dist/cjs/swiper-carousel/components/plugins/AnimationPlugin.js +0 -42
  75. package/dist/cjs/swiper-carousel/components/plugins/AutoPlayPlugin.js +0 -105
  76. package/dist/cjs/swiper-carousel/components/plugins/FixSliderMoveBackwards.js +0 -15
  77. package/dist/cjs/swiper-carousel/components/plugins/MutationPlugin.js +0 -45
  78. package/dist/cjs/swiper-carousel/dots/Dots.js +0 -51
  79. package/dist/cjs/swiper-carousel/dots/Dots.liquid.js +0 -26
  80. package/dist/cjs/swiper-carousel/dots/common/common.js +0 -28
  81. package/dist/cjs/swiper-carousel/dots/common/getClass.js +0 -40
  82. package/dist/cjs/swiper-carousel/dots/common/getStyle.js +0 -33
  83. package/dist/cjs/swiper-carousel/dots/hook/useDotsSetting.js +0 -21
  84. package/dist/cjs/swiper-carousel/index.js +0 -17
  85. package/dist/cjs/swiper-carousel/next.js +0 -22
  86. package/dist/cjs/swiper-carousel/root/Swiper.js +0 -128
  87. package/dist/cjs/swiper-carousel/root/Swiper.liquid.js +0 -104
  88. package/dist/cjs/swiper-carousel/root/common/getAttr.js +0 -25
  89. package/dist/cjs/swiper-carousel/root/common/getClass.js +0 -135
  90. package/dist/cjs/swiper-carousel/root/common/getData.js +0 -56
  91. package/dist/cjs/swiper-carousel/root/common/getStyle.js +0 -66
  92. package/dist/cjs/swiper-carousel/root/hook/useCarousel.js +0 -482
  93. package/dist/cjs/swiper-carousel/setting/Swiper.js +0 -42
  94. package/dist/cjs/swiper-carousel/setting/SwiperItem.js +0 -40
  95. package/dist/cjs/swiper-carousel/setting/configs/presets.js +0 -87
  96. package/dist/cjs/swiper-carousel/setting/configs/settingV2.js +0 -822
  97. package/dist/cjs/swiper-carousel/setting/configs/uiV2.js +0 -718
  98. package/dist/esm/product/components/ProductImagesV3/common/common.js +0 -344
  99. package/dist/esm/product/components/ProductImagesV3/common/getAttr.js +0 -189
  100. package/dist/esm/product/components/ProductImagesV3/common/getBorderActiveCss.js +0 -24
  101. package/dist/esm/product/components/ProductImagesV3/common/getClasses.js +0 -83
  102. package/dist/esm/product/components/ProductImagesV3/common/getStyle.js +0 -292
  103. package/dist/esm/product/components/ProductImagesV3/common/hoverAction.js +0 -92
  104. package/dist/esm/product/components/ProductImagesV3/common/productFeaturedImage.js +0 -53
  105. package/dist/esm/product/components/ProductImagesV3/common/productGallery.js +0 -251
  106. package/dist/esm/product/components/ProductImagesV3/components/child/MediaIcon.js +0 -59
  107. package/dist/esm/product/components/ProductImagesV3/components/child/ProductFeatureVideo.js +0 -32
  108. package/dist/esm/product/components/ProductImagesV3/components/child/ProductFeaturedImageCarousel.js +0 -105
  109. package/dist/esm/product/components/ProductImagesV3/components/child/ProductFeaturedImageOnly.js +0 -135
  110. package/dist/esm/product/components/ProductImagesV3/components/child/ProductGalleryGrid.js +0 -96
  111. package/dist/esm/product/components/ProductImagesV3/components/feature-gallery/FeatureImageWithGallery.js +0 -73
  112. package/dist/esm/product/components/ProductImagesV3/components/feature-gallery/FeatureImageWithGallery.liquid.js +0 -296
  113. package/dist/esm/product/components/ProductImagesV3/components/feature-only/OnlyFeatureImage.js +0 -40
  114. package/dist/esm/product/components/ProductImagesV3/components/gallery-carousel/GalleryCarousel.js +0 -79
  115. package/dist/esm/product/components/ProductImagesV3/components/gallery-carousel/GalleryCarousel.liquid.js +0 -178
  116. package/dist/esm/product/components/ProductImagesV3/components/gallery-grid/GalleryGrid.js +0 -26
  117. package/dist/esm/product/components/ProductImagesV3/components/gallery-grid/GalleryGrid.liquid.js +0 -235
  118. package/dist/esm/product/components/ProductImagesV3/components/lightbox/ButtonOpenLightBox.js +0 -24
  119. package/dist/esm/product/components/ProductImagesV3/components/lightbox/ProductImagesLightBox.js +0 -140
  120. package/dist/esm/product/components/ProductImagesV3/composables/getProductImagesAttr.js +0 -12
  121. package/dist/esm/product/components/ProductImagesV3/composables/getProductImagesClassName.js +0 -52
  122. package/dist/esm/product/components/ProductImagesV3/composables/getProductImagesStyles.js +0 -51
  123. package/dist/esm/product/components/ProductImagesV3/hooks/useFeatureImageWithGallery.js +0 -53
  124. package/dist/esm/product/components/ProductImagesV3/hooks/useFilterImagesByVariant.js +0 -39
  125. package/dist/esm/product/components/ProductImagesV3/hooks/useGalleryCarousel.js +0 -132
  126. package/dist/esm/product/components/ProductImagesV3/hooks/useProductFeaturedImageCarousel.js +0 -201
  127. package/dist/esm/product/components/ProductImagesV3/hooks/useProductGalleryGrid.js +0 -85
  128. package/dist/esm/product/components/ProductImagesV3/index.js +0 -287
  129. package/dist/esm/product/components/ProductImagesV3/index.liquid.js +0 -149
  130. package/dist/esm/product/setting/product-image-v3/ProductFeatureImage.js +0 -248
  131. package/dist/esm/product/setting/product-image-v3/ProductGalleryImage.js +0 -248
  132. package/dist/esm/product/setting/product-image-v3/ProductImages.js +0 -70
  133. package/dist/esm/product/setting/product-image-v3/configs/setting-v2/ProductFeatureImage.js +0 -384
  134. package/dist/esm/product/setting/product-image-v3/configs/setting-v2/ProductGalleryImage.js +0 -516
  135. package/dist/esm/product/setting/product-image-v3/configs/setting-v2/index.js +0 -335
  136. package/dist/esm/product/setting/product-image-v3/configs/ui/FeatureNavigation.js +0 -116
  137. package/dist/esm/product/setting/product-image-v3/configs/ui/ImageListNavigation.js +0 -117
  138. package/dist/esm/product/setting/product-image-v3/configs/uiV1.js +0 -235
  139. package/dist/esm/product/setting/product-image-v3/configs/uiV2.js +0 -489
  140. package/dist/esm/swiper-carousel/arrow/Arrow.js +0 -48
  141. package/dist/esm/swiper-carousel/arrow/Arrow.liquid.js +0 -42
  142. package/dist/esm/swiper-carousel/arrow/common/common.js +0 -111
  143. package/dist/esm/swiper-carousel/arrow/common/getClass.js +0 -48
  144. package/dist/esm/swiper-carousel/arrow/common/getStyle.js +0 -82
  145. package/dist/esm/swiper-carousel/carousel-item/SwiperItem.js +0 -30
  146. package/dist/esm/swiper-carousel/carousel-item/SwiperItem.liquid.js +0 -34
  147. package/dist/esm/swiper-carousel/carousel-item/common/getClass.js +0 -27
  148. package/dist/esm/swiper-carousel/carousel-item/common/getStyle.js +0 -77
  149. package/dist/esm/swiper-carousel/carousel-item/hook/useCarouseItem.js +0 -20
  150. package/dist/esm/swiper-carousel/components/common/carousel.js +0 -93
  151. package/dist/esm/swiper-carousel/components/const/index.js +0 -3
  152. package/dist/esm/swiper-carousel/components/hooks/useTrackPreviewPause.js +0 -30
  153. package/dist/esm/swiper-carousel/components/plugins/AnimationPlugin.js +0 -35
  154. package/dist/esm/swiper-carousel/components/plugins/AutoPlayPlugin.js +0 -103
  155. package/dist/esm/swiper-carousel/components/plugins/FixSliderMoveBackwards.js +0 -13
  156. package/dist/esm/swiper-carousel/components/plugins/MutationPlugin.js +0 -43
  157. package/dist/esm/swiper-carousel/dots/Dots.js +0 -47
  158. package/dist/esm/swiper-carousel/dots/Dots.liquid.js +0 -22
  159. package/dist/esm/swiper-carousel/dots/common/common.js +0 -26
  160. package/dist/esm/swiper-carousel/dots/common/getClass.js +0 -38
  161. package/dist/esm/swiper-carousel/dots/common/getStyle.js +0 -31
  162. package/dist/esm/swiper-carousel/dots/hook/useDotsSetting.js +0 -19
  163. package/dist/esm/swiper-carousel/index.js +0 -15
  164. package/dist/esm/swiper-carousel/next.js +0 -18
  165. package/dist/esm/swiper-carousel/root/Swiper.js +0 -124
  166. package/dist/esm/swiper-carousel/root/Swiper.liquid.js +0 -100
  167. package/dist/esm/swiper-carousel/root/common/getAttr.js +0 -23
  168. package/dist/esm/swiper-carousel/root/common/getClass.js +0 -133
  169. package/dist/esm/swiper-carousel/root/common/getData.js +0 -54
  170. package/dist/esm/swiper-carousel/root/common/getStyle.js +0 -64
  171. package/dist/esm/swiper-carousel/root/hook/useCarousel.js +0 -480
  172. package/dist/esm/swiper-carousel/setting/Swiper.js +0 -38
  173. package/dist/esm/swiper-carousel/setting/SwiperItem.js +0 -36
  174. package/dist/esm/swiper-carousel/setting/configs/presets.js +0 -85
  175. package/dist/esm/swiper-carousel/setting/configs/settingV2.js +0 -818
  176. package/dist/esm/swiper-carousel/setting/configs/uiV2.js +0 -713
@@ -1,296 +0,0 @@
1
- import { makeStyleResponsive, template, cls } from '@gem-sdk/core';
2
- import { getAspectRatio, getPaddingBottomByShapeSetting, getSrcImage } from '../../common/common.js';
3
- import { checkRenderFeaturedCarousel, getZoomImageClass, getZoomLenClass } from '../../common/productFeaturedImage.js';
4
- import HTML5Embed from '../../../../../video/components/HTML5Embed.liquid.js';
5
- import Model3d from '../../../../../image/components/Modal3d.liquid.js';
6
- import NextImage from '../../../../../image/components/NextImage.liquid.js';
7
- import Video from '../../../../../image/components/Video.liquid.js';
8
- import { getStyleOfObject } from '../../../../helpers/function.js';
9
- import { getProductImagesStyles } from '../../composables/getProductImagesStyles.js';
10
- import { getProductImagesClassName } from '../../composables/getProductImagesClassName.js';
11
- import { getProductImagesAttr } from '../../composables/getProductImagesAttr.js';
12
- import { LiquidIf, LiquidFor, Liquid, If } from '@gem-sdk/system';
13
- import CarouselItem from '../../../../../swiper-carousel/carousel-item/SwiperItem.liquid.js';
14
- import Carousel from '../../../../../swiper-carousel/root/Swiper.liquid.js';
15
-
16
- const FeatureImageWithGallery = ({ builderPropUID, children, enableLazyLoadImage, ...setting })=>{
17
- const { featuredImageCarouselClasses, galleryItemClasses, featuredCarouselItemClasses } = getProductImagesClassName(setting);
18
- const { featuredImageCarouselStyle, featureImageStyle, featureImageCarouselOnlyOneImageStyle, featureImageOnlyOneImageStyle, featureImageCarouselItemStyle } = getProductImagesStyles(setting);
19
- const { featuredImageCarouselSettingAttrs } = getProductImagesAttr(setting);
20
- const ftAspectRatio = getAspectRatio(setting.ftShape);
21
- const renderFeatured = ()=>{
22
- return `
23
- {% case featureMedia.media_type %}
24
- {% when 'image' %}
25
- ${renderImageWithHoverAction()}
26
- {% when 'external_video' %}
27
- {% assign mediaSourceVideo = featureMedia | external_video_url %}
28
- ${renderExternalVideo()}
29
- {% when 'video' %}
30
- {% assign mediaSourceVideo = featureMedia.sources.last.url %}
31
- ${renderVideo()}
32
- {% when 'model' %}
33
- ${renderModel3d()}
34
- {% else %}
35
- ${renderNoImage()}
36
- {% endcase %}
37
- `;
38
- };
39
- const renderModel3d = ()=>{
40
- return Model3d({
41
- src: LiquidIf(`featureMedia.sources.first.url contains '.glb'`, `{{ featureMedia.sources.first.url }}`, `{{featureMedia.sources.last.url}}`),
42
- alt: '{{featureMedia.preview_image.alt}}',
43
- poster: `{{featureMedia.preview_image.src | product_img_url: '1024x1024'}}`,
44
- cameraControls: true,
45
- arStatus: 'not-presenting',
46
- style: {
47
- width: '100%'
48
- },
49
- aspectRatio: ftAspectRatio
50
- });
51
- };
52
- const renderExternalVideo = ()=>{
53
- return Video({
54
- src: `{{mediaSourceVideo}}`,
55
- alt: '{{featureMedia.alt}}',
56
- autoplay: false,
57
- allowfullscreen: true,
58
- controls: true,
59
- style: {
60
- width: '100%',
61
- height: '100%'
62
- },
63
- aspectRatio: ftAspectRatio
64
- });
65
- };
66
- const renderVideo = ()=>{
67
- return HTML5Embed({
68
- src: `{{mediaSourceVideo}}`,
69
- title: '{{featureMedia.alt}}',
70
- autoplay: false,
71
- controls: true,
72
- style: {
73
- width: '100%',
74
- 'max-height': '100%'
75
- }
76
- });
77
- };
78
- const renderImageWithHoverAction = ()=>{
79
- return template`
80
- ${renderFeaturedImageOnly(cls('gp-w-full gp-transition-opacity', {
81
- 'group-hover:gp-opacity-0': setting.hoverEffect == 'other'
82
- }, `{{shouldHidden}}`))}
83
- ${If(setting?.hoverEffect !== 'none', `<div class="${cls('zoom-element !gp-max-w-none', getZoomImageClass())}">
84
- ${renderFeaturedImageOnly('image-zoom', true)}
85
- </div>`, ' ')}
86
- ${If(setting?.hoverEffect == 'zoom' && setting?.zoomType == 'glasses', `<div class="${cls('zoom-lens-element', getZoomLenClass())}" style="opacity: 0; background-image: url('{{ featureMedia.src | img_url: "1024x1024"}}')"></div>`, ' ')}
87
- `;
88
- };
89
- const renderFeaturedImageOnly = (className, hasHoverEffect)=>{
90
- return template`
91
- {% assign src = featureMedia.src %}
92
- ${If(hasHoverEffect && setting.hoverEffect == 'other', `{% assign otherImage = product.media[${setting.otherImage}] %}
93
- {% assign src = otherImage.src %}
94
- ${LiquidIf(`otherImage.media_type != 'image'`, `{% assign src = otherImage.preview_image.src %}`)}
95
- `)}
96
- ${NextImage({
97
- srcIsLiquidCode: true,
98
- src: LiquidIf(`src != null`, getSrcImage('src'), `{{ 'https://cdn.shopify.com/s/assets/no-image-2048-5e88c1b20e087fb7bbe9a3771824e743c244f437e4f8ba93bbf7b11b53f7824c_large.gif' }}`),
99
- id: LiquidIf(`featureMedia != null`, `{{featureMedia.id}}`),
100
- width: `{{featureMedia.width}}`,
101
- height: `{{featureMedia.height}}`,
102
- alt: `{{featureMedia.alt}}`,
103
- srcset: `${getSrcImage('src')}`,
104
- baseSrc: `{{src | image_url}}`,
105
- sizes: `(max-width: 768px) 50vw, 100vw`,
106
- setting: {
107
- layout: setting?.ftLayout,
108
- aspectRatio: ftAspectRatio,
109
- qualityType: setting?.qualityType,
110
- qualityPercent: setting?.qualityPercent
111
- },
112
- priority: setting?.preload,
113
- className: `gp-w-full gp-h-full gp-absolute gp-top-0 gp-left-0 featured-image-only gp-cursor-pointer !gp-rounded-none ${className}`,
114
- enableLazyLoadImage
115
- })}`;
116
- };
117
- const renderNoImage = ()=>{
118
- return template`
119
- ${NextImage({
120
- srcIsLiquidCode: true,
121
- src: 'https://cdn.shopify.com/s/assets/no-image-2048-5e88c1b20e087fb7bbe9a3771824e743c244f437e4f8ba93bbf7b11b53f7824c_large.gif',
122
- alt: `No Image`,
123
- sizes: `(max-width: 768px) 50vw, 100vw`,
124
- setting: {
125
- layout: setting?.ftLayout,
126
- aspectRatio: ftAspectRatio,
127
- qualityType: setting?.qualityType,
128
- qualityPercent: setting?.qualityPercent
129
- },
130
- priority: setting?.preload,
131
- className: `gp-w-full gp-h-full gp-absolute gp-top-0 gp-left-0 featured-image-only gp-cursor-pointer !gp-rounded-none`,
132
- enableLazyLoadImage
133
- })}`;
134
- };
135
- const paddingBottomValue = getPaddingBottomByShapeSetting(setting.ftShape);
136
- const renderCarouselGalleryItem = (className)=>{
137
- return `
138
- ${Liquid(`{% assign productImageWidth = 0 %}
139
- {% case featureMedia.media_type %}
140
- {% when 'image' %}
141
- {% assign productImageWidth = featureMedia.width %}
142
- {% else %}
143
- {% assign productImageWidth = featureMedia.preview_image.width %}
144
- {% endcase %}`)}
145
- ${CarouselItem({
146
- id: '{{section.id}}-{{imageID}}',
147
- contentType: 'productImage',
148
- className: `${galleryItemClasses(`gp-ft-image-item ${className}`)}`,
149
- parentId: `${builderPropUID}-{{section.id}}-{{product.id}}`,
150
- style: featureImageCarouselItemStyle,
151
- customStyle: {
152
- width: '{{productImageWidth}}px'
153
- },
154
- children: `
155
- <div
156
- class="gp-w-full gp-relative ${LiquidIf(`featureMedia == null or featureMedia.media_type == 'image'`, `{{ 'gp-h-0' }}`, `{{ 'gp-h-full !gp-pb-0' }}`)}"
157
- style="${getStyleOfObject(makeStyleResponsive('pb', paddingBottomValue))} ${LiquidIf(`featureMedia.media_type == 'video' or featureMedia.media_type == 'external_video'`, `{{ 'display: flex; align-items: center; justify-content: center' }}`)}"
158
- >
159
- ${renderFeatured()}
160
- </div>
161
- `
162
- })}`;
163
- };
164
- const isRenderFeatureCarousel = checkRenderFeaturedCarousel(setting);
165
- const FEATURE_IMAGE_WRAPPER_CLASS = 'gp-featured-image-wrapper';
166
- const carouselChildren = LiquidIf(`product.media.size > 0`, `${LiquidFor(`media in product.media`, `${children || ''} {% assign largestRatio = 0 %}
167
- ${LiquidFor(`featureMedia in product.media`, `{% assign height = featureMedia.height | times: 1.0 %}
168
- {% assign width = featureMedia.width | times: 1.0 %}
169
- {% assign ratio = height | divided_by: width %}
170
- ${LiquidIf(`ratio > largestRatio`, `{% assign largestRatio = ratio %}`)}`)}
171
- ${LiquidFor(`featureMedia in product.media`, `${LiquidIf(`featureMedia.media_type == 'image'`, `${LiquidFor(`image in product.images`, LiquidIf(`image.src == featureMedia.src`, `{% assign imageID = image.id %}{% break %}`))}`, `{% assign imageID = '' %}`)}
172
- ${renderCarouselGalleryItem()}`)}`)}`, NextImage({
173
- src: `{{ 'https://cdn.shopify.com/s/assets/no-image-2048-5e88c1b20e087fb7bbe9a3771824e743c244f437e4f8ba93bbf7b11b53f7824c_large.gif' }}`,
174
- id: `noImageError`,
175
- width: `480`,
176
- height: `480`,
177
- alt: `no image`,
178
- priority: setting?.preload,
179
- setting: {
180
- layout: setting?.ftLayout,
181
- aspectRatio: ftAspectRatio,
182
- qualityType: setting?.qualityType,
183
- qualityPercent: setting?.qualityPercent
184
- },
185
- style: {
186
- height: '100%'
187
- },
188
- className: `gp-w-full featured-image-only !gp-rounded-none`,
189
- customLazyload: true,
190
- enableLazyLoadImage
191
- }));
192
- const renderFeatureImageCarousel = ()=>{
193
- return `
194
- ${Carousel({
195
- builderProps: {
196
- uid: builderPropUID
197
- },
198
- rootId: `ft-${builderPropUID}-{{section.id}}-{{product.id}}`,
199
- conditionAppendJs: 'product.media.size > 1',
200
- wrapperClass: FEATURE_IMAGE_WRAPPER_CLASS,
201
- rootClass: `${featuredImageCarouselClasses}`,
202
- rootAttrs: {
203
- type: 'gp-feature-image-carousel',
204
- 'product-id': '{{product.id}}',
205
- 'product-media': '{{product.media.size}}'
206
- },
207
- isHiddenArrowWhenDisabled: true,
208
- setting: featuredImageCarouselSettingAttrs,
209
- rootStyles: featureImageStyle,
210
- styles: featuredImageCarouselStyle,
211
- style: {
212
- playSpeed: 600
213
- },
214
- disableMarginAuto: true,
215
- children: carouselChildren
216
- })}
217
- `;
218
- };
219
- const getVariantByPreDisplay = ()=>{
220
- switch(setting?.preDisplay){
221
- case '1st-images':
222
- return `
223
- {% assign featureMedia = product.media.first %}
224
- `;
225
- case '1st-3d-mode':
226
- return LiquidFor(`media in product.media`, LiquidIf(`media.media_type == 'model'`, `{% assign featureMedia = media %}{% break %}`));
227
- case '1st-video':
228
- return LiquidFor(`media in product.media`, LiquidIf(`media.media_type == 'video' or media.media_type == 'external_video'`, `{% assign featureMedia = media %}{% break %}`));
229
- default:
230
- return `
231
- {% assign featureMedia = variant.featured_media %}
232
- {% unless featureMedia %}
233
- {% assign featureMedia = product.featured_media %}
234
- {% endunless %}
235
- `;
236
- }
237
- };
238
- const renderFeatureImageCarouselOnlyOneImage = ()=>{
239
- return Liquid(`
240
- {% assign featureMedia = variant.featured_media %}
241
- {% unless featureMedia %}
242
- {% assign featureMedia = product.featured_media %}
243
- {% endunless %}
244
- ${LiquidIf(`product.media.size > 1`, getVariantByPreDisplay())}
245
- {% assign largestRatio = 0 %}
246
- {% assign height = featureMedia.height | times: 1.0 %}
247
- {% assign width = featureMedia.width | times: 1.0 %}
248
- {% assign ratio = height | divided_by: width %}
249
- ${LiquidIf(`ratio > largestRatio`, `{% assign largestRatio = ratio %}`)}
250
- {% assign productImageWidth = 0 %}
251
- {% case featureMedia.media_type %}
252
- {% when 'image' %}
253
- {% assign productImageWidth = featureMedia.width %}
254
- {% else %}
255
- {% assign productImageWidth = featureMedia.preview_image.width %}
256
- {% endcase %}
257
- ${LiquidIf(`featureMedia == null`, `{% assign productImageWidth = 1600 %}`)}
258
- <div
259
- class='gp-feature-image-carousel gp-feature-image-only'
260
- style="${getStyleOfObject(featureImageStyle)}"
261
- >
262
- <div
263
- class="gp-relative"
264
- style="${getStyleOfObject(featureImageOnlyOneImageStyle)}"
265
- >
266
- ${children}
267
- <div
268
- type="gp-feature-image-only"
269
- product-id="{{product.id}}"
270
- product-media="{{product.media.size}}"
271
- class="${featuredCarouselItemClasses(FEATURE_IMAGE_WRAPPER_CLASS)}
272
- style="${getStyleOfObject(featureImageCarouselOnlyOneImageStyle)}"
273
- >
274
- <div
275
- class="gp-w-full gp-relative ${LiquidIf(`featureMedia == null or featureMedia.media_type == 'image'`, `{{ 'gp-h-0' }}`, `{{ 'gp-h-full !gp-pb-0' }}`)}"
276
- style="${getStyleOfObject(makeStyleResponsive('pb', paddingBottomValue))} ${LiquidIf(`featureMedia.media_type == 'video' or featureMedia.media_type == 'external_video'`, `{{ 'display: flex; align-items: center; justify-content: center' }}`)}"
277
- >
278
- ${renderFeatured()}
279
- </div>
280
- </div>
281
- </div>
282
- </div>
283
- `);
284
- };
285
- return Liquid(`
286
- {% capture featureImageOnlyOne %}
287
- ${renderFeatureImageCarouselOnlyOneImage()}
288
- {% endcapture %}
289
- ${LiquidIf(`product.media.size > 1`, `
290
- ${If(isRenderFeatureCarousel, renderFeatureImageCarousel(), ' ')}
291
- ${If(!isRenderFeatureCarousel, `{{ featureImageOnlyOne }}`, ' ')}
292
- `, `{{ featureImageOnlyOne }}`)}
293
- `);
294
- };
295
-
296
- export { FeatureImageWithGallery as default };
@@ -1,40 +0,0 @@
1
- 'use client';
2
- import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
3
- import ProductFeaturedImageCarousel from '../child/ProductFeaturedImageCarousel.js';
4
- import { getProductImagesClassName } from '../../composables/getProductImagesClassName.js';
5
- import { getProductImagesStyles } from '../../composables/getProductImagesStyles.js';
6
-
7
- const OnlyFeatureImage = (productImageProps)=>{
8
- const { setting, styles, gallery, builderProps, noDataChildren, onHandleClickImage, children } = productImageProps;
9
- const settings = {
10
- ...setting,
11
- ...styles
12
- };
13
- if (gallery?.[0]?.id === 'noImageError') {
14
- return /*#__PURE__*/ jsx(Fragment, {
15
- children: noDataChildren
16
- });
17
- }
18
- // eslint-disable-next-line react-hooks/rules-of-hooks
19
- const { featureImageOnlyOneImageClasses } = getProductImagesClassName(settings);
20
- // eslint-disable-next-line react-hooks/rules-of-hooks
21
- const { featureImageStyle } = getProductImagesStyles(settings);
22
- return /*#__PURE__*/ jsxs("div", {
23
- className: featureImageOnlyOneImageClasses,
24
- style: featureImageStyle,
25
- children: [
26
- /*#__PURE__*/ jsx(ProductFeaturedImageCarousel, {
27
- productImages: gallery,
28
- ...settings,
29
- onHandleClick: (imageID, enableOpenLightBox)=>{
30
- onHandleClickImage(imageID || '', enableOpenLightBox);
31
- },
32
- builderPropUID: builderProps?.uid,
33
- builderPropsClass: `gp-product-images-gallery-${builderProps?.uid}`
34
- }),
35
- children
36
- ]
37
- });
38
- };
39
-
40
- export { OnlyFeatureImage as default };
@@ -1,79 +0,0 @@
1
- import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
2
- import { useCurrentDevice } from '@gem-sdk/core';
3
- import { getAspectRatio } from '../../common/common.js';
4
- import { getEditorMinHeightClass } from '../../common/productGallery.js';
5
- import { getProductImagesClassName } from '../../composables/getProductImagesClassName.js';
6
- import { getProductImagesStyles } from '../../composables/getProductImagesStyles.js';
7
- import { getProductImagesAttr } from '../../composables/getProductImagesAttr.js';
8
- import { isFeatureMedia } from '../../common/productFeaturedImage.js';
9
- import MediaIcon from '../child/MediaIcon.js';
10
- import ButtonOpenLightBox from '../lightbox/ButtonOpenLightBox.js';
11
- import NextImage from '../../../../../image/components/NextImage.js';
12
- import Carousel from '../../../../../carousel/root/Carousel.js';
13
- import CarouselItem from '../../../../../carousel/carousel-item/CarouselItem.js';
14
- import { useGalleryCarousel } from '../../hooks/useGalleryCarousel.js';
15
- import { If } from '@gem-sdk/system';
16
-
17
- const ProductGalleryCarousel = (props)=>{
18
- const { builderPropUID, productImages, // onHandleClick,
19
- activeIndexFormFeatureImage, onClickFeatureArrow, builderPropsClass, arrow, priorityFeatureImage, ...setting } = props;
20
- const currentDevice = useCurrentDevice();
21
- const { galleryItemClasses } = getProductImagesClassName(setting);
22
- const { galleryCarouselSettingAttrs } = getProductImagesAttr(setting);
23
- const { galleryCarouselStyle, galleryCarouselItemStyle } = getProductImagesStyles(setting);
24
- const { moveToIdx, isDisplay, shapeByLayout, isEnableBorderActive, isShowButtonLightbox, filteredProductImages, handleClickCarouselItem } = useGalleryCarousel(props);
25
- return /*#__PURE__*/ jsx(Fragment, {
26
- children: isDisplay && /*#__PURE__*/ jsx(Carousel, {
27
- parentClass: builderPropsClass,
28
- rootClass: builderPropsClass,
29
- setting: galleryCarouselSettingAttrs,
30
- styles: galleryCarouselStyle,
31
- slidesClass: getEditorMinHeightClass(currentDevice, setting.position, setting.navigationPosition),
32
- builderProps: {
33
- uid: `${builderPropUID}-carousel`
34
- },
35
- moveToIdx: moveToIdx,
36
- isHiddenArrowWhenDisabled: true,
37
- disableMarginAuto: true,
38
- children: filteredProductImages?.map((image, index)=>{
39
- const canActive = index === moveToIdx;
40
- const imageSrc = isFeatureMedia(image.contentType) ? image.previewImage : image.src;
41
- return /*#__PURE__*/ jsxs(CarouselItem, {
42
- contentType: "productImage",
43
- className: galleryItemClasses(`gp-gallery-image-item gem-slider-item-${builderPropUID} ${canActive && isEnableBorderActive ? 'gem-slider-item-active' : ''}`),
44
- onClickItem: ()=>handleClickCarouselItem(image?.id),
45
- style: galleryCarouselItemStyle,
46
- "data-id": image?.id,
47
- "data-border": canActive && !!setting?.borderActive ? 'active' : 'deactive',
48
- children: [
49
- /*#__PURE__*/ jsx(NextImage, {
50
- draggable: "false",
51
- src: imageSrc,
52
- width: image?.width,
53
- height: image?.height,
54
- alt: image?.alt,
55
- setting: {
56
- aspectRatio: getAspectRatio(shapeByLayout),
57
- layout: setting?.layout,
58
- qualityPercent: setting?.qualityPercent,
59
- qualityType: setting?.qualityType
60
- },
61
- style: {
62
- width: '100%',
63
- height: '100%',
64
- cursor: 'pointer'
65
- },
66
- className: "product-list-image"
67
- }),
68
- /*#__PURE__*/ jsx(MediaIcon, {
69
- contentType: image?.contentType || ''
70
- }),
71
- If(isShowButtonLightbox, /*#__PURE__*/ jsx(ButtonOpenLightBox, {}))
72
- ]
73
- }, image?.id);
74
- })
75
- })
76
- });
77
- };
78
-
79
- export { ProductGalleryCarousel as default };
@@ -1,178 +0,0 @@
1
- import { template, makeStyleResponsive, getResponsiveValueByScreen } from '@gem-sdk/core';
2
- import NextImage from '../../../../../image/components/NextImage.liquid.js';
3
- import { getPaddingBottomByShapeSetting, getDisplayStyle, getAspectRatio, getSrcImage } from '../../common/common.js';
4
- import { getShapeByLayout, getMinHeightByPosition, checkDisplayGalleryByWidth, getZoomDisplay, getCarouselVerticalConfigByPosition } from '../../common/productGallery.js';
5
- import { getStyleOfObject } from '../../../../helpers/function.js';
6
- import { getProductImagesStyles } from '../../composables/getProductImagesStyles.js';
7
- import { getProductImagesClassName } from '../../composables/getProductImagesClassName.js';
8
- import { getProductImagesAttr } from '../../composables/getProductImagesAttr.js';
9
- import { LiquidIf, LiquidFor } from '@gem-sdk/system';
10
- import 'react/jsx-runtime';
11
- import 'react';
12
- import 'next/link';
13
- import '../../../../../accordion/components/common/classes.js';
14
- import 'html-react-parser';
15
- import '../../../../../marquee/common/classes.js';
16
- import '../../../constants/product-bundle.js';
17
- import '../../../ProductBadge/types.js';
18
- import '../../../ProductBadge/constants.js';
19
- import '../../../ProductBadge/utils/shape.js';
20
- import '../../../ProductBundle/common/styles.js';
21
- import '../../../ProductBundle/common/classes.js';
22
- import '../../../ProductButton/common/types.js';
23
- import CarouselItem from '../../../../../swiper-carousel/carousel-item/SwiperItem.liquid.js';
24
- import Carousel from '../../../../../swiper-carousel/root/Swiper.liquid.js';
25
-
26
- const ProductGalleryCarousel = ({ builderPropUID, children, enableLazyLoadImage, ...setting })=>{
27
- const { featuredImageGalleryClasses, galleryItemClasses } = getProductImagesClassName(setting);
28
- const { galleryCarouselSettingAttrs } = getProductImagesAttr(setting);
29
- const { galleryCarouselStyle, galleryCarouselItemStyle } = getProductImagesStyles(setting);
30
- const getCarouselDisplay = ()=>{
31
- const isDisplayCarousel = (type, position, device)=>{
32
- const layout = getResponsiveValueByScreen(position, device);
33
- const typeDevice = getResponsiveValueByScreen(type, device);
34
- const isDisplayTypeSlider = typeDevice === 'slider' && (layout === 'bottom-center' || layout === 'inside-bottom');
35
- const isHorizontalLayout = [
36
- 'left',
37
- 'right',
38
- 'inside-left',
39
- 'inside-right'
40
- ].includes(layout ?? '');
41
- return isHorizontalLayout || isDisplayTypeSlider;
42
- };
43
- const isDisplayByWidth = checkDisplayGalleryByWidth({
44
- shapeByLayout
45
- });
46
- const isDisplay = {
47
- desktop: isDisplayByWidth.desktop && isDisplayCarousel(setting.type, setting.position, 'desktop'),
48
- tablet: isDisplayByWidth.tablet && isDisplayCarousel(setting.type, setting.position, 'tablet'),
49
- mobile: isDisplayByWidth.mobile && isDisplayCarousel(setting.type, setting.position, 'mobile')
50
- };
51
- return getDisplayStyle((device)=>!isDisplay[device], 'flex');
52
- };
53
- const shapeByLayout = getShapeByLayout({
54
- shape: setting.shape,
55
- shapeForBottom: setting.shapeForBottom,
56
- shapeFor1Col: setting.shapeFor1Col,
57
- shapeFor2Col: setting.shapeFor2Col,
58
- shapeForFtOnly: setting.shapeForFtOnly,
59
- shapeForInsideBottom: setting.shapeForInsideBottom,
60
- shapeForInside: setting.shapeForInside
61
- }, setting.position);
62
- const renderImage = (setting, style)=>{
63
- return template`${NextImage({
64
- srcIsLiquidCode: true,
65
- src: `${getSrcImage('media.preview_image')}`,
66
- width: `{{media.width}}`,
67
- height: `{{media.height}}`,
68
- alt: '{{media.alt}}',
69
- setting: setting,
70
- baseSrc: '{{media.preview_image | image_url}}',
71
- customLazyload: true,
72
- style: style,
73
- className: '!gp-rounded-none gp-w-full gp-h-full gp-absolute gp-top-0 gp-left-0 gp-cursor-pointer',
74
- enableLazyLoadImage
75
- })}`;
76
- };
77
- const paddingBottomValue = getPaddingBottomByShapeSetting(shapeByLayout);
78
- const renderCarouselGalleryItem = (className)=>{
79
- return `
80
- ${LiquidIf(`media.media_type == 'video'`, `{% assign mediaSourceUrl = media.sources.last.url %}`)}
81
- ${LiquidIf(`media.media_type == 'external_video'`, `{% assign mediaSourceUrl = media | external_video_url %}`)}
82
- ${LiquidIf(`media.media_type == 'image'`, `{% assign mediaSourceUrl = media.src %}`)}
83
- ${CarouselItem({
84
- id: '{{imageID}}',
85
- contentType: 'productImage',
86
- className: `${galleryItemClasses(`gp-gallery-image-item ${className}`)}`,
87
- parentId: `${builderPropUID}-{{product.id}}`,
88
- builderAttrs: {
89
- 'data-outline': className ? 'active' : 'deactive'
90
- },
91
- style: galleryCarouselItemStyle,
92
- children: `
93
- <div class="gp-w-full gp-relative"
94
- style="${getStyleOfObject(makeStyleResponsive('pb', paddingBottomValue))};"
95
- >
96
- ${renderImage({
97
- aspectRatio: getAspectRatio(shapeByLayout),
98
- layout: setting?.layout,
99
- qualityPercent: setting?.qualityPercent,
100
- qualityType: setting?.qualityType
101
- }, {
102
- width: '100%',
103
- height: '100%',
104
- cursor: 'pointer'
105
- })}
106
-
107
- ${LiquidIf(`media.media_type == 'video' or media.media_type == 'external_video'`, `<div class="gp-absolute gp-pb-1 gp-pr-1 gp-right-0 gp-bottom-0" >
108
- <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
109
- <rect opacity="0.9" width="24" height="24" rx="3" fill="#212121"/>
110
- <path d="M17.6869 12.2646L17.6868 12.2646L6.78379 18.4464C6.78378 18.4464 6.78376 18.4464 6.78374 18.4464C6.52931 18.5903 6.1665 18.4179 6.1665 18.0416V5.95844C6.1665 5.58218 6.52917 5.40981 6.7836 5.55354C6.78366 5.55357 6.78373 5.55361 6.78379 5.55365L17.6868 11.7354L17.6869 11.7354C17.8819 11.846 17.8819 12.154 17.6869 12.2646Z" stroke="#F9F9F9" stroke-miterlimit="10"/>
111
- </svg>
112
- </div>`)}
113
- ${LiquidIf(`media.media_type == 'model'`, `<div class="gp-absolute gp-pb-1 gp-pr-1 gp-right-0 gp-bottom-0">
114
- <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
115
- <rect opacity="0.9" width="24" height="24" rx="3" fill="#212121"/>
116
- <path fill-rule="evenodd" clip-rule="evenodd" d="M11.7441 4.57034C11.9017 4.47655 12.098 4.47655 12.2555 4.57034L18.5889 8.33957C18.7404 8.42971 18.8332 8.59296 18.8332 8.76923V15.2308C18.8332 15.407 18.7404 15.5703 18.5889 15.6604L12.2555 19.4297C12.098 19.5234 11.9017 19.5234 11.7441 19.4297L5.41079 15.6604C5.25932 15.5703 5.1665 15.407 5.1665 15.2308V8.76923C5.1665 8.59296 5.25932 8.42971 5.41079 8.33957L11.7441 4.57034ZM6.1665 9.64865V14.9465L11.4998 18.1206V12.8227L6.1665 9.64865ZM12.4998 12.8227V18.1206L17.8332 14.9465V9.64865L12.4998 12.8227ZM17.3555 8.76923L11.9998 11.9566L6.64417 8.76923L11.9998 5.58185L17.3555 8.76923Z" fill="#F9F9F9"/>
117
- </svg>
118
- </div>`)}
119
-
120
- <div class="gp-absolute gp-inset-0 gp-flex gp-cursor-pointer gp-items-center gp-justify-center gp-bg-black/50 gp-opacity-0 gp-transition-opacity gp-duration-100 group-hover:gp-opacity-100"
121
- style="${getStyleOfObject(getZoomDisplay(setting?.clickOpenLightBox))}"
122
- >
123
- <svg
124
- height="100%"
125
- width="100%"
126
- xmlns="http://www.w3.org/2000/svg"
127
- class="gp-h-6 gp-w-6"
128
- viewBox="0 0 512 512"
129
- color="#fff"
130
- ><path
131
- fill="currentColor"
132
- stroke-linecap="round"
133
- stroke-linejoin="round"
134
- d="M62.2467 345.253C43.7072 326.714 29.1474 305.116 18.9714 281.057C8.42839 256.13 3.08301 229.671 3.08301 202.418C3.08301 175.165 8.43012 148.707 18.974 123.78C29.15 99.7213 43.7098 78.123 62.2485 59.5834C80.788 41.0439 102.386 26.4841 126.445 16.3081C151.372 5.76422 177.831 0.417969 205.084 0.417969C232.337 0.417969 258.794 5.76421 283.722 16.3064C307.78 26.4823 329.379 41.0422 347.918 59.5817C366.458 78.1212 381.017 99.7196 391.194 123.778C401.737 148.706 407.083 175.163 407.083 202.417C407.083 229.671 401.737 256.129 391.194 281.056C388.406 287.648 385.277 294.048 381.839 300.257L493.397 411.815C514.091 432.511 514.091 466.187 493.395 486.883L484.272 496.006C474.245 506.032 460.915 511.553 446.738 511.553C432.559 511.553 419.228 506.032 409.202 496.006L296.022 382.824C291.996 384.854 287.898 386.762 283.721 388.528C258.794 399.073 232.336 404.419 205.082 404.419C177.828 404.419 151.371 399.071 126.443 388.528C102.385 378.352 80.7863 363.793 62.2467 345.253ZM301.699 336.166C313.928 327.317 324.896 316.835 334.282 305.034C342.149 295.142 348.9 284.325 354.355 272.775C364.433 251.432 370.076 227.586 370.076 202.419C370.076 111.296 296.206 37.4253 205.083 37.4253C113.96 37.4253 40.0895 111.294 40.0895 202.418C40.0895 293.541 113.96 367.411 205.084 367.411C227.413 367.411 248.701 362.967 268.126 354.928C280.091 349.976 291.347 343.658 301.699 336.166ZM467.229 460.716C473.507 454.439 473.507 444.26 467.229 437.982L360.595 331.348C356.601 336.153 352.378 340.794 347.919 345.253C341.671 351.502 335.068 357.286 328.147 362.615L435.371 469.839C438.511 472.977 442.624 474.547 446.739 474.547C450.853 474.547 454.967 472.978 458.106 469.839L467.229 460.716ZM223.582 183.91H281.071C291.292 183.91 299.574 192.194 299.575 202.414C299.575 206.778 298.062 210.786 295.533 213.951C292.143 218.195 286.926 220.916 281.072 220.916H228.303H223.583V225.63V278.406C223.583 287.081 217.613 294.358 209.559 296.361C208.124 296.717 206.625 296.909 205.08 296.909C194.861 296.909 186.577 288.625 186.577 278.406V220.917H129.087C118.868 220.917 110.584 212.633 110.584 202.414C110.584 192.195 118.868 183.911 129.087 183.911H186.576V126.421C186.576 116.202 194.86 107.918 205.079 107.918C215.298 107.918 223.582 116.202 223.582 126.421V183.91Z"
135
- />
136
- </svg>
137
- </div>
138
- </div>
139
- `
140
- })}`;
141
- };
142
- const getSpacingClassByVerticalConfig = ()=>{
143
- const verticalConfig = getCarouselVerticalConfigByPosition(setting.position);
144
- const isNotVerticalClass = [
145
- !verticalConfig['desktop'] ? 'gp-py-0' : 'gp-px-0',
146
- !verticalConfig['tablet'] ? 'tablet:gp-py-0' : 'tablet:gp-px-0',
147
- !verticalConfig['mobile'] ? 'mobile:gp-py-0' : 'mobile:gp-px-0'
148
- ];
149
- return ` ${isNotVerticalClass.join(' ')}`;
150
- };
151
- const carouselChildren = LiquidIf(`product.media.size > 1`, LiquidFor(`media in product.media`, `${LiquidIf(`media.media_type == 'image'`, LiquidFor(`image in product.images`, LiquidIf(`image.src == media.src`, `{% assign imageID = image.id %}{% break %}`)), `{% assign imageID = '' %}`)}
152
- ${LiquidIf(`media.id == product.featured_media.id `, renderCarouselGalleryItem(setting?.borderActive?.border !== 'none' ? 'active' : ''), renderCarouselGalleryItem())}`));
153
- return template`
154
- ${Carousel({
155
- builderProps: {
156
- uid: builderPropUID
157
- },
158
- rootId: `${builderPropUID}-{{product.id}}`,
159
- rootClass: `${featuredImageGalleryClasses}`,
160
- rootAttrs: {
161
- type: 'grid-carousel',
162
- 'product-media': '{{product.media.size}}'
163
- },
164
- wrapperClass: getSpacingClassByVerticalConfig(),
165
- slidesClass: getMinHeightByPosition(setting.position, setting.navigationPosition),
166
- isHiddenArrowWhenDisabled: true,
167
- setting: galleryCarouselSettingAttrs,
168
- rootStyles: {
169
- ...getCarouselDisplay()
170
- },
171
- styles: galleryCarouselStyle,
172
- disableMarginAuto: true,
173
- children: carouselChildren
174
- })}
175
- `;
176
- };
177
-
178
- export { ProductGalleryCarousel as default };
@@ -1,26 +0,0 @@
1
- 'use client';
2
- import { jsx, Fragment } from 'react/jsx-runtime';
3
- import ProductGalleryGrid from '../child/ProductGalleryGrid.js';
4
-
5
- const GalleryGrid = (productImageProps)=>{
6
- const { setting, styles, gallery, builderProps, noDataChildren, onHandleClickImage, children } = productImageProps;
7
- const settings = {
8
- ...setting,
9
- ...styles
10
- };
11
- if (gallery?.[0]?.id === 'noImageError') {
12
- return /*#__PURE__*/ jsx(Fragment, {
13
- children: noDataChildren
14
- });
15
- }
16
- return /*#__PURE__*/ jsx(ProductGalleryGrid, {
17
- productImages: gallery,
18
- enableHoverAction: true,
19
- ...settings,
20
- builderPropUID: builderProps?.uid,
21
- onHandleClick: (imageID, enableOpenLightBox)=>onHandleClickImage(imageID || '', enableOpenLightBox),
22
- children: children
23
- });
24
- };
25
-
26
- export { GalleryGrid as default };