@gem-sdk/core 1.56.0 → 1.57.0-dev.45
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/ComponentToolbarPreview.js +181 -107
- package/dist/cjs/components/ComponentWrapper.js +16 -1
- package/dist/cjs/components/ComponentWrapperPreview.js +16 -2
- package/dist/cjs/components/InteractionSuffix.js +42 -0
- package/dist/cjs/components/Render.liquid.js +22 -7
- package/dist/cjs/contexts/PageContext.js +42 -1
- package/dist/cjs/contexts/ProductContext.js +10 -0
- package/dist/cjs/graphql/fragments/published-theme-page.generated.js +4 -0
- package/dist/cjs/helpers/animations.js +17 -8
- package/dist/cjs/helpers/background.js +10 -5
- package/dist/cjs/helpers/compose-advance-style.js +30 -4
- package/dist/cjs/helpers/interaction/index.js +110 -0
- package/dist/cjs/helpers/radius.js +11 -1
- package/dist/cjs/helpers/shadow.js +5 -4
- package/dist/cjs/helpers/third-party/appConfig.js +56 -0
- package/dist/cjs/helpers/third-party/appSetting.js +207 -60
- package/dist/cjs/helpers/third-party/constant.js +9 -1
- package/dist/cjs/helpers/third-party/getAppBlockConfig.js +8 -1
- package/dist/cjs/hooks/animation/useAnimationConfig.js +2 -1
- package/dist/cjs/hooks/animation/useAnimationTarget.js +5 -2
- package/dist/cjs/hooks/animation/useApplyAnimation.js +6 -4
- package/dist/cjs/hooks/useInteraction.js +19 -0
- package/dist/cjs/hooks/useToolbarPostPurchase.js +2 -2
- package/dist/cjs/index.js +14 -1
- package/dist/cjs/types/animations.js +2 -0
- package/dist/cjs/types/custom.js +52 -0
- package/dist/esm/components/ComponentToolbarPreview.js +181 -107
- package/dist/esm/components/ComponentWrapper.js +16 -1
- package/dist/esm/components/ComponentWrapperPreview.js +16 -2
- package/dist/esm/components/InteractionSuffix.js +40 -0
- package/dist/esm/components/Render.liquid.js +22 -7
- package/dist/esm/contexts/PageContext.js +42 -1
- package/dist/esm/contexts/ProductContext.js +10 -0
- package/dist/esm/graphql/fragments/published-theme-page.generated.js +4 -0
- package/dist/esm/helpers/animations.js +17 -8
- package/dist/esm/helpers/background.js +10 -5
- package/dist/esm/helpers/compose-advance-style.js +31 -5
- package/dist/esm/helpers/interaction/index.js +108 -0
- package/dist/esm/helpers/radius.js +11 -1
- package/dist/esm/helpers/shadow.js +5 -4
- package/dist/esm/helpers/third-party/appConfig.js +49 -1
- package/dist/esm/helpers/third-party/appSetting.js +207 -60
- package/dist/esm/helpers/third-party/constant.js +10 -2
- package/dist/esm/helpers/third-party/getAppBlockConfig.js +8 -1
- package/dist/esm/hooks/animation/useAnimationConfig.js +2 -1
- package/dist/esm/hooks/animation/useAnimationTarget.js +5 -2
- package/dist/esm/hooks/animation/useApplyAnimation.js +6 -4
- package/dist/esm/hooks/useInteraction.js +17 -0
- package/dist/esm/hooks/useToolbarPostPurchase.js +2 -2
- package/dist/esm/index.js +4 -1
- package/dist/esm/types/animations.js +2 -0
- package/dist/esm/types/custom.js +52 -0
- package/dist/types/index.d.ts +548 -185
- package/package.json +3 -3
|
@@ -31,6 +31,44 @@ const createPageStoreProvider = (data)=>zustand.createStore((set)=>({
|
|
|
31
31
|
set({
|
|
32
32
|
publicStoreFrontData: publicStoreFrontData
|
|
33
33
|
});
|
|
34
|
+
},
|
|
35
|
+
setInteractionIsSelectOnPage: (value)=>{
|
|
36
|
+
set((state)=>({
|
|
37
|
+
interactionData: {
|
|
38
|
+
...state.interactionData,
|
|
39
|
+
isSelectOnPage: value
|
|
40
|
+
}
|
|
41
|
+
}));
|
|
42
|
+
},
|
|
43
|
+
setInteractionItem: (item)=>{
|
|
44
|
+
set((state)=>({
|
|
45
|
+
interactionData: {
|
|
46
|
+
...state.interactionData,
|
|
47
|
+
item,
|
|
48
|
+
isSelectOnPage: state.interactionData?.isSelectOnPage || false
|
|
49
|
+
}
|
|
50
|
+
}));
|
|
51
|
+
},
|
|
52
|
+
setInteractionSelectType: (selectType)=>{
|
|
53
|
+
set((state)=>({
|
|
54
|
+
interactionData: {
|
|
55
|
+
...state.interactionData,
|
|
56
|
+
selectType
|
|
57
|
+
}
|
|
58
|
+
}));
|
|
59
|
+
},
|
|
60
|
+
setInteractionSettingType: (settingType)=>{
|
|
61
|
+
set((state)=>({
|
|
62
|
+
interactionData: {
|
|
63
|
+
...state.interactionData,
|
|
64
|
+
settingType
|
|
65
|
+
}
|
|
66
|
+
}));
|
|
67
|
+
},
|
|
68
|
+
setSidebarMode: (mode)=>{
|
|
69
|
+
set(()=>({
|
|
70
|
+
sidebarMode: mode
|
|
71
|
+
}));
|
|
34
72
|
}
|
|
35
73
|
}));
|
|
36
74
|
const PageProvider = ({ children, dynamicProduct, dynamicCollection, productOffers, publicStoreFrontData, ...passProps })=>{
|
|
@@ -38,7 +76,10 @@ const PageProvider = ({ children, dynamicProduct, dynamicCollection, productOffe
|
|
|
38
76
|
dynamicProduct,
|
|
39
77
|
dynamicCollection,
|
|
40
78
|
productOffers,
|
|
41
|
-
publicStoreFrontData
|
|
79
|
+
publicStoreFrontData,
|
|
80
|
+
interactionData: {
|
|
81
|
+
selectType: 'ELEMENT'
|
|
82
|
+
}
|
|
42
83
|
}), [
|
|
43
84
|
dynamicProduct,
|
|
44
85
|
dynamicCollection,
|
|
@@ -25,6 +25,16 @@ const createProductStoreProvider = (data)=>zustand.createStore((set, get)=>({
|
|
|
25
25
|
};
|
|
26
26
|
});
|
|
27
27
|
},
|
|
28
|
+
setShouldRequireUploadMessage: (value)=>{
|
|
29
|
+
set({
|
|
30
|
+
shouldRequireUploadMessage: value
|
|
31
|
+
});
|
|
32
|
+
},
|
|
33
|
+
setRequireUpload: (value)=>{
|
|
34
|
+
set({
|
|
35
|
+
requireUpload: value
|
|
36
|
+
});
|
|
37
|
+
},
|
|
28
38
|
addProperty: (data)=>{
|
|
29
39
|
const properties = get().properties;
|
|
30
40
|
if (!properties?.some((v)=>v.key === data.key)) {
|
|
@@ -46,17 +46,23 @@ 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 = [
|
|
53
53
|
'left',
|
|
54
54
|
'right'
|
|
55
55
|
].includes(direction ?? '') ? 'X' : 'Y';
|
|
56
|
-
|
|
56
|
+
let isNeg = [
|
|
57
57
|
'left',
|
|
58
58
|
'down'
|
|
59
59
|
].includes(direction ?? '') ? '-' : '';
|
|
60
|
+
if (reverse) {
|
|
61
|
+
isNeg = [
|
|
62
|
+
'left',
|
|
63
|
+
'down'
|
|
64
|
+
].includes(direction ?? '') ? '' : '-';
|
|
65
|
+
}
|
|
60
66
|
const preset = [
|
|
61
67
|
{
|
|
62
68
|
opacity: 0,
|
|
@@ -67,11 +73,11 @@ const animations = ()=>{
|
|
|
67
73
|
transform: `translate${coordinate}(0)`
|
|
68
74
|
}
|
|
69
75
|
];
|
|
70
|
-
return generateAnimationInstance(target, preset, {
|
|
76
|
+
return generateAnimationInstance(target, reverse ? preset.reverse() : preset, {
|
|
71
77
|
...generateOptions(normalizedOptions, 500)
|
|
72
78
|
});
|
|
73
79
|
};
|
|
74
|
-
const fade = (target, options)=>{
|
|
80
|
+
const fade = (target, options, reverse)=>{
|
|
75
81
|
const normalizedOptions = normalizeOptions(options);
|
|
76
82
|
const preset = [
|
|
77
83
|
{
|
|
@@ -81,7 +87,7 @@ const animations = ()=>{
|
|
|
81
87
|
opacity: 1
|
|
82
88
|
}
|
|
83
89
|
];
|
|
84
|
-
return generateAnimationInstance(target, preset, {
|
|
90
|
+
return generateAnimationInstance(target, reverse ? preset.reverse() : preset, {
|
|
85
91
|
...generateOptions(normalizedOptions, 500)
|
|
86
92
|
});
|
|
87
93
|
};
|
|
@@ -101,7 +107,7 @@ const animations = ()=>{
|
|
|
101
107
|
easing: EASING[easing ?? 'linear']
|
|
102
108
|
};
|
|
103
109
|
};
|
|
104
|
-
const zoom = (target, options)=>{
|
|
110
|
+
const zoom = (target, options, reverse)=>{
|
|
105
111
|
const normalizedOptions = normalizeOptions(options);
|
|
106
112
|
const { scale, zoomDirection, isFade } = normalizedOptions;
|
|
107
113
|
const [i1, i2] = scale.in;
|
|
@@ -126,8 +132,11 @@ const animations = ()=>{
|
|
|
126
132
|
opacity: 1
|
|
127
133
|
}
|
|
128
134
|
];
|
|
129
|
-
|
|
130
|
-
|
|
135
|
+
let zoomPreset = zoomDirection === 'in' ? zoomInPreset : zoomOutPreset;
|
|
136
|
+
if (reverse) {
|
|
137
|
+
zoomPreset = zoomDirection === 'in' ? zoomOutPreset : zoomInPreset;
|
|
138
|
+
}
|
|
139
|
+
return generateAnimationInstance(target, reverse ? zoomPreset.reverse() : zoomPreset, {
|
|
131
140
|
...generateOptions(normalizedOptions, 700)
|
|
132
141
|
});
|
|
133
142
|
};
|
|
@@ -13,7 +13,9 @@ const getStyleBackgroundByDevice = (background, options)=>{
|
|
|
13
13
|
...getStyleBgColor(background)
|
|
14
14
|
} : {},
|
|
15
15
|
...!options?.ignoreBackgroundImage ? {
|
|
16
|
-
...getStyleBgImage(background, options)
|
|
16
|
+
...getStyleBgImage(background, options)
|
|
17
|
+
} : {},
|
|
18
|
+
...!options?.ignoreBackgroundImageProperties ? {
|
|
17
19
|
...getStyleBgPosition(background),
|
|
18
20
|
...getStyleBgSize(background),
|
|
19
21
|
...getStyleBgRepeat(background)
|
|
@@ -74,6 +76,9 @@ const getBgImageByDevice = (background, device, options)=>{
|
|
|
74
76
|
if (typeof imageByDevice === 'string') {
|
|
75
77
|
return `url(${imageByDevice})`;
|
|
76
78
|
}
|
|
79
|
+
if (imageByDevice !== undefined) {
|
|
80
|
+
return 'none';
|
|
81
|
+
}
|
|
77
82
|
};
|
|
78
83
|
const getStyleBgPosition = (background)=>{
|
|
79
84
|
const bgPosition = {
|
|
@@ -121,7 +126,7 @@ const getBgAttachmentByDevice = (background, device)=>{
|
|
|
121
126
|
return background?.[device]?.attachment;
|
|
122
127
|
};
|
|
123
128
|
const composeBackgroundCss = (backgroundColor)=>{
|
|
124
|
-
return `${backgroundColor ? `background-color: ${colors.getSingleColorVariable(backgroundColor)}
|
|
129
|
+
return `${backgroundColor ? `background-color: ${colors.getSingleColorVariable(backgroundColor)};` : undefined}`;
|
|
125
130
|
};
|
|
126
131
|
const makeFixedBgAttachment = (background)=>{
|
|
127
132
|
if (!background) return;
|
|
@@ -205,7 +210,7 @@ const getGradientBgrStyleForButton = (backgroundStyle)=>{
|
|
|
205
210
|
});
|
|
206
211
|
return bgrStyle;
|
|
207
212
|
};
|
|
208
|
-
const getGradientBgrStyleByDevice = (backgroundStyle, ignoreBackgroundImage
|
|
213
|
+
const getGradientBgrStyleByDevice = (backgroundStyle, ignoreBackgroundImage)=>{
|
|
209
214
|
if (!backgroundStyle) return;
|
|
210
215
|
const bgrStyle = {};
|
|
211
216
|
[
|
|
@@ -215,8 +220,8 @@ const getGradientBgrStyleByDevice = (backgroundStyle, ignoreBackgroundImage = fa
|
|
|
215
220
|
].forEach((device)=>{
|
|
216
221
|
if (backgroundStyle[device]?.color?.includes(GRADIENT_BGR_KEY)) {
|
|
217
222
|
Object.assign(bgrStyle, {
|
|
218
|
-
[`--bgc${device !== 'desktop' ? '-' + device : ''}`]:
|
|
219
|
-
[`--bgi${device !== 'desktop' ? '-' + device : ''}`]: ignoreBackgroundImage ? `${backgroundStyle[device]?.color}` : `${getBgImageByDevice(backgroundStyle, device) || 'url()'}, ${backgroundStyle[device]?.color}`
|
|
223
|
+
[`--bgc${device !== 'desktop' ? '-' + device : ''}`]: backgroundStyle[device]?.color,
|
|
224
|
+
[`--bgi${device !== 'desktop' ? '-' + device : ''}`]: !ignoreBackgroundImage?.[device] ? `${backgroundStyle[device]?.color}` : `${getBgImageByDevice(backgroundStyle, device) || 'url()'}, ${backgroundStyle[device]?.color}`
|
|
220
225
|
});
|
|
221
226
|
}
|
|
222
227
|
});
|
|
@@ -40,6 +40,16 @@ const getAttrValue = (attr, value, tag)=>{
|
|
|
40
40
|
if (!value) return 'none';
|
|
41
41
|
if (value && tag && constant.layoutComponent.includes(tag)) return 'grid';
|
|
42
42
|
return 'block';
|
|
43
|
+
case 'animation':
|
|
44
|
+
return undefined;
|
|
45
|
+
case 'hasBoxShadow':
|
|
46
|
+
return undefined;
|
|
47
|
+
case 'rounded':
|
|
48
|
+
return undefined;
|
|
49
|
+
case 'boxShadow':
|
|
50
|
+
return undefined;
|
|
51
|
+
case 'border':
|
|
52
|
+
return undefined;
|
|
43
53
|
default:
|
|
44
54
|
return value;
|
|
45
55
|
}
|
|
@@ -102,8 +112,23 @@ function composeAdvanceStyle(data, tag, pageType) {
|
|
|
102
112
|
Object.assign(styles, radius.composeRadius(value));
|
|
103
113
|
}
|
|
104
114
|
if (attr === 'boxShadow') {
|
|
105
|
-
|
|
115
|
+
const listElementShadowV2 = [
|
|
116
|
+
'Row',
|
|
117
|
+
'Section',
|
|
118
|
+
'Text',
|
|
119
|
+
'Heading'
|
|
120
|
+
];
|
|
121
|
+
let hasBoxShadowV2 = hasBoxShadow;
|
|
122
|
+
if (listElementShadowV2.includes(tag || '')) {
|
|
123
|
+
hasBoxShadowV2 = {
|
|
124
|
+
desktop: value.desktop ?? {},
|
|
125
|
+
tablet: value.tablet ?? value.desktop ?? {},
|
|
126
|
+
mobile: value.mobile ?? value.tablet ?? value.desktop ?? {}
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
Object.assign(styles, shadow.getResponsiveStyleShadow(value, 'box-shadow', hasBoxShadowV2 ?? hasBoxShadow));
|
|
106
130
|
}
|
|
131
|
+
const styleValue = getAttrValue(attr, deviceValue, tag);
|
|
107
132
|
if (composeAttr === 'desktop') {
|
|
108
133
|
switch(attr){
|
|
109
134
|
case 'padding':
|
|
@@ -131,7 +156,7 @@ function composeAdvanceStyle(data, tag, pageType) {
|
|
|
131
156
|
case 'p':
|
|
132
157
|
break;
|
|
133
158
|
default:
|
|
134
|
-
styles[`--${attr}`] =
|
|
159
|
+
styleValue && (styles[`--${attr}`] = styleValue);
|
|
135
160
|
break;
|
|
136
161
|
}
|
|
137
162
|
} else {
|
|
@@ -164,7 +189,7 @@ function composeAdvanceStyle(data, tag, pageType) {
|
|
|
164
189
|
case 'p':
|
|
165
190
|
break;
|
|
166
191
|
default:
|
|
167
|
-
styles[`--${attr}-${composeAttr}`] =
|
|
192
|
+
styleValue && (styles[`--${attr}-${composeAttr}`] = styleValue);
|
|
168
193
|
break;
|
|
169
194
|
}
|
|
170
195
|
}
|
|
@@ -209,7 +234,8 @@ function composeAdvanceStyle(data, tag, pageType) {
|
|
|
209
234
|
}
|
|
210
235
|
});
|
|
211
236
|
} else {
|
|
212
|
-
|
|
237
|
+
const styleValue = getAttrValue(attr, value, tag);
|
|
238
|
+
styleValue && (styles[`--${attr}`] = styleValue);
|
|
213
239
|
if (attr === 'hasBoxShadow' && data.boxShadow) {
|
|
214
240
|
Object.assign(styles, shadow.getStyleShadow({
|
|
215
241
|
value: data.boxShadow,
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var react = require('react');
|
|
4
|
+
require('react/jsx-runtime');
|
|
5
|
+
require('zustand');
|
|
6
|
+
require('swr');
|
|
7
|
+
var PageContext = require('../../contexts/PageContext.js');
|
|
8
|
+
require('@gem-sdk/adapter-shopify');
|
|
9
|
+
require('swr/mutation');
|
|
10
|
+
require('swr/infinite');
|
|
11
|
+
require('vanilla-lazyload');
|
|
12
|
+
require('../../hooks/useCartUI.js');
|
|
13
|
+
require('react-transition-group');
|
|
14
|
+
require('@gem-sdk/core');
|
|
15
|
+
require('classnames');
|
|
16
|
+
require('dayjs');
|
|
17
|
+
require('../convert.js');
|
|
18
|
+
|
|
19
|
+
const useInteraction = ()=>{
|
|
20
|
+
const ref = react.useRef();
|
|
21
|
+
const setInteractionIsSelectOnPage = PageContext.usePageStore((s)=>s.setInteractionIsSelectOnPage);
|
|
22
|
+
function findElementIncludingSelf(element, selector) {
|
|
23
|
+
if (!(element instanceof Document) && element?.matches(selector)) {
|
|
24
|
+
return element;
|
|
25
|
+
} else {
|
|
26
|
+
return element?.querySelector(selector);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
const handleOnListener = (element, event, callback)=>{
|
|
30
|
+
const eventListener = (e)=>{
|
|
31
|
+
const customEvent = e;
|
|
32
|
+
const params = customEvent.detail;
|
|
33
|
+
if (callback) callback(params);
|
|
34
|
+
};
|
|
35
|
+
element.addEventListener(event, eventListener);
|
|
36
|
+
return ()=>element.removeEventListener(event, eventListener);
|
|
37
|
+
};
|
|
38
|
+
const onListener = ({ event, selector, elementRef }, callback)=>{
|
|
39
|
+
const element = findElementIncludingSelf(elementRef?.current || ref.current || document, selector);
|
|
40
|
+
if (!element) return;
|
|
41
|
+
return handleOnListener(element, event, callback);
|
|
42
|
+
};
|
|
43
|
+
const trigger = ({ event, data, selector, element: elementParam })=>{
|
|
44
|
+
const element = elementParam || document.body?.querySelector(selector);
|
|
45
|
+
if (!element) return;
|
|
46
|
+
const eventDispatch = new CustomEvent(event, {
|
|
47
|
+
bubbles: false,
|
|
48
|
+
cancelable: true,
|
|
49
|
+
detail: {
|
|
50
|
+
data
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
element.dispatchEvent(eventDispatch);
|
|
54
|
+
};
|
|
55
|
+
const saveToElementInteractionData = (element, key, value)=>{
|
|
56
|
+
const interactionData = element.getAttribute('gp-data-interaction');
|
|
57
|
+
const interactionDataJson = JSON.parse(interactionData || '{}');
|
|
58
|
+
element.setAttribute('gp-data-interaction', JSON.stringify({
|
|
59
|
+
...interactionDataJson,
|
|
60
|
+
[key]: value
|
|
61
|
+
}));
|
|
62
|
+
};
|
|
63
|
+
const getInteractionPreviousData = (element, key)=>{
|
|
64
|
+
const interactionData = element.getAttribute('gp-data-interaction');
|
|
65
|
+
const interactionDataJson = JSON.parse(interactionData || '{}');
|
|
66
|
+
return {
|
|
67
|
+
previousData: interactionDataJson[key],
|
|
68
|
+
interactionDataJson
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
const closeSelectOnPage = ()=>{
|
|
72
|
+
setInteractionIsSelectOnPage(false);
|
|
73
|
+
const event = new CustomEvent('editor:interaction:change-select-on-page', {
|
|
74
|
+
bubbles: true,
|
|
75
|
+
detail: false
|
|
76
|
+
});
|
|
77
|
+
window.dispatchEvent(event);
|
|
78
|
+
};
|
|
79
|
+
const changeSelectMode = (mode)=>{
|
|
80
|
+
const event = new CustomEvent('editor:interaction:change-select-mode', {
|
|
81
|
+
bubbles: true,
|
|
82
|
+
detail: mode
|
|
83
|
+
});
|
|
84
|
+
window.dispatchEvent(event);
|
|
85
|
+
};
|
|
86
|
+
const selectInteractionElement = ({ componentUid, settingType, $target })=>{
|
|
87
|
+
const event = new CustomEvent('editor:interaction:select-element', {
|
|
88
|
+
bubbles: true,
|
|
89
|
+
detail: {
|
|
90
|
+
componentUid,
|
|
91
|
+
settingType,
|
|
92
|
+
$target
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
window.dispatchEvent(event);
|
|
96
|
+
};
|
|
97
|
+
return {
|
|
98
|
+
onListener,
|
|
99
|
+
trigger,
|
|
100
|
+
saveToElementInteractionData,
|
|
101
|
+
closeSelectOnPage,
|
|
102
|
+
ref,
|
|
103
|
+
findElementIncludingSelf,
|
|
104
|
+
getInteractionPreviousData,
|
|
105
|
+
changeSelectMode,
|
|
106
|
+
selectInteractionElement
|
|
107
|
+
};
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
exports.useInteraction = useInteraction;
|
|
@@ -27,7 +27,14 @@ const getRadiusCSSFromGlobal = (state, key, device)=>{
|
|
|
27
27
|
};
|
|
28
28
|
};
|
|
29
29
|
const getCustomRadius = (state, radius, device)=>{
|
|
30
|
-
|
|
30
|
+
const list = [
|
|
31
|
+
'custom',
|
|
32
|
+
'pill',
|
|
33
|
+
'rounded',
|
|
34
|
+
'single',
|
|
35
|
+
'none'
|
|
36
|
+
];
|
|
37
|
+
if (!radius || !state || !list.includes(radius?.radiusType ?? '')) return {};
|
|
31
38
|
const suffix = device && device !== 'desktop' ? constant.devicesMapping?.[device] : '';
|
|
32
39
|
const mState = constant.stateMapping?.[state];
|
|
33
40
|
return {
|
|
@@ -62,6 +69,7 @@ const composeRadiusState = (radiusValue, device)=>{
|
|
|
62
69
|
case 'circle':
|
|
63
70
|
case 'none':
|
|
64
71
|
case 'custom':
|
|
72
|
+
case 'rounded':
|
|
65
73
|
Object.assign(style, getCustomRadius('normal', radiusValue.normal, device));
|
|
66
74
|
break;
|
|
67
75
|
}
|
|
@@ -74,6 +82,7 @@ const composeRadiusState = (radiusValue, device)=>{
|
|
|
74
82
|
case 'circle':
|
|
75
83
|
case 'none':
|
|
76
84
|
case 'custom':
|
|
85
|
+
case 'rounded':
|
|
77
86
|
Object.assign(style, getCustomRadius('hover', radiusValue.hover, device));
|
|
78
87
|
break;
|
|
79
88
|
}
|
|
@@ -86,6 +95,7 @@ const composeRadiusState = (radiusValue, device)=>{
|
|
|
86
95
|
case 'circle':
|
|
87
96
|
case 'none':
|
|
88
97
|
case 'custom':
|
|
98
|
+
case 'rounded':
|
|
89
99
|
Object.assign(style, getCustomRadius('focus', radiusValue.focus, device));
|
|
90
100
|
break;
|
|
91
101
|
}
|
|
@@ -24,10 +24,11 @@ const getStyleShadow = (shadowStyle, isActiveState = false)=>{
|
|
|
24
24
|
let { state } = shadowStyle || {};
|
|
25
25
|
if (!state) state = 'normal';
|
|
26
26
|
if (!styleAppliedFor || !value) return {};
|
|
27
|
-
|
|
27
|
+
const isNoneValue = value.type === 'none';
|
|
28
|
+
if (typeof value.distance == 'undefined' && !isNoneValue) return {};
|
|
28
29
|
const { value: distance, unit: unitDistance } = parseValueWithUnit(`${value?.distance}`);
|
|
29
30
|
return {
|
|
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
|
+
[`-${!isActiveState ? constant.stateMapping?.[state] || '' : ''}-${getShortname.getShortName(styleAppliedFor)}${shadowStyle.screen ? `-${shadowStyle.screen}` : ''}`]: isEnableShadow && !isNoneValue ? `${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
32
|
};
|
|
32
33
|
};
|
|
33
34
|
const getStyleShadowState = (shadow, styleAppliedFor, isEnableShadow, screen)=>{
|
|
@@ -44,7 +45,7 @@ const getStyleShadowState = (shadow, styleAppliedFor, isEnableShadow, screen)=>{
|
|
|
44
45
|
}
|
|
45
46
|
return style;
|
|
46
47
|
};
|
|
47
|
-
const
|
|
48
|
+
const getResponsiveStyleShadow = (value, styleAppliedFor, isEnableShadow)=>{
|
|
48
49
|
if (!value) return undefined;
|
|
49
50
|
if ('desktop' in value || 'tablet' in value || 'mobile' in value) {
|
|
50
51
|
return {
|
|
@@ -63,7 +64,7 @@ const composeShadowCss = ({ hasBoxShadow, boxShadowValue, important })=>{
|
|
|
63
64
|
};
|
|
64
65
|
|
|
65
66
|
exports.composeShadowCss = composeShadowCss;
|
|
66
|
-
exports.
|
|
67
|
+
exports.getResponsiveStyleShadow = getResponsiveStyleShadow;
|
|
67
68
|
exports.getStyleShadow = getStyleShadow;
|
|
68
69
|
exports.getStyleShadowState = getStyleShadowState;
|
|
69
70
|
exports.parseValueWithUnit = parseValueWithUnit;
|
|
@@ -132,15 +132,69 @@ const AppointmentBookingCowlendarConfig = {
|
|
|
132
132
|
appId: '6d8b8f6a-9b3c-42b8-b2e6-a758c38d45bf'
|
|
133
133
|
}
|
|
134
134
|
};
|
|
135
|
+
const BoldSubscriptionsConfig = {
|
|
136
|
+
BoldSubscriptions: {
|
|
137
|
+
appName: 'bold-subscriptions',
|
|
138
|
+
appId: '9ceb49f0-5fe5-4b5e-943d-f8af8985167d'
|
|
139
|
+
}
|
|
140
|
+
};
|
|
141
|
+
const SproutPlantTreesGrowSalesConfig = {
|
|
142
|
+
SproutPlantTreesGrowSales: {
|
|
143
|
+
appName: 'sprout-plant-trees',
|
|
144
|
+
appId: '7db5ee24-2195-4099-b98e-1547c600e4aa'
|
|
145
|
+
}
|
|
146
|
+
};
|
|
147
|
+
const InstasellShoppableInstagramConfig = {
|
|
148
|
+
InstasellShoppableInstagram: {
|
|
149
|
+
appName: 'instasell-instagram-gallery',
|
|
150
|
+
appId: '38d643ac-410a-4b2c-a727-6125ff08e444'
|
|
151
|
+
}
|
|
152
|
+
};
|
|
153
|
+
const GrowaveConfig = {
|
|
154
|
+
Growave: {
|
|
155
|
+
appName: 'growave-loyalty-wishlist',
|
|
156
|
+
appId: 'b3d2efbe-110a-4e27-84a8-1f2ed63996a4'
|
|
157
|
+
}
|
|
158
|
+
};
|
|
159
|
+
const KachingBundlesConfig = {
|
|
160
|
+
KachingBundles: {
|
|
161
|
+
appName: 'kaching-bundles',
|
|
162
|
+
appId: '6c637362-a106-4a32-94ac-94dcfd68cdb8'
|
|
163
|
+
}
|
|
164
|
+
};
|
|
165
|
+
const LoloyalLoyaltyReferralsConfig = {
|
|
166
|
+
LoloyalLoyaltyReferrals: {
|
|
167
|
+
appName: 'loloyal-com',
|
|
168
|
+
appId: '930ac91f-2bf2-4655-9ba0-574771f782d6'
|
|
169
|
+
}
|
|
170
|
+
};
|
|
171
|
+
const PowerfulContactFormBuilderConfig = {
|
|
172
|
+
PowerfulContactFormBuilder: {
|
|
173
|
+
appName: 'powerful-form-builder',
|
|
174
|
+
appId: 'e4bcb1eb-35b2-42e6-bc37-bfe0e1542c9d'
|
|
175
|
+
}
|
|
176
|
+
};
|
|
177
|
+
const WishlistKingConfig = {
|
|
178
|
+
WishlistKing: {
|
|
179
|
+
appName: 'wishlist-king',
|
|
180
|
+
appId: '194f5011-a43c-4b22-b12e-eaf20dc4506a'
|
|
181
|
+
}
|
|
182
|
+
};
|
|
135
183
|
|
|
136
184
|
exports.AppointmentBookingCowlendarConfig = AppointmentBookingCowlendarConfig;
|
|
185
|
+
exports.BoldSubscriptionsConfig = BoldSubscriptionsConfig;
|
|
137
186
|
exports.BonLoyaltyRewardsReferralsConfig = BonLoyaltyRewardsReferralsConfig;
|
|
138
187
|
exports.EasyBundleBuilderSkailamaConfig = EasyBundleBuilderSkailamaConfig;
|
|
139
188
|
exports.FastBundleBundlesDiscountsConfig = FastBundleBundlesDiscountsConfig;
|
|
140
189
|
exports.FlyBundlesUpsellsFbtConfig = FlyBundlesUpsellsFbtConfig;
|
|
190
|
+
exports.GrowaveConfig = GrowaveConfig;
|
|
191
|
+
exports.InstasellShoppableInstagramConfig = InstasellShoppableInstagramConfig;
|
|
141
192
|
exports.JunipProductReviewsUgcConfig = JunipProductReviewsUgcConfig;
|
|
193
|
+
exports.KachingBundlesConfig = KachingBundlesConfig;
|
|
142
194
|
exports.KiteFreeGiftDiscountConfig = KiteFreeGiftDiscountConfig;
|
|
195
|
+
exports.LoloyalLoyaltyReferralsConfig = LoloyalLoyaltyReferralsConfig;
|
|
143
196
|
exports.LoopSubscriptionsConfig = LoopSubscriptionsConfig;
|
|
197
|
+
exports.PowerfulContactFormBuilderConfig = PowerfulContactFormBuilderConfig;
|
|
144
198
|
exports.PreorderNowPreOrderPqConfig = PreorderNowPreOrderPqConfig;
|
|
145
199
|
exports.PreorderNowWodPresaleConfig = PreorderNowWodPresaleConfig;
|
|
146
200
|
exports.ProductOptionsCustomizerConfig = ProductOptionsCustomizerConfig;
|
|
@@ -151,7 +205,9 @@ exports.SelleasyConfig = SelleasyConfig;
|
|
|
151
205
|
exports.ShopifyFormsConfig = ShopifyFormsConfig;
|
|
152
206
|
exports.SimpleBundlesKitsConfig = SimpleBundlesKitsConfig;
|
|
153
207
|
exports.SkioSubscriptionsYcS20Config = SkioSubscriptionsYcS20Config;
|
|
208
|
+
exports.SproutPlantTreesGrowSalesConfig = SproutPlantTreesGrowSalesConfig;
|
|
154
209
|
exports.SubifySubscriptionsConfig = SubifySubscriptionsConfig;
|
|
155
210
|
exports.UnlimitedBundlesDiscountsConfig = UnlimitedBundlesDiscountsConfig;
|
|
156
211
|
exports.WhatmoreShoppableVideosreelConfig = WhatmoreShoppableVideosreelConfig;
|
|
212
|
+
exports.WishlistKingConfig = WishlistKingConfig;
|
|
157
213
|
exports.YotpoReviewsV3UgcConfig = YotpoReviewsV3UgcConfig;
|