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.
- package/es/common/hooks/use-account.js +2 -2
- package/es/common/hooks/use-tunnel.js +2 -2
- package/es/common/utils/msem-widget.js +3 -3
- package/es/esf/components/cp-form.js +2 -2
- package/es/esf/components/magic-box/booking.js +2 -2
- package/es/esf/components/magic-box/services/widgets.js +1 -1
- package/package.json +1 -1
|
@@ -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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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 {
|
|
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
|
|
63
|
+
await loadWidgetMseM(msemWidgetHost);
|
|
64
64
|
window.MseM?.onLoad(() => {
|
|
65
65
|
const options = {
|
|
66
66
|
resort,
|