@plasmicpkgs/commerce-local 0.0.207 → 0.0.208
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.
|
@@ -2611,7 +2611,7 @@ function _createForOfIteratorHelperLoose(o, allowArrayLike) {
|
|
|
2611
2611
|
}
|
|
2612
2612
|
|
|
2613
2613
|
var fetcher = /*#__PURE__*/function () {
|
|
2614
|
-
var _ref = /*#__PURE__*/_asyncToGenerator(
|
|
2614
|
+
var _ref = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
2615
2615
|
var res, _yield$res$json, data;
|
|
2616
2616
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
2617
2617
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -2692,7 +2692,7 @@ var handler = {
|
|
|
2692
2692
|
query: "use-cart"
|
|
2693
2693
|
},
|
|
2694
2694
|
fetcher: function fetcher(_ref) {
|
|
2695
|
-
return _asyncToGenerator(
|
|
2695
|
+
return _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
2696
2696
|
var input, fetch;
|
|
2697
2697
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
2698
2698
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -2734,7 +2734,7 @@ var handler$1 = {
|
|
|
2734
2734
|
query: "use-add-item"
|
|
2735
2735
|
},
|
|
2736
2736
|
fetcher: function fetcher(_ref) {
|
|
2737
|
-
return _asyncToGenerator(
|
|
2737
|
+
return _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
2738
2738
|
var _item$quantity;
|
|
2739
2739
|
var item, fetch, lineItem, cart, _iterator, _step, product, variant, _item$quantity2, currentLineItem;
|
|
2740
2740
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
@@ -2785,8 +2785,8 @@ var handler$1 = {
|
|
|
2785
2785
|
return function () {
|
|
2786
2786
|
var _useCart = commerce.useCart(),
|
|
2787
2787
|
mutate = _useCart.mutate;
|
|
2788
|
-
return React.useCallback(
|
|
2789
|
-
var _addItem = _asyncToGenerator(
|
|
2788
|
+
return React.useCallback(/*#__PURE__*/function () {
|
|
2789
|
+
var _addItem = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(input) {
|
|
2790
2790
|
var data;
|
|
2791
2791
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
2792
2792
|
while (1) switch (_context2.prev = _context2.next) {
|
|
@@ -2821,7 +2821,7 @@ var handler$2 = {
|
|
|
2821
2821
|
query: ''
|
|
2822
2822
|
},
|
|
2823
2823
|
fetcher: function fetcher(_ref) {
|
|
2824
|
-
return _asyncToGenerator(
|
|
2824
|
+
return _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
2825
2825
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
2826
2826
|
while (1) switch (_context.prev = _context.next) {
|
|
2827
2827
|
case 0:
|
|
@@ -2835,7 +2835,7 @@ var handler$2 = {
|
|
|
2835
2835
|
useHook: function useHook(_ref2) {
|
|
2836
2836
|
return function () {
|
|
2837
2837
|
return /*#__PURE__*/function () {
|
|
2838
|
-
var _addItem = _asyncToGenerator(
|
|
2838
|
+
var _addItem = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
2839
2839
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
2840
2840
|
while (1) switch (_context2.prev = _context2.next) {
|
|
2841
2841
|
case 0:
|
|
@@ -2860,7 +2860,7 @@ var handler$3 = {
|
|
|
2860
2860
|
query: ''
|
|
2861
2861
|
},
|
|
2862
2862
|
fetcher: function fetcher(_ref) {
|
|
2863
|
-
return _asyncToGenerator(
|
|
2863
|
+
return _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
2864
2864
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
2865
2865
|
while (1) switch (_context.prev = _context.next) {
|
|
2866
2866
|
case 0:
|
|
@@ -2874,7 +2874,7 @@ var handler$3 = {
|
|
|
2874
2874
|
useHook: function useHook(_ref2) {
|
|
2875
2875
|
return function () {
|
|
2876
2876
|
return /*#__PURE__*/function () {
|
|
2877
|
-
var _removeItem = _asyncToGenerator(
|
|
2877
|
+
var _removeItem = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(input) {
|
|
2878
2878
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
2879
2879
|
while (1) switch (_context2.prev = _context2.next) {
|
|
2880
2880
|
case 0:
|
|
@@ -2914,7 +2914,7 @@ var handler$4 = {
|
|
|
2914
2914
|
query: "use-search"
|
|
2915
2915
|
},
|
|
2916
2916
|
fetcher: function fetcher(_ref) {
|
|
2917
|
-
return _asyncToGenerator(
|
|
2917
|
+
return _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
2918
2918
|
var input, fetch, search, categoryId, brandId, sort, count, products, category;
|
|
2919
2919
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
2920
2920
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -2978,7 +2978,7 @@ var handler$5 = {
|
|
|
2978
2978
|
query: "use-product"
|
|
2979
2979
|
},
|
|
2980
2980
|
fetcher: function fetcher(_ref) {
|
|
2981
|
-
return _asyncToGenerator(
|
|
2981
|
+
return _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
2982
2982
|
var _data$products$find;
|
|
2983
2983
|
var input, fetch, id;
|
|
2984
2984
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
@@ -3017,7 +3017,7 @@ var handler$6 = {
|
|
|
3017
3017
|
query: "use-categories"
|
|
3018
3018
|
},
|
|
3019
3019
|
fetcher: function fetcher(_ref) {
|
|
3020
|
-
return _asyncToGenerator(
|
|
3020
|
+
return _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
3021
3021
|
var input, fetch, categoryId, category;
|
|
3022
3022
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
3023
3023
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -3070,7 +3070,7 @@ var handler$7 = {
|
|
|
3070
3070
|
query: "use-brands"
|
|
3071
3071
|
},
|
|
3072
3072
|
fetcher: function fetcher(_ref) {
|
|
3073
|
-
return _asyncToGenerator(
|
|
3073
|
+
return _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
3074
3074
|
var vendorsStrings;
|
|
3075
3075
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
3076
3076
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commerce-local.cjs.development.js","sources":["../src/fetcher.ts","../src/const.ts","../src/utils/cart.ts","../src/cart/use-cart.tsx","../src/cart/use-add-item.tsx","../src/cart/use-update-item.tsx","../src/cart/use-remove-item.tsx","../src/utils/sort-product.ts","../src/product/use-search.tsx","../src/product/use-product.tsx","../src/site/use-categories.ts","../src/site/use-brands.ts","../src/provider.ts","../src/local.ts","../src/registerCommerceProvider.tsx","../src/index.tsx"],"sourcesContent":["import { Fetcher } from '@plasmicpkgs/commerce';\n\nexport const fetcher: Fetcher = async () => {\n console.log('FETCHER')\n const res = await fetch('./data.json')\n if (res.ok) {\n const { data } = await res.json()\n return data\n }\n throw res\n}\n","export const LOCAL_CART_OBJ = \"localCartObj\";\n\nexport const LOCAL_CART_ID = \"localCartId\";\n","import { CartType } from \"@plasmicpkgs/commerce\";\nimport Cookies from \"js-cookie\";\nimport { LOCAL_CART_ID, LOCAL_CART_OBJ } from \"../const\";\n\nconst options: Cookies.CookieAttributes = {\n sameSite: \"none\",\n secure: true,\n};\n\nexport const createCart: () => CartType.Cart = () => {\n const cart = {\n id: \"\",\n createdAt: \"\",\n currency: { code: \"USD\" },\n taxesIncluded: false,\n lineItems: [],\n lineItemsSubtotalPrice: 0,\n subtotalPrice: 0,\n totalPrice: 0,\n };\n\n const cartId = Date.now().toString();\n\n Cookies.set(LOCAL_CART_ID, cartId);\n Cookies.set(\n LOCAL_CART_OBJ,\n JSON.stringify({\n id: cartId,\n cart,\n })\n );\n\n return cart;\n};\n\nexport const getCart: (cartId?: string) => CartType.Cart = (\n cartId?: string\n) => {\n cartId = cartId ?? Cookies.get(LOCAL_CART_ID);\n const cartStr = Cookies.get(LOCAL_CART_OBJ);\n const cart = cartStr ? JSON.parse(cartStr) : undefined;\n\n if (!cart || cart.id !== cartId) {\n return createCart();\n } else {\n return cart.cart;\n }\n};\n\nexport const cartUpdate = (newCart: CartType.Cart) => {\n Cookies.set(\n LOCAL_CART_OBJ,\n JSON.stringify({\n id: Cookies.get(LOCAL_CART_ID),\n cart: newCart,\n })\n );\n\n return newCart;\n};\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes:\n - Before: just returned an empty cart.\n - Now: Read cart from local storage.\n*/\nimport { SWRHook, useCart, UseCart } from \"@plasmicpkgs/commerce\";\nimport React from \"react\";\nimport { getCart } from \"../utils/cart\";\n\nexport default useCart as UseCart<typeof handler>;\n\nexport const handler: SWRHook<any> = {\n fetchOptions: {\n query: \"use-cart\",\n },\n async fetcher({ input, options, fetch }) {\n return getCart(input.cartId);\n },\n useHook: ({ useData }) => (input) => {\n const response = useData({\n swrOptions: { revalidateOnFocus: false, ...input?.swrOptions },\n });\n return React.useMemo(\n () =>\n Object.create(response, {\n isEmpty: {\n get() {\n return (response.data?.lineItems.length ?? 0) <= 0;\n },\n enumerable: true,\n },\n }),\n [response]\n );\n },\n};\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes:\n - Implemented a local cart\n - The items are added to local storage.\n*/\nimport {\n CommerceError,\n MutationHook,\n useAddItem,\n UseAddItem,\n} from \"@plasmicpkgs/commerce\";\nimport { useCallback } from \"react\";\nimport data from \"../data.json\";\nimport { cartUpdate, getCart } from \"../utils/cart\";\nimport useCart from \"./use-cart\";\n\nexport default useAddItem as UseAddItem<typeof handler>;\nexport const handler: MutationHook<any> = {\n fetchOptions: {\n query: \"use-add-item\",\n },\n async fetcher({ input: item, options, fetch }) {\n if (\n item.quantity &&\n (!Number.isInteger(item.quantity) || item.quantity! < 1)\n ) {\n throw new CommerceError({\n message: \"The item quantity has to be a valid integer greater than 0\",\n });\n }\n\n const lineItem = {\n variantId: item.variantId,\n quantity: item.quantity ?? 1,\n };\n\n const cart = getCart();\n for (const product of data.products) {\n const variant = (product.variants as any[]).find(\n (variant) => variant.id === item.variantId\n );\n if (variant) {\n cart.totalPrice += variant.price * (item.quantity ?? 1);\n cart.currency.code = product.price.currencyCode;\n const currentLineItem = cart.lineItems.find(\n (item) => item.variantId === lineItem.variantId\n );\n if (!currentLineItem) {\n cart.lineItems.push(lineItem as any);\n } else {\n currentLineItem.quantity += lineItem.quantity;\n }\n }\n }\n\n return cartUpdate(cart);\n },\n useHook: ({ fetch }) => () => {\n const { mutate } = useCart();\n return useCallback(\n async function addItem(input) {\n const data = await fetch({ input });\n await mutate(data, false);\n return data;\n },\n [fetch, mutate]\n );\n },\n};\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes: None\n*/\nimport { MutationHook } from '@plasmicpkgs/commerce'\nimport { useUpdateItem,\n UseUpdateItem,\n} from '@plasmicpkgs/commerce'\n\nexport default useUpdateItem as UseUpdateItem<any>\n\nexport const handler: MutationHook<any> = {\n fetchOptions: {\n query: '',\n },\n async fetcher({ input, options, fetch }) {},\n useHook:\n ({ fetch }) =>\n () => {\n return async function addItem() {\n return {}\n }\n },\n}\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes: None\n*/\nimport { MutationHook } from '@plasmicpkgs/commerce'\nimport {useRemoveItem,\n UseRemoveItem,\n} from '@plasmicpkgs/commerce'\n\nexport default useRemoveItem as UseRemoveItem<typeof handler>\n\nexport const handler: MutationHook<any> = {\n fetchOptions: {\n query: '',\n },\n async fetcher({ input, options, fetch }) {},\n useHook:\n ({ fetch }) =>\n () => {\n return async function removeItem(input) {\n return {}\n }\n },\n}\n","import data from \"../data.json\";\n\nexport const sortProduct = (\n a: typeof data.products[0],\n b: typeof data.products[0],\n sortKey: string\n) => {\n switch (sortKey) {\n case \"price-asc\":\n return a.price.value < b.price.value ? -1 : 1;\n case \"price-desc\":\n return a.price.value < b.price.value ? 1 : -1;\n case \"trending-desc\":\n return a.id.localeCompare(b.id);\n case \"latest-desc\":\n return a.id.localeCompare(b.id) * -1;\n default:\n return 0;\n }\n};\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes: None\n*/\nimport { SWRHook, useSearch, UseSearch } from \"@plasmicpkgs/commerce\";\nimport data from \"../data.json\";\nimport { sortProduct } from \"../utils/sort-product\";\nconst useSearchTyped: UseSearch<typeof handler> = useSearch;\nexport default useSearchTyped;\n\nexport const handler: SWRHook<any> = {\n fetchOptions: {\n query: \"use-search\",\n },\n async fetcher({ input, options, fetch }) {\n const { search, categoryId, brandId, sort, count } = input;\n\n let products = data.products;\n\n if (categoryId) {\n const category = data.categories.find(\n (category) => category.id === categoryId\n );\n products = data.products.filter((product) =>\n category?.products?.includes(product.id)\n );\n }\n\n if (brandId) {\n products = products.filter(\n (product) =>\n product.vendor.replace(/\\s+/g, \"-\").toLowerCase() ===\n `${brandId}`.toLowerCase()\n );\n }\n\n if (search) {\n products = products.filter(\n (product) =>\n product.name.toLowerCase().includes(`${search}`.toLowerCase()) ||\n product.slug.toLowerCase().includes(`${search}`.toLowerCase())\n );\n }\n\n if (sort) {\n products = products.sort((a, b) => sortProduct(a, b, sort));\n }\n\n return {\n products: products.slice(0, count),\n found: products.length > 0,\n };\n },\n useHook:\n ({ useData }) =>\n (input = {}) => {\n return useData({\n input: [\n [\"search\", input.search],\n [\"prefixSearch\", input.prefixSearch],\n [\"categoryId\", input.categoryId],\n [\"brandId\", input.brandId],\n [\"sort\", input.sort],\n [\"locale\", input.locale],\n [\"count\", input.count],\n ],\n swrOptions: {\n revalidateOnFocus: false,\n ...input.swrOptions,\n },\n });\n },\n};\n","import { SWRHook, useProduct, UseProduct } from \"@plasmicpkgs/commerce\";\nimport data from \"../data.json\";\nexport default useProduct as UseProduct<typeof handler>;\n\nexport const handler: SWRHook<any> = {\n fetchOptions: {\n query: \"use-product\",\n },\n async fetcher({ input, options, fetch }) {\n const { id } = input;\n\n return (\n data.products.find((product) =>\n [product.id, product.slug].includes(id)\n ) ?? null\n );\n },\n useHook: ({ useData }) => (input = {}) => {\n return useData({\n input: [[\"id\", input.id]],\n swrOptions: {\n revalidateOnFocus: false,\n ...input.swrOptions,\n },\n });\n },\n};\n","import { SWRHook, useCategories, UseCategories } from \"@plasmicpkgs/commerce\";\nimport React from \"react\";\nimport data from \"../data.json\";\nexport default useCategories as UseCategories<typeof handler>;\n\nexport const handler: SWRHook<any> = {\n fetchOptions: {\n query: \"use-categories\",\n },\n async fetcher({ input, options, fetch }) {\n const { categoryId } = input;\n if (!categoryId) {\n return data.categories;\n }\n const category = data.categories.find(\n (category) => category.id === categoryId\n );\n return category ? [category] : [];\n },\n useHook: ({ useData }) => (input) => {\n const response = useData({\n input: [[\"categoryId\", input?.categoryId]],\n swrOptions: { revalidateOnFocus: false, ...input?.swrOptions },\n });\n return React.useMemo(\n () =>\n Object.create(response, {\n isEmpty: {\n get() {\n return (response.data?.length ?? 0) <= 0;\n },\n enumerable: true,\n },\n }),\n [response]\n );\n },\n};\n","import { SWRHook, useBrands, UseBrands } from \"@plasmicpkgs/commerce\";\nimport React from \"react\";\nimport data from \"../data.json\";\nexport default useBrands as UseBrands<typeof handler>;\n\nexport const handler: SWRHook<any> = {\n fetchOptions: {\n query: \"use-brands\",\n },\n async fetcher({ input, options, fetch }) {\n const vendorsStrings = data.products.map((product) => product.vendor);\n return Array.from(new Set(vendorsStrings).values()).map((v) => {\n const id = v.replace(/\\s+/g, \"-\").toLowerCase();\n return {\n entityId: id,\n name: v,\n path: `brands/${id}`,\n };\n });\n },\n useHook: ({ useData }) => (input) => {\n const response = useData({\n swrOptions: { revalidateOnFocus: false, ...input?.swrOptions },\n });\n return React.useMemo(\n () =>\n Object.create(response, {\n isEmpty: {\n get() {\n return (response.data?.length ?? 0) <= 0;\n },\n enumerable: true,\n },\n }),\n [response]\n );\n },\n};\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes: Removed authentication, customer and wishlist hooks\n*/\nimport { fetcher } from './fetcher'\nimport { handler as useCart } from './cart/use-cart'\nimport { handler as useAddItem } from './cart/use-add-item'\nimport { handler as useUpdateItem } from './cart/use-update-item'\nimport { handler as useRemoveItem } from './cart/use-remove-item'\nimport { handler as useSearch } from './product/use-search'\nimport { handler as useProduct } from './product/use-product'\nimport { handler as useCategories } from './site/use-categories'\nimport { handler as useBrands } from './site/use-brands'\nimport { LOCAL_CART_ID } from './const'\nexport const localProvider = {\n locale: 'en-us',\n cartCookie: LOCAL_CART_ID,\n fetcher: fetcher,\n cart: { useCart, useAddItem, useUpdateItem, useRemoveItem },\n products: { useSearch, useProduct },\n site: { useCategories, useBrands }\n}\n\nexport type LocalProvider = typeof localProvider\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes: Add export data\n*/\nexport * from \"./registerable\";\nexport { localProvider, data };\nexport type { LocalProvider };\nimport {\n getCommerceProvider,\n useCommerce as useCoreCommerce,\n} from \"@plasmicpkgs/commerce\";\nimport data from \"./data.json\";\nimport { localProvider, LocalProvider } from \"./provider\";\n\nexport const CommerceProvider = getCommerceProvider(localProvider);\n\nexport const useCommerce = () => useCoreCommerce<LocalProvider>();\n","import { GlobalContextMeta } from \"@plasmicapp/host\";\nimport registerGlobalContext from \"@plasmicapp/host/registerGlobalContext\";\nimport React from \"react\";\nimport { CommerceProvider } from \"./local\";\nimport { Registerable } from \"./registerable\";\n\ninterface CommerceProviderProps {\n children?: React.ReactNode;\n}\n\nexport const commerceProviderMeta: GlobalContextMeta<CommerceProviderProps> = {\n name: \"plasmic-commerce-local-provider\",\n displayName: \"Local Provider\",\n props: {},\n importPath: \"@plasmicpkgs/commerce-local\",\n importName: \"CommerceProviderComponent\",\n};\n\nfunction CommerceProviderComponent(props: CommerceProviderProps) {\n return <CommerceProvider>{props.children}</CommerceProvider>;\n}\n\nexport function registerCommerceProvider(\n loader?: Registerable,\n customCommerceProviderMeta?: GlobalContextMeta<CommerceProviderProps>\n) {\n const doRegisterComponent: typeof registerGlobalContext = (...args) =>\n loader\n ? loader.registerGlobalContext(...args)\n : registerGlobalContext(...args);\n doRegisterComponent(\n CommerceProviderComponent,\n customCommerceProviderMeta ?? commerceProviderMeta\n );\n}\n","import { Registerable } from \"./registerable\";\nimport { registerCommerceProvider } from \"./registerCommerceProvider\";\nexport * from \"./registerable\";\n\nexport * from \"./local\";\n\nexport function registerAll(loader?: Registerable) {\n registerCommerceProvider(loader);\n}\n\nexport { registerCommerceProvider };"],"names":["fetcher","_ref","_asyncToGenerator","_regeneratorRuntime","mark","_callee","res","_yield$res$json","data","wrap","_callee$","_context","prev","next","console","log","fetch","sent","ok","json","abrupt","stop","apply","arguments","LOCAL_CART_OBJ","LOCAL_CART_ID","createCart","cart","id","createdAt","currency","code","taxesIncluded","lineItems","lineItemsSubtotalPrice","subtotalPrice","totalPrice","cartId","Date","now","toString","Cookies","set","JSON","stringify","getCart","_cartId","get","cartStr","parse","undefined","cartUpdate","newCart","handler","fetchOptions","query","input","options","useHook","_ref2","useData","response","swrOptions","_extends","revalidateOnFocus","React","useMemo","Object","create","isEmpty","_response$data$lineIt","_response$data","length","enumerable","item","quantity","Number","isInteger","CommerceError","message","lineItem","variantId","_item$quantity","_iterator","_createForOfIteratorHelperLoose","products","_step","done","product","value","variant","variants","find","price","_item$quantity2","currencyCode","currentLineItem","push","_useCart","useCart","mutate","useCallback","_addItem","_callee2","_callee2$","_context2","addItem","_x","_removeItem","removeItem","sortProduct","a","b","sortKey","localeCompare","search","categoryId","brandId","sort","count","category","categories","filter","_category$products","includes","vendor","replace","toLowerCase","name","slug","slice","found","prefixSearch","locale","_data$products$find","_response$data$length","vendorsStrings","map","Array","from","Set","values","v","entityId","path","localProvider","cartCookie","useAddItem","useUpdateItem","useRemoveItem","useSearch","useProduct","site","useCategories","useBrands","CommerceProvider","getCommerceProvider","useCommerce","useCoreCommerce","commerceProviderMeta","displayName","props","importPath","importName","CommerceProviderComponent","children","registerCommerceProvider","loader","customCommerceProviderMeta","doRegisterComponent","registerGlobalContext","registerAll"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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A,OAAO;EAChB2B,IAAI,EAAE;IAAEwE,OAAO,EAAPA,OAAO;IAAEgD,UAAU,EAAVA,SAAU;IAAEC,aAAa,EAAbA,SAAa;IAAEC,aAAa,EAAbA;GAAe;EAC3DhE,QAAQ,EAAE;IAAEiE,SAAS,EAATA,SAAS;IAAEC,UAAU,EAAVA;GAAY;EACnCC,IAAI,EAAE;IAAEC,aAAa,EAAbA,SAAa;IAAEC,SAAS,EAATA;;CACxB;;ACrBD;;;;AAIA,IAUaC,gBAAgB,gBAAGC,4BAAmB,CAACX,aAAa,CAAC;AAElE,IAAaY,WAAW,GAAG,SAAdA,WAAWA;EAAA,OAASC,oBAAe,EAAiB;AAAA;;ACN1D,IAAMC,oBAAoB,GAA6C;EAC5E/B,IAAI,EAAE,iCAAiC;EACvCgC,WAAW,EAAE,gBAAgB;EAC7BC,KAAK,EAAE,EAAE;EACTC,UAAU,EAAE,6BAA6B;EACzCC,UAAU,EAAE;CACb;AAED,SAASC,yBAAyBA,CAACH,KAA4B;EAC7D,OAAOhG,6BAAC0F,gBAAgB,QAAEM,KAAK,CAACI,QAAQ,CAAoB;AAC9D;AAEA,SAAgBC,wBAAwBA,CACtCC,MAAqB,EACrBC,0BAAqE;EAErE,IAAMC,mBAAmB,GAAiC,SAApDA,mBAAmBA;IAAA,OACvBF,MAAM,GACFA,MAAM,CAACG,qBAAqB,CAAApJ,KAAA,CAA5BiJ,MAAM,EAAAhJ,SAA8B,CAAC,GACrCmJ,qBAAqB,CAAApJ,KAAA,SAAAC,SAAQ,CAAC;;EACpCkJ,mBAAmB,CACjBL,yBAAyB,EACzBI,0BAA0B,WAA1BA,0BAA0B,GAAIT,oBAAoB,CACnD;AACH;;SC5BgBY,WAAWA,CAACJ,MAAqB;EAC/CD,wBAAwB,CAACC,MAAM,CAAC;AAClC;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"commerce-local.cjs.development.js","sources":["../src/fetcher.ts","../src/const.ts","../src/utils/cart.ts","../src/cart/use-cart.tsx","../src/cart/use-add-item.tsx","../src/cart/use-update-item.tsx","../src/cart/use-remove-item.tsx","../src/utils/sort-product.ts","../src/product/use-search.tsx","../src/product/use-product.tsx","../src/site/use-categories.ts","../src/site/use-brands.ts","../src/provider.ts","../src/local.ts","../src/registerCommerceProvider.tsx","../src/index.tsx"],"sourcesContent":["import { Fetcher } from '@plasmicpkgs/commerce';\n\nexport const fetcher: Fetcher = async () => {\n console.log('FETCHER')\n const res = await fetch('./data.json')\n if (res.ok) {\n const { data } = await res.json()\n return data\n }\n throw res\n}\n","export const LOCAL_CART_OBJ = \"localCartObj\";\n\nexport const LOCAL_CART_ID = \"localCartId\";\n","import { CartType } from \"@plasmicpkgs/commerce\";\nimport Cookies from \"js-cookie\";\nimport { LOCAL_CART_ID, LOCAL_CART_OBJ } from \"../const\";\n\nconst options: Cookies.CookieAttributes = {\n sameSite: \"none\",\n secure: true,\n};\n\nexport const createCart: () => CartType.Cart = () => {\n const cart = {\n id: \"\",\n createdAt: \"\",\n currency: { code: \"USD\" },\n taxesIncluded: false,\n lineItems: [],\n lineItemsSubtotalPrice: 0,\n subtotalPrice: 0,\n totalPrice: 0,\n };\n\n const cartId = Date.now().toString();\n\n Cookies.set(LOCAL_CART_ID, cartId);\n Cookies.set(\n LOCAL_CART_OBJ,\n JSON.stringify({\n id: cartId,\n cart,\n })\n );\n\n return cart;\n};\n\nexport const getCart: (cartId?: string) => CartType.Cart = (\n cartId?: string\n) => {\n cartId = cartId ?? Cookies.get(LOCAL_CART_ID);\n const cartStr = Cookies.get(LOCAL_CART_OBJ);\n const cart = cartStr ? JSON.parse(cartStr) : undefined;\n\n if (!cart || cart.id !== cartId) {\n return createCart();\n } else {\n return cart.cart;\n }\n};\n\nexport const cartUpdate = (newCart: CartType.Cart) => {\n Cookies.set(\n LOCAL_CART_OBJ,\n JSON.stringify({\n id: Cookies.get(LOCAL_CART_ID),\n cart: newCart,\n })\n );\n\n return newCart;\n};\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes:\n - Before: just returned an empty cart.\n - Now: Read cart from local storage.\n*/\nimport { SWRHook, useCart, UseCart } from \"@plasmicpkgs/commerce\";\nimport React from \"react\";\nimport { getCart } from \"../utils/cart\";\n\nexport default useCart as UseCart<typeof handler>;\n\nexport const handler: SWRHook<any> = {\n fetchOptions: {\n query: \"use-cart\",\n },\n async fetcher({ input, options, fetch }) {\n return getCart(input.cartId);\n },\n useHook: ({ useData }) => (input) => {\n const response = useData({\n swrOptions: { revalidateOnFocus: false, ...input?.swrOptions },\n });\n return React.useMemo(\n () =>\n Object.create(response, {\n isEmpty: {\n get() {\n return (response.data?.lineItems.length ?? 0) <= 0;\n },\n enumerable: true,\n },\n }),\n [response]\n );\n },\n};\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes:\n - Implemented a local cart\n - The items are added to local storage.\n*/\nimport {\n CommerceError,\n MutationHook,\n useAddItem,\n UseAddItem,\n} from \"@plasmicpkgs/commerce\";\nimport { useCallback } from \"react\";\nimport data from \"../data.json\";\nimport { cartUpdate, getCart } from \"../utils/cart\";\nimport useCart from \"./use-cart\";\n\nexport default useAddItem as UseAddItem<typeof handler>;\nexport const handler: MutationHook<any> = {\n fetchOptions: {\n query: \"use-add-item\",\n },\n async fetcher({ input: item, options, fetch }) {\n if (\n item.quantity &&\n (!Number.isInteger(item.quantity) || item.quantity! < 1)\n ) {\n throw new CommerceError({\n message: \"The item quantity has to be a valid integer greater than 0\",\n });\n }\n\n const lineItem = {\n variantId: item.variantId,\n quantity: item.quantity ?? 1,\n };\n\n const cart = getCart();\n for (const product of data.products) {\n const variant = (product.variants as any[]).find(\n (variant) => variant.id === item.variantId\n );\n if (variant) {\n cart.totalPrice += variant.price * (item.quantity ?? 1);\n cart.currency.code = product.price.currencyCode;\n const currentLineItem = cart.lineItems.find(\n (item) => item.variantId === lineItem.variantId\n );\n if (!currentLineItem) {\n cart.lineItems.push(lineItem as any);\n } else {\n currentLineItem.quantity += lineItem.quantity;\n }\n }\n }\n\n return cartUpdate(cart);\n },\n useHook: ({ fetch }) => () => {\n const { mutate } = useCart();\n return useCallback(\n async function addItem(input) {\n const data = await fetch({ input });\n await mutate(data, false);\n return data;\n },\n [fetch, mutate]\n );\n },\n};\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes: None\n*/\nimport { MutationHook } from '@plasmicpkgs/commerce'\nimport { useUpdateItem,\n UseUpdateItem,\n} from '@plasmicpkgs/commerce'\n\nexport default useUpdateItem as UseUpdateItem<any>\n\nexport const handler: MutationHook<any> = {\n fetchOptions: {\n query: '',\n },\n async fetcher({ input, options, fetch }) {},\n useHook:\n ({ fetch }) =>\n () => {\n return async function addItem() {\n return {}\n }\n },\n}\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes: None\n*/\nimport { MutationHook } from '@plasmicpkgs/commerce'\nimport {useRemoveItem,\n UseRemoveItem,\n} from '@plasmicpkgs/commerce'\n\nexport default useRemoveItem as UseRemoveItem<typeof handler>\n\nexport const handler: MutationHook<any> = {\n fetchOptions: {\n query: '',\n },\n async fetcher({ input, options, fetch }) {},\n useHook:\n ({ fetch }) =>\n () => {\n return async function removeItem(input) {\n return {}\n }\n },\n}\n","import data from \"../data.json\";\n\nexport const sortProduct = (\n a: typeof data.products[0],\n b: typeof data.products[0],\n sortKey: string\n) => {\n switch (sortKey) {\n case \"price-asc\":\n return a.price.value < b.price.value ? -1 : 1;\n case \"price-desc\":\n return a.price.value < b.price.value ? 1 : -1;\n case \"trending-desc\":\n return a.id.localeCompare(b.id);\n case \"latest-desc\":\n return a.id.localeCompare(b.id) * -1;\n default:\n return 0;\n }\n};\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes: None\n*/\nimport { SWRHook, useSearch, UseSearch } from \"@plasmicpkgs/commerce\";\nimport data from \"../data.json\";\nimport { sortProduct } from \"../utils/sort-product\";\nconst useSearchTyped: UseSearch<typeof handler> = useSearch;\nexport default useSearchTyped;\n\nexport const handler: SWRHook<any> = {\n fetchOptions: {\n query: \"use-search\",\n },\n async fetcher({ input, options, fetch }) {\n const { search, categoryId, brandId, sort, count } = input;\n\n let products = data.products;\n\n if (categoryId) {\n const category = data.categories.find(\n (category) => category.id === categoryId\n );\n products = data.products.filter((product) =>\n category?.products?.includes(product.id)\n );\n }\n\n if (brandId) {\n products = products.filter(\n (product) =>\n product.vendor.replace(/\\s+/g, \"-\").toLowerCase() ===\n `${brandId}`.toLowerCase()\n );\n }\n\n if (search) {\n products = products.filter(\n (product) =>\n product.name.toLowerCase().includes(`${search}`.toLowerCase()) ||\n product.slug.toLowerCase().includes(`${search}`.toLowerCase())\n );\n }\n\n if (sort) {\n products = products.sort((a, b) => sortProduct(a, b, sort));\n }\n\n return {\n products: products.slice(0, count),\n found: products.length > 0,\n };\n },\n useHook:\n ({ useData }) =>\n (input = {}) => {\n return useData({\n input: [\n [\"search\", input.search],\n [\"prefixSearch\", input.prefixSearch],\n [\"categoryId\", input.categoryId],\n [\"brandId\", input.brandId],\n [\"sort\", input.sort],\n [\"locale\", input.locale],\n [\"count\", input.count],\n ],\n swrOptions: {\n revalidateOnFocus: false,\n ...input.swrOptions,\n },\n });\n },\n};\n","import { SWRHook, useProduct, UseProduct } from \"@plasmicpkgs/commerce\";\nimport data from \"../data.json\";\nexport default useProduct as UseProduct<typeof handler>;\n\nexport const handler: SWRHook<any> = {\n fetchOptions: {\n query: \"use-product\",\n },\n async fetcher({ input, options, fetch }) {\n const { id } = input;\n\n return (\n data.products.find((product) =>\n [product.id, product.slug].includes(id)\n ) ?? null\n );\n },\n useHook: ({ useData }) => (input = {}) => {\n return useData({\n input: [[\"id\", input.id]],\n swrOptions: {\n revalidateOnFocus: false,\n ...input.swrOptions,\n },\n });\n },\n};\n","import { SWRHook, useCategories, UseCategories } from \"@plasmicpkgs/commerce\";\nimport React from \"react\";\nimport data from \"../data.json\";\nexport default useCategories as UseCategories<typeof handler>;\n\nexport const handler: SWRHook<any> = {\n fetchOptions: {\n query: \"use-categories\",\n },\n async fetcher({ input, options, fetch }) {\n const { categoryId } = input;\n if (!categoryId) {\n return data.categories;\n }\n const category = data.categories.find(\n (category) => category.id === categoryId\n );\n return category ? [category] : [];\n },\n useHook: ({ useData }) => (input) => {\n const response = useData({\n input: [[\"categoryId\", input?.categoryId]],\n swrOptions: { revalidateOnFocus: false, ...input?.swrOptions },\n });\n return React.useMemo(\n () =>\n Object.create(response, {\n isEmpty: {\n get() {\n return (response.data?.length ?? 0) <= 0;\n },\n enumerable: true,\n },\n }),\n [response]\n );\n },\n};\n","import { SWRHook, useBrands, UseBrands } from \"@plasmicpkgs/commerce\";\nimport React from \"react\";\nimport data from \"../data.json\";\nexport default useBrands as UseBrands<typeof handler>;\n\nexport const handler: SWRHook<any> = {\n fetchOptions: {\n query: \"use-brands\",\n },\n async fetcher({ input, options, fetch }) {\n const vendorsStrings = data.products.map((product) => product.vendor);\n return Array.from(new Set(vendorsStrings).values()).map((v) => {\n const id = v.replace(/\\s+/g, \"-\").toLowerCase();\n return {\n entityId: id,\n name: v,\n path: `brands/${id}`,\n };\n });\n },\n useHook: ({ useData }) => (input) => {\n const response = useData({\n swrOptions: { revalidateOnFocus: false, ...input?.swrOptions },\n });\n return React.useMemo(\n () =>\n Object.create(response, {\n isEmpty: {\n get() {\n return (response.data?.length ?? 0) <= 0;\n },\n enumerable: true,\n },\n }),\n [response]\n );\n },\n};\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes: Removed authentication, customer and wishlist hooks\n*/\nimport { fetcher } from './fetcher'\nimport { handler as useCart } from './cart/use-cart'\nimport { handler as useAddItem } from './cart/use-add-item'\nimport { handler as useUpdateItem } from './cart/use-update-item'\nimport { handler as useRemoveItem } from './cart/use-remove-item'\nimport { handler as useSearch } from './product/use-search'\nimport { handler as useProduct } from './product/use-product'\nimport { handler as useCategories } from './site/use-categories'\nimport { handler as useBrands } from './site/use-brands'\nimport { LOCAL_CART_ID } from './const'\nexport const localProvider = {\n locale: 'en-us',\n cartCookie: LOCAL_CART_ID,\n fetcher: fetcher,\n cart: { useCart, useAddItem, useUpdateItem, useRemoveItem },\n products: { useSearch, useProduct },\n site: { useCategories, useBrands }\n}\n\nexport type LocalProvider = typeof localProvider\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes: Add export data\n*/\nexport * from \"./registerable\";\nexport { localProvider, data };\nexport type { LocalProvider };\nimport {\n getCommerceProvider,\n useCommerce as useCoreCommerce,\n} from \"@plasmicpkgs/commerce\";\nimport data from \"./data.json\";\nimport { localProvider, LocalProvider } from \"./provider\";\n\nexport const CommerceProvider = getCommerceProvider(localProvider);\n\nexport const useCommerce = () => useCoreCommerce<LocalProvider>();\n","import { GlobalContextMeta } from \"@plasmicapp/host\";\nimport registerGlobalContext from \"@plasmicapp/host/registerGlobalContext\";\nimport React from \"react\";\nimport { CommerceProvider } from \"./local\";\nimport { Registerable } from \"./registerable\";\n\ninterface CommerceProviderProps {\n children?: React.ReactNode;\n}\n\nexport const commerceProviderMeta: GlobalContextMeta<CommerceProviderProps> = {\n name: \"plasmic-commerce-local-provider\",\n displayName: \"Local Provider\",\n props: {},\n importPath: \"@plasmicpkgs/commerce-local\",\n importName: \"CommerceProviderComponent\",\n};\n\nfunction CommerceProviderComponent(props: CommerceProviderProps) {\n return <CommerceProvider>{props.children}</CommerceProvider>;\n}\n\nexport function registerCommerceProvider(\n loader?: Registerable,\n customCommerceProviderMeta?: GlobalContextMeta<CommerceProviderProps>\n) {\n const doRegisterComponent: typeof registerGlobalContext = (...args) =>\n loader\n ? loader.registerGlobalContext(...args)\n : registerGlobalContext(...args);\n doRegisterComponent(\n CommerceProviderComponent,\n customCommerceProviderMeta ?? commerceProviderMeta\n );\n}\n","import { Registerable } from \"./registerable\";\nimport { registerCommerceProvider } from \"./registerCommerceProvider\";\nexport * from \"./registerable\";\n\nexport * from \"./local\";\n\nexport function registerAll(loader?: Registerable) {\n registerCommerceProvider(loader);\n}\n\nexport { registerCommerceProvider };"],"names":["fetcher","_ref","_asyncToGenerator","_regeneratorRuntime","mark","_callee","res","_yield$res$json","data","wrap","_callee$","_context","prev","next","console","log","fetch","sent","ok","json","abrupt","stop","apply","arguments","LOCAL_CART_OBJ","LOCAL_CART_ID","createCart","cart","id","createdAt","currency","code","taxesIncluded","lineItems","lineItemsSubtotalPrice","subtotalPrice","totalPrice","cartId","Date","now","toString","Cookies","set","JSON","stringify","getCart","_cartId","get","cartStr","parse","undefined","cartUpdate","newCart","handler","fetchOptions","query","input","options","useHook","_ref2","useData","response","swrOptions","_extends","revalidateOnFocus","React","useMemo","Object","create","isEmpty","_response$data$lineIt","_response$data","length","enumerable","item","quantity","Number","isInteger","CommerceError","message","lineItem","variantId","_item$quantity","_iterator","_createForOfIteratorHelperLoose","products","_step","done","product","value","variant","variants","find","price","_item$quantity2","currencyCode","currentLineItem","push","_useCart","useCart","mutate","useCallback","_addItem","_callee2","_callee2$","_context2","addItem","_x","_removeItem","removeItem","sortProduct","a","b","sortKey","localeCompare","search","categoryId","brandId","sort","count","category","categories","filter","_category$products","includes","vendor","replace","toLowerCase","name","slug","slice","found","prefixSearch","locale","_data$products$find","_response$data$length","vendorsStrings","map","Array","from","Set","values","v","entityId","path","localProvider","cartCookie","useAddItem","useUpdateItem","useRemoveItem","useSearch","useProduct","site","useCategories","useBrands","CommerceProvider","getCommerceProvider","useCommerce","useCoreCommerce","commerceProviderMeta","displayName","props","importPath","importName","CommerceProviderComponent","children","registerCommerceProvider","loader","customCommerceProviderMeta","doRegisterComponent","registerGlobalContext","registerAll"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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EAAE;CACb;AAED,SAASC,yBAAyBA,CAACH,KAA4B;EAC7D,OAAOhG,6BAAC0F,gBAAgB,QAAEM,KAAK,CAACI,QAAQ,CAAoB;AAC9D;AAEA,SAAgBC,wBAAwBA,CACtCC,MAAqB,EACrBC,0BAAqE;EAErE,IAAMC,mBAAmB,GAAiC,SAApDA,mBAAmBA;IAAA,OACvBF,MAAM,GACFA,MAAM,CAACG,qBAAqB,CAAApJ,KAAA,CAA5BiJ,MAAM,EAAAhJ,SAA8B,CAAC,GACrCmJ,qBAAqB,CAAApJ,KAAA,SAAAC,SAAQ,CAAC;;EACpCkJ,mBAAmB,CACjBL,yBAAyB,EACzBI,0BAA0B,WAA1BA,0BAA0B,GAAIT,oBAAoB,CACnD;AACH;;SC5BgBY,WAAWA,CAACJ,MAAqB;EAC/CD,wBAAwB,CAACC,MAAM,CAAC;AAClC;;;;;;;;;"}
|
|
@@ -2604,7 +2604,7 @@ function _createForOfIteratorHelperLoose(o, allowArrayLike) {
|
|
|
2604
2604
|
}
|
|
2605
2605
|
|
|
2606
2606
|
var fetcher = /*#__PURE__*/function () {
|
|
2607
|
-
var _ref = /*#__PURE__*/_asyncToGenerator(
|
|
2607
|
+
var _ref = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
2608
2608
|
var res, _yield$res$json, data;
|
|
2609
2609
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
2610
2610
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -2685,7 +2685,7 @@ var handler = {
|
|
|
2685
2685
|
query: "use-cart"
|
|
2686
2686
|
},
|
|
2687
2687
|
fetcher: function fetcher(_ref) {
|
|
2688
|
-
return _asyncToGenerator(
|
|
2688
|
+
return _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
2689
2689
|
var input, fetch;
|
|
2690
2690
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
2691
2691
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -2727,7 +2727,7 @@ var handler$1 = {
|
|
|
2727
2727
|
query: "use-add-item"
|
|
2728
2728
|
},
|
|
2729
2729
|
fetcher: function fetcher(_ref) {
|
|
2730
|
-
return _asyncToGenerator(
|
|
2730
|
+
return _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
2731
2731
|
var _item$quantity;
|
|
2732
2732
|
var item, fetch, lineItem, cart, _iterator, _step, product, variant, _item$quantity2, currentLineItem;
|
|
2733
2733
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
@@ -2778,8 +2778,8 @@ var handler$1 = {
|
|
|
2778
2778
|
return function () {
|
|
2779
2779
|
var _useCart = useCart(),
|
|
2780
2780
|
mutate = _useCart.mutate;
|
|
2781
|
-
return useCallback(
|
|
2782
|
-
var _addItem = _asyncToGenerator(
|
|
2781
|
+
return useCallback(/*#__PURE__*/function () {
|
|
2782
|
+
var _addItem = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(input) {
|
|
2783
2783
|
var data;
|
|
2784
2784
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
2785
2785
|
while (1) switch (_context2.prev = _context2.next) {
|
|
@@ -2814,7 +2814,7 @@ var handler$2 = {
|
|
|
2814
2814
|
query: ''
|
|
2815
2815
|
},
|
|
2816
2816
|
fetcher: function fetcher(_ref) {
|
|
2817
|
-
return _asyncToGenerator(
|
|
2817
|
+
return _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
2818
2818
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
2819
2819
|
while (1) switch (_context.prev = _context.next) {
|
|
2820
2820
|
case 0:
|
|
@@ -2828,7 +2828,7 @@ var handler$2 = {
|
|
|
2828
2828
|
useHook: function useHook(_ref2) {
|
|
2829
2829
|
return function () {
|
|
2830
2830
|
return /*#__PURE__*/function () {
|
|
2831
|
-
var _addItem = _asyncToGenerator(
|
|
2831
|
+
var _addItem = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
2832
2832
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
2833
2833
|
while (1) switch (_context2.prev = _context2.next) {
|
|
2834
2834
|
case 0:
|
|
@@ -2853,7 +2853,7 @@ var handler$3 = {
|
|
|
2853
2853
|
query: ''
|
|
2854
2854
|
},
|
|
2855
2855
|
fetcher: function fetcher(_ref) {
|
|
2856
|
-
return _asyncToGenerator(
|
|
2856
|
+
return _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
2857
2857
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
2858
2858
|
while (1) switch (_context.prev = _context.next) {
|
|
2859
2859
|
case 0:
|
|
@@ -2867,7 +2867,7 @@ var handler$3 = {
|
|
|
2867
2867
|
useHook: function useHook(_ref2) {
|
|
2868
2868
|
return function () {
|
|
2869
2869
|
return /*#__PURE__*/function () {
|
|
2870
|
-
var _removeItem = _asyncToGenerator(
|
|
2870
|
+
var _removeItem = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(input) {
|
|
2871
2871
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
2872
2872
|
while (1) switch (_context2.prev = _context2.next) {
|
|
2873
2873
|
case 0:
|
|
@@ -2907,7 +2907,7 @@ var handler$4 = {
|
|
|
2907
2907
|
query: "use-search"
|
|
2908
2908
|
},
|
|
2909
2909
|
fetcher: function fetcher(_ref) {
|
|
2910
|
-
return _asyncToGenerator(
|
|
2910
|
+
return _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
2911
2911
|
var input, fetch, search, categoryId, brandId, sort, count, products, category;
|
|
2912
2912
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
2913
2913
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -2971,7 +2971,7 @@ var handler$5 = {
|
|
|
2971
2971
|
query: "use-product"
|
|
2972
2972
|
},
|
|
2973
2973
|
fetcher: function fetcher(_ref) {
|
|
2974
|
-
return _asyncToGenerator(
|
|
2974
|
+
return _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
2975
2975
|
var _data$products$find;
|
|
2976
2976
|
var input, fetch, id;
|
|
2977
2977
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
@@ -3010,7 +3010,7 @@ var handler$6 = {
|
|
|
3010
3010
|
query: "use-categories"
|
|
3011
3011
|
},
|
|
3012
3012
|
fetcher: function fetcher(_ref) {
|
|
3013
|
-
return _asyncToGenerator(
|
|
3013
|
+
return _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
3014
3014
|
var input, fetch, categoryId, category;
|
|
3015
3015
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
3016
3016
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -3063,7 +3063,7 @@ var handler$7 = {
|
|
|
3063
3063
|
query: "use-brands"
|
|
3064
3064
|
},
|
|
3065
3065
|
fetcher: function fetcher(_ref) {
|
|
3066
|
-
return _asyncToGenerator(
|
|
3066
|
+
return _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
3067
3067
|
var vendorsStrings;
|
|
3068
3068
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
3069
3069
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commerce-local.esm.js","sources":["../src/fetcher.ts","../src/const.ts","../src/utils/cart.ts","../src/cart/use-cart.tsx","../src/cart/use-add-item.tsx","../src/cart/use-update-item.tsx","../src/cart/use-remove-item.tsx","../src/utils/sort-product.ts","../src/product/use-search.tsx","../src/product/use-product.tsx","../src/site/use-categories.ts","../src/site/use-brands.ts","../src/provider.ts","../src/local.ts","../src/registerCommerceProvider.tsx","../src/index.tsx"],"sourcesContent":["import { Fetcher } from '@plasmicpkgs/commerce';\n\nexport const fetcher: Fetcher = async () => {\n console.log('FETCHER')\n const res = await fetch('./data.json')\n if (res.ok) {\n const { data } = await res.json()\n return data\n }\n throw res\n}\n","export const LOCAL_CART_OBJ = \"localCartObj\";\n\nexport const LOCAL_CART_ID = \"localCartId\";\n","import { CartType } from \"@plasmicpkgs/commerce\";\nimport Cookies from \"js-cookie\";\nimport { LOCAL_CART_ID, LOCAL_CART_OBJ } from \"../const\";\n\nconst options: Cookies.CookieAttributes = {\n sameSite: \"none\",\n secure: true,\n};\n\nexport const createCart: () => CartType.Cart = () => {\n const cart = {\n id: \"\",\n createdAt: \"\",\n currency: { code: \"USD\" },\n taxesIncluded: false,\n lineItems: [],\n lineItemsSubtotalPrice: 0,\n subtotalPrice: 0,\n totalPrice: 0,\n };\n\n const cartId = Date.now().toString();\n\n Cookies.set(LOCAL_CART_ID, cartId);\n Cookies.set(\n LOCAL_CART_OBJ,\n JSON.stringify({\n id: cartId,\n cart,\n })\n );\n\n return cart;\n};\n\nexport const getCart: (cartId?: string) => CartType.Cart = (\n cartId?: string\n) => {\n cartId = cartId ?? Cookies.get(LOCAL_CART_ID);\n const cartStr = Cookies.get(LOCAL_CART_OBJ);\n const cart = cartStr ? JSON.parse(cartStr) : undefined;\n\n if (!cart || cart.id !== cartId) {\n return createCart();\n } else {\n return cart.cart;\n }\n};\n\nexport const cartUpdate = (newCart: CartType.Cart) => {\n Cookies.set(\n LOCAL_CART_OBJ,\n JSON.stringify({\n id: Cookies.get(LOCAL_CART_ID),\n cart: newCart,\n })\n );\n\n return newCart;\n};\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes:\n - Before: just returned an empty cart.\n - Now: Read cart from local storage.\n*/\nimport { SWRHook, useCart, UseCart } from \"@plasmicpkgs/commerce\";\nimport React from \"react\";\nimport { getCart } from \"../utils/cart\";\n\nexport default useCart as UseCart<typeof handler>;\n\nexport const handler: SWRHook<any> = {\n fetchOptions: {\n query: \"use-cart\",\n },\n async fetcher({ input, options, fetch }) {\n return getCart(input.cartId);\n },\n useHook: ({ useData }) => (input) => {\n const response = useData({\n swrOptions: { revalidateOnFocus: false, ...input?.swrOptions },\n });\n return React.useMemo(\n () =>\n Object.create(response, {\n isEmpty: {\n get() {\n return (response.data?.lineItems.length ?? 0) <= 0;\n },\n enumerable: true,\n },\n }),\n [response]\n );\n },\n};\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes:\n - Implemented a local cart\n - The items are added to local storage.\n*/\nimport {\n CommerceError,\n MutationHook,\n useAddItem,\n UseAddItem,\n} from \"@plasmicpkgs/commerce\";\nimport { useCallback } from \"react\";\nimport data from \"../data.json\";\nimport { cartUpdate, getCart } from \"../utils/cart\";\nimport useCart from \"./use-cart\";\n\nexport default useAddItem as UseAddItem<typeof handler>;\nexport const handler: MutationHook<any> = {\n fetchOptions: {\n query: \"use-add-item\",\n },\n async fetcher({ input: item, options, fetch }) {\n if (\n item.quantity &&\n (!Number.isInteger(item.quantity) || item.quantity! < 1)\n ) {\n throw new CommerceError({\n message: \"The item quantity has to be a valid integer greater than 0\",\n });\n }\n\n const lineItem = {\n variantId: item.variantId,\n quantity: item.quantity ?? 1,\n };\n\n const cart = getCart();\n for (const product of data.products) {\n const variant = (product.variants as any[]).find(\n (variant) => variant.id === item.variantId\n );\n if (variant) {\n cart.totalPrice += variant.price * (item.quantity ?? 1);\n cart.currency.code = product.price.currencyCode;\n const currentLineItem = cart.lineItems.find(\n (item) => item.variantId === lineItem.variantId\n );\n if (!currentLineItem) {\n cart.lineItems.push(lineItem as any);\n } else {\n currentLineItem.quantity += lineItem.quantity;\n }\n }\n }\n\n return cartUpdate(cart);\n },\n useHook: ({ fetch }) => () => {\n const { mutate } = useCart();\n return useCallback(\n async function addItem(input) {\n const data = await fetch({ input });\n await mutate(data, false);\n return data;\n },\n [fetch, mutate]\n );\n },\n};\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes: None\n*/\nimport { MutationHook } from '@plasmicpkgs/commerce'\nimport { useUpdateItem,\n UseUpdateItem,\n} from '@plasmicpkgs/commerce'\n\nexport default useUpdateItem as UseUpdateItem<any>\n\nexport const handler: MutationHook<any> = {\n fetchOptions: {\n query: '',\n },\n async fetcher({ input, options, fetch }) {},\n useHook:\n ({ fetch }) =>\n () => {\n return async function addItem() {\n return {}\n }\n },\n}\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes: None\n*/\nimport { MutationHook } from '@plasmicpkgs/commerce'\nimport {useRemoveItem,\n UseRemoveItem,\n} from '@plasmicpkgs/commerce'\n\nexport default useRemoveItem as UseRemoveItem<typeof handler>\n\nexport const handler: MutationHook<any> = {\n fetchOptions: {\n query: '',\n },\n async fetcher({ input, options, fetch }) {},\n useHook:\n ({ fetch }) =>\n () => {\n return async function removeItem(input) {\n return {}\n }\n },\n}\n","import data from \"../data.json\";\n\nexport const sortProduct = (\n a: typeof data.products[0],\n b: typeof data.products[0],\n sortKey: string\n) => {\n switch (sortKey) {\n case \"price-asc\":\n return a.price.value < b.price.value ? -1 : 1;\n case \"price-desc\":\n return a.price.value < b.price.value ? 1 : -1;\n case \"trending-desc\":\n return a.id.localeCompare(b.id);\n case \"latest-desc\":\n return a.id.localeCompare(b.id) * -1;\n default:\n return 0;\n }\n};\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes: None\n*/\nimport { SWRHook, useSearch, UseSearch } from \"@plasmicpkgs/commerce\";\nimport data from \"../data.json\";\nimport { sortProduct } from \"../utils/sort-product\";\nconst useSearchTyped: UseSearch<typeof handler> = useSearch;\nexport default useSearchTyped;\n\nexport const handler: SWRHook<any> = {\n fetchOptions: {\n query: \"use-search\",\n },\n async fetcher({ input, options, fetch }) {\n const { search, categoryId, brandId, sort, count } = input;\n\n let products = data.products;\n\n if (categoryId) {\n const category = data.categories.find(\n (category) => category.id === categoryId\n );\n products = data.products.filter((product) =>\n category?.products?.includes(product.id)\n );\n }\n\n if (brandId) {\n products = products.filter(\n (product) =>\n product.vendor.replace(/\\s+/g, \"-\").toLowerCase() ===\n `${brandId}`.toLowerCase()\n );\n }\n\n if (search) {\n products = products.filter(\n (product) =>\n product.name.toLowerCase().includes(`${search}`.toLowerCase()) ||\n product.slug.toLowerCase().includes(`${search}`.toLowerCase())\n );\n }\n\n if (sort) {\n products = products.sort((a, b) => sortProduct(a, b, sort));\n }\n\n return {\n products: products.slice(0, count),\n found: products.length > 0,\n };\n },\n useHook:\n ({ useData }) =>\n (input = {}) => {\n return useData({\n input: [\n [\"search\", input.search],\n [\"prefixSearch\", input.prefixSearch],\n [\"categoryId\", input.categoryId],\n [\"brandId\", input.brandId],\n [\"sort\", input.sort],\n [\"locale\", input.locale],\n [\"count\", input.count],\n ],\n swrOptions: {\n revalidateOnFocus: false,\n ...input.swrOptions,\n },\n });\n },\n};\n","import { SWRHook, useProduct, UseProduct } from \"@plasmicpkgs/commerce\";\nimport data from \"../data.json\";\nexport default useProduct as UseProduct<typeof handler>;\n\nexport const handler: SWRHook<any> = {\n fetchOptions: {\n query: \"use-product\",\n },\n async fetcher({ input, options, fetch }) {\n const { id } = input;\n\n return (\n data.products.find((product) =>\n [product.id, product.slug].includes(id)\n ) ?? null\n );\n },\n useHook: ({ useData }) => (input = {}) => {\n return useData({\n input: [[\"id\", input.id]],\n swrOptions: {\n revalidateOnFocus: false,\n ...input.swrOptions,\n },\n });\n },\n};\n","import { SWRHook, useCategories, UseCategories } from \"@plasmicpkgs/commerce\";\nimport React from \"react\";\nimport data from \"../data.json\";\nexport default useCategories as UseCategories<typeof handler>;\n\nexport const handler: SWRHook<any> = {\n fetchOptions: {\n query: \"use-categories\",\n },\n async fetcher({ input, options, fetch }) {\n const { categoryId } = input;\n if (!categoryId) {\n return data.categories;\n }\n const category = data.categories.find(\n (category) => category.id === categoryId\n );\n return category ? [category] : [];\n },\n useHook: ({ useData }) => (input) => {\n const response = useData({\n input: [[\"categoryId\", input?.categoryId]],\n swrOptions: { revalidateOnFocus: false, ...input?.swrOptions },\n });\n return React.useMemo(\n () =>\n Object.create(response, {\n isEmpty: {\n get() {\n return (response.data?.length ?? 0) <= 0;\n },\n enumerable: true,\n },\n }),\n [response]\n );\n },\n};\n","import { SWRHook, useBrands, UseBrands } from \"@plasmicpkgs/commerce\";\nimport React from \"react\";\nimport data from \"../data.json\";\nexport default useBrands as UseBrands<typeof handler>;\n\nexport const handler: SWRHook<any> = {\n fetchOptions: {\n query: \"use-brands\",\n },\n async fetcher({ input, options, fetch }) {\n const vendorsStrings = data.products.map((product) => product.vendor);\n return Array.from(new Set(vendorsStrings).values()).map((v) => {\n const id = v.replace(/\\s+/g, \"-\").toLowerCase();\n return {\n entityId: id,\n name: v,\n path: `brands/${id}`,\n };\n });\n },\n useHook: ({ useData }) => (input) => {\n const response = useData({\n swrOptions: { revalidateOnFocus: false, ...input?.swrOptions },\n });\n return React.useMemo(\n () =>\n Object.create(response, {\n isEmpty: {\n get() {\n return (response.data?.length ?? 0) <= 0;\n },\n enumerable: true,\n },\n }),\n [response]\n );\n },\n};\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes: Removed authentication, customer and wishlist hooks\n*/\nimport { fetcher } from './fetcher'\nimport { handler as useCart } from './cart/use-cart'\nimport { handler as useAddItem } from './cart/use-add-item'\nimport { handler as useUpdateItem } from './cart/use-update-item'\nimport { handler as useRemoveItem } from './cart/use-remove-item'\nimport { handler as useSearch } from './product/use-search'\nimport { handler as useProduct } from './product/use-product'\nimport { handler as useCategories } from './site/use-categories'\nimport { handler as useBrands } from './site/use-brands'\nimport { LOCAL_CART_ID } from './const'\nexport const localProvider = {\n locale: 'en-us',\n cartCookie: LOCAL_CART_ID,\n fetcher: fetcher,\n cart: { useCart, useAddItem, useUpdateItem, useRemoveItem },\n products: { useSearch, useProduct },\n site: { useCategories, useBrands }\n}\n\nexport type LocalProvider = typeof localProvider\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes: Add export data\n*/\nexport * from \"./registerable\";\nexport { localProvider, data };\nexport type { LocalProvider };\nimport {\n getCommerceProvider,\n useCommerce as useCoreCommerce,\n} from \"@plasmicpkgs/commerce\";\nimport data from \"./data.json\";\nimport { localProvider, LocalProvider } from \"./provider\";\n\nexport const CommerceProvider = getCommerceProvider(localProvider);\n\nexport const useCommerce = () => useCoreCommerce<LocalProvider>();\n","import { GlobalContextMeta } from \"@plasmicapp/host\";\nimport registerGlobalContext from \"@plasmicapp/host/registerGlobalContext\";\nimport React from \"react\";\nimport { CommerceProvider } from \"./local\";\nimport { Registerable } from \"./registerable\";\n\ninterface CommerceProviderProps {\n children?: React.ReactNode;\n}\n\nexport const commerceProviderMeta: GlobalContextMeta<CommerceProviderProps> = {\n name: \"plasmic-commerce-local-provider\",\n displayName: \"Local Provider\",\n props: {},\n importPath: \"@plasmicpkgs/commerce-local\",\n importName: \"CommerceProviderComponent\",\n};\n\nfunction CommerceProviderComponent(props: CommerceProviderProps) {\n return <CommerceProvider>{props.children}</CommerceProvider>;\n}\n\nexport function registerCommerceProvider(\n loader?: Registerable,\n customCommerceProviderMeta?: GlobalContextMeta<CommerceProviderProps>\n) {\n const doRegisterComponent: typeof registerGlobalContext = (...args) =>\n loader\n ? loader.registerGlobalContext(...args)\n : registerGlobalContext(...args);\n doRegisterComponent(\n CommerceProviderComponent,\n customCommerceProviderMeta ?? commerceProviderMeta\n );\n}\n","import { Registerable } from \"./registerable\";\nimport { registerCommerceProvider } from \"./registerCommerceProvider\";\nexport * from \"./registerable\";\n\nexport * from \"./local\";\n\nexport function registerAll(loader?: Registerable) {\n registerCommerceProvider(loader);\n}\n\nexport { registerCommerceProvider };"],"names":["fetcher","_ref","_asyncToGenerator","_regeneratorRuntime","mark","_callee","res","_yield$res$json","data","wrap","_callee$","_context","prev","next","console","log","fetch","sent","ok","json","abrupt","stop","apply","arguments","LOCAL_CART_OBJ","LOCAL_CART_ID","createCart","cart","id","createdAt","currency","code","taxesIncluded","lineItems","lineItemsSubtotalPrice","subtotalPrice","totalPrice","cartId","Date","now","toString","Cookies","set","JSON","stringify","getCart","_cartId","get","cartStr","parse","undefined","cartUpdate","newCart","handler","fetchOptions","query","input","options","useHook","_ref2","useData","response","swrOptions","_extends","revalidateOnFocus","React","useMemo","Object","create","isEmpty","_response$data$lineIt","_response$data","length","enumerable","item","quantity","Number","isInteger","CommerceError","message","lineItem","variantId","_item$quantity","_iterator","_createForOfIteratorHelperLoose","products","_step","done","product","value","variant","variants","find","price","_item$quantity2","currencyCode","currentLineItem","push","_useCart","useCart","mutate","useCallback","_addItem","_callee2","_callee2$","_context2","addItem","_x","_removeItem","removeItem","sortProduct","a","b","sortKey","localeCompare","search","categoryId","brandId","sort","count","category","categories","filter","_category$products","includes","vendor","replace","toLowerCase","name","slug","slice","found","prefixSearch","locale","_data$products$find","_response$data$length","vendorsStrings","map","Array","from","Set","values","v","entityId","path","localProvider","cartCookie","useAddItem","useUpdateItem","useRemoveItem","useSearch","useProduct","site","useCategories","useBrands","CommerceProvider","getCommerceProvider","useCommerce","useCoreCommerce","commerceProviderMeta","displayName","props","importPath","importName","CommerceProviderComponent","children","registerCommerceProvider","loader","customCommerceProviderMeta","doRegisterComponent","registerGlobalContext","registerAll"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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FA,MAAM,CAACG,qBAAqB,CAAApJ,KAAA,CAA5BiJ,MAAM,EAAAhJ,SAA8B,CAAC,GACrCmJ,qBAAqB,CAAApJ,KAAA,SAAAC,SAAQ,CAAC;;EACpCkJ,mBAAmB,CACjBL,yBAAyB,EACzBI,0BAA0B,WAA1BA,0BAA0B,GAAIT,oBAAoB,CACnD;AACH;;SC5BgBY,WAAWA,CAACJ,MAAqB;EAC/CD,wBAAwB,CAACC,MAAM,CAAC;AAClC;;;;"}
|
|
1
|
+
{"version":3,"file":"commerce-local.esm.js","sources":["../src/fetcher.ts","../src/const.ts","../src/utils/cart.ts","../src/cart/use-cart.tsx","../src/cart/use-add-item.tsx","../src/cart/use-update-item.tsx","../src/cart/use-remove-item.tsx","../src/utils/sort-product.ts","../src/product/use-search.tsx","../src/product/use-product.tsx","../src/site/use-categories.ts","../src/site/use-brands.ts","../src/provider.ts","../src/local.ts","../src/registerCommerceProvider.tsx","../src/index.tsx"],"sourcesContent":["import { Fetcher } from '@plasmicpkgs/commerce';\n\nexport const fetcher: Fetcher = async () => {\n console.log('FETCHER')\n const res = await fetch('./data.json')\n if (res.ok) {\n const { data } = await res.json()\n return data\n }\n throw res\n}\n","export const LOCAL_CART_OBJ = \"localCartObj\";\n\nexport const LOCAL_CART_ID = \"localCartId\";\n","import { CartType } from \"@plasmicpkgs/commerce\";\nimport Cookies from \"js-cookie\";\nimport { LOCAL_CART_ID, LOCAL_CART_OBJ } from \"../const\";\n\nconst options: Cookies.CookieAttributes = {\n sameSite: \"none\",\n secure: true,\n};\n\nexport const createCart: () => CartType.Cart = () => {\n const cart = {\n id: \"\",\n createdAt: \"\",\n currency: { code: \"USD\" },\n taxesIncluded: false,\n lineItems: [],\n lineItemsSubtotalPrice: 0,\n subtotalPrice: 0,\n totalPrice: 0,\n };\n\n const cartId = Date.now().toString();\n\n Cookies.set(LOCAL_CART_ID, cartId);\n Cookies.set(\n LOCAL_CART_OBJ,\n JSON.stringify({\n id: cartId,\n cart,\n })\n );\n\n return cart;\n};\n\nexport const getCart: (cartId?: string) => CartType.Cart = (\n cartId?: string\n) => {\n cartId = cartId ?? Cookies.get(LOCAL_CART_ID);\n const cartStr = Cookies.get(LOCAL_CART_OBJ);\n const cart = cartStr ? JSON.parse(cartStr) : undefined;\n\n if (!cart || cart.id !== cartId) {\n return createCart();\n } else {\n return cart.cart;\n }\n};\n\nexport const cartUpdate = (newCart: CartType.Cart) => {\n Cookies.set(\n LOCAL_CART_OBJ,\n JSON.stringify({\n id: Cookies.get(LOCAL_CART_ID),\n cart: newCart,\n })\n );\n\n return newCart;\n};\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes:\n - Before: just returned an empty cart.\n - Now: Read cart from local storage.\n*/\nimport { SWRHook, useCart, UseCart } from \"@plasmicpkgs/commerce\";\nimport React from \"react\";\nimport { getCart } from \"../utils/cart\";\n\nexport default useCart as UseCart<typeof handler>;\n\nexport const handler: SWRHook<any> = {\n fetchOptions: {\n query: \"use-cart\",\n },\n async fetcher({ input, options, fetch }) {\n return getCart(input.cartId);\n },\n useHook: ({ useData }) => (input) => {\n const response = useData({\n swrOptions: { revalidateOnFocus: false, ...input?.swrOptions },\n });\n return React.useMemo(\n () =>\n Object.create(response, {\n isEmpty: {\n get() {\n return (response.data?.lineItems.length ?? 0) <= 0;\n },\n enumerable: true,\n },\n }),\n [response]\n );\n },\n};\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes:\n - Implemented a local cart\n - The items are added to local storage.\n*/\nimport {\n CommerceError,\n MutationHook,\n useAddItem,\n UseAddItem,\n} from \"@plasmicpkgs/commerce\";\nimport { useCallback } from \"react\";\nimport data from \"../data.json\";\nimport { cartUpdate, getCart } from \"../utils/cart\";\nimport useCart from \"./use-cart\";\n\nexport default useAddItem as UseAddItem<typeof handler>;\nexport const handler: MutationHook<any> = {\n fetchOptions: {\n query: \"use-add-item\",\n },\n async fetcher({ input: item, options, fetch }) {\n if (\n item.quantity &&\n (!Number.isInteger(item.quantity) || item.quantity! < 1)\n ) {\n throw new CommerceError({\n message: \"The item quantity has to be a valid integer greater than 0\",\n });\n }\n\n const lineItem = {\n variantId: item.variantId,\n quantity: item.quantity ?? 1,\n };\n\n const cart = getCart();\n for (const product of data.products) {\n const variant = (product.variants as any[]).find(\n (variant) => variant.id === item.variantId\n );\n if (variant) {\n cart.totalPrice += variant.price * (item.quantity ?? 1);\n cart.currency.code = product.price.currencyCode;\n const currentLineItem = cart.lineItems.find(\n (item) => item.variantId === lineItem.variantId\n );\n if (!currentLineItem) {\n cart.lineItems.push(lineItem as any);\n } else {\n currentLineItem.quantity += lineItem.quantity;\n }\n }\n }\n\n return cartUpdate(cart);\n },\n useHook: ({ fetch }) => () => {\n const { mutate } = useCart();\n return useCallback(\n async function addItem(input) {\n const data = await fetch({ input });\n await mutate(data, false);\n return data;\n },\n [fetch, mutate]\n );\n },\n};\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes: None\n*/\nimport { MutationHook } from '@plasmicpkgs/commerce'\nimport { useUpdateItem,\n UseUpdateItem,\n} from '@plasmicpkgs/commerce'\n\nexport default useUpdateItem as UseUpdateItem<any>\n\nexport const handler: MutationHook<any> = {\n fetchOptions: {\n query: '',\n },\n async fetcher({ input, options, fetch }) {},\n useHook:\n ({ fetch }) =>\n () => {\n return async function addItem() {\n return {}\n }\n },\n}\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes: None\n*/\nimport { MutationHook } from '@plasmicpkgs/commerce'\nimport {useRemoveItem,\n UseRemoveItem,\n} from '@plasmicpkgs/commerce'\n\nexport default useRemoveItem as UseRemoveItem<typeof handler>\n\nexport const handler: MutationHook<any> = {\n fetchOptions: {\n query: '',\n },\n async fetcher({ input, options, fetch }) {},\n useHook:\n ({ fetch }) =>\n () => {\n return async function removeItem(input) {\n return {}\n }\n },\n}\n","import data from \"../data.json\";\n\nexport const sortProduct = (\n a: typeof data.products[0],\n b: typeof data.products[0],\n sortKey: string\n) => {\n switch (sortKey) {\n case \"price-asc\":\n return a.price.value < b.price.value ? -1 : 1;\n case \"price-desc\":\n return a.price.value < b.price.value ? 1 : -1;\n case \"trending-desc\":\n return a.id.localeCompare(b.id);\n case \"latest-desc\":\n return a.id.localeCompare(b.id) * -1;\n default:\n return 0;\n }\n};\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes: None\n*/\nimport { SWRHook, useSearch, UseSearch } from \"@plasmicpkgs/commerce\";\nimport data from \"../data.json\";\nimport { sortProduct } from \"../utils/sort-product\";\nconst useSearchTyped: UseSearch<typeof handler> = useSearch;\nexport default useSearchTyped;\n\nexport const handler: SWRHook<any> = {\n fetchOptions: {\n query: \"use-search\",\n },\n async fetcher({ input, options, fetch }) {\n const { search, categoryId, brandId, sort, count } = input;\n\n let products = data.products;\n\n if (categoryId) {\n const category = data.categories.find(\n (category) => category.id === categoryId\n );\n products = data.products.filter((product) =>\n category?.products?.includes(product.id)\n );\n }\n\n if (brandId) {\n products = products.filter(\n (product) =>\n product.vendor.replace(/\\s+/g, \"-\").toLowerCase() ===\n `${brandId}`.toLowerCase()\n );\n }\n\n if (search) {\n products = products.filter(\n (product) =>\n product.name.toLowerCase().includes(`${search}`.toLowerCase()) ||\n product.slug.toLowerCase().includes(`${search}`.toLowerCase())\n );\n }\n\n if (sort) {\n products = products.sort((a, b) => sortProduct(a, b, sort));\n }\n\n return {\n products: products.slice(0, count),\n found: products.length > 0,\n };\n },\n useHook:\n ({ useData }) =>\n (input = {}) => {\n return useData({\n input: [\n [\"search\", input.search],\n [\"prefixSearch\", input.prefixSearch],\n [\"categoryId\", input.categoryId],\n [\"brandId\", input.brandId],\n [\"sort\", input.sort],\n [\"locale\", input.locale],\n [\"count\", input.count],\n ],\n swrOptions: {\n revalidateOnFocus: false,\n ...input.swrOptions,\n },\n });\n },\n};\n","import { SWRHook, useProduct, UseProduct } from \"@plasmicpkgs/commerce\";\nimport data from \"../data.json\";\nexport default useProduct as UseProduct<typeof handler>;\n\nexport const handler: SWRHook<any> = {\n fetchOptions: {\n query: \"use-product\",\n },\n async fetcher({ input, options, fetch }) {\n const { id } = input;\n\n return (\n data.products.find((product) =>\n [product.id, product.slug].includes(id)\n ) ?? null\n );\n },\n useHook: ({ useData }) => (input = {}) => {\n return useData({\n input: [[\"id\", input.id]],\n swrOptions: {\n revalidateOnFocus: false,\n ...input.swrOptions,\n },\n });\n },\n};\n","import { SWRHook, useCategories, UseCategories } from \"@plasmicpkgs/commerce\";\nimport React from \"react\";\nimport data from \"../data.json\";\nexport default useCategories as UseCategories<typeof handler>;\n\nexport const handler: SWRHook<any> = {\n fetchOptions: {\n query: \"use-categories\",\n },\n async fetcher({ input, options, fetch }) {\n const { categoryId } = input;\n if (!categoryId) {\n return data.categories;\n }\n const category = data.categories.find(\n (category) => category.id === categoryId\n );\n return category ? [category] : [];\n },\n useHook: ({ useData }) => (input) => {\n const response = useData({\n input: [[\"categoryId\", input?.categoryId]],\n swrOptions: { revalidateOnFocus: false, ...input?.swrOptions },\n });\n return React.useMemo(\n () =>\n Object.create(response, {\n isEmpty: {\n get() {\n return (response.data?.length ?? 0) <= 0;\n },\n enumerable: true,\n },\n }),\n [response]\n );\n },\n};\n","import { SWRHook, useBrands, UseBrands } from \"@plasmicpkgs/commerce\";\nimport React from \"react\";\nimport data from \"../data.json\";\nexport default useBrands as UseBrands<typeof handler>;\n\nexport const handler: SWRHook<any> = {\n fetchOptions: {\n query: \"use-brands\",\n },\n async fetcher({ input, options, fetch }) {\n const vendorsStrings = data.products.map((product) => product.vendor);\n return Array.from(new Set(vendorsStrings).values()).map((v) => {\n const id = v.replace(/\\s+/g, \"-\").toLowerCase();\n return {\n entityId: id,\n name: v,\n path: `brands/${id}`,\n };\n });\n },\n useHook: ({ useData }) => (input) => {\n const response = useData({\n swrOptions: { revalidateOnFocus: false, ...input?.swrOptions },\n });\n return React.useMemo(\n () =>\n Object.create(response, {\n isEmpty: {\n get() {\n return (response.data?.length ?? 0) <= 0;\n },\n enumerable: true,\n },\n }),\n [response]\n );\n },\n};\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes: Removed authentication, customer and wishlist hooks\n*/\nimport { fetcher } from './fetcher'\nimport { handler as useCart } from './cart/use-cart'\nimport { handler as useAddItem } from './cart/use-add-item'\nimport { handler as useUpdateItem } from './cart/use-update-item'\nimport { handler as useRemoveItem } from './cart/use-remove-item'\nimport { handler as useSearch } from './product/use-search'\nimport { handler as useProduct } from './product/use-product'\nimport { handler as useCategories } from './site/use-categories'\nimport { handler as useBrands } from './site/use-brands'\nimport { LOCAL_CART_ID } from './const'\nexport const localProvider = {\n locale: 'en-us',\n cartCookie: LOCAL_CART_ID,\n fetcher: fetcher,\n cart: { useCart, useAddItem, useUpdateItem, useRemoveItem },\n products: { useSearch, useProduct },\n site: { useCategories, useBrands }\n}\n\nexport type LocalProvider = typeof localProvider\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes: Add export data\n*/\nexport * from \"./registerable\";\nexport { localProvider, data };\nexport type { LocalProvider };\nimport {\n getCommerceProvider,\n useCommerce as useCoreCommerce,\n} from \"@plasmicpkgs/commerce\";\nimport data from \"./data.json\";\nimport { localProvider, LocalProvider } from \"./provider\";\n\nexport const CommerceProvider = getCommerceProvider(localProvider);\n\nexport const useCommerce = () => useCoreCommerce<LocalProvider>();\n","import { GlobalContextMeta } from \"@plasmicapp/host\";\nimport registerGlobalContext from \"@plasmicapp/host/registerGlobalContext\";\nimport React from \"react\";\nimport { CommerceProvider } from \"./local\";\nimport { Registerable } from \"./registerable\";\n\ninterface CommerceProviderProps {\n children?: React.ReactNode;\n}\n\nexport const commerceProviderMeta: GlobalContextMeta<CommerceProviderProps> = {\n name: \"plasmic-commerce-local-provider\",\n displayName: \"Local Provider\",\n props: {},\n importPath: \"@plasmicpkgs/commerce-local\",\n importName: \"CommerceProviderComponent\",\n};\n\nfunction CommerceProviderComponent(props: CommerceProviderProps) {\n return <CommerceProvider>{props.children}</CommerceProvider>;\n}\n\nexport function registerCommerceProvider(\n loader?: Registerable,\n customCommerceProviderMeta?: GlobalContextMeta<CommerceProviderProps>\n) {\n const doRegisterComponent: typeof registerGlobalContext = (...args) =>\n loader\n ? loader.registerGlobalContext(...args)\n : registerGlobalContext(...args);\n doRegisterComponent(\n CommerceProviderComponent,\n customCommerceProviderMeta ?? commerceProviderMeta\n );\n}\n","import { Registerable } from \"./registerable\";\nimport { registerCommerceProvider } from \"./registerCommerceProvider\";\nexport * from \"./registerable\";\n\nexport * from \"./local\";\n\nexport function registerAll(loader?: Registerable) {\n registerCommerceProvider(loader);\n}\n\nexport { registerCommerceProvider };"],"names":["fetcher","_ref","_asyncToGenerator","_regeneratorRuntime","mark","_callee","res","_yield$res$json","data","wrap","_callee$","_context","prev","next","console","log","fetch","sent","ok","json","abrupt","stop","apply","arguments","LOCAL_CART_OBJ","LOCAL_CART_ID","createCart","cart","id","createdAt","currency","code","taxesIncluded","lineItems","lineItemsSubtotalPrice","subtotalPrice","totalPrice","cartId","Date","now","toString","Cookies","set","JSON","stringify","getCart","_cartId","get","cartStr","parse","undefined","cartUpdate","newCart","handler","fetchOptions","query","input","options","useHook","_ref2","useData","response","swrOptions","_extends","revalidateOnFocus","React","useMemo","Object","create","isEmpty","_response$data$lineIt","_response$data","length","enumerable","item","quantity","Number","isInteger","CommerceError","message","lineItem","variantId","_item$quantity","_iterator","_createForOfIteratorHelperLoose","products","_step","done","product","value","variant","variants","find","price","_item$quantity2","currencyCode","currentLineItem","push","_useCart","useCart","mutate","useCallback","_addItem","_callee2","_callee2$","_context2","addItem","_x","_removeItem","removeItem","sortProduct","a","b","sortKey","localeCompare","search","categoryId","brandId","sort","count","category","categories","filter","_category$products","includes","vendor","replace","toLowerCase","name","slug","slice","found","prefixSearch","locale","_data$products$find","_response$data$length","vendorsStrings","map","Array","from","Set","values","v","entityId","path","localProvider","cartCookie","useAddItem","useUpdateItem","useRemoveItem","useSearch","useProduct","site","useCategories","useBrands","CommerceProvider","getCommerceProvider","useCommerce","useCoreCommerce","commerceProviderMeta","displayName","props","importPath","importName","CommerceProviderComponent","children","registerCommerceProvider","loader","customCommerceProviderMeta","doRegisterComponent","registerGlobalContext","registerAll"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AAU,EAAVA;GAAY;EACnCC,IAAI,EAAE;IAAEC,aAAa,EAAbA,SAAa;IAAEC,SAAS,EAATA;;CACxB;;ACrBD;;;;AAIA,IAUaC,gBAAgB,gBAAGC,mBAAmB,CAACX,aAAa,CAAC;AAElE,IAAaY,WAAW,GAAG,SAAdA,WAAWA;EAAA,OAASC,aAAe,EAAiB;AAAA;;ACN1D,IAAMC,oBAAoB,GAA6C;EAC5E/B,IAAI,EAAE,iCAAiC;EACvCgC,WAAW,EAAE,gBAAgB;EAC7BC,KAAK,EAAE,EAAE;EACTC,UAAU,EAAE,6BAA6B;EACzCC,UAAU,EAAE;CACb;AAED,SAASC,yBAAyBA,CAACH,KAA4B;EAC7D,OAAOhG,oBAAC0F,gBAAgB,QAAEM,KAAK,CAACI,QAAQ,CAAoB;AAC9D;AAEA,SAAgBC,wBAAwBA,CACtCC,MAAqB,EACrBC,0BAAqE;EAErE,IAAMC,mBAAmB,GAAiC,SAApDA,mBAAmBA;IAAA,OACvBF,MAAM,GACFA,MAAM,CAACG,qBAAqB,CAAApJ,KAAA,CAA5BiJ,MAAM,EAAAhJ,SAA8B,CAAC,GACrCmJ,qBAAqB,CAAApJ,KAAA,SAAAC,SAAQ,CAAC;;EACpCkJ,mBAAmB,CACjBL,yBAAyB,EACzBI,0BAA0B,WAA1BA,0BAA0B,GAAIT,oBAAoB,CACnD;AACH;;SC5BgBY,WAAWA,CAACJ,MAAqB;EAC/CD,wBAAwB,CAACC,MAAM,CAAC;AAClC;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plasmicpkgs/commerce-local",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.208",
|
|
4
4
|
"description": "Plasmic registration calls for local provider 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.210",
|
|
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,8 +33,8 @@
|
|
|
33
33
|
"react": ">=16.8.0"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@plasmicpkgs/commerce": "0.0.
|
|
36
|
+
"@plasmicpkgs/commerce": "0.0.208",
|
|
37
37
|
"@types/react": "^18.0.27"
|
|
38
38
|
},
|
|
39
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "7f923856013e0efa4eb893fa16c2f48bd4edc9c3"
|
|
40
40
|
}
|