hemfixarna-web-components 1.4.6 → 1.5.0
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/cjs/{hemfixarna-address_32.cjs.entry.js → hemfixarna-address_34.cjs.entry.js} +148 -62
- package/dist/cjs/{hemfixarna-address_32.cjs.entry.js.map → hemfixarna-address_34.cjs.entry.js.map} +1 -1
- package/dist/cjs/hemfixarna-components.cjs.js +2 -2
- package/dist/cjs/{index-83c1daf2.js → index-b83343b9.js} +33 -2
- package/dist/{esm/index-1fd61928.js.map → cjs/index-b83343b9.js.map} +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +2 -0
- package/dist/collection/components/customers/hemfixarna-power/hemfixarna-power.js +131 -0
- package/dist/collection/components/customers/hemfixarna-power/hemfixarna-power.js.map +1 -0
- package/dist/collection/components/hemfixarna-breadcrumbs/hemfixarna-breadcrumbs.js +7 -2
- package/dist/collection/components/hemfixarna-breadcrumbs/hemfixarna-breadcrumbs.js.map +1 -1
- package/dist/collection/components/hemfixarna-category.tsx/hemfixarna-category.js +1 -1
- package/dist/collection/components/hemfixarna-category.tsx/hemfixarna-category.js.map +1 -1
- package/dist/collection/components/hemfixarna-checkout/hemfixarna-checkout.js +60 -5
- package/dist/collection/components/hemfixarna-checkout/hemfixarna-checkout.js.map +1 -1
- package/dist/collection/components/hemfixarna-component/hemfixarna-component.js +2 -2
- package/dist/collection/components/hemfixarna-component/hemfixarna-component.js.map +1 -1
- package/dist/collection/components/hemfixarna-component/hemfixarna.css +46 -2
- package/dist/collection/components/hemfixarna-contact/hemfixarna-contact.js +33 -0
- package/dist/collection/components/hemfixarna-contact/hemfixarna-contact.js.map +1 -0
- package/dist/collection/components/hemfixarna-demo/hemfixarna-demo.css +6 -1
- package/dist/collection/components/hemfixarna-demo/hemfixarna-demo.js +4 -2
- package/dist/collection/components/hemfixarna-demo/hemfixarna-demo.js.map +1 -1
- package/dist/collection/components/hemfixarna-info/hemfixarna-info.js +2 -29
- package/dist/collection/components/hemfixarna-info/hemfixarna-info.js.map +1 -1
- package/dist/collection/components/hemfixarna-order/hemfixarna-order.js +1 -4
- package/dist/collection/components/hemfixarna-order/hemfixarna-order.js.map +1 -1
- package/dist/collection/components/hemfixarna-product/hemfixarna-product.js +1 -1
- package/dist/collection/components/hemfixarna-product/hemfixarna-product.js.map +1 -1
- package/dist/collection/components/hemfixarna-service/hemfixarna-service.js +1 -1
- package/dist/collection/components/hemfixarna-service/hemfixarna-service.js.map +1 -1
- package/dist/collection/components/hemfixarna-start/hemfixarna-start.js +2 -2
- package/dist/collection/components/hemfixarna-start/hemfixarna-start.js.map +1 -1
- package/dist/collection/store/index.js +1 -0
- package/dist/collection/store/index.js.map +1 -1
- package/dist/collection/types/index.js +1 -0
- package/dist/collection/types/index.js.map +1 -1
- package/dist/collection/utils/api.js +11 -1
- package/dist/collection/utils/api.js.map +1 -1
- package/dist/esm/{hemfixarna-address_32.entry.js → hemfixarna-address_34.entry.js} +135 -51
- package/dist/esm/{hemfixarna-address_32.entry.js.map → hemfixarna-address_34.entry.js.map} +1 -1
- package/dist/esm/hemfixarna-components.js +3 -3
- package/dist/esm/{index-1fd61928.js → index-8c417125.js} +33 -2
- package/dist/{cjs/index-83c1daf2.js.map → esm/index-8c417125.js.map} +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/hemfixarna-components/hemfixarna-components.esm.js +1 -1
- package/dist/hemfixarna-components/p-852e7173.js +3 -0
- package/dist/hemfixarna-components/p-9a7694f6.entry.js +2 -0
- package/dist/types/components/customers/hemfixarna-power/hemfixarna-power.d.ts +10 -0
- package/dist/types/components/hemfixarna-checkout/hemfixarna-checkout.d.ts +10 -0
- package/dist/types/components/hemfixarna-contact/hemfixarna-contact.d.ts +4 -0
- package/dist/types/components/hemfixarna-info/hemfixarna-info.d.ts +0 -9
- package/dist/types/components.d.ts +40 -2
- package/dist/types/store/index.d.ts +2 -1
- package/dist/types/types/index.d.ts +59 -2
- package/dist/types/utils/api.d.ts +2 -1
- package/package.json +1 -1
- package/dist/hemfixarna-components/p-33d37833.js +0 -3
- package/dist/hemfixarna-components/p-3b2da615.entry.js +0 -2
- /package/dist/hemfixarna-components/{p-33d37833.js.map → p-852e7173.js.map} +0 -0
- /package/dist/hemfixarna-components/{p-3b2da615.entry.js.map → p-9a7694f6.entry.js.map} +0 -0
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../src/utils/api.ts"],"names":[],"mappings":"AAGA,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,OAAO,mBAAmB,CAAC,CAAC,CAAC,wCAAwC,CAAC;AAExH,MAAM,CAAC,KAAK,UAAU,aAAa,CAAI,OAAoB,EAAE,OAAqB;EAChF,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;EAC/C,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;EACnC,OAAO,IAAI,CAAC;AACd,CAAC;AAED,MAAM,WAAW,GAAG,KAAK,EAAE,QAAgB,EAAE,EAAE;EAC7C,IAAI,CAAC,QAAQ,EAAE;IACb,OAAO;GACR;EACD,MAAM,IAAI,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;EACpC,MAAM,IAAI,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;EACpC,IAAI;IACF,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,GAAG,IAAI,IAAI,IAAI,IAAI,IAAI,EAAE,CAAC,CAAC;IACnD,OAAO,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC;GACzB;EAAC,OAAO,KAAK,EAAE;IACd,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;GACpB;AACH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AG,IAAI,iBAAiB,CAAC,CAAC;IAClD,OAAO,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC;GACzB;EAAC,OAAO,KAAK,EAAE;IACd,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;GACpB;AACH,CAAC,CAAC;AAEF,mCAAmC;AACnC,kBAAkB;AAClB,wBAAwB;AACxB,mBAAmB;AACnB,oCAAoC;AACpC,mBAAmB;AACnB,qBAAqB;AACrB,iCAAiC;AACjC,yBAAyB;AACzB,uBAAuB;AACvB,mBAAmB;AACnB,sCAAsC;AACtC,IAAI;AAEJ,MAAM,SAAS,GAAG,KAAK,EAAE,IAAgB,EAAE,EAAE;EAC3C,IAAI;IACF,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,GAAG,IAAI,WAAW,EAAE;MAC1C,MAAM,EAAE,MAAM;MACd,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;MAC1B,OAAO,EAAE;QACP,cAAc,EAAE,kBAAkB;OACnC;KACF,CAAC,CAAC;IACH,OAAO,CAAC,MAAM,GAAG,CAAC,IAAI,EAAE,CAA4E,CAAC;GACtG;EAAC,OAAO,KAAK,EAAE;IACd,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;GACpB;AACH,CAAC,CAAC;AAEF,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,SAAS,EAAE,CAAC","sourcesContent":["import { RotOptions, RutOptions, WpOptions } from '../types';\nimport { FelixOrder } from './felixApi';\n\nconst base = process.env.API_URL ? `${process.env.API_URL}/wp-json/headless` : 'https://hemfixarna.se/wp-json/headless';\n\nexport async function fetchWithType<T>(request: RequestInfo, options?: RequestInit): Promise<T> {\n const response = await fetch(request, options);\n const body = await response.json();\n return body;\n}\n\nconst getTaxonomy = async (endpoint: string) => {\n if (!endpoint) {\n return;\n }\n const type = endpoint.split('/')[0];\n const slug = endpoint.split('/')[1];\n try {\n const res = await fetch(`${base}/${type}/${slug}`);\n return await res.json();\n } catch (error) {\n console.log(error);\n }\n};\n\nconst getCustomer = async (slug: string) => {\n try {\n const res = await fetch(`${base}/customer/${slug}`);\n return await res.json();\n } catch (error) {\n console.log(error);\n }\n};\n\nconst getOptions = async () => {\n try {\n const res = await fetch(`${base}/webcoptions`);\n return (await res.json()) as WpOptions;\n } catch (error) {\n console.log(error);\n }\n};\n\nconst getRut = async () => {\n try {\n const data = await fetchWithType<RutOptions>(`${base}/rut`);\n return data;\n } catch (error) {\n console.log(error);\n }\n};\n\nconst getRot = async () => {\n try {\n const res = await fetch(`${base}/rot`);\n return (await res.json()) as RotOptions;\n } catch (error) {\n console.log(error);\n }\n};\n\nconst getGreenDiscount = async () => {\n try {\n const res = await fetch(`${base}/green-discount`);\n return await res.json();\n } catch (error) {\n console.log(error);\n }\n};\n\n// export interface PostOrderData {\n// name: string;\n// customer: Business;\n// phone: string;\n// social_security_number: string;\n// email: string;\n// address: string;\n// earliest_visit_date: string;\n// order_items: string;\n// start_fee: string;\n// total: number;\n// felixStatus: 'success' | 'error';\n// }\n\nconst postOrder = async (data: FelixOrder) => {\n try {\n const res = await fetch(`${base}/weborder`, {\n method: 'POST',\n body: JSON.stringify(data),\n headers: {\n 'Content-Type': 'application/json',\n },\n });\n return (await res.json()) as { message: string; post_id: number; data: FelixOrder; status?: number };\n } catch (error) {\n console.log(error);\n }\n};\n\nexport { getCustomer, getGreenDiscount, getOptions, getRot, getRut, getTaxonomy, postOrder };\n"]}
|
1
|
+
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../src/utils/api.ts"],"names":[],"mappings":"AAGA,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,OAAO,mBAAmB,CAAC,CAAC,CAAC,wCAAwC,CAAC;AAExH,MAAM,CAAC,KAAK,UAAU,aAAa,CAAI,OAAoB,EAAE,OAAqB;E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ACnB,oCAAoC;AACpC,mBAAmB;AACnB,qBAAqB;AACrB,iCAAiC;AACjC,yBAAyB;AACzB,uBAAuB;AACvB,mBAAmB;AACnB,sCAAsC;AACtC,IAAI;AAEJ,MAAM,SAAS,GAAG,KAAK,EAAE,IAAgB,EAAE,EAAE;EAC3C,IAAI;IACF,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,GAAG,IAAI,WAAW,EAAE;MAC1C,MAAM,EAAE,MAAM;MACd,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;MAC1B,OAAO,EAAE;QACP,cAAc,EAAE,kBAAkB;OACnC;KACF,CAAC,CAAC;IACH,OAAO,CAAC,MAAM,GAAG,CAAC,IAAI,EAAE,CAA4E,CAAC;GACtG;EAAC,OAAO,KAAK,EAAE;IACd,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;GACpB;AACH,CAAC,CAAC;AAEF,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,CAAC","sourcesContent":["import { RotOptions, RutOptions, SourcesRespone, WpOptions } from '../types';\nimport { FelixOrder } from './felixApi';\n\nconst base = process.env.API_URL ? `${process.env.API_URL}/wp-json/headless` : 'https://hemfixarna.se/wp-json/headless';\n\nexport async function fetchWithType<T>(request: RequestInfo, options?: RequestInit): Promise<T> {\n const response = await fetch(request, options);\n const body = await response.json();\n return body;\n}\n\nconst getTaxonomy = async (endpoint: string) => {\n if (!endpoint) {\n return;\n }\n const type = endpoint.split('/')[0];\n const slug = endpoint.split('/')[1];\n try {\n const res = await fetch(`${base}/${type}/${slug}`);\n return await res.json();\n } catch (error) {\n console.log(error);\n }\n};\n\nconst getCustomer = async (slug: string) => {\n try {\n const res = await fetch(`${base}/customer/${slug}`);\n return await res.json();\n } catch (error) {\n console.log(error);\n }\n};\n\nconst getOptions = async () => {\n try {\n const res = await fetch(`${base}/webcoptions`);\n return (await res.json()) as WpOptions;\n } catch (error) {\n console.log(error);\n }\n};\n\nconst getRut = async () => {\n try {\n const data = await fetchWithType<RutOptions>(`${base}/rut`);\n return data;\n } catch (error) {\n console.log(error);\n }\n};\n\nconst getRot = async () => {\n try {\n const res = await fetch(`${base}/rot`);\n return (await res.json()) as RotOptions;\n } catch (error) {\n console.log(error);\n }\n};\n\nconst getGreenDiscount = async () => {\n try {\n const res = await fetch(`${base}/green-discount`);\n return await res.json();\n } catch (error) {\n console.log(error);\n }\n};\n\nconst getSources = async () => {\n try {\n const res = await fetchWithType<{ response: SourcesRespone }>(`${base}/getsources`);\n return res?.response?.data;\n } catch (error) {\n console.log(error);\n }\n};\n\n// export interface PostOrderData {\n// name: string;\n// customer: Business;\n// phone: string;\n// social_security_number: string;\n// email: string;\n// address: string;\n// earliest_visit_date: string;\n// order_items: string;\n// start_fee: string;\n// total: number;\n// felixStatus: 'success' | 'error';\n// }\n\nconst postOrder = async (data: FelixOrder) => {\n try {\n const res = await fetch(`${base}/weborder`, {\n method: 'POST',\n body: JSON.stringify(data),\n headers: {\n 'Content-Type': 'application/json',\n },\n });\n return (await res.json()) as { message: string; post_id: number; data: FelixOrder; status?: number };\n } catch (error) {\n console.log(error);\n }\n};\n\nexport { getCustomer, getGreenDiscount, getOptions, getRot, getRut, getSources, getTaxonomy, postOrder };\n"]}
|