@gem-sdk/components 2.0.0-dev.551 → 2.0.0-dev.553

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 (29) hide show
  1. package/dist/cjs/coupon/common/classes.js +1 -1
  2. package/dist/cjs/coupon/common/styles.js +4 -2
  3. package/dist/cjs/coupon/setting/config/settings.js +7 -3
  4. package/dist/cjs/coupon/setting/config/uiV2.js +65 -64
  5. package/dist/cjs/marquee/setting/configs/settingsV2.js +3 -3
  6. package/dist/cjs/product/components/ProductBadge/common/getAttrs.js +2 -19
  7. package/dist/cjs/product/components/ProductBadge/index.liquid.js +15 -0
  8. package/dist/cjs/product/components/ProductPrice/hooks/useGpPrice.js +1 -1
  9. package/dist/cjs/product/setting/constant/bundle-layout/horizontalOne.js +230 -14
  10. package/dist/cjs/product/setting/constant/bundle-layout/horizontalThree.js +684 -464
  11. package/dist/cjs/product/setting/constant/bundle-layout/horizontalTwo.js +235 -15
  12. package/dist/cjs/product/setting/constant/bundle-layout/verticalOne.js +230 -13
  13. package/dist/cjs/product/setting/constant/bundle-layout/verticalThree.js +579 -359
  14. package/dist/cjs/product/setting/constant/bundle-layout/verticalTwo.js +579 -359
  15. package/dist/esm/coupon/common/classes.js +1 -1
  16. package/dist/esm/coupon/common/styles.js +4 -2
  17. package/dist/esm/coupon/setting/config/settings.js +7 -3
  18. package/dist/esm/coupon/setting/config/uiV2.js +65 -64
  19. package/dist/esm/marquee/setting/configs/settingsV2.js +3 -3
  20. package/dist/esm/product/components/ProductBadge/common/getAttrs.js +2 -19
  21. package/dist/esm/product/components/ProductBadge/index.liquid.js +17 -2
  22. package/dist/esm/product/components/ProductPrice/hooks/useGpPrice.js +1 -1
  23. package/dist/esm/product/setting/constant/bundle-layout/horizontalOne.js +230 -14
  24. package/dist/esm/product/setting/constant/bundle-layout/horizontalThree.js +684 -464
  25. package/dist/esm/product/setting/constant/bundle-layout/horizontalTwo.js +235 -15
  26. package/dist/esm/product/setting/constant/bundle-layout/verticalOne.js +230 -13
  27. package/dist/esm/product/setting/constant/bundle-layout/verticalThree.js +579 -359
  28. package/dist/esm/product/setting/constant/bundle-layout/verticalTwo.js +579 -359
  29. package/package.json +2 -2
@@ -6,7 +6,7 @@ const getActiveClasses = (backgroundColor, text)=>{
6
6
  tablet: 'tablet:',
7
7
  mobile: 'mobile:'
8
8
  };
9
- const generateClass = (type, device, value)=>value ? `${breakpoints[device]}[_&button]:data-[active=true]:!gp-${type}-[${value}]` : '';
9
+ const generateClass = (type, device, value)=>value ? `${breakpoints[device]}[&_button]:data-[active=true]:!gp-${type}-[${value}]` : '';
10
10
  const classes = [
11
11
  generateClass('bg', 'desktop', backgroundColor?.desktop?.active),
12
12
  generateClass('bg', 'tablet', backgroundColor?.tablet?.active),
@@ -43,8 +43,10 @@ const getInnerBorderCornerCss = (data)=>{
43
43
  return `
44
44
  ${mediaQuery}
45
45
  .gp-coupon[data-active="true"] .${uid} {
46
- ${composeBorderCss(borderBtnV2?.[device]?.active)} !important;
47
- ${composeCornerCss(roundedBtnV2?.[device]?.active)} !important;
46
+ ${composeBorderCss(borderBtnV2?.[device]?.active, {
47
+ important: true
48
+ })};
49
+ ${composeCornerCss(roundedBtnV2?.[device]?.active, true)};
48
50
  box-shadow: ${getShadowValue(boxShadowBtnV2?.[device]?.active)} !important;
49
51
  }
50
52
  ${closeMediaQuery}
@@ -12,7 +12,7 @@ const CouponSettings = [
12
12
  default: 'icon',
13
13
  options: [
14
14
  {
15
- label: 'Secondary',
15
+ label: 'Text Only',
16
16
  value: 'none',
17
17
  iconName: 'gp-coupon-code-layout'
18
18
  },
@@ -271,6 +271,9 @@ const CouponSettings = [
271
271
  default: {
272
272
  type: 'paragraph-1'
273
273
  },
274
+ hiddenSetting: {
275
+ textAlign: true
276
+ },
274
277
  ignoreReRender: true
275
278
  },
276
279
  {
@@ -516,8 +519,9 @@ const CouponSettings = [
516
519
  distance: '4px',
517
520
  blur: '4px',
518
521
  spread: '0px',
519
- color: '#121212',
520
- angle: 45
522
+ color: 'rgba(18, 18, 18, 0.2)',
523
+ angle: 45,
524
+ enable: true
521
525
  }
522
526
  }
523
527
  }
@@ -9,7 +9,40 @@ const SettingUIV2 = [
9
9
  setting: {
10
10
  id: 'couponLayout'
11
11
  },
12
- layout: 'vertical'
12
+ layout: 'vertical',
13
+ controlChangeTrigger: {
14
+ settings: [
15
+ {
16
+ condition: `couponLayout === 'icon'`,
17
+ source: [
18
+ 'couponLayout',
19
+ 'iconVisible'
20
+ ],
21
+ action: {
22
+ controlId: 'iconVisible',
23
+ groupType: 'setting',
24
+ controlType: 'setting',
25
+ newValue: true
26
+ }
27
+ },
28
+ {
29
+ condition: `couponLayout === 'none'`,
30
+ source: [
31
+ 'couponLayout',
32
+ 'iconVisible'
33
+ ],
34
+ action: {
35
+ controlId: 'iconVisible',
36
+ groupType: 'setting',
37
+ controlType: 'setting',
38
+ newValue: false
39
+ }
40
+ }
41
+ ],
42
+ options: {
43
+ noRecordHistory: true
44
+ }
45
+ }
13
46
  }
14
47
  ]
15
48
  },
@@ -26,6 +59,7 @@ const SettingUIV2 = [
26
59
  iconName: 'polaris-text-block',
27
60
  getValueFromSettingID: 'copyContent',
28
61
  isHideClear: true,
62
+ compoDefaultValue: 'GEMPAGES30',
29
63
  popoverLabel: {
30
64
  en: 'Code'
31
65
  },
@@ -46,22 +80,6 @@ const SettingUIV2 = [
46
80
  }
47
81
  ]
48
82
  },
49
- {
50
- label: {
51
- en: 'Content'
52
- },
53
- controls: [
54
- {
55
- type: 'control',
56
- label: {
57
- en: 'Default'
58
- },
59
- setting: {
60
- id: 'defaultLabel'
61
- }
62
- }
63
- ]
64
- },
65
83
  {
66
84
  label: {
67
85
  en: 'Size'
@@ -201,50 +219,6 @@ const SettingUIV2 = [
201
219
  setting: {
202
220
  id: 'boxShadowBtnV2',
203
221
  state: 'normal'
204
- },
205
- options: {
206
- updateFields: [
207
- {
208
- field: 'normal.enable',
209
- settingId: 'hasBoxShadow',
210
- state: 'normal'
211
- }
212
- ]
213
- },
214
- controlChangeTrigger: {
215
- settings: [
216
- {
217
- condition: `boxShadow.normal.enable === true`,
218
- source: [
219
- 'boxShadow',
220
- 'hasBoxShadow'
221
- ],
222
- action: {
223
- controlId: 'hasBoxShadow',
224
- groupType: 'style',
225
- controlType: 'style',
226
- state: 'normal',
227
- newValue: true
228
- }
229
- },
230
- {
231
- condition: `boxShadow.normal.enable === false`,
232
- source: [
233
- 'boxShadow',
234
- 'hasBoxShadow'
235
- ],
236
- action: {
237
- controlId: 'hasBoxShadow',
238
- groupType: 'style',
239
- controlType: 'style',
240
- state: 'normal',
241
- newValue: false
242
- }
243
- }
244
- ],
245
- options: {
246
- noRecordHistory: true
247
- }
248
222
  }
249
223
  }
250
224
  ]
@@ -270,14 +244,14 @@ const SettingUIV2 = [
270
244
  id: 'iconSvg'
271
245
  },
272
246
  label: {
273
- en: 'Choose'
247
+ en: 'Icon'
274
248
  }
275
249
  },
276
250
  {
277
251
  conditionDisplay: 'couponLayout == "icon" && iconVisible == true',
278
252
  type: 'control',
279
253
  label: {
280
- en: 'Icon position'
254
+ en: 'Position'
281
255
  },
282
256
  setting: {
283
257
  id: 'iconAlign'
@@ -287,7 +261,7 @@ const SettingUIV2 = [
287
261
  conditionDisplay: 'couponLayout == "icon" && iconVisible == true',
288
262
  type: 'control',
289
263
  label: {
290
- en: 'Spacing'
264
+ en: 'Gap'
291
265
  },
292
266
  setting: {
293
267
  id: 'iconSpacing'
@@ -309,6 +283,33 @@ const SettingUIV2 = [
309
283
  toggleStyle: 'switch'
310
284
  }
311
285
  },
286
+ {
287
+ type: 'combo',
288
+ label: {
289
+ en: 'Content'
290
+ },
291
+ iconName: 'polaris-text-block',
292
+ getValueFromSettingID: 'defaultLabel',
293
+ isHideClear: true,
294
+ compoDefaultValue: 'Copy',
295
+ popoverLabel: {
296
+ en: 'Content'
297
+ },
298
+ controls: [
299
+ {
300
+ label: {
301
+ en: 'Content'
302
+ },
303
+ options: {
304
+ fullWidth: true
305
+ },
306
+ layout: 'vertical',
307
+ setting: {
308
+ id: 'defaultLabel'
309
+ }
310
+ }
311
+ ]
312
+ },
312
313
  {
313
314
  type: 'control',
314
315
  layout: 'vertical',
@@ -11,17 +11,17 @@ const MarqueeSettingsV2 = [
11
11
  {
12
12
  label: 'Fit to content',
13
13
  value: 'FIT_CONTENT',
14
- note: 'Match the width of the element inside'
14
+ subTitle: 'Match the width of the element inside'
15
15
  },
16
16
  {
17
17
  label: 'Based on the item count',
18
18
  value: 'BASE_ON_NUMBER_OF_ITEMS',
19
- note: 'Max item width is screen width divided by the number of items'
19
+ subTitle: 'Max item width is screen width divided by the number of items'
20
20
  },
21
21
  {
22
22
  label: 'Custom',
23
23
  value: 'CUSTOM',
24
- note: 'Set the max width as you want'
24
+ subTitle: 'Set the max width as you want'
25
25
  }
26
26
  ],
27
27
  devices: {
@@ -1,5 +1,3 @@
1
- import { dataStringify } from '@gem-sdk/core';
2
-
3
1
  const getImageAttr = ({ setting })=>{
4
2
  return {
5
3
  src: setting?.image?.src,
@@ -8,27 +6,12 @@ const getImageAttr = ({ setting })=>{
8
6
  };
9
7
  };
10
8
  const getContainerAttrs = (props)=>{
11
- const { builderAttrs, builderProps, setting } = props;
12
- const isTextBadge = setting?.contentType === 'text';
9
+ const { builderAttrs, builderProps } = props;
13
10
  return {
14
11
  ...builderAttrs,
15
12
  'data-id': builderProps?.uid || '',
16
13
  id: `g-product-badge-${builderProps?.uid}`,
17
- 'gp-data-hidden': 'false',
18
- 'gp-data': `${dataStringify({
19
- displayContent: setting?.displayContent,
20
- minPrice: '{{ minPriceValue }}',
21
- variantIDs: '{{ product.variants | map: "id" | json | escape }}',
22
- variantInventoryQuantities: '{{ product.variants | map: "inventory_quantity" | json | escape }}',
23
- amountDiscount: '{{amountDiscountValue}}',
24
- percentDiscount: '{{percentDiscountValue}}',
25
- price: '{{price}}',
26
- displayTrigger: setting?.displayTrigger,
27
- uid: builderProps?.uid,
28
- productCreatedAt: '{{product.created_at | date: "%Y-%m-%d" }}',
29
- productTags: '{{ product.tags | join: "," }}',
30
- isTextBadge
31
- })}`
14
+ 'gp-data-hidden': 'false'
32
15
  };
33
16
  };
34
17
  const getEditTooltipAttrs = (props)=>{
@@ -1,9 +1,9 @@
1
- import { template, RenderIf, isLocalEnv, baseAssetURL } from '@gem-sdk/core';
1
+ import { template, dataStringify, RenderIf, isLocalEnv, baseAssetURL } from '@gem-sdk/core';
2
2
  import { getSettingPreloadData } from '../../../helpers.js';
3
3
  import { checkDiscountContentProductBadge } from './utils/common.js';
4
4
  import { generateBadgeContent } from './utils/generateLiquidContent.js';
5
5
  import { renderBadgeInFirstTime } from './utils/renderBadgeLiquid.js';
6
- import { createStyle, createClass, createAttr } from '@gem-sdk/system';
6
+ import { createStyle, createClass, createAttr, createStateOrContext } from '@gem-sdk/system';
7
7
  import { getWrapperClasses, getSubWrapperClass, getTextContainerClasses, getTextWrapperClasses, getTextContentClasses, getImageContainerClasses, getImageClasses } from './common/getClasses.js';
8
8
  import { getContainerStyle, getSubWrapperStyle, getContentStyleInternal, getTextBadgeWrapperStyles, getTextContentStyle, getImageContainerStyles } from './common/getStyles.js';
9
9
  import { getSubWrapperAttrs, getContainerAttrs, getTextContentAttrs, getImageAttr } from './common/getAttrs.js';
@@ -73,6 +73,20 @@ const ProductBadge = (props)=>{
73
73
  setting
74
74
  })
75
75
  });
76
+ const createDataState = createStateOrContext({
77
+ displayContent: setting?.displayContent,
78
+ minPrice: '{{ minPriceValue }}',
79
+ variantIDs: '{{ product.variants | map: "id" | json | escape }}',
80
+ variantInventoryQuantities: '{{ product.variants | map: "inventory_quantity" | json | escape }}',
81
+ amountDiscount: '{{amountDiscountValue}}',
82
+ percentDiscount: '{{percentDiscountValue}}',
83
+ price: '{{price}}',
84
+ displayTrigger: setting?.displayTrigger,
85
+ uid: props.builderProps?.uid,
86
+ productCreatedAt: '{{product.created_at | date: "%Y-%m-%d" }}',
87
+ productTags: '{{ product.tags | join: "," }}',
88
+ isTextBadge
89
+ });
76
90
  return template`
77
91
  {% if product %}
78
92
  ${generateBadgeContent(setting?.displayContent)}
@@ -81,6 +95,7 @@ const ProductBadge = (props)=>{
81
95
  ${{
82
96
  ...containerAttrs
83
97
  }}
98
+ gp-data='${dataStringify(createDataState)}'
84
99
  class="containerClass"
85
100
  style="${containerStyle}"
86
101
  >
@@ -27,7 +27,7 @@ const useGpPrice = (props)=>{
27
27
  bundleItem?.quantity
28
28
  ]);
29
29
  const bundleDiscount = useMemo(()=>{
30
- const value = parseInt(bundleItem?.discountValue);
30
+ const value = Number(bundleItem?.discountValue);
31
31
  if (bundleItem?.discountType === 'percentage') {
32
32
  return price * quantityProduct * value / 100;
33
33
  }
@@ -275,36 +275,252 @@ const horizontalOne = [
275
275
  {
276
276
  childrens: [
277
277
  {
278
- childrens: [],
278
+ tag: 'ProductPrice',
279
279
  label: 'Product Price',
280
280
  settings: {
281
- priceType: 'compare',
282
- hasOnlyDefaultVariant: false
281
+ priceType: 'compare'
283
282
  },
284
283
  styles: {
284
+ typo: {
285
+ type: 'subheading-2',
286
+ default: {
287
+ type: 'subheading-2'
288
+ }
289
+ },
285
290
  color: {
286
- normal: '#B4B4B4'
291
+ normal: 'text-1'
287
292
  },
293
+ lineThrough: true,
294
+ thickness: 2,
295
+ lineColor: 'text-1',
296
+ disableHoverColor: true,
288
297
  hasTextShadow: {
289
298
  normal: false
290
299
  },
291
- lineColor: 'text-1',
292
- lineThrough: true,
293
- textAlign: {
294
- desktop: 'right'
295
- },
296
300
  textShadow: {
297
301
  normal: {
298
302
  type: 'shadow-1'
299
303
  }
300
304
  },
301
- thickness: '1px',
302
- typo: {
303
- type: 'paragraph-2'
305
+ textAlign: {
306
+ desktop: 'left'
304
307
  }
305
308
  },
306
- tag: 'ProductPrice',
307
- uid: 'ggRh1uHyP9'
309
+ advanced: {
310
+ 'spacing-setting': {
311
+ desktop: {
312
+ margin: {
313
+ bottom: 0
314
+ }
315
+ }
316
+ },
317
+ d: {
318
+ desktop: true,
319
+ tablet: true,
320
+ mobile: true
321
+ },
322
+ border: {
323
+ desktop: {
324
+ normal: {
325
+ borderType: 'none',
326
+ border: 'none',
327
+ borderWidth: '1px',
328
+ width: '1px 1px 1px 1px',
329
+ color: '#121212',
330
+ isCustom: true
331
+ }
332
+ }
333
+ },
334
+ rounded: {
335
+ desktop: {
336
+ normal: {
337
+ btrr: '0px',
338
+ bblr: '0px',
339
+ bbrr: '0px',
340
+ btlr: '0px',
341
+ radiusType: 'none'
342
+ }
343
+ }
344
+ },
345
+ hasBoxShadow: {
346
+ desktop: {
347
+ normal: false
348
+ }
349
+ },
350
+ boxShadow: {
351
+ desktop: {
352
+ normal: {}
353
+ }
354
+ },
355
+ op: {
356
+ desktop: '100%'
357
+ }
358
+ },
359
+ defaultPresetConfig: {
360
+ typo: {
361
+ type: 'subheading-2',
362
+ default: {
363
+ type: 'subheading-2'
364
+ }
365
+ },
366
+ color: {
367
+ normal: 'text-1'
368
+ },
369
+ lineThrough: true,
370
+ thickness: 2,
371
+ lineColor: 'text-1',
372
+ disableHoverColor: true,
373
+ hasTextShadow: {
374
+ normal: false
375
+ },
376
+ textShadow: {
377
+ normal: {
378
+ type: 'shadow-1'
379
+ }
380
+ },
381
+ textAlign: {
382
+ desktop: 'left'
383
+ },
384
+ 'spacing-setting': {
385
+ desktop: {
386
+ margin: {
387
+ bottom: 'var(--g-s-l)'
388
+ }
389
+ }
390
+ },
391
+ d: {
392
+ desktop: true,
393
+ tablet: true,
394
+ mobile: true
395
+ },
396
+ border: {
397
+ desktop: {
398
+ normal: {
399
+ borderType: 'none',
400
+ border: 'none',
401
+ borderWidth: '1px',
402
+ width: '1px 1px 1px 1px',
403
+ color: '#121212',
404
+ isCustom: true
405
+ }
406
+ }
407
+ },
408
+ rounded: {
409
+ desktop: {
410
+ normal: {
411
+ btrr: '0px',
412
+ bblr: '0px',
413
+ bbrr: '0px',
414
+ btlr: '0px',
415
+ radiusType: 'none'
416
+ }
417
+ }
418
+ },
419
+ hasBoxShadow: {
420
+ desktop: {
421
+ normal: false
422
+ }
423
+ },
424
+ boxShadow: {
425
+ desktop: {
426
+ normal: {}
427
+ }
428
+ },
429
+ op: {
430
+ desktop: '100%'
431
+ },
432
+ animation: {
433
+ desktop: {
434
+ enabled: false,
435
+ trigger: 'appear',
436
+ triggerConfig: {
437
+ appear: {
438
+ animation: 'fade',
439
+ setting: {
440
+ fade: {
441
+ delay: '0',
442
+ speed: 1.7,
443
+ easing: 'ease-out'
444
+ },
445
+ zoom: {
446
+ delay: '0',
447
+ speed: 1.7,
448
+ isFade: true,
449
+ easing: 'ease-out',
450
+ zoomDirection: 'in',
451
+ scale: {
452
+ in: [
453
+ 80,
454
+ 100
455
+ ],
456
+ out: [
457
+ 120,
458
+ 100
459
+ ]
460
+ }
461
+ },
462
+ slide: {
463
+ delay: '0',
464
+ speed: 1.7,
465
+ easing: 'ease-out',
466
+ direction: 'left',
467
+ isCustomDistance: false
468
+ },
469
+ shake: {
470
+ delay: '0',
471
+ speed: 0.7,
472
+ loop: false,
473
+ intensity: 11,
474
+ easing: 'linear'
475
+ }
476
+ }
477
+ },
478
+ hover: {
479
+ animation: 'none',
480
+ setting: {
481
+ fade: {
482
+ delay: '0',
483
+ speed: 1.7,
484
+ easing: 'ease-out'
485
+ },
486
+ zoom: {
487
+ delay: '0',
488
+ speed: 1.7,
489
+ isFade: false,
490
+ easing: 'ease-out',
491
+ zoomDirection: 'in',
492
+ scale: {
493
+ in: [
494
+ 100,
495
+ 120
496
+ ],
497
+ out: [
498
+ 100,
499
+ 80
500
+ ]
501
+ }
502
+ },
503
+ slide: {
504
+ delay: '0',
505
+ speed: 1.7,
506
+ easing: 'ease-out',
507
+ direction: 'left',
508
+ isCustomDistance: false
509
+ },
510
+ shake: {
511
+ delay: '0',
512
+ speed: 0.7,
513
+ loop: false,
514
+ intensity: 11,
515
+ easing: 'linear'
516
+ }
517
+ }
518
+ }
519
+ }
520
+ }
521
+ },
522
+ priceType: 'compare'
523
+ }
308
524
  }
309
525
  ],
310
526
  label: 'Block',