ublo-lib 1.25.3 → 1.25.4

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.
@@ -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 = e => {
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
- fullScreen ? Utils.enterFullScreen(container) : Utils.exitFullScreen();
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
- button && button.removeEventListener("click", onButtonClick);
65
- button && button.remove();
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
- image && observer.observe(image, {
40
- attributes: true
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(([k, v]) => v !== undefined).map(([k, v]) => `${key}[${k}]=${encodeURIComponent(v)}`).join("&");
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 ? newData[index][name].value = newValue : newData[name].value = newValue;
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 ? newData[index][name].validator = true : newData[name].validator = true;
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 ? newData[index][name].validator = isValid : newData[name].validator = isValid;
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);
@@ -11,7 +11,6 @@ const Lesson = ({
11
11
  lang,
12
12
  index,
13
13
  fields,
14
- lesson,
15
14
  lessons,
16
15
  setLessons
17
16
  }) => {
@@ -1,19 +1,4 @@
1
- const DEFAULT_TOOLTIP = {
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
- window.MseM && window.MseM.onLoad(() => {
31
- const options = {
32
- lang: lang === "fr" ? "fr" : "en",
33
- resort,
34
- channel,
35
- preview: cmsMode !== undefined || preview,
36
- fullWidth: true,
37
- maxWidth: 1400,
38
- groundedTo: "#msem-cp",
39
- analytics: Plausible.callback,
40
- cartUrl: cart[0].path,
41
- scrollOffset: 300
42
- };
43
- const presets = {
44
- kind: "CP",
45
- stay: cmsMode === undefined && forceStay ? stay : undefined
46
- };
47
- window.MseM.esf(options, presets);
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 = name => e => {
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 => e => ageChanged(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 => e => activityChanged(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(e => {
26
+ const getStoredStay = React.useCallback(() => {
27
27
  const storedStay = window.sessionStorage.getItem("stay");
28
28
  if (storedStay) {
29
29
  const newStay = JSON.parse(storedStay);
@@ -107,4 +107,5 @@ const Days = React.forwardRef(({
107
107
  }, day))
108
108
  });
109
109
  });
110
+ Days.displayName = "Days";
110
111
  export default Days;
@@ -110,4 +110,5 @@ const Weeks = React.forwardRef(({
110
110
  })
111
111
  });
112
112
  });
113
+ Weeks.displayName = "Weeks";
113
114
  export default Weeks;
@@ -18,7 +18,9 @@ const Reviews = ({
18
18
  useDefaultCSS: true
19
19
  });
20
20
  };
21
- resort && setTimeout(run, 3000);
21
+ if (resort) {
22
+ setTimeout(run, 3000);
23
+ }
22
24
  }, [resort, reviewsLang, selector]);
23
25
  return _jsx("div", {
24
26
  id: selector
@@ -60,7 +60,7 @@ const Map = ({
60
60
  setCurrent,
61
61
  current
62
62
  }) => {
63
- const clicked = village => e => setCurrent(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 => e => {
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);
@@ -163,7 +163,7 @@ const WeekPicker = ({
163
163
  bar.scrollLeft = currentScroll + 200;
164
164
  }
165
165
  };
166
- const select = week => _ => {
166
+ const select = week => () => {
167
167
  selectWeek(week);
168
168
  if (setClosed !== undefined) {
169
169
  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 && setTimeout(run, 3000);
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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ublo-lib",
3
- "version": "1.25.3",
3
+ "version": "1.25.4",
4
4
  "peerDependencies": {
5
5
  "dt-design-system": "^3.1.5",
6
6
  "leaflet": "^1.9.1",