@plasmicpkgs/commerce 0.0.13 → 0.0.14

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,17 +1,24 @@
1
- import { Product } from "./types/product";
2
1
  import React from "react";
2
+ 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
6
  export declare const CategoryContext: React.Context<Category | undefined>;
7
- export declare function ProductProvider({ product, children }: {
7
+ export declare const SliderContext: React.Context<number | undefined>;
8
+ export declare function ProductProvider({ product, children, }: {
8
9
  product: Product;
9
10
  children: React.ReactNode;
10
11
  }): JSX.Element;
11
12
  export declare const useProduct: () => Product;
12
13
  export declare const useProductForm: () => any;
13
- export declare function CategoryProvider({ category, children }: {
14
+ export declare function CategoryProvider({ category, children, }: {
14
15
  category: Category;
15
16
  children: React.ReactNode;
16
17
  }): JSX.Element;
17
18
  export declare const useCategoryContext: () => Category | undefined;
19
+ export declare function ProductSliderProvider({ mediaIndex, onClick, children, }: {
20
+ mediaIndex: number;
21
+ children: React.ReactNode;
22
+ onClick?: () => void;
23
+ }): JSX.Element;
24
+ export declare const useProductSliderContext: () => number | undefined;
@@ -0,0 +1,10 @@
1
+ import { ComponentMeta } from "@plasmicapp/host/registerComponent";
2
+ import { Registerable } from "./registerable";
3
+ interface CategoryMediaProps {
4
+ className: string;
5
+ mediaIndex?: number;
6
+ }
7
+ export declare const categoryMediaMeta: ComponentMeta<CategoryMediaProps>;
8
+ export declare function CategoryMedia(props: CategoryMediaProps): JSX.Element;
9
+ export declare function registerCategoryMedia(loader?: Registerable, customCategoryMediaMeta?: ComponentMeta<CategoryMediaProps>): void;
10
+ export {};
@@ -0,0 +1,14 @@
1
+ import { ComponentMeta } from "@plasmicapp/host/registerComponent";
2
+ import React from "react";
3
+ import { Registerable } from "./registerable";
4
+ interface ProductSliderProps {
5
+ className: string;
6
+ slideContainer?: React.ReactNode;
7
+ thumbsContainer?: React.ReactNode;
8
+ thumbsVisible?: number;
9
+ slideSelected?: number;
10
+ }
11
+ export declare const productSliderMeta: ComponentMeta<ProductSliderProps>;
12
+ export declare function ProductSlider(props: ProductSliderProps): JSX.Element;
13
+ export declare function registerProductSlider(loader?: Registerable, customProductSliderMeta?: ComponentMeta<ProductSliderProps>): void;
14
+ export {};
@@ -1,9 +1,14 @@
1
+ export declare type CategoryImage = {
2
+ url: string;
3
+ alt?: string;
4
+ };
1
5
  export declare type Category = {
2
6
  id: string;
3
7
  name: string;
4
8
  slug: string;
5
9
  path: string;
6
10
  isEmpty?: boolean;
11
+ images?: CategoryImage[];
7
12
  };
8
13
  export declare type Brand = {
9
14
  name: string;
@@ -21,8 +26,8 @@ export declare type SiteTypes = {
21
26
  };
22
27
  export declare type GetSiteInfoOperation<T extends SiteTypes = SiteTypes> = {
23
28
  data: {
24
- categories: T['category'][];
25
- brands: T['brand'][];
29
+ categories: T["category"][];
30
+ brands: T["brand"][];
26
31
  };
27
32
  };
28
33
  export declare type GetCategoriesBody = {
@@ -31,15 +36,15 @@ export declare type GetCategoriesBody = {
31
36
  categoryId?: string;
32
37
  };
33
38
  export declare type GetCategoriesHook<T extends SiteTypes = SiteTypes> = {
34
- data: T['category'][];
35
- input: T['getCategoriesBody'];
36
- fetcherInput: T['getCategoriesBody'];
39
+ data: T["category"][];
40
+ input: T["getCategoriesBody"];
41
+ fetcherInput: T["getCategoriesBody"];
37
42
  swrState: {
38
43
  isEmpty: boolean;
39
44
  };
40
45
  };
41
46
  export declare type GetBrandsHook<T extends SiteTypes = SiteTypes> = {
42
- data: T['brand'][] | null;
47
+ data: T["brand"][] | null;
43
48
  input: {};
44
49
  fetcherInput: {};
45
50
  swrState: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plasmicpkgs/commerce",
3
- "version": "0.0.13",
3
+ "version": "0.0.14",
4
4
  "description": "Plasmic registration calls for commerce components",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -39,5 +39,5 @@
39
39
  "react-hook-form": "^7.28.0",
40
40
  "swr": "^1.2.2"
41
41
  },
42
- "gitHead": "bb7b1af1220818bfc4bf343647dc553eb5b7a19b"
42
+ "gitHead": "2b4d3ba496914ffab95f817007b83e4c5b9491a9"
43
43
  }