chayns-api 2.2.5 → 2.2.6
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.
|
@@ -83,11 +83,9 @@ const ChaynsProvider = ({
|
|
|
83
83
|
})();
|
|
84
84
|
}, []);
|
|
85
85
|
(0, _react.useEffect)(() => {
|
|
86
|
-
if (isModule) {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
customWrapper.current.emitChange();
|
|
90
|
-
}
|
|
86
|
+
if (isModule && data) {
|
|
87
|
+
customWrapper.current.values = data;
|
|
88
|
+
customWrapper.current.emitChange();
|
|
91
89
|
}
|
|
92
90
|
}, [data, isModule]);
|
|
93
91
|
(0, _react.useEffect)(() => {
|
|
@@ -39,24 +39,27 @@ const ModuleHost = ({
|
|
|
39
39
|
preventStagingReplacement,
|
|
40
40
|
styleSettings
|
|
41
41
|
}) => {
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
42
|
+
const data = (0, _react.useMemo)(() => {
|
|
43
|
+
const result = {
|
|
44
|
+
site,
|
|
45
|
+
isAdminModeActive,
|
|
46
|
+
pages,
|
|
47
|
+
currentPage,
|
|
48
|
+
device,
|
|
49
|
+
language,
|
|
50
|
+
parameters,
|
|
51
|
+
customData,
|
|
52
|
+
environment,
|
|
53
|
+
styleSettings
|
|
54
|
+
};
|
|
55
|
+
if (user) {
|
|
56
|
+
result.user = user;
|
|
57
|
+
}
|
|
58
|
+
if (dialog) {
|
|
59
|
+
result.dialog = dialog;
|
|
60
|
+
}
|
|
61
|
+
return result;
|
|
62
|
+
}, [site, isAdminModeActive, pages, currentPage, device, language, parameters, customData, environment, styleSettings, user, dialog]);
|
|
60
63
|
return _react.default.createElement(_react.default.Fragment, null, _react.default.createElement("div", {
|
|
61
64
|
className: "module-css"
|
|
62
65
|
}), _react.default.createElement(System, {
|
|
@@ -67,7 +70,7 @@ const ModuleHost = ({
|
|
|
67
70
|
module: system.module,
|
|
68
71
|
preventSingleton: system.preventSingleton
|
|
69
72
|
},
|
|
70
|
-
data:
|
|
73
|
+
data: data,
|
|
71
74
|
functions: functions,
|
|
72
75
|
customFunctions: customFunctions,
|
|
73
76
|
fallback: children,
|
|
@@ -77,11 +77,9 @@ const ChaynsProvider = _ref2 => {
|
|
|
77
77
|
})();
|
|
78
78
|
}, []);
|
|
79
79
|
useEffect(() => {
|
|
80
|
-
if (isModule) {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
customWrapper.current.emitChange();
|
|
84
|
-
}
|
|
80
|
+
if (isModule && data) {
|
|
81
|
+
customWrapper.current.values = data;
|
|
82
|
+
customWrapper.current.emitChange();
|
|
85
83
|
}
|
|
86
84
|
}, [data, isModule]);
|
|
87
85
|
useEffect(() => {
|
|
@@ -32,24 +32,27 @@ const ModuleHost = _ref2 => {
|
|
|
32
32
|
preventStagingReplacement,
|
|
33
33
|
styleSettings
|
|
34
34
|
} = _ref2;
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
35
|
+
const data = useMemo(() => {
|
|
36
|
+
const result = {
|
|
37
|
+
site,
|
|
38
|
+
isAdminModeActive,
|
|
39
|
+
pages,
|
|
40
|
+
currentPage,
|
|
41
|
+
device,
|
|
42
|
+
language,
|
|
43
|
+
parameters,
|
|
44
|
+
customData,
|
|
45
|
+
environment,
|
|
46
|
+
styleSettings
|
|
47
|
+
};
|
|
48
|
+
if (user) {
|
|
49
|
+
result.user = user;
|
|
50
|
+
}
|
|
51
|
+
if (dialog) {
|
|
52
|
+
result.dialog = dialog;
|
|
53
|
+
}
|
|
54
|
+
return result;
|
|
55
|
+
}, [site, isAdminModeActive, pages, currentPage, device, language, parameters, customData, environment, styleSettings, user, dialog]);
|
|
53
56
|
return React.createElement(React.Fragment, null, React.createElement("div", {
|
|
54
57
|
className: "module-css"
|
|
55
58
|
}), React.createElement(System, {
|
|
@@ -60,7 +63,7 @@ const ModuleHost = _ref2 => {
|
|
|
60
63
|
module: system.module,
|
|
61
64
|
preventSingleton: system.preventSingleton
|
|
62
65
|
},
|
|
63
|
-
data:
|
|
66
|
+
data: data,
|
|
64
67
|
functions: functions,
|
|
65
68
|
customFunctions: customFunctions,
|
|
66
69
|
fallback: children,
|