import { type BridgeInputs } from "../web-view/build-paywall-context"; import { type InputSelectionsByFieldId } from "../../stores/input-selections.svelte"; import { type InitialInputSelections } from "../../stores/inputValidation"; import type { ColorMode } from "../../types"; import type { ColorScheme } from "../../types/colors"; import type { CompleteWorkflowNavigateArgs } from "../../types/components/button"; import type { ReservedAttribute } from "../../types/components/input-text"; import type { FunnelConditionEvaluator } from "../../types/overrides"; import type { PaywallData } from "../../types/paywall"; import type { OnComponentInteraction } from "../../types/paywall-component-interaction"; import type { UIConfig } from "../../types/ui-config"; import { type CustomVariables, type PackageInfo, type VariableDictionary } from "../../types/variables"; import type { WalletButtonRender, WalletPurchasePrepare, WalletPurchaseStart } from "../../types/wallet"; import type { PaywallOffering, PaywallPackage, PaywallWorkflow } from "@revenuecat/workflow-web-components-sdk"; /** * Props are captured once at mount and are not reactive to subsequent changes. * The paywall should be remounted to reflect new prop values. */ interface Props { paywallData: PaywallData; selectedLocale?: string; variablesPerPackage?: Record; /** * Global variables that are available independent of package selection. * Useful for success screens, confirmation flows, and other contexts where variables * aren't tied to a specific package. Package-specific variables from variablesPerPackage * will override global variables when both are present. */ globalVariables?: VariableDictionary; infoPerPackage?: Record; uiConfig: UIConfig; preferredColorMode?: ColorMode; onPurchaseClicked?: (selectedPackageId: string, actionId: string) => void; onBackClicked?: () => void; /** Called when a `close_workflow` button is pressed to dismiss the paywall/workflow. */ onClose?: () => void; onVisitCustomerCenterClicked?: () => void; onCookieSettingsClicked?: () => void; onRestorePurchasesClicked?: () => void; onNavigateToUrlClicked?: (url: string) => void; /** * Called when a complete_workflow button is pressed. The URL is localized; * the host merges `url_query_params` (e.g. `app_user_id`) if needed. */ onCompleteWorkflowNavigate?: (args: CompleteWorkflowNavigateArgs) => void | Promise; onActionTriggered?: (actionId: string) => void; onComponentInteraction?: OnComponentInteraction; onError?: (error: unknown) => void; hideBackButtons?: boolean; /** * Set when the host can handle native actions (e.g. a native app bridge). * Renders `restore_purchases` buttons, which stay hidden otherwise. */ renderNative?: boolean; walletButtonRender?: WalletButtonRender; prepareWalletPurchase?: WalletPurchasePrepare; onWalletPurchaseClicked?: WalletPurchaseStart; appUserId?: string; isSandbox?: boolean; rcSource?: string; onCustomWebCheckout?: (url: string) => void; onInputChanged?: (fieldId: string, value: string, actionId?: string) => void; /** * Called for sensitive inputs (keyboard_type: "password") instead of * onInputChanged, so hosts can keep the value in memory only. */ onSensitiveInputChanged?: (fieldId: string, value: string) => void; onReservedAttributeChanged?: (reservedAttribute: ReservedAttribute, value: string) => void; maxContentWidth?: string; initialInputSelections?: InitialInputSelections; /** * Choice input answers from earlier funnel screens (field_id → selected * option ids), so input conditions can match them. Once a choice input on * this screen is answered (selected, or restored through * `initialInputSelections`), its answer wins for that field_id. Ignored * inside a Workflow, which tracks answers across its own screens. */ inputSelectionsByFieldId?: InputSelectionsByFieldId; /** * Evaluates a `funnel_condition` rule's JSON Logic `logic` against the * funnel's state, returning whether it matches. Without it, funnel * conditions never match. Inside a Workflow, the Workflow's evaluator is * used instead. */ evaluateFunnelCondition?: FunnelConditionEvaluator; /** * Custom variables to pass to the paywall for text substitution. * Use `{{ custom.variable_name }}` syntax in your paywall text to reference these values. * Keys must start with a letter and can only contain letters, numbers, and underscores. * * @example * ```typescript * customVariables: { * 'player_name': CustomVariableValue.string('John'), * 'level': CustomVariableValue.string('42'), * } * ``` */ customVariables?: CustomVariables; /** * Optional baseline safe-area colour applied when the paywall background * can't derive one and `background.safe_area_fallback_color` is unset. * Hosts (e.g. workflow runtimes) pass their workflow-level fallback here. */ safeAreaFallbackColor?: ColorScheme | null; offering?: PaywallOffering | null; packages?: PaywallPackage[]; workflow?: PaywallWorkflow; isPreview?: boolean; inputs?: BridgeInputs; /** * Keeps the header and sticky footer in normal flow instead of using * `position: sticky`. Use when the paywall fills a fixed-size box that no * ancestor scrolls, e.g. a device frame scaled with `transform`, where * WebKit resolves sticky offsets against the scaled size and pins the * footer partway up the paywall. The paywall still scrolls its own content. * * This may not be used for rendering in a container smaller than the * paywall itself, thus only for our own previews, such as in MCP Apps * * See sticky footer implementation below: * "stays visible when an ancestor scrollport is shorter than the paywall" */ disableStickyPositioning?: boolean; } declare const Paywall: import("svelte").Component; type Paywall = ReturnType; export default Paywall;