ublo-lib 1.31.24 → 1.31.25

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.
@@ -12,7 +12,7 @@ export default function useAccount({
12
12
  const widgetLang = React.useMemo(() => lang === "fr" ? "fr" : "en", [lang]);
13
13
  React.useEffect(() => {
14
14
  const startAccount = async () => {
15
- await loadWigetMseM(integration);
15
+ await loadWidgetMseM(integration);
16
16
  window.MseM.onLoad(() => {
17
17
  window.MseM.customerAccount({
18
18
  lang: widgetLang,
@@ -25,7 +25,7 @@ export default function useAccount({
25
25
  startAccount();
26
26
  }, [channel, integration, widgetLang]);
27
27
  }
28
- async function loadWigetMseM(integration) {
28
+ async function loadWidgetMseM(integration) {
29
29
  const source = integration ? "https://widget-integration.msem.tech/static/js/widget-msem.js" : "https://widget.msem.tech/static/js/widget-msem.js";
30
30
  await loadJS(source, "widget-msem");
31
31
  }
@@ -35,7 +35,7 @@ export default function useTunnel({
35
35
  await loadWidgetMseM(integration);
36
36
  const categoryCode = window.sessionStorage.getItem("categoryCode") || undefined;
37
37
  window.MseM.onLoad(() => {
38
- window.MseM.tunnel({
38
+ window.requestAnimationFrame(() => window.MseM.tunnel({
39
39
  channel,
40
40
  resort,
41
41
  groundedTo,
@@ -44,7 +44,7 @@ export default function useTunnel({
44
44
  customOffers,
45
45
  analytics: Plausible.callback,
46
46
  categoryCode
47
- });
47
+ }));
48
48
  });
49
49
  };
50
50
  if (enableCustomOffers && customOffers !== undefined || !enableCustomOffers) {
@@ -2,7 +2,7 @@ import NextScript from "next/script";
2
2
  import getConfig from "next/config";
3
3
  import { loadJS } from "./load-js";
4
4
  import { jsx as _jsx } from "react/jsx-runtime";
5
- export const loadWigetMseM = async (id = "widget-msem", forceIntegration = false) => {
5
+ export const loadWidgetMseM = async (id = "widget-msem", forceIntegration = false) => {
6
6
  const {
7
7
  publicRuntimeConfig
8
8
  } = getConfig();
@@ -13,12 +13,12 @@ export const loadWigetMseM = async (id = "widget-msem", forceIntegration = false
13
13
  return loadJS(widgetUrl, id);
14
14
  };
15
15
  export const openMseM = async (widget, options = {}, presets = {}) => {
16
- await loadWigetMseM();
16
+ await loadWidgetMseM();
17
17
  window.MseM?.onLoad(() => window.MseM[widget](options, presets));
18
18
  };
19
19
  export function loadWidget(widget, options = {}, presets = {}) {
20
20
  if (window.MseMLoaded) {
21
- window.MseM?.onLoad(() => window.MseM[widget](options, presets));
21
+ window.MseM?.onLoad(() => window.requestAnimationFrame(() => window.MseM[widget](options, presets)));
22
22
  } else {
23
23
  setTimeout(() => {
24
24
  const isGroundedTo = ("groundedTo" in options);
@@ -14,7 +14,7 @@ export const loadJS = (url, id) => {
14
14
  document.body.appendChild(el);
15
15
  });
16
16
  };
17
- export const loadWigetMseM = () => loadJS("https://widget.msem.tech/static/js/widget-msem.js", "widget-msem");
17
+ export const loadWidgetMseM = () => loadJS("https://widget.msem.tech/static/js/widget-msem.js", "widget-msem");
18
18
  const CPForm = ({
19
19
  lang,
20
20
  channel = "ESF",
@@ -26,7 +26,7 @@ const CPForm = ({
26
26
  }) => {
27
27
  useEffect(() => {
28
28
  const run = async () => {
29
- await loadWigetMseM();
29
+ await loadWidgetMseM();
30
30
  if (window.MseM) {
31
31
  window.MseM.onLoad(() => {
32
32
  const options = {
@@ -3,7 +3,7 @@ import { useUbloContext } from "ublo/with-ublo";
3
3
  import Button from "dt-design-system/es/button";
4
4
  import * as Icons from "dt-design-system/es/icons";
5
5
  import { message } from "./messages";
6
- import { loadWigetMseM } from "./services/widgets";
6
+ import { loadWidgetMseM } from "./services/widgets";
7
7
  import * as Plausible from "../../../common/components/plausible";
8
8
  import css from "./booking.module.css";
9
9
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -60,7 +60,7 @@ const Booking = ({
60
60
  }, [cartPage, categoryCode]);
61
61
  React.useEffect(() => {
62
62
  const init = async () => {
63
- await loadWigetMseM(msemWidgetHost);
63
+ await loadWidgetMseM(msemWidgetHost);
64
64
  window.MseM?.onLoad(() => {
65
65
  const options = {
66
66
  resort,
@@ -1,4 +1,4 @@
1
1
  import { loadJS } from "../../../../common/utils/load-js";
2
- export async function loadWigetMseM(msemWidgetHost) {
2
+ export async function loadWidgetMseM(msemWidgetHost) {
3
3
  await loadJS(`${msemWidgetHost}/static/js/widget-msem.js`, "widget-msem");
4
4
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ublo-lib",
3
- "version": "1.31.24",
3
+ "version": "1.31.25",
4
4
  "peerDependencies": {
5
5
  "dt-design-system": "^3.8.3",
6
6
  "leaflet": "^1.9.1",