@gem-sdk/components 2.0.0-dev.289 → 2.0.0-dev.294
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/image/components/AdaptiveImage.js +1 -1
- package/dist/cjs/image/components/AdaptiveImage.liquid.js +4 -4
- package/dist/cjs/image/components/Image.js +1 -5
- package/dist/cjs/image/components/common/styles.js +2 -2
- package/dist/cjs/image/components/helpers/getNextImageLiquidAttrs.js +6 -24
- package/dist/cjs/image/components/helpers/getNextImageReactAttrs.js +3 -3
- 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/configs/uiV2.js +2 -2
- 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/third-party/components/RechargeSubscriptions.liquid.js +1 -1
- package/dist/cjs/third-party/setting/RechargeSubscriptions.js +5 -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/image/components/AdaptiveImage.js +2 -2
- package/dist/esm/image/components/AdaptiveImage.liquid.js +4 -4
- package/dist/esm/image/components/Image.js +2 -6
- package/dist/esm/image/components/common/styles.js +2 -2
- package/dist/esm/image/components/helpers/getNextImageLiquidAttrs.js +6 -24
- package/dist/esm/image/components/helpers/getNextImageReactAttrs.js +3 -3
- 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/configs/uiV2.js +2 -2
- 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/third-party/components/RechargeSubscriptions.liquid.js +1 -1
- package/dist/esm/third-party/setting/RechargeSubscriptions.js +5 -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
|
|
@@ -19,7 +19,7 @@ const AdaptiveImage = (props)=>{
|
|
|
19
19
|
srcDesktop,
|
|
20
20
|
enableLazyLoadImage: enableLazyloadImage
|
|
21
21
|
}));
|
|
22
|
-
const pictureStyle = system.
|
|
22
|
+
const pictureStyle = system.createStyleReact({
|
|
23
23
|
...styles.getAdaptivePictureStyles()
|
|
24
24
|
});
|
|
25
25
|
const adaptiveImageStyles = system.createStyle({
|
|
@@ -39,13 +39,13 @@ const AdaptiveImage = (props)=>{
|
|
|
39
39
|
})
|
|
40
40
|
});
|
|
41
41
|
const renderSource = ()=>{
|
|
42
|
-
return `
|
|
43
|
-
${srcMobile ? `<source media="(max-width: 767px)" srcset="${enableLazyLoadImage ? constants.IMAGE_PLACEHOLDER : srcMobile}" />` : ``}
|
|
44
|
-
${srcTablet ? `<source media="(max-width: 1024px)" srcset="${enableLazyLoadImage ? constants.IMAGE_PLACEHOLDER : srcTablet}" />` : ``}
|
|
42
|
+
return core.template`
|
|
43
|
+
${srcMobile ? `<source media="(max-width: 767px)" data-srcSet="${srcMobile}" srcset="${enableLazyLoadImage ? constants.IMAGE_PLACEHOLDER : srcMobile}" />` : ``}
|
|
44
|
+
${srcTablet ? `<source media="(max-width: 1024px)" data-srcSet="${srcTablet}" srcset="${enableLazyLoadImage ? constants.IMAGE_PLACEHOLDER : srcTablet}" />` : ``}
|
|
45
45
|
`;
|
|
46
46
|
};
|
|
47
47
|
const renderImage = ()=>{
|
|
48
|
-
return `
|
|
48
|
+
return core.template`
|
|
49
49
|
<img
|
|
50
50
|
${{
|
|
51
51
|
...restProps
|
|
@@ -22,11 +22,7 @@ const Image = ({ style, styles: styles$1, setting, children, advanced, className
|
|
|
22
22
|
setting: imageLink,
|
|
23
23
|
enableImageLink
|
|
24
24
|
});
|
|
25
|
-
|
|
26
|
-
setting,
|
|
27
|
-
styles: styles$1
|
|
28
|
-
});
|
|
29
|
-
const wrapperStyles = system.createStyle(styles.getWrapperStyles(styles$1));
|
|
25
|
+
const wrapperStyles = system.createStyleReact(styles.getWrapperStyles(styles$1));
|
|
30
26
|
const noDataImageStyles = system.createStyle(styles.getNoDataImageStyles(styles$1));
|
|
31
27
|
const imageStyles = system.createStyle(styles.getImageStyles(styles$1, builderProps));
|
|
32
28
|
const containerStyles = system.createStyle(styles.getContainerStyles(style, styles$1));
|
|
@@ -11,7 +11,7 @@ const getContainerStyles = (style, styles)=>{
|
|
|
11
11
|
};
|
|
12
12
|
const getWrapperStyles = (styles)=>{
|
|
13
13
|
return {
|
|
14
|
-
|
|
14
|
+
'border-radius': 'inherit',
|
|
15
15
|
overflow: 'hidden',
|
|
16
16
|
...core.makeStyleResponsive('jc', styles?.align)
|
|
17
17
|
};
|
|
@@ -62,7 +62,7 @@ const getAdaptiveImageStyles = ({ layout, aspectRatio, borderRadius })=>{
|
|
|
62
62
|
};
|
|
63
63
|
const getAdaptivePictureStyles = ()=>{
|
|
64
64
|
return {
|
|
65
|
-
|
|
65
|
+
'border-radius': 'inherit'
|
|
66
66
|
};
|
|
67
67
|
};
|
|
68
68
|
const getNoDataImageStyles = (styles)=>{
|
|
@@ -8,6 +8,7 @@ const getNextImageLiquidAttrs = (props)=>{
|
|
|
8
8
|
const { srcset, setting, storage, baseSrc, priority, customAttrs, width = 2237, height = 1678, isNotLazyload, backupFileKey, backupFilePath, srcIsLiquidCode, enableLazyLoadImage, alt = constants.NEXT_IMAGE_CONFIG.DEFAULT_ALT, src = constants.NEXT_IMAGE_CONFIG.DEFAULT_SRC, sizes = constants.NEXT_IMAGE_CONFIG.DEFAULT_SIZES } = props;
|
|
9
9
|
const hasLazyLoad = !isNotLazyload && enableLazyLoadImage && !priority;
|
|
10
10
|
const getLoadingAttrs = ()=>{
|
|
11
|
+
const { qualityPercent, qualityType } = setting ?? {};
|
|
11
12
|
const newBackupFileKey = backupFileKey ? getSrcSet.getNewBackupFileKey(backupFileKey ?? '', src) : '';
|
|
12
13
|
const srcImage = srcIsLiquidCode ? baseSrc : getSrcSet.getImageSrc({
|
|
13
14
|
src,
|
|
@@ -37,43 +38,24 @@ const getNextImageLiquidAttrs = (props)=>{
|
|
|
37
38
|
srcset: srcset || ''
|
|
38
39
|
};
|
|
39
40
|
return {
|
|
41
|
+
'data-sizes': 'auto',
|
|
42
|
+
'quality-type': JSON.stringify(qualityType) || '{}',
|
|
43
|
+
'quality-percent': JSON.stringify(qualityPercent) || '{}',
|
|
40
44
|
...hasLazyLoad ? lazyLoadAttrs : priorityLoadAttrs
|
|
41
45
|
};
|
|
42
46
|
};
|
|
43
47
|
const getBaseAttrs = ()=>{
|
|
44
|
-
const { qualityPercent, qualityType } = setting ?? {};
|
|
45
48
|
return {
|
|
46
49
|
alt,
|
|
47
50
|
width,
|
|
48
51
|
height,
|
|
49
|
-
draggable: 'false'
|
|
50
|
-
'data-sizes': 'auto',
|
|
51
|
-
'quality-type': JSON.stringify(qualityType) || '{}',
|
|
52
|
-
'quality-percent': JSON.stringify(qualityPercent) || '{}'
|
|
52
|
+
draggable: 'false'
|
|
53
53
|
};
|
|
54
54
|
};
|
|
55
|
-
const getFilteredAttrs = ()=>{
|
|
56
|
-
const ignoreAttrs = [
|
|
57
|
-
'src',
|
|
58
|
-
'srcset',
|
|
59
|
-
'width',
|
|
60
|
-
'height',
|
|
61
|
-
'alt',
|
|
62
|
-
'base-src'
|
|
63
|
-
];
|
|
64
|
-
const filteredAttrs = {};
|
|
65
|
-
Object.entries(props).forEach(([key, value])=>{
|
|
66
|
-
if (!ignoreAttrs.includes(key) && (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean')) {
|
|
67
|
-
filteredAttrs[key] = value;
|
|
68
|
-
}
|
|
69
|
-
});
|
|
70
|
-
return filteredAttrs;
|
|
71
|
-
};
|
|
72
55
|
return system.createAttr({
|
|
73
56
|
...customAttrs,
|
|
74
57
|
...getBaseAttrs(),
|
|
75
|
-
...getLoadingAttrs()
|
|
76
|
-
...getFilteredAttrs()
|
|
58
|
+
...getLoadingAttrs()
|
|
77
59
|
});
|
|
78
60
|
};
|
|
79
61
|
|
|
@@ -4,7 +4,7 @@ var system = require('@gem-sdk/system');
|
|
|
4
4
|
var constants = require('../common/constants.js');
|
|
5
5
|
|
|
6
6
|
const getNextImageReactAttrs = (props)=>{
|
|
7
|
-
const { width = constants.NEXT_IMAGE_CONFIG.DEFAULT_WIDTH_PROPS, height = constants.NEXT_IMAGE_CONFIG.DEFAULT_HEIGHT_PROPS, priority, isNotLazyload, enableLazyLoadImage, base64 = constants.IMAGE_PLACEHOLDER, alt = constants.NEXT_IMAGE_CONFIG.DEFAULT_ALT, src = constants.NEXT_IMAGE_CONFIG.DEFAULT_SRC } = props;
|
|
7
|
+
const { width = constants.NEXT_IMAGE_CONFIG.DEFAULT_WIDTH_PROPS, height = constants.NEXT_IMAGE_CONFIG.DEFAULT_HEIGHT_PROPS, quality, priority, isNotLazyload, enableLazyLoadImage, base64 = constants.IMAGE_PLACEHOLDER, alt = constants.NEXT_IMAGE_CONFIG.DEFAULT_ALT, src = constants.NEXT_IMAGE_CONFIG.DEFAULT_SRC } = props;
|
|
8
8
|
const hasLazyLoad = !isNotLazyload && enableLazyLoadImage && !priority;
|
|
9
9
|
const getLoadingAttrs = ()=>{
|
|
10
10
|
const lazyLoadAttrs = {
|
|
@@ -26,12 +26,12 @@ const getNextImageReactAttrs = (props)=>{
|
|
|
26
26
|
src,
|
|
27
27
|
alt,
|
|
28
28
|
width,
|
|
29
|
-
height
|
|
29
|
+
height,
|
|
30
|
+
quality
|
|
30
31
|
});
|
|
31
32
|
const baseAttrs = getBaseAttrs();
|
|
32
33
|
const loadingAttrs = system.createAttr(getLoadingAttrs());
|
|
33
34
|
return {
|
|
34
|
-
...props,
|
|
35
35
|
...baseAttrs,
|
|
36
36
|
...loadingAttrs
|
|
37
37
|
};
|
|
@@ -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,
|