@plasmicpkgs/commerce-shopify 0.0.8 → 0.0.11
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-shopify.cjs.development.js +158 -28
- package/dist/commerce-shopify.cjs.development.js.map +1 -1
- package/dist/commerce-shopify.cjs.production.min.js +1 -1
- package/dist/commerce-shopify.cjs.production.min.js.map +1 -1
- package/dist/commerce-shopify.esm.js +158 -28
- package/dist/commerce-shopify.esm.js.map +1 -1
- package/dist/product/use-product.d.ts +8 -0
- package/dist/provider.d.ts +3 -0
- package/dist/utils/normalize.d.ts +1 -1
- package/dist/utils/queries/get-all-collections-query.d.ts +1 -1
- package/dist/utils/queries/get-all-products-query.d.ts +1 -1
- package/dist/utils/queries/get-collection-query.d.ts +3 -0
- package/dist/utils/queries/get-product-query.d.ts +3 -2
- package/package.json +4 -4
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { SWRHook } from '@plasmicpkgs/commerce';
|
|
2
|
+
import type { GetProductHook } from '@plasmicpkgs/commerce';
|
|
3
|
+
export declare type GetProductInput = {
|
|
4
|
+
id?: string;
|
|
5
|
+
};
|
|
6
|
+
declare const _default;
|
|
7
|
+
export default _default;
|
|
8
|
+
export declare const handler: SWRHook<GetProductHook>;
|
package/dist/provider.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/// <reference types="lodash" />
|
|
2
2
|
import { handler as useSearch } from './product/use-search';
|
|
3
|
+
import { handler as useProduct } from './product/use-product';
|
|
3
4
|
import { handler as useCart } from './cart/use-cart';
|
|
4
5
|
import { handler as useAddItem } from './cart/use-add-item';
|
|
5
6
|
import { handler as useUpdateItem } from './cart/use-update-item';
|
|
@@ -36,6 +37,7 @@ export declare const getShopifyProvider: (storeDomain: string, accessToken: stri
|
|
|
36
37
|
fetcher: Fetcher<any, any>;
|
|
37
38
|
products: {
|
|
38
39
|
useSearch: import("@plasmicpkgs/commerce").SWRHook<import("@plasmicpkgs/commerce").SearchProductsHook<import("@plasmicpkgs/commerce/dist/types/product").ProductTypes>>;
|
|
40
|
+
useProduct: import("@plasmicpkgs/commerce").SWRHook<import("@plasmicpkgs/commerce").GetProductHook<import("@plasmicpkgs/commerce/dist/types/product").ProductTypes>>;
|
|
39
41
|
};
|
|
40
42
|
site: {
|
|
41
43
|
useCategories: import("@plasmicpkgs/commerce").SWRHook<import("@plasmicpkgs/commerce/dist/types/site").GetCategoriesHook<import("@plasmicpkgs/commerce/dist/types/site").SiteTypes>>;
|
|
@@ -54,6 +56,7 @@ export declare type ShopifyProvider = {
|
|
|
54
56
|
};
|
|
55
57
|
products: {
|
|
56
58
|
useSearch: typeof useSearch;
|
|
59
|
+
useProduct: typeof useProduct;
|
|
57
60
|
};
|
|
58
61
|
site: {
|
|
59
62
|
useCategories: typeof useCategories;
|
|
@@ -4,4 +4,4 @@ import { Collection } from '../schema';
|
|
|
4
4
|
import { Category } from '../types/site';
|
|
5
5
|
export declare function normalizeProduct({ id, title: name, vendor, images, variants, description, descriptionHtml, handle, priceRange, options, metafields, ...rest }: any): Product;
|
|
6
6
|
export declare function normalizeCart(checkout: any): Cart;
|
|
7
|
-
export declare const normalizeCategory: ({ title: name, handle, id, }: Collection) => Category;
|
|
7
|
+
export declare const normalizeCategory: ({ title: name, handle, id, products, }: Collection) => Category;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const getSiteCollectionsQuery
|
|
1
|
+
declare const getSiteCollectionsQuery: string;
|
|
2
2
|
export default getSiteCollectionsQuery;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare const productConnectionFragment = "\n fragment productConnection on ProductConnection {\n pageInfo {\n hasNextPage\n hasPreviousPage\n }\n edges {\n node {\n id\n title\n vendor\n handle\n description\n descriptionHtml\n priceRange {\n minVariantPrice {\n amount\n currencyCode\n }\n }\n options {\n id\n name\n values\n }\n variants(first: 250) {\n pageInfo {\n hasNextPage\n hasPreviousPage\n }\n edges {\n node {\n id\n title\n sku\n availableForSale\n requiresShipping\n selectedOptions {\n name\n value\n }\n priceV2 {\n amount\n currencyCode\n }\n compareAtPriceV2 {\n amount\n currencyCode\n }\n }\n }\n }\n images(first: 250) {\n pageInfo {\n hasNextPage\n hasPreviousPage\n }\n edges {\n node {\n originalSrc\n altText\n width\n height\n }\n }\n }\n }\n }\n }\n";
|
|
1
|
+
export declare const productConnectionFragment = "\n fragment productConnection on ProductConnection {\n pageInfo {\n hasNextPage\n hasPreviousPage\n }\n edges {\n node {\n id\n handle\n title\n vendor\n handle\n description\n descriptionHtml\n priceRange {\n minVariantPrice {\n amount\n currencyCode\n }\n }\n options {\n id\n name\n values\n }\n variants(first: 250) {\n pageInfo {\n hasNextPage\n hasPreviousPage\n }\n edges {\n node {\n id\n title\n sku\n availableForSale\n requiresShipping\n selectedOptions {\n name\n value\n }\n priceV2 {\n amount\n currencyCode\n }\n compareAtPriceV2 {\n amount\n currencyCode\n }\n }\n }\n }\n images(first: 250) {\n pageInfo {\n hasNextPage\n hasPreviousPage\n }\n edges {\n node {\n originalSrc\n altText\n width\n height\n }\n }\n }\n }\n }\n }\n";
|
|
2
2
|
declare const getAllProductsQuery: string;
|
|
3
3
|
export default getAllProductsQuery;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
declare const
|
|
2
|
-
export
|
|
1
|
+
export declare const getProductQueryBySlug: string;
|
|
2
|
+
export declare const getProductQueryById: string;
|
|
3
|
+
export default getProductQueryBySlug;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plasmicpkgs/commerce-shopify",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.11",
|
|
4
4
|
"description": "Plasmic registration calls for shopify commerce provider",
|
|
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.38",
|
|
22
22
|
"@size-limit/preset-small-lib": "^4.11.0",
|
|
23
23
|
"@types/js-cookie": "^3.0.1",
|
|
24
24
|
"@types/lodash.debounce": "^4.0.6",
|
|
@@ -34,10 +34,10 @@
|
|
|
34
34
|
"react": ">=16.8.0"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@plasmicpkgs/commerce": "0.0.
|
|
37
|
+
"@plasmicpkgs/commerce": "0.0.9",
|
|
38
38
|
"@types/react": "^17.0.40",
|
|
39
39
|
"lodash": "^4.17.21",
|
|
40
40
|
"lodash-es": "^4.17.21"
|
|
41
41
|
},
|
|
42
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "262f227330daf125c84c8a4b5a64891c3c4981be"
|
|
43
43
|
}
|