@plasmicpkgs/commerce 0.0.39 → 0.0.42
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/dist/commerce.cjs.development.js +16 -13
- 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.esm.js +16 -13
- package/dist/commerce.esm.js.map +1 -1
- package/dist/contexts.d.ts +0 -5
- package/dist/registerProductQuantity.d.ts +1 -1
- package/dist/types/product.d.ts +16 -14
- package/package.json +4 -4
package/dist/contexts.d.ts
CHANGED
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { Product } from "./types/product";
|
|
3
3
|
import { Category } from "./types/site";
|
|
4
|
-
export declare const ProductContext: React.Context<Product | undefined>;
|
|
5
|
-
export declare const ProductFormContext: React.Context<any>;
|
|
6
4
|
export declare function ProductProvider({ product, children, }: {
|
|
7
5
|
product: Product;
|
|
8
6
|
children: React.ReactNode;
|
|
9
7
|
}): JSX.Element;
|
|
10
8
|
export declare const useProduct: () => Product;
|
|
11
|
-
export declare const useProductForm: () => any;
|
|
12
|
-
export declare const CategoryContext: React.Context<Category | undefined>;
|
|
13
9
|
export declare const PrimaryCategoryContext: React.Context<Category | undefined>;
|
|
14
10
|
export declare function CategoryProvider({ category, children, }: {
|
|
15
11
|
category: Category;
|
|
@@ -17,7 +13,6 @@ export declare function CategoryProvider({ category, children, }: {
|
|
|
17
13
|
}): JSX.Element;
|
|
18
14
|
export declare const useCategoryContext: () => Category | undefined;
|
|
19
15
|
export declare const usePrimaryCategory: () => Category | undefined;
|
|
20
|
-
export declare const ProductMediaContext: React.Context<number | undefined>;
|
|
21
16
|
export declare function ProductMediaProvider({ mediaIndex, onClick, children, }: {
|
|
22
17
|
mediaIndex: number;
|
|
23
18
|
children: React.ReactNode;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ComponentMeta } from "@plasmicapp/host/registerComponent";
|
|
2
|
-
import { Registerable } from "./registerable";
|
|
3
2
|
import React from "react";
|
|
3
|
+
import { Registerable } from "./registerable";
|
|
4
4
|
interface ProductQuantityProps {
|
|
5
5
|
className: string;
|
|
6
6
|
children?: React.ReactNode;
|
package/dist/types/product.d.ts
CHANGED
|
@@ -2,10 +2,12 @@ import { Category } from "./site";
|
|
|
2
2
|
export declare type ProductImage = {
|
|
3
3
|
url: string;
|
|
4
4
|
alt?: string;
|
|
5
|
+
width?: number;
|
|
6
|
+
height?: number;
|
|
5
7
|
};
|
|
6
8
|
export declare type ProductPrice = {
|
|
7
9
|
value: number;
|
|
8
|
-
currencyCode?:
|
|
10
|
+
currencyCode?: "USD" | "EUR" | "ARS" | string;
|
|
9
11
|
retailPrice?: number;
|
|
10
12
|
salePrice?: number;
|
|
11
13
|
listPrice?: number;
|
|
@@ -13,7 +15,7 @@ export declare type ProductPrice = {
|
|
|
13
15
|
extendedListPrice?: number;
|
|
14
16
|
};
|
|
15
17
|
export declare type ProductOption = {
|
|
16
|
-
__typename?:
|
|
18
|
+
__typename?: "MultipleChoiceOption";
|
|
17
19
|
id: string;
|
|
18
20
|
displayName: string;
|
|
19
21
|
values: ProductOptionValues[];
|
|
@@ -62,18 +64,18 @@ export declare type ProductTypes = {
|
|
|
62
64
|
};
|
|
63
65
|
export declare type SearchProductsHook<T extends ProductTypes = ProductTypes> = {
|
|
64
66
|
data: {
|
|
65
|
-
products: T[
|
|
67
|
+
products: T["product"][];
|
|
66
68
|
found: boolean;
|
|
67
69
|
};
|
|
68
|
-
body: T[
|
|
69
|
-
input: T[
|
|
70
|
-
fetcherInput: T[
|
|
70
|
+
body: T["searchBody"];
|
|
71
|
+
input: T["searchBody"];
|
|
72
|
+
fetcherInput: T["searchBody"];
|
|
71
73
|
};
|
|
72
74
|
export declare type GetProductHook<T extends ProductTypes = ProductTypes> = {
|
|
73
|
-
data: T[
|
|
74
|
-
body: T[
|
|
75
|
-
input: T[
|
|
76
|
-
fetcherInput: T[
|
|
75
|
+
data: T["product"] | null;
|
|
76
|
+
body: T["getProductBody"];
|
|
77
|
+
input: T["getProductBody"];
|
|
78
|
+
fetcherInput: T["getProductBody"];
|
|
77
79
|
};
|
|
78
80
|
export declare type ProductsSchema<T extends ProductTypes = ProductTypes> = {
|
|
79
81
|
endpoint: {
|
|
@@ -85,7 +87,7 @@ export declare type ProductsSchema<T extends ProductTypes = ProductTypes> = {
|
|
|
85
87
|
};
|
|
86
88
|
export declare type GetAllProductPathsOperation<T extends ProductTypes = ProductTypes> = {
|
|
87
89
|
data: {
|
|
88
|
-
products: Pick<T[
|
|
90
|
+
products: Pick<T["product"], "path">[];
|
|
89
91
|
};
|
|
90
92
|
variables: {
|
|
91
93
|
first?: number;
|
|
@@ -93,17 +95,17 @@ export declare type GetAllProductPathsOperation<T extends ProductTypes = Product
|
|
|
93
95
|
};
|
|
94
96
|
export declare type GetAllProductsOperation<T extends ProductTypes = ProductTypes> = {
|
|
95
97
|
data: {
|
|
96
|
-
products: T[
|
|
98
|
+
products: T["product"][];
|
|
97
99
|
};
|
|
98
100
|
variables: {
|
|
99
|
-
relevance?:
|
|
101
|
+
relevance?: "featured" | "best_selling" | "newest";
|
|
100
102
|
ids?: string[];
|
|
101
103
|
first?: number;
|
|
102
104
|
};
|
|
103
105
|
};
|
|
104
106
|
export declare type GetProductOperation<T extends ProductTypes = ProductTypes> = {
|
|
105
107
|
data: {
|
|
106
|
-
product?: T[
|
|
108
|
+
product?: T["product"];
|
|
107
109
|
};
|
|
108
110
|
variables: {
|
|
109
111
|
path: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plasmicpkgs/commerce",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.42",
|
|
4
4
|
"description": "Plasmic registration calls for commerce components",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"analyze": "size-limit --why"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
|
-
"@plasmicapp/host": "1.0.
|
|
21
|
+
"@plasmicapp/host": "1.0.59",
|
|
22
22
|
"@size-limit/preset-small-lib": "^4.11.0",
|
|
23
23
|
"@types/js-cookie": "^3.0.1",
|
|
24
24
|
"@types/node": "^14.0.26",
|
|
@@ -33,12 +33,12 @@
|
|
|
33
33
|
"react": ">=16.8.0"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@plasmicapp/query": "0.1.
|
|
36
|
+
"@plasmicapp/query": "0.1.50",
|
|
37
37
|
"@types/react": "^17.0.40",
|
|
38
38
|
"@vercel/fetch": "^6.2.0",
|
|
39
39
|
"js-cookie": "^3.0.1",
|
|
40
40
|
"react-hook-form": "^7.28.0",
|
|
41
41
|
"swr": "^1.2.2"
|
|
42
42
|
},
|
|
43
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "6997c79202742f5574c50117c218b10d736deba5"
|
|
44
44
|
}
|