@anker-in/shopify-react 0.1.1-beta.31 → 0.1.1-beta.33

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.
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import React__default from 'react';
3
3
  import { ShopifyClient, ShopifyConfig, CartCookieAdapter, NormalizedCart, AttributeInput, HasMetafieldsIdentifier } from '@anker-in/shopify-sdk';
4
- import { C as CookieAdapter, R as RouterAdapter, U as UserContextAdapter } from '../types-Dt0DUG00.mjs';
4
+ import { C as CookieAdapter, R as RouterAdapter, U as UserContextAdapter, P as PerformanceAdapter } from '../types-SKDHauqk.mjs';
5
5
  import * as react_jsx_runtime from 'react/jsx-runtime';
6
6
  import { SWRConfiguration } from 'swr';
7
7
  import { e as PlusMemberSettingsMetafields } from '../types-BSsb8OPm.mjs';
@@ -15,6 +15,7 @@ interface ShopifyContextValue {
15
15
  cartCookieAdapter: CartCookieAdapter;
16
16
  routerAdapter?: RouterAdapter;
17
17
  userAdapter?: UserContextAdapter;
18
+ performanceAdapter?: PerformanceAdapter;
18
19
  }
19
20
  declare const ShopifyContext: React.Context<ShopifyContextValue | null>;
20
21
 
@@ -27,12 +28,13 @@ interface ShopifyProviderProps {
27
28
  routerAdapter?: RouterAdapter;
28
29
  userAdapter?: UserContextAdapter;
29
30
  children: React__default.ReactNode;
31
+ performanceAdapter?: PerformanceAdapter;
30
32
  }
31
33
  /**
32
34
  * Shopify Provider Component
33
35
  * Provides Shopify context to all child components
34
36
  */
35
- declare function ShopifyProvider({ config, locale, locales, cookieAdapter, cartCookieAdapter, routerAdapter, userAdapter, children, }: ShopifyProviderProps): react_jsx_runtime.JSX.Element;
37
+ declare function ShopifyProvider({ config, locale, locales, cookieAdapter, cartCookieAdapter, routerAdapter, userAdapter, children, performanceAdapter, }: ShopifyProviderProps): react_jsx_runtime.JSX.Element;
36
38
 
37
39
  /**
38
40
  * Hook to access Shopify context
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import React__default from 'react';
3
3
  import { ShopifyClient, ShopifyConfig, CartCookieAdapter, NormalizedCart, AttributeInput, HasMetafieldsIdentifier } from '@anker-in/shopify-sdk';
4
- import { C as CookieAdapter, R as RouterAdapter, U as UserContextAdapter } from '../types-Dt0DUG00.js';
4
+ import { C as CookieAdapter, R as RouterAdapter, U as UserContextAdapter, P as PerformanceAdapter } from '../types-SKDHauqk.js';
5
5
  import * as react_jsx_runtime from 'react/jsx-runtime';
6
6
  import { SWRConfiguration } from 'swr';
7
7
  import { e as PlusMemberSettingsMetafields } from '../types-BSsb8OPm.js';
@@ -15,6 +15,7 @@ interface ShopifyContextValue {
15
15
  cartCookieAdapter: CartCookieAdapter;
16
16
  routerAdapter?: RouterAdapter;
17
17
  userAdapter?: UserContextAdapter;
18
+ performanceAdapter?: PerformanceAdapter;
18
19
  }
19
20
  declare const ShopifyContext: React.Context<ShopifyContextValue | null>;
20
21
 
@@ -27,12 +28,13 @@ interface ShopifyProviderProps {
27
28
  routerAdapter?: RouterAdapter;
28
29
  userAdapter?: UserContextAdapter;
29
30
  children: React__default.ReactNode;
31
+ performanceAdapter?: PerformanceAdapter;
30
32
  }
31
33
  /**
32
34
  * Shopify Provider Component
33
35
  * Provides Shopify context to all child components
34
36
  */
35
- declare function ShopifyProvider({ config, locale, locales, cookieAdapter, cartCookieAdapter, routerAdapter, userAdapter, children, }: ShopifyProviderProps): react_jsx_runtime.JSX.Element;
37
+ declare function ShopifyProvider({ config, locale, locales, cookieAdapter, cartCookieAdapter, routerAdapter, userAdapter, children, performanceAdapter, }: ShopifyProviderProps): react_jsx_runtime.JSX.Element;
36
38
 
37
39
  /**
38
40
  * Hook to access Shopify context
@@ -62,7 +62,8 @@ function ShopifyProvider({
62
62
  cartCookieAdapter = browserCartCookieAdapter,
63
63
  routerAdapter,
64
64
  userAdapter,
65
- children
65
+ children,
66
+ performanceAdapter
66
67
  }) {
67
68
  const client = react.useMemo(() => {
68
69
  return shopifySdk.createShopifyClient(config, locale);
@@ -76,7 +77,8 @@ function ShopifyProvider({
76
77
  cookieAdapter,
77
78
  cartCookieAdapter,
78
79
  routerAdapter,
79
- userAdapter
80
+ userAdapter,
81
+ performanceAdapter
80
82
  };
81
83
  }, [
82
84
  client,
@@ -86,6 +88,7 @@ function ShopifyProvider({
86
88
  cookieAdapter,
87
89
  cartCookieAdapter,
88
90
  routerAdapter,
91
+ performanceAdapter,
89
92
  userAdapter
90
93
  ]);
91
94
  return /* @__PURE__ */ jsxRuntime.jsx(ShopifyContext.Provider, { value, children });
@@ -405,7 +408,6 @@ var useCalcAutoFreeGift = (cart, autoFreeGiftConfig, customer, lines) => {
405
408
  const effectiveCart = react.useMemo(() => {
406
409
  return cart;
407
410
  }, [lines, cart]);
408
- console.log("effectiveCart useCalcAutoFreeGift", effectiveCart);
409
411
  const { activeCampaign, subtotal } = react.useMemo(() => {
410
412
  for (const campaign of autoFreeGiftConfig) {
411
413
  const { rule_conditions = [], rule_result } = campaign;
@@ -421,7 +423,6 @@ var useCalcAutoFreeGift = (cart, autoFreeGiftConfig, customer, lines) => {
421
423
  all_store_variant: spend_get_reward.main_product?.all_store_variant || false
422
424
  }
423
425
  );
424
- console.log("matchedSubtotal useCalcAutoFreeGift", matchedSubtotal);
425
426
  if (matchedSubtotal > 0) {
426
427
  return { activeCampaign: campaign, subtotal: matchedSubtotal };
427
428
  }
@@ -1141,7 +1142,8 @@ function CartProvider({
1141
1142
  cart,
1142
1143
  mutateCart,
1143
1144
  isCartLoading: isCartLoading || isCodeChanging,
1144
- setLoadingState
1145
+ setLoadingState,
1146
+ metafieldIdentifiers
1145
1147
  });
1146
1148
  const removeCustomAttributes = react.useCallback(
1147
1149
  (attributes2) => {