@sentecacommerce-theme/lib 0.13.5-alpha.5 → 0.13.7-alpha.1
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.
- package/dist/cjs/analytics/addToCart.js +0 -1
- package/dist/cjs/analytics/initiateCheckout.js +0 -1
- package/dist/cjs/analytics/viewContent.js +0 -1
- package/dist/cjs/api/myCartApi/index.js +2 -1
- package/dist/cjs/basket/api/index.js +37 -0
- package/dist/cjs/basket/api/mutations/index.js +37 -0
- package/dist/cjs/basket/api/mutations/useReplaceBasketMutation.js +58 -0
- package/dist/cjs/basket/hooks/index.js +52 -0
- package/dist/cjs/basket/hooks/useBasketCrossSaleItems.js +99 -0
- package/dist/cjs/basket/hooks/useReplaceBasket.js +10 -0
- package/dist/cjs/basket/index.js +37 -0
- package/dist/cjs/checkout/api/keys.js +8 -1
- package/dist/cjs/checkout/api/queries/index.js +15 -0
- package/dist/cjs/checkout/api/queries/useBnpCalculateForCartQuery.js +60 -0
- package/dist/cjs/checkout/hooks/index.js +15 -0
- package/dist/cjs/checkout/hooks/useBnpCalculateForCart.js +120 -0
- package/dist/cjs/components/Portal/index.js +1 -1
- package/dist/cjs/contexts/CheckoutForm/hooks/usePayment/index.js +7 -2
- package/dist/cjs/contexts/CheckoutForm/index.js +5 -3
- package/dist/cjs/hooks/useLineItem/index.js +7 -0
- package/dist/cjs/hooks/useProduct/index.js +26 -5
- package/dist/cjs/hooks/useProduct/utils/index.js +14 -1
- package/dist/cjs/hooks/useProgressBar/hooks/useGetSetState.js +1 -24
- package/dist/cjs/hooks/useVouchers/index.js +1 -2
- package/dist/cjs/index.js +24 -0
- package/dist/cjs/listing/api/queries/useAggregateQuery.js +40 -5
- package/dist/cjs/listing/hooks/useListingConfig.js +2 -1
- package/dist/cjs/listing/hooks/useListingFilters.js +2 -2
- package/dist/cjs/listing/types.js +8 -1
- package/dist/cjs/listing/utils/buildCategoryQuery.js +11 -6
- package/dist/cjs/navigation/components/SearchBox/Components/Container/index.js +1 -1
- package/dist/cjs/navigation/components/SearchBox/Components/EmptyBox/index.js +19 -18
- package/dist/cjs/navigation/components/SearchBox/Components/Products/Components/ProductCard/index.js +1 -1
- package/dist/cjs/navigation/components/SearchBox/Components/Products/index.js +2 -2
- package/dist/cjs/navigation/components/SearchBox/Components/RecentSearches/index.js +1 -1
- package/dist/cjs/navigation/components/SearchBox/index.js +11 -11
- package/dist/cjs/order/api/mutations/index.js +15 -0
- package/dist/cjs/order/api/mutations/useUpdateOrderCustomFieldMutation.js +15 -0
- package/dist/cjs/order/hooks/index.js +15 -0
- package/dist/cjs/order/hooks/useUpdateOrderCustomField.js +9 -0
- package/dist/cjs/product/api/keys.js +11 -0
- package/dist/cjs/product/api/queries/index.js +37 -0
- package/dist/cjs/product/api/queries/useBnpOffersQuery.js +64 -0
- package/dist/cjs/product/hooks/index.js +37 -0
- package/dist/cjs/product/hooks/useBnpOffers.js +112 -0
- package/dist/cjs/product/index.js +15 -0
- package/dist/cjs/user/api/queries/index.js +15 -0
- package/dist/cjs/user/api/queries/useGetMyLoyaltyCardQuery.js +21 -0
- package/dist/cjs/user/api/utils/getUserToken.js +16 -0
- package/dist/cjs/user/api/utils/index.js +12 -0
- package/dist/cjs/user/hooks/index.js +24 -0
- package/dist/cjs/user/hooks/useGetMyLoyaltyCard.js +9 -0
- package/dist/cjs/user/hooks/useGetUserToken.js +15 -0
- package/dist/esm/analytics/Pixel/mainScript.js +0 -1
- package/dist/esm/analytics/addToCart.js +0 -1
- package/dist/esm/analytics/initiateCheckout.js +0 -1
- package/dist/esm/analytics/pageView.js +1 -1
- package/dist/esm/analytics/viewContent.js +0 -1
- package/dist/esm/api/myCartApi/index.js +2 -1
- package/dist/esm/basket/api/index.js +1 -0
- package/dist/esm/basket/api/mutations/index.js +1 -0
- package/dist/esm/basket/api/mutations/useReplaceBasketMutation.js +48 -0
- package/dist/esm/basket/hooks/index.js +2 -0
- package/dist/esm/basket/hooks/useBasketCrossSaleItems.js +67 -0
- package/dist/esm/basket/hooks/useReplaceBasket.js +2 -0
- package/dist/esm/basket/index.js +1 -0
- package/dist/esm/checkout/api/keys.js +6 -0
- package/dist/esm/checkout/api/queries/index.js +1 -0
- package/dist/esm/checkout/api/queries/useBnpCalculateForCartQuery.js +50 -0
- package/dist/esm/checkout/hooks/index.js +1 -0
- package/dist/esm/checkout/hooks/useBnpCalculateForCart.js +92 -0
- package/dist/esm/components/GoogleOneTap/index.js +1 -1
- package/dist/esm/components/Portal/index.js +1 -1
- package/dist/esm/contexts/CheckoutForm/hooks/usePayment/index.js +7 -2
- package/dist/esm/contexts/CheckoutForm/index.js +5 -3
- package/dist/esm/hooks/useLineItem/index.js +2 -0
- package/dist/esm/hooks/useProduct/index.js +27 -6
- package/dist/esm/hooks/useProduct/utils/index.js +13 -0
- package/dist/esm/hooks/useProgressBar/hooks/useGetSetState.js +1 -1
- package/dist/esm/hooks/useVouchers/index.js +1 -2
- package/dist/esm/index.js +4 -0
- package/dist/esm/listing/api/queries/useAggregateQuery.js +40 -5
- package/dist/esm/listing/hooks/useListingConfig.js +2 -1
- package/dist/esm/listing/hooks/useListingFilters.js +2 -2
- package/dist/esm/listing/types.js +7 -0
- package/dist/esm/listing/utils/buildCategoryQuery.js +11 -6
- package/dist/esm/navigation/components/SearchBox/Components/Container/index.js +1 -1
- package/dist/esm/navigation/components/SearchBox/Components/EmptyBox/index.js +19 -18
- package/dist/esm/navigation/components/SearchBox/Components/Products/Components/ProductCard/index.js +1 -1
- package/dist/esm/navigation/components/SearchBox/Components/Products/index.js +2 -2
- package/dist/esm/navigation/components/SearchBox/Components/RecentSearches/index.js +1 -1
- package/dist/esm/navigation/components/SearchBox/index.js +11 -11
- package/dist/esm/order/api/mutations/index.js +1 -0
- package/dist/esm/order/api/mutations/useUpdateOrderCustomFieldMutation.js +10 -0
- package/dist/esm/order/hooks/index.js +1 -0
- package/dist/esm/order/hooks/useUpdateOrderCustomField.js +4 -0
- package/dist/esm/product/api/keys.js +6 -0
- package/dist/esm/product/api/queries/index.js +1 -0
- package/dist/esm/product/api/queries/useBnpOffersQuery.js +54 -0
- package/dist/esm/product/hooks/index.js +1 -0
- package/dist/esm/product/hooks/useBnpOffers.js +84 -0
- package/dist/esm/product/index.js +1 -0
- package/dist/esm/user/api/queries/index.js +1 -0
- package/dist/esm/user/api/queries/useGetMyLoyaltyCardQuery.js +16 -0
- package/dist/esm/user/api/utils/getUserToken.js +6 -0
- package/dist/esm/user/api/utils/index.js +1 -0
- package/dist/esm/user/hooks/index.js +2 -0
- package/dist/esm/user/hooks/useGetMyLoyaltyCard.js +4 -0
- package/dist/esm/user/hooks/useGetUserToken.js +5 -0
- package/dist/types/api/myCartApi/index.d.ts +1 -0
- package/dist/types/basket/api/index.d.ts +1 -0
- package/dist/types/basket/api/mutations/index.d.ts +1 -0
- package/dist/types/basket/api/mutations/useReplaceBasketMutation.d.ts +2 -0
- package/dist/types/basket/hooks/index.d.ts +2 -0
- package/dist/types/basket/hooks/useBasketCrossSaleItems.d.ts +9 -0
- package/dist/types/basket/hooks/useReplaceBasket.d.ts +2 -0
- package/dist/types/basket/index.d.ts +1 -0
- package/dist/types/checkout/api/keys.d.ts +1 -0
- package/dist/types/checkout/api/queries/index.d.ts +1 -0
- package/dist/types/checkout/api/queries/useBnpCalculateForCartQuery.d.ts +4 -0
- package/dist/types/checkout/hooks/index.d.ts +1 -0
- package/dist/types/checkout/hooks/useBnpCalculateForCart.d.ts +39 -0
- package/dist/types/contexts/CheckoutForm/hooks/usePayment/index.d.ts +2 -0
- package/dist/types/contexts/CheckoutForm/index.d.ts +2 -1
- package/dist/types/hooks/basket-hooks/useBasketItemList/index.d.ts +1 -0
- package/dist/types/hooks/order-hooks/api/queries/useOrderGetPaymentMethodQuery.d.ts +1 -16
- package/dist/types/hooks/order-hooks/useReferralOrders/index.d.ts +1 -0
- package/dist/types/hooks/useLineItem/index.d.ts +2 -2
- package/dist/types/hooks/useProduct/index.d.ts +1 -0
- package/dist/types/hooks/useProduct/utils/index.d.ts +1 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/listing/api/queries/useAggregateQuery.d.ts +4 -3
- package/dist/types/listing/types.d.ts +5 -0
- package/dist/types/navigation/components/SearchBox/Components/Container/index.d.ts +10 -9
- package/dist/types/navigation/components/SearchBox/Components/EmptyBox/index.d.ts +22 -21
- package/dist/types/navigation/components/SearchBox/Components/Products/Components/ProductCard/index.d.ts +8 -7
- package/dist/types/navigation/components/SearchBox/Components/Products/index.d.ts +9 -8
- package/dist/types/navigation/components/SearchBox/index.d.ts +31 -30
- package/dist/types/order/api/mutations/index.d.ts +1 -0
- package/dist/types/order/api/mutations/useUpdateCustomLineItemMutation.d.ts +2 -5
- package/dist/types/order/api/mutations/useUpdateOrderCustomFieldMutation.d.ts +9 -0
- package/dist/types/order/hooks/index.d.ts +1 -0
- package/dist/types/order/hooks/useUpdateCustomLineItem.d.ts +2 -2
- package/dist/types/order/hooks/useUpdateOrderCustomField.d.ts +2 -0
- package/dist/types/product/api/keys.d.ts +1 -0
- package/dist/types/product/api/queries/index.d.ts +1 -0
- package/dist/types/product/api/queries/useBnpOffersQuery.d.ts +5 -0
- package/dist/types/product/hooks/index.d.ts +1 -0
- package/dist/types/product/hooks/useBnpOffers.d.ts +37 -0
- package/dist/types/product/index.d.ts +1 -0
- package/dist/types/user/api/queries/index.d.ts +1 -0
- package/dist/types/user/api/queries/useGetMyLoyaltyCardQuery.d.ts +5 -0
- package/dist/types/user/api/utils/getUserToken.d.ts +1 -0
- package/dist/types/user/api/utils/index.d.ts +1 -0
- package/dist/types/user/hooks/index.d.ts +2 -0
- package/dist/types/user/hooks/useGetMyLoyaltyCard.d.ts +2 -0
- package/dist/types/user/hooks/useGetUserToken.d.ts +1 -0
- 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"
|
package/dist/esm/navigation/components/SearchBox/Components/Products/Components/ProductCard/index.js
CHANGED
@@ -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 ?
|
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
|
@@ -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
|
+
};
|
@@ -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
|
+
};
|
@@ -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
|
+
};
|
@@ -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,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 @@
|
|
1
|
+
export * from './hooks';
|
@@ -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;
|
@@ -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 {};
|
@@ -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 = {
|
package/dist/types/index.d.ts
CHANGED
@@ -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';
|