@gem-sdk/components 2.0.0-dev.372 → 2.0.0-dev.374

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.
Files changed (38) hide show
  1. package/dist/cjs/article/setting/configs/ArticleAuthor/uiV2.js +3 -1
  2. package/dist/cjs/builder.js +0 -1
  3. package/dist/cjs/form/components/contact/Contact.liquid.js +9 -3
  4. package/dist/cjs/form/components/contact/common/composeStyles.js +2 -1
  5. package/dist/cjs/form/components/form-email/FormEmail.js +16 -22
  6. package/dist/cjs/form/components/newsletter/Newsletter.liquid.js +39 -34
  7. package/dist/cjs/form/components/newsletter/common/composeStyles.js +2 -2
  8. package/dist/cjs/form/setting/contact/Contact.js +6 -15
  9. package/dist/cjs/form/setting/contact/ContactInitConfig.js +1 -1
  10. package/dist/cjs/form/setting/contact/configs/settings.js +206 -0
  11. package/dist/cjs/form/setting/contact/configs/uiV1.js +76 -0
  12. package/dist/cjs/form/setting/contact/configs/uiV2.js +241 -0
  13. package/dist/cjs/form/setting/newsletter/Newsletter.js +1 -1
  14. package/dist/cjs/form/setting/newsletter/NewsletterInitConfig.js +2 -4
  15. package/dist/cjs/form/setting/newsletter/configs/settings.js +13 -0
  16. package/dist/cjs/form/setting/newsletter/configs/uiV2.js +35 -13
  17. package/dist/cjs/form/setting/submit-button/configs/settings.js +17 -9
  18. package/dist/cjs/form/setting/submit-button/configs/uiV2.js +2 -2
  19. package/dist/esm/article/setting/configs/ArticleAuthor/uiV2.js +3 -1
  20. package/dist/esm/builder.js +0 -1
  21. package/dist/esm/form/components/contact/Contact.liquid.js +9 -3
  22. package/dist/esm/form/components/contact/common/composeStyles.js +3 -2
  23. package/dist/esm/form/components/form-email/FormEmail.js +17 -23
  24. package/dist/esm/form/components/newsletter/Newsletter.liquid.js +40 -35
  25. package/dist/esm/form/components/newsletter/common/composeStyles.js +2 -2
  26. package/dist/esm/form/setting/contact/Contact.js +6 -15
  27. package/dist/esm/form/setting/contact/ContactInitConfig.js +1 -1
  28. package/dist/esm/form/setting/contact/configs/settings.js +202 -0
  29. package/dist/esm/form/setting/contact/configs/uiV1.js +74 -0
  30. package/dist/esm/form/setting/contact/configs/uiV2.js +239 -0
  31. package/dist/esm/form/setting/newsletter/Newsletter.js +1 -1
  32. package/dist/esm/form/setting/newsletter/NewsletterInitConfig.js +2 -4
  33. package/dist/esm/form/setting/newsletter/configs/settings.js +13 -0
  34. package/dist/esm/form/setting/newsletter/configs/uiV2.js +35 -13
  35. package/dist/esm/form/setting/submit-button/configs/settings.js +17 -9
  36. package/dist/esm/form/setting/submit-button/configs/uiV2.js +2 -2
  37. package/dist/types/index.d.ts +5 -2
  38. package/package.json +2 -2
@@ -0,0 +1,241 @@
1
+ 'use strict';
2
+
3
+ const SettingUIV2 = [
4
+ {
5
+ label: {
6
+ en: 'Message'
7
+ },
8
+ controls: [
9
+ {
10
+ type: 'combo',
11
+ label: {
12
+ en: 'Success'
13
+ },
14
+ iconName: 'polaris-text-block',
15
+ getValueFromSettingID: 'successMessage',
16
+ isHideClear: true,
17
+ disableScrollbar: true,
18
+ popoverLabel: {
19
+ en: 'Success message'
20
+ },
21
+ controls: [
22
+ {
23
+ layout: 'vertical',
24
+ label: {
25
+ en: 'Content'
26
+ },
27
+ setting: {
28
+ id: 'successMessage'
29
+ }
30
+ },
31
+ {
32
+ setting: {
33
+ id: 'successColor'
34
+ },
35
+ label: {
36
+ en: 'Color'
37
+ }
38
+ }
39
+ ]
40
+ },
41
+ {
42
+ type: 'combo',
43
+ label: {
44
+ en: 'Error'
45
+ },
46
+ iconName: 'polaris-text-block',
47
+ getValueFromSettingID: 'errorMessage',
48
+ isHideClear: true,
49
+ disableScrollbar: true,
50
+ popoverLabel: {
51
+ en: 'Error message'
52
+ },
53
+ controls: [
54
+ {
55
+ layout: 'vertical',
56
+ label: {
57
+ en: 'Content'
58
+ },
59
+ setting: {
60
+ id: 'errorMessage'
61
+ }
62
+ },
63
+ {
64
+ setting: {
65
+ id: 'errorColor'
66
+ },
67
+ label: {
68
+ en: 'Color'
69
+ }
70
+ }
71
+ ]
72
+ }
73
+ ]
74
+ },
75
+ {
76
+ label: {
77
+ en: 'Size'
78
+ },
79
+ controls: [
80
+ {
81
+ id: 'Width',
82
+ label: {
83
+ en: 'Width'
84
+ },
85
+ controlConfig: {
86
+ id: 'width',
87
+ type: 'dropdown:input',
88
+ label: 'Width',
89
+ inputType: 'number',
90
+ units: [
91
+ 'px',
92
+ '%'
93
+ ],
94
+ hideUnit: false,
95
+ linkWithSetting: {
96
+ name: 'globalSize',
97
+ field: 'width'
98
+ },
99
+ displayOptions: [
100
+ {
101
+ label: 'Fit content',
102
+ value: 'Auto',
103
+ showValue: true
104
+ }
105
+ ]
106
+ },
107
+ layout: 'horizontal'
108
+ },
109
+ {
110
+ label: {
111
+ en: 'Padding'
112
+ },
113
+ controlConfig: {
114
+ id: 'padding',
115
+ type: 'padding-v2',
116
+ linkWithSetting: {
117
+ name: 'globalSize',
118
+ field: 'padding'
119
+ },
120
+ compoDefaultValue: {
121
+ desktop: {
122
+ default: {
123
+ type: 'medium',
124
+ top: '12px',
125
+ bottom: '12px',
126
+ left: '24px',
127
+ right: '24px'
128
+ }
129
+ }
130
+ }
131
+ }
132
+ }
133
+ ]
134
+ },
135
+ {
136
+ label: {
137
+ en: 'Background'
138
+ },
139
+ controls: [
140
+ {
141
+ setting: {
142
+ id: 'background'
143
+ },
144
+ layout: 'vertical'
145
+ }
146
+ ]
147
+ },
148
+ {
149
+ label: {
150
+ en: 'Shape'
151
+ },
152
+ controls: [
153
+ {
154
+ label: {
155
+ en: 'Border'
156
+ },
157
+ setting: {
158
+ id: 'border',
159
+ state: 'normal'
160
+ }
161
+ },
162
+ {
163
+ label: {
164
+ en: 'Corner'
165
+ },
166
+ setting: {
167
+ id: 'rounded',
168
+ state: 'normal'
169
+ }
170
+ },
171
+ {
172
+ label: {
173
+ en: 'Shadow'
174
+ },
175
+ setting: {
176
+ id: 'boxShadow',
177
+ state: 'normal'
178
+ },
179
+ options: {
180
+ updateFields: [
181
+ {
182
+ field: 'enable',
183
+ settingId: 'hasBoxShadow',
184
+ state: 'normal'
185
+ }
186
+ ]
187
+ },
188
+ controlChangeTrigger: {
189
+ settings: [
190
+ {
191
+ condition: `boxShadow.normal.enable === true`,
192
+ source: [
193
+ 'boxShadow',
194
+ 'hasBoxShadow'
195
+ ],
196
+ action: {
197
+ controlId: 'hasBoxShadow',
198
+ groupType: 'advanced',
199
+ controlType: 'advanced',
200
+ state: 'normal',
201
+ newValue: true
202
+ }
203
+ },
204
+ {
205
+ condition: `boxShadow.normal.enable === false`,
206
+ source: [
207
+ 'boxShadow',
208
+ 'hasBoxShadow'
209
+ ],
210
+ action: {
211
+ controlId: 'hasBoxShadow',
212
+ groupType: 'advanced',
213
+ controlType: 'advanced',
214
+ state: 'normal',
215
+ newValue: false
216
+ }
217
+ }
218
+ ],
219
+ options: {
220
+ noRecordHistory: true
221
+ }
222
+ }
223
+ }
224
+ ]
225
+ },
226
+ {
227
+ label: {
228
+ en: 'After submit'
229
+ },
230
+ controls: [
231
+ {
232
+ layout: 'vertical',
233
+ setting: {
234
+ id: 'callbackURL'
235
+ }
236
+ }
237
+ ]
238
+ }
239
+ ];
240
+
241
+ exports.SettingUIV2 = SettingUIV2;
@@ -51,7 +51,7 @@ const config = {
51
51
  editor: {
52
52
  en: {
53
53
  err_msg_default: 'Can’t send email. Please try again later.',
54
- success_msg_default: `Thanks for contacting us. We'll get back to you as soon as possible.`
54
+ success_msg_default: `Thanks for subscribing`
55
55
  }
56
56
  }
57
57
  }
@@ -7,10 +7,8 @@ const newsletterInitConfig = [
7
7
  'spacing-setting': {
8
8
  desktop: {
9
9
  padding: {
10
- top: 'var(--g-s-xl)',
11
- bottom: 'var(--g-s-xl)',
12
- left: 'var(--g-s-l)',
13
- right: 'var(--g-s-l)'
10
+ top: '24px',
11
+ bottom: '24px'
14
12
  }
15
13
  }
16
14
  },
@@ -49,6 +49,12 @@ const NewsletterSettings = [
49
49
  autoHeight: true,
50
50
  minHeight: 58
51
51
  },
52
+ {
53
+ id: 'successColor',
54
+ type: 'color-picker-v2',
55
+ label: 'Color',
56
+ default: '#00A042'
57
+ },
52
58
  {
53
59
  id: 'errorMessage',
54
60
  type: 'textarea',
@@ -57,6 +63,12 @@ const NewsletterSettings = [
57
63
  autoHeight: true,
58
64
  minHeight: 58
59
65
  },
66
+ {
67
+ id: 'errorColor',
68
+ type: 'color-picker-v2',
69
+ label: 'Color',
70
+ default: '#F44336'
71
+ },
60
72
  {
61
73
  id: 'translate',
62
74
  type: 'input',
@@ -66,6 +78,7 @@ const NewsletterSettings = [
66
78
  id: 'background',
67
79
  type: 'background-media',
68
80
  ignoreReRender: true,
81
+ hideImage: true,
69
82
  devices: {
70
83
  desktop: {
71
84
  default: {
@@ -21,9 +21,20 @@ const SettingUIV2 = [
21
21
  controls: [
22
22
  {
23
23
  layout: 'vertical',
24
+ label: {
25
+ en: 'Content'
26
+ },
24
27
  setting: {
25
28
  id: 'successMessage'
26
29
  }
30
+ },
31
+ {
32
+ setting: {
33
+ id: 'successColor'
34
+ },
35
+ label: {
36
+ en: 'Color'
37
+ }
27
38
  }
28
39
  ]
29
40
  },
@@ -42,27 +53,25 @@ const SettingUIV2 = [
42
53
  controls: [
43
54
  {
44
55
  layout: 'vertical',
56
+ label: {
57
+ en: 'Content'
58
+ },
45
59
  setting: {
46
60
  id: 'errorMessage'
47
61
  }
62
+ },
63
+ {
64
+ setting: {
65
+ id: 'errorColor'
66
+ },
67
+ label: {
68
+ en: 'Color'
69
+ }
48
70
  }
49
71
  ]
50
72
  }
51
73
  ]
52
74
  },
53
- {
54
- label: {
55
- en: 'After submit'
56
- },
57
- controls: [
58
- {
59
- layout: 'vertical',
60
- setting: {
61
- id: 'callbackURL'
62
- }
63
- }
64
- ]
65
- },
66
75
  {
67
76
  label: {
68
77
  en: 'Size'
@@ -145,6 +154,19 @@ const SettingUIV2 = [
145
154
  }
146
155
  }
147
156
  ]
157
+ },
158
+ {
159
+ label: {
160
+ en: 'After submit'
161
+ },
162
+ controls: [
163
+ {
164
+ layout: 'vertical',
165
+ setting: {
166
+ id: 'callbackURL'
167
+ }
168
+ }
169
+ ]
148
170
  }
149
171
  ];
150
172
 
@@ -127,17 +127,25 @@ const SubmitButtonSettings = [
127
127
  }
128
128
  },
129
129
  {
130
- id: 'backgroundColor',
130
+ id: 'backgroundColorV2',
131
131
  type: 'color-picker-v2',
132
- label: 'Background Color',
133
- default: {
134
- normal: 'brand',
135
- hover: 'highlight'
132
+ devices: {
133
+ desktop: {
134
+ default: {
135
+ normal: 'brand',
136
+ hover: 'highlight'
137
+ }
138
+ }
136
139
  },
137
- state: {
138
- hover: true,
139
- normal: true
140
- }
140
+ compoDefaultValue: {
141
+ desktop: {
142
+ default: {
143
+ normal: 'brand',
144
+ hover: 'highlight'
145
+ }
146
+ }
147
+ },
148
+ enableGradient: true
141
149
  },
142
150
  {
143
151
  id: 'textColor',
@@ -132,7 +132,7 @@ const SettingUIV2 = [
132
132
  en: 'Color'
133
133
  },
134
134
  setting: {
135
- id: 'backgroundColor',
135
+ id: 'backgroundColorV2',
136
136
  state: 'normal'
137
137
  }
138
138
  }
@@ -266,7 +266,7 @@ const SettingUIV2 = [
266
266
  en: 'Background'
267
267
  },
268
268
  setting: {
269
- id: 'backgroundColor',
269
+ id: 'backgroundColorV2',
270
270
  state: 'hover'
271
271
  }
272
272
  },
@@ -10,6 +10,7 @@ const uiV2 = [
10
10
  },
11
11
  getValueFromSettingID: 'prefix',
12
12
  type: 'combo',
13
+ defaultValueWhenClear: '',
13
14
  controls: [
14
15
  {
15
16
  label: {
@@ -18,7 +19,8 @@ const uiV2 = [
18
19
  type: 'control',
19
20
  setting: {
20
21
  id: 'prefix'
21
- }
22
+ },
23
+ defaultValueWhenClear: ''
22
24
  }
23
25
  ]
24
26
  },
@@ -58,7 +58,6 @@ import TextField from './form/components/textfield/TextField.js';
58
58
  import FormTextArea from './form/components/textarea/TextArea.js';
59
59
  import FormCheckbox from './form/components/form-checkbox/FormCheckbox.js';
60
60
  import TextInput from './form/components/textinput/TextInput.js';
61
- import './form/setting/contact/Contact.js';
62
61
  import Header from './header/components/Header.js';
63
62
  import BasicHeader from './header/components/kind/basic/index.js';
64
63
  import ModernHeader from './header/components/kind/modern/index.js';
@@ -1,17 +1,23 @@
1
1
  import { template } from '@gem-sdk/core';
2
2
  import Newsletter from '../newsletter/Newsletter.liquid.js';
3
+ import { composeContainerStyles } from './common/composeStyles.js';
4
+ import { createStyle } from '@gem-sdk/system';
3
5
 
4
- const ContactForm = ({ builderProps, setting, children, style, advanced, pageContext })=>{
6
+ const ContactForm = ({ builderProps, setting, children, style, advanced, pageContext, styles })=>{
7
+ const containerStyle = createStyle(composeContainerStyles(setting, styles));
5
8
  return template`
6
- ${Newsletter({
9
+ <div style="${containerStyle}">
10
+ ${Newsletter({
7
11
  builderProps: builderProps,
8
12
  setting: setting,
9
13
  style: style,
10
14
  children: children,
11
15
  formType: 'contact',
12
16
  advanced,
13
- pageContext
17
+ pageContext,
18
+ styles
14
19
  })}
20
+ </div>
15
21
  `;
16
22
  };
17
23
 
@@ -1,5 +1,5 @@
1
1
  import { filterTruthy } from '../../../helpers/common.js';
2
- import { makeGlobalSize, getStyleBackgroundByDevice } from '@gem-sdk/core';
2
+ import { makeGlobalSize, getStyleBackgroundByDevice, getGradientBgrStyleByDevice } from '@gem-sdk/core';
3
3
 
4
4
  const composeStyles = (styles)=>filterTruthy(styles);
5
5
  const composeContainerStyles = (setting, styles)=>{
@@ -12,7 +12,8 @@ const composeContainerStyles = (setting, styles)=>{
12
12
  '--w': '100%'
13
13
  },
14
14
  ...composeGlobalSize.padding,
15
- ...getStyleBackgroundByDevice(background)
15
+ ...getStyleBackgroundByDevice(background),
16
+ ...getGradientBgrStyleByDevice(background)
16
17
  });
17
18
  };
18
19
 
@@ -1,5 +1,5 @@
1
1
  'use client';
2
- import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import { jsx, jsxs } from 'react/jsx-runtime';
3
3
  import { createStyle, createClass } from '@gem-sdk/system';
4
4
  import { composeContainerStyles, composeInnerStyles } from './common/composeStyles.js';
5
5
  import { composeContainerClasses, composeInnerClasses } from './common/composeClasses.js';
@@ -11,32 +11,26 @@ const FormEmail = ({ builderProps, builderAttrs, setting, advanced, children })=
11
11
  const innerStyles = createStyle(composeInnerStyles(setting, advanced));
12
12
  const containerClasses = createClass(composeContainerClasses(setting, advanced, builderProps));
13
13
  const innerClasses = createClass(composeInnerClasses(setting));
14
- return /*#__PURE__*/ jsxs("div", {
14
+ return /*#__PURE__*/ jsx("div", {
15
15
  ...builderAttrs,
16
16
  "data-id": builderProps?.uid,
17
17
  className: containerClasses,
18
18
  style: containerStyles,
19
- children: [
20
- /*#__PURE__*/ jsx("span", {
21
- className: "gp-text-16 gp-text-[#121212]",
22
- children: placeholder
23
- }),
24
- /*#__PURE__*/ jsxs("div", {
25
- children: [
26
- /*#__PURE__*/ jsx("input", {
27
- type: "email",
28
- className: innerClasses,
29
- style: innerStyles,
30
- placeholder: placeholder,
31
- name: name,
32
- required: required,
33
- autoComplete: "email",
34
- value: hideOnClient ? defaultEmail : ''
35
- }),
36
- children
37
- ]
38
- })
39
- ]
19
+ children: /*#__PURE__*/ jsxs("div", {
20
+ children: [
21
+ /*#__PURE__*/ jsx("input", {
22
+ type: "email",
23
+ className: innerClasses,
24
+ style: innerStyles,
25
+ placeholder: placeholder,
26
+ name: name,
27
+ required: required,
28
+ autoComplete: "email",
29
+ value: hideOnClient ? defaultEmail : ''
30
+ }),
31
+ children
32
+ ]
33
+ })
40
34
  });
41
35
  };
42
36
 
@@ -2,10 +2,11 @@ import { template, RenderIf, isLocalEnv, baseAssetURL } from '@gem-sdk/core';
2
2
  import { getDynamicSourceLocales, getStaticLocale, getSettingPreloadData } from '../../../helpers.js';
3
3
  import { composeContainerAttrs, composeAnchorAttrs, composeFormAttrs, composePopoverAttrs } from './common/composeAttrs.js';
4
4
  import { createStyle, createClass } from '@gem-sdk/system';
5
- import { composeContainerStyles, composeFormStyles, popoverStyles } from './common/composeStyles.js';
5
+ import { composeContainerStylesForm, composeFormStyles, popoverStyles } from './common/composeStyles.js';
6
6
  import { composeFormClasses } from './common/composeClasses.js';
7
+ import { composeContainerStyles } from '../contact/common/composeStyles.js';
7
8
 
8
- const Newsletter = ({ builderProps, setting, children, style, formType, advanced, pageContext })=>{
9
+ const Newsletter = ({ builderProps, setting, children, style, formType, advanced, pageContext, styles })=>{
9
10
  const errorMessage = getDynamicSourceLocales({
10
11
  val: setting?.errorMessage,
11
12
  uid: builderProps?.uid,
@@ -23,56 +24,60 @@ const Newsletter = ({ builderProps, setting, children, style, formType, advanced
23
24
  translate: setting?.translate
24
25
  });
25
26
  const containerAttrs = composeContainerAttrs(builderProps, setting);
26
- const composedContainerStyles = createStyle(composeContainerStyles(style));
27
+ const composedContainerStyles = createStyle(composeContainerStylesForm(style));
27
28
  const anchorAttrs = composeAnchorAttrs(builderProps, setting);
28
29
  const composedFormClasses = createClass(composeFormClasses());
29
30
  const composedFormStyles = createStyle(composeFormStyles(setting));
30
31
  const formAttrs = composeFormAttrs(builderProps);
31
32
  const popoverAttrs = composePopoverAttrs(builderProps);
32
33
  const generatedPopoverStyles = popoverStyles(builderProps);
34
+ const containerStyle = createStyle(composeContainerStyles(setting, styles));
33
35
  return template`
34
- <gp-form
35
- ${{
36
+ <div style="${containerStyle}">
37
+ <gp-form
38
+ ${{
36
39
  ...containerAttrs
37
40
  }}
38
- style="${composedContainerStyles}"
39
- >
40
- <a
41
- ${{
41
+ style="${composedContainerStyles}"
42
+ >
43
+ <a
44
+ ${{
42
45
  ...anchorAttrs
43
46
  }}
44
- >
45
- </a>
46
- {% form '${formType ? formType : 'customer'}', class: 'gp-form-${builderProps?.uid} ${advanced?.cssClass}', id: 'contact_form_${builderProps?.uid}' %}
47
- {% if form.errors %}
48
- <div
49
- ${{
47
+ >
48
+ </a>
49
+ {% form '${formType ? formType : 'customer'}', class: 'gp-form-${builderProps?.uid} ${advanced?.cssClass}', id: 'contact_form_${builderProps?.uid}' %}
50
+ {% if form.errors %}
51
+ <div
52
+ ${{
50
53
  ...formAttrs
51
54
  }}
52
- class="${composedFormClasses}"
53
- style="${composedFormStyles}"
54
- >
55
- ${errorMessage}
56
- </div>
57
- {% endif %}
58
- <div popover ${{
55
+ class="${composedFormClasses}"
56
+ style="${composedFormStyles}"
57
+ >
58
+ ${errorMessage}
59
+ </div>
60
+ {% endif %}
61
+ <div popover ${{
59
62
  ...popoverAttrs
60
63
  }}>
61
- <style>
62
- ${generatedPopoverStyles}
63
- </style>
64
- <div
65
- ${{
64
+ <style>
65
+ ${generatedPopoverStyles}
66
+ </style>
67
+ <div
68
+ ${{
66
69
  ...formAttrs
67
70
  }}
68
- class="${composedFormClasses}"
69
- style="${composedFormStyles}"
70
- >
71
- ${successMessage}
72
- </div></div>
73
- ${children}
74
- {% endform %}
75
- </gp-form>
71
+ class="${composedFormClasses}"
72
+ style="${composedFormStyles}"
73
+ >
74
+ ${successMessage}
75
+ </div>
76
+ </div>
77
+ ${children}
78
+ {% endform %}
79
+ </gp-form>
80
+ </div>
76
81
  ${RenderIf(isLocalEnv, `<script ${getSettingPreloadData('class="gps-link" delay', 'src')}="{{ 'gp-form.js' | asset_url }}" defer="defer"></script>`, `<script ${getSettingPreloadData('class="gps-link" delay', 'src')}="${baseAssetURL}/assets-v2/gp-form.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}" defer="defer"></script>`)}
77
82
  `;
78
83
  };