ublo-lib 1.25.3 → 1.25.5
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/components/editable-map/index.js +1 -1
- package/es/common/components/msem-preset-linker/msem-preset-linker.module.css +4 -0
- package/es/common/components/video-player/video-player.js +5 -1
- package/es/common/hooks/use-packages.js +4 -2
- package/es/common/hooks/use-zone-sync.js +5 -3
- package/es/common/utils/fetcher.js +1 -1
- package/es/esf/components/booking-form/field.js +15 -3
- package/es/esf/components/booking-form/lesson.js +0 -1
- package/es/esf/components/covid-link/index.js +1 -16
- package/es/esf/components/cp-form.js +21 -19
- package/es/esf/components/levels/levels.js +3 -3
- package/es/esf/components/period-picker/date-display.js +1 -1
- package/es/esf/components/period-picker/days.js +1 -0
- package/es/esf/components/period-picker/weeks.js +1 -0
- package/es/esf/components/reviews.js +3 -1
- package/es/esf/components/village-maps/index.js +2 -2
- package/es/esf/components/week-picker/index.js +1 -1
- package/es/esf/components/week-picker-2/index.js +1 -1
- package/es/esf/hooks/use-reviews.js +3 -1
- package/es/lbm/components/lumiplan/lumiplan.js +2 -2
- package/es/lbm/components/lumiplan/pois.js +3 -1
- package/package.json +1 -1
|
@@ -17,7 +17,7 @@ export default function EditableMap({
|
|
|
17
17
|
} = useUbloContext();
|
|
18
18
|
const [formats, setFormats] = React.useState([]);
|
|
19
19
|
const [refreshKey, setRefreshKey] = React.useState(0);
|
|
20
|
-
const refreshEditableMap =
|
|
20
|
+
const refreshEditableMap = () => {
|
|
21
21
|
setRefreshKey(key => key + 1);
|
|
22
22
|
};
|
|
23
23
|
React.useEffect(() => {
|
|
@@ -56,7 +56,11 @@ const Player = ({
|
|
|
56
56
|
React.useEffect(() => {
|
|
57
57
|
const container = containerRef.current;
|
|
58
58
|
if (fullScreen === undefined || !container) return;
|
|
59
|
-
|
|
59
|
+
if (fullScreen) {
|
|
60
|
+
Utils.enterFullScreen(container);
|
|
61
|
+
} else {
|
|
62
|
+
Utils.exitFullScreen();
|
|
63
|
+
}
|
|
60
64
|
}, [fullScreen]);
|
|
61
65
|
React.useEffect(() => {
|
|
62
66
|
setPlaying(forcePlay);
|
|
@@ -61,8 +61,10 @@ const usePackages = (defaultPopupContent, setPopupContent, cartUrl, selector = "
|
|
|
61
61
|
section.appendChild(newButton);
|
|
62
62
|
newButton.addEventListener("click", onButtonClick);
|
|
63
63
|
} else {
|
|
64
|
-
|
|
65
|
-
|
|
64
|
+
if (button) {
|
|
65
|
+
button.removeEventListener("click", onButtonClick);
|
|
66
|
+
button.remove();
|
|
67
|
+
}
|
|
66
68
|
}
|
|
67
69
|
}, [cmsMode, onButtonClick]);
|
|
68
70
|
const onPackageClick = React.useCallback(async e => {
|
|
@@ -36,9 +36,11 @@ const useZoneSync = (zoneRef, twinZoneParentSelector) => {
|
|
|
36
36
|
});
|
|
37
37
|
if (section) {
|
|
38
38
|
const image = section.querySelector("img");
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
if (image) {
|
|
40
|
+
observer.observe(image, {
|
|
41
|
+
attributes: true
|
|
42
|
+
});
|
|
43
|
+
}
|
|
42
44
|
} else {
|
|
43
45
|
zone.addEventListener("ublo-section-created", init);
|
|
44
46
|
}
|
|
@@ -2,7 +2,7 @@ const defaultContentType = {
|
|
|
2
2
|
"Content-Type": "application/json; charset=utf-8"
|
|
3
3
|
};
|
|
4
4
|
const buildQueryStringForObject = (key, object) => {
|
|
5
|
-
return Object.entries(object).filter(([
|
|
5
|
+
return Object.entries(object).filter(([, v]) => v !== undefined).map(([k, v]) => `${key}[${k}]=${encodeURIComponent(v)}`).join("&");
|
|
6
6
|
};
|
|
7
7
|
const buildQueryString = params => {
|
|
8
8
|
return Object.keys(params).filter(k => params[k] !== undefined && params[k] !== null).map(k => typeof params[k] === "object" ? buildQueryStringForObject(k, params[k]) : `${k}=${encodeURIComponent(params[k])}`).join("&");
|
|
@@ -78,13 +78,25 @@ const Field = ({
|
|
|
78
78
|
const newData = isArray ? [...data] : {
|
|
79
79
|
...data
|
|
80
80
|
};
|
|
81
|
-
isArray
|
|
81
|
+
if (isArray) {
|
|
82
|
+
newData[index][name].value = newValue;
|
|
83
|
+
} else {
|
|
84
|
+
newData[name].value = newValue;
|
|
85
|
+
}
|
|
82
86
|
if (!required) {
|
|
83
87
|
setValid(true);
|
|
84
|
-
isArray
|
|
88
|
+
if (isArray) {
|
|
89
|
+
newData[index][name].validator = true;
|
|
90
|
+
} else {
|
|
91
|
+
newData[name].validator = true;
|
|
92
|
+
}
|
|
85
93
|
} else {
|
|
86
94
|
const isValid = validate(type, newValue);
|
|
87
|
-
isArray
|
|
95
|
+
if (isArray) {
|
|
96
|
+
newData[index][name].validator = isValid;
|
|
97
|
+
} else {
|
|
98
|
+
newData[name].validator = isValid;
|
|
99
|
+
}
|
|
88
100
|
setValid(validate(type, newValue));
|
|
89
101
|
}
|
|
90
102
|
setData(newData);
|
|
@@ -1,19 +1,4 @@
|
|
|
1
|
-
const
|
|
2
|
-
fr: "Informations Covid-19",
|
|
3
|
-
en: "Covid-19 Information"
|
|
4
|
-
};
|
|
5
|
-
const CovidLink = ({
|
|
6
|
-
lang,
|
|
7
|
-
site,
|
|
8
|
-
id = "covid-link",
|
|
9
|
-
customStyles = {},
|
|
10
|
-
tooltips = DEFAULT_TOOLTIP,
|
|
11
|
-
tooltipPosition = "left",
|
|
12
|
-
hrefs,
|
|
13
|
-
zoneId = "contenu",
|
|
14
|
-
openInPopup,
|
|
15
|
-
hideFixedButton
|
|
16
|
-
}) => {
|
|
1
|
+
const CovidLink = ({}) => {
|
|
17
2
|
return null;
|
|
18
3
|
};
|
|
19
4
|
export default CovidLink;
|
|
@@ -27,25 +27,27 @@ const CPForm = ({
|
|
|
27
27
|
useEffect(() => {
|
|
28
28
|
const run = async () => {
|
|
29
29
|
await loadWigetMseM();
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
30
|
+
if (window.MseM) {
|
|
31
|
+
window.MseM.onLoad(() => {
|
|
32
|
+
const options = {
|
|
33
|
+
lang: lang === "fr" ? "fr" : "en",
|
|
34
|
+
resort,
|
|
35
|
+
channel,
|
|
36
|
+
preview: cmsMode !== undefined || preview,
|
|
37
|
+
fullWidth: true,
|
|
38
|
+
maxWidth: 1400,
|
|
39
|
+
groundedTo: "#msem-cp",
|
|
40
|
+
analytics: Plausible.callback,
|
|
41
|
+
cartUrl: cart[0].path,
|
|
42
|
+
scrollOffset: 300
|
|
43
|
+
};
|
|
44
|
+
const presets = {
|
|
45
|
+
kind: "CP",
|
|
46
|
+
stay: cmsMode === undefined && forceStay ? stay : undefined
|
|
47
|
+
};
|
|
48
|
+
window.MseM.esf(options, presets);
|
|
49
|
+
});
|
|
50
|
+
}
|
|
49
51
|
};
|
|
50
52
|
if (stay) run();
|
|
51
53
|
}, [cart, channel, cmsMode, lang, resort, forceStay, stay]);
|
|
@@ -79,7 +79,7 @@ const Level = ({
|
|
|
79
79
|
name,
|
|
80
80
|
title
|
|
81
81
|
} = level;
|
|
82
|
-
const clicked =
|
|
82
|
+
const clicked = () => () => {
|
|
83
83
|
if (levelRef.current) {
|
|
84
84
|
levelRef.current.scrollIntoView({
|
|
85
85
|
behavior: "smooth",
|
|
@@ -181,7 +181,7 @@ const AgeClasses = ({
|
|
|
181
181
|
selectedAge,
|
|
182
182
|
ageChanged
|
|
183
183
|
}) => {
|
|
184
|
-
const clicked = age =>
|
|
184
|
+
const clicked = age => () => ageChanged(age);
|
|
185
185
|
return _jsx("div", {
|
|
186
186
|
className: "evaluate-level__ages",
|
|
187
187
|
children: ages.map(age => {
|
|
@@ -211,7 +211,7 @@ const Activities = ({
|
|
|
211
211
|
selectedAge,
|
|
212
212
|
ageChanged
|
|
213
213
|
}) => {
|
|
214
|
-
const clicked = activity =>
|
|
214
|
+
const clicked = activity => () => activityChanged(activity);
|
|
215
215
|
return _jsx("div", {
|
|
216
216
|
className: "evaluate-level__activities",
|
|
217
217
|
children: activities.map(activity => {
|
|
@@ -23,7 +23,7 @@ const DateDisplay = ({
|
|
|
23
23
|
const classes = classNames(css.display, {
|
|
24
24
|
[className]: className
|
|
25
25
|
});
|
|
26
|
-
const getStoredStay = React.useCallback(
|
|
26
|
+
const getStoredStay = React.useCallback(() => {
|
|
27
27
|
const storedStay = window.sessionStorage.getItem("stay");
|
|
28
28
|
if (storedStay) {
|
|
29
29
|
const newStay = JSON.parse(storedStay);
|
|
@@ -60,7 +60,7 @@ const Map = ({
|
|
|
60
60
|
setCurrent,
|
|
61
61
|
current
|
|
62
62
|
}) => {
|
|
63
|
-
const clicked = village =>
|
|
63
|
+
const clicked = village => () => setCurrent(village);
|
|
64
64
|
return _jsxs(_Fragment, {
|
|
65
65
|
children: [_jsx("img", {
|
|
66
66
|
className: "villages-map__big-map",
|
|
@@ -106,7 +106,7 @@ const VillagesList = ({
|
|
|
106
106
|
current,
|
|
107
107
|
setOpened
|
|
108
108
|
}) => {
|
|
109
|
-
const clicked = village =>
|
|
109
|
+
const clicked = village => () => {
|
|
110
110
|
setCurrent(village);
|
|
111
111
|
setOpened(true);
|
|
112
112
|
};
|
|
@@ -141,7 +141,7 @@ const WeekPicker = ({
|
|
|
141
141
|
}
|
|
142
142
|
}
|
|
143
143
|
}, [selected, endWeek, noRoughValidation, forceSeasonSwitch, onChange]);
|
|
144
|
-
const select = week =>
|
|
144
|
+
const select = week => () => {
|
|
145
145
|
selectWeek(week);
|
|
146
146
|
if (setClosed !== undefined) {
|
|
147
147
|
setClosed(week);
|
|
@@ -19,7 +19,9 @@ const useReviews = (lang, resort, containerId = "msem-reviews", preventInit) =>
|
|
|
19
19
|
useDefaultCSS: true
|
|
20
20
|
});
|
|
21
21
|
};
|
|
22
|
-
!preventInit && reviews
|
|
22
|
+
if (!preventInit && reviews) {
|
|
23
|
+
setTimeout(run, 3000);
|
|
24
|
+
}
|
|
23
25
|
}, [containerId, language, preventInit, resort, reviews]);
|
|
24
26
|
};
|
|
25
27
|
export default useReviews;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { useInView } from "framer-motion";
|
|
3
3
|
import getConfig from "next/config";
|
|
4
|
+
import ResortSelector from "./resort-selector";
|
|
4
5
|
import TodaysTips from "./todays-tips";
|
|
5
6
|
import RoadCondition from "./road-condition";
|
|
6
7
|
import Weather from "./weather";
|
|
7
8
|
import Domain from "./domain";
|
|
8
9
|
import Pois from "./pois";
|
|
10
|
+
import Opening from "./opening";
|
|
9
11
|
import * as API from "./api";
|
|
10
12
|
import css from "./lumiplan.module.css";
|
|
11
|
-
import Opening from "./opening";
|
|
12
|
-
import ResortSelector from "./resort-selector";
|
|
13
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
14
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
15
15
|
const {
|
|
@@ -80,7 +80,9 @@ const SPECIAL_TRAILS = {
|
|
|
80
80
|
Waouland: `${lumiplanApi}/pistes-ludiques/waouland.png`,
|
|
81
81
|
Opoualand: `${lumiplanApi}/pistes-ludiques/opoualand.png`,
|
|
82
82
|
"The Flying Donuts": `${lumiplanApi}/pistes-ludiques/flying-donuts.png`,
|
|
83
|
-
"Schlitte Mountain": `${lumiplanApi}/pistes-ludiques/schlitte-mountain.png
|
|
83
|
+
"Schlitte Mountain": `${lumiplanApi}/pistes-ludiques/schlitte-mountain.png`,
|
|
84
|
+
Boris: `${lumiplanApi}/pistes-ludiques/boris.png`,
|
|
85
|
+
"Rail Park": `${lumiplanApi}/pistes-ludiques/rail-park.png`
|
|
84
86
|
};
|
|
85
87
|
const Pois = React.forwardRef(({
|
|
86
88
|
pois
|