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

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 (49) 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/Search.d.ts +1 -1
  5. package/contexts/hooks/useScrollRestorationInfinite.d.ts +1 -1
  6. package/contexts/index.d.ts +4 -4
  7. package/data/api/aviseme/index.d.ts +18 -0
  8. package/data/api/preview/exit-preview/index.d.ts +13 -0
  9. package/data/api/preview/index.d.ts +36 -0
  10. package/data/api/xml/index.d.ts +3 -0
  11. package/data/helpers/plp/index.d.ts +3 -7
  12. package/data/helpers/search/facets.d.ts +0 -1
  13. package/data/helpers/search/index.d.ts +0 -4
  14. package/data/helpers/search/product/index.d.ts +1 -13
  15. package/data/helpers/search/search.d.ts +0 -1
  16. package/data/index.d.ts +0 -2
  17. package/{index-CIVkR1d_.mjs → index-BM8vTUKg.mjs} +712 -776
  18. package/index-CZjoMPpQ.js +4 -0
  19. package/index.js +18 -18
  20. package/index.mjs +8751 -11007
  21. package/index2.js +2 -2
  22. package/index2.mjs +666 -578
  23. package/layout/index.d.ts +2 -2
  24. package/layout/template/PDC/Composite/InfiniteScroller/Banners/Banners.d.ts +1 -1
  25. package/layout/template/PDC/Composite/InfiniteScroller/Page/Composite/Card.d.ts +1 -1
  26. package/layout/template/PDC/Composite/InfiniteScroller/Page/Composite/Loader.d.ts +1 -1
  27. package/layout/template/PDC/Composite/InfiniteScroller/Page/Composite/NextPage.d.ts +1 -4
  28. package/layout/template/PDC/Composite/InfiniteScroller/Page/Page.d.ts +2 -2
  29. package/layout/template/PDC/Composite/InfiniteScroller/Page/index.d.ts +3 -10
  30. package/layout/template/PDC/Composite/Pagination/Pagination.d.ts +1 -1
  31. package/layout/template/PDC/PDC.d.ts +1 -1
  32. package/layout/template/PDC/index.d.ts +1 -1
  33. package/package.json +1 -1
  34. package/server.d.ts +8 -4
  35. package/style.css +1 -1
  36. package/types/contexts/contexts/plp.d.ts +21 -63
  37. package/types/contexts/contexts/search.d.ts +17 -39
  38. package/types/contexts/hooks/index.d.ts +2 -0
  39. package/types/layout/team-components/PLPNavigation/index.d.ts +2 -0
  40. package/types/layout/templates/PLP/index.d.ts +3 -7
  41. package/contexts/contexts/search/QueryFacets.d.ts +0 -5
  42. package/contexts/contexts/search/QueryProducts.d.ts +0 -5
  43. package/contexts/contexts/search/RootTank.d.ts +0 -9
  44. package/contexts/store/plp-scroll.d.ts +0 -3
  45. package/index-BFjIPkXv.js +0 -4
  46. package/layout/template/PDC/Composite/InfiniteScroller/Filters/Filters.d.ts +0 -11
  47. package/layout/template/PDC/Composite/InfiniteScroller/Filters/index.d.ts +0 -1
  48. package/layout/template/PDC/Composite/InfiniteScroller/Page/Composite/AnchorPDP.d.ts +0 -7
  49. package/layout/template/SearchResult/Composite/Products.d.ts +0 -7
@@ -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, ...props }: FilterProviderProps) => import("react/jsx-runtime").JSX.Element;
4
+ declare const FilterProvider: ({ children, filters, PLP_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: ({ brand, constants, collectionId, children, itemsPerPage, pathname, searchParams, slug, ...props }: PLPProviderProps) => import("react/jsx-runtime").JSX.Element;
4
+ declare const PLPProvider: ({ children, slug, searchParams, collectionId, brand, itemsPerPage, PLP_SORT_DEFAULT }: 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, searchParams, PLP_SORT_DEFAULT }: FacetsProviderProps) => import("react/jsx-runtime").JSX.Element;
3
+ declare const FacetsProvider: ({ children, forceUpdate, storeId, }: 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 { SearchProviderProps, SearchContextProps } from '../../../types/contexts/contexts/search';
2
2
 
3
- declare const SearchProvider: ({ children, state, collectionId, brand, searchParams, }: SearchProviderProps) => import("react/jsx-runtime").JSX.Element;
3
+ declare const SearchProvider: ({ children, sort, state, count, collectionId, brand, searchParams, ITEMS_PER_PAGE }: 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: ({ load, PLP_GRID_SCROLL_BACK }: UseScrollRestorationInfiniteProps) => void;
3
+ export declare const useScrollRestorationInfinite: ({ pages, 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: ({ brand, constants, collectionId, children, itemsPerPage, pathname, searchParams, slug, ...props }: import('../types/contexts/contexts/plp').PLPProviderProps) => import("react/jsx-runtime").JSX.Element;
84
+ provider: ({ children, slug, searchParams, collectionId, brand, itemsPerPage, PLP_SORT_DEFAULT }: 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, ...props }: import('../types/layout/team-components/Filter').FilterProviderProps) => import("react/jsx-runtime").JSX.Element;
89
+ provider: ({ children, filters, PLP_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;
@@ -101,7 +101,7 @@ export declare const contexts: {
101
101
  };
102
102
  searchFacets: {
103
103
  hook: () => import('../types/contexts/contexts/search').FacetsContextProps;
104
- provider: ({ children, searchParams, PLP_SORT_DEFAULT }: import('../types/contexts/contexts/search').FacetsProviderProps) => import("react/jsx-runtime").JSX.Element;
104
+ provider: ({ children, forceUpdate, storeId, }: import('../types/contexts/contexts/search').FacetsProviderProps) => import("react/jsx-runtime").JSX.Element;
105
105
  };
106
106
  searchProducts: {
107
107
  hook: () => import('../types/contexts/contexts/search').ProductsContextProps;
@@ -113,7 +113,7 @@ export declare const contexts: {
113
113
  };
114
114
  searchSearch: {
115
115
  hook: () => import('../types/contexts/contexts/search').SearchContextProps;
116
- provider: ({ children, state, collectionId, brand, searchParams, }: import('../types/contexts/contexts/search').SearchProviderProps) => import("react/jsx-runtime").JSX.Element;
116
+ provider: ({ children, sort, state, count, collectionId, brand, searchParams, ITEMS_PER_PAGE }: import('../types/contexts/contexts/search').SearchProviderProps) => import("react/jsx-runtime").JSX.Element;
117
117
  };
118
118
  session: {
119
119
  hook: () => import('../types/contexts/contexts/session').ISessionContext;
@@ -0,0 +1,18 @@
1
+ import { FetchFunctionsProps } from 'libs/multi-lib/src/types/data/api';
2
+ import * as yup from 'yup';
3
+ declare const schema: yup.ObjectSchema<{
4
+ userName: string | undefined;
5
+ email: string | undefined;
6
+ sku: string | undefined;
7
+ }, yup.AnyObject, {
8
+ userName: undefined;
9
+ email: undefined;
10
+ sku: undefined;
11
+ }, "">;
12
+ type SchemaType = yup.InferType<typeof schema>;
13
+ export declare function aviseMe({ apiUrl, body, }: FetchFunctionsProps<SchemaType>): Promise<{
14
+ ok: boolean;
15
+ status: number;
16
+ text: () => Promise<string>;
17
+ } | undefined>;
18
+ export {};
@@ -0,0 +1,13 @@
1
+ import { NextRequest } from 'next/server';
2
+
3
+ /**
4
+ * Disables Next.js Draft Mode and redirects to a specified path or the homepage.
5
+ * This route should be called to exit the preview/draft experience.
6
+ *
7
+ * @example /api/preview/disable?redirect=/category
8
+ */
9
+ export declare function getCMSPreviewExitData(request: NextRequest): {
10
+ redirectTo: string;
11
+ clearCookies: string[];
12
+ disableDraft: boolean;
13
+ };
@@ -0,0 +1,36 @@
1
+ import { NextRequest } from 'next/server';
2
+
3
+ /**
4
+ * Enables Next.js Draft Mode and redirects the user to the provided URL
5
+ * (or to the homepage if none is provided).
6
+ *
7
+ * This route is used to enter the preview/draft experience for any CMS.
8
+ * It supports multiple CMS platforms such as VTEX and Strapi, each sending
9
+ * different preview parameters.
10
+ *
11
+ *
12
+ * @example VTEX
13
+ * /api/preview?url=/product/123&previewMode=true&versionId=abc123&documentId=xyz789
14
+ *
15
+ * @example strapi
16
+ * /api/preview?url=/blog/my-post&status=draft&secret=STRAPI_PREVIEW_TOKEN
17
+ */
18
+ export declare function getCMSPreviewData({ platformCMS, request, }: {
19
+ platformCMS: string;
20
+ request: NextRequest;
21
+ }): {
22
+ error: boolean;
23
+ url?: undefined;
24
+ isDraft?: undefined;
25
+ previewData?: undefined;
26
+ } | {
27
+ url: string;
28
+ isDraft: boolean;
29
+ previewData: {
30
+ versionId: string;
31
+ releaseId: string;
32
+ documentId: string;
33
+ contentType: string;
34
+ } | null;
35
+ error?: undefined;
36
+ };
@@ -0,0 +1,3 @@
1
+ export declare function getVtexXmlProxyData({ pathname }: {
2
+ pathname: string;
3
+ }): 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 { PageState, PLPBanners, Page } from '../../../types/contexts/contexts/plp';
4
+ import { PLPBanners, Page, PLPInfiniteContextProps } 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,10 +16,6 @@ export declare const getPositions: (banners: PLPBanners, page: number, columns:
16
16
  banners: number[];
17
17
  products: number[];
18
18
  };
19
- export declare const createPagesTanStank: (page: number, initial?: boolean) => {
20
- loading: boolean;
21
- page: number;
22
- }[];
23
19
  export declare const createPages: (page: number, data?: ProductSearchResultPage, itemsPerPage?: number) => {
24
20
  loading: boolean;
25
21
  page: number;
@@ -34,7 +30,7 @@ export declare const createPages: (page: number, data?: ProductSearchResultPage,
34
30
  products: ProductNode_PDC[];
35
31
  }[];
36
32
  export declare const createPage: (pages: Page[], newPage: number) => Page[];
37
- export declare const createPagination: (page?: number, itemsPerPage?: number) => {
33
+ export declare const createPagination: () => {
38
34
  nextPage: boolean;
39
35
  previousPage: boolean;
40
36
  startCursor: string;
@@ -42,7 +38,7 @@ export declare const createPagination: (page?: number, itemsPerPage?: number) =>
42
38
  count: number;
43
39
  total: number;
44
40
  };
45
- export declare const getVisibleBanners: (pages: Page[], banners: PLPBanners, products: PageState["products"], bannersPositions: PageState["banners"], count: number) => ({
41
+ export declare const getVisibleBanners: (pages: Page[], banners: PLPBanners, products: PLPInfiniteContextProps["products"], bannersPositions: PLPInfiniteContextProps["banners"], count: number) => ({
46
42
  columns: number;
47
43
  position_grid: number;
48
44
  } & {
@@ -46,4 +46,3 @@ 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,10 +7,6 @@ declare const searchHelpers: {
7
7
  value: string;
8
8
  key: string;
9
9
  }[];
10
- selectedFacets: (facets: string[]) => {
11
- key: string;
12
- value: string;
13
- }[];
14
10
  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>[];
15
11
  };
16
12
  export default searchHelpers;
@@ -268,19 +268,7 @@ 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 | {
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
- })[];
271
+ export declare const createPage: (pages: Page[], newPage: number) => Page[];
284
272
  export declare const createPagination: () => {
285
273
  nextPage: boolean;
286
274
  previousPage: boolean;
@@ -2,7 +2,6 @@ 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;
6
5
  export declare const createCategorySlug: (slug: string[] | string, facets: string[]) => string;
7
6
  export declare const convertSearchParams: (searchParams: {
8
7
  [key: string]: string | string[] | undefined;
package/data/index.d.ts CHANGED
@@ -2,7 +2,6 @@ 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";
6
5
  import * as utils from "./helpers/utils";
7
6
  export declare const data: {
8
7
  helpers: {
@@ -11,6 +10,5 @@ export declare const data: {
11
10
  plp: typeof plp;
12
11
  product: typeof product;
13
12
  utils: typeof utils;
14
- search: typeof search;
15
13
  };
16
14
  };