@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,119 +0,0 @@
1
- 'use strict';
2
-
3
- var core = require('@gem-sdk/core');
4
-
5
- const devices = [
6
- 'desktop',
7
- 'tablet',
8
- 'mobile'
9
- ];
10
- const getResponsiveSetting = (setting)=>{
11
- const desktop = setting.desktop;
12
- const tablet = setting.tablet ? setting.tablet : desktop;
13
- const mobile = setting.mobile ? setting.mobile : tablet;
14
- return {
15
- desktop,
16
- tablet,
17
- mobile
18
- };
19
- };
20
- const getArrowPositionStyle = ({ vertical, arrowType, gapToEachSize, left })=>{
21
- const result = {};
22
- devices.forEach((item)=>{
23
- const verticalResponsive = core.getResponsiveValueByScreen(vertical, item, false);
24
- const deviceType = item === 'desktop' ? '' : `-${item}`;
25
- if (!verticalResponsive) {
26
- result[`left${deviceType}`] = arrowType[item] === 'inside' && left ? gapToEachSize + 'px' : 'initial';
27
- result[`top${deviceType}`] = left ? 'initial' : '';
28
- result[`right${deviceType}`] = arrowType[item] === 'inside' && !left ? gapToEachSize + 'px' : 'initial';
29
- result[`bottom${deviceType}`] = !left ? 'initial' : '';
30
- } else {
31
- result[`top${deviceType}`] = arrowType[item] === 'inside' && left ? gapToEachSize + 'px' : 'initial';
32
- result[`left${deviceType}`] = left ? 'initial' : '';
33
- result[`bottom${deviceType}`] = arrowType[item] === 'inside' && !left ? gapToEachSize + 'px' : 'initial';
34
- result[`right${deviceType}`] = !left ? 'initial' : '';
35
- }
36
- });
37
- return result;
38
- };
39
- const getClassArrowRotate = (left, vertical)=>{
40
- const result = {};
41
- devices.forEach((item)=>{
42
- const verticalResponsive = core.getResponsiveValueByScreen(vertical, item, false);
43
- const deviceType = item === 'desktop' ? '' : `${item}:`;
44
- result[`${deviceType}gp-rotate-[-90deg]`] = left && !!verticalResponsive;
45
- result[`${deviceType}gp-rotate-90`] = !left && !!verticalResponsive;
46
- result[`${deviceType}gp-rotate-180`] = left && !verticalResponsive;
47
- result[`${deviceType}gp-rotate-0`] = !left && !verticalResponsive;
48
- });
49
- return result;
50
- };
51
- const getClassArrowDisplay = (arrowType, vertical)=>{
52
- const result = {};
53
- devices.forEach((device)=>{
54
- const verticalResponsive = core.getResponsiveValueByScreen(vertical, device, false);
55
- const deviceRes = device === 'desktop' ? '' : `${device}:`;
56
- result[`${deviceRes}!gp-flex ${deviceRes}!gp-absolute ${deviceRes}gp-z-2`] = arrowType[device] === 'inside' || !!verticalResponsive;
57
- result[`${deviceRes}!gp-flex ${deviceRes}!gp-relative `] = arrowType[device] === 'outside';
58
- result[`${deviceRes}!gp-hidden`] = arrowType[device] === 'none';
59
- });
60
- return result;
61
- };
62
- const getArrowDisplayStyle = (arrowType)=>{
63
- let result = {};
64
- devices.forEach((device)=>{
65
- const arrowTypeResponsive = core.getResponsiveValueByScreen(arrowType, device, 'none');
66
- result = {
67
- ...result,
68
- [device]: arrowTypeResponsive === 'none' ? 'none' : 'flex'
69
- };
70
- });
71
- return result;
72
- };
73
- const mappingNavigationCarousel = (setting)=>{
74
- const generateValueByDevices = (value)=>{
75
- const newValue = {
76
- ...value
77
- };
78
- const deviceNotExits = devices.filter((x)=>!Object.keys(newValue).includes(x));
79
- deviceNotExits.forEach((el)=>{
80
- if (el === 'tablet') {
81
- newValue[el] = newValue['desktop'];
82
- }
83
- if (el === 'mobile') {
84
- newValue[el] = newValue['tablet'];
85
- }
86
- });
87
- return newValue;
88
- };
89
- if (setting?.layout === 'vertical') {
90
- const { controlOverContent, arrow } = setting;
91
- const newArrow = generateValueByDevices(arrow);
92
- const newControlOverContent = generateValueByDevices(controlOverContent);
93
- const navigationStyle = {};
94
- devices.forEach((el)=>{
95
- if (!newArrow[el]) navigationStyle[el] = 'none';
96
- else if (newArrow[el] && newControlOverContent[el]) navigationStyle[el] = 'inside';
97
- else navigationStyle[el] = 'outside';
98
- });
99
- return {
100
- ...setting,
101
- navigationStyle
102
- };
103
- }
104
- return setting;
105
- };
106
- const getData = (props)=>{
107
- const isRenderCustomIcon = !!props.custom && props.custom !== '';
108
- return {
109
- isRenderCustomIcon
110
- };
111
- };
112
-
113
- exports.getArrowDisplayStyle = getArrowDisplayStyle;
114
- exports.getArrowPositionStyle = getArrowPositionStyle;
115
- exports.getClassArrowDisplay = getClassArrowDisplay;
116
- exports.getClassArrowRotate = getClassArrowRotate;
117
- exports.getData = getData;
118
- exports.getResponsiveSetting = getResponsiveSetting;
119
- exports.mappingNavigationCarousel = mappingNavigationCarousel;
@@ -1,50 +0,0 @@
1
- 'use strict';
2
-
3
- var system = require('@gem-sdk/system');
4
- var common = require('./common.js');
5
-
6
- const getClass = (props)=>{
7
- const { className, componentId, rootId, left, uid, isHiddenWhenDisabled, disabled, showWhenHover, showArrow, vertical } = props;
8
- const idClass = 'gp-carousel-arrow-' + uid;
9
- const arrowType = common.getResponsiveSetting(showArrow || {});
10
- const classAction = left ? 'gp-carousel-action-back gem-slider-previous' : 'gp-carousel-action-next gem-slider-next';
11
- const buttonClass = system.createClass({
12
- ...{
13
- 'gp-z-1 gp-items-center gp-justify-center gp-overflow-hidden gp-shrink-0': true
14
- },
15
- ...{
16
- [idClass]: true
17
- },
18
- ...className && {
19
- [className]: true
20
- },
21
- ...componentId && {
22
- [componentId]: true
23
- },
24
- ...rootId && {
25
- [rootId]: true
26
- },
27
- ...classAction && {
28
- [classAction]: true
29
- },
30
- ...{
31
- hidden: isHiddenWhenDisabled && disabled,
32
- 'gp-cursor-default gp-text-gray-300': disabled,
33
- 'gp-cursor-pointer gp-text-gray-500': !disabled,
34
- '!gp-invisible group-hover/carousel:!gp-visible': showWhenHover,
35
- ...common.getClassArrowDisplay(arrowType, vertical)
36
- }
37
- });
38
- const buttonContentClass = system.createClass({
39
- ...{
40
- 'gp-flex gp-items-center gp-justify-center [&>svg]:gp-h-full [&>svg]:gp-w-full': true
41
- },
42
- ...common.getClassArrowRotate(Boolean(left), vertical)
43
- });
44
- return {
45
- buttonClass,
46
- buttonContentClass
47
- };
48
- };
49
-
50
- exports.getClass = getClass;
@@ -1,84 +0,0 @@
1
- 'use strict';
2
-
3
- var system = require('@gem-sdk/system');
4
- var core = require('@gem-sdk/core');
5
- var common = require('./common.js');
6
-
7
- const getStyle = (props, type = 'liquid')=>{
8
- const { uid, vertical, showArrow, gapToEachSize, left, arrowBackgroundColor, arrowButtonSize, rootId, arrowBorder, arrowCorner, arrowCustomColor, arrowIconSize, arrowShadow } = props;
9
- const arrowShadowStyle = core.getResponsiveStyleShadowWithoutState(arrowShadow, 'box-shadow', arrowShadow);
10
- const arrowBorderStyle = common.getResponsiveSetting(arrowBorder || {});
11
- const arrowCornerStyle = common.getResponsiveSetting(arrowCorner || {});
12
- const buttonPadding = core.getPaddingGlobalSize(arrowButtonSize);
13
- const iconSizeResponsive = common.getResponsiveSetting(arrowIconSize || {});
14
- const arrowType = common.getResponsiveSetting(showArrow || {});
15
- const buttonWidth = core.makeGlobalSizeWidthResponsive(arrowButtonSize);
16
- const buttonHeight = core.makeGlobalSizeHeightResponsive(arrowButtonSize);
17
- const iconWidth = core.makeStyleResponsive('w', iconSizeResponsive, 'px');
18
- const iconHeight = core.makeStyleResponsive('h', iconSizeResponsive, 'px');
19
- const display = core.makeStyleResponsive('d', common.getArrowDisplayStyle(arrowType));
20
- const position = core.makeStyle(common.getArrowPositionStyle({
21
- vertical,
22
- arrowType,
23
- gapToEachSize: gapToEachSize ?? '',
24
- left: Boolean(left)
25
- }));
26
- const buttonStyleObj = {
27
- 'background-color': arrowBackgroundColor ?? '',
28
- ...display,
29
- ...position,
30
- ...buttonWidth,
31
- ...buttonHeight,
32
- ...buttonPadding,
33
- ...arrowShadowStyle
34
- };
35
- const buttonContentStyleObj = {
36
- ...core.makeStyle({
37
- c: arrowCustomColor
38
- }),
39
- ...iconWidth,
40
- ...iconHeight
41
- };
42
- const buttonStyle = type === 'react' ? system.createStyleReact(buttonStyleObj) : system.createStyle(buttonStyleObj);
43
- const buttonContentStyle = type === 'react' ? system.createStyleReact(buttonContentStyleObj) : system.createStyle(buttonContentStyleObj);
44
- const innerBorderCss = `
45
- ${rootId ? '.' + rootId : ''}.gp-carousel-arrow-${uid} {
46
- ${core.composeCornerCss(arrowCornerStyle.desktop)}
47
- }
48
- ${rootId ? '.' + rootId : ''}.gp-carousel-arrow-${uid}::before {
49
- content: '';
50
- height: 100%;
51
- width: 100%;
52
- position: absolute;
53
- pointer-events: none;
54
- z-index: 10;
55
- ${core.composeBorderCss(arrowBorderStyle.desktop)}
56
- ${core.composeCornerCss(arrowCornerStyle.desktop)}
57
- }
58
- @media only screen and (max-width: 1024px) and (min-width: 768px) {
59
- ${rootId ? '.' + rootId : ''}.gp-carousel-arrow-${uid} {
60
- ${core.composeCornerCss(arrowCornerStyle.tablet)}
61
- }
62
- ${rootId ? '.' + rootId : ''}.gp-carousel-arrow-${uid}::before {
63
- ${core.composeBorderCss(arrowBorderStyle.tablet)}
64
- ${core.composeCornerCss(arrowCornerStyle.tablet)}
65
- }
66
- }
67
- @media only screen and (max-width: 768px) {
68
- ${rootId ? '.' + rootId : ''}.gp-carousel-arrow-${uid} {
69
- ${core.composeCornerCss(arrowCornerStyle.mobile)}
70
- }
71
- ${rootId ? '.' + rootId : ''}.gp-carousel-arrow-${uid}::before {
72
- ${core.composeBorderCss(arrowBorderStyle.mobile)}
73
- ${core.composeCornerCss(arrowCornerStyle.mobile)}
74
- }
75
- }
76
- `;
77
- return {
78
- buttonStyle,
79
- buttonContentStyle,
80
- innerBorderCss
81
- };
82
- };
83
-
84
- exports.getStyle = getStyle;
@@ -1,34 +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 ChildrenDroppable = require('../../grid/components/ChildrenDroppable.js');
9
- var getStyle = require('./common/getStyle.js');
10
- var getClass = require('./common/getClass.js');
11
- var useCarouseItem = require('./hook/useCarouseItem.js');
12
-
13
- const CarouselItem = (props)=>{
14
- const { children, builderAttrs } = props;
15
- const { handleClick, handleMouseMove, handleMouseOut } = useCarouseItem.useCarouselItem(props);
16
- const { carouselItemStyle, carouselItemInnerStyle } = getStyle.getStyle(props);
17
- const { carouselItemClass, carouselItemInnerClass } = getClass.getClass(props);
18
- return /*#__PURE__*/ jsxRuntime.jsx("div", {
19
- ...builderAttrs,
20
- "aria-hidden": true,
21
- className: carouselItemClass,
22
- style: carouselItemStyle,
23
- onClick: handleClick,
24
- onMouseMove: handleMouseMove,
25
- onMouseLeave: handleMouseOut,
26
- children: /*#__PURE__*/ jsxRuntime.jsx("div", {
27
- className: carouselItemInnerClass,
28
- style: carouselItemInnerStyle,
29
- children: core.isEmptyChildren(children) ? /*#__PURE__*/ jsxRuntime.jsx(ChildrenDroppable.default, {}) : children
30
- })
31
- });
32
- };
33
-
34
- exports.default = CarouselItem;
@@ -1,38 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var core = require('@gem-sdk/core');
6
- var getStyle = require('./common/getStyle.js');
7
- var getClass = require('./common/getClass.js');
8
-
9
- const CarouselItem = (props)=>{
10
- const { builderAttrs, index, children } = props;
11
- const { carouselItemStyle, carouselItemInnerStyle } = getStyle.getStyle(props);
12
- const { carouselItemClass, carouselItemInnerClass } = getClass.getClass(props);
13
- return core.template`
14
- <div
15
- ${{
16
- ...builderAttrs
17
- }}
18
- class="${carouselItemClass}"
19
- style="${carouselItemStyle}"
20
- data-index="${index}"
21
- grid-index="{{forloop.index}}"
22
- external-id="{{media.external_id}}"
23
- media-type="{{media.media_type}}"
24
- media-poster="{{media.preview_image.src}}"
25
- media-source-url="{{media.sources.first.url}}"
26
- media-last-source-url="{{mediaSourceUrl}}"
27
- >
28
- <div
29
- class="${carouselItemInnerClass}"
30
- style="${carouselItemInnerStyle}"
31
- >
32
- ${children}
33
- </div>
34
- </div>
35
- `;
36
- };
37
-
38
- exports.default = CarouselItem;
@@ -1,29 +0,0 @@
1
- 'use strict';
2
-
3
- var system = require('@gem-sdk/system');
4
-
5
- const getClass = (props)=>{
6
- const { parentId, parentUid, builderProps, className } = props;
7
- const carouselItemClass = system.createClass({
8
- [`gem-slider-item gp-w-full`]: true,
9
- [`gem-slider-item-${parentId || parentUid}`]: true,
10
- ...parentUid && {
11
- [`gp-child-item-${parentUid}`]: true
12
- },
13
- ...builderProps?.uid && {
14
- [builderProps?.uid]: true
15
- },
16
- ...className && {
17
- [className]: true
18
- }
19
- });
20
- const carouselItemInnerClass = system.createClass({
21
- 'gp-h-full gp-w-full': true
22
- });
23
- return {
24
- carouselItemClass,
25
- carouselItemInnerClass
26
- };
27
- };
28
-
29
- exports.getClass = getClass;
@@ -1,79 +0,0 @@
1
- 'use strict';
2
-
3
- var core = require('@gem-sdk/core');
4
- var carousel = require('../../components/common/carousel.js');
5
- var system = require('@gem-sdk/system');
6
-
7
- const getStyle = (props)=>{
8
- const { style, contentType, parentStyle, parentSettings, background, customStyle, index } = props;
9
- const itemPadding = core.makeGlobalSize(parentStyle?.itemPadding);
10
- const styleByContentType = ()=>{
11
- const delList = [
12
- '--radius'
13
- ];
14
- delList.forEach((element)=>{
15
- delete style?.[element];
16
- });
17
- if (contentType === 'productImage') return style;
18
- return {
19
- ...style,
20
- ...core.makeStyle({
21
- bs: parentStyle?.borderContent?.border,
22
- bw: parentStyle?.borderContent?.width,
23
- bc: core.getSingleColorVariable(parentStyle?.borderContent?.color)
24
- }),
25
- ...core.getRadiusStyleActiveState({
26
- ...parentStyle?.roundedContent,
27
- active: {
28
- ...parentStyle?.roundedContent || {},
29
- radiusType: 'custom'
30
- }
31
- })
32
- };
33
- };
34
- const getCarouselItemStyle = {
35
- ...customStyle,
36
- ...itemPadding && itemPadding.padding,
37
- ...carousel.getInitialWidthForCarouselItem({
38
- spacing: parentStyle?.spacing,
39
- slidesToShow: parentSettings?.itemNumber ?? parentSettings?.slidesToShow,
40
- sneakPeak: parentSettings?.sneakPeak,
41
- sneakPeakType: parentSettings?.sneakPeakType,
42
- sneakPeakOffsetCenter: parentSettings?.sneakPeakOffsetCenter,
43
- sneakPeakOffsetForward: parentSettings?.sneakPeakOffsetForward,
44
- vertical: parentSettings?.vertical
45
- }),
46
- ...core.getStyleBackgroundByDevice(background),
47
- ...core.getGradientBgrStyleByDevice(background, {
48
- desktop: true,
49
- tablet: true,
50
- mobile: true
51
- }),
52
- ...core.makeStyleResponsive('ml', carousel.getCarouselSneakPeakTranslate({
53
- index,
54
- spacing: parentStyle?.spacing,
55
- slidesToShow: parentSettings?.itemNumber ?? parentSettings?.slidesToShow,
56
- sneakPeak: parentSettings?.sneakPeak,
57
- sneakPeakType: parentSettings?.sneakPeakType,
58
- sneakPeakOffsetCenter: parentSettings?.sneakPeakOffsetCenter,
59
- sneakPeakOffsetForward: parentSettings?.sneakPeakOffsetForward
60
- }))
61
- };
62
- const carouselItemInnerStyle = system.createStyle({
63
- ...core.getStyleShadow({
64
- value: parentStyle?.carouselShadow,
65
- styleAppliedFor: 'box-shadow',
66
- isEnableShadow: parentStyle?.hasActiveShadow
67
- })
68
- });
69
- const carouselItemStyle = system.createStyle({
70
- ...getCarouselItemStyle,
71
- ...styleByContentType()
72
- });
73
- return {
74
- carouselItemStyle,
75
- carouselItemInnerStyle
76
- };
77
- };
78
-
79
- exports.getStyle = getStyle;
@@ -1,22 +0,0 @@
1
- 'use strict';
2
-
3
- const useCarouselItem = (props)=>{
4
- const { onClickItem, onMouseMove, onMouseOut, dispatchEventSelectSlide, index = 0 } = props;
5
- const handleClick = (e)=>{
6
- onClickItem && onClickItem(e);
7
- dispatchEventSelectSlide && dispatchEventSelectSlide(index);
8
- };
9
- const handleMouseMove = (e)=>{
10
- onMouseMove && onMouseMove(e);
11
- };
12
- const handleMouseOut = (e)=>{
13
- onMouseOut && onMouseOut(e);
14
- };
15
- return {
16
- handleClick,
17
- handleMouseMove,
18
- handleMouseOut
19
- };
20
- };
21
-
22
- exports.useCarouselItem = useCarouselItem;
@@ -1,98 +0,0 @@
1
- 'use strict';
2
-
3
- var core = require('@gem-sdk/core');
4
- var helpers = require('../../../helpers.js');
5
-
6
- const DEVICES = [
7
- 'desktop',
8
- 'mobile',
9
- 'tablet'
10
- ];
11
- const getInitialWidthForCarouselItem = (setting)=>{
12
- let result = {};
13
- DEVICES.forEach((device)=>{
14
- if (!setting?.vertical?.[device]) {
15
- const className = {
16
- ...core.makeStyleResponsive('minw', core.makeWidth(getWidthForCarouselItem({
17
- spacing: setting?.spacing,
18
- slidesToShow: setting?.slidesToShow,
19
- sneakPeak: setting?.sneakPeak,
20
- sneakPeakType: setting?.sneakPeakType,
21
- sneakPeakOffsetCenter: setting?.sneakPeakOffsetCenter,
22
- sneakPeakOffsetForward: setting?.sneakPeakOffsetForward
23
- }))),
24
- ...core.makeStyleResponsive('maxw', core.makeWidth(getWidthForCarouselItem({
25
- spacing: setting?.spacing,
26
- slidesToShow: setting?.slidesToShow,
27
- sneakPeak: setting?.sneakPeak,
28
- sneakPeakType: setting?.sneakPeakType,
29
- sneakPeakOffsetCenter: setting?.sneakPeakOffsetCenter,
30
- sneakPeakOffsetForward: setting?.sneakPeakOffsetForward
31
- })))
32
- };
33
- result = {
34
- ...result,
35
- ...className
36
- };
37
- }
38
- });
39
- return result;
40
- };
41
- const getSlideToShow = (setting)=>{
42
- const result = {};
43
- DEVICES.forEach((device)=>{
44
- const enableSneakPeak = core.getResponsiveValueByScreen(setting.sneakPeak, device);
45
- const offset = enableSneakPeak ? core.getResponsiveValueByScreen(setting.sneakPeakType, device) === 'center' ? core.getResponsiveValueByScreen(setting.sneakPeakOffsetCenter, device) ?? 0 : core.getResponsiveValueByScreen(setting.sneakPeakOffsetForward, device) ?? 0 : 0;
46
- const itemNumberByDevice = core.getResponsiveValueByScreen(setting.slidesToShow, device) || 1;
47
- const rx = core.getResponsiveValueByScreen(setting.sneakPeakType, device) === 'center' ? -2 : -1;
48
- result[device] = itemNumberByDevice === 'auto' ? itemNumberByDevice : itemNumberByDevice + offset / 100 * rx;
49
- });
50
- return result;
51
- };
52
- const getCarouselSneakPeakTranslate = (setting)=>{
53
- let result = {};
54
- DEVICES.forEach((device)=>{
55
- const spacing = helpers.convertUnitToNumber(core.getResponsiveValueByScreen(setting.spacing, device), 44);
56
- const sneakPeak = core.getResponsiveValueByScreen(setting.sneakPeak, device, false);
57
- const sneakPeakType = core.getResponsiveValueByScreen(setting.sneakPeakType, device);
58
- const slidesToShow = helpers.convertUnitToNumber(core.getResponsiveValueByScreen(sneakPeak ? getSlideToShow({
59
- slidesToShow: setting?.slidesToShow,
60
- sneakPeak: setting?.sneakPeak,
61
- sneakPeakType: setting?.sneakPeakType,
62
- sneakPeakOffsetCenter: setting?.sneakPeakOffsetCenter,
63
- sneakPeakOffsetForward: setting?.sneakPeakOffsetForward
64
- }) : setting.slidesToShow, device), 4);
65
- const offset = 1.5;
66
- const itemSpacing = spacing * ((setting.index ?? 0) + 1);
67
- const itemWidth = `100% / ${slidesToShow} - ${(slidesToShow - 1) * spacing / slidesToShow}px + ${itemSpacing}px`;
68
- result = {
69
- ...result,
70
- [device]: sneakPeak && sneakPeakType === 'center' && setting.index === 0 ? `calc((${itemWidth}) * ${offset} - (${itemWidth}))` : `0px`
71
- };
72
- });
73
- return result;
74
- };
75
- const getWidthForCarouselItem = (setting)=>{
76
- let result = {};
77
- DEVICES.forEach((device)=>{
78
- const spacing = helpers.convertUnitToNumber(core.getResponsiveValueByScreen(setting.spacing, device), 44);
79
- const sneakPeak = core.getResponsiveValueByScreen(setting.sneakPeak, device, false);
80
- const slidesToShow = helpers.convertUnitToNumber(core.getResponsiveValueByScreen(sneakPeak ? getSlideToShow({
81
- slidesToShow: setting?.slidesToShow,
82
- sneakPeak: setting?.sneakPeak,
83
- sneakPeakType: setting?.sneakPeakType,
84
- sneakPeakOffsetCenter: setting?.sneakPeakOffsetCenter,
85
- sneakPeakOffsetForward: setting?.sneakPeakOffsetForward
86
- }) : setting.slidesToShow, device), 4);
87
- result = {
88
- ...result,
89
- [device]: `calc(100% / ${slidesToShow} - ${(slidesToShow - 1) * spacing / slidesToShow}px)`
90
- };
91
- });
92
- return result;
93
- };
94
-
95
- exports.getCarouselSneakPeakTranslate = getCarouselSneakPeakTranslate;
96
- exports.getInitialWidthForCarouselItem = getInitialWidthForCarouselItem;
97
- exports.getSlideToShow = getSlideToShow;
98
- exports.getWidthForCarouselItem = getWidthForCarouselItem;
@@ -1,5 +0,0 @@
1
- 'use strict';
2
-
3
- const DOT_CONTAINER_SELECTOR = 'gp-carousel-dot-container';
4
-
5
- exports.DOT_CONTAINER_SELECTOR = DOT_CONTAINER_SELECTOR;
@@ -1,34 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var React = require('react');
6
-
7
- const useTrackPreviewPause = (runPreview)=>{
8
- const trackerRef = React.useRef(undefined);
9
- const [isFirstPreviewClicked, setIsFirstPreviewClicked] = React.useState(false);
10
- React.useEffect(()=>{
11
- if (isFirstPreviewClicked) return;
12
- if (!trackerRef.current) {
13
- trackerRef.current = JSON.stringify({
14
- isFirstPreviewClicked,
15
- runPreview
16
- });
17
- return;
18
- }
19
- if (!isFirstPreviewClicked && trackerRef.current !== JSON.stringify({
20
- isFirstPreviewClicked,
21
- runPreview
22
- })) {
23
- setIsFirstPreviewClicked(true);
24
- }
25
- }, [
26
- isFirstPreviewClicked,
27
- runPreview
28
- ]);
29
- return {
30
- isFirstPreviewClicked
31
- };
32
- };
33
-
34
- exports.default = useTrackPreviewPause;
@@ -1,42 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- // Easing formula from https://easings.net/#
6
- const CAROUSEL_ANIMATION = {
7
- EASE_IN: {
8
- value: 'ease-in',
9
- formula: (t)=>t * t * t
10
- },
11
- EASE_OUT: {
12
- value: 'ease-out',
13
- formula: (t)=>1 - Math.pow(1 - t, 3)
14
- },
15
- EASE_IN_OUT: {
16
- value: 'ease-in-out',
17
- formula: (t)=>t < 0.5 ? 4 * t * t * t : 1 - Math.pow(-2 * t + 2, 3) / 2
18
- },
19
- DEFAULT: {
20
- value: 'default',
21
- formula: (t)=>1 + --t * t * t * t * t
22
- }
23
- };
24
- const DEFAULT_PLAY_SPEED = 500;
25
- const AnimationPlugin = (slider)=>{
26
- let timeout;
27
- let previousAnimation = slider.options.animation ?? {};
28
- slider.on('beforeOptionsChanged', (newOption)=>{
29
- clearTimeout(timeout);
30
- timeout = setTimeout(()=>{
31
- if (newOption.options.animation && JSON.stringify(newOption.options.animation) !== JSON.stringify(previousAnimation)) {
32
- previousAnimation = newOption.options.animation;
33
- slider.update(newOption.options);
34
- }
35
- }, 200);
36
- });
37
- };
38
-
39
- exports.AnimationPlugin = AnimationPlugin;
40
- exports.CAROUSEL_ANIMATION = CAROUSEL_ANIMATION;
41
- exports.DEFAULT_PLAY_SPEED = DEFAULT_PLAY_SPEED;
42
- exports.default = AnimationPlugin;