@sentecacommerce-theme/lib 0.13.1 → 0.13.2
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/mainScript.js +2 -1
- package/dist/cjs/api/getSDKConfig.js +4 -2
- package/dist/cjs/api/myCartApi/index.js +8 -2
- package/dist/cjs/basket/api/mutations/index.js +14 -0
- package/dist/cjs/basket/api/mutations/useChangeGiftVariant.js +116 -0
- package/dist/cjs/basket/hooks/index.js +12 -0
- package/dist/cjs/basket/hooks/useChangeGiftVariant.js +16 -0
- package/dist/cjs/config/SentecaProvider.js +3 -1
- package/dist/cjs/hooks/useAggregateResult/index.js +5 -1
- package/dist/cjs/hooks/useAvailability/index.js +1 -1
- package/dist/cjs/hooks/useClearAllFilters/index.js +2 -0
- package/dist/cjs/hooks/useProduct/index.js +36 -26
- package/dist/cjs/hooks/wishlist-hooks/useWishlistItem/index.js +39 -15
- package/dist/cjs/listing/api/queries/useListingQuery.js +1 -1
- package/dist/cjs/listing/hooks/useListingBreadcrumbs.js +20 -8
- package/dist/cjs/listing/hooks/useListingCategories.js +2 -2
- package/dist/cjs/listing/hooks/useListingFilters.js +7 -1
- package/dist/cjs/listing/hooks/useListingMeta.js +51 -40
- package/dist/cjs/listing/hooks/useSlideFilter.js +27 -4
- package/dist/cjs/listing/ssr/prefetchCategories.js +5 -6
- package/dist/cjs/listing/ssr/prefetchPredicate.js +4 -4
- package/dist/cjs/listing/utils/buildCategoryQuery.js +22 -1
- package/dist/cjs/navigation/components/SearchBox/Components/EmptyBox/index.js +7 -7
- package/dist/cjs/navigation/components/SearchBox/index.js +4 -4
- package/dist/cjs/seo/components/TranslationsMeta/index.js +43 -14
- package/dist/cjs/seo/components/index.js +12 -0
- package/dist/cjs/seo/hooks/useSeoTranslations.js +55 -14
- package/dist/cjs/ui/components/GridStyles.js +2 -2
- package/dist/cjs/ui/components/RangeSliderInput.js +14 -1
- package/dist/cjs/user/api/queries/useGetMyLoyaltyCardQuery.js +49 -3
- package/dist/cjs/utils/getLocaleFromPath.js +13 -0
- package/dist/cjs/utils/getSelectedFilters.js +3 -1
- package/dist/cjs/utils/index.js +12 -0
- package/dist/cjs/utils/isTouchDevice.js +2 -1
- package/dist/cjs/utils/localStorage.js +7 -2
- package/dist/esm/analytics/Pixel/mainScript.js +2 -1
- package/dist/esm/api/getSDKConfig.js +5 -3
- package/dist/esm/api/myCartApi/index.js +8 -2
- package/dist/esm/basket/api/mutations/index.js +1 -0
- package/dist/esm/basket/api/mutations/useChangeGiftVariant.js +106 -0
- package/dist/esm/basket/hooks/index.js +1 -0
- package/dist/esm/basket/hooks/useChangeGiftVariant.js +3 -0
- package/dist/esm/config/SentecaProvider.js +3 -1
- package/dist/esm/hooks/useAggregateResult/index.js +5 -1
- package/dist/esm/hooks/useAvailability/index.js +1 -1
- package/dist/esm/hooks/useClearAllFilters/index.js +2 -0
- package/dist/esm/hooks/useProduct/index.js +28 -18
- package/dist/esm/hooks/wishlist-hooks/useWishlistItem/index.js +21 -13
- package/dist/esm/listing/api/queries/useListingQuery.js +1 -1
- package/dist/esm/listing/hooks/useListingBreadcrumbs.js +15 -3
- package/dist/esm/listing/hooks/useListingCategories.js +2 -2
- package/dist/esm/listing/hooks/useListingFilters.js +7 -1
- package/dist/esm/listing/hooks/useListingMeta.js +51 -42
- package/dist/esm/listing/hooks/useSlideFilter.js +27 -4
- package/dist/esm/listing/ssr/prefetchCategories.js +6 -7
- package/dist/esm/listing/ssr/prefetchPredicate.js +4 -4
- package/dist/esm/listing/utils/buildCategoryQuery.js +22 -1
- package/dist/esm/navigation/components/SearchBox/Components/EmptyBox/index.js +7 -7
- package/dist/esm/navigation/components/SearchBox/index.js +4 -4
- package/dist/esm/seo/components/TranslationsMeta/index.js +43 -14
- package/dist/esm/seo/components/index.js +1 -0
- package/dist/esm/seo/hooks/useSeoTranslations.js +55 -14
- package/dist/esm/ui/components/GridStyles.js +2 -2
- package/dist/esm/ui/components/RangeSliderInput.js +14 -1
- package/dist/esm/user/api/queries/useGetMyLoyaltyCardQuery.js +44 -3
- package/dist/esm/utils/getLocaleFromPath.js +8 -0
- package/dist/esm/utils/getSelectedFilters.js +3 -1
- package/dist/esm/utils/index.js +1 -0
- package/dist/esm/utils/isTouchDevice.js +2 -1
- package/dist/esm/utils/localStorage.js +7 -2
- package/dist/types/basket/api/mutations/index.d.ts +1 -0
- package/dist/types/basket/api/mutations/useChangeGiftVariant.d.ts +2 -0
- package/dist/types/basket/hooks/index.d.ts +1 -0
- package/dist/types/basket/hooks/useChangeGiftVariant.d.ts +2 -0
- package/dist/types/hooks/basket-hooks/useBasketLineItem/index.d.ts +1 -2
- package/dist/types/hooks/useProduct/index.d.ts +2 -1
- package/dist/types/listing/hooks/useListingMeta.d.ts +4 -0
- package/dist/types/listing/hooks/useSlideFilter.d.ts +4 -0
- package/dist/types/listing/types.d.ts +10 -0
- package/dist/types/navigation/components/SearchBox/Components/EmptyBox/index.d.ts +5 -4
- package/dist/types/navigation/components/SearchBox/index.d.ts +7 -6
- package/dist/types/seo/components/TranslationsMeta/index.d.ts +1 -0
- package/dist/types/seo/components/index.d.ts +1 -0
- package/dist/types/seo/hooks/useSeoTranslations.d.ts +5 -3
- package/dist/types/ui/components/GridStyles.d.ts +2 -1
- package/dist/types/ui/components/RangeSliderInput.d.ts +2 -1
- package/dist/types/utils/getLocaleFromPath.d.ts +1 -0
- package/dist/types/utils/index.d.ts +1 -0
- package/package.json +2 -2
@@ -1,38 +1,79 @@
|
|
1
1
|
import React from 'react';
|
2
|
+
import { useRouter } from 'next/router';
|
3
|
+
function _defineProperty(obj, key, value) {
|
4
|
+
if (key in obj) {
|
5
|
+
Object.defineProperty(obj, key, {
|
6
|
+
value: value,
|
7
|
+
enumerable: true,
|
8
|
+
configurable: true,
|
9
|
+
writable: true
|
10
|
+
});
|
11
|
+
} else {
|
12
|
+
obj[key] = value;
|
13
|
+
}
|
14
|
+
return obj;
|
15
|
+
}
|
16
|
+
function _objectSpread(target) {
|
17
|
+
for(var i = 1; i < arguments.length; i++){
|
18
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
19
|
+
var ownKeys = Object.keys(source);
|
20
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
21
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
22
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
23
|
+
}));
|
24
|
+
}
|
25
|
+
ownKeys.forEach(function(key) {
|
26
|
+
_defineProperty(target, key, source[key]);
|
27
|
+
});
|
28
|
+
}
|
29
|
+
return target;
|
30
|
+
}
|
2
31
|
var SeoTranslationsContext = /*#__PURE__*/ React.createContext({});
|
3
32
|
export var SeoTranslationsProvider = function(param) {
|
4
33
|
var children = param.children, translations = param.translations, defaultLocale = param.defaultLocale, localesMap = param.localesMap;
|
34
|
+
var router = useRouter();
|
35
|
+
var currentLocale = router.locale;
|
36
|
+
var currentPath = router.asPath;
|
5
37
|
var data1 = React.useMemo(function() {
|
6
|
-
|
7
|
-
|
38
|
+
if (!translations) translations = {};
|
39
|
+
translations[currentLocale] = {
|
40
|
+
slug: currentPath.split('?')[0].replace("/".concat(currentLocale), ''),
|
41
|
+
title: '',
|
42
|
+
id: Date.now().toString()
|
43
|
+
};
|
44
|
+
var map = Object.keys(translations || {}).filter(function(lang) {
|
8
45
|
return Boolean(localesMap[lang]);
|
9
|
-
}).
|
46
|
+
}).reduce(function(acc, lang) {
|
47
|
+
var ref;
|
10
48
|
var data = translations === null || translations === void 0 ? void 0 : translations[lang];
|
11
49
|
var localeData = localesMap[lang];
|
12
50
|
var isDefault = defaultLocale === lang;
|
13
|
-
var
|
14
|
-
|
15
|
-
|
51
|
+
var isFrontPage = data.slug === '/';
|
52
|
+
var prefix = ((ref = data.slug) === null || ref === void 0 ? void 0 : ref[0]) === '/' ? '' : '/';
|
53
|
+
var slug = "".concat(isDefault ? '' : "/".concat(lang)).concat(prefix).concat(isFrontPage ? '' : data.slug);
|
54
|
+
return _objectSpread({}, acc, _defineProperty({}, lang, {
|
16
55
|
slug: slug,
|
17
|
-
title: data.title,
|
18
56
|
locale: lang,
|
19
|
-
isDefault: isDefault
|
20
|
-
|
21
|
-
|
57
|
+
isDefault: isDefault,
|
58
|
+
domain: "https://".concat(localeData.domain)
|
59
|
+
}));
|
60
|
+
}, {});
|
22
61
|
return {
|
23
|
-
|
62
|
+
translationsMap: map,
|
24
63
|
defaultLocale: defaultLocale,
|
25
|
-
|
64
|
+
allLocales: Object.keys(localesMap)
|
26
65
|
};
|
27
66
|
}, [
|
28
67
|
defaultLocale,
|
29
68
|
translations,
|
30
|
-
localesMap
|
69
|
+
localesMap,
|
70
|
+
currentLocale,
|
71
|
+
currentPath
|
31
72
|
]);
|
32
73
|
return(/*#__PURE__*/ React.createElement(SeoTranslationsContext.Provider, {
|
33
74
|
value: data1
|
34
75
|
}, children));
|
35
76
|
};
|
36
77
|
export var useSeoTranslations = function() {
|
37
|
-
return React.useContext(SeoTranslationsContext);
|
78
|
+
return React.useContext(SeoTranslationsContext) || {};
|
38
79
|
};
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
export var GridStyles = function(param) {
|
3
|
-
var spaceX = param.spaceX, breakpoints = param.breakpoints, _remSize = param.remSize, remSize = _remSize === void 0 ? 10 : _remSize;
|
3
|
+
var spaceX = param.spaceX, breakpoints = param.breakpoints, _remSize = param.remSize, remSize = _remSize === void 0 ? 10 : _remSize, _spaceBetweenSections = param.spaceBetweenSections, spaceBetweenSections = _spaceBetweenSections === void 0 ? 80 : _spaceBetweenSections;
|
4
4
|
var getSize = function getSize(width) {
|
5
5
|
return "min-width: calc(".concat(width, "% - ").concat(spaceX / remSize, "rem);") + "max-width: calc(".concat(width, "% - ").concat(spaceX / remSize, "rem);") + "margin: 0 ".concat(spaceX / 2 / remSize, "rem;");
|
6
6
|
};
|
@@ -20,7 +20,7 @@ export var GridStyles = function(param) {
|
|
20
20
|
}, '');
|
21
21
|
return(/*#__PURE__*/ React.createElement("style", {
|
22
22
|
dangerouslySetInnerHTML: {
|
23
|
-
__html: "\n .Page--row {\n display: flex;\n display: -webkit-flex;\n flex-wrap: wrap;\n -webkit-flex-wrap: wrap;\n margin: 0 -".concat(spaceX / remSize / 2, "rem;\n }\n\n .Page__section {\n padding-bottom:
|
23
|
+
__html: "\n .Page--row {\n display: flex;\n display: -webkit-flex;\n flex-wrap: wrap;\n -webkit-flex-wrap: wrap;\n margin: 0 -".concat(spaceX / remSize / 2, "rem;\n }\n\n .Page__section {\n padding-bottom: ").concat(spaceBetweenSections / remSize, "rem;\n }\n\n .Page--col {\n display: block;\n width: 100%;\n }\n \n .size-default-inherit {\n width: 100%;\n }\n ").concat(queries, "\n ")
|
24
24
|
}
|
25
25
|
}));
|
26
26
|
};
|
@@ -117,7 +117,7 @@ export var RangeSlideClasses = {
|
|
117
117
|
thumbActive: 'RangeSlider--thumb-active'
|
118
118
|
};
|
119
119
|
export var RangeSliderInput = function(param) {
|
120
|
-
var defaultValue = param.defaultValue, onChange = param.onChange, _min = param.min, min = _min === void 0 ? 0 : _min, _max = param.max, max = _max === void 0 ? 100 : _max, _step = param.step, step = _step === void 0 ? 1 : _step;
|
120
|
+
var defaultValue = param.defaultValue, onChange = param.onChange, onSlide = param.onSlide, _min = param.min, min = _min === void 0 ? 0 : _min, _max = param.max, max = _max === void 0 ? 100 : _max, _step = param.step, step = _step === void 0 ? 1 : _step;
|
121
121
|
var ref1 = _slicedToArray(useState(defaultValue), 2), value = ref1[0], setValue = ref1[1];
|
122
122
|
var inputLeftRef = React.useRef(null);
|
123
123
|
var inputRightRef = React.useRef(null);
|
@@ -130,6 +130,17 @@ export var RangeSliderInput = function(param) {
|
|
130
130
|
}, [
|
131
131
|
defaultValue
|
132
132
|
]);
|
133
|
+
var onSlideGeneric = function() {
|
134
|
+
var inputLeft = inputLeftRef.current;
|
135
|
+
var inputRight = inputRightRef.current;
|
136
|
+
if (!inputLeft || !inputRight) return;
|
137
|
+
var leftValue = Math.min(Number(inputLeft.value), Number(inputRight.value) - 1);
|
138
|
+
var rightValue = Math.max(Number(inputRight.value), Number(inputLeft.value) + 1);
|
139
|
+
onSlide === null || onSlide === void 0 ? void 0 : onSlide({
|
140
|
+
left: leftValue,
|
141
|
+
right: rightValue
|
142
|
+
});
|
143
|
+
};
|
133
144
|
var updateLeftValue = useCallback(function() {
|
134
145
|
var inputLeft = inputLeftRef.current;
|
135
146
|
var inputRight = inputRightRef.current;
|
@@ -138,6 +149,7 @@ export var RangeSliderInput = function(param) {
|
|
138
149
|
setValue(_objectSpread({}, value, {
|
139
150
|
left: leftValue
|
140
151
|
}));
|
152
|
+
onSlideGeneric();
|
141
153
|
}, [
|
142
154
|
setValue,
|
143
155
|
value
|
@@ -150,6 +162,7 @@ export var RangeSliderInput = function(param) {
|
|
150
162
|
setValue(_objectSpread({}, value, {
|
151
163
|
right: rightValue
|
152
164
|
}));
|
165
|
+
onSlideGeneric();
|
153
166
|
}, [
|
154
167
|
setValue,
|
155
168
|
value
|
@@ -1,9 +1,50 @@
|
|
1
|
+
import regeneratorRuntime from "regenerator-runtime";
|
1
2
|
import { MyWalletGetByType } from '@sentecacommerce/sdk';
|
2
3
|
import { useQuery } from 'react-query';
|
4
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
5
|
+
try {
|
6
|
+
var info = gen[key](arg);
|
7
|
+
var value = info.value;
|
8
|
+
} catch (error) {
|
9
|
+
reject(error);
|
10
|
+
return;
|
11
|
+
}
|
12
|
+
if (info.done) {
|
13
|
+
resolve(value);
|
14
|
+
} else {
|
15
|
+
Promise.resolve(value).then(_next, _throw);
|
16
|
+
}
|
17
|
+
}
|
18
|
+
function _asyncToGenerator(fn) {
|
19
|
+
return function() {
|
20
|
+
var self = this, args = arguments;
|
21
|
+
return new Promise(function(resolve, reject) {
|
22
|
+
var gen = fn.apply(self, args);
|
23
|
+
function _next(value) {
|
24
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
25
|
+
}
|
26
|
+
function _throw(err) {
|
27
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
28
|
+
}
|
29
|
+
_next(undefined);
|
30
|
+
});
|
31
|
+
};
|
32
|
+
}
|
3
33
|
export var useGetMyLoyaltyCardQuery = function(callback) {
|
4
|
-
return useQuery('get-loyalty-card-key', function() {
|
5
|
-
return
|
6
|
-
|
34
|
+
return useQuery('get-loyalty-card-key', _asyncToGenerator(regeneratorRuntime.mark(function _callee() {
|
35
|
+
return regeneratorRuntime.wrap(function _callee$(_ctx) {
|
36
|
+
while(1)switch(_ctx.prev = _ctx.next){
|
37
|
+
case 0:
|
38
|
+
return _ctx.abrupt("return", MyWalletGetByType('loyalty-program'));
|
39
|
+
case 1:
|
40
|
+
case "end":
|
41
|
+
return _ctx.stop();
|
42
|
+
}
|
43
|
+
}, _callee);
|
44
|
+
})), {
|
45
|
+
refetchOnMount: false,
|
46
|
+
refetchOnWindowFocus: false,
|
47
|
+
retry: false,
|
7
48
|
onSuccess: function() {
|
8
49
|
var ref;
|
9
50
|
return callback === null || callback === void 0 ? void 0 : (ref = callback.onSuccess) === null || ref === void 0 ? void 0 : ref.call(callback);
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import { canUseDOM } from './canUseDom';
|
2
|
+
export var getLocaleFromPath = function() {
|
3
|
+
if (!canUseDOM()) return '';
|
4
|
+
var locale = window.location.pathname.split('/')[1] || '';
|
5
|
+
// the allowed standards: bg bg-BG, en en-US/en-UK
|
6
|
+
if (locale.length !== 2 && locale.length !== 5) return '';
|
7
|
+
return locale;
|
8
|
+
};
|
@@ -95,7 +95,9 @@ export var getSelectedFilters = function(router, slug, data, config) {
|
|
95
95
|
aggType: key,
|
96
96
|
aggKey: "".concat(valueFrom, ",").concat(valueTo),
|
97
97
|
aggOperator: filtersOperatorsMap.stats
|
98
|
-
}, true, router)
|
98
|
+
}, true, router), undefined, {
|
99
|
+
shallow: true
|
100
|
+
});
|
99
101
|
},
|
100
102
|
selected: true,
|
101
103
|
data: _objectSpread({}, data.raw, {
|
package/dist/esm/utils/index.js
CHANGED
@@ -13,6 +13,7 @@ export * from './getTranslatableField';
|
|
13
13
|
export * from './formatAsCurrency';
|
14
14
|
export * from './createCatalogBreadcrumb';
|
15
15
|
export * from './adjustColor';
|
16
|
+
export * from './getLocaleFromPath';
|
16
17
|
export * from './calcDiscount';
|
17
18
|
export * from './canUseDom';
|
18
19
|
export * from './getFirst';
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import { canUseDOM } from "./canUseDom";
|
1
2
|
export function isTouchDevice() {
|
2
|
-
return 'ontouchstart' in window || navigator.maxTouchPoints > 0 || navigator.msMaxTouchPoints > 0;
|
3
|
+
return canUseDOM() && ('ontouchstart' in window || navigator.maxTouchPoints > 0 || navigator.msMaxTouchPoints > 0);
|
3
4
|
}
|
@@ -1,10 +1,15 @@
|
|
1
1
|
export var readFromLocalStorage = function(key) {
|
2
2
|
if (typeof window !== 'undefined') {
|
3
|
-
|
3
|
+
try {
|
4
|
+
return JSON.parse(localStorage.getItem(key));
|
5
|
+
} catch (e) {
|
6
|
+
console.log(e);
|
7
|
+
return null;
|
8
|
+
}
|
4
9
|
}
|
5
10
|
};
|
6
11
|
export var writeToLocalStorage = function(key, data) {
|
7
|
-
if (typeof window !== 'undefined') {
|
12
|
+
if (typeof window !== 'undefined' && data !== undefined) {
|
8
13
|
localStorage.setItem(key, JSON.stringify(data));
|
9
14
|
}
|
10
15
|
};
|
@@ -2,7 +2,7 @@ import { LineItemDTO, LineItemDTOLineItemModeEnum, LineItemDTOStatusEnum, MoneyD
|
|
2
2
|
import { BaseProductType } from '../../useLineItem';
|
3
3
|
import { SelectedOptionType } from '../../useProduct/utils';
|
4
4
|
import { AssetsMap } from '../../../utils/assetsToMap';
|
5
|
-
interface BasketLineItemProps extends BaseProductType {
|
5
|
+
export interface BasketLineItemProps extends BaseProductType {
|
6
6
|
productId: string;
|
7
7
|
lineItemId: string;
|
8
8
|
quantityInBasket: number;
|
@@ -36,4 +36,3 @@ export declare const useBasketLineItem: (props: {
|
|
36
36
|
item: LineItemDTO;
|
37
37
|
expiry?: number;
|
38
38
|
}) => BasketLineItemProps;
|
39
|
-
export {};
|
@@ -128,6 +128,7 @@ declare type ProductProviderProps = {
|
|
128
128
|
expand?: string;
|
129
129
|
project?: string;
|
130
130
|
};
|
131
|
+
includeBrandInName?: boolean;
|
131
132
|
};
|
132
133
|
declare type ProductStateContextType = {
|
133
134
|
attributeRules: AttributeRulesMap;
|
@@ -163,7 +164,7 @@ declare type CountFunctionsContextType = {
|
|
163
164
|
};
|
164
165
|
getProductVideos: () => VideoType[];
|
165
166
|
};
|
166
|
-
export declare function ProductProvider({ product, children, defaultVariantId, }: ProductProviderProps): JSX.Element;
|
167
|
+
export declare function ProductProvider({ product, children, defaultVariantId, includeBrandInName, }: ProductProviderProps): JSX.Element;
|
167
168
|
export declare function useProductState(): ProductStateContextType;
|
168
169
|
export declare function useProductFunctions(): CountFunctionsContextType;
|
169
170
|
export declare function useProduct(slug: string, config?: getProductBySlugConfig): import("react-query").QueryResult<ProductDTO, unknown>;
|
@@ -1,4 +1,6 @@
|
|
1
1
|
import { AssetType } from '../../utils/assetsToMap';
|
2
|
+
import { NextRouter } from 'next/router';
|
3
|
+
import { Node } from './useListingCategories';
|
2
4
|
export declare type UseListingMetaResult = {
|
3
5
|
displayName: string;
|
4
6
|
description: string;
|
@@ -10,3 +12,5 @@ export declare type UseListingMetaResult = {
|
|
10
12
|
getCustomFieldByKey: (key: string) => any | undefined;
|
11
13
|
};
|
12
14
|
export declare const useListingMeta: () => UseListingMetaResult;
|
15
|
+
export declare function getFilterByType(filterType: string, router?: NextRouter): string;
|
16
|
+
export declare function getCategoryName(router?: NextRouter, categories?: Node[] | null): string | undefined;
|
@@ -84,4 +84,14 @@ export interface ListingPageMeta {
|
|
84
84
|
collapseMode?: StringField;
|
85
85
|
limit: NumberField;
|
86
86
|
includeVariants?: BooleanField;
|
87
|
+
getTitle?: GetListingPageTitle;
|
87
88
|
}
|
89
|
+
export declare type GetListingPageTitle = (type: ListingTypesEnum, meta: Omit<ListingPageMeta, 'getTitle'>, data: {
|
90
|
+
brand?: string;
|
91
|
+
category?: string;
|
92
|
+
defaultName?: string;
|
93
|
+
attribute?: string;
|
94
|
+
search?: string;
|
95
|
+
isWithAttribute: boolean;
|
96
|
+
childAttribute?: string;
|
97
|
+
}) => string;
|
@@ -3,11 +3,12 @@ interface EmptyBoxProps {
|
|
3
3
|
backgroundColor?: StringField;
|
4
4
|
searchHistory?: any[];
|
5
5
|
labels: GroupField<{
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
6
|
+
promoOffers: StringField;
|
7
|
+
products: StringField;
|
8
|
+
recentSearches: StringField;
|
9
|
+
popularSearches: StringField;
|
10
10
|
blogLabel: StringField;
|
11
|
+
noResults: StringField;
|
11
12
|
blog: GroupField<{
|
12
13
|
blogTitle: StringField;
|
13
14
|
image: StringField;
|
@@ -1,12 +1,13 @@
|
|
1
1
|
import { StringField, GroupField, BooleanField, NumberField } from '@sentecacommerce-theme/cms';
|
2
2
|
interface SearchLabels {
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
3
|
+
recentSearches: StringField;
|
4
|
+
popularSearches: StringField;
|
5
|
+
suggestedBrands: StringField;
|
6
|
+
suggestedCategories: StringField;
|
7
|
+
promoOffers: StringField;
|
8
|
+
products: StringField;
|
9
9
|
blogLabel: StringField;
|
10
|
+
noResults: StringField;
|
10
11
|
blog: GroupField<{
|
11
12
|
blogTitle: StringField;
|
12
13
|
image: StringField;
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare const TranslationsMeta: () => JSX.Element | null;
|
@@ -10,13 +10,15 @@ export declare const SeoTranslationsProvider: ({ children, translations, default
|
|
10
10
|
}) => JSX.Element;
|
11
11
|
export declare const useSeoTranslations: () => SeoTranslationContextType;
|
12
12
|
export declare type SeoTranslationContextType = {
|
13
|
-
|
13
|
+
translationsMap: {
|
14
|
+
[key: string]: SeoTranslationType;
|
15
|
+
};
|
14
16
|
defaultLocale: string;
|
15
|
-
|
17
|
+
allLocales: string[];
|
16
18
|
};
|
17
19
|
export declare type SeoTranslationType = {
|
18
20
|
slug: string;
|
19
|
-
title: string;
|
20
21
|
locale: string;
|
21
22
|
isDefault: boolean;
|
23
|
+
domain: string;
|
22
24
|
};
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { StringField } from '@sentecacommerce-theme/cms';
|
2
|
-
export declare const GridStyles: ({ spaceX, breakpoints, remSize, }: {
|
2
|
+
export declare const GridStyles: ({ spaceX, breakpoints, remSize, spaceBetweenSections, }: {
|
3
3
|
breakpoints?: {
|
4
4
|
[key: string]: {
|
5
5
|
min: StringField;
|
@@ -7,4 +7,5 @@ export declare const GridStyles: ({ spaceX, breakpoints, remSize, }: {
|
|
7
7
|
} | undefined;
|
8
8
|
spaceX: number;
|
9
9
|
remSize?: number | undefined;
|
10
|
+
spaceBetweenSections?: number | undefined;
|
10
11
|
}) => JSX.Element;
|
@@ -15,11 +15,12 @@ export declare const RangeSlideClasses: {
|
|
15
15
|
thumbHover: string;
|
16
16
|
thumbActive: string;
|
17
17
|
};
|
18
|
-
export declare const RangeSliderInput: ({ defaultValue, onChange, min, max, step, }: {
|
18
|
+
export declare const RangeSliderInput: ({ defaultValue, onChange, onSlide, min, max, step, }: {
|
19
19
|
min: number;
|
20
20
|
max: number;
|
21
21
|
step: number;
|
22
22
|
defaultValue: ValueType;
|
23
23
|
onChange: (data: ValueType) => void;
|
24
|
+
onSlide?: ((data: ValueType) => void) | undefined;
|
24
25
|
}) => JSX.Element;
|
25
26
|
export {};
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare const getLocaleFromPath: () => string;
|
@@ -13,6 +13,7 @@ export * from './getTranslatableField';
|
|
13
13
|
export * from './formatAsCurrency';
|
14
14
|
export * from './createCatalogBreadcrumb';
|
15
15
|
export * from './adjustColor';
|
16
|
+
export * from './getLocaleFromPath';
|
16
17
|
export * from './calcDiscount';
|
17
18
|
export * from './canUseDom';
|
18
19
|
export * from './getFirst';
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@sentecacommerce-theme/lib",
|
3
3
|
"sideEffects": false,
|
4
|
-
"version": "0.13.
|
4
|
+
"version": "0.13.2",
|
5
5
|
"main": "dist/cjs/index.js",
|
6
6
|
"module": "dist/esm/index.js",
|
7
7
|
"types": "dist/types/index.d.ts",
|
@@ -31,7 +31,7 @@
|
|
31
31
|
"watch:cjs": "swc src --out-dir dist/cjs -w",
|
32
32
|
"watch:esm": "swc src --out-dir dist/esm --no-swcrc -w"
|
33
33
|
},
|
34
|
-
"gitHead": "
|
34
|
+
"gitHead": "a02a163a7ab04039fc81e5e8ce3c38e93131968c",
|
35
35
|
"peerDependencies": {
|
36
36
|
"react-query": "^2.26.2"
|
37
37
|
},
|