@gem-sdk/components 2.0.0-dev.711 → 2.0.0-dev.713
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/article/setting/configs/ArticleList/settings.js +2 -1
- package/dist/cjs/banner/setting/setting.js +5 -0
- package/dist/cjs/banner/setting/uiV2.js +24 -0
- package/dist/cjs/button/components/common/styles.js +107 -87
- package/dist/cjs/button/setting/configs/settings.js +1 -1
- package/dist/cjs/button/setting/configs/uiV2.js +1 -1
- package/dist/cjs/form/setting/submit-button/configs/settings.js +1 -2
- package/dist/esm/article/setting/configs/ArticleList/settings.js +2 -1
- package/dist/esm/banner/setting/setting.js +5 -0
- package/dist/esm/banner/setting/uiV2.js +24 -0
- package/dist/esm/button/components/common/styles.js +108 -88
- package/dist/esm/button/setting/configs/settings.js +1 -1
- package/dist/esm/button/setting/configs/uiV2.js +1 -1
- package/dist/esm/form/setting/submit-button/configs/settings.js +1 -2
- package/package.json +2 -2
|
@@ -49,6 +49,30 @@ const SettingUIV2 = [
|
|
|
49
49
|
newValue: 'bottom'
|
|
50
50
|
}
|
|
51
51
|
},
|
|
52
|
+
{
|
|
53
|
+
condition: `layout.cols.length == 1 && layout.type === 'center-distributed'`,
|
|
54
|
+
source: [
|
|
55
|
+
'layout'
|
|
56
|
+
],
|
|
57
|
+
action: {
|
|
58
|
+
controlId: 'contentPosition1Col',
|
|
59
|
+
groupType: 'style',
|
|
60
|
+
controlType: 'style',
|
|
61
|
+
newValue: 'space-between'
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
condition: `layout.cols.length > 1 && ( layout.type === 'left-distributed' || layout.type === 'right-distributed')`,
|
|
66
|
+
source: [
|
|
67
|
+
'layout'
|
|
68
|
+
],
|
|
69
|
+
action: {
|
|
70
|
+
controlId: 'contentPosition2Col',
|
|
71
|
+
groupType: 'style',
|
|
72
|
+
controlType: 'style',
|
|
73
|
+
newValue: 'space-between'
|
|
74
|
+
}
|
|
75
|
+
},
|
|
52
76
|
{
|
|
53
77
|
condition: `layout.cols.length > 1 && ( layout.type === 'left-top' || layout.type === 'right-top')`,
|
|
54
78
|
source: [
|
|
@@ -2,120 +2,140 @@
|
|
|
2
2
|
|
|
3
3
|
var core = require('@gem-sdk/core');
|
|
4
4
|
|
|
5
|
-
const getButtonWrapperStyles = (
|
|
6
|
-
...
|
|
7
|
-
...core.makeStyleResponsive('ta',
|
|
5
|
+
const getButtonWrapperStyles = (style1, styles1)=>({
|
|
6
|
+
...style1,
|
|
7
|
+
...core.makeStyleResponsive('ta', styles1?.align)
|
|
8
8
|
});
|
|
9
|
-
const getButtonStyles = (
|
|
10
|
-
|
|
11
|
-
...
|
|
12
|
-
...
|
|
13
|
-
...
|
|
14
|
-
...
|
|
15
|
-
|
|
16
|
-
|
|
9
|
+
const getButtonStyles = (styles1)=>{
|
|
10
|
+
return {
|
|
11
|
+
...getSizeStyles(styles1),
|
|
12
|
+
...getRadiusStyles(styles1),
|
|
13
|
+
...getShadowStyles(styles1),
|
|
14
|
+
...getBackgroundStyles(styles1),
|
|
15
|
+
...getTypographyStyles(styles1).textColorStyle
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
const getButtonIconStyles = (styles1, settings1)=>{
|
|
17
19
|
return {
|
|
18
|
-
...getIconSpacingStyle(
|
|
19
|
-
'--height-desktop': `${
|
|
20
|
-
'--height-tablet': `${
|
|
21
|
-
'--height-mobile': `${
|
|
20
|
+
...getIconSpacingStyle(styles1, settings1),
|
|
21
|
+
'--height-desktop': `${styles1?.size?.desktop}`,
|
|
22
|
+
'--height-tablet': `${styles1?.size?.desktop || styles1?.size?.tablet}`,
|
|
23
|
+
'--height-mobile': `${styles1?.size?.mobile || styles1?.size?.tablet || styles1?.size?.desktop}`
|
|
22
24
|
};
|
|
23
25
|
};
|
|
24
|
-
const isEnableShadowStateForDevice = (
|
|
25
|
-
normal:
|
|
26
|
-
hover:
|
|
26
|
+
const isEnableShadowStateForDevice = (deviceStyles1)=>({
|
|
27
|
+
normal: deviceStyles1?.normal?.type !== 'none',
|
|
28
|
+
hover: deviceStyles1?.hover?.type !== 'none'
|
|
27
29
|
});
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
+
const ignoreStateNoneValue = (obj, condition)=>{
|
|
31
|
+
return Object.entries(obj).reduce((acc, [key, value])=>{
|
|
32
|
+
if (![
|
|
33
|
+
'hover',
|
|
34
|
+
'focus',
|
|
35
|
+
'normal'
|
|
36
|
+
].includes(key) || eval(condition)) {
|
|
37
|
+
acc[key] = value;
|
|
38
|
+
}
|
|
39
|
+
return acc;
|
|
40
|
+
}, {});
|
|
41
|
+
};
|
|
42
|
+
const getShadowStyles = (styles1)=>{
|
|
43
|
+
const { boxShadowBtnV2: boxShadowBtnV21 } = styles1 || {};
|
|
44
|
+
const ignoreNoneValueObjectShadow1 = ignoreStateNoneValue(boxShadowBtnV21 || {}, 'value?.enable !== false');
|
|
30
45
|
return {
|
|
31
|
-
...core.getStyleShadowState(
|
|
46
|
+
...core.getStyleShadowState(ignoreNoneValueObjectShadow1, 'box-shadow', isEnableShadowStateForDevice(boxShadowBtnV21))
|
|
32
47
|
};
|
|
33
48
|
};
|
|
34
|
-
const getRadiusStyles = (
|
|
35
|
-
const
|
|
36
|
-
|
|
49
|
+
const getRadiusStyles = (styles1)=>{
|
|
50
|
+
const ignoreNoneValueObject1 = ignoreStateNoneValue(styles1?.roundedBtnV2 || {}, 'value?.radiusType !== "none"');
|
|
51
|
+
return core.composeRadius(ignoreNoneValueObject1);
|
|
52
|
+
};
|
|
53
|
+
const getIconSpacingStyle = (styles1, settings1)=>{
|
|
54
|
+
const spacing1 = styles1?.iconSpacing || {
|
|
37
55
|
desktop: '8px'
|
|
38
56
|
};
|
|
39
|
-
return
|
|
57
|
+
return settings1?.iconAlign === 'left' ? core.makeStyleResponsive('mr', spacing1) : core.makeStyleResponsive('ml', spacing1);
|
|
40
58
|
};
|
|
41
|
-
const getSizeStyles = (
|
|
42
|
-
const
|
|
59
|
+
const getSizeStyles = (styles1)=>{
|
|
60
|
+
const composeGlobalSize1 = core.makeGlobalSize(styles1?.globalSize);
|
|
43
61
|
return {
|
|
44
|
-
...
|
|
45
|
-
...
|
|
46
|
-
...
|
|
62
|
+
...composeGlobalSize1.width,
|
|
63
|
+
...composeGlobalSize1.height,
|
|
64
|
+
...composeGlobalSize1.padding
|
|
47
65
|
};
|
|
48
66
|
};
|
|
49
|
-
const getTypographyStyles = (
|
|
50
|
-
const
|
|
51
|
-
const
|
|
52
|
-
'--c':
|
|
67
|
+
const getTypographyStyles = (styles1)=>{
|
|
68
|
+
const typographyStyle1 = core.composeTypographyStyle(styles1?.typo, styles1?.typography);
|
|
69
|
+
const colorObj1 = {
|
|
70
|
+
'--c': typographyStyle1?.['--c']
|
|
53
71
|
};
|
|
54
|
-
const
|
|
55
|
-
...
|
|
72
|
+
const otherProps1 = {
|
|
73
|
+
...typographyStyle1
|
|
56
74
|
};
|
|
57
|
-
delete
|
|
75
|
+
delete otherProps1['--c'];
|
|
58
76
|
return {
|
|
59
77
|
textColorStyle: {
|
|
60
|
-
|
|
61
|
-
...
|
|
78
|
+
'--hvr-c': core.getColor(styles1?.textColorHover?.hover),
|
|
79
|
+
...colorObj1
|
|
62
80
|
},
|
|
63
|
-
withoutTextColorStyles:
|
|
81
|
+
withoutTextColorStyles: otherProps1
|
|
64
82
|
};
|
|
65
83
|
};
|
|
66
|
-
const getTypoStyles = (
|
|
84
|
+
const getTypoStyles = (styles1)=>{
|
|
67
85
|
return {
|
|
68
|
-
...getTypographyStyles(
|
|
86
|
+
...getTypographyStyles(styles1).withoutTextColorStyles,
|
|
69
87
|
...core.getStyleShadow({
|
|
70
88
|
styleAppliedFor: 'text-shadow',
|
|
71
|
-
value:
|
|
72
|
-
isEnableShadow:
|
|
89
|
+
value: styles1?.typo?.custom?.textShadow,
|
|
90
|
+
isEnableShadow: styles1?.typo?.custom?.hasShadowText
|
|
73
91
|
})
|
|
74
92
|
};
|
|
75
93
|
};
|
|
76
|
-
const getBackgroundStyles = (
|
|
94
|
+
const getBackgroundStyles = (styles1)=>{
|
|
77
95
|
return {
|
|
78
|
-
...core.getStyleBackgroundImage(
|
|
79
|
-
...core.getGlobalColorStateStyle('bg',
|
|
96
|
+
...core.getStyleBackgroundImage(styles1?.backgroundImage),
|
|
97
|
+
...core.getGlobalColorStateStyle('bg', styles1?.backgroundColorV2)
|
|
80
98
|
};
|
|
81
99
|
};
|
|
82
|
-
const getCustomCssStyles = ({ styles, uid, builderAttrs })=>{
|
|
83
|
-
if (!
|
|
84
|
-
const { borderBtnV2, roundedBtnV2 } =
|
|
85
|
-
const
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
100
|
+
const getCustomCssStyles = ({ styles: styles1, uid: uid1, builderAttrs: builderAttrs1 })=>{
|
|
101
|
+
if (!uid1) return '';
|
|
102
|
+
const { borderBtnV2: borderBtnV21, roundedBtnV2: roundedBtnV21 } = styles1 ?? {};
|
|
103
|
+
const borderBtnIgnoreNoneValue1 = ignoreStateNoneValue(borderBtnV21 || {}, 'value?.borderType !== "none"');
|
|
104
|
+
const roundedBtnIgnoreNoneValue1 = ignoreStateNoneValue(roundedBtnV21 || {}, 'value?.radiusType !== "none"');
|
|
105
|
+
const borderCornerStyles1 = generateBorderCornerStyles({
|
|
106
|
+
uid: uid1,
|
|
107
|
+
borderBtn: borderBtnIgnoreNoneValue1,
|
|
108
|
+
roundedBtn: roundedBtnIgnoreNoneValue1,
|
|
109
|
+
builderAttrs: builderAttrs1
|
|
90
110
|
});
|
|
91
111
|
return `
|
|
92
|
-
${
|
|
93
|
-
${
|
|
112
|
+
${borderCornerStyles1.normalStyles}
|
|
113
|
+
${borderCornerStyles1.hoverStyles}
|
|
94
114
|
`.trim();
|
|
95
115
|
};
|
|
96
|
-
const generateBorderCornerStyles = ({ uid, borderBtn, roundedBtn, builderAttrs })=>{
|
|
97
|
-
const
|
|
98
|
-
const
|
|
99
|
-
if (!
|
|
100
|
-
return
|
|
116
|
+
const generateBorderCornerStyles = ({ uid: uid1, borderBtn: borderBtn1, roundedBtn: roundedBtn1, builderAttrs: builderAttrs1 })=>{
|
|
117
|
+
const tag1 = builderAttrs1?.['data-component-tag'];
|
|
118
|
+
const getResponsiveStyles1 = ({ styleObj: styleObj1, state: state1 })=>{
|
|
119
|
+
if (!styleObj1) return undefined;
|
|
120
|
+
return styleObj1?.[state1];
|
|
101
121
|
};
|
|
102
|
-
const
|
|
103
|
-
styleObj:
|
|
122
|
+
const normalBorder1 = getResponsiveStyles1({
|
|
123
|
+
styleObj: borderBtn1,
|
|
104
124
|
state: 'normal'
|
|
105
125
|
});
|
|
106
|
-
const
|
|
107
|
-
styleObj:
|
|
126
|
+
const hoverBorder1 = getResponsiveStyles1({
|
|
127
|
+
styleObj: borderBtn1,
|
|
108
128
|
state: 'hover'
|
|
109
129
|
});
|
|
110
|
-
const
|
|
111
|
-
styleObj:
|
|
130
|
+
const normalCorner1 = getResponsiveStyles1({
|
|
131
|
+
styleObj: roundedBtn1,
|
|
112
132
|
state: 'normal'
|
|
113
133
|
});
|
|
114
|
-
const
|
|
115
|
-
styleObj:
|
|
134
|
+
const hoverCorner1 = getResponsiveStyles1({
|
|
135
|
+
styleObj: roundedBtn1,
|
|
116
136
|
state: 'hover'
|
|
117
137
|
});
|
|
118
|
-
const
|
|
138
|
+
const baseStyle1 = `
|
|
119
139
|
content: "";
|
|
120
140
|
height: 100%;
|
|
121
141
|
width: 100%;
|
|
@@ -123,30 +143,30 @@ const generateBorderCornerStyles = ({ uid, borderBtn, roundedBtn, builderAttrs }
|
|
|
123
143
|
pointer-events: none;
|
|
124
144
|
top: 0;
|
|
125
145
|
left: 0;
|
|
126
|
-
${core.composeBorderCss(
|
|
127
|
-
${core.composeCornerCss(
|
|
146
|
+
${core.composeBorderCss(normalBorder1)}
|
|
147
|
+
${core.composeCornerCss(normalCorner1)}
|
|
128
148
|
`;
|
|
129
|
-
let
|
|
130
|
-
.${
|
|
131
|
-
${
|
|
149
|
+
let normalStyles1 = `
|
|
150
|
+
.${uid1}.gp-button-base::before {
|
|
151
|
+
${baseStyle1}
|
|
132
152
|
}
|
|
133
153
|
`;
|
|
134
|
-
if (
|
|
135
|
-
const
|
|
136
|
-
|
|
137
|
-
[data-is-in-stock="${
|
|
138
|
-
${
|
|
154
|
+
if (tag1 === 'ProductButton') {
|
|
155
|
+
const isInStock1 = builderAttrs1?.['data-is-in-stock'] ?? false;
|
|
156
|
+
normalStyles1 = `
|
|
157
|
+
[data-is-in-stock="${isInStock1}"]>.${uid1}.gp-button-base::before {
|
|
158
|
+
${baseStyle1}
|
|
139
159
|
`;
|
|
140
160
|
}
|
|
141
|
-
const
|
|
142
|
-
.${
|
|
143
|
-
${core.composeBorderCss(
|
|
144
|
-
${core.composeCornerCss(
|
|
161
|
+
const hoverStyles1 = `
|
|
162
|
+
.${uid1}:hover::before {
|
|
163
|
+
${core.composeBorderCss(hoverBorder1)}
|
|
164
|
+
${core.composeCornerCss(hoverCorner1)}
|
|
145
165
|
}
|
|
146
166
|
`;
|
|
147
167
|
return {
|
|
148
|
-
normalStyles,
|
|
149
|
-
hoverStyles
|
|
168
|
+
normalStyles: normalStyles1,
|
|
169
|
+
hoverStyles: hoverStyles1
|
|
150
170
|
};
|
|
151
171
|
};
|
|
152
172
|
|
|
@@ -47,7 +47,7 @@ const SubmitButtonSettings = [
|
|
|
47
47
|
id: 'label',
|
|
48
48
|
label: 'Text',
|
|
49
49
|
type: 'input',
|
|
50
|
-
default: 'Submit'
|
|
50
|
+
default: '<p>Submit</p>'
|
|
51
51
|
},
|
|
52
52
|
{
|
|
53
53
|
id: 'translate',
|
|
@@ -367,7 +367,6 @@ const SubmitButtonSettings = [
|
|
|
367
367
|
type: 'paragraph-1'
|
|
368
368
|
},
|
|
369
369
|
hiddenSetting: {
|
|
370
|
-
transform: true,
|
|
371
370
|
textAlign: true
|
|
372
371
|
},
|
|
373
372
|
ignoreReRender: true
|
|
@@ -47,6 +47,30 @@ const SettingUIV2 = [
|
|
|
47
47
|
newValue: 'bottom'
|
|
48
48
|
}
|
|
49
49
|
},
|
|
50
|
+
{
|
|
51
|
+
condition: `layout.cols.length == 1 && layout.type === 'center-distributed'`,
|
|
52
|
+
source: [
|
|
53
|
+
'layout'
|
|
54
|
+
],
|
|
55
|
+
action: {
|
|
56
|
+
controlId: 'contentPosition1Col',
|
|
57
|
+
groupType: 'style',
|
|
58
|
+
controlType: 'style',
|
|
59
|
+
newValue: 'space-between'
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
condition: `layout.cols.length > 1 && ( layout.type === 'left-distributed' || layout.type === 'right-distributed')`,
|
|
64
|
+
source: [
|
|
65
|
+
'layout'
|
|
66
|
+
],
|
|
67
|
+
action: {
|
|
68
|
+
controlId: 'contentPosition2Col',
|
|
69
|
+
groupType: 'style',
|
|
70
|
+
controlType: 'style',
|
|
71
|
+
newValue: 'space-between'
|
|
72
|
+
}
|
|
73
|
+
},
|
|
50
74
|
{
|
|
51
75
|
condition: `layout.cols.length > 1 && ( layout.type === 'left-top' || layout.type === 'right-top')`,
|
|
52
76
|
source: [
|
|
@@ -1,119 +1,139 @@
|
|
|
1
|
-
import { makeStyleResponsive, getStyleShadowState, composeRadius, makeGlobalSize, composeTypographyStyle,
|
|
1
|
+
import { makeStyleResponsive, getStyleShadowState, composeRadius, makeGlobalSize, composeTypographyStyle, getColor, getStyleShadow, getStyleBackgroundImage, getGlobalColorStateStyle, composeBorderCss, composeCornerCss } from '@gem-sdk/core';
|
|
2
2
|
|
|
3
|
-
const getButtonWrapperStyles = (
|
|
4
|
-
...
|
|
5
|
-
...makeStyleResponsive('ta',
|
|
3
|
+
const getButtonWrapperStyles = (style1, styles1)=>({
|
|
4
|
+
...style1,
|
|
5
|
+
...makeStyleResponsive('ta', styles1?.align)
|
|
6
6
|
});
|
|
7
|
-
const getButtonStyles = (
|
|
8
|
-
|
|
9
|
-
...
|
|
10
|
-
...
|
|
11
|
-
...
|
|
12
|
-
...
|
|
13
|
-
|
|
14
|
-
|
|
7
|
+
const getButtonStyles = (styles1)=>{
|
|
8
|
+
return {
|
|
9
|
+
...getSizeStyles(styles1),
|
|
10
|
+
...getRadiusStyles(styles1),
|
|
11
|
+
...getShadowStyles(styles1),
|
|
12
|
+
...getBackgroundStyles(styles1),
|
|
13
|
+
...getTypographyStyles(styles1).textColorStyle
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
const getButtonIconStyles = (styles1, settings1)=>{
|
|
15
17
|
return {
|
|
16
|
-
...getIconSpacingStyle(
|
|
17
|
-
'--height-desktop': `${
|
|
18
|
-
'--height-tablet': `${
|
|
19
|
-
'--height-mobile': `${
|
|
18
|
+
...getIconSpacingStyle(styles1, settings1),
|
|
19
|
+
'--height-desktop': `${styles1?.size?.desktop}`,
|
|
20
|
+
'--height-tablet': `${styles1?.size?.desktop || styles1?.size?.tablet}`,
|
|
21
|
+
'--height-mobile': `${styles1?.size?.mobile || styles1?.size?.tablet || styles1?.size?.desktop}`
|
|
20
22
|
};
|
|
21
23
|
};
|
|
22
|
-
const isEnableShadowStateForDevice = (
|
|
23
|
-
normal:
|
|
24
|
-
hover:
|
|
24
|
+
const isEnableShadowStateForDevice = (deviceStyles1)=>({
|
|
25
|
+
normal: deviceStyles1?.normal?.type !== 'none',
|
|
26
|
+
hover: deviceStyles1?.hover?.type !== 'none'
|
|
25
27
|
});
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
+
const ignoreStateNoneValue = (obj, condition)=>{
|
|
29
|
+
return Object.entries(obj).reduce((acc, [key, value])=>{
|
|
30
|
+
if (![
|
|
31
|
+
'hover',
|
|
32
|
+
'focus',
|
|
33
|
+
'normal'
|
|
34
|
+
].includes(key) || eval(condition)) {
|
|
35
|
+
acc[key] = value;
|
|
36
|
+
}
|
|
37
|
+
return acc;
|
|
38
|
+
}, {});
|
|
39
|
+
};
|
|
40
|
+
const getShadowStyles = (styles1)=>{
|
|
41
|
+
const { boxShadowBtnV2: boxShadowBtnV21 } = styles1 || {};
|
|
42
|
+
const ignoreNoneValueObjectShadow1 = ignoreStateNoneValue(boxShadowBtnV21 || {}, 'value?.enable !== false');
|
|
28
43
|
return {
|
|
29
|
-
...getStyleShadowState(
|
|
44
|
+
...getStyleShadowState(ignoreNoneValueObjectShadow1, 'box-shadow', isEnableShadowStateForDevice(boxShadowBtnV21))
|
|
30
45
|
};
|
|
31
46
|
};
|
|
32
|
-
const getRadiusStyles = (
|
|
33
|
-
const
|
|
34
|
-
|
|
47
|
+
const getRadiusStyles = (styles1)=>{
|
|
48
|
+
const ignoreNoneValueObject1 = ignoreStateNoneValue(styles1?.roundedBtnV2 || {}, 'value?.radiusType !== "none"');
|
|
49
|
+
return composeRadius(ignoreNoneValueObject1);
|
|
50
|
+
};
|
|
51
|
+
const getIconSpacingStyle = (styles1, settings1)=>{
|
|
52
|
+
const spacing1 = styles1?.iconSpacing || {
|
|
35
53
|
desktop: '8px'
|
|
36
54
|
};
|
|
37
|
-
return
|
|
55
|
+
return settings1?.iconAlign === 'left' ? makeStyleResponsive('mr', spacing1) : makeStyleResponsive('ml', spacing1);
|
|
38
56
|
};
|
|
39
|
-
const getSizeStyles = (
|
|
40
|
-
const
|
|
57
|
+
const getSizeStyles = (styles1)=>{
|
|
58
|
+
const composeGlobalSize1 = makeGlobalSize(styles1?.globalSize);
|
|
41
59
|
return {
|
|
42
|
-
...
|
|
43
|
-
...
|
|
44
|
-
...
|
|
60
|
+
...composeGlobalSize1.width,
|
|
61
|
+
...composeGlobalSize1.height,
|
|
62
|
+
...composeGlobalSize1.padding
|
|
45
63
|
};
|
|
46
64
|
};
|
|
47
|
-
const getTypographyStyles = (
|
|
48
|
-
const
|
|
49
|
-
const
|
|
50
|
-
'--c':
|
|
65
|
+
const getTypographyStyles = (styles1)=>{
|
|
66
|
+
const typographyStyle1 = composeTypographyStyle(styles1?.typo, styles1?.typography);
|
|
67
|
+
const colorObj1 = {
|
|
68
|
+
'--c': typographyStyle1?.['--c']
|
|
51
69
|
};
|
|
52
|
-
const
|
|
53
|
-
...
|
|
70
|
+
const otherProps1 = {
|
|
71
|
+
...typographyStyle1
|
|
54
72
|
};
|
|
55
|
-
delete
|
|
73
|
+
delete otherProps1['--c'];
|
|
56
74
|
return {
|
|
57
75
|
textColorStyle: {
|
|
58
|
-
|
|
59
|
-
...
|
|
76
|
+
'--hvr-c': getColor(styles1?.textColorHover?.hover),
|
|
77
|
+
...colorObj1
|
|
60
78
|
},
|
|
61
|
-
withoutTextColorStyles:
|
|
79
|
+
withoutTextColorStyles: otherProps1
|
|
62
80
|
};
|
|
63
81
|
};
|
|
64
|
-
const getTypoStyles = (
|
|
82
|
+
const getTypoStyles = (styles1)=>{
|
|
65
83
|
return {
|
|
66
|
-
...getTypographyStyles(
|
|
84
|
+
...getTypographyStyles(styles1).withoutTextColorStyles,
|
|
67
85
|
...getStyleShadow({
|
|
68
86
|
styleAppliedFor: 'text-shadow',
|
|
69
|
-
value:
|
|
70
|
-
isEnableShadow:
|
|
87
|
+
value: styles1?.typo?.custom?.textShadow,
|
|
88
|
+
isEnableShadow: styles1?.typo?.custom?.hasShadowText
|
|
71
89
|
})
|
|
72
90
|
};
|
|
73
91
|
};
|
|
74
|
-
const getBackgroundStyles = (
|
|
92
|
+
const getBackgroundStyles = (styles1)=>{
|
|
75
93
|
return {
|
|
76
|
-
...getStyleBackgroundImage(
|
|
77
|
-
...getGlobalColorStateStyle('bg',
|
|
94
|
+
...getStyleBackgroundImage(styles1?.backgroundImage),
|
|
95
|
+
...getGlobalColorStateStyle('bg', styles1?.backgroundColorV2)
|
|
78
96
|
};
|
|
79
97
|
};
|
|
80
|
-
const getCustomCssStyles = ({ styles, uid, builderAttrs })=>{
|
|
81
|
-
if (!
|
|
82
|
-
const { borderBtnV2, roundedBtnV2 } =
|
|
83
|
-
const
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
98
|
+
const getCustomCssStyles = ({ styles: styles1, uid: uid1, builderAttrs: builderAttrs1 })=>{
|
|
99
|
+
if (!uid1) return '';
|
|
100
|
+
const { borderBtnV2: borderBtnV21, roundedBtnV2: roundedBtnV21 } = styles1 ?? {};
|
|
101
|
+
const borderBtnIgnoreNoneValue1 = ignoreStateNoneValue(borderBtnV21 || {}, 'value?.borderType !== "none"');
|
|
102
|
+
const roundedBtnIgnoreNoneValue1 = ignoreStateNoneValue(roundedBtnV21 || {}, 'value?.radiusType !== "none"');
|
|
103
|
+
const borderCornerStyles1 = generateBorderCornerStyles({
|
|
104
|
+
uid: uid1,
|
|
105
|
+
borderBtn: borderBtnIgnoreNoneValue1,
|
|
106
|
+
roundedBtn: roundedBtnIgnoreNoneValue1,
|
|
107
|
+
builderAttrs: builderAttrs1
|
|
88
108
|
});
|
|
89
109
|
return `
|
|
90
|
-
${
|
|
91
|
-
${
|
|
110
|
+
${borderCornerStyles1.normalStyles}
|
|
111
|
+
${borderCornerStyles1.hoverStyles}
|
|
92
112
|
`.trim();
|
|
93
113
|
};
|
|
94
|
-
const generateBorderCornerStyles = ({ uid, borderBtn, roundedBtn, builderAttrs })=>{
|
|
95
|
-
const
|
|
96
|
-
const
|
|
97
|
-
if (!
|
|
98
|
-
return
|
|
114
|
+
const generateBorderCornerStyles = ({ uid: uid1, borderBtn: borderBtn1, roundedBtn: roundedBtn1, builderAttrs: builderAttrs1 })=>{
|
|
115
|
+
const tag1 = builderAttrs1?.['data-component-tag'];
|
|
116
|
+
const getResponsiveStyles1 = ({ styleObj: styleObj1, state: state1 })=>{
|
|
117
|
+
if (!styleObj1) return undefined;
|
|
118
|
+
return styleObj1?.[state1];
|
|
99
119
|
};
|
|
100
|
-
const
|
|
101
|
-
styleObj:
|
|
120
|
+
const normalBorder1 = getResponsiveStyles1({
|
|
121
|
+
styleObj: borderBtn1,
|
|
102
122
|
state: 'normal'
|
|
103
123
|
});
|
|
104
|
-
const
|
|
105
|
-
styleObj:
|
|
124
|
+
const hoverBorder1 = getResponsiveStyles1({
|
|
125
|
+
styleObj: borderBtn1,
|
|
106
126
|
state: 'hover'
|
|
107
127
|
});
|
|
108
|
-
const
|
|
109
|
-
styleObj:
|
|
128
|
+
const normalCorner1 = getResponsiveStyles1({
|
|
129
|
+
styleObj: roundedBtn1,
|
|
110
130
|
state: 'normal'
|
|
111
131
|
});
|
|
112
|
-
const
|
|
113
|
-
styleObj:
|
|
132
|
+
const hoverCorner1 = getResponsiveStyles1({
|
|
133
|
+
styleObj: roundedBtn1,
|
|
114
134
|
state: 'hover'
|
|
115
135
|
});
|
|
116
|
-
const
|
|
136
|
+
const baseStyle1 = `
|
|
117
137
|
content: "";
|
|
118
138
|
height: 100%;
|
|
119
139
|
width: 100%;
|
|
@@ -121,30 +141,30 @@ const generateBorderCornerStyles = ({ uid, borderBtn, roundedBtn, builderAttrs }
|
|
|
121
141
|
pointer-events: none;
|
|
122
142
|
top: 0;
|
|
123
143
|
left: 0;
|
|
124
|
-
${composeBorderCss(
|
|
125
|
-
${composeCornerCss(
|
|
144
|
+
${composeBorderCss(normalBorder1)}
|
|
145
|
+
${composeCornerCss(normalCorner1)}
|
|
126
146
|
`;
|
|
127
|
-
let
|
|
128
|
-
.${
|
|
129
|
-
${
|
|
147
|
+
let normalStyles1 = `
|
|
148
|
+
.${uid1}.gp-button-base::before {
|
|
149
|
+
${baseStyle1}
|
|
130
150
|
}
|
|
131
151
|
`;
|
|
132
|
-
if (
|
|
133
|
-
const
|
|
134
|
-
|
|
135
|
-
[data-is-in-stock="${
|
|
136
|
-
${
|
|
152
|
+
if (tag1 === 'ProductButton') {
|
|
153
|
+
const isInStock1 = builderAttrs1?.['data-is-in-stock'] ?? false;
|
|
154
|
+
normalStyles1 = `
|
|
155
|
+
[data-is-in-stock="${isInStock1}"]>.${uid1}.gp-button-base::before {
|
|
156
|
+
${baseStyle1}
|
|
137
157
|
`;
|
|
138
158
|
}
|
|
139
|
-
const
|
|
140
|
-
.${
|
|
141
|
-
${composeBorderCss(
|
|
142
|
-
${composeCornerCss(
|
|
159
|
+
const hoverStyles1 = `
|
|
160
|
+
.${uid1}:hover::before {
|
|
161
|
+
${composeBorderCss(hoverBorder1)}
|
|
162
|
+
${composeCornerCss(hoverCorner1)}
|
|
143
163
|
}
|
|
144
164
|
`;
|
|
145
165
|
return {
|
|
146
|
-
normalStyles,
|
|
147
|
-
hoverStyles
|
|
166
|
+
normalStyles: normalStyles1,
|
|
167
|
+
hoverStyles: hoverStyles1
|
|
148
168
|
};
|
|
149
169
|
};
|
|
150
170
|
|
|
@@ -43,7 +43,7 @@ const SubmitButtonSettings = [
|
|
|
43
43
|
id: 'label',
|
|
44
44
|
label: 'Text',
|
|
45
45
|
type: 'input',
|
|
46
|
-
default: 'Submit'
|
|
46
|
+
default: '<p>Submit</p>'
|
|
47
47
|
},
|
|
48
48
|
{
|
|
49
49
|
id: 'translate',
|
|
@@ -363,7 +363,6 @@ const SubmitButtonSettings = [
|
|
|
363
363
|
type: 'paragraph-1'
|
|
364
364
|
},
|
|
365
365
|
hiddenSetting: {
|
|
366
|
-
transform: true,
|
|
367
366
|
textAlign: true
|
|
368
367
|
},
|
|
369
368
|
ignoreReRender: true
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gem-sdk/components",
|
|
3
|
-
"version": "2.0.0-dev.
|
|
3
|
+
"version": "2.0.0-dev.713",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "dist/cjs/index.js",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"scan-all-text": "rollup -c ./scripts/rollup.config.settings.mjs && node ./scripts/scan-all-text && node ./scripts/scan-all-text"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@gem-sdk/core": "2.0.0-dev.
|
|
28
|
+
"@gem-sdk/core": "2.0.0-dev.713",
|
|
29
29
|
"@gem-sdk/styles": "2.0.0-dev.703",
|
|
30
30
|
"@gem-sdk/system": "2.0.0-dev.695",
|
|
31
31
|
"@types/react-transition-group": "^4.4.5",
|