chayns-api 2.1.3-3 → 2.1.5
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/.babelrc +31 -30
- package/.eslintrc +17 -17
- package/.github/workflows/deploy_docs.yml +28 -28
- package/.github/workflows/publish.yml +21 -21
- package/LICENSE +21 -21
- package/README.md +67 -67
- package/dist/cjs/calls/dialogs/chaynsDialog.js +0 -2
- package/dist/cjs/calls/dialogs/communication.js +0 -2
- package/dist/cjs/calls/dialogs/confirm.js +0 -1
- package/dist/cjs/calls/dialogs/date.js +0 -50
- package/dist/cjs/calls/dialogs/iFrame.js +1 -1
- package/dist/cjs/calls/index.js +1 -162
- package/dist/cjs/calls/sendMessage.js +0 -12
- package/dist/cjs/calls/visibilityChangeListener.js +0 -7
- package/dist/cjs/components/AppDialogWrapper.js +3 -3
- package/dist/cjs/components/ChaynsContext.js +1 -1
- package/dist/cjs/components/ChaynsProvider.js +6 -10
- package/dist/cjs/components/ErrorBoundary.js +1 -1
- package/dist/cjs/components/WaitUntil.js +0 -2
- package/dist/cjs/components/withCompatMode.js +9 -13
- package/dist/cjs/components/withHydrationBoundary.js +2 -2
- package/dist/cjs/constants/hydrationContext.js +1 -3
- package/dist/cjs/constants/languages.js +1 -1
- package/dist/cjs/handler/DialogHandler.js +0 -4
- package/dist/cjs/hooks/geoLocationListener.js +0 -7
- package/dist/cjs/hooks/scrollListener.js +0 -14
- package/dist/cjs/hooks/useAccessToken.js +0 -4
- package/dist/cjs/hooks/useCurrentPage.js +0 -3
- package/dist/cjs/hooks/useCustomCallbackFunction.js +0 -4
- package/dist/cjs/hooks/useCustomData.js +0 -3
- package/dist/cjs/hooks/useDevice.js +0 -3
- package/dist/cjs/hooks/useDialogState.js +0 -7
- package/dist/cjs/hooks/useEnvironment.js +0 -3
- package/dist/cjs/hooks/useFunctions.js +0 -3
- package/dist/cjs/hooks/useIsAdminMode.js +0 -3
- package/dist/cjs/hooks/useLanguage.js +0 -3
- package/dist/cjs/hooks/usePages.js +0 -6
- package/dist/cjs/hooks/useParameters.js +0 -3
- package/dist/cjs/hooks/useSite.js +0 -3
- package/dist/cjs/hooks/useUser.js +0 -3
- package/dist/cjs/hooks/useValues.js +0 -3
- package/dist/cjs/hooks/windowMetricsListener.js +0 -7
- package/dist/cjs/host/ChaynsHost.js +3 -4
- package/dist/cjs/host/iframe/HostIframe.js +4 -23
- package/dist/cjs/host/module/ModuleHost.js +5 -9
- package/dist/cjs/host/module/utils/loadComponent.js +4 -5
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/types/IChaynsReact.js +39 -46
- package/dist/cjs/util/appCall.js +0 -2
- package/dist/cjs/util/deviceHelper.js +0 -4
- package/dist/cjs/util/heightHelper.js +1 -1
- package/dist/cjs/util/initModuleFederationSharing.js +2 -6
- package/dist/cjs/util/postIframeForm.js +0 -1
- package/dist/cjs/util/transferNestedFunctions.js +0 -3
- package/dist/cjs/wrapper/AppWrapper.js +6 -20
- package/dist/cjs/wrapper/FrameWrapper.js +2 -7
- package/dist/cjs/wrapper/ModuleFederationWrapper.js +1 -3
- package/dist/cjs/wrapper/StaticChaynsApi.js +1 -1
- package/dist/esm/calls/dialogs/chaynsDialog.js +0 -2
- package/dist/esm/calls/dialogs/communication.js +0 -2
- package/dist/esm/calls/dialogs/confirm.js +0 -1
- package/dist/esm/calls/dialogs/date.js +0 -51
- package/dist/esm/calls/dialogs/iFrame.js +1 -1
- package/dist/esm/calls/index.js +1 -162
- package/dist/esm/calls/sendMessage.js +0 -12
- package/dist/esm/calls/visibilityChangeListener.js +0 -7
- package/dist/esm/components/AppDialogWrapper.js +2 -2
- package/dist/esm/components/ChaynsContext.js +1 -1
- package/dist/esm/components/ChaynsProvider.js +5 -10
- package/dist/esm/components/WaitUntil.js +0 -2
- package/dist/esm/components/withCompatMode.js +8 -14
- package/dist/esm/components/withHydrationBoundary.js +2 -2
- package/dist/esm/constants/hydrationContext.js +1 -3
- package/dist/esm/constants/languages.js +1 -1
- package/dist/esm/handler/DialogHandler.js +1 -5
- package/dist/esm/hooks/geoLocationListener.js +0 -7
- package/dist/esm/hooks/scrollListener.js +0 -14
- package/dist/esm/hooks/useAccessToken.js +0 -5
- package/dist/esm/hooks/useCurrentPage.js +0 -4
- package/dist/esm/hooks/useCustomCallbackFunction.js +0 -5
- package/dist/esm/hooks/useCustomData.js +0 -4
- package/dist/esm/hooks/useDevice.js +0 -3
- package/dist/esm/hooks/useDialogState.js +0 -8
- package/dist/esm/hooks/useEnvironment.js +0 -3
- package/dist/esm/hooks/useFunctions.js +0 -4
- package/dist/esm/hooks/useIsAdminMode.js +0 -3
- package/dist/esm/hooks/useLanguage.js +0 -3
- package/dist/esm/hooks/usePages.js +0 -6
- package/dist/esm/hooks/useParameters.js +0 -3
- package/dist/esm/hooks/useSite.js +0 -3
- package/dist/esm/hooks/useUser.js +0 -3
- package/dist/esm/hooks/useValues.js +0 -4
- package/dist/esm/hooks/windowMetricsListener.js +0 -7
- package/dist/esm/host/ChaynsHost.js +2 -3
- package/dist/esm/host/iframe/HostIframe.js +3 -22
- package/dist/esm/host/module/ModuleHost.js +4 -8
- package/dist/esm/host/module/utils/loadComponent.js +3 -4
- package/dist/esm/types/IChaynsReact.js +39 -49
- package/dist/esm/util/appCall.js +0 -2
- package/dist/esm/util/deviceHelper.js +0 -4
- package/dist/esm/util/initModuleFederationSharing.js +1 -5
- package/dist/esm/util/postIframeForm.js +0 -1
- package/dist/esm/util/transferNestedFunctions.js +0 -2
- package/dist/esm/wrapper/AppWrapper.js +6 -20
- package/dist/esm/wrapper/FrameWrapper.js +2 -6
- package/dist/esm/wrapper/ModuleFederationWrapper.js +1 -3
- package/dist/esm/wrapper/SsrWrapper.js +1 -1
- package/dist/esm/wrapper/StaticChaynsApi.js +1 -1
- package/dist/types/calls/dialogs/alert.d.ts +1 -1
- package/dist/types/calls/dialogs/chaynsDialog.d.ts +24 -24
- package/dist/types/calls/dialogs/close.d.ts +1 -1
- package/dist/types/calls/dialogs/communication.d.ts +3 -3
- package/dist/types/calls/dialogs/confirm.d.ts +13 -13
- package/dist/types/calls/dialogs/date.d.ts +96 -96
- package/dist/types/calls/dialogs/dropUpAlert.d.ts +5 -5
- package/dist/types/calls/dialogs/fileSelect.d.ts +16 -16
- package/dist/types/calls/dialogs/iFrame.d.ts +10 -10
- package/dist/types/calls/dialogs/index.d.ts +14 -14
- package/dist/types/calls/dialogs/input.d.ts +15 -15
- package/dist/types/calls/dialogs/mediaSelect.d.ts +8 -8
- package/dist/types/calls/dialogs/open.d.ts +1 -1
- package/dist/types/calls/dialogs/select.d.ts +6 -6
- package/dist/types/calls/dialogs/signature.d.ts +7 -7
- package/dist/types/calls/dialogs/toast.d.ts +1 -1
- package/dist/types/calls/dialogs/utils/callback.d.ts +1 -1
- package/dist/types/calls/dialogs/utils/is.d.ts +4 -4
- package/dist/types/calls/getUserInfo.d.ts +9 -9
- package/dist/types/calls/index.d.ts +255 -255
- package/dist/types/calls/sendMessage.d.ts +13 -13
- package/dist/types/calls/visibilityChangeListener.d.ts +9 -9
- package/dist/types/components/AppDialogWrapper.d.ts +5 -5
- package/dist/types/components/ChaynsContext.d.ts +3 -3
- package/dist/types/components/ChaynsProvider.d.ts +11 -11
- package/dist/types/components/ErrorBoundary.d.ts +13 -13
- package/dist/types/components/WaitUntil.d.ts +7 -7
- package/dist/types/components/moduleWrapper.d.ts +4 -4
- package/dist/types/components/withCompatMode.d.ts +43 -43
- package/dist/types/components/withHydrationBoundary.d.ts +24 -24
- package/dist/types/constants/hydrationContext.d.ts +6 -6
- package/dist/types/constants/index.d.ts +1 -1
- package/dist/types/constants/languages.d.ts +12 -12
- package/dist/types/handler/DialogHandler.d.ts +24 -24
- package/dist/types/helper/apiListenerHelper.d.ts +6 -6
- package/dist/types/hooks/context.d.ts +3 -3
- package/dist/types/hooks/geoLocationListener.d.ts +18 -18
- package/dist/types/hooks/index.d.ts +18 -18
- package/dist/types/hooks/scrollListener.d.ts +28 -28
- package/dist/types/hooks/useAccessToken.d.ts +6 -6
- package/dist/types/hooks/useCurrentPage.d.ts +5 -5
- package/dist/types/hooks/useCustomCallbackFunction.d.ts +5 -5
- package/dist/types/hooks/useCustomData.d.ts +4 -4
- package/dist/types/hooks/useDevice.d.ts +5 -5
- package/dist/types/hooks/useDialogState.d.ts +9 -9
- package/dist/types/hooks/useEnvironment.d.ts +5 -5
- package/dist/types/hooks/useFunctions.d.ts +4 -4
- package/dist/types/hooks/useIsAdminMode.d.ts +4 -4
- package/dist/types/hooks/useLanguage.d.ts +5 -5
- package/dist/types/hooks/usePages.d.ts +18 -18
- package/dist/types/hooks/useParameters.d.ts +5 -5
- package/dist/types/hooks/useSite.d.ts +5 -5
- package/dist/types/hooks/useUser.d.ts +5 -5
- package/dist/types/hooks/useValues.d.ts +4 -4
- package/dist/types/hooks/windowMetricsListener.d.ts +11 -11
- package/dist/types/host/ChaynsHost.d.ts +29 -29
- package/dist/types/host/iframe/HostIframe.d.ts +26 -26
- package/dist/types/host/iframe/utils/useUpdateData.d.ts +3 -3
- package/dist/types/host/module/ModuleHost.d.ts +28 -28
- package/dist/types/host/module/utils/loadComponent.d.ts +3 -3
- package/dist/types/index.d.ts +20 -20
- package/dist/types/types/IChaynsReact.d.ts +898 -899
- package/dist/types/types/dialog.d.ts +41 -41
- package/dist/types/util/appCall.d.ts +2 -2
- package/dist/types/util/bindChaynsApi.d.ts +1 -1
- package/dist/types/util/deviceHelper.d.ts +9 -9
- package/dist/types/util/heightHelper.d.ts +1 -1
- package/dist/types/util/initModuleFederationSharing.d.ts +3 -3
- package/dist/types/util/is.d.ts +5 -5
- package/dist/types/util/postIframeForm.d.ts +1 -1
- package/dist/types/util/transferNestedFunctions.d.ts +1 -1
- package/dist/types/util/url.d.ts +1 -1
- package/dist/types/wrapper/AppWrapper.d.ts +22 -22
- package/dist/types/wrapper/FrameWrapper.d.ts +18 -18
- package/dist/types/wrapper/ModuleFederationWrapper.d.ts +13 -13
- package/dist/types/wrapper/SsrWrapper.d.ts +14 -14
- package/dist/types/wrapper/StaticChaynsApi.d.ts +16 -16
- package/package.json +88 -88
- package/toolkit.config.js +20 -20
- package/tsconfig.json +56 -56
|
@@ -2,35 +2,6 @@ import { buttonText, buttonType, dialogAction } from './chaynsDialog';
|
|
|
2
2
|
import { isDate, isNumber, isObject } from './utils/is';
|
|
3
3
|
import { open } from './open';
|
|
4
4
|
import { getDevice } from "../index";
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* The config object for date dialog
|
|
8
|
-
* @typedef {Object} dateConfig
|
|
9
|
-
* @property {Date} preSelect - The date object which should be preselected.
|
|
10
|
-
* @property {Date} minDate - The min date which you could select.
|
|
11
|
-
* @property {Date} maxDate - The max date which you could select.
|
|
12
|
-
* @property {dateDialogType} dateType - The type of dialog you want to display.
|
|
13
|
-
* @property {number} minuteIntervall - The interval for special minutes, possible are 2, 3, 4, 5, 6, 12, 15, 20, 30. Default is 1.
|
|
14
|
-
* @property {string} message - The message that is displayed above the date dialog, only in apps supported
|
|
15
|
-
* @property {string} title - The title that is displayed above the message, only in apps supported
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* This call will open a date select dialog.
|
|
20
|
-
* <div>Call: 30</div>
|
|
21
|
-
* @param {dateConfig} config - Define the configuration of this call
|
|
22
|
-
* @return {Promise} contains a timestamp as result
|
|
23
|
-
* @example chayns.dialog.date({
|
|
24
|
-
* 'dateType': chayns.dialog.dateType.DATE_TIME,
|
|
25
|
-
* 'preSelect': new Date(2018, 6, 14, 0, 0, 0),
|
|
26
|
-
* 'minDate': new Date(2018, 6, 1, 15, 0, 0),
|
|
27
|
-
* 'maxDate': new Date(2019, 6, 1, 0, 23, 0),
|
|
28
|
-
* 'minuteInterval': 15
|
|
29
|
-
* ).then(function (data) {
|
|
30
|
-
* console.log(data);
|
|
31
|
-
* });
|
|
32
|
-
*/
|
|
33
|
-
|
|
34
5
|
export function date() {
|
|
35
6
|
let config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
36
7
|
let {
|
|
@@ -43,8 +14,6 @@ export function date() {
|
|
|
43
14
|
autoSelectDate
|
|
44
15
|
} = config,
|
|
45
16
|
type = config.dateType || dateType.DATE;
|
|
46
|
-
|
|
47
|
-
// This will fix the iOS problem with not preselectedDate without user interaction. That it return the wrog time.
|
|
48
17
|
const {
|
|
49
18
|
os,
|
|
50
19
|
app
|
|
@@ -73,7 +42,6 @@ export function date() {
|
|
|
73
42
|
minuteInterval,
|
|
74
43
|
autoSelectDate
|
|
75
44
|
}).then(data => {
|
|
76
|
-
// @ts-ignore
|
|
77
45
|
return Promise.resolve(data.selectedDate);
|
|
78
46
|
});
|
|
79
47
|
}
|
|
@@ -100,7 +68,6 @@ export function advancedDate() {
|
|
|
100
68
|
getLocalTime,
|
|
101
69
|
autoSelectDate
|
|
102
70
|
} = config,
|
|
103
|
-
// minInterval and maxInterval in minutes
|
|
104
71
|
type = config.dateType || dateType.DATE;
|
|
105
72
|
minDate = validateValue(minDate);
|
|
106
73
|
maxDate = validateValue(maxDate);
|
|
@@ -120,8 +87,6 @@ export function advancedDate() {
|
|
|
120
87
|
}
|
|
121
88
|
}
|
|
122
89
|
} else {
|
|
123
|
-
// This will fix the iOS problem with not preselectedDate without user interaction. That it return the wrong time.
|
|
124
|
-
// eslint-disable-next-line no-lonely-if
|
|
125
90
|
if (minuteInterval && minuteInterval > 1 && os === 'iOS' && app) {
|
|
126
91
|
preSelect = roundInterval(preSelect, minuteInterval);
|
|
127
92
|
} else {
|
|
@@ -164,20 +129,6 @@ export function advancedDate() {
|
|
|
164
129
|
return Promise.resolve(data);
|
|
165
130
|
});
|
|
166
131
|
}
|
|
167
|
-
|
|
168
|
-
/**
|
|
169
|
-
* @typedef {number} dateDialogType
|
|
170
|
-
*/
|
|
171
|
-
|
|
172
|
-
/**
|
|
173
|
-
* Enum for date dialog
|
|
174
|
-
* <div>DATE will open a dialog where you can select a special day</div>
|
|
175
|
-
* <div>TIME will open a dialog where you can only select a special time</div>
|
|
176
|
-
* <div>DATE_TIME will open a dialog where you can select a special time on a special day</div>
|
|
177
|
-
* @readonly
|
|
178
|
-
* @enum {dateDialogType}
|
|
179
|
-
* @type {{DATE: number, TIME: number, DATE_TIME: number}}
|
|
180
|
-
*/
|
|
181
132
|
export const dateType = {
|
|
182
133
|
'DATE': 1,
|
|
183
134
|
'TIME': 2,
|
|
@@ -186,7 +137,6 @@ export const dateType = {
|
|
|
186
137
|
function validateValue(value) {
|
|
187
138
|
if (!isNumber(value)) {
|
|
188
139
|
if (isDate(value)) {
|
|
189
|
-
// TODO: Find out whats the purpose of parsing to int
|
|
190
140
|
return parseInt(value.getTime() / 1000 + "", 10);
|
|
191
141
|
}
|
|
192
142
|
return undefined;
|
|
@@ -206,6 +156,5 @@ function roundInterval() {
|
|
|
206
156
|
let minutes = preDate.getMinutes();
|
|
207
157
|
preDate.setMinutes(minutes - minutes % interval);
|
|
208
158
|
preDate.setSeconds(0);
|
|
209
|
-
// TODO: Why?
|
|
210
159
|
return parseInt(preDate.getTime() / 1000 + "", 10);
|
|
211
160
|
}
|
|
@@ -24,7 +24,7 @@ export function iFrame() {
|
|
|
24
24
|
}
|
|
25
25
|
export function _chaynsCallResponder(obj) {
|
|
26
26
|
if (obj.call.value.callback) {
|
|
27
|
-
const call = JSON.parse(JSON.stringify(obj));
|
|
27
|
+
const call = JSON.parse(JSON.stringify(obj));
|
|
28
28
|
invokeDialogCall(obj).then(result => {
|
|
29
29
|
sendData({
|
|
30
30
|
result,
|
package/dist/esm/calls/index.js
CHANGED
|
@@ -1,308 +1,147 @@
|
|
|
1
1
|
import { moduleWrapper } from '../components/moduleWrapper';
|
|
2
|
-
/**
|
|
3
|
-
* This adds a listener to determine your location.
|
|
4
|
-
* @category Event listener
|
|
5
|
-
*/
|
|
6
2
|
export const addGeoLocationListener = function () {
|
|
7
3
|
return moduleWrapper.current.functions.addGeoLocationListener(...arguments);
|
|
8
4
|
};
|
|
9
|
-
/**
|
|
10
|
-
* Adds a listener for scroll event by user.
|
|
11
|
-
* @category Event listener
|
|
12
|
-
*/
|
|
13
5
|
export const addScrollListener = function () {
|
|
14
6
|
return moduleWrapper.current.functions.addScrollListener(...arguments);
|
|
15
7
|
};
|
|
16
|
-
/**
|
|
17
|
-
* This method will be executed when the page gets displayed or hidden.
|
|
18
|
-
* @category Event listener
|
|
19
|
-
*/
|
|
20
8
|
export const addVisibilityChangeListener = function () {
|
|
21
9
|
return moduleWrapper.current.functions.addVisibilityChangeListener(...arguments);
|
|
22
10
|
};
|
|
23
|
-
/**
|
|
24
|
-
* This method will be executed when the toolbar gets displayed or hidden.
|
|
25
|
-
* @category Event listener
|
|
26
|
-
*/
|
|
27
11
|
export const addToolbarChangeListener = function () {
|
|
28
12
|
return moduleWrapper.current.functions.addToolbarChangeListener(...arguments);
|
|
29
13
|
};
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* This adds a listener to get the actual height of the page.
|
|
33
|
-
* @category Event listener
|
|
34
|
-
*/
|
|
35
14
|
export const addWindowMetricsListener = function () {
|
|
36
15
|
return moduleWrapper.current.functions.addWindowMetricsListener(...arguments);
|
|
37
|
-
};
|
|
38
|
-
* Allows a custom callback function to be defined
|
|
39
|
-
*/
|
|
16
|
+
};
|
|
40
17
|
export const customCallbackFunction = function () {
|
|
41
18
|
return moduleWrapper.current.functions.customCallbackFunction(...arguments);
|
|
42
19
|
};
|
|
43
|
-
/**
|
|
44
|
-
* Get the accessToken from the user.
|
|
45
|
-
*/
|
|
46
20
|
export const getAccessToken = function () {
|
|
47
21
|
return moduleWrapper.current.functions.getAccessToken(...arguments);
|
|
48
22
|
};
|
|
49
|
-
/**
|
|
50
|
-
* This method returns a list of installed share/social media apps.
|
|
51
|
-
*/
|
|
52
23
|
export const getAvailableSharingServices = function () {
|
|
53
24
|
return moduleWrapper.current.functions.getAvailableSharingServices(...arguments);
|
|
54
25
|
};
|
|
55
|
-
/**
|
|
56
|
-
* This method determines your location. If you want to track a route, use addGeoLocationListener.
|
|
57
|
-
*/
|
|
58
26
|
export const getGeoLocation = function () {
|
|
59
27
|
return moduleWrapper.current.functions.getGeoLocation(...arguments);
|
|
60
28
|
};
|
|
61
|
-
/**
|
|
62
|
-
* This method returns user information for a specific user.
|
|
63
|
-
* @category User functions
|
|
64
|
-
*/
|
|
65
29
|
export const getUserInfo = function () {
|
|
66
30
|
return moduleWrapper.current.functions.getUserInfo(...arguments);
|
|
67
31
|
};
|
|
68
|
-
/**
|
|
69
|
-
* Return the current scroll position of the top frame
|
|
70
|
-
*/
|
|
71
32
|
export const getScrollPosition = function () {
|
|
72
33
|
return moduleWrapper.current.functions.getScrollPosition(...arguments);
|
|
73
34
|
};
|
|
74
|
-
/**
|
|
75
|
-
* Returns the window metrics.
|
|
76
|
-
*/
|
|
77
35
|
export const getWindowMetrics = function () {
|
|
78
36
|
return moduleWrapper.current.functions.getWindowMetrics(...arguments);
|
|
79
37
|
};
|
|
80
|
-
/** @internal */
|
|
81
38
|
export const invokeCall = function () {
|
|
82
39
|
return moduleWrapper.current.functions.invokeCall(...arguments);
|
|
83
40
|
};
|
|
84
|
-
/** @internal */
|
|
85
41
|
export const invokeDialogCall = function () {
|
|
86
42
|
return moduleWrapper.current.functions.invokeDialogCall(...arguments);
|
|
87
43
|
};
|
|
88
|
-
/**
|
|
89
|
-
* This method will show a login dialog where the user has the opportunity to log in.
|
|
90
|
-
*/
|
|
91
44
|
export const login = function () {
|
|
92
45
|
return moduleWrapper.current.functions.login(...arguments);
|
|
93
46
|
};
|
|
94
|
-
/**
|
|
95
|
-
* This method will logout the user
|
|
96
|
-
*/
|
|
97
47
|
export const logout = function () {
|
|
98
48
|
return moduleWrapper.current.functions.logout(...arguments);
|
|
99
49
|
};
|
|
100
|
-
/**
|
|
101
|
-
* This function navigates you to the previous site.
|
|
102
|
-
*/
|
|
103
50
|
export const navigateBack = function () {
|
|
104
51
|
return moduleWrapper.current.functions.navigateBack(...arguments);
|
|
105
52
|
};
|
|
106
|
-
/**
|
|
107
|
-
* The images specified in the url array is shown in gallery mode.
|
|
108
|
-
*/
|
|
109
53
|
export const openImage = function () {
|
|
110
54
|
return moduleWrapper.current.functions.openImage(...arguments);
|
|
111
55
|
};
|
|
112
|
-
/**
|
|
113
|
-
* The images and videos specified in the items array is shown in gallery mode.
|
|
114
|
-
*/
|
|
115
56
|
export const openMedia = function () {
|
|
116
57
|
return moduleWrapper.current.functions.openMedia(...arguments);
|
|
117
58
|
};
|
|
118
|
-
/**
|
|
119
|
-
* Opens an URL in the chayns environment.
|
|
120
|
-
*/
|
|
121
59
|
export const openUrl = function () {
|
|
122
60
|
return moduleWrapper.current.functions.openUrl(...arguments);
|
|
123
61
|
};
|
|
124
|
-
/**
|
|
125
|
-
* The video specified in the URL is shown in video mode.
|
|
126
|
-
*/
|
|
127
62
|
export const openVideo = function () {
|
|
128
63
|
return moduleWrapper.current.functions.openVideo(...arguments);
|
|
129
64
|
};
|
|
130
|
-
/**
|
|
131
|
-
* Refresh badge count in navigation, user information and pages
|
|
132
|
-
*/
|
|
133
65
|
export const refreshData = function () {
|
|
134
66
|
return moduleWrapper.current.functions.refreshData(...arguments);
|
|
135
67
|
};
|
|
136
|
-
/**
|
|
137
|
-
* Refresh accesstoken, should only be used when user object changes, not when token is invalid
|
|
138
|
-
*/
|
|
139
68
|
export const refreshAccessToken = function () {
|
|
140
69
|
return moduleWrapper.current.functions.refreshAccessToken(...arguments);
|
|
141
70
|
};
|
|
142
|
-
/**
|
|
143
|
-
* This removes a listener to determine your location.
|
|
144
|
-
* @category Event listener
|
|
145
|
-
*/
|
|
146
71
|
export const removeGeoLocationListener = function () {
|
|
147
72
|
return moduleWrapper.current.functions.removeGeoLocationListener(...arguments);
|
|
148
73
|
};
|
|
149
|
-
/**
|
|
150
|
-
* This removes a listener for changing toolbar visibility
|
|
151
|
-
* @category Event listener
|
|
152
|
-
*/
|
|
153
74
|
export const removeToolbarChangeListener = function () {
|
|
154
75
|
return moduleWrapper.current.functions.removeToolbarChangeListener(...arguments);
|
|
155
76
|
};
|
|
156
|
-
/**
|
|
157
|
-
* Removes scroll listener.
|
|
158
|
-
* @category Event listener
|
|
159
|
-
*/
|
|
160
77
|
export const removeScrollListener = function () {
|
|
161
78
|
return moduleWrapper.current.functions.removeScrollListener(...arguments);
|
|
162
79
|
};
|
|
163
|
-
/**
|
|
164
|
-
* Removes visibility change listener.
|
|
165
|
-
* @category Event listener
|
|
166
|
-
*/
|
|
167
80
|
export const removeVisibilityChangeListener = function () {
|
|
168
81
|
return moduleWrapper.current.functions.removeVisibilityChangeListener(...arguments);
|
|
169
82
|
};
|
|
170
|
-
/**
|
|
171
|
-
* Removes window metrics listener.
|
|
172
|
-
* @category Event listener
|
|
173
|
-
*/
|
|
174
83
|
export const removeWindowMetricsListener = function () {
|
|
175
84
|
return moduleWrapper.current.functions.removeWindowMetricsListener(...arguments);
|
|
176
85
|
};
|
|
177
|
-
/**
|
|
178
|
-
* Select other page on chayns site.
|
|
179
|
-
*/
|
|
180
86
|
export const selectPage = function () {
|
|
181
87
|
return moduleWrapper.current.functions.selectPage(...arguments);
|
|
182
88
|
};
|
|
183
|
-
/**
|
|
184
|
-
* Scrolls by specific amount.
|
|
185
|
-
*/
|
|
186
89
|
export const scrollByY = function () {
|
|
187
90
|
return moduleWrapper.current.functions.scrollByY(...arguments);
|
|
188
91
|
};
|
|
189
|
-
/**
|
|
190
|
-
* Scrolls to specific position.
|
|
191
|
-
*/
|
|
192
92
|
export const scrollToY = function () {
|
|
193
93
|
return moduleWrapper.current.functions.scrollToY(...arguments);
|
|
194
94
|
};
|
|
195
|
-
/**
|
|
196
|
-
* Sends intercom message to group.
|
|
197
|
-
*/
|
|
198
95
|
export const sendMessageToGroup = function () {
|
|
199
96
|
return moduleWrapper.current.functions.sendMessageToGroup(...arguments);
|
|
200
97
|
};
|
|
201
|
-
/**
|
|
202
|
-
* Sends intercom message to page.
|
|
203
|
-
*/
|
|
204
98
|
export const sendMessageToPage = function () {
|
|
205
99
|
return moduleWrapper.current.functions.sendMessageToPage(...arguments);
|
|
206
100
|
};
|
|
207
|
-
/**
|
|
208
|
-
* Sends intercom message to an user.
|
|
209
|
-
*/
|
|
210
101
|
export const sendMessageToUser = function () {
|
|
211
102
|
return moduleWrapper.current.functions.sendMessageToUser(...arguments);
|
|
212
103
|
};
|
|
213
|
-
/**
|
|
214
|
-
* Switches admin mode, also toggles admin switch in top frame.
|
|
215
|
-
*/
|
|
216
104
|
export const setAdminMode = function () {
|
|
217
105
|
return moduleWrapper.current.functions.setAdminMode(...arguments);
|
|
218
106
|
};
|
|
219
|
-
/**
|
|
220
|
-
* Sets the display timeout, only works in chayns App.
|
|
221
|
-
*/
|
|
222
107
|
export const setDisplayTimeout = function () {
|
|
223
108
|
return moduleWrapper.current.functions.setDisplayTimeout(...arguments);
|
|
224
109
|
};
|
|
225
|
-
/**
|
|
226
|
-
* Enables or disables a button which floats over the page.
|
|
227
|
-
*/
|
|
228
110
|
export const setFloatingButton = function () {
|
|
229
111
|
return moduleWrapper.current.functions.setFloatingButton(...arguments);
|
|
230
112
|
};
|
|
231
|
-
/**
|
|
232
|
-
* Sets the height of the page.
|
|
233
|
-
*/
|
|
234
113
|
export const setHeight = function () {
|
|
235
114
|
return moduleWrapper.current.functions.setHeight(...arguments);
|
|
236
115
|
};
|
|
237
|
-
/**
|
|
238
|
-
* Enables or disables the ability to refresh a page
|
|
239
|
-
*/
|
|
240
116
|
export const setRefreshScrollEnabled = function () {
|
|
241
117
|
return moduleWrapper.current.functions.setRefreshScrollEnabled(...arguments);
|
|
242
118
|
};
|
|
243
|
-
/**
|
|
244
|
-
* Scans a qr-code and returns the result
|
|
245
|
-
*/
|
|
246
119
|
export const setScanQrCode = function () {
|
|
247
120
|
return moduleWrapper.current.functions.setScanQrCode(...arguments);
|
|
248
121
|
};
|
|
249
|
-
/**
|
|
250
|
-
* Temporarily change design settings in top frame
|
|
251
|
-
*/
|
|
252
122
|
export const setTempDesignSettings = function () {
|
|
253
123
|
return moduleWrapper.current.functions.setTempDesignSettings(...arguments);
|
|
254
124
|
};
|
|
255
|
-
/**
|
|
256
|
-
* Shows or hide a waitcursor
|
|
257
|
-
*/
|
|
258
125
|
export const setWaitCursor = function () {
|
|
259
126
|
return moduleWrapper.current.functions.setWaitCursor(...arguments);
|
|
260
127
|
};
|
|
261
|
-
/**
|
|
262
|
-
* Retrieves the value that is assigned to the key from a storage outside the frame
|
|
263
|
-
*/
|
|
264
128
|
export const storageGetItem = function () {
|
|
265
129
|
return moduleWrapper.current.functions.storageGetItem(...arguments);
|
|
266
130
|
};
|
|
267
|
-
/**
|
|
268
|
-
* Removes the value that is assigned to the key from a storage outside the frame
|
|
269
|
-
*/
|
|
270
131
|
export const storageRemoveItem = function () {
|
|
271
132
|
return moduleWrapper.current.functions.storageRemoveItem(...arguments);
|
|
272
133
|
};
|
|
273
|
-
/**
|
|
274
|
-
* Sets the value that is assigned to the key from a storage outside the frame
|
|
275
|
-
*/
|
|
276
134
|
export const storageSetItem = function () {
|
|
277
135
|
return moduleWrapper.current.functions.storageSetItem(...arguments);
|
|
278
136
|
};
|
|
279
|
-
/**
|
|
280
|
-
* This method lets a smartphone vibrate for the given time.
|
|
281
|
-
*/
|
|
282
137
|
export const vibrate = function () {
|
|
283
138
|
return moduleWrapper.current.functions.vibrate(...arguments);
|
|
284
139
|
};
|
|
285
|
-
|
|
286
|
-
/**
|
|
287
|
-
* This method creates a dialog
|
|
288
|
-
*/
|
|
289
|
-
// @ts-ignore
|
|
290
140
|
export const createDialog = config => moduleWrapper.current.functions.createDialog(config);
|
|
291
|
-
/**
|
|
292
|
-
* Displays an overlay
|
|
293
|
-
*/
|
|
294
141
|
export const setOverlay = function () {
|
|
295
142
|
return moduleWrapper.current.functions.setOverlay(...arguments);
|
|
296
143
|
};
|
|
297
|
-
|
|
298
|
-
/**
|
|
299
|
-
* Generates a temp accesstoken, only valid for short period of time (~3 days), works only when no user is logged in
|
|
300
|
-
*/
|
|
301
144
|
export const addAnonymousAccount = () => moduleWrapper.current.functions.addAnonymousAccount();
|
|
302
|
-
/**
|
|
303
|
-
* Returns user information, only when user is logged in
|
|
304
|
-
* @category User functions
|
|
305
|
-
*/
|
|
306
145
|
export const getUser = () => moduleWrapper.current.values.user;
|
|
307
146
|
export const getSite = () => moduleWrapper.current.values.site;
|
|
308
147
|
export const getCurrentPage = () => moduleWrapper.current.values.currentPage;
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
const INTERCOM_URL = 'https://sub54.tobit.com/rest/api';
|
|
2
|
-
/**
|
|
3
|
-
* @category Intercom functions
|
|
4
|
-
*/
|
|
5
2
|
export const sendMessageToUser = async (api, object, receiverUserId) => {
|
|
6
3
|
var _api$values$user;
|
|
7
4
|
if (!object.text) {
|
|
@@ -34,9 +31,6 @@ export const sendMessageToUser = async (api, object, receiverUserId) => {
|
|
|
34
31
|
}
|
|
35
32
|
});
|
|
36
33
|
};
|
|
37
|
-
/**
|
|
38
|
-
* @category Intercom functions
|
|
39
|
-
*/
|
|
40
34
|
export const sendMessageToPage = async (api, object) => {
|
|
41
35
|
var _api$values$user2;
|
|
42
36
|
if (!object.text) {
|
|
@@ -66,9 +60,6 @@ export const sendMessageToPage = async (api, object) => {
|
|
|
66
60
|
}
|
|
67
61
|
});
|
|
68
62
|
};
|
|
69
|
-
/**
|
|
70
|
-
* @category Intercom functions
|
|
71
|
-
*/
|
|
72
63
|
export const sendMessageToGroup = async (api, object, groupId) => {
|
|
73
64
|
if (!object.text) {
|
|
74
65
|
return Promise.reject(new Error('no text specified'));
|
|
@@ -96,9 +87,6 @@ export const sendMessageToGroup = async (api, object, groupId) => {
|
|
|
96
87
|
}
|
|
97
88
|
});
|
|
98
89
|
};
|
|
99
|
-
/**
|
|
100
|
-
* @category Intercom functions
|
|
101
|
-
*/
|
|
102
90
|
function sendMessage(endpoint, token, body) {
|
|
103
91
|
return fetch(`${INTERCOM_URL}${endpoint}`, {
|
|
104
92
|
method: 'POST',
|
|
@@ -5,10 +5,6 @@ const handleVisibilityChange = () => {
|
|
|
5
5
|
isVisible: !document.hidden
|
|
6
6
|
});
|
|
7
7
|
};
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* @category Event listener
|
|
11
|
-
*/
|
|
12
8
|
export const addVisibilityChangeListener = callback => {
|
|
13
9
|
const {
|
|
14
10
|
id,
|
|
@@ -19,9 +15,6 @@ export const addVisibilityChangeListener = callback => {
|
|
|
19
15
|
}
|
|
20
16
|
return id;
|
|
21
17
|
};
|
|
22
|
-
/**
|
|
23
|
-
* @category Event listener
|
|
24
|
-
*/
|
|
25
18
|
export const removeVisibilityChangeListener = id => {
|
|
26
19
|
const shouldRemove = removeApiListener(key, id);
|
|
27
20
|
if (shouldRemove) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
1
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
2
|
import React, { useEffect, useState } from 'react';
|
|
3
3
|
import ChaynsHost from '../host/ChaynsHost';
|
|
4
4
|
import { useFunctions, useValues } from '../hooks';
|
|
@@ -19,7 +19,7 @@ const AppDialogWrapper = _ref => {
|
|
|
19
19
|
});
|
|
20
20
|
});
|
|
21
21
|
}, []);
|
|
22
|
-
return
|
|
22
|
+
return React.createElement(ErrorBoundary, null, React.createElement(ChaynsHost, _extends({
|
|
23
23
|
type: "client-module",
|
|
24
24
|
system: {
|
|
25
25
|
module: './AppWrapper',
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createContext } from 'react';
|
|
2
|
-
export const ChaynsContext =
|
|
2
|
+
export const ChaynsContext = createContext(null);
|
|
@@ -8,11 +8,8 @@ import { ModuleFederationWrapper } from '../wrapper/ModuleFederationWrapper';
|
|
|
8
8
|
import { SsrWrapper } from '../wrapper/SsrWrapper';
|
|
9
9
|
import { ChaynsContext } from './ChaynsContext';
|
|
10
10
|
import { moduleWrapper } from './moduleWrapper';
|
|
11
|
-
|
|
12
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
13
|
-
|
|
14
11
|
const isServer = typeof window === 'undefined';
|
|
15
|
-
const InitialDataProvider =
|
|
12
|
+
const InitialDataProvider = React.memo(_ref => {
|
|
16
13
|
let {
|
|
17
14
|
data,
|
|
18
15
|
renderedByServer
|
|
@@ -20,7 +17,7 @@ const InitialDataProvider = /*#__PURE__*/React.memo(_ref => {
|
|
|
20
17
|
if (!renderedByServer) {
|
|
21
18
|
return null;
|
|
22
19
|
}
|
|
23
|
-
return
|
|
20
|
+
return React.createElement("script", {
|
|
24
21
|
id: "__CHAYNS_DATA__",
|
|
25
22
|
type: "application/json",
|
|
26
23
|
dangerouslySetInnerHTML: {
|
|
@@ -37,7 +34,6 @@ const ChaynsProvider = _ref2 => {
|
|
|
37
34
|
renderedByServer,
|
|
38
35
|
isModule
|
|
39
36
|
} = _ref2;
|
|
40
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
41
37
|
const customWrapper = useRef(null);
|
|
42
38
|
if (!customWrapper.current) {
|
|
43
39
|
if (isModule) {
|
|
@@ -55,8 +51,7 @@ const ChaynsProvider = _ref2 => {
|
|
|
55
51
|
} else {
|
|
56
52
|
var _deviceInfo$app$name, _deviceInfo$app;
|
|
57
53
|
const deviceInfo = getDeviceInfo(navigator.userAgent, '');
|
|
58
|
-
|
|
59
|
-
if ([AppName.Chayns, AppName.ChaynsLauncher, AppName.Sidekick, AppName.TobitChat].includes((_deviceInfo$app$name = (_deviceInfo$app = deviceInfo.app) === null || _deviceInfo$app === void 0 ? void 0 : _deviceInfo$app.name) !== null && _deviceInfo$app$name !== void 0 ? _deviceInfo$app$name : AppName.Unknown) && window.self === window.top) {
|
|
54
|
+
if ([AppName.Chayns, AppName.ChaynsLauncher, AppName.Sidekick, AppName.TobitChat, AppName.Team].includes((_deviceInfo$app$name = (_deviceInfo$app = deviceInfo.app) === null || _deviceInfo$app === void 0 ? void 0 : _deviceInfo$app.name) !== null && _deviceInfo$app$name !== void 0 ? _deviceInfo$app$name : AppName.Unknown) && window.self === window.top) {
|
|
60
55
|
customWrapper.current = new AppWrapper();
|
|
61
56
|
} else {
|
|
62
57
|
customWrapper.current = new FrameWrapper();
|
|
@@ -88,9 +83,9 @@ const ChaynsProvider = _ref2 => {
|
|
|
88
83
|
}
|
|
89
84
|
}
|
|
90
85
|
}, [data, isModule]);
|
|
91
|
-
return
|
|
86
|
+
return React.createElement(React.Fragment, null, isInitialized && React.createElement(ChaynsContext.Provider, {
|
|
92
87
|
value: customWrapper.current
|
|
93
|
-
}, children),
|
|
88
|
+
}, children), React.createElement(InitialDataProvider, {
|
|
94
89
|
data: (_customWrapper$curren2 = customWrapper.current) === null || _customWrapper$curren2 === void 0 ? void 0 : _customWrapper$curren2.values,
|
|
95
90
|
renderedByServer: renderedByServer
|
|
96
91
|
}));
|
|
@@ -3,10 +3,8 @@ const handleTasks = async tasks => {
|
|
|
3
3
|
for (let i = 0; i < tasks.length; i++) {
|
|
4
4
|
const task = tasks[i];
|
|
5
5
|
if (Array.isArray(task)) {
|
|
6
|
-
// eslint-disable-next-line no-await-in-loop
|
|
7
6
|
await Promise.allSettled(task.map(t => Array.isArray(t) ? handleTasks(t) : typeof t === 'function' ? t() : t));
|
|
8
7
|
} else {
|
|
9
|
-
// eslint-disable-next-line no-await-in-loop
|
|
10
8
|
await (typeof task === 'function' ? task() : task).catch(() => {});
|
|
11
9
|
}
|
|
12
10
|
}
|
|
@@ -1,31 +1,26 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
2
|
-
/* eslint-disable react/jsx-props-no-spreading */
|
|
3
|
-
|
|
1
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
4
2
|
import React, { PureComponent } from 'react';
|
|
5
3
|
import ReactDOM from 'react-dom';
|
|
6
4
|
import ErrorBoundary from './ErrorBoundary';
|
|
7
5
|
let ReactDOMClient;
|
|
8
6
|
try {
|
|
9
7
|
ReactDOMClient = require('react-dom/client');
|
|
10
|
-
} catch (e) {
|
|
11
|
-
// do nothing
|
|
12
|
-
}
|
|
8
|
+
} catch (e) {}
|
|
13
9
|
export const withCompatMode = Component => {
|
|
14
10
|
class CompatComponent extends PureComponent {
|
|
15
11
|
constructor(props) {
|
|
16
12
|
super(props);
|
|
17
|
-
this.ref =
|
|
13
|
+
this.ref = React.createRef();
|
|
18
14
|
}
|
|
19
15
|
componentDidMount() {
|
|
20
16
|
var _ReactDOMClient;
|
|
21
17
|
const {
|
|
22
18
|
innerRef
|
|
23
19
|
} = this.props;
|
|
24
|
-
const component =
|
|
20
|
+
const component = React.createElement(ErrorBoundary, null, React.createElement(Component, _extends({}, this.props, {
|
|
25
21
|
ref: innerRef
|
|
26
22
|
})));
|
|
27
23
|
if (typeof ((_ReactDOMClient = ReactDOMClient) === null || _ReactDOMClient === void 0 ? void 0 : _ReactDOMClient.createRoot) === 'function') {
|
|
28
|
-
// TODO: use non-random value
|
|
29
24
|
this.root = ReactDOMClient.createRoot(this.ref.current, {
|
|
30
25
|
identifierPrefix: crypto.randomUUID()
|
|
31
26
|
});
|
|
@@ -38,7 +33,7 @@ export const withCompatMode = Component => {
|
|
|
38
33
|
const {
|
|
39
34
|
innerRef
|
|
40
35
|
} = this.props;
|
|
41
|
-
const component =
|
|
36
|
+
const component = React.createElement(ErrorBoundary, null, React.createElement(Component, _extends({}, this.props, {
|
|
42
37
|
ref: innerRef
|
|
43
38
|
})));
|
|
44
39
|
clearTimeout(this.timeout);
|
|
@@ -54,19 +49,18 @@ export const withCompatMode = Component => {
|
|
|
54
49
|
if (this.root) {
|
|
55
50
|
this.root.unmount();
|
|
56
51
|
} else {
|
|
57
|
-
ReactDOM.render(
|
|
52
|
+
ReactDOM.render(React.createElement(React.Fragment, null), this.ref.current);
|
|
58
53
|
}
|
|
59
54
|
}
|
|
60
55
|
render() {
|
|
61
|
-
return
|
|
56
|
+
return React.createElement("div", {
|
|
62
57
|
ref: this.ref
|
|
63
58
|
});
|
|
64
59
|
}
|
|
65
60
|
}
|
|
66
61
|
return {
|
|
67
|
-
Component: props =>
|
|
62
|
+
Component: props => React.createElement("div", null, React.createElement(Component, props)),
|
|
68
63
|
CompatComponent,
|
|
69
|
-
// @ts-expect-error will be set by chayns-toolkit via DefinePlugin
|
|
70
64
|
requiredVersion: __REQUIRED_REACT_VERSION__,
|
|
71
65
|
environment: process.env.NODE_ENV,
|
|
72
66
|
buildEnv: process.env.BUILD_ENV || process.env.NODE_ENV,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
1
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
2
|
import React, { useContext, useEffect, useState } from 'react';
|
|
3
3
|
import { HydrationContext } from '../constants';
|
|
4
4
|
function withHydrationBoundary(Component, initializer, useHydrationId, useProps) {
|
|
@@ -42,7 +42,7 @@ function withHydrationBoundary(Component, initializer, useHydrationId, useProps)
|
|
|
42
42
|
$elem.remove();
|
|
43
43
|
}
|
|
44
44
|
}, []);
|
|
45
|
-
return
|
|
45
|
+
return React.createElement(Component, _extends({}, rest, {
|
|
46
46
|
value: store
|
|
47
47
|
}), children);
|
|
48
48
|
};
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { createContext } from 'react';
|
|
2
2
|
export let HydrationContext;
|
|
3
|
-
|
|
4
|
-
// force single context on server-side (fake sharing)
|
|
5
3
|
if (!globalThis.window && globalThis._hydrationContext) {
|
|
6
4
|
HydrationContext = globalThis._hydrationContext;
|
|
7
5
|
} else {
|
|
8
|
-
HydrationContext =
|
|
6
|
+
HydrationContext = createContext({});
|
|
9
7
|
globalThis._hydrationContext = HydrationContext;
|
|
10
8
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export let DeviceLanguage =
|
|
1
|
+
export let DeviceLanguage = function (DeviceLanguage) {
|
|
2
2
|
DeviceLanguage[DeviceLanguage["de"] = 1] = "de";
|
|
3
3
|
DeviceLanguage[DeviceLanguage["en"] = 2] = "en";
|
|
4
4
|
DeviceLanguage[DeviceLanguage["fr"] = 3] = "fr";
|