@plasmicpkgs/commerce 0.0.17 → 0.0.20
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 +96 -70
- 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 +94 -71
- package/dist/commerce.esm.js.map +1 -1
- package/dist/contexts.d.ts +6 -4
- package/dist/index.d.ts +1 -0
- package/dist/registerCategoryMedia.d.ts +0 -1
- package/dist/registerProductCollection.d.ts +1 -1
- package/dist/registerProductMedia.d.ts +3 -1
- package/dist/registerProductMediaCollection.d.ts +11 -0
- package/package.json +3 -3
package/dist/contexts.d.ts
CHANGED
|
@@ -3,22 +3,24 @@ import { Product } from "./types/product";
|
|
|
3
3
|
import { Category } from "./types/site";
|
|
4
4
|
export declare const ProductContext: React.Context<Product | undefined>;
|
|
5
5
|
export declare const ProductFormContext: React.Context<any>;
|
|
6
|
-
export declare const CategoryContext: React.Context<Category | undefined>;
|
|
7
|
-
export declare const SliderContext: React.Context<number | undefined>;
|
|
8
6
|
export declare function ProductProvider({ product, children, }: {
|
|
9
7
|
product: Product;
|
|
10
8
|
children: React.ReactNode;
|
|
11
9
|
}): JSX.Element;
|
|
12
10
|
export declare const useProduct: () => Product;
|
|
13
11
|
export declare const useProductForm: () => any;
|
|
12
|
+
export declare const CategoryContext: React.Context<Category | undefined>;
|
|
13
|
+
export declare const PrimaryCategoryContext: React.Context<Category | undefined>;
|
|
14
14
|
export declare function CategoryProvider({ category, children, }: {
|
|
15
15
|
category: Category;
|
|
16
16
|
children: React.ReactNode;
|
|
17
17
|
}): JSX.Element;
|
|
18
18
|
export declare const useCategoryContext: () => Category | undefined;
|
|
19
|
-
export declare
|
|
19
|
+
export declare const usePrimaryCategory: () => Category | undefined;
|
|
20
|
+
export declare const ProductMediaContext: React.Context<number | undefined>;
|
|
21
|
+
export declare function ProductMediaProvider({ mediaIndex, onClick, children, }: {
|
|
20
22
|
mediaIndex: number;
|
|
21
23
|
children: React.ReactNode;
|
|
22
24
|
onClick?: () => void;
|
|
23
25
|
}): JSX.Element;
|
|
24
|
-
export declare const
|
|
26
|
+
export declare const useProductMediaContext: () => number | undefined;
|
package/dist/index.d.ts
CHANGED
|
@@ -24,6 +24,7 @@ export * from "./registerProductBox";
|
|
|
24
24
|
export * from "./registerProductCollection";
|
|
25
25
|
export * from "./registerProductLink";
|
|
26
26
|
export * from "./registerProductMedia";
|
|
27
|
+
export * from "./registerProductMediaCollection";
|
|
27
28
|
export * from "./registerProductPrice";
|
|
28
29
|
export * from "./registerProductQuantity";
|
|
29
30
|
export * from "./registerProductSlider";
|
|
@@ -3,7 +3,6 @@ import { Registerable } from "./registerable";
|
|
|
3
3
|
interface CategoryMediaProps {
|
|
4
4
|
className: string;
|
|
5
5
|
mediaIndex?: number;
|
|
6
|
-
mediaSize?: string;
|
|
7
6
|
}
|
|
8
7
|
export declare const categoryMediaMeta: ComponentMeta<CategoryMediaProps>;
|
|
9
8
|
export declare function CategoryMedia(props: CategoryMediaProps): JSX.Element;
|
|
@@ -19,7 +19,7 @@ interface ProductCollectionProps {
|
|
|
19
19
|
categories: Category[];
|
|
20
20
|
brands: Brand[];
|
|
21
21
|
features?: CommerceExtraFeatures;
|
|
22
|
-
|
|
22
|
+
categoryCtx?: Category;
|
|
23
23
|
}) => void;
|
|
24
24
|
}
|
|
25
25
|
export declare const productCollectionMeta: ComponentMeta<ProductCollectionProps>;
|
|
@@ -3,7 +3,9 @@ import { Registerable } from "./registerable";
|
|
|
3
3
|
interface ProductMediaProps {
|
|
4
4
|
className: string;
|
|
5
5
|
mediaIndex?: number;
|
|
6
|
-
|
|
6
|
+
setControlContextData: (data: {
|
|
7
|
+
inMediaContext: boolean;
|
|
8
|
+
}) => void;
|
|
7
9
|
}
|
|
8
10
|
export declare const productMediaMeta: ComponentMeta<ProductMediaProps>;
|
|
9
11
|
export declare function ProductMedia(props: ProductMediaProps): JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ComponentMeta } from "@plasmicapp/host/registerComponent";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { Registerable } from "./registerable";
|
|
4
|
+
interface ProductMediaCollectionProps {
|
|
5
|
+
className: string;
|
|
6
|
+
media: React.ReactNode;
|
|
7
|
+
}
|
|
8
|
+
export declare const productMediaCollectionMeta: ComponentMeta<ProductMediaCollectionProps>;
|
|
9
|
+
export declare function ProductMediaCollection(props: ProductMediaCollectionProps): JSX.Element;
|
|
10
|
+
export declare function registerProductMediaCollection(loader?: Registerable, customProductMediaCollectionMeta?: ComponentMeta<ProductMediaCollectionProps>): void;
|
|
11
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plasmicpkgs/commerce",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.20",
|
|
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.41",
|
|
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",
|
|
@@ -39,5 +39,5 @@
|
|
|
39
39
|
"react-hook-form": "^7.28.0",
|
|
40
40
|
"swr": "^1.2.2"
|
|
41
41
|
},
|
|
42
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "2ecb9e39678b29c788a5ccb1c0e45ba6b3b5de88"
|
|
43
43
|
}
|