@gem-sdk/components 2.0.0-dev.655 → 2.0.0-dev.658
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/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/cjs/text/setting/configs/settings.js +2 -1
- 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/dist/esm/text/setting/configs/settings.js +2 -1
- package/package.json +2 -2
|
@@ -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
|
}, [
|
|
@@ -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
|
}, [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gem-sdk/components",
|
|
3
|
-
"version": "2.0.0-dev.
|
|
3
|
+
"version": "2.0.0-dev.658",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "dist/cjs/index.js",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"scan-all-text": "rollup -c ./scripts/rollup.config.settings.mjs && node ./scripts/scan-all-text && node ./scripts/scan-all-text"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@gem-sdk/core": "2.0.0-dev.
|
|
28
|
+
"@gem-sdk/core": "2.0.0-dev.658",
|
|
29
29
|
"@gem-sdk/styles": "2.0.0-dev.571",
|
|
30
30
|
"@gem-sdk/system": "2.0.0-dev.504",
|
|
31
31
|
"@types/react-transition-group": "^4.4.5",
|