@sentecacommerce-theme/lib 0.13.5-alpha.6 → 0.13.7-alpha.5

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 (158) hide show
  1. package/dist/cjs/analytics/addToCart.js +0 -1
  2. package/dist/cjs/analytics/initiateCheckout.js +0 -1
  3. package/dist/cjs/analytics/viewContent.js +0 -1
  4. package/dist/cjs/api/myCartApi/index.js +2 -1
  5. package/dist/cjs/basket/api/index.js +37 -0
  6. package/dist/cjs/basket/api/mutations/index.js +37 -0
  7. package/dist/cjs/basket/api/mutations/useReplaceBasketMutation.js +58 -0
  8. package/dist/cjs/basket/hooks/index.js +52 -0
  9. package/dist/cjs/basket/hooks/useBasketCrossSaleItems.js +99 -0
  10. package/dist/cjs/basket/hooks/useReplaceBasket.js +10 -0
  11. package/dist/cjs/basket/index.js +37 -0
  12. package/dist/cjs/checkout/api/keys.js +8 -1
  13. package/dist/cjs/checkout/api/queries/index.js +15 -0
  14. package/dist/cjs/checkout/api/queries/useBnpCalculateForCartQuery.js +60 -0
  15. package/dist/cjs/checkout/hooks/index.js +15 -0
  16. package/dist/cjs/checkout/hooks/useBnpCalculateForCart.js +120 -0
  17. package/dist/cjs/components/Portal/index.js +1 -1
  18. package/dist/cjs/contexts/CheckoutForm/hooks/usePayment/index.js +7 -2
  19. package/dist/cjs/contexts/CheckoutForm/index.js +5 -3
  20. package/dist/cjs/hooks/useLineItem/index.js +7 -0
  21. package/dist/cjs/hooks/useProduct/index.js +26 -5
  22. package/dist/cjs/hooks/useProduct/utils/index.js +14 -1
  23. package/dist/cjs/hooks/useProgressBar/hooks/useGetSetState.js +1 -24
  24. package/dist/cjs/hooks/useVouchers/index.js +1 -2
  25. package/dist/cjs/index.js +24 -0
  26. package/dist/cjs/listing/api/queries/useAggregateQuery.js +40 -5
  27. package/dist/cjs/listing/hooks/useListingConfig.js +2 -1
  28. package/dist/cjs/listing/hooks/useListingFilters.js +2 -2
  29. package/dist/cjs/listing/types.js +8 -1
  30. package/dist/cjs/listing/utils/buildCategoryQuery.js +11 -6
  31. package/dist/cjs/navigation/components/SearchBox/Components/Container/index.js +1 -1
  32. package/dist/cjs/navigation/components/SearchBox/Components/EmptyBox/index.js +19 -18
  33. package/dist/cjs/navigation/components/SearchBox/Components/Products/Components/ProductCard/index.js +1 -1
  34. package/dist/cjs/navigation/components/SearchBox/Components/Products/index.js +2 -2
  35. package/dist/cjs/navigation/components/SearchBox/Components/RecentSearches/index.js +1 -1
  36. package/dist/cjs/navigation/components/SearchBox/index.js +11 -11
  37. package/dist/cjs/order/api/mutations/index.js +15 -0
  38. package/dist/cjs/order/api/mutations/useUpdateOrderCustomFieldMutation.js +15 -0
  39. package/dist/cjs/order/hooks/index.js +15 -0
  40. package/dist/cjs/order/hooks/useUpdateOrderCustomField.js +9 -0
  41. package/dist/cjs/product/api/keys.js +11 -0
  42. package/dist/cjs/product/api/queries/index.js +37 -0
  43. package/dist/cjs/product/api/queries/useBnpOffersQuery.js +64 -0
  44. package/dist/cjs/product/hooks/index.js +37 -0
  45. package/dist/cjs/product/hooks/useBnpOffers.js +112 -0
  46. package/dist/cjs/product/index.js +15 -0
  47. package/dist/cjs/user/api/queries/index.js +15 -0
  48. package/dist/cjs/user/api/queries/useGetMyLoyaltyCardQuery.js +21 -0
  49. package/dist/cjs/user/api/utils/getUserToken.js +16 -0
  50. package/dist/cjs/user/api/utils/index.js +12 -0
  51. package/dist/cjs/user/hooks/index.js +24 -0
  52. package/dist/cjs/user/hooks/useGetMyLoyaltyCard.js +9 -0
  53. package/dist/cjs/user/hooks/useGetUserToken.js +15 -0
  54. package/dist/esm/analytics/Pixel/mainScript.js +0 -1
  55. package/dist/esm/analytics/addToCart.js +0 -1
  56. package/dist/esm/analytics/initiateCheckout.js +0 -1
  57. package/dist/esm/analytics/pageView.js +1 -1
  58. package/dist/esm/analytics/viewContent.js +0 -1
  59. package/dist/esm/api/myCartApi/index.js +2 -1
  60. package/dist/esm/basket/api/index.js +1 -0
  61. package/dist/esm/basket/api/mutations/index.js +1 -0
  62. package/dist/esm/basket/api/mutations/useReplaceBasketMutation.js +48 -0
  63. package/dist/esm/basket/hooks/index.js +2 -0
  64. package/dist/esm/basket/hooks/useBasketCrossSaleItems.js +67 -0
  65. package/dist/esm/basket/hooks/useReplaceBasket.js +2 -0
  66. package/dist/esm/basket/index.js +1 -0
  67. package/dist/esm/checkout/api/keys.js +6 -0
  68. package/dist/esm/checkout/api/queries/index.js +1 -0
  69. package/dist/esm/checkout/api/queries/useBnpCalculateForCartQuery.js +50 -0
  70. package/dist/esm/checkout/hooks/index.js +1 -0
  71. package/dist/esm/checkout/hooks/useBnpCalculateForCart.js +92 -0
  72. package/dist/esm/components/GoogleOneTap/index.js +1 -1
  73. package/dist/esm/components/Portal/index.js +1 -1
  74. package/dist/esm/contexts/CheckoutForm/hooks/usePayment/index.js +7 -2
  75. package/dist/esm/contexts/CheckoutForm/index.js +5 -3
  76. package/dist/esm/hooks/useLineItem/index.js +2 -0
  77. package/dist/esm/hooks/useProduct/index.js +27 -6
  78. package/dist/esm/hooks/useProduct/utils/index.js +13 -0
  79. package/dist/esm/hooks/useProgressBar/hooks/useGetSetState.js +1 -1
  80. package/dist/esm/hooks/useVouchers/index.js +1 -2
  81. package/dist/esm/index.js +4 -0
  82. package/dist/esm/listing/api/queries/useAggregateQuery.js +40 -5
  83. package/dist/esm/listing/hooks/useListingConfig.js +2 -1
  84. package/dist/esm/listing/hooks/useListingFilters.js +2 -2
  85. package/dist/esm/listing/types.js +7 -0
  86. package/dist/esm/listing/utils/buildCategoryQuery.js +11 -6
  87. package/dist/esm/navigation/components/SearchBox/Components/Container/index.js +1 -1
  88. package/dist/esm/navigation/components/SearchBox/Components/EmptyBox/index.js +19 -18
  89. package/dist/esm/navigation/components/SearchBox/Components/Products/Components/ProductCard/index.js +1 -1
  90. package/dist/esm/navigation/components/SearchBox/Components/Products/index.js +2 -2
  91. package/dist/esm/navigation/components/SearchBox/Components/RecentSearches/index.js +1 -1
  92. package/dist/esm/navigation/components/SearchBox/index.js +11 -11
  93. package/dist/esm/order/api/mutations/index.js +1 -0
  94. package/dist/esm/order/api/mutations/useUpdateOrderCustomFieldMutation.js +10 -0
  95. package/dist/esm/order/hooks/index.js +1 -0
  96. package/dist/esm/order/hooks/useUpdateOrderCustomField.js +4 -0
  97. package/dist/esm/product/api/keys.js +6 -0
  98. package/dist/esm/product/api/queries/index.js +1 -0
  99. package/dist/esm/product/api/queries/useBnpOffersQuery.js +54 -0
  100. package/dist/esm/product/hooks/index.js +1 -0
  101. package/dist/esm/product/hooks/useBnpOffers.js +84 -0
  102. package/dist/esm/product/index.js +1 -0
  103. package/dist/esm/user/api/queries/index.js +1 -0
  104. package/dist/esm/user/api/queries/useGetMyLoyaltyCardQuery.js +16 -0
  105. package/dist/esm/user/api/utils/getUserToken.js +6 -0
  106. package/dist/esm/user/api/utils/index.js +1 -0
  107. package/dist/esm/user/hooks/index.js +2 -0
  108. package/dist/esm/user/hooks/useGetMyLoyaltyCard.js +4 -0
  109. package/dist/esm/user/hooks/useGetUserToken.js +5 -0
  110. package/dist/types/api/myCartApi/index.d.ts +1 -0
  111. package/dist/types/basket/api/index.d.ts +1 -0
  112. package/dist/types/basket/api/mutations/index.d.ts +1 -0
  113. package/dist/types/basket/api/mutations/useReplaceBasketMutation.d.ts +2 -0
  114. package/dist/types/basket/hooks/index.d.ts +2 -0
  115. package/dist/types/basket/hooks/useBasketCrossSaleItems.d.ts +9 -0
  116. package/dist/types/basket/hooks/useReplaceBasket.d.ts +2 -0
  117. package/dist/types/basket/index.d.ts +1 -0
  118. package/dist/types/checkout/api/keys.d.ts +1 -0
  119. package/dist/types/checkout/api/queries/index.d.ts +1 -0
  120. package/dist/types/checkout/api/queries/useBnpCalculateForCartQuery.d.ts +4 -0
  121. package/dist/types/checkout/hooks/index.d.ts +1 -0
  122. package/dist/types/checkout/hooks/useBnpCalculateForCart.d.ts +39 -0
  123. package/dist/types/contexts/CheckoutForm/hooks/usePayment/index.d.ts +2 -0
  124. package/dist/types/contexts/CheckoutForm/index.d.ts +2 -1
  125. package/dist/types/hooks/basket-hooks/useBasketItemList/index.d.ts +1 -0
  126. package/dist/types/hooks/order-hooks/api/queries/useOrderGetPaymentMethodQuery.d.ts +1 -16
  127. package/dist/types/hooks/order-hooks/useReferralOrders/index.d.ts +1 -0
  128. package/dist/types/hooks/useLineItem/index.d.ts +2 -2
  129. package/dist/types/hooks/useProduct/index.d.ts +1 -0
  130. package/dist/types/hooks/useProduct/utils/index.d.ts +1 -0
  131. package/dist/types/index.d.ts +3 -0
  132. package/dist/types/listing/api/queries/useAggregateQuery.d.ts +4 -3
  133. package/dist/types/listing/types.d.ts +5 -0
  134. package/dist/types/navigation/components/SearchBox/Components/Container/index.d.ts +10 -9
  135. package/dist/types/navigation/components/SearchBox/Components/EmptyBox/index.d.ts +22 -21
  136. package/dist/types/navigation/components/SearchBox/Components/Products/Components/ProductCard/index.d.ts +8 -7
  137. package/dist/types/navigation/components/SearchBox/Components/Products/index.d.ts +9 -8
  138. package/dist/types/navigation/components/SearchBox/index.d.ts +31 -30
  139. package/dist/types/order/api/mutations/index.d.ts +1 -0
  140. package/dist/types/order/api/mutations/useUpdateCustomLineItemMutation.d.ts +2 -5
  141. package/dist/types/order/api/mutations/useUpdateOrderCustomFieldMutation.d.ts +9 -0
  142. package/dist/types/order/hooks/index.d.ts +1 -0
  143. package/dist/types/order/hooks/useUpdateCustomLineItem.d.ts +2 -2
  144. package/dist/types/order/hooks/useUpdateOrderCustomField.d.ts +2 -0
  145. package/dist/types/product/api/keys.d.ts +1 -0
  146. package/dist/types/product/api/queries/index.d.ts +1 -0
  147. package/dist/types/product/api/queries/useBnpOffersQuery.d.ts +5 -0
  148. package/dist/types/product/hooks/index.d.ts +1 -0
  149. package/dist/types/product/hooks/useBnpOffers.d.ts +37 -0
  150. package/dist/types/product/index.d.ts +1 -0
  151. package/dist/types/user/api/queries/index.d.ts +1 -0
  152. package/dist/types/user/api/queries/useGetMyLoyaltyCardQuery.d.ts +5 -0
  153. package/dist/types/user/api/utils/getUserToken.d.ts +1 -0
  154. package/dist/types/user/api/utils/index.d.ts +1 -0
  155. package/dist/types/user/hooks/index.d.ts +2 -0
  156. package/dist/types/user/hooks/useGetMyLoyaltyCard.d.ts +2 -0
  157. package/dist/types/user/hooks/useGetUserToken.d.ts +1 -0
  158. package/package.json +4 -3
@@ -62,6 +62,7 @@ function _templateObject4() {
62
62
  }
63
63
  export var EmptyBox = function(param) {
64
64
  var backgroundColor = param.backgroundColor, searchHistory = param.searchHistory, labels = param.labels, labelsColor = param.labelsColor, textColor = param.textColor, onClose = param.onClose, canDisplayPopular = param.canDisplayPopular, canDisplayRecent = param.canDisplayRecent, withRecent = param.withRecent, promoOffers = param.promoOffers, searchValue = param.searchValue, isLoading = param.isLoading;
65
+ var ref, ref1, ref2, ref3;
65
66
  return(/*#__PURE__*/ React.createElement(React.Fragment, null, isLoading ? /*#__PURE__*/ React.createElement("div", {
66
67
  style: {
67
68
  width: '100%',
@@ -70,28 +71,28 @@ export var EmptyBox = function(param) {
70
71
  }, /*#__PURE__*/ React.createElement(Spinner, null)) : /*#__PURE__*/ React.createElement(Wrapper, null, !searchValue || (searchValue === null || searchValue === void 0 ? void 0 : searchValue.length) < 3 ? /*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement(BlogCol, {
71
72
  backgroundColor: backgroundColor
72
73
  }, /*#__PURE__*/ React.createElement(BlogContainer, {
73
- blogTitle: labels.blog.blogTitle,
74
- image: labels.blog.image,
75
- url: labels.blog.url,
76
- description: labels.blog.description,
77
- title: labels.blogLabel,
78
- labelsColor: labelsColor,
79
- textColor: textColor,
74
+ blogTitle: (labels === null || labels === void 0 ? void 0 : (ref = labels.blog) === null || ref === void 0 ? void 0 : ref.blogTitle) || '',
75
+ image: (labels === null || labels === void 0 ? void 0 : (ref1 = labels.blog) === null || ref1 === void 0 ? void 0 : ref1.image) || '',
76
+ url: (labels === null || labels === void 0 ? void 0 : (ref2 = labels.blog) === null || ref2 === void 0 ? void 0 : ref2.url) || '',
77
+ description: (labels === null || labels === void 0 ? void 0 : (ref3 = labels.blog) === null || ref3 === void 0 ? void 0 : ref3.description) || '',
78
+ title: (labels === null || labels === void 0 ? void 0 : labels.blogLabel) || '',
79
+ labelsColor: labelsColor || '',
80
+ textColor: textColor || '',
80
81
  onClose: onClose
81
82
  })), /*#__PURE__*/ React.createElement(SuggestedSearches, null, canDisplayPopular && /*#__PURE__*/ React.createElement(PopularSearches, {
82
- title: labels.popularSearchesLabel,
83
+ title: (labels === null || labels === void 0 ? void 0 : labels.popularSearchesLabel) || '',
83
84
  onClose: onClose,
84
- textColor: textColor,
85
- labelsColor: labelsColor
85
+ textColor: textColor || '',
86
+ labelsColor: labelsColor || ''
86
87
  }), withRecent && canDisplayRecent && /*#__PURE__*/ React.createElement(RecentSearches, {
87
- title: labels.recentSearchesLabel,
88
+ title: (labels === null || labels === void 0 ? void 0 : labels.recentSearchesLabel) || '',
88
89
  data: searchHistory,
89
90
  onClose: onClose,
90
- textColor: textColor,
91
- labelsColor: labelsColor
91
+ textColor: textColor || '',
92
+ labelsColor: labelsColor || ''
92
93
  }))) : /*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement(Container, {
93
94
  labelsColor: labelsColor,
94
- title: labels.productsLabel,
95
+ title: (labels === null || labels === void 0 ? void 0 : labels.productsLabel) || '',
95
96
  onlyMobile: true
96
97
  }, /*#__PURE__*/ React.createElement(NoResultsDesc, {
97
98
  className: "SEARCH_BOX_NO_RESULT"
@@ -99,14 +100,14 @@ export var EmptyBox = function(param) {
99
100
  backgroundColor: backgroundColor
100
101
  }, /*#__PURE__*/ React.createElement(Products, {
101
102
  data: promoOffers,
102
- textColor: textColor,
103
- labelsColor: labelsColor,
103
+ textColor: textColor || '',
104
+ labelsColor: labelsColor || '',
104
105
  onClose: onClose,
105
- title: labels.promoOffersLabel,
106
+ title: (labels === null || labels === void 0 ? void 0 : labels.promoOffersLabel) || '',
106
107
  offers: true
107
108
  })), /*#__PURE__*/ React.createElement(Container, {
108
109
  labelsColor: labelsColor,
109
- title: labels.productsLabel,
110
+ title: (labels === null || labels === void 0 ? void 0 : labels.productsLabel) || '',
110
111
  onlyDesktop: true
111
112
  }, /*#__PURE__*/ React.createElement(NoResultsDesc, {
112
113
  className: "SEARCH_BOX_NO_RESULT"
@@ -151,7 +151,7 @@ export var ProductCard = function(param) {
151
151
  fontWeight: 400
152
152
  }
153
153
  }, name), /*#__PURE__*/ React.createElement(PriceContainer, null, discountPrice ? /*#__PURE__*/ React.createElement(Price, null, /*#__PURE__*/ React.createElement(NewPrice, null, discountPrice.displayValue), /*#__PURE__*/ React.createElement(OriginalPrice, null, price.displayValue)) : /*#__PURE__*/ React.createElement(ProductCardPrice, {
154
- color: priceColor
154
+ color: priceColor || ''
155
155
  }, price.displayValue)))))), /*#__PURE__*/ React.createElement(Divider, {
156
156
  isLast: isLast
157
157
  })));
@@ -28,7 +28,7 @@ export var Products = function(param) {
28
28
  labelsColor: labelsColor,
29
29
  title: title,
30
30
  offers: offers,
31
- noData: !data || (data === null || data === void 0 ? void 0 : data.length) < 1
31
+ noData: !data || (data === null || data === void 0 ? void 0 : data.length) < 1 || null
32
32
  }, Boolean(data === null || data === void 0 ? void 0 : data.length) ? /*#__PURE__*/ React.createElement("div", {
33
33
  className: "row ".concat(offers ? 'flex-column' : '')
34
34
  }, data === null || data === void 0 ? void 0 : data.map(function(product, index) {
@@ -39,7 +39,7 @@ export var Products = function(param) {
39
39
  labelsColor: labelsColor,
40
40
  priceColor: priceColor,
41
41
  onClose: onClose,
42
- isLast: index === (data === null || data === void 0 ? void 0 : data.length) - 1,
42
+ isLast: index === (data === null || data === void 0 ? void 0 : data.length) - 1 || null,
43
43
  offers: offers,
44
44
  productSpacing: productSpacing
45
45
  }));
@@ -6,7 +6,7 @@ export var RecentSearches = function(param) {
6
6
  return(/*#__PURE__*/ React.createElement(Container, {
7
7
  labelsColor: labelsColor,
8
8
  title: title,
9
- noData: !data || (data === null || data === void 0 ? void 0 : data.length) < 1
9
+ noData: !data || (data === null || data === void 0 ? void 0 : data.length) < 1 || null
10
10
  }, data && /*#__PURE__*/ React.createElement(RecentSearchesList, {
11
11
  data: data,
12
12
  onClose: onClose,
@@ -141,7 +141,7 @@ var BottomMenuEnum1;
141
141
  })(BottomMenuEnum1 || (BottomMenuEnum1 = {
142
142
  }));
143
143
  export var SearchBox = function(param) {
144
- var isLoading = param.isLoading, onClose = param.onClose, suggestedBrands = param.suggestedBrands, suggestedCategories = param.suggestedCategories, suggestions = param.suggestions, searchValue = param.searchValue, _withRecent = param.withRecent, withRecent = _withRecent === void 0 ? true : _withRecent, labels = param.labels, bottomMenu = param.bottomMenu, labelsColor = param.labelsColor, textColor = param.textColor, priceColor = param.priceColor, backgroundColor = param.backgroundColor, onSearchSubmit = param.onSearchSubmit, top = param.top, delay = param.delay, isContainer = param.isContainer, noCloseButton = param.noCloseButton, productSpacing = param.productSpacing, closeButtonOnTop = param.closeButtonOnTop, _hasPopularSearches = param.hasPopularSearches, hasPopularSearches = _hasPopularSearches === void 0 ? false : _hasPopularSearches;
144
+ var isLoading = param.isLoading, onClose = param.onClose, suggestedBrands = param.suggestedBrands, suggestedCategories = param.suggestedCategories, suggestions = param.suggestions, searchValue = param.searchValue, _withRecent = param.withRecent, withRecent = _withRecent === void 0 ? true : _withRecent, labels = param.labels, bottomMenu = param.bottomMenu, labelsColor = param.labelsColor, textColor = param.textColor, priceColor = param.priceColor, backgroundColor = param.backgroundColor, onSearchSubmit = param.onSearchSubmit, top = param.top, delay = param.delay, isContainer = param.isContainer, noCloseButton = param.noCloseButton, productSpacing = param.productSpacing, closeButtonOnTop = param.closeButtonOnTop, _hasPopularSearches = param.hasPopularSearches, hasPopularSearches = _hasPopularSearches === void 0 ? null : _hasPopularSearches;
145
145
  var ref = useSearchHistory(), data = ref.data, loadingRecent = ref.isLoading;
146
146
  var canDisplayRecent = !loadingRecent;
147
147
  var searchHistory = data === null || data === void 0 ? void 0 : data.results;
@@ -169,21 +169,21 @@ export var SearchBox = function(param) {
169
169
  }, /*#__PURE__*/ React.createElement(SearchBoxContent, {
170
170
  isContainer: isContainer
171
171
  }, /*#__PURE__*/ React.createElement(Row, null, /*#__PURE__*/ React.createElement(Placeholder, null), showResults ? /*#__PURE__*/ React.createElement(ResultsBox, null, /*#__PURE__*/ React.createElement(SuggestedBrandsCol, {
172
- backgroundColor: backgroundColor
172
+ backgroundColor: backgroundColor || ''
173
173
  }, suggestedBrands.length !== 0 && /*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement(Suggestions, {
174
174
  data: displayableBrands,
175
175
  onClose: onClose,
176
- searchValue: searchValue,
177
- title: labels.suggestedBrandsLabel,
178
- labelsColor: labelsColor,
179
- textColor: textColor
176
+ searchValue: searchValue || '',
177
+ title: (labels === null || labels === void 0 ? void 0 : labels.suggestedBrandsLabel) || '',
178
+ labelsColor: labelsColor || '',
179
+ textColor: textColor || ''
180
180
  })), suggestedCategories.length > 0 && /*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement(Suggestions, {
181
181
  data: suggestedCategories,
182
182
  onClose: onClose,
183
- searchValue: searchValue,
184
- title: labels.suggestedCategoriesLabel,
185
- labelsColor: labelsColor,
186
- textColor: textColor
183
+ searchValue: searchValue || '',
184
+ title: (labels === null || labels === void 0 ? void 0 : labels.suggestedCategoriesLabel) || '',
185
+ labelsColor: labelsColor || '',
186
+ textColor: textColor || ''
187
187
  }))), /*#__PURE__*/ React.createElement(ProductsWrapper, {
188
188
  backgroundColor: backgroundColor
189
189
  }, /*#__PURE__*/ React.createElement(Products, {
@@ -212,7 +212,7 @@ export var SearchBox = function(param) {
212
212
  onClose: onClose,
213
213
  searchHistory: searchHistory,
214
214
  textColor: textColor,
215
- canDisplayRecent: canDisplayRecent,
215
+ canDisplayRecent: canDisplayRecent || null,
216
216
  withRecent: withRecent,
217
217
  promoOffers: promoOffers,
218
218
  searchValue: searchValue
@@ -1 +1,2 @@
1
1
  export * from './useUpdateCustomLineItemMutation';
2
+ export * from './useUpdateOrderCustomFieldMutation';
@@ -0,0 +1,10 @@
1
+ import { MyCartSetCartCustomField } from '@sentecacommerce/sdk';
2
+ import { useMutation } from 'react-query';
3
+ export var useUpdateOrderCustomFieldMutation = function(callback) {
4
+ return useMutation(function(values) {
5
+ return MyCartSetCartCustomField(values.customFields);
6
+ }, {
7
+ onSuccess: callback === null || callback === void 0 ? void 0 : callback.onSuccess,
8
+ onError: callback === null || callback === void 0 ? void 0 : callback.onError
9
+ });
10
+ };
@@ -1 +1,2 @@
1
1
  export * from './useUpdateCustomLineItem';
2
+ export * from './useUpdateOrderCustomField';
@@ -0,0 +1,4 @@
1
+ import { useUpdateOrderCustomFieldMutation } from '../api';
2
+ export var useUpdateOrderCustomField = function(props) {
3
+ return useUpdateOrderCustomFieldMutation(props);
4
+ };
@@ -0,0 +1,6 @@
1
+ export var getBnpProductOffersKey = function(sku) {
2
+ return [
3
+ 'product-bnp-offers',
4
+ sku
5
+ ];
6
+ };
@@ -0,0 +1 @@
1
+ export * from './useBnpOffersQuery';
@@ -0,0 +1,54 @@
1
+ import regeneratorRuntime from "regenerator-runtime";
2
+ import React from 'react';
3
+ import { useQuery } from 'react-query';
4
+ import { MyPaymentsBnpCalculateForSKU } from '@sentecacommerce/sdk';
5
+ import { getBnpProductOffersKey } from '../keys';
6
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
7
+ try {
8
+ var info = gen[key](arg);
9
+ var value = info.value;
10
+ } catch (error) {
11
+ reject(error);
12
+ return;
13
+ }
14
+ if (info.done) {
15
+ resolve(value);
16
+ } else {
17
+ Promise.resolve(value).then(_next, _throw);
18
+ }
19
+ }
20
+ function _asyncToGenerator(fn) {
21
+ return function() {
22
+ var self = this, args = arguments;
23
+ return new Promise(function(resolve, reject) {
24
+ var gen = fn.apply(self, args);
25
+ function _next(value) {
26
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
27
+ }
28
+ function _throw(err) {
29
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
30
+ }
31
+ _next(undefined);
32
+ });
33
+ };
34
+ }
35
+ export var useBnpOffersQuery = function(param) {
36
+ var sku = param.sku, _preferredInstallmentCentAmount = param.preferredInstallmentCentAmount, preferredInstallmentCentAmount = _preferredInstallmentCentAmount === void 0 ? 0 : _preferredInstallmentCentAmount, _downPaymentCentAmount = param.downPaymentCentAmount, downPaymentCentAmount = _downPaymentCentAmount === void 0 ? 0 : _downPaymentCentAmount;
37
+ return useQuery(getBnpProductOffersKey(sku), _asyncToGenerator(regeneratorRuntime.mark(function _callee() {
38
+ return regeneratorRuntime.wrap(function _callee$(_ctx) {
39
+ while(1)switch(_ctx.prev = _ctx.next){
40
+ case 0:
41
+ _ctx.next = 2;
42
+ return MyPaymentsBnpCalculateForSKU(sku, {
43
+ preferredInstallmentCentAmount: preferredInstallmentCentAmount,
44
+ downPaymentCentAmount: downPaymentCentAmount
45
+ });
46
+ case 2:
47
+ return _ctx.abrupt("return", _ctx.sent);
48
+ case 3:
49
+ case "end":
50
+ return _ctx.stop();
51
+ }
52
+ }, _callee);
53
+ })));
54
+ };
@@ -0,0 +1 @@
1
+ export * from './useBnpOffers';
@@ -0,0 +1,84 @@
1
+ import React, { useMemo } from 'react';
2
+ import { useBnpOffersQuery } from '../api/queries';
3
+ import { decodePrice, formatAsCurrency, useConfigState } from '../../index';
4
+ function _defineProperty(obj, key, value) {
5
+ if (key in obj) {
6
+ Object.defineProperty(obj, key, {
7
+ value: value,
8
+ enumerable: true,
9
+ configurable: true,
10
+ writable: true
11
+ });
12
+ } else {
13
+ obj[key] = value;
14
+ }
15
+ return obj;
16
+ }
17
+ function _objectSpread(target) {
18
+ for(var i = 1; i < arguments.length; i++){
19
+ var source = arguments[i] != null ? arguments[i] : {
20
+ };
21
+ var ownKeys = Object.keys(source);
22
+ if (typeof Object.getOwnPropertySymbols === "function") {
23
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
24
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
25
+ }));
26
+ }
27
+ ownKeys.forEach(function(key) {
28
+ _defineProperty(target, key, source[key]);
29
+ });
30
+ }
31
+ return target;
32
+ }
33
+ export var useBnpOffers = function(props) {
34
+ var ref6, ref1, ref2, ref3;
35
+ var configLocale = (ref6 = useConfigState()) === null || ref6 === void 0 ? void 0 : (ref1 = ref6.price) === null || ref1 === void 0 ? void 0 : ref1.locale;
36
+ var response = useBnpOffersQuery(props);
37
+ return useMemo(function() {
38
+ var ref, ref4, ref5;
39
+ return _objectSpread({
40
+ }, response, {
41
+ data: response === null || response === void 0 ? void 0 : (ref = response.data) === null || ref === void 0 ? void 0 : (ref4 = ref[0]) === null || ref4 === void 0 ? void 0 : (ref5 = ref4.offers) === null || ref5 === void 0 ? void 0 : ref5.map(function(offer) {
42
+ var _totalRepaymentAmount = decodePrice(offer.totalRepaymentAmount);
43
+ var _correctDownPaymentAmount = decodePrice(offer.correctDownPaymentAmount);
44
+ var _installmentAmount = decodePrice(offer.installmentAmount);
45
+ var _processingFeeAmount = decodePrice(offer.processingFeeAmount);
46
+ var totalRepaymentAmount = formatAsCurrency({
47
+ price: _totalRepaymentAmount,
48
+ precision: offer.totalRepaymentAmount.fractionDigits,
49
+ currency: offer.totalRepaymentAmount.currencyCode,
50
+ locale: configLocale || 'en'
51
+ });
52
+ var correctDownPaymentAmount = formatAsCurrency({
53
+ price: _correctDownPaymentAmount,
54
+ precision: offer.correctDownPaymentAmount.fractionDigits,
55
+ currency: offer.correctDownPaymentAmount.currencyCode,
56
+ locale: configLocale || 'en'
57
+ });
58
+ var installmentAmount = formatAsCurrency({
59
+ price: _installmentAmount,
60
+ precision: offer.installmentAmount.fractionDigits,
61
+ currency: offer.installmentAmount.currencyCode,
62
+ locale: configLocale || 'en'
63
+ });
64
+ var processingFeeAmount = formatAsCurrency({
65
+ price: _processingFeeAmount,
66
+ precision: offer.processingFeeAmount.fractionDigits,
67
+ currency: offer.processingFeeAmount.currencyCode,
68
+ locale: configLocale || 'en'
69
+ });
70
+ return _objectSpread({
71
+ }, offer, {
72
+ totalRepaymentAmount: totalRepaymentAmount,
73
+ correctDownPaymentAmount: correctDownPaymentAmount,
74
+ installmentAmount: installmentAmount,
75
+ processingFeeAmount: processingFeeAmount
76
+ });
77
+ }).sort(function(offer, offer2) {
78
+ return Number(offer.maturity) - Number(offer2.maturity);
79
+ })
80
+ });
81
+ }, [
82
+ response === null || response === void 0 ? void 0 : (ref2 = response.data) === null || ref2 === void 0 ? void 0 : (ref3 = ref2[0]) === null || ref3 === void 0 ? void 0 : ref3.offers
83
+ ]);
84
+ };
@@ -1 +1,2 @@
1
1
  export * from './api';
2
+ export * from './hooks';
@@ -1 +1,2 @@
1
1
  export * from './useIsAuthenticatedQuery';
2
+ export * from './useGetMyLoyaltyCardQuery';
@@ -0,0 +1,16 @@
1
+ import { MyWalletGetByType } from '@sentecacommerce/sdk';
2
+ import { useQuery } from 'react-query';
3
+ export var useGetMyLoyaltyCardQuery = function(callback) {
4
+ return useQuery('get-loyalty-card-key', function() {
5
+ return MyWalletGetByType('loyalty-program');
6
+ }, {
7
+ onSuccess: function() {
8
+ var ref;
9
+ return callback === null || callback === void 0 ? void 0 : (ref = callback.onSuccess) === null || ref === void 0 ? void 0 : ref.call(callback);
10
+ },
11
+ onError: function(err) {
12
+ var ref;
13
+ return callback === null || callback === void 0 ? void 0 : (ref = callback.onError) === null || ref === void 0 ? void 0 : ref.call(callback, err);
14
+ }
15
+ });
16
+ };
@@ -0,0 +1,6 @@
1
+ import Cookie from 'js-cookie';
2
+ import { AUTH_TOKEN_KEY, ANONYMOUS_TOKEN_KEY } from '../../../index';
3
+ var ref;
4
+ export var getUserToken = function() {
5
+ return (ref = Cookie.get(AUTH_TOKEN_KEY)) !== null && ref !== void 0 ? ref : Cookie.get(ANONYMOUS_TOKEN_KEY);
6
+ };
@@ -2,3 +2,4 @@ export * from './processLogin';
2
2
  export * from './processLoginPayload';
3
3
  export * from './invalidateQueries';
4
4
  export * from './generateAnonymousToken';
5
+ export * from './getUserToken';
@@ -13,3 +13,5 @@ export * from './useResetPassword';
13
13
  export * from './useVerifyChangeEmail';
14
14
  export * from './useChangeEmail';
15
15
  export * from './useRequestEmailConfirmation';
16
+ export * from './useGetUserToken';
17
+ export * from './useGetMyLoyaltyCard';
@@ -0,0 +1,4 @@
1
+ import { useGetMyLoyaltyCardQuery } from '../api';
2
+ export var useGetMyLoyaltyCard = function(callback) {
3
+ return useGetMyLoyaltyCardQuery(callback);
4
+ };
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import { getUserToken } from '../api';
3
+ export var useGetUserToken = function() {
4
+ return getUserToken();
5
+ };
@@ -8,6 +8,7 @@ export declare const myCartCacheKeys: {
8
8
  useGetAllShippingMethods: string;
9
9
  useGetPaymentMethods: string;
10
10
  useIsExisting: string;
11
+ useGetCrossSaleItems: string;
11
12
  };
12
13
  declare type myCartApiType = {
13
14
  readonly useGetWithCookies: (queryCache: QueryCache, cookies: any) => Promise<OrderDTO>;
@@ -0,0 +1 @@
1
+ export * from './mutations';
@@ -0,0 +1 @@
1
+ export * from './useReplaceBasketMutation';
@@ -0,0 +1,2 @@
1
+ import { OrderDTO } from '../../../index';
2
+ export declare const useReplaceBasketMutation: () => import("react-query").MutationResultPair<void, unknown, OrderDTO, unknown>;
@@ -0,0 +1,2 @@
1
+ export * from './useReplaceBasket';
2
+ export * from './useBasketCrossSaleItems';
@@ -0,0 +1,9 @@
1
+ export declare const useBasketCrossSaleItems: () => {
2
+ name: string;
3
+ description: string;
4
+ slug: string;
5
+ attributeRules: import("@sentecacommerce/sdk").AttributeRuleDTO[] | undefined;
6
+ attributes: import("@sentecacommerce/sdk").ProductAttributeDTO[] | undefined;
7
+ _id: string | undefined;
8
+ variants: import("@sentecacommerce/sdk").ProductVariantDTO[] | undefined;
9
+ }[] | undefined;
@@ -0,0 +1,2 @@
1
+ import { useReplaceBasketMutation } from '../api';
2
+ export { useReplaceBasketMutation as useReplaceBasket };
@@ -0,0 +1 @@
1
+ export * from './hooks';
@@ -1,3 +1,4 @@
1
1
  export declare enum CheckoutQueryKeysEnum {
2
2
  }
3
3
  export declare const getVerifyBoricaResponseKey: (order: string) => string;
4
+ export declare const getBnpLoanCalculatorKey: (preferredInstallmentCentAmount: number) => (string | number)[];
@@ -1 +1,2 @@
1
1
  export * from './useVerifyBoricaResponseQuery';
2
+ export * from './useBnpCalculateForCartQuery';
@@ -0,0 +1,4 @@
1
+ export declare const useBnpCalculateForCartQuery: (props: {
2
+ preferredInstallmentCentAmount: number;
3
+ downPaymentCentAmount: number;
4
+ }) => import("react-query").QueryResult<import("@sentecacommerce/sdk").BNPLoanOfferDTO[], unknown>;
@@ -1 +1,2 @@
1
1
  export * from './useVerifyBoricaResponse';
2
+ export * from './useBnpCalculateForCart';
@@ -0,0 +1,39 @@
1
+ export declare const useBnpCalculateForCart: (props?: {
2
+ preferredInstallmentCentAmount?: number | undefined;
3
+ downPaymentCentAmount?: number | undefined;
4
+ } | undefined) => {
5
+ data: {
6
+ offers: {
7
+ totalRepaymentAmount: import("../../index").FormattedPriceType;
8
+ correctDownPaymentAmount: import("../../index").FormattedPriceType;
9
+ installmentAmount: import("../../index").FormattedPriceType;
10
+ processingFeeAmount: import("../../index").FormattedPriceType;
11
+ apr: string;
12
+ maturity: string;
13
+ nir: string;
14
+ variantId: string;
15
+ }[] | undefined;
16
+ scheme?: import("@sentecacommerce/sdk").BNPPricingSchemesDTO | undefined;
17
+ };
18
+ canFetchMore: boolean | undefined;
19
+ clear: () => void;
20
+ error: unknown;
21
+ failureCount: number;
22
+ fetchMore: (fetchMoreVariable?: unknown, options?: import("react-query/types/core/query").FetchMoreOptions | undefined) => Promise<import("@sentecacommerce/sdk").BNPLoanOfferDTO[] | undefined>;
23
+ isError: boolean;
24
+ isFetched: boolean;
25
+ isFetchedAfterMount: boolean;
26
+ isFetching: boolean;
27
+ isFetchingMore?: import("react-query").IsFetchingMoreValue | undefined;
28
+ isIdle: boolean;
29
+ isInitialData: boolean;
30
+ isLoading: boolean;
31
+ isPreviousData: boolean;
32
+ isPlaceholderData: boolean;
33
+ isStale: boolean;
34
+ isSuccess: boolean;
35
+ refetch: (options?: import("react-query/types/core/query").RefetchOptions | undefined) => Promise<import("@sentecacommerce/sdk").BNPLoanOfferDTO[] | undefined>;
36
+ remove: () => void;
37
+ status: import("react-query").QueryStatus;
38
+ updatedAt: number;
39
+ };
@@ -12,5 +12,7 @@ export declare type UsePaymentResultType = {
12
12
  errors?: CheckoutFormErrorsResultType;
13
13
  isValid: boolean;
14
14
  updateIsSubmitting: (value: boolean) => void;
15
+ updateLoanInfo: (value: any) => void;
16
+ loanInfo: any;
15
17
  paymentMethods?: PaymentMethodsResult;
16
18
  };
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { OrderDTO, AddressDTO } from '@sentecacommerce/sdk';
2
+ import { OrderDTO, AddressDTO, OrderLoanInfoDTO } from '@sentecacommerce/sdk';
3
3
  import { MutateFunction, QueryResult } from 'react-query';
4
4
  import { UseBillingResultType, UsePaymentResultType, UseShippingResultType } from './hooks';
5
5
  import { ShippingValidationsType, BillingAddressValidationType } from './utils';
@@ -20,6 +20,7 @@ export declare type CheckoutFormOnSubmitData = {
20
20
  scrollToFirstError: () => void;
21
21
  shippingState: UseShippingResultType;
22
22
  shippingAddress?: AddressDTO;
23
+ loanInfo?: OrderLoanInfoDTO;
23
24
  };
24
25
  declare type Props = {
25
26
  children: any;
@@ -36,5 +36,6 @@ export declare const useBasketItemList: () => {
36
36
  shippingDetails?: import("@sentecacommerce/sdk").ItemShippingDetailsDraftDTO | undefined;
37
37
  fields?: any;
38
38
  custom?: import("@sentecacommerce/sdk").CustomField[] | undefined;
39
+ type: string;
39
40
  }[];
40
41
  };
@@ -1,16 +1 @@
1
- export declare const useOrderGetPaymentMethodQuery: (orderId: string) => import("react-query").QueryResult<{
2
- name: string;
3
- description: string;
4
- _id: string;
5
- createdAt: number;
6
- updatedAt: number;
7
- version?: number | undefined;
8
- key: string;
9
- type: import("@sentecacommerce/sdk").PaymentMethodDTOTypeEnum;
10
- moduleKey?: string | undefined;
11
- authority: import("@sentecacommerce/sdk").PaymentMethodDTOAuthorityEnum;
12
- merchantKey?: string | undefined;
13
- countryCode: string;
14
- currencyCode: string;
15
- config: any;
16
- }, unknown>;
1
+ export declare const useOrderGetPaymentMethodQuery: (orderId: string) => import("react-query").QueryResult<any, unknown>;
@@ -3,4 +3,5 @@ export declare const useReferralOrders: (query?: {
3
3
  offset?: number | undefined;
4
4
  filter?: string | undefined;
5
5
  project?: string | undefined;
6
+ sort?: string | undefined;
6
7
  } | undefined) => import("react-query").InfiniteQueryResult<import("@sentecacommerce/sdk").OrderFilterResultDTO, unknown>;
@@ -1,4 +1,5 @@
1
- import { SearchResultDTO, ImageDTO, MoneyDTO, ReviewRatingStatisticsDTO, OfferDTO } from '@sentecacommerce/sdk';
1
+ import { SearchResultDTO, ImageDTO, MoneyDTO, ReviewRatingStatisticsDTO, OfferDTO, OfferDTOStatusEnum } from '@sentecacommerce/sdk';
2
+ export { OfferDTOStatusEnum };
2
3
  export interface BaseProductType {
3
4
  name: string;
4
5
  slug: string;
@@ -47,4 +48,3 @@ interface LineItemType extends BaseProductType {
47
48
  getCustomFieldByKey: (key: string) => any;
48
49
  }
49
50
  export declare const useLineItem: (props: SearchResultDTO) => LineItemType;
50
- export {};
@@ -136,6 +136,7 @@ declare type ProductStateContextType = {
136
136
  seoData: SeoInformationType;
137
137
  variants?: VariantMap;
138
138
  selectedVariant?: VariantType | null;
139
+ collapsedImages?: object;
139
140
  };
140
141
  export declare type VideoType = {
141
142
  type: string;
@@ -11,6 +11,7 @@ export declare const createProductContent: (data: any) => {
11
11
  name: string;
12
12
  content: string;
13
13
  };
14
+ export declare const createCollapseKeyImagesMap: (product?: ProductDTO | undefined) => {} | undefined;
14
15
  export declare const createAttributeRulesMap: (product?: ProductDTO | undefined) => any;
15
16
  export declare const createMappedOptions: (options?: OptionDefinitionDTO[] | undefined) => OptionsType[];
16
17
  export declare type SelectedOptionType = {
@@ -1,3 +1,5 @@
1
+ import Cookie from 'js-cookie';
2
+ export { Cookie };
1
3
  export * from './dto';
2
4
  export * from './api/productsApi';
3
5
  export * from './api/pagesApi';
@@ -105,6 +107,7 @@ export * from './brands';
105
107
  export * from './navigation';
106
108
  export * from './GDPR';
107
109
  export * from './user';
110
+ export * from './basket';
108
111
  export * from './ui';
109
112
  export * from './wishlist';
110
113
  export * from './build';