chayns-api 3.3.0-beta.0 → 3.3.0
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.
- package/dist/cjs/components/ChaynsProvider.js +11 -13
- package/dist/cjs/contexts/HistoryLayerContext.js +4 -2
- package/dist/cjs/host/ChaynsHost.js +9 -9
- package/dist/cjs/host/iframe/HostIframe.js +3 -3
- package/dist/cjs/host/module/ModuleHost.js +4 -4
- package/dist/esm/components/ChaynsProvider.js +11 -13
- package/dist/esm/contexts/HistoryLayerContext.js +4 -2
- package/dist/esm/host/ChaynsHost.js +9 -9
- package/dist/esm/host/iframe/HostIframe.js +3 -3
- package/dist/esm/host/module/ModuleHost.js +4 -4
- package/dist/types/components/ChaynsProvider.d.ts +5 -1
- package/dist/types/contexts/HistoryLayerContext.d.ts +4 -1
- package/dist/types/host/ChaynsHost.d.ts +2 -2
- package/dist/types/host/iframe/HostIframe.d.ts +2 -2
- package/dist/types/host/module/ModuleHost.d.ts +2 -2
- package/dist/types/types/IChaynsReact.d.ts +5 -1
- package/package.json +1 -1
|
@@ -72,10 +72,10 @@ const ChaynsProvider = ({
|
|
|
72
72
|
chaynsApiId,
|
|
73
73
|
historyLayer,
|
|
74
74
|
history,
|
|
75
|
-
|
|
75
|
+
isHistoryEnabled,
|
|
76
76
|
segmentCount
|
|
77
77
|
}) => {
|
|
78
|
-
var _ref, _crypto, _crypto$randomUUID, _customWrapper$curren, _customWrapper$curren3, _customWrapper$curren4;
|
|
78
|
+
var _ref, _crypto, _crypto$randomUUID, _ref2, _customWrapper$curren, _ref4, _customWrapper$curren3, _customWrapper$curren4;
|
|
79
79
|
const customWrapper = (0, _react.useRef)(null);
|
|
80
80
|
const idRef = (0, _react.useRef)((_ref = chaynsApiId !== null && chaynsApiId !== void 0 ? chaynsApiId : (_crypto = crypto) === null || _crypto === void 0 || (_crypto$randomUUID = _crypto.randomUUID) === null || _crypto$randomUUID === void 0 ? void 0 : _crypto$randomUUID.call(_crypto)) !== null && _ref !== void 0 ? _ref : Math.random().toString());
|
|
81
81
|
const contextLayer = (0, _HistoryLayerContext.useChaynsHistoryLayerContext)();
|
|
@@ -108,10 +108,10 @@ const ChaynsProvider = ({
|
|
|
108
108
|
customWrapper.current.chaynsApiId = idRef.current;
|
|
109
109
|
}
|
|
110
110
|
}
|
|
111
|
-
const [effectiveLayer, setEffectiveLayer] = (0, _react.useState)(historyLayer !== null && historyLayer !== void 0 ? historyLayer : null);
|
|
111
|
+
const [effectiveLayer, setEffectiveLayer] = (0, _react.useState)((_ref2 = historyLayer !== null && historyLayer !== void 0 ? historyLayer : contextLayer) !== null && _ref2 !== void 0 ? _ref2 : null);
|
|
112
112
|
const [isInitialized, setIsInitialized] = (0, _react.useState)(!!((_customWrapper$curren = customWrapper.current) !== null && _customWrapper$curren !== void 0 && _customWrapper$curren.values));
|
|
113
113
|
(0, _react.useEffect)(() => {
|
|
114
|
-
void (async (_customWrapper$curren2,
|
|
114
|
+
void (async (_customWrapper$curren2, _ref3) => {
|
|
115
115
|
await customWrapper.current.init();
|
|
116
116
|
customWrapper.current.addDataListener(() => {
|
|
117
117
|
customWrapper.current.emitChange();
|
|
@@ -120,7 +120,7 @@ const ChaynsProvider = ({
|
|
|
120
120
|
if (!rootLayerRef.current && !historyLayer && !parentLayerRef.current) {
|
|
121
121
|
rootLayerRef.current = (0, _rootLayer.getOrInitRootChaynsHistoryLayer)(history === null || history === void 0 ? void 0 : history.url, history === null || history === void 0 ? void 0 : history.segmentCount).rootLayer;
|
|
122
122
|
}
|
|
123
|
-
const layer = (
|
|
123
|
+
const layer = (_ref3 = historyLayer !== null && historyLayer !== void 0 ? historyLayer : parentLayerRef.current) !== null && _ref3 !== void 0 ? _ref3 : rootLayerRef.current;
|
|
124
124
|
if (layer && typeof segmentCount === 'number' && layer.getSegmentCount() !== segmentCount) {
|
|
125
125
|
await layer.setSegmentCount(segmentCount);
|
|
126
126
|
}
|
|
@@ -149,18 +149,16 @@ const ChaynsProvider = ({
|
|
|
149
149
|
(0, _moduleWrapper.removeModuleWrapper)(id, customWrapper.current);
|
|
150
150
|
};
|
|
151
151
|
}, []);
|
|
152
|
-
let
|
|
153
|
-
if (typeof isHistoryDisabled === 'boolean' && !isDisabled) {
|
|
154
|
-
isDisabled = isHistoryDisabled;
|
|
155
|
-
}
|
|
152
|
+
let shouldEnableHistory = (_ref4 = isHistoryEnabled !== null && isHistoryEnabled !== void 0 ? isHistoryEnabled : (_customWrapper$curren3 = customWrapper.current.values) === null || _customWrapper$curren3 === void 0 ? void 0 : _customWrapper$curren3.isHistoryEnabled) !== null && _ref4 !== void 0 ? _ref4 : false;
|
|
156
153
|
if ((historyLayer === null || historyLayer === void 0 ? void 0 : historyLayer.id) === 'root') {
|
|
157
|
-
|
|
154
|
+
shouldEnableHistory = true;
|
|
158
155
|
}
|
|
156
|
+
const layerToProvide = shouldEnableHistory ? effectiveLayer : null;
|
|
159
157
|
return _react.default.createElement(_react.default.Fragment, null, isInitialized && _react.default.createElement(_ChaynsContext.ChaynsContext.Provider, {
|
|
160
158
|
value: customWrapper.current
|
|
161
|
-
},
|
|
162
|
-
layer:
|
|
163
|
-
}, children)
|
|
159
|
+
}, _react.default.createElement(_HistoryLayerContext.ChaynsHistoryLayerProvider, {
|
|
160
|
+
layer: layerToProvide
|
|
161
|
+
}, children)), _react.default.createElement(InitialDataProvider, {
|
|
164
162
|
data: (_customWrapper$curren4 = customWrapper.current) === null || _customWrapper$curren4 === void 0 ? void 0 : _customWrapper$curren4.values,
|
|
165
163
|
renderedByServer: renderedByServer
|
|
166
164
|
}));
|
|
@@ -37,8 +37,10 @@ const ChaynsHistoryLayerProvider = t0 => {
|
|
|
37
37
|
let t2;
|
|
38
38
|
if ($[0] !== layer) {
|
|
39
39
|
t1 = () => {
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
if (layer) {
|
|
41
|
+
pushChaynsHistoryLayer(layer);
|
|
42
|
+
return () => popChaynsHistoryLayer(layer);
|
|
43
|
+
}
|
|
42
44
|
};
|
|
43
45
|
t2 = [layer];
|
|
44
46
|
$[0] = layer;
|
|
@@ -39,11 +39,11 @@ const ChaynsHost = t0 => {
|
|
|
39
39
|
styleSettings,
|
|
40
40
|
historyLayer,
|
|
41
41
|
historyChildId,
|
|
42
|
-
|
|
42
|
+
isHistoryEnabled: t3
|
|
43
43
|
} = t0;
|
|
44
44
|
const iFrameRef = t1 === undefined ? undefined : t1;
|
|
45
45
|
const loadingComponent = t2 === undefined ? undefined : t2;
|
|
46
|
-
const
|
|
46
|
+
const isHistoryEnabled = t3 === undefined ? false : t3;
|
|
47
47
|
const isInitiallyVisible = type !== "client-module" && (type !== "server-module" || !!(system !== null && system !== void 0 && system.serverUrl));
|
|
48
48
|
const isHydrated = (0, _react.useSyncExternalStore)(subscribeToHydration, _temp, _temp2);
|
|
49
49
|
const isVisible = (0, _react.useDeferredValue)(isInitiallyVisible || isHydrated);
|
|
@@ -60,7 +60,7 @@ const ChaynsHost = t0 => {
|
|
|
60
60
|
}
|
|
61
61
|
const resolvedLayer = t4;
|
|
62
62
|
let layer;
|
|
63
|
-
if (
|
|
63
|
+
if (isHistoryEnabled) {
|
|
64
64
|
let t5;
|
|
65
65
|
if ($[2] !== historyChildId || $[3] !== resolvedLayer) {
|
|
66
66
|
var _resolvedLayer$getChi;
|
|
@@ -79,7 +79,7 @@ const ChaynsHost = t0 => {
|
|
|
79
79
|
{
|
|
80
80
|
const t5 = type === "server-iframe";
|
|
81
81
|
let t6;
|
|
82
|
-
if ($[5] !== currentPage || $[6] !== customData || $[7] !== customFunctions || $[8] !== device || $[9] !== dialog || $[10] !== environment || $[11] !== functions || $[12] !== iFrameProps || $[13] !== iFrameRef || $[14] !== isAdminModeActive || $[15] !==
|
|
82
|
+
if ($[5] !== currentPage || $[6] !== customData || $[7] !== customFunctions || $[8] !== device || $[9] !== dialog || $[10] !== environment || $[11] !== functions || $[12] !== iFrameProps || $[13] !== iFrameRef || $[14] !== isAdminModeActive || $[15] !== isHistoryEnabled || $[16] !== language || $[17] !== layer || $[18] !== pages || $[19] !== parameters || $[20] !== preventStagingReplacement || $[21] !== site || $[22] !== src || $[23] !== styleSettings || $[24] !== t5 || $[25] !== user) {
|
|
83
83
|
t6 = _react.default.createElement(_HostIframe.default, {
|
|
84
84
|
iFrameRef: iFrameRef,
|
|
85
85
|
iFrameProps: iFrameProps,
|
|
@@ -101,7 +101,7 @@ const ChaynsHost = t0 => {
|
|
|
101
101
|
dialog: dialog,
|
|
102
102
|
styleSettings: styleSettings,
|
|
103
103
|
historyLayer: layer,
|
|
104
|
-
|
|
104
|
+
isHistoryEnabled: isHistoryEnabled
|
|
105
105
|
});
|
|
106
106
|
$[5] = currentPage;
|
|
107
107
|
$[6] = customData;
|
|
@@ -113,7 +113,7 @@ const ChaynsHost = t0 => {
|
|
|
113
113
|
$[12] = iFrameProps;
|
|
114
114
|
$[13] = iFrameRef;
|
|
115
115
|
$[14] = isAdminModeActive;
|
|
116
|
-
$[15] =
|
|
116
|
+
$[15] = isHistoryEnabled;
|
|
117
117
|
$[16] = language;
|
|
118
118
|
$[17] = layer;
|
|
119
119
|
$[18] = pages;
|
|
@@ -145,7 +145,7 @@ const ChaynsHost = t0 => {
|
|
|
145
145
|
case "server-module":
|
|
146
146
|
{
|
|
147
147
|
let t5;
|
|
148
|
-
if ($[30] !== currentPage || $[31] !== customData || $[32] !== customFunctions || $[33] !== device || $[34] !== dialog || $[35] !== environment || $[36] !== functions || $[37] !== isAdminModeActive || $[38] !==
|
|
148
|
+
if ($[30] !== currentPage || $[31] !== customData || $[32] !== customFunctions || $[33] !== device || $[34] !== dialog || $[35] !== environment || $[36] !== functions || $[37] !== isAdminModeActive || $[38] !== isHistoryEnabled || $[39] !== language || $[40] !== layer || $[41] !== loadingComponent || $[42] !== pages || $[43] !== parameters || $[44] !== preventStagingReplacement || $[45] !== site || $[46] !== styleSettings || $[47] !== system || $[48] !== user) {
|
|
149
149
|
t5 = _react.default.createElement(_ModuleHost.default, {
|
|
150
150
|
system: system,
|
|
151
151
|
pages: pages,
|
|
@@ -165,7 +165,7 @@ const ChaynsHost = t0 => {
|
|
|
165
165
|
dialog: dialog,
|
|
166
166
|
styleSettings: styleSettings,
|
|
167
167
|
historyLayer: layer,
|
|
168
|
-
|
|
168
|
+
isHistoryEnabled: isHistoryEnabled
|
|
169
169
|
});
|
|
170
170
|
$[30] = currentPage;
|
|
171
171
|
$[31] = customData;
|
|
@@ -175,7 +175,7 @@ const ChaynsHost = t0 => {
|
|
|
175
175
|
$[35] = environment;
|
|
176
176
|
$[36] = functions;
|
|
177
177
|
$[37] = isAdminModeActive;
|
|
178
|
-
$[38] =
|
|
178
|
+
$[38] = isHistoryEnabled;
|
|
179
179
|
$[39] = language;
|
|
180
180
|
$[40] = layer;
|
|
181
181
|
$[41] = loadingComponent;
|
|
@@ -34,7 +34,7 @@ const HostIframe = ({
|
|
|
34
34
|
dialog,
|
|
35
35
|
styleSettings,
|
|
36
36
|
historyLayer,
|
|
37
|
-
|
|
37
|
+
isHistoryEnabled
|
|
38
38
|
}) => {
|
|
39
39
|
const eventTarget = (0, _react.useRef)();
|
|
40
40
|
const ref = (0, _react.useRef)();
|
|
@@ -54,7 +54,7 @@ const HostIframe = ({
|
|
|
54
54
|
const initialData = {
|
|
55
55
|
site,
|
|
56
56
|
isAdminModeActive,
|
|
57
|
-
|
|
57
|
+
isHistoryEnabled,
|
|
58
58
|
pages,
|
|
59
59
|
currentPage,
|
|
60
60
|
device,
|
|
@@ -193,7 +193,7 @@ const HostIframe = ({
|
|
|
193
193
|
}
|
|
194
194
|
return undefined;
|
|
195
195
|
}, []);
|
|
196
|
-
(0, _useUpdateData.default)(eventTarget.current, '
|
|
196
|
+
(0, _useUpdateData.default)(eventTarget.current, 'isHistoryEnabled', isHistoryEnabled);
|
|
197
197
|
(0, _useUpdateData.default)(eventTarget.current, 'isAdminModeActive', isAdminModeActive);
|
|
198
198
|
(0, _useUpdateData.default)(eventTarget.current, 'user', user);
|
|
199
199
|
(0, _useUpdateData.default)(eventTarget.current, 'site', site);
|
|
@@ -52,15 +52,15 @@ const ModuleHost = t0 => {
|
|
|
52
52
|
preventStagingReplacement,
|
|
53
53
|
styleSettings,
|
|
54
54
|
historyLayer,
|
|
55
|
-
|
|
55
|
+
isHistoryEnabled
|
|
56
56
|
} = t0;
|
|
57
57
|
const children = t1 === undefined ? null : t1;
|
|
58
58
|
let result;
|
|
59
|
-
if ($[0] !== currentPage || $[1] !== customData || $[2] !== device || $[3] !== dialog || $[4] !== environment || $[5] !== isAdminModeActive || $[6] !==
|
|
59
|
+
if ($[0] !== currentPage || $[1] !== customData || $[2] !== device || $[3] !== dialog || $[4] !== environment || $[5] !== isAdminModeActive || $[6] !== isHistoryEnabled || $[7] !== language || $[8] !== pages || $[9] !== parameters || $[10] !== site || $[11] !== styleSettings || $[12] !== user) {
|
|
60
60
|
result = {
|
|
61
61
|
site,
|
|
62
62
|
isAdminModeActive,
|
|
63
|
-
|
|
63
|
+
isHistoryEnabled,
|
|
64
64
|
pages,
|
|
65
65
|
currentPage,
|
|
66
66
|
device,
|
|
@@ -82,7 +82,7 @@ const ModuleHost = t0 => {
|
|
|
82
82
|
$[3] = dialog;
|
|
83
83
|
$[4] = environment;
|
|
84
84
|
$[5] = isAdminModeActive;
|
|
85
|
-
$[6] =
|
|
85
|
+
$[6] = isHistoryEnabled;
|
|
86
86
|
$[7] = language;
|
|
87
87
|
$[8] = pages;
|
|
88
88
|
$[9] = parameters;
|
|
@@ -64,10 +64,10 @@ const ChaynsProvider = ({
|
|
|
64
64
|
chaynsApiId,
|
|
65
65
|
historyLayer,
|
|
66
66
|
history,
|
|
67
|
-
|
|
67
|
+
isHistoryEnabled,
|
|
68
68
|
segmentCount
|
|
69
69
|
}) => {
|
|
70
|
-
var _ref, _crypto, _crypto$randomUUID, _customWrapper$curren, _customWrapper$curren3, _customWrapper$curren4;
|
|
70
|
+
var _ref, _crypto, _crypto$randomUUID, _ref2, _customWrapper$curren, _ref4, _customWrapper$curren3, _customWrapper$curren4;
|
|
71
71
|
const customWrapper = useRef(null);
|
|
72
72
|
const idRef = useRef((_ref = chaynsApiId !== null && chaynsApiId !== void 0 ? chaynsApiId : (_crypto = crypto) === null || _crypto === void 0 || (_crypto$randomUUID = _crypto.randomUUID) === null || _crypto$randomUUID === void 0 ? void 0 : _crypto$randomUUID.call(_crypto)) !== null && _ref !== void 0 ? _ref : Math.random().toString());
|
|
73
73
|
const contextLayer = useChaynsHistoryLayerContext();
|
|
@@ -100,10 +100,10 @@ const ChaynsProvider = ({
|
|
|
100
100
|
customWrapper.current.chaynsApiId = idRef.current;
|
|
101
101
|
}
|
|
102
102
|
}
|
|
103
|
-
const [effectiveLayer, setEffectiveLayer] = useState(historyLayer !== null && historyLayer !== void 0 ? historyLayer : null);
|
|
103
|
+
const [effectiveLayer, setEffectiveLayer] = useState((_ref2 = historyLayer !== null && historyLayer !== void 0 ? historyLayer : contextLayer) !== null && _ref2 !== void 0 ? _ref2 : null);
|
|
104
104
|
const [isInitialized, setIsInitialized] = useState(!!((_customWrapper$curren = customWrapper.current) !== null && _customWrapper$curren !== void 0 && _customWrapper$curren.values));
|
|
105
105
|
useEffect(() => {
|
|
106
|
-
void (async (_customWrapper$curren2,
|
|
106
|
+
void (async (_customWrapper$curren2, _ref3) => {
|
|
107
107
|
await customWrapper.current.init();
|
|
108
108
|
customWrapper.current.addDataListener(() => {
|
|
109
109
|
customWrapper.current.emitChange();
|
|
@@ -112,7 +112,7 @@ const ChaynsProvider = ({
|
|
|
112
112
|
if (!rootLayerRef.current && !historyLayer && !parentLayerRef.current) {
|
|
113
113
|
rootLayerRef.current = getOrInitRootChaynsHistoryLayer(history === null || history === void 0 ? void 0 : history.url, history === null || history === void 0 ? void 0 : history.segmentCount).rootLayer;
|
|
114
114
|
}
|
|
115
|
-
const layer = (
|
|
115
|
+
const layer = (_ref3 = historyLayer !== null && historyLayer !== void 0 ? historyLayer : parentLayerRef.current) !== null && _ref3 !== void 0 ? _ref3 : rootLayerRef.current;
|
|
116
116
|
if (layer && typeof segmentCount === 'number' && layer.getSegmentCount() !== segmentCount) {
|
|
117
117
|
await layer.setSegmentCount(segmentCount);
|
|
118
118
|
}
|
|
@@ -141,18 +141,16 @@ const ChaynsProvider = ({
|
|
|
141
141
|
removeModuleWrapper(id, customWrapper.current);
|
|
142
142
|
};
|
|
143
143
|
}, []);
|
|
144
|
-
let
|
|
145
|
-
if (typeof isHistoryDisabled === 'boolean' && !isDisabled) {
|
|
146
|
-
isDisabled = isHistoryDisabled;
|
|
147
|
-
}
|
|
144
|
+
let shouldEnableHistory = (_ref4 = isHistoryEnabled !== null && isHistoryEnabled !== void 0 ? isHistoryEnabled : (_customWrapper$curren3 = customWrapper.current.values) === null || _customWrapper$curren3 === void 0 ? void 0 : _customWrapper$curren3.isHistoryEnabled) !== null && _ref4 !== void 0 ? _ref4 : false;
|
|
148
145
|
if ((historyLayer === null || historyLayer === void 0 ? void 0 : historyLayer.id) === 'root') {
|
|
149
|
-
|
|
146
|
+
shouldEnableHistory = true;
|
|
150
147
|
}
|
|
148
|
+
const layerToProvide = shouldEnableHistory ? effectiveLayer : null;
|
|
151
149
|
return React.createElement(React.Fragment, null, isInitialized && React.createElement(ChaynsContext.Provider, {
|
|
152
150
|
value: customWrapper.current
|
|
153
|
-
},
|
|
154
|
-
layer:
|
|
155
|
-
}, children)
|
|
151
|
+
}, React.createElement(ChaynsHistoryLayerProvider, {
|
|
152
|
+
layer: layerToProvide
|
|
153
|
+
}, children)), React.createElement(InitialDataProvider, {
|
|
156
154
|
data: (_customWrapper$curren4 = customWrapper.current) === null || _customWrapper$curren4 === void 0 ? void 0 : _customWrapper$curren4.values,
|
|
157
155
|
renderedByServer: renderedByServer
|
|
158
156
|
}));
|
|
@@ -26,8 +26,10 @@ export const ChaynsHistoryLayerProvider = t0 => {
|
|
|
26
26
|
let t2;
|
|
27
27
|
if ($[0] !== layer) {
|
|
28
28
|
t1 = () => {
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
if (layer) {
|
|
30
|
+
pushChaynsHistoryLayer(layer);
|
|
31
|
+
return () => popChaynsHistoryLayer(layer);
|
|
32
|
+
}
|
|
31
33
|
};
|
|
32
34
|
t2 = [layer];
|
|
33
35
|
$[0] = layer;
|
|
@@ -31,11 +31,11 @@ const ChaynsHost = t0 => {
|
|
|
31
31
|
styleSettings,
|
|
32
32
|
historyLayer,
|
|
33
33
|
historyChildId,
|
|
34
|
-
|
|
34
|
+
isHistoryEnabled: t3
|
|
35
35
|
} = t0;
|
|
36
36
|
const iFrameRef = t1 === undefined ? undefined : t1;
|
|
37
37
|
const loadingComponent = t2 === undefined ? undefined : t2;
|
|
38
|
-
const
|
|
38
|
+
const isHistoryEnabled = t3 === undefined ? false : t3;
|
|
39
39
|
const isInitiallyVisible = type !== "client-module" && (type !== "server-module" || !!(system !== null && system !== void 0 && system.serverUrl));
|
|
40
40
|
const isHydrated = useSyncExternalStore(subscribeToHydration, _temp, _temp2);
|
|
41
41
|
const isVisible = useDeferredValue(isInitiallyVisible || isHydrated);
|
|
@@ -52,7 +52,7 @@ const ChaynsHost = t0 => {
|
|
|
52
52
|
}
|
|
53
53
|
const resolvedLayer = t4;
|
|
54
54
|
let layer;
|
|
55
|
-
if (
|
|
55
|
+
if (isHistoryEnabled) {
|
|
56
56
|
let t5;
|
|
57
57
|
if ($[2] !== historyChildId || $[3] !== resolvedLayer) {
|
|
58
58
|
var _resolvedLayer$getChi;
|
|
@@ -71,7 +71,7 @@ const ChaynsHost = t0 => {
|
|
|
71
71
|
{
|
|
72
72
|
const t5 = type === "server-iframe";
|
|
73
73
|
let t6;
|
|
74
|
-
if ($[5] !== currentPage || $[6] !== customData || $[7] !== customFunctions || $[8] !== device || $[9] !== dialog || $[10] !== environment || $[11] !== functions || $[12] !== iFrameProps || $[13] !== iFrameRef || $[14] !== isAdminModeActive || $[15] !==
|
|
74
|
+
if ($[5] !== currentPage || $[6] !== customData || $[7] !== customFunctions || $[8] !== device || $[9] !== dialog || $[10] !== environment || $[11] !== functions || $[12] !== iFrameProps || $[13] !== iFrameRef || $[14] !== isAdminModeActive || $[15] !== isHistoryEnabled || $[16] !== language || $[17] !== layer || $[18] !== pages || $[19] !== parameters || $[20] !== preventStagingReplacement || $[21] !== site || $[22] !== src || $[23] !== styleSettings || $[24] !== t5 || $[25] !== user) {
|
|
75
75
|
t6 = React.createElement(HostIframe, {
|
|
76
76
|
iFrameRef: iFrameRef,
|
|
77
77
|
iFrameProps: iFrameProps,
|
|
@@ -93,7 +93,7 @@ const ChaynsHost = t0 => {
|
|
|
93
93
|
dialog: dialog,
|
|
94
94
|
styleSettings: styleSettings,
|
|
95
95
|
historyLayer: layer,
|
|
96
|
-
|
|
96
|
+
isHistoryEnabled: isHistoryEnabled
|
|
97
97
|
});
|
|
98
98
|
$[5] = currentPage;
|
|
99
99
|
$[6] = customData;
|
|
@@ -105,7 +105,7 @@ const ChaynsHost = t0 => {
|
|
|
105
105
|
$[12] = iFrameProps;
|
|
106
106
|
$[13] = iFrameRef;
|
|
107
107
|
$[14] = isAdminModeActive;
|
|
108
|
-
$[15] =
|
|
108
|
+
$[15] = isHistoryEnabled;
|
|
109
109
|
$[16] = language;
|
|
110
110
|
$[17] = layer;
|
|
111
111
|
$[18] = pages;
|
|
@@ -137,7 +137,7 @@ const ChaynsHost = t0 => {
|
|
|
137
137
|
case "server-module":
|
|
138
138
|
{
|
|
139
139
|
let t5;
|
|
140
|
-
if ($[30] !== currentPage || $[31] !== customData || $[32] !== customFunctions || $[33] !== device || $[34] !== dialog || $[35] !== environment || $[36] !== functions || $[37] !== isAdminModeActive || $[38] !==
|
|
140
|
+
if ($[30] !== currentPage || $[31] !== customData || $[32] !== customFunctions || $[33] !== device || $[34] !== dialog || $[35] !== environment || $[36] !== functions || $[37] !== isAdminModeActive || $[38] !== isHistoryEnabled || $[39] !== language || $[40] !== layer || $[41] !== loadingComponent || $[42] !== pages || $[43] !== parameters || $[44] !== preventStagingReplacement || $[45] !== site || $[46] !== styleSettings || $[47] !== system || $[48] !== user) {
|
|
141
141
|
t5 = React.createElement(ModuleHost, {
|
|
142
142
|
system: system,
|
|
143
143
|
pages: pages,
|
|
@@ -157,7 +157,7 @@ const ChaynsHost = t0 => {
|
|
|
157
157
|
dialog: dialog,
|
|
158
158
|
styleSettings: styleSettings,
|
|
159
159
|
historyLayer: layer,
|
|
160
|
-
|
|
160
|
+
isHistoryEnabled: isHistoryEnabled
|
|
161
161
|
});
|
|
162
162
|
$[30] = currentPage;
|
|
163
163
|
$[31] = customData;
|
|
@@ -167,7 +167,7 @@ const ChaynsHost = t0 => {
|
|
|
167
167
|
$[35] = environment;
|
|
168
168
|
$[36] = functions;
|
|
169
169
|
$[37] = isAdminModeActive;
|
|
170
|
-
$[38] =
|
|
170
|
+
$[38] = isHistoryEnabled;
|
|
171
171
|
$[39] = language;
|
|
172
172
|
$[40] = layer;
|
|
173
173
|
$[41] = loadingComponent;
|
|
@@ -26,7 +26,7 @@ const HostIframe = ({
|
|
|
26
26
|
dialog,
|
|
27
27
|
styleSettings,
|
|
28
28
|
historyLayer,
|
|
29
|
-
|
|
29
|
+
isHistoryEnabled
|
|
30
30
|
}) => {
|
|
31
31
|
const eventTarget = useRef();
|
|
32
32
|
const ref = useRef();
|
|
@@ -46,7 +46,7 @@ const HostIframe = ({
|
|
|
46
46
|
const initialData = {
|
|
47
47
|
site,
|
|
48
48
|
isAdminModeActive,
|
|
49
|
-
|
|
49
|
+
isHistoryEnabled,
|
|
50
50
|
pages,
|
|
51
51
|
currentPage,
|
|
52
52
|
device,
|
|
@@ -185,7 +185,7 @@ const HostIframe = ({
|
|
|
185
185
|
}
|
|
186
186
|
return undefined;
|
|
187
187
|
}, []);
|
|
188
|
-
useUpdateData(eventTarget.current, '
|
|
188
|
+
useUpdateData(eventTarget.current, 'isHistoryEnabled', isHistoryEnabled);
|
|
189
189
|
useUpdateData(eventTarget.current, 'isAdminModeActive', isAdminModeActive);
|
|
190
190
|
useUpdateData(eventTarget.current, 'user', user);
|
|
191
191
|
useUpdateData(eventTarget.current, 'site', site);
|
|
@@ -44,15 +44,15 @@ const ModuleHost = t0 => {
|
|
|
44
44
|
preventStagingReplacement,
|
|
45
45
|
styleSettings,
|
|
46
46
|
historyLayer,
|
|
47
|
-
|
|
47
|
+
isHistoryEnabled
|
|
48
48
|
} = t0;
|
|
49
49
|
const children = t1 === undefined ? null : t1;
|
|
50
50
|
let result;
|
|
51
|
-
if ($[0] !== currentPage || $[1] !== customData || $[2] !== device || $[3] !== dialog || $[4] !== environment || $[5] !== isAdminModeActive || $[6] !==
|
|
51
|
+
if ($[0] !== currentPage || $[1] !== customData || $[2] !== device || $[3] !== dialog || $[4] !== environment || $[5] !== isAdminModeActive || $[6] !== isHistoryEnabled || $[7] !== language || $[8] !== pages || $[9] !== parameters || $[10] !== site || $[11] !== styleSettings || $[12] !== user) {
|
|
52
52
|
result = {
|
|
53
53
|
site,
|
|
54
54
|
isAdminModeActive,
|
|
55
|
-
|
|
55
|
+
isHistoryEnabled,
|
|
56
56
|
pages,
|
|
57
57
|
currentPage,
|
|
58
58
|
device,
|
|
@@ -74,7 +74,7 @@ const ModuleHost = t0 => {
|
|
|
74
74
|
$[3] = dialog;
|
|
75
75
|
$[4] = environment;
|
|
76
76
|
$[5] = isAdminModeActive;
|
|
77
|
-
$[6] =
|
|
77
|
+
$[6] = isHistoryEnabled;
|
|
78
78
|
$[7] = language;
|
|
79
79
|
$[8] = pages;
|
|
80
80
|
$[9] = parameters;
|
|
@@ -28,7 +28,11 @@ export type ChaynsProviderProps = {
|
|
|
28
28
|
segmentCount?: number;
|
|
29
29
|
};
|
|
30
30
|
segmentCount?: number;
|
|
31
|
-
|
|
31
|
+
/**
|
|
32
|
+
* When true, enables the history layer for this provider.
|
|
33
|
+
* Defaults to false for safety in federated module scenarios.
|
|
34
|
+
*/
|
|
35
|
+
isHistoryEnabled?: boolean;
|
|
32
36
|
};
|
|
33
37
|
declare const ChaynsProvider: React.FC<ChaynsProviderProps>;
|
|
34
38
|
export default ChaynsProvider;
|
|
@@ -6,7 +6,7 @@ export declare function popChaynsHistoryLayer(layer: ChaynsHistoryLayer): void;
|
|
|
6
6
|
export declare function getCurrentChaynsHistoryLayer(): ChaynsHistoryLayer | null;
|
|
7
7
|
declare const ChaynsHistoryLayerContext: React.Context<ChaynsHistoryLayer | null>;
|
|
8
8
|
export interface ChaynsHistoryLayerProviderProps {
|
|
9
|
-
layer: ChaynsHistoryLayer;
|
|
9
|
+
layer: ChaynsHistoryLayer | null;
|
|
10
10
|
children: ReactNode;
|
|
11
11
|
}
|
|
12
12
|
/**
|
|
@@ -14,6 +14,9 @@ export interface ChaynsHistoryLayerProviderProps {
|
|
|
14
14
|
* module-level layer stack so that `getCurrentChaynsHistoryLayer()` (static / non-React
|
|
15
15
|
* call sites) also sees this layer as the current one.
|
|
16
16
|
*
|
|
17
|
+
* When `layer` is `null`, the provider still wraps children but does not register
|
|
18
|
+
* a layer on the stack (useful for disabled history scenarios).
|
|
19
|
+
*
|
|
17
20
|
* Use `ChaynsHistoryLayerOverrideProvider` instead if you only want to override the
|
|
18
21
|
* React context without affecting static call sites.
|
|
19
22
|
*/
|
|
@@ -36,8 +36,8 @@ type ChaynsHostType = {
|
|
|
36
36
|
* namespace. Activate it with `layer.navigate({ activeChild: historyChildId })`.
|
|
37
37
|
*/
|
|
38
38
|
historyChildId?: string;
|
|
39
|
-
/**
|
|
40
|
-
|
|
39
|
+
/** When true, enables the history layer for hosted children. Defaults to false. */
|
|
40
|
+
isHistoryEnabled?: boolean;
|
|
41
41
|
} & ({
|
|
42
42
|
type: `${'client' | 'server'}-iframe`;
|
|
43
43
|
src: string;
|
|
@@ -25,8 +25,8 @@ type HostIframeProps = {
|
|
|
25
25
|
dialog: ChaynsReactValues["dialog"];
|
|
26
26
|
styleSettings: ChaynsReactValues["styleSettings"];
|
|
27
27
|
historyLayer?: ChaynsHistoryLayer;
|
|
28
|
-
/**
|
|
29
|
-
|
|
28
|
+
/** When true, enables the history layer. Defaults to false. */
|
|
29
|
+
isHistoryEnabled?: boolean;
|
|
30
30
|
};
|
|
31
31
|
declare const HostIframe: FC<HostIframeProps>;
|
|
32
32
|
export default HostIframe;
|
|
@@ -27,8 +27,8 @@ type ModulePropTypes = {
|
|
|
27
27
|
children?: ReactNode;
|
|
28
28
|
styleSettings: ChaynsReactValues["styleSettings"];
|
|
29
29
|
historyLayer?: ChaynsHistoryLayer;
|
|
30
|
-
/**
|
|
31
|
-
|
|
30
|
+
/** When true, enables the history layer. Defaults to false. */
|
|
31
|
+
isHistoryEnabled?: boolean;
|
|
32
32
|
};
|
|
33
33
|
declare const ModuleHost: FC<ModulePropTypes>;
|
|
34
34
|
export default ModuleHost;
|
|
@@ -350,7 +350,10 @@ export interface ChaynsReactValues {
|
|
|
350
350
|
site: ChaynsApiSite;
|
|
351
351
|
user: ChaynsApiUser | undefined;
|
|
352
352
|
isAdminModeActive: boolean;
|
|
353
|
-
|
|
353
|
+
/**
|
|
354
|
+
* When true, enables the history layer.
|
|
355
|
+
*/
|
|
356
|
+
isHistoryEnabled?: boolean;
|
|
354
357
|
pages: Page[];
|
|
355
358
|
currentPage: {
|
|
356
359
|
id: number;
|
|
@@ -545,6 +548,7 @@ export interface RefreshData {
|
|
|
545
548
|
suffix?: boolean;
|
|
546
549
|
tapps?: boolean;
|
|
547
550
|
user?: boolean;
|
|
551
|
+
userImage?: boolean;
|
|
548
552
|
chaynsProData?: boolean;
|
|
549
553
|
ignoreUacCache?: boolean;
|
|
550
554
|
chaynsInfo?: boolean;
|