chayns-api 1.1.0-2 → 1.1.0-4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. package/dist/cjs/calls/dialogs/chaynsDialog.js +3 -6
  2. package/dist/cjs/calls/dialogs/date.js +29 -2
  3. package/dist/cjs/calls/dialogs/fileSelect.js +1 -2
  4. package/dist/cjs/calls/dialogs/input.js +2 -3
  5. package/dist/cjs/calls/dialogs/select.js +2 -3
  6. package/dist/cjs/calls/getUserInfo.js +1 -2
  7. package/dist/cjs/calls/index.js +93 -82
  8. package/dist/cjs/components/AppDialogWrapper.js +7 -7
  9. package/dist/cjs/components/ChaynsContext.js +2 -4
  10. package/dist/cjs/components/ChaynsProvider.js +10 -13
  11. package/dist/cjs/components/ErrorBoundary.js +31 -0
  12. package/dist/cjs/components/moduleWrapper.js +9 -0
  13. package/dist/cjs/components/withCompatMode.js +8 -7
  14. package/dist/cjs/components/withHydrationBoundary.js +57 -0
  15. package/dist/cjs/constants/hydrationContext.js +16 -0
  16. package/dist/cjs/constants/index.js +16 -0
  17. package/dist/cjs/handler/DialogHandler.js +4 -2
  18. package/dist/cjs/hooks/useAccessToken.js +1 -0
  19. package/dist/cjs/hooks/useDialogState.js +2 -2
  20. package/dist/cjs/hooks/usePages.js +2 -2
  21. package/dist/cjs/host/ChaynsHost.js +1 -2
  22. package/dist/cjs/host/iframe/HostIframe.js +4 -6
  23. package/dist/cjs/host/iframe/utils/useUpdateData.js +1 -2
  24. package/dist/cjs/host/module/ModuleHost.js +8 -24
  25. package/dist/cjs/host/module/utils/loadComponent.js +58 -51
  26. package/dist/cjs/index.js +48 -5
  27. package/dist/cjs/types/IChaynsReact.js +140 -107
  28. package/dist/cjs/util/appCall.js +3 -4
  29. package/dist/cjs/util/deviceHelper.js +18 -13
  30. package/dist/cjs/util/transferNestedFunctions.js +36 -0
  31. package/dist/cjs/wrapper/AppWrapper.js +69 -11
  32. package/dist/cjs/wrapper/FrameWrapper.js +16 -5
  33. package/dist/cjs/wrapper/StaticChaynsApi.js +22 -0
  34. package/dist/esm/calls/index.js +22 -1
  35. package/dist/esm/components/AppDialogWrapper.js +4 -3
  36. package/dist/esm/components/ChaynsProvider.js +6 -7
  37. package/dist/esm/components/ErrorBoundary.js +23 -0
  38. package/dist/esm/components/moduleWrapper.js +3 -0
  39. package/dist/esm/components/withCompatMode.js +5 -4
  40. package/dist/esm/components/withHydrationBoundary.js +50 -0
  41. package/dist/esm/constants/hydrationContext.js +10 -0
  42. package/dist/esm/constants/index.js +1 -0
  43. package/dist/esm/handler/DialogHandler.js +6 -4
  44. package/dist/esm/hooks/useAccessToken.js +1 -0
  45. package/dist/esm/hooks/useDialogState.js +2 -2
  46. package/dist/esm/hooks/usePages.js +1 -1
  47. package/dist/esm/host/iframe/HostIframe.js +1 -2
  48. package/dist/esm/host/module/ModuleHost.js +5 -20
  49. package/dist/esm/host/module/utils/loadComponent.js +58 -50
  50. package/dist/esm/index.js +6 -1
  51. package/dist/esm/types/IChaynsReact.js +142 -87
  52. package/dist/esm/util/appCall.js +2 -2
  53. package/dist/esm/util/deviceHelper.js +17 -11
  54. package/dist/esm/util/transferNestedFunctions.js +32 -0
  55. package/dist/esm/wrapper/AppWrapper.js +70 -11
  56. package/dist/esm/wrapper/FrameWrapper.js +16 -5
  57. package/dist/esm/wrapper/StaticChaynsApi.js +20 -0
  58. package/dist/types/calls/index.d.ts +19 -5
  59. package/dist/types/components/AppDialogWrapper.d.ts +2 -2
  60. package/dist/types/components/ChaynsProvider.d.ts +1 -4
  61. package/dist/types/components/ErrorBoundary.d.ts +13 -0
  62. package/dist/types/components/moduleWrapper.d.ts +4 -0
  63. package/dist/types/components/withHydrationBoundary.d.ts +16 -0
  64. package/dist/types/constants/hydrationContext.d.ts +8 -0
  65. package/dist/types/constants/index.d.ts +1 -0
  66. package/dist/types/handler/DialogHandler.d.ts +0 -1
  67. package/dist/types/hooks/useAccessToken.d.ts +1 -0
  68. package/dist/types/host/module/ModuleHost.d.ts +1 -0
  69. package/dist/types/host/module/utils/loadComponent.d.ts +1 -1
  70. package/dist/types/index.d.ts +6 -1
  71. package/dist/types/types/IChaynsReact.d.ts +136 -28
  72. package/dist/types/util/deviceHelper.d.ts +2 -2
  73. package/dist/types/util/transferNestedFunctions.d.ts +1 -0
  74. package/dist/types/wrapper/StaticChaynsApi.d.ts +9 -0
  75. package/package.json +26 -22
  76. package/toolkit.config.js +20 -0
@@ -1,6 +1,6 @@
1
1
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
3
- function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
2
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
3
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
4
4
  /* eslint-disable */
5
5
  // @ts-nocheck
6
6
 
@@ -15,12 +15,28 @@ import { addApiListener, dispatchApiEvent, removeApiListener } from '../helper/a
15
15
  let appWrapperDialogId = 0;
16
16
  export class AppWrapper {
17
17
  mapOldApiToNew(retVal) {
18
- var _window, _window2, _AppInfo$TappSelected;
18
+ var _window, _colorMode, _window2, _AppInfo$TappSelected;
19
19
  const {
20
20
  AppInfo,
21
21
  AppUser
22
22
  } = retVal;
23
23
  this.accessToken = AppUser.TobitAccessToken;
24
+ const urlParams = new URLSearchParams(location.search);
25
+ const urlParamsLowerCase = new URLSearchParams(location.search.toLowerCase());
26
+ let tappId = urlParamsLowerCase.get('tappid');
27
+ let colorMode = urlParamsLowerCase.get('colormode');
28
+ if (colorMode) {
29
+ try {
30
+ colorMode = Number.parseInt(colorMode, 10);
31
+ } catch {}
32
+ }
33
+ if (tappId) {
34
+ try {
35
+ tappId = Number.parseInt(tappId, 10);
36
+ } catch {
37
+ // ignore
38
+ }
39
+ }
24
40
  return {
25
41
  device: getDeviceInfo(navigator.userAgent, 'image/webp'),
26
42
  environment: {
@@ -48,7 +64,7 @@ export class AppWrapper {
48
64
  docked: false
49
65
  },
50
66
  title: AppInfo.Title,
51
- colorMode: AppInfo.colorMode,
67
+ colorMode: (_colorMode = colorMode) !== null && _colorMode !== void 0 ? _colorMode : AppInfo.colorMode,
52
68
  color: AppInfo.color,
53
69
  domain: AppInfo.domain,
54
70
  font: {
@@ -60,7 +76,7 @@ export class AppWrapper {
60
76
  locationPersonId: AppInfo.LocationPersonId,
61
77
  urlHash: (_window2 = window) === null || _window2 === void 0 ? void 0 : _window2.location.hash.replace('#', '')
62
78
  },
63
- parameters: Object.fromEntries(new URLSearchParams(location.search)),
79
+ parameters: Object.fromEntries(urlParams),
64
80
  user: {
65
81
  firstName: AppUser.FirstName,
66
82
  lastName: AppUser.LastName,
@@ -72,7 +88,7 @@ export class AppWrapper {
72
88
  customData: null,
73
89
  isAdminModeActive: AppUser.AdminMode,
74
90
  currentPage: {
75
- id: (_AppInfo$TappSelected = AppInfo.TappSelected) === null || _AppInfo$TappSelected === void 0 ? void 0 : _AppInfo$TappSelected.TappID,
91
+ id: ((_AppInfo$TappSelected = AppInfo.TappSelected) === null || _AppInfo$TappSelected === void 0 ? void 0 : _AppInfo$TappSelected.TappID) || tappId,
76
92
  siteId: AppInfo.SiteID
77
93
  },
78
94
  pages: AppInfo.Tapps.map(x => ({
@@ -106,12 +122,13 @@ export class AppWrapper {
106
122
  permanent: true
107
123
  }, {
108
124
  callback: v => {
109
- var _v$accuracy, _v$code;
125
+ var _v$accuracy, _v$isAccurate, _v$code;
110
126
  dispatchApiEvent('geoLocationListener', {
111
127
  latitude: v.latitude,
112
128
  longitude: v.longitude,
113
129
  accuracy: (_v$accuracy = v.accuracy) !== null && _v$accuracy !== void 0 ? _v$accuracy : null,
114
130
  speed: v.speed,
131
+ isAccurate: (_v$isAccurate = v.isAccurate) !== null && _v$isAccurate !== void 0 ? _v$isAccurate : null,
115
132
  code: (_v$code = v.code) !== null && _v$code !== void 0 ? _v$code : null
116
133
  });
117
134
  }
@@ -157,6 +174,23 @@ export class AppWrapper {
157
174
  }
158
175
  return id;
159
176
  },
177
+ addToolbarChangeListener: async callback => {
178
+ const {
179
+ id,
180
+ shouldInitialize
181
+ } = addApiListener('toolbarChangeListener', callback);
182
+ if (shouldInitialize) {
183
+ this.appCall(293, {}, {
184
+ callback: v => {
185
+ dispatchApiEvent('toolbarChangeListener', {
186
+ isVisible: v.isVisible,
187
+ toolbarHeight: v.toolbarHeight
188
+ });
189
+ }
190
+ });
191
+ }
192
+ return id;
193
+ },
160
194
  addWindowMetricsListener: async callback => {
161
195
  const {
162
196
  id,
@@ -182,13 +216,15 @@ export class AppWrapper {
182
216
  };
183
217
  },
184
218
  getGeoLocation: async () => {
219
+ var _res$accuracy, _res$isAccurate, _res$code;
185
220
  const res = await this.appCall(14);
186
221
  return {
187
222
  latitude: res.latitude,
188
223
  longitude: res.longitude,
189
224
  speed: res.speed,
190
- code: res.code,
191
- isAccurate: res.isAccurate
225
+ accuracy: (_res$accuracy = res.accuracy) !== null && _res$accuracy !== void 0 ? _res$accuracy : null,
226
+ isAccurate: (_res$isAccurate = res.isAccurate) !== null && _res$isAccurate !== void 0 ? _res$isAccurate : null,
227
+ code: (_res$code = res.code) !== null && _res$code !== void 0 ? _res$code : null
192
228
  };
193
229
  },
194
230
  getUserInfo: async query => {
@@ -220,7 +256,7 @@ export class AppWrapper {
220
256
  let {
221
257
  retVal
222
258
  } = _ref;
223
- callback === null || callback === void 0 ? void 0 : callback(retVal);
259
+ callback === null || callback === void 0 || callback(retVal);
224
260
  delete window[callbackName];
225
261
  };
226
262
  const callObj = {
@@ -250,6 +286,7 @@ export class AppWrapper {
250
286
  },
251
287
  openImage: async value => {
252
288
  this.appCall(4, {
289
+ urls: value.items.map(x => x.url),
253
290
  items: value.items.map(x => ({
254
291
  url: x.url,
255
292
  title: x.title,
@@ -304,6 +341,14 @@ export class AppWrapper {
304
341
  // App does not support removal of onActivate callback which makes this a no-op
305
342
  }
306
343
  },
344
+ removeToolbarChangeListener: async id => {
345
+ const {
346
+ shouldRemove
347
+ } = removeApiListener('toolbarChangeListener', id);
348
+ if (shouldRemove) {
349
+ // App does not support removal of onToolbarBarRemove callback which makes this a no-op
350
+ }
351
+ },
307
352
  removeWindowMetricsListener: async id => {
308
353
  const shouldRemove = removeApiListener('windowMetricsListener', id);
309
354
  if (shouldRemove) {
@@ -317,7 +362,7 @@ export class AppWrapper {
317
362
  id: options.id,
318
363
  showName: options.showName,
319
364
  position: options.position,
320
- params: options.params
365
+ params: new URLSearchParams(options.params).toString() || undefined
321
366
  }, {
322
367
  awaitResult: false
323
368
  });
@@ -506,6 +551,20 @@ export class AppWrapper {
506
551
  }
507
552
  async init() {
508
553
  this.values = this.mapOldApiToNew(await this.appCall(18));
554
+ const callbackName = `chaynsApiV5Callback_${this.counter++}`;
555
+ window.disablev4AccessTokenChangeListener = true;
556
+ window[callbackName] = _ref2 => {
557
+ let {
558
+ retVal: value
559
+ } = _ref2;
560
+ this.mapOldApiToNew(value);
561
+ };
562
+ this.appCall(66, {
563
+ enabled: true,
564
+ callback: callbackName
565
+ }, {
566
+ awaitResult: false
567
+ });
509
568
  return undefined;
510
569
  }
511
570
  getSSRData() {
@@ -1,6 +1,6 @@
1
1
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
3
- function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
2
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
3
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
4
4
  /* eslint-disable @typescript-eslint/no-non-null-assertion */
5
5
  import * as comlink from 'comlink';
6
6
  import DialogHandler from '../handler/DialogHandler';
@@ -28,6 +28,10 @@ export class FrameWrapper {
28
28
  return this.exposedFunctions.addScrollListener(value, callback && comlink.proxy(result => callback(result)));
29
29
  },
30
30
  addVisibilityChangeListener: async callback => addVisibilityChangeListener(callback),
31
+ addToolbarChangeListener: async callback => {
32
+ if (!this.initialized) await this.ready;
33
+ return this.exposedFunctions.addToolbarChangeListener(callback && comlink.proxy(result => callback(result)));
34
+ },
31
35
  addWindowMetricsListener: async callback => {
32
36
  if (!this.initialized) await this.ready;
33
37
  const {
@@ -99,6 +103,10 @@ export class FrameWrapper {
99
103
  if (!this.initialized) await this.ready;
100
104
  return this.exposedFunctions.openImage(value);
101
105
  },
106
+ openMedia: async value => {
107
+ if (!this.initialized) await this.ready;
108
+ return this.exposedFunctions.openMedia(value);
109
+ },
102
110
  openUrl: async value => {
103
111
  if (!this.initialized) await this.ready;
104
112
  return this.exposedFunctions.openUrl(value);
@@ -136,6 +144,10 @@ export class FrameWrapper {
136
144
  this.resizeListener = null;
137
145
  }
138
146
  },
147
+ removeToolbarChangeListener: async id => {
148
+ if (!this.initialized) await this.ready;
149
+ return this.exposedFunctions.removeToolbarChangeListener(id);
150
+ },
139
151
  selectPage: async options => {
140
152
  if (!this.initialized) await this.ready;
141
153
  await this.exposedFunctions.selectPage(options);
@@ -240,9 +252,9 @@ export class FrameWrapper {
240
252
  if (!this.initialized) await this.ready;
241
253
  return this.exposedFunctions.openDialog(config, comlink.proxy(callback));
242
254
  },
243
- setDialogResult: async result => {
255
+ setDialogResult: async (buttonType, result) => {
244
256
  if (!this.initialized) await this.ready;
245
- return this.exposedFunctions.setDialogResult(result);
257
+ return this.exposedFunctions.setDialogResult(buttonType, result);
246
258
  },
247
259
  dispatchEventToDialogClient: async (dialogId, data) => {
248
260
  if (!this.initialized) await this.ready;
@@ -297,7 +309,6 @@ export class FrameWrapper {
297
309
  if (this.initialized) {
298
310
  this.values[type] = value;
299
311
  }
300
- this.values[type] = value;
301
312
  document.dispatchEvent(new CustomEvent('chayns_api_data', {
302
313
  detail: {
303
314
  type,
@@ -0,0 +1,20 @@
1
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
3
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
4
+ import { moduleWrapper } from '../components/moduleWrapper';
5
+ import { FrameWrapper } from './FrameWrapper';
6
+ class StaticChaynsApi {
7
+ constructor() {
8
+ _defineProperty(this, "getSite", () => this._wrapper.values.site);
9
+ const wrapper = new FrameWrapper();
10
+ moduleWrapper.current = wrapper;
11
+ this._wrapper = wrapper;
12
+ this.ready = wrapper.init();
13
+ this.addDataListener = wrapper.addDataListener;
14
+ Object.entries(wrapper.functions).forEach(_ref => {
15
+ let [k, v] = _ref;
16
+ this[k] = v;
17
+ });
18
+ }
19
+ }
20
+ export default StaticChaynsApi;
@@ -19,6 +19,11 @@ export declare const addScrollListener: (value: {
19
19
  * @category Event listener
20
20
  */
21
21
  export declare const addVisibilityChangeListener: (callback: (result: import("../types/IChaynsReact").VisibilityChangeListenerResult) => void) => Promise<number>;
22
+ /**
23
+ * This method will be executed when the toolbar gets displayed or hidden.
24
+ * @category Event listener
25
+ */
26
+ export declare const addToolbarChangeListener: (callback: (result: import("../types/IChaynsReact").ToolbarChangeListenerResult) => void) => Promise<number>;
22
27
  /**
23
28
  * This adds a listener to get the actual height of the page.
24
29
  * @category Event listener
@@ -75,6 +80,10 @@ export declare const navigateBack: () => Promise<void>;
75
80
  * The images specified in the url array is shown in gallery mode.
76
81
  */
77
82
  export declare const openImage: (value: import("../types/IChaynsReact").OpenImage) => Promise<void>;
83
+ /**
84
+ * The images and videos specified in the items array is shown in gallery mode.
85
+ */
86
+ export declare const openMedia: (value: import("../types/IChaynsReact").OpenMedia) => Promise<void>;
78
87
  /**
79
88
  * Opens an URL in the chayns environment.
80
89
  */
@@ -96,6 +105,11 @@ export declare const refreshAccessToken: () => Promise<void>;
96
105
  * @category Event listener
97
106
  */
98
107
  export declare const removeGeoLocationListener: (value: number) => Promise<void>;
108
+ /**
109
+ * This removes a listener for changing toolbar visibility
110
+ * @category Event listener
111
+ */
112
+ export declare const removeToolbarChangeListener: (value: number) => Promise<void>;
99
113
  /**
100
114
  * Removes scroll listener.
101
115
  * @category Event listener
@@ -186,7 +200,7 @@ export declare const vibrate: (value: import("../types/IChaynsReact").Vibrate) =
186
200
  /**
187
201
  * This method creates a dialog
188
202
  */
189
- export declare const createDialog: (config: import("../types/IChaynsReact").Dialog) => import("../handler/DialogHandler").default;
203
+ export declare const createDialog: (config: import("../types/IChaynsReact").Dialog) => import("..").DialogHandler;
190
204
  /**
191
205
  * Displays an overlay
192
206
  */
@@ -209,8 +223,8 @@ export declare const getLanguage: () => {
209
223
  active: import("../types/IChaynsReact").Language;
210
224
  };
211
225
  export declare const getParameters: () => {
212
- [key: string]: string;
213
- [key: symbol]: string;
226
+ [key: string]: string | string[];
227
+ [key: symbol]: string | string[];
214
228
  };
215
229
  export declare const getPages: () => import("../types/IChaynsReact").Page[];
216
230
  export declare const getEnvironment: () => {
@@ -227,8 +241,8 @@ export declare const language: {
227
241
  active: import("../types/IChaynsReact").Language;
228
242
  };
229
243
  export declare const parameters: {
230
- [key: string]: string;
231
- [key: symbol]: string;
244
+ [key: string]: string | string[];
245
+ [key: symbol]: string | string[];
232
246
  };
233
247
  export declare const pages: import("../types/IChaynsReact").Page[];
234
248
  export declare const environment: {
@@ -1,5 +1,5 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  declare const AppDialogWrapper: ({ dialogEventTarget }: {
3
3
  dialogEventTarget: any;
4
- }) => JSX.Element;
4
+ }) => React.JSX.Element;
5
5
  export default AppDialogWrapper;
@@ -1,8 +1,5 @@
1
1
  import React, { ReactNode } from 'react';
2
- import { ChaynsReactFunctions, ChaynsReactValues, IChaynsReact } from '../types/IChaynsReact';
3
- export declare const moduleWrapper: {
4
- current: IChaynsReact;
5
- };
2
+ import { ChaynsReactFunctions, ChaynsReactValues } from '../types/IChaynsReact';
6
3
  type ChaynsProviderProps = {
7
4
  data?: ChaynsReactValues;
8
5
  functions?: ChaynsReactFunctions;
@@ -0,0 +1,13 @@
1
+ import React from "react";
2
+ export default class ErrorBoundary extends React.Component<{
3
+ children: React.ReactNode;
4
+ }, {
5
+ hasError: boolean;
6
+ }> {
7
+ constructor(props: any);
8
+ static getDerivedStateFromError(): {
9
+ hasError: boolean;
10
+ };
11
+ componentDidCatch(error: any, errorInfo: any): void;
12
+ render(): React.ReactNode;
13
+ }
@@ -0,0 +1,4 @@
1
+ import { IChaynsReact } from '../types/IChaynsReact';
2
+ export declare const moduleWrapper: {
3
+ current: IChaynsReact;
4
+ };
@@ -0,0 +1,16 @@
1
+ import React from 'react';
2
+ type StoreLikeValue = object & {
3
+ getState: () => object;
4
+ abort?: () => Promise<void>;
5
+ };
6
+ type HydrationComponent = React.FC<{
7
+ value: StoreLikeValue;
8
+ children?: React.ReactNode;
9
+ }>;
10
+ type Initializer = (initialValue: object | undefined) => StoreLikeValue;
11
+ type HydrationBoundary = React.FC<{
12
+ id: string;
13
+ children?: React.ReactNode;
14
+ }>;
15
+ declare const withHydrationBoundary: (Component: HydrationComponent, initializer: Initializer, useHydrationId: undefined | (() => string)) => HydrationBoundary;
16
+ export default withHydrationBoundary;
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ export type HydrationContextValueType = {
3
+ [key: string]: {
4
+ getState: () => object;
5
+ abort?: () => Promise<void>;
6
+ };
7
+ };
8
+ export declare let HydrationContext: React.Context<HydrationContextValueType>;
@@ -0,0 +1 @@
1
+ export * from './hydrationContext';
@@ -7,7 +7,6 @@ export default class DialogHandler {
7
7
  private readonly _config;
8
8
  private readonly _dispatchEvent;
9
9
  private readonly _addDataListener;
10
- private readonly _removeDataListener;
11
10
  private readonly listeners;
12
11
  constructor(config: any, open: any, close: any, dispatchEvent: any, addDataListener: any);
13
12
  open(): Promise<unknown>;
@@ -1,5 +1,6 @@
1
1
  import { AccessToken } from "../types/IChaynsReact";
2
2
  /**
3
3
  * @category Hooks
4
+ * @deprecated Use {@link getAccessToken} instead
4
5
  */
5
6
  export declare const useAccessToken: (accessToken?: AccessToken) => string | undefined;
@@ -4,6 +4,7 @@ export type TypeSystem = {
4
4
  scope: string;
5
5
  url: string;
6
6
  module: string;
7
+ preventSingleton?: boolean;
7
8
  };
8
9
  type ModulePropTypes = {
9
10
  system: TypeSystem;
@@ -1 +1 @@
1
- export default function loadComponent(scope: any, module: any, url: any, skipCompatMode?: boolean): () => Promise<any>;
1
+ export default function loadComponent(scope: any, module: any, url: any, skipCompatMode?: boolean, preventSingleton?: boolean): any;
@@ -1,5 +1,6 @@
1
+ import './util/transferNestedFunctions';
1
2
  export { default as ChaynsProvider } from './components/ChaynsProvider';
2
- export { default as getDeviceInfo, getScreenSize } from './util/deviceHelper';
3
+ export { default as getDeviceInfo, getScreenSize, getClientDeviceInfo } from './util/deviceHelper';
3
4
  export { default as ChaynsHost } from './host/ChaynsHost';
4
5
  export { withCompatMode } from './components/withCompatMode';
5
6
  export * from './calls';
@@ -7,6 +8,10 @@ export * from './hooks';
7
8
  export * from './components/WaitUntil';
8
9
  export * from './types/IChaynsReact';
9
10
  export * from './components/withCompatMode';
11
+ export * from './constants';
12
+ export { default as withHydrationBoundary } from './components/withHydrationBoundary';
13
+ export { default as StaticChaynsApi } from './wrapper/StaticChaynsApi';
14
+ export { default as DialogHandler } from './handler/DialogHandler';
10
15
  export * as dialog from './calls/dialogs/index';
11
16
  export * from './types/IChaynsReact';
12
17
  declare const _default: {