@soma-vertical-web/multi-lib 1.0.32 → 1.0.34

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.
Files changed (57) hide show
  1. package/contexts/contexts/plp/FilterContext.d.ts +1 -1
  2. package/contexts/contexts/plp/PLPContext.d.ts +1 -1
  3. package/contexts/contexts/search/Facets.d.ts +1 -1
  4. package/contexts/contexts/search/Products.d.ts +1 -1
  5. package/contexts/contexts/search/QueryFacets.d.ts +5 -0
  6. package/contexts/contexts/search/QueryProducts.d.ts +5 -0
  7. package/contexts/contexts/search/RootTank.d.ts +9 -0
  8. package/contexts/contexts/search/Search.d.ts +1 -1
  9. package/contexts/hooks/useScrollRestorationInfinite.d.ts +1 -1
  10. package/contexts/index.d.ts +3 -15
  11. package/contexts/store/plp-scroll.d.ts +3 -0
  12. package/contexts/store/plp.d.ts +2 -2
  13. package/data/api/fetchProxy.d.ts +9 -0
  14. package/data/helpers/plp/index.d.ts +4 -13
  15. package/data/helpers/search/facets.d.ts +1 -0
  16. package/data/helpers/search/index.d.ts +4 -0
  17. package/data/helpers/search/product/index.d.ts +13 -1
  18. package/data/helpers/search/search.d.ts +1 -0
  19. package/data/index.d.ts +2 -0
  20. package/index-AgO_aUeQ.mjs +2371 -0
  21. package/index-BFjIPkXv.js +4 -0
  22. package/{index-BM8vTUKg.mjs → index-CIVkR1d_.mjs} +776 -712
  23. package/index-CXSKhXO3.js +4 -0
  24. package/index-D0PGMDh5.js +4 -0
  25. package/index-ekZLWJ5-.mjs +2686 -0
  26. package/index.js +17 -17
  27. package/index.mjs +10513 -8429
  28. package/index2.js +2 -2
  29. package/index2.mjs +338 -343
  30. package/layout/index.d.ts +5 -5
  31. package/layout/template/PDC/Composite/Grid/Grid.d.ts +1 -1
  32. package/layout/template/PDC/Composite/InfiniteScroller/Banners/Banners.d.ts +1 -1
  33. package/layout/template/PDC/Composite/InfiniteScroller/Filters/Filters.d.ts +7 -0
  34. package/layout/template/PDC/Composite/InfiniteScroller/Filters/index.d.ts +1 -0
  35. package/layout/template/PDC/Composite/InfiniteScroller/InfiniteScroller.d.ts +3 -1
  36. package/layout/template/PDC/Composite/InfiniteScroller/Page/Composite/AnchorPDP.d.ts +7 -0
  37. package/layout/template/PDC/Composite/InfiniteScroller/Page/Composite/Card.d.ts +1 -1
  38. package/layout/template/PDC/Composite/InfiniteScroller/Page/Composite/Loader.d.ts +1 -1
  39. package/layout/template/PDC/Composite/InfiniteScroller/Page/Composite/NextPage.d.ts +4 -1
  40. package/layout/template/PDC/Composite/InfiniteScroller/Page/Page.d.ts +2 -2
  41. package/layout/template/PDC/Composite/InfiniteScroller/Page/index.d.ts +10 -3
  42. package/layout/template/PDC/Composite/Pagination/Pagination.d.ts +1 -1
  43. package/layout/template/PDC/PDC.d.ts +1 -1
  44. package/layout/template/PDC/index.d.ts +3 -3
  45. package/layout/template/SearchResult/Composite/Products.d.ts +7 -0
  46. package/layout/template/SearchResult/SearchContent.d.ts +1 -1
  47. package/layout/template/SearchResult/SearchResult.d.ts +1 -1
  48. package/package.json +1 -1
  49. package/server.d.ts +4 -0
  50. package/style.css +1 -1
  51. package/types/contexts/contexts/plp.d.ts +63 -21
  52. package/types/contexts/contexts/search.d.ts +30 -28
  53. package/types/contexts/hooks/index.d.ts +0 -2
  54. package/types/layout/team-components/PLPNavigation/index.d.ts +0 -2
  55. package/types/layout/templates/PLP/index.d.ts +20 -4
  56. package/types/layout/templates/SearchResult/index.d.ts +3 -0
  57. package/index-CZjoMPpQ.js +0 -4
@@ -1,6 +1,6 @@
1
1
  import { FilterContextProps, FilterProviderProps } from '../../../types/layout/team-components/Filter';
2
2
 
3
3
  declare const FilterContext: import('react').Context<FilterContextProps>;
4
- declare const FilterProvider: ({ children, filters, PLP_FILTERS, ...props }: FilterProviderProps) => import("react/jsx-runtime").JSX.Element;
4
+ declare const FilterProvider: ({ children, filters, ...props }: FilterProviderProps) => import("react/jsx-runtime").JSX.Element;
5
5
  declare const useFilterContext: () => FilterContextProps;
6
6
  export { FilterContext, FilterProvider, useFilterContext };
@@ -1,6 +1,6 @@
1
1
  import { PLPContextProps, PLPProviderProps } from '../../../types/contexts/contexts/plp';
2
2
 
3
3
  declare const PLPContext: import('react').Context<PLPContextProps>;
4
- declare const PLPProvider: ({ children, slug, searchParams, collectionId, brand, itemsPerPage, PLP_SORT_DEFAULT }: PLPProviderProps) => import("react/jsx-runtime").JSX.Element;
4
+ declare const PLPProvider: ({ brand, constants, collectionId, children, itemsPerPage, pathname, searchParams, slug, ...props }: PLPProviderProps) => import("react/jsx-runtime").JSX.Element;
5
5
  declare const usePLPContext: () => PLPContextProps;
6
6
  export { PLPContext, PLPProvider, usePLPContext };
@@ -1,5 +1,5 @@
1
1
  import { FacetsContextProps, FacetsProviderProps } from '../../../types/contexts/contexts/search';
2
2
 
3
- declare const FacetsProvider: ({ children, forceUpdate, storeId, }: FacetsProviderProps) => import("react/jsx-runtime").JSX.Element;
3
+ declare const FacetsProvider: ({ children, forceUpdate, }: FacetsProviderProps) => import("react/jsx-runtime").JSX.Element;
4
4
  declare const useFacetsContext: () => FacetsContextProps;
5
5
  export { FacetsProvider, useFacetsContext };
@@ -1,5 +1,5 @@
1
1
  import { ProductsContextProps, ProductsProviderProps } from '../../../types/contexts/contexts/search';
2
2
 
3
- declare const ProductsProvider: ({ children, query, forceUpdate, storeId, }: ProductsProviderProps) => import("react/jsx-runtime").JSX.Element;
3
+ declare const ProductsProvider: ({ children, query, forceUpdate, }: ProductsProviderProps) => import("react/jsx-runtime").JSX.Element;
4
4
  declare const useProductsContext: () => ProductsContextProps;
5
5
  export { ProductsProvider, useProductsContext };
@@ -0,0 +1,5 @@
1
+ import { QueryFacetsContextProps, QueryFacetsProviderProps } from '../../../types/contexts/contexts/search';
2
+
3
+ declare const QueryFacetsProvider: ({ children, enabled, storeId, ...props }: QueryFacetsProviderProps) => import("react/jsx-runtime").JSX.Element;
4
+ declare const useQueryFacetsContext: () => QueryFacetsContextProps;
5
+ export { QueryFacetsProvider, useQueryFacetsContext };
@@ -0,0 +1,5 @@
1
+ import { QueryProductsContextProps, QueryProductsProviderProps } from '../../../types/contexts/contexts/search';
2
+
3
+ declare const QueryProductsProvider: ({ callback, children, forceUpdate, storeId, options, state, queryKey, }: QueryProductsProviderProps) => import("react/jsx-runtime").JSX.Element;
4
+ declare const useQueryProductsContext: () => QueryProductsContextProps;
5
+ export { QueryProductsProvider, useQueryProductsContext };
@@ -0,0 +1,9 @@
1
+ import { UseQueryOptions } from '@tanstack/react-query';
2
+ import { DataParams, RootProviderProps, RootQueryContextProps } from '../../../types/contexts/contexts/search';
3
+
4
+ declare const RootQueryProvider: <TKey extends readonly unknown[]>({ children, fetch, queryKey, options, }: RootProviderProps & {
5
+ queryKey: TKey;
6
+ options?: Omit<UseQueryOptions<DataParams, Error, DataParams, TKey>, "queryKey" | "queryFn">;
7
+ }) => import("react/jsx-runtime").JSX.Element;
8
+ declare const useRootQueryContext: () => RootQueryContextProps;
9
+ export { RootQueryProvider, useRootQueryContext };
@@ -1,5 +1,5 @@
1
1
  import { SearchProviderProps, SearchContextProps } from '../../../types/contexts/contexts/search';
2
2
 
3
- declare const SearchProvider: ({ children, sort, state, count, collectionId, brand, searchParams, ITEMS_PER_PAGE }: SearchProviderProps) => import("react/jsx-runtime").JSX.Element;
3
+ declare const SearchProvider: ({ children, state, collectionId, brand, searchParams, }: SearchProviderProps) => import("react/jsx-runtime").JSX.Element;
4
4
  declare const useSearchContext: () => SearchContextProps;
5
5
  export { SearchProvider, useSearchContext };
@@ -1,4 +1,4 @@
1
1
  import { UseScrollRestorationInfiniteProps } from '../../types/contexts/hooks';
2
2
 
3
- export declare const useScrollRestorationInfinite: ({ pages, load, PLP_GRID_SCROLL_BACK }: UseScrollRestorationInfiniteProps) => void;
3
+ export declare const useScrollRestorationInfinite: ({ load, PLP_GRID_SCROLL_BACK }: UseScrollRestorationInfiniteProps) => void;
4
4
  export default useScrollRestorationInfinite;
@@ -81,12 +81,12 @@ export declare const contexts: {
81
81
  };
82
82
  };
83
83
  plp: {
84
- provider: ({ children, slug, searchParams, collectionId, brand, itemsPerPage, PLP_SORT_DEFAULT }: import('../types/contexts/contexts/plp').PLPProviderProps) => import("react/jsx-runtime").JSX.Element;
84
+ provider: ({ brand, constants, collectionId, children, itemsPerPage, pathname, searchParams, slug, ...props }: import('../types/contexts/contexts/plp').PLPProviderProps) => import("react/jsx-runtime").JSX.Element;
85
85
  hook: () => import('../types/contexts/contexts/plp').PLPContextProps;
86
86
  };
87
87
  plpFilter: {
88
88
  hook: () => import('../types/layout/team-components/Filter').FilterContextProps;
89
- provider: ({ children, filters, PLP_FILTERS, ...props }: import('../types/layout/team-components/Filter').FilterProviderProps) => import("react/jsx-runtime").JSX.Element;
89
+ provider: ({ children, filters, ...props }: import('../types/layout/team-components/Filter').FilterProviderProps) => import("react/jsx-runtime").JSX.Element;
90
90
  };
91
91
  PLPContent: {
92
92
  provider: ({ children, data, device, SectionZone, COMMON_PAGE_COLUMN_GAP_PDC, }: import('../types/cms/ContentTypes/PLP').PLPContentProviderProps) => import("react/jsx-runtime").JSX.Element;
@@ -99,21 +99,9 @@ export declare const contexts: {
99
99
  pdpdata: {
100
100
  provider: ({ children, productData, isKit, PDP_INFO, NAME_SPLIT_SYMBOL, TEXTURE_IMAGE, }: import('../types/contexts/contexts/pdp').PDPDataProviderProps) => import("react/jsx-runtime").JSX.Element;
101
101
  };
102
- searchFacets: {
103
- hook: () => import('../types/contexts/contexts/search').FacetsContextProps;
104
- provider: ({ children, forceUpdate, storeId, }: import('../types/contexts/contexts/search').FacetsProviderProps) => import("react/jsx-runtime").JSX.Element;
105
- };
106
- searchProducts: {
107
- hook: () => import('../types/contexts/contexts/search').ProductsContextProps;
108
- provider: ({ children, query, forceUpdate, storeId, }: import('../types/contexts/contexts/search').ProductsProviderProps) => import("react/jsx-runtime").JSX.Element;
109
- };
110
- searchRoot: {
111
- hook: () => import('../types/contexts/contexts/search').RootContextProps;
112
- provider: ({ children, fetch }: import('../types/contexts/contexts/search').RootProviderProps) => import("react/jsx-runtime").JSX.Element;
113
- };
114
102
  searchSearch: {
115
103
  hook: () => import('../types/contexts/contexts/search').SearchContextProps;
116
- provider: ({ children, sort, state, count, collectionId, brand, searchParams, ITEMS_PER_PAGE }: import('../types/contexts/contexts/search').SearchProviderProps) => import("react/jsx-runtime").JSX.Element;
104
+ provider: ({ children, state, collectionId, brand, searchParams, }: import('../types/contexts/contexts/search').SearchProviderProps) => import("react/jsx-runtime").JSX.Element;
117
105
  };
118
106
  session: {
119
107
  hook: () => import('../types/contexts/contexts/session').ISessionContext;
@@ -0,0 +1,3 @@
1
+ import { ScrollPageState } from '../../types/contexts/contexts/plp';
2
+
3
+ export declare const usePLPInfiniteScroll: import('zustand').UseBoundStore<import('zustand').StoreApi<ScrollPageState>>;
@@ -1,3 +1,3 @@
1
- import { PageState } from '../../types/contexts/contexts/plp';
1
+ import { ScrollPageState } from '../../types/contexts/contexts/plp';
2
2
 
3
- export declare const usePLPInfiniteScroll: import('zustand').UseBoundStore<import('zustand').StoreApi<PageState>>;
3
+ export declare const usePLPInfiniteScroll: import('zustand').UseBoundStore<import('zustand').StoreApi<ScrollPageState>>;
@@ -0,0 +1,9 @@
1
+ import { FetchPriority } from '../../types/contexts/hooks';
2
+ import { OrderFormConstants } from '../../types/contexts/store/cart';
3
+
4
+ export declare const configureFetchProxy: (storeId: string) => void;
5
+ export declare const fetchProxy: (path: string, options?: RequestInit) => Promise<Response>;
6
+ export declare const proxyCartAPI: (path: string, params: {
7
+ priority?: FetchPriority;
8
+ body: Record<string, unknown>;
9
+ }, skipSanitize?: boolean, CONSTANTS?: OrderFormConstants) => Promise<any>;
@@ -1,7 +1,7 @@
1
1
  import { State } from '../../../types/data/api/search/index';
2
2
  import { ProductSearchResultPage } from '../../../types/data/api/search/product';
3
3
  import { ProductNode_PDC } from '../../../types/global/product';
4
- import { PLPBanners, Page, PLPInfiniteContextProps } from '../../../types/contexts/contexts/plp';
4
+ import { PageState, PLPBanners, Page } from '../../../types/contexts/contexts/plp';
5
5
  import { StoreConfigType } from '../../../types/constants';
6
6
 
7
7
  export declare const deepEqual: (a: any, b: any) => boolean;
@@ -16,21 +16,12 @@ export declare const getPositions: (banners: PLPBanners, page: number, columns:
16
16
  banners: number[];
17
17
  products: number[];
18
18
  };
19
- export declare const createPages: (page: number, data?: ProductSearchResultPage, itemsPerPage?: number) => {
19
+ export declare const createPages: (page: number, initial?: boolean) => {
20
20
  loading: boolean;
21
21
  page: number;
22
- pagination: {
23
- nextPage: boolean;
24
- previousPage: boolean;
25
- startCursor: string;
26
- endCursor: string;
27
- count: number;
28
- total: number;
29
- };
30
- products: ProductNode_PDC[];
31
22
  }[];
32
23
  export declare const createPage: (pages: Page[], newPage: number) => Page[];
33
- export declare const createPagination: () => {
24
+ export declare const createPagination: (page?: number, itemsPerPage?: number) => {
34
25
  nextPage: boolean;
35
26
  previousPage: boolean;
36
27
  startCursor: string;
@@ -38,7 +29,7 @@ export declare const createPagination: () => {
38
29
  count: number;
39
30
  total: number;
40
31
  };
41
- export declare const getVisibleBanners: (pages: Page[], banners: PLPBanners, products: PLPInfiniteContextProps["products"], bannersPositions: PLPInfiniteContextProps["banners"], count: number) => ({
32
+ export declare const getVisibleBanners: (pages: Page[], banners: PLPBanners, products: PageState["products"], bannersPositions: PageState["banners"], count: number) => ({
42
33
  columns: number;
43
34
  position_grid: number;
44
35
  } & {
@@ -46,3 +46,4 @@ export declare const filterNonRootFacets: (selectedFacets: SelectedFacet[], base
46
46
  export declare const addDefaultFacets: (facets: SelectedFacet[], channel: Channel, policy?: string, region?: string) => SelectedFacet[];
47
47
  export declare const getRegionFacet: (channel: Channel, region?: string) => StoreSelectedFacet | null;
48
48
  export declare const getPolicyFacet: (channel: Channel, key?: string) => StoreSelectedFacet | null;
49
+ export declare const getFacetsActiveSearchParams: (searchParams: URLSearchParams) => SelectedFacet[];
@@ -7,6 +7,10 @@ declare const searchHelpers: {
7
7
  value: string;
8
8
  key: string;
9
9
  }[];
10
+ selectedFacets: (facets: string[]) => {
11
+ key: string;
12
+ value: string;
13
+ }[];
10
14
  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>[];
11
15
  };
12
16
  export default searchHelpers;
@@ -268,7 +268,19 @@ export declare const createPages: ({ page, count, ...props }: SearchCreatePages)
268
268
  };
269
269
  products: ProductNode_PDC[];
270
270
  }[];
271
- export declare const createPage: (pages: Page[], newPage: number) => Page[];
271
+ export declare const createPage: (pages: Page[], newPage: number) => (Page | {
272
+ loading: boolean;
273
+ page: number;
274
+ pagination: {
275
+ nextPage: boolean;
276
+ previousPage: boolean;
277
+ startCursor: string;
278
+ endCursor: string;
279
+ count: number;
280
+ total: number;
281
+ };
282
+ products: never[];
283
+ })[];
272
284
  export declare const createPagination: () => {
273
285
  nextPage: boolean;
274
286
  previousPage: boolean;
@@ -2,6 +2,7 @@ import { AppRouterInstance } from 'next/dist/shared/lib/app-router-context.share
2
2
  import { State } from '../../../types/data/api/search';
3
3
 
4
4
  export declare const parseSearchState: ({ pathname, searchParams }: URL, facets: string[]) => State;
5
+ export declare const parsePLPState: (pathname: string, { searchParams }: URL, facets: string[]) => State;
5
6
  export declare const createCategorySlug: (slug: string[] | string, facets: string[]) => string;
6
7
  export declare const convertSearchParams: (searchParams: {
7
8
  [key: string]: string | string[] | undefined;
package/data/index.d.ts CHANGED
@@ -2,6 +2,7 @@ import * as cart from "./helpers/cart";
2
2
  import * as events from "./helpers/events";
3
3
  import * as plp from "./helpers/plp";
4
4
  import * as product from "./helpers/product";
5
+ import * as search from "./helpers/search";
5
6
  import * as utils from "./helpers/utils";
6
7
  export declare const data: {
7
8
  helpers: {
@@ -10,5 +11,6 @@ export declare const data: {
10
11
  plp: typeof plp;
11
12
  product: typeof product;
12
13
  utils: typeof utils;
14
+ search: typeof search;
13
15
  };
14
16
  };