@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,4 +1,4 @@
1
- import { makeStyle, makeStyleResponsive, getGradientBgrStyleByDevice, getStyleBackgroundByDevice } from '@gem-sdk/core';
1
+ import { makeStyle, makeStyleResponsive, getStyleBackgroundByDevice, getGradientBgrStyleByDevice } from '@gem-sdk/core';
2
2
  import 'react/jsx-runtime';
3
3
  import 'react';
4
4
  import { ELEMENT_Z_INDEX } from '../../../common/const.js';
@@ -13,7 +13,7 @@ const getDisplayStyle = (device, display, position)=>{
13
13
  return style;
14
14
  };
15
15
  const getCSSPosition = (position, device)=>{
16
- if (device === '-mobile') {
16
+ if (device === '-mobile' || device === '-tablet') {
17
17
  return 'fixed';
18
18
  }
19
19
  return position == 'top' ? 'sticky' : 'fixed';
@@ -42,8 +42,8 @@ const getContentStyles = (args)=>{
42
42
  }),
43
43
  ...makeStyleResponsive('w', width),
44
44
  ...filterStyles(style),
45
- ...getGradientBgrStyleByDevice(background),
46
- ...getStyleBackgroundByDevice(background)
45
+ ...getStyleBackgroundByDevice(background),
46
+ ...getGradientBgrStyleByDevice(background)
47
47
  };
48
48
  };
49
49
  const getStylePadding = (style)=>{
@@ -6,8 +6,8 @@ const useSticky = (setting)=>{
6
6
  const w = makeStyleResponsive('w', width);
7
7
  const sidebarMode = usePageStore((s)=>s.sidebarMode === 'interaction');
8
8
  const currentDevice = useCurrentDevice();
9
- const getCSSPosition = (position, isMobile)=>{
10
- if (isMobile) {
9
+ const getCSSPosition = (position, forceFixed)=>{
10
+ if (forceFixed) {
11
11
  return 'fixed';
12
12
  }
13
13
  return position == 'top' ? 'sticky' : 'fixed';
@@ -57,7 +57,7 @@ const useSticky = (setting)=>{
57
57
  const positionStyle = useMemo(()=>{
58
58
  return {
59
59
  [`--pos`]: getCSSPosition(position?.desktop),
60
- [`--pos-tablet`]: getCSSPosition(position?.tablet ?? position?.desktop),
60
+ [`--pos-tablet`]: getCSSPosition(position?.tablet ?? position?.desktop, true),
61
61
  [`--pos-mobile`]: getCSSPosition(position?.mobile ?? position?.desktop, true)
62
62
  };
63
63
  }, [
@@ -3691,14 +3691,13 @@ type ProductListSettingStyles = {
3691
3691
  verticalGutter?: ObjectDevices$1<string>;
3692
3692
  fullWidth?: ObjectDevices$1<boolean>;
3693
3693
  adaptiveHeight?: ObjectDevices$1<boolean>;
3694
- spacing?: ObjectDevices$1<number>;
3695
3694
  width?: ObjectDevices$1<string>;
3696
3695
  height?: ObjectDevices$1<string>;
3697
3696
  backgroundColor?: ObjectDevices$1<ColorValueType$1>;
3698
3697
  backgroundImage?: ObjectDevices$1<BackgroundImageValue>;
3699
3698
  preloadBgImage?: boolean;
3700
3699
  align?: ObjectDevices$1<AlignProp>;
3701
- };
3700
+ } & CarouselProps['styles'];
3702
3701
  type ProductListSetting = {
3703
3702
  productSetting?: {
3704
3703
  productSrc?: ProductSource;
@@ -3718,12 +3717,10 @@ type ProductListSetting = {
3718
3717
  randomizeOrder?: boolean;
3719
3718
  numberOfProducts?: number;
3720
3719
  col?: number;
3721
- loop?: ObjectDevices$1<boolean>;
3722
3720
  scrollMode?: ObjectDevices$1<'snap' | 'free' | 'free-snap'>;
3723
3721
  orderBy?: ProductSortedByOrderType;
3724
- dragToScroll?: boolean;
3725
3722
  sameHeight?: boolean;
3726
- } & Pick<NonNullable<CarouselProps['setting']>, 'dotColor' | 'dotActiveColor' | 'dot' | 'dotStyle' | 'dotSize' | 'dotGapToCarousel' | 'arrow' | 'arrowCustom' | 'arrowCustomColor' | 'speed' | 'slidesToShow' | 'controlOverContent' | 'loop' | 'autoplay' | 'pauseOnHover' | 'autoplayTimeout'>;
3723
+ } & CarouselProps['setting'];
3727
3724
  type ProductListProps = BasePropsWrap<ProductListSetting, ProductListSettingStyles> & {
3728
3725
  style?: React.CSSProperties;
3729
3726
  className?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/components",
3
- "version": "2.0.0-dev.474",
3
+ "version": "2.0.0-dev.477",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",
@@ -1,496 +0,0 @@
1
- 'use strict';
2
-
3
- const ProductListSettings = [
4
- {
5
- id: 'setting',
6
- controls: [
7
- {
8
- id: 'productSetting',
9
- type: 'product-list',
10
- label: 'Select product list',
11
- default: {
12
- productSrc: 'PickProduct',
13
- productIds: [],
14
- collectionId: 'Latest',
15
- relatedType: 'related-product',
16
- relatedTag: [
17
- 'collection'
18
- ],
19
- hasRelatedExclude: false
20
- }
21
- },
22
- // {
23
- // id: 'randomizeOrder',
24
- // type: 'toggle',
25
- // label: 'Randomize product order',
26
- // default: false,
27
- // },
28
- // {
29
- // id: 'productSrc',
30
- // type: 'select',
31
- // label: 'Product source',
32
- // default: 'PickProduct',
33
- // options: [
34
- // {
35
- // label: 'Pick Collections',
36
- // value: 'Collection',
37
- // hideOnPage: ['GP_COLLECTION'],
38
- // },
39
- // {
40
- // label: 'Pick Products',
41
- // value: 'PickProduct',
42
- // hideOnPage: ['GP_COLLECTION'],
43
- // },
44
- // {
45
- // label: 'Display by assigned collection',
46
- // value: 'DynamicCollection',
47
- // hideOnPage: [
48
- // 'ARTICLE',
49
- // 'BLOG',
50
- // 'COLLECTION',
51
- // 'GP_ARTICLE',
52
- // 'GP_BLOG',
53
- // 'GP_INDEX',
54
- // 'GP_PRODUCT',
55
- // 'GP_STATIC',
56
- // 'PRODUCT',
57
- // 'STATIC',
58
- // ],
59
- // },
60
- // ],
61
- // },
62
- // {
63
- // id: 'orderBy',
64
- // type: 'select',
65
- // label: 'Order By',
66
- // default: 'none',
67
- // hide: true,
68
- // options: [
69
- // {
70
- // label: 'None',
71
- // value: 'none',
72
- // },
73
- // {
74
- // label: 'Name A-Z',
75
- // value: 'TITLE_ASC',
76
- // },
77
- // {
78
- // label: 'Name Z-A',
79
- // value: 'TITLE_DESC',
80
- // },
81
- // {
82
- // label: 'New Arrivals',
83
- // value: 'CREATED_AT_DESC',
84
- // },
85
- // ],
86
- // },
87
- // {
88
- // id: 'collectionId',
89
- // type: 'collection',
90
- // label: 'Collection ID',
91
- // hide: true,
92
- // default: 'Latest',
93
- // },
94
- // {
95
- // id: 'productIds',
96
- // type: 'pick-multi-product',
97
- // label: 'Product List',
98
- // max: 24,
99
- // hide: true,
100
- // default: [],
101
- // },
102
- {
103
- id: 'slidesToShow',
104
- type: 'input:slider',
105
- min: 1,
106
- max: 6,
107
- label: 'Products per rows ',
108
- hideUnit: true,
109
- useOnlyUnitInit: true,
110
- devices: {
111
- desktop: {
112
- default: 4
113
- },
114
- tablet: {
115
- default: 3
116
- },
117
- mobile: {
118
- default: 2
119
- }
120
- }
121
- },
122
- {
123
- id: 'numberOfProducts',
124
- type: 'input:slider',
125
- min: 1,
126
- max: 50,
127
- label: 'Number of products',
128
- default: 4,
129
- hide: true,
130
- hideUnit: true,
131
- useOnlyUnitInit: true,
132
- ignoreMax: true
133
- },
134
- {
135
- id: 'slider-settings',
136
- label: 'Slider Settings',
137
- type: 'group',
138
- hide: true,
139
- controls: [
140
- {
141
- id: 'dot',
142
- label: 'Dot',
143
- type: 'toggle',
144
- devices: {
145
- desktop: {
146
- default: false
147
- }
148
- }
149
- },
150
- {
151
- id: 'dotStyle',
152
- label: 'Dot style',
153
- type: 'layout-segment',
154
- iconViewBox: '0 0 77 48',
155
- enableItemBackground: true,
156
- enableTooltip: true,
157
- options: [
158
- {
159
- label: 'None',
160
- value: 'none',
161
- type: 'carousel-dot',
162
- isTextIcon: true
163
- },
164
- {
165
- label: 'Inside',
166
- value: 'inside',
167
- type: 'carousel-dot'
168
- },
169
- {
170
- label: 'Outside',
171
- value: 'outside',
172
- type: 'carousel-dot'
173
- }
174
- ],
175
- devices: {
176
- desktop: {
177
- default: 'inside'
178
- }
179
- }
180
- },
181
- {
182
- id: 'dotSize',
183
- label: 'Dots size',
184
- type: 'input:stepper',
185
- min: 1,
186
- devices: {
187
- desktop: {
188
- default: 12
189
- }
190
- }
191
- },
192
- {
193
- id: 'dotGapToCarousel',
194
- label: 'Gap to carousel',
195
- type: 'input:unit',
196
- useOnlyUnitInit: true,
197
- units: [
198
- 'px'
199
- ],
200
- min: 0,
201
- devices: {
202
- desktop: {
203
- default: 16
204
- }
205
- }
206
- },
207
- {
208
- id: 'dotColor',
209
- label: 'Dot color',
210
- type: 'colorpicker',
211
- devices: {
212
- desktop: {
213
- default: 'bg-1'
214
- }
215
- }
216
- },
217
- {
218
- id: 'dotActiveColor',
219
- label: 'Dot color active',
220
- type: 'colorpicker',
221
- devices: {
222
- desktop: {
223
- default: 'line-3'
224
- }
225
- }
226
- },
227
- {
228
- id: 'arrow',
229
- label: 'Next/Prev Arrow',
230
- type: 'toggle',
231
- devices: {
232
- desktop: {
233
- default: false
234
- }
235
- }
236
- },
237
- {
238
- id: 'arrowCustom',
239
- label: 'Custom Arrow',
240
- type: 'icon',
241
- default: '<svg height="100%" width="100%" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M5 3l3.057-3 11.943 12-11.943 12-3.057-3 9-9z"></path></svg>'
242
- },
243
- {
244
- id: 'arrowCustomColor',
245
- label: 'Icon color',
246
- type: 'colorpicker',
247
- default: '#000000'
248
- },
249
- {
250
- id: 'controlOverContent',
251
- label: 'Control Over Content',
252
- type: 'toggle',
253
- devices: {
254
- desktop: {
255
- default: false
256
- }
257
- }
258
- },
259
- {
260
- id: 'loop',
261
- label: 'Loop',
262
- type: 'toggle',
263
- devices: {
264
- desktop: {
265
- default: false
266
- }
267
- }
268
- },
269
- {
270
- id: 'speed',
271
- label: 'Speed(s)',
272
- type: 'input:stepper',
273
- min: 0,
274
- max: 60,
275
- default: 2,
276
- hide: true
277
- },
278
- {
279
- id: 'dragToScroll',
280
- label: 'Drag to scroll',
281
- type: 'toggle',
282
- default: false
283
- },
284
- {
285
- id: 'autoplay',
286
- label: 'Autoplay',
287
- type: 'toggle',
288
- default: false
289
- },
290
- {
291
- id: 'pauseOnHover',
292
- label: 'Pause On Hover',
293
- type: 'toggle',
294
- default: true,
295
- hide: true
296
- },
297
- {
298
- id: 'autoplayTimeout',
299
- label: 'Timeout(s)',
300
- type: 'input:slider',
301
- min: 1,
302
- max: 10,
303
- step: 0.1,
304
- default: 2,
305
- hide: true,
306
- hideUnit: true,
307
- useOnlyUnitInit: true
308
- },
309
- {
310
- id: 'sameHeight',
311
- label: 'Enable same height',
312
- type: 'toggle',
313
- default: false
314
- }
315
- ]
316
- }
317
- ]
318
- },
319
- {
320
- id: 'style',
321
- controls: [
322
- {
323
- id: 'layout',
324
- type: 'option:value',
325
- label: 'Layout',
326
- default: 'grid',
327
- options: [
328
- {
329
- label: 'Grid',
330
- value: 'grid'
331
- },
332
- {
333
- label: 'Slider',
334
- value: 'slider'
335
- }
336
- ]
337
- },
338
- {
339
- id: 'dimensions',
340
- label: 'Dimensions',
341
- type: 'group',
342
- controls: [
343
- {
344
- id: 'fullWidth',
345
- label: 'Full Width',
346
- type: 'toggle',
347
- devices: {
348
- desktop: {
349
- default: true
350
- }
351
- }
352
- },
353
- {
354
- id: 'width',
355
- label: 'Width',
356
- type: 'input:unit',
357
- emptyOnClear: true,
358
- units: [
359
- 'px',
360
- '%'
361
- ],
362
- devices: {
363
- desktop: {
364
- default: 'default'
365
- }
366
- },
367
- hide: true
368
- },
369
- {
370
- id: 'adaptiveHeight',
371
- label: 'Fit height to content',
372
- type: 'toggle',
373
- devices: {
374
- desktop: {
375
- default: true
376
- }
377
- },
378
- hide: true
379
- },
380
- {
381
- id: 'height',
382
- label: 'Height',
383
- type: 'input:unit',
384
- units: [
385
- 'px'
386
- ],
387
- devices: {
388
- desktop: {
389
- default: '400px'
390
- }
391
- },
392
- hide: true
393
- }
394
- ]
395
- },
396
- {
397
- id: 'grid',
398
- label: 'Grid',
399
- type: 'group',
400
- controls: [
401
- {
402
- id: 'horizontalGutter',
403
- label: 'Row gap',
404
- type: 'input:unit',
405
- units: [
406
- 'px'
407
- ],
408
- devices: {
409
- desktop: {
410
- default: '16px'
411
- },
412
- mobile: {
413
- default: '16px'
414
- }
415
- }
416
- },
417
- {
418
- id: 'verticalGutter',
419
- label: 'Column gap',
420
- type: 'input:unit-spacing',
421
- units: [
422
- 'px'
423
- ],
424
- devices: {
425
- desktop: {
426
- default: '8px'
427
- },
428
- mobile: {
429
- default: '8px'
430
- }
431
- }
432
- }
433
- ],
434
- hide: true
435
- },
436
- {
437
- id: 'slider',
438
- label: 'Slider',
439
- type: 'group',
440
- controls: [
441
- {
442
- id: 'spacing',
443
- label: 'Item Spacing',
444
- type: 'input:unit',
445
- min: 0,
446
- useOnlyUnitInit: true,
447
- units: [
448
- 'px'
449
- ],
450
- devices: {
451
- desktop: {
452
- default: 44
453
- }
454
- }
455
- }
456
- ],
457
- hide: true
458
- },
459
- {
460
- id: 'align',
461
- label: 'Align',
462
- type: 'option:value',
463
- options: [
464
- {
465
- label: 'Left',
466
- value: 'left',
467
- type: 'align',
468
- tooltip: 'Align left',
469
- iconName: 'gp-align-left'
470
- },
471
- {
472
- label: 'Center',
473
- value: 'center',
474
- type: 'align',
475
- tooltip: 'Align center',
476
- iconName: 'gp-align-center'
477
- },
478
- {
479
- label: 'Right',
480
- value: 'right',
481
- type: 'align',
482
- tooltip: 'Align right',
483
- iconName: 'gp-align-right'
484
- }
485
- ],
486
- devices: {
487
- desktop: {
488
- default: 'center'
489
- }
490
- }
491
- }
492
- ]
493
- }
494
- ];
495
-
496
- exports.ProductListSettings = ProductListSettings;