@gem-sdk/components 2.1.13-staging.21 → 2.1.13-staging.23
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/jsx/components/ProductFeaturedImageCarousel.js +12 -4
- package/dist/cjs/third-party/components/QikifyUpsell.js +22 -10
- package/dist/esm/product/components/ProductImagesV2/jsx/components/ProductFeaturedImageCarousel.js +13 -5
- package/dist/esm/third-party/components/QikifyUpsell.js +22 -10
- package/package.json +1 -1
package/dist/cjs/product/components/ProductImagesV2/jsx/components/ProductFeaturedImageCarousel.js
CHANGED
|
@@ -20,12 +20,20 @@ const ProductFeaturedImageCarousel = ({ productImages, imgRef, onHandleClick, on
|
|
|
20
20
|
const { onListener, ref } = core.useInteraction();
|
|
21
21
|
let delayTimeout;
|
|
22
22
|
const mode = core.useEditorMode();
|
|
23
|
-
const
|
|
23
|
+
const getImageActiveIndex = React.useCallback(()=>{
|
|
24
24
|
const index = productImages?.findIndex((item)=>item.id === featuredImageGlobal?.id);
|
|
25
|
-
return index;
|
|
25
|
+
return index ?? 0;
|
|
26
26
|
}, [
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
featuredImageGlobal?.id,
|
|
28
|
+
productImages
|
|
29
|
+
]);
|
|
30
|
+
const [imageActiveIndex, setImageActiveIndex] = React.useState(getImageActiveIndex());
|
|
31
|
+
React.useEffect(()=>{
|
|
32
|
+
setImageActiveIndex(getImageActiveIndex());
|
|
33
|
+
}, [
|
|
34
|
+
featuredImageGlobal,
|
|
35
|
+
getImageActiveIndex,
|
|
36
|
+
productImages
|
|
29
37
|
]);
|
|
30
38
|
const imageActive = React.useMemo(()=>{
|
|
31
39
|
if (productImages?.length) return featuredImageGlobal || productImages?.[0];
|
|
@@ -8,21 +8,33 @@ var ThirdPartyPreview = require('./ThirdPartyPreview.js');
|
|
|
8
8
|
var React = require('react');
|
|
9
9
|
|
|
10
10
|
const WidgetOptions = [
|
|
11
|
-
// {
|
|
12
|
-
// value: 'bogo',
|
|
13
|
-
// label: 'Upsell, Cross-sell',
|
|
14
|
-
// },
|
|
15
11
|
{
|
|
16
|
-
value: '
|
|
17
|
-
label: '
|
|
12
|
+
value: 'bogo_offer',
|
|
13
|
+
label: 'qikify Buy X get Y'
|
|
18
14
|
},
|
|
19
15
|
{
|
|
20
|
-
value: '
|
|
21
|
-
label: '
|
|
16
|
+
value: 'free_gift',
|
|
17
|
+
label: 'qikify Free Gift'
|
|
22
18
|
},
|
|
23
19
|
{
|
|
24
|
-
value: '
|
|
25
|
-
label: '
|
|
20
|
+
value: 'bundle_offer',
|
|
21
|
+
label: 'qikify Product Bundle'
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
value: 'promotion_badge',
|
|
25
|
+
label: 'qikify Promotion Badge'
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
value: 'order-goal',
|
|
29
|
+
label: 'qikify Reward Bar'
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
value: 'upsurge_offer',
|
|
33
|
+
label: 'qikify Upsurge Discount'
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
value: 'volume_offer',
|
|
37
|
+
label: 'qikify Volume Discount'
|
|
26
38
|
}
|
|
27
39
|
];
|
|
28
40
|
const AppConfig = {
|
package/dist/esm/product/components/ProductImagesV2/jsx/components/ProductFeaturedImageCarousel.js
CHANGED
|
@@ -6,7 +6,7 @@ import { getAspectRatio } from '../../common/common.js';
|
|
|
6
6
|
import { checkRenderFeaturedCarousel, getDotSettingByLayout } from '../../common/productFeaturedImage.js';
|
|
7
7
|
import { handleMouseMove, handleMouseOut } from '../../common/hoverAction.js';
|
|
8
8
|
import ProductFeaturedImageOnly from './ProductFeaturedImageOnly.js';
|
|
9
|
-
import { memo,
|
|
9
|
+
import { memo, useCallback, useState, useEffect, useMemo, createRef } from 'react';
|
|
10
10
|
import { handleSetSrcForFeatureProductImage } from '../../../../../image/helpers/getSrcSet.js';
|
|
11
11
|
|
|
12
12
|
const ProductFeaturedImageCarousel = ({ productImages, imgRef, onHandleClick, onClickArrow, onHandleLoaded, onHandleUpdateActiveIndex, builderPropUID, builderPropsClass, children, parentUid, ...setting })=>{
|
|
@@ -16,12 +16,20 @@ const ProductFeaturedImageCarousel = ({ productImages, imgRef, onHandleClick, on
|
|
|
16
16
|
const { onListener, ref } = useInteraction();
|
|
17
17
|
let delayTimeout;
|
|
18
18
|
const mode = useEditorMode();
|
|
19
|
-
const
|
|
19
|
+
const getImageActiveIndex = useCallback(()=>{
|
|
20
20
|
const index = productImages?.findIndex((item)=>item.id === featuredImageGlobal?.id);
|
|
21
|
-
return index;
|
|
21
|
+
return index ?? 0;
|
|
22
22
|
}, [
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
featuredImageGlobal?.id,
|
|
24
|
+
productImages
|
|
25
|
+
]);
|
|
26
|
+
const [imageActiveIndex, setImageActiveIndex] = useState(getImageActiveIndex());
|
|
27
|
+
useEffect(()=>{
|
|
28
|
+
setImageActiveIndex(getImageActiveIndex());
|
|
29
|
+
}, [
|
|
30
|
+
featuredImageGlobal,
|
|
31
|
+
getImageActiveIndex,
|
|
32
|
+
productImages
|
|
25
33
|
]);
|
|
26
34
|
const imageActive = useMemo(()=>{
|
|
27
35
|
if (productImages?.length) return featuredImageGlobal || productImages?.[0];
|
|
@@ -4,21 +4,33 @@ import ThirdPartyPreview from './ThirdPartyPreview.js';
|
|
|
4
4
|
import { useMemo } from 'react';
|
|
5
5
|
|
|
6
6
|
const WidgetOptions = [
|
|
7
|
-
// {
|
|
8
|
-
// value: 'bogo',
|
|
9
|
-
// label: 'Upsell, Cross-sell',
|
|
10
|
-
// },
|
|
11
7
|
{
|
|
12
|
-
value: '
|
|
13
|
-
label: '
|
|
8
|
+
value: 'bogo_offer',
|
|
9
|
+
label: 'qikify Buy X get Y'
|
|
14
10
|
},
|
|
15
11
|
{
|
|
16
|
-
value: '
|
|
17
|
-
label: '
|
|
12
|
+
value: 'free_gift',
|
|
13
|
+
label: 'qikify Free Gift'
|
|
18
14
|
},
|
|
19
15
|
{
|
|
20
|
-
value: '
|
|
21
|
-
label: '
|
|
16
|
+
value: 'bundle_offer',
|
|
17
|
+
label: 'qikify Product Bundle'
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
value: 'promotion_badge',
|
|
21
|
+
label: 'qikify Promotion Badge'
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
value: 'order-goal',
|
|
25
|
+
label: 'qikify Reward Bar'
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
value: 'upsurge_offer',
|
|
29
|
+
label: 'qikify Upsurge Discount'
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
value: 'volume_offer',
|
|
33
|
+
label: 'qikify Volume Discount'
|
|
22
34
|
}
|
|
23
35
|
];
|
|
24
36
|
const AppConfig = {
|