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