@anker-in/shopify-react 0.1.1-beta.14 → 0.1.1-beta.16
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 +28 -15
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/index.mjs +28 -15
- package/dist/hooks/index.mjs.map +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +28 -15
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +28 -15
- package/dist/index.mjs.map +1 -1
- package/dist/provider/index.d.mts +1 -1
- package/dist/provider/index.d.ts +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/dist/{types-DpxtE_nv.d.mts → types-DX-2ABDs.d.mts} +4 -1
- package/dist/{types-DpxtE_nv.d.ts → types-DX-2ABDs.d.ts} +4 -1
- package/package.json +2 -2
- package/dist/index-Bp9gEGUb.d.mts +0 -1974
- package/dist/index-D9zCMHzm.d.ts +0 -1974
|
@@ -4,7 +4,7 @@ import { ShopifyClient, ShopifyConfig, CartCookieAdapter as CartCookieAdapter$1,
|
|
|
4
4
|
import { C as CookieAdapter, b as CartCookieAdapter, R as RouterAdapter, U as UserContextAdapter } from '../types-BLMoxbOk.mjs';
|
|
5
5
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
6
6
|
import { SWRConfiguration } from 'swr';
|
|
7
|
-
import { e as PlusMemberSettingsMetafields } from '../types-
|
|
7
|
+
import { e as PlusMemberSettingsMetafields } from '../types-DX-2ABDs.mjs';
|
|
8
8
|
import 'swr/mutation';
|
|
9
9
|
|
|
10
10
|
interface ShopifyContextValue {
|
package/dist/provider/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { ShopifyClient, ShopifyConfig, CartCookieAdapter as CartCookieAdapter$1,
|
|
|
4
4
|
import { C as CookieAdapter, b as CartCookieAdapter, R as RouterAdapter, U as UserContextAdapter } from '../types-BLMoxbOk.js';
|
|
5
5
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
6
6
|
import { SWRConfiguration } from 'swr';
|
|
7
|
-
import { e as PlusMemberSettingsMetafields } from '../types-
|
|
7
|
+
import { e as PlusMemberSettingsMetafields } from '../types-DX-2ABDs.js';
|
|
8
8
|
import 'swr/mutation';
|
|
9
9
|
|
|
10
10
|
interface ShopifyContextValue {
|
package/dist/provider/index.js
CHANGED
|
@@ -786,10 +786,6 @@ var useCartAttributes = ({
|
|
|
786
786
|
{
|
|
787
787
|
key: "_is_login",
|
|
788
788
|
value: profile?.token ? "true" : "false"
|
|
789
|
-
},
|
|
790
|
-
{
|
|
791
|
-
key: "_last_url",
|
|
792
|
-
value: typeof window !== "undefined" ? window.location.origin + window.location.pathname : ""
|
|
793
789
|
}
|
|
794
790
|
];
|
|
795
791
|
if (profile?.token) {
|
|
@@ -845,18 +841,29 @@ var useCartAttributes = ({
|
|
|
845
841
|
}
|
|
846
842
|
];
|
|
847
843
|
}, [currentUrl]);
|
|
844
|
+
const commonAttributes = react.useMemo(
|
|
845
|
+
() => [
|
|
846
|
+
...memberAttributes,
|
|
847
|
+
...functionAttributes,
|
|
848
|
+
...presellAttributes,
|
|
849
|
+
...weightAttributes,
|
|
850
|
+
...trackingAttributes,
|
|
851
|
+
...getReferralAttributes()
|
|
852
|
+
].filter((item) => item?.value),
|
|
853
|
+
[memberAttributes, functionAttributes, presellAttributes, weightAttributes, trackingAttributes]
|
|
854
|
+
);
|
|
855
|
+
const extraAttributesInCart = react.useMemo(() => {
|
|
856
|
+
return cart?.customAttributes?.filter(
|
|
857
|
+
(item) => !commonAttributes.some((attr) => attr.key === item.key)
|
|
858
|
+
) || [];
|
|
859
|
+
}, [cart]);
|
|
848
860
|
return react.useMemo(
|
|
849
861
|
() => ({
|
|
850
|
-
attributes: [
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
...presellAttributes,
|
|
854
|
-
...weightAttributes,
|
|
855
|
-
...trackingAttributes,
|
|
856
|
-
...getReferralAttributes()
|
|
857
|
-
].filter((item) => item?.value)
|
|
862
|
+
attributes: [...commonAttributes, ...extraAttributesInCart].filter(
|
|
863
|
+
(item) => item?.value
|
|
864
|
+
)
|
|
858
865
|
}),
|
|
859
|
-
[
|
|
866
|
+
[commonAttributes, extraAttributesInCart]
|
|
860
867
|
);
|
|
861
868
|
};
|
|
862
869
|
var useUpdateLineCodeAmountAttributes = ({
|