@plasmicpkgs/commerce 0.0.3 → 0.0.7
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/LICENSE.md +21 -0
- package/dist/commerce.cjs.development.js +891 -690
- package/dist/commerce.cjs.development.js.map +1 -1
- package/dist/commerce.cjs.production.min.js +1 -1
- package/dist/commerce.cjs.production.min.js.map +1 -1
- package/dist/commerce.d.ts +1 -0
- package/dist/commerce.esm.js +860 -690
- package/dist/commerce.esm.js.map +1 -1
- package/dist/index.d.ts +12 -0
- package/dist/product/use-product.d.ts +5 -0
- package/dist/registerAddToCartButton.d.ts +1 -0
- package/dist/registerCart.d.ts +10 -0
- package/dist/registerProductBox.d.ts +13 -0
- package/dist/registerProductCollection.d.ts +2 -0
- package/dist/registerProductLink.d.ts +12 -0
- package/dist/registerProductPrice.d.ts +1 -1
- package/dist/types/product.d.ts +10 -0
- package/package.json +3 -2
- package/dist/registerUseCart.d.ts +0 -9
package/dist/index.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ export * from "./utils/types";
|
|
|
5
5
|
export * from "./utils/errors";
|
|
6
6
|
export * from "./types/product";
|
|
7
7
|
export * from "./product/use-search";
|
|
8
|
+
export * from "./product/use-product";
|
|
8
9
|
export * from "./site/use-categories";
|
|
9
10
|
export * from "./site/use-brands";
|
|
10
11
|
export * from "./cart/use-cart";
|
|
@@ -12,6 +13,7 @@ export * from "./cart/use-add-item";
|
|
|
12
13
|
export * from "./cart/use-remove-item";
|
|
13
14
|
export * from "./cart/use-update-item";
|
|
14
15
|
export { default as useSearch } from "./product/use-search";
|
|
16
|
+
export { default as useProduct } from "./product/use-product";
|
|
15
17
|
export { default as useCategories } from "./site/use-categories";
|
|
16
18
|
export { default as useBrands } from "./site/use-brands";
|
|
17
19
|
export { default as useCart } from "./cart/use-cart";
|
|
@@ -22,4 +24,14 @@ export * as CartType from "./types/cart";
|
|
|
22
24
|
export * as ProductTypes from "./types/product";
|
|
23
25
|
export * as SiteTypes from "./types/site";
|
|
24
26
|
export { CommerceAPIConfig } from "./api/index";
|
|
27
|
+
export * from "./registerAddToCartButton";
|
|
28
|
+
export * from "./registerCart";
|
|
29
|
+
export * from "./registerProductBox";
|
|
30
|
+
export * from "./registerProductCollection";
|
|
31
|
+
export * from "./registerProductLink";
|
|
32
|
+
export * from "./registerProductMedia";
|
|
33
|
+
export * from "./registerProductPrice";
|
|
34
|
+
export * from "./registerProductQuantity";
|
|
35
|
+
export * from "./registerProductTextField";
|
|
36
|
+
export * from "./registerProductVariantPicker";
|
|
25
37
|
export declare function registerAll(loader?: Registerable): void;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { SWRHook } from '../utils/types';
|
|
2
|
+
import type { GetProductHook } from '../types/product';
|
|
3
|
+
export declare type UseProduct<H extends SWRHook<GetProductHook<any>> = SWRHook<GetProductHook>> = ReturnType<H['useHook']>;
|
|
4
|
+
declare const useProduct: UseProduct;
|
|
5
|
+
export default useProduct;
|
|
@@ -5,5 +5,6 @@ interface AddToCartButtonProps {
|
|
|
5
5
|
children?: React.ReactNode;
|
|
6
6
|
}
|
|
7
7
|
export declare const addToCartButtonMeta: ComponentMeta<AddToCartButtonProps>;
|
|
8
|
+
export declare function AddToCartButton(props: AddToCartButtonProps): React.ReactElement<any, string | ((props: any) => React.ReactElement<any, any> | null) | (new (props: any) => React.Component<any, any, any>)> | null;
|
|
8
9
|
export declare function registerAddToCartButton(loader?: Registerable, customAddToCartButtonMeta?: ComponentMeta<AddToCartButtonProps>): void;
|
|
9
10
|
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ComponentMeta } from "@plasmicapp/host/registerComponent";
|
|
2
|
+
import { Registerable } from "./registerable";
|
|
3
|
+
interface CartProps {
|
|
4
|
+
className?: string;
|
|
5
|
+
field: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const cartMeta: ComponentMeta<CartProps>;
|
|
8
|
+
export declare function CartComponent(props: CartProps): JSX.Element;
|
|
9
|
+
export declare function registerCart(loader?: Registerable, customCartMeta?: ComponentMeta<CartProps>): void;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ComponentMeta } from "@plasmicapp/host/registerComponent";
|
|
2
|
+
import { Registerable } from "./registerable";
|
|
3
|
+
import React from "react";
|
|
4
|
+
interface ProductBoxProps {
|
|
5
|
+
className?: string;
|
|
6
|
+
children?: React.ReactNode;
|
|
7
|
+
id?: string;
|
|
8
|
+
noLayout?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare const productBoxMeta: ComponentMeta<ProductBoxProps>;
|
|
11
|
+
export declare function ProductBox(props: ProductBoxProps): JSX.Element;
|
|
12
|
+
export declare function registerProductBox(loader?: Registerable, customProductBoxMeta?: ComponentMeta<ProductBoxProps>): void;
|
|
13
|
+
export {};
|
|
@@ -8,11 +8,13 @@ interface ProductCollectionProps {
|
|
|
8
8
|
count?: number;
|
|
9
9
|
category?: string;
|
|
10
10
|
brand?: string;
|
|
11
|
+
noLayout?: boolean;
|
|
11
12
|
setControlContextData?: (data: {
|
|
12
13
|
categories: Category[];
|
|
13
14
|
brands: Brand[];
|
|
14
15
|
}) => void;
|
|
15
16
|
}
|
|
16
17
|
export declare const productCollectionMeta: ComponentMeta<ProductCollectionProps>;
|
|
18
|
+
export declare function ProductCollection(props: ProductCollectionProps): JSX.Element;
|
|
17
19
|
export declare function registerProductCollection(loader?: Registerable, customProductCollectionMeta?: ComponentMeta<ProductCollectionProps>): void;
|
|
18
20
|
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ComponentMeta } from "@plasmicapp/host/registerComponent";
|
|
2
|
+
import { Registerable } from "./registerable";
|
|
3
|
+
import React from "react";
|
|
4
|
+
interface ProductLinkProps {
|
|
5
|
+
className?: string;
|
|
6
|
+
children?: React.ReactNode;
|
|
7
|
+
linkDest?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const productLinkMeta: ComponentMeta<ProductLinkProps>;
|
|
10
|
+
export declare function ProductLink(props: ProductLinkProps): JSX.Element;
|
|
11
|
+
export declare function registerProductLink(loader?: Registerable, customProductLinkMeta?: ComponentMeta<ProductLinkProps>): void;
|
|
12
|
+
export {};
|
|
@@ -4,6 +4,6 @@ interface ProductPriceProps {
|
|
|
4
4
|
className: string;
|
|
5
5
|
}
|
|
6
6
|
export declare const productPriceMeta: ComponentMeta<ProductPriceProps>;
|
|
7
|
-
export declare function
|
|
7
|
+
export declare function ProductPriceComponent(props: ProductPriceProps): JSX.Element;
|
|
8
8
|
export declare function registerProductPrice(loader?: Registerable, customProductPriceMeta?: ComponentMeta<ProductPriceProps>): void;
|
|
9
9
|
export {};
|
package/dist/types/product.d.ts
CHANGED
|
@@ -49,9 +49,13 @@ export declare type SearchProductsBody = {
|
|
|
49
49
|
locale?: string;
|
|
50
50
|
count?: number;
|
|
51
51
|
};
|
|
52
|
+
export declare type GetProductBody = {
|
|
53
|
+
id?: string;
|
|
54
|
+
};
|
|
52
55
|
export declare type ProductTypes = {
|
|
53
56
|
product: Product;
|
|
54
57
|
searchBody: SearchProductsBody;
|
|
58
|
+
getProductBody: GetProductBody;
|
|
55
59
|
};
|
|
56
60
|
export declare type SearchProductsHook<T extends ProductTypes = ProductTypes> = {
|
|
57
61
|
data: {
|
|
@@ -62,6 +66,12 @@ export declare type SearchProductsHook<T extends ProductTypes = ProductTypes> =
|
|
|
62
66
|
input: T['searchBody'];
|
|
63
67
|
fetcherInput: T['searchBody'];
|
|
64
68
|
};
|
|
69
|
+
export declare type GetProductHook<T extends ProductTypes = ProductTypes> = {
|
|
70
|
+
data: T['product'] | null;
|
|
71
|
+
body: T['getProductBody'];
|
|
72
|
+
input: T['getProductBody'];
|
|
73
|
+
fetcherInput: T['getProductBody'];
|
|
74
|
+
};
|
|
65
75
|
export declare type ProductsSchema<T extends ProductTypes = ProductTypes> = {
|
|
66
76
|
endpoint: {
|
|
67
77
|
options: {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plasmicpkgs/commerce",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.7",
|
|
4
4
|
"description": "Plasmic registration calls for commerce components",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -38,5 +38,6 @@
|
|
|
38
38
|
"js-cookie": "^3.0.1",
|
|
39
39
|
"react-hook-form": "^7.28.0",
|
|
40
40
|
"swr": "^1.2.2"
|
|
41
|
-
}
|
|
41
|
+
},
|
|
42
|
+
"gitHead": "ea0c85f1b7d88855d71907270cb3922527d34bd9"
|
|
42
43
|
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { ComponentMeta } from "@plasmicapp/host/registerComponent";
|
|
2
|
-
import { Registerable } from "./registerable";
|
|
3
|
-
interface UseCartProps {
|
|
4
|
-
className?: string;
|
|
5
|
-
field: string;
|
|
6
|
-
}
|
|
7
|
-
export declare const useCartMeta: ComponentMeta<UseCartProps>;
|
|
8
|
-
export declare function registerUseCart(loader?: Registerable, customUseCartMeta?: ComponentMeta<UseCartProps>): void;
|
|
9
|
-
export {};
|