@wix/headless-stores 0.0.28 → 0.0.29

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.
@@ -1,6 +1,9 @@
1
1
  import { type ProductsListServiceConfig } from "../services/products-list-service.js";
2
- import type { PropsWithChildren, ReactNode } from "react";
3
2
  import { productsV3 } from "@wix/stores";
3
+ export interface RootProps {
4
+ children: React.ReactNode;
5
+ productsListConfig: ProductsListServiceConfig;
6
+ }
4
7
  /**
5
8
  * Root component that provides the ProductsList service context to its children.
6
9
  * This component sets up the necessary services for managing products list state.
@@ -11,13 +14,12 @@ import { productsV3 } from "@wix/stores";
11
14
  * @param props.productsListConfig - Configuration for the ProductsList service
12
15
  * @returns JSX element wrapping children with ProductsList service context
13
16
  */
14
- export declare function Root(props: PropsWithChildren<{
15
- productsListConfig: ProductsListServiceConfig;
16
- }>): import("react/jsx-runtime").JSX.Element;
17
- export type EmptyStateProps = {
18
- children: ((props: EmptyStateRenderProps) => ReactNode) | ReactNode;
19
- };
20
- export type EmptyStateRenderProps = {};
17
+ export declare function Root(props: RootProps): React.ReactNode;
18
+ export interface EmptyStateProps {
19
+ children: (props: EmptyStateRenderProps) => React.ReactNode;
20
+ }
21
+ export interface EmptyStateRenderProps {
22
+ }
21
23
  /**
22
24
  * Component that renders content when the products list is empty.
23
25
  * Only displays its children when there are no products, no loading state, and no errors.
@@ -27,11 +29,12 @@ export type EmptyStateRenderProps = {};
27
29
  * @param props.children - Content to display when products list is empty (can be a render function or ReactNode)
28
30
  * @returns JSX element or null based on products list state
29
31
  */
30
- export declare function EmptyState(props: EmptyStateProps): ReactNode;
31
- export type LoadingProps = {
32
- children: ((props: LoadingRenderProps) => ReactNode) | ReactNode;
33
- };
34
- export type LoadingRenderProps = {};
32
+ export declare function EmptyState(props: EmptyStateProps): React.ReactNode;
33
+ export interface LoadingProps {
34
+ children: (props: LoadingRenderProps) => React.ReactNode;
35
+ }
36
+ export interface LoadingRenderProps {
37
+ }
35
38
  /**
36
39
  * Component that renders content during loading state.
37
40
  * Only displays its children when the products list is currently loading.
@@ -41,13 +44,13 @@ export type LoadingRenderProps = {};
41
44
  * @param props.children - Content to display during loading (can be a render function or ReactNode)
42
45
  * @returns JSX element or null based on loading state
43
46
  */
44
- export declare function Loading(props: LoadingProps): ReactNode;
45
- export type ErrorProps = {
46
- children: ((props: ErrorRenderProps) => ReactNode) | ReactNode;
47
- };
48
- export type ErrorRenderProps = {
47
+ export declare function Loading(props: LoadingProps): React.ReactNode;
48
+ export interface ErrorRenderProps {
49
49
  error: string | null;
50
- };
50
+ }
51
+ export interface ErrorProps {
52
+ children: (props: ErrorRenderProps) => React.ReactNode;
53
+ }
51
54
  /**
52
55
  * Component that renders content when there's an error loading products.
53
56
  * Only displays its children when an error has occurred.
@@ -57,13 +60,13 @@ export type ErrorRenderProps = {
57
60
  * @param props.children - Content to display during error state (can be a render function or ReactNode)
58
61
  * @returns JSX element or null based on error state
59
62
  */
60
- export declare function Error(props: ErrorProps): ReactNode;
61
- export type ItemContentRenderProps = {
63
+ export declare function Error(props: ErrorProps): React.ReactNode;
64
+ export interface ItemContentRenderProps {
62
65
  product: productsV3.V3Product;
63
- };
64
- export type ItemContentProps = {
65
- children: ((props: ItemContentRenderProps) => ReactNode) | ReactNode;
66
- };
66
+ }
67
+ export interface ItemContentProps {
68
+ children: (props: ItemContentRenderProps) => React.ReactNode;
69
+ }
67
70
  /**
68
71
  * Component that renders content for each product in the list.
69
72
  * Maps over all products and provides each product through a service context.
@@ -74,4 +77,4 @@ export type ItemContentProps = {
74
77
  * @param props.children - Content to display for each product (can be a render function receiving product data or ReactNode)
75
78
  * @returns Array of JSX elements for each product or null if no products to display
76
79
  */
77
- export declare function ItemContent(props: ItemContentProps): import("react/jsx-runtime").JSX.Element[] | null;
80
+ export declare function ItemContent(props: ItemContentProps): React.ReactNode;
@@ -56,6 +56,7 @@ export function Loading(props) {
56
56
  }
57
57
  return null;
58
58
  }
59
+ ;
59
60
  /**
60
61
  * Component that renders content when there's an error loading products.
61
62
  * Only displays its children when an error has occurred.
@@ -1,11 +1,11 @@
1
1
  import { type Signal } from "@wix/services-definitions/core-services/signals";
2
2
  import { productsV3 } from "@wix/stores";
3
- export type ProductsListServiceConfig = {
3
+ export interface ProductsListServiceConfig {
4
4
  products: productsV3.V3Product[];
5
5
  searchOptions: Parameters<typeof productsV3.searchProducts>[0];
6
6
  pagingMetadata: productsV3.CommonCursorPagingMetadata;
7
7
  aggregations: productsV3.AggregationData;
8
- };
8
+ }
9
9
  export declare function loadProductsListServiceConfig(searchOptions: Parameters<typeof productsV3.searchProducts>[0]): Promise<ProductsListServiceConfig>;
10
10
  export declare const ProductsListServiceDefinition: string & {
11
11
  __api: {
@@ -1,6 +1,7 @@
1
1
  import { defineService, implementService } from "@wix/services-definitions";
2
2
  import { SignalsServiceDefinition, } from "@wix/services-definitions/core-services/signals";
3
3
  import { productsV3 } from "@wix/stores";
4
+ ;
4
5
  export async function loadProductsListServiceConfig(searchOptions) {
5
6
  const result = await productsV3.searchProducts(searchOptions);
6
7
  return {
@@ -1,6 +1,9 @@
1
1
  import { type ProductsListServiceConfig } from "../services/products-list-service.js";
2
- import type { PropsWithChildren, ReactNode } from "react";
3
2
  import { productsV3 } from "@wix/stores";
3
+ export interface RootProps {
4
+ children: React.ReactNode;
5
+ productsListConfig: ProductsListServiceConfig;
6
+ }
4
7
  /**
5
8
  * Root component that provides the ProductsList service context to its children.
6
9
  * This component sets up the necessary services for managing products list state.
@@ -11,13 +14,12 @@ import { productsV3 } from "@wix/stores";
11
14
  * @param props.productsListConfig - Configuration for the ProductsList service
12
15
  * @returns JSX element wrapping children with ProductsList service context
13
16
  */
14
- export declare function Root(props: PropsWithChildren<{
15
- productsListConfig: ProductsListServiceConfig;
16
- }>): import("react/jsx-runtime").JSX.Element;
17
- export type EmptyStateProps = {
18
- children: ((props: EmptyStateRenderProps) => ReactNode) | ReactNode;
19
- };
20
- export type EmptyStateRenderProps = {};
17
+ export declare function Root(props: RootProps): React.ReactNode;
18
+ export interface EmptyStateProps {
19
+ children: (props: EmptyStateRenderProps) => React.ReactNode;
20
+ }
21
+ export interface EmptyStateRenderProps {
22
+ }
21
23
  /**
22
24
  * Component that renders content when the products list is empty.
23
25
  * Only displays its children when there are no products, no loading state, and no errors.
@@ -27,11 +29,12 @@ export type EmptyStateRenderProps = {};
27
29
  * @param props.children - Content to display when products list is empty (can be a render function or ReactNode)
28
30
  * @returns JSX element or null based on products list state
29
31
  */
30
- export declare function EmptyState(props: EmptyStateProps): ReactNode;
31
- export type LoadingProps = {
32
- children: ((props: LoadingRenderProps) => ReactNode) | ReactNode;
33
- };
34
- export type LoadingRenderProps = {};
32
+ export declare function EmptyState(props: EmptyStateProps): React.ReactNode;
33
+ export interface LoadingProps {
34
+ children: (props: LoadingRenderProps) => React.ReactNode;
35
+ }
36
+ export interface LoadingRenderProps {
37
+ }
35
38
  /**
36
39
  * Component that renders content during loading state.
37
40
  * Only displays its children when the products list is currently loading.
@@ -41,13 +44,13 @@ export type LoadingRenderProps = {};
41
44
  * @param props.children - Content to display during loading (can be a render function or ReactNode)
42
45
  * @returns JSX element or null based on loading state
43
46
  */
44
- export declare function Loading(props: LoadingProps): ReactNode;
45
- export type ErrorProps = {
46
- children: ((props: ErrorRenderProps) => ReactNode) | ReactNode;
47
- };
48
- export type ErrorRenderProps = {
47
+ export declare function Loading(props: LoadingProps): React.ReactNode;
48
+ export interface ErrorRenderProps {
49
49
  error: string | null;
50
- };
50
+ }
51
+ export interface ErrorProps {
52
+ children: (props: ErrorRenderProps) => React.ReactNode;
53
+ }
51
54
  /**
52
55
  * Component that renders content when there's an error loading products.
53
56
  * Only displays its children when an error has occurred.
@@ -57,13 +60,13 @@ export type ErrorRenderProps = {
57
60
  * @param props.children - Content to display during error state (can be a render function or ReactNode)
58
61
  * @returns JSX element or null based on error state
59
62
  */
60
- export declare function Error(props: ErrorProps): ReactNode;
61
- export type ItemContentRenderProps = {
63
+ export declare function Error(props: ErrorProps): React.ReactNode;
64
+ export interface ItemContentRenderProps {
62
65
  product: productsV3.V3Product;
63
- };
64
- export type ItemContentProps = {
65
- children: ((props: ItemContentRenderProps) => ReactNode) | ReactNode;
66
- };
66
+ }
67
+ export interface ItemContentProps {
68
+ children: (props: ItemContentRenderProps) => React.ReactNode;
69
+ }
67
70
  /**
68
71
  * Component that renders content for each product in the list.
69
72
  * Maps over all products and provides each product through a service context.
@@ -74,4 +77,4 @@ export type ItemContentProps = {
74
77
  * @param props.children - Content to display for each product (can be a render function receiving product data or ReactNode)
75
78
  * @returns Array of JSX elements for each product or null if no products to display
76
79
  */
77
- export declare function ItemContent(props: ItemContentProps): import("react/jsx-runtime").JSX.Element[] | null;
80
+ export declare function ItemContent(props: ItemContentProps): React.ReactNode;
@@ -56,6 +56,7 @@ export function Loading(props) {
56
56
  }
57
57
  return null;
58
58
  }
59
+ ;
59
60
  /**
60
61
  * Component that renders content when there's an error loading products.
61
62
  * Only displays its children when an error has occurred.
@@ -1,11 +1,11 @@
1
1
  import { type Signal } from "@wix/services-definitions/core-services/signals";
2
2
  import { productsV3 } from "@wix/stores";
3
- export type ProductsListServiceConfig = {
3
+ export interface ProductsListServiceConfig {
4
4
  products: productsV3.V3Product[];
5
5
  searchOptions: Parameters<typeof productsV3.searchProducts>[0];
6
6
  pagingMetadata: productsV3.CommonCursorPagingMetadata;
7
7
  aggregations: productsV3.AggregationData;
8
- };
8
+ }
9
9
  export declare function loadProductsListServiceConfig(searchOptions: Parameters<typeof productsV3.searchProducts>[0]): Promise<ProductsListServiceConfig>;
10
10
  export declare const ProductsListServiceDefinition: string & {
11
11
  __api: {
@@ -1,6 +1,7 @@
1
1
  import { defineService, implementService } from "@wix/services-definitions";
2
2
  import { SignalsServiceDefinition, } from "@wix/services-definitions/core-services/signals";
3
3
  import { productsV3 } from "@wix/stores";
4
+ ;
4
5
  export async function loadProductsListServiceConfig(searchOptions) {
5
6
  const result = await productsV3.searchProducts(searchOptions);
6
7
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/headless-stores",
3
- "version": "0.0.28",
3
+ "version": "0.0.29",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "prebuild": "cd ../media && yarn build && cd ../ecom && yarn build",