@dropins/storefront-purchase-order 0.0.7-alpha1 → 0.0.7-alpha3
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/chunks/fetch-error.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*! Copyright 2025 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
|
-
const s=
|
|
3
|
+
const s=t=>{var e,n;if(t.length===1&&((n=(e=t[0])==null?void 0:e.path)==null?void 0:n.length)>0){const a=t[0].path[t[0].path.length-1];if(["applied_coupons","applied_gift_cards"].includes(a))return}const o=t.map(a=>a.message).join(" ");throw Error(o)};export{s as h};
|
|
4
4
|
//# sourceMappingURL=fetch-error.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetch-error.js","sources":["/@dropins/storefront-purchase-order/src/lib/fetch-error.ts"],"sourcesContent":["/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\n/** Actions */\nexport const handleFetchError = (errors: Array<{ message: string }
|
|
1
|
+
{"version":3,"file":"fetch-error.js","sources":["/@dropins/storefront-purchase-order/src/lib/fetch-error.ts"],"sourcesContent":["/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\n/** Actions */\nexport const handleFetchError = (\n errors: Array<{ message: string; path: string[] }>\n) => {\n // We only allow silently skipping the error if it's a SINGLE error.\n const isSingleError = errors.length === 1;\n\n /**\n * TODO: Temporary workaround to avoid UX regressions.\n * Data is still valid even when these specific errors occur.\n * Remove this logic once the following issues are resolved:\n * - https://jira.corp.adobe.com/browse/LYNX-986\n * - https://jira.corp.adobe.com/browse/LYNX-989\n */\n if (isSingleError && errors[0]?.path?.length > 0) {\n const lastStep = errors[0].path[errors[0].path.length - 1];\n\n const allowedErrorPaths = ['applied_coupons', 'applied_gift_cards'];\n\n // If the single error's path ends with an allowed step - skip throwing\n if (allowedErrorPaths.includes(lastStep)) {\n return;\n }\n }\n\n const errorMessage = errors.map((e: any) => e.message).join(' ');\n\n throw Error(errorMessage);\n};\n"],"names":["handleFetchError","errors","_a","_b","lastStep","errorMessage","e"],"mappings":"AAkBO,MAAMA,EACXC,GACG,CAFE,IAAAC,EAAAC,EAaL,GATsBF,EAAO,SAAW,KASnBE,GAAAD,EAAAD,EAAO,CAAC,IAAR,YAAAC,EAAW,OAAX,YAAAC,EAAiB,QAAS,EAAG,CAChD,MAAMC,EAAWH,EAAO,CAAC,EAAE,KAAKA,EAAO,CAAC,EAAE,KAAK,OAAS,CAAC,EAKzD,GAH0B,CAAC,kBAAmB,oBAAoB,EAG5C,SAASG,CAAQ,EACrC,MAEJ,CAEA,MAAMC,EAAeJ,EAAO,IAAKK,GAAWA,EAAE,OAAO,EAAE,KAAK,GAAG,EAE/D,MAAM,MAAMD,CAAY,CAC1B"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*! Copyright 2025 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
|
-
import{useState as a,useEffect as
|
|
3
|
+
import{useState as a,useEffect as n}from"@dropins/tools/preact-hooks.js";import{events as c}from"@dropins/tools/event-bus.js";const i=()=>{const[t,s]=a(!0),[u,o]=a(null);return n(()=>{const e=c.on("purchase-order/data",r=>{r!=null&&r.uid&&o(r),s(!1)},{eager:!0});return()=>{e==null||e.off()}},[]),{poDataLoading:t,purchaseOrderData:u}};export{i as u};
|
|
4
4
|
//# sourceMappingURL=usePurchaseOrderData.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePurchaseOrderData.js","sources":["/@dropins/storefront-purchase-order/src/hooks/usePurchaseOrderData.tsx"],"sourcesContent":["/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { useEffect, useState } from 'preact/hooks';\nimport { PurchaseOrderModel } from '../data/models';\nimport { events } from '@adobe-commerce/event-bus';\n\nexport const usePurchaseOrderData = () => {\n const [poDataLoading, setPoDataLoading] = useState(true);\n const [purchaseOrderData, setPurchaseOrderData] =\n useState<PurchaseOrderModel | null>(null);\n\n useEffect(() => {\n const event = events.on(\n 'purchase-order/data',\n (po: PurchaseOrderModel) => {\n if (po?.uid) {\n setPurchaseOrderData(po);\n }\n\n setPoDataLoading(false);\n },\n { eager: true }\n );\n\n return () => {\n event?.off();\n };\n }, []);\n\n
|
|
1
|
+
{"version":3,"file":"usePurchaseOrderData.js","sources":["/@dropins/storefront-purchase-order/src/hooks/usePurchaseOrderData.tsx"],"sourcesContent":["/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { useEffect, useState } from 'preact/hooks';\nimport { PurchaseOrderModel } from '../data/models';\nimport { events } from '@adobe-commerce/event-bus';\n\nexport const usePurchaseOrderData = () => {\n const [poDataLoading, setPoDataLoading] = useState(true);\n const [purchaseOrderData, setPurchaseOrderData] =\n useState<PurchaseOrderModel | null>(null);\n\n useEffect(() => {\n const event = events.on(\n 'purchase-order/data',\n (po: PurchaseOrderModel) => {\n if (po?.uid) {\n setPurchaseOrderData(po);\n }\n\n setPoDataLoading(false);\n },\n { eager: true }\n );\n\n return () => {\n event?.off();\n };\n }, []);\n\n return { poDataLoading, purchaseOrderData };\n};\n"],"names":["usePurchaseOrderData","poDataLoading","setPoDataLoading","useState","purchaseOrderData","setPurchaseOrderData","useEffect","event","events","po"],"mappings":"8HAqBO,MAAMA,EAAuB,IAAM,CACxC,KAAM,CAACC,EAAeC,CAAgB,EAAIC,EAAS,EAAI,EACjD,CAACC,EAAmBC,CAAoB,EAC5CF,EAAoC,IAAI,EAE1C,OAAAG,EAAU,IAAM,CACd,MAAMC,EAAQC,EAAO,GACnB,sBACCC,GAA2B,CACtBA,GAAA,MAAAA,EAAI,KACNJ,EAAqBI,CAAE,EAGzBP,EAAiB,EAAK,CACxB,EACA,CAAE,MAAO,EAAA,CAAK,EAGhB,MAAO,IAAM,CACXK,GAAA,MAAAA,EAAO,KACT,CACF,EAAG,CAAA,CAAE,EAEE,CAAE,cAAAN,EAAe,kBAAAG,CAAA,CAC1B"}
|
package/lib/fetch-error.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name": "@dropins/storefront-purchase-order", "version": "0.0.7-
|
|
1
|
+
{"name": "@dropins/storefront-purchase-order", "version": "0.0.7-alpha3", "@dropins/tools": "1.6.0-beta2", "license": "SEE LICENSE IN LICENSE.md"}
|