@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.
- package/cjs/dist/data-component-tags.d.ts +4 -2
- package/cjs/dist/data-component-tags.js +4 -2
- package/cjs/dist/react/Category.js +1 -0
- package/cjs/dist/react/CategoryList.d.ts +4 -1
- package/cjs/dist/react/CategoryList.js +5 -3
- package/cjs/dist/react/Choice.js +1 -0
- package/cjs/dist/react/Option.js +1 -0
- package/cjs/dist/react/Product.d.ts +4 -1
- package/cjs/dist/react/Product.js +7 -5
- package/cjs/dist/react/ProductList.js +1 -0
- package/cjs/dist/react/core/CategoryList.d.ts +3 -0
- package/cjs/dist/react/core/CategoryList.js +1 -0
- package/dist/data-component-tags.d.ts +4 -2
- package/dist/data-component-tags.js +4 -2
- package/dist/react/Category.js +1 -0
- package/dist/react/CategoryList.d.ts +4 -1
- package/dist/react/CategoryList.js +5 -3
- package/dist/react/Choice.js +1 -0
- package/dist/react/Option.js +1 -0
- package/dist/react/Product.d.ts +4 -1
- package/dist/react/Product.js +7 -5
- package/dist/react/ProductList.js +1 -0
- package/dist/react/core/CategoryList.d.ts +3 -0
- package/dist/react/core/CategoryList.js +1 -0
- package/package.json +2 -2
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export declare enum DataComponentTags {
|
|
2
|
+
categoryListRoot = "stores.category-list-root",
|
|
2
3
|
categoryRoot = "stores.category-root",
|
|
3
|
-
|
|
4
|
+
choiceRoot = "stores.choice-root",
|
|
4
5
|
optionRoot = "stores.option-root",
|
|
5
|
-
|
|
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
|
|
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
|
|
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 (
|
|
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.
|
package/cjs/dist/react/Choice.js
CHANGED
package/cjs/dist/react/Option.js
CHANGED
|
@@ -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
|
|
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
|
|
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
|
-
|
|
93
|
-
|
|
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,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
|
-
|
|
4
|
+
choiceRoot = "stores.choice-root",
|
|
4
5
|
optionRoot = "stores.option-root",
|
|
5
|
-
|
|
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 = {}));
|
package/dist/react/Category.js
CHANGED
|
@@ -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
|
|
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
|
|
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 (
|
|
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.
|
package/dist/react/Choice.js
CHANGED
package/dist/react/Option.js
CHANGED
|
@@ -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
|
/**
|
package/dist/react/Product.d.ts
CHANGED
|
@@ -60,7 +60,10 @@ export interface ProductRootProps {
|
|
|
60
60
|
* }
|
|
61
61
|
* ```
|
|
62
62
|
*/
|
|
63
|
-
export declare
|
|
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
|
*/
|
package/dist/react/Product.js
CHANGED
|
@@ -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
|
|
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
|
-
|
|
93
|
-
|
|
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,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.
|
|
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.
|
|
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",
|