@gem-sdk/components 2.0.0-dev.289 → 2.0.0-dev.293

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 (56) hide show
  1. package/dist/cjs/accordion/components/common/styles.js +1 -2
  2. package/dist/cjs/banner/components/HeroBannerItem.liquid.js +1 -1
  3. package/dist/cjs/carousel/components/Carousel.js +2 -3
  4. package/dist/cjs/carousel/components/CarouselItem.js +6 -2
  5. package/dist/cjs/estimate-delivery/components/EstimateDate.liquid.js +1 -1
  6. package/dist/cjs/grid/row/commons/getAttr.js +3 -2
  7. package/dist/cjs/post-purchase/button/setting/configs/settings.js +10 -8
  8. package/dist/cjs/post-purchase/callout-banner/components/CalloutText.js +1 -2
  9. package/dist/cjs/post-purchase/callout-banner/components/common/getStyles.js +8 -0
  10. package/dist/cjs/post-purchase/callout-banner/setting/config/callout-text/setting.js +3 -3
  11. package/dist/cjs/post-purchase/countdown-timer/settings/config/setting.js +2 -1
  12. package/dist/cjs/product/components/FileUpload/components/common/index.js +1 -1
  13. package/dist/cjs/product/components/Product.js +3 -3
  14. package/dist/cjs/product/components/ProductImagesV2/jsx/ProductImages.js +1 -5
  15. package/dist/cjs/product/components/ProductImagesV2/jsx/components/ProductFeatureVideo.js +36 -0
  16. package/dist/cjs/product/components/ProductImagesV2/jsx/components/ProductFeaturedImageOnly.js +83 -51
  17. package/dist/cjs/product/components/ProductImagesV2/jsx/components/ProductGalleryCarousel.js +3 -1
  18. package/dist/cjs/product/components/ProductImagesV2/jsx/components/ProductGalleryGrid.js +3 -2
  19. package/dist/cjs/product/components/ProductImagesV2/jsx/components/ProductImagesLightBox.js +29 -11
  20. package/dist/cjs/product/setting/product-image-v2/ProductFeatureImage.js +0 -363
  21. package/dist/cjs/product/setting/product-image-v2/ProductGalleryImage.js +0 -493
  22. package/dist/cjs/product/setting/product-image-v2/ProductImages.js +1 -3
  23. package/dist/cjs/product/setting/product-image-v2/configs/setting-v2/ProductGalleryImage.js +2 -5
  24. package/dist/cjs/product/setting/product-image-v2/configs/setting-v2/index.js +4 -7
  25. package/dist/cjs/setting.js +2 -2
  26. package/dist/cjs/video/components/Video.js +1 -1
  27. package/dist/esm/accordion/components/common/styles.js +1 -2
  28. package/dist/esm/banner/components/HeroBannerItem.liquid.js +1 -1
  29. package/dist/esm/carousel/components/Carousel.js +2 -3
  30. package/dist/esm/carousel/components/CarouselItem.js +6 -2
  31. package/dist/esm/estimate-delivery/components/EstimateDate.liquid.js +1 -1
  32. package/dist/esm/grid/row/commons/getAttr.js +3 -2
  33. package/dist/esm/post-purchase/button/setting/configs/settings.js +10 -8
  34. package/dist/esm/post-purchase/callout-banner/components/CalloutText.js +2 -3
  35. package/dist/esm/post-purchase/callout-banner/components/common/getStyles.js +8 -1
  36. package/dist/esm/post-purchase/callout-banner/setting/config/callout-text/setting.js +3 -3
  37. package/dist/esm/post-purchase/countdown-timer/settings/config/setting.js +2 -1
  38. package/dist/esm/product/components/FileUpload/components/common/index.js +1 -1
  39. package/dist/esm/product/components/Product.js +3 -3
  40. package/dist/esm/product/components/ProductImagesV2/jsx/ProductImages.js +1 -5
  41. package/dist/esm/product/components/ProductImagesV2/jsx/components/ProductFeatureVideo.js +32 -0
  42. package/dist/esm/product/components/ProductImagesV2/jsx/components/ProductFeaturedImageOnly.js +84 -52
  43. package/dist/esm/product/components/ProductImagesV2/jsx/components/ProductGalleryCarousel.js +3 -1
  44. package/dist/esm/product/components/ProductImagesV2/jsx/components/ProductGalleryGrid.js +3 -2
  45. package/dist/esm/product/components/ProductImagesV2/jsx/components/ProductImagesLightBox.js +31 -13
  46. package/dist/esm/product/setting/product-image-v2/ProductFeatureImage.js +1 -361
  47. package/dist/esm/product/setting/product-image-v2/ProductGalleryImage.js +1 -492
  48. package/dist/esm/product/setting/product-image-v2/ProductImages.js +1 -3
  49. package/dist/esm/product/setting/product-image-v2/configs/setting-v2/ProductGalleryImage.js +2 -5
  50. package/dist/esm/product/setting/product-image-v2/configs/setting-v2/index.js +4 -7
  51. package/dist/esm/setting.js +2 -2
  52. package/dist/esm/video/components/Video.js +2 -2
  53. package/dist/types/index.d.ts +2 -0
  54. package/package.json +2 -2
  55. package/dist/cjs/product/setting/product-image-v2/configs/settings.js +0 -327
  56. package/dist/esm/product/setting/product-image-v2/configs/settings.js +0 -325
@@ -1,10 +1,11 @@
1
1
  import { createAttr } from '@gem-sdk/system';
2
2
 
3
3
  const getAttr = (props)=>{
4
- const { builderProps, setting } = props;
4
+ const { builderProps, setting, customAttrs } = props;
5
5
  const rowAttr = createAttr({
6
6
  'data-id': builderProps?.uidInteraction ?? builderProps?.uid ?? '',
7
- id: builderProps?.uid ?? ''
7
+ id: builderProps?.uid ?? '',
8
+ ...customAttrs
8
9
  });
9
10
  const sectionAttr = createAttr({
10
11
  'data-same-height-display-contents': !!setting?.allowSameHeight
@@ -20,25 +20,27 @@ const DeclineButtonSettings = [
20
20
  },
21
21
  {
22
22
  id: 'buttonType',
23
+ type: 'layout-selector',
23
24
  label: 'Style',
24
- type: 'layout-segment',
25
- iconViewBox: '0 0 120 72',
25
+ iconViewBox: '0 0 80 48',
26
26
  enableItemBackground: true,
27
27
  itemPerRow: 2,
28
28
  itemSpacing: 'large',
29
+ default: 'secondary',
29
30
  options: [
30
31
  {
31
- label: 'Button',
32
+ label: 'Outline',
32
33
  value: 'secondary',
33
- type: 'post-purchase-button'
34
+ type: 'post-purchase-button',
35
+ iconName: 'gp-secondary-button'
34
36
  },
35
37
  {
36
- label: 'link',
38
+ label: 'Text link',
37
39
  value: 'link',
38
- type: 'post-purchase-button'
40
+ type: 'post-purchase-button',
41
+ iconName: 'gp-link-button'
39
42
  }
40
- ],
41
- default: 'secondary'
43
+ ]
42
44
  }
43
45
  ]
44
46
  },
@@ -1,10 +1,9 @@
1
1
  'use client';
2
2
  import { jsxs, jsx } from 'react/jsx-runtime';
3
- import { makeStyleResponsive } from '@gem-sdk/core';
4
3
  import Text from '../../text/components/Text.js';
5
4
  import { createClass, createStyle, createAttr } from '@gem-sdk/system';
6
5
  import { getCalloutTextWrapperClasses } from './common/getClasses.js';
7
- import { getCalloutTextStyle, getTextStyles } from './common/getStyles.js';
6
+ import { makeStyleResponsiveWidth, getCalloutTextStyle, getTextStyles } from './common/getStyles.js';
8
7
 
9
8
  const CalloutText = ({ setting = {}, styles = {}, style, builderAttrs, builderProps, children })=>{
10
9
  const { width, align } = styles;
@@ -16,7 +15,7 @@ const CalloutText = ({ setting = {}, styles = {}, style, builderAttrs, builderPr
16
15
  })
17
16
  });
18
17
  const containerStyle = createStyle({
19
- ...makeStyleResponsive('w', width)
18
+ ...makeStyleResponsiveWidth(width)
20
19
  });
21
20
  const textStyles = {
22
21
  ...getTextStyles(styles)
@@ -29,6 +29,13 @@ var CalloutBorderColorEnum;
29
29
  CalloutBorderColorEnum["critical"] = '#facccc';
30
30
  CalloutBorderColorEnum["none"] = '#D9D9D9';
31
31
  })(CalloutBorderColorEnum || (CalloutBorderColorEnum = {}));
32
+ const makeStyleResponsiveWidth = (value, unit)=>{
33
+ return {
34
+ [`--w`]: unit ? `${value?.desktop}${unit}` : value?.desktop === 'default' ? '1200px' : value?.desktop,
35
+ [`--w-tablet`]: unit ? `${value?.tablet}${unit}` : value?.tablet === 'default' ? '1200px' : value?.tablet,
36
+ [`--w-mobile`]: unit ? `${value?.mobile}${unit}` : value?.mobile === 'default' ? '1200px' : value?.mobile
37
+ };
38
+ };
32
39
  const getCalloutBoxContainerStyles = (styles)=>{
33
40
  return filterTruthyStyles({
34
41
  backgroundColor: styles?.backgroundColor ? CalloutBgColorEnum[styles?.backgroundColor] : '#FAFAFA',
@@ -36,4 +43,4 @@ const getCalloutBoxContainerStyles = (styles)=>{
36
43
  });
37
44
  };
38
45
 
39
- export { getCalloutBoxContainerStyles, getCalloutTextStyle, getTextStyles };
46
+ export { getCalloutBoxContainerStyles, getCalloutTextStyle, getTextStyles, makeStyleResponsiveWidth };
@@ -92,13 +92,13 @@ const CalloutTextSettings = [
92
92
  hideUnit: false,
93
93
  devices: {
94
94
  desktop: {
95
- default: '100%'
95
+ default: 'default'
96
96
  },
97
97
  tablet: {
98
- default: '100%'
98
+ default: 'default'
99
99
  },
100
100
  mobile: {
101
- default: '100%'
101
+ default: 'default'
102
102
  }
103
103
  },
104
104
  displayOptions: [
@@ -23,7 +23,8 @@ const CountdownTimerSettings = [
23
23
  ],
24
24
  min: 1,
25
25
  isNumber: true,
26
- showDefaultUnit: false,
26
+ showDefaultUnit: true,
27
+ disableDecimal: true,
27
28
  default: '30',
28
29
  fallbackValue: 30
29
30
  }
@@ -24,6 +24,7 @@ import '../../../../../post-purchase/product/components/product-variant/componen
24
24
  import '../../../Product.js';
25
25
  import '../../../../../notification/components/Notifications.js';
26
26
  import '../../../../../notification/components/Notice.js';
27
+ import '../../../../../video/components/Video.js';
27
28
  import '../../../ProductQuickView/index.js';
28
29
  import '../../../constants/product-bundle.js';
29
30
  import '../../../ProductList.js';
@@ -33,7 +34,6 @@ import '../../../ProductBadge/constants.js';
33
34
  import '../../../ProductBadge/utils/shape.js';
34
35
  import '../../../ProductBadge/types.js';
35
36
  import '../../../../../textarea/Textarea.js';
36
- import '../../../../../video/components/Video.js';
37
37
  import '../../../../../third-party/components/JudgemeReviews.js';
38
38
  import '../../../../../third-party/components/LooxReviews.js';
39
39
  import '../../../../../third-party/components/Klaviyo.js';
@@ -98,9 +98,9 @@ const LocalProduct = ({ children, productSetting, quantity, readOnly, rowSetting
98
98
  style: style,
99
99
  setting: rowSetting,
100
100
  styles: rowStyles,
101
- ...mode === 'edit' ? {
102
- 'data-product-id': product?.baseID?.replace('gid://shopify/Product/', '')
103
- } : {},
101
+ customAttrs: mode === 'edit' ? {
102
+ 'data-product-id': product?.baseID?.replace('gid://shopify/Product/', '') ?? ''
103
+ } : undefined,
104
104
  children: isEmptyChildren(children) ? /*#__PURE__*/ jsx(ChildrenDroppable, {}) : children
105
105
  })
106
106
  }, `uid-${product.id}-${initialVariantId ?? ''}`)
@@ -6,7 +6,6 @@ import { useMemo, useState, useEffect, Children, isValidElement } from 'react';
6
6
  import FeatureImageWithGallery from './layouts/FeatureImageWithGallery.js';
7
7
  import OnlyFeatureImage from './layouts/OnlyFeatureImage.js';
8
8
  import ProductImagesLightBox from './components/ProductImagesLightBox.js';
9
- import { isFeatureMedia } from '../common/productFeaturedImage.js';
10
9
  import NoDataState from '../../../../common/components/NoDataState.js';
11
10
  import { getProductImagesClassName } from '../composables/getProductImagesClassName.js';
12
11
  import { getBorderActiveCss } from '../common/getBorderActiveCss.js';
@@ -87,10 +86,7 @@ const ProductImagesV2 = (props)=>{
87
86
  currentVariant?.media
88
87
  ]);
89
88
  const gallery = useMemo(()=>{
90
- const images = getProductGallery(product)?.map((item)=>{
91
- if (item) item.src = isFeatureMedia(item.contentType) ? item?.previewImage : item.src;
92
- return item;
93
- });
89
+ const images = getProductGallery(product);
94
90
  if (!images?.length) return [
95
91
  {
96
92
  id: product?.featuredImage?.id || 'noImageError',
@@ -0,0 +1,32 @@
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,10 +1,11 @@
1
1
  'use client';
2
2
  import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
3
- import { useProduct, useCurrentDevice, useShopStore, getResponsiveValueByScreen, cls, makeStyle } from '@gem-sdk/core';
3
+ import { useProduct, useCurrentDevice, useShopStore, useEditorMode, getResponsiveValueByScreen, cls, makeStyle } from '@gem-sdk/core';
4
4
  import { memo, useMemo } from 'react';
5
5
  import NextImage from '../../../../../image/components/NextImage.js';
6
6
  import MediaIcon from './MediaIcon.js';
7
7
  import { isFeatureMedia, getZoomImageClass, getZoomLenClass } from '../../common/productFeaturedImage.js';
8
+ import ProductFeatureVideo from './ProductFeatureVideo.js';
8
9
 
9
10
  const defaultImage = {
10
11
  src: 'https://cdn.shopify.com/s/assets/no-image-2048-5e88c1b20e087fb7bbe9a3771824e743c244f437e4f8ba93bbf7b11b53f7824c_large.gif',
@@ -18,14 +19,28 @@ const ProductFeaturedImageOnly = ({ image, imageShowWhenHover, setting, aspectRa
18
19
  const product = useProduct();
19
20
  const currentDevice = useCurrentDevice();
20
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
+ ]);
21
35
  const renderImage = useMemo(()=>{
22
36
  if (!image) return defaultImage;
23
37
  return {
24
38
  ...image,
25
- src: isFeatureMedia(image?.contentType) ? image?.previewImage : image.src
39
+ src: isRenderVideo ? image.src : isFeatureMedia(image?.contentType) ? image?.previewImage : image.src
26
40
  };
27
41
  }, [
28
- image
42
+ image,
43
+ isRenderVideo
29
44
  ]);
30
45
  const shopifyProductLink = useMemo(()=>{
31
46
  if (!storefrontUrl) return `#`;
@@ -53,56 +68,73 @@ const ProductFeaturedImageOnly = ({ image, imageShowWhenHover, setting, aspectRa
53
68
  currentDevice,
54
69
  setting.ftActionEnable
55
70
  ]);
71
+ const isRenderHoverImage = useMemo(()=>enableHoverAction && setting?.hoverEffect !== 'none' && !isFeatureMedia(renderImage?.contentType), [
72
+ enableHoverAction,
73
+ renderImage?.contentType,
74
+ setting?.hoverEffect
75
+ ]);
76
+ const isZoomImage = useMemo(()=>enableHoverAction && setting?.hoverEffect == 'zoom' && setting?.zoomType == 'glasses' && !isFeatureMedia(renderImage?.contentType), [
77
+ enableHoverAction,
78
+ renderImage?.contentType,
79
+ setting?.hoverEffect,
80
+ setting?.zoomType
81
+ ]);
56
82
  return /*#__PURE__*/ jsx(Fragment, {
57
- children: handleProductLink(/*#__PURE__*/ jsxs(Fragment, {
58
- children: [
59
- /*#__PURE__*/ jsx(NextImage, {
60
- draggable: "false",
61
- src: renderImage.src,
62
- width: renderImage?.width,
63
- height: renderImage?.height,
64
- alt: renderImage?.alt,
65
- setting: {
66
- aspectRatio: aspectRatio,
67
- layout: setting?.ftLayout
68
- },
69
- priority: setting?.preload,
70
- className: "featured-image-only",
71
- style: {
72
- width: '100%',
73
- height: '100%',
74
- cursor: 'pointer'
75
- }
76
- }),
77
- /*#__PURE__*/ jsx(MediaIcon, {
78
- contentType: renderImage?.contentType ?? ''
79
- }),
80
- enableHoverAction && setting?.hoverEffect !== 'none' && !isFeatureMedia(renderImage?.contentType) && /*#__PURE__*/ jsx(NextImage, {
81
- draggable: "false",
82
- src: setting?.hoverEffect === 'other' ? imageShowWhenHover?.src : renderImage.src,
83
- width: setting?.hoverEffect === 'other' ? imageShowWhenHover?.width : renderImage.width,
84
- height: setting?.hoverEffect === 'other' ? imageShowWhenHover?.height : renderImage.height,
85
- alt: setting?.hoverEffect === 'other' ? imageShowWhenHover?.alt : renderImage.alt,
86
- setting: {
87
- layout: setting.ftLayout,
88
- aspectRatio: aspectRatio
89
- },
90
- style: {
91
- width: '100%',
92
- height: '100%'
93
- },
94
- className: cls('hover-image featured-image-only !gp-max-w-none', getZoomImageClass()),
95
- priority: setting?.preload
96
- }),
97
- enableHoverAction && setting?.hoverEffect == 'zoom' && setting?.zoomType == 'glasses' && !isFeatureMedia(renderImage?.contentType) && /*#__PURE__*/ jsx("div", {
98
- className: cls(getZoomLenClass(), 'room-len'),
99
- style: {
100
- ...makeStyle({
101
- bgi: `url("${renderImage?.src}")`
102
- })
103
- }
104
- })
105
- ]
83
+ children: handleProductLink(/*#__PURE__*/ jsx(Fragment, {
84
+ children: isRenderVideo ? /*#__PURE__*/ jsx(ProductFeatureVideo, {
85
+ type: renderImage?.contentType,
86
+ url: renderImage.src ?? '',
87
+ aspectRatio: aspectRatio
88
+ }) : /*#__PURE__*/ jsxs(Fragment, {
89
+ children: [
90
+ /*#__PURE__*/ jsx(NextImage, {
91
+ draggable: "false",
92
+ src: renderImage.src,
93
+ width: renderImage?.width,
94
+ height: renderImage?.height,
95
+ alt: renderImage?.alt,
96
+ setting: {
97
+ aspectRatio: aspectRatio,
98
+ layout: setting?.ftLayout
99
+ },
100
+ priority: setting?.preload,
101
+ className: "featured-image-only",
102
+ style: {
103
+ width: '100%',
104
+ height: '100%',
105
+ cursor: 'pointer'
106
+ }
107
+ }),
108
+ /*#__PURE__*/ jsx(MediaIcon, {
109
+ contentType: renderImage?.contentType ?? ''
110
+ }),
111
+ isRenderHoverImage && /*#__PURE__*/ jsx(NextImage, {
112
+ draggable: "false",
113
+ src: setting?.hoverEffect === 'other' ? imageShowWhenHover?.src : renderImage.src,
114
+ width: setting?.hoverEffect === 'other' ? imageShowWhenHover?.width : renderImage.width,
115
+ height: setting?.hoverEffect === 'other' ? imageShowWhenHover?.height : renderImage.height,
116
+ alt: setting?.hoverEffect === 'other' ? imageShowWhenHover?.alt : renderImage.alt,
117
+ setting: {
118
+ layout: setting.ftLayout,
119
+ aspectRatio: aspectRatio
120
+ },
121
+ style: {
122
+ width: '100%',
123
+ height: '100%'
124
+ },
125
+ className: cls('hover-image featured-image-only !gp-max-w-none', getZoomImageClass()),
126
+ priority: setting?.preload
127
+ }),
128
+ isZoomImage && /*#__PURE__*/ jsx("div", {
129
+ className: cls(getZoomLenClass(), 'room-len'),
130
+ style: {
131
+ ...makeStyle({
132
+ bgi: `url("${renderImage?.src}")`
133
+ })
134
+ }
135
+ })
136
+ ]
137
+ })
106
138
  }))
107
139
  });
108
140
  };
@@ -14,6 +14,7 @@ import { useFilterImagesByVariant } from '../hooks/useFilterImagesByVariant.js';
14
14
  import { getProductImagesClassName } from '../../composables/getProductImagesClassName.js';
15
15
  import { getProductImagesStyles } from '../../composables/getProductImagesStyles.js';
16
16
  import { getProductImagesAttr } from '../../composables/getProductImagesAttr.js';
17
+ import { isFeatureMedia } from '../../common/productFeaturedImage.js';
17
18
 
18
19
  const ProductGalleryCarousel = ({ builderPropUID, productImages, onHandleClick, activeIndexFormFeatureImage, onClickFeatureArrow, builderPropsClass, arrow, priorityFeatureImage, ...setting })=>{
19
20
  const currentDevice = useCurrentDevice();
@@ -147,6 +148,7 @@ const ProductGalleryCarousel = ({ builderPropUID, productImages, onHandleClick,
147
148
  disableMarginAuto: true,
148
149
  children: filteredProductImages?.map((image, index)=>{
149
150
  const canActive = index === moveToIdx;
151
+ const imageSrc = isFeatureMedia(image.contentType) ? image.previewImage : image.src;
150
152
  return /*#__PURE__*/ jsxs(CarouselItem, {
151
153
  contentType: "productImage",
152
154
  className: galleryItemClasses(`gem-slider-item-${builderPropUID} ${canActive && isEnableBorderActive ? 'gem-slider-item-active' : ''}`),
@@ -159,7 +161,7 @@ const ProductGalleryCarousel = ({ builderPropUID, productImages, onHandleClick,
159
161
  children: [
160
162
  /*#__PURE__*/ jsx(NextImage, {
161
163
  draggable: "false",
162
- src: image.src,
164
+ src: imageSrc,
163
165
  width: image?.width,
164
166
  height: image?.height,
165
167
  alt: image?.alt,
@@ -119,6 +119,7 @@ const ProductGalleryGrid = ({ builderPropUID, productImages, onHandleClick, acti
119
119
  children: [
120
120
  filteredProductImages?.map((image, index)=>{
121
121
  const canActive = index === imageActiveIndex;
122
+ const imageSrc = isFeatureMedia(image.contentType) ? image.previewImage : image.src;
122
123
  return(// eslint-disable-next-line jsx-a11y/mouse-events-have-key-events
123
124
  /*#__PURE__*/ jsxs("div", {
124
125
  "aria-hidden": true,
@@ -135,7 +136,7 @@ const ProductGalleryGrid = ({ builderPropUID, productImages, onHandleClick, acti
135
136
  "data-border": canActive && !!setting?.borderActive && setting?.activeEffectEnable ? 'active' : 'deactive',
136
137
  children: [
137
138
  /*#__PURE__*/ jsx(NextImage, {
138
- src: image.src,
139
+ src: imageSrc,
139
140
  width: image?.width,
140
141
  height: image?.height,
141
142
  alt: image?.alt,
@@ -152,7 +153,7 @@ const ProductGalleryGrid = ({ builderPropUID, productImages, onHandleClick, acti
152
153
  contentType: image?.contentType || ''
153
154
  }),
154
155
  setting?.galleryHoverEffect !== 'none' && !isFeatureMedia(image?.contentType) && /*#__PURE__*/ jsx(NextImage, {
155
- src: image?.src,
156
+ src: imageSrc,
156
157
  width: image?.width,
157
158
  height: image?.height,
158
159
  alt: image?.alt,
@@ -1,6 +1,6 @@
1
1
  'use client';
2
- import { jsx } from 'react/jsx-runtime';
3
- import { useFeaturedImageGlobal, cls } from '@gem-sdk/core';
2
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
3
+ import { useFeaturedImageGlobal, useEditorMode, cls } from '@gem-sdk/core';
4
4
  import Carousel from '../../../../../carousel/components/Carousel.js';
5
5
  import CarouselItem from '../../../../../carousel/components/CarouselItem.js';
6
6
  import NextImage from '../../../../../image/components/NextImage.js';
@@ -8,6 +8,8 @@ import '../../../../../modal/components/confirm.js';
8
8
  import Modal from '../../../../../modal/components/Modal.js';
9
9
  import { useMemo } from 'react';
10
10
  import { isFeatureMedia } from '../../common/productFeaturedImage.js';
11
+ import ProductFeatureVideo from './ProductFeatureVideo.js';
12
+ import MediaIcon from './MediaIcon.js';
11
13
 
12
14
  const ProductImagesLightBox = ({ builderPropUID, productImages, open, imageRatio, onHandleClose })=>{
13
15
  const featuredImageGlobal = useFeaturedImageGlobal();
@@ -28,6 +30,11 @@ const ProductImagesLightBox = ({ builderPropUID, productImages, open, imageRatio
28
30
  mobile: false,
29
31
  tablet: false
30
32
  };
33
+ const mode = useEditorMode();
34
+ const isRenderVideo = (image)=>mode !== 'edit' && [
35
+ 'VIDEO',
36
+ 'EXTERNAL_VIDEO'
37
+ ].includes(image?.contentType || '');
31
38
  return /*#__PURE__*/ jsx(Modal, {
32
39
  setting: {
33
40
  open: open
@@ -103,17 +110,28 @@ const ProductImagesLightBox = ({ builderPropUID, productImages, open, imageRatio
103
110
  fullHeight: true,
104
111
  children: productImages?.map((image)=>/*#__PURE__*/ jsx(CarouselItem, {
105
112
  className: `gem-slider-item gem-slider-item-${builderPropUID} gp-flex gp-items-center gp-justify-center gp-px-4`,
106
- children: /*#__PURE__*/ jsx(NextImage, {
107
- src: isFeatureMedia(image?.contentType) ? image?.previewImage : image?.src,
108
- width: image?.width,
109
- height: image?.height,
110
- alt: image?.alt,
111
- "content-type": image?.contentType,
112
- setting: {
113
- aspectRatio: imageRatio
114
- },
115
- className: cls('gp-h-full gp-w-full gp-object-contain')
116
- }, image?.id)
113
+ children: !isRenderVideo(image) ? /*#__PURE__*/ jsxs(Fragment, {
114
+ children: [
115
+ /*#__PURE__*/ jsx(NextImage, {
116
+ src: isFeatureMedia(image?.contentType) ? image?.previewImage : image?.src,
117
+ width: image?.width,
118
+ height: image?.height,
119
+ alt: image?.alt,
120
+ "content-type": image?.contentType,
121
+ setting: {
122
+ aspectRatio: imageRatio
123
+ },
124
+ className: cls('gp-h-full gp-w-full gp-object-contain')
125
+ }, image?.id),
126
+ /*#__PURE__*/ jsx(MediaIcon, {
127
+ contentType: image?.contentType ?? ''
128
+ })
129
+ ]
130
+ }) : /*#__PURE__*/ jsx(ProductFeatureVideo, {
131
+ type: image?.contentType,
132
+ url: image.src ?? '',
133
+ aspectRatio: imageRatio
134
+ })
117
135
  }, image?.id))
118
136
  })
119
137
  });