chayns-api 1.0.33 → 1.0.36
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 +63 -63
- 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 +129 -122
- package/dist/cjs/util/appCall.js +2 -2
- package/dist/cjs/util/deviceHelper.js +3 -3
- package/dist/cjs/wrapper/StaticChaynsApi.js +23 -0
- package/dist/esm/calls/dialogs/date.js +0 -1
- package/dist/esm/calls/index.js +1 -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 +109 -99
- package/dist/esm/util/appCall.js +2 -2
- package/dist/esm/util/deviceHelper.js +3 -3
- package/dist/esm/wrapper/StaticChaynsApi.js +20 -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 +3 -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
|
@@ -4,261 +4,261 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
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
|
|
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
|
* Opens an URL in the chayns environment.
|
|
94
94
|
*/
|
|
95
95
|
exports.openImage = openImage;
|
|
96
|
-
const openUrl = (...args) =>
|
|
96
|
+
const openUrl = (...args) => _moduleWrapper.moduleWrapper.current.functions.openUrl(...args);
|
|
97
97
|
/**
|
|
98
98
|
* The video specified in the URL is shown in video mode.
|
|
99
99
|
*/
|
|
100
100
|
exports.openUrl = openUrl;
|
|
101
|
-
const openVideo = (...args) =>
|
|
101
|
+
const openVideo = (...args) => _moduleWrapper.moduleWrapper.current.functions.openVideo(...args);
|
|
102
102
|
/**
|
|
103
103
|
* Refresh badge count in navigation, user information and pages
|
|
104
104
|
*/
|
|
105
105
|
exports.openVideo = openVideo;
|
|
106
|
-
const refreshData = (...args) =>
|
|
106
|
+
const refreshData = (...args) => _moduleWrapper.moduleWrapper.current.functions.refreshData(...args);
|
|
107
107
|
/**
|
|
108
108
|
* Refresh accesstoken, should only be used when user object changes, not when token is invalid
|
|
109
109
|
*/
|
|
110
110
|
exports.refreshData = refreshData;
|
|
111
|
-
const refreshAccessToken = (...args) =>
|
|
111
|
+
const refreshAccessToken = (...args) => _moduleWrapper.moduleWrapper.current.functions.refreshAccessToken(...args);
|
|
112
112
|
/**
|
|
113
113
|
* This removes a listener to determine your location.
|
|
114
114
|
* @category Event listener
|
|
115
115
|
*/
|
|
116
116
|
exports.refreshAccessToken = refreshAccessToken;
|
|
117
|
-
const removeGeoLocationListener = (...args) =>
|
|
117
|
+
const removeGeoLocationListener = (...args) => _moduleWrapper.moduleWrapper.current.functions.removeGeoLocationListener(...args);
|
|
118
118
|
/**
|
|
119
119
|
* Removes scroll listener.
|
|
120
120
|
* @category Event listener
|
|
121
121
|
*/
|
|
122
122
|
exports.removeGeoLocationListener = removeGeoLocationListener;
|
|
123
|
-
const removeScrollListener = (...args) =>
|
|
123
|
+
const removeScrollListener = (...args) => _moduleWrapper.moduleWrapper.current.functions.removeScrollListener(...args);
|
|
124
124
|
/**
|
|
125
125
|
* Removes visibility change listener.
|
|
126
126
|
* @category Event listener
|
|
127
127
|
*/
|
|
128
128
|
exports.removeScrollListener = removeScrollListener;
|
|
129
|
-
const removeVisibilityChangeListener = (...args) =>
|
|
129
|
+
const removeVisibilityChangeListener = (...args) => _moduleWrapper.moduleWrapper.current.functions.removeVisibilityChangeListener(...args);
|
|
130
130
|
/**
|
|
131
131
|
* Removes window metrics listener.
|
|
132
132
|
* @category Event listener
|
|
133
133
|
*/
|
|
134
134
|
exports.removeVisibilityChangeListener = removeVisibilityChangeListener;
|
|
135
|
-
const removeWindowMetricsListener = (...args) =>
|
|
135
|
+
const removeWindowMetricsListener = (...args) => _moduleWrapper.moduleWrapper.current.functions.removeWindowMetricsListener(...args);
|
|
136
136
|
/**
|
|
137
137
|
* Select other page on chayns site.
|
|
138
138
|
*/
|
|
139
139
|
exports.removeWindowMetricsListener = removeWindowMetricsListener;
|
|
140
|
-
const selectPage = (...args) =>
|
|
140
|
+
const selectPage = (...args) => _moduleWrapper.moduleWrapper.current.functions.selectPage(...args);
|
|
141
141
|
/**
|
|
142
142
|
* Scrolls by specific amount.
|
|
143
143
|
*/
|
|
144
144
|
exports.selectPage = selectPage;
|
|
145
|
-
const scrollByY = (...args) =>
|
|
145
|
+
const scrollByY = (...args) => _moduleWrapper.moduleWrapper.current.functions.scrollByY(...args);
|
|
146
146
|
/**
|
|
147
147
|
* Scrolls to specific position.
|
|
148
148
|
*/
|
|
149
149
|
exports.scrollByY = scrollByY;
|
|
150
|
-
const scrollToY = (...args) =>
|
|
150
|
+
const scrollToY = (...args) => _moduleWrapper.moduleWrapper.current.functions.scrollToY(...args);
|
|
151
151
|
/**
|
|
152
152
|
* Sends intercom message to group.
|
|
153
153
|
*/
|
|
154
154
|
exports.scrollToY = scrollToY;
|
|
155
|
-
const sendMessageToGroup = (...args) =>
|
|
155
|
+
const sendMessageToGroup = (...args) => _moduleWrapper.moduleWrapper.current.functions.sendMessageToGroup(...args);
|
|
156
156
|
/**
|
|
157
157
|
* Sends intercom message to page.
|
|
158
158
|
*/
|
|
159
159
|
exports.sendMessageToGroup = sendMessageToGroup;
|
|
160
|
-
const sendMessageToPage = (...args) =>
|
|
160
|
+
const sendMessageToPage = (...args) => _moduleWrapper.moduleWrapper.current.functions.sendMessageToPage(...args);
|
|
161
161
|
/**
|
|
162
162
|
* Sends intercom message to an user.
|
|
163
163
|
*/
|
|
164
164
|
exports.sendMessageToPage = sendMessageToPage;
|
|
165
|
-
const sendMessageToUser = (...args) =>
|
|
165
|
+
const sendMessageToUser = (...args) => _moduleWrapper.moduleWrapper.current.functions.sendMessageToUser(...args);
|
|
166
166
|
/**
|
|
167
167
|
* Switches admin mode, also toggles admin switch in top frame.
|
|
168
168
|
*/
|
|
169
169
|
exports.sendMessageToUser = sendMessageToUser;
|
|
170
|
-
const setAdminMode = (...args) =>
|
|
170
|
+
const setAdminMode = (...args) => _moduleWrapper.moduleWrapper.current.functions.setAdminMode(...args);
|
|
171
171
|
/**
|
|
172
172
|
* Sets the display timeout, only works in chayns App.
|
|
173
173
|
*/
|
|
174
174
|
exports.setAdminMode = setAdminMode;
|
|
175
|
-
const setDisplayTimeout = (...args) =>
|
|
175
|
+
const setDisplayTimeout = (...args) => _moduleWrapper.moduleWrapper.current.functions.setDisplayTimeout(...args);
|
|
176
176
|
/**
|
|
177
177
|
* Enables or disables a button which floats over the page.
|
|
178
178
|
*/
|
|
179
179
|
exports.setDisplayTimeout = setDisplayTimeout;
|
|
180
|
-
const setFloatingButton = (...args) =>
|
|
180
|
+
const setFloatingButton = (...args) => _moduleWrapper.moduleWrapper.current.functions.setFloatingButton(...args);
|
|
181
181
|
/**
|
|
182
182
|
* Sets the height of the page.
|
|
183
183
|
*/
|
|
184
184
|
exports.setFloatingButton = setFloatingButton;
|
|
185
|
-
const setHeight = (...args) =>
|
|
185
|
+
const setHeight = (...args) => _moduleWrapper.moduleWrapper.current.functions.setHeight(...args);
|
|
186
186
|
/**
|
|
187
187
|
* Enables or disables the ability to refresh a page
|
|
188
188
|
*/
|
|
189
189
|
exports.setHeight = setHeight;
|
|
190
|
-
const setRefreshScrollEnabled = (...args) =>
|
|
190
|
+
const setRefreshScrollEnabled = (...args) => _moduleWrapper.moduleWrapper.current.functions.setRefreshScrollEnabled(...args);
|
|
191
191
|
/**
|
|
192
192
|
* Scans a qr-code and returns the result
|
|
193
193
|
*/
|
|
194
194
|
exports.setRefreshScrollEnabled = setRefreshScrollEnabled;
|
|
195
|
-
const setScanQrCode = (...args) =>
|
|
195
|
+
const setScanQrCode = (...args) => _moduleWrapper.moduleWrapper.current.functions.setScanQrCode(...args);
|
|
196
196
|
/**
|
|
197
197
|
* Temporarily change design settings in top frame
|
|
198
198
|
*/
|
|
199
199
|
exports.setScanQrCode = setScanQrCode;
|
|
200
|
-
const setTempDesignSettings = (...args) =>
|
|
200
|
+
const setTempDesignSettings = (...args) => _moduleWrapper.moduleWrapper.current.functions.setTempDesignSettings(...args);
|
|
201
201
|
/**
|
|
202
202
|
* Shows or hide a waitcursor
|
|
203
203
|
*/
|
|
204
204
|
exports.setTempDesignSettings = setTempDesignSettings;
|
|
205
|
-
const setWaitCursor = (...args) =>
|
|
205
|
+
const setWaitCursor = (...args) => _moduleWrapper.moduleWrapper.current.functions.setWaitCursor(...args);
|
|
206
206
|
/**
|
|
207
207
|
* Retrieves the value that is assigned to the key from a storage outside the frame
|
|
208
208
|
*/
|
|
209
209
|
exports.setWaitCursor = setWaitCursor;
|
|
210
|
-
const storageGetItem = (...args) =>
|
|
210
|
+
const storageGetItem = (...args) => _moduleWrapper.moduleWrapper.current.functions.storageGetItem(...args);
|
|
211
211
|
/**
|
|
212
212
|
* Removes the value that is assigned to the key from a storage outside the frame
|
|
213
213
|
*/
|
|
214
214
|
exports.storageGetItem = storageGetItem;
|
|
215
|
-
const storageRemoveItem = (...args) =>
|
|
215
|
+
const storageRemoveItem = (...args) => _moduleWrapper.moduleWrapper.current.functions.storageRemoveItem(...args);
|
|
216
216
|
/**
|
|
217
217
|
* Sets the value that is assigned to the key from a storage outside the frame
|
|
218
218
|
*/
|
|
219
219
|
exports.storageRemoveItem = storageRemoveItem;
|
|
220
|
-
const storageSetItem = (...args) =>
|
|
220
|
+
const storageSetItem = (...args) => _moduleWrapper.moduleWrapper.current.functions.storageSetItem(...args);
|
|
221
221
|
/**
|
|
222
222
|
* This method lets a smartphone vibrate for the given time.
|
|
223
223
|
*/
|
|
224
224
|
exports.storageSetItem = storageSetItem;
|
|
225
|
-
const vibrate = (...args) =>
|
|
225
|
+
const vibrate = (...args) => _moduleWrapper.moduleWrapper.current.functions.vibrate(...args);
|
|
226
226
|
/**
|
|
227
227
|
* This method creates a dialog
|
|
228
228
|
*/
|
|
229
229
|
exports.vibrate = vibrate;
|
|
230
|
-
const createDialog = (...args) =>
|
|
230
|
+
const createDialog = (...args) => _moduleWrapper.moduleWrapper.current.functions.createDialog(...args);
|
|
231
231
|
/**
|
|
232
232
|
* Displays an overlay
|
|
233
233
|
*/
|
|
234
234
|
exports.createDialog = createDialog;
|
|
235
|
-
const setOverlay = (...args) =>
|
|
235
|
+
const setOverlay = (...args) => _moduleWrapper.moduleWrapper.current.functions.setOverlay(...args);
|
|
236
236
|
/**
|
|
237
237
|
* Returns user information, only when user is logged in
|
|
238
238
|
* @category User functions
|
|
239
239
|
*/
|
|
240
240
|
exports.setOverlay = setOverlay;
|
|
241
|
-
const getUser = () =>
|
|
241
|
+
const getUser = () => _moduleWrapper.moduleWrapper.current.values.user;
|
|
242
242
|
exports.getUser = getUser;
|
|
243
|
-
const getSite = () =>
|
|
243
|
+
const getSite = () => _moduleWrapper.moduleWrapper.current.values.site;
|
|
244
244
|
exports.getSite = getSite;
|
|
245
|
-
const getCurrentPage = () =>
|
|
245
|
+
const getCurrentPage = () => _moduleWrapper.moduleWrapper.current.values.currentPage;
|
|
246
246
|
exports.getCurrentPage = getCurrentPage;
|
|
247
|
-
const getDevice = () =>
|
|
247
|
+
const getDevice = () => _moduleWrapper.moduleWrapper.current.values.device;
|
|
248
248
|
exports.getDevice = getDevice;
|
|
249
|
-
const getLanguage = () =>
|
|
249
|
+
const getLanguage = () => _moduleWrapper.moduleWrapper.current.values.language;
|
|
250
250
|
exports.getLanguage = getLanguage;
|
|
251
|
-
const getParameters = () =>
|
|
251
|
+
const getParameters = () => _moduleWrapper.moduleWrapper.current.values.parameters;
|
|
252
252
|
exports.getParameters = getParameters;
|
|
253
|
-
const getPages = () =>
|
|
253
|
+
const getPages = () => _moduleWrapper.moduleWrapper.current.values.pages;
|
|
254
254
|
exports.getPages = getPages;
|
|
255
|
-
const getEnvironment = () =>
|
|
255
|
+
const getEnvironment = () => _moduleWrapper.moduleWrapper.current.values.environment;
|
|
256
256
|
exports.getEnvironment = getEnvironment;
|
|
257
257
|
const user = new Proxy({}, {
|
|
258
258
|
get: (target, prop) => {
|
|
259
259
|
var _moduleWrapper$curren;
|
|
260
260
|
console.warn('Deprecated user import');
|
|
261
|
-
return (_moduleWrapper$curren =
|
|
261
|
+
return (_moduleWrapper$curren = _moduleWrapper.moduleWrapper.current.values.user) === null || _moduleWrapper$curren === void 0 ? void 0 : _moduleWrapper$curren[prop];
|
|
262
262
|
}
|
|
263
263
|
});
|
|
264
264
|
exports.user = user;
|
|
@@ -266,7 +266,7 @@ const site = new Proxy({}, {
|
|
|
266
266
|
get: (target, prop) => {
|
|
267
267
|
var _moduleWrapper$curren2;
|
|
268
268
|
console.warn('Deprecated site import');
|
|
269
|
-
return (_moduleWrapper$curren2 =
|
|
269
|
+
return (_moduleWrapper$curren2 = _moduleWrapper.moduleWrapper.current.values.site) === null || _moduleWrapper$curren2 === void 0 ? void 0 : _moduleWrapper$curren2[prop];
|
|
270
270
|
}
|
|
271
271
|
});
|
|
272
272
|
exports.site = site;
|
|
@@ -274,7 +274,7 @@ const device = new Proxy({}, {
|
|
|
274
274
|
get: (target, prop) => {
|
|
275
275
|
var _moduleWrapper$curren3;
|
|
276
276
|
console.warn('Deprecated device import');
|
|
277
|
-
return (_moduleWrapper$curren3 =
|
|
277
|
+
return (_moduleWrapper$curren3 = _moduleWrapper.moduleWrapper.current.values.device) === null || _moduleWrapper$curren3 === void 0 ? void 0 : _moduleWrapper$curren3[prop];
|
|
278
278
|
}
|
|
279
279
|
});
|
|
280
280
|
exports.device = device;
|
|
@@ -282,7 +282,7 @@ const language = new Proxy({}, {
|
|
|
282
282
|
get: (target, prop) => {
|
|
283
283
|
var _moduleWrapper$curren4;
|
|
284
284
|
console.warn('Deprecated language import');
|
|
285
|
-
return (_moduleWrapper$curren4 =
|
|
285
|
+
return (_moduleWrapper$curren4 = _moduleWrapper.moduleWrapper.current.values.language) === null || _moduleWrapper$curren4 === void 0 ? void 0 : _moduleWrapper$curren4[prop];
|
|
286
286
|
}
|
|
287
287
|
});
|
|
288
288
|
exports.language = language;
|
|
@@ -290,7 +290,7 @@ const parameters = new Proxy({}, {
|
|
|
290
290
|
get: (target, prop) => {
|
|
291
291
|
var _moduleWrapper$curren5;
|
|
292
292
|
console.warn('Deprecated parameters import');
|
|
293
|
-
return (_moduleWrapper$curren5 =
|
|
293
|
+
return (_moduleWrapper$curren5 = _moduleWrapper.moduleWrapper.current.values.parameters) === null || _moduleWrapper$curren5 === void 0 ? void 0 : _moduleWrapper$curren5[prop];
|
|
294
294
|
}
|
|
295
295
|
});
|
|
296
296
|
exports.parameters = parameters;
|
|
@@ -298,7 +298,7 @@ const pages = new Proxy({}, {
|
|
|
298
298
|
get: (target, prop) => {
|
|
299
299
|
var _moduleWrapper$curren6;
|
|
300
300
|
console.warn('Deprecated pages import');
|
|
301
|
-
return (_moduleWrapper$curren6 =
|
|
301
|
+
return (_moduleWrapper$curren6 = _moduleWrapper.moduleWrapper.current.values.pages) === null || _moduleWrapper$curren6 === void 0 ? void 0 : _moduleWrapper$curren6[prop];
|
|
302
302
|
}
|
|
303
303
|
});
|
|
304
304
|
exports.pages = pages;
|
|
@@ -306,7 +306,7 @@ const environment = new Proxy({}, {
|
|
|
306
306
|
get: (target, prop) => {
|
|
307
307
|
var _moduleWrapper$curren7;
|
|
308
308
|
console.warn('Deprecated environment import');
|
|
309
|
-
return (_moduleWrapper$curren7 =
|
|
309
|
+
return (_moduleWrapper$curren7 = _moduleWrapper.moduleWrapper.current.values.environment) === null || _moduleWrapper$curren7 === void 0 ? void 0 : _moduleWrapper$curren7[prop];
|
|
310
310
|
}
|
|
311
311
|
});
|
|
312
312
|
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;
|