@gem-sdk/components 2.0.0-dev.600 → 2.0.0-dev.601
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/post-purchase/product/components/product-variant/components/ProductVariant.js +6 -3
- package/dist/cjs/third-party/setting/FordeerProductLabels/uiV2.js +17 -15
- package/dist/cjs/third-party/setting/ProductOptionsVariantOption/uiV2.js +0 -35
- package/dist/cjs/third-party/setting/YotpoReviews/uiV2.js +23 -9
- package/dist/esm/post-purchase/product/components/product-variant/components/ProductVariant.js +7 -4
- package/dist/esm/third-party/setting/FordeerProductLabels/uiV2.js +17 -15
- package/dist/esm/third-party/setting/ProductOptionsVariantOption/uiV2.js +0 -35
- package/dist/esm/third-party/setting/YotpoReviews/uiV2.js +23 -9
- package/package.json +1 -1
package/dist/cjs/post-purchase/product/components/product-variant/components/ProductVariant.js
CHANGED
|
@@ -40,6 +40,7 @@ const PostPurchaseProductVariants = ({ builderProps, style, styles: styles$1, se
|
|
|
40
40
|
const isSyncProduct = core.useIsSyncProduct();
|
|
41
41
|
const { selectedOptions, setSelectedOption, forceSelectedOption } = core.useSelectedOption();
|
|
42
42
|
const [variantId, setVariantId] = React.useState('');
|
|
43
|
+
const mode = core.useEditorMode();
|
|
43
44
|
React.useEffect(()=>{
|
|
44
45
|
const url = new URL(window.location.href);
|
|
45
46
|
const variantParam = url.searchParams.get(VARIANT_PARAM_PATH);
|
|
@@ -206,9 +207,11 @@ const PostPurchaseProductVariants = ({ builderProps, style, styles: styles$1, se
|
|
|
206
207
|
})
|
|
207
208
|
})
|
|
208
209
|
]
|
|
209
|
-
}) : /*#__PURE__*/ jsxRuntime.jsx("
|
|
210
|
-
|
|
211
|
-
|
|
210
|
+
}) : /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
211
|
+
children: mode === 'edit' && /*#__PURE__*/ jsxRuntime.jsx("p", {
|
|
212
|
+
className: defaultVariantClasses,
|
|
213
|
+
children: "This product has only default variant"
|
|
214
|
+
})
|
|
212
215
|
})
|
|
213
216
|
});
|
|
214
217
|
};
|
|
@@ -26,13 +26,23 @@ const SettingUIV2 = [
|
|
|
26
26
|
]
|
|
27
27
|
},
|
|
28
28
|
{
|
|
29
|
-
conditionDisplay: 'widgetType === "badge"',
|
|
30
|
-
messageConfig: {
|
|
31
|
-
type: 'info',
|
|
32
|
-
message: '<a style="text-decoration: none; color: #8AA4FF; font-style: normal" href="https://help.fordeercommerce.io/en/article/how-to-get-labelbadge-id-oaszaa/?bust=1728450204490" target="_blank">How can I get the badge ID ?</a>'
|
|
33
|
-
},
|
|
34
29
|
controls: [
|
|
35
30
|
{
|
|
31
|
+
conditionDisplay: 'widgetType === "badge"',
|
|
32
|
+
messageConfig: {
|
|
33
|
+
type: 'info',
|
|
34
|
+
message: '<a style="text-decoration: none; color: #8AA4FF; font-style: normal" href="https://help.fordeercommerce.io/en/article/how-to-get-labelbadge-id-oaszaa/?bust=1728450204490" target="_blank">How can I get the badge ID ?</a>'
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
conditionDisplay: 'widgetType === "trustedBadge"',
|
|
39
|
+
messageConfig: {
|
|
40
|
+
type: 'info',
|
|
41
|
+
message: '<a style="text-decoration: none; color: #8AA4FF; font-style: normal" href="https://help.fordeercommerce.io/en/article/how-to-get-labelbadge-id-oaszaa/?bust=1728450204490" target="_blank">How can I get trust badge ID ?</a>'
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
conditionDisplay: 'widgetType === "badge"',
|
|
36
46
|
type: 'combo',
|
|
37
47
|
label: {
|
|
38
48
|
en: 'Badge ID'
|
|
@@ -57,18 +67,10 @@ const SettingUIV2 = [
|
|
|
57
67
|
}
|
|
58
68
|
}
|
|
59
69
|
]
|
|
60
|
-
}
|
|
61
|
-
]
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
messageConfig: {
|
|
65
|
-
type: 'info',
|
|
66
|
-
message: '<a style="text-decoration: none; color: #8AA4FF; font-style: normal" href="https://help.fordeercommerce.io/en/article/how-to-get-labelbadge-id-oaszaa/?bust=1728450204490" target="_blank">How can I get trust badge ID ?</a>'
|
|
67
|
-
},
|
|
68
|
-
conditionDisplay: 'widgetType === "trustedBadge"',
|
|
69
|
-
controls: [
|
|
70
|
+
},
|
|
70
71
|
{
|
|
71
72
|
type: 'combo',
|
|
73
|
+
conditionDisplay: 'widgetType === "trustedBadge"',
|
|
72
74
|
label: {
|
|
73
75
|
en: 'Trust Badge ID'
|
|
74
76
|
},
|
|
@@ -53,41 +53,6 @@ const SettingUIV2 = [
|
|
|
53
53
|
}
|
|
54
54
|
]
|
|
55
55
|
},
|
|
56
|
-
{
|
|
57
|
-
messageConfig: {
|
|
58
|
-
type: 'info',
|
|
59
|
-
message: 'How to get the embedded code? Click <a href="https://app.omnisend.com/forms/list/all" target="_blank" class="reference">here</a>'
|
|
60
|
-
},
|
|
61
|
-
conditionDisplay: `widgetType == 'landing-page'`,
|
|
62
|
-
controls: [
|
|
63
|
-
{
|
|
64
|
-
type: 'combo',
|
|
65
|
-
label: {
|
|
66
|
-
en: 'Landing Page Link'
|
|
67
|
-
},
|
|
68
|
-
iconName: 'polaris-text-block',
|
|
69
|
-
getValueFromSettingID: 'landingPageLink',
|
|
70
|
-
isHideClear: true,
|
|
71
|
-
popoverLabel: {
|
|
72
|
-
en: 'Landing Page Link'
|
|
73
|
-
},
|
|
74
|
-
controls: [
|
|
75
|
-
{
|
|
76
|
-
label: {
|
|
77
|
-
en: 'Content'
|
|
78
|
-
},
|
|
79
|
-
options: {
|
|
80
|
-
fullWidth: true
|
|
81
|
-
},
|
|
82
|
-
layout: 'vertical',
|
|
83
|
-
setting: {
|
|
84
|
-
id: 'landingPageLink'
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
]
|
|
88
|
-
}
|
|
89
|
-
]
|
|
90
|
-
},
|
|
91
56
|
{
|
|
92
57
|
controls: [
|
|
93
58
|
{
|
|
@@ -34,19 +34,33 @@ const SettingUIV2 = [
|
|
|
34
34
|
setting: {
|
|
35
35
|
id: 'widgetType'
|
|
36
36
|
}
|
|
37
|
-
}
|
|
38
|
-
]
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
conditionDisplay: 'version === "v1"',
|
|
42
|
-
controls: [
|
|
37
|
+
},
|
|
43
38
|
{
|
|
39
|
+
conditionDisplay: `version === "v1"`,
|
|
40
|
+
type: 'combo',
|
|
44
41
|
label: {
|
|
45
42
|
en: 'App Key'
|
|
46
43
|
},
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
44
|
+
iconName: 'polaris-text-block',
|
|
45
|
+
getValueFromSettingID: 'appKey',
|
|
46
|
+
isHideClear: true,
|
|
47
|
+
popoverLabel: {
|
|
48
|
+
en: 'App Key'
|
|
49
|
+
},
|
|
50
|
+
controls: [
|
|
51
|
+
{
|
|
52
|
+
label: {
|
|
53
|
+
en: 'Content'
|
|
54
|
+
},
|
|
55
|
+
options: {
|
|
56
|
+
fullWidth: true
|
|
57
|
+
},
|
|
58
|
+
layout: 'vertical',
|
|
59
|
+
setting: {
|
|
60
|
+
id: 'appKey'
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
]
|
|
50
64
|
}
|
|
51
65
|
]
|
|
52
66
|
},
|
package/dist/esm/post-purchase/product/components/product-variant/components/ProductVariant.js
CHANGED
|
@@ -5,7 +5,7 @@ import { createClass, createStyle } from '@gem-sdk/system';
|
|
|
5
5
|
import { getDefaultVariantClasses, getContainerClasses, getDropdownVariantWrapperClasses } from '../common/classes.js';
|
|
6
6
|
import { getWrapperStyles } from '../common/styles.js';
|
|
7
7
|
import ProductOption from './ProductOption.js';
|
|
8
|
-
import { useVariants, useProduct, useIsSyncProduct, useSelectedOption, useInitialSwatchesOptions, useSwatchesOptions, getSelectedVariant } from '@gem-sdk/core';
|
|
8
|
+
import { useVariants, useProduct, useIsSyncProduct, useSelectedOption, useEditorMode, useInitialSwatchesOptions, useSwatchesOptions, getSelectedVariant } from '@gem-sdk/core';
|
|
9
9
|
import { useTransition } from '../hooks/useTransition.js';
|
|
10
10
|
import { useState, useEffect, useMemo, useCallback } from 'react';
|
|
11
11
|
import { checkDefaultVariant } from '../../../../../product/helpers/product.js';
|
|
@@ -36,6 +36,7 @@ const PostPurchaseProductVariants = ({ builderProps, style, styles, setting })=>
|
|
|
36
36
|
const isSyncProduct = useIsSyncProduct();
|
|
37
37
|
const { selectedOptions, setSelectedOption, forceSelectedOption } = useSelectedOption();
|
|
38
38
|
const [variantId, setVariantId] = useState('');
|
|
39
|
+
const mode = useEditorMode();
|
|
39
40
|
useEffect(()=>{
|
|
40
41
|
const url = new URL(window.location.href);
|
|
41
42
|
const variantParam = url.searchParams.get(VARIANT_PARAM_PATH);
|
|
@@ -202,9 +203,11 @@ const PostPurchaseProductVariants = ({ builderProps, style, styles, setting })=>
|
|
|
202
203
|
})
|
|
203
204
|
})
|
|
204
205
|
]
|
|
205
|
-
}) : /*#__PURE__*/ jsx("
|
|
206
|
-
|
|
207
|
-
|
|
206
|
+
}) : /*#__PURE__*/ jsx("div", {
|
|
207
|
+
children: mode === 'edit' && /*#__PURE__*/ jsx("p", {
|
|
208
|
+
className: defaultVariantClasses,
|
|
209
|
+
children: "This product has only default variant"
|
|
210
|
+
})
|
|
208
211
|
})
|
|
209
212
|
});
|
|
210
213
|
};
|
|
@@ -22,13 +22,23 @@ const SettingUIV2 = [
|
|
|
22
22
|
]
|
|
23
23
|
},
|
|
24
24
|
{
|
|
25
|
-
conditionDisplay: 'widgetType === "badge"',
|
|
26
|
-
messageConfig: {
|
|
27
|
-
type: 'info',
|
|
28
|
-
message: '<a style="text-decoration: none; color: #8AA4FF; font-style: normal" href="https://help.fordeercommerce.io/en/article/how-to-get-labelbadge-id-oaszaa/?bust=1728450204490" target="_blank">How can I get the badge ID ?</a>'
|
|
29
|
-
},
|
|
30
25
|
controls: [
|
|
31
26
|
{
|
|
27
|
+
conditionDisplay: 'widgetType === "badge"',
|
|
28
|
+
messageConfig: {
|
|
29
|
+
type: 'info',
|
|
30
|
+
message: '<a style="text-decoration: none; color: #8AA4FF; font-style: normal" href="https://help.fordeercommerce.io/en/article/how-to-get-labelbadge-id-oaszaa/?bust=1728450204490" target="_blank">How can I get the badge ID ?</a>'
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
conditionDisplay: 'widgetType === "trustedBadge"',
|
|
35
|
+
messageConfig: {
|
|
36
|
+
type: 'info',
|
|
37
|
+
message: '<a style="text-decoration: none; color: #8AA4FF; font-style: normal" href="https://help.fordeercommerce.io/en/article/how-to-get-labelbadge-id-oaszaa/?bust=1728450204490" target="_blank">How can I get trust badge ID ?</a>'
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
conditionDisplay: 'widgetType === "badge"',
|
|
32
42
|
type: 'combo',
|
|
33
43
|
label: {
|
|
34
44
|
en: 'Badge ID'
|
|
@@ -53,18 +63,10 @@ const SettingUIV2 = [
|
|
|
53
63
|
}
|
|
54
64
|
}
|
|
55
65
|
]
|
|
56
|
-
}
|
|
57
|
-
]
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
messageConfig: {
|
|
61
|
-
type: 'info',
|
|
62
|
-
message: '<a style="text-decoration: none; color: #8AA4FF; font-style: normal" href="https://help.fordeercommerce.io/en/article/how-to-get-labelbadge-id-oaszaa/?bust=1728450204490" target="_blank">How can I get trust badge ID ?</a>'
|
|
63
|
-
},
|
|
64
|
-
conditionDisplay: 'widgetType === "trustedBadge"',
|
|
65
|
-
controls: [
|
|
66
|
+
},
|
|
66
67
|
{
|
|
67
68
|
type: 'combo',
|
|
69
|
+
conditionDisplay: 'widgetType === "trustedBadge"',
|
|
68
70
|
label: {
|
|
69
71
|
en: 'Trust Badge ID'
|
|
70
72
|
},
|
|
@@ -49,41 +49,6 @@ const SettingUIV2 = [
|
|
|
49
49
|
}
|
|
50
50
|
]
|
|
51
51
|
},
|
|
52
|
-
{
|
|
53
|
-
messageConfig: {
|
|
54
|
-
type: 'info',
|
|
55
|
-
message: 'How to get the embedded code? Click <a href="https://app.omnisend.com/forms/list/all" target="_blank" class="reference">here</a>'
|
|
56
|
-
},
|
|
57
|
-
conditionDisplay: `widgetType == 'landing-page'`,
|
|
58
|
-
controls: [
|
|
59
|
-
{
|
|
60
|
-
type: 'combo',
|
|
61
|
-
label: {
|
|
62
|
-
en: 'Landing Page Link'
|
|
63
|
-
},
|
|
64
|
-
iconName: 'polaris-text-block',
|
|
65
|
-
getValueFromSettingID: 'landingPageLink',
|
|
66
|
-
isHideClear: true,
|
|
67
|
-
popoverLabel: {
|
|
68
|
-
en: 'Landing Page Link'
|
|
69
|
-
},
|
|
70
|
-
controls: [
|
|
71
|
-
{
|
|
72
|
-
label: {
|
|
73
|
-
en: 'Content'
|
|
74
|
-
},
|
|
75
|
-
options: {
|
|
76
|
-
fullWidth: true
|
|
77
|
-
},
|
|
78
|
-
layout: 'vertical',
|
|
79
|
-
setting: {
|
|
80
|
-
id: 'landingPageLink'
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
]
|
|
84
|
-
}
|
|
85
|
-
]
|
|
86
|
-
},
|
|
87
52
|
{
|
|
88
53
|
controls: [
|
|
89
54
|
{
|
|
@@ -30,19 +30,33 @@ const SettingUIV2 = [
|
|
|
30
30
|
setting: {
|
|
31
31
|
id: 'widgetType'
|
|
32
32
|
}
|
|
33
|
-
}
|
|
34
|
-
]
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
conditionDisplay: 'version === "v1"',
|
|
38
|
-
controls: [
|
|
33
|
+
},
|
|
39
34
|
{
|
|
35
|
+
conditionDisplay: `version === "v1"`,
|
|
36
|
+
type: 'combo',
|
|
40
37
|
label: {
|
|
41
38
|
en: 'App Key'
|
|
42
39
|
},
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
40
|
+
iconName: 'polaris-text-block',
|
|
41
|
+
getValueFromSettingID: 'appKey',
|
|
42
|
+
isHideClear: true,
|
|
43
|
+
popoverLabel: {
|
|
44
|
+
en: 'App Key'
|
|
45
|
+
},
|
|
46
|
+
controls: [
|
|
47
|
+
{
|
|
48
|
+
label: {
|
|
49
|
+
en: 'Content'
|
|
50
|
+
},
|
|
51
|
+
options: {
|
|
52
|
+
fullWidth: true
|
|
53
|
+
},
|
|
54
|
+
layout: 'vertical',
|
|
55
|
+
setting: {
|
|
56
|
+
id: 'appKey'
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
]
|
|
46
60
|
}
|
|
47
61
|
]
|
|
48
62
|
},
|