@nok-integration/storefront-react 0.22.3 → 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.d.ts +1 -5
- package/dist/index.mjs +17 -20
- package/dist/standalone/storefront.mjs +17 -20
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -5897,9 +5897,6 @@ export declare type ShopEvent = {
|
|
|
5897
5897
|
| {
|
|
5898
5898
|
type: 'support_requested';
|
|
5899
5899
|
orderRef: string;
|
|
5900
|
-
} | {
|
|
5901
|
-
type: 'help_requested';
|
|
5902
|
-
inviteRef: string;
|
|
5903
5900
|
}
|
|
5904
5901
|
/**
|
|
5905
5902
|
* The fan confirmed a cancellation and the engine accepted it.
|
|
@@ -6982,14 +6979,13 @@ declare const VipInviteView: z.ZodDiscriminatedUnion<"state", [z.ZodObject<{
|
|
|
6982
6979
|
|
|
6983
6980
|
declare type VipInviteView = z.infer<typeof VipInviteView>;
|
|
6984
6981
|
|
|
6985
|
-
export declare function VipLandingView({ token, onUnavailable
|
|
6982
|
+
export declare function VipLandingView({ token, onUnavailable }: VipLandingViewProps): JSX.Element;
|
|
6986
6983
|
|
|
6987
6984
|
export declare interface VipLandingViewProps {
|
|
6988
6985
|
/** The token from the invite link: the last path segment of the URL the recipient opened. */
|
|
6989
6986
|
token: string;
|
|
6990
6987
|
/** Replaces the built-in screen for an invite that cannot be claimed. */
|
|
6991
6988
|
onUnavailable?: (state: VipInviteUnavailableState) => ReactNode;
|
|
6992
|
-
onHelp?: () => void;
|
|
6993
6989
|
}
|
|
6994
6990
|
|
|
6995
6991
|
/** "Why shop with us" reassurance tiles. */
|
package/dist/index.mjs
CHANGED
|
@@ -6402,7 +6402,6 @@ const ES = {
|
|
|
6402
6402
|
"Measurement unit": "Unidad de medida",
|
|
6403
6403
|
"Need help?": "¿Necesita ayuda?",
|
|
6404
6404
|
"Need help with your order?": "¿Necesita ayuda con su pedido?",
|
|
6405
|
-
Homepage: "Inicio",
|
|
6406
6405
|
Breadcrumb: "Ruta de navegación",
|
|
6407
6406
|
"Show image {0} of {1}": "Ver imagen {0} de {1}",
|
|
6408
6407
|
"Nothing left to return": "No queda nada por devolver",
|
|
@@ -8453,7 +8452,7 @@ function VipBreadcrumb({ title: title2, trail: trail2 = [], onHome }) {
|
|
|
8453
8452
|
type: "button",
|
|
8454
8453
|
className: styles$C.home,
|
|
8455
8454
|
onClick: onHome,
|
|
8456
|
-
children: t("
|
|
8455
|
+
children: t("DAZN Shop")
|
|
8457
8456
|
})
|
|
8458
8457
|
}), trail2.map((crumb, i) => jsxs(Fragment$1, {
|
|
8459
8458
|
children: [jsx("li", {
|
|
@@ -8934,7 +8933,7 @@ function OrderTrackingContent({ orderRef, locale: localeProp, onStartReturn, onO
|
|
|
8934
8933
|
className: styles$A.cancelledMeta,
|
|
8935
8934
|
children: t("Order #{0} · Placed {1}", shortRef$1(order.order_ref), placedOn(order.placed_at, locale))
|
|
8936
8935
|
})]
|
|
8937
|
-
}),
|
|
8936
|
+
}), jsx(Button, {
|
|
8938
8937
|
variant: "primary",
|
|
8939
8938
|
fullWidth: true,
|
|
8940
8939
|
loading: reordering,
|
|
@@ -10132,6 +10131,16 @@ function BottomSheet({ open, onClose, title: title2, children, footer: footer2 }
|
|
|
10132
10131
|
})]
|
|
10133
10132
|
});
|
|
10134
10133
|
}
|
|
10134
|
+
function messageToNative(message2) {
|
|
10135
|
+
if (typeof window === "undefined") return;
|
|
10136
|
+
const host = window;
|
|
10137
|
+
if (!host.dazn?.native?.isNative) return;
|
|
10138
|
+
try {
|
|
10139
|
+
host.daznNativeBridge?.messageToNative?.(message2);
|
|
10140
|
+
} catch {
|
|
10141
|
+
return;
|
|
10142
|
+
}
|
|
10143
|
+
}
|
|
10135
10144
|
const LOW_STOCK_THRESHOLD = 5;
|
|
10136
10145
|
function isLowStock(available) {
|
|
10137
10146
|
return available !== void 0 && available > 0 && available <= LOW_STOCK_THRESHOLD;
|
|
@@ -10635,6 +10644,7 @@ function CartViewContent({ onContinueShopping, checkoutLabel } = {}) {
|
|
|
10635
10644
|
});
|
|
10636
10645
|
}
|
|
10637
10646
|
async function handOff(current2) {
|
|
10647
|
+
messageToNative("showLoader");
|
|
10638
10648
|
setHandingOff(true);
|
|
10639
10649
|
try {
|
|
10640
10650
|
const { checkout_url } = await api.cart.handoff();
|
|
@@ -12467,7 +12477,7 @@ function VipHero({ hero: hero2, onContinue }) {
|
|
|
12467
12477
|
})
|
|
12468
12478
|
});
|
|
12469
12479
|
}
|
|
12470
|
-
function VipLandingView({ token, onUnavailable
|
|
12480
|
+
function VipLandingView({ token, onUnavailable }) {
|
|
12471
12481
|
const t = useT();
|
|
12472
12482
|
const { api, emit } = useShop();
|
|
12473
12483
|
const [load, setLoad] = useState({
|
|
@@ -12530,13 +12540,10 @@ function VipLandingView({ token, onUnavailable, onHelp }) {
|
|
|
12530
12540
|
}
|
|
12531
12541
|
return jsx(ActiveLanding, {
|
|
12532
12542
|
token,
|
|
12533
|
-
invite
|
|
12534
|
-
...onHelp ? {
|
|
12535
|
-
onHelp
|
|
12536
|
-
} : {}
|
|
12543
|
+
invite
|
|
12537
12544
|
});
|
|
12538
12545
|
}
|
|
12539
|
-
function ActiveLanding({ token, invite
|
|
12546
|
+
function ActiveLanding({ token, invite }) {
|
|
12540
12547
|
const t = useT();
|
|
12541
12548
|
const toast2 = useToast();
|
|
12542
12549
|
const { api, emit } = useShop();
|
|
@@ -12601,16 +12608,7 @@ function ActiveLanding({ token, invite, onHelp }) {
|
|
|
12601
12608
|
title: loaded.product.title,
|
|
12602
12609
|
onHome: product.close
|
|
12603
12610
|
})
|
|
12604
|
-
} : {}
|
|
12605
|
-
help: jsx(VipHelpLink, {
|
|
12606
|
-
onHelp: () => {
|
|
12607
|
-
emit({
|
|
12608
|
-
type: "help_requested",
|
|
12609
|
-
inviteRef: invite.invite_ref
|
|
12610
|
-
});
|
|
12611
|
-
onHelp?.();
|
|
12612
|
-
}
|
|
12613
|
-
})
|
|
12611
|
+
} : {}
|
|
12614
12612
|
}, loaded.product.sku);
|
|
12615
12613
|
}
|
|
12616
12614
|
if (loaded.loading) return jsx(ScreenSkeleton, {
|
|
@@ -13487,7 +13485,6 @@ function toGa4Event(event) {
|
|
|
13487
13485
|
case "ready":
|
|
13488
13486
|
case "navigate":
|
|
13489
13487
|
case "support_requested":
|
|
13490
|
-
case "help_requested":
|
|
13491
13488
|
case "order_cancellation_requested":
|
|
13492
13489
|
case "reorder_requested":
|
|
13493
13490
|
case "session_required":
|
|
@@ -6402,7 +6402,6 @@ const ES = {
|
|
|
6402
6402
|
"Measurement unit": "Unidad de medida",
|
|
6403
6403
|
"Need help?": "¿Necesita ayuda?",
|
|
6404
6404
|
"Need help with your order?": "¿Necesita ayuda con su pedido?",
|
|
6405
|
-
Homepage: "Inicio",
|
|
6406
6405
|
Breadcrumb: "Ruta de navegación",
|
|
6407
6406
|
"Show image {0} of {1}": "Ver imagen {0} de {1}",
|
|
6408
6407
|
"Nothing left to return": "No queda nada por devolver",
|
|
@@ -8453,7 +8452,7 @@ function VipBreadcrumb({ title: title2, trail: trail2 = [], onHome }) {
|
|
|
8453
8452
|
type: "button",
|
|
8454
8453
|
className: styles$C.home,
|
|
8455
8454
|
onClick: onHome,
|
|
8456
|
-
children: t("
|
|
8455
|
+
children: t("DAZN Shop")
|
|
8457
8456
|
})
|
|
8458
8457
|
}), trail2.map((crumb, i) => jsxs(Fragment$1, {
|
|
8459
8458
|
children: [jsx("li", {
|
|
@@ -8934,7 +8933,7 @@ function OrderTrackingContent({ orderRef, locale: localeProp, onStartReturn, onO
|
|
|
8934
8933
|
className: styles$A.cancelledMeta,
|
|
8935
8934
|
children: t("Order #{0} · Placed {1}", shortRef$1(order.order_ref), placedOn(order.placed_at, locale))
|
|
8936
8935
|
})]
|
|
8937
|
-
}),
|
|
8936
|
+
}), jsx(Button, {
|
|
8938
8937
|
variant: "primary",
|
|
8939
8938
|
fullWidth: true,
|
|
8940
8939
|
loading: reordering,
|
|
@@ -10132,6 +10131,16 @@ function BottomSheet({ open, onClose, title: title2, children, footer: footer2 }
|
|
|
10132
10131
|
})]
|
|
10133
10132
|
});
|
|
10134
10133
|
}
|
|
10134
|
+
function messageToNative(message2) {
|
|
10135
|
+
if (typeof window === "undefined") return;
|
|
10136
|
+
const host = window;
|
|
10137
|
+
if (!host.dazn?.native?.isNative) return;
|
|
10138
|
+
try {
|
|
10139
|
+
host.daznNativeBridge?.messageToNative?.(message2);
|
|
10140
|
+
} catch {
|
|
10141
|
+
return;
|
|
10142
|
+
}
|
|
10143
|
+
}
|
|
10135
10144
|
const LOW_STOCK_THRESHOLD = 5;
|
|
10136
10145
|
function isLowStock(available) {
|
|
10137
10146
|
return available !== void 0 && available > 0 && available <= LOW_STOCK_THRESHOLD;
|
|
@@ -10635,6 +10644,7 @@ function CartViewContent({ onContinueShopping, checkoutLabel } = {}) {
|
|
|
10635
10644
|
});
|
|
10636
10645
|
}
|
|
10637
10646
|
async function handOff(current2) {
|
|
10647
|
+
messageToNative("showLoader");
|
|
10638
10648
|
setHandingOff(true);
|
|
10639
10649
|
try {
|
|
10640
10650
|
const { checkout_url } = await api.cart.handoff();
|
|
@@ -12467,7 +12477,7 @@ function VipHero({ hero: hero2, onContinue }) {
|
|
|
12467
12477
|
})
|
|
12468
12478
|
});
|
|
12469
12479
|
}
|
|
12470
|
-
function VipLandingView({ token, onUnavailable
|
|
12480
|
+
function VipLandingView({ token, onUnavailable }) {
|
|
12471
12481
|
const t = useT();
|
|
12472
12482
|
const { api, emit } = useShop();
|
|
12473
12483
|
const [load, setLoad] = useState({
|
|
@@ -12530,13 +12540,10 @@ function VipLandingView({ token, onUnavailable, onHelp }) {
|
|
|
12530
12540
|
}
|
|
12531
12541
|
return jsx(ActiveLanding, {
|
|
12532
12542
|
token,
|
|
12533
|
-
invite
|
|
12534
|
-
...onHelp ? {
|
|
12535
|
-
onHelp
|
|
12536
|
-
} : {}
|
|
12543
|
+
invite
|
|
12537
12544
|
});
|
|
12538
12545
|
}
|
|
12539
|
-
function ActiveLanding({ token, invite
|
|
12546
|
+
function ActiveLanding({ token, invite }) {
|
|
12540
12547
|
const t = useT();
|
|
12541
12548
|
const toast2 = useToast();
|
|
12542
12549
|
const { api, emit } = useShop();
|
|
@@ -12601,16 +12608,7 @@ function ActiveLanding({ token, invite, onHelp }) {
|
|
|
12601
12608
|
title: loaded.product.title,
|
|
12602
12609
|
onHome: product.close
|
|
12603
12610
|
})
|
|
12604
|
-
} : {}
|
|
12605
|
-
help: jsx(VipHelpLink, {
|
|
12606
|
-
onHelp: () => {
|
|
12607
|
-
emit({
|
|
12608
|
-
type: "help_requested",
|
|
12609
|
-
inviteRef: invite.invite_ref
|
|
12610
|
-
});
|
|
12611
|
-
onHelp?.();
|
|
12612
|
-
}
|
|
12613
|
-
})
|
|
12611
|
+
} : {}
|
|
12614
12612
|
}, loaded.product.sku);
|
|
12615
12613
|
}
|
|
12616
12614
|
if (loaded.loading) return jsx(ScreenSkeleton, {
|
|
@@ -13487,7 +13485,6 @@ function toGa4Event(event) {
|
|
|
13487
13485
|
case "ready":
|
|
13488
13486
|
case "navigate":
|
|
13489
13487
|
case "support_requested":
|
|
13490
|
-
case "help_requested":
|
|
13491
13488
|
case "order_cancellation_requested":
|
|
13492
13489
|
case "reorder_requested":
|
|
13493
13490
|
case "session_required":
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nok-integration/storefront-react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.23.0",
|
|
4
4
|
"description": "Mountable React storefront components: catalogue, product detail and cart, mounted directly into a host DOM tree. No iframe.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"type": "module",
|