@appfunnel-dev/sdk 2.0.0-canary.8 → 2.0.0-canary.9
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/{capabilities-CsnkVwna.d.cts → capabilities-Dq22RCr_.d.cts} +34 -1
- package/dist/{capabilities-CsnkVwna.d.ts → capabilities-Dq22RCr_.d.ts} +34 -1
- package/dist/{checkout-3PkKwPd7.d.ts → checkout-ClaO5IYV.d.ts} +17 -4
- package/dist/{checkout-Cg20l53c.d.cts → checkout-DBp4bCpC.d.cts} +17 -4
- package/dist/{chunk-RY3LOSVZ.cjs → chunk-7JLOF6CJ.cjs} +27 -5
- package/dist/chunk-7JLOF6CJ.cjs.map +1 -0
- package/dist/{chunk-PWXMQGO6.js → chunk-JAO6AA4R.js} +3 -3
- package/dist/{chunk-PWXMQGO6.js.map → chunk-JAO6AA4R.js.map} +1 -1
- package/dist/{chunk-RVJLR4RS.js → chunk-OXQBEKZ5.js} +25 -6
- package/dist/chunk-OXQBEKZ5.js.map +1 -0
- package/dist/{chunk-FY3TMSRU.cjs → chunk-VV7TFC64.cjs} +7 -7
- package/dist/{chunk-FY3TMSRU.cjs.map → chunk-VV7TFC64.cjs.map} +1 -1
- package/dist/driver-paddle.cjs +26 -24
- package/dist/driver-paddle.cjs.map +1 -1
- package/dist/driver-paddle.d.cts +2 -2
- package/dist/driver-paddle.d.ts +2 -2
- package/dist/driver-paddle.js +6 -4
- package/dist/driver-paddle.js.map +1 -1
- package/dist/driver-stripe.cjs +32 -26
- package/dist/driver-stripe.cjs.map +1 -1
- package/dist/driver-stripe.d.cts +2 -2
- package/dist/driver-stripe.d.ts +2 -2
- package/dist/driver-stripe.js +10 -4
- package/dist/driver-stripe.js.map +1 -1
- package/dist/index.cjs +48 -21
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +18 -3
- package/dist/index.js.map +1 -1
- package/dist/manifest-entry.cjs +24 -12
- package/dist/manifest-entry.d.cts +2 -2
- package/dist/manifest-entry.d.ts +2 -2
- package/dist/manifest-entry.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-RVJLR4RS.js.map +0 -1
- package/dist/chunk-RY3LOSVZ.cjs.map +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -3,11 +3,11 @@ import { ReactNode, ComponentType, ButtonHTMLAttributes } from 'react';
|
|
|
3
3
|
import { V as VariableValue, a as VariableConfig, A as Acquisition, O as Offering, D as Direction, F as FunnelContext, R as RuntimeExperiment, b as FunnelSnapshot, c as FunnelDefinition, d as buildContext, e as OfferingInput, P as PageMeta, f as PageContext } from './manifest-B3Tdab0M.cjs';
|
|
4
4
|
export { B as BrowserContext, g as BuildContextOptions, C as ClickIdContext, h as CompileInput, i as Condition, j as ConditionOp, k as DeviceContext, E as EdgeCondition, l as ExperimentArm, m as ExperimentResolution, n as FlowPage, o as FunnelLocales, p as FunnelManifest, G as Gate, I as IdentityContext, q as Interval, L as LocaleContext, M as ManifestEdge, r as ManifestPage, s as ManifestValidation, t as Money, u as OsContext, v as PageType, w as Predicate, x as ResolvedOffering, y as Route, S as SessionContext, z as SystemContext, U as UtmContext, H as assignVariant, J as bucketingSeed, K as buildAcquisition, N as buildCatalog, Q as compileManifest, T as currencyExponent, W as defineFunnel, X as definePage, Y as entryGuard, Z as evaluateCondition, _ as evaluateGate, $ as expectedPathLength, a0 as fnv1a, a1 as formatMoney, a2 as formatOffering, a3 as hashToUnit, a4 as isRtl, a5 as isVariantKey, a6 as nextPage, a7 as outgoingKeys, a8 as pageMeta, a9 as parseSlotKey, aa as pickByWeight, ab as resolveExperiments, ac as resolveLocale, ad as resolveOffering, ae as resolveRoute } from './manifest-B3Tdab0M.cjs';
|
|
5
5
|
import { NavSnapshot } from './protocol.cjs';
|
|
6
|
-
import { a as CheckoutDriver, C as CheckoutDriverContext } from './checkout-
|
|
7
|
-
export { b as Checkout, c as CheckoutCallbacks, d as CheckoutHandle, e as CheckoutProps, f as CheckoutRequest, g as CheckoutResult, h as CheckoutResume, i as CheckoutStatus, F as FailureModalProps, j as FailureRoute, M as MockDriverOptions, O as OnFailedMap, U as Upsell, k as UpsellProps, l as UseCheckoutOptions, m as createMockDriver, n as driverWithEmail, u as useCheckout } from './checkout-
|
|
6
|
+
import { a as CheckoutDriver, C as CheckoutDriverContext } from './checkout-DBp4bCpC.cjs';
|
|
7
|
+
export { b as Checkout, c as CheckoutCallbacks, d as CheckoutHandle, e as CheckoutProps, f as CheckoutRequest, g as CheckoutResult, h as CheckoutResume, i as CheckoutStatus, F as FailureModalProps, j as FailureRoute, M as MockDriverOptions, O as OnFailedMap, U as Upsell, k as UpsellProps, l as UseCheckoutOptions, m as createMockDriver, n as driverWithEmail, u as useCheckout } from './checkout-DBp4bCpC.cjs';
|
|
8
8
|
import { ToasterProps } from 'sonner';
|
|
9
9
|
export { ToasterProps, toast } from 'sonner';
|
|
10
|
-
export { C as CheckoutError, a as CheckoutErrorCategory, b as CheckoutIntent, c as CheckoutProvider, d as CheckoutSurface, I as INLINE_SURFACES, O as OffSessionReliability, P as PROVIDER_PROFILES, e as ProviderProfile, S as SurfaceCapability, U as UpsellKind, V as ValidationResult,
|
|
10
|
+
export { C as CheckoutError, a as CheckoutErrorCategory, b as CheckoutIntent, c as CheckoutProvider, d as CheckoutSurface, D as DeviceClass, I as INLINE_SURFACES, O as OffSessionReliability, P as PROVIDER_PROFILES, e as ProviderProfile, S as SurfaceCapability, f as SurfacePreference, U as UpsellKind, V as ValidationResult, g as checkoutError, i as isInlineSurface, h as isMerchantOfRecord, j as isOrchestrator, k as isRenderableSurface, r as renderableSurfaces, l as resolveSurface, s as surfacesFor, v as validateCheckout, m as validateUpsell } from './capabilities-Dq22RCr_.cjs';
|
|
11
11
|
|
|
12
12
|
declare class VariableStore {
|
|
13
13
|
private state;
|
package/dist/index.d.ts
CHANGED
|
@@ -3,11 +3,11 @@ import { ReactNode, ComponentType, ButtonHTMLAttributes } from 'react';
|
|
|
3
3
|
import { V as VariableValue, a as VariableConfig, A as Acquisition, O as Offering, D as Direction, F as FunnelContext, R as RuntimeExperiment, b as FunnelSnapshot, c as FunnelDefinition, d as buildContext, e as OfferingInput, P as PageMeta, f as PageContext } from './manifest-B3Tdab0M.js';
|
|
4
4
|
export { B as BrowserContext, g as BuildContextOptions, C as ClickIdContext, h as CompileInput, i as Condition, j as ConditionOp, k as DeviceContext, E as EdgeCondition, l as ExperimentArm, m as ExperimentResolution, n as FlowPage, o as FunnelLocales, p as FunnelManifest, G as Gate, I as IdentityContext, q as Interval, L as LocaleContext, M as ManifestEdge, r as ManifestPage, s as ManifestValidation, t as Money, u as OsContext, v as PageType, w as Predicate, x as ResolvedOffering, y as Route, S as SessionContext, z as SystemContext, U as UtmContext, H as assignVariant, J as bucketingSeed, K as buildAcquisition, N as buildCatalog, Q as compileManifest, T as currencyExponent, W as defineFunnel, X as definePage, Y as entryGuard, Z as evaluateCondition, _ as evaluateGate, $ as expectedPathLength, a0 as fnv1a, a1 as formatMoney, a2 as formatOffering, a3 as hashToUnit, a4 as isRtl, a5 as isVariantKey, a6 as nextPage, a7 as outgoingKeys, a8 as pageMeta, a9 as parseSlotKey, aa as pickByWeight, ab as resolveExperiments, ac as resolveLocale, ad as resolveOffering, ae as resolveRoute } from './manifest-B3Tdab0M.js';
|
|
5
5
|
import { NavSnapshot } from './protocol.js';
|
|
6
|
-
import { a as CheckoutDriver, C as CheckoutDriverContext } from './checkout-
|
|
7
|
-
export { b as Checkout, c as CheckoutCallbacks, d as CheckoutHandle, e as CheckoutProps, f as CheckoutRequest, g as CheckoutResult, h as CheckoutResume, i as CheckoutStatus, F as FailureModalProps, j as FailureRoute, M as MockDriverOptions, O as OnFailedMap, U as Upsell, k as UpsellProps, l as UseCheckoutOptions, m as createMockDriver, n as driverWithEmail, u as useCheckout } from './checkout-
|
|
6
|
+
import { a as CheckoutDriver, C as CheckoutDriverContext } from './checkout-ClaO5IYV.js';
|
|
7
|
+
export { b as Checkout, c as CheckoutCallbacks, d as CheckoutHandle, e as CheckoutProps, f as CheckoutRequest, g as CheckoutResult, h as CheckoutResume, i as CheckoutStatus, F as FailureModalProps, j as FailureRoute, M as MockDriverOptions, O as OnFailedMap, U as Upsell, k as UpsellProps, l as UseCheckoutOptions, m as createMockDriver, n as driverWithEmail, u as useCheckout } from './checkout-ClaO5IYV.js';
|
|
8
8
|
import { ToasterProps } from 'sonner';
|
|
9
9
|
export { ToasterProps, toast } from 'sonner';
|
|
10
|
-
export { C as CheckoutError, a as CheckoutErrorCategory, b as CheckoutIntent, c as CheckoutProvider, d as CheckoutSurface, I as INLINE_SURFACES, O as OffSessionReliability, P as PROVIDER_PROFILES, e as ProviderProfile, S as SurfaceCapability, U as UpsellKind, V as ValidationResult,
|
|
10
|
+
export { C as CheckoutError, a as CheckoutErrorCategory, b as CheckoutIntent, c as CheckoutProvider, d as CheckoutSurface, D as DeviceClass, I as INLINE_SURFACES, O as OffSessionReliability, P as PROVIDER_PROFILES, e as ProviderProfile, S as SurfaceCapability, f as SurfacePreference, U as UpsellKind, V as ValidationResult, g as checkoutError, i as isInlineSurface, h as isMerchantOfRecord, j as isOrchestrator, k as isRenderableSurface, r as renderableSurfaces, l as resolveSurface, s as surfacesFor, v as validateCheckout, m as validateUpsell } from './capabilities-Dq22RCr_.js';
|
|
11
11
|
|
|
12
12
|
declare class VariableStore {
|
|
13
13
|
private state;
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { isRtl, formatOffering, bucketingSeed, resolveExperiments, entryGuard, evaluateGate, expectedPathLength, nextPage, outgoingKeys, buildCatalog, resolveLocale } from './chunk-VW2HVPR4.js';
|
|
2
2
|
export { assignVariant, bucketingSeed, buildCatalog, compileManifest, currencyExponent, defineFunnel, definePage, entryGuard, evaluateCondition, evaluateGate, expectedPathLength, fnv1a, formatMoney, formatOffering, hashToUnit, isRtl, isVariantKey, nextPage, outgoingKeys, pageMeta, parseSlotKey, pickByWeight, resolveExperiments, resolveLocale, resolveOffering, resolveRoute } from './chunk-VW2HVPR4.js';
|
|
3
3
|
import { AF_PROTOCOL } from './chunk-ZZJG4EYL.js';
|
|
4
|
-
import { checkoutError, isInlineSurface, PROVIDER_PROFILES } from './chunk-
|
|
5
|
-
export { INLINE_SURFACES, PROVIDER_PROFILES, checkoutError, isInlineSurface, isMerchantOfRecord, isOrchestrator, surfacesFor, validateCheckout, validateUpsell } from './chunk-
|
|
4
|
+
import { checkoutError, resolveSurface, isInlineSurface, PROVIDER_PROFILES } from './chunk-OXQBEKZ5.js';
|
|
5
|
+
export { INLINE_SURFACES, PROVIDER_PROFILES, checkoutError, isInlineSurface, isMerchantOfRecord, isOrchestrator, isRenderableSurface, renderableSurfaces, resolveSurface, surfacesFor, validateCheckout, validateUpsell } from './chunk-OXQBEKZ5.js';
|
|
6
6
|
import './chunk-G3PMV62Z.js';
|
|
7
7
|
import React, { createContext, createElement, useCallback, useContext, useMemo, lazy, useRef, useState, useEffect, useTransition, Suspense, Fragment, isValidElement, cloneElement, useReducer, useSyncExternalStore } from 'react';
|
|
8
8
|
import ReactDOM, { createPortal } from 'react-dom';
|
|
@@ -1720,9 +1720,21 @@ function trigger(onClick, {
|
|
|
1720
1720
|
children ?? "Continue"
|
|
1721
1721
|
);
|
|
1722
1722
|
}
|
|
1723
|
+
function detectDeviceClass() {
|
|
1724
|
+
if (typeof window === "undefined") return "desktop";
|
|
1725
|
+
const ua = navigator.userAgent?.toLowerCase() ?? "";
|
|
1726
|
+
if (/mobile|android(?!.*tablet)|iphone|ipod/.test(ua)) return "mobile";
|
|
1727
|
+
try {
|
|
1728
|
+
if (window.matchMedia?.("(pointer: coarse)").matches && window.innerWidth > 0 && window.innerWidth < 768) {
|
|
1729
|
+
return "mobile";
|
|
1730
|
+
}
|
|
1731
|
+
} catch {
|
|
1732
|
+
}
|
|
1733
|
+
return "desktop";
|
|
1734
|
+
}
|
|
1723
1735
|
function Checkout({
|
|
1724
1736
|
offering,
|
|
1725
|
-
surface,
|
|
1737
|
+
surface: surfacePreference,
|
|
1726
1738
|
asChild,
|
|
1727
1739
|
children,
|
|
1728
1740
|
className,
|
|
@@ -1730,6 +1742,9 @@ function Checkout({
|
|
|
1730
1742
|
}) {
|
|
1731
1743
|
const product = offering;
|
|
1732
1744
|
const driver = useDriver();
|
|
1745
|
+
const [surface] = useState(
|
|
1746
|
+
() => resolveSurface(driver.provider, surfacePreference, detectDeviceClass())
|
|
1747
|
+
);
|
|
1733
1748
|
const checkout = useCheckout(options);
|
|
1734
1749
|
const intent = options.intent ?? "purchase";
|
|
1735
1750
|
if (isInlineSurface(surface)) {
|