@gem-sdk/components 2.0.0-dev.693 → 2.0.0-dev.695

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 +4 -4
  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,59 +0,0 @@
1
- 'use client';
2
- import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
3
-
4
- const MediaIcon = ({ contentType })=>{
5
- const isVideoSource = contentType == 'VIDEO' || contentType == 'EXTERNAL_VIDEO';
6
- const isModel3D = contentType == 'MODEL_3D';
7
- return /*#__PURE__*/ jsx(Fragment, {
8
- children: (isVideoSource || isModel3D) && /*#__PURE__*/ jsxs("div", {
9
- className: "gp-absolute gp-bottom-0 gp-right-0 gp-pb-[15px] gp-pr-[15px]",
10
- children: [
11
- isVideoSource && /*#__PURE__*/ jsxs("svg", {
12
- width: "24",
13
- height: "24",
14
- viewBox: "0 0 24 24",
15
- fill: "none",
16
- xmlns: "http://www.w3.org/2000/svg",
17
- children: [
18
- /*#__PURE__*/ jsx("rect", {
19
- opacity: "0.9",
20
- width: "24",
21
- height: "24",
22
- rx: "3",
23
- fill: "#212121"
24
- }),
25
- /*#__PURE__*/ jsx("path", {
26
- 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",
27
- stroke: "#F9F9F9",
28
- strokeMiterlimit: "10"
29
- })
30
- ]
31
- }),
32
- isModel3D && /*#__PURE__*/ jsxs("svg", {
33
- width: "24",
34
- height: "24",
35
- viewBox: "0 0 24 24",
36
- fill: "none",
37
- xmlns: "http://www.w3.org/2000/svg",
38
- children: [
39
- /*#__PURE__*/ jsx("rect", {
40
- opacity: "0.9",
41
- width: "24",
42
- height: "24",
43
- rx: "3",
44
- fill: "#212121"
45
- }),
46
- /*#__PURE__*/ jsx("path", {
47
- fillRule: "evenodd",
48
- clipRule: "evenodd",
49
- 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",
50
- fill: "#F9F9F9"
51
- })
52
- ]
53
- })
54
- ]
55
- })
56
- });
57
- };
58
-
59
- export { MediaIcon as default };
@@ -1,32 +0,0 @@
1
- import { jsx, Fragment } from 'react/jsx-runtime';
2
- import { memo, useMemo } from 'react';
3
- import 'next/link';
4
- import '@gem-sdk/core';
5
- import Video from '../../../../../video/components/Video.js';
6
-
7
- const ProductFeatureVideo = (props)=>{
8
- const { url, aspectRatio } = props;
9
- const videoType = useMemo(()=>{
10
- if (url.includes('youtu.be')) return 'youtube';
11
- if (url.includes('vimeo')) return 'vimeo';
12
- return 'html5';
13
- }, [
14
- url
15
- ]);
16
- return /*#__PURE__*/ jsx(Fragment, {
17
- children: /*#__PURE__*/ jsx(Video, {
18
- setting: {
19
- type: videoType,
20
- html5Url: url,
21
- youtubeUrl: url,
22
- vimeoUrl: url,
23
- preload: true,
24
- controls: true,
25
- aspectRatio
26
- }
27
- })
28
- });
29
- };
30
- var ProductFeatureVideo$1 = /*#__PURE__*/ memo(ProductFeatureVideo);
31
-
32
- export { ProductFeatureVideo$1 as default };
@@ -1,105 +0,0 @@
1
- import { jsx, jsxs } from 'react/jsx-runtime';
2
- import { memo } from 'react';
3
- import { useCurrentDevice, getResponsiveValueByScreen, makeStyleResponsive } from '@gem-sdk/core';
4
- import { handleMouseMove, handleMouseOut } from '../../common/hoverAction.js';
5
- import { getProductImagesStyles } from '../../composables/getProductImagesStyles.js';
6
- import { getProductImagesClassName } from '../../composables/getProductImagesClassName.js';
7
- import { getProductImagesAttr } from '../../composables/getProductImagesAttr.js';
8
- import { createStyle } from '@gem-sdk/system';
9
- import { getFeaturedImageOnlyOneImageStyle } from '../../common/getStyle.js';
10
- import Carousel from '../../../../../carousel/root/Carousel.js';
11
- import CarouselItem from '../../../../../carousel/carousel-item/CarouselItem.js';
12
- import ProductFeaturedImageOnly from './ProductFeaturedImageOnly.js';
13
- import { useProductFeaturedImageCarousel } from '../../hooks/useProductFeaturedImageCarousel.js';
14
-
15
- const ProductFeaturedImageCarousel = (props)=>{
16
- const { productImages, imgRef, onHandleClick, onClickArrow, onHandleLoaded, onHandleUpdateActiveIndex, builderPropUID, builderPropsClass, children, parentUid, ...setting } = props;
17
- const { ref, imageActive, imageActiveIndex, imageShowWhenHover, enableOpenLightBox, filteredProductImages, isRenderFeatureCarousel, genRandomKey, getAspectRatioFinal, emitUpdateActiveIndex } = useProductFeaturedImageCarousel(props);
18
- const currentDevice = useCurrentDevice();
19
- const { galleryItemClasses, featureImageOnlyOneImageClasses } = getProductImagesClassName(setting);
20
- const { featuredImageCarouselStyle, featureImageCarouselItemStyle } = getProductImagesStyles(setting);
21
- const featureImageOnlyOneImageStyle = createStyle({
22
- ...getFeaturedImageOnlyOneImageStyle({
23
- setting,
24
- options: {
25
- enableRadius: true,
26
- enableHeight: true
27
- }
28
- })
29
- });
30
- const { featuredImageCarouselSettingAttrs } = getProductImagesAttr(setting);
31
- return /*#__PURE__*/ jsx("div", {
32
- ref: ref,
33
- "data-slot": "children",
34
- className: "product-feature-image",
35
- children: isRenderFeatureCarousel ? /*#__PURE__*/ jsxs(Carousel, {
36
- parentClass: builderPropsClass,
37
- elmRef: imgRef,
38
- setting: featuredImageCarouselSettingAttrs,
39
- styles: featuredImageCarouselStyle,
40
- builderProps: {
41
- uid: builderPropUID
42
- },
43
- isHiddenArrowWhenDisabled: true,
44
- onLoaded: (status)=>onHandleLoaded && onHandleLoaded(status),
45
- onChangeActive: (index)=>emitUpdateActiveIndex(index),
46
- onClickArrow: ()=>onClickArrow && onClickArrow(genRandomKey()),
47
- moveToIdx: imageActiveIndex,
48
- disableMarginAuto: true,
49
- onHandleChangeSlideByInteraction: (idx)=>{
50
- const length = filteredProductImages?.length ?? 0;
51
- const index = idx >= length ? 0 : idx;
52
- onHandleClick(filteredProductImages?.[index]?.id ?? '', enableOpenLightBox);
53
- },
54
- children: [
55
- children,
56
- filteredProductImages?.map((image)=>{
57
- return /*#__PURE__*/ jsx(CarouselItem, {
58
- contentType: "productImage",
59
- className: galleryItemClasses('gp-ft-image-item !gp-min-w-full'),
60
- onClickItem: ()=>{
61
- const clickEffect = getResponsiveValueByScreen(setting?.ftClickOpenLightBox, currentDevice);
62
- if (clickEffect !== 'none') onHandleClick(image?.id ?? '', enableOpenLightBox);
63
- },
64
- style: featureImageCarouselItemStyle,
65
- onMouseMove: (e)=>handleMouseMove(e, setting),
66
- onMouseOut: (e)=>handleMouseOut(e),
67
- children: /*#__PURE__*/ jsx(ProductFeaturedImageOnly, {
68
- image: image,
69
- imageShowWhenHover: imageShowWhenHover,
70
- setting: setting,
71
- aspectRatio: getAspectRatioFinal()
72
- })
73
- }, image?.id);
74
- })
75
- ]
76
- }) : /*#__PURE__*/ jsx("div", {
77
- ref: imgRef,
78
- className: "gp-flex gp-w-full",
79
- style: {
80
- ...makeStyleResponsive('jc', setting?.align)
81
- },
82
- "data-id": builderPropUID,
83
- children: /*#__PURE__*/ jsx("div", {
84
- "aria-hidden": "true",
85
- className: featureImageOnlyOneImageClasses,
86
- style: featureImageOnlyOneImageStyle,
87
- onMouseMove: (e)=>handleMouseMove(e, setting),
88
- onMouseOut: (e)=>handleMouseOut(e),
89
- onBlur: ()=>void 0,
90
- onClick: ()=>{
91
- onHandleClick(imageActive?.id ?? '', enableOpenLightBox);
92
- },
93
- children: /*#__PURE__*/ jsx(ProductFeaturedImageOnly, {
94
- image: imageActive,
95
- imageShowWhenHover: imageShowWhenHover,
96
- setting: setting,
97
- aspectRatio: getAspectRatioFinal(imageActive)
98
- })
99
- })
100
- })
101
- });
102
- };
103
- var ProductFeaturedImageCarousel$1 = /*#__PURE__*/ memo(ProductFeaturedImageCarousel);
104
-
105
- export { ProductFeaturedImageCarousel$1 as default };
@@ -1,135 +0,0 @@
1
- 'use client';
2
- import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
3
- import { useProduct, useCurrentDevice, useShopStore, useEditorMode, getResponsiveValueByScreen, cls, makeStyle } from '@gem-sdk/core';
4
- import { memo, useMemo } from 'react';
5
- import NextImage from '../../../../../image/components/NextImage.js';
6
- import MediaIcon from './MediaIcon.js';
7
- import { isFeatureMedia, getZoomImageClass, getZoomLenClass } from '../../common/productFeaturedImage.js';
8
- import ProductFeatureVideo from './ProductFeatureVideo.js';
9
-
10
- const defaultImage = {
11
- src: 'https://cdn.shopify.com/s/assets/no-image-2048-5e88c1b20e087fb7bbe9a3771824e743c244f437e4f8ba93bbf7b11b53f7824c_large.gif',
12
- id: `noImageError`,
13
- width: 480,
14
- height: 480,
15
- alt: `no image`,
16
- contentType: 'IMAGE'
17
- };
18
- const ProductFeaturedImageOnly = ({ image, imageShowWhenHover, setting, aspectRatio })=>{
19
- const product = useProduct();
20
- const currentDevice = useCurrentDevice();
21
- const storefrontUrl = useShopStore((state)=>state.storefrontUrl);
22
- const mode = useEditorMode();
23
- const isClickEffect = useMemo(()=>getResponsiveValueByScreen(setting.ftClickOpenLightBox, currentDevice) !== 'none', [
24
- currentDevice,
25
- setting.ftClickOpenLightBox
26
- ]);
27
- const isRenderVideo = useMemo(()=>mode !== 'edit' && [
28
- 'VIDEO',
29
- 'EXTERNAL_VIDEO'
30
- ].includes(image?.contentType || '') && !isClickEffect, [
31
- mode,
32
- image?.contentType,
33
- isClickEffect
34
- ]);
35
- const renderImage = useMemo(()=>{
36
- if (!image) return defaultImage;
37
- return {
38
- ...image,
39
- src: isRenderVideo ? image.src : isFeatureMedia(image?.contentType) ? image?.previewImage : image.src
40
- };
41
- }, [
42
- image,
43
- isRenderVideo
44
- ]);
45
- const shopifyProductLink = useMemo(()=>{
46
- if (!storefrontUrl) return `#`;
47
- const url = new URL(storefrontUrl);
48
- if (product) {
49
- return `${url.protocol}//${url.host}/products/${product.handle}`;
50
- }
51
- return `#`;
52
- }, [
53
- storefrontUrl,
54
- product
55
- ]);
56
- const handleProductLink = (children)=>{
57
- if (getResponsiveValueByScreen(setting.ftClickOpenLightBox, currentDevice) === 'product-link') return /*#__PURE__*/ jsx("a", {
58
- title: product?.title,
59
- href: shopifyProductLink,
60
- className: "gp-w-full",
61
- children: children
62
- });
63
- return children;
64
- };
65
- const isRenderHoverImage = useMemo(()=>setting?.hoverEffect !== 'none' && !isFeatureMedia(renderImage?.contentType), [
66
- renderImage?.contentType,
67
- setting?.hoverEffect
68
- ]);
69
- const isZoomImage = useMemo(()=>setting?.hoverEffect == 'zoom' && setting?.zoomType == 'glasses' && !isFeatureMedia(renderImage?.contentType), [
70
- renderImage?.contentType,
71
- setting?.hoverEffect,
72
- setting?.zoomType
73
- ]);
74
- return /*#__PURE__*/ jsx(Fragment, {
75
- children: handleProductLink(/*#__PURE__*/ jsx(Fragment, {
76
- children: isRenderVideo ? /*#__PURE__*/ jsx(ProductFeatureVideo, {
77
- type: renderImage?.contentType,
78
- url: renderImage.src ?? '',
79
- aspectRatio: aspectRatio
80
- }) : /*#__PURE__*/ jsxs(Fragment, {
81
- children: [
82
- /*#__PURE__*/ jsx(NextImage, {
83
- draggable: "false",
84
- src: renderImage.src,
85
- width: renderImage?.width,
86
- height: renderImage?.height,
87
- alt: renderImage?.alt,
88
- setting: {
89
- aspectRatio: aspectRatio,
90
- layout: setting?.ftLayout
91
- },
92
- priority: setting?.preload,
93
- className: "featured-image-only",
94
- style: {
95
- width: '100%',
96
- height: '100%',
97
- cursor: 'pointer'
98
- }
99
- }),
100
- /*#__PURE__*/ jsx(MediaIcon, {
101
- contentType: renderImage?.contentType ?? ''
102
- }),
103
- isRenderHoverImage && /*#__PURE__*/ jsx(NextImage, {
104
- draggable: "false",
105
- src: setting?.hoverEffect === 'other' ? imageShowWhenHover?.src : renderImage.src,
106
- width: setting?.hoverEffect === 'other' ? imageShowWhenHover?.width : renderImage.width,
107
- height: setting?.hoverEffect === 'other' ? imageShowWhenHover?.height : renderImage.height,
108
- alt: setting?.hoverEffect === 'other' ? imageShowWhenHover?.alt : renderImage.alt,
109
- setting: {
110
- layout: setting.ftLayout,
111
- aspectRatio: aspectRatio
112
- },
113
- style: {
114
- width: '100%',
115
- height: '100%'
116
- },
117
- className: cls('hover-image featured-image-only !gp-max-w-none', getZoomImageClass()),
118
- priority: setting?.preload
119
- }),
120
- isZoomImage && /*#__PURE__*/ jsx("div", {
121
- className: cls(getZoomLenClass(), 'room-len'),
122
- style: {
123
- ...makeStyle({
124
- bgi: `url("${renderImage?.src}")`
125
- })
126
- }
127
- })
128
- ]
129
- })
130
- }))
131
- });
132
- };
133
- var ProductFeaturedImageOnly$1 = /*#__PURE__*/ memo(ProductFeaturedImageOnly);
134
-
135
- export { ProductFeaturedImageOnly$1 as default };
@@ -1,96 +0,0 @@
1
- import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
2
- import { useCurrentDevice, cls, getResponsiveValueByScreen, makeStyle } from '@gem-sdk/core';
3
- import { memo } from 'react';
4
- import { getAspectRatio } from '../../common/common.js';
5
- import NextImage from '../../../../../image/components/NextImage.js';
6
- import ButtonOpenLightBox from '../lightbox/ButtonOpenLightBox.js';
7
- import MediaIcon from './MediaIcon.js';
8
- import { isFeatureMedia, getZoomImageClass, getZoomLenClass } from '../../common/productFeaturedImage.js';
9
- import { handleMouseMove, handleMouseOut } from '../../common/hoverAction.js';
10
- import { getProductImagesClassName } from '../../composables/getProductImagesClassName.js';
11
- import { getProductImagesStyles } from '../../composables/getProductImagesStyles.js';
12
- import { useProductGalleryGrid } from '../../hooks/useProductGalleryGrid.js';
13
-
14
- const ProductGalleryGrid = (props)=>{
15
- const { builderPropUID, productImages, onHandleClick, activeIndexFormFeatureImage, children, isHiddenInteraction, ...setting } = props;
16
- const { isDisplay, shapeByLayout, imageActiveIndex, enableOpenLightBox, isEnableBorderActive, filteredProductImages } = useProductGalleryGrid(props);
17
- const currentDevice = useCurrentDevice();
18
- const { galleryGridWrapperClasses, galleryItemClasses } = getProductImagesClassName(setting);
19
- const { galleryGridStyles, galleryGridItemStyles } = getProductImagesStyles(setting);
20
- return /*#__PURE__*/ jsx(Fragment, {
21
- children: isDisplay && /*#__PURE__*/ jsxs("div", {
22
- "data-slot": "children",
23
- "data-id": builderPropUID,
24
- className: galleryGridWrapperClasses,
25
- style: galleryGridStyles,
26
- "gp-data-hidden": `${isHiddenInteraction}`,
27
- children: [
28
- filteredProductImages?.map((image, index)=>{
29
- const canActive = index === imageActiveIndex;
30
- const imageSrc = isFeatureMedia(image.contentType) ? image.previewImage : image.src;
31
- return(// eslint-disable-next-line jsx-a11y/mouse-events-have-key-events
32
- /*#__PURE__*/ jsxs("div", {
33
- "aria-hidden": true,
34
- className: galleryItemClasses(`gem-slider-item-${builderPropUID}
35
- ${canActive && isEnableBorderActive ? 'gem-slider-item-active' : ''}`),
36
- onClick: ()=>onHandleClick(image?.id || '', enableOpenLightBox),
37
- style: galleryGridItemStyles,
38
- onMouseMove: (e)=>handleMouseMove(e, {
39
- hoverEffect: setting.galleryHoverEffect,
40
- zoom: setting.galleryZoom,
41
- zoomType: setting.galleryZoomType
42
- }),
43
- onMouseOut: (e)=>handleMouseOut(e),
44
- "data-border": canActive && !!setting?.borderActive ? 'active' : 'deactive',
45
- children: [
46
- /*#__PURE__*/ jsx(NextImage, {
47
- src: imageSrc,
48
- width: image?.width,
49
- height: image?.height,
50
- alt: image?.alt,
51
- setting: {
52
- aspectRatio: getAspectRatio(shapeByLayout),
53
- layout: setting?.layout
54
- },
55
- style: {
56
- width: '100%',
57
- height: '100%'
58
- }
59
- }, image?.id),
60
- /*#__PURE__*/ jsx(MediaIcon, {
61
- contentType: image?.contentType || ''
62
- }),
63
- setting?.galleryHoverEffect !== 'none' && !isFeatureMedia(image?.contentType) && /*#__PURE__*/ jsx(NextImage, {
64
- src: imageSrc,
65
- width: image?.width,
66
- height: image?.height,
67
- alt: image?.alt,
68
- setting: {
69
- layout: setting.layout,
70
- aspectRatio: getAspectRatio(shapeByLayout)
71
- },
72
- className: cls('hover-image !gp-max-w-none', getZoomImageClass())
73
- }),
74
- setting?.galleryHoverEffect == 'zoom' && setting?.galleryZoomType == 'glasses' && [
75
- 'one-col',
76
- 'two-col'
77
- ].includes(getResponsiveValueByScreen(setting.position, currentDevice) || '') && !isFeatureMedia(image?.contentType) && /*#__PURE__*/ jsx("div", {
78
- className: cls(getZoomLenClass(), 'room-len'),
79
- style: {
80
- ...makeStyle({
81
- bgi: `url("${image?.src}")`
82
- })
83
- }
84
- }),
85
- getResponsiveValueByScreen(setting?.clickOpenLightBox, currentDevice) && /*#__PURE__*/ jsx(ButtonOpenLightBox, {})
86
- ]
87
- }, image?.id));
88
- }),
89
- children
90
- ]
91
- })
92
- });
93
- };
94
- var ProductGalleryGrid$1 = /*#__PURE__*/ memo(ProductGalleryGrid);
95
-
96
- export { ProductGalleryGrid$1 as default };
@@ -1,73 +0,0 @@
1
- import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
2
- import { cls } from '@gem-sdk/core';
3
- import ProductGalleryCarousel from '../gallery-carousel/GalleryCarousel.js';
4
- import ProductGalleryGrid from '../child/ProductGalleryGrid.js';
5
- import ProductFeaturedImageCarousel from '../child/ProductFeaturedImageCarousel.js';
6
- import { getProductImagesStyles } from '../../composables/getProductImagesStyles.js';
7
- import { getProductImagesClassName } from '../../composables/getProductImagesClassName.js';
8
- import { useFeatureImageWithGallery } from '../../hooks/useFeatureImageWithGallery.js';
9
-
10
- const FeatureImageWithGallery = (props)=>{
11
- const { setting, styles, builderProps, gallery, onHandleClickImage, priorityFeatureImage, children, noDataChildren } = props;
12
- const settings = {
13
- ...setting,
14
- ...styles
15
- };
16
- const { isShowCarousel, featureImageHeight, featureWrapperImage, onClickFeatureArrow, activeIndexFromFeatureImage, setOnClickFeatureArrow, onHandleLoadedFeatureImage, setActiveIndexFromFeatureImage } = useFeatureImageWithGallery(props);
17
- if (gallery?.[0]?.id === 'noImageError') {
18
- return /*#__PURE__*/ jsx(Fragment, {
19
- children: noDataChildren
20
- });
21
- }
22
- const { ftImageGalleryClasses, imageGalleryWrapperClasses } = getProductImagesClassName(props);
23
- const { wrapperFeaturedImageStyle, featureImageStyle, galleryImageStyle } = getProductImagesStyles(settings, {
24
- gallery,
25
- featureImageHeight
26
- });
27
- return /*#__PURE__*/ jsxs("div", {
28
- className: cls('gp-grid gp-w-full gp-relative'),
29
- style: wrapperFeaturedImageStyle,
30
- children: [
31
- /*#__PURE__*/ jsx("div", {
32
- className: ftImageGalleryClasses,
33
- style: featureImageStyle,
34
- children: /*#__PURE__*/ jsx(ProductFeaturedImageCarousel, {
35
- imgRef: featureWrapperImage,
36
- productImages: gallery,
37
- ...settings,
38
- onHandleClick: (imageID, enableOpenLightBox)=>onHandleClickImage(imageID || '', enableOpenLightBox),
39
- onHandleLoaded: onHandleLoadedFeatureImage,
40
- onHandleUpdateActiveIndex: setActiveIndexFromFeatureImage,
41
- onClickArrow: (randomKey)=>setOnClickFeatureArrow(randomKey),
42
- builderPropUID: builderProps?.uid,
43
- builderPropsClass: `gp-product-images-feature-${builderProps?.uid}`,
44
- children: children
45
- })
46
- }),
47
- gallery.length > 1 && /*#__PURE__*/ jsx("div", {
48
- className: imageGalleryWrapperClasses,
49
- style: galleryImageStyle,
50
- children: isShowCarousel ? /*#__PURE__*/ jsx(ProductGalleryCarousel, {
51
- productImages: gallery,
52
- position: settings?.position,
53
- ...settings,
54
- builderPropUID: builderProps?.uid,
55
- onHandleClick: (imageID, enableOpenLightBox)=>onHandleClickImage(imageID || '', enableOpenLightBox),
56
- activeIndexFormFeatureImage: activeIndexFromFeatureImage,
57
- priorityFeatureImage: priorityFeatureImage,
58
- onClickFeatureArrow: onClickFeatureArrow,
59
- builderPropsClass: `gp-product-images-gallery-${builderProps?.uid}`
60
- }) : /*#__PURE__*/ jsx(ProductGalleryGrid, {
61
- productImages: gallery,
62
- ...settings,
63
- builderPropUID: builderProps?.uid,
64
- onHandleClick: (imageID, enableOpenLightBox)=>onHandleClickImage(imageID || '', enableOpenLightBox),
65
- activeIndexFormFeatureImage: activeIndexFromFeatureImage,
66
- isHiddenInteraction: true
67
- })
68
- })
69
- ]
70
- });
71
- };
72
-
73
- export { FeatureImageWithGallery as default };