@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,292 @@
1
+ import { makeStyleResponsive, makeHeight, getHeightByShapeGlobalSize, makeWidth, composeRadius, getResponsiveValueByScreen, makeStyleWithDefault, getWidthByShapeGlobalSize } from '@gem-sdk/core';
2
+ import { getStyleGridLayout, getStyleGridOrderForFeature, getStyleGridOrderForGallery, getStyleInsideLayout, convertSpacing, getDisplayStyle, convertSpacingForIndisdeLayout } from './common.js';
3
+ import { getShapeByLayout, sizeSettingDefaultForNewLayout, getSettingWidthForGridItem, getSettingMinWidthForCarouselItem, getSettingWidthForCarouselItem, checkDisplayGalleryByWidth } from './productGallery.js';
4
+
5
+ const DEVICES = [
6
+ 'desktop',
7
+ 'mobile',
8
+ 'tablet'
9
+ ];
10
+ function filterTruthyStyles(styles) {
11
+ return Object.fromEntries(Object.entries(styles || {}).filter(([, value])=>!!value));
12
+ }
13
+ const getWrapContainerStyle = (settings, isOnlyOneImage)=>{
14
+ const gridLayout = getStyleGridLayout({
15
+ position: settings.position,
16
+ ratioLayout: settings.ratioLayout,
17
+ ratioLayoutRight: settings.ratioLayoutRight,
18
+ isHiddenGalleryImages: !!isOnlyOneImage
19
+ });
20
+ const layoutOneImage = {
21
+ '--gtc': 'minmax(0, 12fr)'
22
+ };
23
+ const composeStyles = {
24
+ ...isOnlyOneImage ? layoutOneImage : gridLayout,
25
+ ...makeStyleResponsive('gg', settings?.spacing)
26
+ };
27
+ return filterTruthyStyles(composeStyles);
28
+ };
29
+ const getFeatureImageStyle = (settings, { enableOrder, enableDisplay })=>{
30
+ const getStyleFeaturedImageDisplay = ()=>{
31
+ return getDisplayStyle((device)=>![
32
+ 'bottom-center',
33
+ 'left',
34
+ 'right',
35
+ 'only-feature',
36
+ 'inside-bottom',
37
+ 'inside-left',
38
+ 'inside-right'
39
+ ].includes(getResponsiveValueByScreen(settings?.position, device) || ''), 'flex');
40
+ };
41
+ const featureImageOrder = getStyleGridOrderForFeature({
42
+ position: settings?.position
43
+ });
44
+ const composeStyles = {
45
+ ...makeStyleResponsive('jc', settings?.align),
46
+ ...enableOrder && {
47
+ ...featureImageOrder
48
+ },
49
+ ...enableDisplay && {
50
+ ...getStyleFeaturedImageDisplay()
51
+ }
52
+ };
53
+ return filterTruthyStyles(composeStyles);
54
+ };
55
+ const getGalleryImageStyle = (settings, featureImageHeight)=>{
56
+ const galleryImageOrder = getStyleGridOrderForGallery({
57
+ position: settings.position
58
+ });
59
+ const getHeightForGallery = ()=>{
60
+ let result = {};
61
+ const ftImageHeight = featureImageHeight ?? 0;
62
+ DEVICES.forEach((device)=>{
63
+ const position = getResponsiveValueByScreen(settings?.position, device);
64
+ const isHorizontalLayout = [
65
+ 'left',
66
+ 'right'
67
+ ].includes(position);
68
+ const spacingByDevice = getResponsiveValueByScreen(settings?.spacing, device);
69
+ const isHorizontalInsideLayout = [
70
+ 'inside-left',
71
+ 'inside-right'
72
+ ].includes(position);
73
+ const spacingValue = convertSpacingForIndisdeLayout(spacingByDevice);
74
+ const heightInside = `calc(${ftImageHeight}px - ${spacingValue})`;
75
+ result = {
76
+ ...result,
77
+ [device]: isHorizontalLayout ? ftImageHeight + 'px' : isHorizontalInsideLayout ? heightInside : 'auto'
78
+ };
79
+ });
80
+ return result;
81
+ };
82
+ const shapeByLayout = getShapeByLayout({
83
+ shape: settings.shape,
84
+ shapeForBottom: settings.shapeForBottom,
85
+ shapeFor1Col: settings.shapeFor1Col,
86
+ shapeFor2Col: settings.shapeFor2Col,
87
+ shapeForFtOnly: settings.shapeForFtOnly,
88
+ shapeForInsideBottom: settings.shapeForInsideBottom ?? sizeSettingDefaultForNewLayout,
89
+ shapeForInside: settings.shapeForInside ?? sizeSettingDefaultForNewLayout
90
+ }, settings.position);
91
+ const styleInsideLayout = getStyleInsideLayout(settings.position, shapeByLayout, settings?.spacing);
92
+ const composeStyles = {
93
+ ...makeStyleResponsive('h', makeHeight(getHeightForGallery())),
94
+ ...makeStyleResponsive('jc', settings?.align),
95
+ ...galleryImageOrder,
96
+ ...styleInsideLayout
97
+ };
98
+ return filterTruthyStyles(composeStyles);
99
+ };
100
+ const getGalleryGridStyle = (setting, wrapperStyle)=>{
101
+ const shapeByLayout = getShapeByLayout({
102
+ shape: setting.shape,
103
+ shapeForBottom: setting.shapeForBottom,
104
+ shapeFor1Col: setting.shapeFor1Col,
105
+ shapeFor2Col: setting.shapeFor2Col,
106
+ shapeForFtOnly: setting.shapeForFtOnly,
107
+ shapeForInsideBottom: setting.shapeForInsideBottom,
108
+ shapeForInside: setting.shapeForInside
109
+ }, setting.position);
110
+ const getGridDisplay = ()=>{
111
+ const isDisplayGrid = (type, position, device)=>{
112
+ const layout = getResponsiveValueByScreen(position, device);
113
+ const typeDevice = getResponsiveValueByScreen(type, device);
114
+ const isDisplayTypeGrid = typeDevice !== 'slider' && (layout === 'bottom-center' || layout === 'inside-bottom');
115
+ const isDisplayByLayout = [
116
+ 'one-col',
117
+ 'two-col'
118
+ ].includes(layout || '');
119
+ return isDisplayTypeGrid || isDisplayByLayout;
120
+ };
121
+ const isDisplayByWidth = checkDisplayGalleryByWidth({
122
+ shapeByLayout
123
+ });
124
+ const isDisplay = {
125
+ desktop: isDisplayByWidth.desktop && isDisplayGrid(setting.type, setting.position, 'desktop'),
126
+ tablet: isDisplayByWidth.tablet && isDisplayGrid(setting.type, setting.position, 'tablet'),
127
+ mobile: isDisplayByWidth.mobile && isDisplayGrid(setting.type, setting.position, 'mobile')
128
+ };
129
+ return getDisplayStyle((device)=>!isDisplay[device], 'flex');
130
+ };
131
+ const composeStyles = {
132
+ ...getGridDisplay(),
133
+ ...makeStyleResponsive('cg', setting?.itemSpacing),
134
+ ...makeStyleResponsive('rg', setting?.itemSpacing),
135
+ ...makeStyleResponsive('jc', setting?.align),
136
+ ...wrapperStyle
137
+ };
138
+ return filterTruthyStyles(composeStyles);
139
+ };
140
+ const getGalleryGridItemStyle = (setting)=>{
141
+ const shapeByLayout = getShapeByLayout({
142
+ shape: setting.shape,
143
+ shapeForBottom: setting.shapeForBottom,
144
+ shapeFor1Col: setting.shapeFor1Col,
145
+ shapeFor2Col: setting.shapeFor2Col,
146
+ shapeForFtOnly: setting.shapeForFtOnly,
147
+ shapeForInsideBottom: setting.shapeForInsideBottom,
148
+ shapeForInside: setting.shapeForInside
149
+ }, setting.position);
150
+ const getHeightByLayoutForItem = getHeightByShapeGlobalSize(shapeByLayout);
151
+ const getWidthByLayoutForItem = getSettingWidthForGridItem({
152
+ shapeByLayout,
153
+ itemSpacing: setting.itemSpacing
154
+ });
155
+ const composeStyles = {
156
+ 'max-width': '100%',
157
+ 'outline-color': 'var(--g-c-brand, brand)',
158
+ ...makeStyleResponsive('h', makeHeight(getHeightByLayoutForItem)),
159
+ ...makeStyleResponsive('w', makeWidth(getWidthByLayoutForItem)),
160
+ ...composeRadius({
161
+ normal: setting.corner
162
+ })
163
+ };
164
+ return filterTruthyStyles(composeStyles);
165
+ };
166
+ const getFeatureImageCarouselItemStyle = (setting)=>{
167
+ const imageHeightResponsive = getHeightByShapeGlobalSize(setting.ftShape);
168
+ const composeStyles = {
169
+ 'max-width': '100%',
170
+ 'outline-color': 'var(--g-c-brand, brand)',
171
+ ...composeRadius({
172
+ normal: setting?.ftCorner
173
+ }),
174
+ ...makeStyleResponsive('h', makeHeight(imageHeightResponsive)),
175
+ 'min-width': '100%'
176
+ };
177
+ return filterTruthyStyles(composeStyles);
178
+ };
179
+ const getGalleryCarouselStyle = (setting)=>{
180
+ const shapeByLayout = getShapeByLayout({
181
+ shape: setting.shape,
182
+ shapeForBottom: setting.shapeForBottom,
183
+ shapeFor1Col: setting.shapeFor1Col,
184
+ shapeFor2Col: setting.shapeFor2Col,
185
+ shapeForFtOnly: setting.shapeForFtOnly,
186
+ shapeForInsideBottom: setting.shapeForInsideBottom,
187
+ shapeForInside: setting.shapeForInside
188
+ }, setting.position);
189
+ const getWidthByLayoutForCarouselByDevice = (device)=>{
190
+ const layout = getResponsiveValueByScreen(setting?.position, device);
191
+ const isLayoutBottom = layout === 'bottom-center' || layout === 'inside-bottom';
192
+ const isInsideLayout = layout === 'inside-left' || layout === 'inside-right';
193
+ const shapeSetting = getResponsiveValueByScreen(shapeByLayout, device);
194
+ return isLayoutBottom || isInsideLayout || !shapeSetting?.width ? '100%' : shapeSetting.width;
195
+ };
196
+ const composeStyles = {
197
+ spacing: convertSpacing(setting?.itemSpacing),
198
+ sizeSetting: {
199
+ desktop: {
200
+ width: getWidthByLayoutForCarouselByDevice('desktop'),
201
+ height: '100%'
202
+ },
203
+ tablet: {
204
+ width: getWidthByLayoutForCarouselByDevice('tablet'),
205
+ height: '100%'
206
+ },
207
+ mobile: {
208
+ width: getWidthByLayoutForCarouselByDevice('mobile'),
209
+ height: '100%'
210
+ }
211
+ }
212
+ };
213
+ return filterTruthyStyles(composeStyles);
214
+ };
215
+ const getGalleryCarouselItemStyle = (setting)=>{
216
+ const shapeByLayout = getShapeByLayout({
217
+ shape: setting.shape,
218
+ shapeForBottom: setting.shapeForBottom,
219
+ shapeFor1Col: setting.shapeFor1Col,
220
+ shapeFor2Col: setting.shapeFor2Col,
221
+ shapeForFtOnly: setting.shapeForFtOnly,
222
+ shapeForInsideBottom: setting.shapeForInsideBottom,
223
+ shapeForInside: setting.shapeForInside
224
+ }, setting.position);
225
+ const styleMinWidthForItem = makeStyleResponsive('minw', makeWidth(getSettingMinWidthForCarouselItem({
226
+ shapeByLayout,
227
+ position: setting.position,
228
+ spacing: setting.itemSpacing
229
+ })));
230
+ const styleWidthForItem = makeStyleResponsive('w', makeWidth(getSettingWidthForCarouselItem({
231
+ shapeByLayout,
232
+ position: setting.position
233
+ })));
234
+ const styleHeightForItem = makeStyleResponsive('h', makeHeight(getHeightByShapeGlobalSize(shapeByLayout)));
235
+ const composeStyles = {
236
+ 'max-width': '100%',
237
+ 'outline-color': 'var(--g-c-brand, brand)',
238
+ ...styleMinWidthForItem,
239
+ ...styleWidthForItem,
240
+ ...styleHeightForItem,
241
+ ...composeRadius({
242
+ normal: setting.corner
243
+ })
244
+ };
245
+ return filterTruthyStyles(composeStyles);
246
+ };
247
+ const getFeaturedImageCarouselStyle = (setting)=>{
248
+ const imageWidthResponsiveByDevice = (device)=>{
249
+ const shapeSetting = getResponsiveValueByScreen(setting.ftShape, device);
250
+ return shapeSetting?.width ?? '100%';
251
+ };
252
+ const composeStyles = {
253
+ playSpeed: setting?.ftAnimationSpeed,
254
+ sizeSetting: {
255
+ desktop: {
256
+ width: imageWidthResponsiveByDevice('desktop'),
257
+ height: 'auto'
258
+ },
259
+ tablet: {
260
+ width: imageWidthResponsiveByDevice('tablet'),
261
+ height: 'auto'
262
+ },
263
+ mobile: {
264
+ width: imageWidthResponsiveByDevice('mobile'),
265
+ height: 'auto'
266
+ }
267
+ },
268
+ align: {
269
+ desktop: getResponsiveValueByScreen(setting?.align, 'desktop'),
270
+ tablet: getResponsiveValueByScreen(setting?.align, 'tablet'),
271
+ mobile: getResponsiveValueByScreen(setting?.align, 'mobile')
272
+ }
273
+ };
274
+ return filterTruthyStyles(composeStyles);
275
+ };
276
+ const getFeaturedImageOnlyOneImageStyle = ({ setting, options })=>{
277
+ const imageHeightResponsive = getHeightByShapeGlobalSize(setting?.ftShape);
278
+ const composeStyles = {
279
+ ...makeStyleWithDefault('w', getWidthByShapeGlobalSize(setting?.ftShape, false, true), {
280
+ desktop: '--g-ct-w',
281
+ tablet: '--g-ct-w',
282
+ mobile: '--g-ct-w'
283
+ }),
284
+ ...options?.enableRadius && composeRadius({
285
+ normal: setting?.ftCorner
286
+ }),
287
+ ...options?.enableHeight && makeStyleResponsive('h', makeHeight(imageHeightResponsive))
288
+ };
289
+ return filterTruthyStyles(composeStyles);
290
+ };
291
+
292
+ export { getFeatureImageCarouselItemStyle, getFeatureImageStyle, getFeaturedImageCarouselStyle, getFeaturedImageOnlyOneImageStyle, getGalleryCarouselItemStyle, getGalleryCarouselStyle, getGalleryGridItemStyle, getGalleryGridStyle, getGalleryImageStyle, getWrapContainerStyle };
@@ -0,0 +1,92 @@
1
+ import { convertUnitToNumber } from './common.js';
2
+
3
+ const handleMouseMove = (event, setting)=>{
4
+ const isEnableRoomEffect = setting?.hoverEffect === 'zoom' && setting?.zoomType === 'default';
5
+ const isEnableGlassEffect = setting?.hoverEffect === 'zoom' && setting?.zoomType === 'glasses';
6
+ const isEnableShowOtherImage = setting?.hoverEffect === 'other';
7
+ const isEnableHoverEffect = setting?.hoverEffect !== 'none';
8
+ if (!isEnableHoverEffect) return;
9
+ const featureImageDom = event.currentTarget.querySelector('img');
10
+ const featureImageHoverDom = event.currentTarget.querySelector('img.hover-image');
11
+ const zoomLens = event.currentTarget.querySelector('.room-len');
12
+ const imagePosition = featureImageDom?.getBoundingClientRect();
13
+ const slideWidth = featureImageDom?.clientWidth || 0;
14
+ const slideHeight = featureImageDom?.clientHeight || 0;
15
+ const zoom = convertUnitToNumber(setting?.zoom, 0);
16
+ const zoomValue = !zoom || zoom < 100 ? 1 : zoom / 100 || 1;
17
+ const zoomSize = (slideWidth || 1) * (setting?.hoverEffect === 'other' ? 1 : zoomValue);
18
+ const zoomSizeHeight = (slideHeight || 1) * (setting?.hoverEffect === 'other' ? 1 : zoomValue);
19
+ const imageOffsetX = event.clientX - imagePosition?.x;
20
+ const imageOffsetY = event.clientY - imagePosition?.y;
21
+ isEnableShowOtherImage && displayOtherImage({
22
+ featureImageHoverDom
23
+ });
24
+ isEnableRoomEffect && event.clientX >= imagePosition?.x && event.clientX <= imagePosition.right && event.clientY >= imagePosition?.y && event.clientY <= imagePosition.bottom && displayZoomImage({
25
+ featureImageDom,
26
+ featureImageHoverDom,
27
+ zoomSize,
28
+ zoomSizeHeight,
29
+ slideWidth,
30
+ imageOffsetX,
31
+ imageOffsetY,
32
+ isEnableShowOtherImage
33
+ });
34
+ isEnableGlassEffect && displayZoomLen({
35
+ zoomLens,
36
+ zoomSize,
37
+ zoomValue,
38
+ imagePosition,
39
+ slideWidth,
40
+ slideHeight,
41
+ imageOffsetX,
42
+ imageOffsetY
43
+ });
44
+ };
45
+ const displayOtherImage = ({ featureImageHoverDom })=>{
46
+ if (!featureImageHoverDom) return;
47
+ featureImageHoverDom.style.opacity = '1';
48
+ featureImageHoverDom.style.top = '0px';
49
+ featureImageHoverDom.style.left = '0px';
50
+ featureImageHoverDom.style.width = '100%';
51
+ };
52
+ const displayZoomLen = ({ zoomLens, zoomSize, zoomValue, slideWidth, slideHeight, imageOffsetX, imageOffsetY })=>{
53
+ if (!zoomLens) return;
54
+ zoomLens.style.opacity = '1';
55
+ const w = zoomLens.offsetWidth / 2;
56
+ const h = zoomLens.offsetHeight / 2;
57
+ const imageHeight = slideHeight || 1;
58
+ if (imageOffsetX > slideWidth - w / zoomValue) {
59
+ imageOffsetX = slideWidth - w / zoomValue;
60
+ }
61
+ if (imageOffsetX < w / zoomValue) {
62
+ imageOffsetX = w / zoomValue;
63
+ }
64
+ if (imageOffsetY > imageHeight - h / zoomValue) {
65
+ imageOffsetY = imageHeight - h / zoomValue;
66
+ }
67
+ if (imageOffsetY < h / zoomValue) {
68
+ imageOffsetY = h / zoomValue;
69
+ }
70
+ zoomLens.style.top = imageOffsetY - h + 'px';
71
+ zoomLens.style.left = imageOffsetX - w + 'px';
72
+ zoomLens.style.backgroundSize = zoomSize + 'px ' + imageHeight * zoomValue + 'px';
73
+ zoomLens.style.backgroundPosition = `-${imageOffsetX * zoomValue - w}px -${imageOffsetY * zoomValue - h}px`;
74
+ };
75
+ const displayZoomImage = ({ featureImageDom, featureImageHoverDom, zoomSize, zoomSizeHeight, slideWidth, imageOffsetX, imageOffsetY, isEnableShowOtherImage = false })=>{
76
+ if (!featureImageHoverDom) return;
77
+ featureImageHoverDom.style.width = `${zoomSize}px`;
78
+ if (!isEnableShowOtherImage) featureImageHoverDom.style.height = `${zoomSizeHeight}px`;
79
+ featureImageHoverDom.style.opacity = '1';
80
+ const x = imageOffsetX / featureImageDom?.offsetWidth;
81
+ const y = imageOffsetY / featureImageDom?.offsetHeight;
82
+ featureImageHoverDom.style.top = (featureImageDom?.offsetHeight - featureImageHoverDom.offsetHeight) * y + 'px';
83
+ featureImageHoverDom.style.left = (slideWidth - zoomSize) * x + 'px';
84
+ };
85
+ const handleMouseOut = (event)=>{
86
+ const featureImageHoverDom = event.currentTarget.querySelector('img.hover-image');
87
+ const zoomLens = event.currentTarget.querySelector('.room-len');
88
+ featureImageHoverDom && (featureImageHoverDom.style.opacity = '0');
89
+ zoomLens && (zoomLens.style.opacity = '0');
90
+ };
91
+
92
+ export { handleMouseMove, handleMouseOut };
@@ -0,0 +1,53 @@
1
+ import { getResponsiveValueByScreen } from '@gem-sdk/core';
2
+
3
+ const devices = [
4
+ 'desktop',
5
+ 'tablet',
6
+ 'mobile'
7
+ ];
8
+ const isFeatureMedia = (contentType)=>{
9
+ if (!contentType) return false;
10
+ return [
11
+ 'EXTERNAL_VIDEO',
12
+ 'MODEL_3D',
13
+ 'VIDEO'
14
+ ].includes(contentType);
15
+ };
16
+ const getZoomLenClass = ()=>{
17
+ return `!gp-flex gp-absolute gp-opacity-0 gp-h-[150px] gp-w-[150px] gp-cursor-none gp-rounded-full gp-bg-no-repeat gp-shadow-glasses gp-bg-white gp-pointer-events-none`;
18
+ };
19
+ const getZoomImageClass = ()=>{
20
+ return `gp-absolute gp-left-0 gp-top-0 gp-opacity-0 gp-transition-opacity gp-bg-white gp-pointer-events-none`;
21
+ };
22
+ const getDotStyleForOnlyFeaturedImage = (setting)=>{
23
+ let result = {};
24
+ devices.forEach((device)=>{
25
+ const position = getResponsiveValueByScreen(setting.position, device);
26
+ const dotStyle = getResponsiveValueByScreen(setting.dotStyle, device);
27
+ result = {
28
+ ...result,
29
+ [device]: position === 'only-feature' ? dotStyle : 'none'
30
+ };
31
+ });
32
+ return result;
33
+ };
34
+ const checkRenderFeaturedCarousel = (setting)=>{
35
+ const devices = [
36
+ 'desktop',
37
+ 'mobile',
38
+ 'tablet'
39
+ ];
40
+ let isShow = false;
41
+ devices.forEach((device)=>{
42
+ const show = checkShowCarousel(setting, device);
43
+ if (checkShowCarousel(setting, device)) {
44
+ isShow = show;
45
+ }
46
+ });
47
+ return isShow;
48
+ };
49
+ const checkShowCarousel = (setting, device)=>{
50
+ return getResponsiveValueByScreen(setting.position, device) !== 'only-feature' || getResponsiveValueByScreen(setting.ftNavigationPosition, device) !== 'none' || getResponsiveValueByScreen(setting.ftDotStyle, device) !== 'none' || getResponsiveValueByScreen(setting.ftLoop, device) === true || setting.ftDragToScroll === true;
51
+ };
52
+
53
+ export { checkRenderFeaturedCarousel, getDotStyleForOnlyFeaturedImage, getZoomImageClass, getZoomLenClass, isFeatureMedia };
@@ -0,0 +1,251 @@
1
+ import { getResponsiveValueByScreen, cls } from '@gem-sdk/core';
2
+ import { getDisplayStyle } from './common.js';
3
+ import { convertUnitToNumber } from '../../ProductImages/common/productFeaturedImage.js';
4
+
5
+ const getZoomDisplay = (largeViewInPopup)=>{
6
+ return getDisplayStyle((device)=>!getResponsiveValueByScreen(largeViewInPopup, device), 'flex');
7
+ };
8
+ const HORIZONTAL_LAYOUT = [
9
+ 'right',
10
+ 'left',
11
+ 'inside-left',
12
+ 'inside-right'
13
+ ];
14
+ const sizeSettingDefaultForNewLayout = {
15
+ desktop: {
16
+ shape: 'square',
17
+ shapeValue: '1/1',
18
+ width: '20%',
19
+ height: undefined,
20
+ shapeLinked: true
21
+ }
22
+ };
23
+ const getCarouselVerticalConfigByPosition = (position)=>{
24
+ const devices = [
25
+ 'desktop',
26
+ 'mobile',
27
+ 'tablet'
28
+ ];
29
+ let result = {};
30
+ devices.forEach((device)=>{
31
+ const positionDevice = getResponsiveValueByScreen(position, device);
32
+ const isHorizontalLayout = HORIZONTAL_LAYOUT.includes(positionDevice);
33
+ if (isHorizontalLayout) result = {
34
+ ...result,
35
+ [device]: true
36
+ };
37
+ else result = {
38
+ ...result,
39
+ [device]: false
40
+ };
41
+ });
42
+ return result;
43
+ };
44
+ const getMinHeightByPosition = (position, navigationPosition)=>{
45
+ const devices = [
46
+ 'desktop',
47
+ 'mobile',
48
+ 'tablet'
49
+ ];
50
+ const vertical = getCarouselVerticalConfigByPosition(position);
51
+ const result = {};
52
+ devices.forEach((device)=>{
53
+ const navigationStyle = getResponsiveValueByScreen(navigationPosition, device);
54
+ const deviceType = device === 'desktop' ? '' : `${device}:`;
55
+ result[`${deviceType}!gp-min-h-0`] = !!vertical[device] && navigationStyle === 'outside';
56
+ result[`${deviceType}!gp-min-h-full`] = !(vertical[device] && navigationStyle === 'outside');
57
+ });
58
+ return cls({
59
+ ...result
60
+ });
61
+ };
62
+ const getEditorMinHeightClass = (device, position, navigationPosition)=>{
63
+ const vertical = getCarouselVerticalConfigByPosition(position);
64
+ const navigationStyle = getResponsiveValueByScreen(navigationPosition, device);
65
+ return vertical[device] && navigationStyle === 'outside' ? '!gp-min-h-0' : '!gp-min-h-full';
66
+ };
67
+ const getAllowDotConfig = ()=>{
68
+ return {
69
+ desktop: false,
70
+ tablet: false,
71
+ mobile: false
72
+ };
73
+ };
74
+ const getDotStyleConfig = ()=>{
75
+ return {
76
+ desktop: 'none',
77
+ tablet: 'none',
78
+ mobile: 'none'
79
+ };
80
+ };
81
+ const getSettingWidthForGridItem = (setting)=>{
82
+ let result = {};
83
+ const DEVICES = [
84
+ 'desktop',
85
+ 'mobile',
86
+ 'tablet'
87
+ ];
88
+ DEVICES.forEach((device)=>{
89
+ const widthDevice = getResponsiveValueByScreen(setting.shapeByLayout, device)?.width;
90
+ const itemSpacingDevice = getResponsiveValueByScreen(setting.itemSpacing, device);
91
+ let itemPerLine = 0;
92
+ if (widthDevice?.includes('%')) {
93
+ itemPerLine = 100 / parseInt(widthDevice);
94
+ }
95
+ result = {
96
+ ...result,
97
+ [device]: itemPerLine ? `calc(${widthDevice} - ${itemSpacingDevice} * ${itemPerLine - 1} / ${itemPerLine})` : widthDevice
98
+ };
99
+ });
100
+ return result;
101
+ };
102
+ const getSettingWidthForCarouselItem = (setting)=>{
103
+ let result = {};
104
+ const DEVICES = [
105
+ 'desktop',
106
+ 'mobile',
107
+ 'tablet'
108
+ ];
109
+ DEVICES.forEach((device)=>{
110
+ const layout = getResponsiveValueByScreen(setting.position, device);
111
+ const isLayoutBottom = layout === 'bottom-center';
112
+ const itemWidth = getResponsiveValueByScreen(setting.shapeByLayout, device)?.width;
113
+ result = {
114
+ ...result,
115
+ [device]: isLayoutBottom && itemWidth?.includes('px') ? itemWidth : '100%'
116
+ };
117
+ });
118
+ return result;
119
+ };
120
+ const getSettingMinWidthForCarouselItem = (setting)=>{
121
+ let result = {};
122
+ const DEVICES = [
123
+ 'desktop',
124
+ 'mobile',
125
+ 'tablet'
126
+ ];
127
+ DEVICES.forEach((device)=>{
128
+ const layout = getResponsiveValueByScreen(setting.position, device);
129
+ const spacing = convertUnitToNumber(getResponsiveValueByScreen(setting.spacing, device), 5);
130
+ const isLayoutBottom = layout === 'bottom-center' || layout === 'inside-bottom';
131
+ const itemWidth = getResponsiveValueByScreen(setting.shapeByLayout, device)?.width;
132
+ let value = '100%';
133
+ if (isLayoutBottom) {
134
+ const itemsPerSlide = 100 / convertUnitToNumber(itemWidth, 20);
135
+ value = itemWidth?.includes('px') ? itemWidth : itemWidth?.includes('%') ? `calc(${itemWidth} - ${(itemsPerSlide - 1) * spacing / itemsPerSlide}px)` : '100%';
136
+ }
137
+ result = {
138
+ ...result,
139
+ [device]: value
140
+ };
141
+ });
142
+ return result;
143
+ };
144
+ const checkDisplayGalleryByWidth = (setting)=>{
145
+ let result = {
146
+ desktop: true,
147
+ tablet: true,
148
+ mobile: true
149
+ };
150
+ const DEVICES = [
151
+ 'desktop',
152
+ 'mobile',
153
+ 'tablet'
154
+ ];
155
+ DEVICES.forEach((device)=>{
156
+ const itemWidth = getResponsiveValueByScreen(setting.shapeByLayout, device)?.width ?? '100%';
157
+ const isDisplay = parseInt(itemWidth) !== 0;
158
+ result = {
159
+ ...result,
160
+ [device]: isDisplay
161
+ };
162
+ });
163
+ return result;
164
+ };
165
+ const getSliderPerShowConfig = (shapeByLayout, position)=>{
166
+ let result = {
167
+ desktop: 'auto',
168
+ tablet: 'auto',
169
+ mobile: 'auto'
170
+ };
171
+ const DEVICES = [
172
+ 'desktop',
173
+ 'mobile',
174
+ 'tablet'
175
+ ];
176
+ DEVICES.forEach((device)=>{
177
+ const layout = getResponsiveValueByScreen(position, device);
178
+ const isLayoutBottom = layout === 'bottom-center' || layout === 'inside-bottom';
179
+ const itemWidth = getResponsiveValueByScreen(shapeByLayout, device)?.width;
180
+ let itemPerShow = 'auto';
181
+ if (itemWidth?.includes('%')) {
182
+ itemPerShow = parseInt(itemWidth) < 100 ? 100 / parseInt(itemWidth) : 'auto';
183
+ }
184
+ result = {
185
+ ...result,
186
+ [device]: isLayoutBottom ? itemPerShow : 'auto'
187
+ };
188
+ });
189
+ return result;
190
+ };
191
+ const getShapeByLayout = (setting, position)=>{
192
+ let shapeByLayout = {};
193
+ const DEVICES = [
194
+ 'desktop',
195
+ 'mobile',
196
+ 'tablet'
197
+ ];
198
+ DEVICES.forEach((device)=>{
199
+ const layout = getResponsiveValueByScreen(position, device);
200
+ switch(layout){
201
+ case 'bottom-center':
202
+ case 'bottom-left':
203
+ shapeByLayout = {
204
+ ...shapeByLayout,
205
+ [device]: getResponsiveValueByScreen(setting.shapeForBottom, device)
206
+ };
207
+ break;
208
+ case 'inside-bottom':
209
+ shapeByLayout = {
210
+ ...shapeByLayout,
211
+ [device]: getResponsiveValueByScreen(setting.shapeForInsideBottom ?? sizeSettingDefaultForNewLayout, device)
212
+ };
213
+ break;
214
+ case 'left':
215
+ case 'right':
216
+ shapeByLayout = {
217
+ ...shapeByLayout,
218
+ [device]: getResponsiveValueByScreen(setting.shape, device)
219
+ };
220
+ break;
221
+ case 'inside-left':
222
+ case 'inside-right':
223
+ shapeByLayout = {
224
+ ...shapeByLayout,
225
+ [device]: getResponsiveValueByScreen(setting.shapeForInside ?? sizeSettingDefaultForNewLayout, device)
226
+ };
227
+ break;
228
+ case 'only-feature':
229
+ shapeByLayout = {
230
+ ...shapeByLayout,
231
+ [device]: getResponsiveValueByScreen(setting.shapeForFtOnly, device)
232
+ };
233
+ break;
234
+ case 'one-col':
235
+ shapeByLayout = {
236
+ ...shapeByLayout,
237
+ [device]: getResponsiveValueByScreen(setting.shapeFor1Col, device)
238
+ };
239
+ break;
240
+ case 'two-col':
241
+ shapeByLayout = {
242
+ ...shapeByLayout,
243
+ [device]: getResponsiveValueByScreen(setting.shapeFor2Col, device)
244
+ };
245
+ break;
246
+ }
247
+ });
248
+ return shapeByLayout;
249
+ };
250
+
251
+ export { HORIZONTAL_LAYOUT, checkDisplayGalleryByWidth, getAllowDotConfig, getCarouselVerticalConfigByPosition, getDotStyleConfig, getEditorMinHeightClass, getMinHeightByPosition, getSettingMinWidthForCarouselItem, getSettingWidthForCarouselItem, getSettingWidthForGridItem, getShapeByLayout, getSliderPerShowConfig, getZoomDisplay, sizeSettingDefaultForNewLayout };