chayns-api 1.1.0-0 → 1.1.0-2

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 (101) hide show
  1. package/dist/cjs/handler/DialogHandler.js +24 -1
  2. package/dist/cjs/hooks/useDialogState.js +6 -2
  3. package/dist/cjs/wrapper/FrameWrapper.js +37 -3
  4. package/dist/cjs/wrapper/ModuleFederationWrapper.js +1 -1
  5. package/dist/esm/handler/DialogHandler.js +24 -1
  6. package/dist/esm/hooks/useDialogState.js +6 -2
  7. package/dist/esm/wrapper/FrameWrapper.js +37 -3
  8. package/dist/esm/wrapper/ModuleFederationWrapper.js +1 -1
  9. package/dist/types/components/WaitUntil.d.ts +1 -2
  10. package/dist/types/handler/DialogHandler.d.ts +8 -1
  11. package/dist/types/hooks/useDialogState.d.ts +1 -1
  12. package/dist/types/types/IChaynsReact.d.ts +9 -3
  13. package/package.json +3 -3
  14. package/dist/cjs/bootstrap.js +0 -11
  15. package/dist/cjs/calls/abstractApiListener.js +0 -40
  16. package/dist/cjs/calls/apiEventListener.js +0 -40
  17. package/dist/cjs/calls/setVisibilityChangeListener.js +0 -1
  18. package/dist/cjs/calls/windowMetricsListener.js +0 -18
  19. package/dist/cjs/client.js +0 -93
  20. package/dist/cjs/components/App.js +0 -32
  21. package/dist/cjs/components/App.spec.js +0 -16
  22. package/dist/cjs/components/Button.js +0 -32
  23. package/dist/cjs/components/ChaynsModuleProvider.js +0 -457
  24. package/dist/cjs/components/ChaynsProviderExposed.js +0 -16
  25. package/dist/cjs/components/Dialog.js +0 -1
  26. package/dist/cjs/components/TestProvider.js +0 -236
  27. package/dist/cjs/components/Title.js +0 -162
  28. package/dist/cjs/functions/addApiListener.js +0 -37
  29. package/dist/cjs/functions/addGeoLocationListener.js +0 -26
  30. package/dist/cjs/functions/addScrollListener.js +0 -26
  31. package/dist/cjs/functions/addWindowMetricsListener.js +0 -37
  32. package/dist/cjs/helper/cssLoader.js +0 -28
  33. package/dist/cjs/hooks/addGeoLocationListener.js +0 -26
  34. package/dist/cjs/hooks/addScrollListener.js +0 -26
  35. package/dist/cjs/hooks/addWindowMetricsListener.js +0 -37
  36. package/dist/cjs/hooks/geoLocation.js +0 -48
  37. package/dist/cjs/hooks/useAddGeoLocationListener.js +0 -26
  38. package/dist/cjs/hooks/useAddScrollListener.js +0 -48
  39. package/dist/cjs/hooks/useAddWindowMetricsListener.js +0 -45
  40. package/dist/cjs/hooks/useAdddScrollListener.js +0 -26
  41. package/dist/cjs/hooks/useFunction.js +0 -13
  42. package/dist/cjs/hooks/windowMetrics.js +0 -45
  43. package/dist/cjs/host/HostIframe.js +0 -157
  44. package/dist/cjs/host/ModuleHost.js +0 -11
  45. package/dist/cjs/host/module/utils.js +0 -25
  46. package/dist/cjs/index.example.js +0 -7
  47. package/dist/cjs/index2.js +0 -64
  48. package/dist/cjs/types/DynamicApiImport.d.js +0 -5
  49. package/dist/cjs/types/DynamicImport.d.js +0 -5
  50. package/dist/cjs/types/chayns-components.d.js +0 -1
  51. package/dist/cjs/types/chayns-logger.d.js +0 -1
  52. package/dist/cjs/types/chayns.d.js +0 -1
  53. package/dist/cjs/types/tobit-websocket-service-client.d.js +0 -1
  54. package/dist/cjs/types/toolkit-types.d.js +0 -1
  55. package/dist/cjs/util/useFunctionsContext.js +0 -16
  56. package/dist/cjs/util/useIsAdminMode.js +0 -18
  57. package/dist/cjs/util/useUser.js +0 -16
  58. package/dist/cjs/wrapper/Dialog.js +0 -35
  59. package/dist/cjs/wrapper/DialogHandler.js +0 -35
  60. package/dist/esm/bootstrap.js +0 -4
  61. package/dist/esm/client.js +0 -8
  62. package/dist/esm/components/App.js +0 -35
  63. package/dist/esm/components/App.spec.js +0 -9
  64. package/dist/esm/components/Button.js +0 -34
  65. package/dist/esm/components/ChaynsModuleProvider.js +0 -517
  66. package/dist/esm/components/ChaynsProviderExposed.js +0 -3
  67. package/dist/esm/components/Dialog.js +0 -0
  68. package/dist/esm/components/TestProvider.js +0 -308
  69. package/dist/esm/components/Title.js +0 -210
  70. package/dist/esm/helper/cssLoader.js +0 -21
  71. package/dist/esm/hooks/useAddGeoLocationListener.js +0 -18
  72. package/dist/esm/hooks/useAddScrollListener.js +0 -18
  73. package/dist/esm/hooks/useAddWindowMetricsListener.js +0 -18
  74. package/dist/esm/hooks/useFunction.js +0 -6
  75. package/dist/esm/host/HostIframe.js +0 -153
  76. package/dist/esm/index.example.js +0 -1
  77. package/dist/esm/index2.js +0 -5
  78. package/dist/esm/types/DynamicApiImport.d.js +0 -1
  79. package/dist/esm/types/DynamicImport.d.js +0 -1
  80. package/dist/esm/types/chayns-components.d.js +0 -0
  81. package/dist/esm/types/chayns-logger.d.js +0 -0
  82. package/dist/esm/types/chayns.d.js +0 -0
  83. package/dist/esm/types/tobit-websocket-service-client.d.js +0 -0
  84. package/dist/esm/types/toolkit-types.d.js +0 -0
  85. package/dist/esm/util/useIsAdminMode.js +0 -9
  86. package/dist/esm/util/useUser.js +0 -7
  87. package/dist/esm/wrapper/Dialog.js +0 -31
  88. package/dist/esm/wrapper/DialogHandler.js +0 -31
  89. package/dist/types/bootstrap.d.ts +0 -1
  90. package/dist/types/client.d.ts +0 -7
  91. package/dist/types/components/App.d.ts +0 -5
  92. package/dist/types/components/Button.d.ts +0 -8
  93. package/dist/types/components/ChaynsModuleProvider.d.ts +0 -170
  94. package/dist/types/components/ChaynsProviderExposed.d.ts +0 -13
  95. package/dist/types/components/Dialog.d.ts +0 -0
  96. package/dist/types/components/Title.d.ts +0 -3
  97. package/dist/types/hooks/useFunction.d.ts +0 -2
  98. package/dist/types/host/HostIframe.d.ts +0 -20
  99. package/dist/types/index.example.d.ts +0 -0
  100. package/dist/types/wrapper/Dialog.d.ts +0 -10
  101. package/dist/types/wrapper/DialogHandler.d.ts +0 -10
@@ -1,153 +0,0 @@
1
- function _extends() { _extends = Object.assign || 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); }
2
-
3
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
4
-
5
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
6
-
7
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
8
-
9
- import React, { useEffect, useRef } from 'react';
10
- import * as comlink from 'comlink';
11
- import postIframeForm from '../util/postIframeForm';
12
-
13
- var HostIframe = function HostIframe(_ref) {
14
- var iFrameProps = _ref.iFrameProps,
15
- src = _ref.src,
16
- _ref$postForm = _ref.postForm,
17
- postForm = _ref$postForm === void 0 ? false : _ref$postForm,
18
- iFrameRef = _ref.iFrameRef,
19
- pages = _ref.pages,
20
- isAdminModeActive = _ref.isAdminModeActive,
21
- site = _ref.site,
22
- user = _ref.user,
23
- currentPage = _ref.currentPage,
24
- functions = _ref.functions,
25
- device = _ref.device;
26
- var eventTarget = useRef();
27
-
28
- var _ref2 = useRef();
29
-
30
- var currentDataRef = useRef();
31
-
32
- if (!eventTarget.current) {
33
- eventTarget.current = global.EventTarget ? new EventTarget() : undefined;
34
- }
35
-
36
- var setHeight = function setHeight(value) {
37
- if (_ref2.current) {
38
- _ref2.current.height = "".concat(value, "px");
39
- }
40
- }; // region initialData
41
-
42
-
43
- var initialData = {
44
- site: site,
45
- isAdminModeActive: isAdminModeActive,
46
- pages: pages,
47
- currentPage: currentPage,
48
- device: device,
49
- user: user
50
- }; // endregion
51
-
52
- currentDataRef.current = initialData; // region postIframeForm
53
-
54
- useEffect(function () {
55
- if (postForm) {
56
- void postIframeForm(src, JSON.stringify(_objectSpread(_objectSpread({}, initialData), {}, {
57
- pages: undefined
58
- })), 'chayns', iFrameProps.name);
59
- } // eslint-disable-next-line react-hooks/exhaustive-deps
60
-
61
- }, []); // endregion
62
-
63
- console.debug('functions', functions); // region expose data and functions to iframe
64
-
65
- useEffect(function () {
66
- var _ref$current;
67
-
68
- if ((_ref$current = _ref2.current) !== null && _ref$current !== void 0 && _ref$current.contentWindow) {
69
- var obj = _defineProperty({}, iFrameProps.name, {
70
- functions: _objectSpread(_objectSpread({}, functions), {}, {
71
- setHeight: setHeight
72
- }),
73
- addDataListener: function addDataListener(cb) {
74
- if (eventTarget.current) eventTarget.current.addEventListener('data_update', function (e) {
75
- return e.detail && cb(e.detail);
76
- });
77
- },
78
- getInitialData: function getInitialData() {
79
- return currentDataRef.current;
80
- }
81
- });
82
-
83
- comlink.expose(obj, comlink.windowEndpoint(_ref2.current.contentWindow));
84
-
85
- _ref2.current.contentWindow.postMessage('chayns-api-host-ready', '*'); // https://github.com/GoogleChromeLabs/comlink/pull/469 might be better approach once released
86
-
87
-
88
- return function () {
89
- delete obj[iFrameProps.name];
90
- };
91
- }
92
-
93
- return undefined; // eslint-disable-next-line react-hooks/exhaustive-deps
94
- }, []); // endregion
95
- // region dispatch data update
96
-
97
- useEffect(function () {
98
- if (eventTarget.current) {
99
- eventTarget.current.dispatchEvent(new CustomEvent('data_update', {
100
- detail: {
101
- type: 'isAdminModeActive',
102
- value: isAdminModeActive
103
- }
104
- }));
105
- }
106
- }, [isAdminModeActive]);
107
- useEffect(function () {
108
- if (eventTarget.current) {
109
- eventTarget.current.dispatchEvent(new CustomEvent('data_update', {
110
- detail: {
111
- type: 'user',
112
- value: user
113
- }
114
- }));
115
- }
116
- }, [user]);
117
- useEffect(function () {
118
- if (eventTarget.current) {
119
- eventTarget.current.dispatchEvent(new CustomEvent('data_update', {
120
- detail: {
121
- type: 'site',
122
- value: site
123
- }
124
- }));
125
- }
126
- }, [site]);
127
- useEffect(function () {
128
- if (eventTarget.current) {
129
- eventTarget.current.dispatchEvent(new CustomEvent('data_update', {
130
- detail: {
131
- type: 'pages',
132
- value: pages
133
- }
134
- }));
135
- }
136
- }, [pages]); // endregion
137
-
138
- return /*#__PURE__*/React.createElement("iframe", _extends({
139
- ref: function ref(r) {
140
- _ref2.current = r;
141
-
142
- if (iFrameRef) {
143
- // eslint-disable-next-line no-param-reassign
144
- iFrameRef.current = r;
145
- }
146
- },
147
- title: " "
148
- }, iFrameProps, {
149
- src: postForm ? undefined : src
150
- }));
151
- };
152
-
153
- export default HostIframe;
@@ -1 +0,0 @@
1
- import('./bootstrap');
@@ -1,5 +0,0 @@
1
- export { default as RealChaynsProvider } from './components/ChaynsProvider';
2
- export { default as getDeviceInfo } from './util/deviceHelper';
3
- export { default as ChaynsHost } from './host/ChaynsHost';
4
- export * from './calls';
5
- export * from './hooks';
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
File without changes
File without changes
File without changes
File without changes
@@ -1,9 +0,0 @@
1
- import { useContextSelector } from 'use-context-selector';
2
- import { ChaynsContext } from '../components/ChaynsContext';
3
- export var useIsAdminMode = function useIsAdminMode() {
4
- var _useContextSelector;
5
-
6
- return (_useContextSelector = useContextSelector(ChaynsContext, function (v) {
7
- return v === null || v === void 0 ? void 0 : v.isAdminModeActive;
8
- })) !== null && _useContextSelector !== void 0 ? _useContextSelector : false;
9
- };
@@ -1,7 +0,0 @@
1
- import { useContextSelector } from 'use-context-selector';
2
- import { ChaynsContext } from '../components/ChaynsContext';
3
- export var useUser = function useUser() {
4
- return useContextSelector(ChaynsContext, function (v) {
5
- return v === null || v === void 0 ? void 0 : v.user;
6
- });
7
- };
@@ -1,31 +0,0 @@
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); }
4
- export default class DialogHandler {
5
- constructor(config, open, close) {
6
- _defineProperty(this, "isOpen", false);
7
- this._open = open;
8
- this._close = close;
9
- this._config = config;
10
- }
11
- async open() {
12
- if (this.isOpen) {
13
- throw new Error('cannot open a dialog which is already open');
14
- }
15
- return new Promise(async resolve => {
16
- const callback = data => {
17
- this.isOpen = false;
18
- resolve(data);
19
- };
20
- this.isOpen = true;
21
- this.dialogId = await this._open(this._config, callback);
22
- });
23
- }
24
- close(buttonType, data) {
25
- if (!this.isOpen) {
26
- return;
27
- }
28
- this.isOpen = false;
29
- this._close(this.dialogId, data);
30
- }
31
- }
@@ -1,31 +0,0 @@
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); }
4
- export default class DialogHandler {
5
- constructor(config, open, close) {
6
- _defineProperty(this, "isOpen", false);
7
- this._open = open;
8
- this._close = close;
9
- this._config = config;
10
- }
11
- async open() {
12
- if (this.isOpen) {
13
- throw new Error('cannot open a dialog which is already open');
14
- }
15
- return new Promise(async resolve => {
16
- const callback = data => {
17
- this.isOpen = false;
18
- resolve(data);
19
- };
20
- this.isOpen = true;
21
- this.dialogId = await this._open(this._config, callback);
22
- });
23
- }
24
- close(buttonType, data) {
25
- if (!this.isOpen) {
26
- return;
27
- }
28
- this.isOpen = false;
29
- this._close(this.dialogId, data);
30
- }
31
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,7 +0,0 @@
1
- export { default as ChaynsProvider } from './components/ChaynsModuleProvider';
2
- export { default as ChaynsHost } from './host/ChaynsHost';
3
- export { default as getDeviceInfo, getScreenSize } from './util/deviceHelper';
4
- export * from './components/ChaynsModuleProvider';
5
- export * from './components/withCompatMode';
6
- export * as dialog from './calls/dialogs/index';
7
- export * from './types/IChaynsReact';
@@ -1,5 +0,0 @@
1
- import React from 'react';
2
- import { InferProps } from 'prop-types';
3
- declare const propTypes: {};
4
- declare const App: React.FunctionComponent<InferProps<typeof propTypes>>;
5
- export default App;
@@ -1,8 +0,0 @@
1
- import React from 'react';
2
- declare const _default: {
3
- Component: React.ComponentType<any>;
4
- CompatComponent: React.ForwardRefExoticComponent<React.RefAttributes<unknown>>;
5
- requiredVersion: string;
6
- environment: string | undefined;
7
- };
8
- export default _default;
@@ -1,170 +0,0 @@
1
- import { ReactChild, ReactChildren } from "react";
2
- import { ChaynsApiDevice, ChaynsApiSite, ChaynsReactValues, UserInfo } from "../types/IChaynsReact";
3
- interface TestChild {
4
- children: ReactChild | ReactChildren;
5
- }
6
- declare const ChaynsProvider: ({ children, renderedByServer, ...props }: TestChild) => false | JSX.Element;
7
- export declare const useGeoLocation: (args_0?: {
8
- enabled?: boolean | undefined;
9
- timeout?: number | undefined;
10
- silent?: boolean | undefined;
11
- } | undefined) => {
12
- value: import("../types/IChaynsReact").GeoLocation | null;
13
- };
14
- export declare const addGeoLocationListener: (value: {
15
- timeout?: number | undefined;
16
- silent?: boolean | undefined;
17
- }, callback: (geoLocation: import("../types/IChaynsReact").GeoLocation) => void) => Promise<number>;
18
- export declare const addScrollListener: (value: {
19
- throttle?: number | undefined;
20
- }, callback: (result: import("../types/IChaynsReact").ScrollListenerResult) => void) => Promise<number>;
21
- export declare const addVisibilityChangeListener: (callback: (result: import("../types/IChaynsReact").VisibilityChangeListenerResult) => void) => Promise<number>;
22
- export declare const addWindowMetricsListener: (callback: (result: import("../types/IChaynsReact").WindowMetricsListenerResult) => void) => Promise<number>;
23
- export declare const getAccessToken: (value?: import("../types/IChaynsReact").AccessToken | undefined) => Promise<import("../types/IChaynsReact").AccessTokenResult>;
24
- export declare const getAvailableSharingServices: () => Promise<import("../types/IChaynsReact").AvailableSharingServices>;
25
- export declare const getGeoLocation: (value: {
26
- timeout?: number | undefined;
27
- silent?: boolean | undefined;
28
- }) => Promise<import("../types/IChaynsReact").GeoLocation>;
29
- export declare const getUserInfo: (value: import("../types/IChaynsReact").UserInfoQuery) => Promise<UserInfo | null>;
30
- export declare const getScrollPosition: () => Promise<import("../types/IChaynsReact").ScrollListenerResult>;
31
- export declare const getWindowMetrics: () => Promise<import("../types/IChaynsReact").WindowMetricsListenerResult>;
32
- export declare const invokeCall: (value: import("../types/IChaynsReact").InvokeCall, callback?: ((result: any) => void) | undefined) => Promise<any>;
33
- export declare const invokeDialogCall: (value: import("../types/IChaynsReact").InvokeCall, callback?: ((result: any) => void) | undefined) => Promise<any>;
34
- export declare const login: (value?: import("../types/IChaynsReact").Login | undefined, callback?: ((result: boolean) => void) | undefined, closeCallback?: (() => void) | undefined) => Promise<import("../types/IChaynsReact").LoginResult>;
35
- export declare const logout: () => Promise<void>;
36
- export declare const navigateBack: () => Promise<void>;
37
- export declare const openImage: (value: import("../types/IChaynsReact").OpenImage) => Promise<void>;
38
- export declare const openUrl: (value: import("../types/IChaynsReact").OpenUrl) => Promise<void>;
39
- export declare const openVideo: (value: import("../types/IChaynsReact").OpenVideo) => Promise<void>;
40
- export declare const refreshAccessToken: () => Promise<void>;
41
- export declare const refreshData: (value: import("../types/IChaynsReact").RefreshData) => Promise<void>;
42
- export declare const removeGeoLocationListener: (value: number) => Promise<void>;
43
- export declare const removeScrollListener: (value: number) => Promise<void>;
44
- export declare const removeVisibilityChangeListener: (value: number) => Promise<void>;
45
- export declare const removeWindowMetricsListener: (value: number) => Promise<void>;
46
- export declare const selectPage: (value: import("../types/IChaynsReact").SelectPage) => Promise<void>;
47
- export declare const scrollToY: (position: number, duration: number) => Promise<void>;
48
- export declare const sendMessageToGroup: (groupId: number, message: import("../types/IChaynsReact").IntercomMessage) => Promise<Response>;
49
- export declare const sendMessageToPage: (message: import("../types/IChaynsReact").IntercomMessage) => Promise<Response>;
50
- export declare const sendMessageToUser: (userId: number, message: import("../types/IChaynsReact").IntercomMessage) => Promise<Response>;
51
- export declare const setAdminMode: (enabled: boolean) => Promise<void>;
52
- export declare const setDisplayTimeout: (enabled: boolean) => Promise<import("../types/IChaynsReact").DisplayTimeout>;
53
- export declare const setFloatingButton: (value: import("../types/IChaynsReact").FloatingButton, callback: () => void) => Promise<void>;
54
- export declare const setHeight: (height: number) => Promise<void>;
55
- export declare const setOverlay: (value: import("../types/IChaynsReact").ShowOverlay, callback: () => void) => Promise<void>;
56
- export declare const setRefreshScrollEnabled: (enabled: boolean) => Promise<import("../types/IChaynsReact").RefreshScrollEnabled>;
57
- export declare const setScanQrCode: (value: import("../types/IChaynsReact").ScanQrCodeRequest) => Promise<import("../types/IChaynsReact").ScanQrCodeResult>;
58
- export declare const setTempDesignSettings: (value: import("../types/IChaynsReact").DesignSettings) => Promise<void>;
59
- export declare const setWaitCursor: (value: import("../types/IChaynsReact").WaitCursor) => Promise<void>;
60
- export declare const storageGetItem: (key: string, accessMode: import("../types/IChaynsReact").AccessMode) => Promise<any>;
61
- export declare const storageRemoveItem: (key: string, accessMode: import("../types/IChaynsReact").AccessMode) => Promise<void>;
62
- export declare const storageSetItem: (key: string, value: any, accessMode: import("../types/IChaynsReact").AccessMode, tappIds: number[]) => Promise<void>;
63
- export declare const vibrate: (value: import("../types/IChaynsReact").Vibrate) => Promise<void>;
64
- export declare const useAccessToken: (accessToken?: import("../types/IChaynsReact").AccessToken | undefined) => string | undefined;
65
- export declare const useWindowMetrics: (args_0?: {
66
- enabled?: boolean | undefined;
67
- } | undefined) => import("../types/IChaynsReact").WindowMetricsListenerResult;
68
- export declare const useScrollPosition: (args_0?: {
69
- enabled?: boolean | undefined;
70
- throttle?: number | undefined;
71
- } | undefined) => import("../types/IChaynsReact").ScrollListenerResult;
72
- export declare const useUser: () => import("../types/IChaynsReact").ChaynsApiUser;
73
- export declare const useIsAdminMode: () => boolean;
74
- export declare const useScrollOffsetTop: (args_0?: {
75
- enabled?: boolean | undefined;
76
- throttle?: number | undefined;
77
- } | undefined) => number;
78
- export declare const useScrollOffsetBottom: (args_0?: {
79
- enabled?: boolean | undefined;
80
- throttle?: number | undefined;
81
- } | undefined) => number;
82
- export declare const useScrollListener: () => (value: {
83
- throttle?: number | undefined;
84
- }, callback: (result: import("../types/IChaynsReact").ScrollListenerResult) => void) => () => void;
85
- export declare const useWindowMetricsListener: () => (callback: (result: import("../types/IChaynsReact").WindowMetricsListenerResult) => void) => () => void;
86
- export declare const useGeoLocationListener: () => (value: {
87
- timeout?: number | undefined;
88
- silent?: boolean | undefined;
89
- }, callback: (result: import("../types/IChaynsReact").GeoLocation) => void) => () => void;
90
- export declare const WaitUntil: ({ children, ...props }: TestChild) => JSX.Element;
91
- export declare const getUser: () => import("../types/IChaynsReact").ChaynsApiUser | undefined;
92
- export declare const getSite: () => ChaynsApiSite;
93
- export declare const getDevice: () => ChaynsApiDevice;
94
- export declare const useDevice: () => ChaynsApiDevice;
95
- export declare const useSite: () => ChaynsApiSite;
96
- export declare const getLanguage: () => {
97
- site: import("../types/IChaynsReact").Language;
98
- translation: import("../types/IChaynsReact").Language;
99
- device: import("../types/IChaynsReact").Language;
100
- active: import("../types/IChaynsReact").Language;
101
- };
102
- export declare const getParameters: () => {
103
- [key: string]: string;
104
- [key: symbol]: string;
105
- };
106
- export declare const useParameters: () => {
107
- [key: string]: string;
108
- [key: symbol]: string;
109
- };
110
- export declare const usePages: () => import("../types/IChaynsReact").Page[];
111
- export declare const usePage: () => import("../types/IChaynsReact").Page | null;
112
- export declare const getPages: () => import("../types/IChaynsReact").Page[];
113
- export declare const useEnvironment: () => {
114
- buildEnvironment: import("../types/IChaynsReact").Environment;
115
- runtimeEnvironment: string | import("../types/IChaynsReact").RuntimeEnviroment;
116
- };
117
- export declare const useCustomData: () => any;
118
- export declare const getEnvironment: () => {
119
- buildEnvironment: import("../types/IChaynsReact").Environment;
120
- runtimeEnvironment: string | import("../types/IChaynsReact").RuntimeEnviroment;
121
- };
122
- export declare const useLanguage: () => {
123
- site: import("../types/IChaynsReact").Language;
124
- translation: import("../types/IChaynsReact").Language;
125
- device: import("../types/IChaynsReact").Language;
126
- active: import("../types/IChaynsReact").Language;
127
- };
128
- export declare const useValues: () => ChaynsReactValues;
129
- export declare const useFunctions: () => import("../types/IChaynsReact").ChaynsReactFunctions;
130
- export declare const useCurrentPage: () => any;
131
- /**
132
- * @deprecated
133
- */
134
- export declare const user: UserInfo;
135
- /**
136
- * @deprecated
137
- */
138
- export declare const site: ChaynsApiSite;
139
- /**
140
- * @deprecated
141
- */
142
- export declare const device: ChaynsApiDevice;
143
- /**
144
- * @deprecated
145
- */
146
- export declare const language: {
147
- site: import("../types/IChaynsReact").Language;
148
- translation: import("../types/IChaynsReact").Language;
149
- device: import("../types/IChaynsReact").Language;
150
- active: import("../types/IChaynsReact").Language;
151
- };
152
- /**
153
- * @deprecated
154
- */
155
- export declare const parameters: {
156
- [key: string]: string;
157
- [key: symbol]: string;
158
- };
159
- /**
160
- * @deprecated
161
- */
162
- export declare const pages: import("../types/IChaynsReact").Page[];
163
- /**
164
- * @deprecated
165
- */
166
- export declare const environment: {
167
- buildEnvironment: import("../types/IChaynsReact").Environment;
168
- runtimeEnvironment: string | import("../types/IChaynsReact").RuntimeEnviroment;
169
- };
170
- export default ChaynsProvider;
@@ -1,13 +0,0 @@
1
- /// <reference types="react" />
2
- declare const _default: {
3
- Component: import("react").ComponentType<{
4
- data?: import("..").ChaynsReactValues | undefined;
5
- functions?: import("..").ChaynsReactFunctions | undefined;
6
- isSSR?: boolean | undefined;
7
- isModule?: boolean | undefined;
8
- }>;
9
- CompatComponent: import("react").ForwardRefExoticComponent<import("react").RefAttributes<unknown>>;
10
- requiredVersion: any;
11
- environment: string | undefined;
12
- };
13
- export default _default;
File without changes
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- declare const _default: React.MemoExoticComponent<() => JSX.Element>;
3
- export default _default;
@@ -1,2 +0,0 @@
1
- import { ChaynsReactFunctions } from '../types/IChaynsReact';
2
- export declare const useFunction: <T extends keyof ChaynsReactFunctions>(name: T) => ChaynsReactFunctions[T];
@@ -1,20 +0,0 @@
1
- import React, { FC } from 'react';
2
- import { ChaynsApiDevice, ChaynsApiSite, ChaynsApiUser, ChaynsReactFunctions, ChaynsReactValues, Page } from '../types/IChaynsReact';
3
- declare type HostIframeProps = {
4
- iFrameProps: {
5
- [key: string]: unknown;
6
- name: string;
7
- };
8
- src: string;
9
- postForm?: boolean;
10
- iFrameRef: React.MutableRefObject<HTMLIFrameElement | null> | undefined;
11
- pages: Page[];
12
- isAdminModeActive: boolean;
13
- site: ChaynsApiSite;
14
- user: ChaynsApiUser;
15
- currentPage: ChaynsReactValues["currentPage"];
16
- functions: ChaynsReactFunctions;
17
- device: ChaynsApiDevice;
18
- };
19
- declare const HostIframe: FC<HostIframeProps>;
20
- export default HostIframe;
File without changes
@@ -1,10 +0,0 @@
1
- export default class DialogHandler {
2
- private dialogId;
3
- private isOpen;
4
- private readonly _open;
5
- private readonly _close;
6
- private readonly _config;
7
- constructor(config: any, open: any, close: any);
8
- open(): Promise<unknown>;
9
- close(buttonType: any, data: any): void;
10
- }
@@ -1,10 +0,0 @@
1
- export default class DialogHandler {
2
- private dialogId;
3
- private isOpen;
4
- private readonly _open;
5
- private readonly _close;
6
- private readonly _config;
7
- constructor(config: any, open: any, close: any);
8
- open(): Promise<unknown>;
9
- close(buttonType: any, data: any): void;
10
- }