ublo-lib 1.12.5 → 1.12.7
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.
|
@@ -2,6 +2,7 @@ import * as React from "react";
|
|
|
2
2
|
import * as ReactDOM from "react-dom";
|
|
3
3
|
import dynamic from "next/dynamic";
|
|
4
4
|
import Router from "next/router";
|
|
5
|
+
import { useUbloContext } from "ublo/with-ublo";
|
|
5
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
7
|
const Map = dynamic(() => import("./editable-map"), {
|
|
7
8
|
ssr: false
|
|
@@ -9,6 +10,10 @@ const Map = dynamic(() => import("./editable-map"), {
|
|
|
9
10
|
export default function EditableMap({
|
|
10
11
|
iconSet = "esf"
|
|
11
12
|
}) {
|
|
13
|
+
const {
|
|
14
|
+
lang,
|
|
15
|
+
path
|
|
16
|
+
} = useUbloContext();
|
|
12
17
|
const [formats, setFormats] = React.useState([]);
|
|
13
18
|
const [refreshKey, setRefreshKey] = React.useState(0);
|
|
14
19
|
|
|
@@ -26,7 +31,6 @@ export default function EditableMap({
|
|
|
26
31
|
const isInZone = Boolean(element?.closest(".cms"));
|
|
27
32
|
const storedPresets = element.dataset.presets;
|
|
28
33
|
const presets = storedPresets ? JSON.parse(storedPresets) : {};
|
|
29
|
-
element.innerHTML = "";
|
|
30
34
|
return {
|
|
31
35
|
element,
|
|
32
36
|
isInDialog,
|
|
@@ -37,7 +41,7 @@ export default function EditableMap({
|
|
|
37
41
|
setFormats(formats);
|
|
38
42
|
}
|
|
39
43
|
}, 200);
|
|
40
|
-
}, [refreshKey]);
|
|
44
|
+
}, [lang, path, refreshKey]);
|
|
41
45
|
React.useEffect(() => {
|
|
42
46
|
if (formats.some(format => format.isInZone)) {
|
|
43
47
|
window.addEventListener("ublo-content-saved", reloadWindow);
|