ublo-lib 1.5.7 → 1.5.9
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.
|
@@ -7,7 +7,6 @@ import css from "./editable-map.module.css";
|
|
|
7
7
|
import "leaflet/dist/leaflet.css";
|
|
8
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
9
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
|
-
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
11
10
|
const FRANCE_CENTER = [46.807934, 3.645097];
|
|
12
11
|
const DEFAULT_ZOOM = 6;
|
|
13
12
|
|
|
@@ -26,7 +25,6 @@ const EditableMap = ({
|
|
|
26
25
|
const [center, setCenter] = React.useState(presets?.center || FRANCE_CENTER);
|
|
27
26
|
const [zoom, setZoom] = React.useState(presets?.zoom ?? DEFAULT_ZOOM);
|
|
28
27
|
const [markers, setMarkers] = React.useState(presets?.markers ?? []);
|
|
29
|
-
const mustRenderMap = !cmsMode || cmsMode === "editing";
|
|
30
28
|
const refreshSize = React.useCallback(() => {
|
|
31
29
|
if (!mustRenderMap) return;
|
|
32
30
|
ref.current.invalidateSize();
|
|
@@ -63,12 +61,10 @@ const EditableMap = ({
|
|
|
63
61
|
setCenter: setCenter
|
|
64
62
|
})]
|
|
65
63
|
}), [markers, center, zoom]);
|
|
66
|
-
return
|
|
64
|
+
return _jsxs("div", {
|
|
67
65
|
className: css.container,
|
|
68
66
|
"data-cms-remove": "",
|
|
69
|
-
children:
|
|
70
|
-
children: [map, cmsMode === "editing" && _jsx(Helper, {})]
|
|
71
|
-
})
|
|
67
|
+
children: [map, cmsMode === "editing" && _jsx(Helper, {})]
|
|
72
68
|
});
|
|
73
69
|
};
|
|
74
70
|
|
|
@@ -18,7 +18,11 @@ const useWidgets = (widgets, defaultOptions, mode, resorts, skiPassesUrl, setTun
|
|
|
18
18
|
} = section.dataset;
|
|
19
19
|
const selectedWidget = widgets[widget];
|
|
20
20
|
const linkOverride = section.querySelector("a")?.href;
|
|
21
|
-
|
|
21
|
+
|
|
22
|
+
if (!widget || widget === "undefined" || cmsMode === "editing" || cmsMode === "info" || mode === EDITING) {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
|
|
22
26
|
const storedConfig = config ? JSON.parse(decodeURIComponent(config)) : {};
|
|
23
27
|
const {
|
|
24
28
|
options = {},
|
|
@@ -41,6 +45,7 @@ const useWidgets = (widgets, defaultOptions, mode, resorts, skiPassesUrl, setTun
|
|
|
41
45
|
roomType
|
|
42
46
|
} = previewDetails || {};
|
|
43
47
|
const isSkiPasses = selectedWidget.widget === "skiPass";
|
|
48
|
+
const isLodging = selectedWidget.widget === "lodging";
|
|
44
49
|
setTunnelDestination?.(resortData?.code);
|
|
45
50
|
|
|
46
51
|
if (isSkiPasses && skiPassWidgetUrl) {
|
|
@@ -52,7 +57,7 @@ const useWidgets = (widgets, defaultOptions, mode, resorts, skiPassesUrl, setTun
|
|
|
52
57
|
return;
|
|
53
58
|
}
|
|
54
59
|
|
|
55
|
-
if (lodgingPrefixUrl) {
|
|
60
|
+
if (isLodging && lodgingPrefixUrl) {
|
|
56
61
|
const endpoint = URLParams.getLodgingUrl({
|
|
57
62
|
presets,
|
|
58
63
|
options: { ...options,
|