@gem-sdk/components 2.0.0-dev.271 → 2.0.0-dev.275

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 (104) hide show
  1. package/dist/cjs/article/components/ArticleImage.js +0 -5
  2. package/dist/cjs/article/components/ArticleList.js +1 -1
  3. package/dist/cjs/banner/components/HeroBannerItem.liquid.js +1 -1
  4. package/dist/cjs/builder.js +13 -13
  5. package/dist/cjs/cart/components/ShopPayButton/ShopPayButton.js +70 -0
  6. package/dist/cjs/cart/components/ShopPayButton/ShopPayButton.liquid.js +71 -0
  7. package/dist/cjs/cart/components/ShopPayButton/common/classes.js +18 -0
  8. package/dist/cjs/cart/components/ShopPayButton/common/helpers.js +31 -0
  9. package/dist/cjs/cart/components/ShopPayButton/common/styles.js +12 -0
  10. package/dist/cjs/cart/components/ShopPayButton/hooks/useShopPayButton.js +70 -0
  11. package/dist/cjs/cart/next.js +1 -1
  12. package/dist/cjs/estimate-delivery/components/EstimateDate.liquid.js +1 -1
  13. package/dist/cjs/form/setting/submit-button/configs/settings.js +2 -2
  14. package/dist/cjs/header/components/kind/basic/index.js +1 -1
  15. package/dist/cjs/header/components/kind/modern/index.js +1 -1
  16. package/dist/cjs/index.js +39 -39
  17. package/dist/cjs/index.liquid.js +9 -9
  18. package/dist/cjs/marquee/setting/configs/childImageTemplate.js +1 -1
  19. package/dist/cjs/post-purchase/advanced-list/components/common/getClasses.js +1 -1
  20. package/dist/cjs/post-purchase/advanced-list/setting/configs/presets.js +3 -1
  21. package/dist/cjs/post-purchase/advanced-list/setting/configs/settings.js +2 -1
  22. package/dist/cjs/post-purchase/advanced-list/setting/template.js +8 -3
  23. package/dist/cjs/post-purchase/callout-banner/setting/config/callout-text/setting.js +0 -7
  24. package/dist/cjs/post-purchase/callout-banner/setting/config/callout-text/uiV2.js +1 -1
  25. package/dist/cjs/post-purchase/image/setting/Image.js +2 -2
  26. package/dist/cjs/post-purchase/image/setting/setting-v2.js +25 -13
  27. package/dist/cjs/post-purchase/image/setting/ui-v2.js +1 -1
  28. package/dist/cjs/post-purchase/link/setting/configs/settings.js +7 -2
  29. package/dist/cjs/post-purchase/product/settings/product-variants/configs/uiV2.js +4 -2
  30. package/dist/cjs/product/components/DynamicCheckout/DynamicCheckout.js +28 -0
  31. package/dist/cjs/product/components/DynamicCheckout/DynamicCheckout.liquid.js +23 -0
  32. package/dist/cjs/product/components/DynamicCheckout/common/classes.js +32 -0
  33. package/dist/cjs/product/components/DynamicCheckout/common/styles.js +181 -0
  34. package/dist/cjs/product/components/DynamicCheckout/components/Button.liquid.js +58 -0
  35. package/dist/cjs/product/components/FileUpload/components/common/index.js +1 -1
  36. package/dist/cjs/product/components/ProductDescription/common/const.js +9 -0
  37. package/dist/cjs/product/components/ProductDescription/common/getClasses.js +30 -0
  38. package/dist/cjs/product/components/ProductDescription/common/getStyle.js +81 -0
  39. package/dist/cjs/product/components/ProductDescription/hooks/useGpDescription.js +90 -0
  40. package/dist/cjs/product/components/ProductDescription/index.js +115 -0
  41. package/dist/cjs/product/components/ProductDescription/index.liquid.js +86 -0
  42. package/dist/cjs/product/next.js +1 -1
  43. package/dist/cjs/setting.js +1 -1
  44. package/dist/esm/article/components/ArticleImage.js +0 -5
  45. package/dist/esm/article/components/ArticleList.js +1 -1
  46. package/dist/esm/banner/components/HeroBannerItem.liquid.js +1 -1
  47. package/dist/esm/builder.js +3 -3
  48. package/dist/esm/cart/components/ShopPayButton/ShopPayButton.js +66 -0
  49. package/dist/esm/cart/components/ShopPayButton/ShopPayButton.liquid.js +67 -0
  50. package/dist/esm/cart/components/ShopPayButton/common/classes.js +15 -0
  51. package/dist/esm/cart/components/ShopPayButton/common/helpers.js +27 -0
  52. package/dist/esm/cart/components/ShopPayButton/common/styles.js +10 -0
  53. package/dist/esm/cart/components/ShopPayButton/hooks/useShopPayButton.js +68 -0
  54. package/dist/esm/cart/next.js +1 -1
  55. package/dist/esm/estimate-delivery/components/EstimateDate.liquid.js +1 -1
  56. package/dist/esm/form/setting/submit-button/configs/settings.js +2 -2
  57. package/dist/esm/header/components/kind/basic/index.js +1 -1
  58. package/dist/esm/header/components/kind/modern/index.js +1 -1
  59. package/dist/esm/index.js +3 -3
  60. package/dist/esm/index.liquid.js +3 -3
  61. package/dist/esm/marquee/setting/configs/childImageTemplate.js +1 -1
  62. package/dist/esm/post-purchase/advanced-list/components/common/getClasses.js +1 -1
  63. package/dist/esm/post-purchase/advanced-list/setting/configs/presets.js +3 -1
  64. package/dist/esm/post-purchase/advanced-list/setting/configs/settings.js +2 -1
  65. package/dist/esm/post-purchase/advanced-list/setting/template.js +8 -3
  66. package/dist/esm/post-purchase/callout-banner/setting/config/callout-text/setting.js +0 -7
  67. package/dist/esm/post-purchase/callout-banner/setting/config/callout-text/uiV2.js +1 -1
  68. package/dist/esm/post-purchase/image/setting/Image.js +2 -2
  69. package/dist/esm/post-purchase/image/setting/setting-v2.js +25 -13
  70. package/dist/esm/post-purchase/image/setting/ui-v2.js +1 -1
  71. package/dist/esm/post-purchase/link/setting/configs/settings.js +7 -2
  72. package/dist/esm/post-purchase/product/settings/product-variants/configs/uiV2.js +4 -2
  73. package/dist/esm/product/components/DynamicCheckout/DynamicCheckout.js +24 -0
  74. package/dist/esm/product/components/DynamicCheckout/DynamicCheckout.liquid.js +19 -0
  75. package/dist/esm/product/components/DynamicCheckout/common/classes.js +30 -0
  76. package/dist/esm/product/components/DynamicCheckout/common/styles.js +179 -0
  77. package/dist/esm/product/components/DynamicCheckout/components/Button.liquid.js +54 -0
  78. package/dist/esm/product/components/FileUpload/components/common/index.js +1 -1
  79. package/dist/esm/product/components/ProductDescription/common/const.js +6 -0
  80. package/dist/esm/product/components/ProductDescription/common/getClasses.js +27 -0
  81. package/dist/esm/product/components/ProductDescription/common/getStyle.js +77 -0
  82. package/dist/esm/product/components/ProductDescription/hooks/useGpDescription.js +88 -0
  83. package/dist/esm/product/components/ProductDescription/index.js +111 -0
  84. package/dist/esm/product/components/ProductDescription/index.liquid.js +82 -0
  85. package/dist/esm/product/next.js +1 -1
  86. package/dist/esm/setting.js +1 -1
  87. package/dist/types/index.d.ts +29 -97
  88. package/package.json +1 -1
  89. package/dist/cjs/cart/components/ShopPayButton/ShopPayButtonCommon.js +0 -20
  90. package/dist/cjs/cart/components/ShopPayButton/index.js +0 -113
  91. package/dist/cjs/cart/components/ShopPayButton/index.liquid.js +0 -51
  92. package/dist/cjs/product/components/DynamicCheckout.liquid.js +0 -250
  93. package/dist/cjs/product/components/ProductDescription/const.js +0 -5
  94. package/dist/cjs/product/components/ProductDescription.js +0 -172
  95. package/dist/cjs/product/components/ProductDescription.liquid.js +0 -120
  96. package/dist/esm/cart/components/ShopPayButton/ShopPayButtonCommon.js +0 -17
  97. package/dist/esm/cart/components/ShopPayButton/index.js +0 -109
  98. package/dist/esm/cart/components/ShopPayButton/index.liquid.js +0 -47
  99. package/dist/esm/product/components/DynamicCheckout.liquid.js +0 -246
  100. package/dist/esm/product/components/ProductDescription/const.js +0 -3
  101. package/dist/esm/product/components/ProductDescription.js +0 -168
  102. package/dist/esm/product/components/ProductDescription.liquid.js +0 -116
  103. /package/dist/cjs/product/components/ProductDescription/{common.js → common/getMaxHeight.js} +0 -0
  104. /package/dist/esm/product/components/ProductDescription/{common.js → common/getMaxHeight.js} +0 -0
@@ -0,0 +1,27 @@
1
+ const getSPButton = ({ styles, buttons })=>{
2
+ const { DynamicCheckoutBlack, DynamicCheckoutWhite, DynamicCheckoutPurple, ExpressCheckoutBlack, ExpressCheckoutWhite, ExpressCheckoutPurple } = buttons;
3
+ if (styles?.type === 'dynamic') {
4
+ if (styles.color === 'black') return DynamicCheckoutBlack;
5
+ if (styles.color === 'purple') return DynamicCheckoutPurple;
6
+ return DynamicCheckoutWhite;
7
+ } else {
8
+ if (styles?.color === 'black') return ExpressCheckoutBlack;
9
+ if (styles?.color === 'purple') return ExpressCheckoutPurple;
10
+ return ExpressCheckoutWhite;
11
+ }
12
+ };
13
+ const getIdFromGid = (id)=>{
14
+ if (!id) return;
15
+ return id.split('/').at(-1);
16
+ };
17
+ const getStoreUrl = (url)=>{
18
+ if (!url) return;
19
+ try {
20
+ const data = new URL(url);
21
+ return data.origin;
22
+ } catch {
23
+ return;
24
+ }
25
+ };
26
+
27
+ export { getIdFromGid, getSPButton, getStoreUrl };
@@ -0,0 +1,10 @@
1
+ import { makeStyleResponsive } from '@gem-sdk/core';
2
+
3
+ const getButtonWrapperStyles = (style, styles)=>{
4
+ return {
5
+ ...style,
6
+ ...makeStyleResponsive('jc', styles?.align)
7
+ };
8
+ };
9
+
10
+ export { getButtonWrapperStyles };
@@ -0,0 +1,68 @@
1
+ import { useEditorMode, useQuantity, useCartData, useCurrentVariant, useShopStore, useCurrentVariantInStock } from '@gem-sdk/core';
2
+ import { useMemo } from 'react';
3
+ import { getStoreUrl, getIdFromGid } from '../common/helpers.js';
4
+
5
+ const useShopPayButton = (setting)=>{
6
+ const mode = useEditorMode();
7
+ const { quantity } = useQuantity();
8
+ const { data: cartData } = useCartData();
9
+ const currentVariant = useCurrentVariant();
10
+ const storefrontUrl = useShopStore((s)=>s.storefrontUrl);
11
+ const isCurrentVariantInStock = useCurrentVariantInStock();
12
+ const storeUrl = getStoreUrl(storefrontUrl);
13
+ const idsInCart = useMemo(()=>{
14
+ const items = cartData?.lineItems.map((v)=>({
15
+ id: v.variantId,
16
+ quantity: v.quantity
17
+ }))?.reduce((prev, curr)=>{
18
+ const bareId = getIdFromGid(curr?.id);
19
+ if (bareId) {
20
+ prev.push(`${bareId}:${curr?.quantity ?? 1}`);
21
+ }
22
+ return prev;
23
+ }, []);
24
+ return items;
25
+ }, [
26
+ cartData?.lineItems
27
+ ]);
28
+ const variants = useMemo(()=>{
29
+ if (setting?.kind === 'cart-buy') {
30
+ return idsInCart;
31
+ }
32
+ if (currentVariant?.baseID && isCurrentVariantInStock && quantity) {
33
+ return [
34
+ `${getIdFromGid(currentVariant.baseID)}:${quantity}`
35
+ ];
36
+ }
37
+ return undefined;
38
+ }, [
39
+ setting?.kind,
40
+ currentVariant?.baseID,
41
+ isCurrentVariantInStock,
42
+ quantity,
43
+ idsInCart
44
+ ]);
45
+ const payUrl = `${storeUrl}/cart/${variants?.join(',')}?payment=shop_pay`;
46
+ const handleOnPay = ({ inputWidth = 600, inputHeight = 600 })=>{
47
+ if (mode === 'edit') return;
48
+ if (setting?.openMode === 'popup') {
49
+ const dualScreenLeft = window.screenLeft !== undefined ? window.screenLeft : window.screenX;
50
+ const dualScreenTop = window.screenTop !== undefined ? window.screenTop : window.screenY;
51
+ const width = window.innerWidth ? window.innerWidth : document.documentElement.clientWidth ? document.documentElement.clientWidth : screen.width;
52
+ const height = window.innerHeight ? window.innerHeight : document.documentElement.clientHeight ? document.documentElement.clientHeight : screen.height;
53
+ const systemZoom = width / window.screen.availWidth;
54
+ const left = (width - inputWidth) / 2 / systemZoom + dualScreenLeft;
55
+ const top = (height - inputHeight) / 2 / systemZoom + dualScreenTop;
56
+ window.open(payUrl, 'shop_pay', `scrollbars=yes, width=${inputWidth / systemZoom}, height=${inputHeight / systemZoom}, top=${top}, left=${left}`);
57
+ } else {
58
+ !!payUrl && window.open(payUrl);
59
+ }
60
+ };
61
+ return {
62
+ storeUrl,
63
+ variants,
64
+ handleOnPay
65
+ };
66
+ };
67
+
68
+ export { useShopPayButton };
@@ -47,7 +47,7 @@ const CouponList = dynamic(()=>import('./components/CouponList.js'), {
47
47
  const CheckoutNow = dynamic(()=>import('./components/CheckoutNow.js'), {
48
48
  loading: Loading
49
49
  });
50
- const ShopPayButton = dynamic(()=>import('./components/ShopPayButton/index.js'), {
50
+ const ShopPayButton = dynamic(()=>import('./components/ShopPayButton/ShopPayButton.js'), {
51
51
  ssr: false,
52
52
  loading: Loading
53
53
  });
@@ -16,7 +16,7 @@ import '@gem-sdk/keen-slider/react';
16
16
  import 'next/image';
17
17
  import 'react-youtube';
18
18
  import '../../image/components/AdaptiveImage.js';
19
- import '../../cart/components/ShopPayButton/index.js';
19
+ import '../../cart/components/ShopPayButton/ShopPayButton.js';
20
20
  import '../../countdown-timer/setting/configs/settings.js';
21
21
  import '../../header/components/Header.js';
22
22
  import '../../header/components/kind/basic/index.js';
@@ -319,8 +319,8 @@ const SubmitButtonSettings = [
319
319
  height: 'Auto',
320
320
  padding: {
321
321
  type: 'medium',
322
- top: '8px',
323
- bottom: '8px',
322
+ top: '12px',
323
+ bottom: '12px',
324
324
  left: '24px',
325
325
  right: '24px'
326
326
  }
@@ -9,7 +9,7 @@ import 'next/head';
9
9
  import 'next/image';
10
10
  import 'react-youtube';
11
11
  import Image from '../../../../image/components/Image.js';
12
- import '../../../../cart/components/ShopPayButton/index.js';
12
+ import '../../../../cart/components/ShopPayButton/ShopPayButton.js';
13
13
  import CheckoutNow from '../../../../cart/components/CheckoutNow.js';
14
14
 
15
15
  const MobileMenu = dynamic(()=>import('./MobileMenu.js'));
@@ -9,7 +9,7 @@ import 'next/image';
9
9
  import 'react-youtube';
10
10
  import 'next/link';
11
11
  import '../../../../image/components/AdaptiveImage.js';
12
- import '../../../../cart/components/ShopPayButton/index.js';
12
+ import '../../../../cart/components/ShopPayButton/ShopPayButton.js';
13
13
 
14
14
  const ModernHeader = (props)=>{
15
15
  return /*#__PURE__*/ jsxs("div", {
package/dist/esm/index.js CHANGED
@@ -25,7 +25,7 @@ export { default as CartDiscount } from './cart/components/CartDiscount.js';
25
25
  export { default as CartOrderNote } from './cart/components/CartOrderNote.js';
26
26
  export { default as CartLineAttribute } from './cart/components/CartLineAttribute.js';
27
27
  export { default as CouponList } from './cart/components/CouponList.js';
28
- export { default as ShopPayButton } from './cart/components/ShopPayButton/index.js';
28
+ export { default as ShopPayButton } from './cart/components/ShopPayButton/ShopPayButton.js';
29
29
  export { default as CheckoutNow } from './cart/components/CheckoutNow.js';
30
30
  export { default as collectionSetting } from './collection/setting/index.js';
31
31
  export { default as CollectionTitle } from './collection/components/CollectionTitle.js';
@@ -68,7 +68,7 @@ export { default as productSetting } from './product/setting/index.js';
68
68
  export { default as Product } from './product/components/Product.js';
69
69
  export { default as ProductTitle } from './product/components/ProductTitle/index.js';
70
70
  export { default as ProductQuantity } from './product/components/ProductQuantity.js';
71
- export { default as ProductDescription } from './product/components/ProductDescription.js';
71
+ export { default as ProductDescription } from './product/components/ProductDescription/index.js';
72
72
  export { default as ProductPrice } from './product/components/ProductPrice.js';
73
73
  export { default as ProductButton } from './product/components/ProductButton.js';
74
74
  export { default as ProductVariants } from './product/components/ProductVariants/index.js';
@@ -78,7 +78,7 @@ export { default as ProductPropertyInput } from './product/components/ProductPro
78
78
  export { default as ProductQuickView } from './product/components/ProductQuickView/index.js';
79
79
  export { default as ProductTag } from './product/components/ProductTag.js';
80
80
  export { default as ProductList } from './product/components/ProductList.js';
81
- export { default as DynamicCheckout } from './product/components/DynamicCheckout.js';
81
+ export { default as DynamicCheckout } from './product/components/DynamicCheckout/DynamicCheckout.js';
82
82
  export { default as ProductBundleDiscount } from './product/components/ProductBundleDiscount.js';
83
83
  export { default as ProductBundleDiscountItem } from './product/components/ProductBundleDiscountItem.js';
84
84
  export { default as ProductVendor } from './product/components/Vendor.js';
@@ -12,7 +12,7 @@ export { default as Product } from './product/components/Product.liquid.js';
12
12
  export { default as ProductTitle } from './product/components/ProductTitle/index.liquid.js';
13
13
  export { ProductPrice } from './product/components/ProductPrice.liquid.js';
14
14
  export { default as ProductButton } from './product/components/ProductButton.liquid.js';
15
- export { default as ProductDescription } from './product/components/ProductDescription.liquid.js';
15
+ export { default as ProductDescription } from './product/components/ProductDescription/index.liquid.js';
16
16
  export { default as ProductImages } from './product/components/ProductImages.liquid.js';
17
17
  export { default as ProductImagesV2 } from './product/components/ProductImagesV2/liquid/ProductImages.liquid.js';
18
18
  export { default as ProductQuantity } from './product/components/ProductQuantity.liquid.js';
@@ -20,7 +20,7 @@ export { default as ProductVariants } from './product/components/ProductVariants
20
20
  export { default as ProductTag } from './product/components/ProductTag.liquid.js';
21
21
  export { default as ProductProperties } from './product/components/ProductProperties.liquid.js';
22
22
  export { default as ProductList } from './product/components/ProductList.liquid.js';
23
- export { default as DynamicCheckout } from './product/components/DynamicCheckout.liquid.js';
23
+ export { default as DynamicCheckout } from './product/components/DynamicCheckout/DynamicCheckout.liquid.js';
24
24
  export { default as ProductVendor } from './product/components/Vendor.liquid.js';
25
25
  export { default as ProductBundleDiscount } from './product/components/ProductBundleDiscount.liquid.js';
26
26
  export { default as ProductBundleDiscountItem } from './product/components/ProductBundleDiscountItem.liquid.js';
@@ -47,7 +47,7 @@ export { default as TabItem } from './tab/components/TabItem.liquid.js';
47
47
  export { default as HeroBanner } from './banner/components/HeroBanner.liquid.js';
48
48
  export { default as CSSCode } from './code/components/CSSCode.liquid.js';
49
49
  export { default as StockCounter } from './stock-counter/components/StockCounter.liquid.js';
50
- export { default as ShopPayButton } from './cart/components/ShopPayButton/index.liquid.js';
50
+ export { default as ShopPayButton } from './cart/components/ShopPayButton/ShopPayButton.liquid.js';
51
51
  export { default as Newsletter } from './form/components/newsletter/Newsletter.liquid.js';
52
52
  export { default as ContactForm } from './form/components/contact/Contact.liquid.js';
53
53
  export { default as FormEmail } from './form/components/form-email/FormEmail.liquid.js';
@@ -68,7 +68,7 @@ const renderChildImageTemplate = (imgSrc)=>({
68
68
  height: 110
69
69
  }
70
70
  },
71
- isAdaptive: false,
71
+ isAdaptive: true,
72
72
  isNotLazyload: true
73
73
  }
74
74
  }
@@ -11,7 +11,7 @@ const getClasses = (uid, align)=>{
11
11
  };
12
12
  };
13
13
  const getContainerClasses = ()=>{
14
- const classList = 'gp-inline-flex gp-flex-col';
14
+ const classList = 'gp-inline-flex gp-flex-col gp-w-full';
15
15
  return composeClasses(classList);
16
16
  };
17
17
 
@@ -22,7 +22,8 @@ const ConfigPreset = [
22
22
  settings: {
23
23
  childItem: [
24
24
  'Item 1',
25
- 'Item 2'
25
+ 'Item 2',
26
+ 'Item 3'
26
27
  ]
27
28
  },
28
29
  advanced: {
@@ -30,6 +31,7 @@ const ConfigPreset = [
30
31
  inlinePadding: 'none'
31
32
  },
32
33
  childrens: [
34
+ ChildTemplate,
33
35
  ChildTemplate,
34
36
  ChildTemplate
35
37
  ]
@@ -10,8 +10,9 @@ const ConfigSettings = [
10
10
  label: 'Item management',
11
11
  type: 'child-item',
12
12
  default: [
13
+ 'Item 1',
13
14
  'Item 2',
14
- 'Item 2'
15
+ 'Item 3'
15
16
  ],
16
17
  childTemplate: ChildTemplate
17
18
  }
@@ -34,14 +34,16 @@ const ChildTemplate = {
34
34
  label: 'Image',
35
35
  styles: {
36
36
  width: {
37
- desktop: '100px'
37
+ desktop: '32px'
38
38
  },
39
+ aspectRatio: '1',
40
+ align: 'left',
39
41
  enableBorder: 'none'
40
42
  },
41
43
  settings: {
42
44
  srcSet: {
43
45
  desktop: {
44
- src: 'https://ucarecdn.com/ee6d5074-1640-4cc7-8933-47c8589c3dee/-/format/auto/'
46
+ src: 'https://cdn.shopify.com/s/files/1/0791/2780/6265/files/gempages_468220687216018311-d69940af-f03e-4864-a612-63cd9a4dce36.png'
45
47
  }
46
48
  }
47
49
  }
@@ -59,7 +61,7 @@ const ChildTemplate = {
59
61
  text: 'Your custom text goes here'
60
62
  },
61
63
  advanced: {
62
- blockPadding: 'base'
64
+ blockPadding: 'extraTight'
63
65
  },
64
66
  styles: {
65
67
  typo: {
@@ -67,6 +69,9 @@ const ChildTemplate = {
67
69
  textColor: 'default',
68
70
  fontWeight: 'normal',
69
71
  textTransform: 'none'
72
+ },
73
+ width: {
74
+ desktop: '100%'
70
75
  }
71
76
  }
72
77
  }
@@ -76,13 +76,6 @@ const CalloutTextSettings = [
76
76
  type: 'text',
77
77
  tooltip: 'Align right',
78
78
  iconName: 'polaris-text-align-right'
79
- },
80
- {
81
- label: 'Justify',
82
- value: 'justify',
83
- type: 'text',
84
- tooltip: 'Align justify',
85
- iconName: 'gp-text-align-justify'
86
79
  }
87
80
  ],
88
81
  default: 'left'
@@ -90,7 +90,7 @@ const SettingUIV2 = [
90
90
  {
91
91
  type: 'control',
92
92
  label: {
93
- en: 'Text align'
93
+ en: 'Align'
94
94
  },
95
95
  setting: {
96
96
  id: 'textAlign'
@@ -88,7 +88,7 @@ const config = {
88
88
  hideUnit: false,
89
89
  devices: {
90
90
  desktop: {
91
- default: undefined
91
+ default: '500px'
92
92
  }
93
93
  },
94
94
  displayOptions: [
@@ -144,7 +144,7 @@ const config = {
144
144
  tooltip: 'Align right'
145
145
  }
146
146
  ],
147
- default: 'center'
147
+ default: 'left'
148
148
  },
149
149
  {
150
150
  id: 'enableBorder',
@@ -41,39 +41,51 @@ const ImagePostPurchaseSettingV2 = [
41
41
  type: 'select',
42
42
  default: 'auto',
43
43
  options: [
44
- {
45
- label: 'Original',
46
- value: 'auto'
47
- },
48
44
  {
49
45
  label: 'Square',
50
46
  value: '1',
51
47
  type: 'image-shape',
52
- icon: 'image-shape-square'
48
+ icon: 'gp-image-shape-square'
53
49
  },
54
50
  {
55
51
  label: 'Vertical',
56
52
  value: '3/4',
57
53
  type: 'image-shape',
58
- icon: 'image-shape-vertical'
54
+ icon: 'gp-image-shape-vertical'
59
55
  },
60
56
  {
61
57
  label: 'Horizontal',
62
58
  value: '4/3',
63
59
  type: 'image-shape',
64
- icon: 'image-shape-horizontal'
60
+ icon: 'gp-image-shape-horizontal'
61
+ },
62
+ {
63
+ label: 'Original',
64
+ value: 'auto'
65
65
  }
66
66
  ]
67
67
  },
68
68
  {
69
69
  id: 'width',
70
- type: 'input:unit',
70
+ type: 'dropdown:input',
71
71
  label: 'Width',
72
- min: 0,
72
+ inputType: 'number',
73
73
  units: [
74
74
  'px',
75
75
  '%'
76
76
  ],
77
+ displayOptions: [
78
+ {
79
+ label: 'Full',
80
+ value: '100%',
81
+ showValue: true
82
+ },
83
+ {
84
+ label: 'Default',
85
+ value: '1200px',
86
+ showValue: true
87
+ }
88
+ ],
77
89
  devices: {
78
90
  desktop: {
79
91
  default: '500px'
@@ -128,21 +140,21 @@ const ImagePostPurchaseSettingV2 = [
128
140
  iconName: 'gp-align-right'
129
141
  }
130
142
  ],
131
- default: 'center'
143
+ default: 'left'
132
144
  },
133
145
  {
134
146
  id: 'enableBorder',
135
- type: 'option:value',
147
+ type: 'segment',
136
148
  default: 'none',
137
149
  options: [
138
150
  {
139
- label: 'None',
140
151
  value: 'none',
152
+ iconName: 'gp-cursor-none',
141
153
  type: 'border'
142
154
  },
143
155
  {
144
- label: 'Solid',
145
156
  value: 'solid',
157
+ iconName: 'gp-line',
146
158
  type: 'border'
147
159
  }
148
160
  ]
@@ -68,7 +68,7 @@ const SettingUIV2 = [
68
68
  },
69
69
  options: {
70
70
  labelVariant: 'primary',
71
- disableMessage: `Align is not supported when width is 100%`
71
+ disableMessage: 'Horizontal alignment is disabled when the width is set to 100% or greater'
72
72
  }
73
73
  }
74
74
  ]
@@ -34,14 +34,19 @@ const PostPurchaseLinkSettings = [
34
34
  },
35
35
  displayOptions: [
36
36
  {
37
- label: 'Full',
38
- value: '100%',
37
+ label: 'Fit content',
38
+ value: 'Auto',
39
39
  showValue: true
40
40
  },
41
41
  {
42
42
  label: 'Default',
43
43
  value: '1200px',
44
44
  showValue: true
45
+ },
46
+ {
47
+ label: 'Full',
48
+ value: '100%',
49
+ showValue: true
45
50
  }
46
51
  ]
47
52
  }
@@ -146,7 +146,6 @@ const ProductVariantsSettingUIV2 = [
146
146
  ]
147
147
  },
148
148
  {
149
- conditionDisplay: "width !== '100%'",
150
149
  controls: [
151
150
  {
152
151
  label: {
@@ -155,8 +154,11 @@ const ProductVariantsSettingUIV2 = [
155
154
  setting: {
156
155
  id: 'align'
157
156
  },
157
+ conditionEnable: '!(parseInt(width) == 100 && width?.includes("%"))',
158
158
  options: {
159
- labelVariant: 'primary'
159
+ labelVariant: 'primary',
160
+ fullWidth: true,
161
+ disableMessage: `Horizontal alignment is disabled when the width is set to 100% or greater`
160
162
  }
161
163
  }
162
164
  ]
@@ -0,0 +1,24 @@
1
+ 'use client';
2
+ import { jsx } from 'react/jsx-runtime';
3
+ import Button from '../../../button/components/v2/ButtonV2.js';
4
+ import '@gem-sdk/core';
5
+ import 'next/link';
6
+ import 'react';
7
+
8
+ const DynamicCheckout = ({ builderProps, builderAttrs, style, styles, advanced, setting })=>{
9
+ const { ...buttonStyles } = styles ?? {};
10
+ const label = setting?.label || 'Buy it now';
11
+ return /*#__PURE__*/ jsx(Button, {
12
+ builderProps: builderProps,
13
+ builderAttrs: builderAttrs,
14
+ advanced: advanced,
15
+ setting: {
16
+ label: label,
17
+ htmlType: 'button'
18
+ },
19
+ style: style,
20
+ styles: buttonStyles
21
+ });
22
+ };
23
+
24
+ export { DynamicCheckout as default };
@@ -0,0 +1,19 @@
1
+ import Button from './components/Button.liquid.js';
2
+
3
+ const DynamicCheckout = ({ builderProps, styles, advanced, setting, pageContext })=>{
4
+ const { ...buttonStyles } = styles ?? {};
5
+ const label = setting?.label || 'Buy it now';
6
+ return Button({
7
+ builderProps,
8
+ className: '',
9
+ advanced,
10
+ setting: {
11
+ label: label,
12
+ htmlType: 'button'
13
+ },
14
+ styles: buttonStyles,
15
+ pageContext
16
+ });
17
+ };
18
+
19
+ export { DynamicCheckout as default };
@@ -0,0 +1,30 @@
1
+ import { getGlobalColorStateClassDynamicBtn, genTypoClass, genSizeClass } from '@gem-sdk/core';
2
+
3
+ const getBaseClasses = (uid)=>({
4
+ 'gp-block': true,
5
+ [`wrap__button--unbranded__${uid}`]: true,
6
+ [String.raw`[&_.shopify-payment-button\_\_button--unbranded]:gp-min-h-fit`]: true,
7
+ [String.raw`disabled:[&_.shopify-payment-button\_\_button--unbranded]:gp-pointer-events-none`]: true
8
+ });
9
+ const getTypographyClass = (typoType)=>{
10
+ if (!typoType) return {};
11
+ return {
12
+ [String.raw`[&_.shopify-payment-button\_\_button--unbranded]:!${genTypoClass(typoType)}`]: true
13
+ };
14
+ };
15
+ const getSpacingClass = (spacingType)=>{
16
+ if (!spacingType) return {};
17
+ return {
18
+ [String.raw`[&_.shopify-payment-button\_\_button--unbranded]:!${genSizeClass(spacingType)}`]: true
19
+ };
20
+ };
21
+ const getButtonClasses = ({ uid = '', styles })=>{
22
+ return {
23
+ ...getBaseClasses(uid),
24
+ ...getTypographyClass(styles?.typo?.type),
25
+ ...getSpacingClass(styles?.btnSpacing?.type),
26
+ [getGlobalColorStateClassDynamicBtn('text', styles?.textColor)]: true
27
+ };
28
+ };
29
+
30
+ export { getButtonClasses };