@appfunnel-dev/sdk 0.7.0 → 0.9.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/README.md +2 -80
- package/dist/elements/index.cjs +49 -4
- package/dist/elements/index.cjs.map +1 -1
- package/dist/elements/index.d.cts +19 -1
- package/dist/elements/index.d.ts +19 -1
- package/dist/elements/index.js +49 -5
- package/dist/elements/index.js.map +1 -1
- package/dist/index.cjs +759 -57
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +18 -7
- package/dist/index.d.ts +18 -7
- package/dist/index.js +761 -59
- package/dist/index.js.map +1 -1
- package/dist/{internal-C7seLJBr.d.cts → internal-C9MOEdND.d.cts} +11 -12
- package/dist/{internal-C7seLJBr.d.ts → internal-C9MOEdND.d.ts} +11 -12
- package/dist/internal.d.cts +1 -1
- package/dist/internal.d.ts +1 -1
- package/package.json +1 -1
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-
|
|
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-
|
|
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-C9MOEdND.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-C9MOEdND.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';
|
|
@@ -190,12 +190,12 @@ declare function useNavigation(): NavigationState;
|
|
|
190
190
|
declare function useProducts(): ProductsState;
|
|
191
191
|
|
|
192
192
|
/**
|
|
193
|
-
* Tracking hook — fire events
|
|
193
|
+
* Tracking hook — fire custom events.
|
|
194
194
|
*/
|
|
195
195
|
declare function useTracking(): TrackingState;
|
|
196
196
|
|
|
197
197
|
/**
|
|
198
|
-
* Payment hook — reads payment-related variables.
|
|
198
|
+
* Payment hook — reads payment-related variables and provides a purchase action.
|
|
199
199
|
*
|
|
200
200
|
* Only re-renders when payment/card variables change.
|
|
201
201
|
*/
|
|
@@ -283,11 +283,19 @@ interface StripePaymentFormProps {
|
|
|
283
283
|
mode?: 'checkout' | 'validate-only';
|
|
284
284
|
/** "elements" for PaymentElement, "embedded" for Stripe Embedded Checkout */
|
|
285
285
|
variant?: 'elements' | 'embedded';
|
|
286
|
-
/**
|
|
286
|
+
/** Page key to redirect to after successful embedded checkout (required for embedded variant) */
|
|
287
|
+
successPageKey?: string;
|
|
288
|
+
/** Enable Stripe automatic tax calculation (embedded variant only) */
|
|
289
|
+
automaticTax?: boolean;
|
|
290
|
+
/** Enable Stripe managed payments — Stripe controls tax, payment methods, etc. (embedded variant only, forces embedded mode) */
|
|
291
|
+
managedPayments?: boolean;
|
|
292
|
+
/** Allow promotion codes in checkout (embedded variant only) */
|
|
293
|
+
allowPromotionCodes?: boolean;
|
|
294
|
+
/** Called on successful payment (elements variant only — embedded uses returnUrl redirect) */
|
|
287
295
|
onSuccess?: () => void;
|
|
288
|
-
/** Called on payment error */
|
|
296
|
+
/** Called on payment error (elements variant only) */
|
|
289
297
|
onError?: (error: string) => void;
|
|
290
|
-
/** Called when the Stripe form is ready to accept submissions */
|
|
298
|
+
/** Called when the Stripe form is ready to accept submissions (elements variant only) */
|
|
291
299
|
onReady?: () => void;
|
|
292
300
|
/** Additional CSS class */
|
|
293
301
|
className?: string;
|
|
@@ -299,6 +307,9 @@ interface StripePaymentFormProps {
|
|
|
299
307
|
/**
|
|
300
308
|
* Stripe payment component supporting PaymentElement and Embedded Checkout.
|
|
301
309
|
*
|
|
310
|
+
* In dev mode (`globalThis.__APPFUNNEL_DEV__`), renders a demo form that
|
|
311
|
+
* simulates Stripe UI and emulates purchases without real Stripe calls.
|
|
312
|
+
*
|
|
302
313
|
* Use a ref to submit the form from an external button:
|
|
303
314
|
* ```tsx
|
|
304
315
|
* const paymentRef = useRef<StripePaymentHandle>(null)
|
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-
|
|
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-
|
|
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-C9MOEdND.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-C9MOEdND.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';
|
|
@@ -190,12 +190,12 @@ declare function useNavigation(): NavigationState;
|
|
|
190
190
|
declare function useProducts(): ProductsState;
|
|
191
191
|
|
|
192
192
|
/**
|
|
193
|
-
* Tracking hook — fire events
|
|
193
|
+
* Tracking hook — fire custom events.
|
|
194
194
|
*/
|
|
195
195
|
declare function useTracking(): TrackingState;
|
|
196
196
|
|
|
197
197
|
/**
|
|
198
|
-
* Payment hook — reads payment-related variables.
|
|
198
|
+
* Payment hook — reads payment-related variables and provides a purchase action.
|
|
199
199
|
*
|
|
200
200
|
* Only re-renders when payment/card variables change.
|
|
201
201
|
*/
|
|
@@ -283,11 +283,19 @@ interface StripePaymentFormProps {
|
|
|
283
283
|
mode?: 'checkout' | 'validate-only';
|
|
284
284
|
/** "elements" for PaymentElement, "embedded" for Stripe Embedded Checkout */
|
|
285
285
|
variant?: 'elements' | 'embedded';
|
|
286
|
-
/**
|
|
286
|
+
/** Page key to redirect to after successful embedded checkout (required for embedded variant) */
|
|
287
|
+
successPageKey?: string;
|
|
288
|
+
/** Enable Stripe automatic tax calculation (embedded variant only) */
|
|
289
|
+
automaticTax?: boolean;
|
|
290
|
+
/** Enable Stripe managed payments — Stripe controls tax, payment methods, etc. (embedded variant only, forces embedded mode) */
|
|
291
|
+
managedPayments?: boolean;
|
|
292
|
+
/** Allow promotion codes in checkout (embedded variant only) */
|
|
293
|
+
allowPromotionCodes?: boolean;
|
|
294
|
+
/** Called on successful payment (elements variant only — embedded uses returnUrl redirect) */
|
|
287
295
|
onSuccess?: () => void;
|
|
288
|
-
/** Called on payment error */
|
|
296
|
+
/** Called on payment error (elements variant only) */
|
|
289
297
|
onError?: (error: string) => void;
|
|
290
|
-
/** Called when the Stripe form is ready to accept submissions */
|
|
298
|
+
/** Called when the Stripe form is ready to accept submissions (elements variant only) */
|
|
291
299
|
onReady?: () => void;
|
|
292
300
|
/** Additional CSS class */
|
|
293
301
|
className?: string;
|
|
@@ -299,6 +307,9 @@ interface StripePaymentFormProps {
|
|
|
299
307
|
/**
|
|
300
308
|
* Stripe payment component supporting PaymentElement and Embedded Checkout.
|
|
301
309
|
*
|
|
310
|
+
* In dev mode (`globalThis.__APPFUNNEL_DEV__`), renders a demo form that
|
|
311
|
+
* simulates Stripe UI and emulates purchases without real Stripe calls.
|
|
312
|
+
*
|
|
302
313
|
* Use a ref to submit the form from an external button:
|
|
303
314
|
* ```tsx
|
|
304
315
|
* const paymentRef = useRef<StripePaymentHandle>(null)
|