@nok-integration/storefront-react 0.19.53 → 0.20.5
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 +62 -0
- package/dist/index.mjs +335 -147
- package/dist/standalone/storefront.mjs +335 -147
- package/dist/standalone/styles.css +184 -187
- package/dist/styles.css +184 -187
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -2558,6 +2558,32 @@ declare function createClient(options: ClientOptions): {
|
|
|
2558
2558
|
}[];
|
|
2559
2559
|
}>;
|
|
2560
2560
|
};
|
|
2561
|
+
storefrontConfig: {
|
|
2562
|
+
/**
|
|
2563
|
+
* Presentation, analytics and market settings. Unauthenticated: it is read before a
|
|
2564
|
+
* session exists, because the analytics tag has to be in the document that renders
|
|
2565
|
+
* the first product.
|
|
2566
|
+
*
|
|
2567
|
+
* A consumer that cannot reach this must fall back to `STOREFRONT_CONFIG_FALLBACK`
|
|
2568
|
+
* rather than failing — and that value carries no measurement id, so an outage can
|
|
2569
|
+
* only ever serve less analytics.
|
|
2570
|
+
*/
|
|
2571
|
+
get: () => Promise<{
|
|
2572
|
+
analytics: {
|
|
2573
|
+
ga4_measurement_id: string | null;
|
|
2574
|
+
debug: boolean;
|
|
2575
|
+
};
|
|
2576
|
+
presentation: {
|
|
2577
|
+
show_cart_tax: boolean;
|
|
2578
|
+
show_size_charts: boolean;
|
|
2579
|
+
show_stock_alerts: boolean;
|
|
2580
|
+
};
|
|
2581
|
+
market: {
|
|
2582
|
+
default_country: string;
|
|
2583
|
+
default_lang: string;
|
|
2584
|
+
};
|
|
2585
|
+
}>;
|
|
2586
|
+
};
|
|
2561
2587
|
inventory: {
|
|
2562
2588
|
get: (sku: string) => Promise<{
|
|
2563
2589
|
sku: string;
|
|
@@ -3313,6 +3339,14 @@ export declare interface DaznShopConfig {
|
|
|
3313
3339
|
notifications?: 'internal' | 'host';
|
|
3314
3340
|
onEvent?: OnEvent;
|
|
3315
3341
|
locale?: string;
|
|
3342
|
+
/**
|
|
3343
|
+
* Controls the shop may draw, when the merchandiser has them switched on.
|
|
3344
|
+
*
|
|
3345
|
+
* Omitted, or omitting a member, means on: a host that says nothing gets the whole
|
|
3346
|
+
* shop. Switching one off removes the control and the flow behind it; it never leaves
|
|
3347
|
+
* a button that does nothing.
|
|
3348
|
+
*/
|
|
3349
|
+
features?: ShopFeatures;
|
|
3316
3350
|
}
|
|
3317
3351
|
|
|
3318
3352
|
/**
|
|
@@ -3465,6 +3499,24 @@ export declare interface FilterOption {
|
|
|
3465
3499
|
*/
|
|
3466
3500
|
export declare function formatMoney(money: Money, locale?: string): string;
|
|
3467
3501
|
|
|
3502
|
+
/**
|
|
3503
|
+
* `ShopEvent` as GA4 recommended ecommerce events.
|
|
3504
|
+
*
|
|
3505
|
+
* A pure mapping and nothing else: it loads no tag, reads no globals and sends nothing.
|
|
3506
|
+
* It turns one of our events into the `{ name, params }` a GA4 `gtag('event', …)` call
|
|
3507
|
+
* takes, so a host that already has analytics can adopt our stream without reverse
|
|
3508
|
+
* engineering it, and so the app and DAZN report the same event names for the same fan
|
|
3509
|
+
* actions rather than two vocabularies for one funnel.
|
|
3510
|
+
*
|
|
3511
|
+
* Events with no GA4 equivalent map to `null` rather than to an invented name. A custom
|
|
3512
|
+
* event that looks like a recommended one is worse than no event: it is silently absent
|
|
3513
|
+
* from every standard report while appearing to be present.
|
|
3514
|
+
*/
|
|
3515
|
+
export declare interface Ga4Event {
|
|
3516
|
+
name: string;
|
|
3517
|
+
params: Record<string, unknown>;
|
|
3518
|
+
}
|
|
3519
|
+
|
|
3468
3520
|
/**
|
|
3469
3521
|
* Supplies the session bearer token. Called before each authenticated request and again,
|
|
3470
3522
|
* once, after a `401`.
|
|
@@ -5588,6 +5640,7 @@ declare interface ShopContextValue {
|
|
|
5588
5640
|
products: ProductCache;
|
|
5589
5641
|
theme: 'light' | 'dark' | 'auto';
|
|
5590
5642
|
notifications: 'internal' | 'host';
|
|
5643
|
+
features: Required<ShopFeatures>;
|
|
5591
5644
|
locale?: string;
|
|
5592
5645
|
assetBaseUrl?: string;
|
|
5593
5646
|
emit: OnEvent;
|
|
@@ -5709,6 +5762,13 @@ export declare type ShopEvent = {
|
|
|
5709
5762
|
scope: string;
|
|
5710
5763
|
};
|
|
5711
5764
|
|
|
5765
|
+
declare interface ShopFeatures {
|
|
5766
|
+
/** Offer the size guide on products that have one. */
|
|
5767
|
+
sizeCharts?: boolean;
|
|
5768
|
+
/** Offer "Remind me when available" on an out-of-stock product. */
|
|
5769
|
+
stockAlerts?: boolean;
|
|
5770
|
+
}
|
|
5771
|
+
|
|
5712
5772
|
/**
|
|
5713
5773
|
* The 64px shop header from Figma `mobile/header` (context=shop): back chevron on the
|
|
5714
5774
|
* left, cart and overflow on the right.
|
|
@@ -6377,6 +6437,8 @@ export declare function ToastProvider({ children }: {
|
|
|
6377
6437
|
|
|
6378
6438
|
export declare type ToastTone = 'neutral' | 'success' | 'critical';
|
|
6379
6439
|
|
|
6440
|
+
export declare function toGa4Event(event: ShopEvent): Ga4Event | null;
|
|
6441
|
+
|
|
6380
6442
|
/** Resolve UI copy + behaviour for an API error code (unknown → generic retriable). */
|
|
6381
6443
|
export declare function treatmentFor(code: ErrorCode | undefined): ErrorTreatment;
|
|
6382
6444
|
|