@soma-vertical-web/multi-lib 1.0.19 → 1.0.21
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/Session.d.ts +1 -1
- 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/Search.d.ts +1 -1
- package/contexts/hooks/useSimilars.d.ts +7 -0
- package/contexts/index.d.ts +5 -5
- package/data/api/checkout/order-form/shipping/update/index.d.ts +2 -2
- package/data/api/user/index.d.ts +3 -0
- 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-BhiCzrut.mjs +2255 -0
- package/index-CpUjW-m9.mjs +1877 -0
- package/index-DZ1MbO8M.js +4 -0
- package/index-xWhZ_YcF.js +4 -0
- package/index.js +17 -17
- package/index.mjs +12132 -14158
- package/index2.js +8 -1
- package/index2.mjs +2345 -1215
- package/layout/index.d.ts +4 -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/TrackingRouteWatcher/index.d.ts +5 -0
- package/package.json +1 -1
- package/server.d.ts +2 -4
- package/types/contexts/contexts/plp.d.ts +8 -42
- package/types/contexts/contexts/search.d.ts +15 -34
- package/types/contexts/contexts/session.d.ts +1 -0
- package/types/layout/team-components/PLPNavigation/index.d.ts +2 -0
- package/types/layout/templates/PLP/index.d.ts +2 -2
package/layout/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { helpers as FilterHelpers } from './team-component/Filter';
|
|
2
2
|
import { default as LPCadastro } from './template/LPCadastro';
|
|
3
|
+
import { default as tracker } from './template/TrackingRouteWatcher';
|
|
3
4
|
import * as pdp from './template/PDP';
|
|
4
5
|
export declare const layout: {
|
|
5
6
|
teamComponents: {
|
|
@@ -260,7 +261,7 @@ export declare const layout: {
|
|
|
260
261
|
};
|
|
261
262
|
};
|
|
262
263
|
pdc: {
|
|
263
|
-
({ className }: import('../types/layout/templates/PLP').PLPRootProps): import("react/jsx-runtime").JSX.Element;
|
|
264
|
+
({ className, ...props }: import('../types/layout/templates/PLP').PLPRootProps): import("react/jsx-runtime").JSX.Element;
|
|
264
265
|
displayName: string;
|
|
265
266
|
};
|
|
266
267
|
pdc_composites: {
|
|
@@ -293,7 +294,7 @@ export declare const layout: {
|
|
|
293
294
|
displayName: string;
|
|
294
295
|
};
|
|
295
296
|
Pagination: {
|
|
296
|
-
({ query, type, searchParams, ITEMS_DEFAULT_SORT, ITEMS_PER_SECTION, ITEMS_PER_PAGE, SEARCH_PAGE_ITEM_THRESHOLD, VARIANT_PAGINATION, ...props }: import('../types/layout/templates/PLP').PaginationProps): import("react/jsx-runtime").JSX.Element
|
|
297
|
+
({ query, type, searchParams, ITEMS_DEFAULT_SORT, ITEMS_PER_SECTION, ITEMS_PER_PAGE, SEARCH_PAGE_ITEM_THRESHOLD, VARIANT_PAGINATION, ...props }: import('../types/layout/templates/PLP').PaginationProps): import("react/jsx-runtime").JSX.Element;
|
|
297
298
|
displayName: string;
|
|
298
299
|
};
|
|
299
300
|
Products: {
|
|
@@ -368,6 +369,7 @@ export declare const layout: {
|
|
|
368
369
|
displayName: string;
|
|
369
370
|
};
|
|
370
371
|
};
|
|
372
|
+
tracker: typeof tracker;
|
|
371
373
|
};
|
|
372
374
|
utils: {
|
|
373
375
|
EventCollector: ({ page, data }: import('react').PropsWithChildren & import('../types/data/events').CollectorProps) => null;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PaginationProps } from '../../../../../types/layout/templates/PLP';
|
|
2
2
|
|
|
3
3
|
declare const Pagination: {
|
|
4
|
-
({ query, type, searchParams, ITEMS_DEFAULT_SORT, ITEMS_PER_SECTION, ITEMS_PER_PAGE, SEARCH_PAGE_ITEM_THRESHOLD, VARIANT_PAGINATION, ...props }: PaginationProps): import("react/jsx-runtime").JSX.Element
|
|
4
|
+
({ query, type, searchParams, ITEMS_DEFAULT_SORT, ITEMS_PER_SECTION, ITEMS_PER_PAGE, SEARCH_PAGE_ITEM_THRESHOLD, VARIANT_PAGINATION, ...props }: PaginationProps): import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
displayName: string;
|
|
6
6
|
};
|
|
7
7
|
export default Pagination;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PLPRootProps } from '../../../types/layout/templates/PLP';
|
|
2
2
|
|
|
3
3
|
declare const PDC: {
|
|
4
|
-
({ className }: PLPRootProps): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
({ className, ...props }: PLPRootProps): import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
displayName: string;
|
|
6
6
|
};
|
|
7
7
|
export default PDC;
|
|
@@ -28,7 +28,7 @@ declare const PDC: {
|
|
|
28
28
|
displayName: string;
|
|
29
29
|
};
|
|
30
30
|
Pagination: {
|
|
31
|
-
({ query, type, searchParams, ITEMS_DEFAULT_SORT, ITEMS_PER_SECTION, ITEMS_PER_PAGE, SEARCH_PAGE_ITEM_THRESHOLD, VARIANT_PAGINATION, ...props }: import('../../../types/layout/templates/PLP').PaginationProps): import("react/jsx-runtime").JSX.Element
|
|
31
|
+
({ query, type, searchParams, ITEMS_DEFAULT_SORT, ITEMS_PER_SECTION, ITEMS_PER_PAGE, SEARCH_PAGE_ITEM_THRESHOLD, VARIANT_PAGINATION, ...props }: import('../../../types/layout/templates/PLP').PaginationProps): import("react/jsx-runtime").JSX.Element;
|
|
32
32
|
displayName: string;
|
|
33
33
|
};
|
|
34
34
|
Products: {
|
package/package.json
CHANGED
package/server.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ import * as catalog from './data/api/catalog';
|
|
|
5
5
|
import * as cms from './data/api/cms';
|
|
6
6
|
import * as search from './data/api/search';
|
|
7
7
|
import * as masterdata from './data/api/master-data';
|
|
8
|
+
import * as user from './data/api/user';
|
|
8
9
|
import * as catalogHelpers from './data/helpers/catalog';
|
|
9
10
|
import * as productHelpers from './data/helpers/product';
|
|
10
11
|
declare const serverAPIs: {
|
|
@@ -13,6 +14,7 @@ declare const serverAPIs: {
|
|
|
13
14
|
cms: typeof cms;
|
|
14
15
|
search: typeof search;
|
|
15
16
|
masterdata: typeof masterdata;
|
|
17
|
+
user: typeof user;
|
|
16
18
|
wishlist: {
|
|
17
19
|
getWishlistProducts({ body, apiUrl, extraData, fetchOptions }: import('./types/data/api').FetchFunctionsProps<any>): Promise<any>;
|
|
18
20
|
};
|
|
@@ -28,10 +30,6 @@ declare const serverHelpers: {
|
|
|
28
30
|
value: string;
|
|
29
31
|
key: string;
|
|
30
32
|
}[];
|
|
31
|
-
selectedFacets: (facets: string[]) => {
|
|
32
|
-
key: string;
|
|
33
|
-
value: string;
|
|
34
|
-
}[];
|
|
35
33
|
filterNonCategorySelected: (facets: import('./types/data/api/search/facets').Facet[], base?: string | null) => import('./types/data/api/search/facets').Facet<import('./types/data/api/search/facets').FacetValueBoolean | import('./types/data/api/search/facets').FacetValueRange>[];
|
|
36
34
|
};
|
|
37
35
|
product: typeof productHelpers;
|
|
@@ -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,6 @@ 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;
|
|
132
98
|
}
|
|
133
99
|
export type PLPConstantsContextProps = Omit<PLPConstantsProviderProps, 'children'>;
|
|
@@ -1,41 +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
|
-
import { UseQueryOptions } from '@tanstack/react-query';
|
|
8
8
|
|
|
9
|
-
export interface QueryFacetsContextProps extends FacetSearchResult {
|
|
10
|
-
isLoading?: boolean;
|
|
11
|
-
deleteAllFacets(): void;
|
|
12
|
-
selectedFacets: SelectedFacet[];
|
|
13
|
-
onToggleFacet(value: SelectedFacet): void;
|
|
14
|
-
onSort(sort: PLP_FILTERS_SORT_OPTIONtype): void;
|
|
15
|
-
}
|
|
16
9
|
export interface FacetsContextProps {
|
|
10
|
+
breadcrumb: BreadCrumbItemLinkProps[];
|
|
17
11
|
deleteAllFacets(): void;
|
|
12
|
+
facets: Facet[];
|
|
13
|
+
isLoading: boolean;
|
|
18
14
|
selectedFacets: SelectedFacet[];
|
|
19
15
|
onToggleFacet(value: SelectedFacet): void;
|
|
20
16
|
onSort(sort: PLP_FILTERS_SORT_OPTIONtype): void;
|
|
21
17
|
}
|
|
22
|
-
export interface QueryFacetsProviderProps extends PropsWithChildren {
|
|
23
|
-
state: State;
|
|
24
|
-
forceUpdate?: boolean;
|
|
25
|
-
PLP_SORT_DEFAULT: ITEMS_DEFAULT_SORTType;
|
|
26
|
-
}
|
|
27
18
|
export interface FacetsProviderProps extends PropsWithChildren {
|
|
28
19
|
forceUpdate?: boolean;
|
|
29
|
-
searchParams: URLSearchParams;
|
|
30
|
-
PLP_SORT_DEFAULT: ITEMS_DEFAULT_SORTType;
|
|
31
20
|
}
|
|
32
21
|
export interface FacetsProviderContentProps extends Omit<FacetsProviderProps, 'forceUpdate'> {
|
|
33
22
|
selectedFacets: SelectedFacet[];
|
|
34
23
|
}
|
|
35
|
-
export interface QueryProductsContextProps extends ProductSearchResultPage {
|
|
36
|
-
isLoading: boolean;
|
|
37
|
-
total: number;
|
|
38
|
-
}
|
|
39
24
|
export interface ProductsContextProps extends ProductSearchResultPage {
|
|
40
25
|
isLoading: boolean;
|
|
41
26
|
total: number;
|
|
@@ -48,21 +33,22 @@ export interface SuggestedTermsContextProps {
|
|
|
48
33
|
export interface SuggestedTermsProviderProps extends PropsWithChildren {
|
|
49
34
|
term?: string;
|
|
50
35
|
}
|
|
51
|
-
export interface
|
|
36
|
+
export interface ProductsProviderProps extends PropsWithChildren {
|
|
37
|
+
query?: string;
|
|
52
38
|
forceUpdate?: boolean;
|
|
53
|
-
options: Omit<UseQueryOptions<DataParams, Error, DataParams, (string | undefined)[]>, 'queryKey' | 'queryFn'>;
|
|
54
|
-
state: State;
|
|
55
|
-
queryKey: (string | undefined)[];
|
|
56
39
|
}
|
|
57
|
-
export interface
|
|
58
|
-
|
|
40
|
+
export interface SearchContextProps extends Pick<SearchProviderProps, 'sort' | 'searchParams'> {
|
|
41
|
+
count: number;
|
|
42
|
+
state: State;
|
|
59
43
|
}
|
|
60
|
-
export type SearchContextProps = Pick<SearchProviderProps, 'state' | 'searchParams'>;
|
|
61
44
|
export interface SearchProviderProps extends PropsWithChildren {
|
|
62
|
-
brand?: string | null;
|
|
63
|
-
collectionId?: number | null;
|
|
64
45
|
searchParams: URLSearchParams;
|
|
65
46
|
state: State;
|
|
47
|
+
sort?: string;
|
|
48
|
+
collectionId?: number | null;
|
|
49
|
+
brand?: string | null;
|
|
50
|
+
count?: number;
|
|
51
|
+
ITEMS_PER_PAGE: ITEMS_PER_PAGEType;
|
|
66
52
|
}
|
|
67
53
|
export interface SearchItem {
|
|
68
54
|
term: string;
|
|
@@ -74,11 +60,6 @@ export interface TopSearchesContextProps {
|
|
|
74
60
|
error: string | null;
|
|
75
61
|
}
|
|
76
62
|
export type DataParams = FacetsContextProps | ProductSearchResultPage | SuggestedTermsContextProps;
|
|
77
|
-
export interface RootQueryContextProps {
|
|
78
|
-
data: DataParams | undefined;
|
|
79
|
-
isLoading: boolean;
|
|
80
|
-
isError?: boolean;
|
|
81
|
-
}
|
|
82
63
|
export interface RootContextProps {
|
|
83
64
|
data: DataParams | null;
|
|
84
65
|
isLoading: boolean;
|
|
@@ -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 = {
|
|
@@ -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
|
|
|
@@ -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 extends PLPConstantsContextProps {
|
|
118
118
|
className?: string;
|
|
119
119
|
}
|
|
120
120
|
export type EmptyProps = {
|