@gem-sdk/components 2.0.0-dev.347 → 2.0.0-dev.348
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/Countdown.js +103 -307
- package/dist/cjs/countdown-timer/components/Countdown.liquid.js +92 -56
- package/dist/cjs/countdown-timer/components/common/getAttr.js +15 -0
- package/dist/cjs/countdown-timer/components/common/getClasses.js +69 -0
- package/dist/cjs/countdown-timer/components/common/getStyle.js +66 -0
- package/dist/cjs/countdown-timer/components/hooks/useCountDownTimer.js +67 -0
- package/dist/cjs/countdown-timer/{hooks → components/hooks}/useTimeLeft.js +1 -1
- package/dist/cjs/countdown-timer/index.js +1 -1
- package/dist/cjs/countdown-timer/setting/Countdown.js +1 -1
- package/dist/cjs/countdown-timer/setting/configs/settings.js +1 -1
- package/dist/cjs/product/components/ProductProperties/ProductPropertyInput/ProductPropertyInput.liquid.js +1 -1
- package/dist/cjs/product/setting/product-properties/configs/settingsV2.js +43 -14
- package/dist/cjs/product/setting/product-properties/configs/uiV2.js +5 -2
- package/dist/cjs/third-party/components/AliReviews.liquid.js +1 -1
- package/dist/cjs/third-party/components/FeraReviews/FeraReviewsSampleContent.js +3 -3
- package/dist/cjs/third-party/components/FeraReviews/LiquidTemplateByWidget.js +2 -2
- package/dist/cjs/third-party/components/FeraReviews.js +0 -5
- package/dist/cjs/third-party/components/GoogleReviewsByReputon.liquid.js +2 -2
- package/dist/cjs/third-party/components/JudgemeReviews.liquid.js +5 -5
- package/dist/cjs/third-party/components/KachingBundles.liquid.js +1 -1
- package/dist/cjs/third-party/components/KingProductOptions.liquid.js +1 -1
- package/dist/cjs/third-party/components/LaiProductReviews/LiquidTemplateByWiget.js +3 -3
- package/dist/cjs/third-party/components/LooxReviews.liquid.js +1 -1
- package/dist/cjs/third-party/components/Ryviu.liquid.js +1 -1
- package/dist/cjs/third-party/components/Vitals.liquid.js +2 -2
- package/dist/cjs/third-party/setting/TrustshopProductReviews.js +3 -3
- package/dist/cjs/third-party/setting/WhatmoreShoppableVideosreel.js +36 -36
- package/dist/cjs/third-party/types/index.js +5 -0
- package/dist/esm/countdown-timer/components/Countdown.js +104 -308
- package/dist/esm/countdown-timer/components/Countdown.liquid.js +93 -57
- package/dist/esm/countdown-timer/components/common/getAttr.js +12 -0
- package/dist/esm/countdown-timer/components/common/getClasses.js +61 -0
- package/dist/esm/countdown-timer/components/common/getStyle.js +60 -0
- package/dist/esm/countdown-timer/components/hooks/useCountDownTimer.js +63 -0
- package/dist/esm/countdown-timer/{hooks → components/hooks}/useTimeLeft.js +1 -1
- package/dist/esm/countdown-timer/index.js +1 -1
- package/dist/esm/countdown-timer/setting/Countdown.js +1 -1
- package/dist/esm/countdown-timer/setting/configs/settings.js +1 -1
- package/dist/esm/product/components/ProductProperties/ProductPropertyInput/ProductPropertyInput.liquid.js +1 -1
- package/dist/esm/product/setting/product-properties/configs/settingsV2.js +43 -14
- package/dist/esm/product/setting/product-properties/configs/uiV2.js +5 -2
- package/dist/esm/third-party/components/AliReviews.liquid.js +1 -1
- package/dist/esm/third-party/components/FeraReviews/FeraReviewsSampleContent.js +1 -1
- package/dist/esm/third-party/components/FeraReviews/LiquidTemplateByWidget.js +1 -1
- package/dist/esm/third-party/components/FeraReviews.js +1 -5
- package/dist/esm/third-party/components/GoogleReviewsByReputon.liquid.js +2 -2
- package/dist/esm/third-party/components/JudgemeReviews.liquid.js +5 -5
- package/dist/esm/third-party/components/KachingBundles.liquid.js +1 -1
- package/dist/esm/third-party/components/KingProductOptions.liquid.js +1 -1
- package/dist/esm/third-party/components/LaiProductReviews/LiquidTemplateByWiget.js +3 -3
- package/dist/esm/third-party/components/LooxReviews.liquid.js +1 -1
- package/dist/esm/third-party/components/Ryviu.liquid.js +1 -1
- package/dist/esm/third-party/components/Vitals.liquid.js +2 -2
- package/dist/esm/third-party/setting/TrustshopProductReviews.js +3 -3
- package/dist/esm/third-party/setting/WhatmoreShoppableVideosreel.js +36 -36
- package/dist/esm/third-party/types/index.js +5 -1
- package/dist/types/index.d.ts +1541 -1531
- package/package.json +1 -1
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var core = require('@gem-sdk/core');
|
|
4
|
+
|
|
5
|
+
function composeClasses(classList) {
|
|
6
|
+
return classList.split(' ').reduce((acc, item)=>{
|
|
7
|
+
acc[item] = true;
|
|
8
|
+
return acc;
|
|
9
|
+
}, {});
|
|
10
|
+
}
|
|
11
|
+
const getContentClasses = ()=>{
|
|
12
|
+
const classList = 'gp-flex gp-flex-wrap gp-w-max gp-relative';
|
|
13
|
+
return {
|
|
14
|
+
...composeClasses(classList)
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
const getWrapperClasses = (advancedCssClass)=>{
|
|
18
|
+
let classList = 'gp-flex';
|
|
19
|
+
if (advancedCssClass) classList += ` ${advancedCssClass}`;
|
|
20
|
+
return {
|
|
21
|
+
...composeClasses(classList)
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
const getDateClasses = (styles, dateLabel)=>{
|
|
25
|
+
let classList = 'gp-flex-1 gp-text-center gp-min-w-max !gp-max-w-max';
|
|
26
|
+
const { itemPadding } = styles || {};
|
|
27
|
+
if (itemPadding?.type) classList += ` ${core.genSizeClass(itemPadding?.type)}`;
|
|
28
|
+
if (!dateLabel) classList += ` gp-content-center`;
|
|
29
|
+
return {
|
|
30
|
+
...composeClasses(classList)
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
const getTextFrontClasses = (styles)=>{
|
|
34
|
+
let classList = 'gp-countdown-number';
|
|
35
|
+
const { colorNumber } = styles || {};
|
|
36
|
+
if (core.getGlobalColorClass('text', colorNumber)) classList += ` ${core.getGlobalColorClass('text', colorNumber)}`;
|
|
37
|
+
return {
|
|
38
|
+
...composeClasses(classList)
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
const getTextBackClasses = (styles, textLabel)=>{
|
|
42
|
+
let classList = '';
|
|
43
|
+
const { colorLabel } = styles || {};
|
|
44
|
+
if (core.getGlobalColorClass('text', colorLabel)) classList += ` ${core.getGlobalColorClass('text', colorLabel)}`;
|
|
45
|
+
if (!textLabel) classList += ` gp-hidden`;
|
|
46
|
+
return {
|
|
47
|
+
...composeClasses(classList)
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
const getLinkClasses = ()=>{
|
|
51
|
+
const classList = 'gp-absolute gp-inset-0 gp-z-1';
|
|
52
|
+
return {
|
|
53
|
+
...composeClasses(classList)
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
const getTextExpireClasses = ()=>{
|
|
57
|
+
const classList = 'gp-flex gp-h-12 gp-items-center gp-justify-center gp-bg-[#d6d6d6] gp-opacity-70';
|
|
58
|
+
return {
|
|
59
|
+
...composeClasses(classList)
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
exports.getContentClasses = getContentClasses;
|
|
64
|
+
exports.getDateClasses = getDateClasses;
|
|
65
|
+
exports.getLinkClasses = getLinkClasses;
|
|
66
|
+
exports.getTextBackClasses = getTextBackClasses;
|
|
67
|
+
exports.getTextExpireClasses = getTextExpireClasses;
|
|
68
|
+
exports.getTextFrontClasses = getTextFrontClasses;
|
|
69
|
+
exports.getWrapperClasses = getWrapperClasses;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var core = require('@gem-sdk/core');
|
|
4
|
+
|
|
5
|
+
function filterTruthyStyles(styles) {
|
|
6
|
+
return Object.fromEntries(Object.entries(styles || {}).filter(([, value])=>!!value));
|
|
7
|
+
}
|
|
8
|
+
const getWrapperStyle = (styles)=>{
|
|
9
|
+
const composeStyles = {
|
|
10
|
+
...core.makeStyleResponsive('jc', styles?.textAlign)
|
|
11
|
+
};
|
|
12
|
+
return filterTruthyStyles(composeStyles);
|
|
13
|
+
};
|
|
14
|
+
const getContainStyle = (styles)=>{
|
|
15
|
+
const { horizontalGap, textAlign } = styles || {};
|
|
16
|
+
const composeStyles = {
|
|
17
|
+
gap: horizontalGap,
|
|
18
|
+
...core.makeStyleResponsive('jc', textAlign)
|
|
19
|
+
};
|
|
20
|
+
return filterTruthyStyles(composeStyles);
|
|
21
|
+
};
|
|
22
|
+
const getDateStyle = (styles)=>{
|
|
23
|
+
const { borderState, itemPadding, backgroundItemColor, roundedState } = styles || {};
|
|
24
|
+
const composeStyles = {
|
|
25
|
+
...!itemPadding?.type ? core.composeSize(itemPadding?.custom) : {},
|
|
26
|
+
...core.handleConvertBorderStyle(borderState),
|
|
27
|
+
...core.handleConvertBorderWidth(borderState),
|
|
28
|
+
...core.handleConvertBorderColor(borderState),
|
|
29
|
+
...core.composeRadius(roundedState),
|
|
30
|
+
...core.makeStyle({
|
|
31
|
+
bg: core.getGlobalColorCSSProp(backgroundItemColor)
|
|
32
|
+
})
|
|
33
|
+
};
|
|
34
|
+
return filterTruthyStyles(composeStyles);
|
|
35
|
+
};
|
|
36
|
+
const getTextFrontStyle = (styles)=>{
|
|
37
|
+
const { colorNumber, verticalGap } = styles || {};
|
|
38
|
+
let composeStyles = {};
|
|
39
|
+
if (colorNumber) {
|
|
40
|
+
composeStyles = {
|
|
41
|
+
...core.makeStyle({
|
|
42
|
+
mb: verticalGap,
|
|
43
|
+
c: core.getGlobalColorCSSProp(colorNumber)
|
|
44
|
+
})
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
return filterTruthyStyles(composeStyles);
|
|
48
|
+
};
|
|
49
|
+
const getTextBackStyle = (styles)=>{
|
|
50
|
+
const { colorLabel } = styles || {};
|
|
51
|
+
let composeStyles = {};
|
|
52
|
+
if (colorLabel) {
|
|
53
|
+
composeStyles = {
|
|
54
|
+
...core.makeStyle({
|
|
55
|
+
c: core.getGlobalColorCSSProp(colorLabel)
|
|
56
|
+
})
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
return filterTruthyStyles(composeStyles);
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
exports.getContainStyle = getContainStyle;
|
|
63
|
+
exports.getDateStyle = getDateStyle;
|
|
64
|
+
exports.getTextBackStyle = getTextBackStyle;
|
|
65
|
+
exports.getTextFrontStyle = getTextFrontStyle;
|
|
66
|
+
exports.getWrapperStyle = getWrapperStyle;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var core = require('@gem-sdk/core');
|
|
6
|
+
var common = require('../../../product/components/ProductVariants/common/common.js');
|
|
7
|
+
var helpers = require('../../helpers.js');
|
|
8
|
+
var useTimeLeft = require('./useTimeLeft.js');
|
|
9
|
+
var React = require('react');
|
|
10
|
+
|
|
11
|
+
const useCountDownTimer = (setting, builderProps)=>{
|
|
12
|
+
const ref = React.useRef(null);
|
|
13
|
+
const { trigger } = core.useInteraction();
|
|
14
|
+
const { timerDaily, timerEverygreen, dateStandard, behaviour, loopAfterFinish, redirectUrl, timeZone, enableDay, enableHour, enableMinute, enableSecond, enableWeek } = setting ?? {};
|
|
15
|
+
const timeLeft = useTimeLeft.default({
|
|
16
|
+
timerDaily: timerDaily,
|
|
17
|
+
timerEverygreen: timerEverygreen,
|
|
18
|
+
dateStandard: dateStandard,
|
|
19
|
+
behaviour: behaviour,
|
|
20
|
+
loopAfterFinish: loopAfterFinish,
|
|
21
|
+
redirectUrl: redirectUrl,
|
|
22
|
+
timeZone: timeZone
|
|
23
|
+
});
|
|
24
|
+
const { week, day, hour, minute, second } = helpers.convertTime(timeLeft, {
|
|
25
|
+
enableWeek: enableWeek,
|
|
26
|
+
enableDay: enableDay,
|
|
27
|
+
enableHour: enableHour,
|
|
28
|
+
enableMinute: enableMinute,
|
|
29
|
+
enableSecond: enableSecond
|
|
30
|
+
});
|
|
31
|
+
common.useTransition((preTimeLeft)=>{
|
|
32
|
+
if (preTimeLeft !== timeLeft) {
|
|
33
|
+
dispatchInteractionCountdownTimer(timeLeft);
|
|
34
|
+
}
|
|
35
|
+
}, [
|
|
36
|
+
timeLeft
|
|
37
|
+
]);
|
|
38
|
+
const dispatchInteractionCountdownTimer = (timeLeft)=>{
|
|
39
|
+
const element = ref.current;
|
|
40
|
+
const gpInteractionCounter = new Map(Object.entries(JSON.parse(element?.getAttribute('gp-interaction-counter') ?? '{}')));
|
|
41
|
+
if (gpInteractionCounter.size <= 0) return;
|
|
42
|
+
gpInteractionCounter.forEach((_, key)=>{
|
|
43
|
+
if (timeLeft !== Number(key)) return;
|
|
44
|
+
trigger({
|
|
45
|
+
event: 'gp:countdown-timer',
|
|
46
|
+
selector: `[data-id="${builderProps?.uid}"]`,
|
|
47
|
+
element,
|
|
48
|
+
data: Number(key)
|
|
49
|
+
});
|
|
50
|
+
if (!setting?.loopAfterFinish) {
|
|
51
|
+
gpInteractionCounter.delete(key);
|
|
52
|
+
element.setAttribute('gp-interaction-counter', JSON.stringify(Object.fromEntries(gpInteractionCounter)));
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
};
|
|
56
|
+
return {
|
|
57
|
+
week,
|
|
58
|
+
day,
|
|
59
|
+
hour,
|
|
60
|
+
minute,
|
|
61
|
+
second,
|
|
62
|
+
timeLeft,
|
|
63
|
+
ref
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
exports.default = useCountDownTimer;
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var settings = require('./configs/settings.js');
|
|
6
5
|
var uiV1 = require('./configs/uiV1.js');
|
|
7
6
|
var uiV2 = require('./configs/uiV2.js');
|
|
7
|
+
var settings = require('./configs/settings.js');
|
|
8
8
|
|
|
9
9
|
const config = {
|
|
10
10
|
tag: 'Countdown',
|
|
@@ -49,7 +49,7 @@ const ProductPropertyInput = ({ setting, styles, builderProps, pageContext, attr
|
|
|
49
49
|
value="${elementValue}"
|
|
50
50
|
class="${inputClasses}"
|
|
51
51
|
style="${inputStyles}"
|
|
52
|
-
${required ? `required="${required}"` : ''}
|
|
52
|
+
${required ? `required="${required}"` : ''}
|
|
53
53
|
minlength="${minChar}"
|
|
54
54
|
maxlength="${maxChar}"
|
|
55
55
|
></${element}>
|
|
@@ -30,7 +30,7 @@ const ProductPropertiesSettingsV2 = [
|
|
|
30
30
|
popoverLabel: 'Type',
|
|
31
31
|
options: [
|
|
32
32
|
{
|
|
33
|
-
label: 'Text',
|
|
33
|
+
label: 'Text field',
|
|
34
34
|
value: 'text',
|
|
35
35
|
type: 'p-image-layout',
|
|
36
36
|
iconName: 'gp-input-text'
|
|
@@ -42,7 +42,7 @@ const ProductPropertiesSettingsV2 = [
|
|
|
42
42
|
iconName: 'gp-input-text-area'
|
|
43
43
|
},
|
|
44
44
|
{
|
|
45
|
-
label: 'Email',
|
|
45
|
+
label: 'Email field',
|
|
46
46
|
value: 'email',
|
|
47
47
|
type: 'p-image-layout',
|
|
48
48
|
iconName: 'gp-input-email'
|
|
@@ -54,7 +54,7 @@ const ProductPropertiesSettingsV2 = [
|
|
|
54
54
|
iconName: 'gp-input-checkbox'
|
|
55
55
|
},
|
|
56
56
|
{
|
|
57
|
-
label: 'Radio',
|
|
57
|
+
label: 'Radio button',
|
|
58
58
|
value: 'radio',
|
|
59
59
|
type: 'p-image-layout',
|
|
60
60
|
iconName: 'gp-input-radio-button'
|
|
@@ -66,7 +66,7 @@ const ProductPropertiesSettingsV2 = [
|
|
|
66
66
|
iconName: 'gp-input-dropdown'
|
|
67
67
|
},
|
|
68
68
|
{
|
|
69
|
-
label: 'Hidden',
|
|
69
|
+
label: 'Hidden field',
|
|
70
70
|
value: 'hidden',
|
|
71
71
|
type: 'p-image-layout',
|
|
72
72
|
iconName: 'gp-input-hidden-field'
|
|
@@ -78,7 +78,7 @@ const ProductPropertiesSettingsV2 = [
|
|
|
78
78
|
id: 'label',
|
|
79
79
|
label: 'Label',
|
|
80
80
|
type: 'input',
|
|
81
|
-
default: '',
|
|
81
|
+
default: 'Label',
|
|
82
82
|
placeholder: 'E.g. Input your name below'
|
|
83
83
|
},
|
|
84
84
|
{
|
|
@@ -192,7 +192,7 @@ const ProductPropertiesSettingsV2 = [
|
|
|
192
192
|
id: 'isDisplayLabel',
|
|
193
193
|
label: 'Label',
|
|
194
194
|
type: 'toggle',
|
|
195
|
-
default:
|
|
195
|
+
default: false
|
|
196
196
|
},
|
|
197
197
|
{
|
|
198
198
|
id: 'labelTypo',
|
|
@@ -205,7 +205,8 @@ const ProductPropertiesSettingsV2 = [
|
|
|
205
205
|
}
|
|
206
206
|
},
|
|
207
207
|
hiddenSetting: {
|
|
208
|
-
textAlign: true
|
|
208
|
+
textAlign: true,
|
|
209
|
+
textShadow: true
|
|
209
210
|
},
|
|
210
211
|
ignoreReRender: true
|
|
211
212
|
},
|
|
@@ -249,11 +250,15 @@ const ProductPropertiesSettingsV2 = [
|
|
|
249
250
|
type: 'typography-v2',
|
|
250
251
|
label: 'Typography',
|
|
251
252
|
default: {
|
|
252
|
-
type: 'paragraph-1'
|
|
253
|
+
type: 'paragraph-1',
|
|
254
|
+
attrs: {
|
|
255
|
+
color: 'text-1'
|
|
256
|
+
}
|
|
253
257
|
},
|
|
254
258
|
hiddenSetting: {
|
|
255
259
|
color: false,
|
|
256
|
-
textAlign: true
|
|
260
|
+
textAlign: true,
|
|
261
|
+
textShadow: true
|
|
257
262
|
},
|
|
258
263
|
ignoreReRender: true
|
|
259
264
|
},
|
|
@@ -348,7 +353,9 @@ const ProductPropertiesSettingsV2 = [
|
|
|
348
353
|
type: 'color-picker-v2',
|
|
349
354
|
label: 'Text Color',
|
|
350
355
|
default: {
|
|
351
|
-
normal: 'text-1'
|
|
356
|
+
normal: 'text-1',
|
|
357
|
+
focus: 'transparent',
|
|
358
|
+
hover: 'transparent'
|
|
352
359
|
},
|
|
353
360
|
state: {
|
|
354
361
|
normal: true,
|
|
@@ -361,7 +368,9 @@ const ProductPropertiesSettingsV2 = [
|
|
|
361
368
|
type: 'color-picker-v2',
|
|
362
369
|
label: 'Text Color',
|
|
363
370
|
default: {
|
|
364
|
-
normal: 'text-1'
|
|
371
|
+
normal: 'text-1',
|
|
372
|
+
hover: 'transparent',
|
|
373
|
+
active: 'transparent'
|
|
365
374
|
},
|
|
366
375
|
state: {
|
|
367
376
|
normal: true,
|
|
@@ -377,6 +386,12 @@ const ProductPropertiesSettingsV2 = [
|
|
|
377
386
|
desktop: {
|
|
378
387
|
default: {
|
|
379
388
|
normal: {
|
|
389
|
+
border: 'solid',
|
|
390
|
+
borderWidth: '1px',
|
|
391
|
+
width: '1px',
|
|
392
|
+
color: '#121212'
|
|
393
|
+
},
|
|
394
|
+
hover: {
|
|
380
395
|
borderType: 'none',
|
|
381
396
|
border: 'none',
|
|
382
397
|
borderWidth: '1px',
|
|
@@ -384,7 +399,7 @@ const ProductPropertiesSettingsV2 = [
|
|
|
384
399
|
color: '#121212',
|
|
385
400
|
isCustom: true
|
|
386
401
|
},
|
|
387
|
-
|
|
402
|
+
focus: {
|
|
388
403
|
borderType: 'none',
|
|
389
404
|
border: 'none',
|
|
390
405
|
borderWidth: '1px',
|
|
@@ -409,6 +424,12 @@ const ProductPropertiesSettingsV2 = [
|
|
|
409
424
|
color: '#212121',
|
|
410
425
|
width: '1px',
|
|
411
426
|
borderWidth: '1px'
|
|
427
|
+
},
|
|
428
|
+
focus: {
|
|
429
|
+
border: 'solid',
|
|
430
|
+
color: '#212121',
|
|
431
|
+
width: '1px',
|
|
432
|
+
borderWidth: '1px'
|
|
412
433
|
}
|
|
413
434
|
}
|
|
414
435
|
}
|
|
@@ -420,12 +441,20 @@ const ProductPropertiesSettingsV2 = [
|
|
|
420
441
|
label: 'Background Color',
|
|
421
442
|
devices: {
|
|
422
443
|
desktop: {
|
|
423
|
-
default: {
|
|
444
|
+
default: {
|
|
445
|
+
normal: '#FFFFFF',
|
|
446
|
+
hover: '#DDDDDD',
|
|
447
|
+
focus: 'transparent'
|
|
448
|
+
}
|
|
424
449
|
}
|
|
425
450
|
},
|
|
426
451
|
compoDefaultValue: {
|
|
427
452
|
desktop: {
|
|
428
|
-
default: {
|
|
453
|
+
default: {
|
|
454
|
+
normal: '#FFFFFF',
|
|
455
|
+
hover: '#DDDDDD',
|
|
456
|
+
focus: 'transparent'
|
|
457
|
+
}
|
|
429
458
|
}
|
|
430
459
|
},
|
|
431
460
|
enableGradient: true
|
|
@@ -322,6 +322,7 @@ const SettingUIV2 = [
|
|
|
322
322
|
}
|
|
323
323
|
},
|
|
324
324
|
{
|
|
325
|
+
conditionDisplay: 'isDisplayLabel !== false',
|
|
325
326
|
type: 'combo',
|
|
326
327
|
iconName: 'polaris-text-block',
|
|
327
328
|
getValueFromSettingID: 'label',
|
|
@@ -341,6 +342,7 @@ const SettingUIV2 = [
|
|
|
341
342
|
]
|
|
342
343
|
},
|
|
343
344
|
{
|
|
345
|
+
conditionDisplay: 'isDisplayLabel !== false',
|
|
344
346
|
setting: {
|
|
345
347
|
id: 'labelTypo'
|
|
346
348
|
},
|
|
@@ -537,6 +539,7 @@ const SettingUIV2 = [
|
|
|
537
539
|
},
|
|
538
540
|
type: 'combo',
|
|
539
541
|
isHideClear: true,
|
|
542
|
+
getValueFromSettingID: 'name',
|
|
540
543
|
controls: [
|
|
541
544
|
{
|
|
542
545
|
setting: {
|
|
@@ -628,7 +631,7 @@ const SettingUIV2 = [
|
|
|
628
631
|
},
|
|
629
632
|
{
|
|
630
633
|
type: 'combo',
|
|
631
|
-
conditionDisplay: '["text", "textarea"].includes(type)',
|
|
634
|
+
conditionDisplay: '["text", "textarea"].includes(type) && numberOnly === true',
|
|
632
635
|
label: {
|
|
633
636
|
en: 'Invalid number'
|
|
634
637
|
},
|
|
@@ -668,7 +671,7 @@ const SettingUIV2 = [
|
|
|
668
671
|
},
|
|
669
672
|
{
|
|
670
673
|
type: 'combo',
|
|
671
|
-
conditionDisplay: 'type !== "hidden"',
|
|
674
|
+
conditionDisplay: 'type !== "hidden" && required === true',
|
|
672
675
|
label: {
|
|
673
676
|
en: 'Missing required'
|
|
674
677
|
},
|
|
@@ -18,7 +18,7 @@ const AliReviews = ({ setting, advanced })=>{
|
|
|
18
18
|
{% when 'starRating' %}
|
|
19
19
|
<div class='alireviews-review-star-rating' product-handle='{{product.handle}}' product-id='{{product.id}}'> </div >
|
|
20
20
|
{% when 'reviewBox' %}
|
|
21
|
-
<div class="alireviews-review-box"> </div
|
|
21
|
+
<div class="alireviews-review-box"> </div
|
|
22
22
|
{% endcase %}
|
|
23
23
|
</div>
|
|
24
24
|
`;
|
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
|
|
6
6
|
var jsxRuntime = require('react/jsx-runtime');
|
|
7
|
-
var FeraReviews$1 = require('../FeraReviews.js');
|
|
8
7
|
var ThirdPartyPreview = require('../ThirdPartyPreview.js');
|
|
9
8
|
var FeraReviews = require('../../configs/FeraReviews.js');
|
|
10
9
|
var React = require('react');
|
|
10
|
+
var index = require('../../types/index.js');
|
|
11
11
|
|
|
12
12
|
const mapWidgetLabelV2 = {
|
|
13
13
|
productReviews: 'Product Reviews',
|
|
@@ -28,8 +28,8 @@ const mapWidgetLabelV3 = {
|
|
|
28
28
|
otherWidget: 'Other'
|
|
29
29
|
};
|
|
30
30
|
const FeraReviewsSampleContent = ({ setting })=>{
|
|
31
|
-
const feraVersion = setting?.feraVersion ||
|
|
32
|
-
const widgetLabel = feraVersion ===
|
|
31
|
+
const feraVersion = setting?.feraVersion || index.FERA_VERSION.V2;
|
|
32
|
+
const widgetLabel = feraVersion === index.FERA_VERSION.V3 ? mapWidgetLabelV3[setting?.widgetTypeV3 || 'allReviews'] : mapWidgetLabelV2[setting?.widgetType || 'allReviews'];
|
|
33
33
|
const label = React.useMemo(()=>{
|
|
34
34
|
return widgetLabel ? `${FeraReviews.default.label} - ${feraVersion} - ${widgetLabel}` : FeraReviews.default.label;
|
|
35
35
|
}, [
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var FeraReviews = require('../FeraReviews.js');
|
|
4
3
|
var core = require('@gem-sdk/core');
|
|
4
|
+
var index = require('../../types/index.js');
|
|
5
5
|
|
|
6
6
|
const getTemplateByWidget = (setting)=>{
|
|
7
7
|
switch(setting?.feraVersion){
|
|
8
|
-
case
|
|
8
|
+
case index.FERA_VERSION['V3']:
|
|
9
9
|
return liquidTemplateFeraV3(setting);
|
|
10
10
|
default:
|
|
11
11
|
return liquidTemplateFeraV2(setting);
|
|
@@ -8,10 +8,6 @@ var core = require('@gem-sdk/core');
|
|
|
8
8
|
var dynamic = require('next/dynamic');
|
|
9
9
|
|
|
10
10
|
const FeraReviewsSampleContent = dynamic(()=>Promise.resolve().then(function () { return require('./FeraReviews/FeraReviewsSampleContent.js'); }));
|
|
11
|
-
const FERA_VERSION = {
|
|
12
|
-
V2: 'V2',
|
|
13
|
-
V3: 'V3'
|
|
14
|
-
};
|
|
15
11
|
const FeraReviews = ({ setting })=>{
|
|
16
12
|
const mode = core.useEditorMode();
|
|
17
13
|
return /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
@@ -24,5 +20,4 @@ const FeraReviews = ({ setting })=>{
|
|
|
24
20
|
});
|
|
25
21
|
};
|
|
26
22
|
|
|
27
|
-
exports.FERA_VERSION = FERA_VERSION;
|
|
28
23
|
exports.default = FeraReviews;
|
|
@@ -80,8 +80,8 @@ const GoogleReviewsByReputon = ({ setting, advanced })=>{
|
|
|
80
80
|
data-type="basic_slide"
|
|
81
81
|
data-sticky="true"
|
|
82
82
|
{% endcase %}
|
|
83
|
-
<script
|
|
84
|
-
type="text/javascript"
|
|
83
|
+
<script
|
|
84
|
+
type="text/javascript"
|
|
85
85
|
src="https://cdn.grw.reputon.com/assets/widget.js?shop={{shop.domain}}" defer></script>
|
|
86
86
|
</div>
|
|
87
87
|
`;
|
|
@@ -19,7 +19,7 @@ const JudgemeReviews = ({ setting, advanced })=>{
|
|
|
19
19
|
{% when "single_product_preview_badge" %}
|
|
20
20
|
<div style='{{ jm_style }}' class='jdgm-widget jdgm-preview-badge' data-id='{{ product.id }}'>
|
|
21
21
|
{{ product.metafields.judgeme.badge }}
|
|
22
|
-
</div>
|
|
22
|
+
</div>
|
|
23
23
|
{% when "review_widget" %}
|
|
24
24
|
<div style='clear:both'></div>
|
|
25
25
|
<div id='judgeme_product_reviews' class='jdgm-widget jdgm-review-widget' data-id='{{ product.id }}'>
|
|
@@ -27,7 +27,7 @@ const JudgemeReviews = ({ setting, advanced })=>{
|
|
|
27
27
|
</div>
|
|
28
28
|
{% when "reviews_carousel" %}
|
|
29
29
|
<div class='jdgm-carousel-wrapper'>
|
|
30
|
-
{% assign jm_metafields = shop.metafields.judgeme %}
|
|
30
|
+
{% assign jm_metafields = shop.metafields.judgeme %}
|
|
31
31
|
<div class='jdgm-carousel-title-and-link'>
|
|
32
32
|
<h2 class='jdgm-carousel-title'>Let customers speak for us</h2>
|
|
33
33
|
<span class='jdgm-all-reviews-rating-wrapper' href='javascript:void(0)'>
|
|
@@ -35,7 +35,7 @@ const JudgemeReviews = ({ setting, advanced })=>{
|
|
|
35
35
|
<span style='display: block' class='jdgm-carousel-number-of-reviews' data-number-of-reviews='{{ jm_metafields.all_reviews_count }}'>
|
|
36
36
|
from {{ shop.metafields.judgeme.all_reviews_count }} reviews
|
|
37
37
|
</span>
|
|
38
|
-
</span>
|
|
38
|
+
</span>
|
|
39
39
|
</div>
|
|
40
40
|
{{ jm_metafields.featured_carousel }}
|
|
41
41
|
</div>
|
|
@@ -48,14 +48,14 @@ const JudgemeReviews = ({ setting, advanced })=>{
|
|
|
48
48
|
Customers rate us {{ shop.metafields.judgeme.all_reviews_rating | round: 1 }}/5 based on {{ shop.metafields.judgeme.all_reviews_count }} reviews.
|
|
49
49
|
</span>
|
|
50
50
|
</a>
|
|
51
|
-
</div>
|
|
51
|
+
</div>
|
|
52
52
|
</div>
|
|
53
53
|
{% when "section_for_medals" %}
|
|
54
54
|
{{ shop.metafields.judgeme.medals }}
|
|
55
55
|
{% when "ugc_media_grid" %}
|
|
56
56
|
<div class='jdgm-widget jdgm-ugc-media-wrapper'>
|
|
57
57
|
{{ shop.metafields.judgeme.ugc_media_grid }}
|
|
58
|
-
</div>
|
|
58
|
+
</div>
|
|
59
59
|
{% when "verified_reviews_count_badge" %}
|
|
60
60
|
<div style='clear:both'></div>
|
|
61
61
|
<div style='text-align: center'>
|
|
@@ -14,7 +14,7 @@ const KachingBundles = ({ setting, advanced })=>{
|
|
|
14
14
|
...core.makeStyleResponsive('ta', align)
|
|
15
15
|
}}"
|
|
16
16
|
>
|
|
17
|
-
<kaching-bundle product-id="{{ product.id }}"></kaching-bundle>
|
|
17
|
+
<kaching-bundle product-id="{{ product.id }}"></kaching-bundle>
|
|
18
18
|
</div>
|
|
19
19
|
<script>
|
|
20
20
|
window.kachingBundlesDisableAddToCartHandling = true;
|
|
@@ -47,7 +47,7 @@ const productReviewWidget = `
|
|
|
47
47
|
</div>
|
|
48
48
|
`;
|
|
49
49
|
const starRatings = `
|
|
50
|
-
<div class="scm-reviews-rate" data-rate-version2="{{ product.metafields.scm_review_importer.reviewsData.reviewCountInfo | json | escape}}" data-product-id="{{ product.id }}"></div>
|
|
50
|
+
<div class="scm-reviews-rate" data-rate-version2="{{ product.metafields.scm_review_importer.reviewsData.reviewCountInfo | json | escape}}" data-product-id="{{ product.id }}"></div>
|
|
51
51
|
`;
|
|
52
52
|
// Advanced
|
|
53
53
|
const cardCarousel = `
|
|
@@ -80,8 +80,8 @@ const happyCustomerReviews = `
|
|
|
80
80
|
{% endunless %}
|
|
81
81
|
`;
|
|
82
82
|
const starRatingsInList = `
|
|
83
|
-
<div class="scm-reviews-rate"
|
|
84
|
-
data-rate-version2="{{ product.metafields.scm_review_importer.reviewsData.reviewCountInfo | json | escape }}"
|
|
83
|
+
<div class="scm-reviews-rate"
|
|
84
|
+
data-rate-version2="{{ product.metafields.scm_review_importer.reviewsData.reviewCountInfo | json | escape }}"
|
|
85
85
|
data-product-id="{{ product.id }}"></div>
|
|
86
86
|
`;
|
|
87
87
|
|
|
@@ -43,7 +43,7 @@ const LooxReviews = ({ setting, advanced })=>{
|
|
|
43
43
|
{% if '${widgetType}' == "rating_widget" %}
|
|
44
44
|
{% if '${showRatingWidgetAllReviews}' == 'true' %}
|
|
45
45
|
{% if shop.metafields.loox["global_stats"] %}
|
|
46
|
-
{% assign looxstats = shop.metafields.loox["global_stats"] | split: ',' %}
|
|
46
|
+
{% assign looxstats = shop.metafields.loox["global_stats"] | split: ',' %}
|
|
47
47
|
<a href="#looxReviews">
|
|
48
48
|
<div class="loox-rating" data-rating="{{ looxstats[0] }}" data-raters="{{ looxstats[1] }}"></div>
|
|
49
49
|
</a>
|
|
@@ -16,7 +16,7 @@ const Ryviu = ({ setting, advanced })=>{
|
|
|
16
16
|
{% assign widget = '${widgetType}' %}
|
|
17
17
|
{% case widget %}
|
|
18
18
|
{% when "reviews" %}
|
|
19
|
-
<div class="lt-block-reviews">
|
|
19
|
+
<div class="lt-block-reviews">
|
|
20
20
|
<ryviu-widget handle="{{product.handle}}" product_id="{{product.id}}" title_product="{{product.title}}" total_meta="{{ product.metafields.ryviu.r_count }}" image_product="{{ product.featured_image.src | img_url: '100x' }}"></ryviu-widget>
|
|
21
21
|
</div>
|
|
22
22
|
{% when "badge" %}
|
|
@@ -36,9 +36,9 @@ const Vitals = ({ setting, advanced })=>{
|
|
|
36
36
|
{% when "stockScarcity" %}
|
|
37
37
|
<div id="vitals-stock-urgency"></div>
|
|
38
38
|
{% when "sizeChart" %}
|
|
39
|
-
<div id="vitals-size_chart"></div>
|
|
39
|
+
<div id="vitals-size_chart"></div>
|
|
40
40
|
{% when "upsellBuilderBogo" %}
|
|
41
|
-
<div id="vitals-upsell-builder-bogo"></div>
|
|
41
|
+
<div id="vitals-upsell-builder-bogo"></div>
|
|
42
42
|
{% when "bundleCountdownBox" %}
|
|
43
43
|
<div id="bundle-countdown_box"></div>
|
|
44
44
|
{% when "reviewsUnderTitle" %}
|