@gem-sdk/components 2.0.0-dev.353 → 2.0.0-dev.356

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 (110) hide show
  1. package/dist/cjs/article/components/ArticleAuthor.liquid.js +27 -0
  2. package/dist/cjs/article/components/ArticleCategory.liquid.js +27 -0
  3. package/dist/cjs/article/components/ArticleContent.liquid.js +42 -0
  4. package/dist/cjs/article/components/ArticleDate.liquid.js +35 -0
  5. package/dist/cjs/article/components/ArticleExcerpt.liquid.js +26 -0
  6. package/dist/cjs/article/components/ArticleImage.liquid.js +67 -0
  7. package/dist/cjs/article/components/ArticlePagination.liquid.js +17 -0
  8. package/dist/cjs/article/components/ArticleReadMore.liquid.js +58 -0
  9. package/dist/cjs/article/components/ArticleTag.liquid.js +27 -0
  10. package/dist/cjs/article/components/ArticleTitle.liquid.js +46 -0
  11. package/dist/cjs/builder.js +1 -1
  12. package/dist/cjs/button/components/Button.js +5 -3
  13. package/dist/cjs/button/components/Button.liquid.js +7 -3
  14. package/dist/cjs/button/components/common/attributes.js +1 -2
  15. package/dist/cjs/button/components/common/helpers.js +2 -2
  16. package/dist/cjs/button/components/common/styles.js +29 -1
  17. package/dist/cjs/button/setting/configs/settings.js +24 -4
  18. package/dist/cjs/button/setting/configs/uiV2.js +46 -8
  19. package/dist/cjs/form/setting/newsletter/configs/settings.js +2 -2
  20. package/dist/cjs/form/setting/newsletter/configs/uiV2.js +0 -44
  21. package/dist/cjs/image/setting/configs/uiV2.js +5 -1
  22. package/dist/cjs/index.js +1 -1
  23. package/dist/cjs/index.liquid.js +20 -0
  24. package/dist/cjs/post-purchase/callout-banner/setting/config/callout-text/setting.js +4 -3
  25. package/dist/cjs/post-purchase/image/common/getClasses.js +1 -4
  26. package/dist/cjs/post-purchase/product/common/getClasses.js +4 -5
  27. package/dist/cjs/post-purchase/product/components/product-image/carousel-post-purchase/CarouselPostPurchase.js +3 -2
  28. package/dist/cjs/post-purchase/product/components/product-image/carousel-post-purchase/CarouselWrapperPostPurchase.js +2 -1
  29. package/dist/cjs/post-purchase/product/components/product-offer/common/attrs.js +14 -0
  30. package/dist/cjs/post-purchase/product/components/product-offer/common/classes.js +29 -0
  31. package/dist/cjs/post-purchase/product/components/product-offer/common/styles.js +27 -0
  32. package/dist/cjs/post-purchase/product/components/product-offer/components/ProductOffer.js +53 -0
  33. package/dist/cjs/post-purchase/product/components/product-offer/components/ProductOfferItem.js +45 -0
  34. package/dist/cjs/post-purchase/product/components/product-offer/hooks/useProductOfferData.js +57 -0
  35. package/dist/cjs/post-purchase/product/hooks/product-image/useListCarousel.js +6 -2
  36. package/dist/cjs/post-purchase/product/index.js +2 -2
  37. package/dist/cjs/post-purchase/product/next.js +1 -1
  38. package/dist/cjs/post-purchase/product/settings/product-image/setting-v2.js +5 -5
  39. package/dist/cjs/post-purchase/product/settings/product-image/uiV2.js +2 -1
  40. package/dist/cjs/post-purchase/product/settings/{ProductOffer.js → product-offer/index.js} +23 -143
  41. package/dist/cjs/post-purchase/product/settings/product-offer/ui/uiV1.js +140 -0
  42. package/dist/cjs/post-purchase/product/settings/product-offer/ui/uiV2.js +141 -0
  43. package/dist/cjs/post-purchase/utils/constants.js +6 -0
  44. package/dist/cjs/product/components/ProductViewMore/ProductViewMore.js +17 -18
  45. package/dist/cjs/product/components/ProductViewMore/ProductViewMore.liquid.js +14 -21
  46. package/dist/cjs/product/components/ProductViewMore/common/data.js +26 -0
  47. package/dist/cjs/product/components/ProductViewMore/common/styles.js +12 -0
  48. package/dist/cjs/product/setting/dynamic-checkout/configs/settings.js +9 -5
  49. package/dist/cjs/product/setting/dynamic-checkout/configs/uiV2.js +10 -10
  50. package/dist/cjs/product/setting/product-button/configs/settings.js +1 -0
  51. package/dist/cjs/product/setting/product-button/configs/uiV2.js +1 -1
  52. package/dist/cjs/product/setting/product-view-more/configs/settings.js +17 -16
  53. package/dist/cjs/product/setting/product-view-more/configs/uiV2.js +45 -45
  54. package/dist/esm/article/components/ArticleAuthor.liquid.js +23 -0
  55. package/dist/esm/article/components/ArticleCategory.liquid.js +23 -0
  56. package/dist/esm/article/components/ArticleContent.liquid.js +38 -0
  57. package/dist/esm/article/components/ArticleDate.liquid.js +31 -0
  58. package/dist/esm/article/components/ArticleExcerpt.liquid.js +22 -0
  59. package/dist/esm/article/components/ArticleImage.liquid.js +63 -0
  60. package/dist/esm/article/components/ArticlePagination.liquid.js +13 -0
  61. package/dist/esm/article/components/ArticleReadMore.liquid.js +54 -0
  62. package/dist/esm/article/components/ArticleTag.liquid.js +23 -0
  63. package/dist/esm/article/components/ArticleTitle.liquid.js +42 -0
  64. package/dist/esm/builder.js +1 -1
  65. package/dist/esm/button/components/Button.js +5 -3
  66. package/dist/esm/button/components/Button.liquid.js +7 -3
  67. package/dist/esm/button/components/common/attributes.js +1 -2
  68. package/dist/esm/button/components/common/helpers.js +2 -2
  69. package/dist/esm/button/components/common/styles.js +29 -3
  70. package/dist/esm/button/setting/configs/settings.js +24 -4
  71. package/dist/esm/button/setting/configs/uiV2.js +46 -8
  72. package/dist/esm/form/setting/newsletter/configs/settings.js +2 -2
  73. package/dist/esm/form/setting/newsletter/configs/uiV2.js +0 -44
  74. package/dist/esm/image/setting/configs/uiV2.js +5 -1
  75. package/dist/esm/index.js +1 -1
  76. package/dist/esm/index.liquid.js +10 -0
  77. package/dist/esm/post-purchase/callout-banner/setting/config/callout-text/setting.js +4 -3
  78. package/dist/esm/post-purchase/image/common/getClasses.js +1 -4
  79. package/dist/esm/post-purchase/product/common/getClasses.js +4 -5
  80. package/dist/esm/post-purchase/product/components/product-image/carousel-post-purchase/CarouselPostPurchase.js +3 -2
  81. package/dist/esm/post-purchase/product/components/product-image/carousel-post-purchase/CarouselWrapperPostPurchase.js +2 -1
  82. package/dist/esm/post-purchase/product/components/product-offer/common/attrs.js +12 -0
  83. package/dist/esm/post-purchase/product/components/product-offer/common/classes.js +25 -0
  84. package/dist/esm/post-purchase/product/components/product-offer/common/styles.js +24 -0
  85. package/dist/esm/post-purchase/product/components/product-offer/components/ProductOffer.js +49 -0
  86. package/dist/esm/post-purchase/product/components/product-offer/components/ProductOfferItem.js +43 -0
  87. package/dist/esm/post-purchase/product/components/product-offer/hooks/useProductOfferData.js +55 -0
  88. package/dist/esm/post-purchase/product/hooks/product-image/useListCarousel.js +6 -2
  89. package/dist/esm/post-purchase/product/index.js +1 -1
  90. package/dist/esm/post-purchase/product/next.js +1 -1
  91. package/dist/esm/post-purchase/product/settings/product-image/setting-v2.js +5 -5
  92. package/dist/esm/post-purchase/product/settings/product-image/uiV2.js +2 -1
  93. package/dist/esm/post-purchase/product/settings/{ProductOffer.js → product-offer/index.js} +23 -143
  94. package/dist/esm/post-purchase/product/settings/product-offer/ui/uiV1.js +138 -0
  95. package/dist/esm/post-purchase/product/settings/product-offer/ui/uiV2.js +139 -0
  96. package/dist/esm/post-purchase/utils/constants.js +6 -1
  97. package/dist/esm/product/components/ProductViewMore/ProductViewMore.js +17 -18
  98. package/dist/esm/product/components/ProductViewMore/ProductViewMore.liquid.js +14 -21
  99. package/dist/esm/product/components/ProductViewMore/common/data.js +23 -0
  100. package/dist/esm/product/components/ProductViewMore/common/styles.js +10 -0
  101. package/dist/esm/product/setting/dynamic-checkout/configs/settings.js +9 -5
  102. package/dist/esm/product/setting/dynamic-checkout/configs/uiV2.js +10 -10
  103. package/dist/esm/product/setting/product-button/configs/settings.js +1 -0
  104. package/dist/esm/product/setting/product-button/configs/uiV2.js +1 -1
  105. package/dist/esm/product/setting/product-view-more/configs/settings.js +17 -16
  106. package/dist/esm/product/setting/product-view-more/configs/uiV2.js +45 -45
  107. package/dist/types/index.d.ts +82 -18
  108. package/package.json +2 -2
  109. package/dist/cjs/post-purchase/product/components/ProductOffer.js +0 -138
  110. package/dist/esm/post-purchase/product/components/ProductOffer.js +0 -133
@@ -0,0 +1,49 @@
1
+ 'use client';
2
+ import { jsx, Fragment } from 'react/jsx-runtime';
3
+ import { createElement } from 'react';
4
+ import Loading from '../../../../../common/components/Loading.js';
5
+ import '@gem-sdk/core';
6
+ import { getProductOfferContainerClasses, getProductOfferWrapperClasses } from '../common/classes.js';
7
+ import { createClass, createStyle } from '@gem-sdk/system';
8
+ import { getWrapperStyles, getContainerStyles } from '../common/styles.js';
9
+ import { useProductOfferData } from '../hooks/useProductOfferData.js';
10
+ import { ProductOfferItem } from './ProductOfferItem.js';
11
+
12
+ const PostPurchaseProductOffer = (props)=>{
13
+ const { styles, builderAttrs, builderProps, setting } = props;
14
+ const { isLoading, productSortedById, totalProduct } = useProductOfferData();
15
+ const productOfferContainerClasses = createClass({
16
+ ...getProductOfferContainerClasses(builderProps?.uid)
17
+ });
18
+ const productOfferWrapperClasses = createClass({
19
+ ...getProductOfferWrapperClasses()
20
+ });
21
+ const wrapperStyles = createStyle({
22
+ ...getWrapperStyles(styles)
23
+ });
24
+ const containerStyles = createStyle({
25
+ ...getContainerStyles(setting)
26
+ });
27
+ return /*#__PURE__*/ jsx(Fragment, {
28
+ children: isLoading ? /*#__PURE__*/ jsx(Loading, {}) : !productSortedById?.length ? /*#__PURE__*/ jsx("div", {
29
+ children: "You haven't set up a product yet. Please go back to the sales funnel details to add a product."
30
+ }) : /*#__PURE__*/ jsx("div", {
31
+ ...builderAttrs,
32
+ className: productOfferContainerClasses,
33
+ style: containerStyles,
34
+ children: /*#__PURE__*/ jsx("div", {
35
+ className: productOfferWrapperClasses,
36
+ style: wrapperStyles,
37
+ children: productSortedById?.map((product, index)=>/*#__PURE__*/ createElement(ProductOfferItem, {
38
+ ...props,
39
+ product: product,
40
+ index: index,
41
+ key: index,
42
+ totalProduct: totalProduct
43
+ }))
44
+ })
45
+ })
46
+ });
47
+ };
48
+
49
+ export { PostPurchaseProductOffer as default };
@@ -0,0 +1,43 @@
1
+ 'use client';
2
+ import { jsx } from 'react/jsx-runtime';
3
+ import { useEditorMode, ProductProvider, isEmptyChildren } from '@gem-sdk/core';
4
+ import Row from '../../../../../grid/row/Row.js';
5
+ import 'react';
6
+ import ChildrenDroppable from '../../../../../grid/components/ChildrenDroppable.js';
7
+ import { createAttr, createClass } from '@gem-sdk/system';
8
+ import { getProductOfferAttrs } from '../common/attrs.js';
9
+ import { getProductOfferItemClasses } from '../common/classes.js';
10
+
11
+ const ProductOfferItem = (props)=>{
12
+ const { product, setting, builderProps, children, index, totalProduct, builderAttrs, styles } = props;
13
+ const mode = useEditorMode();
14
+ const { variantSelected, ...rowSetting } = setting ?? {};
15
+ const variantId = variantSelected?.[product?.baseID ?? '']?.variantId;
16
+ const attrs = createAttr({
17
+ ...getProductOfferAttrs(product, builderProps?.uid)
18
+ });
19
+ const productOfferItemClasses = createClass({
20
+ ...getProductOfferItemClasses(index, setting, totalProduct)
21
+ });
22
+ return /*#__PURE__*/ jsx("div", {
23
+ className: productOfferItemClasses,
24
+ children: /*#__PURE__*/ jsx(ProductProvider, {
25
+ product,
26
+ readOnly: true,
27
+ initialVariantId: variantId ?? 'Latest',
28
+ children: /*#__PURE__*/ jsx("div", {
29
+ ...mode === 'edit' ? {
30
+ ...attrs
31
+ } : {},
32
+ children: /*#__PURE__*/ jsx(Row, {
33
+ builderAttrs: builderAttrs,
34
+ setting: rowSetting,
35
+ styles: styles,
36
+ children: isEmptyChildren(children) ? /*#__PURE__*/ jsx(ChildrenDroppable, {}) : children
37
+ })
38
+ })
39
+ })
40
+ }, `uid-${product?.id}`);
41
+ };
42
+
43
+ export { ProductOfferItem };
@@ -0,0 +1,55 @@
1
+ import { usePageStore, useProductsQuery, flattenConnection } from '@gem-sdk/core';
2
+ import { useDynamicProduct } from '../../../hooks/useDynamicProduct.js';
3
+ import { useMemo } from 'react';
4
+ import { hasPublicStoreFrontData, createStoreFrontFetcher } from '../../../helpers/index.js';
5
+ import { productOfferPlaceholder } from '../../../constants/ProductOfferPlaceholder.js';
6
+
7
+ const useProductOfferData = ()=>{
8
+ const productOffers = usePageStore((s)=>s.productOffers);
9
+ const publicStoreFrontData = usePageStore((s)=>s.publicStoreFrontData);
10
+ const { isDynamicProduct } = useDynamicProduct();
11
+ const dynamicDiscountOffer = usePageStore((s)=>s.dynamicDiscountOffer);
12
+ const totalProduct = useMemo(()=>isDynamicProduct ? dynamicDiscountOffer?.appliedProductCount : productOffers?.length, [
13
+ dynamicDiscountOffer?.appliedProductCount,
14
+ isDynamicProduct,
15
+ productOffers?.length
16
+ ]);
17
+ const sortedProductBaseIDs = useMemo(()=>{
18
+ return productOffers?.sort((a, b)=>{
19
+ if (a?.node?.position && b?.node?.position) {
20
+ return a.node.position - b.node.position;
21
+ }
22
+ return 0;
23
+ }).map((item)=>item?.node?.objectBaseID).filter(Boolean);
24
+ }, [
25
+ productOffers
26
+ ]);
27
+ const { isLoading, isValidating, data } = useProductsQuery(sortedProductBaseIDs || [], {
28
+ revalidateOnMount: true
29
+ }, {
30
+ allStatus: true,
31
+ fetcher: hasPublicStoreFrontData(publicStoreFrontData) ? createStoreFrontFetcher(publicStoreFrontData) : undefined
32
+ });
33
+ const loading = useMemo(()=>isLoading || isValidating, [
34
+ isLoading,
35
+ isValidating
36
+ ]);
37
+ const products = useMemo(()=>flattenConnection(data?.products), [
38
+ data?.products
39
+ ]);
40
+ const productSortedById = useMemo(()=>{
41
+ return isDynamicProduct && dynamicDiscountOffer?.appliedProductCount ? Array(dynamicDiscountOffer.appliedProductCount).fill(productOfferPlaceholder) : sortedProductBaseIDs?.map((id)=>products?.find((el)=>el?.baseID === id)).filter(Boolean);
42
+ }, [
43
+ isDynamicProduct,
44
+ dynamicDiscountOffer?.appliedProductCount,
45
+ sortedProductBaseIDs,
46
+ products
47
+ ]);
48
+ return {
49
+ isLoading: loading,
50
+ productSortedById,
51
+ totalProduct
52
+ };
53
+ };
54
+
55
+ export { useProductOfferData };
@@ -2,7 +2,7 @@ import { useCallback, useMemo } from 'react';
2
2
  import { useCarousel } from './useCarousel.js';
3
3
 
4
4
  const useListCarousel = (props)=>{
5
- const { productImages, itemPerRow } = props;
5
+ const { productImages, itemPerRow, vertical } = props;
6
6
  const { moveToIdx } = useCarousel();
7
7
  const list = useCallback(()=>{
8
8
  const temp = [
@@ -16,6 +16,9 @@ const useListCarousel = (props)=>{
16
16
  ]);
17
17
  const listRender = useMemo(()=>{
18
18
  const listItem = list();
19
+ if (vertical) return [
20
+ ...productImages
21
+ ];
19
22
  if (listItem.length < itemPerRow) {
20
23
  const temp = [
21
24
  ...productImages
@@ -31,7 +34,8 @@ const useListCarousel = (props)=>{
31
34
  }, [
32
35
  list,
33
36
  itemPerRow,
34
- productImages
37
+ productImages,
38
+ vertical
35
39
  ]);
36
40
  return {
37
41
  listRender
@@ -14,7 +14,7 @@ import config$2 from './settings/product-price/ProductPrice.js';
14
14
  import config$3 from './settings/product-variants/ProductVariant.js';
15
15
  import config$4 from './settings/accept-button/index.js';
16
16
  import config$5 from './settings/product-quantity/index.js';
17
- import config$7 from './settings/ProductOffer.js';
17
+ import config$7 from './settings/product-offer/index.js';
18
18
  import config$6 from './settings/product-price-breakdown/index.js';
19
19
  import config$8 from './settings/product-discount-tag/ProductDiscountTag.js';
20
20
  import config$9 from './settings/product-image/ProductImages.js';
@@ -26,7 +26,7 @@ const PostPurchaseProductQuantity = dynamic(()=>import('./components/ProductQuan
26
26
  const PostPurchaseProductPriceBreakdown = dynamic(()=>import('./components/ProductPriceBreakdown.js'), {
27
27
  loading: Loading
28
28
  });
29
- const PostPurchaseProductOffer = dynamic(()=>import('./components/ProductOffer.js'), {
29
+ const PostPurchaseProductOffer = dynamic(()=>import('./components/product-offer/components/ProductOffer.js'), {
30
30
  loading: Loading
31
31
  });
32
32
  const PostPurchaseProductDiscountTag = dynamic(()=>import('./components/ProductDiscountTag.js'), {
@@ -32,25 +32,25 @@ const SettingV2 = [
32
32
  itemSpacing: 'large',
33
33
  options: [
34
34
  {
35
- label: 'Image list bottom',
35
+ label: 'Featured top',
36
36
  value: 'bottom-center',
37
37
  type: 'p-image-layout',
38
38
  iconName: 'gp-product-image-layout-bottom'
39
39
  },
40
40
  {
41
- label: 'Image list left',
41
+ label: 'Featured left',
42
42
  value: 'left',
43
43
  type: 'p-image-layout',
44
44
  iconName: 'gp-product-image-layout-left'
45
45
  },
46
46
  {
47
- label: 'Image list right',
47
+ label: 'Featured right',
48
48
  value: 'right',
49
49
  type: 'p-image-layout',
50
50
  iconName: 'gp-product-image-layout-right'
51
51
  },
52
52
  {
53
- label: 'Featured Only',
53
+ label: 'Featured only',
54
54
  value: 'only-feature',
55
55
  type: 'p-image-layout',
56
56
  iconName: 'gp-product-image-layout-featured-only'
@@ -349,7 +349,7 @@ const SettingV2 = [
349
349
  label: 'Spacing',
350
350
  id: 'ilSpacing',
351
351
  options: postPurchaseSpacing,
352
- default: 'none'
352
+ default: 'xtight'
353
353
  },
354
354
  {
355
355
  id: 'ilItemPerSlide',
@@ -168,7 +168,7 @@ const SettingUIV2 = [
168
168
  },
169
169
  {
170
170
  label: {
171
- en: 'Spacing'
171
+ en: 'Item spacing'
172
172
  },
173
173
  controls: [
174
174
  {
@@ -232,6 +232,7 @@ const SettingUIV2 = [
232
232
  fullWidth: true,
233
233
  disableMessage: `Horizontal alignment is disabled when the width is set to 100% or greater`
234
234
  },
235
+ conditionDisplay: "['bottom-center', 'left', 'right', 'only-feature'].includes(layoutType)",
235
236
  conditionEnable: '!(parseInt(ftWidth) >= 100 && ftWidth?.includes("%"))'
236
237
  }
237
238
  ]
@@ -1,7 +1,9 @@
1
- import { postPurchaseProductOfferDefault } from './presets-config/product-presets/product-offer-default.js';
2
- import { postPurchaseViewSpacing } from '../../utils/constants.js';
3
- import { postPurchaseProduct1Col } from './presets-config/product-presets/product-offer-1-col.js';
4
- import { postPurchaseProduct2Col } from './presets-config/product-presets/product-offer-2-col.js';
1
+ import { postPurchaseProductOfferDefault } from '../presets-config/product-presets/product-offer-default.js';
2
+ import { postPurchaseViewSpacing } from '../../../utils/constants.js';
3
+ import { postPurchaseProduct1Col } from '../presets-config/product-presets/product-offer-1-col.js';
4
+ import { postPurchaseProduct2Col } from '../presets-config/product-presets/product-offer-2-col.js';
5
+ import { ProductOfferSettingUIV1 } from './ui/uiV1.js';
6
+ import { ProductOfferSettingUIV2 } from './ui/uiV2.js';
5
7
 
6
8
  const config = {
7
9
  tag: 'PostPurchaseProductOffer',
@@ -345,14 +347,26 @@ const config = {
345
347
  },
346
348
  {
347
349
  id: 'productOfferWidth',
348
- type: 'input:unit-width',
350
+ type: 'dropdown:input',
349
351
  label: 'Width',
350
- placeholder: 'Global style',
351
- min: 0,
352
352
  units: [
353
353
  'px',
354
354
  '%'
355
355
  ],
356
+ hideUnit: false,
357
+ inputType: 'number',
358
+ displayOptions: [
359
+ {
360
+ label: 'Full',
361
+ value: '100%',
362
+ showValue: true
363
+ },
364
+ {
365
+ label: 'Default',
366
+ value: '1200px',
367
+ showValue: true
368
+ }
369
+ ],
356
370
  devices: {
357
371
  desktop: {
358
372
  default: '100%'
@@ -370,142 +384,8 @@ const config = {
370
384
  ]
371
385
  }
372
386
  ],
373
- ui: [
374
- {
375
- type: 'control',
376
- label: {
377
- en: 'Product source'
378
- },
379
- setting: {
380
- id: 'productSetting'
381
- },
382
- layout: 'vertical'
383
- },
384
- {
385
- type: 'group',
386
- label: {
387
- en: 'Product offers'
388
- },
389
- controls: [
390
- {
391
- type: 'control',
392
- label: {
393
- en: 'Quantity'
394
- },
395
- setting: {
396
- id: 'dynamicOfferQuantity'
397
- }
398
- }
399
- ],
400
- condition: 'false'
401
- },
402
- {
403
- type: 'control',
404
- label: {
405
- en: ''
406
- },
407
- setting: {
408
- id: 'discountAndShippingFee'
409
- },
410
- layout: 'vertical'
411
- },
412
- {
413
- type: 'group',
414
- label: {
415
- en: 'Layout'
416
- },
417
- condition: `(productSetting?.productIds?.length || 0) > 1`,
418
- controls: [
419
- {
420
- type: 'control',
421
- label: {
422
- en: 'Choose layout'
423
- },
424
- setting: {
425
- id: 'productOfferLayout'
426
- },
427
- layout: 'vertical',
428
- condition: `(productSetting?.productIds?.length || 0) > 1`
429
- },
430
- {
431
- type: 'control',
432
- label: {
433
- en: 'Row gap'
434
- },
435
- setting: {
436
- id: 'productOfferVerticalGutter'
437
- }
438
- },
439
- {
440
- type: 'control',
441
- label: {
442
- en: 'Column gap'
443
- },
444
- setting: {
445
- id: 'productOfferColumnGap'
446
- }
447
- }
448
- ]
449
- },
450
- {
451
- type: 'group',
452
- label: {
453
- en: 'Product Layout'
454
- },
455
- controls: [
456
- {
457
- type: 'control',
458
- label: {
459
- en: ''
460
- },
461
- setting: {
462
- id: 'layout'
463
- },
464
- layout: 'vertical'
465
- },
466
- {
467
- type: 'control',
468
- label: {
469
- en: 'Column gap'
470
- },
471
- setting: {
472
- id: 'columnGap'
473
- },
474
- condition: `!!layout.cols && layout.cols.length > 1`
475
- }
476
- ]
477
- },
478
- {
479
- type: 'group',
480
- label: {
481
- en: 'Size'
482
- },
483
- controls: [
484
- {
485
- type: 'control',
486
- label: {
487
- en: 'Width'
488
- },
489
- setting: {
490
- id: 'productOfferWidth'
491
- }
492
- }
493
- ]
494
- },
495
- {
496
- type: 'control',
497
- label: {
498
- en: 'Align'
499
- },
500
- setting: {
501
- id: 'inlineAlignment'
502
- },
503
- condition: `productOfferWidth !== '100%'`,
504
- options: {
505
- label: 'large'
506
- }
507
- }
508
- ],
387
+ ui: ProductOfferSettingUIV1,
388
+ uiV2: ProductOfferSettingUIV2,
509
389
  presets: [
510
390
  postPurchaseProductOfferDefault,
511
391
  postPurchaseProduct2Col,
@@ -0,0 +1,138 @@
1
+ const ProductOfferSettingUIV1 = [
2
+ {
3
+ type: 'control',
4
+ label: {
5
+ en: 'Product source'
6
+ },
7
+ setting: {
8
+ id: 'productSetting'
9
+ },
10
+ layout: 'vertical'
11
+ },
12
+ {
13
+ type: 'group',
14
+ label: {
15
+ en: 'Product offers'
16
+ },
17
+ controls: [
18
+ {
19
+ type: 'control',
20
+ label: {
21
+ en: 'Quantity'
22
+ },
23
+ setting: {
24
+ id: 'dynamicOfferQuantity'
25
+ }
26
+ }
27
+ ],
28
+ condition: 'false'
29
+ },
30
+ {
31
+ type: 'control',
32
+ label: {
33
+ en: ''
34
+ },
35
+ setting: {
36
+ id: 'discountAndShippingFee'
37
+ },
38
+ layout: 'vertical'
39
+ },
40
+ {
41
+ type: 'group',
42
+ label: {
43
+ en: 'Layout'
44
+ },
45
+ condition: `(productSetting?.productIds?.length || 0) > 1`,
46
+ controls: [
47
+ {
48
+ type: 'control',
49
+ label: {
50
+ en: 'Choose layout'
51
+ },
52
+ setting: {
53
+ id: 'productOfferLayout'
54
+ },
55
+ layout: 'vertical',
56
+ condition: `(productSetting?.productIds?.length || 0) > 1`
57
+ },
58
+ {
59
+ type: 'control',
60
+ label: {
61
+ en: 'Row gap'
62
+ },
63
+ setting: {
64
+ id: 'productOfferVerticalGutter'
65
+ }
66
+ },
67
+ {
68
+ type: 'control',
69
+ label: {
70
+ en: 'Column gap'
71
+ },
72
+ setting: {
73
+ id: 'productOfferColumnGap'
74
+ }
75
+ }
76
+ ]
77
+ },
78
+ {
79
+ type: 'group',
80
+ label: {
81
+ en: 'Product Layout'
82
+ },
83
+ controls: [
84
+ {
85
+ type: 'control',
86
+ label: {
87
+ en: ''
88
+ },
89
+ setting: {
90
+ id: 'layout'
91
+ },
92
+ layout: 'vertical'
93
+ },
94
+ {
95
+ type: 'control',
96
+ label: {
97
+ en: 'Column gap'
98
+ },
99
+ setting: {
100
+ id: 'columnGap'
101
+ },
102
+ condition: `!!layout.cols && layout.cols.length > 1`
103
+ }
104
+ ]
105
+ },
106
+ {
107
+ type: 'group',
108
+ label: {
109
+ en: 'Size'
110
+ },
111
+ controls: [
112
+ {
113
+ type: 'control',
114
+ label: {
115
+ en: 'Width'
116
+ },
117
+ setting: {
118
+ id: 'productOfferWidth'
119
+ }
120
+ }
121
+ ]
122
+ },
123
+ {
124
+ type: 'control',
125
+ label: {
126
+ en: 'Align'
127
+ },
128
+ setting: {
129
+ id: 'inlineAlignment'
130
+ },
131
+ condition: `productOfferWidth !== '100%'`,
132
+ options: {
133
+ label: 'large'
134
+ }
135
+ }
136
+ ];
137
+
138
+ export { ProductOfferSettingUIV1 };