@nok-integration/storefront-react 0.19.42 → 0.19.44

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.
@@ -5257,7 +5257,7 @@ function NoScreenTitle({ children }) {
5257
5257
  }
5258
5258
  const ShopContext = createContext(null);
5259
5259
  function DaznShopProvider({ children, ...config }) {
5260
- const { apiBaseUrl, getToken, market, navigate: hostNavigate, sessionTransport = "bearer", theme = "auto", notifications = "internal", onEvent, locale, assetBaseUrl } = config;
5260
+ const { apiBaseUrl, getToken, market, navigate: hostNavigate, prefetch: hostPrefetch, sessionTransport = "bearer", theme = "auto", notifications = "internal", onEvent, locale, assetBaseUrl } = config;
5261
5261
  const listeners = useRef(/* @__PURE__ */ new Set());
5262
5262
  const subscribe = useCallback((listener) => {
5263
5263
  listeners.current.add(listener);
@@ -5320,8 +5320,9 @@ function DaznShopProvider({ children, ...config }) {
5320
5320
  assetBaseUrl,
5321
5321
  emit,
5322
5322
  subscribe,
5323
- navigate
5324
- }), [api, market, products, theme, notifications, locale, assetBaseUrl, emit, subscribe, navigate]);
5323
+ navigate,
5324
+ prefetch: hostPrefetch ?? null
5325
+ }), [api, market, products, theme, notifications, locale, assetBaseUrl, emit, subscribe, navigate, hostPrefetch]);
5325
5326
  return jsx(ShopContext.Provider, {
5326
5327
  value: value2,
5327
5328
  children: jsx(ScreenTitleProvider, {
@@ -5345,6 +5346,9 @@ function useShopApi() {
5345
5346
  function useNavigate() {
5346
5347
  return useShopOptional()?.navigate ?? null;
5347
5348
  }
5349
+ function usePrefetch() {
5350
+ return useShopOptional()?.prefetch ?? null;
5351
+ }
5348
5352
  function useAssetUrl() {
5349
5353
  const base = useShopOptional()?.assetBaseUrl;
5350
5354
  return useCallback((src) => resolveAssetUrl(src, base), [base]);
@@ -5355,7 +5359,35 @@ function useShopEvent() {
5355
5359
  }
5356
5360
  function ShopLink({ to, children, ...rest }) {
5357
5361
  const navigate = useNavigate();
5362
+ const prefetch = usePrefetch();
5363
+ const anchor2 = useRef(null);
5364
+ const warmed = useRef(false);
5365
+ const warm = () => {
5366
+ if (warmed.current || !prefetch) return;
5367
+ warmed.current = true;
5368
+ prefetch(to);
5369
+ };
5370
+ useEffect(() => {
5371
+ warmed.current = false;
5372
+ }, [to]);
5373
+ useEffect(() => {
5374
+ const el = anchor2.current;
5375
+ if (!el || !prefetch || typeof IntersectionObserver === "undefined") return;
5376
+ const observer = new IntersectionObserver((entries) => {
5377
+ for (const entry of entries) {
5378
+ if (!entry.isIntersecting) continue;
5379
+ observer.disconnect();
5380
+ warm();
5381
+ }
5382
+ }, {
5383
+ rootMargin: "200px"
5384
+ });
5385
+ observer.observe(el);
5386
+ return () => observer.disconnect();
5387
+ }, [prefetch, to]);
5358
5388
  return jsx("a", {
5389
+ ref: anchor2,
5390
+ onPointerDown: warm,
5359
5391
  href: to,
5360
5392
  onClick: (event) => {
5361
5393
  if (!navigate || event.defaultPrevented || event.button !== 0 || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey || rest.target && rest.target !== "_self") {
@@ -5524,8 +5556,8 @@ function Skeleton({ width, height, radius, className, circle }) {
5524
5556
  style
5525
5557
  });
5526
5558
  }
5527
- const surface$1 = "_surface_ekrjo_10";
5528
- const fill = "_fill_ekrjo_35";
5559
+ const surface$1 = "_surface_1xwok_10";
5560
+ const fill = "_fill_1xwok_35";
5529
5561
  const styles$O = {
5530
5562
  surface: surface$1,
5531
5563
  fill
@@ -6599,27 +6631,27 @@ function renderValue(key, pricing, format, t) {
6599
6631
  }
6600
6632
  return key === "discount" ? null : format(pricing[key]);
6601
6633
  }
6602
- const lines$1 = "_lines_1nchz_19";
6603
- const line$2 = "_line_1nchz_19";
6604
- const thumb$2 = "_thumb_1nchz_34";
6605
- const image$9 = "_image_1nchz_44";
6606
- const placeholder$8 = "_placeholder_1nchz_51";
6607
- const lineBody = "_lineBody_1nchz_56";
6608
- const lineText = "_lineText_1nchz_65";
6609
- const lineTitle = "_lineTitle_1nchz_75";
6610
- const lineMeta = "_lineMeta_1nchz_107";
6611
- const detail$1 = "_detail_1nchz_104";
6612
- const linePrice = "_linePrice_1nchz_128";
6613
- const paid$3 = "_paid_1nchz_140";
6614
- const was$4 = "_was_1nchz_153";
6615
- const card$4 = "_card_1nchz_176";
6616
- const cardTitle = "_cardTitle_1nchz_184";
6617
- const cardBody = "_cardBody_1nchz_196";
6618
- const summaryCard = "_summaryCard_1nchz_168";
6619
- const itemsHeader = "_itemsHeader_1nchz_14";
6620
- const itemsTitle = "_itemsTitle_1nchz_239";
6621
- const itemsCount = "_itemsCount_1nchz_250";
6622
- const cardLines = "_cardLines_1nchz_269";
6634
+ const lines$1 = "_lines_15b52_19";
6635
+ const line$2 = "_line_15b52_19";
6636
+ const thumb$2 = "_thumb_15b52_34";
6637
+ const image$9 = "_image_15b52_44";
6638
+ const placeholder$8 = "_placeholder_15b52_51";
6639
+ const lineBody = "_lineBody_15b52_56";
6640
+ const lineText = "_lineText_15b52_65";
6641
+ const lineTitle = "_lineTitle_15b52_75";
6642
+ const lineMeta = "_lineMeta_15b52_107";
6643
+ const detail$1 = "_detail_15b52_104";
6644
+ const linePrice = "_linePrice_15b52_128";
6645
+ const paid$3 = "_paid_15b52_140";
6646
+ const was$4 = "_was_15b52_153";
6647
+ const card$4 = "_card_15b52_176";
6648
+ const cardTitle = "_cardTitle_15b52_184";
6649
+ const cardBody = "_cardBody_15b52_196";
6650
+ const summaryCard = "_summaryCard_15b52_168";
6651
+ const itemsHeader = "_itemsHeader_15b52_14";
6652
+ const itemsTitle = "_itemsTitle_15b52_225";
6653
+ const itemsCount = "_itemsCount_15b52_236";
6654
+ const cardLines = "_cardLines_15b52_255";
6623
6655
  const styles$F = {
6624
6656
  lines: lines$1,
6625
6657
  line: line$2,
@@ -7057,17 +7089,17 @@ function ReturnItemRow({ item: item2, className }) {
7057
7089
  })]
7058
7090
  });
7059
7091
  }
7060
- const page$6 = "_page_1wude_7";
7061
- const titles$2 = "_titles_1wude_15";
7062
- const title$k = "_title_1wude_15";
7063
- const subtitle$7 = "_subtitle_1wude_30";
7064
- const list$2 = "_list_1wude_38";
7065
- const card$3 = "_card_1wude_48";
7066
- const checkSlot = "_checkSlot_1wude_61";
7067
- const check = "_check_1wude_61";
7068
- const row$6 = "_row_1wude_105";
7069
- const reason = "_reason_1wude_130";
7070
- const reasonSet = "_reasonSet_1wude_150";
7092
+ const page$6 = "_page_v0hbj_7";
7093
+ const titles$2 = "_titles_v0hbj_15";
7094
+ const title$k = "_title_v0hbj_15";
7095
+ const subtitle$7 = "_subtitle_v0hbj_30";
7096
+ const list$2 = "_list_v0hbj_38";
7097
+ const card$3 = "_card_v0hbj_48";
7098
+ const checkSlot = "_checkSlot_v0hbj_61";
7099
+ const check = "_check_v0hbj_61";
7100
+ const row$6 = "_row_v0hbj_105";
7101
+ const reason = "_reason_v0hbj_112";
7102
+ const reasonSet = "_reasonSet_v0hbj_132";
7071
7103
  const styles$B = {
7072
7104
  page: page$6,
7073
7105
  titles: titles$2,
@@ -7943,13 +7975,13 @@ function HelpRow({ label: label2, status, onClick }) {
7943
7975
  function shortRef$1(orderRef) {
7944
7976
  return orderRef.replace(/^ord_/, "");
7945
7977
  }
7946
- const page$2 = "_page_o6awf_6";
7947
- const confirmed = "_confirmed_o6awf_16";
7948
- const title$h = "_title_o6awf_22";
7949
- const headline = "_headline_o6awf_47";
7950
- const subtitle$4 = "_subtitle_o6awf_65";
7951
- const rule = "_rule_o6awf_89";
7952
- const done = "_done_o6awf_106";
7978
+ const page$2 = "_page_vqbqs_6";
7979
+ const confirmed = "_confirmed_vqbqs_16";
7980
+ const title$h = "_title_vqbqs_22";
7981
+ const headline = "_headline_vqbqs_47";
7982
+ const subtitle$4 = "_subtitle_vqbqs_65";
7983
+ const rule = "_rule_vqbqs_77";
7984
+ const done = "_done_vqbqs_94";
7953
7985
  const styles$x = {
7954
7986
  page: page$2,
7955
7987
  confirmed,
@@ -8698,16 +8730,16 @@ function RailCarousel({ title: title2, products, seeAllTo, inset: inset2 }) {
8698
8730
  })]
8699
8731
  });
8700
8732
  }
8701
- const overlay$2 = "_overlay_fszc5_1";
8702
- const scrim$4 = "_scrim_fszc5_10";
8703
- const sheet$2 = "_sheet_fszc5_16";
8704
- const grabArea = "_grabArea_fszc5_41";
8705
- const grabber = "_grabber_fszc5_51";
8706
- const header$4 = "_header_fszc5_59";
8707
- const title$c = "_title_fszc5_67";
8708
- const close$1 = "_close_fszc5_71";
8709
- const body$4 = "_body_fszc5_84";
8710
- const footer = "_footer_fszc5_97";
8733
+ const overlay$2 = "_overlay_uxpgl_1";
8734
+ const scrim$4 = "_scrim_uxpgl_10";
8735
+ const sheet$2 = "_sheet_uxpgl_16";
8736
+ const grabArea = "_grabArea_uxpgl_41";
8737
+ const grabber = "_grabber_uxpgl_51";
8738
+ const header$4 = "_header_uxpgl_59";
8739
+ const title$c = "_title_uxpgl_67";
8740
+ const close$1 = "_close_uxpgl_71";
8741
+ const body$4 = "_body_uxpgl_84";
8742
+ const footer = "_footer_uxpgl_97";
8711
8743
  const styles$o = {
8712
8744
  overlay: overlay$2,
8713
8745
  scrim: scrim$4,
@@ -9139,11 +9171,11 @@ function ShippingInfo() {
9139
9171
  })]
9140
9172
  });
9141
9173
  }
9142
- const bar = "_bar_1e0f6_1";
9143
- const floating$1 = "_floating_1e0f6_53";
9144
- const divider = "_divider_1e0f6_59";
9145
- const info$1 = "_info_1e0f6_63";
9146
- const actions = "_actions_1e0f6_71";
9174
+ const bar = "_bar_v20rr_1";
9175
+ const floating$1 = "_floating_v20rr_31";
9176
+ const divider = "_divider_v20rr_37";
9177
+ const info$1 = "_info_v20rr_41";
9178
+ const actions = "_actions_v20rr_49";
9147
9179
  const styles$k = {
9148
9180
  bar,
9149
9181
  floating: floating$1,
@@ -9163,14 +9195,14 @@ function StickyCtaBar({ children, info: info2, variant = "floating" }) {
9163
9195
  })]
9164
9196
  });
9165
9197
  }
9166
- const surface = "_surface_3g1wi_15";
9167
- const screen = "_screen_3g1wi_20";
9168
- const body$3 = "_body_3g1wi_12";
9169
- const items = "_items_3g1wi_34";
9170
- const sectionHeader = "_sectionHeader_3g1wi_40";
9171
- const sectionTitle = "_sectionTitle_3g1wi_46";
9172
- const count = "_count_3g1wi_67";
9173
- const lines = "_lines_3g1wi_91";
9198
+ const surface = "_surface_15488_15";
9199
+ const screen = "_screen_15488_20";
9200
+ const body$3 = "_body_15488_12";
9201
+ const items = "_items_15488_34";
9202
+ const sectionHeader = "_sectionHeader_15488_40";
9203
+ const sectionTitle = "_sectionTitle_15488_46";
9204
+ const count = "_count_15488_55";
9205
+ const lines = "_lines_15488_79";
9174
9206
  const styles$j = {
9175
9207
  surface,
9176
9208
  screen,
@@ -9429,14 +9461,14 @@ function CartSheetProvider({ children }) {
9429
9461
  })]
9430
9462
  });
9431
9463
  }
9432
- const gallery = "_gallery_o876w_1";
9433
- const track$2 = "_track_o876w_5";
9434
- const slide$1 = "_slide_o876w_29";
9435
- const image$4 = "_image_o876w_36";
9436
- const placeholder$1 = "_placeholder_o876w_40";
9437
- const dots$2 = "_dots_o876w_58";
9438
- const dot$2 = "_dot_o876w_58";
9439
- const dotActive$2 = "_dotActive_o876w_109";
9464
+ const gallery = "_gallery_1wmgz_1";
9465
+ const track$2 = "_track_1wmgz_5";
9466
+ const slide$1 = "_slide_1wmgz_20";
9467
+ const image$4 = "_image_1wmgz_27";
9468
+ const placeholder$1 = "_placeholder_1wmgz_31";
9469
+ const dots$2 = "_dots_1wmgz_49";
9470
+ const dot$2 = "_dot_1wmgz_49";
9471
+ const dotActive$2 = "_dotActive_1wmgz_100";
9440
9472
  const styles$i = {
9441
9473
  gallery,
9442
9474
  track: track$2,
@@ -10402,14 +10434,14 @@ function ProductDetail({ product, inventory: inventory2, recommendations = [] })
10402
10434
  })]
10403
10435
  });
10404
10436
  }
10405
- const hero$1 = "_hero_s25l3_10";
10406
- const image$2 = "_image_s25l3_42";
10407
- const scrim$1 = "_scrim_s25l3_70";
10408
- const fade = "_fade_s25l3_94";
10409
- const text$2 = "_text_s25l3_108";
10410
- const title$5 = "_title_s25l3_157";
10411
- const subtitle$2 = "_subtitle_s25l3_168";
10412
- const noImage = "_noImage_s25l3_183";
10437
+ const hero$1 = "_hero_1tiqx_10";
10438
+ const image$2 = "_image_1tiqx_42";
10439
+ const scrim$1 = "_scrim_1tiqx_70";
10440
+ const fade = "_fade_1tiqx_94";
10441
+ const text$2 = "_text_1tiqx_108";
10442
+ const title$5 = "_title_1tiqx_157";
10443
+ const subtitle$2 = "_subtitle_1tiqx_168";
10444
+ const noImage = "_noImage_1tiqx_183";
10413
10445
  const styles$9 = {
10414
10446
  hero: hero$1,
10415
10447
  image: image$2,
@@ -10925,24 +10957,24 @@ function ProductView({ sku, initialData, showRecommendations = true, onNotFound
10925
10957
  })
10926
10958
  });
10927
10959
  }
10928
- const showcase = "_showcase_t7w1s_59";
10929
- const panel = "_panel_t7w1s_63";
10930
- const image = "_image_t7w1s_91";
10931
- const hero = "_hero_t7w1s_131";
10932
- const heroContent = "_heroContent_t7w1s_212";
10933
- const heroText = "_heroText_t7w1s_236";
10934
- const logo = "_logo_t7w1s_245";
10935
- const heroTitle = "_heroTitle_t7w1s_265";
10936
- const heroSub = "_heroSub_t7w1s_289";
10937
- const swipe = "_swipe_t7w1s_308";
10938
- const swipeLabel = "_swipeLabel_t7w1s_315";
10939
- const chevron$1 = "_chevron_t7w1s_321";
10940
- const overlay$1 = "_overlay_t7w1s_11";
10941
- const copy = "_copy_t7w1s_356";
10942
- const title$2 = "_title_t7w1s_361";
10943
- const subtitle$1 = "_subtitle_t7w1s_368";
10944
- const cta = "_cta_t7w1s_374";
10945
- const mosaic = "_mosaic_t7w1s_418";
10960
+ const showcase = "_showcase_x4nga_14";
10961
+ const panel = "_panel_x4nga_19";
10962
+ const image = "_image_x4nga_48";
10963
+ const hero = "_hero_x4nga_88";
10964
+ const heroContent = "_heroContent_x4nga_173";
10965
+ const heroText = "_heroText_x4nga_197";
10966
+ const logo = "_logo_x4nga_206";
10967
+ const heroTitle = "_heroTitle_x4nga_226";
10968
+ const heroSub = "_heroSub_x4nga_250";
10969
+ const swipe = "_swipe_x4nga_269";
10970
+ const swipeLabel = "_swipeLabel_x4nga_276";
10971
+ const chevron$1 = "_chevron_x4nga_282";
10972
+ const overlay$1 = "_overlay_x4nga_11";
10973
+ const copy = "_copy_x4nga_317";
10974
+ const title$2 = "_title_x4nga_322";
10975
+ const subtitle$1 = "_subtitle_x4nga_329";
10976
+ const cta = "_cta_x4nga_335";
10977
+ const mosaic = "_mosaic_x4nga_379";
10946
10978
  const styles$2 = {
10947
10979
  showcase,
10948
10980
  panel,
@@ -11217,18 +11249,18 @@ function useCartCount() {
11217
11249
  }, [subscribe]);
11218
11250
  return count2;
11219
11251
  }
11220
- const header$1 = "_header_1a3o7_25";
11221
- const floating = "_floating_1a3o7_44";
11222
- const scrolled = "_scrolled_1a3o7_79";
11223
- const title$1 = "_title_1a3o7_172";
11224
- const leading = "_leading_1a3o7_199";
11225
- const right = "_right_1a3o7_205";
11226
- const spacer = "_spacer_1a3o7_218";
11227
- const iconBtn = "_iconBtn_1a3o7_223";
11228
- const menuBtn = "_menuBtn_1a3o7_250";
11229
- const badge = "_badge_1a3o7_278";
11230
- const closeSlot = "_closeSlot_1a3o7_305";
11231
- const centred = "_centred_1a3o7_320";
11252
+ const header$1 = "_header_r9jjq_14";
11253
+ const floating = "_floating_r9jjq_39";
11254
+ const scrolled = "_scrolled_r9jjq_47";
11255
+ const title$1 = "_title_r9jjq_121";
11256
+ const leading = "_leading_r9jjq_134";
11257
+ const right = "_right_r9jjq_140";
11258
+ const spacer = "_spacer_r9jjq_153";
11259
+ const iconBtn = "_iconBtn_r9jjq_158";
11260
+ const menuBtn = "_menuBtn_r9jjq_185";
11261
+ const badge = "_badge_r9jjq_194";
11262
+ const closeSlot = "_closeSlot_r9jjq_221";
11263
+ const centred = "_centred_r9jjq_236";
11232
11264
  const styles$1 = {
11233
11265
  header: header$1,
11234
11266
  floating,
@@ -11702,6 +11734,7 @@ export {
11702
11734
  useCartSheet,
11703
11735
  useMoney,
11704
11736
  useNavigate,
11737
+ usePrefetch,
11705
11738
  useProduct,
11706
11739
  useShopApi,
11707
11740
  useShopEvent,