@wix/headless-stores 0.0.91 → 0.0.92

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,8 @@
1
1
  export declare enum DataComponentTags {
2
+ categoryListRoot = "stores.category-list-root",
2
3
  categoryRoot = "stores.category-root",
3
- productListRoot = "stores.product-list-root",
4
+ choiceRoot = "stores.choice-root",
4
5
  optionRoot = "stores.option-root",
5
- choiceRoot = "stores.choice-root"
6
+ productListRoot = "stores.product-list-root",
7
+ productRoot = "stores.product-root"
6
8
  }
@@ -1,7 +1,9 @@
1
1
  export var DataComponentTags;
2
2
  (function (DataComponentTags) {
3
+ DataComponentTags["categoryListRoot"] = "stores.category-list-root";
3
4
  DataComponentTags["categoryRoot"] = "stores.category-root";
4
- DataComponentTags["productListRoot"] = "stores.product-list-root";
5
- DataComponentTags["optionRoot"] = "stores.option-root";
6
5
  DataComponentTags["choiceRoot"] = "stores.choice-root";
6
+ DataComponentTags["optionRoot"] = "stores.option-root";
7
+ DataComponentTags["productListRoot"] = "stores.product-list-root";
8
+ DataComponentTags["productRoot"] = "stores.product-root";
7
9
  })(DataComponentTags || (DataComponentTags = {}));
@@ -53,6 +53,7 @@ export const Root = React.forwardRef((props, ref) => {
53
53
  return (_jsx(CategoryContext.Provider, { value: contextValue, children: _jsx(AsChildSlot, { ref: ref, "data-component-tag": DataComponentTags.categoryRoot, "data-testid": TestIds.categoryRoot, children: children }) }));
54
54
  } }));
55
55
  });
56
+ Root.displayName = 'Category.Root';
56
57
  /**
57
58
  * Interactive element for selecting or triggering category actions.
58
59
  * Provides category data and selection state to custom render functions.
@@ -61,7 +61,10 @@ export interface CategoryListCategoryRepeaterProps {
61
61
  * }
62
62
  * ```
63
63
  */
64
- export declare function Root(props: CategoryListRootProps): React.ReactNode;
64
+ export declare const Root: {
65
+ (props: CategoryListRootProps): React.ReactNode;
66
+ displayName: string;
67
+ };
65
68
  /**
66
69
  * Displays loading state while category data is being fetched.
67
70
  * Only displays its children when the categories list is currently loading.
@@ -3,6 +3,7 @@ import React from 'react';
3
3
  import * as CoreCategoryList from './core/CategoryList.js';
4
4
  import * as Category from './Category.js';
5
5
  import { AsChildSlot } from '@wix/headless-utils/react';
6
+ import { DataComponentTags } from '../data-component-tags.js';
6
7
  var TestIds;
7
8
  (function (TestIds) {
8
9
  TestIds["categoryListRoot"] = "category-list";
@@ -31,12 +32,13 @@ var TestIds;
31
32
  * }
32
33
  * ```
33
34
  */
34
- export function Root(props) {
35
+ export const Root = (props) => {
35
36
  const { categories, categoriesListConfig, children, emptyState } = props;
36
37
  // Create service config, prioritizing categoriesListConfig, then categories prop
37
38
  const serviceConfig = categoriesListConfig || (categories ? { categories } : { categories: [] });
38
- return (_jsxs(CoreCategoryList.Root, { categoriesListConfig: serviceConfig, "data-testid": TestIds.categoryListRoot, children: [children, emptyState && (_jsx(CoreCategoryList.EmptyState, { children: emptyState }))] }));
39
- }
39
+ return (_jsx(CoreCategoryList.Root, { categoriesListConfig: serviceConfig, children: _jsxs(AsChildSlot, { "data-testid": TestIds.categoryListRoot, "data-component-tag": DataComponentTags.categoryListRoot, children: [children, emptyState && (_jsx(CoreCategoryList.EmptyState, { children: emptyState }))] }) }));
40
+ };
41
+ Root.displayName = 'CategoryList.Root';
40
42
  /**
41
43
  * Displays loading state while category data is being fetched.
42
44
  * Only displays its children when the categories list is currently loading.
@@ -50,6 +50,7 @@ export const Root = React.forwardRef((props, ref) => {
50
50
  };
51
51
  return (_jsx("div", { ...attributes, ref: ref, children: children }));
52
52
  });
53
+ Root.displayName = 'Choice.Root';
53
54
  /**
54
55
  * Text-based choice button.
55
56
  *
@@ -116,6 +116,7 @@ export const Root = React.forwardRef((props, ref) => {
116
116
  };
117
117
  return (_jsx(OptionContext.Provider, { value: contextValue, children: _jsx(AsChildSlot, { ref: ref, asChild: asChild, className: className, "data-component-tag": DataComponentTags.optionRoot, "data-testid": TestIds.optionRoot, "data-type": optionType, customElement: children, customElementProps: { option, onValueChange, allowedTypes }, ...otherProps, children: _jsx("div", { children: React.isValidElement(children) ? children : null }) }) }));
118
118
  });
119
+ Root.displayName = 'Option.Root';
119
120
  // Create a context to pass option data down
120
121
  export const OptionContext = React.createContext(null);
121
122
  /**
@@ -60,7 +60,10 @@ export interface ProductRootProps {
60
60
  * }
61
61
  * ```
62
62
  */
63
- export declare function Root(props: ProductRootProps): React.ReactNode;
63
+ export declare const Root: {
64
+ (props: ProductRootProps): React.ReactNode;
65
+ displayName: string;
66
+ };
64
67
  /**
65
68
  * Props for Product Name component
66
69
  */
@@ -11,6 +11,7 @@ import * as ProductModifiers from './core/ProductModifiers.js';
11
11
  import * as SelectedVariant from './core/SelectedVariant.js';
12
12
  import * as Option from './Option.js';
13
13
  import { AsContent } from './types.js';
14
+ import { DataComponentTags } from '../data-component-tags.js';
14
15
  const VariantsContext = React.createContext(null);
15
16
  /**
16
17
  * Hook to access variants context
@@ -86,12 +87,13 @@ var TestIds;
86
87
  * }
87
88
  * ```
88
89
  */
89
- export function Root(props) {
90
+ export const Root = (props) => {
90
91
  const { children, product, ...attrs } = props;
91
- return (_jsx(CoreProduct.Root, { productServiceConfig: { product: props.product }, children: _jsx(MediaGallery.Root, { mediaGalleryServiceConfig: {
92
- media: props.product.media?.itemsInfo?.items ?? [],
93
- }, children: _jsx(ProductVariantSelector.Root, { children: _jsx(ProductModifiers.Root, { children: _jsx(SelectedVariant.Root, { children: _jsx(AsChildSlot, { ...attrs, children: children }) }) }) }) }) }));
94
- }
92
+ return (_jsx(AsChildSlot, { "data-testid": TestIds.productRoot, "data-component-tag": DataComponentTags.productRoot, children: _jsx(CoreProduct.Root, { productServiceConfig: { product: props.product }, children: _jsx(MediaGallery.Root, { mediaGalleryServiceConfig: {
93
+ media: props.product.media?.itemsInfo?.items ?? [],
94
+ }, children: _jsx(ProductVariantSelector.Root, { children: _jsx(ProductModifiers.Root, { children: _jsx(SelectedVariant.Root, { children: _jsx(AsChildSlot, { ...attrs, children: children }) }) }) }) }) }) }));
95
+ };
96
+ Root.displayName = 'Product.Root';
95
97
  /**
96
98
  * Displays the product name with customizable rendering following the documented API.
97
99
  *
@@ -61,6 +61,7 @@ export const Root = React.forwardRef((props, ref) => {
61
61
  };
62
62
  return (_jsx(CoreProductList.Root, { productsListConfig: serviceConfig, children: _jsx(RootContent, { children: children, className: className, ref: ref }) }));
63
63
  });
64
+ Root.displayName = 'ProductList.Root';
64
65
  /**
65
66
  * Internal component to handle the Root content with service access
66
67
  */
@@ -36,6 +36,9 @@ export interface RootProps {
36
36
  * ```
37
37
  */
38
38
  export declare function Root(props: RootProps): React.ReactNode;
39
+ export declare namespace Root {
40
+ var displayName: string;
41
+ }
39
42
  /**
40
43
  * Props for EmptyState headless component
41
44
  */
@@ -36,6 +36,7 @@ export function Root(props) {
36
36
  const { categoriesListConfig, children } = props;
37
37
  return (_jsx(WixServices, { servicesMap: createServicesMap().addService(CategoriesListServiceDefinition, CategoriesListService, categoriesListConfig), children: children }));
38
38
  }
39
+ Root.displayName = 'CategoryList.Root';
39
40
  /**
40
41
  * Component that renders content when the categories list is empty.
41
42
  * Only displays its children when there are no categories, no loading state, and no errors.
@@ -1,6 +1,8 @@
1
1
  export declare enum DataComponentTags {
2
+ categoryListRoot = "stores.category-list-root",
2
3
  categoryRoot = "stores.category-root",
3
- productListRoot = "stores.product-list-root",
4
+ choiceRoot = "stores.choice-root",
4
5
  optionRoot = "stores.option-root",
5
- choiceRoot = "stores.choice-root"
6
+ productListRoot = "stores.product-list-root",
7
+ productRoot = "stores.product-root"
6
8
  }
@@ -1,7 +1,9 @@
1
1
  export var DataComponentTags;
2
2
  (function (DataComponentTags) {
3
+ DataComponentTags["categoryListRoot"] = "stores.category-list-root";
3
4
  DataComponentTags["categoryRoot"] = "stores.category-root";
4
- DataComponentTags["productListRoot"] = "stores.product-list-root";
5
- DataComponentTags["optionRoot"] = "stores.option-root";
6
5
  DataComponentTags["choiceRoot"] = "stores.choice-root";
6
+ DataComponentTags["optionRoot"] = "stores.option-root";
7
+ DataComponentTags["productListRoot"] = "stores.product-list-root";
8
+ DataComponentTags["productRoot"] = "stores.product-root";
7
9
  })(DataComponentTags || (DataComponentTags = {}));
@@ -53,6 +53,7 @@ export const Root = React.forwardRef((props, ref) => {
53
53
  return (_jsx(CategoryContext.Provider, { value: contextValue, children: _jsx(AsChildSlot, { ref: ref, "data-component-tag": DataComponentTags.categoryRoot, "data-testid": TestIds.categoryRoot, children: children }) }));
54
54
  } }));
55
55
  });
56
+ Root.displayName = 'Category.Root';
56
57
  /**
57
58
  * Interactive element for selecting or triggering category actions.
58
59
  * Provides category data and selection state to custom render functions.
@@ -61,7 +61,10 @@ export interface CategoryListCategoryRepeaterProps {
61
61
  * }
62
62
  * ```
63
63
  */
64
- export declare function Root(props: CategoryListRootProps): React.ReactNode;
64
+ export declare const Root: {
65
+ (props: CategoryListRootProps): React.ReactNode;
66
+ displayName: string;
67
+ };
65
68
  /**
66
69
  * Displays loading state while category data is being fetched.
67
70
  * Only displays its children when the categories list is currently loading.
@@ -3,6 +3,7 @@ import React from 'react';
3
3
  import * as CoreCategoryList from './core/CategoryList.js';
4
4
  import * as Category from './Category.js';
5
5
  import { AsChildSlot } from '@wix/headless-utils/react';
6
+ import { DataComponentTags } from '../data-component-tags.js';
6
7
  var TestIds;
7
8
  (function (TestIds) {
8
9
  TestIds["categoryListRoot"] = "category-list";
@@ -31,12 +32,13 @@ var TestIds;
31
32
  * }
32
33
  * ```
33
34
  */
34
- export function Root(props) {
35
+ export const Root = (props) => {
35
36
  const { categories, categoriesListConfig, children, emptyState } = props;
36
37
  // Create service config, prioritizing categoriesListConfig, then categories prop
37
38
  const serviceConfig = categoriesListConfig || (categories ? { categories } : { categories: [] });
38
- return (_jsxs(CoreCategoryList.Root, { categoriesListConfig: serviceConfig, "data-testid": TestIds.categoryListRoot, children: [children, emptyState && (_jsx(CoreCategoryList.EmptyState, { children: emptyState }))] }));
39
- }
39
+ return (_jsx(CoreCategoryList.Root, { categoriesListConfig: serviceConfig, children: _jsxs(AsChildSlot, { "data-testid": TestIds.categoryListRoot, "data-component-tag": DataComponentTags.categoryListRoot, children: [children, emptyState && (_jsx(CoreCategoryList.EmptyState, { children: emptyState }))] }) }));
40
+ };
41
+ Root.displayName = 'CategoryList.Root';
40
42
  /**
41
43
  * Displays loading state while category data is being fetched.
42
44
  * Only displays its children when the categories list is currently loading.
@@ -50,6 +50,7 @@ export const Root = React.forwardRef((props, ref) => {
50
50
  };
51
51
  return (_jsx("div", { ...attributes, ref: ref, children: children }));
52
52
  });
53
+ Root.displayName = 'Choice.Root';
53
54
  /**
54
55
  * Text-based choice button.
55
56
  *
@@ -116,6 +116,7 @@ export const Root = React.forwardRef((props, ref) => {
116
116
  };
117
117
  return (_jsx(OptionContext.Provider, { value: contextValue, children: _jsx(AsChildSlot, { ref: ref, asChild: asChild, className: className, "data-component-tag": DataComponentTags.optionRoot, "data-testid": TestIds.optionRoot, "data-type": optionType, customElement: children, customElementProps: { option, onValueChange, allowedTypes }, ...otherProps, children: _jsx("div", { children: React.isValidElement(children) ? children : null }) }) }));
118
118
  });
119
+ Root.displayName = 'Option.Root';
119
120
  // Create a context to pass option data down
120
121
  export const OptionContext = React.createContext(null);
121
122
  /**
@@ -60,7 +60,10 @@ export interface ProductRootProps {
60
60
  * }
61
61
  * ```
62
62
  */
63
- export declare function Root(props: ProductRootProps): React.ReactNode;
63
+ export declare const Root: {
64
+ (props: ProductRootProps): React.ReactNode;
65
+ displayName: string;
66
+ };
64
67
  /**
65
68
  * Props for Product Name component
66
69
  */
@@ -11,6 +11,7 @@ import * as ProductModifiers from './core/ProductModifiers.js';
11
11
  import * as SelectedVariant from './core/SelectedVariant.js';
12
12
  import * as Option from './Option.js';
13
13
  import { AsContent } from './types.js';
14
+ import { DataComponentTags } from '../data-component-tags.js';
14
15
  const VariantsContext = React.createContext(null);
15
16
  /**
16
17
  * Hook to access variants context
@@ -86,12 +87,13 @@ var TestIds;
86
87
  * }
87
88
  * ```
88
89
  */
89
- export function Root(props) {
90
+ export const Root = (props) => {
90
91
  const { children, product, ...attrs } = props;
91
- return (_jsx(CoreProduct.Root, { productServiceConfig: { product: props.product }, children: _jsx(MediaGallery.Root, { mediaGalleryServiceConfig: {
92
- media: props.product.media?.itemsInfo?.items ?? [],
93
- }, children: _jsx(ProductVariantSelector.Root, { children: _jsx(ProductModifiers.Root, { children: _jsx(SelectedVariant.Root, { children: _jsx(AsChildSlot, { ...attrs, children: children }) }) }) }) }) }));
94
- }
92
+ return (_jsx(AsChildSlot, { "data-testid": TestIds.productRoot, "data-component-tag": DataComponentTags.productRoot, children: _jsx(CoreProduct.Root, { productServiceConfig: { product: props.product }, children: _jsx(MediaGallery.Root, { mediaGalleryServiceConfig: {
93
+ media: props.product.media?.itemsInfo?.items ?? [],
94
+ }, children: _jsx(ProductVariantSelector.Root, { children: _jsx(ProductModifiers.Root, { children: _jsx(SelectedVariant.Root, { children: _jsx(AsChildSlot, { ...attrs, children: children }) }) }) }) }) }) }));
95
+ };
96
+ Root.displayName = 'Product.Root';
95
97
  /**
96
98
  * Displays the product name with customizable rendering following the documented API.
97
99
  *
@@ -61,6 +61,7 @@ export const Root = React.forwardRef((props, ref) => {
61
61
  };
62
62
  return (_jsx(CoreProductList.Root, { productsListConfig: serviceConfig, children: _jsx(RootContent, { children: children, className: className, ref: ref }) }));
63
63
  });
64
+ Root.displayName = 'ProductList.Root';
64
65
  /**
65
66
  * Internal component to handle the Root content with service access
66
67
  */
@@ -36,6 +36,9 @@ export interface RootProps {
36
36
  * ```
37
37
  */
38
38
  export declare function Root(props: RootProps): React.ReactNode;
39
+ export declare namespace Root {
40
+ var displayName: string;
41
+ }
39
42
  /**
40
43
  * Props for EmptyState headless component
41
44
  */
@@ -36,6 +36,7 @@ export function Root(props) {
36
36
  const { categoriesListConfig, children } = props;
37
37
  return (_jsx(WixServices, { servicesMap: createServicesMap().addService(CategoriesListServiceDefinition, CategoriesListService, categoriesListConfig), children: children }));
38
38
  }
39
+ Root.displayName = 'CategoryList.Root';
39
40
  /**
40
41
  * Component that renders content when the categories list is empty.
41
42
  * Only displays its children when there are no categories, no loading state, and no errors.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/headless-stores",
3
- "version": "0.0.91",
3
+ "version": "0.0.92",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "prebuild": "cd ../media && yarn build && cd ../ecom && yarn build",
@@ -63,7 +63,7 @@
63
63
  "@wix/ecom": "^1.0.1278",
64
64
  "@wix/essentials": "^0.1.24",
65
65
  "@wix/headless-ecom": "0.0.30",
66
- "@wix/headless-media": "0.0.13",
66
+ "@wix/headless-media": "0.0.14",
67
67
  "@wix/headless-utils": "0.0.3",
68
68
  "@wix/redirects": "^1.0.83",
69
69
  "@wix/services-definitions": "^0.1.4",