@gem-sdk/core 1.48.0-dev.8 → 1.48.0-dev.83
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/components/InteractionSuffix.js +1 -1
- package/dist/cjs/components/Render.liquid.js +10 -4
- package/dist/cjs/graphql/fragments/product-little.generated.js +1 -0
- package/dist/cjs/graphql/fragments/published-theme-page.generated.js +8 -0
- package/dist/cjs/helpers/animations.js +6 -6
- package/dist/cjs/helpers/background.js +1 -1
- package/dist/cjs/helpers/compose-advance-style.js +6 -3
- package/dist/cjs/helpers/interaction/index.js +40 -0
- package/dist/cjs/helpers/queries/get-product.js +1 -1
- package/dist/cjs/helpers/render.js +2 -0
- package/dist/cjs/helpers/shadow.js +15 -3
- package/dist/cjs/helpers/third-party/appConfig.js +56 -0
- package/dist/cjs/helpers/third-party/appSetting.js +93 -0
- package/dist/cjs/helpers/third-party/constant.js +9 -1
- package/dist/cjs/helpers/typography.js +16 -13
- package/dist/cjs/index.js +4 -0
- package/dist/cjs/types/animations.js +2 -0
- package/dist/esm/components/InteractionSuffix.js +2 -2
- package/dist/esm/components/Render.liquid.js +10 -4
- package/dist/esm/graphql/fragments/product-little.generated.js +1 -0
- package/dist/esm/graphql/fragments/published-theme-page.generated.js +8 -0
- package/dist/esm/helpers/animations.js +6 -6
- package/dist/esm/helpers/background.js +1 -1
- package/dist/esm/helpers/compose-advance-style.js +7 -4
- package/dist/esm/helpers/interaction/index.js +38 -0
- package/dist/esm/helpers/queries/get-product.js +1 -1
- package/dist/esm/helpers/render.js +2 -0
- package/dist/esm/helpers/shadow.js +15 -4
- package/dist/esm/helpers/third-party/appConfig.js +49 -1
- package/dist/esm/helpers/third-party/appSetting.js +93 -0
- package/dist/esm/helpers/third-party/constant.js +10 -2
- package/dist/esm/helpers/typography.js +16 -14
- package/dist/esm/index.js +3 -2
- package/dist/esm/types/animations.js +2 -0
- package/dist/types/index.d.ts +1974 -193
- package/package.json +3 -3
|
@@ -46,7 +46,7 @@ const InteractionSuffix = ({ tag, uid })=>{
|
|
|
46
46
|
isCurrentInteractionTarget
|
|
47
47
|
]);
|
|
48
48
|
if (!isDisplay) {
|
|
49
|
-
return
|
|
49
|
+
return /*#__PURE__*/ jsxRuntime.jsx(jsxRuntime.Fragment, {});
|
|
50
50
|
}
|
|
51
51
|
return /*#__PURE__*/ jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
52
52
|
children: [
|
|
@@ -59,7 +59,11 @@ const Render = ({ uid, builder, components, parentId, extraFiles = {}, pageConte
|
|
|
59
59
|
const customProps = {
|
|
60
60
|
extraFiles: {}
|
|
61
61
|
};
|
|
62
|
-
const
|
|
62
|
+
const d = item.advanced?.displayInitInteraction ?? item.advanced?.d;
|
|
63
|
+
const style = composeAdvanceStyle.composeAdvanceStyle({
|
|
64
|
+
...item.advanced,
|
|
65
|
+
d
|
|
66
|
+
}, item.tag);
|
|
63
67
|
let liquid = '';
|
|
64
68
|
if (constant.disableWrap.includes(item.tag)) {
|
|
65
69
|
liquid = render.RenderIf(item?.childrens?.length, ()=>{
|
|
@@ -219,7 +223,7 @@ const RenderCustomCode = (item)=>{
|
|
|
219
223
|
};
|
|
220
224
|
const appendAnimation = (props, liquid)=>{
|
|
221
225
|
const { advanced, tag } = props;
|
|
222
|
-
const { animation, op: opacity } = advanced ?? {};
|
|
226
|
+
const { animation, op: opacity, hasAnimationInteraction } = advanced ?? {};
|
|
223
227
|
const getAnimationType = (settings, type)=>{
|
|
224
228
|
return settings?.triggerConfig?.[type]?.animation ?? 'none';
|
|
225
229
|
};
|
|
@@ -233,7 +237,9 @@ const appendAnimation = (props, liquid)=>{
|
|
|
233
237
|
const hoverDesktop = getAnimationType(getSettingsByDevice('desktop'), 'hover');
|
|
234
238
|
const appearTablet = getAnimationType(getSettingsByDevice('tablet'), 'appear');
|
|
235
239
|
const appearMobile = getAnimationType(getSettingsByDevice('mobile'), 'appear');
|
|
236
|
-
const enableAnimation = animation?.desktop?.enabled && (appearDesktop !== 'none' || hoverDesktop !== 'none') || animation?.tablet?.enabled && appearTablet !== 'none' || animation?.mobile?.enabled && appearMobile !== 'none';
|
|
240
|
+
const enableAnimation = animation?.desktop?.enabled && (appearDesktop !== 'none' || hoverDesktop !== 'none') || animation?.tablet?.enabled && appearTablet !== 'none' || animation?.mobile?.enabled && appearMobile !== 'none' || !!hasAnimationInteraction;
|
|
241
|
+
const enableAnimationWhenInit = animation?.desktop?.enabled && (appearDesktop !== 'none' || hoverDesktop !== 'none') || animation?.tablet?.enabled && appearTablet !== 'none' || animation?.mobile?.enabled && appearMobile !== 'none';
|
|
242
|
+
if (!enableAnimation) return liquid;
|
|
237
243
|
const getInitVisibility = (device)=>getSettingsByDevice(device)?.enabled && ![
|
|
238
244
|
'shake',
|
|
239
245
|
'none'
|
|
@@ -249,7 +255,7 @@ const appendAnimation = (props, liquid)=>{
|
|
|
249
255
|
config: animation,
|
|
250
256
|
tag,
|
|
251
257
|
opacity,
|
|
252
|
-
|
|
258
|
+
notEnableAnimationWhenInit: !enableAnimationWhenInit
|
|
253
259
|
})}'
|
|
254
260
|
style="${{
|
|
255
261
|
display: 'contents'
|
|
@@ -28,6 +28,10 @@
|
|
|
28
28
|
themePageCustomFonts {
|
|
29
29
|
...CustomFontSelect
|
|
30
30
|
}
|
|
31
|
+
interaction {
|
|
32
|
+
id
|
|
33
|
+
value
|
|
34
|
+
}
|
|
31
35
|
}
|
|
32
36
|
`;
|
|
33
37
|
const PreviewThemePageSelect = `
|
|
@@ -55,6 +59,10 @@ const PreviewThemePageSelect = `
|
|
|
55
59
|
themePageCustomCode {
|
|
56
60
|
...CustomCodeSelect
|
|
57
61
|
}
|
|
62
|
+
interaction {
|
|
63
|
+
id
|
|
64
|
+
value
|
|
65
|
+
}
|
|
58
66
|
}
|
|
59
67
|
`;
|
|
60
68
|
|
|
@@ -46,7 +46,7 @@ const animations = ()=>{
|
|
|
46
46
|
});
|
|
47
47
|
return cloneOptions;
|
|
48
48
|
};
|
|
49
|
-
const slide = (target, options)=>{
|
|
49
|
+
const slide = (target, options, reverse)=>{
|
|
50
50
|
const normalizedOptions = normalizeOptions(options);
|
|
51
51
|
const { direction, distance } = normalizedOptions;
|
|
52
52
|
const coordinate = [
|
|
@@ -67,11 +67,11 @@ const animations = ()=>{
|
|
|
67
67
|
transform: `translate${coordinate}(0)`
|
|
68
68
|
}
|
|
69
69
|
];
|
|
70
|
-
return generateAnimationInstance(target, preset, {
|
|
70
|
+
return generateAnimationInstance(target, reverse ? preset.reverse() : preset, {
|
|
71
71
|
...generateOptions(normalizedOptions, 500)
|
|
72
72
|
});
|
|
73
73
|
};
|
|
74
|
-
const fade = (target, options)=>{
|
|
74
|
+
const fade = (target, options, reverse)=>{
|
|
75
75
|
const normalizedOptions = normalizeOptions(options);
|
|
76
76
|
const preset = [
|
|
77
77
|
{
|
|
@@ -81,7 +81,7 @@ const animations = ()=>{
|
|
|
81
81
|
opacity: 1
|
|
82
82
|
}
|
|
83
83
|
];
|
|
84
|
-
return generateAnimationInstance(target, preset, {
|
|
84
|
+
return generateAnimationInstance(target, reverse ? preset.reverse() : preset, {
|
|
85
85
|
...generateOptions(normalizedOptions, 500)
|
|
86
86
|
});
|
|
87
87
|
};
|
|
@@ -101,7 +101,7 @@ const animations = ()=>{
|
|
|
101
101
|
easing: EASING[easing ?? 'linear']
|
|
102
102
|
};
|
|
103
103
|
};
|
|
104
|
-
const zoom = (target, options)=>{
|
|
104
|
+
const zoom = (target, options, reverse)=>{
|
|
105
105
|
const normalizedOptions = normalizeOptions(options);
|
|
106
106
|
const { scale, zoomDirection, isFade } = normalizedOptions;
|
|
107
107
|
const [i1, i2] = scale.in;
|
|
@@ -127,7 +127,7 @@ const animations = ()=>{
|
|
|
127
127
|
}
|
|
128
128
|
];
|
|
129
129
|
const zoomPreset = zoomDirection === 'in' ? zoomInPreset : zoomOutPreset;
|
|
130
|
-
return generateAnimationInstance(target, zoomPreset, {
|
|
130
|
+
return generateAnimationInstance(target, reverse ? zoomPreset.reverse() : zoomPreset, {
|
|
131
131
|
...generateOptions(normalizedOptions, 700)
|
|
132
132
|
});
|
|
133
133
|
};
|
|
@@ -121,7 +121,7 @@ const getBgAttachmentByDevice = (background, device)=>{
|
|
|
121
121
|
return background?.[device]?.attachment;
|
|
122
122
|
};
|
|
123
123
|
const composeBackgroundCss = (backgroundColor)=>{
|
|
124
|
-
return `${backgroundColor ? `background-color: ${colors.getSingleColorVariable(backgroundColor)}
|
|
124
|
+
return `${backgroundColor ? `background-color: ${colors.getSingleColorVariable(backgroundColor)};` : undefined}`;
|
|
125
125
|
};
|
|
126
126
|
const makeFixedBgAttachment = (background)=>{
|
|
127
127
|
if (!background) return;
|
|
@@ -101,6 +101,9 @@ function composeAdvanceStyle(data, tag, pageType) {
|
|
|
101
101
|
if (attr === 'rounded') {
|
|
102
102
|
Object.assign(styles, radius.composeRadius(value));
|
|
103
103
|
}
|
|
104
|
+
if (attr === 'boxShadow') {
|
|
105
|
+
Object.assign(styles, shadow.getResonsiveStyleShadow(value, 'box-shadow', hasBoxShadow));
|
|
106
|
+
}
|
|
104
107
|
if (composeAttr === 'desktop') {
|
|
105
108
|
switch(attr){
|
|
106
109
|
case 'padding':
|
|
@@ -215,20 +218,20 @@ function composeAdvanceStyle(data, tag, pageType) {
|
|
|
215
218
|
}));
|
|
216
219
|
}
|
|
217
220
|
}
|
|
218
|
-
if (attr === 'blockPadding' && pageType ===
|
|
221
|
+
if (attr === 'blockPadding' && pageType === 'POST_PURCHASE') {
|
|
219
222
|
const valueMapped = postPurchasePaddingMapping[value];
|
|
220
223
|
styles[`--pb`] = getAttrValue(attr, valueMapped, tag);
|
|
221
224
|
styles[`--pt`] = getAttrValue(attr, valueMapped, tag);
|
|
222
225
|
styles[`--mb`] = '0px';
|
|
223
226
|
styles[`--mt`] = '0px';
|
|
224
227
|
}
|
|
225
|
-
if (attr === 'inlinePadding' && pageType ===
|
|
228
|
+
if (attr === 'inlinePadding' && pageType === 'POST_PURCHASE') {
|
|
226
229
|
const valueMapped = postPurchasePaddingMapping[value];
|
|
227
230
|
styles[`--pl`] = getAttrValue(attr, valueMapped, tag);
|
|
228
231
|
styles[`--pr`] = getAttrValue(attr, valueMapped, tag);
|
|
229
232
|
}
|
|
230
233
|
});
|
|
231
|
-
const advancedPostPurchaseStyles = pageType ===
|
|
234
|
+
const advancedPostPurchaseStyles = pageType === 'POST_PURCHASE' ? composeAdvanceStyleForPostPurchase(data, tag) : {};
|
|
232
235
|
return {
|
|
233
236
|
...styles,
|
|
234
237
|
...advancedPostPurchaseStyles
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const useInteraction = ()=>{
|
|
4
|
+
const onListener = ({ event, selector }, callback)=>{
|
|
5
|
+
const element = document.querySelector(selector);
|
|
6
|
+
if (!element) return;
|
|
7
|
+
element.addEventListener(event, (e)=>{
|
|
8
|
+
const event = e;
|
|
9
|
+
const params = event.detail;
|
|
10
|
+
if (callback) callback(params);
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
const trigger = ({ event, data, selector })=>{
|
|
14
|
+
const element = document.querySelector(selector);
|
|
15
|
+
if (!element) return;
|
|
16
|
+
const eventDispatch = new CustomEvent(event, {
|
|
17
|
+
bubbles: false,
|
|
18
|
+
cancelable: true,
|
|
19
|
+
detail: {
|
|
20
|
+
data
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
element.dispatchEvent(eventDispatch);
|
|
24
|
+
};
|
|
25
|
+
const saveToElementInteractionData = (element, key, value)=>{
|
|
26
|
+
const interactionData = element.getAttribute('gp-data-interaction');
|
|
27
|
+
const interactionDataJson = JSON.parse(interactionData || '{}');
|
|
28
|
+
element.setAttribute('gp-data-interaction', JSON.stringify({
|
|
29
|
+
...interactionDataJson,
|
|
30
|
+
[key]: value
|
|
31
|
+
}));
|
|
32
|
+
};
|
|
33
|
+
return {
|
|
34
|
+
onListener,
|
|
35
|
+
trigger,
|
|
36
|
+
saveToElementInteractionData
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
exports.useInteraction = useInteraction;
|
|
@@ -36,7 +36,7 @@ const getProduct = async (fetcher, { id, isSample, isStorefront })=>{
|
|
|
36
36
|
};
|
|
37
37
|
};
|
|
38
38
|
const orderBy = {
|
|
39
|
-
field: '
|
|
39
|
+
field: 'PLATFORM_CREATED_AT',
|
|
40
40
|
direction: 'DESC'
|
|
41
41
|
};
|
|
42
42
|
const fetchProduct = async (fetcher, { id, isSample, isStorefront })=>{
|
|
@@ -27,10 +27,10 @@ const getStyleShadow = (shadowStyle, isActiveState = false)=>{
|
|
|
27
27
|
if (typeof value.distance == 'undefined') return {};
|
|
28
28
|
const { value: distance, unit: unitDistance } = parseValueWithUnit(`${value?.distance}`);
|
|
29
29
|
return {
|
|
30
|
-
[`-${!isActiveState ? constant.stateMapping?.[state] || '' : ''}-${getShortname.getShortName(styleAppliedFor)}`]: isEnableShadow ? `${Math.cos(parseFloat(`${value?.angle}`) * Math.PI / 180) * parseFloat(`${distance}`)}${unitDistance} ${Math.sin(parseFloat(`${value?.angle}`) * Math.PI / 180) * parseFloat(`${distance}`)}${unitDistance} ${value?.blur} ${styleAppliedFor === 'box-shadow' ? value?.spread + ' ' : ''}${colors.getSingleColorVariable(value?.color)}` : 'none'
|
|
30
|
+
[`-${!isActiveState ? constant.stateMapping?.[state] || '' : ''}-${getShortname.getShortName(styleAppliedFor)}${shadowStyle.screen ? `-${shadowStyle.screen}` : ''}`]: isEnableShadow ? `${Math.cos(parseFloat(`${value?.angle}`) * Math.PI / 180) * parseFloat(`${distance}`)}${unitDistance} ${Math.sin(parseFloat(`${value?.angle}`) * Math.PI / 180) * parseFloat(`${distance}`)}${unitDistance} ${value?.blur} ${styleAppliedFor === 'box-shadow' ? value?.spread + ' ' : ''}${colors.getSingleColorVariable(value?.color)}` : 'none'
|
|
31
31
|
};
|
|
32
32
|
};
|
|
33
|
-
const getStyleShadowState = (shadow, styleAppliedFor, isEnableShadow)=>{
|
|
33
|
+
const getStyleShadowState = (shadow, styleAppliedFor, isEnableShadow, screen)=>{
|
|
34
34
|
if (!shadow || !styleAppliedFor) return {};
|
|
35
35
|
const style = {};
|
|
36
36
|
for (const [key, value] of Object.entries(shadow)){
|
|
@@ -38,11 +38,22 @@ const getStyleShadowState = (shadow, styleAppliedFor, isEnableShadow)=>{
|
|
|
38
38
|
value: value,
|
|
39
39
|
state: key,
|
|
40
40
|
styleAppliedFor,
|
|
41
|
-
isEnableShadow: isEnableShadow?.[key]
|
|
41
|
+
isEnableShadow: isEnableShadow?.[key],
|
|
42
|
+
screen: screen ?? ''
|
|
42
43
|
}));
|
|
43
44
|
}
|
|
44
45
|
return style;
|
|
45
46
|
};
|
|
47
|
+
const getResonsiveStyleShadow = (value, styleAppliedFor, isEnableShadow)=>{
|
|
48
|
+
if (!value) return undefined;
|
|
49
|
+
if ('desktop' in value || 'tablet' in value || 'mobile' in value) {
|
|
50
|
+
return {
|
|
51
|
+
...getStyleShadowState(value.desktop, styleAppliedFor, isEnableShadow.desktop),
|
|
52
|
+
...value.tablet && (isEnableShadow.tablet ?? isEnableShadow.desktop) ? getStyleShadowState(value.tablet, styleAppliedFor, isEnableShadow.tablet ?? isEnableShadow.desktop, 'tablet') : undefined,
|
|
53
|
+
...value.mobile && (isEnableShadow.mobile ?? isEnableShadow.tablet ?? isEnableShadow.desktop) ? getStyleShadowState(value.mobile, styleAppliedFor, isEnableShadow.mobile ?? isEnableShadow.tablet ?? isEnableShadow.desktop, 'mobile') : undefined
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
};
|
|
46
57
|
const composeShadowCss = ({ hasBoxShadow, boxShadowValue, important })=>{
|
|
47
58
|
if (!hasBoxShadow) return undefined;
|
|
48
59
|
if (!boxShadowValue) return undefined;
|
|
@@ -52,6 +63,7 @@ const composeShadowCss = ({ hasBoxShadow, boxShadowValue, important })=>{
|
|
|
52
63
|
};
|
|
53
64
|
|
|
54
65
|
exports.composeShadowCss = composeShadowCss;
|
|
66
|
+
exports.getResonsiveStyleShadow = getResonsiveStyleShadow;
|
|
55
67
|
exports.getStyleShadow = getStyleShadow;
|
|
56
68
|
exports.getStyleShadowState = getStyleShadowState;
|
|
57
69
|
exports.parseValueWithUnit = parseValueWithUnit;
|
|
@@ -72,16 +72,72 @@ const FastBundleBundlesDiscountsConfig = {
|
|
|
72
72
|
appId: '9e87fbe2-9041-4c23-acf5-322413994cef'
|
|
73
73
|
}
|
|
74
74
|
};
|
|
75
|
+
const SimpleBundlesKitsConfig = {
|
|
76
|
+
SimpleBundlesKits: {
|
|
77
|
+
appName: 'simple-bundles-kits',
|
|
78
|
+
appId: 'e553276b-36b2-446d-b80a-aa47fe5f96ac'
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
const EasyBundleBuilderSkailamaConfig = {
|
|
82
|
+
EasyBundleBuilderSkailama: {
|
|
83
|
+
appName: 'easy-bundles',
|
|
84
|
+
appId: '05b1325c-6303-4da5-8e2f-b13ab2a50e1a'
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
const AssortionUpsellBundlesConfig = {
|
|
88
|
+
AssortionUpsellBundles: {
|
|
89
|
+
appName: 'assortion',
|
|
90
|
+
appId: '5588d7f9-a5bc-4f4a-9c54-39b7e081dd23'
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
const PreorderNowPreOrderPqConfig = {
|
|
94
|
+
PreorderNowPreOrderPq: {
|
|
95
|
+
appName: 'preorder-now-pre-order-pq',
|
|
96
|
+
appId: '551fab2c-3af6-4a8f-ba21-736a71cb4540'
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
const KPreorderNowPartialPaymentConfig = {
|
|
100
|
+
KPreorderNowPartialPayment: {
|
|
101
|
+
appName: 'k-preorder-now-partial-payment',
|
|
102
|
+
appId: '65705a60-a3b0-43ae-9dc8-15db78d76b3b'
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
const FlyBundlesUpsellsFbtConfig = {
|
|
106
|
+
FlyBundlesUpsellsFbt: {
|
|
107
|
+
appName: 'fly-bundles-upsell',
|
|
108
|
+
appId: '26807bdc-c2ed-4a25-afb2-06e6b1ebf843'
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
const PreorderNowWodPresaleConfig = {
|
|
112
|
+
PreorderNowWodPresale: {
|
|
113
|
+
appName: 'preorder-now-wod-presale',
|
|
114
|
+
appId: 'fdf17d17-ef12-4a7b-8383-20cc1fc2a4b6'
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
const JunipProductReviewsUgcConfig = {
|
|
118
|
+
JunipProductReviewsUgc: {
|
|
119
|
+
appName: 'junip-product-reviews-ugc',
|
|
120
|
+
appId: 'dc14f5a8-ed15-41b1-ad08-cfba23f9789b'
|
|
121
|
+
}
|
|
122
|
+
};
|
|
75
123
|
|
|
124
|
+
exports.AssortionUpsellBundlesConfig = AssortionUpsellBundlesConfig;
|
|
76
125
|
exports.BonLoyaltyRewardsReferralsConfig = BonLoyaltyRewardsReferralsConfig;
|
|
126
|
+
exports.EasyBundleBuilderSkailamaConfig = EasyBundleBuilderSkailamaConfig;
|
|
77
127
|
exports.FastBundleBundlesDiscountsConfig = FastBundleBundlesDiscountsConfig;
|
|
128
|
+
exports.FlyBundlesUpsellsFbtConfig = FlyBundlesUpsellsFbtConfig;
|
|
129
|
+
exports.JunipProductReviewsUgcConfig = JunipProductReviewsUgcConfig;
|
|
130
|
+
exports.KPreorderNowPartialPaymentConfig = KPreorderNowPartialPaymentConfig;
|
|
78
131
|
exports.KiteFreeGiftDiscountConfig = KiteFreeGiftDiscountConfig;
|
|
79
132
|
exports.LoopSubscriptionsConfig = LoopSubscriptionsConfig;
|
|
133
|
+
exports.PreorderNowPreOrderPqConfig = PreorderNowPreOrderPqConfig;
|
|
134
|
+
exports.PreorderNowWodPresaleConfig = PreorderNowWodPresaleConfig;
|
|
80
135
|
exports.PumperBundlesVolumeDiscountConfig = PumperBundlesVolumeDiscountConfig;
|
|
81
136
|
exports.RechargeSubscriptionsConfig = RechargeSubscriptionsConfig;
|
|
82
137
|
exports.ReviewxpoProductReviewsAppConfig = ReviewxpoProductReviewsAppConfig;
|
|
83
138
|
exports.SelleasyConfig = SelleasyConfig;
|
|
84
139
|
exports.ShopifyFormsConfig = ShopifyFormsConfig;
|
|
140
|
+
exports.SimpleBundlesKitsConfig = SimpleBundlesKitsConfig;
|
|
85
141
|
exports.SkioSubscriptionsYcS20Config = SkioSubscriptionsYcS20Config;
|
|
86
142
|
exports.SubifySubscriptionsConfig = SubifySubscriptionsConfig;
|
|
87
143
|
exports.UnlimitedBundlesDiscountsConfig = UnlimitedBundlesDiscountsConfig;
|
|
@@ -81,6 +81,13 @@ const overrideSettings = (tag, currentSetting, appSetting)=>{
|
|
|
81
81
|
...currentSetting,
|
|
82
82
|
form_id: appSetting['formId']
|
|
83
83
|
};
|
|
84
|
+
case 'FlyBundlesUpsellsFbt':
|
|
85
|
+
{
|
|
86
|
+
return {
|
|
87
|
+
...currentSetting,
|
|
88
|
+
bundle_id: appSetting?.['customBundleId']
|
|
89
|
+
};
|
|
90
|
+
}
|
|
84
91
|
default:
|
|
85
92
|
return currentSetting;
|
|
86
93
|
}
|
|
@@ -124,10 +131,96 @@ const FastBundleBundlesDiscounts = {
|
|
|
124
131
|
volume_position: null
|
|
125
132
|
}
|
|
126
133
|
};
|
|
134
|
+
const SimpleBundlesKits = {
|
|
135
|
+
SimpleBundlesKits: {
|
|
136
|
+
'infinite-options-selector': null
|
|
137
|
+
}
|
|
138
|
+
};
|
|
139
|
+
const EasyBundleBuilderSkailama = {
|
|
140
|
+
EasyBundleBuilderSkailama: {
|
|
141
|
+
'app-block-bundlePage': null
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
const AssortionUpsellBundles = {
|
|
145
|
+
AssortionUpsellBundles: {
|
|
146
|
+
volume: null,
|
|
147
|
+
bundle: null,
|
|
148
|
+
addon: null
|
|
149
|
+
}
|
|
150
|
+
};
|
|
151
|
+
const PreorderNowPreOrderPq = {
|
|
152
|
+
PreorderNowPreOrderPq: {
|
|
153
|
+
'app-block-notifyapp-block-notify': null,
|
|
154
|
+
'app-block-partial': null,
|
|
155
|
+
'app-block-timer': null,
|
|
156
|
+
'app-block': null
|
|
157
|
+
}
|
|
158
|
+
};
|
|
159
|
+
const KPreorderNowPartialPayment = {
|
|
160
|
+
KPreorderNowPartialPayment: {
|
|
161
|
+
'kaktus-bundle': null
|
|
162
|
+
}
|
|
163
|
+
};
|
|
164
|
+
const FlyBundlesUpsellsFbt = {
|
|
165
|
+
FlyBundlesUpsellsFbt: {
|
|
166
|
+
'app-block-volume': null,
|
|
167
|
+
'app-block-upsell-block': null,
|
|
168
|
+
'app-block-fbt': null,
|
|
169
|
+
'app-block-custom': {
|
|
170
|
+
bundle_id: ''
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
};
|
|
174
|
+
const PreorderNowWodPresale = {
|
|
175
|
+
PreorderNowWodPresale: {
|
|
176
|
+
'app-block': null,
|
|
177
|
+
'popups-block': null
|
|
178
|
+
}
|
|
179
|
+
};
|
|
180
|
+
const JunipProductReviewsUgc = {
|
|
181
|
+
JunipProductReviewsUgc: {
|
|
182
|
+
'junip-review-carousel': {
|
|
183
|
+
reviewsType: 'product_reviews',
|
|
184
|
+
showSummary: true,
|
|
185
|
+
title: 'Reviews',
|
|
186
|
+
paddingTop: 48,
|
|
187
|
+
paddingBottom: 48,
|
|
188
|
+
containerClass: ''
|
|
189
|
+
},
|
|
190
|
+
'junip-ugc-gallery': {
|
|
191
|
+
layout: 'scroll',
|
|
192
|
+
title: '',
|
|
193
|
+
paddingTop: 48,
|
|
194
|
+
paddingBottom: 48,
|
|
195
|
+
containerClass: ''
|
|
196
|
+
},
|
|
197
|
+
'junip-product-review': {
|
|
198
|
+
product: '{{product}}'
|
|
199
|
+
},
|
|
200
|
+
'junip-product-summary': {
|
|
201
|
+
product: '{{product}}'
|
|
202
|
+
},
|
|
203
|
+
'junip-reviews': {
|
|
204
|
+
layout: 'list',
|
|
205
|
+
reviewsType: 'all',
|
|
206
|
+
showSummary: true,
|
|
207
|
+
reviewsCount: 10,
|
|
208
|
+
containerClass: ''
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
};
|
|
127
212
|
const composeSettingsByWidgetType = {
|
|
213
|
+
...JunipProductReviewsUgc,
|
|
214
|
+
...FlyBundlesUpsellsFbt,
|
|
215
|
+
...PreorderNowWodPresale,
|
|
216
|
+
...KPreorderNowPartialPayment,
|
|
217
|
+
...PreorderNowPreOrderPq,
|
|
218
|
+
...AssortionUpsellBundles,
|
|
219
|
+
...EasyBundleBuilderSkailama,
|
|
128
220
|
...FastBundleBundlesDiscounts,
|
|
129
221
|
...KiteFreeGiftDiscount,
|
|
130
222
|
...UnlimitedBundlesDiscounts,
|
|
223
|
+
...SimpleBundlesKits,
|
|
131
224
|
...PumperBundlesVolumeDiscount,
|
|
132
225
|
...ReviewxpoProductReviewsApp,
|
|
133
226
|
...ShopifyForms,
|
|
@@ -14,7 +14,15 @@ const mapShopifyAppMeta = {
|
|
|
14
14
|
...appConfig.PumperBundlesVolumeDiscountConfig,
|
|
15
15
|
...appConfig.UnlimitedBundlesDiscountsConfig,
|
|
16
16
|
...appConfig.KiteFreeGiftDiscountConfig,
|
|
17
|
-
...appConfig.FastBundleBundlesDiscountsConfig
|
|
17
|
+
...appConfig.FastBundleBundlesDiscountsConfig,
|
|
18
|
+
...appConfig.SimpleBundlesKitsConfig,
|
|
19
|
+
...appConfig.EasyBundleBuilderSkailamaConfig,
|
|
20
|
+
...appConfig.AssortionUpsellBundlesConfig,
|
|
21
|
+
...appConfig.PreorderNowPreOrderPqConfig,
|
|
22
|
+
...appConfig.KPreorderNowPartialPaymentConfig,
|
|
23
|
+
...appConfig.FlyBundlesUpsellsFbtConfig,
|
|
24
|
+
...appConfig.PreorderNowWodPresaleConfig,
|
|
25
|
+
...appConfig.JunipProductReviewsUgcConfig
|
|
18
26
|
};
|
|
19
27
|
const THIRD_PARTY_APP_BLOCK_ID_PREFIX = 'gp_app';
|
|
20
28
|
|
|
@@ -76,8 +76,10 @@ const composeTypographyV2 = (value, attrs)=>{
|
|
|
76
76
|
});
|
|
77
77
|
};
|
|
78
78
|
const composeFontFamilyTypographyV2 = (value)=>{
|
|
79
|
-
const fontFamily = value
|
|
80
|
-
if (!fontFamily)
|
|
79
|
+
const { fontFamily, isCustom, fallbackFontFamily } = value || {};
|
|
80
|
+
if (!fontFamily) {
|
|
81
|
+
return isCustom ? fallbackFontFamily : undefined;
|
|
82
|
+
}
|
|
81
83
|
if (typeof fontFamily === 'string') {
|
|
82
84
|
return getFontUsedByTypographyV2({
|
|
83
85
|
fontFamily,
|
|
@@ -116,18 +118,10 @@ const composeTypographyAttr = (attrs)=>{
|
|
|
116
118
|
});
|
|
117
119
|
};
|
|
118
120
|
const composeTypographyClassName = (typo, typography)=>{
|
|
119
|
-
return typo ? typo?.type && !typo.custom ? genTypoClass(typo.type) : '' : typography?.type && genTypoClass(typography?.type);
|
|
121
|
+
return typo ? typo?.type && !isCustomTypo(typo.custom) ? genTypoClass(typo.type) : '' : typography?.type && genTypoClass(typography?.type);
|
|
120
122
|
};
|
|
121
123
|
const composeFallbackTypographyStyle = (tag)=>{
|
|
122
|
-
if (
|
|
123
|
-
'heading',
|
|
124
|
-
'heading-1',
|
|
125
|
-
'heading-2',
|
|
126
|
-
'heading-3',
|
|
127
|
-
'heading-4',
|
|
128
|
-
'heading-5',
|
|
129
|
-
'heading-6'
|
|
130
|
-
].includes(tag)) {
|
|
124
|
+
if (tag.toLocaleLowerCase().includes('heading')) {
|
|
131
125
|
return 'var(--g-font-heading, heading)';
|
|
132
126
|
}
|
|
133
127
|
return 'var(--g-font-body, body)';
|
|
@@ -137,7 +131,8 @@ const composeTypographyStyle = (typo, typography, disableAttr)=>{
|
|
|
137
131
|
const fallbackFontFamily = composeFallbackTypographyStyle(typo.type ?? 'heading');
|
|
138
132
|
const customTypo = {
|
|
139
133
|
...typo.custom,
|
|
140
|
-
fallbackFontFamily: fallbackFontFamily
|
|
134
|
+
fallbackFontFamily: fallbackFontFamily,
|
|
135
|
+
isCustom: isCustomTypo(typo.custom)
|
|
141
136
|
};
|
|
142
137
|
return {
|
|
143
138
|
...composeTypographyV2(customTypo, typo.attrs),
|
|
@@ -148,6 +143,13 @@ const composeTypographyStyle = (typo, typography, disableAttr)=>{
|
|
|
148
143
|
...!typography?.type ? composeTypography(typography?.custom) : {}
|
|
149
144
|
};
|
|
150
145
|
};
|
|
146
|
+
const isCustomTypo = (customTypo)=>{
|
|
147
|
+
return customTypo && Object.keys(customTypo).length > 1 || customTypo && Object.keys(customTypo).length === 1 && !customTypo.fontSize;
|
|
148
|
+
};
|
|
149
|
+
const getSeoTagFromTypo = (typo)=>{
|
|
150
|
+
if (!typo?.attrs?.seoTagValue) return 'div';
|
|
151
|
+
return typo?.attrs?.seoTagValue;
|
|
152
|
+
};
|
|
151
153
|
|
|
152
154
|
exports.composeFallbackTypographyStyle = composeFallbackTypographyStyle;
|
|
153
155
|
exports.composeFontFamilyTypographyV2 = composeFontFamilyTypographyV2;
|
|
@@ -159,3 +161,4 @@ exports.composeTypographyStyle = composeTypographyStyle;
|
|
|
159
161
|
exports.composeTypographyV2 = composeTypographyV2;
|
|
160
162
|
exports.composeTypographyV2Css = composeTypographyV2Css;
|
|
161
163
|
exports.genTypoClass = genTypoClass;
|
|
164
|
+
exports.getSeoTagFromTypo = getSeoTagFromTypo;
|
package/dist/cjs/index.js
CHANGED
|
@@ -108,6 +108,7 @@ var getProduct = require('./helpers/queries/get-product.js');
|
|
|
108
108
|
var getProductBySlug = require('./helpers/queries/get-product-by-slug.js');
|
|
109
109
|
var getAppBlocks = require('./helpers/third-party/getAppBlocks.js');
|
|
110
110
|
var addAppBlockId = require('./helpers/third-party/addAppBlockId.js');
|
|
111
|
+
var index = require('./helpers/interaction/index.js');
|
|
111
112
|
|
|
112
113
|
|
|
113
114
|
|
|
@@ -267,6 +268,7 @@ exports.removeUndefinedValuesFromObject = render.removeUndefinedValuesFromObject
|
|
|
267
268
|
exports.styles = render.styles;
|
|
268
269
|
exports.template = render.template;
|
|
269
270
|
exports.composeShadowCss = shadow.composeShadowCss;
|
|
271
|
+
exports.getResonsiveStyleShadow = shadow.getResonsiveStyleShadow;
|
|
270
272
|
exports.getStyleShadow = shadow.getStyleShadow;
|
|
271
273
|
exports.getStyleShadowState = shadow.getStyleShadowState;
|
|
272
274
|
exports.parseValueWithUnit = shadow.parseValueWithUnit;
|
|
@@ -293,6 +295,7 @@ exports.composeTypographyStyle = typography.composeTypographyStyle;
|
|
|
293
295
|
exports.composeTypographyV2 = typography.composeTypographyV2;
|
|
294
296
|
exports.composeTypographyV2Css = typography.composeTypographyV2Css;
|
|
295
297
|
exports.genTypoClass = typography.genTypoClass;
|
|
298
|
+
exports.getSeoTagFromTypo = typography.getSeoTagFromTypo;
|
|
296
299
|
exports.useAddToCart = useAddToCart.useAddToCart;
|
|
297
300
|
exports.useCartData = useCartData.useCartData;
|
|
298
301
|
exports.useCartDiscountCodesUpdate = useCartDiscountCodesUpdate.useCartDiscountCodesUpdate;
|
|
@@ -403,3 +406,4 @@ exports.getProduct = getProduct.getProduct;
|
|
|
403
406
|
exports.getProductBySlug = getProductBySlug.getProductBySlug;
|
|
404
407
|
exports.getAppBlocks = getAppBlocks.getAppBlocks;
|
|
405
408
|
exports.addAppBlockId = addAppBlockId.addAppBlockId;
|
|
409
|
+
exports.useInteraction = index.useInteraction;
|
|
@@ -32,6 +32,8 @@ exports.AnimationTriggerType = void 0;
|
|
|
32
32
|
(function(AnimationTriggerType) {
|
|
33
33
|
AnimationTriggerType["Appear"] = 'appear';
|
|
34
34
|
AnimationTriggerType["Hover"] = 'hover';
|
|
35
|
+
AnimationTriggerType["Hidden"] = 'hidden';
|
|
36
|
+
AnimationTriggerType["AppearByTrigger"] = 'appearByTrigger';
|
|
35
37
|
})(exports.AnimationTriggerType || (exports.AnimationTriggerType = {}));
|
|
36
38
|
exports.AnimationZoomDirectionType = void 0;
|
|
37
39
|
(function(AnimationZoomDirectionType) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
|
2
2
|
import { useMemo } from 'react';
|
|
3
3
|
import 'zustand';
|
|
4
4
|
import 'swr';
|
|
@@ -44,7 +44,7 @@ const InteractionSuffix = ({ tag, uid })=>{
|
|
|
44
44
|
isCurrentInteractionTarget
|
|
45
45
|
]);
|
|
46
46
|
if (!isDisplay) {
|
|
47
|
-
return
|
|
47
|
+
return /*#__PURE__*/ jsx(Fragment, {});
|
|
48
48
|
}
|
|
49
49
|
return /*#__PURE__*/ jsxs(Fragment, {
|
|
50
50
|
children: [
|
|
@@ -55,7 +55,11 @@ const Render = ({ uid, builder, components, parentId, extraFiles = {}, pageConte
|
|
|
55
55
|
const customProps = {
|
|
56
56
|
extraFiles: {}
|
|
57
57
|
};
|
|
58
|
-
const
|
|
58
|
+
const d = item.advanced?.displayInitInteraction ?? item.advanced?.d;
|
|
59
|
+
const style = composeAdvanceStyle({
|
|
60
|
+
...item.advanced,
|
|
61
|
+
d
|
|
62
|
+
}, item.tag);
|
|
59
63
|
let liquid = '';
|
|
60
64
|
if (disableWrap.includes(item.tag)) {
|
|
61
65
|
liquid = RenderIf(item?.childrens?.length, ()=>{
|
|
@@ -215,7 +219,7 @@ const RenderCustomCode = (item)=>{
|
|
|
215
219
|
};
|
|
216
220
|
const appendAnimation = (props, liquid)=>{
|
|
217
221
|
const { advanced, tag } = props;
|
|
218
|
-
const { animation, op: opacity } = advanced ?? {};
|
|
222
|
+
const { animation, op: opacity, hasAnimationInteraction } = advanced ?? {};
|
|
219
223
|
const getAnimationType = (settings, type)=>{
|
|
220
224
|
return settings?.triggerConfig?.[type]?.animation ?? 'none';
|
|
221
225
|
};
|
|
@@ -229,7 +233,9 @@ const appendAnimation = (props, liquid)=>{
|
|
|
229
233
|
const hoverDesktop = getAnimationType(getSettingsByDevice('desktop'), 'hover');
|
|
230
234
|
const appearTablet = getAnimationType(getSettingsByDevice('tablet'), 'appear');
|
|
231
235
|
const appearMobile = getAnimationType(getSettingsByDevice('mobile'), 'appear');
|
|
232
|
-
const enableAnimation = animation?.desktop?.enabled && (appearDesktop !== 'none' || hoverDesktop !== 'none') || animation?.tablet?.enabled && appearTablet !== 'none' || animation?.mobile?.enabled && appearMobile !== 'none';
|
|
236
|
+
const enableAnimation = animation?.desktop?.enabled && (appearDesktop !== 'none' || hoverDesktop !== 'none') || animation?.tablet?.enabled && appearTablet !== 'none' || animation?.mobile?.enabled && appearMobile !== 'none' || !!hasAnimationInteraction;
|
|
237
|
+
const enableAnimationWhenInit = animation?.desktop?.enabled && (appearDesktop !== 'none' || hoverDesktop !== 'none') || animation?.tablet?.enabled && appearTablet !== 'none' || animation?.mobile?.enabled && appearMobile !== 'none';
|
|
238
|
+
if (!enableAnimation) return liquid;
|
|
233
239
|
const getInitVisibility = (device)=>getSettingsByDevice(device)?.enabled && ![
|
|
234
240
|
'shake',
|
|
235
241
|
'none'
|
|
@@ -245,7 +251,7 @@ const appendAnimation = (props, liquid)=>{
|
|
|
245
251
|
config: animation,
|
|
246
252
|
tag,
|
|
247
253
|
opacity,
|
|
248
|
-
|
|
254
|
+
notEnableAnimationWhenInit: !enableAnimationWhenInit
|
|
249
255
|
})}'
|
|
250
256
|
style="${{
|
|
251
257
|
display: 'contents'
|