@gem-sdk/components 2.0.0-dev.654 → 2.0.0-dev.657
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/countdown-timer/components/hooks/useCountDownTimer.js +3 -2
- package/dist/cjs/countdown-timer/setting/configs/settings.js +6 -0
- package/dist/cjs/product/components/ProductImagesV2/common/getClasses.js +1 -1
- package/dist/cjs/product/components/ProductImagesV2/common/hoverAction.js +1 -0
- package/dist/cjs/product/components/ProductImagesV2/components/child/ProductFeaturedImageCarousel.js +1 -1
- package/dist/cjs/product/components/ProductImagesV2/components/feature-gallery/FeatureImageWithGallery.liquid.js +1 -1
- package/dist/cjs/product/components/ProductImagesV2/hooks/useGalleryCarousel.js +6 -2
- package/dist/esm/countdown-timer/components/hooks/useCountDownTimer.js +3 -2
- package/dist/esm/countdown-timer/setting/configs/settings.js +6 -0
- package/dist/esm/product/components/ProductImagesV2/common/getClasses.js +1 -1
- package/dist/esm/product/components/ProductImagesV2/common/hoverAction.js +1 -0
- package/dist/esm/product/components/ProductImagesV2/components/child/ProductFeaturedImageCarousel.js +1 -1
- package/dist/esm/product/components/ProductImagesV2/components/feature-gallery/FeatureImageWithGallery.liquid.js +1 -1
- package/dist/esm/product/components/ProductImagesV2/hooks/useGalleryCarousel.js +7 -3
- package/package.json +1 -1
|
@@ -11,7 +11,8 @@ var React = require('react');
|
|
|
11
11
|
const useCountDownTimer = (setting, builderProps)=>{
|
|
12
12
|
const ref = React.useRef(null);
|
|
13
13
|
const { trigger } = core.useInteraction();
|
|
14
|
-
const { timerDaily, timerEverygreen, dateStandard, behaviour,
|
|
14
|
+
const { timerDaily, timerEverygreen, dateStandard, behaviour, redirectUrl, timeZone, enableDay, enableHour, enableMinute, enableSecond, enableWeek, autoHideWhenTimeout } = setting ?? {};
|
|
15
|
+
const loopAfterFinish = behaviour === 'evergreen' && autoHideWhenTimeout === false ? setting?.loopAfterFinish : false;
|
|
15
16
|
const timeLeft = useTimeLeft.default({
|
|
16
17
|
timerDaily: timerDaily,
|
|
17
18
|
timerEverygreen: timerEverygreen,
|
|
@@ -47,7 +48,7 @@ const useCountDownTimer = (setting, builderProps)=>{
|
|
|
47
48
|
element,
|
|
48
49
|
data: Number(key)
|
|
49
50
|
});
|
|
50
|
-
if (!
|
|
51
|
+
if (!loopAfterFinish) {
|
|
51
52
|
gpInteractionCounter.delete(key);
|
|
52
53
|
element.setAttribute('gp-interaction-counter', JSON.stringify(Object.fromEntries(gpInteractionCounter)));
|
|
53
54
|
}
|
|
@@ -396,6 +396,9 @@ const CountdownSettings = [
|
|
|
396
396
|
bold: true
|
|
397
397
|
}
|
|
398
398
|
},
|
|
399
|
+
hiddenSetting: {
|
|
400
|
+
textAlign: true
|
|
401
|
+
},
|
|
399
402
|
ignoreReRender: true
|
|
400
403
|
},
|
|
401
404
|
{
|
|
@@ -421,6 +424,9 @@ const CountdownSettings = [
|
|
|
421
424
|
color: 'text-1'
|
|
422
425
|
}
|
|
423
426
|
},
|
|
427
|
+
hiddenSetting: {
|
|
428
|
+
textAlign: true
|
|
429
|
+
},
|
|
424
430
|
ignoreReRender: true
|
|
425
431
|
},
|
|
426
432
|
{
|
|
@@ -72,7 +72,7 @@ const getFeaturedImageGalleryClasses = ({ settings, extraClass })=>{
|
|
|
72
72
|
return composeClasses(classList);
|
|
73
73
|
};
|
|
74
74
|
const getGalleryItemClasses = ({ extraClass })=>{
|
|
75
|
-
let classList = `gp-image-item gp-flex gp-items-center gp-justify-center gp-group gp-relative gp-overflow-hidden gp-cursor-pointer data-[outline=deactive]:after:!gp-border-transparent
|
|
75
|
+
let classList = `gp-image-item gp-flex gp-items-center gp-justify-center gp-group gp-relative gp-overflow-hidden gp-cursor-pointer data-[outline=deactive]:after:!gp-border-transparent`;
|
|
76
76
|
if (extraClass) classList += ` ${extraClass}`;
|
|
77
77
|
return composeClasses(classList);
|
|
78
78
|
};
|
|
@@ -50,6 +50,7 @@ const displayOtherImage = ({ featureImageHoverDom })=>{
|
|
|
50
50
|
featureImageHoverDom.style.top = '0px';
|
|
51
51
|
featureImageHoverDom.style.left = '0px';
|
|
52
52
|
featureImageHoverDom.style.width = '100%';
|
|
53
|
+
featureImageHoverDom.style.height = '100%';
|
|
53
54
|
};
|
|
54
55
|
const displayZoomLen = ({ zoomLens, zoomSize, zoomValue, slideWidth, slideHeight, imageOffsetX, imageOffsetY })=>{
|
|
55
56
|
if (!zoomLens) return;
|
package/dist/cjs/product/components/ProductImagesV2/components/child/ProductFeaturedImageCarousel.js
CHANGED
|
@@ -60,7 +60,7 @@ const ProductFeaturedImageCarousel = (props)=>{
|
|
|
60
60
|
filteredProductImages?.map((image)=>{
|
|
61
61
|
return /*#__PURE__*/ jsxRuntime.jsx(CarouselItem.default, {
|
|
62
62
|
contentType: "productImage",
|
|
63
|
-
className: galleryItemClasses('gp-ft-image-item'),
|
|
63
|
+
className: galleryItemClasses('gp-ft-image-item !gp-min-w-full !gp-max-w-full'),
|
|
64
64
|
onClickItem: ()=>{
|
|
65
65
|
const clickEffect = core.getResponsiveValueByScreen(setting?.ftClickOpenLightBox, currentDevice);
|
|
66
66
|
if (clickEffect !== 'none') onHandleClick(image?.id ?? '', enableOpenLightBox);
|
|
@@ -149,7 +149,7 @@ const FeatureImageWithGallery = ({ builderPropUID, children, enableLazyLoadImage
|
|
|
149
149
|
${CarouselItem_liquid.default({
|
|
150
150
|
id: '{{section.id}}-{{imageID}}',
|
|
151
151
|
contentType: 'productImage',
|
|
152
|
-
className: `${galleryItemClasses(`gp-ft-image-item ${className}`)}`,
|
|
152
|
+
className: `${galleryItemClasses(`gp-ft-image-item !gp-min-w-full !gp-max-w-full' ${className}`)}`,
|
|
153
153
|
parentId: `${builderPropUID}-{{section.id}}-{{product.id}}`,
|
|
154
154
|
style: featureImageCarouselItemStyle,
|
|
155
155
|
customStyle: {
|
|
@@ -13,6 +13,7 @@ const useGalleryCarousel = (props)=>{
|
|
|
13
13
|
const [hasClickFeatureArrow, setHasClickFeatureArrow] = React.useState(onClickFeatureArrow || '');
|
|
14
14
|
const mode = core.useEditorMode();
|
|
15
15
|
const [moveToIdx, setMoveToIdx] = React.useState(0);
|
|
16
|
+
const timeOutRef = React.useRef();
|
|
16
17
|
const { filteredProductImages } = useFilterImagesByVariant.useFilterImagesByVariant({
|
|
17
18
|
productImages,
|
|
18
19
|
displayByVariant: setting?.displayByVariant,
|
|
@@ -25,9 +26,12 @@ const useGalleryCarousel = (props)=>{
|
|
|
25
26
|
onClickFeatureArrow
|
|
26
27
|
]);
|
|
27
28
|
React.useEffect(()=>{
|
|
29
|
+
timeOutRef.current && clearTimeout(timeOutRef.current);
|
|
28
30
|
if (hasClickFeatureArrow) {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
+
timeOutRef.current = setTimeout(()=>{
|
|
32
|
+
setMoveToIdx(activeIndexFormFeatureImage || 0);
|
|
33
|
+
setHasClickFeatureArrow('');
|
|
34
|
+
});
|
|
31
35
|
}
|
|
32
36
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
33
37
|
}, [
|
|
@@ -7,7 +7,8 @@ import { useRef } from 'react';
|
|
|
7
7
|
const useCountDownTimer = (setting, builderProps)=>{
|
|
8
8
|
const ref = useRef(null);
|
|
9
9
|
const { trigger } = useInteraction();
|
|
10
|
-
const { timerDaily, timerEverygreen, dateStandard, behaviour,
|
|
10
|
+
const { timerDaily, timerEverygreen, dateStandard, behaviour, redirectUrl, timeZone, enableDay, enableHour, enableMinute, enableSecond, enableWeek, autoHideWhenTimeout } = setting ?? {};
|
|
11
|
+
const loopAfterFinish = behaviour === 'evergreen' && autoHideWhenTimeout === false ? setting?.loopAfterFinish : false;
|
|
11
12
|
const timeLeft = useTimeLeft({
|
|
12
13
|
timerDaily: timerDaily,
|
|
13
14
|
timerEverygreen: timerEverygreen,
|
|
@@ -43,7 +44,7 @@ const useCountDownTimer = (setting, builderProps)=>{
|
|
|
43
44
|
element,
|
|
44
45
|
data: Number(key)
|
|
45
46
|
});
|
|
46
|
-
if (!
|
|
47
|
+
if (!loopAfterFinish) {
|
|
47
48
|
gpInteractionCounter.delete(key);
|
|
48
49
|
element.setAttribute('gp-interaction-counter', JSON.stringify(Object.fromEntries(gpInteractionCounter)));
|
|
49
50
|
}
|
|
@@ -394,6 +394,9 @@ const CountdownSettings = [
|
|
|
394
394
|
bold: true
|
|
395
395
|
}
|
|
396
396
|
},
|
|
397
|
+
hiddenSetting: {
|
|
398
|
+
textAlign: true
|
|
399
|
+
},
|
|
397
400
|
ignoreReRender: true
|
|
398
401
|
},
|
|
399
402
|
{
|
|
@@ -419,6 +422,9 @@ const CountdownSettings = [
|
|
|
419
422
|
color: 'text-1'
|
|
420
423
|
}
|
|
421
424
|
},
|
|
425
|
+
hiddenSetting: {
|
|
426
|
+
textAlign: true
|
|
427
|
+
},
|
|
422
428
|
ignoreReRender: true
|
|
423
429
|
},
|
|
424
430
|
{
|
|
@@ -70,7 +70,7 @@ const getFeaturedImageGalleryClasses = ({ settings, extraClass })=>{
|
|
|
70
70
|
return composeClasses(classList);
|
|
71
71
|
};
|
|
72
72
|
const getGalleryItemClasses = ({ extraClass })=>{
|
|
73
|
-
let classList = `gp-image-item gp-flex gp-items-center gp-justify-center gp-group gp-relative gp-overflow-hidden gp-cursor-pointer data-[outline=deactive]:after:!gp-border-transparent
|
|
73
|
+
let classList = `gp-image-item gp-flex gp-items-center gp-justify-center gp-group gp-relative gp-overflow-hidden gp-cursor-pointer data-[outline=deactive]:after:!gp-border-transparent`;
|
|
74
74
|
if (extraClass) classList += ` ${extraClass}`;
|
|
75
75
|
return composeClasses(classList);
|
|
76
76
|
};
|
|
@@ -48,6 +48,7 @@ const displayOtherImage = ({ featureImageHoverDom })=>{
|
|
|
48
48
|
featureImageHoverDom.style.top = '0px';
|
|
49
49
|
featureImageHoverDom.style.left = '0px';
|
|
50
50
|
featureImageHoverDom.style.width = '100%';
|
|
51
|
+
featureImageHoverDom.style.height = '100%';
|
|
51
52
|
};
|
|
52
53
|
const displayZoomLen = ({ zoomLens, zoomSize, zoomValue, slideWidth, slideHeight, imageOffsetX, imageOffsetY })=>{
|
|
53
54
|
if (!zoomLens) return;
|
package/dist/esm/product/components/ProductImagesV2/components/child/ProductFeaturedImageCarousel.js
CHANGED
|
@@ -56,7 +56,7 @@ const ProductFeaturedImageCarousel = (props)=>{
|
|
|
56
56
|
filteredProductImages?.map((image)=>{
|
|
57
57
|
return /*#__PURE__*/ jsx(CarouselItem, {
|
|
58
58
|
contentType: "productImage",
|
|
59
|
-
className: galleryItemClasses('gp-ft-image-item'),
|
|
59
|
+
className: galleryItemClasses('gp-ft-image-item !gp-min-w-full !gp-max-w-full'),
|
|
60
60
|
onClickItem: ()=>{
|
|
61
61
|
const clickEffect = getResponsiveValueByScreen(setting?.ftClickOpenLightBox, currentDevice);
|
|
62
62
|
if (clickEffect !== 'none') onHandleClick(image?.id ?? '', enableOpenLightBox);
|
|
@@ -145,7 +145,7 @@ const FeatureImageWithGallery = ({ builderPropUID, children, enableLazyLoadImage
|
|
|
145
145
|
${CarouselItem({
|
|
146
146
|
id: '{{section.id}}-{{imageID}}',
|
|
147
147
|
contentType: 'productImage',
|
|
148
|
-
className: `${galleryItemClasses(`gp-ft-image-item ${className}`)}`,
|
|
148
|
+
className: `${galleryItemClasses(`gp-ft-image-item !gp-min-w-full !gp-max-w-full' ${className}`)}`,
|
|
149
149
|
parentId: `${builderPropUID}-{{section.id}}-{{product.id}}`,
|
|
150
150
|
style: featureImageCarouselItemStyle,
|
|
151
151
|
customStyle: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useCurrentDevice, useFeaturedImageGlobal, useEditorMode, getResponsiveValueByScreen } from '@gem-sdk/core';
|
|
2
|
-
import { useState, useEffect, useMemo, useCallback } from 'react';
|
|
2
|
+
import { useState, useRef, useEffect, useMemo, useCallback } from 'react';
|
|
3
3
|
import { useFilterImagesByVariant } from './useFilterImagesByVariant.js';
|
|
4
4
|
import { handleSetSrcForProductImageList } from '../../../../image/helpers/getSrcSet.js';
|
|
5
5
|
import { getShapeByLayout, checkDisplayGalleryByWidth } from '../common/productGallery.js';
|
|
@@ -11,6 +11,7 @@ const useGalleryCarousel = (props)=>{
|
|
|
11
11
|
const [hasClickFeatureArrow, setHasClickFeatureArrow] = useState(onClickFeatureArrow || '');
|
|
12
12
|
const mode = useEditorMode();
|
|
13
13
|
const [moveToIdx, setMoveToIdx] = useState(0);
|
|
14
|
+
const timeOutRef = useRef();
|
|
14
15
|
const { filteredProductImages } = useFilterImagesByVariant({
|
|
15
16
|
productImages,
|
|
16
17
|
displayByVariant: setting?.displayByVariant,
|
|
@@ -23,9 +24,12 @@ const useGalleryCarousel = (props)=>{
|
|
|
23
24
|
onClickFeatureArrow
|
|
24
25
|
]);
|
|
25
26
|
useEffect(()=>{
|
|
27
|
+
timeOutRef.current && clearTimeout(timeOutRef.current);
|
|
26
28
|
if (hasClickFeatureArrow) {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
+
timeOutRef.current = setTimeout(()=>{
|
|
30
|
+
setMoveToIdx(activeIndexFormFeatureImage || 0);
|
|
31
|
+
setHasClickFeatureArrow('');
|
|
32
|
+
});
|
|
29
33
|
}
|
|
30
34
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
31
35
|
}, [
|