@sentecacommerce-theme/lib 0.13.5-alpha.7 → 0.13.7-alpha.6
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/Pixel/hooks/usePixelProductClick.js +1 -1
- package/dist/cjs/analytics/Pixel/hooks/usePixelProductDetails.js +1 -1
- package/dist/cjs/analytics/Pixel/hooks/usePixelProductsImpression.js +1 -1
- package/dist/cjs/analytics/Pixel/usePixel.js +1 -1
- package/dist/cjs/analytics/Releva/useReleva.js +1 -1
- 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/api.v2/core/checkout/payments/useSetMerchantPaymentMethod.js +1 -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/Html/index.js +1 -1
- 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/ui-hooks/useIsDesktop/index.js +2 -2
- package/dist/cjs/hooks/useAllSelectedFilters/index.js +3 -3
- package/dist/cjs/hooks/useLineItem/index.js +7 -0
- package/dist/cjs/hooks/usePrice/index.js +1 -1
- 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/useSelectedFilters/index.js +3 -3
- package/dist/cjs/hooks/useVouchers/index.js +1 -2
- package/dist/cjs/index.js +24 -0
- package/dist/cjs/listing/api/queries/useAggregateQuery.js +47 -12
- package/dist/cjs/listing/api/queries/useInfiniteListing.js +4 -4
- package/dist/cjs/listing/api/queries/useListingQuery.js +37 -22
- package/dist/cjs/listing/api/queries/usePredicate.js +4 -4
- package/dist/cjs/listing/components/BasicListingSEO.js +1 -1
- package/dist/cjs/listing/hooks/useListingAlias.js +2 -4
- package/dist/cjs/listing/hooks/useListingBreadcrumbs.js +4 -4
- package/dist/cjs/listing/hooks/useListingCategories.js +7 -8
- package/dist/cjs/listing/hooks/useListingConfig.js +4 -5
- package/dist/cjs/listing/hooks/useListingFilters.js +19 -20
- package/dist/cjs/listing/hooks/useListingItems.js +2 -2
- package/dist/cjs/listing/hooks/useListingMeta.js +5 -4
- package/dist/cjs/listing/hooks/useListingPagination.js +4 -4
- package/dist/cjs/listing/hooks/useListingSlug.js +3 -1
- package/dist/cjs/listing/hooks/useSlideFilter.js +4 -3
- package/dist/cjs/listing/hooks/utils.js +2 -1
- package/dist/cjs/listing/ssr/prefetchListing.js +4 -4
- package/dist/cjs/listing/types.js +8 -1
- package/dist/cjs/listing/utils/buildCategoryQuery.js +16 -12
- package/dist/cjs/listing/utils/buildFilterQuery.js +5 -7
- package/dist/cjs/listing/utils/getListingAlias.js +5 -6
- package/dist/cjs/listing/utils/getListingPageType.js +4 -3
- 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/PopularSearches/index.js +1 -1
- 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 +89 -0
- package/dist/cjs/product/index.js +15 -0
- package/dist/cjs/seo/components/GlobalSEO/index.js +3 -3
- 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/hooks/usePixelProductClick.js +1 -1
- package/dist/esm/analytics/Pixel/hooks/usePixelProductDetails.js +1 -1
- package/dist/esm/analytics/Pixel/hooks/usePixelProductsImpression.js +1 -1
- package/dist/esm/analytics/Pixel/mainScript.js +0 -1
- package/dist/esm/analytics/Pixel/usePixel.js +1 -1
- package/dist/esm/analytics/Releva/useReleva.js +1 -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/api.v2/core/checkout/payments/useSetMerchantPaymentMethod.js +1 -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/Html/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/ui-hooks/useIsDesktop/index.js +2 -2
- package/dist/esm/hooks/useAllSelectedFilters/index.js +4 -4
- package/dist/esm/hooks/useLineItem/index.js +2 -0
- package/dist/esm/hooks/usePrice/index.js +1 -1
- 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/useSelectedFilters/index.js +4 -4
- package/dist/esm/hooks/useVouchers/index.js +1 -2
- package/dist/esm/index.js +4 -0
- package/dist/esm/listing/api/queries/useAggregateQuery.js +47 -12
- package/dist/esm/listing/api/queries/useInfiniteListing.js +4 -4
- package/dist/esm/listing/api/queries/useListingQuery.js +37 -22
- package/dist/esm/listing/api/queries/usePredicate.js +4 -4
- package/dist/esm/listing/components/BasicListingSEO.js +1 -1
- package/dist/esm/listing/hooks/useListingAlias.js +2 -4
- package/dist/esm/listing/hooks/useListingBreadcrumbs.js +5 -5
- package/dist/esm/listing/hooks/useListingCategories.js +8 -9
- package/dist/esm/listing/hooks/useListingConfig.js +5 -6
- package/dist/esm/listing/hooks/useListingFilters.js +19 -20
- package/dist/esm/listing/hooks/useListingItems.js +2 -2
- package/dist/esm/listing/hooks/useListingMeta.js +6 -5
- package/dist/esm/listing/hooks/useListingPagination.js +4 -4
- package/dist/esm/listing/hooks/useListingSlug.js +3 -1
- package/dist/esm/listing/hooks/useSlideFilter.js +5 -4
- package/dist/esm/listing/hooks/utils.js +2 -1
- package/dist/esm/listing/ssr/prefetchListing.js +4 -4
- package/dist/esm/listing/types.js +7 -0
- package/dist/esm/listing/utils/buildCategoryQuery.js +16 -12
- package/dist/esm/listing/utils/buildFilterQuery.js +5 -7
- package/dist/esm/listing/utils/getListingAlias.js +5 -6
- package/dist/esm/listing/utils/getListingPageType.js +4 -3
- 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/PopularSearches/index.js +1 -1
- 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/seo/components/GlobalSEO/index.js +3 -3
- 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/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 +6 -4
- package/dist/types/listing/api/queries/useListingQuery.d.ts +4 -2
- package/dist/types/listing/api/queries/usePredicate.d.ts +2 -1
- package/dist/types/listing/hooks/useListingAlias.d.ts +2 -1
- package/dist/types/listing/hooks/useListingFilters.d.ts +0 -1
- package/dist/types/listing/hooks/useListingItems.d.ts +3 -2
- package/dist/types/listing/hooks/useListingSEOCategories.d.ts +6 -4
- package/dist/types/listing/hooks/utils.d.ts +3 -2
- package/dist/types/listing/ssr/prefetchCategories.d.ts +2 -2
- package/dist/types/listing/ssr/prefetchListing.d.ts +4 -4
- package/dist/types/listing/ssr/prefetchPredicate.d.ts +2 -1
- package/dist/types/listing/types.d.ts +32 -16
- package/dist/types/listing/utils/buildCategoryQuery.d.ts +2 -1
- package/dist/types/listing/utils/buildFilterQuery.d.ts +2 -1
- package/dist/types/listing/utils/extendFilter.d.ts +3 -2
- package/dist/types/listing/utils/getListingAlias.d.ts +2 -1
- package/dist/types/listing/utils/getListingPageType.d.ts +2 -2
- 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/types/index.d.ts +38 -40
- 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/dist/types/utils/getSelectedFilters.d.ts +2 -1
- package/package.json +19 -13
@@ -59,7 +59,7 @@ var usePixelProductDetails = function() {
|
|
59
59
|
id: metaData._id,
|
60
60
|
sku: selectedVariant === null || selectedVariant === void 0 ? void 0 : selectedVariant.sku
|
61
61
|
}, {
|
62
|
-
merchantKey: defaultMerchant
|
62
|
+
merchantKey: defaultMerchant || ''
|
63
63
|
});
|
64
64
|
setSentData.on();
|
65
65
|
}
|
@@ -40,7 +40,7 @@ var usePixel = function() {
|
|
40
40
|
var product = param.product, currencyCode = param.currencyCode;
|
41
41
|
pixel === null || pixel === void 0 ? void 0 : pixel.addLineItem(product, {
|
42
42
|
currencyCode: currencyCode,
|
43
|
-
merchantKey: defaultMerchant
|
43
|
+
merchantKey: defaultMerchant || ''
|
44
44
|
});
|
45
45
|
};
|
46
46
|
var pixelRemoveLineItem = function(param) {
|
@@ -166,7 +166,7 @@ var RelevaProvider = function(param1) {
|
|
166
166
|
var ref3, ref4;
|
167
167
|
var token = (ref4 = (ref3 = _jsCookie.default.get('token')) !== null && ref3 !== void 0 ? ref3 : _jsCookie.default.get('anonymousToken')) !== null && ref4 !== void 0 ? ref4 : process.env.API_KEY;
|
168
168
|
var interfaceKey = (0, _index).useConfigState().interfaceKey;
|
169
|
-
var ref5 = (0, _hooks).useRelevaData(payload, isReady, token, interfaceKey), recommenders = ref5.recommenders, banners = ref5.banners, pixelData = ref5.pixelData;
|
169
|
+
var ref5 = (0, _hooks).useRelevaData(payload, isReady, token, interfaceKey || ''), recommenders = ref5.recommenders, banners = ref5.banners, pixelData = ref5.pixelData;
|
170
170
|
var values = {
|
171
171
|
onProductPage: onProductPage,
|
172
172
|
changeProfileData: changeProfileData,
|
@@ -8,7 +8,6 @@ var addToCart = function(sku, quantity, price) {
|
|
8
8
|
var value = (0, _decodePrice).decodePrice(price) * quantity;
|
9
9
|
var currency = price.currencyCode;
|
10
10
|
window.fbq('track', 'AddToCart', {
|
11
|
-
// eslint-disable-next-line @typescript-eslint/camelcase
|
12
11
|
content_type: 'product',
|
13
12
|
value: value,
|
14
13
|
currency: currency,
|
@@ -14,7 +14,6 @@ var initiateCheckout = function(order) {
|
|
14
14
|
var currency = order.currencyCode;
|
15
15
|
var value = (0, _decodePrice).decodePrice(order.grandTotalPrice);
|
16
16
|
window.fbq('track', 'InitiateCheckout', {
|
17
|
-
// eslint-disable-next-line @typescript-eslint/camelcase
|
18
17
|
content_type: 'product',
|
19
18
|
contents: contents,
|
20
19
|
currency: currency,
|
@@ -7,7 +7,6 @@ var viewContent = function(data) {
|
|
7
7
|
var quantity = data.quantity, price = data.price, currency = data.currencyCode, id = data.sku;
|
8
8
|
var value = price * quantity;
|
9
9
|
window.fbq('track', 'ViewContent', {
|
10
|
-
// eslint-disable-next-line @typescript-eslint/camelcase
|
11
10
|
content_type: 'product',
|
12
11
|
value: value,
|
13
12
|
currency: currency,
|
@@ -52,7 +52,8 @@ var myCartCacheKeys = {
|
|
52
52
|
useGetShippingMethods: 'mycart-api-use-get-shippingmethods',
|
53
53
|
useGetAllShippingMethods: 'mycart-api-use-get-all-shippingmethods',
|
54
54
|
useGetPaymentMethods: 'mycart-api-use-get-paymentmethods',
|
55
|
-
useIsExisting: 'mycart-api-is-existing'
|
55
|
+
useIsExisting: 'mycart-api-is-existing',
|
56
|
+
useGetCrossSaleItems: 'mycart-api-use-get-cross-sale-products'
|
56
57
|
};
|
57
58
|
exports.myCartCacheKeys = myCartCacheKeys;
|
58
59
|
var LineItemType1;
|
@@ -11,7 +11,7 @@ function useSetMerchantPaymentMethod(onSuccess) {
|
|
11
11
|
var config = (0, _useConfig).useConfigState();
|
12
12
|
return (0, _reactQuery).useMutation(function(values) {
|
13
13
|
return (0, _sdk).MyCartSetMerchantsPaymentMethods({
|
14
|
-
methods: formatData(values, config.defaultMerchant)
|
14
|
+
methods: formatData(values, config.defaultMerchant || '')
|
15
15
|
});
|
16
16
|
}, {
|
17
17
|
onMutate: function() {
|
@@ -0,0 +1,37 @@
|
|
1
|
+
Object.defineProperty(exports, "__esModule", {
|
2
|
+
value: true
|
3
|
+
});
|
4
|
+
var _mutations = _interopRequireWildcard(require("./mutations"));
|
5
|
+
Object.keys(_mutations).forEach(function(key) {
|
6
|
+
if (key === "default" || key === "__esModule") return;
|
7
|
+
if (key in exports && exports[key] === _mutations[key]) return;
|
8
|
+
Object.defineProperty(exports, key, {
|
9
|
+
enumerable: true,
|
10
|
+
get: function() {
|
11
|
+
return _mutations[key];
|
12
|
+
}
|
13
|
+
});
|
14
|
+
});
|
15
|
+
function _interopRequireWildcard(obj) {
|
16
|
+
if (obj && obj.__esModule) {
|
17
|
+
return obj;
|
18
|
+
} else {
|
19
|
+
var newObj = {
|
20
|
+
};
|
21
|
+
if (obj != null) {
|
22
|
+
for(var key in obj){
|
23
|
+
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
24
|
+
var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {
|
25
|
+
};
|
26
|
+
if (desc.get || desc.set) {
|
27
|
+
Object.defineProperty(newObj, key, desc);
|
28
|
+
} else {
|
29
|
+
newObj[key] = obj[key];
|
30
|
+
}
|
31
|
+
}
|
32
|
+
}
|
33
|
+
}
|
34
|
+
newObj.default = obj;
|
35
|
+
return newObj;
|
36
|
+
}
|
37
|
+
}
|
@@ -0,0 +1,37 @@
|
|
1
|
+
Object.defineProperty(exports, "__esModule", {
|
2
|
+
value: true
|
3
|
+
});
|
4
|
+
var _useReplaceBasketMutation = _interopRequireWildcard(require("./useReplaceBasketMutation"));
|
5
|
+
Object.keys(_useReplaceBasketMutation).forEach(function(key) {
|
6
|
+
if (key === "default" || key === "__esModule") return;
|
7
|
+
if (key in exports && exports[key] === _useReplaceBasketMutation[key]) return;
|
8
|
+
Object.defineProperty(exports, key, {
|
9
|
+
enumerable: true,
|
10
|
+
get: function() {
|
11
|
+
return _useReplaceBasketMutation[key];
|
12
|
+
}
|
13
|
+
});
|
14
|
+
});
|
15
|
+
function _interopRequireWildcard(obj) {
|
16
|
+
if (obj && obj.__esModule) {
|
17
|
+
return obj;
|
18
|
+
} else {
|
19
|
+
var newObj = {
|
20
|
+
};
|
21
|
+
if (obj != null) {
|
22
|
+
for(var key in obj){
|
23
|
+
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
24
|
+
var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {
|
25
|
+
};
|
26
|
+
if (desc.get || desc.set) {
|
27
|
+
Object.defineProperty(newObj, key, desc);
|
28
|
+
} else {
|
29
|
+
newObj[key] = obj[key];
|
30
|
+
}
|
31
|
+
}
|
32
|
+
}
|
33
|
+
}
|
34
|
+
newObj.default = obj;
|
35
|
+
return newObj;
|
36
|
+
}
|
37
|
+
}
|
@@ -0,0 +1,58 @@
|
|
1
|
+
Object.defineProperty(exports, "__esModule", {
|
2
|
+
value: true
|
3
|
+
});
|
4
|
+
exports.useReplaceBasketMutation = void 0;
|
5
|
+
var _regeneratorRuntime = _interopRequireDefault(require("regenerator-runtime"));
|
6
|
+
var _react = _interopRequireDefault(require("react"));
|
7
|
+
var _reactQuery = require("react-query");
|
8
|
+
var _index = require("../../../index");
|
9
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
10
|
+
try {
|
11
|
+
var info = gen[key](arg);
|
12
|
+
var value = info.value;
|
13
|
+
} catch (error) {
|
14
|
+
reject(error);
|
15
|
+
return;
|
16
|
+
}
|
17
|
+
if (info.done) {
|
18
|
+
resolve(value);
|
19
|
+
} else {
|
20
|
+
Promise.resolve(value).then(_next, _throw);
|
21
|
+
}
|
22
|
+
}
|
23
|
+
function _asyncToGenerator(fn) {
|
24
|
+
return function() {
|
25
|
+
var self = this, args = arguments;
|
26
|
+
return new Promise(function(resolve, reject) {
|
27
|
+
var gen = fn.apply(self, args);
|
28
|
+
function _next(value) {
|
29
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
30
|
+
}
|
31
|
+
function _throw(err) {
|
32
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
33
|
+
}
|
34
|
+
_next(undefined);
|
35
|
+
});
|
36
|
+
};
|
37
|
+
}
|
38
|
+
function _interopRequireDefault(obj) {
|
39
|
+
return obj && obj.__esModule ? obj : {
|
40
|
+
default: obj
|
41
|
+
};
|
42
|
+
}
|
43
|
+
var useReplaceBasketMutation = function() {
|
44
|
+
var queryCache = (0, _reactQuery).useQueryCache();
|
45
|
+
return (0, _reactQuery).useMutation(_asyncToGenerator(_regeneratorRuntime.default.mark(function _callee(newBasket) {
|
46
|
+
return _regeneratorRuntime.default.wrap(function _callee$(_ctx) {
|
47
|
+
while(1)switch(_ctx.prev = _ctx.next){
|
48
|
+
case 0:
|
49
|
+
queryCache.setQueryData(_index.myCartCacheKeys.useGet, newBasket);
|
50
|
+
queryCache.setQueryData(_index.myCartCacheKeys.useGetCompact, newBasket.compact);
|
51
|
+
case 2:
|
52
|
+
case "end":
|
53
|
+
return _ctx.stop();
|
54
|
+
}
|
55
|
+
}, _callee);
|
56
|
+
})));
|
57
|
+
};
|
58
|
+
exports.useReplaceBasketMutation = useReplaceBasketMutation;
|
@@ -0,0 +1,52 @@
|
|
1
|
+
Object.defineProperty(exports, "__esModule", {
|
2
|
+
value: true
|
3
|
+
});
|
4
|
+
var _exportNames = {
|
5
|
+
};
|
6
|
+
var _useReplaceBasket = _interopRequireWildcard(require("./useReplaceBasket"));
|
7
|
+
Object.keys(_useReplaceBasket).forEach(function(key) {
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
9
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
10
|
+
if (key in exports && exports[key] === _useReplaceBasket[key]) return;
|
11
|
+
Object.defineProperty(exports, key, {
|
12
|
+
enumerable: true,
|
13
|
+
get: function() {
|
14
|
+
return _useReplaceBasket[key];
|
15
|
+
}
|
16
|
+
});
|
17
|
+
});
|
18
|
+
var _useBasketCrossSaleItems = _interopRequireWildcard(require("./useBasketCrossSaleItems"));
|
19
|
+
Object.keys(_useBasketCrossSaleItems).forEach(function(key) {
|
20
|
+
if (key === "default" || key === "__esModule") return;
|
21
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
22
|
+
if (key in exports && exports[key] === _useBasketCrossSaleItems[key]) return;
|
23
|
+
Object.defineProperty(exports, key, {
|
24
|
+
enumerable: true,
|
25
|
+
get: function() {
|
26
|
+
return _useBasketCrossSaleItems[key];
|
27
|
+
}
|
28
|
+
});
|
29
|
+
});
|
30
|
+
function _interopRequireWildcard(obj) {
|
31
|
+
if (obj && obj.__esModule) {
|
32
|
+
return obj;
|
33
|
+
} else {
|
34
|
+
var newObj = {
|
35
|
+
};
|
36
|
+
if (obj != null) {
|
37
|
+
for(var key in obj){
|
38
|
+
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
39
|
+
var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {
|
40
|
+
};
|
41
|
+
if (desc.get || desc.set) {
|
42
|
+
Object.defineProperty(newObj, key, desc);
|
43
|
+
} else {
|
44
|
+
newObj[key] = obj[key];
|
45
|
+
}
|
46
|
+
}
|
47
|
+
}
|
48
|
+
}
|
49
|
+
newObj.default = obj;
|
50
|
+
return newObj;
|
51
|
+
}
|
52
|
+
}
|
@@ -0,0 +1,99 @@
|
|
1
|
+
Object.defineProperty(exports, "__esModule", {
|
2
|
+
value: true
|
3
|
+
});
|
4
|
+
exports.useBasketCrossSaleItems = void 0;
|
5
|
+
var _regeneratorRuntime = _interopRequireDefault(require("regenerator-runtime"));
|
6
|
+
var _react = _interopRequireWildcard(require("react"));
|
7
|
+
var _reactQuery = require("react-query");
|
8
|
+
var _sdk = require("@sentecacommerce/sdk");
|
9
|
+
var _index = require("../../index");
|
10
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
11
|
+
try {
|
12
|
+
var info = gen[key](arg);
|
13
|
+
var value = info.value;
|
14
|
+
} catch (error) {
|
15
|
+
reject(error);
|
16
|
+
return;
|
17
|
+
}
|
18
|
+
if (info.done) {
|
19
|
+
resolve(value);
|
20
|
+
} else {
|
21
|
+
Promise.resolve(value).then(_next, _throw);
|
22
|
+
}
|
23
|
+
}
|
24
|
+
function _asyncToGenerator(fn) {
|
25
|
+
return function() {
|
26
|
+
var self = this, args = arguments;
|
27
|
+
return new Promise(function(resolve, reject) {
|
28
|
+
var gen = fn.apply(self, args);
|
29
|
+
function _next(value) {
|
30
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
31
|
+
}
|
32
|
+
function _throw(err) {
|
33
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
34
|
+
}
|
35
|
+
_next(undefined);
|
36
|
+
});
|
37
|
+
};
|
38
|
+
}
|
39
|
+
function _interopRequireDefault(obj) {
|
40
|
+
return obj && obj.__esModule ? obj : {
|
41
|
+
default: obj
|
42
|
+
};
|
43
|
+
}
|
44
|
+
function _interopRequireWildcard(obj) {
|
45
|
+
if (obj && obj.__esModule) {
|
46
|
+
return obj;
|
47
|
+
} else {
|
48
|
+
var newObj = {
|
49
|
+
};
|
50
|
+
if (obj != null) {
|
51
|
+
for(var key in obj){
|
52
|
+
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
53
|
+
var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {
|
54
|
+
};
|
55
|
+
if (desc.get || desc.set) {
|
56
|
+
Object.defineProperty(newObj, key, desc);
|
57
|
+
} else {
|
58
|
+
newObj[key] = obj[key];
|
59
|
+
}
|
60
|
+
}
|
61
|
+
}
|
62
|
+
}
|
63
|
+
newObj.default = obj;
|
64
|
+
return newObj;
|
65
|
+
}
|
66
|
+
}
|
67
|
+
var useBasketCrossSaleItems = function() {
|
68
|
+
var crossSaleProducts = (0, _reactQuery).useQuery(_index.myCartCacheKeys.useGetCrossSaleItems, _asyncToGenerator(_regeneratorRuntime.default.mark(function _callee() {
|
69
|
+
return _regeneratorRuntime.default.wrap(function _callee$(_ctx) {
|
70
|
+
while(1)switch(_ctx.prev = _ctx.next){
|
71
|
+
case 0:
|
72
|
+
_ctx.next = 2;
|
73
|
+
return (0, _sdk).MyCartGetCrossSaleProducts();
|
74
|
+
case 2:
|
75
|
+
return _ctx.abrupt("return", _ctx.sent);
|
76
|
+
case 3:
|
77
|
+
case "end":
|
78
|
+
return _ctx.stop();
|
79
|
+
}
|
80
|
+
}, _callee);
|
81
|
+
})));
|
82
|
+
return (0, _react).useMemo(function() {
|
83
|
+
var ref;
|
84
|
+
return crossSaleProducts === null || crossSaleProducts === void 0 ? void 0 : (ref = crossSaleProducts.data) === null || ref === void 0 ? void 0 : ref.map(function(product) {
|
85
|
+
return {
|
86
|
+
name: (0, _index).getTranslatableField(product.name),
|
87
|
+
description: (0, _index).getTranslatableField(product.description),
|
88
|
+
slug: (0, _index).getTranslatableField(product.slug),
|
89
|
+
attributeRules: product.attributeRules,
|
90
|
+
attributes: product.attributes,
|
91
|
+
_id: product._id,
|
92
|
+
variants: product.variants
|
93
|
+
};
|
94
|
+
});
|
95
|
+
}, [
|
96
|
+
crossSaleProducts === null || crossSaleProducts === void 0 ? void 0 : crossSaleProducts.data
|
97
|
+
]);
|
98
|
+
};
|
99
|
+
exports.useBasketCrossSaleItems = useBasketCrossSaleItems;
|
@@ -0,0 +1,37 @@
|
|
1
|
+
Object.defineProperty(exports, "__esModule", {
|
2
|
+
value: true
|
3
|
+
});
|
4
|
+
var _hooks = _interopRequireWildcard(require("./hooks"));
|
5
|
+
Object.keys(_hooks).forEach(function(key) {
|
6
|
+
if (key === "default" || key === "__esModule") return;
|
7
|
+
if (key in exports && exports[key] === _hooks[key]) return;
|
8
|
+
Object.defineProperty(exports, key, {
|
9
|
+
enumerable: true,
|
10
|
+
get: function() {
|
11
|
+
return _hooks[key];
|
12
|
+
}
|
13
|
+
});
|
14
|
+
});
|
15
|
+
function _interopRequireWildcard(obj) {
|
16
|
+
if (obj && obj.__esModule) {
|
17
|
+
return obj;
|
18
|
+
} else {
|
19
|
+
var newObj = {
|
20
|
+
};
|
21
|
+
if (obj != null) {
|
22
|
+
for(var key in obj){
|
23
|
+
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
24
|
+
var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {
|
25
|
+
};
|
26
|
+
if (desc.get || desc.set) {
|
27
|
+
Object.defineProperty(newObj, key, desc);
|
28
|
+
} else {
|
29
|
+
newObj[key] = obj[key];
|
30
|
+
}
|
31
|
+
}
|
32
|
+
}
|
33
|
+
}
|
34
|
+
newObj.default = obj;
|
35
|
+
return newObj;
|
36
|
+
}
|
37
|
+
}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
Object.defineProperty(exports, "__esModule", {
|
2
2
|
value: true
|
3
3
|
});
|
4
|
-
exports.getVerifyBoricaResponseKey = exports.CheckoutQueryKeysEnum = void 0;
|
4
|
+
exports.getBnpLoanCalculatorKey = exports.getVerifyBoricaResponseKey = exports.CheckoutQueryKeysEnum = void 0;
|
5
5
|
var CheckoutQueryKeysEnum;
|
6
6
|
exports.CheckoutQueryKeysEnum = CheckoutQueryKeysEnum;
|
7
7
|
(function(CheckoutQueryKeysEnum) {
|
@@ -11,3 +11,10 @@ var getVerifyBoricaResponseKey = function(order) {
|
|
11
11
|
return "Borica Response for Order: ".concat(order);
|
12
12
|
};
|
13
13
|
exports.getVerifyBoricaResponseKey = getVerifyBoricaResponseKey;
|
14
|
+
var getBnpLoanCalculatorKey = function(preferredInstallmentCentAmount) {
|
15
|
+
return [
|
16
|
+
'bnp-loan-calculator',
|
17
|
+
preferredInstallmentCentAmount
|
18
|
+
];
|
19
|
+
};
|
20
|
+
exports.getBnpLoanCalculatorKey = getBnpLoanCalculatorKey;
|
@@ -1,9 +1,12 @@
|
|
1
1
|
Object.defineProperty(exports, "__esModule", {
|
2
2
|
value: true
|
3
3
|
});
|
4
|
+
var _exportNames = {
|
5
|
+
};
|
4
6
|
var _useVerifyBoricaResponseQuery = _interopRequireWildcard(require("./useVerifyBoricaResponseQuery"));
|
5
7
|
Object.keys(_useVerifyBoricaResponseQuery).forEach(function(key) {
|
6
8
|
if (key === "default" || key === "__esModule") return;
|
9
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
7
10
|
if (key in exports && exports[key] === _useVerifyBoricaResponseQuery[key]) return;
|
8
11
|
Object.defineProperty(exports, key, {
|
9
12
|
enumerable: true,
|
@@ -12,6 +15,18 @@ Object.keys(_useVerifyBoricaResponseQuery).forEach(function(key) {
|
|
12
15
|
}
|
13
16
|
});
|
14
17
|
});
|
18
|
+
var _useBnpCalculateForCartQuery = _interopRequireWildcard(require("./useBnpCalculateForCartQuery"));
|
19
|
+
Object.keys(_useBnpCalculateForCartQuery).forEach(function(key) {
|
20
|
+
if (key === "default" || key === "__esModule") return;
|
21
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
22
|
+
if (key in exports && exports[key] === _useBnpCalculateForCartQuery[key]) return;
|
23
|
+
Object.defineProperty(exports, key, {
|
24
|
+
enumerable: true,
|
25
|
+
get: function() {
|
26
|
+
return _useBnpCalculateForCartQuery[key];
|
27
|
+
}
|
28
|
+
});
|
29
|
+
});
|
15
30
|
function _interopRequireWildcard(obj) {
|
16
31
|
if (obj && obj.__esModule) {
|
17
32
|
return obj;
|
@@ -0,0 +1,60 @@
|
|
1
|
+
Object.defineProperty(exports, "__esModule", {
|
2
|
+
value: true
|
3
|
+
});
|
4
|
+
exports.useBnpCalculateForCartQuery = void 0;
|
5
|
+
var _regeneratorRuntime = _interopRequireDefault(require("regenerator-runtime"));
|
6
|
+
var _react = _interopRequireDefault(require("react"));
|
7
|
+
var _reactQuery = require("react-query");
|
8
|
+
var _sdk = require("@sentecacommerce/sdk");
|
9
|
+
var _keys = require("../keys");
|
10
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
11
|
+
try {
|
12
|
+
var info = gen[key](arg);
|
13
|
+
var value = info.value;
|
14
|
+
} catch (error) {
|
15
|
+
reject(error);
|
16
|
+
return;
|
17
|
+
}
|
18
|
+
if (info.done) {
|
19
|
+
resolve(value);
|
20
|
+
} else {
|
21
|
+
Promise.resolve(value).then(_next, _throw);
|
22
|
+
}
|
23
|
+
}
|
24
|
+
function _asyncToGenerator(fn) {
|
25
|
+
return function() {
|
26
|
+
var self = this, args = arguments;
|
27
|
+
return new Promise(function(resolve, reject) {
|
28
|
+
var gen = fn.apply(self, args);
|
29
|
+
function _next(value) {
|
30
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
31
|
+
}
|
32
|
+
function _throw(err) {
|
33
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
34
|
+
}
|
35
|
+
_next(undefined);
|
36
|
+
});
|
37
|
+
};
|
38
|
+
}
|
39
|
+
function _interopRequireDefault(obj) {
|
40
|
+
return obj && obj.__esModule ? obj : {
|
41
|
+
default: obj
|
42
|
+
};
|
43
|
+
}
|
44
|
+
var useBnpCalculateForCartQuery = function(props) {
|
45
|
+
return (0, _reactQuery).useQuery((0, _keys).getBnpLoanCalculatorKey(props.preferredInstallmentCentAmount), _asyncToGenerator(_regeneratorRuntime.default.mark(function _callee() {
|
46
|
+
return _regeneratorRuntime.default.wrap(function _callee$(_ctx) {
|
47
|
+
while(1)switch(_ctx.prev = _ctx.next){
|
48
|
+
case 0:
|
49
|
+
_ctx.next = 2;
|
50
|
+
return (0, _sdk).MyPaymentsBnpCalculateLoanOrder(props);
|
51
|
+
case 2:
|
52
|
+
return _ctx.abrupt("return", _ctx.sent);
|
53
|
+
case 3:
|
54
|
+
case "end":
|
55
|
+
return _ctx.stop();
|
56
|
+
}
|
57
|
+
}, _callee);
|
58
|
+
})));
|
59
|
+
};
|
60
|
+
exports.useBnpCalculateForCartQuery = useBnpCalculateForCartQuery;
|
@@ -1,9 +1,12 @@
|
|
1
1
|
Object.defineProperty(exports, "__esModule", {
|
2
2
|
value: true
|
3
3
|
});
|
4
|
+
var _exportNames = {
|
5
|
+
};
|
4
6
|
var _useVerifyBoricaResponse = _interopRequireWildcard(require("./useVerifyBoricaResponse"));
|
5
7
|
Object.keys(_useVerifyBoricaResponse).forEach(function(key) {
|
6
8
|
if (key === "default" || key === "__esModule") return;
|
9
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
7
10
|
if (key in exports && exports[key] === _useVerifyBoricaResponse[key]) return;
|
8
11
|
Object.defineProperty(exports, key, {
|
9
12
|
enumerable: true,
|
@@ -12,6 +15,18 @@ Object.keys(_useVerifyBoricaResponse).forEach(function(key) {
|
|
12
15
|
}
|
13
16
|
});
|
14
17
|
});
|
18
|
+
var _useBnpCalculateForCart = _interopRequireWildcard(require("./useBnpCalculateForCart"));
|
19
|
+
Object.keys(_useBnpCalculateForCart).forEach(function(key) {
|
20
|
+
if (key === "default" || key === "__esModule") return;
|
21
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
22
|
+
if (key in exports && exports[key] === _useBnpCalculateForCart[key]) return;
|
23
|
+
Object.defineProperty(exports, key, {
|
24
|
+
enumerable: true,
|
25
|
+
get: function() {
|
26
|
+
return _useBnpCalculateForCart[key];
|
27
|
+
}
|
28
|
+
});
|
29
|
+
});
|
15
30
|
function _interopRequireWildcard(obj) {
|
16
31
|
if (obj && obj.__esModule) {
|
17
32
|
return obj;
|