ublo-lib 1.31.4 → 1.31.6

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.
@@ -41,6 +41,7 @@ export default function useTunnel({
41
41
  groundedTo,
42
42
  lang: widgetLang,
43
43
  esfUrl,
44
+ customOffers,
44
45
  analytics: Plausible.callback,
45
46
  categoryCode
46
47
  });
@@ -2,7 +2,7 @@ import * as React from "react";
2
2
  import { useUbloContext } from "ublo/with-ublo";
3
3
  import { loadJS } from "../../common/utils/load-js";
4
4
  import * as Plausible from "../../common/components/plausible";
5
- export default function useBookingLinks(cart, multipleVillages, setupCallback, channel = "ESF") {
5
+ export default function useBookingLinks(cart, multipleVillages, setupCallback, channel = "ESF", cartChanged) {
6
6
  const {
7
7
  breadcrumb,
8
8
  config,
@@ -14,14 +14,14 @@ export default function useBookingLinks(cart, multipleVillages, setupCallback, c
14
14
  React.useEffect(() => {
15
15
  const run = async () => {
16
16
  await loadJS("https://widget.vente-en-ligne-esf.com/boutique/boutique.js", "boutique-js");
17
- setupConfig(bookingLang, breadcrumb, cart, multipleVillages, hasLangPrefix, channel);
17
+ setupConfig(bookingLang, breadcrumb, cart, multipleVillages, hasLangPrefix, channel, cartChanged);
18
18
  setupDialogCleanup();
19
19
  setupCallback?.();
20
20
  };
21
21
  run();
22
- }, [bookingLang, breadcrumb, cart, channel, hasLangPrefix, multipleVillages, path, setupCallback]);
22
+ }, [bookingLang, breadcrumb, cart, cartChanged, channel, hasLangPrefix, multipleVillages, path, setupCallback]);
23
23
  }
24
- function setupConfig(lang, breadcrumb, cart = [], multipleVillages, hasLangPrefix, channel) {
24
+ function setupConfig(lang, breadcrumb, cart = [], multipleVillages, hasLangPrefix, channel, cartChanged) {
25
25
  const pageEsf = multipleVillages ? breadcrumb?.next?.path : breadcrumb?.path;
26
26
  const langPrefix = hasLangPrefix ? `/${lang}` : "";
27
27
  const pagePanier = langPrefix.concat(cart[0] ? cart[0].path : "/panier");
@@ -30,6 +30,7 @@ function setupConfig(lang, breadcrumb, cart = [], multipleVillages, hasLangPrefi
30
30
  window.currentLang = lang;
31
31
  window.analytics = Plausible.callback;
32
32
  window.channel = channel;
33
+ window.cartChanged = cartChanged;
33
34
  }
34
35
  function closeAllDialogs(e) {
35
36
  const cart = e.target.closest("[onclick^='openBoutiqueESF(']");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ublo-lib",
3
- "version": "1.31.4",
3
+ "version": "1.31.6",
4
4
  "peerDependencies": {
5
5
  "dt-design-system": "^3.8.3",
6
6
  "leaflet": "^1.9.1",