ublo-lib 1.31.33 → 1.31.35

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.
@@ -1,5 +1,4 @@
1
1
  import * as React from "react";
2
- import * as ReactDOM from "react-dom";
3
2
  import * as Utils from "./utils";
4
3
  import * as Plausible from "../plausible";
5
4
  export default React.memo(Tunnel);
@@ -8,7 +7,7 @@ function Tunnel({
8
7
  presets,
9
8
  children
10
9
  }) {
11
- React.useEffect(() => {
10
+ React.useLayoutEffect(() => {
12
11
  const lang = options?.lang === "fr" ? "fr" : "en";
13
12
  const categoryCode = window.sessionStorage.getItem("categoryCode") || undefined;
14
13
  const patchedOptions = {
@@ -20,9 +19,7 @@ function Tunnel({
20
19
  Plausible.callback.apply(null, args);
21
20
  }
22
21
  };
23
- ReactDOM.flushSync(() => {
24
- Utils.loadWidget("tunnel", patchedOptions, presets);
25
- });
22
+ Utils.loadWidget("tunnel", patchedOptions, presets);
26
23
  }, [options, presets]);
27
24
  return children;
28
25
  }
@@ -1,6 +1,6 @@
1
1
  export function loadWidget(widget, options = {}, presets = {}) {
2
2
  if (window.MseMLoaded) {
3
- window.MseM?.onLoad(() => window.requestAnimationFrame(() => window.MseM[widget](options, presets)));
3
+ window.MseM?.onLoad(() => window.MseM[widget](options, presets));
4
4
  } else {
5
5
  setTimeout(() => {
6
6
  const isGroundedTo = ("groundedTo" in options);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ublo-lib",
3
- "version": "1.31.33",
3
+ "version": "1.31.35",
4
4
  "peerDependencies": {
5
5
  "dt-design-system": "^3.8.3",
6
6
  "leaflet": "^1.9.1",