@soma-vertical-web/multi-lib 1.0.18 → 1.0.20
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/QueryProducts.d.ts +2 -2
- package/contexts/contexts/search/Search.d.ts +1 -1
- package/contexts/hooks/useSimilars.d.ts +7 -0
- package/contexts/index.d.ts +4 -4
- package/data/helpers/plp/index.d.ts +2 -2
- package/data/helpers/search/facets.d.ts +0 -1
- package/data/helpers/search/index.d.ts +0 -4
- package/data/helpers/search/search.d.ts +0 -1
- package/data/index.d.ts +0 -2
- package/index-67k__dSl.mjs +1908 -0
- package/index-BFX4NpXJ.js +4 -0
- package/index-CpUjW-m9.mjs +1877 -0
- package/index-xWhZ_YcF.js +4 -0
- package/index.js +17 -17
- package/index.mjs +8440 -10384
- package/index2.js +1 -1
- package/index2.mjs +613 -685
- package/layout/index.d.ts +3 -3
- package/layout/template/PDC/Composite/Pagination/Pagination.d.ts +1 -1
- package/layout/template/PDC/Composite/Products/Products.d.ts +1 -1
- package/layout/template/PDC/PDC.d.ts +1 -1
- package/layout/template/PDC/index.d.ts +2 -2
- package/layout/template/PDP/Composite/Info/MainContent/Similars/index.d.ts +1 -1
- package/layout/template/PDP/index.d.ts +2 -2
- package/package.json +1 -1
- package/server.d.ts +1 -7
- package/style.css +1 -1
- package/types/cms/Sections/SectionZone/index.d.ts +1 -0
- package/types/contexts/contexts/plp.d.ts +9 -42
- package/types/contexts/contexts/search.d.ts +16 -28
- package/types/contexts/hooks/index.d.ts +12 -0
- package/types/layout/team-components/PLPNavigation/index.d.ts +2 -0
- package/types/layout/team-components/ProductCard/index.d.ts +1 -0
- package/types/layout/team-components/ProductList/index.d.ts +2 -1
- package/types/layout/templates/PDP/index.d.ts +1 -2
- package/types/layout/templates/PLP/index.d.ts +3 -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
|
+
createPages: (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<Omit<PageState, 'init'>> {
|
|
41
41
|
addNewPage(page: Page): void;
|
|
42
42
|
columns: number;
|
|
43
43
|
gap: number;
|
|
@@ -48,52 +48,17 @@ export interface PLPInfiniteContextProps extends PropsWithChildren {
|
|
|
48
48
|
export interface PLPInfiniteProviderProps extends PropsWithChildren {
|
|
49
49
|
banners: PLPBanners;
|
|
50
50
|
}
|
|
51
|
-
export interface PLPContextProps
|
|
51
|
+
export interface PLPContextProps {
|
|
52
52
|
openFilters: boolean;
|
|
53
53
|
setOpenFilters: Dispatch<SetStateAction<boolean>>;
|
|
54
54
|
}
|
|
55
55
|
export interface PLPProviderProps extends PropsWithChildren {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
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
|
-
};
|
|
56
|
+
slug: string[] | string;
|
|
57
|
+
PLP_SORT_DEFAULT: PLP_SORT_DEFAULTType;
|
|
58
|
+
searchParams?: URLSearchParams;
|
|
91
59
|
collectionId?: number | null;
|
|
92
60
|
itemsPerPage?: number;
|
|
93
|
-
|
|
94
|
-
pathname: string;
|
|
95
|
-
searchParams?: URLSearchParams;
|
|
96
|
-
slug: string[] | string;
|
|
61
|
+
brand?: string | null;
|
|
97
62
|
}
|
|
98
63
|
export interface PLPConstantsProviderProps extends PropsWithChildren {
|
|
99
64
|
BUY_BUTTON_LABELS: BUY_BUTTON_LABELSType;
|
|
@@ -129,5 +94,7 @@ export interface PLPConstantsProviderProps extends PropsWithChildren {
|
|
|
129
94
|
VARIANT_PAGINATION: VARIANT_PAGINATIONType;
|
|
130
95
|
Z_INDEX_WAR: Z_INDEX_WARType;
|
|
131
96
|
StoreConfig_MainSellerId: StoreConfigType['mainSeller']['id'];
|
|
97
|
+
searchParams: URLSearchParams;
|
|
98
|
+
storeId: StoreConfigType['api']['storeId'];
|
|
132
99
|
}
|
|
133
100
|
export type PLPConstantsContextProps = Omit<PLPConstantsProviderProps, 'children'>;
|
|
@@ -1,40 +1,26 @@
|
|
|
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 { Facet, 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';
|
|
6
7
|
import { ProductsProps } from '../../layout/templates/PLP';
|
|
7
8
|
|
|
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
|
-
}
|
|
15
9
|
export interface FacetsContextProps {
|
|
10
|
+
breadcrumb: BreadCrumbItemLinkProps[];
|
|
16
11
|
deleteAllFacets(): void;
|
|
12
|
+
facets: Facet[];
|
|
13
|
+
isLoading: boolean;
|
|
17
14
|
selectedFacets: SelectedFacet[];
|
|
18
15
|
onToggleFacet(value: SelectedFacet): void;
|
|
19
16
|
onSort(sort: PLP_FILTERS_SORT_OPTIONtype): void;
|
|
20
17
|
}
|
|
21
|
-
export interface QueryFacetsProviderProps extends PropsWithChildren {
|
|
22
|
-
state: State;
|
|
23
|
-
forceUpdate?: boolean;
|
|
24
|
-
PLP_SORT_DEFAULT: ITEMS_DEFAULT_SORTType;
|
|
25
|
-
}
|
|
26
18
|
export interface FacetsProviderProps extends PropsWithChildren {
|
|
27
19
|
forceUpdate?: boolean;
|
|
28
|
-
searchParams: URLSearchParams;
|
|
29
|
-
PLP_SORT_DEFAULT: ITEMS_DEFAULT_SORTType;
|
|
30
20
|
}
|
|
31
21
|
export interface FacetsProviderContentProps extends Omit<FacetsProviderProps, 'forceUpdate'> {
|
|
32
22
|
selectedFacets: SelectedFacet[];
|
|
33
23
|
}
|
|
34
|
-
export interface QueryProductsContextProps extends ProductSearchResultPage {
|
|
35
|
-
isLoading: boolean;
|
|
36
|
-
total: number;
|
|
37
|
-
}
|
|
38
24
|
export interface ProductsContextProps extends ProductSearchResultPage {
|
|
39
25
|
isLoading: boolean;
|
|
40
26
|
total: number;
|
|
@@ -47,15 +33,22 @@ export interface SuggestedTermsContextProps {
|
|
|
47
33
|
export interface SuggestedTermsProviderProps extends PropsWithChildren {
|
|
48
34
|
term?: string;
|
|
49
35
|
}
|
|
50
|
-
export interface ProductsProviderProps extends PropsWithChildren
|
|
36
|
+
export interface ProductsProviderProps extends PropsWithChildren {
|
|
37
|
+
query?: string;
|
|
51
38
|
forceUpdate?: boolean;
|
|
52
39
|
}
|
|
53
|
-
export
|
|
40
|
+
export interface SearchContextProps extends Pick<SearchProviderProps, 'sort' | 'searchParams'> {
|
|
41
|
+
count: number;
|
|
42
|
+
state: State;
|
|
43
|
+
}
|
|
54
44
|
export interface SearchProviderProps extends PropsWithChildren {
|
|
55
|
-
brand?: string | null;
|
|
56
|
-
collectionId?: number | null;
|
|
57
45
|
searchParams: URLSearchParams;
|
|
58
46
|
state: State;
|
|
47
|
+
sort?: string;
|
|
48
|
+
collectionId?: number | null;
|
|
49
|
+
brand?: string | null;
|
|
50
|
+
count?: number;
|
|
51
|
+
ITEMS_PER_PAGE: ITEMS_PER_PAGEType;
|
|
59
52
|
}
|
|
60
53
|
export interface SearchItem {
|
|
61
54
|
term: string;
|
|
@@ -67,11 +60,6 @@ export interface TopSearchesContextProps {
|
|
|
67
60
|
error: string | null;
|
|
68
61
|
}
|
|
69
62
|
export type DataParams = FacetsContextProps | ProductSearchResultPage | SuggestedTermsContextProps;
|
|
70
|
-
export interface RootQueryContextProps {
|
|
71
|
-
data: DataParams | undefined;
|
|
72
|
-
isLoading: boolean;
|
|
73
|
-
isError?: boolean;
|
|
74
|
-
}
|
|
75
63
|
export interface RootContextProps {
|
|
76
64
|
data: DataParams | null;
|
|
77
65
|
isLoading: boolean;
|
|
@@ -17,3 +17,15 @@ export type UseScrollRestorationInfiniteProps = {
|
|
|
17
17
|
load: boolean;
|
|
18
18
|
PLP_GRID_SCROLL_BACK: PLP_GRID_SCROLL_BACKType;
|
|
19
19
|
};
|
|
20
|
+
export type SimilarItem = any;
|
|
21
|
+
export type SimilarCallback = (data: SimilarItem[]) => void;
|
|
22
|
+
export type SimilarsOptions = {
|
|
23
|
+
filterTexture?: string[];
|
|
24
|
+
storeId: string;
|
|
25
|
+
};
|
|
26
|
+
export type PendingRequest = {
|
|
27
|
+
productId: string;
|
|
28
|
+
callbacks: SimilarCallback[];
|
|
29
|
+
filterTexture?: string[];
|
|
30
|
+
storeId: string;
|
|
31
|
+
};
|
|
@@ -1,11 +1,13 @@
|
|
|
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';
|
|
4
5
|
|
|
5
6
|
export interface BreadCrumbItemLinkProps extends HTMLAttributes<HTMLDivElement> {
|
|
6
7
|
isLast?: boolean;
|
|
7
8
|
href?: string;
|
|
8
9
|
name?: string;
|
|
10
|
+
ICONS: ICONSType;
|
|
9
11
|
}
|
|
10
12
|
export type RootProps = HTMLAttributes<HTMLDivElement>;
|
|
11
13
|
export type Order = {
|
|
@@ -33,6 +33,7 @@ export interface RootProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
33
33
|
Z_INDEX_WAR: Z_INDEX_WARType;
|
|
34
34
|
StoreConfig_MainSellerId: StoreConfigType['mainSeller']['id'];
|
|
35
35
|
ICONS: ICONSType;
|
|
36
|
+
storeId: StoreConfigType['api']['storeId'];
|
|
36
37
|
};
|
|
37
38
|
}
|
|
38
39
|
export type Sizes = (typeof SizesExtended)[number];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HTMLAttributes, MutableRefObject } from 'react';
|
|
2
|
-
import { PLP_INFINITE_SCROLLType, PLP_PRODUCT_SIMILAR_DELAYType, PLP_SIZE_ORDERType, PRODUCT_CARD_IMAGE_ASPECT_RATIOType, TEXTURE_IMAGEType } from '../../../constants';
|
|
2
|
+
import { PLP_INFINITE_SCROLLType, PLP_PRODUCT_SIMILAR_DELAYType, PLP_SIZE_ORDERType, PRODUCT_CARD_IMAGE_ASPECT_RATIOType, StoreConfigType, TEXTURE_IMAGEType } from '../../../constants';
|
|
3
3
|
import { HasVariant, ProductType_PDC } from '../../../global/product';
|
|
4
4
|
import { ProductCardProps, RootProps as ProductCard_RootProps } from '../ProductCard';
|
|
5
5
|
import { TagCommercialConsumer } from '../../../cms/ContentTypes/FlagsAndTags';
|
|
@@ -49,5 +49,6 @@ export interface CardProps {
|
|
|
49
49
|
PLP_PRODUCT_SIMILAR_DELAY: PLP_PRODUCT_SIMILAR_DELAYType;
|
|
50
50
|
PLP_SIZE_ORDER: PLP_SIZE_ORDERType;
|
|
51
51
|
TEXTURE_IMAGE?: TEXTURE_IMAGEType;
|
|
52
|
+
storeId: StoreConfigType['api']['storeId'];
|
|
52
53
|
};
|
|
53
54
|
}
|
|
@@ -114,9 +114,8 @@ export type ProductMeasurementsProps = {
|
|
|
114
114
|
Z_INDEX_WAR: Z_INDEX_WARType;
|
|
115
115
|
};
|
|
116
116
|
export interface PDPSimilarsType extends PropsWithChildren {
|
|
117
|
-
|
|
117
|
+
storeId: string;
|
|
118
118
|
productId: string;
|
|
119
|
-
ClientItems: React.ComponentType<ItemsProps>;
|
|
120
119
|
PDP_INFO: PDP_INFOType;
|
|
121
120
|
TEXTURE_IMAGE: TEXTURE_IMAGEType;
|
|
122
121
|
TOGGLE_STYLE_MODIFIER: TOGGLE_STYLE_MODIFIERType;
|
|
@@ -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 } from '../../../contexts/contexts/plp';
|
|
5
|
+
import { Page, PLPConstantsContextProps } from '../../../contexts/contexts/plp';
|
|
6
6
|
import { ProductType_PDC } from '../../../global/product';
|
|
7
7
|
import { ProductCardProps } from '../../team-components/ProductCard';
|
|
8
8
|
|
|
@@ -113,8 +113,9 @@ export interface ProductsProps {
|
|
|
113
113
|
StoreConfig_MainSellerId: StoreConfigType['mainSeller']['id'];
|
|
114
114
|
TEXTURE_IMAGE: TEXTURE_IMAGEType;
|
|
115
115
|
Z_INDEX_WAR: Z_INDEX_WARType;
|
|
116
|
+
storeId: StoreConfigType['api']['storeId'];
|
|
116
117
|
}
|
|
117
|
-
export interface PLPRootProps {
|
|
118
|
+
export interface PLPRootProps extends PLPConstantsContextProps {
|
|
118
119
|
className?: string;
|
|
119
120
|
}
|
|
120
121
|
export type EmptyProps = {
|