@gem-sdk/components 2.0.0-dev.482 → 2.0.0-dev.484
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/form/components/newsletter/Newsletter.liquid.js +2 -2
- package/dist/cjs/form/components/newsletter/common/composeStyles.js +4 -3
- package/dist/cjs/form/setting/newsletter/configs/settings.js +4 -2
- package/dist/cjs/form/setting/newsletter/configs/uiV2.js +2 -0
- package/dist/cjs/icon-list/setting/configs/settings.js +14 -2
- package/dist/cjs/icon-list/setting/configs/uiV2.js +1 -1
- package/dist/cjs/sticky/components/common/styles.js +1 -7
- package/dist/cjs/sticky/components/hooks/useSticky.js +4 -14
- package/dist/cjs/sticky/setting/configs/settingsV2.js +1 -1
- package/dist/cjs/sticky/setting/preset-config.js +6 -1
- package/dist/esm/form/components/newsletter/Newsletter.liquid.js +2 -2
- package/dist/esm/form/components/newsletter/common/composeStyles.js +4 -3
- package/dist/esm/form/setting/newsletter/configs/settings.js +4 -2
- package/dist/esm/form/setting/newsletter/configs/uiV2.js +2 -0
- package/dist/esm/icon-list/setting/configs/settings.js +14 -2
- package/dist/esm/icon-list/setting/configs/uiV2.js +1 -1
- package/dist/esm/sticky/components/common/styles.js +1 -7
- package/dist/esm/sticky/components/hooks/useSticky.js +4 -14
- package/dist/esm/sticky/setting/configs/settingsV2.js +1 -1
- package/dist/esm/sticky/setting/preset-config.js +6 -1
- package/package.json +1 -1
|
@@ -31,8 +31,8 @@ const Newsletter = ({ builderProps, setting, children, style, formType, advanced
|
|
|
31
31
|
const composedContainerStyles = system.createStyle(composeStyles.composeContainerStylesForm(style));
|
|
32
32
|
const anchorAttrs = composeAttrs.composeAnchorAttrs(builderProps, setting);
|
|
33
33
|
const composedFormClasses = system.createClass(composeClasses.composeFormClasses());
|
|
34
|
-
const composedFormStylesError = system.createStyle(composeStyles.composeFormStyles('error'));
|
|
35
|
-
const composedFormStylesSuccess = system.createStyle(composeStyles.composeFormStyles('success'));
|
|
34
|
+
const composedFormStylesError = system.createStyle(composeStyles.composeFormStyles('error', setting));
|
|
35
|
+
const composedFormStylesSuccess = system.createStyle(composeStyles.composeFormStyles('success', setting));
|
|
36
36
|
const formAttrsError = composeAttrs.composeFormAttrs(builderProps, 'error');
|
|
37
37
|
const formAttrsSuccess = composeAttrs.composeFormAttrs(builderProps, 'success');
|
|
38
38
|
const popoverAttrs = composeAttrs.composePopoverAttrs(builderProps);
|
|
@@ -8,20 +8,21 @@ const composeContainerStylesForm = (style)=>{
|
|
|
8
8
|
...style
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
-
const composeFormStyles = (type)=>{
|
|
11
|
+
const composeFormStyles = (type, setting)=>{
|
|
12
|
+
const { errorColor, successColor } = setting ?? {};
|
|
12
13
|
if (type === 'success') {
|
|
13
14
|
return composeStyles({
|
|
14
15
|
'background-color': '#F2FFEC',
|
|
15
16
|
left: '50%',
|
|
16
17
|
transform: 'translateX(-50%)',
|
|
17
|
-
color:
|
|
18
|
+
color: successColor
|
|
18
19
|
});
|
|
19
20
|
}
|
|
20
21
|
return composeStyles({
|
|
21
22
|
'background-color': '#FFE9E9',
|
|
22
23
|
left: '50%',
|
|
23
24
|
transform: 'translateX(-50%)',
|
|
24
|
-
color:
|
|
25
|
+
color: errorColor
|
|
25
26
|
});
|
|
26
27
|
};
|
|
27
28
|
const popoverStyles = (builderProps)=>`
|
|
@@ -46,7 +46,8 @@ const NewsletterSettings = [
|
|
|
46
46
|
label: 'Success Message',
|
|
47
47
|
default: "Thanks for contacting us. We'll get back to you as soon as possible.",
|
|
48
48
|
autoHeight: true,
|
|
49
|
-
minHeight: 58
|
|
49
|
+
minHeight: 58,
|
|
50
|
+
compoDefaultValue: "Thanks for contacting us. We'll get back to you as soon as possible."
|
|
50
51
|
},
|
|
51
52
|
{
|
|
52
53
|
id: 'successColor',
|
|
@@ -61,7 +62,8 @@ const NewsletterSettings = [
|
|
|
61
62
|
label: 'Error Message',
|
|
62
63
|
default: 'Can’t send email. Please try again later.',
|
|
63
64
|
autoHeight: true,
|
|
64
|
-
minHeight: 58
|
|
65
|
+
minHeight: 58,
|
|
66
|
+
compoDefaultValue: 'Can’t send email. Please try again later.'
|
|
65
67
|
},
|
|
66
68
|
{
|
|
67
69
|
id: 'errorColor',
|
|
@@ -25,6 +25,7 @@ const SettingUIV2 = [
|
|
|
25
25
|
getValueFromSettingID: 'successMessage',
|
|
26
26
|
isHideClear: true,
|
|
27
27
|
disableScrollbar: true,
|
|
28
|
+
compoDefaultValue: "Thanks for contacting us. We'll get back to you as soon as possible.",
|
|
28
29
|
popoverLabel: {
|
|
29
30
|
en: 'Success message'
|
|
30
31
|
},
|
|
@@ -57,6 +58,7 @@ const SettingUIV2 = [
|
|
|
57
58
|
getValueFromSettingID: 'errorMessage',
|
|
58
59
|
isHideClear: true,
|
|
59
60
|
disableScrollbar: true,
|
|
61
|
+
compoDefaultValue: 'Can’t send email. Please try again later.',
|
|
60
62
|
popoverLabel: {
|
|
61
63
|
en: 'Error message'
|
|
62
64
|
},
|
|
@@ -148,7 +148,13 @@ const IconListSettings = [
|
|
|
148
148
|
devices: {
|
|
149
149
|
desktop: {
|
|
150
150
|
default: {
|
|
151
|
-
padding: {
|
|
151
|
+
padding: {
|
|
152
|
+
type: 'medium',
|
|
153
|
+
top: '8px',
|
|
154
|
+
bottom: '8px',
|
|
155
|
+
left: '12px',
|
|
156
|
+
right: '12px'
|
|
157
|
+
}
|
|
152
158
|
}
|
|
153
159
|
}
|
|
154
160
|
},
|
|
@@ -239,7 +245,13 @@ const IconListSettings = [
|
|
|
239
245
|
desktop: {
|
|
240
246
|
default: {
|
|
241
247
|
width: '100%',
|
|
242
|
-
padding: {
|
|
248
|
+
padding: {
|
|
249
|
+
type: 'medium',
|
|
250
|
+
top: '8px',
|
|
251
|
+
bottom: '8px',
|
|
252
|
+
left: '12px',
|
|
253
|
+
right: '12px'
|
|
254
|
+
}
|
|
243
255
|
}
|
|
244
256
|
},
|
|
245
257
|
mobile: {
|
|
@@ -9,17 +9,11 @@ const getDisplayStyle = (device, display, position)=>{
|
|
|
9
9
|
const style = {
|
|
10
10
|
[`--top${device}`]: 'auto',
|
|
11
11
|
[`--${position + device}`]: '0',
|
|
12
|
-
[`--pos${device}`]:
|
|
12
|
+
[`--pos${device}`]: 'fixed'
|
|
13
13
|
};
|
|
14
14
|
if (display === 'after-first-cart-button') style[`--d${device}`] = 'none';
|
|
15
15
|
return style;
|
|
16
16
|
};
|
|
17
|
-
const getCSSPosition = (position, device)=>{
|
|
18
|
-
if (device === '-mobile' || device === '-tablet') {
|
|
19
|
-
return 'fixed';
|
|
20
|
-
}
|
|
21
|
-
return position == 'top' ? 'sticky' : 'fixed';
|
|
22
|
-
};
|
|
23
17
|
const displayConditionStyle = (display, position)=>{
|
|
24
18
|
return {
|
|
25
19
|
...getDisplayStyle('', display?.desktop, position?.desktop),
|
|
@@ -10,12 +10,6 @@ const useSticky = (setting)=>{
|
|
|
10
10
|
const w = core.makeStyleResponsive('w', width);
|
|
11
11
|
const sidebarMode = core.usePageStore((s)=>s.sidebarMode === 'interaction');
|
|
12
12
|
const currentDevice = core.useCurrentDevice();
|
|
13
|
-
const getCSSPosition = (position, forceFixed)=>{
|
|
14
|
-
if (forceFixed) {
|
|
15
|
-
return 'fixed';
|
|
16
|
-
}
|
|
17
|
-
return position == 'top' ? 'sticky' : 'fixed';
|
|
18
|
-
};
|
|
19
13
|
const getCSSAlignByDevice = (position, device)=>{
|
|
20
14
|
return {
|
|
21
15
|
[`--left${device}`]: position == 'top' ? '0' : '50%',
|
|
@@ -60,15 +54,11 @@ const useSticky = (setting)=>{
|
|
|
60
54
|
]);
|
|
61
55
|
const positionStyle = React.useMemo(()=>{
|
|
62
56
|
return {
|
|
63
|
-
[`--pos`]:
|
|
64
|
-
[`--pos-tablet`]:
|
|
65
|
-
[`--pos-mobile`]:
|
|
57
|
+
[`--pos`]: 'fixed',
|
|
58
|
+
[`--pos-tablet`]: 'fixed',
|
|
59
|
+
[`--pos-mobile`]: 'fixed'
|
|
66
60
|
};
|
|
67
|
-
}, [
|
|
68
|
-
position?.desktop,
|
|
69
|
-
position?.mobile,
|
|
70
|
-
position?.tablet
|
|
71
|
-
]);
|
|
61
|
+
}, []);
|
|
72
62
|
return {
|
|
73
63
|
w,
|
|
74
64
|
displayStyle,
|
|
@@ -23,6 +23,11 @@ const StickyPreset = {
|
|
|
23
23
|
{
|
|
24
24
|
tag: 'Sticky',
|
|
25
25
|
label: 'Sticky',
|
|
26
|
+
settings: {
|
|
27
|
+
width: {
|
|
28
|
+
desktop: '100%'
|
|
29
|
+
}
|
|
30
|
+
},
|
|
26
31
|
advanced: {
|
|
27
32
|
hasBoxShadow: {
|
|
28
33
|
desktop: {
|
|
@@ -32,7 +37,7 @@ const StickyPreset = {
|
|
|
32
37
|
boxShadow: {
|
|
33
38
|
desktop: {
|
|
34
39
|
normal: {
|
|
35
|
-
type: 'shadow-
|
|
40
|
+
type: 'shadow-2',
|
|
36
41
|
distance: '0px',
|
|
37
42
|
blur: '10px',
|
|
38
43
|
spread: '0px',
|
|
@@ -27,8 +27,8 @@ const Newsletter = ({ builderProps, setting, children, style, formType, advanced
|
|
|
27
27
|
const composedContainerStyles = createStyle(composeContainerStylesForm(style));
|
|
28
28
|
const anchorAttrs = composeAnchorAttrs(builderProps, setting);
|
|
29
29
|
const composedFormClasses = createClass(composeFormClasses());
|
|
30
|
-
const composedFormStylesError = createStyle(composeFormStyles('error'));
|
|
31
|
-
const composedFormStylesSuccess = createStyle(composeFormStyles('success'));
|
|
30
|
+
const composedFormStylesError = createStyle(composeFormStyles('error', setting));
|
|
31
|
+
const composedFormStylesSuccess = createStyle(composeFormStyles('success', setting));
|
|
32
32
|
const formAttrsError = composeFormAttrs(builderProps, 'error');
|
|
33
33
|
const formAttrsSuccess = composeFormAttrs(builderProps, 'success');
|
|
34
34
|
const popoverAttrs = composePopoverAttrs(builderProps);
|
|
@@ -6,20 +6,21 @@ const composeContainerStylesForm = (style)=>{
|
|
|
6
6
|
...style
|
|
7
7
|
});
|
|
8
8
|
};
|
|
9
|
-
const composeFormStyles = (type)=>{
|
|
9
|
+
const composeFormStyles = (type, setting)=>{
|
|
10
|
+
const { errorColor, successColor } = setting ?? {};
|
|
10
11
|
if (type === 'success') {
|
|
11
12
|
return composeStyles({
|
|
12
13
|
'background-color': '#F2FFEC',
|
|
13
14
|
left: '50%',
|
|
14
15
|
transform: 'translateX(-50%)',
|
|
15
|
-
color:
|
|
16
|
+
color: successColor
|
|
16
17
|
});
|
|
17
18
|
}
|
|
18
19
|
return composeStyles({
|
|
19
20
|
'background-color': '#FFE9E9',
|
|
20
21
|
left: '50%',
|
|
21
22
|
transform: 'translateX(-50%)',
|
|
22
|
-
color:
|
|
23
|
+
color: errorColor
|
|
23
24
|
});
|
|
24
25
|
};
|
|
25
26
|
const popoverStyles = (builderProps)=>`
|
|
@@ -42,7 +42,8 @@ const NewsletterSettings = [
|
|
|
42
42
|
label: 'Success Message',
|
|
43
43
|
default: "Thanks for contacting us. We'll get back to you as soon as possible.",
|
|
44
44
|
autoHeight: true,
|
|
45
|
-
minHeight: 58
|
|
45
|
+
minHeight: 58,
|
|
46
|
+
compoDefaultValue: "Thanks for contacting us. We'll get back to you as soon as possible."
|
|
46
47
|
},
|
|
47
48
|
{
|
|
48
49
|
id: 'successColor',
|
|
@@ -57,7 +58,8 @@ const NewsletterSettings = [
|
|
|
57
58
|
label: 'Error Message',
|
|
58
59
|
default: 'Can’t send email. Please try again later.',
|
|
59
60
|
autoHeight: true,
|
|
60
|
-
minHeight: 58
|
|
61
|
+
minHeight: 58,
|
|
62
|
+
compoDefaultValue: 'Can’t send email. Please try again later.'
|
|
61
63
|
},
|
|
62
64
|
{
|
|
63
65
|
id: 'errorColor',
|
|
@@ -23,6 +23,7 @@ const SettingUIV2 = [
|
|
|
23
23
|
getValueFromSettingID: 'successMessage',
|
|
24
24
|
isHideClear: true,
|
|
25
25
|
disableScrollbar: true,
|
|
26
|
+
compoDefaultValue: "Thanks for contacting us. We'll get back to you as soon as possible.",
|
|
26
27
|
popoverLabel: {
|
|
27
28
|
en: 'Success message'
|
|
28
29
|
},
|
|
@@ -55,6 +56,7 @@ const SettingUIV2 = [
|
|
|
55
56
|
getValueFromSettingID: 'errorMessage',
|
|
56
57
|
isHideClear: true,
|
|
57
58
|
disableScrollbar: true,
|
|
59
|
+
compoDefaultValue: 'Can’t send email. Please try again later.',
|
|
58
60
|
popoverLabel: {
|
|
59
61
|
en: 'Error message'
|
|
60
62
|
},
|
|
@@ -146,7 +146,13 @@ const IconListSettings = [
|
|
|
146
146
|
devices: {
|
|
147
147
|
desktop: {
|
|
148
148
|
default: {
|
|
149
|
-
padding: {
|
|
149
|
+
padding: {
|
|
150
|
+
type: 'medium',
|
|
151
|
+
top: '8px',
|
|
152
|
+
bottom: '8px',
|
|
153
|
+
left: '12px',
|
|
154
|
+
right: '12px'
|
|
155
|
+
}
|
|
150
156
|
}
|
|
151
157
|
}
|
|
152
158
|
},
|
|
@@ -237,7 +243,13 @@ const IconListSettings = [
|
|
|
237
243
|
desktop: {
|
|
238
244
|
default: {
|
|
239
245
|
width: '100%',
|
|
240
|
-
padding: {
|
|
246
|
+
padding: {
|
|
247
|
+
type: 'medium',
|
|
248
|
+
top: '8px',
|
|
249
|
+
bottom: '8px',
|
|
250
|
+
left: '12px',
|
|
251
|
+
right: '12px'
|
|
252
|
+
}
|
|
241
253
|
}
|
|
242
254
|
},
|
|
243
255
|
mobile: {
|
|
@@ -7,17 +7,11 @@ const getDisplayStyle = (device, display, position)=>{
|
|
|
7
7
|
const style = {
|
|
8
8
|
[`--top${device}`]: 'auto',
|
|
9
9
|
[`--${position + device}`]: '0',
|
|
10
|
-
[`--pos${device}`]:
|
|
10
|
+
[`--pos${device}`]: 'fixed'
|
|
11
11
|
};
|
|
12
12
|
if (display === 'after-first-cart-button') style[`--d${device}`] = 'none';
|
|
13
13
|
return style;
|
|
14
14
|
};
|
|
15
|
-
const getCSSPosition = (position, device)=>{
|
|
16
|
-
if (device === '-mobile' || device === '-tablet') {
|
|
17
|
-
return 'fixed';
|
|
18
|
-
}
|
|
19
|
-
return position == 'top' ? 'sticky' : 'fixed';
|
|
20
|
-
};
|
|
21
15
|
const displayConditionStyle = (display, position)=>{
|
|
22
16
|
return {
|
|
23
17
|
...getDisplayStyle('', display?.desktop, position?.desktop),
|
|
@@ -6,12 +6,6 @@ const useSticky = (setting)=>{
|
|
|
6
6
|
const w = makeStyleResponsive('w', width);
|
|
7
7
|
const sidebarMode = usePageStore((s)=>s.sidebarMode === 'interaction');
|
|
8
8
|
const currentDevice = useCurrentDevice();
|
|
9
|
-
const getCSSPosition = (position, forceFixed)=>{
|
|
10
|
-
if (forceFixed) {
|
|
11
|
-
return 'fixed';
|
|
12
|
-
}
|
|
13
|
-
return position == 'top' ? 'sticky' : 'fixed';
|
|
14
|
-
};
|
|
15
9
|
const getCSSAlignByDevice = (position, device)=>{
|
|
16
10
|
return {
|
|
17
11
|
[`--left${device}`]: position == 'top' ? '0' : '50%',
|
|
@@ -56,15 +50,11 @@ const useSticky = (setting)=>{
|
|
|
56
50
|
]);
|
|
57
51
|
const positionStyle = useMemo(()=>{
|
|
58
52
|
return {
|
|
59
|
-
[`--pos`]:
|
|
60
|
-
[`--pos-tablet`]:
|
|
61
|
-
[`--pos-mobile`]:
|
|
53
|
+
[`--pos`]: 'fixed',
|
|
54
|
+
[`--pos-tablet`]: 'fixed',
|
|
55
|
+
[`--pos-mobile`]: 'fixed'
|
|
62
56
|
};
|
|
63
|
-
}, [
|
|
64
|
-
position?.desktop,
|
|
65
|
-
position?.mobile,
|
|
66
|
-
position?.tablet
|
|
67
|
-
]);
|
|
57
|
+
}, []);
|
|
68
58
|
return {
|
|
69
59
|
w,
|
|
70
60
|
displayStyle,
|
|
@@ -21,6 +21,11 @@ const StickyPreset = {
|
|
|
21
21
|
{
|
|
22
22
|
tag: 'Sticky',
|
|
23
23
|
label: 'Sticky',
|
|
24
|
+
settings: {
|
|
25
|
+
width: {
|
|
26
|
+
desktop: '100%'
|
|
27
|
+
}
|
|
28
|
+
},
|
|
24
29
|
advanced: {
|
|
25
30
|
hasBoxShadow: {
|
|
26
31
|
desktop: {
|
|
@@ -30,7 +35,7 @@ const StickyPreset = {
|
|
|
30
35
|
boxShadow: {
|
|
31
36
|
desktop: {
|
|
32
37
|
normal: {
|
|
33
|
-
type: 'shadow-
|
|
38
|
+
type: 'shadow-2',
|
|
34
39
|
distance: '0px',
|
|
35
40
|
blur: '10px',
|
|
36
41
|
spread: '0px',
|