@gem-sdk/components 2.0.0-dev.355 → 2.0.0-dev.357

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 (72) hide show
  1. package/dist/cjs/article/next.js +41 -31
  2. package/dist/cjs/builder.js +1 -1
  3. package/dist/cjs/button/components/Button.js +5 -3
  4. package/dist/cjs/button/components/Button.liquid.js +7 -3
  5. package/dist/cjs/button/components/common/attributes.js +1 -2
  6. package/dist/cjs/button/components/common/helpers.js +2 -2
  7. package/dist/cjs/button/components/common/styles.js +29 -1
  8. package/dist/cjs/button/setting/configs/settings.js +24 -4
  9. package/dist/cjs/button/setting/configs/uiV2.js +46 -8
  10. package/dist/cjs/image/setting/configs/uiV2.js +5 -1
  11. package/dist/cjs/index.js +1 -1
  12. package/dist/cjs/post-purchase/callout-banner/setting/config/callout-text/setting.js +4 -3
  13. package/dist/cjs/post-purchase/product/components/product-offer/common/attrs.js +14 -0
  14. package/dist/cjs/post-purchase/product/components/product-offer/common/classes.js +29 -0
  15. package/dist/cjs/post-purchase/product/components/product-offer/common/styles.js +27 -0
  16. package/dist/cjs/post-purchase/product/components/product-offer/components/ProductOffer.js +53 -0
  17. package/dist/cjs/post-purchase/product/components/product-offer/components/ProductOfferItem.js +45 -0
  18. package/dist/cjs/post-purchase/product/components/product-offer/hooks/useProductOfferData.js +57 -0
  19. package/dist/cjs/post-purchase/product/index.js +2 -2
  20. package/dist/cjs/post-purchase/product/next.js +1 -1
  21. package/dist/cjs/post-purchase/product/settings/{ProductOffer.js → product-offer/index.js} +23 -143
  22. package/dist/cjs/post-purchase/product/settings/product-offer/ui/uiV1.js +140 -0
  23. package/dist/cjs/post-purchase/product/settings/product-offer/ui/uiV2.js +141 -0
  24. package/dist/cjs/post-purchase/utils/constants.js +6 -0
  25. package/dist/cjs/product/components/ProductViewMore/ProductViewMore.js +17 -18
  26. package/dist/cjs/product/components/ProductViewMore/ProductViewMore.liquid.js +14 -21
  27. package/dist/cjs/product/components/ProductViewMore/common/data.js +26 -0
  28. package/dist/cjs/product/components/ProductViewMore/common/styles.js +12 -0
  29. package/dist/cjs/product/setting/dynamic-checkout/configs/settings.js +9 -5
  30. package/dist/cjs/product/setting/dynamic-checkout/configs/uiV2.js +10 -10
  31. package/dist/cjs/product/setting/product-button/configs/settings.js +1 -0
  32. package/dist/cjs/product/setting/product-button/configs/uiV2.js +1 -1
  33. package/dist/cjs/product/setting/product-view-more/configs/settings.js +17 -16
  34. package/dist/cjs/product/setting/product-view-more/configs/uiV2.js +45 -45
  35. package/dist/esm/article/next.js +41 -31
  36. package/dist/esm/builder.js +1 -1
  37. package/dist/esm/button/components/Button.js +5 -3
  38. package/dist/esm/button/components/Button.liquid.js +7 -3
  39. package/dist/esm/button/components/common/attributes.js +1 -2
  40. package/dist/esm/button/components/common/helpers.js +2 -2
  41. package/dist/esm/button/components/common/styles.js +29 -3
  42. package/dist/esm/button/setting/configs/settings.js +24 -4
  43. package/dist/esm/button/setting/configs/uiV2.js +46 -8
  44. package/dist/esm/image/setting/configs/uiV2.js +5 -1
  45. package/dist/esm/index.js +1 -1
  46. package/dist/esm/post-purchase/callout-banner/setting/config/callout-text/setting.js +4 -3
  47. package/dist/esm/post-purchase/product/components/product-offer/common/attrs.js +12 -0
  48. package/dist/esm/post-purchase/product/components/product-offer/common/classes.js +25 -0
  49. package/dist/esm/post-purchase/product/components/product-offer/common/styles.js +24 -0
  50. package/dist/esm/post-purchase/product/components/product-offer/components/ProductOffer.js +49 -0
  51. package/dist/esm/post-purchase/product/components/product-offer/components/ProductOfferItem.js +43 -0
  52. package/dist/esm/post-purchase/product/components/product-offer/hooks/useProductOfferData.js +55 -0
  53. package/dist/esm/post-purchase/product/index.js +1 -1
  54. package/dist/esm/post-purchase/product/next.js +1 -1
  55. package/dist/esm/post-purchase/product/settings/{ProductOffer.js → product-offer/index.js} +23 -143
  56. package/dist/esm/post-purchase/product/settings/product-offer/ui/uiV1.js +138 -0
  57. package/dist/esm/post-purchase/product/settings/product-offer/ui/uiV2.js +139 -0
  58. package/dist/esm/post-purchase/utils/constants.js +6 -1
  59. package/dist/esm/product/components/ProductViewMore/ProductViewMore.js +17 -18
  60. package/dist/esm/product/components/ProductViewMore/ProductViewMore.liquid.js +14 -21
  61. package/dist/esm/product/components/ProductViewMore/common/data.js +23 -0
  62. package/dist/esm/product/components/ProductViewMore/common/styles.js +10 -0
  63. package/dist/esm/product/setting/dynamic-checkout/configs/settings.js +9 -5
  64. package/dist/esm/product/setting/dynamic-checkout/configs/uiV2.js +10 -10
  65. package/dist/esm/product/setting/product-button/configs/settings.js +1 -0
  66. package/dist/esm/product/setting/product-button/configs/uiV2.js +1 -1
  67. package/dist/esm/product/setting/product-view-more/configs/settings.js +17 -16
  68. package/dist/esm/product/setting/product-view-more/configs/uiV2.js +45 -45
  69. package/dist/types/index.d.ts +42 -8
  70. package/package.json +2 -2
  71. package/dist/cjs/post-purchase/product/components/ProductOffer.js +0 -138
  72. package/dist/esm/post-purchase/product/components/ProductOffer.js +0 -133
@@ -0,0 +1,57 @@
1
+ 'use strict';
2
+
3
+ var core = require('@gem-sdk/core');
4
+ var useDynamicProduct = require('../../../hooks/useDynamicProduct.js');
5
+ var React = require('react');
6
+ var index = require('../../../helpers/index.js');
7
+ var ProductOfferPlaceholder = require('../../../constants/ProductOfferPlaceholder.js');
8
+
9
+ const useProductOfferData = ()=>{
10
+ const productOffers = core.usePageStore((s)=>s.productOffers);
11
+ const publicStoreFrontData = core.usePageStore((s)=>s.publicStoreFrontData);
12
+ const { isDynamicProduct } = useDynamicProduct.useDynamicProduct();
13
+ const dynamicDiscountOffer = core.usePageStore((s)=>s.dynamicDiscountOffer);
14
+ const totalProduct = React.useMemo(()=>isDynamicProduct ? dynamicDiscountOffer?.appliedProductCount : productOffers?.length, [
15
+ dynamicDiscountOffer?.appliedProductCount,
16
+ isDynamicProduct,
17
+ productOffers?.length
18
+ ]);
19
+ const sortedProductBaseIDs = React.useMemo(()=>{
20
+ return productOffers?.sort((a, b)=>{
21
+ if (a?.node?.position && b?.node?.position) {
22
+ return a.node.position - b.node.position;
23
+ }
24
+ return 0;
25
+ }).map((item)=>item?.node?.objectBaseID).filter(Boolean);
26
+ }, [
27
+ productOffers
28
+ ]);
29
+ const { isLoading, isValidating, data } = core.useProductsQuery(sortedProductBaseIDs || [], {
30
+ revalidateOnMount: true
31
+ }, {
32
+ allStatus: true,
33
+ fetcher: index.hasPublicStoreFrontData(publicStoreFrontData) ? index.createStoreFrontFetcher(publicStoreFrontData) : undefined
34
+ });
35
+ const loading = React.useMemo(()=>isLoading || isValidating, [
36
+ isLoading,
37
+ isValidating
38
+ ]);
39
+ const products = React.useMemo(()=>core.flattenConnection(data?.products), [
40
+ data?.products
41
+ ]);
42
+ const productSortedById = React.useMemo(()=>{
43
+ return isDynamicProduct && dynamicDiscountOffer?.appliedProductCount ? Array(dynamicDiscountOffer.appliedProductCount).fill(ProductOfferPlaceholder.productOfferPlaceholder) : sortedProductBaseIDs?.map((id)=>products?.find((el)=>el?.baseID === id)).filter(Boolean);
44
+ }, [
45
+ isDynamicProduct,
46
+ dynamicDiscountOffer?.appliedProductCount,
47
+ sortedProductBaseIDs,
48
+ products
49
+ ]);
50
+ return {
51
+ isLoading: loading,
52
+ productSortedById,
53
+ totalProduct
54
+ };
55
+ };
56
+
57
+ exports.useProductOfferData = useProductOfferData;
@@ -16,7 +16,7 @@ var ProductPrice$1 = require('./settings/product-price/ProductPrice.js');
16
16
  var ProductVariant$1 = require('./settings/product-variants/ProductVariant.js');
17
17
  var index$1 = require('./settings/accept-button/index.js');
18
18
  var index$2 = require('./settings/product-quantity/index.js');
19
- var ProductOffer$1 = require('./settings/ProductOffer.js');
19
+ var index$4 = require('./settings/product-offer/index.js');
20
20
  var index$3 = require('./settings/product-price-breakdown/index.js');
21
21
  var ProductDiscountTag$1 = require('./settings/product-discount-tag/ProductDiscountTag.js');
22
22
  var ProductImages = require('./settings/product-image/ProductImages.js');
@@ -29,7 +29,7 @@ const postPurchaseProductSetting = {
29
29
  PostPurchaseAcceptButton: index$1.default,
30
30
  PostPurchaseProductQuantity: index$2.default,
31
31
  PostPurchaseProductPriceBreakdown: index$3.default,
32
- PostPurchaseProductOffer: ProductOffer$1.default,
32
+ PostPurchaseProductOffer: index$4.default,
33
33
  PostPurchaseProductDiscountTag: ProductDiscountTag$1.default,
34
34
  PostPurchaseProductImages: ProductImages.default
35
35
  };
@@ -30,7 +30,7 @@ const PostPurchaseProductQuantity = dynamic(()=>Promise.resolve().then(function
30
30
  const PostPurchaseProductPriceBreakdown = dynamic(()=>Promise.resolve().then(function () { return require('./components/ProductPriceBreakdown.js'); }), {
31
31
  loading: Loading.default
32
32
  });
33
- const PostPurchaseProductOffer = dynamic(()=>Promise.resolve().then(function () { return require('./components/ProductOffer.js'); }), {
33
+ const PostPurchaseProductOffer = dynamic(()=>Promise.resolve().then(function () { return require('./components/product-offer/components/ProductOffer.js'); }), {
34
34
  loading: Loading.default
35
35
  });
36
36
  const PostPurchaseProductDiscountTag = dynamic(()=>Promise.resolve().then(function () { return require('./components/ProductDiscountTag.js'); }), {
@@ -2,10 +2,12 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var productOfferDefault = require('./presets-config/product-presets/product-offer-default.js');
6
- var constants = require('../../utils/constants.js');
7
- var productOffer1Col = require('./presets-config/product-presets/product-offer-1-col.js');
8
- var productOffer2Col = require('./presets-config/product-presets/product-offer-2-col.js');
5
+ var productOfferDefault = require('../presets-config/product-presets/product-offer-default.js');
6
+ var constants = require('../../../utils/constants.js');
7
+ var productOffer1Col = require('../presets-config/product-presets/product-offer-1-col.js');
8
+ var productOffer2Col = require('../presets-config/product-presets/product-offer-2-col.js');
9
+ var uiV1 = require('./ui/uiV1.js');
10
+ var uiV2 = require('./ui/uiV2.js');
9
11
 
10
12
  const config = {
11
13
  tag: 'PostPurchaseProductOffer',
@@ -349,14 +351,26 @@ const config = {
349
351
  },
350
352
  {
351
353
  id: 'productOfferWidth',
352
- type: 'input:unit-width',
354
+ type: 'dropdown:input',
353
355
  label: 'Width',
354
- placeholder: 'Global style',
355
- min: 0,
356
356
  units: [
357
357
  'px',
358
358
  '%'
359
359
  ],
360
+ hideUnit: false,
361
+ inputType: 'number',
362
+ displayOptions: [
363
+ {
364
+ label: 'Full',
365
+ value: '100%',
366
+ showValue: true
367
+ },
368
+ {
369
+ label: 'Default',
370
+ value: '1200px',
371
+ showValue: true
372
+ }
373
+ ],
360
374
  devices: {
361
375
  desktop: {
362
376
  default: '100%'
@@ -374,142 +388,8 @@ const config = {
374
388
  ]
375
389
  }
376
390
  ],
377
- ui: [
378
- {
379
- type: 'control',
380
- label: {
381
- en: 'Product source'
382
- },
383
- setting: {
384
- id: 'productSetting'
385
- },
386
- layout: 'vertical'
387
- },
388
- {
389
- type: 'group',
390
- label: {
391
- en: 'Product offers'
392
- },
393
- controls: [
394
- {
395
- type: 'control',
396
- label: {
397
- en: 'Quantity'
398
- },
399
- setting: {
400
- id: 'dynamicOfferQuantity'
401
- }
402
- }
403
- ],
404
- condition: 'false'
405
- },
406
- {
407
- type: 'control',
408
- label: {
409
- en: ''
410
- },
411
- setting: {
412
- id: 'discountAndShippingFee'
413
- },
414
- layout: 'vertical'
415
- },
416
- {
417
- type: 'group',
418
- label: {
419
- en: 'Layout'
420
- },
421
- condition: `(productSetting?.productIds?.length || 0) > 1`,
422
- controls: [
423
- {
424
- type: 'control',
425
- label: {
426
- en: 'Choose layout'
427
- },
428
- setting: {
429
- id: 'productOfferLayout'
430
- },
431
- layout: 'vertical',
432
- condition: `(productSetting?.productIds?.length || 0) > 1`
433
- },
434
- {
435
- type: 'control',
436
- label: {
437
- en: 'Row gap'
438
- },
439
- setting: {
440
- id: 'productOfferVerticalGutter'
441
- }
442
- },
443
- {
444
- type: 'control',
445
- label: {
446
- en: 'Column gap'
447
- },
448
- setting: {
449
- id: 'productOfferColumnGap'
450
- }
451
- }
452
- ]
453
- },
454
- {
455
- type: 'group',
456
- label: {
457
- en: 'Product Layout'
458
- },
459
- controls: [
460
- {
461
- type: 'control',
462
- label: {
463
- en: ''
464
- },
465
- setting: {
466
- id: 'layout'
467
- },
468
- layout: 'vertical'
469
- },
470
- {
471
- type: 'control',
472
- label: {
473
- en: 'Column gap'
474
- },
475
- setting: {
476
- id: 'columnGap'
477
- },
478
- condition: `!!layout.cols && layout.cols.length > 1`
479
- }
480
- ]
481
- },
482
- {
483
- type: 'group',
484
- label: {
485
- en: 'Size'
486
- },
487
- controls: [
488
- {
489
- type: 'control',
490
- label: {
491
- en: 'Width'
492
- },
493
- setting: {
494
- id: 'productOfferWidth'
495
- }
496
- }
497
- ]
498
- },
499
- {
500
- type: 'control',
501
- label: {
502
- en: 'Align'
503
- },
504
- setting: {
505
- id: 'inlineAlignment'
506
- },
507
- condition: `productOfferWidth !== '100%'`,
508
- options: {
509
- label: 'large'
510
- }
511
- }
512
- ],
391
+ ui: uiV1.ProductOfferSettingUIV1,
392
+ uiV2: uiV2.ProductOfferSettingUIV2,
513
393
  presets: [
514
394
  productOfferDefault.postPurchaseProductOfferDefault,
515
395
  productOffer2Col.postPurchaseProduct2Col,
@@ -0,0 +1,140 @@
1
+ 'use strict';
2
+
3
+ const ProductOfferSettingUIV1 = [
4
+ {
5
+ type: 'control',
6
+ label: {
7
+ en: 'Product source'
8
+ },
9
+ setting: {
10
+ id: 'productSetting'
11
+ },
12
+ layout: 'vertical'
13
+ },
14
+ {
15
+ type: 'group',
16
+ label: {
17
+ en: 'Product offers'
18
+ },
19
+ controls: [
20
+ {
21
+ type: 'control',
22
+ label: {
23
+ en: 'Quantity'
24
+ },
25
+ setting: {
26
+ id: 'dynamicOfferQuantity'
27
+ }
28
+ }
29
+ ],
30
+ condition: 'false'
31
+ },
32
+ {
33
+ type: 'control',
34
+ label: {
35
+ en: ''
36
+ },
37
+ setting: {
38
+ id: 'discountAndShippingFee'
39
+ },
40
+ layout: 'vertical'
41
+ },
42
+ {
43
+ type: 'group',
44
+ label: {
45
+ en: 'Layout'
46
+ },
47
+ condition: `(productSetting?.productIds?.length || 0) > 1`,
48
+ controls: [
49
+ {
50
+ type: 'control',
51
+ label: {
52
+ en: 'Choose layout'
53
+ },
54
+ setting: {
55
+ id: 'productOfferLayout'
56
+ },
57
+ layout: 'vertical',
58
+ condition: `(productSetting?.productIds?.length || 0) > 1`
59
+ },
60
+ {
61
+ type: 'control',
62
+ label: {
63
+ en: 'Row gap'
64
+ },
65
+ setting: {
66
+ id: 'productOfferVerticalGutter'
67
+ }
68
+ },
69
+ {
70
+ type: 'control',
71
+ label: {
72
+ en: 'Column gap'
73
+ },
74
+ setting: {
75
+ id: 'productOfferColumnGap'
76
+ }
77
+ }
78
+ ]
79
+ },
80
+ {
81
+ type: 'group',
82
+ label: {
83
+ en: 'Product Layout'
84
+ },
85
+ controls: [
86
+ {
87
+ type: 'control',
88
+ label: {
89
+ en: ''
90
+ },
91
+ setting: {
92
+ id: 'layout'
93
+ },
94
+ layout: 'vertical'
95
+ },
96
+ {
97
+ type: 'control',
98
+ label: {
99
+ en: 'Column gap'
100
+ },
101
+ setting: {
102
+ id: 'columnGap'
103
+ },
104
+ condition: `!!layout.cols && layout.cols.length > 1`
105
+ }
106
+ ]
107
+ },
108
+ {
109
+ type: 'group',
110
+ label: {
111
+ en: 'Size'
112
+ },
113
+ controls: [
114
+ {
115
+ type: 'control',
116
+ label: {
117
+ en: 'Width'
118
+ },
119
+ setting: {
120
+ id: 'productOfferWidth'
121
+ }
122
+ }
123
+ ]
124
+ },
125
+ {
126
+ type: 'control',
127
+ label: {
128
+ en: 'Align'
129
+ },
130
+ setting: {
131
+ id: 'inlineAlignment'
132
+ },
133
+ condition: `productOfferWidth !== '100%'`,
134
+ options: {
135
+ label: 'large'
136
+ }
137
+ }
138
+ ];
139
+
140
+ exports.ProductOfferSettingUIV1 = ProductOfferSettingUIV1;
@@ -0,0 +1,141 @@
1
+ 'use strict';
2
+
3
+ const ProductOfferSettingUIV2 = [
4
+ {
5
+ label: {
6
+ en: 'Layout'
7
+ },
8
+ controls: [
9
+ {
10
+ type: 'control',
11
+ label: {
12
+ en: ''
13
+ },
14
+ setting: {
15
+ id: 'layout'
16
+ },
17
+ layout: 'vertical'
18
+ }
19
+ ]
20
+ },
21
+ {
22
+ label: {
23
+ en: 'Product source'
24
+ },
25
+ controls: [
26
+ {
27
+ setting: {
28
+ id: 'productSetting'
29
+ },
30
+ layout: 'vertical'
31
+ }
32
+ ]
33
+ },
34
+ {
35
+ label: {
36
+ en: 'Column spacing'
37
+ },
38
+ controls: [
39
+ {
40
+ type: 'control',
41
+ label: {
42
+ en: 'Gap'
43
+ },
44
+ setting: {
45
+ id: 'columnGap'
46
+ },
47
+ conditionDisplay: '(productSetting?.productIds?.length || 0) === 1'
48
+ }
49
+ ]
50
+ },
51
+ {
52
+ label: {
53
+ en: 'Display'
54
+ },
55
+ controls: [
56
+ {
57
+ type: 'control',
58
+ label: {
59
+ en: 'Layout'
60
+ },
61
+ setting: {
62
+ id: 'productOfferLayout'
63
+ },
64
+ conditionDisplay: `(productSetting?.productIds?.length || 0) > 1`
65
+ },
66
+ {
67
+ type: 'control',
68
+ label: {
69
+ en: 'Quantity'
70
+ },
71
+ setting: {
72
+ id: 'dynamicOfferQuantity'
73
+ },
74
+ conditionDisplay: `(productSetting?.productIds?.length || 0) == 0`
75
+ },
76
+ {
77
+ type: 'control',
78
+ label: {
79
+ en: 'Row gap'
80
+ },
81
+ setting: {
82
+ id: 'productOfferVerticalGutter'
83
+ }
84
+ },
85
+ {
86
+ type: 'control',
87
+ label: {
88
+ en: 'Column gap'
89
+ },
90
+ setting: {
91
+ id: 'productOfferColumnGap'
92
+ }
93
+ }
94
+ ]
95
+ },
96
+ {
97
+ controls: [
98
+ {
99
+ type: 'control',
100
+ label: {
101
+ en: ''
102
+ },
103
+ setting: {
104
+ id: 'discountAndShippingFee'
105
+ },
106
+ layout: 'vertical'
107
+ }
108
+ ]
109
+ },
110
+ {
111
+ label: {
112
+ en: 'Size'
113
+ },
114
+ controls: [
115
+ {
116
+ type: 'control',
117
+ label: {
118
+ en: 'Width'
119
+ },
120
+ setting: {
121
+ id: 'productOfferWidth'
122
+ }
123
+ }
124
+ ]
125
+ },
126
+ {
127
+ controls: [
128
+ {
129
+ label: {
130
+ en: 'Align'
131
+ },
132
+ setting: {
133
+ id: 'inlineAlignment'
134
+ },
135
+ conditionDisplay: `productOfferWidth !== '100%'`
136
+ }
137
+ ]
138
+ }
139
+ ];
140
+
141
+ exports.ProductOfferSettingUIV2 = ProductOfferSettingUIV2;
@@ -54,6 +54,12 @@ const postPurchaseViewSpacing = [
54
54
  value: 'extraLoose'
55
55
  }
56
56
  ];
57
+ const DEVICES = [
58
+ 'desktop',
59
+ 'tablet',
60
+ 'mobile'
61
+ ];
57
62
 
63
+ exports.DEVICES = DEVICES;
58
64
  exports.postPurchaseSpacing = postPurchaseSpacing;
59
65
  exports.postPurchaseViewSpacing = postPurchaseViewSpacing;
@@ -4,26 +4,25 @@
4
4
  Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
6
  var jsxRuntime = require('react/jsx-runtime');
7
+ var styles = require('./common/styles.js');
8
+ var data = require('./common/data.js');
7
9
  var Button = require('../../../button/components/Button.js');
8
10
 
9
- const ProductViewMore = ({ setting, builderProps, builderAttrs, style, styles, advanced, children })=>{
10
- const { ...buttonStyles } = styles ?? {};
11
- const { label, iconSvg, iconAlign, iconVisible, shouldClearSpace } = setting ?? {};
12
- return /*#__PURE__*/ jsxRuntime.jsx(Button.default, {
13
- builderProps: builderProps,
14
- builderAttrs: builderAttrs,
15
- advanced: advanced,
16
- setting: {
17
- label,
18
- htmlType: 'submit',
19
- iconAlign: iconAlign,
20
- iconSvg: iconSvg,
21
- iconVisible: iconVisible,
22
- shouldClearSpace
23
- },
24
- style: style,
25
- styles: buttonStyles,
26
- children: children
11
+ const ProductViewMore = ({ style, styles: styles$1, setting, advanced, builderProps, builderAttrs, children })=>{
12
+ return /*#__PURE__*/ jsxRuntime.jsx("div", {
13
+ children: /*#__PURE__*/ jsxRuntime.jsx(Button.default, {
14
+ styles: styles$1,
15
+ advanced: advanced,
16
+ builderProps: builderProps,
17
+ builderAttrs: builderAttrs,
18
+ setting: {
19
+ ...data.getButtonSettings(setting)
20
+ },
21
+ style: {
22
+ ...styles.getButtonStyle(style, styles$1)
23
+ },
24
+ children: children
25
+ })
27
26
  });
28
27
  };
29
28
 
@@ -2,39 +2,32 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var core = require('@gem-sdk/core');
6
- var Button_liquid = require('../../../button/components/Button.liquid.js');
5
+ var system = require('@gem-sdk/system');
6
+ var styles = require('./common/styles.js');
7
7
  var helpers = require('../../../helpers.js');
8
+ var Button_liquid = require('../../../button/components/Button.liquid.js');
9
+ var core = require('@gem-sdk/core');
10
+ var data = require('./common/data.js');
8
11
 
9
- const ProductViewMore = ({ setting, builderProps, builderAttrs, style, styles, advanced, pageContext })=>{
10
- const { ...buttonStyles } = styles ?? {};
11
- const { label, iconSvg, iconAlign, iconVisible, translate } = setting ?? {};
12
+ const ProductViewMore = ({ style, styles: styles$1, setting, advanced, builderProps, builderAttrs, pageContext })=>{
12
13
  return core.template`
13
14
  <gp-product-view-more>
14
15
  ${Button_liquid.default({
15
- className: 'btn-view-more',
16
+ styles: styles$1,
17
+ advanced: advanced,
16
18
  builderProps: builderProps,
17
19
  builderAttrs: builderAttrs,
18
20
  setting: {
19
- label: label,
20
- iconAlign: iconAlign,
21
- btnLink: {
22
- link: '{{ product.url }}',
23
- target: setting?.target === 'new-tab' ? '_blank' : '_self'
24
- },
25
- iconSvg: iconSvg,
26
- iconVisible: iconVisible,
27
- translate
21
+ ...data.getButtonSettings(setting),
22
+ ...data.getButtonLiquidSettings(setting)
28
23
  },
29
24
  style: {
30
- ...style,
31
- ...core.makeStyleResponsive('ta', styles?.align)
25
+ ...styles.getButtonStyle(style, styles$1)
32
26
  },
33
- styles: buttonStyles,
34
- advanced,
35
- pageContext
27
+ pageContext,
28
+ className: 'btn-view-more'
36
29
  })}
37
- ${core.RenderIf(core.isLocalEnv, `<script ${helpers.getSettingPreloadData('class="gps-link" delay', 'src')}="{{ 'gp-product-view-more.js' | asset_url }}" defer="defer"></script>`, `<script ${helpers.getSettingPreloadData('class="gps-link" delay', 'src')}="${core.baseAssetURL}/assets-v2/gp-product-view-more.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}" defer="defer"></script>`)}
30
+ ${system.If(core.isLocalEnv, `<script ${helpers.getSettingPreloadData('class="gps-link" delay', 'src')}="{{ 'gp-product-view-more.js' | asset_url }}" defer="defer"></script>`, `<script ${helpers.getSettingPreloadData('class="gps-link" delay', 'src')}="${core.baseAssetURL}/assets-v2/gp-product-view-more.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}" defer="defer"></script>`)}
38
31
  </gp-product-view-more>
39
32
  `;
40
33
  };