@wix/headless-stores 0.0.26 → 0.0.28

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.
@@ -11,7 +11,7 @@ import { productsV3 } from "@wix/stores";
11
11
  * @param props.productsListConfig - Configuration for the ProductsList service
12
12
  * @returns JSX element wrapping children with ProductsList service context
13
13
  */
14
- declare function Root(props: PropsWithChildren<{
14
+ export declare function Root(props: PropsWithChildren<{
15
15
  productsListConfig: ProductsListServiceConfig;
16
16
  }>): import("react/jsx-runtime").JSX.Element;
17
17
  export type EmptyStateProps = {
@@ -27,7 +27,7 @@ export type EmptyStateRenderProps = {};
27
27
  * @param props.children - Content to display when products list is empty (can be a render function or ReactNode)
28
28
  * @returns JSX element or null based on products list state
29
29
  */
30
- declare function EmptyState(props: EmptyStateProps): ReactNode;
30
+ export declare function EmptyState(props: EmptyStateProps): ReactNode;
31
31
  export type LoadingProps = {
32
32
  children: ((props: LoadingRenderProps) => ReactNode) | ReactNode;
33
33
  };
@@ -41,7 +41,7 @@ export type LoadingRenderProps = {};
41
41
  * @param props.children - Content to display during loading (can be a render function or ReactNode)
42
42
  * @returns JSX element or null based on loading state
43
43
  */
44
- declare function Loading(props: LoadingProps): ReactNode;
44
+ export declare function Loading(props: LoadingProps): ReactNode;
45
45
  export type ErrorProps = {
46
46
  children: ((props: ErrorRenderProps) => ReactNode) | ReactNode;
47
47
  };
@@ -57,7 +57,7 @@ export type ErrorRenderProps = {
57
57
  * @param props.children - Content to display during error state (can be a render function or ReactNode)
58
58
  * @returns JSX element or null based on error state
59
59
  */
60
- declare function Error(props: ErrorProps): ReactNode;
60
+ export declare function Error(props: ErrorProps): ReactNode;
61
61
  export type ItemContentRenderProps = {
62
62
  product: productsV3.V3Product;
63
63
  };
@@ -74,37 +74,4 @@ export type ItemContentProps = {
74
74
  * @param props.children - Content to display for each product (can be a render function receiving product data or ReactNode)
75
75
  * @returns Array of JSX elements for each product or null if no products to display
76
76
  */
77
- declare function ItemContent(props: ItemContentProps): import("react/jsx-runtime").JSX.Element[] | null;
78
- /**
79
- * ProductsList component collection providing a complete solution for displaying products.
80
- *
81
- * Includes components for different states:
82
- * - Root: Service provider component
83
- * - EmptyState: Displays when no products are available
84
- * - Loading: Displays during loading state
85
- * - Error: Displays when an error occurs
86
- * - ItemContent: Renders individual product items
87
- *
88
- * @component
89
- * @example
90
- * ```jsx
91
- * <ProductsList.Root productsListConfig={config}>
92
- * <ProductsList.Loading>Loading products...</ProductsList.Loading>
93
- * <ProductsList.Error>
94
- * {({ error }) => <div>Error: {error}</div>}
95
- * </ProductsList.Error>
96
- * <ProductsList.EmptyState>No products found</ProductsList.EmptyState>
97
- * <ProductsList.ItemContent>
98
- * {({ product }) => <div>{product.name}</div>}
99
- * </ProductsList.ItemContent>
100
- * </ProductsList.Root>
101
- * ```
102
- */
103
- export declare const ProductsList: {
104
- Root: typeof Root;
105
- EmptyState: typeof EmptyState;
106
- Loading: typeof Loading;
107
- Error: typeof Error;
108
- ItemContent: typeof ItemContent;
109
- };
110
- export {};
77
+ export declare function ItemContent(props: ItemContentProps): import("react/jsx-runtime").JSX.Element[] | null;
@@ -13,7 +13,7 @@ import { ProductService, ProductServiceDefinition, } from "@wix/headless-stores/
13
13
  * @param props.productsListConfig - Configuration for the ProductsList service
14
14
  * @returns JSX element wrapping children with ProductsList service context
15
15
  */
16
- function Root(props) {
16
+ export function Root(props) {
17
17
  return (_jsx(WixServices, { servicesMap: createServicesMap().addService(ProductsListServiceDefinition, ProductListService, props.productsListConfig), children: props.children }));
18
18
  }
19
19
  /**
@@ -25,7 +25,7 @@ function Root(props) {
25
25
  * @param props.children - Content to display when products list is empty (can be a render function or ReactNode)
26
26
  * @returns JSX element or null based on products list state
27
27
  */
28
- function EmptyState(props) {
28
+ export function EmptyState(props) {
29
29
  const { isLoading, error, products } = useService(ProductsListServiceDefinition);
30
30
  const isLoadingValue = isLoading.get();
31
31
  const errorValue = error.get();
@@ -46,7 +46,7 @@ function EmptyState(props) {
46
46
  * @param props.children - Content to display during loading (can be a render function or ReactNode)
47
47
  * @returns JSX element or null based on loading state
48
48
  */
49
- function Loading(props) {
49
+ export function Loading(props) {
50
50
  const { isLoading } = useService(ProductsListServiceDefinition);
51
51
  const isLoadingValue = isLoading.get();
52
52
  if (isLoadingValue) {
@@ -65,7 +65,7 @@ function Loading(props) {
65
65
  * @param props.children - Content to display during error state (can be a render function or ReactNode)
66
66
  * @returns JSX element or null based on error state
67
67
  */
68
- function Error(props) {
68
+ export function Error(props) {
69
69
  const { error } = useService(ProductsListServiceDefinition);
70
70
  const errorValue = error.get();
71
71
  if (errorValue) {
@@ -85,7 +85,7 @@ function Error(props) {
85
85
  * @param props.children - Content to display for each product (can be a render function receiving product data or ReactNode)
86
86
  * @returns Array of JSX elements for each product or null if no products to display
87
87
  */
88
- function ItemContent(props) {
88
+ export function ItemContent(props) {
89
89
  const { products, isLoading, error } = useService(ProductsListServiceDefinition);
90
90
  const productsValue = products.get();
91
91
  if (isLoading.get() || error.get() || productsValue.length === 0) {
@@ -95,35 +95,3 @@ function ItemContent(props) {
95
95
  ? props.children({ product })
96
96
  : props.children }, product._id)));
97
97
  }
98
- /**
99
- * ProductsList component collection providing a complete solution for displaying products.
100
- *
101
- * Includes components for different states:
102
- * - Root: Service provider component
103
- * - EmptyState: Displays when no products are available
104
- * - Loading: Displays during loading state
105
- * - Error: Displays when an error occurs
106
- * - ItemContent: Renders individual product items
107
- *
108
- * @component
109
- * @example
110
- * ```jsx
111
- * <ProductsList.Root productsListConfig={config}>
112
- * <ProductsList.Loading>Loading products...</ProductsList.Loading>
113
- * <ProductsList.Error>
114
- * {({ error }) => <div>Error: {error}</div>}
115
- * </ProductsList.Error>
116
- * <ProductsList.EmptyState>No products found</ProductsList.EmptyState>
117
- * <ProductsList.ItemContent>
118
- * {({ product }) => <div>{product.name}</div>}
119
- * </ProductsList.ItemContent>
120
- * </ProductsList.Root>
121
- * ```
122
- */
123
- export const ProductsList = {
124
- Root,
125
- EmptyState,
126
- Loading,
127
- Error,
128
- ItemContent,
129
- };
@@ -11,3 +11,4 @@ export * as Product from "./Product.js";
11
11
  export * as ProductModifiers from "./ProductModifiers.js";
12
12
  export * as SelectedVariant from "./SelectedVariant.js";
13
13
  export * as ProductActions from "./ProductActions.js";
14
+ export * as ProductsList from "./ProductsList.js";
@@ -11,3 +11,4 @@ export * as Product from "./Product.js";
11
11
  export * as ProductModifiers from "./ProductModifiers.js";
12
12
  export * as SelectedVariant from "./SelectedVariant.js";
13
13
  export * as ProductActions from "./ProductActions.js";
14
+ export * as ProductsList from "./ProductsList.js";
@@ -1,6 +1,4 @@
1
- export { buyNowServiceBinding, loadBuyNowServiceInitialData, } from "./buy-now-service.js";
2
- export { payNowServiceBinding, loadPayNowServiceInitialData, } from "./pay-now-service.js";
3
- export { CatalogService, CatalogServiceDefinition, loadCatalogServiceConfig, } from "./catalog-service.js";
1
+ export { CatalogService, CatalogServiceDefinition, } from "./catalog-service.js";
4
2
  export { CategoryService, CategoryServiceDefinition, loadCategoriesConfig, } from "./category-service.js";
5
3
  export { CollectionService, CollectionServiceDefinition, loadCollectionServiceConfig, } from "./collection-service.js";
6
4
  export { FilterService, FilterServiceDefinition, Filter, AvailableOptions, } from "./filter-service.js";
@@ -9,4 +7,5 @@ export { ProductService, ProductServiceDefinition, loadProductServiceConfig, } f
9
7
  export { RelatedProductsService, RelatedProductsServiceDefinition, loadRelatedProductsServiceConfig, } from "./related-products-service.js";
10
8
  export { SelectedVariantService, SelectedVariantServiceDefinition, } from "./selected-variant-service.js";
11
9
  export { SocialSharingService, SocialSharingServiceDefinition, } from "./social-sharing-service.js";
10
+ export { ProductListService, ProductsListServiceDefinition, loadProductsListServiceConfig } from "./products-list-service.js";
12
11
  export { SortService, SortServiceDefinition, SortBy } from "./sort-service.js";
@@ -1,6 +1,14 @@
1
- export { buyNowServiceBinding, loadBuyNowServiceInitialData, } from "./buy-now-service.js";
2
- export { payNowServiceBinding, loadPayNowServiceInitialData, } from "./pay-now-service.js";
3
- export { CatalogService, CatalogServiceDefinition, loadCatalogServiceConfig, } from "./catalog-service.js";
1
+ // export {
2
+ // buyNowServiceBinding,
3
+ // loadBuyNowServiceInitialData,
4
+ // } from "./buy-now-service.js";
5
+ // export {
6
+ // payNowServiceBinding,
7
+ // loadPayNowServiceInitialData,
8
+ // } from "./pay-now-service.js";
9
+ export { CatalogService, CatalogServiceDefinition,
10
+ // loadCatalogServiceConfig,
11
+ } from "./catalog-service.js";
4
12
  export { CategoryService, CategoryServiceDefinition, loadCategoriesConfig, } from "./category-service.js";
5
13
  export { CollectionService, CollectionServiceDefinition, loadCollectionServiceConfig, } from "./collection-service.js";
6
14
  export { FilterService, FilterServiceDefinition, } from "./filter-service.js";
@@ -9,4 +17,5 @@ export { ProductService, ProductServiceDefinition, loadProductServiceConfig, } f
9
17
  export { RelatedProductsService, RelatedProductsServiceDefinition, loadRelatedProductsServiceConfig, } from "./related-products-service.js";
10
18
  export { SelectedVariantService, SelectedVariantServiceDefinition, } from "./selected-variant-service.js";
11
19
  export { SocialSharingService, SocialSharingServiceDefinition, } from "./social-sharing-service.js";
20
+ export { ProductListService, ProductsListServiceDefinition, loadProductsListServiceConfig } from "./products-list-service.js";
12
21
  export { SortService, SortServiceDefinition } from "./sort-service.js";
@@ -11,7 +11,7 @@ import { productsV3 } from "@wix/stores";
11
11
  * @param props.productsListConfig - Configuration for the ProductsList service
12
12
  * @returns JSX element wrapping children with ProductsList service context
13
13
  */
14
- declare function Root(props: PropsWithChildren<{
14
+ export declare function Root(props: PropsWithChildren<{
15
15
  productsListConfig: ProductsListServiceConfig;
16
16
  }>): import("react/jsx-runtime").JSX.Element;
17
17
  export type EmptyStateProps = {
@@ -27,7 +27,7 @@ export type EmptyStateRenderProps = {};
27
27
  * @param props.children - Content to display when products list is empty (can be a render function or ReactNode)
28
28
  * @returns JSX element or null based on products list state
29
29
  */
30
- declare function EmptyState(props: EmptyStateProps): ReactNode;
30
+ export declare function EmptyState(props: EmptyStateProps): ReactNode;
31
31
  export type LoadingProps = {
32
32
  children: ((props: LoadingRenderProps) => ReactNode) | ReactNode;
33
33
  };
@@ -41,7 +41,7 @@ export type LoadingRenderProps = {};
41
41
  * @param props.children - Content to display during loading (can be a render function or ReactNode)
42
42
  * @returns JSX element or null based on loading state
43
43
  */
44
- declare function Loading(props: LoadingProps): ReactNode;
44
+ export declare function Loading(props: LoadingProps): ReactNode;
45
45
  export type ErrorProps = {
46
46
  children: ((props: ErrorRenderProps) => ReactNode) | ReactNode;
47
47
  };
@@ -57,7 +57,7 @@ export type ErrorRenderProps = {
57
57
  * @param props.children - Content to display during error state (can be a render function or ReactNode)
58
58
  * @returns JSX element or null based on error state
59
59
  */
60
- declare function Error(props: ErrorProps): ReactNode;
60
+ export declare function Error(props: ErrorProps): ReactNode;
61
61
  export type ItemContentRenderProps = {
62
62
  product: productsV3.V3Product;
63
63
  };
@@ -74,37 +74,4 @@ export type ItemContentProps = {
74
74
  * @param props.children - Content to display for each product (can be a render function receiving product data or ReactNode)
75
75
  * @returns Array of JSX elements for each product or null if no products to display
76
76
  */
77
- declare function ItemContent(props: ItemContentProps): import("react/jsx-runtime").JSX.Element[] | null;
78
- /**
79
- * ProductsList component collection providing a complete solution for displaying products.
80
- *
81
- * Includes components for different states:
82
- * - Root: Service provider component
83
- * - EmptyState: Displays when no products are available
84
- * - Loading: Displays during loading state
85
- * - Error: Displays when an error occurs
86
- * - ItemContent: Renders individual product items
87
- *
88
- * @component
89
- * @example
90
- * ```jsx
91
- * <ProductsList.Root productsListConfig={config}>
92
- * <ProductsList.Loading>Loading products...</ProductsList.Loading>
93
- * <ProductsList.Error>
94
- * {({ error }) => <div>Error: {error}</div>}
95
- * </ProductsList.Error>
96
- * <ProductsList.EmptyState>No products found</ProductsList.EmptyState>
97
- * <ProductsList.ItemContent>
98
- * {({ product }) => <div>{product.name}</div>}
99
- * </ProductsList.ItemContent>
100
- * </ProductsList.Root>
101
- * ```
102
- */
103
- export declare const ProductsList: {
104
- Root: typeof Root;
105
- EmptyState: typeof EmptyState;
106
- Loading: typeof Loading;
107
- Error: typeof Error;
108
- ItemContent: typeof ItemContent;
109
- };
110
- export {};
77
+ export declare function ItemContent(props: ItemContentProps): import("react/jsx-runtime").JSX.Element[] | null;
@@ -13,7 +13,7 @@ import { ProductService, ProductServiceDefinition, } from "@wix/headless-stores/
13
13
  * @param props.productsListConfig - Configuration for the ProductsList service
14
14
  * @returns JSX element wrapping children with ProductsList service context
15
15
  */
16
- function Root(props) {
16
+ export function Root(props) {
17
17
  return (_jsx(WixServices, { servicesMap: createServicesMap().addService(ProductsListServiceDefinition, ProductListService, props.productsListConfig), children: props.children }));
18
18
  }
19
19
  /**
@@ -25,7 +25,7 @@ function Root(props) {
25
25
  * @param props.children - Content to display when products list is empty (can be a render function or ReactNode)
26
26
  * @returns JSX element or null based on products list state
27
27
  */
28
- function EmptyState(props) {
28
+ export function EmptyState(props) {
29
29
  const { isLoading, error, products } = useService(ProductsListServiceDefinition);
30
30
  const isLoadingValue = isLoading.get();
31
31
  const errorValue = error.get();
@@ -46,7 +46,7 @@ function EmptyState(props) {
46
46
  * @param props.children - Content to display during loading (can be a render function or ReactNode)
47
47
  * @returns JSX element or null based on loading state
48
48
  */
49
- function Loading(props) {
49
+ export function Loading(props) {
50
50
  const { isLoading } = useService(ProductsListServiceDefinition);
51
51
  const isLoadingValue = isLoading.get();
52
52
  if (isLoadingValue) {
@@ -65,7 +65,7 @@ function Loading(props) {
65
65
  * @param props.children - Content to display during error state (can be a render function or ReactNode)
66
66
  * @returns JSX element or null based on error state
67
67
  */
68
- function Error(props) {
68
+ export function Error(props) {
69
69
  const { error } = useService(ProductsListServiceDefinition);
70
70
  const errorValue = error.get();
71
71
  if (errorValue) {
@@ -85,7 +85,7 @@ function Error(props) {
85
85
  * @param props.children - Content to display for each product (can be a render function receiving product data or ReactNode)
86
86
  * @returns Array of JSX elements for each product or null if no products to display
87
87
  */
88
- function ItemContent(props) {
88
+ export function ItemContent(props) {
89
89
  const { products, isLoading, error } = useService(ProductsListServiceDefinition);
90
90
  const productsValue = products.get();
91
91
  if (isLoading.get() || error.get() || productsValue.length === 0) {
@@ -95,35 +95,3 @@ function ItemContent(props) {
95
95
  ? props.children({ product })
96
96
  : props.children }, product._id)));
97
97
  }
98
- /**
99
- * ProductsList component collection providing a complete solution for displaying products.
100
- *
101
- * Includes components for different states:
102
- * - Root: Service provider component
103
- * - EmptyState: Displays when no products are available
104
- * - Loading: Displays during loading state
105
- * - Error: Displays when an error occurs
106
- * - ItemContent: Renders individual product items
107
- *
108
- * @component
109
- * @example
110
- * ```jsx
111
- * <ProductsList.Root productsListConfig={config}>
112
- * <ProductsList.Loading>Loading products...</ProductsList.Loading>
113
- * <ProductsList.Error>
114
- * {({ error }) => <div>Error: {error}</div>}
115
- * </ProductsList.Error>
116
- * <ProductsList.EmptyState>No products found</ProductsList.EmptyState>
117
- * <ProductsList.ItemContent>
118
- * {({ product }) => <div>{product.name}</div>}
119
- * </ProductsList.ItemContent>
120
- * </ProductsList.Root>
121
- * ```
122
- */
123
- export const ProductsList = {
124
- Root,
125
- EmptyState,
126
- Loading,
127
- Error,
128
- ItemContent,
129
- };
@@ -11,3 +11,4 @@ export * as Product from "./Product.js";
11
11
  export * as ProductModifiers from "./ProductModifiers.js";
12
12
  export * as SelectedVariant from "./SelectedVariant.js";
13
13
  export * as ProductActions from "./ProductActions.js";
14
+ export * as ProductsList from "./ProductsList.js";
@@ -11,3 +11,4 @@ export * as Product from "./Product.js";
11
11
  export * as ProductModifiers from "./ProductModifiers.js";
12
12
  export * as SelectedVariant from "./SelectedVariant.js";
13
13
  export * as ProductActions from "./ProductActions.js";
14
+ export * as ProductsList from "./ProductsList.js";
@@ -1,6 +1,4 @@
1
- export { buyNowServiceBinding, loadBuyNowServiceInitialData, } from "./buy-now-service.js";
2
- export { payNowServiceBinding, loadPayNowServiceInitialData, } from "./pay-now-service.js";
3
- export { CatalogService, CatalogServiceDefinition, loadCatalogServiceConfig, } from "./catalog-service.js";
1
+ export { CatalogService, CatalogServiceDefinition, } from "./catalog-service.js";
4
2
  export { CategoryService, CategoryServiceDefinition, loadCategoriesConfig, } from "./category-service.js";
5
3
  export { CollectionService, CollectionServiceDefinition, loadCollectionServiceConfig, } from "./collection-service.js";
6
4
  export { FilterService, FilterServiceDefinition, Filter, AvailableOptions, } from "./filter-service.js";
@@ -9,4 +7,5 @@ export { ProductService, ProductServiceDefinition, loadProductServiceConfig, } f
9
7
  export { RelatedProductsService, RelatedProductsServiceDefinition, loadRelatedProductsServiceConfig, } from "./related-products-service.js";
10
8
  export { SelectedVariantService, SelectedVariantServiceDefinition, } from "./selected-variant-service.js";
11
9
  export { SocialSharingService, SocialSharingServiceDefinition, } from "./social-sharing-service.js";
10
+ export { ProductListService, ProductsListServiceDefinition, loadProductsListServiceConfig } from "./products-list-service.js";
12
11
  export { SortService, SortServiceDefinition, SortBy } from "./sort-service.js";
@@ -1,6 +1,14 @@
1
- export { buyNowServiceBinding, loadBuyNowServiceInitialData, } from "./buy-now-service.js";
2
- export { payNowServiceBinding, loadPayNowServiceInitialData, } from "./pay-now-service.js";
3
- export { CatalogService, CatalogServiceDefinition, loadCatalogServiceConfig, } from "./catalog-service.js";
1
+ // export {
2
+ // buyNowServiceBinding,
3
+ // loadBuyNowServiceInitialData,
4
+ // } from "./buy-now-service.js";
5
+ // export {
6
+ // payNowServiceBinding,
7
+ // loadPayNowServiceInitialData,
8
+ // } from "./pay-now-service.js";
9
+ export { CatalogService, CatalogServiceDefinition,
10
+ // loadCatalogServiceConfig,
11
+ } from "./catalog-service.js";
4
12
  export { CategoryService, CategoryServiceDefinition, loadCategoriesConfig, } from "./category-service.js";
5
13
  export { CollectionService, CollectionServiceDefinition, loadCollectionServiceConfig, } from "./collection-service.js";
6
14
  export { FilterService, FilterServiceDefinition, } from "./filter-service.js";
@@ -9,4 +17,5 @@ export { ProductService, ProductServiceDefinition, loadProductServiceConfig, } f
9
17
  export { RelatedProductsService, RelatedProductsServiceDefinition, loadRelatedProductsServiceConfig, } from "./related-products-service.js";
10
18
  export { SelectedVariantService, SelectedVariantServiceDefinition, } from "./selected-variant-service.js";
11
19
  export { SocialSharingService, SocialSharingServiceDefinition, } from "./social-sharing-service.js";
20
+ export { ProductListService, ProductsListServiceDefinition, loadProductsListServiceConfig } from "./products-list-service.js";
12
21
  export { SortService, SortServiceDefinition } from "./sort-service.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/headless-stores",
3
- "version": "0.0.26",
3
+ "version": "0.0.28",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "prebuild": "cd ../media && yarn build && cd ../ecom && yarn build",