@sentecacommerce-theme/lib 0.13.5-alpha.9 → 0.13.7-alpha.7
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.v2/core/checkout/payments/useSetMerchantPaymentMethod.js +1 -1
- package/dist/cjs/checkout/hooks/useBnpCalculateForCart.js +1 -1
- package/dist/cjs/components/Html/index.js +1 -1
- package/dist/cjs/components/Portal/index.js +1 -1
- package/dist/cjs/hooks/ui-hooks/useIsDesktop/index.js +2 -2
- package/dist/cjs/hooks/useAllSelectedFilters/index.js +3 -3
- package/dist/cjs/hooks/usePrice/index.js +1 -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/listing/api/queries/useAggregateQuery.js +7 -7
- package/dist/cjs/listing/api/queries/useInfiniteListing.js +4 -4
- package/dist/cjs/listing/api/queries/useListingQuery.js +18 -21
- 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 +3 -5
- package/dist/cjs/listing/hooks/useListingFilters.js +18 -19
- 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 +3 -4
- package/dist/cjs/listing/hooks/useListingSlug.js +3 -1
- package/dist/cjs/listing/hooks/useSlideFilter.js +4 -3
- package/dist/cjs/listing/hooks/useSort.js +48 -17
- package/dist/cjs/listing/hooks/utils.js +2 -1
- package/dist/cjs/listing/ssr/prefetchCategories.js +1 -1
- package/dist/cjs/listing/ssr/prefetchListing.js +7 -8
- package/dist/cjs/listing/utils/buildCategoryQuery.js +8 -9
- package/dist/cjs/listing/utils/buildFilterQuery.js +5 -7
- package/dist/cjs/listing/utils/calculateOffset.js +1 -1
- 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/product/hooks/useBnpOffers.js +2 -25
- package/dist/cjs/seo/components/GlobalSEO/index.js +3 -3
- 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.v2/core/checkout/payments/useSetMerchantPaymentMethod.js +1 -1
- package/dist/esm/checkout/hooks/useBnpCalculateForCart.js +1 -1
- 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/hooks/ui-hooks/useIsDesktop/index.js +2 -2
- package/dist/esm/hooks/useAllSelectedFilters/index.js +4 -4
- package/dist/esm/hooks/usePrice/index.js +1 -1
- 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/listing/api/queries/useAggregateQuery.js +7 -7
- package/dist/esm/listing/api/queries/useInfiniteListing.js +4 -4
- package/dist/esm/listing/api/queries/useListingQuery.js +18 -21
- 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 +4 -6
- package/dist/esm/listing/hooks/useListingFilters.js +18 -19
- 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 +3 -4
- package/dist/esm/listing/hooks/useListingSlug.js +3 -1
- package/dist/esm/listing/hooks/useSlideFilter.js +5 -4
- package/dist/esm/listing/hooks/useSort.js +48 -17
- package/dist/esm/listing/hooks/utils.js +2 -1
- package/dist/esm/listing/ssr/prefetchCategories.js +2 -2
- package/dist/esm/listing/ssr/prefetchListing.js +7 -8
- package/dist/esm/listing/utils/buildCategoryQuery.js +8 -9
- package/dist/esm/listing/utils/buildFilterQuery.js +5 -7
- package/dist/esm/listing/utils/calculateOffset.js +1 -1
- 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/product/hooks/useBnpOffers.js +2 -2
- package/dist/esm/seo/components/GlobalSEO/index.js +3 -3
- package/dist/types/listing/api/queries/useAggregateQuery.d.ts +2 -1
- 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/useSort.d.ts +6 -5
- 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 -5
- package/dist/types/listing/ssr/prefetchPredicate.d.ts +2 -1
- package/dist/types/listing/types.d.ts +27 -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/types/index.d.ts +38 -40
- package/dist/types/utils/getSelectedFilters.d.ts +2 -1
- package/package.json +11 -5
package/dist/cjs/navigation/components/SearchBox/Components/Products/Components/ProductCard/index.js
CHANGED
@@ -160,7 +160,7 @@ var ProductCard = function(param) {
|
|
160
160
|
fontWeight: 400
|
161
161
|
}
|
162
162
|
}, name), /*#__PURE__*/ _react.default.createElement(PriceContainer, null, discountPrice ? /*#__PURE__*/ _react.default.createElement(Price, null, /*#__PURE__*/ _react.default.createElement(NewPrice, null, discountPrice.displayValue), /*#__PURE__*/ _react.default.createElement(OriginalPrice, null, price.displayValue)) : /*#__PURE__*/ _react.default.createElement(ProductCardPrice, {
|
163
|
-
color: priceColor
|
163
|
+
color: priceColor || ''
|
164
164
|
}, price.displayValue)))))), /*#__PURE__*/ _react.default.createElement(Divider, {
|
165
165
|
isLast: isLast
|
166
166
|
})));
|
@@ -37,7 +37,7 @@ var Products = function(param) {
|
|
37
37
|
labelsColor: labelsColor,
|
38
38
|
title: title,
|
39
39
|
offers: offers,
|
40
|
-
noData: !data || (data === null || data === void 0 ? void 0 : data.length) < 1
|
40
|
+
noData: !data || (data === null || data === void 0 ? void 0 : data.length) < 1 || null
|
41
41
|
}, Boolean(data === null || data === void 0 ? void 0 : data.length) ? /*#__PURE__*/ _react.default.createElement("div", {
|
42
42
|
className: "row ".concat(offers ? 'flex-column' : '')
|
43
43
|
}, data === null || data === void 0 ? void 0 : data.map(function(product, index) {
|
@@ -48,7 +48,7 @@ var Products = function(param) {
|
|
48
48
|
labelsColor: labelsColor,
|
49
49
|
priceColor: priceColor,
|
50
50
|
onClose: onClose,
|
51
|
-
isLast: index === (data === null || data === void 0 ? void 0 : data.length) - 1,
|
51
|
+
isLast: index === (data === null || data === void 0 ? void 0 : data.length) - 1 || null,
|
52
52
|
offers: offers,
|
53
53
|
productSpacing: productSpacing
|
54
54
|
}));
|
@@ -15,7 +15,7 @@ var RecentSearches = function(param) {
|
|
15
15
|
return(/*#__PURE__*/ _react.default.createElement(_.Container, {
|
16
16
|
labelsColor: labelsColor,
|
17
17
|
title: title,
|
18
|
-
noData: !data || (data === null || data === void 0 ? void 0 : data.length) < 1
|
18
|
+
noData: !data || (data === null || data === void 0 ? void 0 : data.length) < 1 || null
|
19
19
|
}, data && /*#__PURE__*/ _react.default.createElement(_recentsSearchesList.RecentSearchesList, {
|
20
20
|
data: data,
|
21
21
|
onClose: onClose,
|
@@ -173,7 +173,7 @@ var BottomMenuEnum1;
|
|
173
173
|
})(BottomMenuEnum1 || (BottomMenuEnum1 = {
|
174
174
|
}));
|
175
175
|
var SearchBox = function(param) {
|
176
|
-
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 ?
|
176
|
+
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;
|
177
177
|
var ref = (0, _index).useSearchHistory(), data = ref.data, loadingRecent = ref.isLoading;
|
178
178
|
var canDisplayRecent = !loadingRecent;
|
179
179
|
var searchHistory = data === null || data === void 0 ? void 0 : data.results;
|
@@ -201,21 +201,21 @@ var SearchBox = function(param) {
|
|
201
201
|
}, /*#__PURE__*/ _react.default.createElement(SearchBoxContent, {
|
202
202
|
isContainer: isContainer
|
203
203
|
}, /*#__PURE__*/ _react.default.createElement(Row, null, /*#__PURE__*/ _react.default.createElement(_components.Placeholder, null), showResults ? /*#__PURE__*/ _react.default.createElement(ResultsBox, null, /*#__PURE__*/ _react.default.createElement(SuggestedBrandsCol, {
|
204
|
-
backgroundColor: backgroundColor
|
204
|
+
backgroundColor: backgroundColor || ''
|
205
205
|
}, suggestedBrands.length !== 0 && /*#__PURE__*/ _react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/ _react.default.createElement(_components.Suggestions, {
|
206
206
|
data: displayableBrands,
|
207
207
|
onClose: onClose,
|
208
|
-
searchValue: searchValue,
|
209
|
-
title: labels.suggestedBrandsLabel,
|
210
|
-
labelsColor: labelsColor,
|
211
|
-
textColor: textColor
|
208
|
+
searchValue: searchValue || '',
|
209
|
+
title: (labels === null || labels === void 0 ? void 0 : labels.suggestedBrandsLabel) || '',
|
210
|
+
labelsColor: labelsColor || '',
|
211
|
+
textColor: textColor || ''
|
212
212
|
})), suggestedCategories.length > 0 && /*#__PURE__*/ _react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/ _react.default.createElement(_components.Suggestions, {
|
213
213
|
data: suggestedCategories,
|
214
214
|
onClose: onClose,
|
215
|
-
searchValue: searchValue,
|
216
|
-
title: labels.suggestedCategoriesLabel,
|
217
|
-
labelsColor: labelsColor,
|
218
|
-
textColor: textColor
|
215
|
+
searchValue: searchValue || '',
|
216
|
+
title: (labels === null || labels === void 0 ? void 0 : labels.suggestedCategoriesLabel) || '',
|
217
|
+
labelsColor: labelsColor || '',
|
218
|
+
textColor: textColor || ''
|
219
219
|
}))), /*#__PURE__*/ _react.default.createElement(ProductsWrapper, {
|
220
220
|
backgroundColor: backgroundColor
|
221
221
|
}, /*#__PURE__*/ _react.default.createElement(_components.Products, {
|
@@ -244,7 +244,7 @@ var SearchBox = function(param) {
|
|
244
244
|
onClose: onClose,
|
245
245
|
searchHistory: searchHistory,
|
246
246
|
textColor: textColor,
|
247
|
-
canDisplayRecent: canDisplayRecent,
|
247
|
+
canDisplayRecent: canDisplayRecent || null,
|
248
248
|
withRecent: withRecent,
|
249
249
|
promoOffers: promoOffers,
|
250
250
|
searchValue: searchValue
|
@@ -2,7 +2,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
2
2
|
value: true
|
3
3
|
});
|
4
4
|
exports.useBnpOffers = void 0;
|
5
|
-
var _react =
|
5
|
+
var _react = require("react");
|
6
6
|
var _queries = require("../api/queries");
|
7
7
|
var _index = require("../../index");
|
8
8
|
function _defineProperty(obj, key, value) {
|
@@ -18,29 +18,6 @@ function _defineProperty(obj, key, value) {
|
|
18
18
|
}
|
19
19
|
return obj;
|
20
20
|
}
|
21
|
-
function _interopRequireWildcard(obj) {
|
22
|
-
if (obj && obj.__esModule) {
|
23
|
-
return obj;
|
24
|
-
} else {
|
25
|
-
var newObj = {
|
26
|
-
};
|
27
|
-
if (obj != null) {
|
28
|
-
for(var key in obj){
|
29
|
-
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
30
|
-
var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {
|
31
|
-
};
|
32
|
-
if (desc.get || desc.set) {
|
33
|
-
Object.defineProperty(newObj, key, desc);
|
34
|
-
} else {
|
35
|
-
newObj[key] = obj[key];
|
36
|
-
}
|
37
|
-
}
|
38
|
-
}
|
39
|
-
}
|
40
|
-
newObj.default = obj;
|
41
|
-
return newObj;
|
42
|
-
}
|
43
|
-
}
|
44
21
|
function _objectSpread(target) {
|
45
22
|
for(var i = 1; i < arguments.length; i++){
|
46
23
|
var source = arguments[i] != null ? arguments[i] : {
|
@@ -59,7 +36,7 @@ function _objectSpread(target) {
|
|
59
36
|
}
|
60
37
|
var useBnpOffers = function(props) {
|
61
38
|
var ref6, ref1, ref2, ref3;
|
62
|
-
var configLocale = (ref6 = (0, _index).useConfigState()) === null || ref6 === void 0 ? void 0 : (ref1 = ref6.price) === null || ref1 === void 0 ? void 0 : ref1.locale;
|
39
|
+
var configLocale = ((ref6 = (0, _index).useConfigState()) === null || ref6 === void 0 ? void 0 : (ref1 = ref6.price) === null || ref1 === void 0 ? void 0 : ref1.locale) || '';
|
63
40
|
var response = (0, _queries).useBnpOffersQuery(props);
|
64
41
|
return (0, _react).useMemo(function() {
|
65
42
|
var ref, ref4, ref5;
|
@@ -31,13 +31,13 @@ function GlobalSEO() {
|
|
31
31
|
dangerouslySetInnerHTML: (0, _utils).createDangerousMarkup(organizationJSONLd)
|
32
32
|
}), Boolean(defaultIcon) && /*#__PURE__*/ _react.default.createElement("link", {
|
33
33
|
rel: "icon",
|
34
|
-
href: defaultIcon
|
34
|
+
href: defaultIcon || ''
|
35
35
|
}), Boolean(favicon === null || favicon === void 0 ? void 0 : favicon.svg) && /*#__PURE__*/ _react.default.createElement("link", {
|
36
36
|
rel: "icon",
|
37
|
-
href: favicon === null || favicon === void 0 ? void 0 : favicon.svg,
|
37
|
+
href: (favicon === null || favicon === void 0 ? void 0 : favicon.svg) || '',
|
38
38
|
type: "image/svg+xml"
|
39
39
|
}), Boolean(favicon === null || favicon === void 0 ? void 0 : favicon.medium) && /*#__PURE__*/ _react.default.createElement("link", {
|
40
40
|
rel: "apple-touch-icon",
|
41
|
-
href: favicon === null || favicon === void 0 ? void 0 : favicon.medium
|
41
|
+
href: (favicon === null || favicon === void 0 ? void 0 : favicon.medium) || ''
|
42
42
|
})));
|
43
43
|
}
|
@@ -50,7 +50,7 @@ export var usePixelProductDetails = function() {
|
|
50
50
|
id: metaData._id,
|
51
51
|
sku: selectedVariant === null || selectedVariant === void 0 ? void 0 : selectedVariant.sku
|
52
52
|
}, {
|
53
|
-
merchantKey: defaultMerchant
|
53
|
+
merchantKey: defaultMerchant || ''
|
54
54
|
});
|
55
55
|
setSentData.on();
|
56
56
|
}
|
@@ -30,7 +30,7 @@ export var usePixel = function() {
|
|
30
30
|
var product = param.product, currencyCode = param.currencyCode;
|
31
31
|
pixel === null || pixel === void 0 ? void 0 : pixel.addLineItem(product, {
|
32
32
|
currencyCode: currencyCode,
|
33
|
-
merchantKey: defaultMerchant
|
33
|
+
merchantKey: defaultMerchant || ''
|
34
34
|
});
|
35
35
|
};
|
36
36
|
var pixelRemoveLineItem = function(param) {
|
@@ -156,7 +156,7 @@ export var RelevaProvider = function(param1) {
|
|
156
156
|
var ref3, ref4;
|
157
157
|
var token = (ref4 = (ref3 = Cookies.get('token')) !== null && ref3 !== void 0 ? ref3 : Cookies.get('anonymousToken')) !== null && ref4 !== void 0 ? ref4 : process.env.API_KEY;
|
158
158
|
var interfaceKey = useConfigState().interfaceKey;
|
159
|
-
var ref5 = useRelevaData(payload, isReady, token, interfaceKey), recommenders = ref5.recommenders, banners = ref5.banners, pixelData = ref5.pixelData;
|
159
|
+
var ref5 = useRelevaData(payload, isReady, token, interfaceKey || ''), recommenders = ref5.recommenders, banners = ref5.banners, pixelData = ref5.pixelData;
|
160
160
|
var values = {
|
161
161
|
onProductPage: onProductPage,
|
162
162
|
changeProfileData: changeProfileData,
|
@@ -4,7 +4,6 @@ export var addToCart = function(sku, quantity, price) {
|
|
4
4
|
var value = decodePrice(price) * quantity;
|
5
5
|
var currency = price.currencyCode;
|
6
6
|
window.fbq('track', 'AddToCart', {
|
7
|
-
// eslint-disable-next-line @typescript-eslint/camelcase
|
8
7
|
content_type: 'product',
|
9
8
|
value: value,
|
10
9
|
currency: currency,
|
@@ -10,7 +10,6 @@ export var initiateCheckout = function(order) {
|
|
10
10
|
var currency = order.currencyCode;
|
11
11
|
var value = decodePrice(order.grandTotalPrice);
|
12
12
|
window.fbq('track', 'InitiateCheckout', {
|
13
|
-
// eslint-disable-next-line @typescript-eslint/camelcase
|
14
13
|
content_type: 'product',
|
15
14
|
contents: contents,
|
16
15
|
currency: currency,
|
@@ -4,7 +4,6 @@ export var viewContent = function(data) {
|
|
4
4
|
var quantity = data.quantity, price = data.price, currency = data.currencyCode, id = data.sku;
|
5
5
|
var value = price * quantity;
|
6
6
|
window.fbq('track', 'ViewContent', {
|
7
|
-
// eslint-disable-next-line @typescript-eslint/camelcase
|
8
7
|
content_type: 'product',
|
9
8
|
value: value,
|
10
9
|
currency: currency,
|
@@ -7,7 +7,7 @@ export function useSetMerchantPaymentMethod(onSuccess) {
|
|
7
7
|
var config = useConfigState();
|
8
8
|
return useMutation(function(values) {
|
9
9
|
return MyCartSetMerchantsPaymentMethods({
|
10
|
-
methods: formatData(values, config.defaultMerchant)
|
10
|
+
methods: formatData(values, config.defaultMerchant || '')
|
11
11
|
});
|
12
12
|
}, {
|
13
13
|
onMutate: function() {
|
@@ -38,7 +38,7 @@ export var useBnpCalculateForCart = function(props) {
|
|
38
38
|
preferredInstallmentCentAmount: preferredInstallmentCentAmount,
|
39
39
|
downPaymentCentAmount: downPaymentCentAmount
|
40
40
|
});
|
41
|
-
var configLocale = (ref8 = useConfigState()) === null || ref8 === void 0 ? void 0 : (ref1 = ref8.price) === null || ref1 === void 0 ? void 0 : ref1.locale;
|
41
|
+
var configLocale = ((ref8 = useConfigState()) === null || ref8 === void 0 ? void 0 : (ref1 = ref8.price) === null || ref1 === void 0 ? void 0 : ref1.locale) || '';
|
42
42
|
return useMemo(function() {
|
43
43
|
var ref, ref5, ref6, ref7;
|
44
44
|
return _objectSpread({
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import regeneratorRuntime from "regenerator-runtime";
|
2
|
-
|
2
|
+
import React, { useCallback } from 'react';
|
3
3
|
import Cookies from 'js-cookie';
|
4
4
|
import { useLoginGoogle } from '../..';
|
5
5
|
import { ExternalScript } from '../ExternalScript';
|
@@ -23,7 +23,7 @@ export var Html = function(param) {
|
|
23
23
|
containerRef.current.querySelectorAll('a').forEach(function(a) {
|
24
24
|
var ref;
|
25
25
|
if (!((ref = a.href) === null || ref === void 0 ? void 0 : ref.trim())) return;
|
26
|
-
var isHrefLocal = a.href[0] === '/' || a.href.includes(domain);
|
26
|
+
var isHrefLocal = a.href[0] === '/' || domain && a.href.includes(domain);
|
27
27
|
if (isHrefLocal) {
|
28
28
|
a.addEventListener('click', cb);
|
29
29
|
links.push(a);
|
@@ -14,7 +14,7 @@ var Portal = function(param) {
|
|
14
14
|
// In that case, it's important to append to the correct document element.
|
15
15
|
var ownerDocument = mountNode.current.ownerDocument;
|
16
16
|
portalNode.current = ownerDocument === null || ownerDocument === void 0 ? void 0 : ownerDocument.createElement(type);
|
17
|
-
ownerDocument.body.appendChild(portalNode.current);
|
17
|
+
ownerDocument === null || ownerDocument === void 0 ? void 0 : ownerDocument.body.appendChild(portalNode.current);
|
18
18
|
forceUpdate();
|
19
19
|
return function() {
|
20
20
|
if (portalNode.current && portalNode.current.ownerDocument) {
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { useConfigState } from '../../useConfig';
|
2
2
|
export var useIsDesktop = function() {
|
3
|
-
var ref;
|
3
|
+
var ref, ref1, ref2, ref3, ref4;
|
4
4
|
var config = useConfigState();
|
5
|
-
return typeof document !== 'undefined' && document.body.clientWidth > Number((ref = config.theme.breakpoints) === null ||
|
5
|
+
return typeof document !== 'undefined' && document.body.clientWidth > Number((ref = config) === null || ref === void 0 ? void 0 : (ref1 = ref.theme) === null || ref1 === void 0 ? void 0 : (ref2 = ref1.breakpoints) === null || ref2 === void 0 ? void 0 : (ref3 = ref2.lg) === null || ref3 === void 0 ? void 0 : (ref4 = ref3.min) === null || ref4 === void 0 ? void 0 : ref4.split('px')[0]);
|
6
6
|
};
|
@@ -1,14 +1,14 @@
|
|
1
1
|
import { useMemo } from 'react';
|
2
2
|
import { useRouter } from 'next/router';
|
3
3
|
import { getSelectedFilters } from '../../utils';
|
4
|
-
import { useListingAlias,
|
4
|
+
import { useListingAlias, useListingConfig } from '../../index';
|
5
5
|
export var useAllSelectedFilters = function(aggregations) {
|
6
6
|
var router = useRouter();
|
7
|
-
var
|
8
|
-
var slug = useListingAlias().slug;
|
7
|
+
var meta = useListingConfig().meta;
|
8
|
+
var slug = useListingAlias(meta).slug;
|
9
9
|
return useMemo(function() {
|
10
10
|
return (aggregations === null || aggregations === void 0 ? void 0 : aggregations.reduce(function(items, filter) {
|
11
|
-
return items.concat(getSelectedFilters(router, slug, filter,
|
11
|
+
return items.concat(getSelectedFilters(router, slug, filter, meta));
|
12
12
|
}, [])) || [];
|
13
13
|
}, [
|
14
14
|
aggregations,
|
@@ -9,7 +9,7 @@ import { useConfigState } from '../useConfig';
|
|
9
9
|
*/ export var usePrice = function(param) {
|
10
10
|
var price = param.price, discountedPrice = param.discountedPrice;
|
11
11
|
var ref, ref1;
|
12
|
-
var configLocale = (ref = useConfigState()) === null || ref === void 0 ? void 0 : (ref1 = ref.price) === null || ref1 === void 0 ? void 0 : ref1.locale;
|
12
|
+
var configLocale = ((ref = useConfigState()) === null || ref === void 0 ? void 0 : (ref1 = ref.price) === null || ref1 === void 0 ? void 0 : ref1.locale) || '';
|
13
13
|
var precision = (price === null || price === void 0 ? void 0 : price.fractionDigits) || 2;
|
14
14
|
var currency = (price === null || price === void 0 ? void 0 : price.currencyCode) || 'BGN' // to be replaced with interface currencyCode
|
15
15
|
;
|
@@ -1,9 +1,9 @@
|
|
1
1
|
import { useRouter } from 'next/router';
|
2
2
|
import { getSelectedFilters } from '../../utils';
|
3
|
-
import { useListingAlias,
|
3
|
+
import { useListingAlias, useListingConfig } from '../../index';
|
4
4
|
export var useSelectedFilters = function(filters) {
|
5
5
|
var router = useRouter();
|
6
|
-
var
|
7
|
-
var slug = useListingAlias().slug;
|
8
|
-
return getSelectedFilters(router, slug, filters,
|
6
|
+
var meta = useListingConfig().meta;
|
7
|
+
var slug = useListingAlias(meta).slug;
|
8
|
+
return getSelectedFilters(router, slug, filters, meta);
|
9
9
|
};
|
@@ -10,8 +10,7 @@ function mapVoucherData(element) {
|
|
10
10
|
var limitValue = element.cartDiscounts[0].resource.maxDiscountValue.centAmount;
|
11
11
|
var limitCurrency = element.cartDiscounts[0].resource.maxDiscountValue.currencyCode;
|
12
12
|
var endDate = new Date(element.validTo).toLocaleDateString('bg-BG');
|
13
|
-
var isUsed =
|
14
|
-
element.totalApplications >= element.maxApplicationsPerCustomer;
|
13
|
+
var isUsed = element.totalApplications >= ((element === null || element === void 0 ? void 0 : element.maxApplicationsPerCustomer) || 1);
|
15
14
|
return {
|
16
15
|
voucherCode: voucherCode,
|
17
16
|
campaign: campaign,
|
@@ -7,7 +7,7 @@ import { useListingAlias } from '../../hooks';
|
|
7
7
|
import { ListingTypesEnum } from '../../types';
|
8
8
|
import { getListingPageType, buildCategoryQuery, buildFilterQuery } from '../../utils';
|
9
9
|
import { canUseDOM } from '../../../utils';
|
10
|
-
import {
|
10
|
+
import { useListingConfig } from '../..';
|
11
11
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
12
12
|
try {
|
13
13
|
var info = gen[key](arg);
|
@@ -76,11 +76,11 @@ export { AggregateRequestEnum1 as AggregateRequestEnum, };
|
|
76
76
|
export var useAggregateQuery = function(aggregates, request, sort) {
|
77
77
|
var router = useRouter();
|
78
78
|
var ref = usePredicate(), predicate = ref.data;
|
79
|
-
var
|
79
|
+
var meta = useListingConfig().meta;
|
80
80
|
var postFilter = getPostFilters(router);
|
81
81
|
var aggregateKeys = generateAggregateKey(aggregates);
|
82
82
|
var predicateId = predicate === null || predicate === void 0 ? void 0 : predicate._id;
|
83
|
-
var ref1 = useListingAlias(), aliasedSlug = ref1.slug;
|
83
|
+
var ref1 = useListingAlias(meta), aliasedSlug = ref1.slug;
|
84
84
|
var queryKeys = [
|
85
85
|
request.toString(),
|
86
86
|
aggregateKeys,
|
@@ -105,7 +105,7 @@ export var useAggregateQuery = function(aggregates, request, sort) {
|
|
105
105
|
router: router,
|
106
106
|
postFilter: postFilter,
|
107
107
|
slug: aliasedSlug,
|
108
|
-
config:
|
108
|
+
config: meta
|
109
109
|
});
|
110
110
|
if (sort) {
|
111
111
|
query = _objectSpread({
|
@@ -126,7 +126,7 @@ export var useAggregateQuery = function(aggregates, request, sort) {
|
|
126
126
|
})), {
|
127
127
|
refetchOnMount: false,
|
128
128
|
refetchOnWindowFocus: false,
|
129
|
-
enabled: isQueryEnabled(router, aliasedSlug, predicateId,
|
129
|
+
enabled: isQueryEnabled(router, aliasedSlug, predicateId, meta),
|
130
130
|
keepPreviousData: true,
|
131
131
|
staleTime: 30000
|
132
132
|
});
|
@@ -168,8 +168,8 @@ function getPostFilters(router) {
|
|
168
168
|
var query = router.query;
|
169
169
|
return query && Array.isArray(query.filter) ? query === null || query === void 0 ? void 0 : (ref = query.filter) === null || ref === void 0 ? void 0 : ref.join('&') : query === null || query === void 0 ? void 0 : query.filter;
|
170
170
|
}
|
171
|
-
function isQueryEnabled(router, slug, predicate,
|
172
|
-
var pageType = getListingPageType(router, slug,
|
171
|
+
function isQueryEnabled(router, slug, predicate, meta) {
|
172
|
+
var pageType = getListingPageType(router, slug, meta);
|
173
173
|
if (pageType === ListingTypesEnum.Search) {
|
174
174
|
return canUseDOM();
|
175
175
|
}
|
@@ -71,8 +71,8 @@ export var useInfiniteListing = function() {
|
|
71
71
|
var config = useListingConfig();
|
72
72
|
var ref3 = usePredicate(), predicate = ref3.data;
|
73
73
|
var query = router.query;
|
74
|
-
var ref1 = useListingAlias(), aliasedSlug = ref1.slug;
|
75
|
-
var limit = config.
|
74
|
+
var ref1 = useListingAlias(config.meta), aliasedSlug = ref1.slug;
|
75
|
+
var limit = config.meta.limit || 24;
|
76
76
|
var postFilter = getPostFilters(router);
|
77
77
|
var ref2;
|
78
78
|
var queryKeys = getListingQueryKeys({
|
@@ -95,11 +95,11 @@ export var useInfiniteListing = function() {
|
|
95
95
|
data = processListingQuery({
|
96
96
|
predicate: predicate,
|
97
97
|
limit: limit,
|
98
|
-
sort: config === null || config === void 0 ? void 0 : config.defaultSortKey,
|
98
|
+
sort: (config === null || config === void 0 ? void 0 : config.defaultSortKey) || 'defaultSort',
|
99
99
|
router: router,
|
100
100
|
postFilter: postFilter,
|
101
101
|
offset: offset,
|
102
|
-
config: config,
|
102
|
+
config: config.meta,
|
103
103
|
slug: aliasedSlug
|
104
104
|
});
|
105
105
|
return _ctx.abrupt("return", data);
|
@@ -6,7 +6,6 @@ import { useListingConfig, useListingSlug, useListingAlias } from '../../hooks';
|
|
6
6
|
import { getListingQueryKeys, usePredicate } from '..';
|
7
7
|
import { ListingTypesEnum } from '../../types';
|
8
8
|
import { calculateOffset, getListingPageType, getPostFilters, extendFilter } from '../../utils';
|
9
|
-
import { useConfigState } from '../../..';
|
10
9
|
function _arrayWithHoles(arr) {
|
11
10
|
if (Array.isArray(arr)) return arr;
|
12
11
|
}
|
@@ -97,25 +96,21 @@ function _slicedToArray(arr, i) {
|
|
97
96
|
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest();
|
98
97
|
}
|
99
98
|
export var useListingQuery = function() {
|
100
|
-
var ref
|
99
|
+
var ref;
|
101
100
|
var router = useRouter();
|
102
101
|
var slug = useListingSlug();
|
103
102
|
var config = useListingConfig();
|
104
|
-
var
|
105
|
-
var
|
106
|
-
var ref4 = useListingAlias(), aliasedSlug = ref4.slug;
|
103
|
+
var ref1 = usePredicate(), predicate = ref1.data;
|
104
|
+
var ref2 = useListingAlias(config.meta), aliasedSlug = ref2.slug;
|
107
105
|
var query = router.query;
|
108
106
|
var postFilter = getPostFilters(router);
|
109
|
-
var
|
110
|
-
var
|
111
|
-
var _sort, ref7;
|
112
|
-
var sort = (ref7 = (_sort = query.sort) !== null && _sort !== void 0 ? _sort : globalConfig === null || globalConfig === void 0 ? void 0 : (ref2 = globalConfig.listing) === null || ref2 === void 0 ? void 0 : ref2.defaultSortKey) !== null && ref7 !== void 0 ? ref7 : 'defaultSort';
|
107
|
+
var limit = !!router.query.limit ? Number(router.query.limit) : (config === null || config === void 0 ? void 0 : (ref = config.meta) === null || ref === void 0 ? void 0 : ref.limit) || 24;
|
108
|
+
var sort = query.sort || (config === null || config === void 0 ? void 0 : config.defaultSortKey) || 'defaultSort';
|
113
109
|
var offset = calculateOffset(query === null || query === void 0 ? void 0 : query.page, limit);
|
114
|
-
var _sort1, ref8;
|
115
110
|
var queryKeys = getListingQueryKeys({
|
116
111
|
type: config.type,
|
117
112
|
predicate: predicate,
|
118
|
-
sort:
|
113
|
+
sort: sort,
|
119
114
|
postFilter: postFilter,
|
120
115
|
slug: slug,
|
121
116
|
offset: offset
|
@@ -125,18 +120,21 @@ export var useListingQuery = function() {
|
|
125
120
|
return regeneratorRuntime.wrap(function _callee$(_ctx) {
|
126
121
|
while(1)switch(_ctx.prev = _ctx.next){
|
127
122
|
case 0:
|
128
|
-
|
123
|
+
_ctx.next = 2;
|
124
|
+
return processListingQuery({
|
129
125
|
predicate: predicate,
|
130
126
|
limit: limit,
|
131
127
|
sort: sort,
|
132
128
|
router: router,
|
133
129
|
postFilter: postFilter,
|
134
130
|
offset: offset,
|
135
|
-
config:
|
131
|
+
config: config.meta,
|
136
132
|
slug: aliasedSlug
|
137
133
|
});
|
138
|
-
return _ctx.abrupt("return", data);
|
139
134
|
case 2:
|
135
|
+
data = _ctx.sent;
|
136
|
+
return _ctx.abrupt("return", data);
|
137
|
+
case 4:
|
140
138
|
case "end":
|
141
139
|
return _ctx.stop();
|
142
140
|
}
|
@@ -155,12 +153,11 @@ export function processListingQuery(_) {
|
|
155
153
|
}
|
156
154
|
function _processListingQuery() {
|
157
155
|
_processListingQuery = _asyncToGenerator(regeneratorRuntime.mark(function _callee(param) {
|
158
|
-
var predicate, router, limit, sort, postFilter, offset, config, slug,
|
156
|
+
var predicate, router, limit, sort, postFilter, offset, config, slug, query, type, filter, _sort;
|
159
157
|
return regeneratorRuntime.wrap(function _callee$(_ctx) {
|
160
158
|
while(1)switch(_ctx.prev = _ctx.next){
|
161
159
|
case 0:
|
162
160
|
predicate = param.predicate, router = param.router, limit = param.limit, sort = param.sort, postFilter = param.postFilter, offset = param.offset, config = param.config, slug = param.slug;
|
163
|
-
;
|
164
161
|
query = router.query;
|
165
162
|
type = getListingPageType(router, slug, config);
|
166
163
|
filter = generateFilter(type, query, slug, predicate);
|
@@ -170,16 +167,16 @@ function _processListingQuery() {
|
|
170
167
|
offset: offset || 0,
|
171
168
|
filter: extendFilter({
|
172
169
|
slug: filter,
|
173
|
-
filterExtension: config === null || config === void 0 ? void 0 :
|
170
|
+
filterExtension: config === null || config === void 0 ? void 0 : config.filterExtension,
|
174
171
|
noSplit: true
|
175
172
|
}),
|
176
173
|
sort: (_sort = query.sort) !== null && _sort !== void 0 ? _sort : sort
|
177
174
|
}, (query === null || query === void 0 ? void 0 : query.filter) && {
|
178
175
|
postFilter: postFilter
|
179
|
-
}, (config === null || config === void 0 ? void 0 : config.
|
180
|
-
collapseMode: config === null || config === void 0 ? void 0 : config.
|
176
|
+
}, (config === null || config === void 0 ? void 0 : config.collapseMode) && type !== ListingTypesEnum.Collection && {
|
177
|
+
collapseMode: config === null || config === void 0 ? void 0 : config.collapseMode
|
181
178
|
})));
|
182
|
-
case
|
179
|
+
case 6:
|
183
180
|
case "end":
|
184
181
|
return _ctx.stop();
|
185
182
|
}
|
@@ -212,6 +209,6 @@ export function isListingQueryEnabled(type, predicate) {
|
|
212
209
|
return false;
|
213
210
|
}
|
214
211
|
function parseAttribute(slug) {
|
215
|
-
var ref = _slicedToArray(slug.split('-'), 2), type = ref[0], val = ref[1];
|
212
|
+
var ref = _slicedToArray((slug === null || slug === void 0 ? void 0 : slug.split('-')) || [], 2), type = ref[0], val = ref[1];
|
216
213
|
return "attr.".concat(type, ";eq;\"").concat(val, "\"");
|
217
214
|
}
|
@@ -2,11 +2,11 @@ import regeneratorRuntime from "regenerator-runtime";
|
|
2
2
|
import { BrandsGetBySlug, CategoriesGetBySlug, ViewsGetBySlug, ProductsGetAttributeLabel, CollectionsGetBySlug } from '@sentecacommerce/sdk';
|
3
3
|
import { useQuery } from 'react-query';
|
4
4
|
import { useRouter } from 'next/router';
|
5
|
-
import { useConfigState } from '../../../index';
|
6
5
|
import { ListingTypesEnum } from '../../types';
|
7
6
|
import { ListingQueryKeysEnum } from '../';
|
8
7
|
import { getListingPageType } from '../../utils';
|
9
8
|
import { useListingSlug, useListingAlias } from '../../hooks';
|
9
|
+
import { useListingConfig } from '../..';
|
10
10
|
function _arrayWithHoles(arr) {
|
11
11
|
if (Array.isArray(arr)) return arr;
|
12
12
|
}
|
@@ -85,9 +85,9 @@ var getBySlugMap = (_obj = {
|
|
85
85
|
}, _defineProperty(_obj, ListingTypesEnum.Category, CategoriesGetBySlug), _defineProperty(_obj, ListingTypesEnum.View, ViewsGetBySlug), _defineProperty(_obj, ListingTypesEnum.Brand, BrandsGetBySlug), _defineProperty(_obj, ListingTypesEnum.Collection, CollectionsGetBySlug), _obj);
|
86
86
|
export var usePredicate = function() {
|
87
87
|
var slug = useListingSlug();
|
88
|
+
var meta = useListingConfig().meta;
|
88
89
|
var router = useRouter();
|
89
|
-
var
|
90
|
-
var ref = useListingAlias(), aliasedSlug = ref.slug;
|
90
|
+
var ref = useListingAlias(meta), aliasedSlug = ref.slug;
|
91
91
|
var attribute = router.query.cat && aliasedSlug;
|
92
92
|
return useQuery([
|
93
93
|
ListingQueryKeysEnum.usePredicate,
|
@@ -99,7 +99,7 @@ export var usePredicate = function() {
|
|
99
99
|
while(1)switch(_ctx.prev = _ctx.next){
|
100
100
|
case 0:
|
101
101
|
_ctx.next = 2;
|
102
|
-
return processPredicateRequest(slug, router, aliasedSlug,
|
102
|
+
return processPredicateRequest(slug, router, aliasedSlug, meta);
|
103
103
|
case 2:
|
104
104
|
data = _ctx.sent;
|
105
105
|
return _ctx.abrupt("return", data);
|
@@ -27,7 +27,7 @@ import { useListingMeta } from '../hooks';
|
|
27
27
|
}), /*#__PURE__*/ React.createElement(OpenGraph, {
|
28
28
|
title: formattedTitle,
|
29
29
|
type: "website",
|
30
|
-
image: image || topBanner || imagesConfig.fallbackImage,
|
30
|
+
image: image || topBanner || (imagesConfig === null || imagesConfig === void 0 ? void 0 : imagesConfig.fallbackImage) || '',
|
31
31
|
additionalProps: [
|
32
32
|
{
|
33
33
|
key: 'description',
|
@@ -1,12 +1,10 @@
|
|
1
1
|
import { getListingAlias } from '../utils';
|
2
|
-
import { useConfigState } from '../..';
|
3
2
|
import { useRouter } from 'next/router';
|
4
|
-
export var useListingAlias = function() {
|
3
|
+
export var useListingAlias = function(meta) {
|
5
4
|
var router = useRouter();
|
6
|
-
var config = useConfigState();
|
7
5
|
var slug = getListingAlias({
|
8
6
|
router: router,
|
9
|
-
config:
|
7
|
+
config: meta
|
10
8
|
});
|
11
9
|
return {
|
12
10
|
slug: slug
|