@gem-sdk/components 2.0.0-dev.621 → 2.0.0-dev.623

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 (206) hide show
  1. package/dist/cjs/article/setting/configs/ArticleAuthor/uiV2.js +1 -0
  2. package/dist/cjs/article/setting/configs/ArticleReadMore/settings.js +0 -1
  3. package/dist/cjs/article/setting/configs/ArticleReadMore/uiV2.js +1 -0
  4. package/dist/cjs/banner/setting/presets/heroBanner1Col.js +1 -1
  5. package/dist/cjs/banner/setting/presets/heroBannerContentLeft.js +2 -4
  6. package/dist/cjs/banner/setting/presets/heroBannerContentRight.js +2 -5
  7. package/dist/cjs/banner/setting/presets/heroBannerVideo.js +10 -0
  8. package/dist/cjs/banner/setting/setting.js +9 -6
  9. package/dist/cjs/banner/setting/uiV2.js +34 -10
  10. package/dist/cjs/builder.js +12 -6
  11. package/dist/cjs/collection/components/collection-banner/components/CollectionBanner.liquid.js +1 -1
  12. package/dist/cjs/collection/components/collection-paginator/common/index.js +1 -2
  13. package/dist/cjs/collection/components/collection-paginator/common/styles.js +2 -2
  14. package/dist/cjs/collection/components/collection-paginator/components/CollectionPaginator.liquid.js +3 -3
  15. package/dist/cjs/collection/setting/collection-banner/configs/uiV2.js +2 -2
  16. package/dist/cjs/collection/setting/collection-paginator/configs/settings.js +8 -5
  17. package/dist/cjs/collection/setting/collection-paginator/configs/uiV2.js +28 -3
  18. package/dist/cjs/index.js +34 -32
  19. package/dist/cjs/index.liquid.js +16 -10
  20. package/dist/cjs/next.js +3 -1
  21. package/dist/cjs/product/components/ProductImagesV3/common/common.js +360 -0
  22. package/dist/cjs/product/components/ProductImagesV3/common/getAttr.js +192 -0
  23. package/dist/cjs/product/components/ProductImagesV3/common/getBorderActiveCss.js +26 -0
  24. package/dist/cjs/product/components/ProductImagesV3/common/getClasses.js +94 -0
  25. package/dist/cjs/product/components/ProductImagesV3/common/getStyle.js +303 -0
  26. package/dist/cjs/product/components/ProductImagesV3/common/hoverAction.js +95 -0
  27. package/dist/cjs/product/components/ProductImagesV3/common/productFeaturedImage.js +59 -0
  28. package/dist/cjs/product/components/ProductImagesV3/common/productGallery.js +266 -0
  29. package/dist/cjs/product/components/ProductImagesV3/components/child/MediaIcon.js +63 -0
  30. package/dist/cjs/product/components/ProductImagesV3/components/child/ProductFeatureVideo.js +36 -0
  31. package/dist/cjs/product/components/ProductImagesV3/components/child/ProductFeaturedImageCarousel.js +109 -0
  32. package/dist/cjs/product/components/ProductImagesV3/components/child/ProductFeaturedImageOnly.js +139 -0
  33. package/dist/cjs/product/components/ProductImagesV3/components/child/ProductGalleryGrid.js +100 -0
  34. package/dist/cjs/product/components/ProductImagesV3/components/feature-gallery/FeatureImageWithGallery.js +77 -0
  35. package/dist/cjs/product/components/ProductImagesV3/components/feature-gallery/FeatureImageWithGallery.liquid.js +300 -0
  36. package/dist/cjs/product/components/ProductImagesV3/components/feature-only/OnlyFeatureImage.js +44 -0
  37. package/dist/cjs/product/components/ProductImagesV3/components/gallery-carousel/GalleryCarousel.js +83 -0
  38. package/dist/cjs/product/components/ProductImagesV3/components/gallery-carousel/GalleryCarousel.liquid.js +182 -0
  39. package/dist/cjs/product/components/ProductImagesV3/components/gallery-grid/GalleryGrid.js +30 -0
  40. package/dist/cjs/product/components/ProductImagesV3/components/gallery-grid/GalleryGrid.liquid.js +239 -0
  41. package/dist/cjs/product/components/ProductImagesV3/components/lightbox/ButtonOpenLightBox.js +28 -0
  42. package/dist/cjs/product/components/ProductImagesV3/components/lightbox/ProductImagesLightBox.js +144 -0
  43. package/dist/cjs/product/components/ProductImagesV3/composables/getProductImagesAttr.js +14 -0
  44. package/dist/cjs/product/components/ProductImagesV3/composables/getProductImagesClassName.js +54 -0
  45. package/dist/cjs/product/components/ProductImagesV3/composables/getProductImagesStyles.js +53 -0
  46. package/dist/cjs/product/components/ProductImagesV3/hooks/useFeatureImageWithGallery.js +55 -0
  47. package/dist/cjs/product/components/ProductImagesV3/hooks/useFilterImagesByVariant.js +41 -0
  48. package/dist/cjs/product/components/ProductImagesV3/hooks/useGalleryCarousel.js +134 -0
  49. package/dist/cjs/product/components/ProductImagesV3/hooks/useProductFeaturedImageCarousel.js +203 -0
  50. package/dist/cjs/product/components/ProductImagesV3/hooks/useProductGalleryGrid.js +87 -0
  51. package/dist/cjs/product/components/ProductImagesV3/index.js +291 -0
  52. package/dist/cjs/product/components/ProductImagesV3/index.liquid.js +153 -0
  53. package/dist/cjs/product/index.js +6 -4
  54. package/dist/cjs/product/next.js +4 -0
  55. package/dist/cjs/product/setting/product-image-v3/ProductFeatureImage.js +252 -0
  56. package/dist/cjs/product/setting/product-image-v3/ProductGalleryImage.js +251 -0
  57. package/dist/cjs/product/setting/product-image-v3/ProductImages.js +74 -0
  58. package/dist/cjs/product/setting/product-image-v3/configs/setting-v2/ProductFeatureImage.js +388 -0
  59. package/dist/cjs/product/setting/product-image-v3/configs/setting-v2/ProductGalleryImage.js +518 -0
  60. package/dist/cjs/product/setting/product-image-v3/configs/setting-v2/index.js +336 -0
  61. package/dist/cjs/product/setting/product-image-v3/configs/ui/FeatureNavigation.js +118 -0
  62. package/dist/cjs/product/setting/product-image-v3/configs/ui/ImageListNavigation.js +119 -0
  63. package/dist/cjs/product/setting/product-image-v3/configs/uiV1.js +237 -0
  64. package/dist/cjs/product/setting/product-image-v3/configs/uiV2.js +491 -0
  65. package/dist/cjs/setting.js +97 -95
  66. package/dist/cjs/swiper-carousel/arrow/Arrow.js +52 -0
  67. package/dist/cjs/swiper-carousel/arrow/Arrow.liquid.js +46 -0
  68. package/dist/cjs/swiper-carousel/arrow/common/common.js +119 -0
  69. package/dist/cjs/swiper-carousel/arrow/common/getClass.js +50 -0
  70. package/dist/cjs/swiper-carousel/arrow/common/getStyle.js +84 -0
  71. package/dist/cjs/swiper-carousel/carousel-item/SwiperItem.js +34 -0
  72. package/dist/cjs/swiper-carousel/carousel-item/SwiperItem.liquid.js +38 -0
  73. package/dist/cjs/swiper-carousel/carousel-item/common/getClass.js +29 -0
  74. package/dist/cjs/swiper-carousel/carousel-item/common/getStyle.js +79 -0
  75. package/dist/cjs/swiper-carousel/carousel-item/hook/useCarouseItem.js +22 -0
  76. package/dist/cjs/swiper-carousel/components/common/carousel.js +98 -0
  77. package/dist/cjs/swiper-carousel/components/const/index.js +5 -0
  78. package/dist/cjs/swiper-carousel/components/hooks/useTrackPreviewPause.js +34 -0
  79. package/dist/cjs/swiper-carousel/components/plugins/AnimationPlugin.js +42 -0
  80. package/dist/cjs/swiper-carousel/components/plugins/AutoPlayPlugin.js +105 -0
  81. package/dist/cjs/swiper-carousel/components/plugins/FixSliderMoveBackwards.js +15 -0
  82. package/dist/cjs/swiper-carousel/components/plugins/MutationPlugin.js +45 -0
  83. package/dist/cjs/swiper-carousel/dots/Dots.js +51 -0
  84. package/dist/cjs/swiper-carousel/dots/Dots.liquid.js +26 -0
  85. package/dist/cjs/swiper-carousel/dots/common/common.js +28 -0
  86. package/dist/cjs/swiper-carousel/dots/common/getClass.js +40 -0
  87. package/dist/cjs/swiper-carousel/dots/common/getStyle.js +33 -0
  88. package/dist/cjs/swiper-carousel/dots/hook/useDotsSetting.js +21 -0
  89. package/dist/cjs/swiper-carousel/index.js +17 -0
  90. package/dist/cjs/swiper-carousel/next.js +22 -0
  91. package/dist/cjs/swiper-carousel/root/Swiper.js +128 -0
  92. package/dist/cjs/swiper-carousel/root/Swiper.liquid.js +104 -0
  93. package/dist/cjs/swiper-carousel/root/common/getAttr.js +25 -0
  94. package/dist/cjs/swiper-carousel/root/common/getClass.js +135 -0
  95. package/dist/cjs/swiper-carousel/root/common/getData.js +56 -0
  96. package/dist/cjs/swiper-carousel/root/common/getStyle.js +64 -0
  97. package/dist/cjs/swiper-carousel/root/hook/useCarousel.js +482 -0
  98. package/dist/cjs/swiper-carousel/setting/Swiper.js +42 -0
  99. package/dist/cjs/swiper-carousel/setting/SwiperItem.js +40 -0
  100. package/dist/cjs/swiper-carousel/setting/configs/presets.js +87 -0
  101. package/dist/cjs/swiper-carousel/setting/configs/settingV2.js +819 -0
  102. package/dist/cjs/swiper-carousel/setting/configs/uiV2.js +718 -0
  103. package/dist/esm/article/setting/configs/ArticleAuthor/uiV2.js +1 -0
  104. package/dist/esm/article/setting/configs/ArticleReadMore/settings.js +0 -1
  105. package/dist/esm/article/setting/configs/ArticleReadMore/uiV2.js +1 -0
  106. package/dist/esm/banner/setting/presets/heroBanner1Col.js +1 -1
  107. package/dist/esm/banner/setting/presets/heroBannerContentLeft.js +2 -4
  108. package/dist/esm/banner/setting/presets/heroBannerContentRight.js +2 -5
  109. package/dist/esm/banner/setting/presets/heroBannerVideo.js +10 -0
  110. package/dist/esm/banner/setting/setting.js +9 -6
  111. package/dist/esm/banner/setting/uiV2.js +34 -10
  112. package/dist/esm/builder.js +6 -0
  113. package/dist/esm/collection/components/collection-banner/components/CollectionBanner.liquid.js +1 -1
  114. package/dist/esm/collection/components/collection-paginator/common/index.js +1 -2
  115. package/dist/esm/collection/components/collection-paginator/common/styles.js +2 -2
  116. package/dist/esm/collection/components/collection-paginator/components/CollectionPaginator.liquid.js +3 -3
  117. package/dist/esm/collection/setting/collection-banner/configs/uiV2.js +2 -2
  118. package/dist/esm/collection/setting/collection-paginator/configs/settings.js +8 -5
  119. package/dist/esm/collection/setting/collection-paginator/configs/uiV2.js +28 -3
  120. package/dist/esm/index.js +1 -0
  121. package/dist/esm/index.liquid.js +3 -0
  122. package/dist/esm/next.js +3 -1
  123. package/dist/esm/product/components/ProductImagesV3/common/common.js +344 -0
  124. package/dist/esm/product/components/ProductImagesV3/common/getAttr.js +189 -0
  125. package/dist/esm/product/components/ProductImagesV3/common/getBorderActiveCss.js +24 -0
  126. package/dist/esm/product/components/ProductImagesV3/common/getClasses.js +83 -0
  127. package/dist/esm/product/components/ProductImagesV3/common/getStyle.js +292 -0
  128. package/dist/esm/product/components/ProductImagesV3/common/hoverAction.js +92 -0
  129. package/dist/esm/product/components/ProductImagesV3/common/productFeaturedImage.js +53 -0
  130. package/dist/esm/product/components/ProductImagesV3/common/productGallery.js +251 -0
  131. package/dist/esm/product/components/ProductImagesV3/components/child/MediaIcon.js +59 -0
  132. package/dist/esm/product/components/ProductImagesV3/components/child/ProductFeatureVideo.js +32 -0
  133. package/dist/esm/product/components/ProductImagesV3/components/child/ProductFeaturedImageCarousel.js +105 -0
  134. package/dist/esm/product/components/ProductImagesV3/components/child/ProductFeaturedImageOnly.js +135 -0
  135. package/dist/esm/product/components/ProductImagesV3/components/child/ProductGalleryGrid.js +96 -0
  136. package/dist/esm/product/components/ProductImagesV3/components/feature-gallery/FeatureImageWithGallery.js +73 -0
  137. package/dist/esm/product/components/ProductImagesV3/components/feature-gallery/FeatureImageWithGallery.liquid.js +296 -0
  138. package/dist/esm/product/components/ProductImagesV3/components/feature-only/OnlyFeatureImage.js +40 -0
  139. package/dist/esm/product/components/ProductImagesV3/components/gallery-carousel/GalleryCarousel.js +79 -0
  140. package/dist/esm/product/components/ProductImagesV3/components/gallery-carousel/GalleryCarousel.liquid.js +178 -0
  141. package/dist/esm/product/components/ProductImagesV3/components/gallery-grid/GalleryGrid.js +26 -0
  142. package/dist/esm/product/components/ProductImagesV3/components/gallery-grid/GalleryGrid.liquid.js +235 -0
  143. package/dist/esm/product/components/ProductImagesV3/components/lightbox/ButtonOpenLightBox.js +24 -0
  144. package/dist/esm/product/components/ProductImagesV3/components/lightbox/ProductImagesLightBox.js +140 -0
  145. package/dist/esm/product/components/ProductImagesV3/composables/getProductImagesAttr.js +12 -0
  146. package/dist/esm/product/components/ProductImagesV3/composables/getProductImagesClassName.js +52 -0
  147. package/dist/esm/product/components/ProductImagesV3/composables/getProductImagesStyles.js +51 -0
  148. package/dist/esm/product/components/ProductImagesV3/hooks/useFeatureImageWithGallery.js +53 -0
  149. package/dist/esm/product/components/ProductImagesV3/hooks/useFilterImagesByVariant.js +39 -0
  150. package/dist/esm/product/components/ProductImagesV3/hooks/useGalleryCarousel.js +132 -0
  151. package/dist/esm/product/components/ProductImagesV3/hooks/useProductFeaturedImageCarousel.js +201 -0
  152. package/dist/esm/product/components/ProductImagesV3/hooks/useProductGalleryGrid.js +85 -0
  153. package/dist/esm/product/components/ProductImagesV3/index.js +287 -0
  154. package/dist/esm/product/components/ProductImagesV3/index.liquid.js +149 -0
  155. package/dist/esm/product/index.js +26 -24
  156. package/dist/esm/product/next.js +4 -0
  157. package/dist/esm/product/setting/product-image-v3/ProductFeatureImage.js +248 -0
  158. package/dist/esm/product/setting/product-image-v3/ProductGalleryImage.js +248 -0
  159. package/dist/esm/product/setting/product-image-v3/ProductImages.js +70 -0
  160. package/dist/esm/product/setting/product-image-v3/configs/setting-v2/ProductFeatureImage.js +384 -0
  161. package/dist/esm/product/setting/product-image-v3/configs/setting-v2/ProductGalleryImage.js +515 -0
  162. package/dist/esm/product/setting/product-image-v3/configs/setting-v2/index.js +334 -0
  163. package/dist/esm/product/setting/product-image-v3/configs/ui/FeatureNavigation.js +116 -0
  164. package/dist/esm/product/setting/product-image-v3/configs/ui/ImageListNavigation.js +117 -0
  165. package/dist/esm/product/setting/product-image-v3/configs/uiV1.js +235 -0
  166. package/dist/esm/product/setting/product-image-v3/configs/uiV2.js +489 -0
  167. package/dist/esm/setting.js +2 -0
  168. package/dist/esm/swiper-carousel/arrow/Arrow.js +48 -0
  169. package/dist/esm/swiper-carousel/arrow/Arrow.liquid.js +42 -0
  170. package/dist/esm/swiper-carousel/arrow/common/common.js +111 -0
  171. package/dist/esm/swiper-carousel/arrow/common/getClass.js +48 -0
  172. package/dist/esm/swiper-carousel/arrow/common/getStyle.js +82 -0
  173. package/dist/esm/swiper-carousel/carousel-item/SwiperItem.js +30 -0
  174. package/dist/esm/swiper-carousel/carousel-item/SwiperItem.liquid.js +34 -0
  175. package/dist/esm/swiper-carousel/carousel-item/common/getClass.js +27 -0
  176. package/dist/esm/swiper-carousel/carousel-item/common/getStyle.js +77 -0
  177. package/dist/esm/swiper-carousel/carousel-item/hook/useCarouseItem.js +20 -0
  178. package/dist/esm/swiper-carousel/components/common/carousel.js +93 -0
  179. package/dist/esm/swiper-carousel/components/const/index.js +3 -0
  180. package/dist/esm/swiper-carousel/components/hooks/useTrackPreviewPause.js +30 -0
  181. package/dist/esm/swiper-carousel/components/plugins/AnimationPlugin.js +35 -0
  182. package/dist/esm/swiper-carousel/components/plugins/AutoPlayPlugin.js +103 -0
  183. package/dist/esm/swiper-carousel/components/plugins/FixSliderMoveBackwards.js +13 -0
  184. package/dist/esm/swiper-carousel/components/plugins/MutationPlugin.js +43 -0
  185. package/dist/esm/swiper-carousel/dots/Dots.js +47 -0
  186. package/dist/esm/swiper-carousel/dots/Dots.liquid.js +22 -0
  187. package/dist/esm/swiper-carousel/dots/common/common.js +26 -0
  188. package/dist/esm/swiper-carousel/dots/common/getClass.js +38 -0
  189. package/dist/esm/swiper-carousel/dots/common/getStyle.js +31 -0
  190. package/dist/esm/swiper-carousel/dots/hook/useDotsSetting.js +19 -0
  191. package/dist/esm/swiper-carousel/index.js +15 -0
  192. package/dist/esm/swiper-carousel/next.js +18 -0
  193. package/dist/esm/swiper-carousel/root/Swiper.js +124 -0
  194. package/dist/esm/swiper-carousel/root/Swiper.liquid.js +100 -0
  195. package/dist/esm/swiper-carousel/root/common/getAttr.js +23 -0
  196. package/dist/esm/swiper-carousel/root/common/getClass.js +133 -0
  197. package/dist/esm/swiper-carousel/root/common/getData.js +54 -0
  198. package/dist/esm/swiper-carousel/root/common/getStyle.js +62 -0
  199. package/dist/esm/swiper-carousel/root/hook/useCarousel.js +480 -0
  200. package/dist/esm/swiper-carousel/setting/Swiper.js +38 -0
  201. package/dist/esm/swiper-carousel/setting/SwiperItem.js +36 -0
  202. package/dist/esm/swiper-carousel/setting/configs/presets.js +85 -0
  203. package/dist/esm/swiper-carousel/setting/configs/settingV2.js +815 -0
  204. package/dist/esm/swiper-carousel/setting/configs/uiV2.js +713 -0
  205. package/dist/types/index.d.ts +552 -117
  206. package/package.json +3 -3
@@ -0,0 +1,266 @@
1
+ 'use strict';
2
+
3
+ var core = require('@gem-sdk/core');
4
+ var common = require('./common.js');
5
+ var productFeaturedImage = require('../../ProductImages/common/productFeaturedImage.js');
6
+
7
+ const getZoomDisplay = (largeViewInPopup)=>{
8
+ return common.getDisplayStyle((device)=>!core.getResponsiveValueByScreen(largeViewInPopup, device), 'flex');
9
+ };
10
+ const HORIZONTAL_LAYOUT = [
11
+ 'right',
12
+ 'left',
13
+ 'inside-left',
14
+ 'inside-right'
15
+ ];
16
+ const sizeSettingDefaultForNewLayout = {
17
+ desktop: {
18
+ shape: 'square',
19
+ shapeValue: '1/1',
20
+ width: '20%',
21
+ height: undefined,
22
+ shapeLinked: true
23
+ }
24
+ };
25
+ const getCarouselVerticalConfigByPosition = (position)=>{
26
+ const devices = [
27
+ 'desktop',
28
+ 'mobile',
29
+ 'tablet'
30
+ ];
31
+ let result = {};
32
+ devices.forEach((device)=>{
33
+ const positionDevice = core.getResponsiveValueByScreen(position, device);
34
+ const isHorizontalLayout = HORIZONTAL_LAYOUT.includes(positionDevice);
35
+ if (isHorizontalLayout) result = {
36
+ ...result,
37
+ [device]: true
38
+ };
39
+ else result = {
40
+ ...result,
41
+ [device]: false
42
+ };
43
+ });
44
+ return result;
45
+ };
46
+ const getMinHeightByPosition = (position, navigationPosition)=>{
47
+ const devices = [
48
+ 'desktop',
49
+ 'mobile',
50
+ 'tablet'
51
+ ];
52
+ const vertical = getCarouselVerticalConfigByPosition(position);
53
+ const result = {};
54
+ devices.forEach((device)=>{
55
+ const navigationStyle = core.getResponsiveValueByScreen(navigationPosition, device);
56
+ const deviceType = device === 'desktop' ? '' : `${device}:`;
57
+ result[`${deviceType}!gp-min-h-0`] = !!vertical[device] && navigationStyle === 'outside';
58
+ result[`${deviceType}!gp-min-h-full`] = !(vertical[device] && navigationStyle === 'outside');
59
+ });
60
+ return core.cls({
61
+ ...result
62
+ });
63
+ };
64
+ const getEditorMinHeightClass = (device, position, navigationPosition)=>{
65
+ const vertical = getCarouselVerticalConfigByPosition(position);
66
+ const navigationStyle = core.getResponsiveValueByScreen(navigationPosition, device);
67
+ return vertical[device] && navigationStyle === 'outside' ? '!gp-min-h-0' : '!gp-min-h-full';
68
+ };
69
+ const getAllowDotConfig = ()=>{
70
+ return {
71
+ desktop: false,
72
+ tablet: false,
73
+ mobile: false
74
+ };
75
+ };
76
+ const getDotStyleConfig = ()=>{
77
+ return {
78
+ desktop: 'none',
79
+ tablet: 'none',
80
+ mobile: 'none'
81
+ };
82
+ };
83
+ const getSettingWidthForGridItem = (setting)=>{
84
+ let result = {};
85
+ const DEVICES = [
86
+ 'desktop',
87
+ 'mobile',
88
+ 'tablet'
89
+ ];
90
+ DEVICES.forEach((device)=>{
91
+ const widthDevice = core.getResponsiveValueByScreen(setting.shapeByLayout, device)?.width;
92
+ const itemSpacingDevice = core.getResponsiveValueByScreen(setting.itemSpacing, device);
93
+ let itemPerLine = 0;
94
+ if (widthDevice?.includes('%')) {
95
+ itemPerLine = 100 / parseInt(widthDevice);
96
+ }
97
+ result = {
98
+ ...result,
99
+ [device]: itemPerLine ? `calc(${widthDevice} - ${itemSpacingDevice} * ${itemPerLine - 1} / ${itemPerLine})` : widthDevice
100
+ };
101
+ });
102
+ return result;
103
+ };
104
+ const getSettingWidthForCarouselItem = (setting)=>{
105
+ let result = {};
106
+ const DEVICES = [
107
+ 'desktop',
108
+ 'mobile',
109
+ 'tablet'
110
+ ];
111
+ DEVICES.forEach((device)=>{
112
+ const layout = core.getResponsiveValueByScreen(setting.position, device);
113
+ const isLayoutBottom = layout === 'bottom-center';
114
+ const itemWidth = core.getResponsiveValueByScreen(setting.shapeByLayout, device)?.width;
115
+ result = {
116
+ ...result,
117
+ [device]: isLayoutBottom && itemWidth?.includes('px') ? itemWidth : '100%'
118
+ };
119
+ });
120
+ return result;
121
+ };
122
+ const getSettingMinWidthForCarouselItem = (setting)=>{
123
+ let result = {};
124
+ const DEVICES = [
125
+ 'desktop',
126
+ 'mobile',
127
+ 'tablet'
128
+ ];
129
+ DEVICES.forEach((device)=>{
130
+ const layout = core.getResponsiveValueByScreen(setting.position, device);
131
+ const spacing = productFeaturedImage.convertUnitToNumber(core.getResponsiveValueByScreen(setting.spacing, device), 5);
132
+ const isLayoutBottom = layout === 'bottom-center' || layout === 'inside-bottom';
133
+ const itemWidth = core.getResponsiveValueByScreen(setting.shapeByLayout, device)?.width;
134
+ let value = '100%';
135
+ if (isLayoutBottom) {
136
+ const itemsPerSlide = 100 / productFeaturedImage.convertUnitToNumber(itemWidth, 20);
137
+ value = itemWidth?.includes('px') ? itemWidth : itemWidth?.includes('%') ? `calc(${itemWidth} - ${(itemsPerSlide - 1) * spacing / itemsPerSlide}px)` : '100%';
138
+ }
139
+ result = {
140
+ ...result,
141
+ [device]: value
142
+ };
143
+ });
144
+ return result;
145
+ };
146
+ const checkDisplayGalleryByWidth = (setting)=>{
147
+ let result = {
148
+ desktop: true,
149
+ tablet: true,
150
+ mobile: true
151
+ };
152
+ const DEVICES = [
153
+ 'desktop',
154
+ 'mobile',
155
+ 'tablet'
156
+ ];
157
+ DEVICES.forEach((device)=>{
158
+ const itemWidth = core.getResponsiveValueByScreen(setting.shapeByLayout, device)?.width ?? '100%';
159
+ const isDisplay = parseInt(itemWidth) !== 0;
160
+ result = {
161
+ ...result,
162
+ [device]: isDisplay
163
+ };
164
+ });
165
+ return result;
166
+ };
167
+ const getSliderPerShowConfig = (shapeByLayout, position)=>{
168
+ let result = {
169
+ desktop: 'auto',
170
+ tablet: 'auto',
171
+ mobile: 'auto'
172
+ };
173
+ const DEVICES = [
174
+ 'desktop',
175
+ 'mobile',
176
+ 'tablet'
177
+ ];
178
+ DEVICES.forEach((device)=>{
179
+ const layout = core.getResponsiveValueByScreen(position, device);
180
+ const isLayoutBottom = layout === 'bottom-center' || layout === 'inside-bottom';
181
+ const itemWidth = core.getResponsiveValueByScreen(shapeByLayout, device)?.width;
182
+ let itemPerShow = 'auto';
183
+ if (itemWidth?.includes('%')) {
184
+ itemPerShow = parseInt(itemWidth) < 100 ? 100 / parseInt(itemWidth) : 'auto';
185
+ }
186
+ result = {
187
+ ...result,
188
+ [device]: isLayoutBottom ? itemPerShow : 'auto'
189
+ };
190
+ });
191
+ return result;
192
+ };
193
+ const getShapeByLayout = (setting, position)=>{
194
+ let shapeByLayout = {};
195
+ const DEVICES = [
196
+ 'desktop',
197
+ 'mobile',
198
+ 'tablet'
199
+ ];
200
+ DEVICES.forEach((device)=>{
201
+ const layout = core.getResponsiveValueByScreen(position, device);
202
+ switch(layout){
203
+ case 'bottom-center':
204
+ case 'bottom-left':
205
+ shapeByLayout = {
206
+ ...shapeByLayout,
207
+ [device]: core.getResponsiveValueByScreen(setting.shapeForBottom, device)
208
+ };
209
+ break;
210
+ case 'inside-bottom':
211
+ shapeByLayout = {
212
+ ...shapeByLayout,
213
+ [device]: core.getResponsiveValueByScreen(setting.shapeForInsideBottom ?? sizeSettingDefaultForNewLayout, device)
214
+ };
215
+ break;
216
+ case 'left':
217
+ case 'right':
218
+ shapeByLayout = {
219
+ ...shapeByLayout,
220
+ [device]: core.getResponsiveValueByScreen(setting.shape, device)
221
+ };
222
+ break;
223
+ case 'inside-left':
224
+ case 'inside-right':
225
+ shapeByLayout = {
226
+ ...shapeByLayout,
227
+ [device]: core.getResponsiveValueByScreen(setting.shapeForInside ?? sizeSettingDefaultForNewLayout, device)
228
+ };
229
+ break;
230
+ case 'only-feature':
231
+ shapeByLayout = {
232
+ ...shapeByLayout,
233
+ [device]: core.getResponsiveValueByScreen(setting.shapeForFtOnly, device)
234
+ };
235
+ break;
236
+ case 'one-col':
237
+ shapeByLayout = {
238
+ ...shapeByLayout,
239
+ [device]: core.getResponsiveValueByScreen(setting.shapeFor1Col, device)
240
+ };
241
+ break;
242
+ case 'two-col':
243
+ shapeByLayout = {
244
+ ...shapeByLayout,
245
+ [device]: core.getResponsiveValueByScreen(setting.shapeFor2Col, device)
246
+ };
247
+ break;
248
+ }
249
+ });
250
+ return shapeByLayout;
251
+ };
252
+
253
+ exports.HORIZONTAL_LAYOUT = HORIZONTAL_LAYOUT;
254
+ exports.checkDisplayGalleryByWidth = checkDisplayGalleryByWidth;
255
+ exports.getAllowDotConfig = getAllowDotConfig;
256
+ exports.getCarouselVerticalConfigByPosition = getCarouselVerticalConfigByPosition;
257
+ exports.getDotStyleConfig = getDotStyleConfig;
258
+ exports.getEditorMinHeightClass = getEditorMinHeightClass;
259
+ exports.getMinHeightByPosition = getMinHeightByPosition;
260
+ exports.getSettingMinWidthForCarouselItem = getSettingMinWidthForCarouselItem;
261
+ exports.getSettingWidthForCarouselItem = getSettingWidthForCarouselItem;
262
+ exports.getSettingWidthForGridItem = getSettingWidthForGridItem;
263
+ exports.getShapeByLayout = getShapeByLayout;
264
+ exports.getSliderPerShowConfig = getSliderPerShowConfig;
265
+ exports.getZoomDisplay = getZoomDisplay;
266
+ exports.sizeSettingDefaultForNewLayout = sizeSettingDefaultForNewLayout;
@@ -0,0 +1,63 @@
1
+ 'use client';
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, '__esModule', { value: true });
5
+
6
+ var jsxRuntime = require('react/jsx-runtime');
7
+
8
+ const MediaIcon = ({ contentType })=>{
9
+ const isVideoSource = contentType == 'VIDEO' || contentType == 'EXTERNAL_VIDEO';
10
+ const isModel3D = contentType == 'MODEL_3D';
11
+ return /*#__PURE__*/ jsxRuntime.jsx(jsxRuntime.Fragment, {
12
+ children: (isVideoSource || isModel3D) && /*#__PURE__*/ jsxRuntime.jsxs("div", {
13
+ className: "gp-absolute gp-bottom-0 gp-right-0 gp-pb-[15px] gp-pr-[15px]",
14
+ children: [
15
+ isVideoSource && /*#__PURE__*/ jsxRuntime.jsxs("svg", {
16
+ width: "24",
17
+ height: "24",
18
+ viewBox: "0 0 24 24",
19
+ fill: "none",
20
+ xmlns: "http://www.w3.org/2000/svg",
21
+ children: [
22
+ /*#__PURE__*/ jsxRuntime.jsx("rect", {
23
+ opacity: "0.9",
24
+ width: "24",
25
+ height: "24",
26
+ rx: "3",
27
+ fill: "#212121"
28
+ }),
29
+ /*#__PURE__*/ jsxRuntime.jsx("path", {
30
+ 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",
31
+ stroke: "#F9F9F9",
32
+ strokeMiterlimit: "10"
33
+ })
34
+ ]
35
+ }),
36
+ isModel3D && /*#__PURE__*/ jsxRuntime.jsxs("svg", {
37
+ width: "24",
38
+ height: "24",
39
+ viewBox: "0 0 24 24",
40
+ fill: "none",
41
+ xmlns: "http://www.w3.org/2000/svg",
42
+ children: [
43
+ /*#__PURE__*/ jsxRuntime.jsx("rect", {
44
+ opacity: "0.9",
45
+ width: "24",
46
+ height: "24",
47
+ rx: "3",
48
+ fill: "#212121"
49
+ }),
50
+ /*#__PURE__*/ jsxRuntime.jsx("path", {
51
+ fillRule: "evenodd",
52
+ clipRule: "evenodd",
53
+ 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",
54
+ fill: "#F9F9F9"
55
+ })
56
+ ]
57
+ })
58
+ ]
59
+ })
60
+ });
61
+ };
62
+
63
+ exports.default = MediaIcon;
@@ -0,0 +1,36 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var jsxRuntime = require('react/jsx-runtime');
6
+ var React = require('react');
7
+ require('next/link');
8
+ require('@gem-sdk/core');
9
+ var Video = require('../../../../../video/components/Video.js');
10
+
11
+ const ProductFeatureVideo = (props)=>{
12
+ const { url, aspectRatio } = props;
13
+ const videoType = React.useMemo(()=>{
14
+ if (url.includes('youtu.be')) return 'youtube';
15
+ if (url.includes('vimeo')) return 'vimeo';
16
+ return 'html5';
17
+ }, [
18
+ url
19
+ ]);
20
+ return /*#__PURE__*/ jsxRuntime.jsx(jsxRuntime.Fragment, {
21
+ children: /*#__PURE__*/ jsxRuntime.jsx(Video.default, {
22
+ setting: {
23
+ type: videoType,
24
+ html5Url: url,
25
+ youtubeUrl: url,
26
+ vimeoUrl: url,
27
+ preload: true,
28
+ controls: true,
29
+ aspectRatio
30
+ }
31
+ })
32
+ });
33
+ };
34
+ var ProductFeatureVideo$1 = /*#__PURE__*/ React.memo(ProductFeatureVideo);
35
+
36
+ exports.default = ProductFeatureVideo$1;
@@ -0,0 +1,109 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var jsxRuntime = require('react/jsx-runtime');
6
+ var React = require('react');
7
+ var core = require('@gem-sdk/core');
8
+ var hoverAction = require('../../common/hoverAction.js');
9
+ var getProductImagesStyles = require('../../composables/getProductImagesStyles.js');
10
+ var getProductImagesClassName = require('../../composables/getProductImagesClassName.js');
11
+ var getProductImagesAttr = require('../../composables/getProductImagesAttr.js');
12
+ var system = require('@gem-sdk/system');
13
+ var getStyle = require('../../common/getStyle.js');
14
+ var Carousel = require('../../../../../carousel/root/Carousel.js');
15
+ var CarouselItem = require('../../../../../carousel/carousel-item/CarouselItem.js');
16
+ var ProductFeaturedImageOnly = require('./ProductFeaturedImageOnly.js');
17
+ var useProductFeaturedImageCarousel = require('../../hooks/useProductFeaturedImageCarousel.js');
18
+
19
+ const ProductFeaturedImageCarousel = (props)=>{
20
+ const { productImages, imgRef, onHandleClick, onClickArrow, onHandleLoaded, onHandleUpdateActiveIndex, builderPropUID, builderPropsClass, children, parentUid, ...setting } = props;
21
+ const { ref, imageActive, imageActiveIndex, imageShowWhenHover, enableOpenLightBox, filteredProductImages, isRenderFeatureCarousel, genRandomKey, getAspectRatioFinal, emitUpdateActiveIndex } = useProductFeaturedImageCarousel.useProductFeaturedImageCarousel(props);
22
+ const currentDevice = core.useCurrentDevice();
23
+ const { galleryItemClasses, featureImageOnlyOneImageClasses } = getProductImagesClassName.getProductImagesClassName(setting);
24
+ const { featuredImageCarouselStyle, featureImageCarouselItemStyle } = getProductImagesStyles.getProductImagesStyles(setting);
25
+ const featureImageOnlyOneImageStyle = system.createStyle({
26
+ ...getStyle.getFeaturedImageOnlyOneImageStyle({
27
+ setting,
28
+ options: {
29
+ enableRadius: true,
30
+ enableHeight: true
31
+ }
32
+ })
33
+ });
34
+ const { featuredImageCarouselSettingAttrs } = getProductImagesAttr.getProductImagesAttr(setting);
35
+ return /*#__PURE__*/ jsxRuntime.jsx("div", {
36
+ ref: ref,
37
+ "data-slot": "children",
38
+ className: "product-feature-image",
39
+ children: isRenderFeatureCarousel ? /*#__PURE__*/ jsxRuntime.jsxs(Carousel.default, {
40
+ parentClass: builderPropsClass,
41
+ elmRef: imgRef,
42
+ setting: featuredImageCarouselSettingAttrs,
43
+ styles: featuredImageCarouselStyle,
44
+ builderProps: {
45
+ uid: builderPropUID
46
+ },
47
+ isHiddenArrowWhenDisabled: true,
48
+ onLoaded: (status)=>onHandleLoaded && onHandleLoaded(status),
49
+ onChangeActive: (index)=>emitUpdateActiveIndex(index),
50
+ onClickArrow: ()=>onClickArrow && onClickArrow(genRandomKey()),
51
+ moveToIdx: imageActiveIndex,
52
+ disableMarginAuto: true,
53
+ onHandleChangeSlideByInteraction: (idx)=>{
54
+ const length = filteredProductImages?.length ?? 0;
55
+ const index = idx >= length ? 0 : idx;
56
+ onHandleClick(filteredProductImages?.[index]?.id ?? '', enableOpenLightBox);
57
+ },
58
+ children: [
59
+ children,
60
+ filteredProductImages?.map((image)=>{
61
+ return /*#__PURE__*/ jsxRuntime.jsx(CarouselItem.default, {
62
+ contentType: "productImage",
63
+ className: galleryItemClasses('gp-ft-image-item'),
64
+ onClickItem: ()=>{
65
+ const clickEffect = core.getResponsiveValueByScreen(setting?.ftClickOpenLightBox, currentDevice);
66
+ if (clickEffect !== 'none') onHandleClick(image?.id ?? '', enableOpenLightBox);
67
+ },
68
+ style: featureImageCarouselItemStyle,
69
+ onMouseMove: (e)=>hoverAction.handleMouseMove(e, setting),
70
+ onMouseOut: (e)=>hoverAction.handleMouseOut(e),
71
+ children: /*#__PURE__*/ jsxRuntime.jsx(ProductFeaturedImageOnly.default, {
72
+ image: image,
73
+ imageShowWhenHover: imageShowWhenHover,
74
+ setting: setting,
75
+ aspectRatio: getAspectRatioFinal()
76
+ })
77
+ }, image?.id);
78
+ })
79
+ ]
80
+ }) : /*#__PURE__*/ jsxRuntime.jsx("div", {
81
+ ref: imgRef,
82
+ className: "gp-flex gp-w-full",
83
+ style: {
84
+ ...core.makeStyleResponsive('jc', setting?.align)
85
+ },
86
+ "data-id": builderPropUID,
87
+ children: /*#__PURE__*/ jsxRuntime.jsx("div", {
88
+ "aria-hidden": "true",
89
+ className: featureImageOnlyOneImageClasses,
90
+ style: featureImageOnlyOneImageStyle,
91
+ onMouseMove: (e)=>hoverAction.handleMouseMove(e, setting),
92
+ onMouseOut: (e)=>hoverAction.handleMouseOut(e),
93
+ onBlur: ()=>void 0,
94
+ onClick: ()=>{
95
+ onHandleClick(imageActive?.id ?? '', enableOpenLightBox);
96
+ },
97
+ children: /*#__PURE__*/ jsxRuntime.jsx(ProductFeaturedImageOnly.default, {
98
+ image: imageActive,
99
+ imageShowWhenHover: imageShowWhenHover,
100
+ setting: setting,
101
+ aspectRatio: getAspectRatioFinal(imageActive)
102
+ })
103
+ })
104
+ })
105
+ });
106
+ };
107
+ var ProductFeaturedImageCarousel$1 = /*#__PURE__*/ React.memo(ProductFeaturedImageCarousel);
108
+
109
+ exports.default = ProductFeaturedImageCarousel$1;
@@ -0,0 +1,139 @@
1
+ 'use client';
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, '__esModule', { value: true });
5
+
6
+ var jsxRuntime = require('react/jsx-runtime');
7
+ var core = require('@gem-sdk/core');
8
+ var React = require('react');
9
+ var NextImage = require('../../../../../image/components/NextImage.js');
10
+ var MediaIcon = require('./MediaIcon.js');
11
+ var productFeaturedImage = require('../../common/productFeaturedImage.js');
12
+ var ProductFeatureVideo = require('./ProductFeatureVideo.js');
13
+
14
+ const defaultImage = {
15
+ src: 'https://cdn.shopify.com/s/assets/no-image-2048-5e88c1b20e087fb7bbe9a3771824e743c244f437e4f8ba93bbf7b11b53f7824c_large.gif',
16
+ id: `noImageError`,
17
+ width: 480,
18
+ height: 480,
19
+ alt: `no image`,
20
+ contentType: 'IMAGE'
21
+ };
22
+ const ProductFeaturedImageOnly = ({ image, imageShowWhenHover, setting, aspectRatio })=>{
23
+ const product = core.useProduct();
24
+ const currentDevice = core.useCurrentDevice();
25
+ const storefrontUrl = core.useShopStore((state)=>state.storefrontUrl);
26
+ const mode = core.useEditorMode();
27
+ const isClickEffect = React.useMemo(()=>core.getResponsiveValueByScreen(setting.ftClickOpenLightBox, currentDevice) !== 'none', [
28
+ currentDevice,
29
+ setting.ftClickOpenLightBox
30
+ ]);
31
+ const isRenderVideo = React.useMemo(()=>mode !== 'edit' && [
32
+ 'VIDEO',
33
+ 'EXTERNAL_VIDEO'
34
+ ].includes(image?.contentType || '') && !isClickEffect, [
35
+ mode,
36
+ image?.contentType,
37
+ isClickEffect
38
+ ]);
39
+ const renderImage = React.useMemo(()=>{
40
+ if (!image) return defaultImage;
41
+ return {
42
+ ...image,
43
+ src: isRenderVideo ? image.src : productFeaturedImage.isFeatureMedia(image?.contentType) ? image?.previewImage : image.src
44
+ };
45
+ }, [
46
+ image,
47
+ isRenderVideo
48
+ ]);
49
+ const shopifyProductLink = React.useMemo(()=>{
50
+ if (!storefrontUrl) return `#`;
51
+ const url = new URL(storefrontUrl);
52
+ if (product) {
53
+ return `${url.protocol}//${url.host}/products/${product.handle}`;
54
+ }
55
+ return `#`;
56
+ }, [
57
+ storefrontUrl,
58
+ product
59
+ ]);
60
+ const handleProductLink = (children)=>{
61
+ if (core.getResponsiveValueByScreen(setting.ftClickOpenLightBox, currentDevice) === 'product-link') return /*#__PURE__*/ jsxRuntime.jsx("a", {
62
+ title: product?.title,
63
+ href: shopifyProductLink,
64
+ className: "gp-w-full",
65
+ children: children
66
+ });
67
+ return children;
68
+ };
69
+ const isRenderHoverImage = React.useMemo(()=>setting?.hoverEffect !== 'none' && !productFeaturedImage.isFeatureMedia(renderImage?.contentType), [
70
+ renderImage?.contentType,
71
+ setting?.hoverEffect
72
+ ]);
73
+ const isZoomImage = React.useMemo(()=>setting?.hoverEffect == 'zoom' && setting?.zoomType == 'glasses' && !productFeaturedImage.isFeatureMedia(renderImage?.contentType), [
74
+ renderImage?.contentType,
75
+ setting?.hoverEffect,
76
+ setting?.zoomType
77
+ ]);
78
+ return /*#__PURE__*/ jsxRuntime.jsx(jsxRuntime.Fragment, {
79
+ children: handleProductLink(/*#__PURE__*/ jsxRuntime.jsx(jsxRuntime.Fragment, {
80
+ children: isRenderVideo ? /*#__PURE__*/ jsxRuntime.jsx(ProductFeatureVideo.default, {
81
+ type: renderImage?.contentType,
82
+ url: renderImage.src ?? '',
83
+ aspectRatio: aspectRatio
84
+ }) : /*#__PURE__*/ jsxRuntime.jsxs(jsxRuntime.Fragment, {
85
+ children: [
86
+ /*#__PURE__*/ jsxRuntime.jsx(NextImage.default, {
87
+ draggable: "false",
88
+ src: renderImage.src,
89
+ width: renderImage?.width,
90
+ height: renderImage?.height,
91
+ alt: renderImage?.alt,
92
+ setting: {
93
+ aspectRatio: aspectRatio,
94
+ layout: setting?.ftLayout
95
+ },
96
+ priority: setting?.preload,
97
+ className: "featured-image-only",
98
+ style: {
99
+ width: '100%',
100
+ height: '100%',
101
+ cursor: 'pointer'
102
+ }
103
+ }),
104
+ /*#__PURE__*/ jsxRuntime.jsx(MediaIcon.default, {
105
+ contentType: renderImage?.contentType ?? ''
106
+ }),
107
+ isRenderHoverImage && /*#__PURE__*/ jsxRuntime.jsx(NextImage.default, {
108
+ draggable: "false",
109
+ src: setting?.hoverEffect === 'other' ? imageShowWhenHover?.src : renderImage.src,
110
+ width: setting?.hoverEffect === 'other' ? imageShowWhenHover?.width : renderImage.width,
111
+ height: setting?.hoverEffect === 'other' ? imageShowWhenHover?.height : renderImage.height,
112
+ alt: setting?.hoverEffect === 'other' ? imageShowWhenHover?.alt : renderImage.alt,
113
+ setting: {
114
+ layout: setting.ftLayout,
115
+ aspectRatio: aspectRatio
116
+ },
117
+ style: {
118
+ width: '100%',
119
+ height: '100%'
120
+ },
121
+ className: core.cls('hover-image featured-image-only !gp-max-w-none', productFeaturedImage.getZoomImageClass()),
122
+ priority: setting?.preload
123
+ }),
124
+ isZoomImage && /*#__PURE__*/ jsxRuntime.jsx("div", {
125
+ className: core.cls(productFeaturedImage.getZoomLenClass(), 'room-len'),
126
+ style: {
127
+ ...core.makeStyle({
128
+ bgi: `url("${renderImage?.src}")`
129
+ })
130
+ }
131
+ })
132
+ ]
133
+ })
134
+ }))
135
+ });
136
+ };
137
+ var ProductFeaturedImageOnly$1 = /*#__PURE__*/ React.memo(ProductFeaturedImageOnly);
138
+
139
+ exports.default = ProductFeaturedImageOnly$1;