@gem-sdk/components 2.0.0-dev.622 → 2.0.0-dev.624

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 (180) hide show
  1. package/dist/cjs/builder.js +12 -6
  2. package/dist/cjs/collection/components/collection-paginator/common/styles.js +3 -4
  3. package/dist/cjs/collection/components/collection-paginator/components/CollectionPaginator.liquid.js +2 -1
  4. package/dist/cjs/collection/setting/collection-paginator/configs/settings.js +2 -3
  5. package/dist/cjs/index.js +34 -32
  6. package/dist/cjs/index.liquid.js +16 -10
  7. package/dist/cjs/next.js +3 -1
  8. package/dist/cjs/product/components/ProductImagesV3/common/common.js +360 -0
  9. package/dist/cjs/product/components/ProductImagesV3/common/getAttr.js +192 -0
  10. package/dist/cjs/product/components/ProductImagesV3/common/getBorderActiveCss.js +26 -0
  11. package/dist/cjs/product/components/ProductImagesV3/common/getClasses.js +94 -0
  12. package/dist/cjs/product/components/ProductImagesV3/common/getStyle.js +303 -0
  13. package/dist/cjs/product/components/ProductImagesV3/common/hoverAction.js +95 -0
  14. package/dist/cjs/product/components/ProductImagesV3/common/productFeaturedImage.js +59 -0
  15. package/dist/cjs/product/components/ProductImagesV3/common/productGallery.js +266 -0
  16. package/dist/cjs/product/components/ProductImagesV3/components/child/MediaIcon.js +63 -0
  17. package/dist/cjs/product/components/ProductImagesV3/components/child/ProductFeatureVideo.js +36 -0
  18. package/dist/cjs/product/components/ProductImagesV3/components/child/ProductFeaturedImageCarousel.js +109 -0
  19. package/dist/cjs/product/components/ProductImagesV3/components/child/ProductFeaturedImageOnly.js +139 -0
  20. package/dist/cjs/product/components/ProductImagesV3/components/child/ProductGalleryGrid.js +100 -0
  21. package/dist/cjs/product/components/ProductImagesV3/components/feature-gallery/FeatureImageWithGallery.js +77 -0
  22. package/dist/cjs/product/components/ProductImagesV3/components/feature-gallery/FeatureImageWithGallery.liquid.js +300 -0
  23. package/dist/cjs/product/components/ProductImagesV3/components/feature-only/OnlyFeatureImage.js +44 -0
  24. package/dist/cjs/product/components/ProductImagesV3/components/gallery-carousel/GalleryCarousel.js +83 -0
  25. package/dist/cjs/product/components/ProductImagesV3/components/gallery-carousel/GalleryCarousel.liquid.js +182 -0
  26. package/dist/cjs/product/components/ProductImagesV3/components/gallery-grid/GalleryGrid.js +30 -0
  27. package/dist/cjs/product/components/ProductImagesV3/components/gallery-grid/GalleryGrid.liquid.js +239 -0
  28. package/dist/cjs/product/components/ProductImagesV3/components/lightbox/ButtonOpenLightBox.js +28 -0
  29. package/dist/cjs/product/components/ProductImagesV3/components/lightbox/ProductImagesLightBox.js +144 -0
  30. package/dist/cjs/product/components/ProductImagesV3/composables/getProductImagesAttr.js +14 -0
  31. package/dist/cjs/product/components/ProductImagesV3/composables/getProductImagesClassName.js +54 -0
  32. package/dist/cjs/product/components/ProductImagesV3/composables/getProductImagesStyles.js +53 -0
  33. package/dist/cjs/product/components/ProductImagesV3/hooks/useFeatureImageWithGallery.js +55 -0
  34. package/dist/cjs/product/components/ProductImagesV3/hooks/useFilterImagesByVariant.js +41 -0
  35. package/dist/cjs/product/components/ProductImagesV3/hooks/useGalleryCarousel.js +134 -0
  36. package/dist/cjs/product/components/ProductImagesV3/hooks/useProductFeaturedImageCarousel.js +203 -0
  37. package/dist/cjs/product/components/ProductImagesV3/hooks/useProductGalleryGrid.js +87 -0
  38. package/dist/cjs/product/components/ProductImagesV3/index.js +291 -0
  39. package/dist/cjs/product/components/ProductImagesV3/index.liquid.js +153 -0
  40. package/dist/cjs/product/index.js +6 -4
  41. package/dist/cjs/product/next.js +4 -0
  42. package/dist/cjs/product/setting/product-image-v3/ProductFeatureImage.js +252 -0
  43. package/dist/cjs/product/setting/product-image-v3/ProductGalleryImage.js +251 -0
  44. package/dist/cjs/product/setting/product-image-v3/ProductImages.js +74 -0
  45. package/dist/cjs/product/setting/product-image-v3/configs/setting-v2/ProductFeatureImage.js +388 -0
  46. package/dist/cjs/product/setting/product-image-v3/configs/setting-v2/ProductGalleryImage.js +518 -0
  47. package/dist/cjs/product/setting/product-image-v3/configs/setting-v2/index.js +336 -0
  48. package/dist/cjs/product/setting/product-image-v3/configs/ui/FeatureNavigation.js +118 -0
  49. package/dist/cjs/product/setting/product-image-v3/configs/ui/ImageListNavigation.js +119 -0
  50. package/dist/cjs/product/setting/product-image-v3/configs/uiV1.js +237 -0
  51. package/dist/cjs/product/setting/product-image-v3/configs/uiV2.js +491 -0
  52. package/dist/cjs/setting.js +97 -95
  53. package/dist/cjs/swiper-carousel/arrow/Arrow.js +52 -0
  54. package/dist/cjs/swiper-carousel/arrow/Arrow.liquid.js +46 -0
  55. package/dist/cjs/swiper-carousel/arrow/common/common.js +119 -0
  56. package/dist/cjs/swiper-carousel/arrow/common/getClass.js +50 -0
  57. package/dist/cjs/swiper-carousel/arrow/common/getStyle.js +84 -0
  58. package/dist/cjs/swiper-carousel/carousel-item/SwiperItem.js +34 -0
  59. package/dist/cjs/swiper-carousel/carousel-item/SwiperItem.liquid.js +38 -0
  60. package/dist/cjs/swiper-carousel/carousel-item/common/getClass.js +29 -0
  61. package/dist/cjs/swiper-carousel/carousel-item/common/getStyle.js +79 -0
  62. package/dist/cjs/swiper-carousel/carousel-item/hook/useCarouseItem.js +22 -0
  63. package/dist/cjs/swiper-carousel/components/common/carousel.js +98 -0
  64. package/dist/cjs/swiper-carousel/components/const/index.js +5 -0
  65. package/dist/cjs/swiper-carousel/components/hooks/useTrackPreviewPause.js +34 -0
  66. package/dist/cjs/swiper-carousel/components/plugins/AnimationPlugin.js +42 -0
  67. package/dist/cjs/swiper-carousel/components/plugins/AutoPlayPlugin.js +105 -0
  68. package/dist/cjs/swiper-carousel/components/plugins/FixSliderMoveBackwards.js +15 -0
  69. package/dist/cjs/swiper-carousel/components/plugins/MutationPlugin.js +45 -0
  70. package/dist/cjs/swiper-carousel/dots/Dots.js +51 -0
  71. package/dist/cjs/swiper-carousel/dots/Dots.liquid.js +26 -0
  72. package/dist/cjs/swiper-carousel/dots/common/common.js +28 -0
  73. package/dist/cjs/swiper-carousel/dots/common/getClass.js +40 -0
  74. package/dist/cjs/swiper-carousel/dots/common/getStyle.js +33 -0
  75. package/dist/cjs/swiper-carousel/dots/hook/useDotsSetting.js +21 -0
  76. package/dist/cjs/swiper-carousel/index.js +17 -0
  77. package/dist/cjs/swiper-carousel/next.js +22 -0
  78. package/dist/cjs/swiper-carousel/root/Swiper.js +128 -0
  79. package/dist/cjs/swiper-carousel/root/Swiper.liquid.js +104 -0
  80. package/dist/cjs/swiper-carousel/root/common/getAttr.js +25 -0
  81. package/dist/cjs/swiper-carousel/root/common/getClass.js +135 -0
  82. package/dist/cjs/swiper-carousel/root/common/getData.js +56 -0
  83. package/dist/cjs/swiper-carousel/root/common/getStyle.js +64 -0
  84. package/dist/cjs/swiper-carousel/root/hook/useCarousel.js +482 -0
  85. package/dist/cjs/swiper-carousel/setting/Swiper.js +42 -0
  86. package/dist/cjs/swiper-carousel/setting/SwiperItem.js +40 -0
  87. package/dist/cjs/swiper-carousel/setting/configs/presets.js +87 -0
  88. package/dist/cjs/swiper-carousel/setting/configs/settingV2.js +819 -0
  89. package/dist/cjs/swiper-carousel/setting/configs/uiV2.js +718 -0
  90. package/dist/esm/builder.js +6 -0
  91. package/dist/esm/collection/components/collection-paginator/common/styles.js +3 -4
  92. package/dist/esm/collection/components/collection-paginator/components/CollectionPaginator.liquid.js +2 -1
  93. package/dist/esm/collection/setting/collection-paginator/configs/settings.js +2 -3
  94. package/dist/esm/index.js +1 -0
  95. package/dist/esm/index.liquid.js +3 -0
  96. package/dist/esm/next.js +3 -1
  97. package/dist/esm/product/components/ProductImagesV3/common/common.js +344 -0
  98. package/dist/esm/product/components/ProductImagesV3/common/getAttr.js +189 -0
  99. package/dist/esm/product/components/ProductImagesV3/common/getBorderActiveCss.js +24 -0
  100. package/dist/esm/product/components/ProductImagesV3/common/getClasses.js +83 -0
  101. package/dist/esm/product/components/ProductImagesV3/common/getStyle.js +292 -0
  102. package/dist/esm/product/components/ProductImagesV3/common/hoverAction.js +92 -0
  103. package/dist/esm/product/components/ProductImagesV3/common/productFeaturedImage.js +53 -0
  104. package/dist/esm/product/components/ProductImagesV3/common/productGallery.js +251 -0
  105. package/dist/esm/product/components/ProductImagesV3/components/child/MediaIcon.js +59 -0
  106. package/dist/esm/product/components/ProductImagesV3/components/child/ProductFeatureVideo.js +32 -0
  107. package/dist/esm/product/components/ProductImagesV3/components/child/ProductFeaturedImageCarousel.js +105 -0
  108. package/dist/esm/product/components/ProductImagesV3/components/child/ProductFeaturedImageOnly.js +135 -0
  109. package/dist/esm/product/components/ProductImagesV3/components/child/ProductGalleryGrid.js +96 -0
  110. package/dist/esm/product/components/ProductImagesV3/components/feature-gallery/FeatureImageWithGallery.js +73 -0
  111. package/dist/esm/product/components/ProductImagesV3/components/feature-gallery/FeatureImageWithGallery.liquid.js +296 -0
  112. package/dist/esm/product/components/ProductImagesV3/components/feature-only/OnlyFeatureImage.js +40 -0
  113. package/dist/esm/product/components/ProductImagesV3/components/gallery-carousel/GalleryCarousel.js +79 -0
  114. package/dist/esm/product/components/ProductImagesV3/components/gallery-carousel/GalleryCarousel.liquid.js +178 -0
  115. package/dist/esm/product/components/ProductImagesV3/components/gallery-grid/GalleryGrid.js +26 -0
  116. package/dist/esm/product/components/ProductImagesV3/components/gallery-grid/GalleryGrid.liquid.js +235 -0
  117. package/dist/esm/product/components/ProductImagesV3/components/lightbox/ButtonOpenLightBox.js +24 -0
  118. package/dist/esm/product/components/ProductImagesV3/components/lightbox/ProductImagesLightBox.js +140 -0
  119. package/dist/esm/product/components/ProductImagesV3/composables/getProductImagesAttr.js +12 -0
  120. package/dist/esm/product/components/ProductImagesV3/composables/getProductImagesClassName.js +52 -0
  121. package/dist/esm/product/components/ProductImagesV3/composables/getProductImagesStyles.js +51 -0
  122. package/dist/esm/product/components/ProductImagesV3/hooks/useFeatureImageWithGallery.js +53 -0
  123. package/dist/esm/product/components/ProductImagesV3/hooks/useFilterImagesByVariant.js +39 -0
  124. package/dist/esm/product/components/ProductImagesV3/hooks/useGalleryCarousel.js +132 -0
  125. package/dist/esm/product/components/ProductImagesV3/hooks/useProductFeaturedImageCarousel.js +201 -0
  126. package/dist/esm/product/components/ProductImagesV3/hooks/useProductGalleryGrid.js +85 -0
  127. package/dist/esm/product/components/ProductImagesV3/index.js +287 -0
  128. package/dist/esm/product/components/ProductImagesV3/index.liquid.js +149 -0
  129. package/dist/esm/product/index.js +26 -24
  130. package/dist/esm/product/next.js +4 -0
  131. package/dist/esm/product/setting/product-image-v3/ProductFeatureImage.js +248 -0
  132. package/dist/esm/product/setting/product-image-v3/ProductGalleryImage.js +248 -0
  133. package/dist/esm/product/setting/product-image-v3/ProductImages.js +70 -0
  134. package/dist/esm/product/setting/product-image-v3/configs/setting-v2/ProductFeatureImage.js +384 -0
  135. package/dist/esm/product/setting/product-image-v3/configs/setting-v2/ProductGalleryImage.js +515 -0
  136. package/dist/esm/product/setting/product-image-v3/configs/setting-v2/index.js +334 -0
  137. package/dist/esm/product/setting/product-image-v3/configs/ui/FeatureNavigation.js +116 -0
  138. package/dist/esm/product/setting/product-image-v3/configs/ui/ImageListNavigation.js +117 -0
  139. package/dist/esm/product/setting/product-image-v3/configs/uiV1.js +235 -0
  140. package/dist/esm/product/setting/product-image-v3/configs/uiV2.js +489 -0
  141. package/dist/esm/setting.js +2 -0
  142. package/dist/esm/swiper-carousel/arrow/Arrow.js +48 -0
  143. package/dist/esm/swiper-carousel/arrow/Arrow.liquid.js +42 -0
  144. package/dist/esm/swiper-carousel/arrow/common/common.js +111 -0
  145. package/dist/esm/swiper-carousel/arrow/common/getClass.js +48 -0
  146. package/dist/esm/swiper-carousel/arrow/common/getStyle.js +82 -0
  147. package/dist/esm/swiper-carousel/carousel-item/SwiperItem.js +30 -0
  148. package/dist/esm/swiper-carousel/carousel-item/SwiperItem.liquid.js +34 -0
  149. package/dist/esm/swiper-carousel/carousel-item/common/getClass.js +27 -0
  150. package/dist/esm/swiper-carousel/carousel-item/common/getStyle.js +77 -0
  151. package/dist/esm/swiper-carousel/carousel-item/hook/useCarouseItem.js +20 -0
  152. package/dist/esm/swiper-carousel/components/common/carousel.js +93 -0
  153. package/dist/esm/swiper-carousel/components/const/index.js +3 -0
  154. package/dist/esm/swiper-carousel/components/hooks/useTrackPreviewPause.js +30 -0
  155. package/dist/esm/swiper-carousel/components/plugins/AnimationPlugin.js +35 -0
  156. package/dist/esm/swiper-carousel/components/plugins/AutoPlayPlugin.js +103 -0
  157. package/dist/esm/swiper-carousel/components/plugins/FixSliderMoveBackwards.js +13 -0
  158. package/dist/esm/swiper-carousel/components/plugins/MutationPlugin.js +43 -0
  159. package/dist/esm/swiper-carousel/dots/Dots.js +47 -0
  160. package/dist/esm/swiper-carousel/dots/Dots.liquid.js +22 -0
  161. package/dist/esm/swiper-carousel/dots/common/common.js +26 -0
  162. package/dist/esm/swiper-carousel/dots/common/getClass.js +38 -0
  163. package/dist/esm/swiper-carousel/dots/common/getStyle.js +31 -0
  164. package/dist/esm/swiper-carousel/dots/hook/useDotsSetting.js +19 -0
  165. package/dist/esm/swiper-carousel/index.js +15 -0
  166. package/dist/esm/swiper-carousel/next.js +18 -0
  167. package/dist/esm/swiper-carousel/root/Swiper.js +124 -0
  168. package/dist/esm/swiper-carousel/root/Swiper.liquid.js +100 -0
  169. package/dist/esm/swiper-carousel/root/common/getAttr.js +23 -0
  170. package/dist/esm/swiper-carousel/root/common/getClass.js +133 -0
  171. package/dist/esm/swiper-carousel/root/common/getData.js +54 -0
  172. package/dist/esm/swiper-carousel/root/common/getStyle.js +62 -0
  173. package/dist/esm/swiper-carousel/root/hook/useCarousel.js +480 -0
  174. package/dist/esm/swiper-carousel/setting/Swiper.js +38 -0
  175. package/dist/esm/swiper-carousel/setting/SwiperItem.js +36 -0
  176. package/dist/esm/swiper-carousel/setting/configs/presets.js +85 -0
  177. package/dist/esm/swiper-carousel/setting/configs/settingV2.js +815 -0
  178. package/dist/esm/swiper-carousel/setting/configs/uiV2.js +713 -0
  179. package/dist/types/index.d.ts +551 -116
  180. package/package.json +2 -2
@@ -0,0 +1,192 @@
1
+ 'use strict';
2
+
3
+ var core = require('@gem-sdk/core');
4
+ var productGallery = require('./productGallery.js');
5
+ var productFeaturedImage = require('./productFeaturedImage.js');
6
+
7
+ const DEVICES = [
8
+ 'desktop',
9
+ 'mobile',
10
+ 'tablet'
11
+ ];
12
+ const getGalleryCarouselSettingAttr = (setting)=>{
13
+ const shapeByLayout = productGallery.getShapeByLayout({
14
+ shape: setting.shape,
15
+ shapeForBottom: setting.shapeForBottom,
16
+ shapeFor1Col: setting.shapeFor1Col,
17
+ shapeFor2Col: setting.shapeFor2Col,
18
+ shapeForFtOnly: setting.shapeForFtOnly,
19
+ shapeForInsideBottom: setting.shapeForInsideBottom,
20
+ shapeForInside: setting.shapeForInside
21
+ }, setting.position);
22
+ const slidePerShow = productGallery.getSliderPerShowConfig(shapeByLayout, setting.position);
23
+ const controlOverContent = {
24
+ desktop: core.getResponsiveValueByScreen(setting.navigationPosition, 'desktop') === 'inside',
25
+ tablet: core.getResponsiveValueByScreen(setting.navigationPosition, 'tablet') === 'inside',
26
+ mobile: core.getResponsiveValueByScreen(setting.navigationPosition, 'mobile') === 'inside'
27
+ };
28
+ const mappingNavigationEnable = DEVICES.reduce((acc, device)=>{
29
+ if (setting.navigationPosition?.[device]) {
30
+ acc[device] = setting.navigationPosition[device] !== 'none';
31
+ }
32
+ return acc;
33
+ }, {});
34
+ return {
35
+ ...setting?.loop && {
36
+ loop: setting.loop
37
+ },
38
+ itemNumber: slidePerShow,
39
+ dot: productGallery.getAllowDotConfig(),
40
+ dotStyle: productGallery.getDotStyleConfig(),
41
+ controlOverContent: controlOverContent,
42
+ ...setting?.dragToScroll && {
43
+ enableDrag: {
44
+ desktop: setting.dragToScroll,
45
+ tablet: setting.dragToScroll,
46
+ mobile: setting.dragToScroll
47
+ }
48
+ },
49
+ vertical: productGallery.getCarouselVerticalConfigByPosition(setting.position),
50
+ ...setting?.arrowIcon && {
51
+ arrowCustom: setting.arrowIcon
52
+ },
53
+ ...{
54
+ arrowIconSize: setting.arrowIconSize || {
55
+ desktop: 24
56
+ }
57
+ },
58
+ ...setting?.arrowIconColor && {
59
+ arrowCustomColor: setting.arrowIconColor
60
+ },
61
+ ...setting?.arrowNavColor && {
62
+ arrowBackgroundColor: setting.arrowNavColor
63
+ },
64
+ ...setting?.arrowNavBorder && {
65
+ arrowBorder: {
66
+ desktop: setting.arrowNavBorder
67
+ }
68
+ },
69
+ ...setting?.arrowNavRadius && {
70
+ roundedArrow: {
71
+ desktop: setting.arrowNavRadius
72
+ }
73
+ },
74
+ ...setting?.arrowNavShadow && {
75
+ arrowShadow: {
76
+ desktop: setting.arrowNavShadow
77
+ }
78
+ },
79
+ sneakPeakType: {
80
+ desktop: 'center'
81
+ },
82
+ arrowGapToEachSide: '16',
83
+ navigationStyle: setting.navigationPosition,
84
+ navigationEnable: mappingNavigationEnable,
85
+ arrowButtonSize: {
86
+ desktop: {
87
+ width: undefined,
88
+ height: undefined
89
+ }
90
+ },
91
+ animationMode: setting?.ftAnimationMode,
92
+ enableAction: {
93
+ desktop: true
94
+ }
95
+ };
96
+ };
97
+ const getFeaturedCarouselSettingAttr = (setting)=>{
98
+ const controlOverContent = {
99
+ desktop: core.getResponsiveValueByScreen(setting.ftNavigationPosition, 'desktop') === 'inside',
100
+ tablet: core.getResponsiveValueByScreen(setting.ftNavigationPosition, 'tablet') === 'inside',
101
+ mobile: core.getResponsiveValueByScreen(setting.ftNavigationPosition, 'mobile') === 'inside'
102
+ };
103
+ const mappingNavigationEnable = DEVICES.reduce((acc, device)=>{
104
+ if (setting.ftNavigationPosition?.[device]) {
105
+ acc[device] = setting.ftNavigationPosition[device] !== 'none';
106
+ }
107
+ return acc;
108
+ }, {});
109
+ return {
110
+ ...setting?.ftLoop && {
111
+ loop: setting.ftLoop
112
+ },
113
+ itemNumber: {
114
+ desktop: 1
115
+ },
116
+ dot: productGallery.getAllowDotConfig(),
117
+ dotStyle: productFeaturedImage.getDotStyleForOnlyFeaturedImage({
118
+ position: setting.position,
119
+ dotStyle: setting.ftDotStyle
120
+ }),
121
+ dotSize: setting.ftDotSize ?? {
122
+ desktop: 12
123
+ },
124
+ dotGapToCarousel: setting.ftDotGapToCarousel ?? {
125
+ desktop: 16
126
+ },
127
+ dotColor: setting.ftDotColor ?? {
128
+ desktop: 'bg-1'
129
+ },
130
+ dotActiveColor: setting.ftDotActiveColor ?? {
131
+ desktop: 'line-3'
132
+ },
133
+ controlOverContent: controlOverContent,
134
+ ...setting?.ftDragToScroll && {
135
+ enableDrag: {
136
+ desktop: setting.ftDragToScroll,
137
+ tablet: setting.ftDragToScroll,
138
+ mobile: setting.ftDragToScroll
139
+ }
140
+ },
141
+ ...setting?.ftArrowIcon && {
142
+ arrowCustom: setting.ftArrowIcon
143
+ },
144
+ ...{
145
+ arrowIconSize: setting.ftArrowIconSize || {
146
+ desktop: 24
147
+ }
148
+ },
149
+ ...setting?.ftArrowIconColor && {
150
+ arrowCustomColor: setting.ftArrowIconColor
151
+ },
152
+ ...setting?.ftArrowNavColor && {
153
+ arrowBackgroundColor: setting.ftArrowNavColor
154
+ },
155
+ ...setting?.ftArrowNavBorder && {
156
+ arrowBorder: {
157
+ desktop: setting.ftArrowNavBorder
158
+ }
159
+ },
160
+ ...setting?.ftArrowNavRadius && {
161
+ roundedArrow: {
162
+ desktop: setting.ftArrowNavRadius
163
+ }
164
+ },
165
+ ...setting?.ftArrowNavShadow && {
166
+ arrowShadow: {
167
+ desktop: setting.ftArrowNavShadow
168
+ }
169
+ },
170
+ sneakPeakType: {
171
+ desktop: 'center'
172
+ },
173
+ arrowGapToEachSide: '16',
174
+ animationMode: setting?.ftAnimationMode,
175
+ ...setting?.ftNavigationPosition && {
176
+ navigationStyle: setting.ftNavigationPosition
177
+ },
178
+ navigationEnable: mappingNavigationEnable,
179
+ arrowButtonSize: {
180
+ desktop: {
181
+ width: undefined,
182
+ height: undefined
183
+ }
184
+ },
185
+ enableAction: {
186
+ desktop: true
187
+ }
188
+ };
189
+ };
190
+
191
+ exports.getFeaturedCarouselSettingAttr = getFeaturedCarouselSettingAttr;
192
+ exports.getGalleryCarouselSettingAttr = getGalleryCarouselSettingAttr;
@@ -0,0 +1,26 @@
1
+ 'use strict';
2
+
3
+ var core = require('@gem-sdk/core');
4
+
5
+ const getBorderActiveCss = ({ settings, uid, type })=>{
6
+ // const suffix = type === 'Liquid' ? '-{{product.id}}' : '';
7
+ const selector = type === 'Liquid' ? `.gem-slider-item-${uid}-{{product.id}}.gp-gallery-image-item::after, .gem-slider-item-gp-gallery-${uid}-{{product.id}}.gp-gallery-image-item::after` : `.gem-slider-item-active.gem-slider-item-${uid}.gp-gallery-image-item::after`;
8
+ return `
9
+ ${selector} {
10
+ content: "";
11
+ height: 100%;
12
+ width: 100%;
13
+ position: absolute;
14
+ z-index: 999;
15
+ top: 0;
16
+ left: 0;
17
+ ${core.composeBorderCss(settings?.borderActive)}
18
+ ${core.composeCornerCss(settings?.corner)}
19
+ }
20
+ .gem-slider-item-${uid}-{{product.id}}.gp-gallery-image-item[data-outline=active]:after, .gem-slider-item-gp-gallery-${uid}-{{product.id}}.gp-gallery-image-item[data-outline=active]:after {
21
+ pointer-events: none;
22
+ }
23
+ `;
24
+ };
25
+
26
+ exports.getBorderActiveCss = getBorderActiveCss;
@@ -0,0 +1,94 @@
1
+ 'use strict';
2
+
3
+ var core = require('@gem-sdk/core');
4
+
5
+ function composeClasses(classList) {
6
+ return classList.split(' ').reduce((acc, item)=>{
7
+ acc[item] = true;
8
+ return acc;
9
+ }, {});
10
+ }
11
+ const getWrapperClasses = ({ extraClass, isAddOverFlowClass = false })=>{
12
+ let classList = 'gp-relative gp-w-full';
13
+ if (extraClass) classList += ` ${extraClass}`;
14
+ if (isAddOverFlowClass) classList += ` gp-overflow-hidden`;
15
+ return composeClasses(classList);
16
+ };
17
+ const getGalleryWrapperClasses = ({ extraClass })=>{
18
+ let classList = 'gallery-wrapper gp-product-images-gallery gp-flex gp-overflow-hidden gp-max-w-full gp-max-h-full data-[only-image=true]:gp-hidden';
19
+ if (extraClass) classList += ` ${extraClass}`;
20
+ return composeClasses(classList);
21
+ };
22
+ const getGalleryGridWrapperClasses = ({ extraClass })=>{
23
+ let classList = 'product-feature-image grid-gallery gp-flex !gp-h-fit gp-w-full gp-flex-wrap scrollbar-track:gp-rounded-2xl scrollbar-thumb:gp-rounded-2xl scrollbar-thumb:gp-bg-gray-400';
24
+ if (extraClass) classList += ` ${extraClass}`;
25
+ return composeClasses(classList);
26
+ };
27
+ const getFtImageWithGalleryClasses = ({ extraClass })=>{
28
+ let classList = 'gp-flex !gp-h-fit gp-relative gp-overflow-hidden';
29
+ if (extraClass) classList += ` ${extraClass}`;
30
+ return composeClasses(classList);
31
+ };
32
+ const getImageGalleryWrapperClasses = ({ extraClass })=>{
33
+ let classList = 'gp-flex gp-h-fit gp-max-w-full';
34
+ if (extraClass) classList += ` ${extraClass}`;
35
+ return composeClasses(classList);
36
+ };
37
+ const getFeaturedImageCarouselClasses = ({ extraClass })=>{
38
+ let classList = '`gp-flex-1 gp-w-full gp-feature-image-carousel';
39
+ if (extraClass) classList += ` ${extraClass}`;
40
+ return composeClasses(classList);
41
+ };
42
+ const getFeaturedImageClasses = ({ setting, extraClass })=>{
43
+ let classList = extraClass ?? '';
44
+ const devices = [
45
+ 'desktop',
46
+ 'tablet',
47
+ 'mobile'
48
+ ];
49
+ devices.forEach((device)=>{
50
+ const navigation = core.getResponsiveValueByScreen(setting?.ftNavigationPosition, device);
51
+ const suffix = device !== 'desktop' ? `${device}:` : '';
52
+ navigation === 'outside' ? classList += ` ${suffix}gp-px-[16px]` : classList += ` ${suffix}gp-px-0`;
53
+ });
54
+ return composeClasses(classList);
55
+ };
56
+ const getFeaturedImageGalleryClasses = ({ settings, extraClass })=>{
57
+ let classList = extraClass ?? 'gp-flex-1 gp-w-full carousel-gallery';
58
+ const devices = [
59
+ 'desktop',
60
+ 'tablet',
61
+ 'mobile'
62
+ ];
63
+ devices.forEach((device)=>{
64
+ const navigation = core.getResponsiveValueByScreen(settings?.navigationPosition, device);
65
+ const type = core.getResponsiveValueByScreen(settings?.type, device);
66
+ const position = core.getResponsiveValueByScreen(settings?.position, device);
67
+ const suffix = device !== 'desktop' ? `${device}:` : '';
68
+ navigation === 'outside' && type === 'slider' && [
69
+ 'bottom-center'
70
+ ].includes(position || '') ? classList += ` ${suffix}gp-px-[16px]` : classList += ` ${suffix}gp-px-0`;
71
+ });
72
+ return composeClasses(classList);
73
+ };
74
+ const getGalleryItemClasses = ({ extraClass })=>{
75
+ let classList = `gp-image-item gp-flex gp-items-center gp-justify-center gp-group gp-relative gp-overflow-hidden gp-cursor-pointer data-[outline=deactive]:after:!gp-border-transparent data-[outline=deactive]:after:!gp-border-transparent`;
76
+ if (extraClass) classList += ` ${extraClass}`;
77
+ return composeClasses(classList);
78
+ };
79
+ const getFeaturedCarouselItemClasses = ({ extraClass })=>{
80
+ let classList = `gp-group gp-z-0 gp-flex !gp-min-w-full !gp-max-w-full gp-w-full gp-relative gp-items-start gp-justify-center gp-overflow-hidden gp-outline-1 -gp-outline-offset-1 gp-image-item gp-ft-image-item data-[outline=active]:gp-outline`;
81
+ if (extraClass) classList += ` ${extraClass}`;
82
+ return composeClasses(classList);
83
+ };
84
+
85
+ exports.getFeaturedCarouselItemClasses = getFeaturedCarouselItemClasses;
86
+ exports.getFeaturedImageCarouselClasses = getFeaturedImageCarouselClasses;
87
+ exports.getFeaturedImageClasses = getFeaturedImageClasses;
88
+ exports.getFeaturedImageGalleryClasses = getFeaturedImageGalleryClasses;
89
+ exports.getFtImageWithGalleryClasses = getFtImageWithGalleryClasses;
90
+ exports.getGalleryGridWrapperClasses = getGalleryGridWrapperClasses;
91
+ exports.getGalleryItemClasses = getGalleryItemClasses;
92
+ exports.getGalleryWrapperClasses = getGalleryWrapperClasses;
93
+ exports.getImageGalleryWrapperClasses = getImageGalleryWrapperClasses;
94
+ exports.getWrapperClasses = getWrapperClasses;
@@ -0,0 +1,303 @@
1
+ 'use strict';
2
+
3
+ var core = require('@gem-sdk/core');
4
+ var common = require('./common.js');
5
+ var productGallery = require('./productGallery.js');
6
+
7
+ const DEVICES = [
8
+ 'desktop',
9
+ 'mobile',
10
+ 'tablet'
11
+ ];
12
+ function filterTruthyStyles(styles) {
13
+ return Object.fromEntries(Object.entries(styles || {}).filter(([, value])=>!!value));
14
+ }
15
+ const getWrapContainerStyle = (settings, isOnlyOneImage)=>{
16
+ const gridLayout = common.getStyleGridLayout({
17
+ position: settings.position,
18
+ ratioLayout: settings.ratioLayout,
19
+ ratioLayoutRight: settings.ratioLayoutRight,
20
+ isHiddenGalleryImages: !!isOnlyOneImage
21
+ });
22
+ const layoutOneImage = {
23
+ '--gtc': 'minmax(0, 12fr)'
24
+ };
25
+ const composeStyles = {
26
+ ...isOnlyOneImage ? layoutOneImage : gridLayout,
27
+ ...core.makeStyleResponsive('gg', settings?.spacing)
28
+ };
29
+ return filterTruthyStyles(composeStyles);
30
+ };
31
+ const getFeatureImageStyle = (settings, { enableOrder, enableDisplay })=>{
32
+ const getStyleFeaturedImageDisplay = ()=>{
33
+ return common.getDisplayStyle((device)=>![
34
+ 'bottom-center',
35
+ 'left',
36
+ 'right',
37
+ 'only-feature',
38
+ 'inside-bottom',
39
+ 'inside-left',
40
+ 'inside-right'
41
+ ].includes(core.getResponsiveValueByScreen(settings?.position, device) || ''), 'flex');
42
+ };
43
+ const featureImageOrder = common.getStyleGridOrderForFeature({
44
+ position: settings?.position
45
+ });
46
+ const composeStyles = {
47
+ ...core.makeStyleResponsive('jc', settings?.align),
48
+ ...enableOrder && {
49
+ ...featureImageOrder
50
+ },
51
+ ...enableDisplay && {
52
+ ...getStyleFeaturedImageDisplay()
53
+ }
54
+ };
55
+ return filterTruthyStyles(composeStyles);
56
+ };
57
+ const getGalleryImageStyle = (settings, featureImageHeight)=>{
58
+ const galleryImageOrder = common.getStyleGridOrderForGallery({
59
+ position: settings.position
60
+ });
61
+ const getHeightForGallery = ()=>{
62
+ let result = {};
63
+ const ftImageHeight = featureImageHeight ?? 0;
64
+ DEVICES.forEach((device)=>{
65
+ const position = core.getResponsiveValueByScreen(settings?.position, device);
66
+ const isHorizontalLayout = [
67
+ 'left',
68
+ 'right'
69
+ ].includes(position);
70
+ const spacingByDevice = core.getResponsiveValueByScreen(settings?.spacing, device);
71
+ const isHorizontalInsideLayout = [
72
+ 'inside-left',
73
+ 'inside-right'
74
+ ].includes(position);
75
+ const spacingValue = common.convertSpacingForIndisdeLayout(spacingByDevice);
76
+ const heightInside = `calc(${ftImageHeight}px - ${spacingValue})`;
77
+ result = {
78
+ ...result,
79
+ [device]: isHorizontalLayout ? ftImageHeight + 'px' : isHorizontalInsideLayout ? heightInside : 'auto'
80
+ };
81
+ });
82
+ return result;
83
+ };
84
+ const shapeByLayout = productGallery.getShapeByLayout({
85
+ shape: settings.shape,
86
+ shapeForBottom: settings.shapeForBottom,
87
+ shapeFor1Col: settings.shapeFor1Col,
88
+ shapeFor2Col: settings.shapeFor2Col,
89
+ shapeForFtOnly: settings.shapeForFtOnly,
90
+ shapeForInsideBottom: settings.shapeForInsideBottom ?? productGallery.sizeSettingDefaultForNewLayout,
91
+ shapeForInside: settings.shapeForInside ?? productGallery.sizeSettingDefaultForNewLayout
92
+ }, settings.position);
93
+ const styleInsideLayout = common.getStyleInsideLayout(settings.position, shapeByLayout, settings?.spacing);
94
+ const composeStyles = {
95
+ ...core.makeStyleResponsive('h', core.makeHeight(getHeightForGallery())),
96
+ ...core.makeStyleResponsive('jc', settings?.align),
97
+ ...galleryImageOrder,
98
+ ...styleInsideLayout
99
+ };
100
+ return filterTruthyStyles(composeStyles);
101
+ };
102
+ const getGalleryGridStyle = (setting, wrapperStyle)=>{
103
+ const shapeByLayout = productGallery.getShapeByLayout({
104
+ shape: setting.shape,
105
+ shapeForBottom: setting.shapeForBottom,
106
+ shapeFor1Col: setting.shapeFor1Col,
107
+ shapeFor2Col: setting.shapeFor2Col,
108
+ shapeForFtOnly: setting.shapeForFtOnly,
109
+ shapeForInsideBottom: setting.shapeForInsideBottom,
110
+ shapeForInside: setting.shapeForInside
111
+ }, setting.position);
112
+ const getGridDisplay = ()=>{
113
+ const isDisplayGrid = (type, position, device)=>{
114
+ const layout = core.getResponsiveValueByScreen(position, device);
115
+ const typeDevice = core.getResponsiveValueByScreen(type, device);
116
+ const isDisplayTypeGrid = typeDevice !== 'slider' && (layout === 'bottom-center' || layout === 'inside-bottom');
117
+ const isDisplayByLayout = [
118
+ 'one-col',
119
+ 'two-col'
120
+ ].includes(layout || '');
121
+ return isDisplayTypeGrid || isDisplayByLayout;
122
+ };
123
+ const isDisplayByWidth = productGallery.checkDisplayGalleryByWidth({
124
+ shapeByLayout
125
+ });
126
+ const isDisplay = {
127
+ desktop: isDisplayByWidth.desktop && isDisplayGrid(setting.type, setting.position, 'desktop'),
128
+ tablet: isDisplayByWidth.tablet && isDisplayGrid(setting.type, setting.position, 'tablet'),
129
+ mobile: isDisplayByWidth.mobile && isDisplayGrid(setting.type, setting.position, 'mobile')
130
+ };
131
+ return common.getDisplayStyle((device)=>!isDisplay[device], 'flex');
132
+ };
133
+ const composeStyles = {
134
+ ...getGridDisplay(),
135
+ ...core.makeStyleResponsive('cg', setting?.itemSpacing),
136
+ ...core.makeStyleResponsive('rg', setting?.itemSpacing),
137
+ ...core.makeStyleResponsive('jc', setting?.align),
138
+ ...wrapperStyle
139
+ };
140
+ return filterTruthyStyles(composeStyles);
141
+ };
142
+ const getGalleryGridItemStyle = (setting)=>{
143
+ const shapeByLayout = productGallery.getShapeByLayout({
144
+ shape: setting.shape,
145
+ shapeForBottom: setting.shapeForBottom,
146
+ shapeFor1Col: setting.shapeFor1Col,
147
+ shapeFor2Col: setting.shapeFor2Col,
148
+ shapeForFtOnly: setting.shapeForFtOnly,
149
+ shapeForInsideBottom: setting.shapeForInsideBottom,
150
+ shapeForInside: setting.shapeForInside
151
+ }, setting.position);
152
+ const getHeightByLayoutForItem = core.getHeightByShapeGlobalSize(shapeByLayout);
153
+ const getWidthByLayoutForItem = productGallery.getSettingWidthForGridItem({
154
+ shapeByLayout,
155
+ itemSpacing: setting.itemSpacing
156
+ });
157
+ const composeStyles = {
158
+ 'max-width': '100%',
159
+ 'outline-color': 'var(--g-c-brand, brand)',
160
+ ...core.makeStyleResponsive('h', core.makeHeight(getHeightByLayoutForItem)),
161
+ ...core.makeStyleResponsive('w', core.makeWidth(getWidthByLayoutForItem)),
162
+ ...core.composeRadius({
163
+ normal: setting.corner
164
+ })
165
+ };
166
+ return filterTruthyStyles(composeStyles);
167
+ };
168
+ const getFeatureImageCarouselItemStyle = (setting)=>{
169
+ const imageHeightResponsive = core.getHeightByShapeGlobalSize(setting.ftShape);
170
+ const composeStyles = {
171
+ 'max-width': '100%',
172
+ 'outline-color': 'var(--g-c-brand, brand)',
173
+ ...core.composeRadius({
174
+ normal: setting?.ftCorner
175
+ }),
176
+ ...core.makeStyleResponsive('h', core.makeHeight(imageHeightResponsive)),
177
+ 'min-width': '100%'
178
+ };
179
+ return filterTruthyStyles(composeStyles);
180
+ };
181
+ const getGalleryCarouselStyle = (setting)=>{
182
+ const shapeByLayout = productGallery.getShapeByLayout({
183
+ shape: setting.shape,
184
+ shapeForBottom: setting.shapeForBottom,
185
+ shapeFor1Col: setting.shapeFor1Col,
186
+ shapeFor2Col: setting.shapeFor2Col,
187
+ shapeForFtOnly: setting.shapeForFtOnly,
188
+ shapeForInsideBottom: setting.shapeForInsideBottom,
189
+ shapeForInside: setting.shapeForInside
190
+ }, setting.position);
191
+ const getWidthByLayoutForCarouselByDevice = (device)=>{
192
+ const layout = core.getResponsiveValueByScreen(setting?.position, device);
193
+ const isLayoutBottom = layout === 'bottom-center' || layout === 'inside-bottom';
194
+ const isInsideLayout = layout === 'inside-left' || layout === 'inside-right';
195
+ const shapeSetting = core.getResponsiveValueByScreen(shapeByLayout, device);
196
+ return isLayoutBottom || isInsideLayout || !shapeSetting?.width ? '100%' : shapeSetting.width;
197
+ };
198
+ const composeStyles = {
199
+ spacing: common.convertSpacing(setting?.itemSpacing),
200
+ sizeSetting: {
201
+ desktop: {
202
+ width: getWidthByLayoutForCarouselByDevice('desktop'),
203
+ height: '100%'
204
+ },
205
+ tablet: {
206
+ width: getWidthByLayoutForCarouselByDevice('tablet'),
207
+ height: '100%'
208
+ },
209
+ mobile: {
210
+ width: getWidthByLayoutForCarouselByDevice('mobile'),
211
+ height: '100%'
212
+ }
213
+ }
214
+ };
215
+ return filterTruthyStyles(composeStyles);
216
+ };
217
+ const getGalleryCarouselItemStyle = (setting)=>{
218
+ const shapeByLayout = productGallery.getShapeByLayout({
219
+ shape: setting.shape,
220
+ shapeForBottom: setting.shapeForBottom,
221
+ shapeFor1Col: setting.shapeFor1Col,
222
+ shapeFor2Col: setting.shapeFor2Col,
223
+ shapeForFtOnly: setting.shapeForFtOnly,
224
+ shapeForInsideBottom: setting.shapeForInsideBottom,
225
+ shapeForInside: setting.shapeForInside
226
+ }, setting.position);
227
+ const styleMinWidthForItem = core.makeStyleResponsive('minw', core.makeWidth(productGallery.getSettingMinWidthForCarouselItem({
228
+ shapeByLayout,
229
+ position: setting.position,
230
+ spacing: setting.itemSpacing
231
+ })));
232
+ const styleWidthForItem = core.makeStyleResponsive('w', core.makeWidth(productGallery.getSettingWidthForCarouselItem({
233
+ shapeByLayout,
234
+ position: setting.position
235
+ })));
236
+ const styleHeightForItem = core.makeStyleResponsive('h', core.makeHeight(core.getHeightByShapeGlobalSize(shapeByLayout)));
237
+ const composeStyles = {
238
+ 'max-width': '100%',
239
+ 'outline-color': 'var(--g-c-brand, brand)',
240
+ ...styleMinWidthForItem,
241
+ ...styleWidthForItem,
242
+ ...styleHeightForItem,
243
+ ...core.composeRadius({
244
+ normal: setting.corner
245
+ })
246
+ };
247
+ return filterTruthyStyles(composeStyles);
248
+ };
249
+ const getFeaturedImageCarouselStyle = (setting)=>{
250
+ const imageWidthResponsiveByDevice = (device)=>{
251
+ const shapeSetting = core.getResponsiveValueByScreen(setting.ftShape, device);
252
+ return shapeSetting?.width ?? '100%';
253
+ };
254
+ const composeStyles = {
255
+ playSpeed: setting?.ftAnimationSpeed,
256
+ sizeSetting: {
257
+ desktop: {
258
+ width: imageWidthResponsiveByDevice('desktop'),
259
+ height: 'auto'
260
+ },
261
+ tablet: {
262
+ width: imageWidthResponsiveByDevice('tablet'),
263
+ height: 'auto'
264
+ },
265
+ mobile: {
266
+ width: imageWidthResponsiveByDevice('mobile'),
267
+ height: 'auto'
268
+ }
269
+ },
270
+ align: {
271
+ desktop: core.getResponsiveValueByScreen(setting?.align, 'desktop'),
272
+ tablet: core.getResponsiveValueByScreen(setting?.align, 'tablet'),
273
+ mobile: core.getResponsiveValueByScreen(setting?.align, 'mobile')
274
+ }
275
+ };
276
+ return filterTruthyStyles(composeStyles);
277
+ };
278
+ const getFeaturedImageOnlyOneImageStyle = ({ setting, options })=>{
279
+ const imageHeightResponsive = core.getHeightByShapeGlobalSize(setting?.ftShape);
280
+ const composeStyles = {
281
+ ...core.makeStyleWithDefault('w', core.getWidthByShapeGlobalSize(setting?.ftShape, false, true), {
282
+ desktop: '--g-ct-w',
283
+ tablet: '--g-ct-w',
284
+ mobile: '--g-ct-w'
285
+ }),
286
+ ...options?.enableRadius && core.composeRadius({
287
+ normal: setting?.ftCorner
288
+ }),
289
+ ...options?.enableHeight && core.makeStyleResponsive('h', core.makeHeight(imageHeightResponsive))
290
+ };
291
+ return filterTruthyStyles(composeStyles);
292
+ };
293
+
294
+ exports.getFeatureImageCarouselItemStyle = getFeatureImageCarouselItemStyle;
295
+ exports.getFeatureImageStyle = getFeatureImageStyle;
296
+ exports.getFeaturedImageCarouselStyle = getFeaturedImageCarouselStyle;
297
+ exports.getFeaturedImageOnlyOneImageStyle = getFeaturedImageOnlyOneImageStyle;
298
+ exports.getGalleryCarouselItemStyle = getGalleryCarouselItemStyle;
299
+ exports.getGalleryCarouselStyle = getGalleryCarouselStyle;
300
+ exports.getGalleryGridItemStyle = getGalleryGridItemStyle;
301
+ exports.getGalleryGridStyle = getGalleryGridStyle;
302
+ exports.getGalleryImageStyle = getGalleryImageStyle;
303
+ exports.getWrapContainerStyle = getWrapContainerStyle;