@nok-integration/storefront-react 0.22.3 → 0.22.4

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.mjs CHANGED
@@ -10132,6 +10132,16 @@ function BottomSheet({ open, onClose, title: title2, children, footer: footer2 }
10132
10132
  })]
10133
10133
  });
10134
10134
  }
10135
+ function messageToNative(message2) {
10136
+ if (typeof window === "undefined") return;
10137
+ const host = window;
10138
+ if (!host.dazn?.native?.isNative) return;
10139
+ try {
10140
+ host.daznNativeBridge?.messageToNative?.(message2);
10141
+ } catch {
10142
+ return;
10143
+ }
10144
+ }
10135
10145
  const LOW_STOCK_THRESHOLD = 5;
10136
10146
  function isLowStock(available) {
10137
10147
  return available !== void 0 && available > 0 && available <= LOW_STOCK_THRESHOLD;
@@ -10635,6 +10645,7 @@ function CartViewContent({ onContinueShopping, checkoutLabel } = {}) {
10635
10645
  });
10636
10646
  }
10637
10647
  async function handOff(current2) {
10648
+ messageToNative("showLoader");
10638
10649
  setHandingOff(true);
10639
10650
  try {
10640
10651
  const { checkout_url } = await api.cart.handoff();
@@ -10132,6 +10132,16 @@ function BottomSheet({ open, onClose, title: title2, children, footer: footer2 }
10132
10132
  })]
10133
10133
  });
10134
10134
  }
10135
+ function messageToNative(message2) {
10136
+ if (typeof window === "undefined") return;
10137
+ const host = window;
10138
+ if (!host.dazn?.native?.isNative) return;
10139
+ try {
10140
+ host.daznNativeBridge?.messageToNative?.(message2);
10141
+ } catch {
10142
+ return;
10143
+ }
10144
+ }
10135
10145
  const LOW_STOCK_THRESHOLD = 5;
10136
10146
  function isLowStock(available) {
10137
10147
  return available !== void 0 && available > 0 && available <= LOW_STOCK_THRESHOLD;
@@ -10635,6 +10645,7 @@ function CartViewContent({ onContinueShopping, checkoutLabel } = {}) {
10635
10645
  });
10636
10646
  }
10637
10647
  async function handOff(current2) {
10648
+ messageToNative("showLoader");
10638
10649
  setHandingOff(true);
10639
10650
  try {
10640
10651
  const { checkout_url } = await api.cart.handoff();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nok-integration/storefront-react",
3
- "version": "0.22.3",
3
+ "version": "0.22.4",
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",