@aifeatures/react 0.8.0 → 0.10.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,25 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { CSSProperties, ReactNode } from 'react';
2
+ import { ReactNode, CSSProperties } from 'react';
3
+
4
+ interface AifeaturesProviderProps {
5
+ /** Public feature API base, such as `/_ls` for the current site's origin. */
6
+ apiUrl: string;
7
+ children?: ReactNode;
8
+ }
9
+ /**
10
+ * Configures forms, commerce, and customer-account requests for descendants.
11
+ * ConsentProvider keeps its independent API configuration.
12
+ */
13
+ declare function AifeaturesProvider({ apiUrl, children }: AifeaturesProviderProps): react_jsx_runtime.JSX.Element;
14
+ declare namespace AifeaturesProvider {
15
+ var neverConsentGate: string;
16
+ }
17
+ /**
18
+ * Resolves an explicit override, then the nearest provider, then the existing
19
+ * platform default. Relative bases remain relative, including during SSR.
20
+ * Use this for authored form actions/fetches as well as package components.
21
+ */
22
+ declare function useAifeaturesApiUrl(explicitApiUrl?: string): string;
3
23
 
4
24
  type AifeaturesCaptchaStatus =
5
25
  /** Fetching the form's config; nothing rendered yet. */
@@ -18,7 +38,7 @@ type AifeaturesCaptchaStatus =
18
38
  interface AifeaturesCaptchaProps {
19
39
  /** Form ID from aifeatures - used to fetch the Turnstile sitekey */
20
40
  formId: string;
21
- /** Base URL for the aifeatures API (defaults to https://aifeatures.dev) */
41
+ /** API base override; falls back to AifeaturesProvider, then https://aifeatures.dev. */
22
42
  apiUrl?: string;
23
43
  /** Called when CAPTCHA verification succeeds */
24
44
  onVerify?: (token: string) => void;
@@ -67,7 +87,7 @@ interface AifeaturesCaptchaProps {
67
87
  * </form>
68
88
  * ```
69
89
  */
70
- declare function AifeaturesCaptcha({ formId, apiUrl, onVerify, onError, onStatusChange, className, }: AifeaturesCaptchaProps): react_jsx_runtime.JSX.Element | null;
90
+ declare function AifeaturesCaptcha({ formId, apiUrl: explicitApiUrl, onVerify, onError, onStatusChange, className, }: AifeaturesCaptchaProps): react_jsx_runtime.JSX.Element | null;
71
91
  declare namespace AifeaturesCaptcha {
72
92
  var neverConsentGate: string;
73
93
  }
@@ -273,7 +293,7 @@ interface PublicProduct {
273
293
  subscription?: PublicProductSubscription | null;
274
294
  }
275
295
  interface UseProductOptions {
276
- /** Base URL for the aifeatures API (defaults to https://aifeatures.dev) */
296
+ /** API base override; falls back to AifeaturesProvider, then https://aifeatures.dev. */
277
297
  apiUrl?: string;
278
298
  /**
279
299
  * Buyer-declared market country (ISO 3166-1 alpha-2) — pass `useMarket()`'s
@@ -453,7 +473,7 @@ declare function selectedImages(product: Pick<PublicProduct, 'options' | 'images
453
473
  declare function applySelectionToUrl(product: Pick<PublicProduct, 'options'>, selection: VariantSelection): void;
454
474
 
455
475
  interface UseCheckoutOptions {
456
- /** Base URL for the aifeatures API (defaults to https://aifeatures.dev) */
476
+ /** API base override; falls back to AifeaturesProvider, then https://aifeatures.dev. */
457
477
  apiUrl?: string;
458
478
  }
459
479
  interface StartCheckoutOptions {
@@ -662,7 +682,7 @@ interface CartItemLine extends CartLine {
662
682
  status: CartLineStatus;
663
683
  }
664
684
  interface UseCartItemsOptions {
665
- /** Base URL for the aifeatures API (defaults to https://aifeatures.dev) */
685
+ /** API base override; falls back to AifeaturesProvider, then https://aifeatures.dev. */
666
686
  apiUrl?: string;
667
687
  }
668
688
  interface UseCartItemsResult {
@@ -805,7 +825,7 @@ interface CartSummary {
805
825
  tax: CartSummaryTax | null;
806
826
  }
807
827
  interface UseCartSummaryOptions {
808
- /** Base URL for the aifeatures API (defaults to https://aifeatures.dev) */
828
+ /** API base override; falls back to AifeaturesProvider, then https://aifeatures.dev. */
809
829
  apiUrl?: string;
810
830
  /**
811
831
  * Milliseconds to wait after a cart change before pricing it. Quantity
@@ -847,7 +867,7 @@ interface UseCartSummaryResult {
847
867
  declare function useCartSummary(options?: UseCartSummaryOptions): UseCartSummaryResult;
848
868
 
849
869
  interface UseCartCheckoutOptions {
850
- /** Base URL for the aifeatures API (defaults to https://aifeatures.dev) */
870
+ /** API base override; falls back to AifeaturesProvider, then https://aifeatures.dev. */
851
871
  apiUrl?: string;
852
872
  }
853
873
  /**
@@ -964,7 +984,7 @@ interface MarketCountry {
964
984
  */
965
985
  declare const MARKET_COUNTRIES: readonly MarketCountry[];
966
986
  interface UseMarketOptions {
967
- /** Base URL for the aifeatures API (defaults to https://aifeatures.dev) */
987
+ /** API base override; falls back to AifeaturesProvider, then https://aifeatures.dev. */
968
988
  apiUrl?: string;
969
989
  }
970
990
  interface UseMarketResult {
@@ -1010,7 +1030,7 @@ interface ProductPriceProps {
1010
1030
  * the price tracks the buyer's selection.
1011
1031
  */
1012
1032
  variantId?: string;
1013
- /** Base URL for the aifeatures API (defaults to https://aifeatures.dev) */
1033
+ /** API base override; falls back to AifeaturesProvider, then https://aifeatures.dev. */
1014
1034
  apiUrl?: string;
1015
1035
  /** Optional BCP 47 locale for formatting (defaults to the browser locale) */
1016
1036
  locale?: string;
@@ -1138,7 +1158,7 @@ interface BuyButtonProps {
1138
1158
  cancelUrl?: string;
1139
1159
  /** Prefills the email field on the Stripe Checkout page. */
1140
1160
  customerEmail?: string;
1141
- /** Base URL for the aifeatures API (defaults to https://aifeatures.dev) */
1161
+ /** API base override; falls back to AifeaturesProvider, then https://aifeatures.dev. */
1142
1162
  apiUrl?: string;
1143
1163
  /** Force-disable the button (combined with the automatic disabled states). */
1144
1164
  disabled?: boolean;
@@ -1193,7 +1213,7 @@ interface AddToCartButtonProps {
1193
1213
  selection?: VariantSelection;
1194
1214
  /** Units to add per click (default 1). */
1195
1215
  quantity?: number;
1196
- /** Base URL for the aifeatures API (defaults to https://aifeatures.dev) */
1216
+ /** API base override; falls back to AifeaturesProvider, then https://aifeatures.dev. */
1197
1217
  apiUrl?: string;
1198
1218
  /** Force-disable the button (combined with the automatic disabled states). */
1199
1219
  disabled?: boolean;
@@ -1235,7 +1255,7 @@ declare namespace AddToCartButton {
1235
1255
  }
1236
1256
 
1237
1257
  interface CartCheckoutButtonProps {
1238
- /** Base URL for the aifeatures API (defaults to https://aifeatures.dev) */
1258
+ /** API base override; falls back to AifeaturesProvider, then https://aifeatures.dev. */
1239
1259
  apiUrl?: string;
1240
1260
  /** Defaults to `${window.location.origin}/order/confirmation`. */
1241
1261
  successUrl?: string;
@@ -1430,7 +1450,7 @@ interface OrderSession {
1430
1450
  subscription?: OrderSessionSubscription;
1431
1451
  }
1432
1452
  interface OrderConfirmationProps {
1433
- /** Base URL for the aifeatures API (defaults to https://aifeatures.dev) */
1453
+ /** API base override; falls back to AifeaturesProvider, then https://aifeatures.dev. */
1434
1454
  apiUrl?: string;
1435
1455
  /** Class name for the container of the default-rendered states */
1436
1456
  className?: string;
@@ -1467,7 +1487,7 @@ interface OrderConfirmationProps {
1467
1487
  /** Rendered for failed/expired (and refunded/disputed) orders */
1468
1488
  renderFailed?: (session: OrderSession) => ReactNode;
1469
1489
  }
1470
- declare function OrderConfirmation({ apiUrl, className, style, sessionId: sessionIdProp, pollIntervalMs, pollTimeoutMs, followRedirect, redirectDelayMs, renderNoSession, renderPending, renderPaid, renderFailed, }: OrderConfirmationProps): react_jsx_runtime.JSX.Element | null;
1490
+ declare function OrderConfirmation({ apiUrl: explicitApiUrl, className, style, sessionId: sessionIdProp, pollIntervalMs, pollTimeoutMs, followRedirect, redirectDelayMs, renderNoSession, renderPending, renderPaid, renderFailed, }: OrderConfirmationProps): react_jsx_runtime.JSX.Element | null;
1471
1491
  declare namespace OrderConfirmation {
1472
1492
  var neverConsentGate: string;
1473
1493
  }
@@ -2119,6 +2139,118 @@ declare namespace PlanPicker {
2119
2139
  var neverConsentGate: string;
2120
2140
  }
2121
2141
 
2142
+ /**
2143
+ * INTERNAL module — shared wire types + fetch classification for the
2144
+ * /v1/account surface (subscriptions Unit 8). Not exported from the package
2145
+ * index except for the payload TYPES (re-exported by the barrel).
2146
+ *
2147
+ * The one non-obvious rule lives here: DARK-PREFIX DETECTION. The whole
2148
+ * /v1/account prefix ships behind a config flag and re-darkening is a live
2149
+ * incident-response move (plan §Magic-link flow), so every route can answer
2150
+ * an EMPTY-BODY 404 indistinguishable from a path that doesn't exist. Live
2151
+ * routes that legitimately 404 (e.g. "Subscription not found") always carry
2152
+ * a JSON `{error}` body — so `404 with a completely EMPTY body` is classified
2153
+ * `unavailable`, and components map it to the login / "temporarily
2154
+ * unavailable" states instead of a dead error. A 404 that carries ANYTHING
2155
+ * (that JSON error, or an interposed proxy/CDN's HTML page) is an ordinary
2156
+ * refusal: the session is not implicated and must not be cleared.
2157
+ */
2158
+ interface ReviewLoginContext {
2159
+ review_product_id: string;
2160
+ review_return_path: string;
2161
+ }
2162
+ interface ReviewReturnContext {
2163
+ product_id: string;
2164
+ path: string | null;
2165
+ account_origin: string;
2166
+ status: 'available' | 'unavailable';
2167
+ }
2168
+ /** One order row from GET /v1/account/me (bounded receipt shelf). */
2169
+ interface AccountOrder {
2170
+ id: string;
2171
+ order_number: number | null;
2172
+ status: string;
2173
+ /** 'checkout' | 'cart' | 'subscription' — subscription = signup or renewal. */
2174
+ source: string;
2175
+ amount_total: number;
2176
+ shipping_total: number | null;
2177
+ tax_total: number | null;
2178
+ currency: string;
2179
+ created_at: string;
2180
+ line_items: Array<{
2181
+ name: string | null;
2182
+ quantity: number | null;
2183
+ unit_amount: number | null;
2184
+ }>;
2185
+ }
2186
+ /**
2187
+ * One subscription row, as serialized by the session surface
2188
+ * (`subscriberSubscriptionView`) — the manage-grant view
2189
+ * (`manageSubscriptionView`) is the same shape minus `product_id` /
2190
+ * `created_at` / `shipping_address`, plus `shipping_name` / `shipping_city`,
2191
+ * so the optional fields cover both doorways with one type.
2192
+ */
2193
+ interface AccountSubscription {
2194
+ id: string;
2195
+ /** Stripe status verbatim ('active', 'past_due', …) — render unmodeled
2196
+ * values generically, never throw on them. */
2197
+ status: string;
2198
+ product_id?: string;
2199
+ plan_title: string | null;
2200
+ plan_interval: string;
2201
+ plan_interval_count: number;
2202
+ /** Locked signup amount (minor units). */
2203
+ plan_amount: number;
2204
+ /** Current recurring amount mirrored from Stripe (falls back to plan_amount). */
2205
+ current_amount: number;
2206
+ currency: string;
2207
+ current_period_end: string | null;
2208
+ cancel_at_period_end: boolean;
2209
+ canceled_at: string | null;
2210
+ /** Terminal — no future invoice can arrive. "Ended — resubscribe" copy. */
2211
+ ended: boolean;
2212
+ is_test: boolean;
2213
+ created_at?: string;
2214
+ shipping_address?: {
2215
+ name?: string | null;
2216
+ address?: {
2217
+ line1?: string | null;
2218
+ line2?: string | null;
2219
+ city?: string | null;
2220
+ state?: string | null;
2221
+ postal_code?: string | null;
2222
+ country?: string | null;
2223
+ } | null;
2224
+ } | null;
2225
+ /** Manage-grant view only. */
2226
+ shipping_name?: string | null;
2227
+ shipping_city?: string | null;
2228
+ }
2229
+ /** Response of GET /v1/account/me. */
2230
+ interface AccountMePayload {
2231
+ customer: {
2232
+ email: string;
2233
+ name: string | null;
2234
+ };
2235
+ site: {
2236
+ name: string;
2237
+ };
2238
+ orders: AccountOrder[];
2239
+ subscriptions: AccountSubscription[];
2240
+ }
2241
+ /** The shipping_address input shape POST /subscriptions/:id/address accepts. */
2242
+ interface AccountShippingAddressInput {
2243
+ name?: string | null;
2244
+ address: {
2245
+ line1: string;
2246
+ line2?: string | null;
2247
+ city?: string | null;
2248
+ state?: string | null;
2249
+ postal_code?: string | null;
2250
+ country: string;
2251
+ };
2252
+ }
2253
+
2122
2254
  interface StoredSessionCustomer {
2123
2255
  email: string;
2124
2256
  name: string | null;
@@ -2129,15 +2261,15 @@ type SessionCustomer = StoredSessionCustomer;
2129
2261
  /** Why the hook is signed_out, when it wasn't a plain fresh visit. */
2130
2262
  type SessionReason = 'session_expired' | 'invalid_code' | null;
2131
2263
  interface UseSessionOptions {
2132
- /** Base URL for the aifeatures API (defaults to https://aifeatures.dev) */
2264
+ /** API base override; falls back to AifeaturesProvider, then https://aifeatures.dev. */
2133
2265
  apiUrl?: string;
2134
2266
  /**
2135
2267
  * Whether THIS instance consumes a `?code=` magic-link param from the URL
2136
2268
  * on mount (default true). Exactly ONE mounted instance must own the
2137
2269
  * consumption — the code is single-use server-side, so a second instance
2138
2270
  * exchanging it burns it and strands the reason on the wrong hook.
2139
- * AccountLogin sets this false when a parent session is passed in
2140
- * (AccountPage owns the URL there). Read once on mount.
2271
+ * AccountPage owns the URL; product widgets and AccountLogin set this
2272
+ * false. Read once on mount.
2141
2273
  */
2142
2274
  consumeUrlCode?: boolean;
2143
2275
  }
@@ -2154,6 +2286,7 @@ type LoginResult =
2154
2286
  };
2155
2287
  type VerifyResult = {
2156
2288
  ok: true;
2289
+ reviewReturn?: ReviewReturnContext;
2157
2290
  } | {
2158
2291
  ok: false;
2159
2292
  code: 'invalid_code' | 'rate_limited' | 'unavailable' | 'error';
@@ -2167,13 +2300,15 @@ interface UseSessionResult {
2167
2300
  token: string | null;
2168
2301
  /** Why signed_out, when there is a why (expired session, bad code). */
2169
2302
  reason: SessionReason;
2303
+ /** Present only after this instance exchanges a review login code. */
2304
+ reviewReturn?: ReviewReturnContext | null;
2170
2305
  /**
2171
2306
  * Request a magic link for `email` (uniform 200 — "sent" even for unknown
2172
2307
  * addresses, by server design). Inside the editor iframe this offers the
2173
2308
  * preview-session handshake to the host first and only falls back to the
2174
2309
  * real POST when nothing claims it.
2175
2310
  */
2176
- login: (email: string) => Promise<LoginResult>;
2311
+ login: (email: string, reviewContext?: ReviewLoginContext) => Promise<LoginResult>;
2177
2312
  /** POST-exchange a login code (single-use) for a session. */
2178
2313
  verifyCode: (code: string) => Promise<VerifyResult>;
2179
2314
  /** Delete the server session (best-effort) and clear the stored token. */
@@ -2227,13 +2362,15 @@ interface AccountLoginSentContext {
2227
2362
  reset: () => void;
2228
2363
  }
2229
2364
  interface AccountLoginProps {
2230
- /** Base URL for the aifeatures API (defaults to https://aifeatures.dev) */
2365
+ /** API base override; falls back to AifeaturesProvider, then https://aifeatures.dev. */
2231
2366
  apiUrl?: string;
2232
2367
  /**
2233
2368
  * Share a parent's useSession() (AccountPage passes its own so the login
2234
2369
  * form and the page agree on status). Omit to run standalone.
2235
2370
  */
2236
2371
  session?: UseSessionResult;
2372
+ /** Product-page navigation to preserve through email sign-in and resend. */
2373
+ reviewContext?: ReviewLoginContext;
2237
2374
  /** Delay before the resend affordance appears (default 30s). */
2238
2375
  resendDelayMs?: number;
2239
2376
  className?: string;
@@ -2267,7 +2404,7 @@ interface AccountLoginProps {
2267
2404
  * (useSession.login) and signs straight in when the host claims it — the
2268
2405
  * check-your-email state is skipped.
2269
2406
  */
2270
- declare function AccountLogin({ apiUrl, session: sessionProp, resendDelayMs, className, style, renderForm, renderSent, renderUnavailable, }: AccountLoginProps): react_jsx_runtime.JSX.Element;
2407
+ declare function AccountLogin({ apiUrl, session: sessionProp, reviewContext, resendDelayMs, className, style, renderForm, renderSent, renderUnavailable, }: AccountLoginProps): react_jsx_runtime.JSX.Element;
2271
2408
  declare namespace AccountLogin {
2272
2409
  var neverConsentGate: string;
2273
2410
  }
@@ -2281,7 +2418,7 @@ interface AccountPagePmBannerContext {
2281
2418
  checking: boolean;
2282
2419
  }
2283
2420
  interface AccountPageProps {
2284
- /** Base URL for the aifeatures API (defaults to https://aifeatures.dev) */
2421
+ /** API base override; falls back to AifeaturesProvider, then https://aifeatures.dev. */
2285
2422
  apiUrl?: string;
2286
2423
  className?: string;
2287
2424
  style?: CSSProperties;
@@ -2336,113 +2473,11 @@ interface AccountPageProps {
2336
2473
  * the stored token and returns to email entry with a brief message, keeping
2337
2474
  * the buyer on this page.
2338
2475
  */
2339
- declare function AccountPage({ apiUrl, className, style, resendDelayMs, loginProps, renderLoading, renderError, renderEmpty, renderHeader, renderPmBanner, renderManageExpired, }: AccountPageProps): react_jsx_runtime.JSX.Element;
2476
+ declare function AccountPage({ apiUrl: explicitApiUrl, className, style, resendDelayMs, loginProps, renderLoading, renderError, renderEmpty, renderHeader, renderPmBanner, renderManageExpired, }: AccountPageProps): react_jsx_runtime.JSX.Element;
2340
2477
  declare namespace AccountPage {
2341
2478
  var neverConsentGate: string;
2342
2479
  }
2343
2480
 
2344
- /**
2345
- * INTERNAL module — shared wire types + fetch classification for the
2346
- * /v1/account surface (subscriptions Unit 8). Not exported from the package
2347
- * index except for the payload TYPES (re-exported by the barrel).
2348
- *
2349
- * The one non-obvious rule lives here: DARK-PREFIX DETECTION. The whole
2350
- * /v1/account prefix ships behind a config flag and re-darkening is a live
2351
- * incident-response move (plan §Magic-link flow), so every route can answer
2352
- * an EMPTY-BODY 404 indistinguishable from a path that doesn't exist. Live
2353
- * routes that legitimately 404 (e.g. "Subscription not found") always carry
2354
- * a JSON `{error}` body — so `404 with a completely EMPTY body` is classified
2355
- * `unavailable`, and components map it to the login / "temporarily
2356
- * unavailable" states instead of a dead error. A 404 that carries ANYTHING
2357
- * (that JSON error, or an interposed proxy/CDN's HTML page) is an ordinary
2358
- * refusal: the session is not implicated and must not be cleared.
2359
- */
2360
- /** One order row from GET /v1/account/me (bounded receipt shelf). */
2361
- interface AccountOrder {
2362
- id: string;
2363
- order_number: number | null;
2364
- status: string;
2365
- /** 'checkout' | 'cart' | 'subscription' — subscription = signup or renewal. */
2366
- source: string;
2367
- amount_total: number;
2368
- shipping_total: number | null;
2369
- tax_total: number | null;
2370
- currency: string;
2371
- created_at: string;
2372
- line_items: Array<{
2373
- name: string | null;
2374
- quantity: number | null;
2375
- unit_amount: number | null;
2376
- }>;
2377
- }
2378
- /**
2379
- * One subscription row, as serialized by the session surface
2380
- * (`subscriberSubscriptionView`) — the manage-grant view
2381
- * (`manageSubscriptionView`) is the same shape minus `product_id` /
2382
- * `created_at` / `shipping_address`, plus `shipping_name` / `shipping_city`,
2383
- * so the optional fields cover both doorways with one type.
2384
- */
2385
- interface AccountSubscription {
2386
- id: string;
2387
- /** Stripe status verbatim ('active', 'past_due', …) — render unmodeled
2388
- * values generically, never throw on them. */
2389
- status: string;
2390
- product_id?: string;
2391
- plan_title: string | null;
2392
- plan_interval: string;
2393
- plan_interval_count: number;
2394
- /** Locked signup amount (minor units). */
2395
- plan_amount: number;
2396
- /** Current recurring amount mirrored from Stripe (falls back to plan_amount). */
2397
- current_amount: number;
2398
- currency: string;
2399
- current_period_end: string | null;
2400
- cancel_at_period_end: boolean;
2401
- canceled_at: string | null;
2402
- /** Terminal — no future invoice can arrive. "Ended — resubscribe" copy. */
2403
- ended: boolean;
2404
- is_test: boolean;
2405
- created_at?: string;
2406
- shipping_address?: {
2407
- name?: string | null;
2408
- address?: {
2409
- line1?: string | null;
2410
- line2?: string | null;
2411
- city?: string | null;
2412
- state?: string | null;
2413
- postal_code?: string | null;
2414
- country?: string | null;
2415
- } | null;
2416
- } | null;
2417
- /** Manage-grant view only. */
2418
- shipping_name?: string | null;
2419
- shipping_city?: string | null;
2420
- }
2421
- /** Response of GET /v1/account/me. */
2422
- interface AccountMePayload {
2423
- customer: {
2424
- email: string;
2425
- name: string | null;
2426
- };
2427
- site: {
2428
- name: string;
2429
- };
2430
- orders: AccountOrder[];
2431
- subscriptions: AccountSubscription[];
2432
- }
2433
- /** The shipping_address input shape POST /subscriptions/:id/address accepts. */
2434
- interface AccountShippingAddressInput {
2435
- name?: string | null;
2436
- address: {
2437
- line1: string;
2438
- line2?: string | null;
2439
- city?: string | null;
2440
- state?: string | null;
2441
- postal_code?: string | null;
2442
- country: string;
2443
- };
2444
- }
2445
-
2446
2481
  interface AccountOrdersProps {
2447
2482
  /** The `orders` array from GET /v1/account/me (newest first, bounded). */
2448
2483
  orders: AccountOrder[];
@@ -2520,7 +2555,7 @@ interface SubscriptionRowContext {
2520
2555
  openPortal: () => void;
2521
2556
  }
2522
2557
  interface SubscriptionListProps {
2523
- /** Base URL for the aifeatures API (defaults to https://aifeatures.dev) */
2558
+ /** API base override; falls back to AifeaturesProvider, then https://aifeatures.dev. */
2524
2559
  apiUrl?: string;
2525
2560
  subscriptions: AccountSubscription[];
2526
2561
  auth: SubscriptionListAuth;
@@ -2558,7 +2593,7 @@ interface SubscriptionListProps {
2558
2593
  * than erroring — the copy is "this subscription has ended", and the only
2559
2594
  * path onward is resubscribing on the product page.
2560
2595
  */
2561
- declare function SubscriptionList({ apiUrl, subscriptions, auth, onAuthError, onUnavailable, onSubscriptionChange, className, style, heading, renderEmpty, renderRow, }: SubscriptionListProps): react_jsx_runtime.JSX.Element;
2596
+ declare function SubscriptionList({ apiUrl: explicitApiUrl, subscriptions, auth, onAuthError, onUnavailable, onSubscriptionChange, className, style, heading, renderEmpty, renderRow, }: SubscriptionListProps): react_jsx_runtime.JSX.Element;
2562
2597
  declare namespace SubscriptionList {
2563
2598
  var neverConsentGate: string;
2564
2599
  }
@@ -2575,4 +2610,118 @@ interface ConsentPolicyDetailsProps {
2575
2610
  * facts around this section. It is not a complete legal policy. */
2576
2611
  declare function ConsentPolicyDetails({ className, style }: ConsentPolicyDetailsProps): react_jsx_runtime.JSX.Element;
2577
2612
 
2578
- export { AccountLogin, type AccountLoginFormContext, type AccountLoginProps, type AccountLoginSentContext, type AccountMePayload, type AccountOrder, AccountOrders, type AccountOrdersProps, AccountPage, type AccountPagePmBannerContext, type AccountPageProps, type AccountShippingAddressInput, type AccountSubscription, type AddCartLineInput, AddToCartButton, type AddToCartButtonProps, type AddToCartResult, AifeaturesCaptcha, type AifeaturesCaptchaProps, BuyButton, type BuyButtonProps, CartCheckoutButton, type CartCheckoutButtonProps, type CartCheckoutLine, type CartConflictItem, type CartItemLine, type CartLine, type CartLineDisplay, type CartLineStatus, 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, PlanPicker, type PlanPickerOptionContext, type PlanPickerProps, PreferencesPanel, type PreferencesPanelProps, type PreferencesStrings, ProductPrice, type ProductPriceProps, type PublicOption, type PublicOptionValue, type PublicProduct, type PublicProductSubscription, type PublicSubscriptionPlan, type PublicVariant, type PublicVariantOptionValue, 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 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, useCart, useCartCheckout, useCartItems, useCartSummary, useCheckout, useConsent, useMarket, useProduct, useSession, valueSlug, variantPriceRange };
2613
+ interface ProductReview {
2614
+ id: string;
2615
+ rating: number;
2616
+ display_name: string;
2617
+ title: string | null;
2618
+ body: string;
2619
+ created_at: string;
2620
+ updated_at: string;
2621
+ verified_purchase: boolean;
2622
+ reply: string | null;
2623
+ reply_updated_at: string | null;
2624
+ }
2625
+ interface OwnProductReview extends ProductReview {
2626
+ revision: number;
2627
+ moderation_state: 'published' | 'hidden';
2628
+ withdrawn_at: string | null;
2629
+ product_id: string;
2630
+ product_path: string | null;
2631
+ product_name: string | null;
2632
+ product_available: boolean;
2633
+ }
2634
+ interface ReviewSummary {
2635
+ count: number;
2636
+ average: number | null;
2637
+ distribution: Record<1 | 2 | 3 | 4 | 5, number>;
2638
+ }
2639
+ interface ReviewAvailability {
2640
+ site_id: string;
2641
+ collection_available: boolean;
2642
+ editing_available: boolean;
2643
+ reason: string | null;
2644
+ turnstile_site_key: string | null;
2645
+ account_origin: string | null;
2646
+ }
2647
+
2648
+ interface UseProductReviewsOptions {
2649
+ apiUrl?: string;
2650
+ /** Optional site namespace; product IDs are already globally unique. */
2651
+ siteId?: string;
2652
+ sort?: 'newest' | 'highest' | 'lowest';
2653
+ rating?: 1 | 2 | 3 | 4 | 5;
2654
+ limit?: number;
2655
+ }
2656
+ interface UseProductReviewsResult {
2657
+ reviews: ProductReview[];
2658
+ summary: ReviewSummary | null;
2659
+ loading: boolean;
2660
+ loadingMore: boolean;
2661
+ error: string | null;
2662
+ /** The product is archived, inactive or removed; retry cannot restore it. */
2663
+ productUnavailable: boolean;
2664
+ hasMore: boolean;
2665
+ refresh: () => void;
2666
+ loadMore: () => void;
2667
+ }
2668
+ declare function useProductReviews(productId: string, options?: UseProductReviewsOptions): UseProductReviewsResult;
2669
+
2670
+ interface ProductRatingProps {
2671
+ productId: string;
2672
+ apiUrl?: string;
2673
+ siteId?: string;
2674
+ className?: string;
2675
+ style?: CSSProperties;
2676
+ render?: (context: {
2677
+ summary: ReviewSummary | null;
2678
+ loading: boolean;
2679
+ error: string | null;
2680
+ productUnavailable: boolean;
2681
+ retry: () => void;
2682
+ }) => ReactNode;
2683
+ }
2684
+ declare function ProductRating({ productId, apiUrl, siteId, className, style, render, }: ProductRatingProps): react_jsx_runtime.JSX.Element;
2685
+ declare namespace ProductRating {
2686
+ var neverConsentGate: string;
2687
+ }
2688
+
2689
+ interface ProductReviewsProps {
2690
+ productId: string;
2691
+ apiUrl?: string;
2692
+ siteId?: string;
2693
+ preview?: boolean;
2694
+ className?: string;
2695
+ style?: CSSProperties;
2696
+ renderReview?: (review: ProductReview) => ReactNode;
2697
+ }
2698
+ declare function ProductReviews(props: ProductReviewsProps): react_jsx_runtime.JSX.Element;
2699
+ declare namespace ProductReviews {
2700
+ var neverConsentGate: string;
2701
+ }
2702
+
2703
+ interface ProductReviewFormProps {
2704
+ productId: string;
2705
+ apiUrl?: string;
2706
+ preview?: boolean;
2707
+ className?: string;
2708
+ style?: CSSProperties;
2709
+ onSaved?: (review: OwnProductReview) => void;
2710
+ }
2711
+ declare function ProductReviewForm(props: ProductReviewFormProps): react_jsx_runtime.JSX.Element;
2712
+ declare namespace ProductReviewForm {
2713
+ var neverConsentGate: string;
2714
+ }
2715
+
2716
+ interface AccountReviewsProps {
2717
+ apiUrl?: string;
2718
+ className?: string;
2719
+ style?: CSSProperties;
2720
+ }
2721
+ /** Account discovery and withdrawal only. Editing always uses the product page. */
2722
+ declare function AccountReviews({ apiUrl: explicitApiUrl, ...props }: AccountReviewsProps): react_jsx_runtime.JSX.Element;
2723
+ declare namespace AccountReviews {
2724
+ var neverConsentGate: string;
2725
+ }
2726
+
2727
+ 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, 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 };