chayns-api 1.0.35 → 1.0.37
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/date.js +28 -0
- package/dist/cjs/calls/index.js +70 -65
- package/dist/cjs/components/ChaynsProvider.js +5 -7
- package/dist/cjs/components/moduleWrapper.js +10 -0
- package/dist/cjs/components/withCompatMode.js +1 -1
- package/dist/cjs/hooks/useDialogState.js +2 -2
- package/dist/cjs/hooks/usePages.js +2 -2
- package/dist/cjs/index.js +8 -0
- package/dist/cjs/types/IChaynsReact.js +136 -123
- package/dist/cjs/util/appCall.js +2 -2
- package/dist/cjs/util/deviceHelper.js +3 -3
- package/dist/cjs/wrapper/FrameWrapper.js +4 -0
- package/dist/cjs/wrapper/StaticChaynsApi.js +23 -0
- package/dist/esm/calls/dialogs/date.js +0 -1
- package/dist/esm/calls/index.js +7 -1
- package/dist/esm/components/ChaynsProvider.js +3 -4
- package/dist/esm/components/moduleWrapper.js +3 -0
- package/dist/esm/hooks/useDialogState.js +2 -2
- package/dist/esm/hooks/usePages.js +1 -1
- package/dist/esm/index.js +1 -0
- package/dist/esm/types/IChaynsReact.js +114 -99
- package/dist/esm/util/appCall.js +2 -2
- package/dist/esm/util/deviceHelper.js +3 -3
- package/dist/esm/wrapper/FrameWrapper.js +4 -0
- package/dist/esm/wrapper/StaticChaynsApi.js +20 -0
- package/dist/types/calls/index.d.ts +4 -0
- package/dist/types/components/AppDialogWrapper.d.ts +2 -2
- package/dist/types/components/ChaynsProvider.d.ts +1 -4
- package/dist/types/components/moduleWrapper.d.ts +4 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/types/IChaynsReact.d.ts +19 -2
- package/dist/types/wrapper/StaticChaynsApi.d.ts +9 -0
- package/package.json +3 -1
- package/toolkit.config.js +20 -0
|
@@ -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,
|
package/dist/cjs/calls/index.js
CHANGED
|
@@ -3,262 +3,267 @@
|
|
|
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.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.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
26
|
* This adds a listener to get the actual height of the page.
|
|
27
27
|
* @category Event listener
|
|
28
28
|
*/
|
|
29
29
|
exports.addVisibilityChangeListener = addVisibilityChangeListener;
|
|
30
|
-
const addWindowMetricsListener = (...args) =>
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
const addWindowMetricsListener = (...args) => _moduleWrapper.moduleWrapper.current.functions.addWindowMetricsListener(...args); /**
|
|
31
|
+
* Allows a custom callback function to be defined
|
|
32
|
+
*/
|
|
33
33
|
exports.addWindowMetricsListener = addWindowMetricsListener;
|
|
34
|
-
const customCallbackFunction = (...args) =>
|
|
34
|
+
const customCallbackFunction = (...args) => _moduleWrapper.moduleWrapper.current.functions.customCallbackFunction(...args);
|
|
35
35
|
/**
|
|
36
36
|
* Get the accessToken from the user.
|
|
37
37
|
*/
|
|
38
38
|
exports.customCallbackFunction = customCallbackFunction;
|
|
39
|
-
const getAccessToken = (...args) =>
|
|
39
|
+
const getAccessToken = (...args) => _moduleWrapper.moduleWrapper.current.functions.getAccessToken(...args);
|
|
40
40
|
/**
|
|
41
41
|
* This method returns a list of installed share/social media apps.
|
|
42
42
|
*/
|
|
43
43
|
exports.getAccessToken = getAccessToken;
|
|
44
|
-
const getAvailableSharingServices = (...args) =>
|
|
44
|
+
const getAvailableSharingServices = (...args) => _moduleWrapper.moduleWrapper.current.functions.getAvailableSharingServices(...args);
|
|
45
45
|
/**
|
|
46
46
|
* This method determines your location. If you want to track a route, use addGeoLocationListener.
|
|
47
47
|
*/
|
|
48
48
|
exports.getAvailableSharingServices = getAvailableSharingServices;
|
|
49
|
-
const getGeoLocation = (...args) =>
|
|
49
|
+
const getGeoLocation = (...args) => _moduleWrapper.moduleWrapper.current.functions.getGeoLocation(...args);
|
|
50
50
|
/**
|
|
51
51
|
* This method returns user information for a specific user.
|
|
52
52
|
* @category User functions
|
|
53
53
|
*/
|
|
54
54
|
exports.getGeoLocation = getGeoLocation;
|
|
55
|
-
const getUserInfo = (...args) =>
|
|
55
|
+
const getUserInfo = (...args) => _moduleWrapper.moduleWrapper.current.functions.getUserInfo(...args);
|
|
56
56
|
/**
|
|
57
57
|
* Return the current scroll position of the top frame
|
|
58
58
|
*/
|
|
59
59
|
exports.getUserInfo = getUserInfo;
|
|
60
|
-
const getScrollPosition = (...args) =>
|
|
60
|
+
const getScrollPosition = (...args) => _moduleWrapper.moduleWrapper.current.functions.getScrollPosition(...args);
|
|
61
61
|
/**
|
|
62
62
|
* Returns the window metrics.
|
|
63
63
|
*/
|
|
64
64
|
exports.getScrollPosition = getScrollPosition;
|
|
65
|
-
const getWindowMetrics = (...args) =>
|
|
65
|
+
const getWindowMetrics = (...args) => _moduleWrapper.moduleWrapper.current.functions.getWindowMetrics(...args);
|
|
66
66
|
/** @internal */
|
|
67
67
|
exports.getWindowMetrics = getWindowMetrics;
|
|
68
|
-
const invokeCall = (...args) =>
|
|
68
|
+
const invokeCall = (...args) => _moduleWrapper.moduleWrapper.current.functions.invokeCall(...args);
|
|
69
69
|
/** @internal */
|
|
70
70
|
exports.invokeCall = invokeCall;
|
|
71
|
-
const invokeDialogCall = (...args) =>
|
|
71
|
+
const invokeDialogCall = (...args) => _moduleWrapper.moduleWrapper.current.functions.invokeDialogCall(...args);
|
|
72
72
|
/**
|
|
73
73
|
* This method will show a login dialog where the user has the opportunity to log in.
|
|
74
74
|
*/
|
|
75
75
|
exports.invokeDialogCall = invokeDialogCall;
|
|
76
|
-
const login = (...args) =>
|
|
76
|
+
const login = (...args) => _moduleWrapper.moduleWrapper.current.functions.login(...args);
|
|
77
77
|
/**
|
|
78
78
|
* This method will logout the user
|
|
79
79
|
*/
|
|
80
80
|
exports.login = login;
|
|
81
|
-
const logout = (...args) =>
|
|
81
|
+
const logout = (...args) => _moduleWrapper.moduleWrapper.current.functions.logout(...args);
|
|
82
82
|
/**
|
|
83
83
|
* This function navigates you to the previous site.
|
|
84
84
|
*/
|
|
85
85
|
exports.logout = logout;
|
|
86
|
-
const navigateBack = (...args) =>
|
|
86
|
+
const navigateBack = (...args) => _moduleWrapper.moduleWrapper.current.functions.navigateBack(...args);
|
|
87
87
|
/**
|
|
88
88
|
* The images specified in the url array is shown in gallery mode.
|
|
89
89
|
*/
|
|
90
90
|
exports.navigateBack = navigateBack;
|
|
91
|
-
const openImage = (...args) =>
|
|
91
|
+
const openImage = (...args) => _moduleWrapper.moduleWrapper.current.functions.openImage(...args);
|
|
92
92
|
/**
|
|
93
|
-
*
|
|
93
|
+
* The images and videos specified in the items array is shown in gallery mode.
|
|
94
94
|
*/
|
|
95
95
|
exports.openImage = openImage;
|
|
96
|
-
const
|
|
96
|
+
const openMedia = (...args) => _moduleWrapper.moduleWrapper.current.functions.openMedia(...args);
|
|
97
|
+
/**
|
|
98
|
+
* Opens an URL in the chayns environment.
|
|
99
|
+
*/
|
|
100
|
+
exports.openMedia = openMedia;
|
|
101
|
+
const openUrl = (...args) => _moduleWrapper.moduleWrapper.current.functions.openUrl(...args);
|
|
97
102
|
/**
|
|
98
103
|
* The video specified in the URL is shown in video mode.
|
|
99
104
|
*/
|
|
100
105
|
exports.openUrl = openUrl;
|
|
101
|
-
const openVideo = (...args) =>
|
|
106
|
+
const openVideo = (...args) => _moduleWrapper.moduleWrapper.current.functions.openVideo(...args);
|
|
102
107
|
/**
|
|
103
108
|
* Refresh badge count in navigation, user information and pages
|
|
104
109
|
*/
|
|
105
110
|
exports.openVideo = openVideo;
|
|
106
|
-
const refreshData = (...args) =>
|
|
111
|
+
const refreshData = (...args) => _moduleWrapper.moduleWrapper.current.functions.refreshData(...args);
|
|
107
112
|
/**
|
|
108
113
|
* Refresh accesstoken, should only be used when user object changes, not when token is invalid
|
|
109
114
|
*/
|
|
110
115
|
exports.refreshData = refreshData;
|
|
111
|
-
const refreshAccessToken = (...args) =>
|
|
116
|
+
const refreshAccessToken = (...args) => _moduleWrapper.moduleWrapper.current.functions.refreshAccessToken(...args);
|
|
112
117
|
/**
|
|
113
118
|
* This removes a listener to determine your location.
|
|
114
119
|
* @category Event listener
|
|
115
120
|
*/
|
|
116
121
|
exports.refreshAccessToken = refreshAccessToken;
|
|
117
|
-
const removeGeoLocationListener = (...args) =>
|
|
122
|
+
const removeGeoLocationListener = (...args) => _moduleWrapper.moduleWrapper.current.functions.removeGeoLocationListener(...args);
|
|
118
123
|
/**
|
|
119
124
|
* Removes scroll listener.
|
|
120
125
|
* @category Event listener
|
|
121
126
|
*/
|
|
122
127
|
exports.removeGeoLocationListener = removeGeoLocationListener;
|
|
123
|
-
const removeScrollListener = (...args) =>
|
|
128
|
+
const removeScrollListener = (...args) => _moduleWrapper.moduleWrapper.current.functions.removeScrollListener(...args);
|
|
124
129
|
/**
|
|
125
130
|
* Removes visibility change listener.
|
|
126
131
|
* @category Event listener
|
|
127
132
|
*/
|
|
128
133
|
exports.removeScrollListener = removeScrollListener;
|
|
129
|
-
const removeVisibilityChangeListener = (...args) =>
|
|
134
|
+
const removeVisibilityChangeListener = (...args) => _moduleWrapper.moduleWrapper.current.functions.removeVisibilityChangeListener(...args);
|
|
130
135
|
/**
|
|
131
136
|
* Removes window metrics listener.
|
|
132
137
|
* @category Event listener
|
|
133
138
|
*/
|
|
134
139
|
exports.removeVisibilityChangeListener = removeVisibilityChangeListener;
|
|
135
|
-
const removeWindowMetricsListener = (...args) =>
|
|
140
|
+
const removeWindowMetricsListener = (...args) => _moduleWrapper.moduleWrapper.current.functions.removeWindowMetricsListener(...args);
|
|
136
141
|
/**
|
|
137
142
|
* Select other page on chayns site.
|
|
138
143
|
*/
|
|
139
144
|
exports.removeWindowMetricsListener = removeWindowMetricsListener;
|
|
140
|
-
const selectPage = (...args) =>
|
|
145
|
+
const selectPage = (...args) => _moduleWrapper.moduleWrapper.current.functions.selectPage(...args);
|
|
141
146
|
/**
|
|
142
147
|
* Scrolls by specific amount.
|
|
143
148
|
*/
|
|
144
149
|
exports.selectPage = selectPage;
|
|
145
|
-
const scrollByY = (...args) =>
|
|
150
|
+
const scrollByY = (...args) => _moduleWrapper.moduleWrapper.current.functions.scrollByY(...args);
|
|
146
151
|
/**
|
|
147
152
|
* Scrolls to specific position.
|
|
148
153
|
*/
|
|
149
154
|
exports.scrollByY = scrollByY;
|
|
150
|
-
const scrollToY = (...args) =>
|
|
155
|
+
const scrollToY = (...args) => _moduleWrapper.moduleWrapper.current.functions.scrollToY(...args);
|
|
151
156
|
/**
|
|
152
157
|
* Sends intercom message to group.
|
|
153
158
|
*/
|
|
154
159
|
exports.scrollToY = scrollToY;
|
|
155
|
-
const sendMessageToGroup = (...args) =>
|
|
160
|
+
const sendMessageToGroup = (...args) => _moduleWrapper.moduleWrapper.current.functions.sendMessageToGroup(...args);
|
|
156
161
|
/**
|
|
157
162
|
* Sends intercom message to page.
|
|
158
163
|
*/
|
|
159
164
|
exports.sendMessageToGroup = sendMessageToGroup;
|
|
160
|
-
const sendMessageToPage = (...args) =>
|
|
165
|
+
const sendMessageToPage = (...args) => _moduleWrapper.moduleWrapper.current.functions.sendMessageToPage(...args);
|
|
161
166
|
/**
|
|
162
167
|
* Sends intercom message to an user.
|
|
163
168
|
*/
|
|
164
169
|
exports.sendMessageToPage = sendMessageToPage;
|
|
165
|
-
const sendMessageToUser = (...args) =>
|
|
170
|
+
const sendMessageToUser = (...args) => _moduleWrapper.moduleWrapper.current.functions.sendMessageToUser(...args);
|
|
166
171
|
/**
|
|
167
172
|
* Switches admin mode, also toggles admin switch in top frame.
|
|
168
173
|
*/
|
|
169
174
|
exports.sendMessageToUser = sendMessageToUser;
|
|
170
|
-
const setAdminMode = (...args) =>
|
|
175
|
+
const setAdminMode = (...args) => _moduleWrapper.moduleWrapper.current.functions.setAdminMode(...args);
|
|
171
176
|
/**
|
|
172
177
|
* Sets the display timeout, only works in chayns App.
|
|
173
178
|
*/
|
|
174
179
|
exports.setAdminMode = setAdminMode;
|
|
175
|
-
const setDisplayTimeout = (...args) =>
|
|
180
|
+
const setDisplayTimeout = (...args) => _moduleWrapper.moduleWrapper.current.functions.setDisplayTimeout(...args);
|
|
176
181
|
/**
|
|
177
182
|
* Enables or disables a button which floats over the page.
|
|
178
183
|
*/
|
|
179
184
|
exports.setDisplayTimeout = setDisplayTimeout;
|
|
180
|
-
const setFloatingButton = (...args) =>
|
|
185
|
+
const setFloatingButton = (...args) => _moduleWrapper.moduleWrapper.current.functions.setFloatingButton(...args);
|
|
181
186
|
/**
|
|
182
187
|
* Sets the height of the page.
|
|
183
188
|
*/
|
|
184
189
|
exports.setFloatingButton = setFloatingButton;
|
|
185
|
-
const setHeight = (...args) =>
|
|
190
|
+
const setHeight = (...args) => _moduleWrapper.moduleWrapper.current.functions.setHeight(...args);
|
|
186
191
|
/**
|
|
187
192
|
* Enables or disables the ability to refresh a page
|
|
188
193
|
*/
|
|
189
194
|
exports.setHeight = setHeight;
|
|
190
|
-
const setRefreshScrollEnabled = (...args) =>
|
|
195
|
+
const setRefreshScrollEnabled = (...args) => _moduleWrapper.moduleWrapper.current.functions.setRefreshScrollEnabled(...args);
|
|
191
196
|
/**
|
|
192
197
|
* Scans a qr-code and returns the result
|
|
193
198
|
*/
|
|
194
199
|
exports.setRefreshScrollEnabled = setRefreshScrollEnabled;
|
|
195
|
-
const setScanQrCode = (...args) =>
|
|
200
|
+
const setScanQrCode = (...args) => _moduleWrapper.moduleWrapper.current.functions.setScanQrCode(...args);
|
|
196
201
|
/**
|
|
197
202
|
* Temporarily change design settings in top frame
|
|
198
203
|
*/
|
|
199
204
|
exports.setScanQrCode = setScanQrCode;
|
|
200
|
-
const setTempDesignSettings = (...args) =>
|
|
205
|
+
const setTempDesignSettings = (...args) => _moduleWrapper.moduleWrapper.current.functions.setTempDesignSettings(...args);
|
|
201
206
|
/**
|
|
202
207
|
* Shows or hide a waitcursor
|
|
203
208
|
*/
|
|
204
209
|
exports.setTempDesignSettings = setTempDesignSettings;
|
|
205
|
-
const setWaitCursor = (...args) =>
|
|
210
|
+
const setWaitCursor = (...args) => _moduleWrapper.moduleWrapper.current.functions.setWaitCursor(...args);
|
|
206
211
|
/**
|
|
207
212
|
* Retrieves the value that is assigned to the key from a storage outside the frame
|
|
208
213
|
*/
|
|
209
214
|
exports.setWaitCursor = setWaitCursor;
|
|
210
|
-
const storageGetItem = (...args) =>
|
|
215
|
+
const storageGetItem = (...args) => _moduleWrapper.moduleWrapper.current.functions.storageGetItem(...args);
|
|
211
216
|
/**
|
|
212
217
|
* Removes the value that is assigned to the key from a storage outside the frame
|
|
213
218
|
*/
|
|
214
219
|
exports.storageGetItem = storageGetItem;
|
|
215
|
-
const storageRemoveItem = (...args) =>
|
|
220
|
+
const storageRemoveItem = (...args) => _moduleWrapper.moduleWrapper.current.functions.storageRemoveItem(...args);
|
|
216
221
|
/**
|
|
217
222
|
* Sets the value that is assigned to the key from a storage outside the frame
|
|
218
223
|
*/
|
|
219
224
|
exports.storageRemoveItem = storageRemoveItem;
|
|
220
|
-
const storageSetItem = (...args) =>
|
|
225
|
+
const storageSetItem = (...args) => _moduleWrapper.moduleWrapper.current.functions.storageSetItem(...args);
|
|
221
226
|
/**
|
|
222
227
|
* This method lets a smartphone vibrate for the given time.
|
|
223
228
|
*/
|
|
224
229
|
exports.storageSetItem = storageSetItem;
|
|
225
|
-
const vibrate = (...args) =>
|
|
230
|
+
const vibrate = (...args) => _moduleWrapper.moduleWrapper.current.functions.vibrate(...args);
|
|
226
231
|
/**
|
|
227
232
|
* This method creates a dialog
|
|
228
233
|
*/
|
|
229
234
|
exports.vibrate = vibrate;
|
|
230
|
-
const createDialog = (...args) =>
|
|
235
|
+
const createDialog = (...args) => _moduleWrapper.moduleWrapper.current.functions.createDialog(...args);
|
|
231
236
|
/**
|
|
232
237
|
* Displays an overlay
|
|
233
238
|
*/
|
|
234
239
|
exports.createDialog = createDialog;
|
|
235
|
-
const setOverlay = (...args) =>
|
|
240
|
+
const setOverlay = (...args) => _moduleWrapper.moduleWrapper.current.functions.setOverlay(...args);
|
|
236
241
|
/**
|
|
237
242
|
* Returns user information, only when user is logged in
|
|
238
243
|
* @category User functions
|
|
239
244
|
*/
|
|
240
245
|
exports.setOverlay = setOverlay;
|
|
241
|
-
const getUser = () =>
|
|
246
|
+
const getUser = () => _moduleWrapper.moduleWrapper.current.values.user;
|
|
242
247
|
exports.getUser = getUser;
|
|
243
|
-
const getSite = () =>
|
|
248
|
+
const getSite = () => _moduleWrapper.moduleWrapper.current.values.site;
|
|
244
249
|
exports.getSite = getSite;
|
|
245
|
-
const getCurrentPage = () =>
|
|
250
|
+
const getCurrentPage = () => _moduleWrapper.moduleWrapper.current.values.currentPage;
|
|
246
251
|
exports.getCurrentPage = getCurrentPage;
|
|
247
|
-
const getDevice = () =>
|
|
252
|
+
const getDevice = () => _moduleWrapper.moduleWrapper.current.values.device;
|
|
248
253
|
exports.getDevice = getDevice;
|
|
249
|
-
const getLanguage = () =>
|
|
254
|
+
const getLanguage = () => _moduleWrapper.moduleWrapper.current.values.language;
|
|
250
255
|
exports.getLanguage = getLanguage;
|
|
251
|
-
const getParameters = () =>
|
|
256
|
+
const getParameters = () => _moduleWrapper.moduleWrapper.current.values.parameters;
|
|
252
257
|
exports.getParameters = getParameters;
|
|
253
|
-
const getPages = () =>
|
|
258
|
+
const getPages = () => _moduleWrapper.moduleWrapper.current.values.pages;
|
|
254
259
|
exports.getPages = getPages;
|
|
255
|
-
const getEnvironment = () =>
|
|
260
|
+
const getEnvironment = () => _moduleWrapper.moduleWrapper.current.values.environment;
|
|
256
261
|
exports.getEnvironment = getEnvironment;
|
|
257
262
|
const user = new Proxy({}, {
|
|
258
263
|
get: (target, prop) => {
|
|
259
264
|
var _moduleWrapper$curren;
|
|
260
265
|
console.warn('Deprecated user import');
|
|
261
|
-
return (_moduleWrapper$curren =
|
|
266
|
+
return (_moduleWrapper$curren = _moduleWrapper.moduleWrapper.current.values.user) === null || _moduleWrapper$curren === void 0 ? void 0 : _moduleWrapper$curren[prop];
|
|
262
267
|
}
|
|
263
268
|
});
|
|
264
269
|
exports.user = user;
|
|
@@ -266,7 +271,7 @@ const site = new Proxy({}, {
|
|
|
266
271
|
get: (target, prop) => {
|
|
267
272
|
var _moduleWrapper$curren2;
|
|
268
273
|
console.warn('Deprecated site import');
|
|
269
|
-
return (_moduleWrapper$curren2 =
|
|
274
|
+
return (_moduleWrapper$curren2 = _moduleWrapper.moduleWrapper.current.values.site) === null || _moduleWrapper$curren2 === void 0 ? void 0 : _moduleWrapper$curren2[prop];
|
|
270
275
|
}
|
|
271
276
|
});
|
|
272
277
|
exports.site = site;
|
|
@@ -274,7 +279,7 @@ const device = new Proxy({}, {
|
|
|
274
279
|
get: (target, prop) => {
|
|
275
280
|
var _moduleWrapper$curren3;
|
|
276
281
|
console.warn('Deprecated device import');
|
|
277
|
-
return (_moduleWrapper$curren3 =
|
|
282
|
+
return (_moduleWrapper$curren3 = _moduleWrapper.moduleWrapper.current.values.device) === null || _moduleWrapper$curren3 === void 0 ? void 0 : _moduleWrapper$curren3[prop];
|
|
278
283
|
}
|
|
279
284
|
});
|
|
280
285
|
exports.device = device;
|
|
@@ -282,7 +287,7 @@ const language = new Proxy({}, {
|
|
|
282
287
|
get: (target, prop) => {
|
|
283
288
|
var _moduleWrapper$curren4;
|
|
284
289
|
console.warn('Deprecated language import');
|
|
285
|
-
return (_moduleWrapper$curren4 =
|
|
290
|
+
return (_moduleWrapper$curren4 = _moduleWrapper.moduleWrapper.current.values.language) === null || _moduleWrapper$curren4 === void 0 ? void 0 : _moduleWrapper$curren4[prop];
|
|
286
291
|
}
|
|
287
292
|
});
|
|
288
293
|
exports.language = language;
|
|
@@ -290,7 +295,7 @@ const parameters = new Proxy({}, {
|
|
|
290
295
|
get: (target, prop) => {
|
|
291
296
|
var _moduleWrapper$curren5;
|
|
292
297
|
console.warn('Deprecated parameters import');
|
|
293
|
-
return (_moduleWrapper$curren5 =
|
|
298
|
+
return (_moduleWrapper$curren5 = _moduleWrapper.moduleWrapper.current.values.parameters) === null || _moduleWrapper$curren5 === void 0 ? void 0 : _moduleWrapper$curren5[prop];
|
|
294
299
|
}
|
|
295
300
|
});
|
|
296
301
|
exports.parameters = parameters;
|
|
@@ -298,7 +303,7 @@ const pages = new Proxy({}, {
|
|
|
298
303
|
get: (target, prop) => {
|
|
299
304
|
var _moduleWrapper$curren6;
|
|
300
305
|
console.warn('Deprecated pages import');
|
|
301
|
-
return (_moduleWrapper$curren6 =
|
|
306
|
+
return (_moduleWrapper$curren6 = _moduleWrapper.moduleWrapper.current.values.pages) === null || _moduleWrapper$curren6 === void 0 ? void 0 : _moduleWrapper$curren6[prop];
|
|
302
307
|
}
|
|
303
308
|
});
|
|
304
309
|
exports.pages = pages;
|
|
@@ -306,7 +311,7 @@ const environment = new Proxy({}, {
|
|
|
306
311
|
get: (target, prop) => {
|
|
307
312
|
var _moduleWrapper$curren7;
|
|
308
313
|
console.warn('Deprecated environment import');
|
|
309
|
-
return (_moduleWrapper$curren7 =
|
|
314
|
+
return (_moduleWrapper$curren7 = _moduleWrapper.moduleWrapper.current.values.environment) === null || _moduleWrapper$curren7 === void 0 ? void 0 : _moduleWrapper$curren7[prop];
|
|
310
315
|
}
|
|
311
316
|
});
|
|
312
317
|
exports.environment = environment;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.default = void 0;
|
|
7
7
|
var _htmlescape = _interopRequireDefault(require("htmlescape"));
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
var _IChaynsReact = require("../types/IChaynsReact");
|
|
@@ -14,14 +14,12 @@ var _ModuleFederationWrapper = require("../wrapper/ModuleFederationWrapper");
|
|
|
14
14
|
var _SsrWrapper = require("../wrapper/SsrWrapper");
|
|
15
15
|
var _ChaynsContext = require("./ChaynsContext");
|
|
16
16
|
var _AppDialogWrapper = _interopRequireDefault(require("./AppDialogWrapper"));
|
|
17
|
+
var _moduleWrapper = require("./moduleWrapper");
|
|
17
18
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
18
19
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
19
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
20
21
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
21
|
-
|
|
22
|
-
current: undefined
|
|
23
|
-
};
|
|
24
|
-
exports.moduleWrapper = moduleWrapper;
|
|
22
|
+
|
|
25
23
|
const isServer = typeof window === 'undefined';
|
|
26
24
|
const InitialDataProvider = /*#__PURE__*/_react.default.memo(({
|
|
27
25
|
data,
|
|
@@ -71,7 +69,7 @@ const ChaynsProvider = ({
|
|
|
71
69
|
customWrapper.current = new _FrameWrapper.FrameWrapper();
|
|
72
70
|
}
|
|
73
71
|
}
|
|
74
|
-
moduleWrapper.current = customWrapper.current;
|
|
72
|
+
_moduleWrapper.moduleWrapper.current = customWrapper.current;
|
|
75
73
|
}
|
|
76
74
|
const [state, setState] = (0, _react.useState)((_customWrapper$curren = (_customWrapper$curren2 = customWrapper.current) === null || _customWrapper$curren2 === void 0 ? void 0 : _customWrapper$curren2.values) !== null && _customWrapper$curren !== void 0 ? _customWrapper$curren : undefined);
|
|
77
75
|
(0, _react.useEffect)(() => {
|
|
@@ -100,7 +98,7 @@ const ChaynsProvider = ({
|
|
|
100
98
|
if (isModule) {
|
|
101
99
|
setState(data);
|
|
102
100
|
if (data) {
|
|
103
|
-
moduleWrapper.current.values = data;
|
|
101
|
+
_moduleWrapper.moduleWrapper.current.values = data;
|
|
104
102
|
}
|
|
105
103
|
}
|
|
106
104
|
}, [data, isModule]);
|
|
@@ -9,7 +9,7 @@ var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
|
9
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
10
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
11
11
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
12
|
-
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); }
|
|
12
|
+
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); } /* eslint-disable react/jsx-props-no-spreading */
|
|
13
13
|
let ReactDOMClient;
|
|
14
14
|
try {
|
|
15
15
|
ReactDOMClient = require('react-dom/client');
|
|
@@ -15,7 +15,7 @@ const useDialogState = () => {
|
|
|
15
15
|
const addDataListener = (0, _useContextSelector.useContextSelector)(_ChaynsContext.ChaynsFunctionsContext, v => v === null || v === void 0 ? void 0 : v.addDialogHostEventListener);
|
|
16
16
|
const isClosingRequested = (0, _useContextSelector.useContextSelector)(_ChaynsContext.ChaynsContext, v => {
|
|
17
17
|
var _v$dialog;
|
|
18
|
-
return v === null || v === void 0
|
|
18
|
+
return v === null || v === void 0 || (_v$dialog = v.dialog) === null || _v$dialog === void 0 ? void 0 : _v$dialog.isClosingRequested;
|
|
19
19
|
});
|
|
20
20
|
return {
|
|
21
21
|
setResult,
|
|
@@ -32,7 +32,7 @@ exports.useDialogState = useDialogState;
|
|
|
32
32
|
const useDialogData = () => {
|
|
33
33
|
const inputData = (0, _useContextSelector.useContextSelector)(_ChaynsContext.ChaynsContext, v => {
|
|
34
34
|
var _v$dialog2;
|
|
35
|
-
return v === null || v === void 0
|
|
35
|
+
return v === null || v === void 0 || (_v$dialog2 = v.dialog) === null || _v$dialog2 === void 0 ? void 0 : _v$dialog2.dialogInput;
|
|
36
36
|
});
|
|
37
37
|
return inputData;
|
|
38
38
|
};
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.usePages = exports.usePage = exports.getPage = void 0;
|
|
7
7
|
var _useContextSelector = require("use-context-selector");
|
|
8
8
|
var _ChaynsContext = require("../components/ChaynsContext");
|
|
9
|
-
var
|
|
9
|
+
var _moduleWrapper = require("../components/moduleWrapper");
|
|
10
10
|
/**
|
|
11
11
|
* @category Hooks
|
|
12
12
|
*/
|
|
@@ -48,7 +48,7 @@ const getPage = ({
|
|
|
48
48
|
const {
|
|
49
49
|
pages,
|
|
50
50
|
currentPage
|
|
51
|
-
} =
|
|
51
|
+
} = _moduleWrapper.moduleWrapper.current.values;
|
|
52
52
|
if (id) {
|
|
53
53
|
var _pages$find2;
|
|
54
54
|
return (_pages$find2 = pages.find(x => x.id === id && (!siteId || x.siteId === siteId))) !== null && _pages$find2 !== void 0 ? _pages$find2 : null;
|
package/dist/cjs/index.js
CHANGED
|
@@ -10,6 +10,7 @@ var _exportNames = {
|
|
|
10
10
|
getClientDeviceInfo: true,
|
|
11
11
|
ChaynsHost: true,
|
|
12
12
|
withCompatMode: true,
|
|
13
|
+
StaticChaynsApi: true,
|
|
13
14
|
DialogHandler: true,
|
|
14
15
|
dialog: true
|
|
15
16
|
};
|
|
@@ -31,6 +32,12 @@ Object.defineProperty(exports, "DialogHandler", {
|
|
|
31
32
|
return _DialogHandler.default;
|
|
32
33
|
}
|
|
33
34
|
});
|
|
35
|
+
Object.defineProperty(exports, "StaticChaynsApi", {
|
|
36
|
+
enumerable: true,
|
|
37
|
+
get: function () {
|
|
38
|
+
return _StaticChaynsApi.default;
|
|
39
|
+
}
|
|
40
|
+
});
|
|
34
41
|
exports.dialog = exports.default = void 0;
|
|
35
42
|
Object.defineProperty(exports, "getClientDeviceInfo", {
|
|
36
43
|
enumerable: true,
|
|
@@ -120,6 +127,7 @@ Object.keys(_IChaynsReact).forEach(function (key) {
|
|
|
120
127
|
}
|
|
121
128
|
});
|
|
122
129
|
});
|
|
130
|
+
var _StaticChaynsApi = _interopRequireDefault(require("./wrapper/StaticChaynsApi"));
|
|
123
131
|
var _DialogHandler = _interopRequireDefault(require("./handler/DialogHandler"));
|
|
124
132
|
var _dialog = _interopRequireWildcard(require("./calls/dialogs/index"));
|
|
125
133
|
exports.dialog = _dialog;
|