@gem-sdk/components 2.1.13-staging.0 → 2.1.13-staging.10

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 (144) hide show
  1. package/dist/cjs/article/components/ArticleList.liquid.js +6 -2
  2. package/dist/cjs/banner/components/hero-banner/index.liquid.js +12 -10
  3. package/dist/cjs/builder.js +21 -1
  4. package/dist/cjs/common/const.js +1 -1
  5. package/dist/cjs/image/components/AdaptiveImage.liquid.js +6 -5
  6. package/dist/cjs/image/components/Image.js +22 -3
  7. package/dist/cjs/image/components/Image.liquid.js +6 -5
  8. package/dist/cjs/image/components/NextImage.liquid.js +4 -3
  9. package/dist/cjs/image/components/NoDataImage.js +133 -0
  10. package/dist/cjs/image-comparison/components/CompareImage.liquid.js +7 -3
  11. package/dist/cjs/index.js +20 -0
  12. package/dist/cjs/index.liquid.js +22 -2
  13. package/dist/cjs/post-purchase/product/components/ProductDiscountTag.js +5 -2
  14. package/dist/cjs/post-purchase/product/components/ProductOffer.js +16 -3
  15. package/dist/cjs/post-purchase/product/components/ProductPrice.js +3 -1
  16. package/dist/cjs/post-purchase/product/components/ProductPriceBreakdown.js +9 -21
  17. package/dist/cjs/post-purchase/product/constants/ProductOfferPlaceholder.js +127 -0
  18. package/dist/cjs/post-purchase/product/hooks/useDynamicProduct.js +28 -0
  19. package/dist/cjs/post-purchase/product/settings/ProductOffer.js +26 -0
  20. package/dist/cjs/product/components/ProductImagesV2/liquid/ProductFeaturedImageCarousel.liquid.js +4 -4
  21. package/dist/cjs/product/components/ProductImagesV2/liquid/ProductGalleryCarousel.liquid.js +2 -2
  22. package/dist/cjs/product/components/ProductImagesV2/liquid/ProductGalleryGrid.liquid.js +4 -4
  23. package/dist/cjs/product/components/ProductImagesV2/liquid/ProductImages.liquid.js +4 -4
  24. package/dist/cjs/tab/hooks/useTabInteraction.js +13 -9
  25. package/dist/cjs/text/components/Text.js +0 -1
  26. package/dist/cjs/third-party/components/AlsoBoughtCbb.js +32 -0
  27. package/dist/cjs/third-party/components/AlsoBoughtCbb.liquid.js +21 -0
  28. package/dist/cjs/third-party/components/BfSizeChartSizeGuide.js +32 -0
  29. package/dist/cjs/third-party/components/BfSizeChartSizeGuide.liquid.js +12 -0
  30. package/dist/cjs/third-party/components/EssentialAnnouncementBar.js +32 -0
  31. package/dist/cjs/third-party/components/EssentialAnnouncementBar.liquid.js +12 -0
  32. package/dist/cjs/third-party/components/EssentialCountdownTimerBar.js +32 -0
  33. package/dist/cjs/third-party/components/EssentialCountdownTimerBar.liquid.js +12 -0
  34. package/dist/cjs/third-party/components/EstimatedDeliveryDatePlus.js +32 -0
  35. package/dist/cjs/third-party/components/EstimatedDeliveryDatePlus.liquid.js +12 -0
  36. package/dist/cjs/third-party/components/GloColorSwatchvariantImage.js +32 -0
  37. package/dist/cjs/third-party/components/GloColorSwatchvariantImage.liquid.js +12 -0
  38. package/dist/cjs/third-party/components/HextomFreeShippingBar.js +32 -0
  39. package/dist/cjs/third-party/components/HextomFreeShippingBar.liquid.js +12 -0
  40. package/dist/cjs/third-party/components/OkendoReviewsLoyalty.js +32 -0
  41. package/dist/cjs/third-party/components/OkendoReviewsLoyalty.liquid.js +12 -0
  42. package/dist/cjs/third-party/components/StellarDeliveryDatePickup.js +32 -0
  43. package/dist/cjs/third-party/components/StellarDeliveryDatePickup.liquid.js +21 -0
  44. package/dist/cjs/third-party/components/TrustedsiteTrustBadges.js +32 -0
  45. package/dist/cjs/third-party/components/TrustedsiteTrustBadges.liquid.js +12 -0
  46. package/dist/cjs/third-party/configs/AlsoBoughtCbb.js +12 -0
  47. package/dist/cjs/third-party/configs/BfSizeChartSizeGuide.js +12 -0
  48. package/dist/cjs/third-party/configs/EssentialAnnouncementBar.js +12 -0
  49. package/dist/cjs/third-party/configs/EssentialCountdownTimerBar.js +12 -0
  50. package/dist/cjs/third-party/configs/EstimatedDeliveryDatePlus.js +12 -0
  51. package/dist/cjs/third-party/configs/GloColorSwatchvariantImage.js +12 -0
  52. package/dist/cjs/third-party/configs/HextomFreeShippingBar.js +12 -0
  53. package/dist/cjs/third-party/configs/OkendoReviewsLoyalty.js +12 -0
  54. package/dist/cjs/third-party/configs/StellarDeliveryDatePickup.js +12 -0
  55. package/dist/cjs/third-party/configs/TrustedsiteTrustBadges.js +12 -0
  56. package/dist/cjs/third-party/helpers/thirdParty.js +1 -1
  57. package/dist/cjs/third-party/next.js +51 -1
  58. package/dist/cjs/third-party/setting/AlsoBoughtCbb.js +127 -0
  59. package/dist/cjs/third-party/setting/BfSizeChartSizeGuide.js +131 -0
  60. package/dist/cjs/third-party/setting/EssentialAnnouncementBar.js +142 -0
  61. package/dist/cjs/third-party/setting/EssentialCountdownTimerBar.js +142 -0
  62. package/dist/cjs/third-party/setting/EstimatedDeliveryDatePlus.js +128 -0
  63. package/dist/cjs/third-party/setting/GloColorSwatchvariantImage.js +152 -0
  64. package/dist/cjs/third-party/setting/HextomFreeShippingBar.js +128 -0
  65. package/dist/cjs/third-party/setting/OkendoReviewsLoyalty.js +171 -0
  66. package/dist/cjs/third-party/setting/StellarDeliveryDatePickup.js +127 -0
  67. package/dist/cjs/third-party/setting/TrustedsiteTrustBadges.js +177 -0
  68. package/dist/cjs/third-party/setting/index.js +21 -1
  69. package/dist/cjs/video/components/HTML5Embed.js +2 -2
  70. package/dist/cjs/video/components/HTML5Embed.liquid.js +6 -3
  71. package/dist/cjs/video/components/LiteYouTubeEmbed.liquid.js +4 -2
  72. package/dist/esm/article/components/ArticleList.liquid.js +6 -2
  73. package/dist/esm/banner/components/hero-banner/index.liquid.js +12 -10
  74. package/dist/esm/builder.js +21 -1
  75. package/dist/esm/common/const.js +1 -1
  76. package/dist/esm/image/components/AdaptiveImage.liquid.js +6 -5
  77. package/dist/esm/image/components/Image.js +23 -4
  78. package/dist/esm/image/components/Image.liquid.js +6 -5
  79. package/dist/esm/image/components/NextImage.liquid.js +4 -3
  80. package/dist/esm/image/components/NoDataImage.js +129 -0
  81. package/dist/esm/image-comparison/components/CompareImage.liquid.js +7 -3
  82. package/dist/esm/index.js +10 -0
  83. package/dist/esm/index.liquid.js +11 -1
  84. package/dist/esm/post-purchase/product/components/ProductDiscountTag.js +5 -2
  85. package/dist/esm/post-purchase/product/components/ProductOffer.js +16 -3
  86. package/dist/esm/post-purchase/product/components/ProductPrice.js +3 -1
  87. package/dist/esm/post-purchase/product/components/ProductPriceBreakdown.js +9 -21
  88. package/dist/esm/post-purchase/product/constants/ProductOfferPlaceholder.js +125 -0
  89. package/dist/esm/post-purchase/product/hooks/useDynamicProduct.js +26 -0
  90. package/dist/esm/post-purchase/product/settings/ProductOffer.js +26 -0
  91. package/dist/esm/product/components/ProductImagesV2/liquid/ProductFeaturedImageCarousel.liquid.js +4 -4
  92. package/dist/esm/product/components/ProductImagesV2/liquid/ProductGalleryCarousel.liquid.js +2 -2
  93. package/dist/esm/product/components/ProductImagesV2/liquid/ProductGalleryGrid.liquid.js +4 -4
  94. package/dist/esm/product/components/ProductImagesV2/liquid/ProductImages.liquid.js +4 -4
  95. package/dist/esm/tab/hooks/useTabInteraction.js +14 -10
  96. package/dist/esm/text/components/Text.js +0 -1
  97. package/dist/esm/third-party/components/AlsoBoughtCbb.js +28 -0
  98. package/dist/esm/third-party/components/AlsoBoughtCbb.liquid.js +17 -0
  99. package/dist/esm/third-party/components/BfSizeChartSizeGuide.js +28 -0
  100. package/dist/esm/third-party/components/BfSizeChartSizeGuide.liquid.js +8 -0
  101. package/dist/esm/third-party/components/EssentialAnnouncementBar.js +28 -0
  102. package/dist/esm/third-party/components/EssentialAnnouncementBar.liquid.js +8 -0
  103. package/dist/esm/third-party/components/EssentialCountdownTimerBar.js +28 -0
  104. package/dist/esm/third-party/components/EssentialCountdownTimerBar.liquid.js +8 -0
  105. package/dist/esm/third-party/components/EstimatedDeliveryDatePlus.js +28 -0
  106. package/dist/esm/third-party/components/EstimatedDeliveryDatePlus.liquid.js +8 -0
  107. package/dist/esm/third-party/components/GloColorSwatchvariantImage.js +28 -0
  108. package/dist/esm/third-party/components/GloColorSwatchvariantImage.liquid.js +8 -0
  109. package/dist/esm/third-party/components/HextomFreeShippingBar.js +28 -0
  110. package/dist/esm/third-party/components/HextomFreeShippingBar.liquid.js +8 -0
  111. package/dist/esm/third-party/components/OkendoReviewsLoyalty.js +28 -0
  112. package/dist/esm/third-party/components/OkendoReviewsLoyalty.liquid.js +8 -0
  113. package/dist/esm/third-party/components/StellarDeliveryDatePickup.js +28 -0
  114. package/dist/esm/third-party/components/StellarDeliveryDatePickup.liquid.js +17 -0
  115. package/dist/esm/third-party/components/TrustedsiteTrustBadges.js +28 -0
  116. package/dist/esm/third-party/components/TrustedsiteTrustBadges.liquid.js +8 -0
  117. package/dist/esm/third-party/configs/AlsoBoughtCbb.js +8 -0
  118. package/dist/esm/third-party/configs/BfSizeChartSizeGuide.js +8 -0
  119. package/dist/esm/third-party/configs/EssentialAnnouncementBar.js +8 -0
  120. package/dist/esm/third-party/configs/EssentialCountdownTimerBar.js +8 -0
  121. package/dist/esm/third-party/configs/EstimatedDeliveryDatePlus.js +8 -0
  122. package/dist/esm/third-party/configs/GloColorSwatchvariantImage.js +8 -0
  123. package/dist/esm/third-party/configs/HextomFreeShippingBar.js +8 -0
  124. package/dist/esm/third-party/configs/OkendoReviewsLoyalty.js +8 -0
  125. package/dist/esm/third-party/configs/StellarDeliveryDatePickup.js +8 -0
  126. package/dist/esm/third-party/configs/TrustedsiteTrustBadges.js +8 -0
  127. package/dist/esm/third-party/helpers/thirdParty.js +1 -1
  128. package/dist/esm/third-party/next.js +51 -1
  129. package/dist/esm/third-party/setting/AlsoBoughtCbb.js +123 -0
  130. package/dist/esm/third-party/setting/BfSizeChartSizeGuide.js +127 -0
  131. package/dist/esm/third-party/setting/EssentialAnnouncementBar.js +138 -0
  132. package/dist/esm/third-party/setting/EssentialCountdownTimerBar.js +138 -0
  133. package/dist/esm/third-party/setting/EstimatedDeliveryDatePlus.js +124 -0
  134. package/dist/esm/third-party/setting/GloColorSwatchvariantImage.js +148 -0
  135. package/dist/esm/third-party/setting/HextomFreeShippingBar.js +124 -0
  136. package/dist/esm/third-party/setting/OkendoReviewsLoyalty.js +167 -0
  137. package/dist/esm/third-party/setting/StellarDeliveryDatePickup.js +123 -0
  138. package/dist/esm/third-party/setting/TrustedsiteTrustBadges.js +173 -0
  139. package/dist/esm/third-party/setting/index.js +224 -204
  140. package/dist/esm/video/components/HTML5Embed.js +2 -2
  141. package/dist/esm/video/components/HTML5Embed.liquid.js +6 -3
  142. package/dist/esm/video/components/LiteYouTubeEmbed.liquid.js +4 -2
  143. package/dist/types/index.d.ts +172 -7
  144. package/package.json +2 -2
@@ -7,14 +7,20 @@ import Loading from '../../../common/components/Loading.js';
7
7
  import { DEVICES } from './ProductVariant.js';
8
8
  import { postPurchaseViewSpacing } from '../../utils/helper.js';
9
9
  import { hasPublicStoreFrontData, createStoreFrontFetcher } from '../helpers/index.js';
10
+ import { productOfferPlaceholder } from '../constants/ProductOfferPlaceholder.js';
11
+ import { useDynamicProduct } from '../hooks/useDynamicProduct.js';
10
12
 
11
13
  const PostPurchaseProductOffer = ({ styles, builderAttrs, builderProps, children, setting })=>{
12
14
  const mode = useEditorMode();
13
- const { productSetting, productOfferLayout, inlineAlignment, ...rowSetting } = setting || {};
15
+ const { productSetting, productOfferLayout, inlineAlignment, discountAndShippingFee, ...rowSetting } = setting || {};
14
16
  const { productOfferColumnGap, productOfferVerticalGutter, productOfferWidth, ...rowStyles } = styles || {};
15
17
  const productOffers = usePageStore((s)=>s.productOffers);
16
18
  const publicStoreFrontData = usePageStore((s)=>s.publicStoreFrontData);
17
- const totalProduct = useMemo(()=>productOffers?.length, [
19
+ const { isDynamicProduct } = useDynamicProduct();
20
+ const dynamicDiscountOffer = usePageStore((s)=>s.dynamicDiscountOffer);
21
+ const totalProduct = useMemo(()=>isDynamicProduct ? dynamicDiscountOffer?.appliedProductCount : productOffers?.length, [
22
+ dynamicDiscountOffer?.appliedProductCount,
23
+ isDynamicProduct,
18
24
  productOffers?.length
19
25
  ]);
20
26
  const sortedProductBaseIDs = useMemo(()=>{
@@ -40,7 +46,14 @@ const PostPurchaseProductOffer = ({ styles, builderAttrs, builderProps, children
40
46
  const products = useMemo(()=>flattenConnection(productData.data?.products), [
41
47
  productData.data?.products
42
48
  ]);
43
- const productSortedById = sortedProductBaseIDs?.map((id)=>products?.find((el)=>el?.baseID === id)).filter(Boolean);
49
+ const productSortedById = useMemo(()=>{
50
+ return isDynamicProduct && dynamicDiscountOffer?.appliedProductCount ? Array(dynamicDiscountOffer.appliedProductCount).fill(productOfferPlaceholder) : sortedProductBaseIDs?.map((id)=>products?.find((el)=>el?.baseID === id)).filter(Boolean);
51
+ }, [
52
+ isDynamicProduct,
53
+ dynamicDiscountOffer?.appliedProductCount,
54
+ sortedProductBaseIDs,
55
+ products
56
+ ]);
44
57
  const getStyles = ()=>{
45
58
  return {
46
59
  ...makeStyleResponsive('cg', productOfferColumnGap),
@@ -2,6 +2,7 @@ import { jsxs, jsx } from 'react/jsx-runtime';
2
2
  import { useCurrentVariant, useProduct, shopifyPriceRounding, useProductOfferDiscount, useFormatMoney, cls } from '@gem-sdk/core';
3
3
  import { useMemo } from 'react';
4
4
  import Text from '../../text/Text.js';
5
+ import { useDynamicProduct } from '../hooks/useDynamicProduct.js';
5
6
 
6
7
  const PostPurchaseProductPrice = ({ styles, style, builderAttrs, builderProps, children })=>{
7
8
  const currentVariant = useCurrentVariant();
@@ -9,6 +10,7 @@ const PostPurchaseProductPrice = ({ styles, style, builderAttrs, builderProps, c
9
10
  const price = currentVariant?.price ?? 0;
10
11
  const salePrice = currentVariant?.salePrice ?? 0;
11
12
  const discount = parseFloat(shopifyPriceRounding(useProductOfferDiscount(), 2));
13
+ const { isDynamicProduct } = useDynamicProduct();
12
14
  const priceShow = useMemo(()=>{
13
15
  if (!discount) {
14
16
  if (styles?.priceType === 'compare') {
@@ -49,7 +51,7 @@ const PostPurchaseProductPrice = ({ styles, style, builderAttrs, builderProps, c
49
51
  /*#__PURE__*/ jsx(Text, {
50
52
  styles: styles,
51
53
  setting: {
52
- text: moneyFormatted
54
+ text: isDynamicProduct ? '$???' : moneyFormatted
53
55
  },
54
56
  className: cls({
55
57
  'gp-money': styles?.priceType === 'regular',
@@ -3,6 +3,7 @@ import { useCurrentVariant, useProduct, useQuantity, useProductOfferDiscount, us
3
3
  import { useMemo, useState, useEffect, Fragment as Fragment$1 } from 'react';
4
4
  import { postPurchaseSpacing } from '../../utils/helper.js';
5
5
  import MoneyLine from './priceBreakdown/MoneyLine.js';
6
+ import { useDynamicProduct } from '../hooks/useDynamicProduct.js';
6
7
 
7
8
  const PostPurchaseProductPriceBreakdown = ({ setting = {}, styles = {}, style, builderAttrs, builderProps, children })=>{
8
9
  const currentVariant = useCurrentVariant();
@@ -17,6 +18,7 @@ const PostPurchaseProductPriceBreakdown = ({ setting = {}, styles = {}, style, b
17
18
  const discountShopifyFormat = shopifyPriceRounding(discountWithQuantity, 2);
18
19
  const totalMoneyFormatted = useFormatMoney(subTotal - parseFloat(discountShopifyFormat), false);
19
20
  const currentProductId = currentProduct?.baseID?.replace('gid://shopify/Product/', '');
21
+ const { isDynamicProduct, dynamicPrice, dynamicDiscount, isEnableDynamicDiscount } = useDynamicProduct();
20
22
  const { labelStyle, moneyStyle, spacing, width, align, isShowPrice } = styles;
21
23
  const itemGap = useMemo(()=>{
22
24
  return postPurchaseSpacing[spacing || 'none'];
@@ -29,19 +31,19 @@ const PostPurchaseProductPriceBreakdown = ({ setting = {}, styles = {}, style, b
29
31
  }, [
30
32
  isShowPrice
31
33
  ]);
32
- const moneyLines = useMemo(()=>{
34
+ const getMoneyLines = ()=>{
33
35
  const data = [];
34
36
  if (styles.isShowSubTotalLabel !== false) {
35
37
  data.push({
36
38
  title: setting.subTotalLabel,
37
- money: subTotalMoneyFormatted,
39
+ money: isDynamicProduct ? dynamicPrice : subTotalMoneyFormatted,
38
40
  uniqueId: 'subTotalLabel'
39
41
  });
40
42
  }
41
43
  if (styles.isShowDiscountLabel !== false) {
42
44
  data.push({
43
45
  title: setting.discountLabel,
44
- money: discount > 0 ? discountMoneyFormatted : 'No discount',
46
+ money: isDynamicProduct && dynamicDiscount && isEnableDynamicDiscount ? dynamicPrice : discount > 0 ? discountMoneyFormatted : 'No discount',
45
47
  uniqueId: 'discountLabel'
46
48
  });
47
49
  }
@@ -67,25 +69,11 @@ const PostPurchaseProductPriceBreakdown = ({ setting = {}, styles = {}, style, b
67
69
  }
68
70
  data.push({
69
71
  title: setting.totalLabel,
70
- money: totalMoneyFormatted,
72
+ money: isDynamicProduct ? dynamicPrice : totalMoneyFormatted,
71
73
  uniqueId: 'totalLabel'
72
74
  });
73
75
  return data;
74
- }, [
75
- discount,
76
- discountMoneyFormatted,
77
- setting.discountLabel,
78
- setting.shippingLabel,
79
- setting.subTotalLabel,
80
- setting.taxesLabel,
81
- setting.totalLabel,
82
- styles.isShowSubTotalLabel,
83
- styles.isShowDiscountLabel,
84
- styles.isShowShippingLabel,
85
- styles.isShowTaxesLabel,
86
- subTotalMoneyFormatted,
87
- totalMoneyFormatted
88
- ]);
76
+ };
89
77
  return /*#__PURE__*/ jsxs(Fragment, {
90
78
  children: [
91
79
  /*#__PURE__*/ jsxs("div", {
@@ -136,9 +124,9 @@ const PostPurchaseProductPriceBreakdown = ({ setting = {}, styles = {}, style, b
136
124
  ...makeStyleResponsive('w', width),
137
125
  gap: itemGap
138
126
  },
139
- children: moneyLines.map((item)=>/*#__PURE__*/ jsxs(Fragment$1, {
127
+ children: getMoneyLines().map((item)=>/*#__PURE__*/ jsxs(Fragment$1, {
140
128
  children: [
141
- item.uniqueId === 'totalLabel' && moneyLines.length > 1 && /*#__PURE__*/ jsx("hr", {}),
129
+ item.uniqueId === 'totalLabel' && getMoneyLines().length > 1 && /*#__PURE__*/ jsx("hr", {}),
142
130
  /*#__PURE__*/ jsx("div", {
143
131
  children: /*#__PURE__*/ jsx(MoneyLine, {
144
132
  uniqueId: item.uniqueId,
@@ -0,0 +1,125 @@
1
+ const productOfferPlaceholder = {
2
+ id: '',
3
+ title: 'Dynamic product',
4
+ description: 'This is a dynamic product. The actual product will appear here based on your setup',
5
+ descriptionHtml: '<p class="QN2lPu">This is a dynamic product. The actual product will</p>\n<p class="QN2lPu">appear here based on your setup</p>',
6
+ createdAt: '2024-07-01T04:19:51.286753Z',
7
+ handle: 'dynamic-product',
8
+ averageRating: 0,
9
+ isStorefront: true,
10
+ isSample: false,
11
+ baseID: '',
12
+ sku: '',
13
+ options: [
14
+ {
15
+ id: '1',
16
+ name: 'Variant',
17
+ optionType: '',
18
+ values: [
19
+ {
20
+ id: '1',
21
+ label: 'Variant option',
22
+ isDefault: true,
23
+ baseID: '1'
24
+ }
25
+ ]
26
+ }
27
+ ],
28
+ vendor: '',
29
+ featuredImage: {
30
+ id: '542178560626918105',
31
+ contentType: 'IMAGE',
32
+ previewImage: '',
33
+ src: 'https://cdn.shopify.com/s/files/1/0858/3168/0279/files/gempages_502328832959710176-312cf60c-d923-4913-9873-66545effe9cc.png',
34
+ width: 449,
35
+ height: 449,
36
+ alt: ''
37
+ },
38
+ collections: {
39
+ edges: [
40
+ {
41
+ node: {
42
+ id: '502321959132988135',
43
+ title: 'Home page'
44
+ }
45
+ },
46
+ {
47
+ node: {
48
+ id: '539286505089204764',
49
+ title: 'b'
50
+ }
51
+ },
52
+ {
53
+ node: {
54
+ id: '539286505089401372',
55
+ title: 'e'
56
+ }
57
+ }
58
+ ]
59
+ },
60
+ tags: [],
61
+ medias: {
62
+ edges: [
63
+ {
64
+ cursor: 'gqFpzweGNIc/AALZoXYB',
65
+ node: {
66
+ id: '542178560626918105',
67
+ contentType: 'IMAGE',
68
+ previewImage: '',
69
+ src: 'https://cdn.shopify.com/s/files/1/0858/3168/0279/files/gempages_502328832959710176-312cf60c-d923-4913-9873-66545effe9cc.png',
70
+ width: 449,
71
+ height: 449,
72
+ alt: ''
73
+ }
74
+ }
75
+ ],
76
+ pageInfo: {
77
+ endCursor: 'gqFpzweGNIc/AALZoXYB',
78
+ hasNextPage: true
79
+ }
80
+ },
81
+ variants: {
82
+ edges: [
83
+ {
84
+ cursor: 'gqFpzwc5ZqRtDAMIoXYC',
85
+ node: {
86
+ id: '520560088328176392',
87
+ title: 'Default Title',
88
+ barcode: '',
89
+ baseID: 'gid://shopify/ProductVariant/49298248925463',
90
+ costPrice: 88,
91
+ height: 0,
92
+ inventoryPolicy: 'DENY',
93
+ inventoryQuantity: 211,
94
+ inventoryStatus: '',
95
+ isDigital: true,
96
+ length: 0,
97
+ lowInventoryAmount: 0,
98
+ manageInventory: false,
99
+ mediaId: '0',
100
+ platform: 'SHOPIFY',
101
+ price: 88,
102
+ salePrice: 88,
103
+ sku: '',
104
+ soldIndividually: false,
105
+ weight: 0,
106
+ width: 0,
107
+ selectedOptions: [
108
+ {
109
+ name: 'Variant',
110
+ value: 'Variant option',
111
+ optionType: ''
112
+ }
113
+ ],
114
+ media: undefined
115
+ }
116
+ }
117
+ ],
118
+ pageInfo: {
119
+ hasNextPage: false,
120
+ endCursor: 'gaFpzwc5ZqRtDAMI'
121
+ }
122
+ }
123
+ };
124
+
125
+ export { productOfferPlaceholder };
@@ -0,0 +1,26 @@
1
+ import { usePageStore } from '@gem-sdk/core';
2
+ import { useMemo } from 'react';
3
+
4
+ const useDynamicProduct = ()=>{
5
+ const dynamicDiscountOffer = usePageStore((s)=>s.dynamicDiscountOffer);
6
+ const isDynamicProduct = useMemo(()=>{
7
+ return !!dynamicDiscountOffer;
8
+ }, [
9
+ dynamicDiscountOffer
10
+ ]);
11
+ // false = No discount
12
+ const isEnableDynamicDiscount = useMemo(()=>{
13
+ return dynamicDiscountOffer?.isEnabled;
14
+ }, [
15
+ dynamicDiscountOffer
16
+ ]);
17
+ const dynamicPrice = '$???';
18
+ return {
19
+ isDynamicProduct,
20
+ dynamicPrice,
21
+ dynamicDiscount: dynamicDiscountOffer,
22
+ isEnableDynamicDiscount
23
+ };
24
+ };
25
+
26
+ export { useDynamicProduct };
@@ -180,6 +180,14 @@ const config = {
180
180
  }
181
181
  }
182
182
  },
183
+ {
184
+ id: 'dynamicOfferQuantity',
185
+ type: 'dynamic-offer-quantity',
186
+ min: 1,
187
+ max: 4,
188
+ default: 2,
189
+ isOnlyAcceptInteger: true
190
+ },
183
191
  {
184
192
  id: 'discountAndShippingFee',
185
193
  type: 'discount-and-shipping-fee-product-offer',
@@ -373,6 +381,24 @@ const config = {
373
381
  },
374
382
  layout: 'vertical'
375
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
+ },
376
402
  {
377
403
  type: 'control',
378
404
  label: {
@@ -9,7 +9,7 @@ import NextImage from '../../../../image/components/NextImage.liquid.js';
9
9
  import Video from '../../../../image/components/Video.liquid.js';
10
10
  import { getStyleOfObject } from '../../../helpers/function.js';
11
11
 
12
- const ProductFeaturedImageCarousel = ({ builderPropUID, children, enableLazyloadImage, ...setting })=>{
12
+ const ProductFeaturedImageCarousel = ({ builderPropUID, children, enableLazyLoadImage, ...setting })=>{
13
13
  const ftAspectRatio = getAspectRatio(setting.ftShape);
14
14
  const getStyleFeaturedImageDisplay = ()=>{
15
15
  return getDisplayStyle((device)=>![
@@ -149,7 +149,7 @@ const ProductFeaturedImageCarousel = ({ builderPropUID, children, enableLazyload
149
149
  },
150
150
  priority: setting?.preload,
151
151
  className: `gp-w-full gp-h-full gp-absolute gp-top-0 gp-left-0 featured-image-only gp-cursor-pointer !gp-rounded-none ${className}`,
152
- enableLazyloadImage
152
+ enableLazyLoadImage
153
153
  })}`;
154
154
  };
155
155
  const renderNoImage = ()=>{
@@ -167,7 +167,7 @@ const ProductFeaturedImageCarousel = ({ builderPropUID, children, enableLazyload
167
167
  },
168
168
  priority: setting?.preload,
169
169
  className: `gp-w-full gp-h-full gp-absolute gp-top-0 gp-left-0 featured-image-only gp-cursor-pointer !gp-rounded-none`,
170
- enableLazyloadImage
170
+ enableLazyLoadImage
171
171
  })}`;
172
172
  };
173
173
  const getValueFromValueContainUnit = (value)=>{
@@ -394,7 +394,7 @@ const ProductFeaturedImageCarousel = ({ builderPropUID, children, enableLazyload
394
394
  },
395
395
  className: `gp-w-full featured-image-only !gp-rounded-none`,
396
396
  customLazyload: true,
397
- enableLazyloadImage
397
+ enableLazyLoadImage
398
398
  })}
399
399
  {%- endif -%}
400
400
  `
@@ -6,7 +6,7 @@ import { convertSpacing, getDisplayStyle, getAspectRatio, getSrcImage } from '..
6
6
  import { getShapeByLayout, getSettingMinWidthForCarouselItem, getSettingWidthForCarouselItem, getMinHeightByPosition, getSliderPerShowConfig, getAllowDotConfig, getDotStyleConfig, getCarouselVerticalConfigByPosition, checkDisplayGalleryByWidth, getZoomDisplay } from '../common/productGallery.js';
7
7
  import { getStyleOfObject } from '../../../helpers/function.js';
8
8
 
9
- const ProductGalleryCarousel = ({ builderPropUID, children, enableLazyloadImage, ...setting })=>{
9
+ const ProductGalleryCarousel = ({ builderPropUID, children, enableLazyLoadImage, ...setting })=>{
10
10
  const getCarouselDisplay = ()=>{
11
11
  const isDisplayCarousel = (type, position, device)=>{
12
12
  const layout = getResponsiveValueByScreen(position, device);
@@ -86,7 +86,7 @@ const ProductGalleryCarousel = ({ builderPropUID, children, enableLazyloadImage,
86
86
  customLazyload: true,
87
87
  style: style,
88
88
  className: '!gp-rounded-none gp-w-full gp-h-full gp-absolute gp-top-0 gp-left-0 gp-cursor-pointer',
89
- enableLazyloadImage
89
+ enableLazyLoadImage
90
90
  })}`;
91
91
  };
92
92
  const aspectRatioToPaddingBottom = ()=>{
@@ -8,7 +8,7 @@ import Model3d from '../../../../image/components/Modal3d.liquid.js';
8
8
  import Video from '../../../../image/components/Video.liquid.js';
9
9
  import HTML5Embed from '../../../../video/components/HTML5Embed.liquid.js';
10
10
 
11
- const ProductGalleryGrid = ({ builderPropUID, wrapperStyle, children, enableLazyloadImage, ...setting })=>{
11
+ const ProductGalleryGrid = ({ builderPropUID, wrapperStyle, children, enableLazyLoadImage, ...setting })=>{
12
12
  const getGridDisplay = ()=>{
13
13
  const isDisplayGrid = (type, position, device)=>{
14
14
  const layout = getResponsiveValueByScreen(position, device);
@@ -97,7 +97,7 @@ const ProductGalleryGrid = ({ builderPropUID, wrapperStyle, children, enableLazy
97
97
  style: style,
98
98
  className: '!gp-rounded-none',
99
99
  customLazyload: false,
100
- enableLazyloadImage
100
+ enableLazyLoadImage
101
101
  })}
102
102
  ${setting?.galleryHoverEffect !== 'none' ? `<div class="${cls('zoom-element !gp-max-w-none', getZoomImageClass())}">
103
103
  ${NextImage({
@@ -111,7 +111,7 @@ const ProductGalleryGrid = ({ builderPropUID, wrapperStyle, children, enableLazy
111
111
  style: style,
112
112
  className: '!gp-rounded-none gp-w-full gp-h-full',
113
113
  customLazyload: false,
114
- enableLazyloadImage
114
+ enableLazyLoadImage
115
115
  })}
116
116
  </div>` : ''}
117
117
  ${setting?.galleryHoverEffect == 'zoom' && setting?.galleryZoomType == 'glasses' ? `
@@ -294,7 +294,7 @@ const ProductGalleryGrid = ({ builderPropUID, wrapperStyle, children, enableLazy
294
294
  },
295
295
  className: '!gp-rounded-none',
296
296
  customLazyload: false,
297
- enableLazyloadImage
297
+ enableLazyLoadImage
298
298
  })}`;
299
299
  };
300
300
  return template`
@@ -7,7 +7,7 @@ import { getSettingPreloadData } from '../../../../helpers.js';
7
7
  import { getShapeByLayout, sizeSettingDefaultForNewLayout } from '../common/productGallery.js';
8
8
 
9
9
  const ProductImages = (productImageProps)=>{
10
- const { setting, styles, builderProps, style, advanced, rawChildren, pageContext, enableLazyloadImage } = productImageProps;
10
+ const { setting, styles, builderProps, style, advanced, rawChildren, pageContext, enableLazyLoadImage } = productImageProps;
11
11
  const settings = {
12
12
  ...setting,
13
13
  ...styles
@@ -112,7 +112,7 @@ const ProductImages = (productImageProps)=>{
112
112
  builderPropUID: `gp-carousel-${builderProps?.uid}`,
113
113
  ...settings,
114
114
  children: renderProductBadge(),
115
- enableLazyloadImage
115
+ enableLazyLoadImage
116
116
  })}
117
117
  ${shouldSkipLiquidRenderForSingleImage(settings?.position, template`
118
118
  <div
@@ -128,7 +128,7 @@ const ProductImages = (productImageProps)=>{
128
128
  ${ProductGalleryCarousel({
129
129
  builderPropUID: `gp-gallery-${builderProps?.uid}`,
130
130
  ...settings,
131
- enableLazyloadImage
131
+ enableLazyLoadImage
132
132
  })}
133
133
  </div>
134
134
  ${ProductGalleryGrid({
@@ -138,7 +138,7 @@ const ProductImages = (productImageProps)=>{
138
138
  },
139
139
  children: renderProductBadge(),
140
140
  ...settings,
141
- enableLazyloadImage
141
+ enableLazyLoadImage
142
142
  })}
143
143
  `)}
144
144
  </div>
@@ -1,20 +1,19 @@
1
1
  import { useInteraction, useEditorMode } from '@gem-sdk/core';
2
- import { useState, useEffect } from 'react';
2
+ import { useEffect } from 'react';
3
3
 
4
4
  const useTabInteraction = ({ activeKey, setActiveKey, activeTab, refContainer, componentUid })=>{
5
- const [previousTab, setPreviousTab] = useState(activeKey || 1);
6
- const { trigger, onListener, interactionListenerLoaded } = useInteraction();
5
+ const { trigger, onListener, interactionListenerLoaded, saveToElementInteractionData, findElementIncludingSelf } = useInteraction();
7
6
  const mode = useEditorMode();
8
7
  const changeOpenTabInteraction = (params)=>{
9
- const { data, isRollback } = params || {};
10
- if (data === undefined && isRollback === undefined) return;
8
+ const { data, isRollback, element, key } = params || {};
9
+ if (data === undefined && isRollback) return;
10
+ const newData = Number(data) + 1;
11
11
  if (isRollback) {
12
- setActiveKey(previousTab);
13
- setPreviousTab(activeTab);
12
+ setActiveKey(newData);
14
13
  return;
15
14
  }
16
- setPreviousTab(activeTab);
17
- setActiveKey(data + 1);
15
+ saveToElementInteractionData(element, key, String(activeKey));
16
+ setActiveKey(newData);
18
17
  };
19
18
  const dispatchEventTabActive = (index)=>{
20
19
  trigger({
@@ -35,11 +34,16 @@ const useTabInteraction = ({ activeKey, setActiveKey, activeTab, refContainer, c
35
34
  dispatchEventTabActive(activeTab - 1);
36
35
  });
37
36
  const selector = `[data-id="${componentUid}"]`;
37
+ const element = findElementIncludingSelf(document, selector);
38
38
  const removeListener = onListener({
39
39
  event: 'gp:change-open-tab',
40
40
  selector
41
41
  }, (params)=>{
42
- changeOpenTabInteraction(params);
42
+ changeOpenTabInteraction({
43
+ ...params,
44
+ element,
45
+ key: params?.uniqueStorageKey
46
+ });
43
47
  });
44
48
  return ()=>{
45
49
  removeListener?.();
@@ -5,7 +5,6 @@ import { forwardRef, useMemo } from 'react';
5
5
  const Text = /*#__PURE__*/ forwardRef(({ styles, builderAttrs, style, setting, advanced, builderProps, className, children, ...props }, ref)=>{
6
6
  const { text, htmlTag: Element = 'div', options, tagWidth, excludeFlex } = setting ?? {};
7
7
  const composeGlobalSize = makeGlobalSize(setting?.globalSize);
8
- console.log('Text: ', text);
9
8
  const mode = useEditorMode();
10
9
  const getPlaceHolderWhenContentNone = ()=>{
11
10
  let classList = '';
@@ -0,0 +1,28 @@
1
+ import { jsx, Fragment } from 'react/jsx-runtime';
2
+ import { makeStyleResponsive } from '@gem-sdk/core';
3
+ import ThirdPartyPreview from './ThirdPartyPreview.js';
4
+ import AppConfig from '../configs/AlsoBoughtCbb.js';
5
+
6
+ const AlsoBoughtCbbContent = ()=>{
7
+ return /*#__PURE__*/ jsx(Fragment, {
8
+ children: /*#__PURE__*/ jsx("div", {
9
+ className: "gp-p-2",
10
+ children: /*#__PURE__*/ jsx(ThirdPartyPreview, {
11
+ setting: {
12
+ label: 'Also Bought • CBB',
13
+ iconSvg: `<img class="gp-w-6 gp-border gp-border-[#494949] gp-rounded-[3px]" src="${AppConfig.logoUrl}">`
14
+ }
15
+ })
16
+ })
17
+ });
18
+ };
19
+ const AlsoBoughtCbb = ({ setting })=>{
20
+ return /*#__PURE__*/ jsx("div", {
21
+ style: {
22
+ ...makeStyleResponsive('ta', setting?.align)
23
+ },
24
+ children: /*#__PURE__*/ jsx(AlsoBoughtCbbContent, {})
25
+ });
26
+ };
27
+
28
+ export { AlsoBoughtCbb as default };
@@ -0,0 +1,17 @@
1
+ import { template, makeStyleResponsive } from '@gem-sdk/core';
2
+
3
+ const AlsoBoughtCbb = ({ setting, advanced })=>{
4
+ const { align } = setting ?? {};
5
+ return template`
6
+ <div
7
+ class="${advanced?.cssClass}"
8
+ style="${{
9
+ ...makeStyleResponsive('ta', align)
10
+ }}"
11
+ >
12
+ <div class="gp-integration-also-bought__position" />
13
+ </div>
14
+ `;
15
+ };
16
+
17
+ export { AlsoBoughtCbb as default };
@@ -0,0 +1,28 @@
1
+ import { jsx, Fragment } from 'react/jsx-runtime';
2
+ import { makeStyleResponsive } from '@gem-sdk/core';
3
+ import ThirdPartyPreview from './ThirdPartyPreview.js';
4
+ import AppConfig from '../configs/BfSizeChartSizeGuide.js';
5
+
6
+ const BfSizeChartSizeGuideContent = ()=>{
7
+ return /*#__PURE__*/ jsx(Fragment, {
8
+ children: /*#__PURE__*/ jsx("div", {
9
+ className: "gp-p-2",
10
+ children: /*#__PURE__*/ jsx(ThirdPartyPreview, {
11
+ setting: {
12
+ label: 'BF Size Chart & Size Guide',
13
+ iconSvg: `<img class="gp-w-6 gp-border gp-border-[#494949] gp-rounded-[3px]" src="${AppConfig.logoUrl}">`
14
+ }
15
+ })
16
+ })
17
+ });
18
+ };
19
+ const BfSizeChartSizeGuide = ({ setting })=>{
20
+ return /*#__PURE__*/ jsx("div", {
21
+ style: {
22
+ ...makeStyleResponsive('ta', setting?.align)
23
+ },
24
+ children: /*#__PURE__*/ jsx(BfSizeChartSizeGuideContent, {})
25
+ });
26
+ };
27
+
28
+ export { BfSizeChartSizeGuide as default };
@@ -0,0 +1,8 @@
1
+ import { getLiquidForAppBlock } from '../helpers/thirdParty.js';
2
+
3
+ const BfSizeChartSizeGuide = ({ setting, advanced })=>{
4
+ const { align, appBlockId } = setting ?? {};
5
+ return getLiquidForAppBlock(appBlockId, align, advanced?.cssClass);
6
+ };
7
+
8
+ export { BfSizeChartSizeGuide as default };
@@ -0,0 +1,28 @@
1
+ import { jsx, Fragment } from 'react/jsx-runtime';
2
+ import { makeStyleResponsive } from '@gem-sdk/core';
3
+ import ThirdPartyPreview from './ThirdPartyPreview.js';
4
+ import AppConfig from '../configs/EssentialAnnouncementBar.js';
5
+
6
+ const EssentialAnnouncementBarContent = ()=>{
7
+ return /*#__PURE__*/ jsx(Fragment, {
8
+ children: /*#__PURE__*/ jsx("div", {
9
+ className: "gp-p-2",
10
+ children: /*#__PURE__*/ jsx(ThirdPartyPreview, {
11
+ setting: {
12
+ label: 'Essential Announcement Bar',
13
+ iconSvg: `<img class="gp-w-6 gp-border gp-border-[#494949] gp-rounded-[3px]" src="${AppConfig.logoUrl}">`
14
+ }
15
+ })
16
+ })
17
+ });
18
+ };
19
+ const EssentialAnnouncementBar = ({ setting })=>{
20
+ return /*#__PURE__*/ jsx("div", {
21
+ style: {
22
+ ...makeStyleResponsive('ta', setting?.align)
23
+ },
24
+ children: /*#__PURE__*/ jsx(EssentialAnnouncementBarContent, {})
25
+ });
26
+ };
27
+
28
+ export { EssentialAnnouncementBar as default };
@@ -0,0 +1,8 @@
1
+ import { getLiquidForAppBlock } from '../helpers/thirdParty.js';
2
+
3
+ const EssentialAnnouncementBar = ({ setting, advanced })=>{
4
+ const { align, appBlockId } = setting ?? {};
5
+ return getLiquidForAppBlock(appBlockId, align, `${advanced?.cssClass ?? ''} !gp-block `);
6
+ };
7
+
8
+ export { EssentialAnnouncementBar as default };