@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
@@ -2,7 +2,7 @@ import { filterTruthy } from '../../../helpers/common.js';
2
2
  import { getStyleBackgroundByDevice } from '@gem-sdk/core';
3
3
 
4
4
  const composeStyles = (styles)=>filterTruthy(styles);
5
- const composeContainerStyles = (style)=>{
5
+ const composeContainerStylesForm = (style)=>{
6
6
  return composeStyles({
7
7
  ...style
8
8
  });
@@ -23,4 +23,4 @@ const popoverStyles = (builderProps)=>`
23
23
  }
24
24
  `;
25
25
 
26
- export { composeContainerStyles, composeFormStyles, popoverStyles };
26
+ export { composeContainerStylesForm, composeFormStyles, popoverStyles };
@@ -1,8 +1,9 @@
1
1
  import { contactInitConfig } from './ContactInitConfig.js';
2
- import config$1 from '../newsletter/Newsletter.js';
2
+ import { SettingUIV2 } from './configs/uiV2.js';
3
+ import { SettingUIV1 } from './configs/uiV1.js';
4
+ import ContactSettings from './configs/settings.js';
3
5
 
4
6
  // TODO VICTOR
5
- // @ts-nocheck
6
7
  const config = {
7
8
  tag: 'ContactForm',
8
9
  label: 'Contact Form',
@@ -16,19 +17,9 @@ const config = {
16
17
  <path d="M2.28223 19.5C1.86801 19.5 1.53223 19.8358 1.53223 20.25C1.53223 20.6642 1.86801 21 2.28223 21H21.7498C22.164 21 22.4998 20.6642 22.4998 20.25C22.4998 19.8358 22.164 19.5 21.7498 19.5H2.28223Z" fill="white"/>
17
18
  </svg>
18
19
  `,
19
- settings: [
20
- {
21
- id: 'setting',
22
- note: `This element sends submissions to <a class="no-underline text-primary-250" target="_blank" href="https://help.shopify.com/en/manual/customers/manage-customers#email-customers">the sender email address</a>`,
23
- controls: config$1.settings?.find((item)=>item.id === 'setting')?.controls || []
24
- },
25
- {
26
- id: 'style',
27
- controls: config$1.settings?.find((item)=>item.id === 'style')?.controls || []
28
- }
29
- ],
30
- ui: config$1.ui,
31
- uiV2: config$1.uiV2,
20
+ settings: ContactSettings,
21
+ ui: SettingUIV1,
22
+ uiV2: SettingUIV2,
32
23
  presets: [
33
24
  {
34
25
  id: 'contact',
@@ -238,7 +238,7 @@ const contactInitConfig = [
238
238
  {
239
239
  tag: 'SubmitButton',
240
240
  settings: {
241
- label: 'Send'
241
+ label: 'Submit'
242
242
  },
243
243
  styles: {
244
244
  roundedBtn: {
@@ -0,0 +1,202 @@
1
+ const ContactSettings = [
2
+ {
3
+ id: 'setting',
4
+ note: `This element sends submissions to <a class="no-underline text-primary-250" target="_blank" href="https://help.shopify.com/en/manual/customers/manage-customers#email-customers">the sender email address</a>`,
5
+ controls: [
6
+ {
7
+ id: 'callbackURL',
8
+ type: 'pick-link',
9
+ label: 'Pick Link',
10
+ customLabel: {
11
+ en: 'Action'
12
+ },
13
+ default: {
14
+ type: 'stay-on-page',
15
+ link: '',
16
+ target: '_self'
17
+ },
18
+ hiddenOptions: {
19
+ 'scroll-to': true,
20
+ 'open-popup': true,
21
+ 'send-email': true,
22
+ 'call-phone': true
23
+ }
24
+ },
25
+ {
26
+ id: 'successMessage',
27
+ type: 'textarea',
28
+ label: 'Success Message',
29
+ default: "Thanks for contacting us. We'll get back to you as soon as possible.",
30
+ autoHeight: true,
31
+ minHeight: 58
32
+ },
33
+ {
34
+ id: 'successColor',
35
+ type: 'color-picker-v2',
36
+ label: 'Color',
37
+ default: '#00A042'
38
+ },
39
+ {
40
+ id: 'errorMessage',
41
+ type: 'textarea',
42
+ label: 'Error Message',
43
+ default: 'Can’t send email. Please try again later.',
44
+ autoHeight: true,
45
+ minHeight: 58
46
+ },
47
+ {
48
+ id: 'errorColor',
49
+ type: 'color-picker-v2',
50
+ label: 'Color',
51
+ default: '#F44336'
52
+ },
53
+ {
54
+ id: 'translate',
55
+ type: 'input',
56
+ default: 'successMessage,errorMessage'
57
+ },
58
+ {
59
+ id: 'background',
60
+ type: 'background-media',
61
+ ignoreReRender: true,
62
+ hideImage: true,
63
+ devices: {
64
+ desktop: {
65
+ default: {
66
+ type: 'color',
67
+ color: 'transparent'
68
+ }
69
+ }
70
+ },
71
+ compoDefaultValue: {
72
+ desktop: {
73
+ default: {
74
+ type: 'color',
75
+ color: '#E2E2E2'
76
+ }
77
+ }
78
+ }
79
+ },
80
+ {
81
+ id: 'width',
82
+ type: 'input:unit',
83
+ label: 'Width',
84
+ placeholder: 'Auto Width',
85
+ min: 0,
86
+ units: [
87
+ 'px',
88
+ '%'
89
+ ],
90
+ hide: true,
91
+ devices: {
92
+ desktop: {
93
+ default: '480px'
94
+ }
95
+ }
96
+ },
97
+ {
98
+ id: 'size',
99
+ label: 'Field size',
100
+ type: 'size',
101
+ default: {
102
+ type: 'medium'
103
+ },
104
+ ignoreReRender: true
105
+ },
106
+ {
107
+ id: 'afterSubmitActionToggle',
108
+ type: 'toggle',
109
+ label: 'Action after submit',
110
+ devices: {
111
+ desktop: {
112
+ default: false
113
+ }
114
+ }
115
+ },
116
+ // {
117
+ // id: 'fullWidth',
118
+ // label: 'Full Width',
119
+ // type: 'toggle',
120
+ // devices: {
121
+ // desktop: {
122
+ // default: true,
123
+ // },
124
+ // },
125
+ // },
126
+ {
127
+ id: 'afterSubmitAction',
128
+ type: 'select',
129
+ options: [
130
+ {
131
+ label: 'Stay on page',
132
+ value: 'stay-on-page'
133
+ },
134
+ {
135
+ label: 'Open URL',
136
+ value: 'open-url'
137
+ }
138
+ ],
139
+ default: 'stay-on-page'
140
+ }
141
+ ]
142
+ },
143
+ {
144
+ id: 'style',
145
+ controls: [
146
+ {
147
+ id: 'globalSize',
148
+ type: 'size-setting',
149
+ devices: {
150
+ desktop: {
151
+ default: {
152
+ width: 'Auto',
153
+ height: 'Auto',
154
+ padding: {
155
+ type: 'medium',
156
+ top: '12px',
157
+ bottom: '12px',
158
+ left: '24px',
159
+ right: '24px'
160
+ }
161
+ }
162
+ }
163
+ },
164
+ settingConfig: {
165
+ width: {
166
+ displayOptions: [
167
+ 'full',
168
+ 'auto',
169
+ 'small',
170
+ 'large',
171
+ 'medium'
172
+ ],
173
+ sizeConfig: {
174
+ small: '100px',
175
+ medium: '116px',
176
+ large: '132px'
177
+ }
178
+ },
179
+ height: {
180
+ displayOptions: [
181
+ 'auto',
182
+ 'small',
183
+ 'large',
184
+ 'medium'
185
+ ],
186
+ sizeConfig: {
187
+ small: '28px',
188
+ medium: '36px',
189
+ large: '44px'
190
+ }
191
+ }
192
+ },
193
+ hiddenSettings: [
194
+ 'shape',
195
+ 'gap'
196
+ ]
197
+ }
198
+ ]
199
+ }
200
+ ];
201
+
202
+ export { ContactSettings as default };
@@ -0,0 +1,74 @@
1
+ const SettingUIV1 = [
2
+ {
3
+ type: 'group',
4
+ label: {
5
+ en: 'After submit'
6
+ },
7
+ controls: [
8
+ {
9
+ type: 'control',
10
+ label: {
11
+ en: 'Action'
12
+ },
13
+ setting: {
14
+ id: 'afterSubmitAction'
15
+ }
16
+ },
17
+ {
18
+ type: 'control',
19
+ label: {
20
+ en: ''
21
+ },
22
+ layout: 'vertical',
23
+ setting: {
24
+ id: 'callbackURL'
25
+ },
26
+ condition: `afterSubmitAction == 'open-url'`
27
+ }
28
+ ]
29
+ },
30
+ {
31
+ type: 'group',
32
+ label: {
33
+ en: 'Success message'
34
+ },
35
+ controls: [
36
+ {
37
+ type: 'control',
38
+ label: {
39
+ en: 'Message'
40
+ },
41
+ options: {
42
+ labelPosition: 'start'
43
+ },
44
+ layout: 'vertical',
45
+ setting: {
46
+ id: 'successMessage'
47
+ }
48
+ }
49
+ ]
50
+ },
51
+ {
52
+ type: 'group',
53
+ label: {
54
+ en: 'Error message'
55
+ },
56
+ controls: [
57
+ {
58
+ type: 'control',
59
+ label: {
60
+ en: 'Message'
61
+ },
62
+ options: {
63
+ labelPosition: 'start'
64
+ },
65
+ layout: 'vertical',
66
+ setting: {
67
+ id: 'errorMessage'
68
+ }
69
+ }
70
+ ]
71
+ }
72
+ ];
73
+
74
+ export { SettingUIV1 };
@@ -0,0 +1,239 @@
1
+ const SettingUIV2 = [
2
+ {
3
+ label: {
4
+ en: 'Message'
5
+ },
6
+ controls: [
7
+ {
8
+ type: 'combo',
9
+ label: {
10
+ en: 'Success'
11
+ },
12
+ iconName: 'polaris-text-block',
13
+ getValueFromSettingID: 'successMessage',
14
+ isHideClear: true,
15
+ disableScrollbar: true,
16
+ popoverLabel: {
17
+ en: 'Success message'
18
+ },
19
+ controls: [
20
+ {
21
+ layout: 'vertical',
22
+ label: {
23
+ en: 'Content'
24
+ },
25
+ setting: {
26
+ id: 'successMessage'
27
+ }
28
+ },
29
+ {
30
+ setting: {
31
+ id: 'successColor'
32
+ },
33
+ label: {
34
+ en: 'Color'
35
+ }
36
+ }
37
+ ]
38
+ },
39
+ {
40
+ type: 'combo',
41
+ label: {
42
+ en: 'Error'
43
+ },
44
+ iconName: 'polaris-text-block',
45
+ getValueFromSettingID: 'errorMessage',
46
+ isHideClear: true,
47
+ disableScrollbar: true,
48
+ popoverLabel: {
49
+ en: 'Error message'
50
+ },
51
+ controls: [
52
+ {
53
+ layout: 'vertical',
54
+ label: {
55
+ en: 'Content'
56
+ },
57
+ setting: {
58
+ id: 'errorMessage'
59
+ }
60
+ },
61
+ {
62
+ setting: {
63
+ id: 'errorColor'
64
+ },
65
+ label: {
66
+ en: 'Color'
67
+ }
68
+ }
69
+ ]
70
+ }
71
+ ]
72
+ },
73
+ {
74
+ label: {
75
+ en: 'Size'
76
+ },
77
+ controls: [
78
+ {
79
+ id: 'Width',
80
+ label: {
81
+ en: 'Width'
82
+ },
83
+ controlConfig: {
84
+ id: 'width',
85
+ type: 'dropdown:input',
86
+ label: 'Width',
87
+ inputType: 'number',
88
+ units: [
89
+ 'px',
90
+ '%'
91
+ ],
92
+ hideUnit: false,
93
+ linkWithSetting: {
94
+ name: 'globalSize',
95
+ field: 'width'
96
+ },
97
+ displayOptions: [
98
+ {
99
+ label: 'Fit content',
100
+ value: 'Auto',
101
+ showValue: true
102
+ }
103
+ ]
104
+ },
105
+ layout: 'horizontal'
106
+ },
107
+ {
108
+ label: {
109
+ en: 'Padding'
110
+ },
111
+ controlConfig: {
112
+ id: 'padding',
113
+ type: 'padding-v2',
114
+ linkWithSetting: {
115
+ name: 'globalSize',
116
+ field: 'padding'
117
+ },
118
+ compoDefaultValue: {
119
+ desktop: {
120
+ default: {
121
+ type: 'medium',
122
+ top: '12px',
123
+ bottom: '12px',
124
+ left: '24px',
125
+ right: '24px'
126
+ }
127
+ }
128
+ }
129
+ }
130
+ }
131
+ ]
132
+ },
133
+ {
134
+ label: {
135
+ en: 'Background'
136
+ },
137
+ controls: [
138
+ {
139
+ setting: {
140
+ id: 'background'
141
+ },
142
+ layout: 'vertical'
143
+ }
144
+ ]
145
+ },
146
+ {
147
+ label: {
148
+ en: 'Shape'
149
+ },
150
+ controls: [
151
+ {
152
+ label: {
153
+ en: 'Border'
154
+ },
155
+ setting: {
156
+ id: 'border',
157
+ state: 'normal'
158
+ }
159
+ },
160
+ {
161
+ label: {
162
+ en: 'Corner'
163
+ },
164
+ setting: {
165
+ id: 'rounded',
166
+ state: 'normal'
167
+ }
168
+ },
169
+ {
170
+ label: {
171
+ en: 'Shadow'
172
+ },
173
+ setting: {
174
+ id: 'boxShadow',
175
+ state: 'normal'
176
+ },
177
+ options: {
178
+ updateFields: [
179
+ {
180
+ field: 'enable',
181
+ settingId: 'hasBoxShadow',
182
+ state: 'normal'
183
+ }
184
+ ]
185
+ },
186
+ controlChangeTrigger: {
187
+ settings: [
188
+ {
189
+ condition: `boxShadow.normal.enable === true`,
190
+ source: [
191
+ 'boxShadow',
192
+ 'hasBoxShadow'
193
+ ],
194
+ action: {
195
+ controlId: 'hasBoxShadow',
196
+ groupType: 'advanced',
197
+ controlType: 'advanced',
198
+ state: 'normal',
199
+ newValue: true
200
+ }
201
+ },
202
+ {
203
+ condition: `boxShadow.normal.enable === false`,
204
+ source: [
205
+ 'boxShadow',
206
+ 'hasBoxShadow'
207
+ ],
208
+ action: {
209
+ controlId: 'hasBoxShadow',
210
+ groupType: 'advanced',
211
+ controlType: 'advanced',
212
+ state: 'normal',
213
+ newValue: false
214
+ }
215
+ }
216
+ ],
217
+ options: {
218
+ noRecordHistory: true
219
+ }
220
+ }
221
+ }
222
+ ]
223
+ },
224
+ {
225
+ label: {
226
+ en: 'After submit'
227
+ },
228
+ controls: [
229
+ {
230
+ layout: 'vertical',
231
+ setting: {
232
+ id: 'callbackURL'
233
+ }
234
+ }
235
+ ]
236
+ }
237
+ ];
238
+
239
+ export { SettingUIV2 };
@@ -47,7 +47,7 @@ const config = {
47
47
  editor: {
48
48
  en: {
49
49
  err_msg_default: 'Can’t send email. Please try again later.',
50
- success_msg_default: `Thanks for contacting us. We'll get back to you as soon as possible.`
50
+ success_msg_default: `Thanks for subscribing`
51
51
  }
52
52
  }
53
53
  }
@@ -5,10 +5,8 @@ const newsletterInitConfig = [
5
5
  'spacing-setting': {
6
6
  desktop: {
7
7
  padding: {
8
- top: 'var(--g-s-xl)',
9
- bottom: 'var(--g-s-xl)',
10
- left: 'var(--g-s-l)',
11
- right: 'var(--g-s-l)'
8
+ top: '24px',
9
+ bottom: '24px'
12
10
  }
13
11
  }
14
12
  },
@@ -45,6 +45,12 @@ const NewsletterSettings = [
45
45
  autoHeight: true,
46
46
  minHeight: 58
47
47
  },
48
+ {
49
+ id: 'successColor',
50
+ type: 'color-picker-v2',
51
+ label: 'Color',
52
+ default: '#00A042'
53
+ },
48
54
  {
49
55
  id: 'errorMessage',
50
56
  type: 'textarea',
@@ -53,6 +59,12 @@ const NewsletterSettings = [
53
59
  autoHeight: true,
54
60
  minHeight: 58
55
61
  },
62
+ {
63
+ id: 'errorColor',
64
+ type: 'color-picker-v2',
65
+ label: 'Color',
66
+ default: '#F44336'
67
+ },
56
68
  {
57
69
  id: 'translate',
58
70
  type: 'input',
@@ -62,6 +74,7 @@ const NewsletterSettings = [
62
74
  id: 'background',
63
75
  type: 'background-media',
64
76
  ignoreReRender: true,
77
+ hideImage: true,
65
78
  devices: {
66
79
  desktop: {
67
80
  default: {