ublo-lib 1.5.6 → 1.5.8

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.
@@ -5,11 +5,12 @@ import { jsx as _jsx } from "react/jsx-runtime";
5
5
  const ScrollSpy = ({
6
6
  className,
7
7
  items,
8
- children,
9
- currentClassName,
10
8
  Tag = "div",
9
+ currentClassName,
11
10
  onUpdate,
12
- container
11
+ rootMargin = "-50% 0px",
12
+ container,
13
+ children
13
14
  }) => {
14
15
  const [current, setCurrent] = React.useState();
15
16
  const callback = React.useCallback(entries => {
@@ -33,13 +34,13 @@ const ScrollSpy = ({
33
34
  return element ? [...acc, element] : acc;
34
35
  }, defaultTargets) : defaultTargets;
35
36
  const observer = new IntersectionObserver(callback, {
36
- rootMargin: "-50% 0px"
37
+ rootMargin
37
38
  });
38
39
  targets.forEach(observer.observe, observer);
39
40
  return () => {
40
41
  observer.disconnect();
41
42
  };
42
- }, [callback, container, items]);
43
+ }, [callback, container, items, rootMargin]);
43
44
  return _jsx(Tag, {
44
45
  className: className,
45
46
  children: children.map(({
@@ -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
- if (!widget || widget === "undefined" || cmsMode === "editing" || cmsMode === "info" || mode === EDITING) return;
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,
@@ -1 +1,3 @@
1
- export { default, EDITING, CONNECTED } from "./msem-linker";
1
+ import MseMLinker from "./msem-linker";
2
+ export { EDITING, CONNECTED } from "./msem-linker";
3
+ export default MseMLinker;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ublo-lib",
3
- "version": "1.5.6",
3
+ "version": "1.5.8",
4
4
  "peerDependencies": {
5
5
  "dt-design-system": "^2.1.0",
6
6
  "next": "^12.0.0",