@aifeatures/react 0.21.0 → 0.23.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.cjs +2 -2
- package/dist/index.d.cts +138 -10
- package/dist/index.d.ts +138 -10
- package/dist/index.js +2 -2
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -92,6 +92,102 @@ declare namespace AifeaturesCaptcha {
|
|
|
92
92
|
var neverConsentGate: string;
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
+
interface MarketingOptInProps {
|
|
96
|
+
/**
|
|
97
|
+
* Visible text saying what the visitor agrees to (e.g. "Email me news and
|
|
98
|
+
* offers from Wave Bye"). Required: it is rendered inside the checkbox's
|
|
99
|
+
* <label>, so it is also the checkbox's accessible name.
|
|
100
|
+
*/
|
|
101
|
+
label: ReactNode;
|
|
102
|
+
/** Called with the box's state on every change (checkout buttons use it). */
|
|
103
|
+
onChange?: (checked: boolean) => void;
|
|
104
|
+
/** Class name for the <label> wrapper */
|
|
105
|
+
className?: string;
|
|
106
|
+
style?: CSSProperties;
|
|
107
|
+
/**
|
|
108
|
+
* Not supported: consent must be an affirmative tick, so the box always
|
|
109
|
+
* starts unchecked. Typed `never` so a pre-ticked usage fails type-check;
|
|
110
|
+
* a value passed anyway is ignored.
|
|
111
|
+
*/
|
|
112
|
+
checked?: never;
|
|
113
|
+
/** Not supported — see `checked`. */
|
|
114
|
+
defaultChecked?: never;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* An unticked "email me" checkbox for marketing consent.
|
|
118
|
+
*
|
|
119
|
+
* Inside an aifeatures form it posts `_marketing_opt_in=true` only when the
|
|
120
|
+
* visitor ticks it — an unticked checkbox posts nothing, so the submission is
|
|
121
|
+
* stored as a non-mailable contact. It always renders unchecked: `checked`
|
|
122
|
+
* and `defaultChecked` are ignored, because a pre-ticked box is not consent.
|
|
123
|
+
*
|
|
124
|
+
* Use it on contact/quote/booking forms. A form whose only job is newsletter
|
|
125
|
+
* signup should use `<NewsletterSignup>` instead (submitting it IS the
|
|
126
|
+
* opt-in, so it needs no box).
|
|
127
|
+
*
|
|
128
|
+
* @example
|
|
129
|
+
* ```tsx
|
|
130
|
+
* <form action={`https://aifeatures.dev/f/${formId}`} method="POST">
|
|
131
|
+
* <input name="email" type="email" required />
|
|
132
|
+
* <MarketingOptIn label="Email me news and offers" />
|
|
133
|
+
* <AifeaturesCaptcha formId={formId} />
|
|
134
|
+
* <button type="submit">Send</button>
|
|
135
|
+
* </form>
|
|
136
|
+
* ```
|
|
137
|
+
*/
|
|
138
|
+
declare function MarketingOptIn({ label, onChange, className, style }: MarketingOptInProps): react_jsx_runtime.JSX.Element;
|
|
139
|
+
declare namespace MarketingOptIn {
|
|
140
|
+
var neverConsentGate: string;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* The marketing part of a JSON form-submit response (POST /f/:formId with
|
|
145
|
+
* `Accept: application/json`). `pending` = the site uses double opt-in and a
|
|
146
|
+
* confirmation email is on its way; `subscribed` = mailable now. Absent on
|
|
147
|
+
* older API deployments, when email marketing is off, and when the signup
|
|
148
|
+
* was not captured — read as a plain acknowledgement that claims nothing.
|
|
149
|
+
*/
|
|
150
|
+
interface FormSubmitMarketing {
|
|
151
|
+
status: 'pending' | 'subscribed';
|
|
152
|
+
}
|
|
153
|
+
interface NewsletterSignupProps {
|
|
154
|
+
/**
|
|
155
|
+
* Form ID from aifeatures. The form must have purpose `newsletter` (set
|
|
156
|
+
* server-side) — submitting it is the visitor's opt-in.
|
|
157
|
+
*/
|
|
158
|
+
formId: string;
|
|
159
|
+
/** API base override; falls back to AifeaturesProvider, then https://aifeatures.dev. */
|
|
160
|
+
apiUrl?: string;
|
|
161
|
+
/** Visible label for the email field (default "Email address"). */
|
|
162
|
+
label?: string;
|
|
163
|
+
/** Submit button text (default "Subscribe"). */
|
|
164
|
+
buttonText?: string;
|
|
165
|
+
/** Class name for the wrapper */
|
|
166
|
+
className?: string;
|
|
167
|
+
/** Class name for the email <input> */
|
|
168
|
+
inputClassName?: string;
|
|
169
|
+
/** Class name for the submit <button> */
|
|
170
|
+
buttonClassName?: string;
|
|
171
|
+
style?: CSSProperties;
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* A newsletter signup form: one explicit `email` field, the Turnstile check,
|
|
175
|
+
* and "unsubscribe anytime" copy. Posts to an aifeatures form whose purpose
|
|
176
|
+
* is `newsletter`, so submitting it is the opt-in — no checkbox.
|
|
177
|
+
*
|
|
178
|
+
* After submit it says "check your email to confirm" when the API reports the
|
|
179
|
+
* contact pending (double opt-in sites), "thanks for subscribing" only when
|
|
180
|
+
* it reports them subscribed, and a plain acknowledgement otherwise (no
|
|
181
|
+
* marketing result: it cannot say the visitor is on the list), announced
|
|
182
|
+
* through an aria-live region.
|
|
183
|
+
*
|
|
184
|
+
* Unstyled beyond layout — pass className props to match the site.
|
|
185
|
+
*/
|
|
186
|
+
declare function NewsletterSignup({ formId, apiUrl: explicitApiUrl, label, buttonText, className, inputClassName, buttonClassName, style, }: NewsletterSignupProps): react_jsx_runtime.JSX.Element;
|
|
187
|
+
declare namespace NewsletterSignup {
|
|
188
|
+
var neverConsentGate: string;
|
|
189
|
+
}
|
|
190
|
+
|
|
95
191
|
/** One selectable value of an option (e.g. "L" of "Size"). */
|
|
96
192
|
interface PublicOptionValue {
|
|
97
193
|
id: string;
|
|
@@ -278,6 +374,15 @@ interface PublicProduct {
|
|
|
278
374
|
purchasable?: boolean;
|
|
279
375
|
/** Whether the site's Stripe account can currently take payments. */
|
|
280
376
|
payments_ready: boolean;
|
|
377
|
+
/**
|
|
378
|
+
* Which marketing-consent box checkout uses — a SITE-level fact surfaced
|
|
379
|
+
* per product. `'stripe'`: Stripe Checkout shows its own consent box (US
|
|
380
|
+
* stores with checkout consent on), so the page shows none. `'onsite'`:
|
|
381
|
+
* BuyButton / CartCheckoutButton render an unticked "email me" box and send
|
|
382
|
+
* `marketing_opt_in: true` when it is ticked. Absent (marketing email not
|
|
383
|
+
* enabled for the site, or an older API): no box at all.
|
|
384
|
+
*/
|
|
385
|
+
checkout_consent?: 'stripe' | 'onsite';
|
|
281
386
|
/**
|
|
282
387
|
* Option axes for a multi-variant product (empty for single-variant). Feed
|
|
283
388
|
* these plus `variants` to `<VariantPicker>` to resolve a variant id.
|
|
@@ -498,6 +603,12 @@ interface StartCheckoutOptions {
|
|
|
498
603
|
cancelUrl?: string;
|
|
499
604
|
/** Prefills the email field on the Stripe Checkout page. */
|
|
500
605
|
customerEmail?: string;
|
|
606
|
+
/**
|
|
607
|
+
* The buyer ticked the on-site "email me" box (see
|
|
608
|
+
* `PublicProduct.checkout_consent`). Sends `marketing_opt_in: true` only
|
|
609
|
+
* when true; anything else sends nothing.
|
|
610
|
+
*/
|
|
611
|
+
marketingOptIn?: boolean;
|
|
501
612
|
/**
|
|
502
613
|
* Subscription selling plan to buy (subscriptions Unit 8). Present =
|
|
503
614
|
* subscription-mode checkout: quantity is locked at 1 (any `quantity`
|
|
@@ -731,6 +842,13 @@ interface UseCartItemsResult {
|
|
|
731
842
|
* nothing in both cases, and NEVER read null as "ships nowhere".
|
|
732
843
|
*/
|
|
733
844
|
shippingCountries: string[] | null;
|
|
845
|
+
/**
|
|
846
|
+
* ORDER-LEVEL checkout consent mode — the first non-null
|
|
847
|
+
* `checkout_consent` from any resolved line's product (a site-level fact).
|
|
848
|
+
* `'onsite'` = render an unticked "email me" box and pass its state as
|
|
849
|
+
* `marketingOptIn`; `'stripe'` or null = render no box.
|
|
850
|
+
*/
|
|
851
|
+
checkoutConsent: 'stripe' | 'onsite' | null;
|
|
734
852
|
/** True while a resolution pass is running. */
|
|
735
853
|
loading: boolean;
|
|
736
854
|
/** Set when some product reads failed transiently (lines marked `error`). */
|
|
@@ -896,6 +1014,12 @@ interface StartCartCheckoutOptions {
|
|
|
896
1014
|
cancelUrl?: string;
|
|
897
1015
|
/** Prefills the email field on the Stripe Checkout page. */
|
|
898
1016
|
customerEmail?: string;
|
|
1017
|
+
/**
|
|
1018
|
+
* The buyer ticked the on-site "email me" box (see
|
|
1019
|
+
* `UseCartItemsResult.checkoutConsent`). Sends `marketing_opt_in: true`
|
|
1020
|
+
* only when true.
|
|
1021
|
+
*/
|
|
1022
|
+
marketingOptIn?: boolean;
|
|
899
1023
|
/** Opaque passthrough stored on the order (string values only). */
|
|
900
1024
|
metadata?: Record<string, string>;
|
|
901
1025
|
/**
|
|
@@ -1712,8 +1836,8 @@ declare namespace ConsentBannerContent {
|
|
|
1712
1836
|
* strict={
|
|
1713
1837
|
* <ConsentBanner.Content>
|
|
1714
1838
|
* <p>...translated disclosure...</p>
|
|
1715
|
-
* <ConsentBanner.AcceptAll>Accept
|
|
1716
|
-
* <ConsentBanner.RejectAll>
|
|
1839
|
+
* <ConsentBanner.AcceptAll>Accept non-essential cookies</ConsentBanner.AcceptAll>
|
|
1840
|
+
* <ConsentBanner.RejectAll>Reject non-essential cookies</ConsentBanner.RejectAll>
|
|
1717
1841
|
* <ConsentBanner.Preferences>Preferences</ConsentBanner.Preferences>
|
|
1718
1842
|
* </ConsentBanner.Content>
|
|
1719
1843
|
* }
|
|
@@ -1779,6 +1903,9 @@ declare const DEFAULT_PREFERENCES_STRINGS: {
|
|
|
1779
1903
|
* visitor, not to say it in English.
|
|
1780
1904
|
*/
|
|
1781
1905
|
gpcHonored: string;
|
|
1906
|
+
/** The same duty, for a visitor who allowed analytics themselves: GPC only
|
|
1907
|
+
* turns analytics off by default, so the line above would be false for them. */
|
|
1908
|
+
gpcHonoredAdvertisingOnly: string;
|
|
1782
1909
|
};
|
|
1783
1910
|
interface ConsentThemeTokens {
|
|
1784
1911
|
/** Panel background color (hex). */
|
|
@@ -1848,13 +1975,13 @@ type CategoryProps$1 = {
|
|
|
1848
1975
|
category?: never;
|
|
1849
1976
|
};
|
|
1850
1977
|
type GatedContentStrings = typeof DEFAULT_GATED_CONTENT_STRINGS;
|
|
1851
|
-
/** The placeholder
|
|
1852
|
-
*
|
|
1978
|
+
/** The placeholder says what to enable and opens category-wide preferences.
|
|
1979
|
+
* Its button never records consent by itself. `title` is for a functional-only
|
|
1980
|
+
* gate; `titleOptional` covers any other gate (chat is functional + analytics),
|
|
1981
|
+
* where "functional cookies" alone would not unlock the content. */
|
|
1853
1982
|
declare const DEFAULT_GATED_CONTENT_STRINGS: {
|
|
1854
1983
|
title: string;
|
|
1855
|
-
|
|
1856
|
-
bodyAfterVendor: string;
|
|
1857
|
-
scope: string;
|
|
1984
|
+
titleOptional: string;
|
|
1858
1985
|
action: string;
|
|
1859
1986
|
};
|
|
1860
1987
|
/**
|
|
@@ -1871,8 +1998,9 @@ type GatedContentProps = CategoryProps$1 & {
|
|
|
1871
1998
|
* The third party the content comes from, named the way a visitor would
|
|
1872
1999
|
* recognize them — "YouTube (Google Ireland Ltd.)", "Calendly".
|
|
1873
2000
|
*
|
|
1874
|
-
* Passing this asks for the built-in preferences placeholder
|
|
1875
|
-
*
|
|
2001
|
+
* Passing this asks for the built-in preferences placeholder. The name is
|
|
2002
|
+
* not shown; it gives each placeholder's button a distinct accessible name.
|
|
2003
|
+
* Omit it for an invisible
|
|
1876
2004
|
* tracker — a pixel or a beacon has nothing to show and no hole to explain.
|
|
1877
2005
|
*/
|
|
1878
2006
|
vendor?: string;
|
|
@@ -2790,4 +2918,4 @@ declare namespace AccountReviews {
|
|
|
2790
2918
|
var neverConsentGate: string;
|
|
2791
2919
|
}
|
|
2792
2920
|
|
|
2793
|
-
export { AccountLogin, type AccountLoginFormContext, type AccountLoginProps, type AccountLoginSentContext, type AccountMePayload, type AccountOrder, AccountOrders, type AccountOrdersProps, AccountPage, type AccountPagePmBannerContext, type AccountPageProps, AccountReviews, type AccountReviewsProps, type AccountShippingAddressInput, type AccountSubscription, type AddCartLineInput, AddToCartButton, type AddToCartButtonProps, type AddToCartResult, AifeaturesCaptcha, type AifeaturesCaptchaProps, AifeaturesProvider, type AifeaturesProviderProps, BuyButton, type BuyButtonProps, CartCheckoutButton, type CartCheckoutButtonProps, type CartCheckoutLine, type CartConflictItem, type CartItemLine, type CartLine, type CartLineDisplay, type CartLineStatus, CartPage, type CartPagePart, type CartPageProps, type CartSummary, type CartSummaryShipping, type CartSummaryShippingOption, ConsentBanner, type ConsentBannerDisclosureProps, type ConsentBannerProps, type ConsentCategory, type ConsentDisclosureStrings, type ConsentGrants, type ConsentIntegration, type ConsentLocale, type ConsentManifest, ConsentPolicyDetails, type ConsentPolicyDetailsProps, ConsentProvider, type ConsentProviderProps, type ConsentThemeTokens, CookieSettingsLink, type CookieSettingsLinkProps, GatedContent, type GatedContentProps, type GatedContentStrings, GatedScript, type GatedScriptProps, type LoginResult, MARKET_COUNTRIES, MAX_CART_LINES, type MarketCountry, OrderConfirmation, type OrderConfirmationProps, type OrderFulfillment, type OrderSession, type OrderSessionLineItem, type OrderSessionSubscription, type OrderStatus, type OwnProductReview, PlanPicker, type PlanPickerOptionContext, type PlanPickerProps, PreferencesPanel, type PreferencesPanelProps, type PreferencesStrings, ProductPrice, type ProductPriceProps, ProductRating, type ProductRatingProps, type ProductReview, ProductReviewForm, type ProductReviewFormProps, ProductReviews, type ProductReviewsProps, type PublicOption, type PublicOptionValue, type PublicProduct, type PublicProductSubscription, type PublicSubscriptionPlan, type PublicVariant, type PublicVariantOptionValue, type ReviewAvailability, type ReviewSummary, type SessionCustomer, type SessionReason, type SessionStatus, type ShippingOptionConflict, type StartCartCheckoutOptions, type StartCheckoutOptions, SubscriptionList, type SubscriptionListAuth, type SubscriptionListProps, type SubscriptionMutationState, type SubscriptionRowContext, type UseCartCheckoutOptions, type UseCartCheckoutResult, type UseCartItemsOptions, type UseCartItemsResult, type UseCartResult, type UseCartSummaryOptions, type UseCartSummaryResult, type UseCheckoutOptions, type UseCheckoutResult, type UseConsentResult, type UseMarketOptions, type UseMarketResult, type UseProductOptions, type UseProductResult, type UseProductReviewsOptions, type UseProductReviewsResult, type UseSessionOptions, type UseSessionResult, VariantPicker, type VariantPickerProps, type VariantSelection, type VerifyResult, ZERO_DECIMAL_CURRENCIES, applySelectionToUrl, consentLocales, formatPrice, getOptions, getVariants, isMultiVariant, isValueAvailable, isValueInCatalog, planRecurringAmount, reanchorSelection, resolveVariant, searchFromSelection, selectedImages, selectedValues, selectionFromSearch, useAifeaturesApiUrl, useCart, useCartCheckout, useCartItems, useCartSummary, useCheckout, useConsent, useMarket, useProduct, useProductReviews, useSession, valueSlug, variantPriceRange };
|
|
2921
|
+
export { AccountLogin, type AccountLoginFormContext, type AccountLoginProps, type AccountLoginSentContext, type AccountMePayload, type AccountOrder, AccountOrders, type AccountOrdersProps, AccountPage, type AccountPagePmBannerContext, type AccountPageProps, AccountReviews, type AccountReviewsProps, type AccountShippingAddressInput, type AccountSubscription, type AddCartLineInput, AddToCartButton, type AddToCartButtonProps, type AddToCartResult, AifeaturesCaptcha, type AifeaturesCaptchaProps, AifeaturesProvider, type AifeaturesProviderProps, BuyButton, type BuyButtonProps, CartCheckoutButton, type CartCheckoutButtonProps, type CartCheckoutLine, type CartConflictItem, type CartItemLine, type CartLine, type CartLineDisplay, type CartLineStatus, CartPage, type CartPagePart, type CartPageProps, type CartSummary, type CartSummaryShipping, type CartSummaryShippingOption, ConsentBanner, type ConsentBannerDisclosureProps, type ConsentBannerProps, type ConsentCategory, type ConsentDisclosureStrings, type ConsentGrants, type ConsentIntegration, type ConsentLocale, type ConsentManifest, ConsentPolicyDetails, type ConsentPolicyDetailsProps, ConsentProvider, type ConsentProviderProps, type ConsentThemeTokens, CookieSettingsLink, type CookieSettingsLinkProps, type FormSubmitMarketing, GatedContent, type GatedContentProps, type GatedContentStrings, GatedScript, type GatedScriptProps, type LoginResult, MARKET_COUNTRIES, MAX_CART_LINES, type MarketCountry, MarketingOptIn, type MarketingOptInProps, NewsletterSignup, type NewsletterSignupProps, OrderConfirmation, type OrderConfirmationProps, type OrderFulfillment, type OrderSession, type OrderSessionLineItem, type OrderSessionSubscription, type OrderStatus, type OwnProductReview, PlanPicker, type PlanPickerOptionContext, type PlanPickerProps, PreferencesPanel, type PreferencesPanelProps, type PreferencesStrings, ProductPrice, type ProductPriceProps, ProductRating, type ProductRatingProps, type ProductReview, ProductReviewForm, type ProductReviewFormProps, ProductReviews, type ProductReviewsProps, type PublicOption, type PublicOptionValue, type PublicProduct, type PublicProductSubscription, type PublicSubscriptionPlan, type PublicVariant, type PublicVariantOptionValue, type ReviewAvailability, type ReviewSummary, type SessionCustomer, type SessionReason, type SessionStatus, type ShippingOptionConflict, type StartCartCheckoutOptions, type StartCheckoutOptions, SubscriptionList, type SubscriptionListAuth, type SubscriptionListProps, type SubscriptionMutationState, type SubscriptionRowContext, type UseCartCheckoutOptions, type UseCartCheckoutResult, type UseCartItemsOptions, type UseCartItemsResult, type UseCartResult, type UseCartSummaryOptions, type UseCartSummaryResult, type UseCheckoutOptions, type UseCheckoutResult, type UseConsentResult, type UseMarketOptions, type UseMarketResult, type UseProductOptions, type UseProductResult, type UseProductReviewsOptions, type UseProductReviewsResult, type UseSessionOptions, type UseSessionResult, VariantPicker, type VariantPickerProps, type VariantSelection, type VerifyResult, ZERO_DECIMAL_CURRENCIES, applySelectionToUrl, consentLocales, formatPrice, getOptions, getVariants, isMultiVariant, isValueAvailable, isValueInCatalog, planRecurringAmount, reanchorSelection, resolveVariant, searchFromSelection, selectedImages, selectedValues, selectionFromSearch, useAifeaturesApiUrl, useCart, useCartCheckout, useCartItems, useCartSummary, useCheckout, useConsent, useMarket, useProduct, useProductReviews, useSession, valueSlug, variantPriceRange };
|
package/dist/index.d.ts
CHANGED
|
@@ -92,6 +92,102 @@ declare namespace AifeaturesCaptcha {
|
|
|
92
92
|
var neverConsentGate: string;
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
+
interface MarketingOptInProps {
|
|
96
|
+
/**
|
|
97
|
+
* Visible text saying what the visitor agrees to (e.g. "Email me news and
|
|
98
|
+
* offers from Wave Bye"). Required: it is rendered inside the checkbox's
|
|
99
|
+
* <label>, so it is also the checkbox's accessible name.
|
|
100
|
+
*/
|
|
101
|
+
label: ReactNode;
|
|
102
|
+
/** Called with the box's state on every change (checkout buttons use it). */
|
|
103
|
+
onChange?: (checked: boolean) => void;
|
|
104
|
+
/** Class name for the <label> wrapper */
|
|
105
|
+
className?: string;
|
|
106
|
+
style?: CSSProperties;
|
|
107
|
+
/**
|
|
108
|
+
* Not supported: consent must be an affirmative tick, so the box always
|
|
109
|
+
* starts unchecked. Typed `never` so a pre-ticked usage fails type-check;
|
|
110
|
+
* a value passed anyway is ignored.
|
|
111
|
+
*/
|
|
112
|
+
checked?: never;
|
|
113
|
+
/** Not supported — see `checked`. */
|
|
114
|
+
defaultChecked?: never;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* An unticked "email me" checkbox for marketing consent.
|
|
118
|
+
*
|
|
119
|
+
* Inside an aifeatures form it posts `_marketing_opt_in=true` only when the
|
|
120
|
+
* visitor ticks it — an unticked checkbox posts nothing, so the submission is
|
|
121
|
+
* stored as a non-mailable contact. It always renders unchecked: `checked`
|
|
122
|
+
* and `defaultChecked` are ignored, because a pre-ticked box is not consent.
|
|
123
|
+
*
|
|
124
|
+
* Use it on contact/quote/booking forms. A form whose only job is newsletter
|
|
125
|
+
* signup should use `<NewsletterSignup>` instead (submitting it IS the
|
|
126
|
+
* opt-in, so it needs no box).
|
|
127
|
+
*
|
|
128
|
+
* @example
|
|
129
|
+
* ```tsx
|
|
130
|
+
* <form action={`https://aifeatures.dev/f/${formId}`} method="POST">
|
|
131
|
+
* <input name="email" type="email" required />
|
|
132
|
+
* <MarketingOptIn label="Email me news and offers" />
|
|
133
|
+
* <AifeaturesCaptcha formId={formId} />
|
|
134
|
+
* <button type="submit">Send</button>
|
|
135
|
+
* </form>
|
|
136
|
+
* ```
|
|
137
|
+
*/
|
|
138
|
+
declare function MarketingOptIn({ label, onChange, className, style }: MarketingOptInProps): react_jsx_runtime.JSX.Element;
|
|
139
|
+
declare namespace MarketingOptIn {
|
|
140
|
+
var neverConsentGate: string;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* The marketing part of a JSON form-submit response (POST /f/:formId with
|
|
145
|
+
* `Accept: application/json`). `pending` = the site uses double opt-in and a
|
|
146
|
+
* confirmation email is on its way; `subscribed` = mailable now. Absent on
|
|
147
|
+
* older API deployments, when email marketing is off, and when the signup
|
|
148
|
+
* was not captured — read as a plain acknowledgement that claims nothing.
|
|
149
|
+
*/
|
|
150
|
+
interface FormSubmitMarketing {
|
|
151
|
+
status: 'pending' | 'subscribed';
|
|
152
|
+
}
|
|
153
|
+
interface NewsletterSignupProps {
|
|
154
|
+
/**
|
|
155
|
+
* Form ID from aifeatures. The form must have purpose `newsletter` (set
|
|
156
|
+
* server-side) — submitting it is the visitor's opt-in.
|
|
157
|
+
*/
|
|
158
|
+
formId: string;
|
|
159
|
+
/** API base override; falls back to AifeaturesProvider, then https://aifeatures.dev. */
|
|
160
|
+
apiUrl?: string;
|
|
161
|
+
/** Visible label for the email field (default "Email address"). */
|
|
162
|
+
label?: string;
|
|
163
|
+
/** Submit button text (default "Subscribe"). */
|
|
164
|
+
buttonText?: string;
|
|
165
|
+
/** Class name for the wrapper */
|
|
166
|
+
className?: string;
|
|
167
|
+
/** Class name for the email <input> */
|
|
168
|
+
inputClassName?: string;
|
|
169
|
+
/** Class name for the submit <button> */
|
|
170
|
+
buttonClassName?: string;
|
|
171
|
+
style?: CSSProperties;
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* A newsletter signup form: one explicit `email` field, the Turnstile check,
|
|
175
|
+
* and "unsubscribe anytime" copy. Posts to an aifeatures form whose purpose
|
|
176
|
+
* is `newsletter`, so submitting it is the opt-in — no checkbox.
|
|
177
|
+
*
|
|
178
|
+
* After submit it says "check your email to confirm" when the API reports the
|
|
179
|
+
* contact pending (double opt-in sites), "thanks for subscribing" only when
|
|
180
|
+
* it reports them subscribed, and a plain acknowledgement otherwise (no
|
|
181
|
+
* marketing result: it cannot say the visitor is on the list), announced
|
|
182
|
+
* through an aria-live region.
|
|
183
|
+
*
|
|
184
|
+
* Unstyled beyond layout — pass className props to match the site.
|
|
185
|
+
*/
|
|
186
|
+
declare function NewsletterSignup({ formId, apiUrl: explicitApiUrl, label, buttonText, className, inputClassName, buttonClassName, style, }: NewsletterSignupProps): react_jsx_runtime.JSX.Element;
|
|
187
|
+
declare namespace NewsletterSignup {
|
|
188
|
+
var neverConsentGate: string;
|
|
189
|
+
}
|
|
190
|
+
|
|
95
191
|
/** One selectable value of an option (e.g. "L" of "Size"). */
|
|
96
192
|
interface PublicOptionValue {
|
|
97
193
|
id: string;
|
|
@@ -278,6 +374,15 @@ interface PublicProduct {
|
|
|
278
374
|
purchasable?: boolean;
|
|
279
375
|
/** Whether the site's Stripe account can currently take payments. */
|
|
280
376
|
payments_ready: boolean;
|
|
377
|
+
/**
|
|
378
|
+
* Which marketing-consent box checkout uses — a SITE-level fact surfaced
|
|
379
|
+
* per product. `'stripe'`: Stripe Checkout shows its own consent box (US
|
|
380
|
+
* stores with checkout consent on), so the page shows none. `'onsite'`:
|
|
381
|
+
* BuyButton / CartCheckoutButton render an unticked "email me" box and send
|
|
382
|
+
* `marketing_opt_in: true` when it is ticked. Absent (marketing email not
|
|
383
|
+
* enabled for the site, or an older API): no box at all.
|
|
384
|
+
*/
|
|
385
|
+
checkout_consent?: 'stripe' | 'onsite';
|
|
281
386
|
/**
|
|
282
387
|
* Option axes for a multi-variant product (empty for single-variant). Feed
|
|
283
388
|
* these plus `variants` to `<VariantPicker>` to resolve a variant id.
|
|
@@ -498,6 +603,12 @@ interface StartCheckoutOptions {
|
|
|
498
603
|
cancelUrl?: string;
|
|
499
604
|
/** Prefills the email field on the Stripe Checkout page. */
|
|
500
605
|
customerEmail?: string;
|
|
606
|
+
/**
|
|
607
|
+
* The buyer ticked the on-site "email me" box (see
|
|
608
|
+
* `PublicProduct.checkout_consent`). Sends `marketing_opt_in: true` only
|
|
609
|
+
* when true; anything else sends nothing.
|
|
610
|
+
*/
|
|
611
|
+
marketingOptIn?: boolean;
|
|
501
612
|
/**
|
|
502
613
|
* Subscription selling plan to buy (subscriptions Unit 8). Present =
|
|
503
614
|
* subscription-mode checkout: quantity is locked at 1 (any `quantity`
|
|
@@ -731,6 +842,13 @@ interface UseCartItemsResult {
|
|
|
731
842
|
* nothing in both cases, and NEVER read null as "ships nowhere".
|
|
732
843
|
*/
|
|
733
844
|
shippingCountries: string[] | null;
|
|
845
|
+
/**
|
|
846
|
+
* ORDER-LEVEL checkout consent mode — the first non-null
|
|
847
|
+
* `checkout_consent` from any resolved line's product (a site-level fact).
|
|
848
|
+
* `'onsite'` = render an unticked "email me" box and pass its state as
|
|
849
|
+
* `marketingOptIn`; `'stripe'` or null = render no box.
|
|
850
|
+
*/
|
|
851
|
+
checkoutConsent: 'stripe' | 'onsite' | null;
|
|
734
852
|
/** True while a resolution pass is running. */
|
|
735
853
|
loading: boolean;
|
|
736
854
|
/** Set when some product reads failed transiently (lines marked `error`). */
|
|
@@ -896,6 +1014,12 @@ interface StartCartCheckoutOptions {
|
|
|
896
1014
|
cancelUrl?: string;
|
|
897
1015
|
/** Prefills the email field on the Stripe Checkout page. */
|
|
898
1016
|
customerEmail?: string;
|
|
1017
|
+
/**
|
|
1018
|
+
* The buyer ticked the on-site "email me" box (see
|
|
1019
|
+
* `UseCartItemsResult.checkoutConsent`). Sends `marketing_opt_in: true`
|
|
1020
|
+
* only when true.
|
|
1021
|
+
*/
|
|
1022
|
+
marketingOptIn?: boolean;
|
|
899
1023
|
/** Opaque passthrough stored on the order (string values only). */
|
|
900
1024
|
metadata?: Record<string, string>;
|
|
901
1025
|
/**
|
|
@@ -1712,8 +1836,8 @@ declare namespace ConsentBannerContent {
|
|
|
1712
1836
|
* strict={
|
|
1713
1837
|
* <ConsentBanner.Content>
|
|
1714
1838
|
* <p>...translated disclosure...</p>
|
|
1715
|
-
* <ConsentBanner.AcceptAll>Accept
|
|
1716
|
-
* <ConsentBanner.RejectAll>
|
|
1839
|
+
* <ConsentBanner.AcceptAll>Accept non-essential cookies</ConsentBanner.AcceptAll>
|
|
1840
|
+
* <ConsentBanner.RejectAll>Reject non-essential cookies</ConsentBanner.RejectAll>
|
|
1717
1841
|
* <ConsentBanner.Preferences>Preferences</ConsentBanner.Preferences>
|
|
1718
1842
|
* </ConsentBanner.Content>
|
|
1719
1843
|
* }
|
|
@@ -1779,6 +1903,9 @@ declare const DEFAULT_PREFERENCES_STRINGS: {
|
|
|
1779
1903
|
* visitor, not to say it in English.
|
|
1780
1904
|
*/
|
|
1781
1905
|
gpcHonored: string;
|
|
1906
|
+
/** The same duty, for a visitor who allowed analytics themselves: GPC only
|
|
1907
|
+
* turns analytics off by default, so the line above would be false for them. */
|
|
1908
|
+
gpcHonoredAdvertisingOnly: string;
|
|
1782
1909
|
};
|
|
1783
1910
|
interface ConsentThemeTokens {
|
|
1784
1911
|
/** Panel background color (hex). */
|
|
@@ -1848,13 +1975,13 @@ type CategoryProps$1 = {
|
|
|
1848
1975
|
category?: never;
|
|
1849
1976
|
};
|
|
1850
1977
|
type GatedContentStrings = typeof DEFAULT_GATED_CONTENT_STRINGS;
|
|
1851
|
-
/** The placeholder
|
|
1852
|
-
*
|
|
1978
|
+
/** The placeholder says what to enable and opens category-wide preferences.
|
|
1979
|
+
* Its button never records consent by itself. `title` is for a functional-only
|
|
1980
|
+
* gate; `titleOptional` covers any other gate (chat is functional + analytics),
|
|
1981
|
+
* where "functional cookies" alone would not unlock the content. */
|
|
1853
1982
|
declare const DEFAULT_GATED_CONTENT_STRINGS: {
|
|
1854
1983
|
title: string;
|
|
1855
|
-
|
|
1856
|
-
bodyAfterVendor: string;
|
|
1857
|
-
scope: string;
|
|
1984
|
+
titleOptional: string;
|
|
1858
1985
|
action: string;
|
|
1859
1986
|
};
|
|
1860
1987
|
/**
|
|
@@ -1871,8 +1998,9 @@ type GatedContentProps = CategoryProps$1 & {
|
|
|
1871
1998
|
* The third party the content comes from, named the way a visitor would
|
|
1872
1999
|
* recognize them — "YouTube (Google Ireland Ltd.)", "Calendly".
|
|
1873
2000
|
*
|
|
1874
|
-
* Passing this asks for the built-in preferences placeholder
|
|
1875
|
-
*
|
|
2001
|
+
* Passing this asks for the built-in preferences placeholder. The name is
|
|
2002
|
+
* not shown; it gives each placeholder's button a distinct accessible name.
|
|
2003
|
+
* Omit it for an invisible
|
|
1876
2004
|
* tracker — a pixel or a beacon has nothing to show and no hole to explain.
|
|
1877
2005
|
*/
|
|
1878
2006
|
vendor?: string;
|
|
@@ -2790,4 +2918,4 @@ declare namespace AccountReviews {
|
|
|
2790
2918
|
var neverConsentGate: string;
|
|
2791
2919
|
}
|
|
2792
2920
|
|
|
2793
|
-
export { AccountLogin, type AccountLoginFormContext, type AccountLoginProps, type AccountLoginSentContext, type AccountMePayload, type AccountOrder, AccountOrders, type AccountOrdersProps, AccountPage, type AccountPagePmBannerContext, type AccountPageProps, AccountReviews, type AccountReviewsProps, type AccountShippingAddressInput, type AccountSubscription, type AddCartLineInput, AddToCartButton, type AddToCartButtonProps, type AddToCartResult, AifeaturesCaptcha, type AifeaturesCaptchaProps, AifeaturesProvider, type AifeaturesProviderProps, BuyButton, type BuyButtonProps, CartCheckoutButton, type CartCheckoutButtonProps, type CartCheckoutLine, type CartConflictItem, type CartItemLine, type CartLine, type CartLineDisplay, type CartLineStatus, CartPage, type CartPagePart, type CartPageProps, type CartSummary, type CartSummaryShipping, type CartSummaryShippingOption, ConsentBanner, type ConsentBannerDisclosureProps, type ConsentBannerProps, type ConsentCategory, type ConsentDisclosureStrings, type ConsentGrants, type ConsentIntegration, type ConsentLocale, type ConsentManifest, ConsentPolicyDetails, type ConsentPolicyDetailsProps, ConsentProvider, type ConsentProviderProps, type ConsentThemeTokens, CookieSettingsLink, type CookieSettingsLinkProps, GatedContent, type GatedContentProps, type GatedContentStrings, GatedScript, type GatedScriptProps, type LoginResult, MARKET_COUNTRIES, MAX_CART_LINES, type MarketCountry, OrderConfirmation, type OrderConfirmationProps, type OrderFulfillment, type OrderSession, type OrderSessionLineItem, type OrderSessionSubscription, type OrderStatus, type OwnProductReview, PlanPicker, type PlanPickerOptionContext, type PlanPickerProps, PreferencesPanel, type PreferencesPanelProps, type PreferencesStrings, ProductPrice, type ProductPriceProps, ProductRating, type ProductRatingProps, type ProductReview, ProductReviewForm, type ProductReviewFormProps, ProductReviews, type ProductReviewsProps, type PublicOption, type PublicOptionValue, type PublicProduct, type PublicProductSubscription, type PublicSubscriptionPlan, type PublicVariant, type PublicVariantOptionValue, type ReviewAvailability, type ReviewSummary, type SessionCustomer, type SessionReason, type SessionStatus, type ShippingOptionConflict, type StartCartCheckoutOptions, type StartCheckoutOptions, SubscriptionList, type SubscriptionListAuth, type SubscriptionListProps, type SubscriptionMutationState, type SubscriptionRowContext, type UseCartCheckoutOptions, type UseCartCheckoutResult, type UseCartItemsOptions, type UseCartItemsResult, type UseCartResult, type UseCartSummaryOptions, type UseCartSummaryResult, type UseCheckoutOptions, type UseCheckoutResult, type UseConsentResult, type UseMarketOptions, type UseMarketResult, type UseProductOptions, type UseProductResult, type UseProductReviewsOptions, type UseProductReviewsResult, type UseSessionOptions, type UseSessionResult, VariantPicker, type VariantPickerProps, type VariantSelection, type VerifyResult, ZERO_DECIMAL_CURRENCIES, applySelectionToUrl, consentLocales, formatPrice, getOptions, getVariants, isMultiVariant, isValueAvailable, isValueInCatalog, planRecurringAmount, reanchorSelection, resolveVariant, searchFromSelection, selectedImages, selectedValues, selectionFromSearch, useAifeaturesApiUrl, useCart, useCartCheckout, useCartItems, useCartSummary, useCheckout, useConsent, useMarket, useProduct, useProductReviews, useSession, valueSlug, variantPriceRange };
|
|
2921
|
+
export { AccountLogin, type AccountLoginFormContext, type AccountLoginProps, type AccountLoginSentContext, type AccountMePayload, type AccountOrder, AccountOrders, type AccountOrdersProps, AccountPage, type AccountPagePmBannerContext, type AccountPageProps, AccountReviews, type AccountReviewsProps, type AccountShippingAddressInput, type AccountSubscription, type AddCartLineInput, AddToCartButton, type AddToCartButtonProps, type AddToCartResult, AifeaturesCaptcha, type AifeaturesCaptchaProps, AifeaturesProvider, type AifeaturesProviderProps, BuyButton, type BuyButtonProps, CartCheckoutButton, type CartCheckoutButtonProps, type CartCheckoutLine, type CartConflictItem, type CartItemLine, type CartLine, type CartLineDisplay, type CartLineStatus, CartPage, type CartPagePart, type CartPageProps, type CartSummary, type CartSummaryShipping, type CartSummaryShippingOption, ConsentBanner, type ConsentBannerDisclosureProps, type ConsentBannerProps, type ConsentCategory, type ConsentDisclosureStrings, type ConsentGrants, type ConsentIntegration, type ConsentLocale, type ConsentManifest, ConsentPolicyDetails, type ConsentPolicyDetailsProps, ConsentProvider, type ConsentProviderProps, type ConsentThemeTokens, CookieSettingsLink, type CookieSettingsLinkProps, type FormSubmitMarketing, GatedContent, type GatedContentProps, type GatedContentStrings, GatedScript, type GatedScriptProps, type LoginResult, MARKET_COUNTRIES, MAX_CART_LINES, type MarketCountry, MarketingOptIn, type MarketingOptInProps, NewsletterSignup, type NewsletterSignupProps, OrderConfirmation, type OrderConfirmationProps, type OrderFulfillment, type OrderSession, type OrderSessionLineItem, type OrderSessionSubscription, type OrderStatus, type OwnProductReview, PlanPicker, type PlanPickerOptionContext, type PlanPickerProps, PreferencesPanel, type PreferencesPanelProps, type PreferencesStrings, ProductPrice, type ProductPriceProps, ProductRating, type ProductRatingProps, type ProductReview, ProductReviewForm, type ProductReviewFormProps, ProductReviews, type ProductReviewsProps, type PublicOption, type PublicOptionValue, type PublicProduct, type PublicProductSubscription, type PublicSubscriptionPlan, type PublicVariant, type PublicVariantOptionValue, type ReviewAvailability, type ReviewSummary, type SessionCustomer, type SessionReason, type SessionStatus, type ShippingOptionConflict, type StartCartCheckoutOptions, type StartCheckoutOptions, SubscriptionList, type SubscriptionListAuth, type SubscriptionListProps, type SubscriptionMutationState, type SubscriptionRowContext, type UseCartCheckoutOptions, type UseCartCheckoutResult, type UseCartItemsOptions, type UseCartItemsResult, type UseCartResult, type UseCartSummaryOptions, type UseCartSummaryResult, type UseCheckoutOptions, type UseCheckoutResult, type UseConsentResult, type UseMarketOptions, type UseMarketResult, type UseProductOptions, type UseProductResult, type UseProductReviewsOptions, type UseProductReviewsResult, type UseSessionOptions, type UseSessionResult, VariantPicker, type VariantPickerProps, type VariantSelection, type VerifyResult, ZERO_DECIMAL_CURRENCIES, applySelectionToUrl, consentLocales, formatPrice, getOptions, getVariants, isMultiVariant, isValueAvailable, isValueInCatalog, planRecurringAmount, reanchorSelection, resolveVariant, searchFromSelection, selectedImages, selectedValues, selectionFromSearch, useAifeaturesApiUrl, useCart, useCartCheckout, useCartItems, useCartSummary, useCheckout, useConsent, useMarket, useProduct, useProductReviews, useSession, valueSlug, variantPriceRange };
|