@gem-sdk/components 2.0.0-dev.390 → 2.0.0-dev.392

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 (36) hide show
  1. package/dist/cjs/carousel/root/common/getData.js +4 -4
  2. package/dist/cjs/form/components/form-email/FormEmail.js +29 -20
  3. package/dist/cjs/form/components/form-email/FormEmail.liquid.js +7 -5
  4. package/dist/cjs/form/components/form-email/common/composeClasses.js +11 -2
  5. package/dist/cjs/form/components/form-email/common/composeStyles.js +62 -2
  6. package/dist/cjs/form/components/newsletter/Newsletter.liquid.js +1 -0
  7. package/dist/cjs/form/components/newsletter/common/composeAttrs.js +1 -2
  8. package/dist/cjs/form/setting/contact/ContactInitConfig.js +3 -1
  9. package/dist/cjs/form/setting/form-email/configs/settings.js +190 -28
  10. package/dist/cjs/form/setting/form-email/configs/uiV2.js +262 -18
  11. package/dist/cjs/form/setting/text-input/configs/settings.js +6 -3
  12. package/dist/cjs/form/setting/text-input/configs/uiV2.js +2 -2
  13. package/dist/cjs/product/components/ProductList/ProductListGridLayout.liquid.js +15 -12
  14. package/dist/cjs/product/setting/product/configs/settings.js +5 -33
  15. package/dist/cjs/product/setting/product/configs/uiV2.js +44 -0
  16. package/dist/cjs/product/setting/product-list/configs/settingsV2.js +4 -7
  17. package/dist/cjs/product/setting/product-list/configs/uiV2.js +5 -2
  18. package/dist/esm/carousel/root/common/getData.js +5 -5
  19. package/dist/esm/form/components/form-email/FormEmail.js +32 -23
  20. package/dist/esm/form/components/form-email/FormEmail.liquid.js +8 -6
  21. package/dist/esm/form/components/form-email/common/composeClasses.js +11 -3
  22. package/dist/esm/form/components/form-email/common/composeStyles.js +63 -4
  23. package/dist/esm/form/components/newsletter/Newsletter.liquid.js +1 -0
  24. package/dist/esm/form/components/newsletter/common/composeAttrs.js +1 -2
  25. package/dist/esm/form/setting/contact/ContactInitConfig.js +3 -1
  26. package/dist/esm/form/setting/form-email/configs/settings.js +190 -28
  27. package/dist/esm/form/setting/form-email/configs/uiV2.js +262 -18
  28. package/dist/esm/form/setting/text-input/configs/settings.js +6 -3
  29. package/dist/esm/form/setting/text-input/configs/uiV2.js +2 -2
  30. package/dist/esm/product/components/ProductList/ProductListGridLayout.liquid.js +15 -12
  31. package/dist/esm/product/setting/product/configs/settings.js +5 -33
  32. package/dist/esm/product/setting/product/configs/uiV2.js +44 -0
  33. package/dist/esm/product/setting/product-list/configs/settingsV2.js +4 -7
  34. package/dist/esm/product/setting/product-list/configs/uiV2.js +5 -2
  35. package/dist/types/index.d.ts +25 -4
  36. package/package.json +2 -2
@@ -16,10 +16,20 @@ const SettingUIV2 = [
16
16
  isHideClear: true,
17
17
  controls: [
18
18
  {
19
- layout: 'vertical',
19
+ label: {
20
+ en: 'Content'
21
+ },
20
22
  setting: {
21
23
  id: 'placeholder'
22
24
  }
25
+ },
26
+ {
27
+ setting: {
28
+ id: 'placeholderColor'
29
+ },
30
+ label: {
31
+ en: 'Color'
32
+ }
23
33
  }
24
34
  ]
25
35
  },
@@ -40,65 +50,299 @@ const SettingUIV2 = [
40
50
  label: {
41
51
  en: 'Width'
42
52
  },
53
+ controlConfig: {
54
+ id: 'width',
55
+ type: 'dropdown:input',
56
+ label: 'Width',
57
+ inputType: 'number',
58
+ units: [
59
+ 'px',
60
+ '%'
61
+ ],
62
+ hideUnit: false,
63
+ linkWithSetting: {
64
+ name: 'globalSize',
65
+ field: 'width'
66
+ },
67
+ displayOptions: [
68
+ {
69
+ label: 'Default',
70
+ value: '1200px',
71
+ showValue: true
72
+ },
73
+ {
74
+ label: 'Full',
75
+ value: '100%',
76
+ showValue: true
77
+ }
78
+ ]
79
+ },
80
+ layout: 'horizontal'
81
+ },
82
+ {
83
+ label: {
84
+ en: 'Height'
85
+ },
86
+ controlConfig: {
87
+ id: 'height',
88
+ type: 'dropdown:input',
89
+ label: 'Height',
90
+ inputType: 'number',
91
+ units: [
92
+ 'px',
93
+ '%'
94
+ ],
95
+ hideUnit: false,
96
+ linkWithSetting: {
97
+ name: 'globalSize',
98
+ field: 'height'
99
+ }
100
+ },
101
+ layout: 'horizontal'
102
+ },
103
+ {
104
+ label: {
105
+ en: 'Padding'
106
+ },
107
+ controlConfig: {
108
+ id: 'padding',
109
+ type: 'padding-v2',
110
+ linkWithSetting: {
111
+ name: 'globalSize',
112
+ field: 'padding'
113
+ },
114
+ compoDefaultValue: {
115
+ desktop: {
116
+ default: {
117
+ type: 'medium',
118
+ top: '12px',
119
+ bottom: '12px',
120
+ left: '24px',
121
+ right: '24px'
122
+ }
123
+ }
124
+ }
125
+ }
126
+ }
127
+ ]
128
+ },
129
+ {
130
+ label: {
131
+ en: 'Background'
132
+ },
133
+ controls: [
134
+ {
43
135
  setting: {
44
- id: 'width'
136
+ id: 'background'
137
+ },
138
+ layout: 'vertical'
139
+ }
140
+ ]
141
+ },
142
+ {
143
+ label: {
144
+ en: 'Shape'
145
+ },
146
+ controls: [
147
+ {
148
+ label: {
149
+ en: 'Border'
150
+ },
151
+ controlConfig: {
152
+ id: 'border',
153
+ type: 'border-v2',
154
+ linkWithSetting: {
155
+ name: 'wrapperBorder'
156
+ }
45
157
  }
46
158
  },
47
159
  {
48
160
  label: {
49
- en: 'Padding'
161
+ en: 'Corner'
50
162
  },
51
163
  setting: {
52
- id: 'size'
164
+ id: 'rounded',
165
+ state: 'normal'
166
+ }
167
+ },
168
+ {
169
+ label: {
170
+ en: 'Shadow'
171
+ },
172
+ setting: {
173
+ id: 'boxShadow',
174
+ state: 'normal'
175
+ },
176
+ options: {
177
+ updateFields: [
178
+ {
179
+ field: 'enable',
180
+ settingId: 'hasBoxShadow',
181
+ state: 'normal'
182
+ }
183
+ ]
184
+ },
185
+ controlChangeTrigger: {
186
+ settings: [
187
+ {
188
+ condition: `boxShadow.normal.enable === true`,
189
+ source: [
190
+ 'boxShadow',
191
+ 'hasBoxShadow'
192
+ ],
193
+ action: {
194
+ controlId: 'hasBoxShadow',
195
+ groupType: 'advanced',
196
+ controlType: 'advanced',
197
+ state: 'normal',
198
+ newValue: true
199
+ }
200
+ },
201
+ {
202
+ condition: `boxShadow.normal.enable === false`,
203
+ source: [
204
+ 'boxShadow',
205
+ 'hasBoxShadow'
206
+ ],
207
+ action: {
208
+ controlId: 'hasBoxShadow',
209
+ groupType: 'advanced',
210
+ controlType: 'advanced',
211
+ state: 'normal',
212
+ newValue: false
213
+ }
214
+ }
215
+ ],
216
+ options: {
217
+ noRecordHistory: true
218
+ }
53
219
  }
54
220
  }
55
221
  ]
56
222
  },
57
223
  {
58
224
  label: {
59
- en: 'Configuration'
225
+ en: 'Hover effect'
60
226
  },
61
227
  controls: [
62
228
  {
63
229
  label: {
64
- en: 'Required'
230
+ en: 'Text color'
65
231
  },
66
232
  setting: {
67
- id: 'required'
233
+ id: 'textColorHover',
234
+ state: 'hover'
68
235
  }
69
236
  },
70
237
  {
71
238
  label: {
72
- en: 'Field name'
239
+ en: 'Background'
73
240
  },
74
241
  setting: {
75
- id: 'name'
242
+ id: 'backgroundColorV2Hover',
243
+ state: 'hover'
76
244
  }
77
245
  },
78
246
  {
79
247
  label: {
80
- en: 'Hide on client'
248
+ en: 'Border'
81
249
  },
82
250
  setting: {
83
- id: 'hideOnClient'
251
+ id: 'borderEmailHover',
252
+ state: 'hover'
253
+ }
254
+ },
255
+ {
256
+ label: {
257
+ en: 'Corner'
258
+ },
259
+ setting: {
260
+ id: 'roundedEmailHover',
261
+ state: 'hover'
262
+ }
263
+ },
264
+ {
265
+ label: {
266
+ en: 'Shadow'
267
+ },
268
+ setting: {
269
+ id: 'boxShadowEmailHover',
270
+ state: 'hover'
84
271
  }
85
272
  }
86
273
  ]
87
274
  },
88
275
  {
276
+ label: {
277
+ en: 'Active state'
278
+ },
89
279
  controls: [
90
280
  {
91
281
  label: {
92
- en: 'Align'
282
+ en: 'Text color'
283
+ },
284
+ setting: {
285
+ id: 'textColorActive',
286
+ state: 'active'
287
+ }
288
+ },
289
+ {
290
+ label: {
291
+ en: 'Background'
93
292
  },
94
- conditionEnable: '!(parseInt(width) >= 100 && width?.includes("%"))',
95
293
  setting: {
96
- id: 'align'
294
+ id: 'backgroundColorV2Active',
295
+ state: 'active'
296
+ }
297
+ },
298
+ {
299
+ label: {
300
+ en: 'Border'
97
301
  },
98
- options: {
99
- labelVariant: 'primary',
100
- fullWidth: true,
101
- disableMessage: `Align is not supported when width is 100%`
302
+ setting: {
303
+ id: 'borderEmailActive',
304
+ state: 'active'
305
+ }
306
+ },
307
+ {
308
+ label: {
309
+ en: 'Corner'
310
+ },
311
+ setting: {
312
+ id: 'roundedEmailActive',
313
+ state: 'active'
314
+ }
315
+ },
316
+ {
317
+ label: {
318
+ en: 'Shadow'
319
+ },
320
+ setting: {
321
+ id: 'boxShadowEmailActive',
322
+ state: 'active'
323
+ }
324
+ }
325
+ ]
326
+ },
327
+ {
328
+ label: {
329
+ en: 'Configuration'
330
+ },
331
+ controls: [
332
+ {
333
+ label: {
334
+ en: 'Required'
335
+ },
336
+ setting: {
337
+ id: 'required'
338
+ }
339
+ },
340
+ {
341
+ label: {
342
+ en: 'Hide on client'
343
+ },
344
+ setting: {
345
+ id: 'hideOnClient'
102
346
  }
103
347
  }
104
348
  ]
@@ -86,7 +86,10 @@ const TextInputSettings = [
86
86
  label: 'Text styles',
87
87
  type: 'typography-v2',
88
88
  default: {
89
- type: 'paragraph-1'
89
+ type: 'paragraph-1',
90
+ attrs: {
91
+ color: 'text-2'
92
+ }
90
93
  },
91
94
  hiddenSetting: {
92
95
  textAlign: true,
@@ -203,8 +206,8 @@ const TextInputSettings = [
203
206
  type: 'medium',
204
207
  top: '12px',
205
208
  bottom: '12px',
206
- left: '24px',
207
- right: '24px'
209
+ left: '12px',
210
+ right: '12px'
208
211
  }
209
212
  }
210
213
  }
@@ -133,8 +133,8 @@ const SettingUIV2 = [
133
133
  type: 'medium',
134
134
  top: '12px',
135
135
  bottom: '12px',
136
- left: '24px',
137
- right: '24px'
136
+ left: '12px',
137
+ right: '12px'
138
138
  }
139
139
  }
140
140
  }
@@ -28,24 +28,17 @@ const ProductListGridLayout = (props)=>{
28
28
  </gp-same-height-v2>
29
29
  `;
30
30
  };
31
- return core.template /* liquid */ `
32
- <div
33
- ${productListAttr}
34
- style="${gridLayoutStyle}"
35
- class="${gridLayoutClass}"
36
- >
31
+ const renderProductList = ()=>{
32
+ return core.template /* liquid */ `
37
33
  {%- assign count = 0 -%}
38
34
  {%- for product in products limit: limit -%}
39
35
  {%- if product.id != empty -%}
40
36
  {%- assign count = count | plus: 1 -%}
41
37
  {%- assign variant = product.selected_or_first_available_variant -%}
42
38
  {%- assign product_form_id = 'product-form-' | append: "${builderProps?.uid}" | append: product.id -%}
43
- ${core.RenderIf(setting?.sameHeight, renderSameHeightGrid(`${ProductListItem_liquid.default({
44
- ...props
45
- })}`))}
46
- ${core.RenderIf(!setting?.sameHeight, core.template /* liquid */ `${ProductListItem_liquid.default({
47
- ...props
48
- })}`)}
39
+ ${ProductListItem_liquid.default({
40
+ ...props
41
+ })}
49
42
  {%- endif -%}
50
43
  {% endfor %}
51
44
  {%- if count == 0 and ${productListId?.length} == 0 -%}
@@ -55,6 +48,16 @@ const ProductListGridLayout = (props)=>{
55
48
  <div>${helpers.getStaticLocale('ProductList', 'no_products_found')}</div>
56
49
  {%- endif -%}
57
50
  {%- endif -%}
51
+ `;
52
+ };
53
+ return core.template /* liquid */ `
54
+ <div
55
+ ${productListAttr}
56
+ style="${gridLayoutStyle}"
57
+ class="${gridLayoutClass}"
58
+ >
59
+ ${core.RenderIf(setting?.sameHeight, renderSameHeightGrid(`${renderProductList()}`))}
60
+ ${core.RenderIf(!setting?.sameHeight, core.template /* liquid */ `${renderProductList()}`)}
58
61
  </div>
59
62
  `;
60
63
  };
@@ -256,7 +256,7 @@ const ProductSettings = [
256
256
  'px'
257
257
  ],
258
258
  min: 0,
259
- max: 200,
259
+ max: 80,
260
260
  devices: {
261
261
  desktop: {
262
262
  default: '32px'
@@ -270,7 +270,7 @@ const ProductSettings = [
270
270
  'px'
271
271
  ],
272
272
  min: 0,
273
- max: 200,
273
+ max: 80,
274
274
  devices: {
275
275
  desktop: {
276
276
  default: '16px'
@@ -299,23 +299,12 @@ const ProductSettings = [
299
299
  type: 'background-media',
300
300
  ignoreReRender: true,
301
301
  showVideo: false,
302
+ hideImage: true,
302
303
  devices: {
303
304
  desktop: {
304
305
  default: {
305
306
  type: 'color',
306
- color: 'transparent',
307
- image: {
308
- src: '',
309
- width: 0,
310
- height: 0
311
- },
312
- size: 'cover',
313
- position: {
314
- x: 50,
315
- y: 50
316
- },
317
- repeat: 'no-repeat',
318
- attachment: 'scroll'
307
+ color: 'transparent'
319
308
  }
320
309
  }
321
310
  },
@@ -323,24 +312,7 @@ const ProductSettings = [
323
312
  desktop: {
324
313
  default: {
325
314
  type: 'color',
326
- color: '#DDDDDD',
327
- image: {
328
- src: 'https://ucarecdn.com/5e27d43d-eb1e-4e71-b7e1-4158f3071bb6/-/format/auto/',
329
- width: 1200,
330
- height: 480
331
- },
332
- size: 'cover',
333
- position: {
334
- x: 50,
335
- y: 50
336
- },
337
- repeat: 'no-repeat',
338
- attachment: 'scroll',
339
- preload: false,
340
- video: 'https://youtu.be/KOxfzBp72uk',
341
- videoHtml5: 'https://media.w3.org/2010/05/sintel/trailer.mp4',
342
- videoType: 'youtube',
343
- loop: true
315
+ color: '#DDDDDD'
344
316
  }
345
317
  }
346
318
  }
@@ -160,6 +160,50 @@ const SettingUIV2 = [
160
160
  setting: {
161
161
  id: 'boxShadow',
162
162
  state: 'normal'
163
+ },
164
+ options: {
165
+ updateFields: [
166
+ {
167
+ field: 'enable',
168
+ settingId: 'advanced.hasBoxShadow',
169
+ state: 'normal'
170
+ }
171
+ ]
172
+ },
173
+ controlChangeTrigger: {
174
+ settings: [
175
+ {
176
+ condition: `boxShadow.normal.enable === true`,
177
+ source: [
178
+ 'boxShadow',
179
+ 'hasBoxShadow'
180
+ ],
181
+ action: {
182
+ controlId: 'hasBoxShadow',
183
+ groupType: 'advanced',
184
+ controlType: 'advanced',
185
+ state: 'normal',
186
+ newValue: true
187
+ }
188
+ },
189
+ {
190
+ condition: `boxShadow.normal.enable === false`,
191
+ source: [
192
+ 'boxShadow',
193
+ 'hasBoxShadow'
194
+ ],
195
+ action: {
196
+ controlId: 'hasBoxShadow',
197
+ groupType: 'advanced',
198
+ controlType: 'advanced',
199
+ state: 'normal',
200
+ newValue: false
201
+ }
202
+ }
203
+ ],
204
+ options: {
205
+ noRecordHistory: true
206
+ }
163
207
  }
164
208
  }
165
209
  ]
@@ -21,12 +21,11 @@ const ProductListSettingsV2 = [
21
21
  },
22
22
  {
23
23
  id: 'slidesToShow',
24
- type: 'range',
24
+ type: 'input:slider',
25
25
  min: 1,
26
26
  max: 6,
27
+ isNumber: true,
27
28
  label: 'Products per rows ',
28
- hideUnit: true,
29
- useOnlyUnitInit: true,
30
29
  devices: {
31
30
  desktop: {
32
31
  default: 4
@@ -41,14 +40,12 @@ const ProductListSettingsV2 = [
41
40
  },
42
41
  {
43
42
  id: 'numberOfProducts',
44
- type: 'range',
43
+ type: 'input:slider',
45
44
  min: 1,
46
45
  max: 50,
47
46
  label: 'Number of products',
47
+ isNumber: true,
48
48
  default: 4,
49
- hide: true,
50
- hideUnit: true,
51
- useOnlyUnitInit: true,
52
49
  ignoreMax: true
53
50
  },
54
51
  {
@@ -114,7 +114,8 @@ const SettingUIV2 = [
114
114
  id: 'arrow'
115
115
  },
116
116
  options: {
117
- labelVariant: 'primary'
117
+ labelVariant: 'primary',
118
+ toggleStyle: 'switch'
118
119
  }
119
120
  },
120
121
  {
@@ -128,7 +129,9 @@ const SettingUIV2 = [
128
129
  },
129
130
  {
130
131
  conditionDisplay: 'arrow === true',
131
- layout: 'vertical',
132
+ label: {
133
+ en: 'Icon'
134
+ },
132
135
  setting: {
133
136
  id: 'arrowCustom'
134
137
  }
@@ -1,4 +1,4 @@
1
- import { dataStringify, getResponsiveValueByScreen } from '@gem-sdk/core';
1
+ import { getResponsiveValueByScreen } from '@gem-sdk/core';
2
2
  import { createStateOrContext } from '@gem-sdk/system';
3
3
 
4
4
  const getData = (props)=>{
@@ -37,14 +37,14 @@ const getData = (props)=>{
37
37
  };
38
38
  const stateData = createStateOrContext({
39
39
  id: uniqueComponentId,
40
- setting,
41
- styles,
42
40
  moveToIdx,
43
- isHiddenArrowWhenDisabled
41
+ isHiddenArrowWhenDisabled,
42
+ setting,
43
+ styles
44
44
  });
45
45
  return {
46
46
  loopConfig: getLoopSetting(),
47
- stateData: dataStringify(stateData).replaceAll("'", '&#039;'),
47
+ stateData: JSON.stringify(stateData).replaceAll("'", '&#039;'),
48
48
  uniqueComponentId,
49
49
  arrowShowConfig: getArrowType(),
50
50
  sliderSelector