@appfunnel-dev/sdk 0.11.0 → 0.13.0

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/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { A as AppFunnelConfig, P as PageDefinition, V as VariableValue, U as UserState, L as LocaleState, T as TranslationState, N as NavigationState, a as ProductsState, b as TrackingState, c as PaymentState, D as DeviceInfo, d as PageData, F as FunnelState } from './internal-BuotLNwa.cjs';
2
- export { C as ConditionConfig, e as ConditionGroupConfig, f as FunnelProvider, g as FunnelProviderProps, h as FunnelSettings, i as PageConfig, j as PageState, k as PageType, l as ProductConfig, m as ProductsConfig, n as Progress, R as RouteConfig, o as RuntimeProduct, p as VariableConfig, q as VariableType } from './internal-BuotLNwa.cjs';
1
+ import { A as AppFunnelConfig, P as PageDefinition, V as VariableValue, U as UserState, L as LocaleState, T as TranslationState, N as NavigationState, a as ProductsState, b as TrackingState, c as PaymentState, D as DeviceInfo, d as PageData, F as FunnelState } from './internal-twwb8xjX.cjs';
2
+ export { C as ConditionConfig, e as ConditionGroupConfig, f as FunnelProvider, g as FunnelProviderProps, h as FunnelSettings, i as PageConfig, j as PageState, k as PageType, l as ProductConfig, m as ProductsConfig, n as Progress, R as RouteConfig, o as RuntimeProduct, p as VariableConfig, q as VariableType } from './internal-twwb8xjX.cjs';
3
3
  import * as react from 'react';
4
4
  import { Appearance } from '@stripe/stripe-js';
5
5
  import * as react_jsx_runtime from 'react/jsx-runtime';
@@ -277,34 +277,50 @@ interface StripePaymentHandle {
277
277
  /** Programmatically submit the payment form */
278
278
  submit: () => Promise<void>;
279
279
  }
280
- interface StripePaymentFormProps {
280
+ interface StripePaymentFormBaseProps {
281
281
  /** Product ID override (default: currently selected product) */
282
282
  productId?: string;
283
283
  /** "checkout" for full payment, "validate-only" to just collect card */
284
284
  mode?: 'checkout' | 'validate-only';
285
+ /** Additional CSS class */
286
+ className?: string;
287
+ /** Stripe Appearance override */
288
+ appearance?: Appearance;
289
+ }
290
+ interface StripePaymentFormElementsProps extends StripePaymentFormBaseProps {
285
291
  /** "elements" for PaymentElement, "embedded" for Stripe Embedded Checkout */
286
- variant?: 'elements' | 'embedded';
287
- /** Page key to redirect to after successful embedded checkout (required for embedded variant) */
292
+ variant?: 'elements';
293
+ /** Page key to redirect to after successful embedded checkout */
288
294
  successPageKey?: string;
289
- /** Enable Stripe automatic tax calculation (embedded variant only) */
290
- automaticTax?: boolean;
291
- /** Enable Stripe managed payments — Stripe controls tax, payment methods, etc. (embedded variant only, forces embedded mode) */
292
- managedPayments?: boolean;
293
- /** Allow promotion codes in checkout (embedded variant only) */
294
- allowPromotionCodes?: boolean;
295
- /** Called on successful payment (elements variant only — embedded uses returnUrl redirect) */
295
+ /** Called on successful payment */
296
296
  onSuccess?: () => void;
297
- /** Called on payment error (elements variant only) */
297
+ /** Called on payment error */
298
298
  onError?: (error: string) => void;
299
- /** Called when the Stripe form is ready to accept submissions (elements variant only) */
299
+ /** Called when the Stripe form is ready to accept submissions */
300
300
  onReady?: () => void;
301
- /** Additional CSS class */
302
- className?: string;
303
- /** Stripe Appearance override (elements variant only) */
304
- appearance?: Appearance;
305
301
  /** PaymentElement layout option (default: 'tabs') */
306
302
  layout?: 'tabs' | 'accordion' | 'auto';
303
+ automaticTax?: never;
304
+ managedPayments?: never;
305
+ allowPromotionCodes?: never;
306
+ }
307
+ interface StripePaymentFormEmbeddedProps extends StripePaymentFormBaseProps {
308
+ /** "embedded" for Stripe Embedded Checkout */
309
+ variant: 'embedded';
310
+ /** Page key to redirect to after successful embedded checkout */
311
+ successPageKey: string;
312
+ /** Enable Stripe automatic tax calculation */
313
+ automaticTax?: boolean;
314
+ /** Enable Stripe managed payments — Stripe controls tax, payment methods, etc. (forces embedded mode) */
315
+ managedPayments?: boolean;
316
+ /** Allow promotion codes in checkout */
317
+ allowPromotionCodes?: boolean;
318
+ onSuccess?: never;
319
+ onError?: never;
320
+ onReady?: never;
321
+ layout?: never;
307
322
  }
323
+ type StripePaymentFormProps = StripePaymentFormElementsProps | StripePaymentFormEmbeddedProps;
308
324
  /**
309
325
  * Stripe payment component supporting PaymentElement and Embedded Checkout.
310
326
  *
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { A as AppFunnelConfig, P as PageDefinition, V as VariableValue, U as UserState, L as LocaleState, T as TranslationState, N as NavigationState, a as ProductsState, b as TrackingState, c as PaymentState, D as DeviceInfo, d as PageData, F as FunnelState } from './internal-BuotLNwa.js';
2
- export { C as ConditionConfig, e as ConditionGroupConfig, f as FunnelProvider, g as FunnelProviderProps, h as FunnelSettings, i as PageConfig, j as PageState, k as PageType, l as ProductConfig, m as ProductsConfig, n as Progress, R as RouteConfig, o as RuntimeProduct, p as VariableConfig, q as VariableType } from './internal-BuotLNwa.js';
1
+ import { A as AppFunnelConfig, P as PageDefinition, V as VariableValue, U as UserState, L as LocaleState, T as TranslationState, N as NavigationState, a as ProductsState, b as TrackingState, c as PaymentState, D as DeviceInfo, d as PageData, F as FunnelState } from './internal-twwb8xjX.js';
2
+ export { C as ConditionConfig, e as ConditionGroupConfig, f as FunnelProvider, g as FunnelProviderProps, h as FunnelSettings, i as PageConfig, j as PageState, k as PageType, l as ProductConfig, m as ProductsConfig, n as Progress, R as RouteConfig, o as RuntimeProduct, p as VariableConfig, q as VariableType } from './internal-twwb8xjX.js';
3
3
  import * as react from 'react';
4
4
  import { Appearance } from '@stripe/stripe-js';
5
5
  import * as react_jsx_runtime from 'react/jsx-runtime';
@@ -277,34 +277,50 @@ interface StripePaymentHandle {
277
277
  /** Programmatically submit the payment form */
278
278
  submit: () => Promise<void>;
279
279
  }
280
- interface StripePaymentFormProps {
280
+ interface StripePaymentFormBaseProps {
281
281
  /** Product ID override (default: currently selected product) */
282
282
  productId?: string;
283
283
  /** "checkout" for full payment, "validate-only" to just collect card */
284
284
  mode?: 'checkout' | 'validate-only';
285
+ /** Additional CSS class */
286
+ className?: string;
287
+ /** Stripe Appearance override */
288
+ appearance?: Appearance;
289
+ }
290
+ interface StripePaymentFormElementsProps extends StripePaymentFormBaseProps {
285
291
  /** "elements" for PaymentElement, "embedded" for Stripe Embedded Checkout */
286
- variant?: 'elements' | 'embedded';
287
- /** Page key to redirect to after successful embedded checkout (required for embedded variant) */
292
+ variant?: 'elements';
293
+ /** Page key to redirect to after successful embedded checkout */
288
294
  successPageKey?: string;
289
- /** Enable Stripe automatic tax calculation (embedded variant only) */
290
- automaticTax?: boolean;
291
- /** Enable Stripe managed payments — Stripe controls tax, payment methods, etc. (embedded variant only, forces embedded mode) */
292
- managedPayments?: boolean;
293
- /** Allow promotion codes in checkout (embedded variant only) */
294
- allowPromotionCodes?: boolean;
295
- /** Called on successful payment (elements variant only — embedded uses returnUrl redirect) */
295
+ /** Called on successful payment */
296
296
  onSuccess?: () => void;
297
- /** Called on payment error (elements variant only) */
297
+ /** Called on payment error */
298
298
  onError?: (error: string) => void;
299
- /** Called when the Stripe form is ready to accept submissions (elements variant only) */
299
+ /** Called when the Stripe form is ready to accept submissions */
300
300
  onReady?: () => void;
301
- /** Additional CSS class */
302
- className?: string;
303
- /** Stripe Appearance override (elements variant only) */
304
- appearance?: Appearance;
305
301
  /** PaymentElement layout option (default: 'tabs') */
306
302
  layout?: 'tabs' | 'accordion' | 'auto';
303
+ automaticTax?: never;
304
+ managedPayments?: never;
305
+ allowPromotionCodes?: never;
306
+ }
307
+ interface StripePaymentFormEmbeddedProps extends StripePaymentFormBaseProps {
308
+ /** "embedded" for Stripe Embedded Checkout */
309
+ variant: 'embedded';
310
+ /** Page key to redirect to after successful embedded checkout */
311
+ successPageKey: string;
312
+ /** Enable Stripe automatic tax calculation */
313
+ automaticTax?: boolean;
314
+ /** Enable Stripe managed payments — Stripe controls tax, payment methods, etc. (forces embedded mode) */
315
+ managedPayments?: boolean;
316
+ /** Allow promotion codes in checkout */
317
+ allowPromotionCodes?: boolean;
318
+ onSuccess?: never;
319
+ onError?: never;
320
+ onReady?: never;
321
+ layout?: never;
307
322
  }
323
+ type StripePaymentFormProps = StripePaymentFormElementsProps | StripePaymentFormEmbeddedProps;
308
324
  /**
309
325
  * Stripe payment component supporting PaymentElement and Embedded Checkout.
310
326
  *
package/dist/index.js CHANGED
@@ -1,11 +1,11 @@
1
- import { useNavigation, useResponses } from './chunk-GZKA33W2.js';
2
- export { useNavigation, useResponse, useResponses } from './chunk-GZKA33W2.js';
3
- import { useFunnelContext } from './chunk-DAHMOQ63.js';
4
- export { FunnelProvider, registerIntegration } from './chunk-DAHMOQ63.js';
1
+ import { useNavigation, useResponses } from './chunk-CMVB7RQE.js';
2
+ export { useNavigation, useResponse, useResponses } from './chunk-CMVB7RQE.js';
3
+ import { useFunnelContext } from './chunk-EB5VWGR4.js';
4
+ export { FunnelProvider, registerIntegration } from './chunk-EB5VWGR4.js';
5
5
  import { forwardRef, useMemo, useRef, useEffect, useCallback, useImperativeHandle, useState, useSyncExternalStore } from 'react';
6
+ import { loadStripe } from '@stripe/stripe-js';
6
7
  import { toast } from 'sonner';
7
8
  export { toast } from 'sonner';
8
- import { loadStripe } from '@stripe/stripe-js';
9
9
  import { useStripe, useElements, PaymentElement, EmbeddedCheckoutProvider, EmbeddedCheckout, Elements } from '@stripe/react-stripe-js';
10
10
  import { jsx, jsxs } from 'react/jsx-runtime';
11
11
 
@@ -447,8 +447,7 @@ function usePayment() {
447
447
  console.log(
448
448
  "[Purchase] 3DS authentication required, loading Stripe..."
449
449
  );
450
- const { loadStripe: loadStripe2 } = await import('@stripe/stripe-js');
451
- const stripeInstance = await loadStripe2(
450
+ const stripeInstance = await loadStripe(
452
451
  result.publishableKey
453
452
  );
454
453
  if (!stripeInstance) {