@gem-sdk/components 2.0.0-dev.474 → 2.0.0-dev.477

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 (28) hide show
  1. package/dist/cjs/carousel/setting/configs/settingV2.js +735 -728
  2. package/dist/cjs/carousel/setting/configs/uiV2.js +304 -298
  3. package/dist/cjs/coupon/setting/config/settings.js +9 -9
  4. package/dist/cjs/product/components/ProductList/ProductListGridLayout.js +11 -6
  5. package/dist/cjs/product/components/ProductList/ProductListItem.liquid.js +3 -0
  6. package/dist/cjs/product/components/ProductList/common/getStyle.js +33 -1
  7. package/dist/cjs/product/components/ProductList/common/index.js +2 -25
  8. package/dist/cjs/product/setting/ProductList.js +1 -3
  9. package/dist/cjs/product/setting/product-list/configs/settingsV2.js +17 -203
  10. package/dist/cjs/product/setting/product-list/configs/uiV2.js +100 -137
  11. package/dist/cjs/sticky/components/common/styles.js +3 -3
  12. package/dist/cjs/sticky/components/hooks/useSticky.js +3 -3
  13. package/dist/esm/carousel/setting/configs/settingV2.js +734 -729
  14. package/dist/esm/carousel/setting/configs/uiV2.js +302 -299
  15. package/dist/esm/coupon/setting/config/settings.js +9 -9
  16. package/dist/esm/product/components/ProductList/ProductListGridLayout.js +11 -6
  17. package/dist/esm/product/components/ProductList/ProductListItem.liquid.js +3 -0
  18. package/dist/esm/product/components/ProductList/common/getStyle.js +34 -2
  19. package/dist/esm/product/components/ProductList/common/index.js +2 -25
  20. package/dist/esm/product/setting/ProductList.js +1 -3
  21. package/dist/esm/product/setting/product-list/configs/settingsV2.js +17 -203
  22. package/dist/esm/product/setting/product-list/configs/uiV2.js +100 -137
  23. package/dist/esm/sticky/components/common/styles.js +4 -4
  24. package/dist/esm/sticky/components/hooks/useSticky.js +3 -3
  25. package/dist/types/index.d.ts +2 -5
  26. package/package.json +1 -1
  27. package/dist/cjs/product/setting/product-list/configs/settings.js +0 -496
  28. package/dist/esm/product/setting/product-list/configs/settings.js +0 -494
@@ -1,5 +1,303 @@
1
1
  'use strict';
2
2
 
3
+ const carouselNavigationSettings = {
4
+ controls: [
5
+ {
6
+ label: {
7
+ en: 'Navigation'
8
+ },
9
+ setting: {
10
+ id: 'navigationEnable'
11
+ },
12
+ options: {
13
+ labelVariant: 'primary',
14
+ toggleStyle: 'switch'
15
+ }
16
+ },
17
+ {
18
+ conditionDisplay: `navigationEnable === true`,
19
+ label: {
20
+ en: 'Position'
21
+ },
22
+ setting: {
23
+ id: 'navigationStyle'
24
+ }
25
+ },
26
+ {
27
+ conditionDisplay: `navigationEnable === true`,
28
+ label: {
29
+ en: 'Icon'
30
+ },
31
+ setting: {
32
+ id: 'arrowCustom'
33
+ }
34
+ },
35
+ {
36
+ conditionDisplay: `navigationEnable === true`,
37
+ label: {
38
+ en: 'Icon size'
39
+ },
40
+ setting: {
41
+ id: 'arrowIconSize'
42
+ }
43
+ },
44
+ {
45
+ conditionDisplay: `navigationEnable === true`,
46
+ label: {
47
+ en: 'Icon color'
48
+ },
49
+ setting: {
50
+ id: 'arrowCustomColor'
51
+ }
52
+ }
53
+ ],
54
+ moreSettings: {
55
+ controls: [
56
+ {
57
+ type: 'combo',
58
+ conditionDisplay: `navigationEnable === true`,
59
+ label: {
60
+ en: 'Size'
61
+ },
62
+ fixedValue: 'Edit',
63
+ iconName: 'polaris-measurement-size',
64
+ controls: [
65
+ {
66
+ setting: {
67
+ id: 'arrowButtonSize'
68
+ },
69
+ layout: 'vertical'
70
+ },
71
+ {
72
+ label: {
73
+ en: 'Padding'
74
+ },
75
+ controlConfig: {
76
+ id: 'padding',
77
+ type: 'padding-v2',
78
+ linkWithSetting: {
79
+ name: 'arrowButtonSize',
80
+ field: 'padding'
81
+ },
82
+ compoDefaultValue: {
83
+ desktop: {
84
+ default: {
85
+ type: 'custom',
86
+ top: '4px',
87
+ bottom: '4px',
88
+ left: '4px',
89
+ right: '4px'
90
+ }
91
+ }
92
+ }
93
+ }
94
+ }
95
+ ]
96
+ },
97
+ {
98
+ conditionDisplay: `navigationEnable === true`,
99
+ label: {
100
+ en: 'Background'
101
+ },
102
+ setting: {
103
+ id: 'arrowBackgroundColor'
104
+ }
105
+ },
106
+ {
107
+ conditionDisplay: `navigationEnable === true`,
108
+ label: {
109
+ en: 'Border'
110
+ },
111
+ setting: {
112
+ id: 'arrowBorder'
113
+ }
114
+ },
115
+ {
116
+ conditionDisplay: `navigationEnable === true`,
117
+ label: {
118
+ en: 'Corner'
119
+ },
120
+ setting: {
121
+ id: 'roundedArrow'
122
+ }
123
+ },
124
+ {
125
+ conditionDisplay: `navigationEnable === true`,
126
+ label: {
127
+ en: 'Shadow'
128
+ },
129
+ setting: {
130
+ id: 'arrowShadow'
131
+ }
132
+ },
133
+ {
134
+ conditionDisplay: `navigationEnable === true`,
135
+ label: {
136
+ en: 'Gap to edge'
137
+ },
138
+ setting: {
139
+ id: 'arrowGapToEachSide'
140
+ }
141
+ },
142
+ {
143
+ conditionDisplay: `navigationEnable === true`,
144
+ label: {
145
+ en: 'Show on hover'
146
+ },
147
+ setting: {
148
+ id: 'showWhenHover'
149
+ }
150
+ }
151
+ ]
152
+ }
153
+ };
154
+ const carouselDotsSettings = {
155
+ controls: [
156
+ {
157
+ label: {
158
+ en: 'Dots'
159
+ },
160
+ setting: {
161
+ id: 'dot'
162
+ },
163
+ options: {
164
+ labelVariant: 'primary',
165
+ toggleStyle: 'switch'
166
+ }
167
+ },
168
+ {
169
+ conditionDisplay: `dot === true`,
170
+ label: {
171
+ en: 'Position'
172
+ },
173
+ setting: {
174
+ id: 'dotStyle'
175
+ }
176
+ },
177
+ {
178
+ conditionDisplay: `dot === true`,
179
+ label: {
180
+ en: 'Active icon'
181
+ },
182
+ setting: {
183
+ id: 'dotActiveColor'
184
+ }
185
+ },
186
+ {
187
+ conditionDisplay: `dot === true`,
188
+ label: {
189
+ en: 'Inactive icon'
190
+ },
191
+ setting: {
192
+ id: 'dotColor'
193
+ }
194
+ },
195
+ {
196
+ conditionDisplay: `dot === true`,
197
+ label: {
198
+ en: 'Dots size'
199
+ },
200
+ setting: {
201
+ id: 'dotSize'
202
+ }
203
+ },
204
+ {
205
+ conditionDisplay: `dot === true`,
206
+ label: {
207
+ en: 'Gap to edge'
208
+ },
209
+ setting: {
210
+ id: 'dotGapToCarousel'
211
+ }
212
+ }
213
+ ]
214
+ };
215
+ const carouselEffectsSettings = {
216
+ label: {
217
+ en: 'Slide effect'
218
+ },
219
+ controls: [
220
+ {
221
+ label: {
222
+ en: 'Slide direction'
223
+ },
224
+ setting: {
225
+ id: 'rtl'
226
+ }
227
+ },
228
+ {
229
+ label: {
230
+ en: 'Autoplay'
231
+ },
232
+ setting: {
233
+ id: 'autoplay'
234
+ }
235
+ },
236
+ {
237
+ label: {
238
+ en: 'Time out'
239
+ },
240
+ setting: {
241
+ id: 'autoplayTimeout'
242
+ },
243
+ conditionDisplay: 'autoplay === true'
244
+ },
245
+ {
246
+ label: {
247
+ en: 'Pause On Hover'
248
+ },
249
+ setting: {
250
+ id: 'pauseOnHover'
251
+ },
252
+ conditionDisplay: 'autoplay == true'
253
+ },
254
+ {
255
+ label: {
256
+ en: 'Preview'
257
+ },
258
+ setting: {
259
+ id: 'runPreview'
260
+ },
261
+ conditionDisplay: 'autoplay === true'
262
+ },
263
+ {
264
+ label: {
265
+ en: 'Infinity loop'
266
+ },
267
+ setting: {
268
+ id: 'loop'
269
+ }
270
+ }
271
+ ],
272
+ moreSettings: {
273
+ controls: [
274
+ {
275
+ label: {
276
+ en: 'Drag / swipe'
277
+ },
278
+ setting: {
279
+ id: 'enableDrag'
280
+ }
281
+ },
282
+ {
283
+ label: {
284
+ en: 'Slide speed'
285
+ },
286
+ setting: {
287
+ id: 'playSpeed'
288
+ }
289
+ },
290
+ {
291
+ label: {
292
+ en: 'Animation'
293
+ },
294
+ setting: {
295
+ id: 'animationMode'
296
+ }
297
+ }
298
+ ]
299
+ }
300
+ };
3
301
  const SettingUIV2 = [
4
302
  {
5
303
  label: {
@@ -194,304 +492,9 @@ const SettingUIV2 = [
194
492
  ]
195
493
  }
196
494
  },
197
- {
198
- controls: [
199
- {
200
- label: {
201
- en: 'Navigation'
202
- },
203
- setting: {
204
- id: 'navigationEnable'
205
- },
206
- options: {
207
- labelVariant: 'primary',
208
- toggleStyle: 'switch'
209
- }
210
- },
211
- {
212
- conditionDisplay: `navigationEnable === true`,
213
- label: {
214
- en: 'Position'
215
- },
216
- setting: {
217
- id: 'navigationStyle'
218
- }
219
- },
220
- {
221
- conditionDisplay: `navigationEnable === true`,
222
- label: {
223
- en: 'Icon'
224
- },
225
- setting: {
226
- id: 'arrowCustom'
227
- }
228
- },
229
- {
230
- conditionDisplay: `navigationEnable === true`,
231
- label: {
232
- en: 'Icon size'
233
- },
234
- setting: {
235
- id: 'arrowIconSize'
236
- }
237
- },
238
- {
239
- conditionDisplay: `navigationEnable === true`,
240
- label: {
241
- en: 'Icon color'
242
- },
243
- setting: {
244
- id: 'arrowCustomColor'
245
- }
246
- }
247
- ],
248
- moreSettings: {
249
- controls: [
250
- {
251
- type: 'combo',
252
- conditionDisplay: `navigationEnable === true`,
253
- label: {
254
- en: 'Size'
255
- },
256
- fixedValue: 'Edit',
257
- iconName: 'polaris-measurement-size',
258
- controls: [
259
- {
260
- setting: {
261
- id: 'arrowButtonSize'
262
- },
263
- layout: 'vertical'
264
- },
265
- {
266
- label: {
267
- en: 'Padding'
268
- },
269
- controlConfig: {
270
- id: 'padding',
271
- type: 'padding-v2',
272
- linkWithSetting: {
273
- name: 'arrowButtonSize',
274
- field: 'padding'
275
- },
276
- compoDefaultValue: {
277
- desktop: {
278
- default: {
279
- type: 'custom',
280
- top: '4px',
281
- bottom: '4px',
282
- left: '4px',
283
- right: '4px'
284
- }
285
- }
286
- }
287
- }
288
- }
289
- ]
290
- },
291
- {
292
- conditionDisplay: `navigationEnable === true`,
293
- label: {
294
- en: 'Background'
295
- },
296
- setting: {
297
- id: 'arrowBackgroundColor'
298
- }
299
- },
300
- {
301
- conditionDisplay: `navigationEnable === true`,
302
- label: {
303
- en: 'Border'
304
- },
305
- setting: {
306
- id: 'arrowBorder'
307
- }
308
- },
309
- {
310
- conditionDisplay: `navigationEnable === true`,
311
- label: {
312
- en: 'Corner'
313
- },
314
- setting: {
315
- id: 'roundedArrow'
316
- }
317
- },
318
- {
319
- conditionDisplay: `navigationEnable === true`,
320
- label: {
321
- en: 'Shadow'
322
- },
323
- setting: {
324
- id: 'arrowShadow'
325
- }
326
- },
327
- {
328
- conditionDisplay: `navigationEnable === true`,
329
- label: {
330
- en: 'Gap to edge'
331
- },
332
- setting: {
333
- id: 'arrowGapToEachSide'
334
- }
335
- },
336
- {
337
- conditionDisplay: `navigationEnable === true`,
338
- label: {
339
- en: 'Show on hover'
340
- },
341
- setting: {
342
- id: 'showWhenHover'
343
- }
344
- }
345
- ]
346
- }
347
- },
348
- {
349
- controls: [
350
- {
351
- label: {
352
- en: 'Dots'
353
- },
354
- setting: {
355
- id: 'dot'
356
- },
357
- options: {
358
- labelVariant: 'primary',
359
- toggleStyle: 'switch'
360
- }
361
- },
362
- {
363
- conditionDisplay: `dot === true`,
364
- label: {
365
- en: 'Position'
366
- },
367
- setting: {
368
- id: 'dotStyle'
369
- }
370
- },
371
- {
372
- conditionDisplay: `dot === true`,
373
- label: {
374
- en: 'Active icon'
375
- },
376
- setting: {
377
- id: 'dotActiveColor'
378
- }
379
- },
380
- {
381
- conditionDisplay: `dot === true`,
382
- label: {
383
- en: 'Inactive icon'
384
- },
385
- setting: {
386
- id: 'dotColor'
387
- }
388
- },
389
- {
390
- conditionDisplay: `dot === true`,
391
- label: {
392
- en: 'Dots size'
393
- },
394
- setting: {
395
- id: 'dotSize'
396
- }
397
- },
398
- {
399
- conditionDisplay: `dot === true`,
400
- label: {
401
- en: 'Gap to edge'
402
- },
403
- setting: {
404
- id: 'dotGapToCarousel'
405
- }
406
- }
407
- ]
408
- },
409
- {
410
- label: {
411
- en: 'Slide effect'
412
- },
413
- controls: [
414
- {
415
- label: {
416
- en: 'Slide direction'
417
- },
418
- setting: {
419
- id: 'rtl'
420
- }
421
- },
422
- {
423
- label: {
424
- en: 'Autoplay'
425
- },
426
- setting: {
427
- id: 'autoplay'
428
- }
429
- },
430
- {
431
- label: {
432
- en: 'Time out'
433
- },
434
- setting: {
435
- id: 'autoplayTimeout'
436
- },
437
- conditionDisplay: 'autoplay === true'
438
- },
439
- {
440
- label: {
441
- en: 'Pause On Hover'
442
- },
443
- setting: {
444
- id: 'pauseOnHover'
445
- },
446
- conditionDisplay: 'autoplay == true'
447
- },
448
- {
449
- label: {
450
- en: 'Preview'
451
- },
452
- setting: {
453
- id: 'runPreview'
454
- },
455
- conditionDisplay: 'autoplay === true'
456
- },
457
- {
458
- label: {
459
- en: 'Infinity loop'
460
- },
461
- setting: {
462
- id: 'loop'
463
- }
464
- }
465
- ],
466
- moreSettings: {
467
- controls: [
468
- {
469
- label: {
470
- en: 'Drag / swipe'
471
- },
472
- setting: {
473
- id: 'enableDrag'
474
- }
475
- },
476
- {
477
- label: {
478
- en: 'Slide speed'
479
- },
480
- setting: {
481
- id: 'playSpeed'
482
- }
483
- },
484
- {
485
- label: {
486
- en: 'Animation'
487
- },
488
- setting: {
489
- id: 'animationMode'
490
- }
491
- }
492
- ]
493
- }
494
- },
495
+ carouselNavigationSettings,
496
+ carouselDotsSettings,
497
+ carouselEffectsSettings,
495
498
  {
496
499
  label: {
497
500
  en: 'Size'
@@ -640,3 +643,6 @@ const SettingUIV2 = [
640
643
  ];
641
644
 
642
645
  exports.SettingUIV2 = SettingUIV2;
646
+ exports.carouselDotsSettings = carouselDotsSettings;
647
+ exports.carouselEffectsSettings = carouselEffectsSettings;
648
+ exports.carouselNavigationSettings = carouselNavigationSettings;
@@ -6,22 +6,22 @@ const CouponSettings = [
6
6
  controls: [
7
7
  {
8
8
  id: 'couponLayout',
9
- label: 'Price Layout',
10
- type: 'layout-segment',
11
- iconViewBox: '0 0 120 72',
12
- enableItemBackground: true,
13
- enableTooltip: false,
9
+ label: 'Layout',
10
+ type: 'layout-selector',
11
+ iconViewBox: '0 0 80 48',
12
+ itemPerRow: 2,
13
+ itemSpacing: 'large',
14
14
  default: 'icon',
15
15
  options: [
16
16
  {
17
- label: 'secondary',
17
+ label: 'Secondary',
18
18
  value: 'none',
19
- type: 'copy-layout'
19
+ iconName: 'coupon-code-layout'
20
20
  },
21
21
  {
22
- label: 'link',
22
+ label: 'Icon',
23
23
  value: 'icon',
24
- type: 'copy-layout'
24
+ iconName: 'coupon-code-no-icon-layout'
25
25
  }
26
26
  ]
27
27
  },
@@ -12,7 +12,7 @@ var getAttr = require('./common/getAttr.js');
12
12
  const ProductListGridLayout = (props)=>{
13
13
  const { children, productSortedById, generateGridRowArray, setting } = props;
14
14
  const mode = core.useEditorMode();
15
- const { gridLayoutStyle } = getStyle.getStyle(props);
15
+ const { gridLayoutStyle, productItemStyle } = getStyle.getStyle(props);
16
16
  const { gridLayoutClass, productItemClass } = getClass.getClass(props);
17
17
  const { productListAttr, getAttrProductItemEditor } = getAttr.getAttr(props);
18
18
  return /*#__PURE__*/ jsxRuntime.jsx("div", {
@@ -23,13 +23,18 @@ const ProductListGridLayout = (props)=>{
23
23
  product: product,
24
24
  readOnly: true,
25
25
  children: /*#__PURE__*/ jsxRuntime.jsx("div", {
26
- ...mode === 'edit' ? getAttrProductItemEditor(product?.baseID) : {},
27
- className: productItemClass,
28
26
  style: {
29
- '--grchild': setting?.sameHeight ? generateGridRowArray?.[index]?.gridRow : undefined,
30
- '--mbchild': generateGridRowArray?.[index]?.marginBottom
27
+ ...productItemStyle
31
28
  },
32
- children: core.isEmptyChildren(children) ? /*#__PURE__*/ jsxRuntime.jsx(ChildrenDroppable.default, {}) : children
29
+ children: /*#__PURE__*/ jsxRuntime.jsx("div", {
30
+ ...mode === 'edit' ? getAttrProductItemEditor(product?.baseID) : {},
31
+ className: productItemClass,
32
+ style: {
33
+ '--grchild': setting?.sameHeight ? generateGridRowArray?.[index]?.gridRow : undefined,
34
+ '--mbchild': generateGridRowArray?.[index]?.marginBottom
35
+ },
36
+ children: core.isEmptyChildren(children) ? /*#__PURE__*/ jsxRuntime.jsx(ChildrenDroppable.default, {}) : children
37
+ })
33
38
  })
34
39
  }, product?.baseID))
35
40
  });
@@ -4,15 +4,18 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var core = require('@gem-sdk/core');
6
6
  var getClass = require('./common/getClass.js');
7
+ var getStyle = require('./common/getStyle.js');
7
8
 
8
9
  const ProductListItem = (props)=>{
9
10
  const { pageContext, children } = props;
11
+ const { productItemStyle } = getStyle.getStyle(props);
10
12
  const { productItemClass, gpProductClass } = getClass.getClass(props);
11
13
  return core.template /* liquid */ `
12
14
  <gp-product
13
15
  gp-context='{"variantSelected": {{ variant | json | escape }}, "quantity": 1 , "formId": "{{ product_form_id }}"}'
14
16
  gp-data='{"variantSelected": {{ variant | json | escape }}, "quantity": 1, "productUrl":{{ product.url | json | escape }}, "productHandle":{{ product.handle | json | escape }}, "collectionUrl": {{ collection.url | json | escape }}, "collectionHandle": {{ collection.handle | json | escape }},"pageContext" : ${JSON.stringify(pageContext)}}'
15
17
  class="${gpProductClass}"
18
+ style="${productItemStyle}"
16
19
  >
17
20
  {%- form 'product', product, id: product_form_id, class: 'form contents ${productItemClass}', data-type: 'add-to-cart-form', autocomplete: 'off' -%}
18
21
  <input type="hidden" name="id" value="{{ variant.id }}" />