@neowhale/storefront 0.2.31 → 0.2.32
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/{chunk-WNZOA4FB.js → chunk-2XODSXJT.js} +2 -2
- package/dist/{chunk-WNZOA4FB.js.map → chunk-2XODSXJT.js.map} +1 -1
- package/dist/{chunk-V5KCIYKG.cjs → chunk-HSGM4XMK.cjs} +2 -2
- package/dist/{chunk-V5KCIYKG.cjs.map → chunk-HSGM4XMK.cjs.map} +1 -1
- package/dist/{client-CwCSPAHp.d.cts → client-CUKv5fMM.d.cts} +2 -0
- package/dist/{client-CwCSPAHp.d.ts → client-CUKv5fMM.d.ts} +2 -0
- package/dist/index.cjs +3 -3
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/next/index.cjs +4 -4
- package/dist/next/index.d.cts +1 -1
- package/dist/next/index.d.ts +1 -1
- package/dist/next/index.js +1 -1
- package/dist/{pixel-manager-LiLpBmPy.d.ts → pixel-manager-DsrUxlIB.d.ts} +1 -1
- package/dist/{pixel-manager-ti1xc1eC.d.cts → pixel-manager-oZStK6GU.d.cts} +1 -1
- package/dist/react/index.cjs +12 -6
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.d.cts +2 -2
- package/dist/react/index.d.ts +2 -2
- package/dist/react/index.js +8 -2
- package/dist/react/index.js.map +1 -1
- package/package.json +1 -1
package/dist/react/index.d.cts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as react from 'react';
|
|
3
3
|
import { ReactNode } from 'react';
|
|
4
|
-
import { F as WhaleStorefrontConfig, r as Product, P as PaymentData, O as Order, a as CartItem, T as TaxBreakdown, W as WhaleClient, f as Customer, E as EventType, g as CustomerAnalytics, d as CheckoutSession, A as Address, b as Category, c as CategoryTreeNode, l as LoyaltyAccount, m as LoyaltyReward, n as LoyaltyTransaction, v as Review, w as ReviewSummary, G as WishlistItem, R as Recommendation, k as Location, x as ShippingMethod, y as ShippingRate, D as DealValidation, C as Cart, H as ReferralStatus, I as ReferralEnrollment, i as LandingSection, Q as QRLandingData, h as LandingPageRenderData } from '../client-
|
|
4
|
+
import { F as WhaleStorefrontConfig, r as Product, P as PaymentData, O as Order, a as CartItem, T as TaxBreakdown, W as WhaleClient, f as Customer, E as EventType, g as CustomerAnalytics, d as CheckoutSession, A as Address, b as Category, c as CategoryTreeNode, l as LoyaltyAccount, m as LoyaltyReward, n as LoyaltyTransaction, v as Review, w as ReviewSummary, G as WishlistItem, R as Recommendation, k as Location, x as ShippingMethod, y as ShippingRate, D as DealValidation, C as Cart, H as ReferralStatus, I as ReferralEnrollment, i as LandingSection, Q as QRLandingData, h as LandingPageRenderData } from '../client-CUKv5fMM.cjs';
|
|
5
5
|
import { ThemeTokens } from '@neowhale/ui';
|
|
6
6
|
import * as zustand_middleware from 'zustand/middleware';
|
|
7
7
|
import * as zustand from 'zustand';
|
|
8
|
-
import { P as PixelManager } from '../pixel-manager-
|
|
8
|
+
import { P as PixelManager } from '../pixel-manager-oZStK6GU.cjs';
|
|
9
9
|
|
|
10
10
|
interface WhaleProviderProps extends WhaleStorefrontConfig {
|
|
11
11
|
children: ReactNode;
|
package/dist/react/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as react from 'react';
|
|
3
3
|
import { ReactNode } from 'react';
|
|
4
|
-
import { F as WhaleStorefrontConfig, r as Product, P as PaymentData, O as Order, a as CartItem, T as TaxBreakdown, W as WhaleClient, f as Customer, E as EventType, g as CustomerAnalytics, d as CheckoutSession, A as Address, b as Category, c as CategoryTreeNode, l as LoyaltyAccount, m as LoyaltyReward, n as LoyaltyTransaction, v as Review, w as ReviewSummary, G as WishlistItem, R as Recommendation, k as Location, x as ShippingMethod, y as ShippingRate, D as DealValidation, C as Cart, H as ReferralStatus, I as ReferralEnrollment, i as LandingSection, Q as QRLandingData, h as LandingPageRenderData } from '../client-
|
|
4
|
+
import { F as WhaleStorefrontConfig, r as Product, P as PaymentData, O as Order, a as CartItem, T as TaxBreakdown, W as WhaleClient, f as Customer, E as EventType, g as CustomerAnalytics, d as CheckoutSession, A as Address, b as Category, c as CategoryTreeNode, l as LoyaltyAccount, m as LoyaltyReward, n as LoyaltyTransaction, v as Review, w as ReviewSummary, G as WishlistItem, R as Recommendation, k as Location, x as ShippingMethod, y as ShippingRate, D as DealValidation, C as Cart, H as ReferralStatus, I as ReferralEnrollment, i as LandingSection, Q as QRLandingData, h as LandingPageRenderData } from '../client-CUKv5fMM.js';
|
|
5
5
|
import { ThemeTokens } from '@neowhale/ui';
|
|
6
6
|
import * as zustand_middleware from 'zustand/middleware';
|
|
7
7
|
import * as zustand from 'zustand';
|
|
8
|
-
import { P as PixelManager } from '../pixel-manager-
|
|
8
|
+
import { P as PixelManager } from '../pixel-manager-DsrUxlIB.js';
|
|
9
9
|
|
|
10
10
|
interface WhaleProviderProps extends WhaleStorefrontConfig {
|
|
11
11
|
children: ReactNode;
|
package/dist/react/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PixelManager } from '../chunk-MZO7BCGU.js';
|
|
2
|
-
import { resilientSend, WhaleClient } from '../chunk-
|
|
2
|
+
import { resilientSend, WhaleClient } from '../chunk-2XODSXJT.js';
|
|
3
3
|
import { createContext, useContext, useRef, useCallback, useEffect, useState, useMemo } from 'react';
|
|
4
4
|
import { usePathname } from 'next/navigation';
|
|
5
5
|
import { createStore } from 'zustand/vanilla';
|
|
@@ -1866,6 +1866,7 @@ function useCustomerAnalytics() {
|
|
|
1866
1866
|
function useCheckout() {
|
|
1867
1867
|
const ctx = useContext(WhaleContext);
|
|
1868
1868
|
if (!ctx) throw new Error("useCheckout must be used within <WhaleProvider>");
|
|
1869
|
+
const { visitorId, getOrCreateSession: getAnalyticsSession } = useAnalytics();
|
|
1869
1870
|
const [session, setSession] = useState(null);
|
|
1870
1871
|
const [loading, setLoading] = useState(false);
|
|
1871
1872
|
const [error, setError] = useState(null);
|
|
@@ -1873,7 +1874,12 @@ function useCheckout() {
|
|
|
1873
1874
|
setLoading(true);
|
|
1874
1875
|
setError(null);
|
|
1875
1876
|
try {
|
|
1876
|
-
const
|
|
1877
|
+
const analyticsSessionId = await getAnalyticsSession().catch(() => void 0);
|
|
1878
|
+
const data = await ctx.client.createCheckoutSession({
|
|
1879
|
+
...params,
|
|
1880
|
+
visitor_id: visitorId,
|
|
1881
|
+
session_id: analyticsSessionId?.startsWith("local-") ? void 0 : analyticsSessionId
|
|
1882
|
+
});
|
|
1877
1883
|
setSession(data);
|
|
1878
1884
|
return data;
|
|
1879
1885
|
} catch (err) {
|