chayns-api 3.2.3 → 3.3.0-beta.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 +13 -11
- package/dist/cjs/contexts/HistoryLayerContext.js +2 -4
- 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/cjs/types/IChaynsReact.js +13 -1
- package/dist/esm/components/ChaynsProvider.js +13 -11
- package/dist/esm/contexts/HistoryLayerContext.js +2 -4
- 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/esm/types/IChaynsReact.js +12 -0
- package/dist/types/components/ChaynsProvider.d.ts +1 -5
- package/dist/types/contexts/HistoryLayerContext.d.ts +1 -4
- 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 +39 -6
- package/package.json +1 -1
|
@@ -72,10 +72,10 @@ const ChaynsProvider = ({
|
|
|
72
72
|
chaynsApiId,
|
|
73
73
|
historyLayer,
|
|
74
74
|
history,
|
|
75
|
-
|
|
75
|
+
isHistoryDisabled,
|
|
76
76
|
segmentCount
|
|
77
77
|
}) => {
|
|
78
|
-
var _ref, _crypto, _crypto$randomUUID,
|
|
78
|
+
var _ref, _crypto, _crypto$randomUUID, _customWrapper$curren, _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)(
|
|
111
|
+
const [effectiveLayer, setEffectiveLayer] = (0, _react.useState)(historyLayer !== null && historyLayer !== void 0 ? historyLayer : 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, _ref2) => {
|
|
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 = (_ref2 = historyLayer !== null && historyLayer !== void 0 ? historyLayer : parentLayerRef.current) !== null && _ref2 !== void 0 ? _ref2 : rootLayerRef.current;
|
|
124
124
|
if (layer && typeof segmentCount === 'number' && layer.getSegmentCount() !== segmentCount) {
|
|
125
125
|
await layer.setSegmentCount(segmentCount);
|
|
126
126
|
}
|
|
@@ -149,16 +149,18 @@ const ChaynsProvider = ({
|
|
|
149
149
|
(0, _moduleWrapper.removeModuleWrapper)(id, customWrapper.current);
|
|
150
150
|
};
|
|
151
151
|
}, []);
|
|
152
|
-
let
|
|
152
|
+
let isDisabled = Boolean((_customWrapper$curren3 = customWrapper.current.values) === null || _customWrapper$curren3 === void 0 ? void 0 : _customWrapper$curren3.isHistoryDisabled);
|
|
153
|
+
if (typeof isHistoryDisabled === 'boolean' && !isDisabled) {
|
|
154
|
+
isDisabled = isHistoryDisabled;
|
|
155
|
+
}
|
|
153
156
|
if ((historyLayer === null || historyLayer === void 0 ? void 0 : historyLayer.id) === 'root') {
|
|
154
|
-
|
|
157
|
+
isDisabled = false;
|
|
155
158
|
}
|
|
156
|
-
const layerToProvide = shouldEnableHistory ? effectiveLayer : null;
|
|
157
159
|
return _react.default.createElement(_react.default.Fragment, null, isInitialized && _react.default.createElement(_ChaynsContext.ChaynsContext.Provider, {
|
|
158
160
|
value: customWrapper.current
|
|
159
|
-
}, _react.default.createElement(_HistoryLayerContext.ChaynsHistoryLayerProvider, {
|
|
160
|
-
layer:
|
|
161
|
-
}, children)), _react.default.createElement(InitialDataProvider, {
|
|
161
|
+
}, !isDisabled ? effectiveLayer ? _react.default.createElement(_HistoryLayerContext.ChaynsHistoryLayerProvider, {
|
|
162
|
+
layer: effectiveLayer
|
|
163
|
+
}, children) : null : children), _react.default.createElement(InitialDataProvider, {
|
|
162
164
|
data: (_customWrapper$curren4 = customWrapper.current) === null || _customWrapper$curren4 === void 0 ? void 0 : _customWrapper$curren4.values,
|
|
163
165
|
renderedByServer: renderedByServer
|
|
164
166
|
}));
|
|
@@ -37,10 +37,8 @@ const ChaynsHistoryLayerProvider = t0 => {
|
|
|
37
37
|
let t2;
|
|
38
38
|
if ($[0] !== layer) {
|
|
39
39
|
t1 = () => {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
return () => popChaynsHistoryLayer(layer);
|
|
43
|
-
}
|
|
40
|
+
pushChaynsHistoryLayer(layer);
|
|
41
|
+
return () => popChaynsHistoryLayer(layer);
|
|
44
42
|
};
|
|
45
43
|
t2 = [layer];
|
|
46
44
|
$[0] = layer;
|
|
@@ -39,11 +39,11 @@ const ChaynsHost = t0 => {
|
|
|
39
39
|
styleSettings,
|
|
40
40
|
historyLayer,
|
|
41
41
|
historyChildId,
|
|
42
|
-
|
|
42
|
+
isHistoryDisabled: t3
|
|
43
43
|
} = t0;
|
|
44
44
|
const iFrameRef = t1 === undefined ? undefined : t1;
|
|
45
45
|
const loadingComponent = t2 === undefined ? undefined : t2;
|
|
46
|
-
const
|
|
46
|
+
const isHistoryDisabled = t3 === undefined ? true : 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 (!isHistoryDisabled) {
|
|
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] !== isHistoryDisabled || $[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
|
+
isHistoryDisabled: isHistoryDisabled
|
|
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] = isHistoryDisabled;
|
|
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] !== isHistoryDisabled || $[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
|
+
isHistoryDisabled: isHistoryDisabled
|
|
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] = isHistoryDisabled;
|
|
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
|
+
isHistoryDisabled
|
|
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
|
+
isHistoryDisabled,
|
|
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, 'isHistoryDisabled', isHistoryDisabled);
|
|
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
|
+
isHistoryDisabled
|
|
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] !== isHistoryDisabled || $[7] !== language || $[8] !== pages || $[9] !== parameters || $[10] !== site || $[11] !== styleSettings || $[12] !== user) {
|
|
60
60
|
result = {
|
|
61
61
|
site,
|
|
62
62
|
isAdminModeActive,
|
|
63
|
-
|
|
63
|
+
isHistoryDisabled,
|
|
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] = isHistoryDisabled;
|
|
86
86
|
$[7] = language;
|
|
87
87
|
$[8] = pages;
|
|
88
88
|
$[9] = parameters;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.selectType = exports.WeekDayType = exports.ToastType = exports.TappEvent = exports.SnapshotType = exports.SharingApp = exports.ScreenSize = exports.ScanQrCodeCodeType = exports.ScanQrCodeCameraTypes = exports.RuntimeEnvironment = exports.RuntimeEnviroment = exports.MediaType = exports.LoginState = exports.Language = exports.IconType = exports.IconStyle = exports.IOSFeedbackVibration = exports.Gender = exports.Font = exports.FloatingButtonPosition = exports.FloatingButtonAnimation = exports.Environment = exports.DialogType = exports.DialogSelectType = exports.DialogInputType = exports.DialogIconType = exports.DialogButtonType = exports.DialogAnimation = exports.DeviceOs = exports.DesignSettingsUpdateTappViewModes = exports.DesignSettingsUpdateSeasonTypes = exports.DesignSettingsUpdateGalleryAnimationTypes = exports.DesignSettingsUpdateCoverTypes = exports.DesignSettingsUpdateBackgroundType = exports.DateType = exports.ColorMode = exports.BrowserName = exports.AppName = exports.AppFlavor = exports.AccessMode = void 0;
|
|
6
|
+
exports.selectType = exports.WeekDayType = exports.ToastType = exports.TappEvent = exports.SnapshotType = exports.SharingApp = exports.ScreenSize = exports.ScanQrCodeCodeType = exports.ScanQrCodeCameraTypes = exports.RuntimeEnvironment = exports.RuntimeEnviroment = exports.MediaType = exports.LoginState = exports.Language = exports.IconType = exports.IconStyle = exports.IOSFeedbackVibration = exports.Gender = exports.Font = exports.FloatingButtonPosition = exports.FloatingButtonAnimation = exports.FileExplorerSortType = exports.FileExplorerFilterType = exports.Environment = exports.DialogType = exports.DialogSelectType = exports.DialogInputType = exports.DialogIconType = exports.DialogButtonType = exports.DialogAnimation = exports.DeviceOs = exports.DesignSettingsUpdateTappViewModes = exports.DesignSettingsUpdateSeasonTypes = exports.DesignSettingsUpdateGalleryAnimationTypes = exports.DesignSettingsUpdateCoverTypes = exports.DesignSettingsUpdateBackgroundType = exports.DateType = exports.ColorMode = exports.BrowserName = exports.AppName = exports.AppFlavor = exports.AccessMode = void 0;
|
|
7
7
|
let DateType = exports.DateType = function (DateType) {
|
|
8
8
|
DateType[DateType["DATE"] = 0] = "DATE";
|
|
9
9
|
DateType[DateType["TIME"] = 1] = "TIME";
|
|
@@ -27,6 +27,17 @@ let ToastType = exports.ToastType = function (ToastType) {
|
|
|
27
27
|
ToastType[ToastType["ERROR"] = 4] = "ERROR";
|
|
28
28
|
return ToastType;
|
|
29
29
|
}({});
|
|
30
|
+
let FileExplorerFilterType = exports.FileExplorerFilterType = function (FileExplorerFilterType) {
|
|
31
|
+
FileExplorerFilterType["FILES"] = "files";
|
|
32
|
+
FileExplorerFilterType["FOLDERS"] = "folders";
|
|
33
|
+
return FileExplorerFilterType;
|
|
34
|
+
}({});
|
|
35
|
+
let FileExplorerSortType = exports.FileExplorerSortType = function (FileExplorerSortType) {
|
|
36
|
+
FileExplorerSortType["NONE"] = "none";
|
|
37
|
+
FileExplorerSortType["ALPHABETICAL_ASC"] = "alphabetical-asc";
|
|
38
|
+
FileExplorerSortType["ALPHABETICAL_DESC"] = "alphabetical-desc";
|
|
39
|
+
return FileExplorerSortType;
|
|
40
|
+
}({});
|
|
30
41
|
let DialogInputType = exports.DialogInputType = function (DialogInputType) {
|
|
31
42
|
DialogInputType["NUMBER"] = "number";
|
|
32
43
|
DialogInputType["PASSWORD"] = "password";
|
|
@@ -316,6 +327,7 @@ let DialogType = exports.DialogType = function (DialogType) {
|
|
|
316
327
|
DialogType["CONFIRM"] = "confirm";
|
|
317
328
|
DialogType["DATE"] = "date";
|
|
318
329
|
DialogType["FILE_SELECT"] = "fileSelect";
|
|
330
|
+
DialogType["FILE_EXPLORER"] = "fileExplorer";
|
|
319
331
|
DialogType["IFRAME"] = "iframe";
|
|
320
332
|
DialogType["MODULE"] = "module";
|
|
321
333
|
DialogType["INPUT"] = "input";
|
|
@@ -64,10 +64,10 @@ const ChaynsProvider = ({
|
|
|
64
64
|
chaynsApiId,
|
|
65
65
|
historyLayer,
|
|
66
66
|
history,
|
|
67
|
-
|
|
67
|
+
isHistoryDisabled,
|
|
68
68
|
segmentCount
|
|
69
69
|
}) => {
|
|
70
|
-
var _ref, _crypto, _crypto$randomUUID,
|
|
70
|
+
var _ref, _crypto, _crypto$randomUUID, _customWrapper$curren, _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(
|
|
103
|
+
const [effectiveLayer, setEffectiveLayer] = useState(historyLayer !== null && historyLayer !== void 0 ? historyLayer : 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, _ref2) => {
|
|
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 = (_ref2 = historyLayer !== null && historyLayer !== void 0 ? historyLayer : parentLayerRef.current) !== null && _ref2 !== void 0 ? _ref2 : rootLayerRef.current;
|
|
116
116
|
if (layer && typeof segmentCount === 'number' && layer.getSegmentCount() !== segmentCount) {
|
|
117
117
|
await layer.setSegmentCount(segmentCount);
|
|
118
118
|
}
|
|
@@ -141,16 +141,18 @@ const ChaynsProvider = ({
|
|
|
141
141
|
removeModuleWrapper(id, customWrapper.current);
|
|
142
142
|
};
|
|
143
143
|
}, []);
|
|
144
|
-
let
|
|
144
|
+
let isDisabled = Boolean((_customWrapper$curren3 = customWrapper.current.values) === null || _customWrapper$curren3 === void 0 ? void 0 : _customWrapper$curren3.isHistoryDisabled);
|
|
145
|
+
if (typeof isHistoryDisabled === 'boolean' && !isDisabled) {
|
|
146
|
+
isDisabled = isHistoryDisabled;
|
|
147
|
+
}
|
|
145
148
|
if ((historyLayer === null || historyLayer === void 0 ? void 0 : historyLayer.id) === 'root') {
|
|
146
|
-
|
|
149
|
+
isDisabled = false;
|
|
147
150
|
}
|
|
148
|
-
const layerToProvide = shouldEnableHistory ? effectiveLayer : null;
|
|
149
151
|
return React.createElement(React.Fragment, null, isInitialized && React.createElement(ChaynsContext.Provider, {
|
|
150
152
|
value: customWrapper.current
|
|
151
|
-
}, React.createElement(ChaynsHistoryLayerProvider, {
|
|
152
|
-
layer:
|
|
153
|
-
}, children)), React.createElement(InitialDataProvider, {
|
|
153
|
+
}, !isDisabled ? effectiveLayer ? React.createElement(ChaynsHistoryLayerProvider, {
|
|
154
|
+
layer: effectiveLayer
|
|
155
|
+
}, children) : null : children), React.createElement(InitialDataProvider, {
|
|
154
156
|
data: (_customWrapper$curren4 = customWrapper.current) === null || _customWrapper$curren4 === void 0 ? void 0 : _customWrapper$curren4.values,
|
|
155
157
|
renderedByServer: renderedByServer
|
|
156
158
|
}));
|
|
@@ -26,10 +26,8 @@ export const ChaynsHistoryLayerProvider = t0 => {
|
|
|
26
26
|
let t2;
|
|
27
27
|
if ($[0] !== layer) {
|
|
28
28
|
t1 = () => {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
return () => popChaynsHistoryLayer(layer);
|
|
32
|
-
}
|
|
29
|
+
pushChaynsHistoryLayer(layer);
|
|
30
|
+
return () => popChaynsHistoryLayer(layer);
|
|
33
31
|
};
|
|
34
32
|
t2 = [layer];
|
|
35
33
|
$[0] = layer;
|
|
@@ -31,11 +31,11 @@ const ChaynsHost = t0 => {
|
|
|
31
31
|
styleSettings,
|
|
32
32
|
historyLayer,
|
|
33
33
|
historyChildId,
|
|
34
|
-
|
|
34
|
+
isHistoryDisabled: t3
|
|
35
35
|
} = t0;
|
|
36
36
|
const iFrameRef = t1 === undefined ? undefined : t1;
|
|
37
37
|
const loadingComponent = t2 === undefined ? undefined : t2;
|
|
38
|
-
const
|
|
38
|
+
const isHistoryDisabled = t3 === undefined ? true : 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 (!isHistoryDisabled) {
|
|
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] !== isHistoryDisabled || $[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
|
+
isHistoryDisabled: isHistoryDisabled
|
|
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] = isHistoryDisabled;
|
|
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] !== isHistoryDisabled || $[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
|
+
isHistoryDisabled: isHistoryDisabled
|
|
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] = isHistoryDisabled;
|
|
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
|
+
isHistoryDisabled
|
|
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
|
+
isHistoryDisabled,
|
|
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, 'isHistoryDisabled', isHistoryDisabled);
|
|
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
|
+
isHistoryDisabled
|
|
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] !== isHistoryDisabled || $[7] !== language || $[8] !== pages || $[9] !== parameters || $[10] !== site || $[11] !== styleSettings || $[12] !== user) {
|
|
52
52
|
result = {
|
|
53
53
|
site,
|
|
54
54
|
isAdminModeActive,
|
|
55
|
-
|
|
55
|
+
isHistoryDisabled,
|
|
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] = isHistoryDisabled;
|
|
78
78
|
$[7] = language;
|
|
79
79
|
$[8] = pages;
|
|
80
80
|
$[9] = parameters;
|
|
@@ -21,6 +21,17 @@ export let ToastType = function (ToastType) {
|
|
|
21
21
|
ToastType[ToastType["ERROR"] = 4] = "ERROR";
|
|
22
22
|
return ToastType;
|
|
23
23
|
}({});
|
|
24
|
+
export let FileExplorerFilterType = function (FileExplorerFilterType) {
|
|
25
|
+
FileExplorerFilterType["FILES"] = "files";
|
|
26
|
+
FileExplorerFilterType["FOLDERS"] = "folders";
|
|
27
|
+
return FileExplorerFilterType;
|
|
28
|
+
}({});
|
|
29
|
+
export let FileExplorerSortType = function (FileExplorerSortType) {
|
|
30
|
+
FileExplorerSortType["NONE"] = "none";
|
|
31
|
+
FileExplorerSortType["ALPHABETICAL_ASC"] = "alphabetical-asc";
|
|
32
|
+
FileExplorerSortType["ALPHABETICAL_DESC"] = "alphabetical-desc";
|
|
33
|
+
return FileExplorerSortType;
|
|
34
|
+
}({});
|
|
24
35
|
export let DialogInputType = function (DialogInputType) {
|
|
25
36
|
DialogInputType["NUMBER"] = "number";
|
|
26
37
|
DialogInputType["PASSWORD"] = "password";
|
|
@@ -310,6 +321,7 @@ export let DialogType = function (DialogType) {
|
|
|
310
321
|
DialogType["CONFIRM"] = "confirm";
|
|
311
322
|
DialogType["DATE"] = "date";
|
|
312
323
|
DialogType["FILE_SELECT"] = "fileSelect";
|
|
324
|
+
DialogType["FILE_EXPLORER"] = "fileExplorer";
|
|
313
325
|
DialogType["IFRAME"] = "iframe";
|
|
314
326
|
DialogType["MODULE"] = "module";
|
|
315
327
|
DialogType["INPUT"] = "input";
|
|
@@ -28,11 +28,7 @@ export type ChaynsProviderProps = {
|
|
|
28
28
|
segmentCount?: number;
|
|
29
29
|
};
|
|
30
30
|
segmentCount?: number;
|
|
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;
|
|
31
|
+
isHistoryDisabled?: boolean;
|
|
36
32
|
};
|
|
37
33
|
declare const ChaynsProvider: React.FC<ChaynsProviderProps>;
|
|
38
34
|
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;
|
|
10
10
|
children: ReactNode;
|
|
11
11
|
}
|
|
12
12
|
/**
|
|
@@ -14,9 +14,6 @@ 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
|
-
*
|
|
20
17
|
* Use `ChaynsHistoryLayerOverrideProvider` instead if you only want to override the
|
|
21
18
|
* React context without affecting static call sites.
|
|
22
19
|
*/
|
|
@@ -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
|
+
/** Whether the history is disabled for the children */
|
|
40
|
+
isHistoryDisabled?: 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
|
+
/** Whether the history is disabled for the children */
|
|
29
|
+
isHistoryDisabled?: 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
|
+
/** Whether the history is disabled for the children */
|
|
31
|
+
isHistoryDisabled?: boolean;
|
|
32
32
|
};
|
|
33
33
|
declare const ModuleHost: FC<ModulePropTypes>;
|
|
34
34
|
export default ModuleHost;
|
|
@@ -69,6 +69,40 @@ export interface DialogFileSelect {
|
|
|
69
69
|
exclude?: Array<string> | string;
|
|
70
70
|
directory?: boolean;
|
|
71
71
|
}
|
|
72
|
+
export interface DialogFileExplorer {
|
|
73
|
+
type: DialogType.FILE_EXPLORER;
|
|
74
|
+
rootFolderName: string;
|
|
75
|
+
items: FileExplorerItem[];
|
|
76
|
+
onLoad: (id?: string | number) => void;
|
|
77
|
+
onFilterChange?: (value: FileExplorerFilterChange) => void;
|
|
78
|
+
}
|
|
79
|
+
export declare enum FileExplorerFilterType {
|
|
80
|
+
FILES = "files",
|
|
81
|
+
FOLDERS = "folders"
|
|
82
|
+
}
|
|
83
|
+
export declare enum FileExplorerSortType {
|
|
84
|
+
NONE = "none",
|
|
85
|
+
ALPHABETICAL_ASC = "alphabetical-asc",
|
|
86
|
+
ALPHABETICAL_DESC = "alphabetical-desc"
|
|
87
|
+
}
|
|
88
|
+
export interface FileExplorerFilterChange {
|
|
89
|
+
currentFolderId?: string | number;
|
|
90
|
+
searchString: string;
|
|
91
|
+
filter: FileExplorerFilterType[];
|
|
92
|
+
sortType: FileExplorerSortType;
|
|
93
|
+
}
|
|
94
|
+
export type FileExplorerItem = FileExplorerFolder | FileExplorerFile;
|
|
95
|
+
export interface FileExplorerFolder {
|
|
96
|
+
id: string | number;
|
|
97
|
+
name: string;
|
|
98
|
+
count: number;
|
|
99
|
+
children: FileExplorerItem[];
|
|
100
|
+
}
|
|
101
|
+
export interface FileExplorerFile {
|
|
102
|
+
id: string | number;
|
|
103
|
+
name: string;
|
|
104
|
+
mimeType: string;
|
|
105
|
+
}
|
|
72
106
|
export interface DialogConfirm {
|
|
73
107
|
type: DialogType.CONFIRM;
|
|
74
108
|
}
|
|
@@ -89,7 +123,7 @@ export interface BaseDialog {
|
|
|
89
123
|
}) => void;
|
|
90
124
|
footer?: string;
|
|
91
125
|
}
|
|
92
|
-
export type Dialog<T = object> = BaseDialog & (DialogAlert | DialogConfirm | DialogInput | DialogModule<T> | DialogIFrame<T> | DialogSelect | DialogDate | DialogToast | DialogSignature | DialogFileSelect);
|
|
126
|
+
export type Dialog<T = object> = BaseDialog & (DialogAlert | DialogConfirm | DialogInput | DialogModule<T> | DialogIFrame<T> | DialogSelect | DialogDate | DialogToast | DialogSignature | DialogFileSelect | DialogFileExplorer);
|
|
93
127
|
export interface DialogSignature {
|
|
94
128
|
type: DialogType.SIGNATURE;
|
|
95
129
|
}
|
|
@@ -316,10 +350,7 @@ export interface ChaynsReactValues {
|
|
|
316
350
|
site: ChaynsApiSite;
|
|
317
351
|
user: ChaynsApiUser | undefined;
|
|
318
352
|
isAdminModeActive: boolean;
|
|
319
|
-
|
|
320
|
-
* When true, enables the history layer.
|
|
321
|
-
*/
|
|
322
|
-
isHistoryEnabled?: boolean;
|
|
353
|
+
isHistoryDisabled?: boolean;
|
|
323
354
|
pages: Page[];
|
|
324
355
|
currentPage: {
|
|
325
356
|
id: number;
|
|
@@ -449,8 +480,9 @@ export interface ChaynsReactFunctions {
|
|
|
449
480
|
})): DialogHandler<Date[]>;
|
|
450
481
|
createDialog(config: BaseDialog & DialogDate): DialogHandler<Date>;
|
|
451
482
|
createDialog(config: BaseDialog & DialogFileSelect): DialogHandler<DialogResultFile[]>;
|
|
483
|
+
createDialog(config: BaseDialog & DialogFileExplorer): DialogHandler<string | number>;
|
|
452
484
|
createDialog<Input = any, Result = unknown>(config: BaseDialog & (DialogModule<Input> | DialogIFrame<Input>)): DialogHandler<Result>;
|
|
453
|
-
createDialog<Input = any, Result = unknown>(config: BaseDialog & (DialogAlert | DialogConfirm | DialogToast | DialogInput | DialogSignature | DialogSelect | DialogDate | DialogFileSelect | DialogIFrame<Input> | DialogModule<Input>)): DialogHandler<any>;
|
|
485
|
+
createDialog<Input = any, Result = unknown>(config: BaseDialog & (DialogAlert | DialogConfirm | DialogToast | DialogInput | DialogSignature | DialogSelect | DialogDate | DialogFileSelect | DialogFileExplorer | DialogIFrame<Input> | DialogModule<Input>)): DialogHandler<any>;
|
|
454
486
|
openDialog: (value: any, callback: (data: any) => any) => Promise<any>;
|
|
455
487
|
closeDialog: (dialogId: number) => Promise<void>;
|
|
456
488
|
setDialogResult: (buttonType: DialogButtonType, result: any) => Promise<void>;
|
|
@@ -1026,6 +1058,7 @@ export declare enum DialogType {
|
|
|
1026
1058
|
CONFIRM = "confirm",
|
|
1027
1059
|
DATE = "date",
|
|
1028
1060
|
FILE_SELECT = "fileSelect",
|
|
1061
|
+
FILE_EXPLORER = "fileExplorer",
|
|
1029
1062
|
IFRAME = "iframe",
|
|
1030
1063
|
MODULE = "module",
|
|
1031
1064
|
INPUT = "input",
|