@gem-sdk/components 2.0.0-dev.420 → 2.0.0-dev.421

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.
@@ -9,7 +9,7 @@ var composeStyles = require('./common/composeStyles.js');
9
9
  var composeClasses = require('./common/composeClasses.js');
10
10
 
11
11
  const FormEmail = ({ builderProps, builderAttrs, setting, advanced, children, styles })=>{
12
- const { placeholder, required, defaultEmail, hideOnClient, title, showTitle } = setting ?? {};
12
+ const { placeholder, required, title, showTitle } = setting ?? {};
13
13
  const name = 'contact[email]';
14
14
  const containerStyles = system.createStyle(composeStyles.composeContainerStyles(setting, advanced));
15
15
  const innerStyles = system.createStyle(composeStyles.composeInnerStyles(setting, advanced, styles));
@@ -38,10 +38,7 @@ const FormEmail = ({ builderProps, builderAttrs, setting, advanced, children, st
38
38
  placeholder: placeholder,
39
39
  name: name,
40
40
  required: required,
41
- autoComplete: "email",
42
- ...hideOnClient && {
43
- value: defaultEmail
44
- }
41
+ autoComplete: "email"
45
42
  }),
46
43
  children
47
44
  ]
@@ -29,7 +29,7 @@ const composeContainerStyles = (setting, advanced)=>{
29
29
  const composeInnerStyles = (setting, advanced, styles)=>{
30
30
  const { border, rounded, hasBoxShadow, boxShadow } = advanced ?? {};
31
31
  const { wrapperBorder, borderRadius, globalSize, boxShadowEmailHover, boxShadowEmailActive, roundedEmailHover, textColorActive, roundedEmailActive, textColorHover, borderEmailHover, borderEmailActive, backgroundColorV2Active, backgroundColorV2Hover } = styles ?? {};
32
- const { typography, size, width, background } = setting ?? {};
32
+ const { typography, size, background } = setting ?? {};
33
33
  const inputStyle = core.composeAdvanceStyle({
34
34
  border,
35
35
  rounded,
@@ -37,7 +37,6 @@ const composeInnerStyles = (setting, advanced, styles)=>{
37
37
  boxShadow
38
38
  });
39
39
  const appendTypoStyle = core.composeTypographyStyle(setting?.typo, typography);
40
- const inputWidth = core.makeStyleResponsive('w', core.makeWidth(width));
41
40
  const composeGlobalSize = core.makeGlobalSize(globalSize);
42
41
  return composeStyles({
43
42
  ...composeGlobalSize?.width?.['--w'] ? composeGlobalSize.width : {
@@ -51,7 +50,6 @@ const composeInnerStyles = (setting, advanced, styles)=>{
51
50
  ...!size?.type ? core.composeSize(size?.custom) : {},
52
51
  ...core.getBorderStyle(wrapperBorder),
53
52
  ...core.getBorderRadiusStyle(borderRadius),
54
- ...inputWidth,
55
53
  ...inputStyle,
56
54
  ...core.getStyleShadow({
57
55
  value: boxShadow,
@@ -43,19 +43,16 @@ const FormEmailSettings = [
43
43
  },
44
44
  {
45
45
  id: 'typo',
46
+ label: 'Text styles',
46
47
  type: 'typography-v2',
47
- label: 'typography',
48
48
  default: {
49
49
  type: 'paragraph-1'
50
50
  },
51
51
  hiddenSetting: {
52
52
  color: true,
53
53
  textAlign: true,
54
- textShadow: true,
55
- fontWeight: true,
56
- transform: true
54
+ textShadow: true
57
55
  },
58
- disableCollapse: true,
59
56
  ignoreReRender: true
60
57
  },
61
58
  {
@@ -121,6 +118,39 @@ const FormEmailSettings = [
121
118
  }
122
119
  }
123
120
  }
121
+ },
122
+ {
123
+ id: 'align',
124
+ label: 'Alignment',
125
+ type: 'option:value',
126
+ options: [
127
+ {
128
+ label: 'Left',
129
+ value: 'left',
130
+ type: 'align',
131
+ tooltip: 'Align left',
132
+ iconName: 'gp-align-left'
133
+ },
134
+ {
135
+ label: 'Center',
136
+ value: 'center',
137
+ type: 'align',
138
+ tooltip: 'Align center',
139
+ iconName: 'gp-align-center'
140
+ },
141
+ {
142
+ label: 'Right',
143
+ value: 'right',
144
+ type: 'align',
145
+ tooltip: 'Align right',
146
+ iconName: 'gp-align-right'
147
+ }
148
+ ],
149
+ devices: {
150
+ desktop: {
151
+ default: 'left'
152
+ }
153
+ }
124
154
  }
125
155
  ]
126
156
  },
@@ -137,10 +167,10 @@ const FormEmailSettings = [
137
167
  height: 'Auto',
138
168
  padding: {
139
169
  type: 'medium',
140
- top: '4px',
141
- bottom: '4px',
142
- left: '16px',
143
- right: '16px'
170
+ top: '12px',
171
+ bottom: '12px',
172
+ left: '12px',
173
+ right: '12px'
144
174
  }
145
175
  }
146
176
  }
@@ -71,27 +71,24 @@ const SettingUIV2 = [
71
71
  },
72
72
  layout: 'horizontal'
73
73
  },
74
- {
75
- label: {
76
- en: 'Height'
77
- },
78
- controlConfig: {
79
- id: 'height',
80
- type: 'dropdown:input',
81
- label: 'Height',
82
- inputType: 'number',
83
- units: [
84
- 'px',
85
- '%'
86
- ],
87
- hideUnit: false,
88
- linkWithSetting: {
89
- name: 'globalSize',
90
- field: 'height'
91
- }
92
- },
93
- layout: 'horizontal'
94
- },
74
+ // {
75
+ // label: {
76
+ // en: 'Height',
77
+ // },
78
+ // controlConfig: {
79
+ // id: 'height',
80
+ // type: 'dropdown:input',
81
+ // label: 'Height',
82
+ // inputType: 'number',
83
+ // units: ['px', '%'],
84
+ // hideUnit: false,
85
+ // linkWithSetting: {
86
+ // name: 'globalSize',
87
+ // field: 'height',
88
+ // },
89
+ // },
90
+ // layout: 'horizontal',
91
+ // },
95
92
  {
96
93
  label: {
97
94
  en: 'Padding'
@@ -341,6 +338,24 @@ const SettingUIV2 = [
341
338
  conditionDisplay: 'hideOnClient === true'
342
339
  }
343
340
  ]
341
+ },
342
+ {
343
+ controls: [
344
+ {
345
+ label: {
346
+ en: 'Align'
347
+ },
348
+ conditionEnable: '!(parseInt(globalSize.width) >= 100 && globalSize.width?.includes("%"))',
349
+ setting: {
350
+ id: 'align'
351
+ },
352
+ options: {
353
+ labelVariant: 'primary',
354
+ fullWidth: true,
355
+ disableMessage: `Align is not supported when width is 100%`
356
+ }
357
+ }
358
+ ]
344
359
  }
345
360
  ];
346
361
 
@@ -84,27 +84,24 @@ const SettingUIV2 = [
84
84
  },
85
85
  layout: 'horizontal'
86
86
  },
87
- {
88
- label: {
89
- en: 'Height'
90
- },
91
- controlConfig: {
92
- id: 'height',
93
- type: 'dropdown:input',
94
- label: 'Height',
95
- inputType: 'number',
96
- units: [
97
- 'px',
98
- '%'
99
- ],
100
- hideUnit: false,
101
- linkWithSetting: {
102
- name: 'globalSize',
103
- field: 'height'
104
- }
105
- },
106
- layout: 'horizontal'
107
- },
87
+ // {
88
+ // label: {
89
+ // en: 'Height',
90
+ // },
91
+ // controlConfig: {
92
+ // id: 'height',
93
+ // type: 'dropdown:input',
94
+ // label: 'Height',
95
+ // inputType: 'number',
96
+ // units: ['px', '%'],
97
+ // hideUnit: false,
98
+ // linkWithSetting: {
99
+ // name: 'globalSize',
100
+ // field: 'height',
101
+ // },
102
+ // },
103
+ // layout: 'horizontal',
104
+ // },
108
105
  {
109
106
  label: {
110
107
  en: 'Padding'
@@ -160,7 +157,7 @@ const SettingUIV2 = [
160
157
  label: {
161
158
  en: 'Align'
162
159
  },
163
- conditionEnable: '!(parseInt(width) >= 100 && width?.includes("%"))',
160
+ conditionEnable: '!(parseInt(globalSize.width) >= 100 && globalSize.width?.includes("%"))',
164
161
  setting: {
165
162
  id: 'align'
166
163
  },
@@ -5,7 +5,7 @@ import { composeContainerStyles, composeInnerStyles } from './common/composeStyl
5
5
  import { composeContainerClasses, composeInnerClasses, getClassTitle } from './common/composeClasses.js';
6
6
 
7
7
  const FormEmail = ({ builderProps, builderAttrs, setting, advanced, children, styles })=>{
8
- const { placeholder, required, defaultEmail, hideOnClient, title, showTitle } = setting ?? {};
8
+ const { placeholder, required, title, showTitle } = setting ?? {};
9
9
  const name = 'contact[email]';
10
10
  const containerStyles = createStyle(composeContainerStyles(setting, advanced));
11
11
  const innerStyles = createStyle(composeInnerStyles(setting, advanced, styles));
@@ -34,10 +34,7 @@ const FormEmail = ({ builderProps, builderAttrs, setting, advanced, children, st
34
34
  placeholder: placeholder,
35
35
  name: name,
36
36
  required: required,
37
- autoComplete: "email",
38
- ...hideOnClient && {
39
- value: defaultEmail
40
- }
37
+ autoComplete: "email"
41
38
  }),
42
39
  children
43
40
  ]
@@ -1,5 +1,5 @@
1
1
  import { filterTruthy } from '../../../helpers/common.js';
2
- import { composeAdvanceStyle, makeStyleResponsive, composeTypographyStyle, makeWidth, makeGlobalSize, composeSize, getBorderStyle, getBorderRadiusStyle, getStyleShadow, getStyleBackgroundByDevice, getGradientBgrStyleByDevice, getSingleColorVariable, getCustomRadius } from '@gem-sdk/core';
2
+ import { composeAdvanceStyle, makeStyleResponsive, composeTypographyStyle, makeGlobalSize, composeSize, getBorderStyle, getBorderRadiusStyle, getStyleShadow, getStyleBackgroundByDevice, getGradientBgrStyleByDevice, getSingleColorVariable, getCustomRadius } from '@gem-sdk/core';
3
3
 
4
4
  const composeStyles = (styles)=>filterTruthy(styles);
5
5
  const composeContainerStyles = (setting, advanced)=>{
@@ -27,7 +27,7 @@ const composeContainerStyles = (setting, advanced)=>{
27
27
  const composeInnerStyles = (setting, advanced, styles)=>{
28
28
  const { border, rounded, hasBoxShadow, boxShadow } = advanced ?? {};
29
29
  const { wrapperBorder, borderRadius, globalSize, boxShadowEmailHover, boxShadowEmailActive, roundedEmailHover, textColorActive, roundedEmailActive, textColorHover, borderEmailHover, borderEmailActive, backgroundColorV2Active, backgroundColorV2Hover } = styles ?? {};
30
- const { typography, size, width, background } = setting ?? {};
30
+ const { typography, size, background } = setting ?? {};
31
31
  const inputStyle = composeAdvanceStyle({
32
32
  border,
33
33
  rounded,
@@ -35,7 +35,6 @@ const composeInnerStyles = (setting, advanced, styles)=>{
35
35
  boxShadow
36
36
  });
37
37
  const appendTypoStyle = composeTypographyStyle(setting?.typo, typography);
38
- const inputWidth = makeStyleResponsive('w', makeWidth(width));
39
38
  const composeGlobalSize = makeGlobalSize(globalSize);
40
39
  return composeStyles({
41
40
  ...composeGlobalSize?.width?.['--w'] ? composeGlobalSize.width : {
@@ -49,7 +48,6 @@ const composeInnerStyles = (setting, advanced, styles)=>{
49
48
  ...!size?.type ? composeSize(size?.custom) : {},
50
49
  ...getBorderStyle(wrapperBorder),
51
50
  ...getBorderRadiusStyle(borderRadius),
52
- ...inputWidth,
53
51
  ...inputStyle,
54
52
  ...getStyleShadow({
55
53
  value: boxShadow,
@@ -39,19 +39,16 @@ const FormEmailSettings = [
39
39
  },
40
40
  {
41
41
  id: 'typo',
42
+ label: 'Text styles',
42
43
  type: 'typography-v2',
43
- label: 'typography',
44
44
  default: {
45
45
  type: 'paragraph-1'
46
46
  },
47
47
  hiddenSetting: {
48
48
  color: true,
49
49
  textAlign: true,
50
- textShadow: true,
51
- fontWeight: true,
52
- transform: true
50
+ textShadow: true
53
51
  },
54
- disableCollapse: true,
55
52
  ignoreReRender: true
56
53
  },
57
54
  {
@@ -117,6 +114,39 @@ const FormEmailSettings = [
117
114
  }
118
115
  }
119
116
  }
117
+ },
118
+ {
119
+ id: 'align',
120
+ label: 'Alignment',
121
+ type: 'option:value',
122
+ options: [
123
+ {
124
+ label: 'Left',
125
+ value: 'left',
126
+ type: 'align',
127
+ tooltip: 'Align left',
128
+ iconName: 'gp-align-left'
129
+ },
130
+ {
131
+ label: 'Center',
132
+ value: 'center',
133
+ type: 'align',
134
+ tooltip: 'Align center',
135
+ iconName: 'gp-align-center'
136
+ },
137
+ {
138
+ label: 'Right',
139
+ value: 'right',
140
+ type: 'align',
141
+ tooltip: 'Align right',
142
+ iconName: 'gp-align-right'
143
+ }
144
+ ],
145
+ devices: {
146
+ desktop: {
147
+ default: 'left'
148
+ }
149
+ }
120
150
  }
121
151
  ]
122
152
  },
@@ -133,10 +163,10 @@ const FormEmailSettings = [
133
163
  height: 'Auto',
134
164
  padding: {
135
165
  type: 'medium',
136
- top: '4px',
137
- bottom: '4px',
138
- left: '16px',
139
- right: '16px'
166
+ top: '12px',
167
+ bottom: '12px',
168
+ left: '12px',
169
+ right: '12px'
140
170
  }
141
171
  }
142
172
  }
@@ -69,27 +69,24 @@ const SettingUIV2 = [
69
69
  },
70
70
  layout: 'horizontal'
71
71
  },
72
- {
73
- label: {
74
- en: 'Height'
75
- },
76
- controlConfig: {
77
- id: 'height',
78
- type: 'dropdown:input',
79
- label: 'Height',
80
- inputType: 'number',
81
- units: [
82
- 'px',
83
- '%'
84
- ],
85
- hideUnit: false,
86
- linkWithSetting: {
87
- name: 'globalSize',
88
- field: 'height'
89
- }
90
- },
91
- layout: 'horizontal'
92
- },
72
+ // {
73
+ // label: {
74
+ // en: 'Height',
75
+ // },
76
+ // controlConfig: {
77
+ // id: 'height',
78
+ // type: 'dropdown:input',
79
+ // label: 'Height',
80
+ // inputType: 'number',
81
+ // units: ['px', '%'],
82
+ // hideUnit: false,
83
+ // linkWithSetting: {
84
+ // name: 'globalSize',
85
+ // field: 'height',
86
+ // },
87
+ // },
88
+ // layout: 'horizontal',
89
+ // },
93
90
  {
94
91
  label: {
95
92
  en: 'Padding'
@@ -339,6 +336,24 @@ const SettingUIV2 = [
339
336
  conditionDisplay: 'hideOnClient === true'
340
337
  }
341
338
  ]
339
+ },
340
+ {
341
+ controls: [
342
+ {
343
+ label: {
344
+ en: 'Align'
345
+ },
346
+ conditionEnable: '!(parseInt(globalSize.width) >= 100 && globalSize.width?.includes("%"))',
347
+ setting: {
348
+ id: 'align'
349
+ },
350
+ options: {
351
+ labelVariant: 'primary',
352
+ fullWidth: true,
353
+ disableMessage: `Align is not supported when width is 100%`
354
+ }
355
+ }
356
+ ]
342
357
  }
343
358
  ];
344
359
 
@@ -82,27 +82,24 @@ const SettingUIV2 = [
82
82
  },
83
83
  layout: 'horizontal'
84
84
  },
85
- {
86
- label: {
87
- en: 'Height'
88
- },
89
- controlConfig: {
90
- id: 'height',
91
- type: 'dropdown:input',
92
- label: 'Height',
93
- inputType: 'number',
94
- units: [
95
- 'px',
96
- '%'
97
- ],
98
- hideUnit: false,
99
- linkWithSetting: {
100
- name: 'globalSize',
101
- field: 'height'
102
- }
103
- },
104
- layout: 'horizontal'
105
- },
85
+ // {
86
+ // label: {
87
+ // en: 'Height',
88
+ // },
89
+ // controlConfig: {
90
+ // id: 'height',
91
+ // type: 'dropdown:input',
92
+ // label: 'Height',
93
+ // inputType: 'number',
94
+ // units: ['px', '%'],
95
+ // hideUnit: false,
96
+ // linkWithSetting: {
97
+ // name: 'globalSize',
98
+ // field: 'height',
99
+ // },
100
+ // },
101
+ // layout: 'horizontal',
102
+ // },
106
103
  {
107
104
  label: {
108
105
  en: 'Padding'
@@ -158,7 +155,7 @@ const SettingUIV2 = [
158
155
  label: {
159
156
  en: 'Align'
160
157
  },
161
- conditionEnable: '!(parseInt(width) >= 100 && width?.includes("%"))',
158
+ conditionEnable: '!(parseInt(globalSize.width) >= 100 && globalSize.width?.includes("%"))',
162
159
  setting: {
163
160
  id: 'align'
164
161
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/components",
3
- "version": "2.0.0-dev.420",
3
+ "version": "2.0.0-dev.421",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",