chayns-api 1.1.0-2 → 1.1.0-4
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/calls/dialogs/chaynsDialog.js +3 -6
- package/dist/cjs/calls/dialogs/date.js +29 -2
- package/dist/cjs/calls/dialogs/fileSelect.js +1 -2
- package/dist/cjs/calls/dialogs/input.js +2 -3
- package/dist/cjs/calls/dialogs/select.js +2 -3
- package/dist/cjs/calls/getUserInfo.js +1 -2
- package/dist/cjs/calls/index.js +93 -82
- package/dist/cjs/components/AppDialogWrapper.js +7 -7
- package/dist/cjs/components/ChaynsContext.js +2 -4
- package/dist/cjs/components/ChaynsProvider.js +10 -13
- package/dist/cjs/components/ErrorBoundary.js +31 -0
- package/dist/cjs/components/moduleWrapper.js +9 -0
- package/dist/cjs/components/withCompatMode.js +8 -7
- package/dist/cjs/components/withHydrationBoundary.js +57 -0
- package/dist/cjs/constants/hydrationContext.js +16 -0
- package/dist/cjs/constants/index.js +16 -0
- package/dist/cjs/handler/DialogHandler.js +4 -2
- package/dist/cjs/hooks/useAccessToken.js +1 -0
- package/dist/cjs/hooks/useDialogState.js +2 -2
- package/dist/cjs/hooks/usePages.js +2 -2
- package/dist/cjs/host/ChaynsHost.js +1 -2
- package/dist/cjs/host/iframe/HostIframe.js +4 -6
- package/dist/cjs/host/iframe/utils/useUpdateData.js +1 -2
- package/dist/cjs/host/module/ModuleHost.js +8 -24
- package/dist/cjs/host/module/utils/loadComponent.js +58 -51
- package/dist/cjs/index.js +48 -5
- package/dist/cjs/types/IChaynsReact.js +140 -107
- package/dist/cjs/util/appCall.js +3 -4
- package/dist/cjs/util/deviceHelper.js +18 -13
- package/dist/cjs/util/transferNestedFunctions.js +36 -0
- package/dist/cjs/wrapper/AppWrapper.js +69 -11
- package/dist/cjs/wrapper/FrameWrapper.js +16 -5
- package/dist/cjs/wrapper/StaticChaynsApi.js +22 -0
- package/dist/esm/calls/index.js +22 -1
- package/dist/esm/components/AppDialogWrapper.js +4 -3
- package/dist/esm/components/ChaynsProvider.js +6 -7
- package/dist/esm/components/ErrorBoundary.js +23 -0
- package/dist/esm/components/moduleWrapper.js +3 -0
- package/dist/esm/components/withCompatMode.js +5 -4
- package/dist/esm/components/withHydrationBoundary.js +50 -0
- package/dist/esm/constants/hydrationContext.js +10 -0
- package/dist/esm/constants/index.js +1 -0
- package/dist/esm/handler/DialogHandler.js +6 -4
- package/dist/esm/hooks/useAccessToken.js +1 -0
- package/dist/esm/hooks/useDialogState.js +2 -2
- package/dist/esm/hooks/usePages.js +1 -1
- package/dist/esm/host/iframe/HostIframe.js +1 -2
- package/dist/esm/host/module/ModuleHost.js +5 -20
- package/dist/esm/host/module/utils/loadComponent.js +58 -50
- package/dist/esm/index.js +6 -1
- package/dist/esm/types/IChaynsReact.js +142 -87
- package/dist/esm/util/appCall.js +2 -2
- package/dist/esm/util/deviceHelper.js +17 -11
- package/dist/esm/util/transferNestedFunctions.js +32 -0
- package/dist/esm/wrapper/AppWrapper.js +70 -11
- package/dist/esm/wrapper/FrameWrapper.js +16 -5
- package/dist/esm/wrapper/StaticChaynsApi.js +20 -0
- package/dist/types/calls/index.d.ts +19 -5
- package/dist/types/components/AppDialogWrapper.d.ts +2 -2
- package/dist/types/components/ChaynsProvider.d.ts +1 -4
- package/dist/types/components/ErrorBoundary.d.ts +13 -0
- package/dist/types/components/moduleWrapper.d.ts +4 -0
- package/dist/types/components/withHydrationBoundary.d.ts +16 -0
- package/dist/types/constants/hydrationContext.d.ts +8 -0
- package/dist/types/constants/index.d.ts +1 -0
- package/dist/types/handler/DialogHandler.d.ts +0 -1
- package/dist/types/hooks/useAccessToken.d.ts +1 -0
- package/dist/types/host/module/ModuleHost.d.ts +1 -0
- package/dist/types/host/module/utils/loadComponent.d.ts +1 -1
- package/dist/types/index.d.ts +6 -1
- package/dist/types/types/IChaynsReact.d.ts +136 -28
- package/dist/types/util/deviceHelper.d.ts +2 -2
- package/dist/types/util/transferNestedFunctions.d.ts +1 -0
- package/dist/types/wrapper/StaticChaynsApi.d.ts +9 -0
- package/package.json +26 -22
- package/toolkit.config.js +20 -0
|
@@ -8,7 +8,7 @@ exports.chaynsDialog = chaynsDialog;
|
|
|
8
8
|
exports.dialogAction = void 0;
|
|
9
9
|
var _open = require("./open");
|
|
10
10
|
var _callback = require("./utils/callback");
|
|
11
|
-
const buttonText = {
|
|
11
|
+
const buttonText = exports.buttonText = {
|
|
12
12
|
'YES': {
|
|
13
13
|
'de': 'Ja',
|
|
14
14
|
'en': 'Yes',
|
|
@@ -27,14 +27,12 @@ const buttonText = {
|
|
|
27
27
|
'nl': 'Annuleren'
|
|
28
28
|
}['de'] || 'Cancel'
|
|
29
29
|
};
|
|
30
|
-
exports.
|
|
31
|
-
const buttonType = {
|
|
30
|
+
const buttonType = exports.buttonType = {
|
|
32
31
|
'CANCEL': -1,
|
|
33
32
|
'NEGATIVE': 0,
|
|
34
33
|
'POSITIVE': 1
|
|
35
34
|
};
|
|
36
|
-
exports.
|
|
37
|
-
const dialogAction = {
|
|
35
|
+
const dialogAction = exports.dialogAction = {
|
|
38
36
|
'ALERT_CONFIRM': 178,
|
|
39
37
|
'INPUT': 173,
|
|
40
38
|
'SELECT': 174,
|
|
@@ -46,7 +44,6 @@ const dialogAction = {
|
|
|
46
44
|
'SIGNATURE': 181,
|
|
47
45
|
'IFRAME': 191
|
|
48
46
|
};
|
|
49
|
-
exports.dialogAction = dialogAction;
|
|
50
47
|
function chaynsDialog(config) {
|
|
51
48
|
const callbackName = 'chaynsDialog';
|
|
52
49
|
config.callback = (0, _callback.getCallbackName)(callbackName);
|
|
@@ -10,6 +10,34 @@ var _chaynsDialog = require("./chaynsDialog");
|
|
|
10
10
|
var _is = require("./utils/is");
|
|
11
11
|
var _open = require("./open");
|
|
12
12
|
var _index = require("../index");
|
|
13
|
+
/**
|
|
14
|
+
* The config object for date dialog
|
|
15
|
+
* @typedef {Object} dateConfig
|
|
16
|
+
* @property {Date} preSelect - The date object which should be preselected.
|
|
17
|
+
* @property {Date} minDate - The min date which you could select.
|
|
18
|
+
* @property {Date} maxDate - The max date which you could select.
|
|
19
|
+
* @property {dateDialogType} dateType - The type of dialog you want to display.
|
|
20
|
+
* @property {number} minuteIntervall - The interval for special minutes, possible are 2, 3, 4, 5, 6, 12, 15, 20, 30. Default is 1.
|
|
21
|
+
* @property {string} message - The message that is displayed above the date dialog, only in apps supported
|
|
22
|
+
* @property {string} title - The title that is displayed above the message, only in apps supported
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* This call will open a date select dialog.
|
|
27
|
+
* <div>Call: 30</div>
|
|
28
|
+
* @param {dateConfig} config - Define the configuration of this call
|
|
29
|
+
* @return {Promise} contains a timestamp as result
|
|
30
|
+
* @example chayns.dialog.date({
|
|
31
|
+
* 'dateType': chayns.dialog.dateType.DATE_TIME,
|
|
32
|
+
* 'preSelect': new Date(2018, 6, 14, 0, 0, 0),
|
|
33
|
+
* 'minDate': new Date(2018, 6, 1, 15, 0, 0),
|
|
34
|
+
* 'maxDate': new Date(2019, 6, 1, 0, 23, 0),
|
|
35
|
+
* 'minuteInterval': 15
|
|
36
|
+
* ).then(function (data) {
|
|
37
|
+
* console.log(data);
|
|
38
|
+
* });
|
|
39
|
+
*/
|
|
40
|
+
|
|
13
41
|
function date(config = {}) {
|
|
14
42
|
let {
|
|
15
43
|
preSelect,
|
|
@@ -155,12 +183,11 @@ function advancedDate(config = {}) {
|
|
|
155
183
|
* @enum {dateDialogType}
|
|
156
184
|
* @type {{DATE: number, TIME: number, DATE_TIME: number}}
|
|
157
185
|
*/
|
|
158
|
-
const dateType = {
|
|
186
|
+
const dateType = exports.dateType = {
|
|
159
187
|
'DATE': 1,
|
|
160
188
|
'TIME': 2,
|
|
161
189
|
'DATE_TIME': 3
|
|
162
190
|
};
|
|
163
|
-
exports.dateType = dateType;
|
|
164
191
|
function validateValue(value) {
|
|
165
192
|
if (!(0, _is.isNumber)(value)) {
|
|
166
193
|
if ((0, _is.isDate)(value)) {
|
|
@@ -8,13 +8,12 @@ exports.fileType = void 0;
|
|
|
8
8
|
var _chaynsDialog = require("./chaynsDialog");
|
|
9
9
|
var _open = require("./open");
|
|
10
10
|
var _index = require("../index");
|
|
11
|
-
const fileType = {
|
|
11
|
+
const fileType = exports.fileType = {
|
|
12
12
|
'IMAGE': 'image',
|
|
13
13
|
'VIDEO': 'video',
|
|
14
14
|
'AUDIO': 'audio',
|
|
15
15
|
'DOCUMENT': ['application/x-latex', 'application/x-tex', 'text/', 'application/json', 'application/pdf', 'application/msword', 'application/msexcel', 'application/mspowerpoint', 'application/vnd.ms-word', 'application/vnd.ms-excel', 'application/vnd.ms-powerpoint', 'application/vnd.openxmlformats-officedocument', 'application/vnd.oasis.opendocument']
|
|
16
16
|
};
|
|
17
|
-
exports.fileType = fileType;
|
|
18
17
|
async function fileSelect(dialog = {}) {
|
|
19
18
|
if (!dialog.buttons || !Array.isArray(dialog.buttons)) {
|
|
20
19
|
dialog.buttons = [];
|
|
@@ -23,11 +23,10 @@ function input(dialog = {}) {
|
|
|
23
23
|
dialog.callType = _chaynsDialog.dialogAction.INPUT;
|
|
24
24
|
return (0, _open.open)(dialog);
|
|
25
25
|
}
|
|
26
|
-
const inputType = {
|
|
26
|
+
const inputType = exports.inputType = {
|
|
27
27
|
'DEFAULT': 0,
|
|
28
28
|
'PASSWORD': 1,
|
|
29
29
|
'TEXTAREA': 2,
|
|
30
30
|
'INPUT': 3,
|
|
31
31
|
'NUMBER': 4
|
|
32
|
-
};
|
|
33
|
-
exports.inputType = inputType;
|
|
32
|
+
};
|
package/dist/cjs/calls/index.js
CHANGED
|
@@ -3,310 +3,321 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.vibrate = exports.user = exports.storageSetItem = exports.storageRemoveItem = exports.storageGetItem = exports.site = exports.setWaitCursor = exports.setTempDesignSettings = exports.setScanQrCode = exports.setRefreshScrollEnabled = exports.setOverlay = exports.setHeight = exports.setFloatingButton = exports.setDisplayTimeout = exports.setAdminMode = exports.sendMessageToUser = exports.sendMessageToPage = exports.sendMessageToGroup = exports.selectPage = exports.scrollToY = exports.scrollByY = exports.removeWindowMetricsListener = exports.removeVisibilityChangeListener = exports.removeScrollListener = exports.removeGeoLocationListener = exports.refreshData = exports.refreshAccessToken = exports.parameters = exports.pages = exports.openVideo = exports.openUrl = exports.openImage = exports.navigateBack = exports.logout = exports.login = exports.language = exports.invokeDialogCall = exports.invokeCall = exports.getWindowMetrics = exports.getUserInfo = exports.getUser = exports.getSite = exports.getScrollPosition = exports.getParameters = exports.getPages = exports.getLanguage = exports.getGeoLocation = exports.getEnvironment = exports.getDevice = exports.getCurrentPage = exports.getAvailableSharingServices = exports.getAccessToken = exports.environment = exports.device = exports.customCallbackFunction = exports.createDialog = exports.addWindowMetricsListener = exports.addVisibilityChangeListener = exports.addScrollListener = exports.addGeoLocationListener = void 0;
|
|
7
|
-
var
|
|
6
|
+
exports.vibrate = exports.user = exports.storageSetItem = exports.storageRemoveItem = exports.storageGetItem = exports.site = exports.setWaitCursor = exports.setTempDesignSettings = exports.setScanQrCode = exports.setRefreshScrollEnabled = exports.setOverlay = exports.setHeight = exports.setFloatingButton = exports.setDisplayTimeout = exports.setAdminMode = exports.sendMessageToUser = exports.sendMessageToPage = exports.sendMessageToGroup = exports.selectPage = exports.scrollToY = exports.scrollByY = exports.removeWindowMetricsListener = exports.removeVisibilityChangeListener = exports.removeToolbarChangeListener = exports.removeScrollListener = exports.removeGeoLocationListener = exports.refreshData = exports.refreshAccessToken = exports.parameters = exports.pages = exports.openVideo = exports.openUrl = exports.openMedia = exports.openImage = exports.navigateBack = exports.logout = exports.login = exports.language = exports.invokeDialogCall = exports.invokeCall = exports.getWindowMetrics = exports.getUserInfo = exports.getUser = exports.getSite = exports.getScrollPosition = exports.getParameters = exports.getPages = exports.getLanguage = exports.getGeoLocation = exports.getEnvironment = exports.getDevice = exports.getCurrentPage = exports.getAvailableSharingServices = exports.getAccessToken = exports.environment = exports.device = exports.customCallbackFunction = exports.createDialog = exports.addWindowMetricsListener = exports.addVisibilityChangeListener = exports.addToolbarChangeListener = exports.addScrollListener = exports.addGeoLocationListener = void 0;
|
|
7
|
+
var _moduleWrapper = require("../components/moduleWrapper");
|
|
8
8
|
/**
|
|
9
9
|
* This adds a listener to determine your location.
|
|
10
10
|
* @category Event listener
|
|
11
11
|
*/
|
|
12
|
-
const addGeoLocationListener = (...args) =>
|
|
12
|
+
const addGeoLocationListener = (...args) => _moduleWrapper.moduleWrapper.current.functions.addGeoLocationListener(...args);
|
|
13
13
|
/**
|
|
14
14
|
* Adds a listener for scroll event by user.
|
|
15
15
|
* @category Event listener
|
|
16
16
|
*/
|
|
17
17
|
exports.addGeoLocationListener = addGeoLocationListener;
|
|
18
|
-
const addScrollListener = (...args) =>
|
|
18
|
+
const addScrollListener = (...args) => _moduleWrapper.moduleWrapper.current.functions.addScrollListener(...args);
|
|
19
19
|
/**
|
|
20
20
|
* This method will be executed when the page gets displayed or hidden.
|
|
21
21
|
* @category Event listener
|
|
22
22
|
*/
|
|
23
23
|
exports.addScrollListener = addScrollListener;
|
|
24
|
-
const addVisibilityChangeListener = (...args) =>
|
|
24
|
+
const addVisibilityChangeListener = (...args) => _moduleWrapper.moduleWrapper.current.functions.addVisibilityChangeListener(...args);
|
|
25
25
|
/**
|
|
26
|
-
* This
|
|
26
|
+
* This method will be executed when the toolbar gets displayed or hidden.
|
|
27
27
|
* @category Event listener
|
|
28
28
|
*/
|
|
29
29
|
exports.addVisibilityChangeListener = addVisibilityChangeListener;
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
const addToolbarChangeListener = (...args) => _moduleWrapper.moduleWrapper.current.functions.addToolbarChangeListener(...args);
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* This adds a listener to get the actual height of the page.
|
|
34
|
+
* @category Event listener
|
|
35
|
+
*/
|
|
36
|
+
exports.addToolbarChangeListener = addToolbarChangeListener;
|
|
37
|
+
const addWindowMetricsListener = (...args) => _moduleWrapper.moduleWrapper.current.functions.addWindowMetricsListener(...args); /**
|
|
38
|
+
* Allows a custom callback function to be defined
|
|
39
|
+
*/
|
|
33
40
|
exports.addWindowMetricsListener = addWindowMetricsListener;
|
|
34
|
-
const customCallbackFunction = (...args) =>
|
|
41
|
+
const customCallbackFunction = (...args) => _moduleWrapper.moduleWrapper.current.functions.customCallbackFunction(...args);
|
|
35
42
|
/**
|
|
36
43
|
* Get the accessToken from the user.
|
|
37
44
|
*/
|
|
38
45
|
exports.customCallbackFunction = customCallbackFunction;
|
|
39
|
-
const getAccessToken = (...args) =>
|
|
46
|
+
const getAccessToken = (...args) => _moduleWrapper.moduleWrapper.current.functions.getAccessToken(...args);
|
|
40
47
|
/**
|
|
41
48
|
* This method returns a list of installed share/social media apps.
|
|
42
49
|
*/
|
|
43
50
|
exports.getAccessToken = getAccessToken;
|
|
44
|
-
const getAvailableSharingServices = (...args) =>
|
|
51
|
+
const getAvailableSharingServices = (...args) => _moduleWrapper.moduleWrapper.current.functions.getAvailableSharingServices(...args);
|
|
45
52
|
/**
|
|
46
53
|
* This method determines your location. If you want to track a route, use addGeoLocationListener.
|
|
47
54
|
*/
|
|
48
55
|
exports.getAvailableSharingServices = getAvailableSharingServices;
|
|
49
|
-
const getGeoLocation = (...args) =>
|
|
56
|
+
const getGeoLocation = (...args) => _moduleWrapper.moduleWrapper.current.functions.getGeoLocation(...args);
|
|
50
57
|
/**
|
|
51
58
|
* This method returns user information for a specific user.
|
|
52
59
|
* @category User functions
|
|
53
60
|
*/
|
|
54
61
|
exports.getGeoLocation = getGeoLocation;
|
|
55
|
-
const getUserInfo = (...args) =>
|
|
62
|
+
const getUserInfo = (...args) => _moduleWrapper.moduleWrapper.current.functions.getUserInfo(...args);
|
|
56
63
|
/**
|
|
57
64
|
* Return the current scroll position of the top frame
|
|
58
65
|
*/
|
|
59
66
|
exports.getUserInfo = getUserInfo;
|
|
60
|
-
const getScrollPosition = (...args) =>
|
|
67
|
+
const getScrollPosition = (...args) => _moduleWrapper.moduleWrapper.current.functions.getScrollPosition(...args);
|
|
61
68
|
/**
|
|
62
69
|
* Returns the window metrics.
|
|
63
70
|
*/
|
|
64
71
|
exports.getScrollPosition = getScrollPosition;
|
|
65
|
-
const getWindowMetrics = (...args) =>
|
|
72
|
+
const getWindowMetrics = (...args) => _moduleWrapper.moduleWrapper.current.functions.getWindowMetrics(...args);
|
|
66
73
|
/** @internal */
|
|
67
74
|
exports.getWindowMetrics = getWindowMetrics;
|
|
68
|
-
const invokeCall = (...args) =>
|
|
75
|
+
const invokeCall = (...args) => _moduleWrapper.moduleWrapper.current.functions.invokeCall(...args);
|
|
69
76
|
/** @internal */
|
|
70
77
|
exports.invokeCall = invokeCall;
|
|
71
|
-
const invokeDialogCall = (...args) =>
|
|
78
|
+
const invokeDialogCall = (...args) => _moduleWrapper.moduleWrapper.current.functions.invokeDialogCall(...args);
|
|
72
79
|
/**
|
|
73
80
|
* This method will show a login dialog where the user has the opportunity to log in.
|
|
74
81
|
*/
|
|
75
82
|
exports.invokeDialogCall = invokeDialogCall;
|
|
76
|
-
const login = (...args) =>
|
|
83
|
+
const login = (...args) => _moduleWrapper.moduleWrapper.current.functions.login(...args);
|
|
77
84
|
/**
|
|
78
85
|
* This method will logout the user
|
|
79
86
|
*/
|
|
80
87
|
exports.login = login;
|
|
81
|
-
const logout = (...args) =>
|
|
88
|
+
const logout = (...args) => _moduleWrapper.moduleWrapper.current.functions.logout(...args);
|
|
82
89
|
/**
|
|
83
90
|
* This function navigates you to the previous site.
|
|
84
91
|
*/
|
|
85
92
|
exports.logout = logout;
|
|
86
|
-
const navigateBack = (...args) =>
|
|
93
|
+
const navigateBack = (...args) => _moduleWrapper.moduleWrapper.current.functions.navigateBack(...args);
|
|
87
94
|
/**
|
|
88
95
|
* The images specified in the url array is shown in gallery mode.
|
|
89
96
|
*/
|
|
90
97
|
exports.navigateBack = navigateBack;
|
|
91
|
-
const openImage = (...args) =>
|
|
98
|
+
const openImage = (...args) => _moduleWrapper.moduleWrapper.current.functions.openImage(...args);
|
|
92
99
|
/**
|
|
93
|
-
*
|
|
100
|
+
* The images and videos specified in the items array is shown in gallery mode.
|
|
94
101
|
*/
|
|
95
102
|
exports.openImage = openImage;
|
|
96
|
-
const
|
|
103
|
+
const openMedia = (...args) => _moduleWrapper.moduleWrapper.current.functions.openMedia(...args);
|
|
104
|
+
/**
|
|
105
|
+
* Opens an URL in the chayns environment.
|
|
106
|
+
*/
|
|
107
|
+
exports.openMedia = openMedia;
|
|
108
|
+
const openUrl = (...args) => _moduleWrapper.moduleWrapper.current.functions.openUrl(...args);
|
|
97
109
|
/**
|
|
98
110
|
* The video specified in the URL is shown in video mode.
|
|
99
111
|
*/
|
|
100
112
|
exports.openUrl = openUrl;
|
|
101
|
-
const openVideo = (...args) =>
|
|
113
|
+
const openVideo = (...args) => _moduleWrapper.moduleWrapper.current.functions.openVideo(...args);
|
|
102
114
|
/**
|
|
103
115
|
* Refresh badge count in navigation, user information and pages
|
|
104
116
|
*/
|
|
105
117
|
exports.openVideo = openVideo;
|
|
106
|
-
const refreshData = (...args) =>
|
|
118
|
+
const refreshData = (...args) => _moduleWrapper.moduleWrapper.current.functions.refreshData(...args);
|
|
107
119
|
/**
|
|
108
120
|
* Refresh accesstoken, should only be used when user object changes, not when token is invalid
|
|
109
121
|
*/
|
|
110
122
|
exports.refreshData = refreshData;
|
|
111
|
-
const refreshAccessToken = (...args) =>
|
|
123
|
+
const refreshAccessToken = (...args) => _moduleWrapper.moduleWrapper.current.functions.refreshAccessToken(...args);
|
|
112
124
|
/**
|
|
113
125
|
* This removes a listener to determine your location.
|
|
114
126
|
* @category Event listener
|
|
115
127
|
*/
|
|
116
128
|
exports.refreshAccessToken = refreshAccessToken;
|
|
117
|
-
const removeGeoLocationListener = (...args) =>
|
|
129
|
+
const removeGeoLocationListener = (...args) => _moduleWrapper.moduleWrapper.current.functions.removeGeoLocationListener(...args);
|
|
118
130
|
/**
|
|
119
|
-
*
|
|
131
|
+
* This removes a listener for changing toolbar visibility
|
|
120
132
|
* @category Event listener
|
|
121
133
|
*/
|
|
122
134
|
exports.removeGeoLocationListener = removeGeoLocationListener;
|
|
123
|
-
const
|
|
135
|
+
const removeToolbarChangeListener = (...args) => _moduleWrapper.moduleWrapper.current.functions.removeToolbarChangeListener(...args);
|
|
136
|
+
/**
|
|
137
|
+
* Removes scroll listener.
|
|
138
|
+
* @category Event listener
|
|
139
|
+
*/
|
|
140
|
+
exports.removeToolbarChangeListener = removeToolbarChangeListener;
|
|
141
|
+
const removeScrollListener = (...args) => _moduleWrapper.moduleWrapper.current.functions.removeScrollListener(...args);
|
|
124
142
|
/**
|
|
125
143
|
* Removes visibility change listener.
|
|
126
144
|
* @category Event listener
|
|
127
145
|
*/
|
|
128
146
|
exports.removeScrollListener = removeScrollListener;
|
|
129
|
-
const removeVisibilityChangeListener = (...args) =>
|
|
147
|
+
const removeVisibilityChangeListener = (...args) => _moduleWrapper.moduleWrapper.current.functions.removeVisibilityChangeListener(...args);
|
|
130
148
|
/**
|
|
131
149
|
* Removes window metrics listener.
|
|
132
150
|
* @category Event listener
|
|
133
151
|
*/
|
|
134
152
|
exports.removeVisibilityChangeListener = removeVisibilityChangeListener;
|
|
135
|
-
const removeWindowMetricsListener = (...args) =>
|
|
153
|
+
const removeWindowMetricsListener = (...args) => _moduleWrapper.moduleWrapper.current.functions.removeWindowMetricsListener(...args);
|
|
136
154
|
/**
|
|
137
155
|
* Select other page on chayns site.
|
|
138
156
|
*/
|
|
139
157
|
exports.removeWindowMetricsListener = removeWindowMetricsListener;
|
|
140
|
-
const selectPage = (...args) =>
|
|
158
|
+
const selectPage = (...args) => _moduleWrapper.moduleWrapper.current.functions.selectPage(...args);
|
|
141
159
|
/**
|
|
142
160
|
* Scrolls by specific amount.
|
|
143
161
|
*/
|
|
144
162
|
exports.selectPage = selectPage;
|
|
145
|
-
const scrollByY = (...args) =>
|
|
163
|
+
const scrollByY = (...args) => _moduleWrapper.moduleWrapper.current.functions.scrollByY(...args);
|
|
146
164
|
/**
|
|
147
165
|
* Scrolls to specific position.
|
|
148
166
|
*/
|
|
149
167
|
exports.scrollByY = scrollByY;
|
|
150
|
-
const scrollToY = (...args) =>
|
|
168
|
+
const scrollToY = (...args) => _moduleWrapper.moduleWrapper.current.functions.scrollToY(...args);
|
|
151
169
|
/**
|
|
152
170
|
* Sends intercom message to group.
|
|
153
171
|
*/
|
|
154
172
|
exports.scrollToY = scrollToY;
|
|
155
|
-
const sendMessageToGroup = (...args) =>
|
|
173
|
+
const sendMessageToGroup = (...args) => _moduleWrapper.moduleWrapper.current.functions.sendMessageToGroup(...args);
|
|
156
174
|
/**
|
|
157
175
|
* Sends intercom message to page.
|
|
158
176
|
*/
|
|
159
177
|
exports.sendMessageToGroup = sendMessageToGroup;
|
|
160
|
-
const sendMessageToPage = (...args) =>
|
|
178
|
+
const sendMessageToPage = (...args) => _moduleWrapper.moduleWrapper.current.functions.sendMessageToPage(...args);
|
|
161
179
|
/**
|
|
162
180
|
* Sends intercom message to an user.
|
|
163
181
|
*/
|
|
164
182
|
exports.sendMessageToPage = sendMessageToPage;
|
|
165
|
-
const sendMessageToUser = (...args) =>
|
|
183
|
+
const sendMessageToUser = (...args) => _moduleWrapper.moduleWrapper.current.functions.sendMessageToUser(...args);
|
|
166
184
|
/**
|
|
167
185
|
* Switches admin mode, also toggles admin switch in top frame.
|
|
168
186
|
*/
|
|
169
187
|
exports.sendMessageToUser = sendMessageToUser;
|
|
170
|
-
const setAdminMode = (...args) =>
|
|
188
|
+
const setAdminMode = (...args) => _moduleWrapper.moduleWrapper.current.functions.setAdminMode(...args);
|
|
171
189
|
/**
|
|
172
190
|
* Sets the display timeout, only works in chayns App.
|
|
173
191
|
*/
|
|
174
192
|
exports.setAdminMode = setAdminMode;
|
|
175
|
-
const setDisplayTimeout = (...args) =>
|
|
193
|
+
const setDisplayTimeout = (...args) => _moduleWrapper.moduleWrapper.current.functions.setDisplayTimeout(...args);
|
|
176
194
|
/**
|
|
177
195
|
* Enables or disables a button which floats over the page.
|
|
178
196
|
*/
|
|
179
197
|
exports.setDisplayTimeout = setDisplayTimeout;
|
|
180
|
-
const setFloatingButton = (...args) =>
|
|
198
|
+
const setFloatingButton = (...args) => _moduleWrapper.moduleWrapper.current.functions.setFloatingButton(...args);
|
|
181
199
|
/**
|
|
182
200
|
* Sets the height of the page.
|
|
183
201
|
*/
|
|
184
202
|
exports.setFloatingButton = setFloatingButton;
|
|
185
|
-
const setHeight = (...args) =>
|
|
203
|
+
const setHeight = (...args) => _moduleWrapper.moduleWrapper.current.functions.setHeight(...args);
|
|
186
204
|
/**
|
|
187
205
|
* Enables or disables the ability to refresh a page
|
|
188
206
|
*/
|
|
189
207
|
exports.setHeight = setHeight;
|
|
190
|
-
const setRefreshScrollEnabled = (...args) =>
|
|
208
|
+
const setRefreshScrollEnabled = (...args) => _moduleWrapper.moduleWrapper.current.functions.setRefreshScrollEnabled(...args);
|
|
191
209
|
/**
|
|
192
210
|
* Scans a qr-code and returns the result
|
|
193
211
|
*/
|
|
194
212
|
exports.setRefreshScrollEnabled = setRefreshScrollEnabled;
|
|
195
|
-
const setScanQrCode = (...args) =>
|
|
213
|
+
const setScanQrCode = (...args) => _moduleWrapper.moduleWrapper.current.functions.setScanQrCode(...args);
|
|
196
214
|
/**
|
|
197
215
|
* Temporarily change design settings in top frame
|
|
198
216
|
*/
|
|
199
217
|
exports.setScanQrCode = setScanQrCode;
|
|
200
|
-
const setTempDesignSettings = (...args) =>
|
|
218
|
+
const setTempDesignSettings = (...args) => _moduleWrapper.moduleWrapper.current.functions.setTempDesignSettings(...args);
|
|
201
219
|
/**
|
|
202
220
|
* Shows or hide a waitcursor
|
|
203
221
|
*/
|
|
204
222
|
exports.setTempDesignSettings = setTempDesignSettings;
|
|
205
|
-
const setWaitCursor = (...args) =>
|
|
223
|
+
const setWaitCursor = (...args) => _moduleWrapper.moduleWrapper.current.functions.setWaitCursor(...args);
|
|
206
224
|
/**
|
|
207
225
|
* Retrieves the value that is assigned to the key from a storage outside the frame
|
|
208
226
|
*/
|
|
209
227
|
exports.setWaitCursor = setWaitCursor;
|
|
210
|
-
const storageGetItem = (...args) =>
|
|
228
|
+
const storageGetItem = (...args) => _moduleWrapper.moduleWrapper.current.functions.storageGetItem(...args);
|
|
211
229
|
/**
|
|
212
230
|
* Removes the value that is assigned to the key from a storage outside the frame
|
|
213
231
|
*/
|
|
214
232
|
exports.storageGetItem = storageGetItem;
|
|
215
|
-
const storageRemoveItem = (...args) =>
|
|
233
|
+
const storageRemoveItem = (...args) => _moduleWrapper.moduleWrapper.current.functions.storageRemoveItem(...args);
|
|
216
234
|
/**
|
|
217
235
|
* Sets the value that is assigned to the key from a storage outside the frame
|
|
218
236
|
*/
|
|
219
237
|
exports.storageRemoveItem = storageRemoveItem;
|
|
220
|
-
const storageSetItem = (...args) =>
|
|
238
|
+
const storageSetItem = (...args) => _moduleWrapper.moduleWrapper.current.functions.storageSetItem(...args);
|
|
221
239
|
/**
|
|
222
240
|
* This method lets a smartphone vibrate for the given time.
|
|
223
241
|
*/
|
|
224
242
|
exports.storageSetItem = storageSetItem;
|
|
225
|
-
const vibrate = (...args) =>
|
|
243
|
+
const vibrate = (...args) => _moduleWrapper.moduleWrapper.current.functions.vibrate(...args);
|
|
226
244
|
/**
|
|
227
245
|
* This method creates a dialog
|
|
228
246
|
*/
|
|
229
247
|
exports.vibrate = vibrate;
|
|
230
|
-
const createDialog = (...args) =>
|
|
248
|
+
const createDialog = (...args) => _moduleWrapper.moduleWrapper.current.functions.createDialog(...args);
|
|
231
249
|
/**
|
|
232
250
|
* Displays an overlay
|
|
233
251
|
*/
|
|
234
252
|
exports.createDialog = createDialog;
|
|
235
|
-
const setOverlay = (...args) =>
|
|
253
|
+
const setOverlay = (...args) => _moduleWrapper.moduleWrapper.current.functions.setOverlay(...args);
|
|
236
254
|
/**
|
|
237
255
|
* Returns user information, only when user is logged in
|
|
238
256
|
* @category User functions
|
|
239
257
|
*/
|
|
240
258
|
exports.setOverlay = setOverlay;
|
|
241
|
-
const getUser = () =>
|
|
259
|
+
const getUser = () => _moduleWrapper.moduleWrapper.current.values.user;
|
|
242
260
|
exports.getUser = getUser;
|
|
243
|
-
const getSite = () =>
|
|
261
|
+
const getSite = () => _moduleWrapper.moduleWrapper.current.values.site;
|
|
244
262
|
exports.getSite = getSite;
|
|
245
|
-
const getCurrentPage = () =>
|
|
263
|
+
const getCurrentPage = () => _moduleWrapper.moduleWrapper.current.values.currentPage;
|
|
246
264
|
exports.getCurrentPage = getCurrentPage;
|
|
247
|
-
const getDevice = () =>
|
|
265
|
+
const getDevice = () => _moduleWrapper.moduleWrapper.current.values.device;
|
|
248
266
|
exports.getDevice = getDevice;
|
|
249
|
-
const getLanguage = () =>
|
|
267
|
+
const getLanguage = () => _moduleWrapper.moduleWrapper.current.values.language;
|
|
250
268
|
exports.getLanguage = getLanguage;
|
|
251
|
-
const getParameters = () =>
|
|
269
|
+
const getParameters = () => _moduleWrapper.moduleWrapper.current.values.parameters;
|
|
252
270
|
exports.getParameters = getParameters;
|
|
253
|
-
const getPages = () =>
|
|
271
|
+
const getPages = () => _moduleWrapper.moduleWrapper.current.values.pages;
|
|
254
272
|
exports.getPages = getPages;
|
|
255
|
-
const getEnvironment = () =>
|
|
273
|
+
const getEnvironment = () => _moduleWrapper.moduleWrapper.current.values.environment;
|
|
256
274
|
exports.getEnvironment = getEnvironment;
|
|
257
|
-
const user = new Proxy({}, {
|
|
275
|
+
const user = exports.user = new Proxy({}, {
|
|
258
276
|
get: (target, prop) => {
|
|
259
277
|
var _moduleWrapper$curren;
|
|
260
278
|
console.warn('Deprecated user import');
|
|
261
|
-
return (_moduleWrapper$curren =
|
|
279
|
+
return (_moduleWrapper$curren = _moduleWrapper.moduleWrapper.current.values.user) === null || _moduleWrapper$curren === void 0 ? void 0 : _moduleWrapper$curren[prop];
|
|
262
280
|
}
|
|
263
281
|
});
|
|
264
|
-
exports.
|
|
265
|
-
const site = new Proxy({}, {
|
|
282
|
+
const site = exports.site = new Proxy({}, {
|
|
266
283
|
get: (target, prop) => {
|
|
267
284
|
var _moduleWrapper$curren2;
|
|
268
285
|
console.warn('Deprecated site import');
|
|
269
|
-
return (_moduleWrapper$curren2 =
|
|
286
|
+
return (_moduleWrapper$curren2 = _moduleWrapper.moduleWrapper.current.values.site) === null || _moduleWrapper$curren2 === void 0 ? void 0 : _moduleWrapper$curren2[prop];
|
|
270
287
|
}
|
|
271
288
|
});
|
|
272
|
-
exports.
|
|
273
|
-
const device = new Proxy({}, {
|
|
289
|
+
const device = exports.device = new Proxy({}, {
|
|
274
290
|
get: (target, prop) => {
|
|
275
291
|
var _moduleWrapper$curren3;
|
|
276
292
|
console.warn('Deprecated device import');
|
|
277
|
-
return (_moduleWrapper$curren3 =
|
|
293
|
+
return (_moduleWrapper$curren3 = _moduleWrapper.moduleWrapper.current.values.device) === null || _moduleWrapper$curren3 === void 0 ? void 0 : _moduleWrapper$curren3[prop];
|
|
278
294
|
}
|
|
279
295
|
});
|
|
280
|
-
exports.
|
|
281
|
-
const language = new Proxy({}, {
|
|
296
|
+
const language = exports.language = new Proxy({}, {
|
|
282
297
|
get: (target, prop) => {
|
|
283
298
|
var _moduleWrapper$curren4;
|
|
284
299
|
console.warn('Deprecated language import');
|
|
285
|
-
return (_moduleWrapper$curren4 =
|
|
300
|
+
return (_moduleWrapper$curren4 = _moduleWrapper.moduleWrapper.current.values.language) === null || _moduleWrapper$curren4 === void 0 ? void 0 : _moduleWrapper$curren4[prop];
|
|
286
301
|
}
|
|
287
302
|
});
|
|
288
|
-
exports.
|
|
289
|
-
const parameters = new Proxy({}, {
|
|
303
|
+
const parameters = exports.parameters = new Proxy({}, {
|
|
290
304
|
get: (target, prop) => {
|
|
291
305
|
var _moduleWrapper$curren5;
|
|
292
306
|
console.warn('Deprecated parameters import');
|
|
293
|
-
return (_moduleWrapper$curren5 =
|
|
307
|
+
return (_moduleWrapper$curren5 = _moduleWrapper.moduleWrapper.current.values.parameters) === null || _moduleWrapper$curren5 === void 0 ? void 0 : _moduleWrapper$curren5[prop];
|
|
294
308
|
}
|
|
295
309
|
});
|
|
296
|
-
exports.
|
|
297
|
-
const pages = new Proxy({}, {
|
|
310
|
+
const pages = exports.pages = new Proxy({}, {
|
|
298
311
|
get: (target, prop) => {
|
|
299
312
|
var _moduleWrapper$curren6;
|
|
300
313
|
console.warn('Deprecated pages import');
|
|
301
|
-
return (_moduleWrapper$curren6 =
|
|
314
|
+
return (_moduleWrapper$curren6 = _moduleWrapper.moduleWrapper.current.values.pages) === null || _moduleWrapper$curren6 === void 0 ? void 0 : _moduleWrapper$curren6[prop];
|
|
302
315
|
}
|
|
303
316
|
});
|
|
304
|
-
exports.
|
|
305
|
-
const environment = new Proxy({}, {
|
|
317
|
+
const environment = exports.environment = new Proxy({}, {
|
|
306
318
|
get: (target, prop) => {
|
|
307
319
|
var _moduleWrapper$curren7;
|
|
308
320
|
console.warn('Deprecated environment import');
|
|
309
|
-
return (_moduleWrapper$curren7 =
|
|
321
|
+
return (_moduleWrapper$curren7 = _moduleWrapper.moduleWrapper.current.values.environment) === null || _moduleWrapper$curren7 === void 0 ? void 0 : _moduleWrapper$curren7[prop];
|
|
310
322
|
}
|
|
311
|
-
});
|
|
312
|
-
exports.environment = environment;
|
|
323
|
+
});
|
|
@@ -7,9 +7,10 @@ exports.default = void 0;
|
|
|
7
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _ChaynsHost = _interopRequireDefault(require("../host/ChaynsHost"));
|
|
9
9
|
var _hooks = require("../hooks");
|
|
10
|
+
var _ErrorBoundary = _interopRequireDefault(require("./ErrorBoundary"));
|
|
10
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
-
function _getRequireWildcardCache(
|
|
12
|
-
function _interopRequireWildcard(
|
|
12
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
13
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
13
14
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
14
15
|
const AppDialogWrapper = ({
|
|
15
16
|
dialogEventTarget
|
|
@@ -26,17 +27,16 @@ const AppDialogWrapper = ({
|
|
|
26
27
|
});
|
|
27
28
|
});
|
|
28
29
|
}, []);
|
|
29
|
-
return /*#__PURE__*/_react.default.createElement(_ChaynsHost.default, _extends({
|
|
30
|
+
return /*#__PURE__*/_react.default.createElement(_ErrorBoundary.default, null, /*#__PURE__*/_react.default.createElement(_ChaynsHost.default, _extends({
|
|
30
31
|
type: "client-module",
|
|
31
32
|
system: {
|
|
32
33
|
module: './AppWrapper',
|
|
33
|
-
url: 'https://tapp
|
|
34
|
+
url: 'https://tapp.chayns-static.space/api/dialog-v2/v1/remoteEntry.js',
|
|
34
35
|
scope: 'dialog_v2'
|
|
35
36
|
}
|
|
36
37
|
}, data, {
|
|
37
38
|
functions: functions,
|
|
38
39
|
customData: dialogData
|
|
39
|
-
}));
|
|
40
|
+
})));
|
|
40
41
|
};
|
|
41
|
-
var _default = AppDialogWrapper;
|
|
42
|
-
exports.default = _default;
|
|
42
|
+
var _default = exports.default = AppDialogWrapper;
|
|
@@ -5,8 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.ChaynsFunctionsContext = exports.ChaynsContext = void 0;
|
|
7
7
|
var _useContextSelector = require("use-context-selector");
|
|
8
|
-
const ChaynsContext = (0, _useContextSelector.createContext)(null);
|
|
8
|
+
const ChaynsContext = exports.ChaynsContext = (0, _useContextSelector.createContext)(null);
|
|
9
9
|
// @ts-expect-error Functions cant be null, implementation of default values is redundant
|
|
10
|
-
exports.
|
|
11
|
-
const ChaynsFunctionsContext = (0, _useContextSelector.createContext)(null);
|
|
12
|
-
exports.ChaynsFunctionsContext = ChaynsFunctionsContext;
|
|
10
|
+
const ChaynsFunctionsContext = exports.ChaynsFunctionsContext = (0, _useContextSelector.createContext)(null);
|