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

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