@sentecacommerce-theme/lib 0.13.7-alpha.5 → 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/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/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/useSelectedFilters/index.js +3 -3
- 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 +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 +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 +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/utils/buildCategoryQuery.js +8 -9
- 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/PopularSearches/index.js +1 -1
- 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/usePixel.js +1 -1
- package/dist/esm/analytics/Releva/useReleva.js +1 -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/Html/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/useSelectedFilters/index.js +4 -4
- 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 +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 +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 +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/utils/buildCategoryQuery.js +8 -9
- 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/PopularSearches/index.js +1 -1
- 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/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 +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/types/index.d.ts +38 -40
- package/dist/types/utils/getSelectedFilters.d.ts +2 -1
- package/package.json +16 -11
@@ -66,20 +66,17 @@ export var buildFilterQuery = function(param) {
|
|
66
66
|
var ref;
|
67
67
|
var query = (predicate === null || predicate === void 0 ? void 0 : predicate.filters) || (predicate === null || predicate === void 0 ? void 0 : predicate._id) || slug;
|
68
68
|
var queryType = pageType === ListingTypesEnum.Search ? 'text' : pageType;
|
69
|
-
var
|
70
|
-
|
71
|
-
filterExtension = config.listing.filterExtension;
|
72
|
-
collapseMode = config.listing.collapseMode;
|
73
|
-
}
|
69
|
+
var ref1 = config || {
|
70
|
+
}, filterExtension = ref1.filterExtension, collapseMode = ref1.collapseMode;
|
74
71
|
var filter = '';
|
75
72
|
if (pageType === ListingTypesEnum.AttrPage) {
|
76
|
-
var
|
73
|
+
var ref2 = _slicedToArray(getAttributePageType(router, slug), 2), type = ref2[0], val = ref2[1];
|
77
74
|
filter = "attr.".concat(type, ";eq;\"").concat(val, "\"");
|
78
75
|
} else {
|
79
76
|
filter = "".concat(queryType, ";eq;\"").concat(query, "\"");
|
80
77
|
}
|
81
78
|
if (router.query.cat) {
|
82
|
-
var
|
79
|
+
var ref3 = _slicedToArray(getAttributePageType(router, slug), 2), type1 = ref3[0], val1 = ref3[1];
|
83
80
|
filter += "&attr.".concat(type1, ";eq;").concat(val1);
|
84
81
|
}
|
85
82
|
if (pageType === ListingTypesEnum.View) {
|
@@ -93,6 +90,7 @@ export var buildFilterQuery = function(param) {
|
|
93
90
|
var aggregatesMap = aggregates === null || aggregates === void 0 ? void 0 : aggregates.reduce(function(map, agg) {
|
94
91
|
var aggregateType = agg.aggregationType;
|
95
92
|
var aggregationTerm = agg.aggregationDefinition;
|
93
|
+
if (!aggregateType) return map;
|
96
94
|
if (map[aggregateType]) {
|
97
95
|
return _objectSpread({
|
98
96
|
}, map, _defineProperty({
|
@@ -31,15 +31,15 @@ function _slicedToArray(arr, i) {
|
|
31
31
|
}
|
32
32
|
export var getListingAlias = function(param) {
|
33
33
|
var router = param.router, config = param.config;
|
34
|
-
var ref;
|
35
34
|
var query = router.query;
|
36
|
-
if (!(config === null || config === void 0 ? void 0 :
|
37
|
-
var
|
35
|
+
if (!(config === null || config === void 0 ? void 0 : config.slugAliases)) return query.slug;
|
36
|
+
var aliases = config.slugAliases;
|
38
37
|
var slugMap = {
|
39
38
|
};
|
40
39
|
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
41
40
|
try {
|
42
|
-
for(var _iterator = Object.entries(aliases
|
41
|
+
for(var _iterator = Object.entries(aliases || {
|
42
|
+
})[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
43
43
|
var _value = _slicedToArray(_step.value, 2), path = _value[0], alias = _value[1];
|
44
44
|
slugMap[alias] = path;
|
45
45
|
}
|
@@ -57,6 +57,5 @@ export var getListingAlias = function(param) {
|
|
57
57
|
}
|
58
58
|
}
|
59
59
|
}
|
60
|
-
|
61
|
-
return (ref1 = slugMap[query === null || query === void 0 ? void 0 : query.slug]) !== null && ref1 !== void 0 ? ref1 : query.slug;
|
60
|
+
return slugMap[query === null || query === void 0 ? void 0 : query.slug] || query.slug;
|
62
61
|
};
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { ListingTypesEnum } from '..';
|
2
|
-
export var getListingPageType = function(router, slug,
|
2
|
+
export var getListingPageType = function(router, slug, meta) {
|
3
3
|
var ref;
|
4
4
|
var pageTypeMap = {
|
5
5
|
'/[slug]/c': ListingTypesEnum.Category,
|
@@ -11,8 +11,9 @@ export var getListingPageType = function(router, slug, config) {
|
|
11
11
|
};
|
12
12
|
var slugAliases = {
|
13
13
|
};
|
14
|
-
if (
|
15
|
-
if ((((ref = Object.keys(slugAliases
|
14
|
+
if (meta) slugAliases = meta.slugAliases;
|
15
|
+
if ((((ref = Object.keys(slugAliases || {
|
16
|
+
})) === null || ref === void 0 ? void 0 : ref.includes(slug)) || (slug === null || slug === void 0 ? void 0 : slug.includes('sex'))) && !router.query.cat) {
|
16
17
|
return ListingTypesEnum.AttrPage;
|
17
18
|
}
|
18
19
|
if (router.query.q || router.query.search) {
|
@@ -6,7 +6,7 @@ export var PopularSearches = function(param) {
|
|
6
6
|
var title = param.title, data = param.data, onClose = param.onClose, labelsColor = param.labelsColor, textColor = param.textColor, searchValue = param.searchValue;
|
7
7
|
var config = useConfigState();
|
8
8
|
var ref = usePopularSearches({
|
9
|
-
key: config.interfaceKey
|
9
|
+
key: config.interfaceKey || ''
|
10
10
|
}), popularSearches = ref.popularSearches, arePopularLoading = ref.isLoading, status = ref.status;
|
11
11
|
return(/*#__PURE__*/ React.createElement(Container, {
|
12
12
|
labelsColor: labelsColor,
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import
|
1
|
+
import { useMemo } from 'react';
|
2
2
|
import { useBnpOffersQuery } from '../api/queries';
|
3
3
|
import { decodePrice, formatAsCurrency, useConfigState } from '../../index';
|
4
4
|
function _defineProperty(obj, key, value) {
|
@@ -32,7 +32,7 @@ function _objectSpread(target) {
|
|
32
32
|
}
|
33
33
|
export var useBnpOffers = function(props) {
|
34
34
|
var ref6, ref1, ref2, ref3;
|
35
|
-
var configLocale = (ref6 = useConfigState()) === null || ref6 === void 0 ? void 0 : (ref1 = ref6.price) === null || ref1 === void 0 ? void 0 : ref1.locale;
|
35
|
+
var configLocale = ((ref6 = useConfigState()) === null || ref6 === void 0 ? void 0 : (ref1 = ref6.price) === null || ref1 === void 0 ? void 0 : ref1.locale) || '';
|
36
36
|
var response = useBnpOffersQuery(props);
|
37
37
|
return useMemo(function() {
|
38
38
|
var ref, ref4, ref5;
|
@@ -21,13 +21,13 @@ export function GlobalSEO() {
|
|
21
21
|
dangerouslySetInnerHTML: createDangerousMarkup(organizationJSONLd)
|
22
22
|
}), Boolean(defaultIcon) && /*#__PURE__*/ React.createElement("link", {
|
23
23
|
rel: "icon",
|
24
|
-
href: defaultIcon
|
24
|
+
href: defaultIcon || ''
|
25
25
|
}), Boolean(favicon === null || favicon === void 0 ? void 0 : favicon.svg) && /*#__PURE__*/ React.createElement("link", {
|
26
26
|
rel: "icon",
|
27
|
-
href: favicon === null || favicon === void 0 ? void 0 : favicon.svg,
|
27
|
+
href: (favicon === null || favicon === void 0 ? void 0 : favicon.svg) || '',
|
28
28
|
type: "image/svg+xml"
|
29
29
|
}), Boolean(favicon === null || favicon === void 0 ? void 0 : favicon.medium) && /*#__PURE__*/ React.createElement("link", {
|
30
30
|
rel: "apple-touch-icon",
|
31
|
-
href: favicon === null || favicon === void 0 ? void 0 : favicon.medium
|
31
|
+
href: (favicon === null || favicon === void 0 ? void 0 : favicon.medium) || ''
|
32
32
|
})));
|
33
33
|
}
|
@@ -2,6 +2,7 @@ import { RangeAggregationResult, TermAggregationResult, RangeAggregation, TermAg
|
|
2
2
|
import { NextRouter } from 'next/router';
|
3
3
|
import { PredicateType } from './usePredicate';
|
4
4
|
import { Aggregate, AggregateSortEnum } from '../../types';
|
5
|
+
import { ListingPageMeta } from '../..';
|
5
6
|
export declare type AggregationResultType = RangeAggregationResult & TermAggregationResult & RangeAggregationResult;
|
6
7
|
export declare type AggregateType = TermAggregation & StatAggregation & RangeAggregation;
|
7
8
|
export declare enum AggregateRequestEnum {
|
@@ -15,7 +16,7 @@ export declare function prepareAggregateQuery({ request, predicate, aggregates,
|
|
15
16
|
router: NextRouter;
|
16
17
|
postFilter: string | undefined;
|
17
18
|
predicate?: PredicateType;
|
18
|
-
config?:
|
19
|
+
config?: ListingPageMeta;
|
19
20
|
slug: string;
|
20
21
|
attributeSortType?: AggregateSortEnum;
|
21
22
|
}): any;
|
@@ -2,6 +2,8 @@ import { CatalogFilterResultDTO } from '@sentecacommerce/sdk';
|
|
2
2
|
import { QueryResult } from 'react-query';
|
3
3
|
import { NextRouter } from 'next/router';
|
4
4
|
import { PredicateType } from '..';
|
5
|
+
import { ListingPageMeta } from '../..';
|
6
|
+
import { StringField } from '@sentecacommerce-theme/cms';
|
5
7
|
export declare const useListingQuery: () => QueryResult<CatalogFilterResultDTO, unknown>;
|
6
8
|
export declare function processListingQuery({ predicate, router, limit, sort, postFilter, offset, config, slug, }: {
|
7
9
|
predicate?: PredicateType;
|
@@ -10,7 +12,7 @@ export declare function processListingQuery({ predicate, router, limit, sort, po
|
|
10
12
|
offset: number;
|
11
13
|
sort?: string;
|
12
14
|
postFilter?: string;
|
13
|
-
config?:
|
15
|
+
config?: ListingPageMeta;
|
14
16
|
slug?: string;
|
15
17
|
}): Promise<CatalogFilterResultDTO>;
|
16
|
-
export declare function isListingQueryEnabled(type:
|
18
|
+
export declare function isListingQueryEnabled(type: StringField, predicate?: PredicateType): boolean;
|
@@ -1,8 +1,9 @@
|
|
1
1
|
import { CategoryDTO, ViewDTO, BrandDTO } from '@sentecacommerce/sdk';
|
2
2
|
import { QueryResult } from 'react-query';
|
3
3
|
import { NextRouter } from 'next/router';
|
4
|
+
import { ListingPageMeta } from '../..';
|
4
5
|
export declare type PredicateType = CategoryDTO & ViewDTO & BrandDTO & {
|
5
6
|
breadcrumb?: any;
|
6
7
|
};
|
7
8
|
export declare const usePredicate: () => QueryResult<PredicateType | undefined, unknown>;
|
8
|
-
export declare function processPredicateRequest(slug: string, router: NextRouter, aliasedSlug: string, mainConfig?:
|
9
|
+
export declare function processPredicateRequest(slug: string, router: NextRouter, aliasedSlug: string, mainConfig?: ListingPageMeta): Promise<any>;
|
@@ -1,7 +1,6 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import { AggregationResultType } from '../api';
|
3
3
|
import { RangeAggregation, StatAggregation, TermAggregation } from '@sentecacommerce/sdk';
|
4
|
-
export type { RangeAggregation, StatAggregation, TermAggregation, } from '@sentecacommerce/sdk';
|
5
4
|
export declare type ListingAggregationResultType = {
|
6
5
|
selected: boolean;
|
7
6
|
data: AggregationResultType;
|
@@ -1,11 +1,12 @@
|
|
1
1
|
import { SearchResultDTO } from '@sentecacommerce/sdk';
|
2
|
+
import type { NumberField, StringField } from '@sentecacommerce-theme/cms';
|
2
3
|
export declare type SearchResultItem = {
|
3
4
|
isPlaceholder?: boolean;
|
4
5
|
} & SearchResultDTO;
|
5
6
|
export declare type UseListingItemsProps = {
|
6
7
|
items?: SearchResultItem[];
|
7
|
-
total?:
|
8
|
-
didYouMean?:
|
8
|
+
total?: NumberField;
|
9
|
+
didYouMean?: StringField;
|
9
10
|
isLoading: boolean;
|
10
11
|
isFetching: boolean;
|
11
12
|
};
|
@@ -1,9 +1,11 @@
|
|
1
|
+
import type { EnumField, StringField } from '@sentecacommerce-theme/cms';
|
2
|
+
import { ComponentTypeEnum } from '..';
|
1
3
|
export declare type SeoFilter = {
|
2
|
-
name?:
|
3
|
-
component?:
|
4
|
+
name?: StringField;
|
5
|
+
component?: EnumField<ComponentTypeEnum>;
|
4
6
|
items?: {
|
5
|
-
name:
|
6
|
-
url:
|
7
|
+
name: StringField;
|
8
|
+
url: StringField;
|
7
9
|
}[];
|
8
10
|
};
|
9
11
|
export declare type UseListingSEOCategoriesPropsResult = {
|
@@ -2,9 +2,10 @@ import { AggregationResultType } from '../api';
|
|
2
2
|
import { CatalogAggregateResponseDTO } from '@sentecacommerce/sdk';
|
3
3
|
import { Aggregate } from '../types';
|
4
4
|
import { NextRouter } from 'next/router';
|
5
|
-
|
5
|
+
import type { StringField } from '@sentecacommerce-theme/cms';
|
6
|
+
export declare function processCategoriesResponse(response?: CatalogAggregateResponseDTO, type?: StringField, term?: StringField): AggregationResultType[];
|
6
7
|
export declare function getAggregateTypeAndTerm(aggregates?: Aggregate): {
|
7
8
|
type: string;
|
8
|
-
term:
|
9
|
+
term: import("@sentecacommerce-theme/cms").EnumField<StringField>;
|
9
10
|
};
|
10
11
|
export declare function getAttributePageType(router: NextRouter, slug: string): string[];
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { NextRouter } from 'next/router';
|
2
2
|
import type { QueryCache } from 'react-query';
|
3
|
-
import { Aggregate } from '../types';
|
3
|
+
import { Aggregate, ListingPageMeta } from '../types';
|
4
4
|
import { PredicateType } from '../api';
|
5
|
-
export declare function prefetchCategories(queryCache: QueryCache, router: NextRouter, predicate: PredicateType, aggregates: Aggregate[], config
|
5
|
+
export declare function prefetchCategories(queryCache: QueryCache, router: NextRouter, predicate: PredicateType, aggregates: Aggregate[], config: ListingPageMeta): Promise<import("@sentecacommerce/sdk").CatalogAggregateResponseDTO>;
|
@@ -1,12 +1,12 @@
|
|
1
1
|
import { NextRouter } from 'next/router';
|
2
2
|
import type { QueryCache } from 'react-query';
|
3
3
|
import { PredicateType } from '../api';
|
4
|
-
|
4
|
+
import { ListingPageMeta } from '..';
|
5
|
+
export declare function prefetchListing({ queryCache, router, predicate, config, defaultSortKey }: {
|
5
6
|
queryCache: QueryCache;
|
6
7
|
router: NextRouter;
|
7
8
|
predicate?: PredicateType;
|
8
9
|
filterExtension?: string;
|
9
|
-
|
10
|
-
|
11
|
-
config?: any;
|
10
|
+
defaultSortKey: string;
|
11
|
+
config: ListingPageMeta;
|
12
12
|
}): Promise<import("@sentecacommerce/sdk").CatalogFilterResultDTO>;
|
@@ -1,3 +1,4 @@
|
|
1
1
|
import { NextRouter } from 'next/router';
|
2
2
|
import type { QueryCache } from 'react-query';
|
3
|
-
|
3
|
+
import { ListingPageMeta } from '..';
|
4
|
+
export declare function prefetchPredicate(queryCache: QueryCache, router: NextRouter, config: ListingPageMeta): Promise<any>;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { BooleanField,
|
1
|
+
import { BooleanField, StringField, NumberField, EnumField, ListField, GroupField } from '@sentecacommerce-theme/cms';
|
2
2
|
export declare type FiltersQuery = {
|
3
3
|
storeKey?: string;
|
4
4
|
currencyCode?: string;
|
@@ -50,26 +50,37 @@ export declare enum ComponentTypeEnum {
|
|
50
50
|
RangeSlider = "range-slider"
|
51
51
|
}
|
52
52
|
export declare type Aggregate = {
|
53
|
-
label:
|
54
|
-
aggregationType: AggregationTypeEnum
|
55
|
-
aggregationDefinition:
|
56
|
-
filterDefinition:
|
57
|
-
order
|
58
|
-
collapsed
|
59
|
-
|
53
|
+
label: StringField;
|
54
|
+
aggregationType: EnumField<AggregationTypeEnum>;
|
55
|
+
aggregationDefinition: EnumField<StringField>;
|
56
|
+
filterDefinition: StringField;
|
57
|
+
order?: NumberField;
|
58
|
+
collapsed: BooleanField;
|
59
|
+
hideOn?: ListField<ListingTypesEnum>;
|
60
|
+
component: EnumField<ComponentTypeEnum>;
|
60
61
|
};
|
61
62
|
export declare type ListingPageSortOption = {
|
62
|
-
key:
|
63
|
-
label:
|
63
|
+
key: StringField;
|
64
|
+
label: StringField;
|
64
65
|
};
|
65
66
|
export interface DefaultListingPageProps {
|
66
67
|
type: ListingTypesEnum;
|
67
|
-
seoAggregates?: Aggregate
|
68
|
-
aggregates?: Aggregate
|
69
|
-
defaultSortKey
|
68
|
+
seoAggregates?: GroupField<Aggregate>;
|
69
|
+
aggregates?: ListField<Aggregate>;
|
70
|
+
defaultSortKey?: StringField;
|
70
71
|
categoryTreeConfig?: Aggregate;
|
71
|
-
sortOptions
|
72
|
-
productsPerPage?: NumberField;
|
72
|
+
sortOptions?: ListField<ListingPageSortOption>;
|
73
73
|
attributeSortType?: AggregateSortEnum;
|
74
|
-
|
74
|
+
meta: ListingPageMeta;
|
75
|
+
}
|
76
|
+
export interface ListingPageMeta {
|
77
|
+
slugAliases: {
|
78
|
+
[key: string]: string;
|
79
|
+
};
|
80
|
+
titleAliases: {
|
81
|
+
[key: string]: string;
|
82
|
+
};
|
83
|
+
filterExtension: StringField;
|
84
|
+
collapseMode: StringField;
|
85
|
+
limit: NumberField;
|
75
86
|
}
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { NextRouter } from 'next/router';
|
2
2
|
import { ListingTypesEnum, Aggregate, PredicateType } from '../index';
|
3
|
+
import { ListingPageMeta } from '../types';
|
3
4
|
export declare const buildCategoryQuery: ({ aggregates, predicate, postFilter, pageType, config, router, slug, }: {
|
4
5
|
pageType: ListingTypesEnum;
|
5
6
|
aggregates: Aggregate[];
|
@@ -7,7 +8,7 @@ export declare const buildCategoryQuery: ({ aggregates, predicate, postFilter, p
|
|
7
8
|
postFilter?: string | undefined;
|
8
9
|
predicate?: PredicateType | undefined;
|
9
10
|
slug: string;
|
10
|
-
config?:
|
11
|
+
config?: ListingPageMeta | undefined;
|
11
12
|
}) => {
|
12
13
|
[x: string]: string;
|
13
14
|
filter: string;
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { NextRouter } from 'next/router';
|
2
2
|
import { Aggregate, ListingTypesEnum, PredicateType } from '../index';
|
3
|
+
import { ListingPageMeta } from '../types';
|
3
4
|
export declare const buildFilterQuery: ({ predicate, slug, pageType, router, aggregates, config, postFilter, }: {
|
4
5
|
aggregates: Aggregate[];
|
5
6
|
router: NextRouter;
|
@@ -7,5 +8,5 @@ export declare const buildFilterQuery: ({ predicate, slug, pageType, router, agg
|
|
7
8
|
predicate?: PredicateType | undefined;
|
8
9
|
slug: string;
|
9
10
|
pageType: ListingTypesEnum;
|
10
|
-
config
|
11
|
+
config?: ListingPageMeta | undefined;
|
11
12
|
}) => any;
|
@@ -1,5 +1,6 @@
|
|
1
|
+
import { StringField, BooleanField } from "@sentecacommerce-theme/cms";
|
1
2
|
export declare const extendFilter: ({ slug, filterExtension, noSplit, }: {
|
2
3
|
slug: string;
|
3
|
-
filterExtension?:
|
4
|
-
noSplit?:
|
4
|
+
filterExtension?: StringField;
|
5
|
+
noSplit?: BooleanField;
|
5
6
|
}) => string;
|
@@ -1,3 +1,3 @@
|
|
1
1
|
import { NextRouter } from 'next/router';
|
2
|
-
import { ListingTypesEnum } from '..';
|
3
|
-
export declare const getListingPageType: (router: NextRouter, slug?: string | undefined,
|
2
|
+
import { ListingPageMeta, ListingTypesEnum } from '..';
|
3
|
+
export declare const getListingPageType: (router: NextRouter, slug?: string | undefined, meta?: ListingPageMeta | undefined) => ListingTypesEnum;
|
@@ -1,46 +1,44 @@
|
|
1
|
+
import { GroupField, NumberField, StringField } from "@sentecacommerce-theme/cms";
|
1
2
|
export interface DefaultConfig {
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
};
|
3
|
+
organizationPhone: StringField;
|
4
|
+
domain: StringField;
|
5
|
+
interfaceKey: StringField;
|
6
|
+
favicon: GroupField<{
|
7
|
+
default: StringField;
|
8
|
+
medium: StringField;
|
9
|
+
svg: StringField;
|
10
|
+
}>;
|
11
|
+
imagesConfig: GroupField<{
|
12
|
+
fallbackImage: StringField;
|
13
|
+
placeholderColor: StringField;
|
14
|
+
ratio: GroupField<{
|
15
|
+
width: NumberField;
|
16
|
+
height: NumberField;
|
17
|
+
}>;
|
18
|
+
}>;
|
19
|
+
facebook: GroupField<{
|
20
|
+
appId: StringField;
|
21
|
+
pixelId: StringField;
|
22
|
+
}>;
|
23
|
+
apple: GroupField<{
|
24
|
+
appId: StringField;
|
25
|
+
redirectURI: StringField;
|
26
|
+
}>;
|
27
|
+
google: GroupField<{
|
28
|
+
id: StringField;
|
29
|
+
analytics: StringField;
|
30
|
+
reMarketing: GroupField<{
|
31
|
+
id: StringField;
|
32
|
+
label: StringField;
|
33
|
+
}>;
|
34
|
+
apiKey: StringField;
|
35
|
+
}>;
|
36
|
+
defaultMerchant: StringField;
|
37
|
+
price: GroupField<{
|
38
|
+
locale: StringField;
|
39
|
+
}>;
|
40
40
|
}
|
41
41
|
export interface DefaultLabels {
|
42
42
|
}
|
43
43
|
export interface DefaultCustomUI {
|
44
44
|
}
|
45
|
-
export interface DefaultConfig {
|
46
|
-
}
|
@@ -1,3 +1,4 @@
|
|
1
1
|
import { NextRouter } from 'next/router';
|
2
2
|
import { AggregateResultType, FormattedAggregationResultType } from '../hooks/useAggregateResult';
|
3
|
-
|
3
|
+
import { ListingPageMeta } from '../listing/types';
|
4
|
+
export declare const getSelectedFilters: (router: NextRouter, slug: string, data?: AggregateResultType | undefined, config?: ListingPageMeta | undefined) => FormattedAggregationResultType[];
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@sentecacommerce-theme/lib",
|
3
3
|
"sideEffects": false,
|
4
|
-
"version": "0.13.7-alpha.
|
4
|
+
"version": "0.13.7-alpha.6",
|
5
5
|
"main": "dist/cjs/index.js",
|
6
6
|
"module": "dist/esm/index.js",
|
7
7
|
"types": "dist/types/index.d.ts",
|
@@ -21,15 +21,15 @@
|
|
21
21
|
},
|
22
22
|
"url": "https://github.com/senteca/theme.git",
|
23
23
|
"scripts": {
|
24
|
-
"prebuild": "rimraf dist",
|
24
|
+
"prebuild": "rimraf ../../../district/node_modules/@sentecacommerce-theme/lib/dist",
|
25
25
|
"build": "concurrently yarn:build:*",
|
26
|
-
"build:types": "tsc --emitDeclarationOnly --declaration --declarationDir dist/types",
|
27
|
-
"build:cjs": "swc src --out-dir dist/cjs",
|
28
|
-
"build:esm": "swc src --out-dir dist/esm --no-swcrc",
|
26
|
+
"build:types": "tsc --emitDeclarationOnly --declaration --declarationDir ../../../district/node_modules/@sentecacommerce-theme/lib/dist/types",
|
27
|
+
"build:cjs": "swc src --out-dir ../../../district/node_modules/@sentecacommerce-theme/lib/dist/cjs",
|
28
|
+
"build:esm": "swc src --out-dir ../../../district/node_modules/@sentecacommerce-theme/lib/dist/esm --no-swcrc",
|
29
29
|
"watch": "concurrently yarn:watch:*",
|
30
|
-
"watch:types": "tsc --emitDeclarationOnly --declaration -w --declarationDir dist/types",
|
31
|
-
"watch:cjs": "swc src --out-dir dist/cjs -w",
|
32
|
-
"watch:esm": "swc src --out-dir dist/esm --no-swcrc -w"
|
30
|
+
"watch:types": "tsc --emitDeclarationOnly --declaration -w --declarationDir ../../../district/node_modules/@sentecacommerce-theme/lib/dist/types",
|
31
|
+
"watch:cjs": "swc src --out-dir ../../../district/node_modules/@sentecacommerce-theme/lib/dist/cjs -w",
|
32
|
+
"watch:esm": "swc src --out-dir ../../../district/node_modules/@sentecacommerce-theme/lib/dist/esm --no-swcrc -w"
|
33
33
|
},
|
34
34
|
"gitHead": "cf94e18e4b1843926172d5722c667a88533157cd",
|
35
35
|
"dependencies": {
|
@@ -46,19 +46,24 @@
|
|
46
46
|
"react-dom": "^17.0.2",
|
47
47
|
"react-query": "^2.26.2",
|
48
48
|
"styled-components": "^5.2.1",
|
49
|
-
"tabbable": "^5.1.5"
|
49
|
+
"tabbable": "^5.1.5",
|
50
|
+
"uuid": "^8.3.2"
|
50
51
|
},
|
51
52
|
"devDependencies": {
|
52
53
|
"@swc/cli": "^0.1.51",
|
53
|
-
"@swc/core": "^1.2.
|
54
|
+
"@swc/core": "^1.2.126",
|
55
|
+
"@swc/jest": "^0.2.15",
|
54
56
|
"@types/body-scroll-lock": "^2.6.1",
|
55
57
|
"@types/facebook-pixel": "^0.0.23",
|
56
58
|
"@types/gtag.js": "^0.0.5",
|
59
|
+
"@types/jest": "27.4.0",
|
57
60
|
"@types/js-cookie": "^2.2.7",
|
58
61
|
"@types/node-fetch": "^2.5.10",
|
59
62
|
"@types/react-dom": "^17.0.11",
|
60
63
|
"@types/resize-observer-browser": "^0.1.5",
|
61
64
|
"@types/styled-components": "^5.1.16",
|
62
|
-
"@types/uuid": "^8.3.3"
|
65
|
+
"@types/uuid": "^8.3.3",
|
66
|
+
"enzyme": "^3.11.0",
|
67
|
+
"jest": "^27.4.5"
|
63
68
|
}
|
64
69
|
}
|