chayns-api 1.0.2 → 1.0.3
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 +30 -30
- package/.eslintrc +17 -17
- package/.github/workflows/deploy_docs.yml +28 -28
- package/.github/workflows/publish.yml +21 -0
- package/LICENSE +21 -21
- package/README.md +47 -47
- package/dist/cjs/calls/dialogs/date.js +10 -10
- package/dist/cjs/calls/index.js +94 -94
- package/dist/cjs/calls/sendMessage.js +8 -8
- package/dist/cjs/calls/visibilityChangeListener.js +4 -4
- package/dist/cjs/hooks/geoLocationListener.js +4 -4
- package/dist/cjs/hooks/scrollListener.js +8 -8
- package/dist/cjs/hooks/useAccessToken.js +2 -2
- package/dist/cjs/hooks/useCurrentPage.js +2 -2
- package/dist/cjs/hooks/useCustomData.js +2 -2
- package/dist/cjs/hooks/useDevice.js +2 -2
- package/dist/cjs/hooks/useEnvironment.js +2 -2
- package/dist/cjs/hooks/useFunctions.js +2 -2
- package/dist/cjs/hooks/useIsAdminMode.js +2 -2
- package/dist/cjs/hooks/useLanguage.js +2 -2
- package/dist/cjs/hooks/usePages.js +4 -4
- package/dist/cjs/hooks/useParameters.js +2 -2
- package/dist/cjs/hooks/useSite.js +2 -2
- package/dist/cjs/hooks/useUser.js +2 -2
- package/dist/cjs/hooks/useValues.js +2 -2
- package/dist/cjs/hooks/windowMetricsListener.js +4 -4
- package/dist/cjs/util/deviceHelper.js +1 -1
- package/dist/cjs/wrapper/AppWrapper.js +5 -0
- package/dist/cjs/wrapper/FrameWrapper.js +4 -0
- package/dist/esm/calls/dialogs/date.js +34 -34
- package/dist/esm/calls/index.js +94 -94
- package/dist/esm/calls/sendMessage.js +8 -8
- package/dist/esm/calls/visibilityChangeListener.js +4 -4
- package/dist/esm/hooks/geoLocationListener.js +4 -4
- package/dist/esm/hooks/scrollListener.js +8 -8
- package/dist/esm/hooks/useAccessToken.js +2 -2
- package/dist/esm/hooks/useCurrentPage.js +2 -2
- package/dist/esm/hooks/useCustomData.js +2 -2
- package/dist/esm/hooks/useDevice.js +2 -2
- package/dist/esm/hooks/useEnvironment.js +2 -2
- package/dist/esm/hooks/useFunctions.js +2 -2
- package/dist/esm/hooks/useIsAdminMode.js +2 -2
- package/dist/esm/hooks/useLanguage.js +2 -2
- package/dist/esm/hooks/usePages.js +4 -4
- package/dist/esm/hooks/useParameters.js +2 -2
- package/dist/esm/hooks/useSite.js +2 -2
- package/dist/esm/hooks/useUser.js +2 -2
- package/dist/esm/hooks/useValues.js +2 -2
- package/dist/esm/hooks/windowMetricsListener.js +4 -4
- package/dist/esm/util/deviceHelper.js +1 -1
- package/dist/esm/wrapper/AppWrapper.js +5 -0
- package/dist/esm/wrapper/FrameWrapper.js +4 -0
- 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 +225 -225
- package/dist/types/calls/sendMessage.d.ts +13 -13
- package/dist/types/calls/visibilityChangeListener.d.ts +9 -9
- package/dist/types/components/ChaynsContext.d.ts +3 -3
- package/dist/types/components/ChaynsProvider.d.ts +13 -13
- package/dist/types/components/WaitUntil.d.ts +7 -7
- package/dist/types/components/withCompatMode.d.ts +13 -13
- package/dist/types/helper/apiListenerHelper.d.ts +6 -6
- package/dist/types/hooks/geoLocationListener.d.ts +18 -18
- package/dist/types/hooks/index.d.ts +16 -16
- package/dist/types/hooks/scrollListener.d.ts +28 -28
- package/dist/types/hooks/useAccessToken.d.ts +5 -5
- package/dist/types/hooks/useCurrentPage.d.ts +4 -4
- package/dist/types/hooks/useCustomData.d.ts +4 -4
- package/dist/types/hooks/useDevice.d.ts +5 -5
- package/dist/types/hooks/useEnvironment.d.ts +5 -5
- package/dist/types/hooks/useFunctions.d.ts +5 -5
- 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 +5 -5
- package/dist/types/hooks/windowMetricsListener.d.ts +11 -11
- package/dist/types/host/ChaynsHost.d.ts +28 -28
- package/dist/types/host/iframe/HostIframe.d.ts +24 -24
- package/dist/types/host/iframe/utils/useUpdateData.d.ts +3 -3
- package/dist/types/host/module/ModuleHost.d.ts +23 -23
- package/dist/types/host/module/utils/loadComponent.d.ts +1 -1
- package/dist/types/host/module/utils/useDynamicScript.d.ts +9 -9
- package/dist/types/index.d.ts +16 -16
- package/dist/types/types/IChaynsReact.d.ts +622 -621
- package/dist/types/types/dialog.d.ts +41 -41
- package/dist/types/util/appCall.d.ts +2 -2
- package/dist/types/util/deviceHelper.d.ts +7 -7
- package/dist/types/util/heightHelper.d.ts +1 -1
- package/dist/types/util/postIframeForm.d.ts +1 -1
- package/dist/types/wrapper/AppWrapper.d.ts +18 -18
- package/dist/types/wrapper/FrameWrapper.d.ts +15 -15
- package/dist/types/wrapper/ModuleFederationWrapper.d.ts +10 -10
- package/dist/types/wrapper/SsrWrapper.d.ts +11 -11
- package/package.json +76 -76
- package/toolkit.config.js +52 -52
- package/tsconfig.json +56 -56
- package/dist/cjs/calls/dialogs/utils/environment.js +0 -10
- package/dist/cjs/client.js +0 -93
- package/dist/cjs/components/ChaynsModuleProvider.js +0 -457
- package/dist/cjs/host/module/PagemakerFrame.js +0 -105
- package/dist/cjs/types/DynamicApiImport.d.js +0 -5
- package/dist/esm/calls/dialogs/utils/environment.js +0 -3
- package/dist/esm/client.js +0 -8
- package/dist/esm/components/ChaynsModuleProvider.js +0 -517
- package/dist/esm/host/module/PagemakerFrame.js +0 -97
- package/dist/esm/types/DynamicApiImport.d.js +0 -1
- package/dist/types/calls/dialogs/utils/environment.d.ts +0 -3
- package/dist/types/client.d.ts +0 -7
- package/dist/types/components/ChaynsModuleProvider.d.ts +0 -170
- package/dist/types/host/module/PagemakerFrame.d.ts +0 -22
package/dist/esm/calls/index.js
CHANGED
|
@@ -1,70 +1,70 @@
|
|
|
1
1
|
import { moduleWrapper } from '../components/ChaynsProvider';
|
|
2
|
-
/**
|
|
3
|
-
* This adds a listener to determine your location.
|
|
4
|
-
* @category Event listener
|
|
2
|
+
/**
|
|
3
|
+
* This adds a listener to determine your location.
|
|
4
|
+
* @category Event listener
|
|
5
5
|
*/
|
|
6
6
|
export const addGeoLocationListener = function () {
|
|
7
7
|
return moduleWrapper.current.functions.addGeoLocationListener(...arguments);
|
|
8
8
|
};
|
|
9
|
-
/**
|
|
10
|
-
* Adds a listener for scroll event by user.
|
|
11
|
-
* @category Event listener
|
|
9
|
+
/**
|
|
10
|
+
* Adds a listener for scroll event by user.
|
|
11
|
+
* @category Event listener
|
|
12
12
|
*/
|
|
13
13
|
export const addScrollListener = function () {
|
|
14
14
|
return moduleWrapper.current.functions.addScrollListener(...arguments);
|
|
15
15
|
};
|
|
16
|
-
/**
|
|
17
|
-
* This method will be executed when the page gets displayed or hidden.
|
|
18
|
-
* @category Event listener
|
|
16
|
+
/**
|
|
17
|
+
* This method will be executed when the page gets displayed or hidden.
|
|
18
|
+
* @category Event listener
|
|
19
19
|
*/
|
|
20
20
|
export const addVisibilityChangeListener = function () {
|
|
21
21
|
return moduleWrapper.current.functions.addVisibilityChangeListener(...arguments);
|
|
22
22
|
};
|
|
23
|
-
/**
|
|
24
|
-
* This adds a listener to get the actual height of the page.
|
|
25
|
-
* @category Event listener
|
|
23
|
+
/**
|
|
24
|
+
* This adds a listener to get the actual height of the page.
|
|
25
|
+
* @category Event listener
|
|
26
26
|
*/
|
|
27
27
|
export const addWindowMetricsListener = function () {
|
|
28
28
|
return moduleWrapper.current.functions.addWindowMetricsListener(...arguments);
|
|
29
|
-
}; /**
|
|
30
|
-
* Allows a custom callback function to be defined
|
|
29
|
+
}; /**
|
|
30
|
+
* Allows a custom callback function to be defined
|
|
31
31
|
*/
|
|
32
32
|
export const customCallbackFunction = function () {
|
|
33
33
|
return moduleWrapper.current.functions.customCallbackFunction(...arguments);
|
|
34
34
|
};
|
|
35
|
-
/**
|
|
36
|
-
* Get the accessToken from the user.
|
|
35
|
+
/**
|
|
36
|
+
* Get the accessToken from the user.
|
|
37
37
|
*/
|
|
38
38
|
export const getAccessToken = function () {
|
|
39
39
|
return moduleWrapper.current.functions.getAccessToken(...arguments);
|
|
40
40
|
};
|
|
41
|
-
/**
|
|
42
|
-
* This method returns a list of installed share/social media apps.
|
|
41
|
+
/**
|
|
42
|
+
* This method returns a list of installed share/social media apps.
|
|
43
43
|
*/
|
|
44
44
|
export const getAvailableSharingServices = function () {
|
|
45
45
|
return moduleWrapper.current.functions.getAvailableSharingServices(...arguments);
|
|
46
46
|
};
|
|
47
|
-
/**
|
|
48
|
-
* This method determines your location. If you want to track a route, use addGeoLocationListener.
|
|
47
|
+
/**
|
|
48
|
+
* This method determines your location. If you want to track a route, use addGeoLocationListener.
|
|
49
49
|
*/
|
|
50
50
|
export const getGeoLocation = function () {
|
|
51
51
|
return moduleWrapper.current.functions.getGeoLocation(...arguments);
|
|
52
52
|
};
|
|
53
|
-
/**
|
|
54
|
-
* This method returns user information for a specific user.
|
|
55
|
-
* @category User functions
|
|
53
|
+
/**
|
|
54
|
+
* This method returns user information for a specific user.
|
|
55
|
+
* @category User functions
|
|
56
56
|
*/
|
|
57
57
|
export const getUserInfo = function () {
|
|
58
58
|
return moduleWrapper.current.functions.getUserInfo(...arguments);
|
|
59
59
|
};
|
|
60
|
-
/**
|
|
61
|
-
* Return the current scroll position of the top frame
|
|
60
|
+
/**
|
|
61
|
+
* Return the current scroll position of the top frame
|
|
62
62
|
*/
|
|
63
63
|
export const getScrollPosition = function () {
|
|
64
64
|
return moduleWrapper.current.functions.getScrollPosition(...arguments);
|
|
65
65
|
};
|
|
66
|
-
/**
|
|
67
|
-
* Returns the window metrics.
|
|
66
|
+
/**
|
|
67
|
+
* Returns the window metrics.
|
|
68
68
|
*/
|
|
69
69
|
export const getWindowMetrics = function () {
|
|
70
70
|
return moduleWrapper.current.functions.getWindowMetrics(...arguments);
|
|
@@ -77,193 +77,193 @@ export const invokeCall = function () {
|
|
|
77
77
|
export const invokeDialogCall = function () {
|
|
78
78
|
return moduleWrapper.current.functions.invokeDialogCall(...arguments);
|
|
79
79
|
};
|
|
80
|
-
/**
|
|
81
|
-
* This method will show a login dialog where the user has the opportunity to log in.
|
|
80
|
+
/**
|
|
81
|
+
* This method will show a login dialog where the user has the opportunity to log in.
|
|
82
82
|
*/
|
|
83
83
|
export const login = function () {
|
|
84
84
|
return moduleWrapper.current.functions.login(...arguments);
|
|
85
85
|
};
|
|
86
|
-
/**
|
|
87
|
-
* This method will logout the user
|
|
86
|
+
/**
|
|
87
|
+
* This method will logout the user
|
|
88
88
|
*/
|
|
89
89
|
export const logout = function () {
|
|
90
90
|
return moduleWrapper.current.functions.logout(...arguments);
|
|
91
91
|
};
|
|
92
|
-
/**
|
|
93
|
-
* This function navigates you to the previous site.
|
|
92
|
+
/**
|
|
93
|
+
* This function navigates you to the previous site.
|
|
94
94
|
*/
|
|
95
95
|
export const navigateBack = function () {
|
|
96
96
|
return moduleWrapper.current.functions.navigateBack(...arguments);
|
|
97
97
|
};
|
|
98
|
-
/**
|
|
99
|
-
* The images specified in the url array is shown in gallery mode.
|
|
98
|
+
/**
|
|
99
|
+
* The images specified in the url array is shown in gallery mode.
|
|
100
100
|
*/
|
|
101
101
|
export const openImage = function () {
|
|
102
102
|
return moduleWrapper.current.functions.openImage(...arguments);
|
|
103
103
|
};
|
|
104
|
-
/**
|
|
105
|
-
* Opens an URL in the chayns environment.
|
|
104
|
+
/**
|
|
105
|
+
* Opens an URL in the chayns environment.
|
|
106
106
|
*/
|
|
107
107
|
export const openUrl = function () {
|
|
108
108
|
return moduleWrapper.current.functions.openUrl(...arguments);
|
|
109
109
|
};
|
|
110
|
-
/**
|
|
111
|
-
* The video specified in the URL is shown in video mode.
|
|
110
|
+
/**
|
|
111
|
+
* The video specified in the URL is shown in video mode.
|
|
112
112
|
*/
|
|
113
113
|
export const openVideo = function () {
|
|
114
114
|
return moduleWrapper.current.functions.openVideo(...arguments);
|
|
115
115
|
};
|
|
116
|
-
/**
|
|
117
|
-
* Refresh badge count in navigation, user information and pages
|
|
116
|
+
/**
|
|
117
|
+
* Refresh badge count in navigation, user information and pages
|
|
118
118
|
*/
|
|
119
119
|
export const refreshData = function () {
|
|
120
120
|
return moduleWrapper.current.functions.refreshData(...arguments);
|
|
121
121
|
};
|
|
122
|
-
/**
|
|
123
|
-
* Refresh accesstoken, should only be used when user object changes, not when token is invalid
|
|
122
|
+
/**
|
|
123
|
+
* Refresh accesstoken, should only be used when user object changes, not when token is invalid
|
|
124
124
|
*/
|
|
125
125
|
export const refreshAccessToken = function () {
|
|
126
126
|
return moduleWrapper.current.functions.refreshAccessToken(...arguments);
|
|
127
127
|
};
|
|
128
|
-
/**
|
|
129
|
-
* This removes a listener to determine your location.
|
|
130
|
-
* @category Event listener
|
|
128
|
+
/**
|
|
129
|
+
* This removes a listener to determine your location.
|
|
130
|
+
* @category Event listener
|
|
131
131
|
*/
|
|
132
132
|
export const removeGeoLocationListener = function () {
|
|
133
133
|
return moduleWrapper.current.functions.removeGeoLocationListener(...arguments);
|
|
134
134
|
};
|
|
135
|
-
/**
|
|
136
|
-
* Removes scroll listener.
|
|
137
|
-
* @category Event listener
|
|
135
|
+
/**
|
|
136
|
+
* Removes scroll listener.
|
|
137
|
+
* @category Event listener
|
|
138
138
|
*/
|
|
139
139
|
export const removeScrollListener = function () {
|
|
140
140
|
return moduleWrapper.current.functions.removeScrollListener(...arguments);
|
|
141
141
|
};
|
|
142
|
-
/**
|
|
143
|
-
* Removes visibility change listener.
|
|
144
|
-
* @category Event listener
|
|
142
|
+
/**
|
|
143
|
+
* Removes visibility change listener.
|
|
144
|
+
* @category Event listener
|
|
145
145
|
*/
|
|
146
146
|
export const removeVisibilityChangeListener = function () {
|
|
147
147
|
return moduleWrapper.current.functions.removeVisibilityChangeListener(...arguments);
|
|
148
148
|
};
|
|
149
|
-
/**
|
|
150
|
-
* Removes window metrics listener.
|
|
151
|
-
* @category Event listener
|
|
149
|
+
/**
|
|
150
|
+
* Removes window metrics listener.
|
|
151
|
+
* @category Event listener
|
|
152
152
|
*/
|
|
153
153
|
export const removeWindowMetricsListener = function () {
|
|
154
154
|
return moduleWrapper.current.functions.removeWindowMetricsListener(...arguments);
|
|
155
155
|
};
|
|
156
|
-
/**
|
|
157
|
-
* Select other page on chayns site.
|
|
156
|
+
/**
|
|
157
|
+
* Select other page on chayns site.
|
|
158
158
|
*/
|
|
159
159
|
export const selectPage = function () {
|
|
160
160
|
return moduleWrapper.current.functions.selectPage(...arguments);
|
|
161
161
|
};
|
|
162
|
-
/**
|
|
163
|
-
* Scrolls to specific position.
|
|
162
|
+
/**
|
|
163
|
+
* Scrolls to specific position.
|
|
164
164
|
*/
|
|
165
165
|
export const scrollToY = function () {
|
|
166
166
|
return moduleWrapper.current.functions.scrollToY(...arguments);
|
|
167
167
|
};
|
|
168
|
-
/**
|
|
169
|
-
* Sends intercom message to group.
|
|
168
|
+
/**
|
|
169
|
+
* Sends intercom message to group.
|
|
170
170
|
*/
|
|
171
171
|
export const sendMessageToGroup = function () {
|
|
172
172
|
return moduleWrapper.current.functions.sendMessageToGroup(...arguments);
|
|
173
173
|
};
|
|
174
|
-
/**
|
|
175
|
-
* Sends intercom message to page.
|
|
174
|
+
/**
|
|
175
|
+
* Sends intercom message to page.
|
|
176
176
|
*/
|
|
177
177
|
export const sendMessageToPage = function () {
|
|
178
178
|
return moduleWrapper.current.functions.sendMessageToPage(...arguments);
|
|
179
179
|
};
|
|
180
|
-
/**
|
|
181
|
-
* Sends intercom message to an user.
|
|
180
|
+
/**
|
|
181
|
+
* Sends intercom message to an user.
|
|
182
182
|
*/
|
|
183
183
|
export const sendMessageToUser = function () {
|
|
184
184
|
return moduleWrapper.current.functions.sendMessageToUser(...arguments);
|
|
185
185
|
};
|
|
186
|
-
/**
|
|
187
|
-
* Switches admin mode, also toggles admin switch in top frame.
|
|
186
|
+
/**
|
|
187
|
+
* Switches admin mode, also toggles admin switch in top frame.
|
|
188
188
|
*/
|
|
189
189
|
export const setAdminMode = function () {
|
|
190
190
|
return moduleWrapper.current.functions.setAdminMode(...arguments);
|
|
191
191
|
};
|
|
192
|
-
/**
|
|
193
|
-
* Sets the display timeout, only works in chayns App.
|
|
192
|
+
/**
|
|
193
|
+
* Sets the display timeout, only works in chayns App.
|
|
194
194
|
*/
|
|
195
195
|
export const setDisplayTimeout = function () {
|
|
196
196
|
return moduleWrapper.current.functions.setDisplayTimeout(...arguments);
|
|
197
197
|
};
|
|
198
|
-
/**
|
|
199
|
-
* Enables or disables a button which floats over the page.
|
|
198
|
+
/**
|
|
199
|
+
* Enables or disables a button which floats over the page.
|
|
200
200
|
*/
|
|
201
201
|
export const setFloatingButton = function () {
|
|
202
202
|
return moduleWrapper.current.functions.setFloatingButton(...arguments);
|
|
203
203
|
};
|
|
204
|
-
/**
|
|
205
|
-
* Sets the height of the page.
|
|
204
|
+
/**
|
|
205
|
+
* Sets the height of the page.
|
|
206
206
|
*/
|
|
207
207
|
export const setHeight = function () {
|
|
208
208
|
return moduleWrapper.current.functions.setHeight(...arguments);
|
|
209
209
|
};
|
|
210
|
-
/**
|
|
211
|
-
* Enables or disables the ability to refresh a page
|
|
210
|
+
/**
|
|
211
|
+
* Enables or disables the ability to refresh a page
|
|
212
212
|
*/
|
|
213
213
|
export const setRefreshScrollEnabled = function () {
|
|
214
214
|
return moduleWrapper.current.functions.setRefreshScrollEnabled(...arguments);
|
|
215
215
|
};
|
|
216
|
-
/**
|
|
217
|
-
* Scans a qr-code and returns the result
|
|
216
|
+
/**
|
|
217
|
+
* Scans a qr-code and returns the result
|
|
218
218
|
*/
|
|
219
219
|
export const setScanQrCode = function () {
|
|
220
220
|
return moduleWrapper.current.functions.setScanQrCode(...arguments);
|
|
221
221
|
};
|
|
222
|
-
/**
|
|
223
|
-
* Temporarily change design settings in top frame
|
|
222
|
+
/**
|
|
223
|
+
* Temporarily change design settings in top frame
|
|
224
224
|
*/
|
|
225
225
|
export const setTempDesignSettings = function () {
|
|
226
226
|
return moduleWrapper.current.functions.setTempDesignSettings(...arguments);
|
|
227
227
|
};
|
|
228
|
-
/**
|
|
229
|
-
* Shows or hide a waitcursor
|
|
228
|
+
/**
|
|
229
|
+
* Shows or hide a waitcursor
|
|
230
230
|
*/
|
|
231
231
|
export const setWaitCursor = function () {
|
|
232
232
|
return moduleWrapper.current.functions.setWaitCursor(...arguments);
|
|
233
233
|
};
|
|
234
|
-
/**
|
|
235
|
-
* Retrieves the value that is assigned to the key from a storage outside the frame
|
|
234
|
+
/**
|
|
235
|
+
* Retrieves the value that is assigned to the key from a storage outside the frame
|
|
236
236
|
*/
|
|
237
237
|
export const storageGetItem = function () {
|
|
238
238
|
return moduleWrapper.current.functions.storageGetItem(...arguments);
|
|
239
239
|
};
|
|
240
|
-
/**
|
|
241
|
-
* Removes the value that is assigned to the key from a storage outside the frame
|
|
240
|
+
/**
|
|
241
|
+
* Removes the value that is assigned to the key from a storage outside the frame
|
|
242
242
|
*/
|
|
243
243
|
export const storageRemoveItem = function () {
|
|
244
244
|
return moduleWrapper.current.functions.storageRemoveItem(...arguments);
|
|
245
245
|
};
|
|
246
|
-
/**
|
|
247
|
-
* Sets the value that is assigned to the key from a storage outside the frame
|
|
246
|
+
/**
|
|
247
|
+
* Sets the value that is assigned to the key from a storage outside the frame
|
|
248
248
|
*/
|
|
249
249
|
export const storageSetItem = function () {
|
|
250
250
|
return moduleWrapper.current.functions.storageSetItem(...arguments);
|
|
251
251
|
};
|
|
252
|
-
/**
|
|
253
|
-
* This method lets a smartphone vibrate for the given time.
|
|
252
|
+
/**
|
|
253
|
+
* This method lets a smartphone vibrate for the given time.
|
|
254
254
|
*/
|
|
255
255
|
export const vibrate = function () {
|
|
256
256
|
return moduleWrapper.current.functions.vibrate(...arguments);
|
|
257
257
|
};
|
|
258
|
-
/**
|
|
259
|
-
* Displays an overlay
|
|
258
|
+
/**
|
|
259
|
+
* Displays an overlay
|
|
260
260
|
*/
|
|
261
261
|
export const setOverlay = function () {
|
|
262
262
|
return moduleWrapper.current.functions.setOverlay(...arguments);
|
|
263
263
|
};
|
|
264
|
-
/**
|
|
265
|
-
* Returns user information, only when user is logged in
|
|
266
|
-
* @category User functions
|
|
264
|
+
/**
|
|
265
|
+
* Returns user information, only when user is logged in
|
|
266
|
+
* @category User functions
|
|
267
267
|
*/
|
|
268
268
|
export const getUser = () => moduleWrapper.current.values.user;
|
|
269
269
|
export const getSite = () => moduleWrapper.current.values.site;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const INTERCOM_URL = 'https://sub54.tobit.com/rest/api';
|
|
2
|
-
/**
|
|
3
|
-
* @category Intercom functions
|
|
2
|
+
/**
|
|
3
|
+
* @category Intercom functions
|
|
4
4
|
*/
|
|
5
5
|
export const sendMessageToUser = async (api, object, receiverUserId) => {
|
|
6
6
|
var _api$values$user;
|
|
@@ -34,8 +34,8 @@ export const sendMessageToUser = async (api, object, receiverUserId) => {
|
|
|
34
34
|
}
|
|
35
35
|
});
|
|
36
36
|
};
|
|
37
|
-
/**
|
|
38
|
-
* @category Intercom functions
|
|
37
|
+
/**
|
|
38
|
+
* @category Intercom functions
|
|
39
39
|
*/
|
|
40
40
|
export const sendMessageToPage = async (api, object) => {
|
|
41
41
|
var _api$values$user2;
|
|
@@ -66,8 +66,8 @@ export const sendMessageToPage = async (api, object) => {
|
|
|
66
66
|
}
|
|
67
67
|
});
|
|
68
68
|
};
|
|
69
|
-
/**
|
|
70
|
-
* @category Intercom functions
|
|
69
|
+
/**
|
|
70
|
+
* @category Intercom functions
|
|
71
71
|
*/
|
|
72
72
|
export const sendMessageToGroup = async (api, object, groupId) => {
|
|
73
73
|
if (!object.text) {
|
|
@@ -96,8 +96,8 @@ export const sendMessageToGroup = async (api, object, groupId) => {
|
|
|
96
96
|
}
|
|
97
97
|
});
|
|
98
98
|
};
|
|
99
|
-
/**
|
|
100
|
-
* @category Intercom functions
|
|
99
|
+
/**
|
|
100
|
+
* @category Intercom functions
|
|
101
101
|
*/
|
|
102
102
|
function sendMessage(endpoint, token, body) {
|
|
103
103
|
return fetch(`${INTERCOM_URL}${endpoint}`, {
|
|
@@ -6,8 +6,8 @@ const handleVisibilityChange = () => {
|
|
|
6
6
|
});
|
|
7
7
|
};
|
|
8
8
|
|
|
9
|
-
/**
|
|
10
|
-
* @category Event listener
|
|
9
|
+
/**
|
|
10
|
+
* @category Event listener
|
|
11
11
|
*/
|
|
12
12
|
export const addVisibilityChangeListener = callback => {
|
|
13
13
|
const {
|
|
@@ -19,8 +19,8 @@ export const addVisibilityChangeListener = callback => {
|
|
|
19
19
|
}
|
|
20
20
|
return id;
|
|
21
21
|
};
|
|
22
|
-
/**
|
|
23
|
-
* @category Event listener
|
|
22
|
+
/**
|
|
23
|
+
* @category Event listener
|
|
24
24
|
*/
|
|
25
25
|
export const removeVisibilityChangeListener = id => {
|
|
26
26
|
const shouldRemove = removeApiListener(key, id);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { useContextSelector } from 'use-context-selector';
|
|
2
2
|
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
3
3
|
import { ChaynsFunctionsContext } from '../components/ChaynsContext';
|
|
4
|
-
/**
|
|
5
|
-
* @category Hooks
|
|
4
|
+
/**
|
|
5
|
+
* @category Hooks
|
|
6
6
|
*/
|
|
7
7
|
export const useGeoLocationListener = () => {
|
|
8
8
|
const addListener = useContextSelector(ChaynsFunctionsContext, v => v.addGeoLocationListener);
|
|
@@ -17,8 +17,8 @@ export const useGeoLocationListener = () => {
|
|
|
17
17
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
18
18
|
}, []);
|
|
19
19
|
};
|
|
20
|
-
/**
|
|
21
|
-
* @category Hooks
|
|
20
|
+
/**
|
|
21
|
+
* @category Hooks
|
|
22
22
|
*/
|
|
23
23
|
export const useGeoLocation = function () {
|
|
24
24
|
let {
|
|
@@ -2,8 +2,8 @@ import { useContextSelector } from 'use-context-selector';
|
|
|
2
2
|
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
3
3
|
import { ChaynsFunctionsContext } from '../components/ChaynsContext';
|
|
4
4
|
import { useWindowMetrics } from './windowMetricsListener';
|
|
5
|
-
/**
|
|
6
|
-
* @category Hooks
|
|
5
|
+
/**
|
|
6
|
+
* @category Hooks
|
|
7
7
|
*/
|
|
8
8
|
export const useScrollListener = () => {
|
|
9
9
|
const addListener = useContextSelector(ChaynsFunctionsContext, v => v.addScrollListener);
|
|
@@ -18,8 +18,8 @@ export const useScrollListener = () => {
|
|
|
18
18
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
19
19
|
}, []);
|
|
20
20
|
};
|
|
21
|
-
/**
|
|
22
|
-
* @category Hooks
|
|
21
|
+
/**
|
|
22
|
+
* @category Hooks
|
|
23
23
|
*/
|
|
24
24
|
export const useScrollPosition = function () {
|
|
25
25
|
let {
|
|
@@ -46,8 +46,8 @@ export const useScrollPosition = function () {
|
|
|
46
46
|
}, [getScrollPosition]);
|
|
47
47
|
return value;
|
|
48
48
|
};
|
|
49
|
-
/**
|
|
50
|
-
* @category Hooks
|
|
49
|
+
/**
|
|
50
|
+
* @category Hooks
|
|
51
51
|
*/
|
|
52
52
|
export const useScrollOffsetTop = function () {
|
|
53
53
|
let {
|
|
@@ -69,8 +69,8 @@ export const useScrollOffsetTop = function () {
|
|
|
69
69
|
}
|
|
70
70
|
return 0;
|
|
71
71
|
};
|
|
72
|
-
/**
|
|
73
|
-
* @category Hooks
|
|
72
|
+
/**
|
|
73
|
+
* @category Hooks
|
|
74
74
|
*/
|
|
75
75
|
export const useScrollOffsetBottom = function () {
|
|
76
76
|
let {
|
|
@@ -2,8 +2,8 @@ import { useEffect, useState } from "react";
|
|
|
2
2
|
import { useContextSelector } from "use-context-selector";
|
|
3
3
|
import { ChaynsFunctionsContext } from "../components/ChaynsContext";
|
|
4
4
|
|
|
5
|
-
/**
|
|
6
|
-
* @category Hooks
|
|
5
|
+
/**
|
|
6
|
+
* @category Hooks
|
|
7
7
|
*/
|
|
8
8
|
export const useAccessToken = accessToken => {
|
|
9
9
|
const [token, setToken] = useState(null);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useContextSelector } from 'use-context-selector';
|
|
2
2
|
import { ChaynsContext } from '../components/ChaynsContext';
|
|
3
3
|
|
|
4
|
-
/**
|
|
5
|
-
* @category Hooks
|
|
4
|
+
/**
|
|
5
|
+
* @category Hooks
|
|
6
6
|
*/
|
|
7
7
|
export const useCurrentPage = () => useContextSelector(ChaynsContext, v => v === null || v === void 0 ? void 0 : v.currentPage);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useContextSelector } from 'use-context-selector';
|
|
2
2
|
import { ChaynsContext } from '../components/ChaynsContext';
|
|
3
3
|
|
|
4
|
-
/**
|
|
5
|
-
* @category Hooks
|
|
4
|
+
/**
|
|
5
|
+
* @category Hooks
|
|
6
6
|
*/
|
|
7
7
|
export const useCustomData = () => useContextSelector(ChaynsContext, v => v === null || v === void 0 ? void 0 : v.customData);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useContextSelector } from 'use-context-selector';
|
|
2
2
|
import { ChaynsContext } from '../components/ChaynsContext';
|
|
3
|
-
/**
|
|
4
|
-
* @category Hooks
|
|
3
|
+
/**
|
|
4
|
+
* @category Hooks
|
|
5
5
|
*/
|
|
6
6
|
export const useDevice = () => useContextSelector(ChaynsContext, v => v === null || v === void 0 ? void 0 : v.device);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useContextSelector } from 'use-context-selector';
|
|
2
2
|
import { ChaynsContext } from '../components/ChaynsContext';
|
|
3
|
-
/**
|
|
4
|
-
* @category Hooks
|
|
3
|
+
/**
|
|
4
|
+
* @category Hooks
|
|
5
5
|
*/
|
|
6
6
|
export const useEnvironment = () => useContextSelector(ChaynsContext, v => v === null || v === void 0 ? void 0 : v.environment);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useContextSelector } from "use-context-selector";
|
|
2
2
|
import { ChaynsFunctionsContext } from "../components/ChaynsContext";
|
|
3
|
-
/**
|
|
4
|
-
* @category Hooks
|
|
3
|
+
/**
|
|
4
|
+
* @category Hooks
|
|
5
5
|
*/
|
|
6
6
|
export const useFunctions = () => {
|
|
7
7
|
const t = useContextSelector(ChaynsFunctionsContext, f => f || {});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useContextSelector } from 'use-context-selector';
|
|
2
2
|
import { ChaynsContext } from '../components/ChaynsContext';
|
|
3
|
-
/**
|
|
4
|
-
* @category Hooks
|
|
3
|
+
/**
|
|
4
|
+
* @category Hooks
|
|
5
5
|
*/
|
|
6
6
|
export const useLanguage = () => useContextSelector(ChaynsContext, v => v === null || v === void 0 ? void 0 : v.language);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { useContextSelector } from 'use-context-selector';
|
|
2
2
|
import { ChaynsContext } from '../components/ChaynsContext';
|
|
3
3
|
import { moduleWrapper } from "../components/ChaynsProvider";
|
|
4
|
-
/**
|
|
5
|
-
* @category Hooks
|
|
4
|
+
/**
|
|
5
|
+
* @category Hooks
|
|
6
6
|
*/
|
|
7
7
|
export const usePages = function () {
|
|
8
8
|
let {
|
|
@@ -16,8 +16,8 @@ export const usePages = function () {
|
|
|
16
16
|
}
|
|
17
17
|
return pages;
|
|
18
18
|
};
|
|
19
|
-
/**
|
|
20
|
-
* @category Hooks
|
|
19
|
+
/**
|
|
20
|
+
* @category Hooks
|
|
21
21
|
*/
|
|
22
22
|
export const usePage = _ref => {
|
|
23
23
|
let {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useContextSelector } from 'use-context-selector';
|
|
2
2
|
import { ChaynsContext } from '../components/ChaynsContext';
|
|
3
|
-
/**
|
|
4
|
-
* @category Hooks
|
|
3
|
+
/**
|
|
4
|
+
* @category Hooks
|
|
5
5
|
*/
|
|
6
6
|
export const useParameters = () => useContextSelector(ChaynsContext, v => (v === null || v === void 0 ? void 0 : v.parameters) || []);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useContextSelector } from 'use-context-selector';
|
|
2
2
|
import { ChaynsContext } from '../components/ChaynsContext';
|
|
3
|
-
/**
|
|
4
|
-
* @category Hooks
|
|
3
|
+
/**
|
|
4
|
+
* @category Hooks
|
|
5
5
|
*/
|
|
6
6
|
export const useSite = () => useContextSelector(ChaynsContext, v => v === null || v === void 0 ? void 0 : v.site);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useContextSelector } from 'use-context-selector';
|
|
2
2
|
import { ChaynsContext } from '../components/ChaynsContext';
|
|
3
|
-
/**
|
|
4
|
-
* @category Hooks
|
|
3
|
+
/**
|
|
4
|
+
* @category Hooks
|
|
5
5
|
*/
|
|
6
6
|
export const useUser = () => useContextSelector(ChaynsContext, v => (v === null || v === void 0 ? void 0 : v.user) || {});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useContextSelector } from 'use-context-selector';
|
|
2
2
|
import { ChaynsContext } from '../components/ChaynsContext';
|
|
3
|
-
/**
|
|
4
|
-
* @category Hooks
|
|
3
|
+
/**
|
|
4
|
+
* @category Hooks
|
|
5
5
|
*/
|
|
6
6
|
export const useValues = () => {
|
|
7
7
|
const t = useContextSelector(ChaynsContext, v => v || {});
|
|
@@ -2,8 +2,8 @@ import { useContextSelector } from 'use-context-selector';
|
|
|
2
2
|
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
3
3
|
import { ChaynsFunctionsContext } from '../components/ChaynsContext';
|
|
4
4
|
import { ScreenSize } from '../types/IChaynsReact';
|
|
5
|
-
/**
|
|
6
|
-
* @category Hooks
|
|
5
|
+
/**
|
|
6
|
+
* @category Hooks
|
|
7
7
|
*/
|
|
8
8
|
export const useWindowMetricsListener = () => {
|
|
9
9
|
const addListener = useContextSelector(ChaynsFunctionsContext, v => v.addWindowMetricsListener);
|
|
@@ -18,8 +18,8 @@ export const useWindowMetricsListener = () => {
|
|
|
18
18
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
19
19
|
}, []);
|
|
20
20
|
};
|
|
21
|
-
/**
|
|
22
|
-
* @category Hooks
|
|
21
|
+
/**
|
|
22
|
+
* @category Hooks
|
|
23
23
|
*/
|
|
24
24
|
export const useWindowMetrics = function () {
|
|
25
25
|
let {
|
|
@@ -11,7 +11,7 @@ const getDeviceInfo = (userAgent, acceptHeader) => {
|
|
|
11
11
|
appName = AppName.David;
|
|
12
12
|
} else if (match) {
|
|
13
13
|
appName = AppName.Location;
|
|
14
|
-
} else if (/dface|h96pp|h96max|jabiru|chaynsterminal|wayter|odroidn2p/i.test(
|
|
14
|
+
} else if (/dface|h96pp|h96max|jabiru|chaynsterminal|wayter|odroidn2p/i.test(userAgent)) {
|
|
15
15
|
appName = AppName.ChaynsLauncher;
|
|
16
16
|
}
|
|
17
17
|
const result = {};
|