@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,266 +0,0 @@
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;
@@ -1,63 +0,0 @@
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;
@@ -1,36 +0,0 @@
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;
@@ -1,109 +0,0 @@
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 !gp-min-w-full'),
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;
@@ -1,139 +0,0 @@
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;