@anker-in/shopify-react 0.1.1-beta.15 → 0.1.1-beta.17
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/hooks/index.d.mts +1881 -9
- package/dist/hooks/index.d.ts +1881 -9
- package/dist/hooks/index.js +27 -14
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/index.mjs +27 -14
- package/dist/hooks/index.mjs.map +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +27 -14
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +27 -14
- package/dist/index.mjs.map +1 -1
- package/dist/provider/index.js +20 -13
- package/dist/provider/index.js.map +1 -1
- package/dist/provider/index.mjs +20 -13
- package/dist/provider/index.mjs.map +1 -1
- package/package.json +5 -5
- package/dist/index-Bfg4hT-O.d.ts +0 -1974
- package/dist/index-DGaexgLe.d.mts +0 -1974
package/dist/hooks/index.mjs
CHANGED
|
@@ -1342,10 +1342,6 @@ var useCartAttributes = ({
|
|
|
1342
1342
|
{
|
|
1343
1343
|
key: "_is_login",
|
|
1344
1344
|
value: profile?.token ? "true" : "false"
|
|
1345
|
-
},
|
|
1346
|
-
{
|
|
1347
|
-
key: "_last_url",
|
|
1348
|
-
value: typeof window !== "undefined" ? window.location.origin + window.location.pathname : ""
|
|
1349
1345
|
}
|
|
1350
1346
|
];
|
|
1351
1347
|
if (profile?.token) {
|
|
@@ -1401,18 +1397,29 @@ var useCartAttributes = ({
|
|
|
1401
1397
|
}
|
|
1402
1398
|
];
|
|
1403
1399
|
}, [currentUrl]);
|
|
1400
|
+
const commonAttributes = useMemo(
|
|
1401
|
+
() => [
|
|
1402
|
+
...memberAttributes,
|
|
1403
|
+
...functionAttributes,
|
|
1404
|
+
...presellAttributes,
|
|
1405
|
+
...weightAttributes,
|
|
1406
|
+
...trackingAttributes,
|
|
1407
|
+
...getReferralAttributes()
|
|
1408
|
+
].filter((item) => item?.value),
|
|
1409
|
+
[memberAttributes, functionAttributes, presellAttributes, weightAttributes, trackingAttributes]
|
|
1410
|
+
);
|
|
1411
|
+
const extraAttributesInCart = useMemo(() => {
|
|
1412
|
+
return cart?.customAttributes?.filter(
|
|
1413
|
+
(item) => !commonAttributes.some((attr) => attr.key === item.key)
|
|
1414
|
+
) || [];
|
|
1415
|
+
}, [cart]);
|
|
1404
1416
|
return useMemo(
|
|
1405
1417
|
() => ({
|
|
1406
|
-
attributes: [
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
...presellAttributes,
|
|
1410
|
-
...weightAttributes,
|
|
1411
|
-
...trackingAttributes,
|
|
1412
|
-
...getReferralAttributes()
|
|
1413
|
-
].filter((item) => item?.value)
|
|
1418
|
+
attributes: [...commonAttributes, ...extraAttributesInCart].filter(
|
|
1419
|
+
(item) => item?.value
|
|
1420
|
+
)
|
|
1414
1421
|
}),
|
|
1415
|
-
[
|
|
1422
|
+
[commonAttributes, extraAttributesInCart]
|
|
1416
1423
|
);
|
|
1417
1424
|
};
|
|
1418
1425
|
var DEFAULT_MIN = 1;
|
|
@@ -2637,7 +2644,13 @@ var usePlusMemberCheckoutCustomAttributes = ({
|
|
|
2637
2644
|
const { deliveryCustomData } = deliveryData || {};
|
|
2638
2645
|
const { profile } = usePlusMemberContext();
|
|
2639
2646
|
return useMemo(() => {
|
|
2640
|
-
const checkoutCustomAttributes = [
|
|
2647
|
+
const checkoutCustomAttributes = [
|
|
2648
|
+
// _last_url: 付费会员结算完成之后 checkout 有一个继续购买的按钮, 用于跳转到继续购买的页面
|
|
2649
|
+
{
|
|
2650
|
+
key: "_last_url",
|
|
2651
|
+
value: typeof window !== "undefined" ? window.location.origin + window.location.pathname : ""
|
|
2652
|
+
}
|
|
2653
|
+
];
|
|
2641
2654
|
if (deliveryCustomData) {
|
|
2642
2655
|
checkoutCustomAttributes.push({
|
|
2643
2656
|
key: "_checkout_delivery_custom",
|