@soma-vertical-web/multi-lib 1.0.17 → 1.0.18
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/contexts/contexts/plp/FilterContext.d.ts +1 -1
- package/contexts/contexts/plp/PLPContext.d.ts +1 -1
- package/contexts/contexts/search/Facets.d.ts +1 -1
- package/contexts/contexts/search/QueryFacets.d.ts +5 -0
- package/contexts/contexts/search/QueryProducts.d.ts +5 -0
- package/contexts/contexts/search/RootTank.d.ts +9 -0
- package/contexts/contexts/search/Search.d.ts +1 -1
- package/contexts/index.d.ts +4 -4
- package/data/helpers/plp/index.d.ts +2 -2
- package/data/helpers/search/facets.d.ts +1 -0
- package/data/helpers/search/index.d.ts +4 -0
- package/data/helpers/search/search.d.ts +1 -0
- package/data/index.d.ts +2 -0
- package/index-BlwJMBFA.mjs +1890 -0
- package/index-dtcYsqh-.js +4 -0
- package/index.js +17 -17
- package/index.mjs +10322 -8216
- package/index2.js +1 -1
- package/index2.mjs +222 -227
- package/layout/index.d.ts +2 -2
- package/layout/template/PDC/Composite/Pagination/Pagination.d.ts +1 -1
- package/layout/template/PDC/PDC.d.ts +1 -1
- package/layout/template/PDC/index.d.ts +1 -1
- package/layout/template/SearchResult/Composite/Products.d.ts +7 -0
- package/package.json +1 -1
- package/server.d.ts +4 -0
- package/style.css +1 -1
- package/types/contexts/contexts/plp.d.ts +42 -8
- package/types/contexts/contexts/search.d.ts +28 -16
- package/types/layout/team-components/PLPNavigation/index.d.ts +0 -2
- package/types/layout/templates/PLP/index.d.ts +2 -2
|
@@ -30,14 +30,14 @@ export type DataLayerEvent = (data: ProductSearchResultPage) => void;
|
|
|
30
30
|
export interface PageState {
|
|
31
31
|
addPage: (state: State, positions: PositionsGrid, callback?: DataLayerEvent, itemsPerPage?: number) => void;
|
|
32
32
|
banners: number[];
|
|
33
|
-
|
|
33
|
+
createPagesScroll: (state: State, positions: PositionsGrid, callback?: DataLayerEvent, itemsPerPage?: number) => void;
|
|
34
34
|
load: boolean;
|
|
35
35
|
pages: Page[];
|
|
36
36
|
products: number[];
|
|
37
37
|
total: number;
|
|
38
38
|
updateProducts: (state: State, callback?: DataLayerEvent) => void;
|
|
39
39
|
}
|
|
40
|
-
export interface PLPInfiniteContextProps extends PropsWithChildren
|
|
40
|
+
export interface PLPInfiniteContextProps extends PropsWithChildren {
|
|
41
41
|
addNewPage(page: Page): void;
|
|
42
42
|
columns: number;
|
|
43
43
|
gap: number;
|
|
@@ -48,17 +48,52 @@ export interface PLPInfiniteContextProps extends PropsWithChildren<Omit<PageStat
|
|
|
48
48
|
export interface PLPInfiniteProviderProps extends PropsWithChildren {
|
|
49
49
|
banners: PLPBanners;
|
|
50
50
|
}
|
|
51
|
-
export interface PLPContextProps {
|
|
51
|
+
export interface PLPContextProps extends Pick<PLPProviderProps, 'constants' | 'mainSeller'> {
|
|
52
52
|
openFilters: boolean;
|
|
53
53
|
setOpenFilters: Dispatch<SetStateAction<boolean>>;
|
|
54
54
|
}
|
|
55
55
|
export interface PLPProviderProps extends PropsWithChildren {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
56
|
+
brand?: string | null;
|
|
57
|
+
constants: {
|
|
58
|
+
BUY_BUTTON_LABELS: BUY_BUTTON_LABELSType;
|
|
59
|
+
ICONS: ICONSType;
|
|
60
|
+
ITEMS_DEFAULT_SORT: ITEMS_DEFAULT_SORTType;
|
|
61
|
+
ITEMS_PER_PAGE: ITEMS_PER_PAGEType;
|
|
62
|
+
ITEMS_PER_SECTION: ITEMS_PER_SECTIONType;
|
|
63
|
+
MAIN_IMAGE: MAIN_IMAGEType;
|
|
64
|
+
NEWSLETTER_CONFIGS: NEWSLETTER_CONFIGSType;
|
|
65
|
+
NOTIFY_INFO: NOTIFY_INFOType;
|
|
66
|
+
PDC_NAVIGATION: PDC_NAVIGATIONType;
|
|
67
|
+
PLP_FILTERS: PLP_FILTERSType;
|
|
68
|
+
PLP_FILTERS_COLORS: PLP_FILTERS_COLORSType;
|
|
69
|
+
PLP_FILTERS_EMPTY: PLP_FILTERS_EMPTYType;
|
|
70
|
+
PLP_FILTERS_TITLE: PLP_FILTERS_TITLEType;
|
|
71
|
+
PLP_GRID_SCROLL_BACK: PLP_GRID_SCROLL_BACKType;
|
|
72
|
+
PLP_INFINITE_SCROLL: PLP_INFINITE_SCROLLType;
|
|
73
|
+
PLP_NOT_RESULT: PLP_NOT_RESULTType;
|
|
74
|
+
PLP_PRODUCT_SIMILAR_DELAY: PLP_PRODUCT_SIMILAR_DELAYType;
|
|
75
|
+
PLP_SHOW_VIDEO_ON_PRODUCT_CARD: PLP_SHOW_VIDEO_ON_PRODUCT_CARDType;
|
|
76
|
+
PLP_SIZE_ORDER: PLP_SIZE_ORDERType;
|
|
77
|
+
PLP_SORT_DEFAULT: PLP_SORT_DEFAULTType;
|
|
78
|
+
PRODUCT_CARD_IMAGE_ASPECT_RATIO: PRODUCT_CARD_IMAGE_ASPECT_RATIOType;
|
|
79
|
+
PRODUCT_CARD_TEXTS: PRODUCT_CARD_TEXTSType;
|
|
80
|
+
PRODUCT_CARD_TOP_WISHLIST_TOGGLE: PRODUCT_CARD_TOP_WISHLIST_TOGGLEType;
|
|
81
|
+
PRODUCT_IMAGE_DIMENSIONS: PRODUCT_IMAGE_DIMENSIONSType;
|
|
82
|
+
SEARCH_PAGE_ITEM_THRESHOLD: SEARCH_PAGE_ITEM_THRESHOLDType;
|
|
83
|
+
SEARCH_TOTAL_PORTAL_ID: SEARCH_TOTAL_PORTAL_IDType;
|
|
84
|
+
SECOND_IMAGE: SECOND_IMAGEType;
|
|
85
|
+
TEXTURE_IMAGE: TEXTURE_IMAGEType;
|
|
86
|
+
TEXTCONTENT_EXPANDED?: TEXTCONTENT_EXPANDEDType;
|
|
87
|
+
TIME_ZONE: TIME_ZONEType;
|
|
88
|
+
VARIANT_PAGINATION: VARIANT_PAGINATIONType;
|
|
89
|
+
Z_INDEX_WAR: Z_INDEX_WARType;
|
|
90
|
+
};
|
|
59
91
|
collectionId?: number | null;
|
|
60
92
|
itemsPerPage?: number;
|
|
61
|
-
|
|
93
|
+
mainSeller: StoreConfigType['mainSeller']['id'];
|
|
94
|
+
pathname: string;
|
|
95
|
+
searchParams?: URLSearchParams;
|
|
96
|
+
slug: string[] | string;
|
|
62
97
|
}
|
|
63
98
|
export interface PLPConstantsProviderProps extends PropsWithChildren {
|
|
64
99
|
BUY_BUTTON_LABELS: BUY_BUTTON_LABELSType;
|
|
@@ -94,6 +129,5 @@ export interface PLPConstantsProviderProps extends PropsWithChildren {
|
|
|
94
129
|
VARIANT_PAGINATION: VARIANT_PAGINATIONType;
|
|
95
130
|
Z_INDEX_WAR: Z_INDEX_WARType;
|
|
96
131
|
StoreConfig_MainSellerId: StoreConfigType['mainSeller']['id'];
|
|
97
|
-
searchParams: URLSearchParams;
|
|
98
132
|
}
|
|
99
133
|
export type PLPConstantsContextProps = Omit<PLPConstantsProviderProps, 'children'>;
|
|
@@ -1,26 +1,40 @@
|
|
|
1
1
|
import { Dispatch, PropsWithChildren, SetStateAction } from 'react';
|
|
2
2
|
import { ProductSearchResultPage } from '../../data/api/search/product';
|
|
3
3
|
import { State, Suggestion } from '../../data/api/search';
|
|
4
|
-
import {
|
|
4
|
+
import { FacetSearchResult, SelectedFacet } from '../../data/api/search/facets';
|
|
5
5
|
import { ITEMS_DEFAULT_SORTType, ITEMS_PER_PAGEType, ITEMS_PER_SECTIONType, PLP_FILTERS_SORT_OPTIONtype, SEARCH_PAGE_ITEM_THRESHOLDType, SEARCH_RESULTType, VARIANT_PAGINATIONType } from '../../constants';
|
|
6
|
-
import { BreadCrumbItemLinkProps } from '../../layout/team-components/PLPNavigation';
|
|
7
6
|
import { ProductsProps } from '../../layout/templates/PLP';
|
|
8
7
|
|
|
8
|
+
export interface QueryFacetsContextProps extends FacetSearchResult {
|
|
9
|
+
isLoading?: boolean;
|
|
10
|
+
deleteAllFacets(): void;
|
|
11
|
+
selectedFacets: SelectedFacet[];
|
|
12
|
+
onToggleFacet(value: SelectedFacet): void;
|
|
13
|
+
onSort(sort: PLP_FILTERS_SORT_OPTIONtype): void;
|
|
14
|
+
}
|
|
9
15
|
export interface FacetsContextProps {
|
|
10
|
-
breadcrumb: BreadCrumbItemLinkProps[];
|
|
11
16
|
deleteAllFacets(): void;
|
|
12
|
-
facets: Facet[];
|
|
13
|
-
isLoading: boolean;
|
|
14
17
|
selectedFacets: SelectedFacet[];
|
|
15
18
|
onToggleFacet(value: SelectedFacet): void;
|
|
16
19
|
onSort(sort: PLP_FILTERS_SORT_OPTIONtype): void;
|
|
17
20
|
}
|
|
21
|
+
export interface QueryFacetsProviderProps extends PropsWithChildren {
|
|
22
|
+
state: State;
|
|
23
|
+
forceUpdate?: boolean;
|
|
24
|
+
PLP_SORT_DEFAULT: ITEMS_DEFAULT_SORTType;
|
|
25
|
+
}
|
|
18
26
|
export interface FacetsProviderProps extends PropsWithChildren {
|
|
19
27
|
forceUpdate?: boolean;
|
|
28
|
+
searchParams: URLSearchParams;
|
|
29
|
+
PLP_SORT_DEFAULT: ITEMS_DEFAULT_SORTType;
|
|
20
30
|
}
|
|
21
31
|
export interface FacetsProviderContentProps extends Omit<FacetsProviderProps, 'forceUpdate'> {
|
|
22
32
|
selectedFacets: SelectedFacet[];
|
|
23
33
|
}
|
|
34
|
+
export interface QueryProductsContextProps extends ProductSearchResultPage {
|
|
35
|
+
isLoading: boolean;
|
|
36
|
+
total: number;
|
|
37
|
+
}
|
|
24
38
|
export interface ProductsContextProps extends ProductSearchResultPage {
|
|
25
39
|
isLoading: boolean;
|
|
26
40
|
total: number;
|
|
@@ -33,22 +47,15 @@ export interface SuggestedTermsContextProps {
|
|
|
33
47
|
export interface SuggestedTermsProviderProps extends PropsWithChildren {
|
|
34
48
|
term?: string;
|
|
35
49
|
}
|
|
36
|
-
export interface ProductsProviderProps extends PropsWithChildren {
|
|
37
|
-
query?: string;
|
|
50
|
+
export interface ProductsProviderProps extends PropsWithChildren<State> {
|
|
38
51
|
forceUpdate?: boolean;
|
|
39
52
|
}
|
|
40
|
-
export
|
|
41
|
-
count: number;
|
|
42
|
-
state: State;
|
|
43
|
-
}
|
|
53
|
+
export type SearchContextProps = Pick<SearchProviderProps, 'state' | 'searchParams'>;
|
|
44
54
|
export interface SearchProviderProps extends PropsWithChildren {
|
|
55
|
+
brand?: string | null;
|
|
56
|
+
collectionId?: number | null;
|
|
45
57
|
searchParams: URLSearchParams;
|
|
46
58
|
state: State;
|
|
47
|
-
sort?: string;
|
|
48
|
-
collectionId?: number | null;
|
|
49
|
-
brand?: string | null;
|
|
50
|
-
count?: number;
|
|
51
|
-
ITEMS_PER_PAGE: ITEMS_PER_PAGEType;
|
|
52
59
|
}
|
|
53
60
|
export interface SearchItem {
|
|
54
61
|
term: string;
|
|
@@ -60,6 +67,11 @@ export interface TopSearchesContextProps {
|
|
|
60
67
|
error: string | null;
|
|
61
68
|
}
|
|
62
69
|
export type DataParams = FacetsContextProps | ProductSearchResultPage | SuggestedTermsContextProps;
|
|
70
|
+
export interface RootQueryContextProps {
|
|
71
|
+
data: DataParams | undefined;
|
|
72
|
+
isLoading: boolean;
|
|
73
|
+
isError?: boolean;
|
|
74
|
+
}
|
|
63
75
|
export interface RootContextProps {
|
|
64
76
|
data: DataParams | null;
|
|
65
77
|
isLoading: boolean;
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import { Dispatch, HTMLAttributes, SetStateAction } from 'react';
|
|
2
2
|
import { SearchSort } from '../../../data/api/search';
|
|
3
3
|
import { FacetsContextProps } from '../../../contexts/contexts/search';
|
|
4
|
-
import { ICONSType } from '../../../constants';
|
|
5
4
|
|
|
6
5
|
export interface BreadCrumbItemLinkProps extends HTMLAttributes<HTMLDivElement> {
|
|
7
6
|
isLast?: boolean;
|
|
8
7
|
href?: string;
|
|
9
8
|
name?: string;
|
|
10
|
-
ICONS: ICONSType;
|
|
11
9
|
}
|
|
12
10
|
export type RootProps = HTMLAttributes<HTMLDivElement>;
|
|
13
11
|
export type Order = {
|
|
@@ -2,7 +2,7 @@ import { HTMLAttributes, PropsWithChildren } from 'react';
|
|
|
2
2
|
import { AvailabilityNotifyProps } from '../../../../types/layout/team-components/Notify';
|
|
3
3
|
import { BannerType } from '../../../cms/Sections/Banner';
|
|
4
4
|
import { BUY_BUTTON_LABELSType, ICONSType, ITEMS_DEFAULT_SORTType, ITEMS_PER_PAGEType, ITEMS_PER_SECTIONType, MAIN_IMAGEType, NEWSLETTER_CONFIGSType, NOTIFY_INFOType, PLP_GRID_SCROLL_BACKType, PLP_INFINITE_SCROLLType, PLP_PRODUCT_SIMILAR_DELAYType, PLP_SHOW_VIDEO_ON_PRODUCT_CARDType, PRODUCT_CARD_IMAGE_ASPECT_RATIOType, PRODUCT_CARD_TEXTSType, PRODUCT_CARD_TOP_WISHLIST_TOGGLEType, PRODUCT_IMAGE_DIMENSIONSType, SEARCH_PAGE_ITEM_THRESHOLDType, SECOND_IMAGEType, StoreConfigType, TEXTURE_IMAGEType, VARIANT_PAGINATIONType, PLP_NOT_RESULTType, Z_INDEX_WARType, PLP_SIZE_ORDERType } from '../../../constants';
|
|
5
|
-
import { Page
|
|
5
|
+
import { Page } from '../../../contexts/contexts/plp';
|
|
6
6
|
import { ProductType_PDC } from '../../../global/product';
|
|
7
7
|
import { ProductCardProps } from '../../team-components/ProductCard';
|
|
8
8
|
|
|
@@ -114,7 +114,7 @@ export interface ProductsProps {
|
|
|
114
114
|
TEXTURE_IMAGE: TEXTURE_IMAGEType;
|
|
115
115
|
Z_INDEX_WAR: Z_INDEX_WARType;
|
|
116
116
|
}
|
|
117
|
-
export interface PLPRootProps
|
|
117
|
+
export interface PLPRootProps {
|
|
118
118
|
className?: string;
|
|
119
119
|
}
|
|
120
120
|
export type EmptyProps = {
|