@nok-integration/storefront-react 0.19.0 → 0.19.2
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.ts +154 -168
- package/dist/index.mjs +4174 -3581
- package/dist/standalone/storefront.mjs +4174 -3581
- package/dist/standalone/styles.css +109 -2183
- package/dist/styles.css +109 -2183
- package/package.json +9 -26
package/dist/index.d.ts
CHANGED
|
@@ -177,9 +177,9 @@ declare const CartItem: z.ZodObject<{
|
|
|
177
177
|
* and tell the fan *why* instead of silently refusing. Mirrors
|
|
178
178
|
* {@link ProductVariant.available}.
|
|
179
179
|
*
|
|
180
|
-
* **Display only, and a hint.** The
|
|
181
|
-
* runs at checkout
|
|
182
|
-
*
|
|
180
|
+
* **Display only, and a hint.** The read model is a cache and the authoritative check
|
|
181
|
+
* runs at checkout — a consumer must not treat this as a guarantee that N are
|
|
182
|
+
* purchasable. Absent = impose no cap client-side; the engine
|
|
183
183
|
* still rejects an over-quantity update with `out_of_stock`, which carries the real
|
|
184
184
|
* `available` figure in its error details.
|
|
185
185
|
*/
|
|
@@ -321,10 +321,9 @@ export declare function CartView(props?: CartViewProps): JSX.Element;
|
|
|
321
321
|
* 4.4 Cart. Loads the session cart, supports optimistic + idempotent qty/remove edits
|
|
322
322
|
* (reverting on error), and hands off to checkout.
|
|
323
323
|
*
|
|
324
|
-
*
|
|
325
|
-
*
|
|
326
|
-
*
|
|
327
|
-
* that forgets can no longer quietly lose it.
|
|
324
|
+
* Re-authentication lives in the SDK's transport, not here: it asks the host's
|
|
325
|
+
* `getToken()` once on a `401` and retries. Every component gets that without opting in,
|
|
326
|
+
* so none can quietly lose it.
|
|
328
327
|
*/
|
|
329
328
|
export declare interface CartViewProps {
|
|
330
329
|
/**
|
|
@@ -363,13 +362,11 @@ declare type CatalogReadQuery = z.infer<typeof CatalogReadQuery>;
|
|
|
363
362
|
* 4.2 Category (PCP) — the composed screen, given a page that is already fetched.
|
|
364
363
|
*
|
|
365
364
|
* This exists for the same reason `ProductDetail` does: the presentation belongs to the
|
|
366
|
-
* package, so that
|
|
367
|
-
*
|
|
368
|
-
*
|
|
369
|
-
*
|
|
370
|
-
*
|
|
371
|
-
* blocks looked right individually, which is what made it read as a missing stylesheet
|
|
372
|
-
* rather than a missing wrapper.
|
|
365
|
+
* package, so that any fetching wrapper around it — `CategoryView` here, or a host's own
|
|
366
|
+
* route — is only ever fetching. Writing the layout out separately in the wrapper is what
|
|
367
|
+
* this prevents: the blocks then look right individually while the page has no column
|
|
368
|
+
* spacing, no background and a full-bleed one-column "grid", which reads as a missing
|
|
369
|
+
* stylesheet rather than a missing wrapper.
|
|
373
370
|
*
|
|
374
371
|
* Not a client component: it renders no interactivity of its own, so it stays usable
|
|
375
372
|
* directly from a server component. The pieces that do need the client carry their own
|
|
@@ -2808,8 +2805,8 @@ declare function createClient(options: ClientOptions): {
|
|
|
2808
2805
|
}>;
|
|
2809
2806
|
};
|
|
2810
2807
|
/**
|
|
2811
|
-
* The fan's own orders
|
|
2812
|
-
*
|
|
2808
|
+
* The fan's own orders. Session-scoped: there is no way to ask for someone else's,
|
|
2809
|
+
* because there is no parameter that names a customer.
|
|
2813
2810
|
*/
|
|
2814
2811
|
stockAlerts: {
|
|
2815
2812
|
/** "Remind me when available" — idempotent per SKU for the session's principal. */
|
|
@@ -2924,10 +2921,10 @@ declare function createClient(options: ClientOptions): {
|
|
|
2924
2921
|
can_return?: boolean | undefined;
|
|
2925
2922
|
}>;
|
|
2926
2923
|
/**
|
|
2927
|
-
* Ask for the order to be cancelled
|
|
2924
|
+
* Ask for the order to be cancelled. Returns the order as it now stands.
|
|
2928
2925
|
*
|
|
2929
|
-
* A request, not a refund:
|
|
2930
|
-
*
|
|
2926
|
+
* A request, not a refund: the merchant of record moves the money. This records the
|
|
2927
|
+
* fan's ask and hands it on.
|
|
2931
2928
|
*/
|
|
2932
2929
|
requestCancellation: (orderRef: string, body: RequestCancellationRequest) => Promise<{
|
|
2933
2930
|
status: "packing" | "on_its_way" | "out_for_delivery" | "delivered" | "cancelled";
|
|
@@ -3083,8 +3080,8 @@ declare function createClient(options: ClientOptions): {
|
|
|
3083
3080
|
}>;
|
|
3084
3081
|
};
|
|
3085
3082
|
/**
|
|
3086
|
-
* The Help Center form
|
|
3087
|
-
*
|
|
3083
|
+
* The Help Center form. Session-scoped: the ticket is filed against the fan already
|
|
3084
|
+
* signed in, and there is no parameter that names a different one.
|
|
3088
3085
|
*/
|
|
3089
3086
|
support: {
|
|
3090
3087
|
/**
|
|
@@ -3207,21 +3204,21 @@ export declare interface DaznShopConfig {
|
|
|
3207
3204
|
* - `'cookie'` — the engine's httpOnly session cookie is sent instead. Correct for a
|
|
3208
3205
|
* first-party web view that authenticates by cookie and has no token for JS to hold.
|
|
3209
3206
|
*
|
|
3210
|
-
* Getting this wrong does not fail loudly
|
|
3211
|
-
* an environment that issues anonymous sessions
|
|
3212
|
-
* so an item is added to one cart and read back from another, and the basket looks
|
|
3213
|
-
*
|
|
3207
|
+
* **Getting this wrong does not fail loudly.** Requests simply arrive unauthenticated,
|
|
3208
|
+
* and an environment that issues anonymous sessions hands out a **new** one per call —
|
|
3209
|
+
* so an item is added to one cart and read back from another, and the basket looks empty
|
|
3210
|
+
* rather than broken. Check this first if a cart will not hold its contents.
|
|
3214
3211
|
*/
|
|
3215
3212
|
sessionTransport?: 'bearer' | 'cookie';
|
|
3216
3213
|
/**
|
|
3217
3214
|
* Origin (or path prefix) the SDK's own static assets are served from — the design
|
|
3218
3215
|
* imagery the shop-entry screen renders. Default: none, i.e. paths are left as written.
|
|
3219
3216
|
*
|
|
3220
|
-
* These are **root-relative** in the
|
|
3221
|
-
*
|
|
3222
|
-
*
|
|
3223
|
-
*
|
|
3224
|
-
*
|
|
3217
|
+
* These paths are **root-relative** in the bundle (`/figma/home/hero.jpg`), so a browser
|
|
3218
|
+
* resolves them against the page's own origin — which, once mounted, is the host's. A
|
|
3219
|
+
* host that does not serve this imagery gets a 404 for each one, and the shop-entry
|
|
3220
|
+
* screen renders with broken images while every other screen behaves normally. Set this
|
|
3221
|
+
* to wherever the assets are served from.
|
|
3225
3222
|
*
|
|
3226
3223
|
* Only root-relative paths are rebased. Absolute and protocol-relative URLs are left
|
|
3227
3224
|
* untouched, because catalogue media arrives from the API already absolute and must not
|
|
@@ -3292,7 +3289,7 @@ export declare interface EmptyStateProps {
|
|
|
3292
3289
|
* | invalid_request | 400 | malformed body or missing field |
|
|
3293
3290
|
* | unauthorized | 401 | missing/invalid session or credentials |
|
|
3294
3291
|
* | out_of_stock | 409 | requested qty exceeds available stock |
|
|
3295
|
-
* | cart_locked | 409 | RETIRED
|
|
3292
|
+
* | cart_locked | 409 | RETIRED; defined, never raised |
|
|
3296
3293
|
* | sku_not_found | 404 | a referenced SKU/product does not exist |
|
|
3297
3294
|
* | category_not_found | 404 | a referenced category code does not exist |
|
|
3298
3295
|
* | amount_mismatch | 422 | totals do not match the authorised amount |
|
|
@@ -3315,7 +3312,7 @@ declare type ErrorCode = z.infer<typeof ErrorCode>;
|
|
|
3315
3312
|
* | invalid_request | 400 | malformed body or missing field |
|
|
3316
3313
|
* | unauthorized | 401 | missing/invalid session or credentials |
|
|
3317
3314
|
* | out_of_stock | 409 | requested qty exceeds available stock |
|
|
3318
|
-
* | cart_locked | 409 | RETIRED
|
|
3315
|
+
* | cart_locked | 409 | RETIRED; defined, never raised |
|
|
3319
3316
|
* | sku_not_found | 404 | a referenced SKU/product does not exist |
|
|
3320
3317
|
* | category_not_found | 404 | a referenced category code does not exist |
|
|
3321
3318
|
* | amount_mismatch | 422 | totals do not match the authorised amount |
|
|
@@ -3433,8 +3430,8 @@ export declare interface IdentityGateProps {
|
|
|
3433
3430
|
}
|
|
3434
3431
|
|
|
3435
3432
|
/**
|
|
3436
|
-
* `GET /v1/inventory/{sku}` — read-model availability.
|
|
3437
|
-
* a live check is also run at checkout.
|
|
3433
|
+
* `GET /v1/inventory/{sku}` — read-model availability. This is a cached projection, not
|
|
3434
|
+
* the authoritative figure; a live check is also run at checkout.
|
|
3438
3435
|
*/
|
|
3439
3436
|
declare const Inventory: z.ZodObject<{
|
|
3440
3437
|
sku: z.ZodString;
|
|
@@ -3556,19 +3553,18 @@ export declare type OnEvent = (event: ShopEvent) => void;
|
|
|
3556
3553
|
/**
|
|
3557
3554
|
* The order confirmation (Figma `5295:74053`).
|
|
3558
3555
|
*
|
|
3559
|
-
* **A different screen from `OrderTrackingView`, not a state of it
|
|
3560
|
-
*
|
|
3561
|
-
*
|
|
3562
|
-
*
|
|
3563
|
-
*
|
|
3564
|
-
*
|
|
3565
|
-
*
|
|
3556
|
+
* **A different screen from `OrderTrackingView`, not a state of it.** The two differ in
|
|
3557
|
+
* their chrome (close-only against back + cart + overflow), in their headline, and in
|
|
3558
|
+
* their footer action, and nothing in the payload can tell them apart: `status` is a
|
|
3559
|
+
* fulfilment step and cannot say "has just come back from paying", and time-since-placed
|
|
3560
|
+
* guesses wrong for anyone opening a confirmation email an hour later. So they are two
|
|
3561
|
+
* routes, and the caller that navigates here is the one that knows — the checkout that
|
|
3562
|
+
* has just finished.
|
|
3566
3563
|
*
|
|
3567
3564
|
* Below the widget the two are the same three blocks, and they are the same components:
|
|
3568
3565
|
* see `OrderReceipt`.
|
|
3569
3566
|
*
|
|
3570
|
-
* Read-only, like tracking
|
|
3571
|
-
* precisely because cancellation is DAZN's under ADR-0008 and ADR-0017.
|
|
3567
|
+
* Read-only, like tracking: the footer is "Done" rather than "Cancel order".
|
|
3572
3568
|
*/
|
|
3573
3569
|
export declare function OrderConfirmationView(props: OrderConfirmationViewProps): JSX.Element;
|
|
3574
3570
|
|
|
@@ -3580,14 +3576,12 @@ export declare interface OrderConfirmationViewProps {
|
|
|
3580
3576
|
/**
|
|
3581
3577
|
* The frame's "Done". Omit it and no button renders.
|
|
3582
3578
|
*
|
|
3583
|
-
* **It leaves the shop.**
|
|
3584
|
-
*
|
|
3585
|
-
*
|
|
3586
|
-
* end of a purchase.
|
|
3579
|
+
* **It leaves the shop entirely.** "Done" goes to the app's own home; the header's
|
|
3580
|
+
* close control goes to the shop home. They are different destinations, and wiring both
|
|
3581
|
+
* to the shop home removes the only way out of the shop at the end of a purchase.
|
|
3587
3582
|
*
|
|
3588
|
-
*
|
|
3589
|
-
*
|
|
3590
|
-
* callback, and the header's `onClose` is the one that goes to the shop home.
|
|
3583
|
+
* It is a host callback because the app's home is not reachable from the `/v1` surface
|
|
3584
|
+
* and not somewhere `navigate('/')` can go.
|
|
3591
3585
|
*/
|
|
3592
3586
|
onDone?: () => void;
|
|
3593
3587
|
}
|
|
@@ -4087,11 +4081,10 @@ declare const OrderDetail: z.ZodObject<{
|
|
|
4087
4081
|
declare type OrderDetail = z.infer<typeof OrderDetail>;
|
|
4088
4082
|
|
|
4089
4083
|
/**
|
|
4090
|
-
* The fan's orders (Figma `mobile/order/list
|
|
4084
|
+
* The fan's orders (Figma `mobile/order/list`).
|
|
4091
4085
|
*
|
|
4092
|
-
* Read-only, like the detail screen it links to.
|
|
4093
|
-
*
|
|
4094
|
-
* {@link OrderStatusBadge}.
|
|
4086
|
+
* Read-only, like the detail screen it links to. The design's return states have no data
|
|
4087
|
+
* behind them — see {@link OrderStatusBadge}.
|
|
4095
4088
|
*
|
|
4096
4089
|
* Scoped to the session at the engine: `GET /v1/orders` takes no customer parameter, so
|
|
4097
4090
|
* there is no identifier a caller could supply to read somebody else's history.
|
|
@@ -4123,9 +4116,9 @@ declare const OrderProgressStep: z.ZodEnum<["packing", "on_its_way", "out_for_de
|
|
|
4123
4116
|
declare type OrderProgressStep = z.infer<typeof OrderProgressStep>;
|
|
4124
4117
|
|
|
4125
4118
|
/**
|
|
4126
|
-
* Fulfilment order status.
|
|
4127
|
-
*
|
|
4128
|
-
*
|
|
4119
|
+
* Fulfilment order status. It lives on the event contract rather than a synchronous order
|
|
4120
|
+
* one because fulfilment status arrives asynchronously, as events. The merchant of record
|
|
4121
|
+
* is authoritative for completed orders.
|
|
4129
4122
|
*/
|
|
4130
4123
|
declare const OrderStatus: z.ZodEnum<["confirmed", "packed", "shipped", "delivered", "cancelled", "refunded"]>;
|
|
4131
4124
|
|
|
@@ -4160,20 +4153,16 @@ export declare interface OrderSummaryProps {
|
|
|
4160
4153
|
* This exists because a zero is ambiguous and the ambiguity is dangerous. `Pricing`
|
|
4161
4154
|
* requires all four values, so the engine sends `0` for shipping and tax it has not
|
|
4162
4155
|
* computed — and rendering that gives the fan a confident "Tax £0.00" and a total that
|
|
4163
|
-
* changes at checkout.
|
|
4164
|
-
*
|
|
4156
|
+
* changes at checkout. Delivery and tax are settled at checkout, so in the cart both are
|
|
4157
|
+
* genuinely unknown rather than genuinely free.
|
|
4165
4158
|
*
|
|
4166
|
-
* **The grand total is still drawn
|
|
4167
|
-
*
|
|
4168
|
-
*
|
|
4169
|
-
* the frame. So the row is drawn, carrying `pricing.total`, and on a cart that means the
|
|
4170
|
-
* items total: delivery and tax are added at DAZN's checkout and can move it by the
|
|
4171
|
-
* spread the design's own shipping note quotes (standard $5-16, express $15-23).
|
|
4159
|
+
* **The grand total is still drawn**, carrying `pricing.total`. On a cart that means the
|
|
4160
|
+
* items total: delivery and tax are added at checkout and can move it by the spread the
|
|
4161
|
+
* design's own shipping note quotes (standard $5-16, express $15-23).
|
|
4172
4162
|
*
|
|
4173
|
-
* Deferring a row
|
|
4174
|
-
*
|
|
4175
|
-
*
|
|
4176
|
-
* comment exists to prevent.
|
|
4163
|
+
* **Deferring a row changes only that row.** Withholding the total as a side effect of
|
|
4164
|
+
* deferring something else would be a prop that silently removes a different row; if
|
|
4165
|
+
* that behaviour is ever wanted, it belongs behind an explicit prop of its own.
|
|
4177
4166
|
*/
|
|
4178
4167
|
deferred?: DeferredLine[];
|
|
4179
4168
|
/**
|
|
@@ -4234,11 +4223,10 @@ export declare interface OrderTimelineProps {
|
|
|
4234
4223
|
* One screen with three states, and the engine's `progress` is what draws them: the widget
|
|
4235
4224
|
* says where the parcel is, and everything under it is the same for all three.
|
|
4236
4225
|
*
|
|
4237
|
-
* The
|
|
4238
|
-
*
|
|
4239
|
-
*
|
|
4240
|
-
*
|
|
4241
|
-
* engine records is a request handed on.
|
|
4226
|
+
* The first state carries a "Cancel order" button and the last offers a return.
|
|
4227
|
+
* Cancelling happens in place, through the reason sheet; a return is three screens, so
|
|
4228
|
+
* "Return items" navigates to them. **Neither moves money** — both record a request and
|
|
4229
|
+
* hand it on, and nothing here computes or settles a refund.
|
|
4242
4230
|
*
|
|
4243
4231
|
* Both are drawn on the ENGINE's say-so — `can_cancel` is its dispatch cut-off,
|
|
4244
4232
|
* `can_return` its returns window. Neither is a status this screen can infer, and it does
|
|
@@ -4261,15 +4249,10 @@ export declare interface OrderTrackingViewProps {
|
|
|
4261
4249
|
/**
|
|
4262
4250
|
* Open the return flow.
|
|
4263
4251
|
*
|
|
4264
|
-
*
|
|
4265
|
-
*
|
|
4266
|
-
*
|
|
4267
|
-
*
|
|
4268
|
-
*
|
|
4269
|
-
* It is still the seam, because the flow is three SCREENS and only the host knows where
|
|
4270
|
-
* its routes are — the same reason `OrderListView` takes `onOpenOrder` rather than
|
|
4271
|
-
* navigating itself. What changed is what the handler leads to: mount `ReturnFlowView`
|
|
4272
|
-
* with this order's reference and the whole flow is there.
|
|
4252
|
+
* Optional. The return flow is three SCREENS, and only the host knows where its routes
|
|
4253
|
+
* are — the same reason `OrderListView` takes `onOpenOrder` rather than navigating
|
|
4254
|
+
* itself. Mount `ReturnFlowView` with this order's reference and the whole flow is
|
|
4255
|
+
* there.
|
|
4273
4256
|
*
|
|
4274
4257
|
* Without it the control is not drawn. The SDK will not offer a button whose destination
|
|
4275
4258
|
* does not exist, and that has not changed either.
|
|
@@ -4425,7 +4408,7 @@ declare const Pricing: z.ZodObject<{
|
|
|
4425
4408
|
|
|
4426
4409
|
declare type Pricing = z.infer<typeof Pricing>;
|
|
4427
4410
|
|
|
4428
|
-
/** A catalog product, served from the engine's cached read model
|
|
4411
|
+
/** A catalog product, served from the engine's cached read model. */
|
|
4429
4412
|
declare const Product: z.ZodObject<{
|
|
4430
4413
|
sku: z.ZodString;
|
|
4431
4414
|
title: z.ZodString;
|
|
@@ -4680,10 +4663,9 @@ export declare interface ProductDetailProps {
|
|
|
4680
4663
|
* three lines with a more/less toggle. Only renders when the catalogue provides a
|
|
4681
4664
|
* description — no placeholder copy is invented.
|
|
4682
4665
|
*
|
|
4683
|
-
* The toggle appears only when the clamp is actually hiding something
|
|
4684
|
-
*
|
|
4685
|
-
* lines and a "Less" that
|
|
4686
|
-
* products have a short description.
|
|
4666
|
+
* The toggle appears only when the clamp is actually hiding something, measured rather
|
|
4667
|
+
* than assumed: a description short enough to fit gets no control, instead of a "More"
|
|
4668
|
+
* that expands to the same lines and a "Less" that collapses back to them.
|
|
4687
4669
|
*/
|
|
4688
4670
|
export declare function ProductDetails({ description }: ProductDetailsProps): JSX.Element | null;
|
|
4689
4671
|
|
|
@@ -4981,8 +4963,8 @@ declare type RequestCancellationRequest = z.infer<typeof RequestCancellationRequ
|
|
|
4981
4963
|
* - **relative** (`./x`, `x.jpg`) — resolves against the document, which is the host's
|
|
4982
4964
|
* business, not ours.
|
|
4983
4965
|
*
|
|
4984
|
-
* With no base configured this is the identity function, so
|
|
4985
|
-
* these paths
|
|
4966
|
+
* With no base configured this is the identity function, so a host that already serves
|
|
4967
|
+
* these paths needs no configuration.
|
|
4986
4968
|
*/
|
|
4987
4969
|
export declare function resolveAssetUrl(src: string, base?: string): string;
|
|
4988
4970
|
|
|
@@ -5175,9 +5157,9 @@ declare type ReturnDetail = z.infer<typeof ReturnDetail>;
|
|
|
5175
5157
|
* around views that own the drawing. Same reason as there — a screen that loads itself is
|
|
5176
5158
|
* one a host can mount from a route with nothing but a reference.
|
|
5177
5159
|
*
|
|
5178
|
-
* **It settles no money and it is not a refund
|
|
5179
|
-
*
|
|
5180
|
-
*
|
|
5160
|
+
* **It settles no money and it is not a refund.** It records goods coming back so the
|
|
5161
|
+
* warehouse can expect them. The merchant of record makes any refund, and reports it
|
|
5162
|
+
* separately.
|
|
5181
5163
|
*/
|
|
5182
5164
|
export declare function ReturnFlowView(props: ReturnFlowViewProps): JSX.Element;
|
|
5183
5165
|
|
|
@@ -5301,13 +5283,12 @@ export declare interface SaleBadgeProps {
|
|
|
5301
5283
|
/**
|
|
5302
5284
|
* What a whole screen looks like while its data is in flight.
|
|
5303
5285
|
*
|
|
5304
|
-
*
|
|
5305
|
-
* width, height or content, a `display: block` span computes to **zero pixels
|
|
5306
|
-
*
|
|
5307
|
-
*
|
|
5308
|
-
* product arriving. It looked like a navigation bug and was a CSS one.
|
|
5286
|
+
* Use this rather than a bare `<Skeleton />`, which is not a loading state on its own:
|
|
5287
|
+
* with no width, height or content, a `display: block` span computes to **zero pixels
|
|
5288
|
+
* tall**, paints nothing, and lets whatever the host has behind it show through — in a
|
|
5289
|
+
* dark host, a black screen between tapping a link and the content arriving.
|
|
5309
5290
|
*
|
|
5310
|
-
* Two things follow
|
|
5291
|
+
* Two things follow, and they are the whole point of this component. It has real
|
|
5311
5292
|
* dimensions, so there is something on screen for the entire wait. And it is a
|
|
5312
5293
|
* `ShopSurface`, so the wait is painted in the palette of the screen you are waiting for
|
|
5313
5294
|
* — a light PDP that resolves out of a light wait, rather than out of the host's black.
|
|
@@ -5357,14 +5338,11 @@ export declare interface SheetHeaderProps {
|
|
|
5357
5338
|
* no free-shipping threshold (per design). The shopper picks the delivery tier at
|
|
5358
5339
|
* DAZN's checkout; this only signals that the options exist.
|
|
5359
5340
|
*
|
|
5360
|
-
* **The returns window is 14 days
|
|
5361
|
-
*
|
|
5362
|
-
* component was placed in the cart, so ours was the number the file agreed with more
|
|
5363
|
-
* often. The current cart frame (5304:78218) says 14 as well, so the contradiction is
|
|
5364
|
-
* gone and 14 is what the design now says in both places.
|
|
5341
|
+
* **The returns window is 14 days**, matching the design on both the PDP and the cart
|
|
5342
|
+
* (`5304:78218`).
|
|
5365
5343
|
*
|
|
5366
|
-
*
|
|
5367
|
-
*
|
|
5344
|
+
* The card only reports the policy; it does not set it. If 14 is wrong, it is wrong in the
|
|
5345
|
+
* design, and one word changes it here.
|
|
5368
5346
|
*/
|
|
5369
5347
|
export declare function ShippingInfo(): JSX.Element;
|
|
5370
5348
|
|
|
@@ -5428,17 +5406,17 @@ export declare type ShopEvent = {
|
|
|
5428
5406
|
/**
|
|
5429
5407
|
* A fan asked for help with a delivered order (0.17.2).
|
|
5430
5408
|
*
|
|
5431
|
-
*
|
|
5432
|
-
*
|
|
5433
|
-
*
|
|
5434
|
-
*
|
|
5409
|
+
* A hand-off, not a step in a flow the SDK completes: the fan pressed the row on the
|
|
5410
|
+
* order screen, and where they go next is the host's to decide. Same shape as
|
|
5411
|
+
* `checkout_handoff` — the event carries the moment and the order, and nothing after
|
|
5412
|
+
* it. No support form is rendered.
|
|
5435
5413
|
*/
|
|
5436
5414
|
| {
|
|
5437
5415
|
type: 'support_requested';
|
|
5438
5416
|
orderRef: string;
|
|
5439
5417
|
}
|
|
5440
5418
|
/**
|
|
5441
|
-
* The fan confirmed a cancellation and the engine accepted it
|
|
5419
|
+
* The fan confirmed a cancellation and the engine accepted it.
|
|
5442
5420
|
*
|
|
5443
5421
|
* Raised after the write succeeds, never on the tap: this is a statement that an order
|
|
5444
5422
|
* has been cancelled, and a host acting on it — refreshing a list, telling analytics —
|
|
@@ -5449,7 +5427,7 @@ export declare type ShopEvent = {
|
|
|
5449
5427
|
orderRef: string;
|
|
5450
5428
|
reason: string;
|
|
5451
5429
|
}
|
|
5452
|
-
/** "Reorder" on a cancelled order. The host
|
|
5430
|
+
/** "Reorder" on a cancelled order. The host decides where that leads; this only announces it. */
|
|
5453
5431
|
| {
|
|
5454
5432
|
type: 'reorder_requested';
|
|
5455
5433
|
orderRef: string;
|
|
@@ -5459,8 +5437,8 @@ export declare type ShopEvent = {
|
|
|
5459
5437
|
*
|
|
5460
5438
|
* Raised after the write, like the cancellation above, and for the same reason: a host
|
|
5461
5439
|
* counting returns must not count one the engine refused. It is not a refund and must
|
|
5462
|
-
* not be treated as one
|
|
5463
|
-
*
|
|
5440
|
+
* not be treated as one — the merchant of record determines what is paid back, and this
|
|
5441
|
+
* event says nothing about money.
|
|
5464
5442
|
*/
|
|
5465
5443
|
| {
|
|
5466
5444
|
type: 'return_requested';
|
|
@@ -5497,21 +5475,19 @@ export declare type ShopEvent = {
|
|
|
5497
5475
|
* The 64px shop header from Figma `mobile/header` (context=shop): back chevron on the
|
|
5498
5476
|
* left, cart and overflow on the right.
|
|
5499
5477
|
*
|
|
5500
|
-
* **Optional, and off by default in every view.** In the
|
|
5501
|
-
* this chrome —
|
|
5502
|
-
*
|
|
5503
|
-
*
|
|
5504
|
-
* if the design is ours, and a mismatch if only half of it is.
|
|
5478
|
+
* **Optional, and off by default in every view.** In the embedded case the host app
|
|
5479
|
+
* provides this chrome — its own back button and menu — which is why no view renders it
|
|
5480
|
+
* for you. It is exported for hosts that would otherwise have to rebuild the same bar:
|
|
5481
|
+
* duplicating it is wasted work, and matching only half of it is worse.
|
|
5505
5482
|
*
|
|
5506
5483
|
* The cart count is real, never fabricated: `useCartCount` returns `null` until it knows,
|
|
5507
5484
|
* and the badge stays hidden until then — a "0" that appears while the cart is still
|
|
5508
5485
|
* loading and then jumps to "3" is a guess wearing a number.
|
|
5509
5486
|
*
|
|
5510
5487
|
* **The badge is also hidden at zero**, which is a deliberate departure from the frame:
|
|
5511
|
-
* `.cart.icon` draws an explicit empty state carrying "0".
|
|
5512
|
-
*
|
|
5513
|
-
*
|
|
5514
|
-
* is the icon on its own.
|
|
5488
|
+
* `.cart.icon` draws an explicit empty state carrying "0". A filled pill is an attention
|
|
5489
|
+
* mark, and one saying there is nothing to look at spends attention to say so. The empty
|
|
5490
|
+
* state is the icon on its own.
|
|
5515
5491
|
*
|
|
5516
5492
|
* `useCartCount` had said as much since it was written ("a badge must render nothing for
|
|
5517
5493
|
* `null` and nothing for `0`"); the component followed the frame instead, and the two
|
|
@@ -5646,9 +5622,9 @@ export declare interface ShopLinkProps extends Omit<AnchorHTMLAttributes<HTMLAnc
|
|
|
5646
5622
|
*
|
|
5647
5623
|
* A light card anchored under the bar, over a scrim, with a close control and two rows.
|
|
5648
5624
|
*
|
|
5649
|
-
* **"Redeem a code" is gone**, and the design is what removed it.
|
|
5650
|
-
*
|
|
5651
|
-
*
|
|
5625
|
+
* **"Redeem a code" is gone**, and the design is what removed it. An earlier `Settings`
|
|
5626
|
+
* frame (636:51006) had three rows; the frame of record draws exactly two, orders and
|
|
5627
|
+
* help. It is the one row this package rendered knowing it could
|
|
5652
5628
|
* never work — promotions are DAZN's and nothing in the commerce API can redeem anything —
|
|
5653
5629
|
* so a fan tapping it got a control that did nothing, every time, by design. Both sides
|
|
5654
5630
|
* now agree it should not be there.
|
|
@@ -5666,8 +5642,7 @@ export declare interface ShopMenuSheetProps {
|
|
|
5666
5642
|
open: boolean;
|
|
5667
5643
|
onClose: () => void;
|
|
5668
5644
|
/**
|
|
5669
|
-
* The fan's orders.
|
|
5670
|
-
* `OrderListView`.
|
|
5645
|
+
* The fan's orders. Wire it to wherever the host renders `OrderListView`.
|
|
5671
5646
|
*/
|
|
5672
5647
|
onManageOrders?: () => void;
|
|
5673
5648
|
/** Help. DAZN's own surface, so a host that has one passes it here. */
|
|
@@ -5681,7 +5656,7 @@ export declare interface ShopMenuSheetProps {
|
|
|
5681
5656
|
* The public surface DAZN programs against. Everything here is a **contract**, not an
|
|
5682
5657
|
* implementation detail — see the versioning policy in the component SDK specification.
|
|
5683
5658
|
*/
|
|
5684
|
-
/** A storefront-relative identifier. NOT a URL
|
|
5659
|
+
/** A storefront-relative identifier. NOT a URL expected to resolve on the host. */
|
|
5685
5660
|
export declare type ShopRoute = '/' | `/category/${string}` | `/product/${string}` | '/cart';
|
|
5686
5661
|
|
|
5687
5662
|
/**
|
|
@@ -5709,39 +5684,31 @@ declare type ShopSessionRequest = z.infer<typeof ShopSessionRequest>;
|
|
|
5709
5684
|
* The root element of a storefront screen: base typography, element defaults, and a
|
|
5710
5685
|
* palette.
|
|
5711
5686
|
*
|
|
5712
|
-
*
|
|
5713
|
-
*
|
|
5714
|
-
*
|
|
5715
|
-
*
|
|
5716
|
-
* designed dark rendered on a light palette in the host's own body font — every component
|
|
5717
|
-
* individually correct, the screen as a whole wrong.
|
|
5718
|
-
*
|
|
5719
|
-
* **`tone` is the only input, and the provider's `theme` no longer overrides it.**
|
|
5687
|
+
* **Every screen root must render inside one.** A screen's typography and palette belong
|
|
5688
|
+
* to the screen, not to the page it is mounted in — without this, a host mounting
|
|
5689
|
+
* `<CategoryView>` gets a screen designed dark rendered on a light palette in the host's
|
|
5690
|
+
* own body font: every component individually correct, the screen as a whole wrong.
|
|
5720
5691
|
*
|
|
5721
|
-
*
|
|
5722
|
-
* to say so — but the storefront has no light and dark of the same screen to choose
|
|
5723
|
-
* between. Each screen is drawn once, in one palette: the shop entry and category pages
|
|
5724
|
-
* are dark, the PDP and cart are light. There is no light version of the dark hero, so
|
|
5725
|
-
* `theme="light"` did not render one; it repainted the tokens underneath a screen whose
|
|
5726
|
-
* artwork, photography and contrast were all built for the other palette.
|
|
5692
|
+
* **`tone` is the only input; the provider's `theme` does not override it.**
|
|
5727
5693
|
*
|
|
5728
|
-
*
|
|
5729
|
-
*
|
|
5730
|
-
*
|
|
5731
|
-
*
|
|
5732
|
-
*
|
|
5694
|
+
* Each screen is drawn once, in one palette: the shop entry and category pages are dark,
|
|
5695
|
+
* the PDP and cart are light. There is no light version of the dark hero, so asking for
|
|
5696
|
+
* one does not produce it — it repaints the tokens underneath artwork, photography and
|
|
5697
|
+
* contrast that were all built for the other palette, giving a dark hero photograph with
|
|
5698
|
+
* near-black text on it. `theme` is still accepted, so setting it will not break a build,
|
|
5699
|
+
* and it still reaches the context for hosts that read it; it does not decide what a
|
|
5700
|
+
* screen looks like.
|
|
5733
5701
|
*
|
|
5734
|
-
* `data-shop-theme` is a real attribute rather than a hashed module class so the token
|
|
5735
|
-
* remap
|
|
5736
|
-
*
|
|
5702
|
+
* `data-shop-theme` is a real attribute rather than a hashed module class, so the token
|
|
5703
|
+
* remap lives once in `theme.css` beside the values it overrides, and so a host can scope
|
|
5704
|
+
* the palette onto a subtree of its own.
|
|
5737
5705
|
*
|
|
5738
|
-
* **Anything that paints its own background must
|
|
5706
|
+
* **Anything that paints its own background must BE one of these, not merely look like
|
|
5739
5707
|
* one.** Setting `background: var(--color-surface-default)` on an element without also
|
|
5740
5708
|
* setting `color` leaves the text inheriting from the host's `<body>` — so a light sheet
|
|
5741
|
-
* in a dark host
|
|
5742
|
-
*
|
|
5743
|
-
*
|
|
5744
|
-
* **as** a dialog or a layout element, or callers will reach for the CSS shortcut again.
|
|
5709
|
+
* in a dark host renders white text on white. Hence the forwarded props and ref: a
|
|
5710
|
+
* surface has to be usable **as** a dialog or a layout element, or callers reach for the
|
|
5711
|
+
* CSS shortcut instead.
|
|
5745
5712
|
*/
|
|
5746
5713
|
export declare const ShopSurface: ForwardRefExoticComponent<ShopSurfaceProps & RefAttributes<HTMLDivElement>>;
|
|
5747
5714
|
|
|
@@ -5997,16 +5964,38 @@ declare const SupportTicketRequest: z.ZodObject<{
|
|
|
5997
5964
|
* a page showing another customer's data.
|
|
5998
5965
|
*/
|
|
5999
5966
|
image_url: z.ZodOptional<z.ZodString>;
|
|
5967
|
+
/**
|
|
5968
|
+
* The fan this ticket belongs to — **only when the caller is a DAZN service holding a
|
|
5969
|
+
* support API key**, and refused outright when the caller holds a shop session.
|
|
5970
|
+
*
|
|
5971
|
+
* Optional here because one field cannot be required of one caller and forbidden to
|
|
5972
|
+
* another in a single schema. The engine decides which rule applies from how the
|
|
5973
|
+
* request authenticated, and rejects the wrong combination either way: absent under a
|
|
5974
|
+
* key is a 400, present under a session is a 400.
|
|
5975
|
+
*
|
|
5976
|
+
* **This is not a relaxation of the rule it looks like a relaxation of.** The rule is
|
|
5977
|
+
* that an *untrusted* caller may not name the fan: a browser that could would let
|
|
5978
|
+
* anyone file a ticket as anyone, and CS would answer it in good faith with another
|
|
5979
|
+
* customer's account detail. A backend authenticated by a shared secret is not that
|
|
5980
|
+
* caller. It is authoritative for its own users in exactly the way order intake
|
|
5981
|
+
* already is when DAZN tells us whose order they have taken.
|
|
5982
|
+
*
|
|
5983
|
+
* This is for a Contact Support form living outside the shop, which therefore has no
|
|
5984
|
+
* shop session to read an identity from.
|
|
5985
|
+
*/
|
|
5986
|
+
dazn_user_id: z.ZodOptional<z.ZodString>;
|
|
6000
5987
|
}, "strict", z.ZodTypeAny, {
|
|
6001
5988
|
email: string;
|
|
6002
5989
|
description: string;
|
|
6003
5990
|
category: string;
|
|
6004
5991
|
image_url?: string | undefined;
|
|
5992
|
+
dazn_user_id?: string | undefined;
|
|
6005
5993
|
}, {
|
|
6006
5994
|
email: string;
|
|
6007
5995
|
description: string;
|
|
6008
5996
|
category: string;
|
|
6009
5997
|
image_url?: string | undefined;
|
|
5998
|
+
dazn_user_id?: string | undefined;
|
|
6010
5999
|
}>;
|
|
6011
6000
|
|
|
6012
6001
|
declare type SupportTicketRequest = z.infer<typeof SupportTicketRequest>;
|
|
@@ -6016,9 +6005,9 @@ export declare function swatchColour(name: string): string;
|
|
|
6016
6005
|
/**
|
|
6017
6006
|
* One row, structurally.
|
|
6018
6007
|
*
|
|
6019
|
-
* Deliberately not `OrderProgressEntry` itself. The return timeline
|
|
6020
|
-
*
|
|
6021
|
-
*
|
|
6008
|
+
* Deliberately not `OrderProgressEntry` itself. The return timeline is drawn by the same
|
|
6009
|
+
* Figma component with a different set of steps — reported, received, completed — so its
|
|
6010
|
+
* entries carry a different `step` enum and would not assign. Nothing
|
|
6022
6011
|
* here interprets `step` beyond keying on it, so the widened type costs nothing and saves
|
|
6023
6012
|
* a second copy of the timeline that would drift from this one.
|
|
6024
6013
|
*/
|
|
@@ -6084,8 +6073,8 @@ declare type UpdateCartItemRequest = z.infer<typeof UpdateCartItemRequest>;
|
|
|
6084
6073
|
|
|
6085
6074
|
/**
|
|
6086
6075
|
* Resolve an SDK asset path against the host's configured base. Identity outside a
|
|
6087
|
-
* provider, and identity when no base is configured — so
|
|
6088
|
-
* paths
|
|
6076
|
+
* provider, and identity when no base is configured — so a host that already serves these
|
|
6077
|
+
* paths needs no configuration.
|
|
6089
6078
|
*/
|
|
6090
6079
|
export declare function useAssetUrl(): (src: string) => string;
|
|
6091
6080
|
|
|
@@ -6164,13 +6153,10 @@ export declare function useShopOptional(): ShopContextValue | null;
|
|
|
6164
6153
|
/**
|
|
6165
6154
|
* Access the toast API. Always returns something usable.
|
|
6166
6155
|
*
|
|
6167
|
-
*
|
|
6168
|
-
*
|
|
6169
|
-
*
|
|
6170
|
-
*
|
|
6171
|
-
* entire tree on mount, because `CartView` raises toasts and nothing had mounted a
|
|
6172
|
-
* provider. With no error boundary above it, a host following our own documentation got
|
|
6173
|
-
* a blank page.
|
|
6156
|
+
* **It never throws**, because strictness here is per capability: `useShopApi` throws
|
|
6157
|
+
* because reaching the API cannot degrade, but a toast can. A `<DaznShopProvider>` with
|
|
6158
|
+
* `<CartView>` beneath it and no `<ToastProvider>` is a supported arrangement — `CartView`
|
|
6159
|
+
* raises toasts, and mounting it must not bring the tree down.
|
|
6174
6160
|
*
|
|
6175
6161
|
* Without a `<ToastProvider>` the message still goes somewhere useful: it is emitted to
|
|
6176
6162
|
* the host as a `notification` event if there is a shop provider to emit through, which
|