chayns-api 1.0.0 → 1.0.1
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/bootstrap.js +11 -0
- package/dist/cjs/calls/abstractApiListener.js +40 -0
- package/dist/cjs/calls/apiEventListener.js +40 -0
- package/dist/cjs/calls/dialogs/alert.js +2 -0
- package/dist/cjs/calls/dialogs/chaynsDialog.js +8 -2
- package/dist/cjs/calls/dialogs/close.js +2 -0
- package/dist/cjs/calls/dialogs/communication.js +16 -1
- package/dist/cjs/calls/dialogs/confirm.js +4 -0
- package/dist/cjs/calls/dialogs/date.js +53 -36
- package/dist/cjs/calls/dialogs/dropUpAlert.js +3 -0
- package/dist/cjs/calls/dialogs/fileSelect.js +10 -0
- package/dist/cjs/calls/dialogs/iFrame.js +8 -0
- package/dist/cjs/calls/dialogs/index.js +27 -0
- package/dist/cjs/calls/dialogs/input.js +6 -0
- package/dist/cjs/calls/dialogs/mediaSelect.js +7 -0
- package/dist/cjs/calls/dialogs/open.js +2 -0
- package/dist/cjs/calls/dialogs/select.js +9 -0
- package/dist/cjs/calls/dialogs/signature.js +5 -0
- package/dist/cjs/calls/dialogs/toast.js +3 -0
- package/dist/cjs/calls/dialogs/utils/callback.js +2 -0
- package/dist/cjs/calls/dialogs/utils/is.js +4 -0
- package/dist/cjs/calls/getUserInfo.js +11 -0
- package/dist/cjs/calls/index.js +155 -3
- package/dist/cjs/calls/sendMessage.js +26 -0
- package/dist/cjs/calls/setVisibilityChangeListener.js +1 -0
- package/dist/cjs/calls/visibilityChangeListener.js +12 -1
- package/dist/cjs/calls/windowMetricsListener.js +18 -0
- package/dist/cjs/components/App.js +32 -0
- package/dist/cjs/components/App.spec.js +16 -0
- package/dist/cjs/components/Button.js +32 -0
- package/dist/cjs/components/ChaynsContext.js +4 -2
- package/dist/cjs/components/ChaynsProvider.js +28 -6
- package/dist/cjs/components/ChaynsProviderExposed.js +16 -0
- package/dist/cjs/components/TestProvider.js +236 -0
- package/dist/cjs/components/Title.js +162 -0
- package/dist/cjs/components/WaitUntil.js +5 -0
- package/dist/cjs/components/withCompatMode.js +16 -1
- package/dist/cjs/functions/addApiListener.js +37 -0
- package/dist/cjs/functions/addGeoLocationListener.js +26 -0
- package/dist/cjs/functions/addScrollListener.js +26 -0
- package/dist/cjs/functions/addWindowMetricsListener.js +37 -0
- package/dist/cjs/helper/apiListenerHelper.js +9 -0
- package/dist/cjs/helper/cssLoader.js +28 -0
- package/dist/cjs/hooks/addGeoLocationListener.js +26 -0
- package/dist/cjs/hooks/addScrollListener.js +26 -0
- package/dist/cjs/hooks/addWindowMetricsListener.js +37 -0
- package/dist/cjs/hooks/geoLocation.js +48 -0
- package/dist/cjs/hooks/geoLocationListener.js +11 -2
- package/dist/cjs/hooks/index.js +16 -0
- package/dist/cjs/hooks/scrollListener.js +23 -4
- package/dist/cjs/hooks/useAccessToken.js +5 -0
- package/dist/cjs/hooks/useAddGeoLocationListener.js +26 -0
- package/dist/cjs/hooks/useAddScrollListener.js +48 -0
- package/dist/cjs/hooks/useAddWindowMetricsListener.js +45 -0
- package/dist/cjs/hooks/useAdddScrollListener.js +26 -0
- package/dist/cjs/hooks/useCurrentPage.js +4 -0
- package/dist/cjs/hooks/useCustomData.js +4 -0
- package/dist/cjs/hooks/useDevice.js +4 -0
- package/dist/cjs/hooks/useEnvironment.js +4 -0
- package/dist/cjs/hooks/useFunctions.js +4 -0
- package/dist/cjs/hooks/useIsAdminMode.js +5 -0
- package/dist/cjs/hooks/useLanguage.js +4 -0
- package/dist/cjs/hooks/usePages.js +12 -0
- package/dist/cjs/hooks/useParameters.js +4 -0
- package/dist/cjs/hooks/useSite.js +4 -0
- package/dist/cjs/hooks/useUser.js +4 -0
- package/dist/cjs/hooks/useValues.js +4 -0
- package/dist/cjs/hooks/windowMetrics.js +45 -0
- package/dist/cjs/hooks/windowMetricsListener.js +12 -2
- package/dist/cjs/host/ChaynsHost.js +12 -0
- package/dist/cjs/host/{module/PagemakerFrame.js → HostIframe.js} +75 -23
- package/dist/cjs/host/ModuleHost.js +11 -0
- package/dist/cjs/host/iframe/HostIframe.js +30 -23
- package/dist/cjs/host/iframe/utils/useUpdateData.js +3 -0
- package/dist/cjs/host/module/ModuleHost.js +13 -3
- package/dist/cjs/host/module/utils/loadComponent.js +18 -1
- package/dist/cjs/host/module/utils/useDynamicScript.js +18 -0
- package/dist/cjs/host/module/utils.js +25 -0
- package/dist/cjs/index.example.js +7 -0
- package/dist/cjs/index.js +19 -0
- package/dist/cjs/index2.js +64 -0
- package/dist/cjs/types/DynamicImport.d.js +5 -0
- package/dist/cjs/types/IChaynsReact.js +47 -0
- package/dist/cjs/types/chayns-components.d.js +1 -0
- package/dist/cjs/types/chayns-logger.d.js +1 -0
- package/dist/cjs/types/chayns.d.js +1 -0
- package/dist/cjs/types/tobit-websocket-service-client.d.js +1 -0
- package/dist/cjs/types/toolkit-types.d.js +1 -0
- package/dist/cjs/util/appCall.js +4 -1
- package/dist/cjs/util/deviceHelper.js +17 -2
- package/dist/cjs/util/heightHelper.js +9 -0
- package/dist/cjs/util/postIframeForm.js +5 -0
- package/dist/cjs/util/useFunctionsContext.js +16 -0
- package/dist/cjs/util/useIsAdminMode.js +18 -0
- package/dist/cjs/util/useUser.js +16 -0
- package/dist/cjs/wrapper/AppWrapper.js +144 -119
- package/dist/cjs/wrapper/FrameWrapper.js +248 -215
- package/dist/cjs/wrapper/ModuleFederationWrapper.js +27 -2
- package/dist/cjs/wrapper/SsrWrapper.js +8 -0
- package/dist/esm/bootstrap.js +4 -0
- package/dist/esm/calls/dialogs/alert.js +4 -4
- package/dist/esm/calls/dialogs/chaynsDialog.js +11 -7
- package/dist/esm/calls/dialogs/communication.js +26 -15
- package/dist/esm/calls/dialogs/confirm.js +8 -5
- package/dist/esm/calls/dialogs/date.js +94 -85
- package/dist/esm/calls/dialogs/dropUpAlert.js +1 -1
- package/dist/esm/calls/dialogs/fileSelect.js +62 -23
- package/dist/esm/calls/dialogs/iFrame.js +10 -7
- package/dist/esm/calls/dialogs/input.js +5 -2
- package/dist/esm/calls/dialogs/mediaSelect.js +55 -18
- package/dist/esm/calls/dialogs/open.js +2 -2
- package/dist/esm/calls/dialogs/select.js +9 -5
- package/dist/esm/calls/dialogs/signature.js +2 -0
- package/dist/esm/calls/dialogs/toast.js +11 -6
- package/dist/esm/calls/dialogs/utils/callback.js +5 -3
- package/dist/esm/calls/dialogs/utils/is.js +3 -1
- package/dist/esm/calls/getUserInfo.js +92 -32
- package/dist/esm/calls/index.js +276 -124
- package/dist/esm/calls/sendMessage.js +221 -91
- package/dist/esm/calls/visibilityChangeListener.js +15 -10
- package/dist/esm/components/App.js +35 -0
- package/dist/esm/components/App.spec.js +9 -0
- package/dist/esm/components/Button.js +34 -0
- package/dist/esm/components/ChaynsContext.js +3 -3
- package/dist/esm/components/ChaynsProvider.js +86 -45
- package/dist/esm/components/ChaynsProviderExposed.js +3 -0
- package/dist/esm/components/TestProvider.js +308 -0
- package/dist/esm/components/Title.js +210 -0
- package/dist/esm/components/WaitUntil.js +86 -21
- package/dist/esm/components/withCompatMode.js +77 -35
- package/dist/esm/helper/apiListenerHelper.js +15 -10
- package/dist/esm/helper/cssLoader.js +21 -0
- package/dist/esm/hooks/geoLocationListener.js +46 -20
- package/dist/esm/hooks/scrollListener.js +86 -50
- package/dist/esm/hooks/useAccessToken.js +28 -6
- package/dist/esm/hooks/useAddGeoLocationListener.js +18 -0
- package/dist/esm/hooks/useAddScrollListener.js +18 -0
- package/dist/esm/hooks/useAddWindowMetricsListener.js +18 -0
- package/dist/esm/hooks/useCurrentPage.js +6 -2
- package/dist/esm/hooks/useCustomData.js +6 -2
- package/dist/esm/hooks/useDevice.js +6 -1
- package/dist/esm/hooks/useEnvironment.js +6 -1
- package/dist/esm/hooks/useFunctions.js +5 -2
- package/dist/esm/hooks/useIsAdminMode.js +6 -2
- package/dist/esm/hooks/useLanguage.js +6 -1
- package/dist/esm/hooks/usePages.js +27 -14
- package/dist/esm/hooks/useParameters.js +6 -1
- package/dist/esm/hooks/useSite.js +6 -1
- package/dist/esm/hooks/useUser.js +6 -1
- package/dist/esm/hooks/useValues.js +5 -2
- package/dist/esm/hooks/windowMetricsListener.js +44 -18
- package/dist/esm/host/ChaynsHost.js +30 -21
- package/dist/esm/host/HostIframe.js +153 -0
- package/dist/esm/host/iframe/HostIframe.js +142 -86
- package/dist/esm/host/iframe/utils/useUpdateData.js +6 -4
- package/dist/esm/host/module/ModuleHost.js +49 -42
- package/dist/esm/host/module/utils/loadComponent.js +85 -47
- package/dist/esm/host/module/utils/useDynamicScript.js +74 -27
- package/dist/esm/index.example.js +1 -0
- package/dist/esm/index2.js +5 -0
- package/dist/esm/types/DynamicImport.d.js +1 -0
- package/dist/esm/types/IChaynsReact.js +61 -14
- package/dist/esm/types/chayns-components.d.js +0 -0
- package/dist/esm/types/chayns-logger.d.js +0 -0
- package/dist/esm/types/chayns.d.js +0 -0
- package/dist/esm/types/tobit-websocket-service-client.d.js +0 -0
- package/dist/esm/types/toolkit-types.d.js +0 -0
- package/dist/esm/util/appCall.js +4 -2
- package/dist/esm/util/deviceHelper.js +33 -11
- package/dist/esm/util/heightHelper.js +13 -10
- package/dist/esm/util/postIframeForm.js +57 -25
- package/dist/esm/util/useIsAdminMode.js +9 -0
- package/dist/esm/util/useUser.js +7 -0
- package/dist/esm/wrapper/AppWrapper.js +762 -179
- package/dist/esm/wrapper/FrameWrapper.js +1509 -258
- package/dist/esm/wrapper/ModuleFederationWrapper.js +284 -47
- package/dist/esm/wrapper/SsrWrapper.js +65 -19
- package/dist/types/bootstrap.d.ts +1 -0
- package/dist/types/calls/dialogs/confirm.d.ts +1 -1
- package/dist/types/calls/dialogs/date.d.ts +4 -4
- package/dist/types/calls/dialogs/dropUpAlert.d.ts +1 -1
- package/dist/types/calls/dialogs/fileSelect.d.ts +1 -1
- package/dist/types/calls/dialogs/iFrame.d.ts +1 -1
- package/dist/types/calls/dialogs/input.d.ts +1 -1
- package/dist/types/calls/dialogs/mediaSelect.d.ts +1 -1
- package/dist/types/calls/dialogs/signature.d.ts +1 -1
- package/dist/types/components/App.d.ts +5 -0
- package/dist/types/components/Button.d.ts +8 -0
- package/dist/types/components/ChaynsProvider.d.ts +1 -1
- package/dist/types/components/ChaynsProviderExposed.d.ts +13 -0
- package/dist/types/components/Title.d.ts +3 -0
- package/dist/types/components/WaitUntil.d.ts +1 -1
- package/dist/types/components/withCompatMode.d.ts +1 -1
- package/dist/types/hooks/useAccessToken.d.ts +1 -1
- package/dist/types/host/ChaynsHost.d.ts +2 -1
- package/dist/types/host/{module/PagemakerFrame.d.ts → HostIframe.d.ts} +5 -7
- package/dist/types/host/iframe/HostIframe.d.ts +1 -1
- package/dist/types/host/module/ModuleHost.d.ts +2 -2
- package/dist/types/index.example.d.ts +0 -0
- package/dist/types/types/IChaynsReact.d.ts +14 -14
- package/package.json +1 -1
- package/dist/cjs/calls/dialogs/utils/environment.js +0 -10
- package/dist/esm/calls/dialogs/utils/environment.js +0 -3
- package/dist/esm/host/module/PagemakerFrame.js +0 -97
- package/dist/types/calls/dialogs/utils/environment.d.ts +0 -3
|
@@ -1,97 +1,73 @@
|
|
|
1
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
2
|
+
|
|
3
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
4
|
+
|
|
5
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
6
|
+
|
|
7
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
8
|
+
|
|
9
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
10
|
+
|
|
11
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
12
|
+
|
|
13
|
+
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; }
|
|
14
|
+
|
|
15
|
+
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; }
|
|
16
|
+
|
|
17
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
18
|
+
|
|
19
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
20
|
+
|
|
21
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
22
|
+
|
|
23
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
24
|
+
|
|
25
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
26
|
+
|
|
1
27
|
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; }
|
|
28
|
+
|
|
2
29
|
import { Environment, Font, Gender, IconType, RuntimeEnviroment } from '../types/IChaynsReact';
|
|
3
30
|
import invokeAppCall from "../util/appCall";
|
|
4
31
|
import getDeviceInfo from "../util/deviceHelper";
|
|
5
|
-
import { removeVisibilityChangeListener } from "../calls/visibilityChangeListener";
|
|
6
|
-
import
|
|
7
|
-
export
|
|
8
|
-
|
|
9
|
-
var
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const {
|
|
14
|
-
AppInfo,
|
|
15
|
-
AppUser
|
|
16
|
-
} = retVal;
|
|
17
|
-
this.accessToken = AppUser.TobitAccessToken;
|
|
18
|
-
return {
|
|
19
|
-
device: getDeviceInfo(navigator.userAgent, 'image/webp'),
|
|
20
|
-
environment: {
|
|
21
|
-
buildEnvironment: Environment.Production,
|
|
22
|
-
runtimeEnvironment: RuntimeEnviroment.Unknown
|
|
23
|
-
},
|
|
24
|
-
language: {
|
|
25
|
-
site: AppInfo.Language,
|
|
26
|
-
translation: null,
|
|
27
|
-
device: AppInfo.Language,
|
|
28
|
-
active: AppInfo.Language
|
|
29
|
-
},
|
|
30
|
-
// ToDo: Find better way to detect
|
|
31
|
-
site: {
|
|
32
|
-
id: AppInfo.SiteID,
|
|
33
|
-
locationId: AppInfo.LocationID,
|
|
34
|
-
url: (_window = window) === null || _window === void 0 ? void 0 : _window.location.href.split('#')[0],
|
|
35
|
-
layoutDisposition: {
|
|
36
|
-
contentWide: false,
|
|
37
|
-
barOnTop: false,
|
|
38
|
-
barWide: false,
|
|
39
|
-
coverDetached: false,
|
|
40
|
-
coverHidden: false,
|
|
41
|
-
coverWide: false,
|
|
42
|
-
docked: false
|
|
43
|
-
},
|
|
44
|
-
title: AppInfo.Title,
|
|
45
|
-
colorMode: AppInfo.colorMode,
|
|
46
|
-
color: AppInfo.color,
|
|
47
|
-
domain: AppInfo.domain,
|
|
48
|
-
font: {
|
|
49
|
-
id: Font.Roboto,
|
|
50
|
-
headlineFont: Font.Roboto,
|
|
51
|
-
dynamicFontSize: false
|
|
52
|
-
},
|
|
53
|
-
dynamicFontSize: false,
|
|
54
|
-
locationPersonId: AppInfo.LocationPersonId,
|
|
55
|
-
urlHash: (_window2 = window) === null || _window2 === void 0 ? void 0 : _window2.location.hash.replace('#', '')
|
|
56
|
-
},
|
|
57
|
-
parameters: [...new URLSearchParams(location.search)],
|
|
58
|
-
user: {
|
|
59
|
-
firstName: AppUser.FirstName,
|
|
60
|
-
lastName: AppUser.LastName,
|
|
61
|
-
gender: Gender.Unknown,
|
|
62
|
-
userId: AppUser.TobitUserID,
|
|
63
|
-
personId: AppUser.PersonID,
|
|
64
|
-
uacGroups: []
|
|
65
|
-
},
|
|
66
|
-
customData: null,
|
|
67
|
-
isAdminModeActive: AppUser.AdminMode,
|
|
68
|
-
currentPage: {
|
|
69
|
-
id: (_AppInfo$TappSelected = AppInfo.TappSelected) === null || _AppInfo$TappSelected === void 0 ? void 0 : _AppInfo$TappSelected.TappID,
|
|
70
|
-
siteId: AppInfo.SiteID
|
|
71
|
-
},
|
|
72
|
-
pages: AppInfo.Tapps.map(x => ({
|
|
73
|
-
id: x.TappID,
|
|
74
|
-
icon: '',
|
|
75
|
-
iconType: IconType.Font,
|
|
76
|
-
customUrl: '',
|
|
77
|
-
isExclusive: x.isExclusiveView,
|
|
78
|
-
isHiddenFromMenu: x.isHiddenFromMenu,
|
|
79
|
-
minAge: null,
|
|
80
|
-
name: x.ShowName,
|
|
81
|
-
sortId: x.SortUID
|
|
82
|
-
}))
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
|
-
constructor() {
|
|
32
|
+
import { removeVisibilityChangeListener as _removeVisibilityChangeListener } from "../calls/visibilityChangeListener";
|
|
33
|
+
import _getUserInfo from "../calls/getUserInfo";
|
|
34
|
+
export var AppWrapper = /*#__PURE__*/function () {
|
|
35
|
+
function AppWrapper() {
|
|
36
|
+
var _this = this;
|
|
37
|
+
|
|
38
|
+
_classCallCheck(this, AppWrapper);
|
|
39
|
+
|
|
86
40
|
_defineProperty(this, "values", null);
|
|
41
|
+
|
|
87
42
|
_defineProperty(this, "accessToken", "");
|
|
43
|
+
|
|
88
44
|
_defineProperty(this, "counter", 0);
|
|
45
|
+
|
|
89
46
|
_defineProperty(this, "functions", {
|
|
90
|
-
getAccessToken:
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
47
|
+
getAccessToken: function () {
|
|
48
|
+
var _getAccessToken = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(accessToken) {
|
|
49
|
+
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
50
|
+
while (1) {
|
|
51
|
+
switch (_context.prev = _context.next) {
|
|
52
|
+
case 0:
|
|
53
|
+
return _context.abrupt("return", {
|
|
54
|
+
accessToken: _this.accessToken
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
case 1:
|
|
58
|
+
case "end":
|
|
59
|
+
return _context.stop();
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}, _callee);
|
|
63
|
+
}));
|
|
64
|
+
|
|
65
|
+
function getAccessToken(_x) {
|
|
66
|
+
return _getAccessToken.apply(this, arguments);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
return getAccessToken;
|
|
70
|
+
}(),
|
|
95
71
|
// addGeoLocationListener: async (value , callback) => {
|
|
96
72
|
// return invokeAppCall({
|
|
97
73
|
// 'action': 14,
|
|
@@ -119,123 +95,730 @@ export class AppWrapper {
|
|
|
119
95
|
// }
|
|
120
96
|
// return id;
|
|
121
97
|
// },
|
|
122
|
-
customCallbackFunction:
|
|
98
|
+
customCallbackFunction: function () {
|
|
99
|
+
var _customCallbackFunction = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(type, data) {
|
|
100
|
+
return regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
101
|
+
while (1) {
|
|
102
|
+
switch (_context2.prev = _context2.next) {
|
|
103
|
+
case 0:
|
|
104
|
+
case "end":
|
|
105
|
+
return _context2.stop();
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}, _callee2);
|
|
109
|
+
}));
|
|
110
|
+
|
|
111
|
+
function customCallbackFunction(_x2, _x3) {
|
|
112
|
+
return _customCallbackFunction.apply(this, arguments);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
return customCallbackFunction;
|
|
116
|
+
}(),
|
|
123
117
|
// getAvailableSharingServices: async () => {
|
|
124
118
|
// },
|
|
125
119
|
// getGeoLocation: async (value) => {
|
|
126
120
|
// },
|
|
127
|
-
getUserInfo:
|
|
128
|
-
|
|
129
|
-
|
|
121
|
+
getUserInfo: function () {
|
|
122
|
+
var _getUserInfo2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3(query) {
|
|
123
|
+
return regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
124
|
+
while (1) {
|
|
125
|
+
switch (_context3.prev = _context3.next) {
|
|
126
|
+
case 0:
|
|
127
|
+
return _context3.abrupt("return", _getUserInfo(_this, query));
|
|
128
|
+
|
|
129
|
+
case 1:
|
|
130
|
+
case "end":
|
|
131
|
+
return _context3.stop();
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}, _callee3);
|
|
135
|
+
}));
|
|
136
|
+
|
|
137
|
+
function getUserInfo(_x4) {
|
|
138
|
+
return _getUserInfo2.apply(this, arguments);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
return getUserInfo;
|
|
142
|
+
}(),
|
|
130
143
|
// getScrollPosition: async () => {
|
|
131
144
|
// },
|
|
132
145
|
// getWindowMetrics: async () => {
|
|
133
146
|
// },
|
|
134
|
-
invokeCall:
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
},
|
|
147
|
+
invokeCall: function () {
|
|
148
|
+
var _invokeCall = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee4(value, callback) {
|
|
149
|
+
return regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
150
|
+
while (1) {
|
|
151
|
+
switch (_context4.prev = _context4.next) {
|
|
152
|
+
case 0:
|
|
153
|
+
case "end":
|
|
154
|
+
return _context4.stop();
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}, _callee4);
|
|
158
|
+
}));
|
|
159
|
+
|
|
160
|
+
function invokeCall(_x5, _x6) {
|
|
161
|
+
return _invokeCall.apply(this, arguments);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
return invokeCall;
|
|
165
|
+
}(),
|
|
166
|
+
invokeDialogCall: function () {
|
|
167
|
+
var _invokeDialogCall = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5(value, callback) {
|
|
168
|
+
var callbackName, callObj;
|
|
169
|
+
return regeneratorRuntime.wrap(function _callee5$(_context5) {
|
|
170
|
+
while (1) {
|
|
171
|
+
switch (_context5.prev = _context5.next) {
|
|
172
|
+
case 0:
|
|
173
|
+
callbackName = "chaynsApiV5Callback_".concat(_this.counter++);
|
|
174
|
+
|
|
175
|
+
window[callbackName] = function (_ref) {
|
|
176
|
+
var retVal = _ref.retVal;
|
|
177
|
+
callback === null || callback === void 0 ? void 0 : callback(retVal);
|
|
178
|
+
delete window[callbackName];
|
|
179
|
+
};
|
|
180
|
+
|
|
181
|
+
callObj = _objectSpread(_objectSpread({}, value), {}, {
|
|
182
|
+
value: _objectSpread(_objectSpread({}, value.value), {}, {
|
|
183
|
+
callback: callbackName
|
|
184
|
+
})
|
|
185
|
+
});
|
|
186
|
+
invokeAppCall(callObj);
|
|
187
|
+
|
|
188
|
+
case 4:
|
|
189
|
+
case "end":
|
|
190
|
+
return _context5.stop();
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
}, _callee5);
|
|
194
|
+
}));
|
|
195
|
+
|
|
196
|
+
function invokeDialogCall(_x7, _x8) {
|
|
197
|
+
return _invokeDialogCall.apply(this, arguments);
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
return invokeDialogCall;
|
|
201
|
+
}(),
|
|
153
202
|
// login: async(value, callback, closeCallback) => {
|
|
154
203
|
// },
|
|
155
|
-
logout:
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
204
|
+
logout: function () {
|
|
205
|
+
var _logout = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee6() {
|
|
206
|
+
return regeneratorRuntime.wrap(function _callee6$(_context6) {
|
|
207
|
+
while (1) {
|
|
208
|
+
switch (_context6.prev = _context6.next) {
|
|
209
|
+
case 0:
|
|
210
|
+
case "end":
|
|
211
|
+
return _context6.stop();
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
}, _callee6);
|
|
215
|
+
}));
|
|
216
|
+
|
|
217
|
+
function logout() {
|
|
218
|
+
return _logout.apply(this, arguments);
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
return logout;
|
|
222
|
+
}(),
|
|
223
|
+
navigateBack: function () {
|
|
224
|
+
var _navigateBack = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee7() {
|
|
225
|
+
return regeneratorRuntime.wrap(function _callee7$(_context7) {
|
|
226
|
+
while (1) {
|
|
227
|
+
switch (_context7.prev = _context7.next) {
|
|
228
|
+
case 0:
|
|
229
|
+
case "end":
|
|
230
|
+
return _context7.stop();
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
}, _callee7);
|
|
234
|
+
}));
|
|
235
|
+
|
|
236
|
+
function navigateBack() {
|
|
237
|
+
return _navigateBack.apply(this, arguments);
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
return navigateBack;
|
|
241
|
+
}(),
|
|
242
|
+
openImage: function () {
|
|
243
|
+
var _openImage = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee8(value) {
|
|
244
|
+
return regeneratorRuntime.wrap(function _callee8$(_context8) {
|
|
245
|
+
while (1) {
|
|
246
|
+
switch (_context8.prev = _context8.next) {
|
|
247
|
+
case 0:
|
|
248
|
+
case "end":
|
|
249
|
+
return _context8.stop();
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
}, _callee8);
|
|
253
|
+
}));
|
|
254
|
+
|
|
255
|
+
function openImage(_x9) {
|
|
256
|
+
return _openImage.apply(this, arguments);
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
return openImage;
|
|
260
|
+
}(),
|
|
261
|
+
openUrl: function () {
|
|
262
|
+
var _openUrl = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee9(value) {
|
|
263
|
+
return regeneratorRuntime.wrap(function _callee9$(_context9) {
|
|
264
|
+
while (1) {
|
|
265
|
+
switch (_context9.prev = _context9.next) {
|
|
266
|
+
case 0:
|
|
267
|
+
case "end":
|
|
268
|
+
return _context9.stop();
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
}, _callee9);
|
|
272
|
+
}));
|
|
273
|
+
|
|
274
|
+
function openUrl(_x10) {
|
|
275
|
+
return _openUrl.apply(this, arguments);
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
return openUrl;
|
|
279
|
+
}(),
|
|
280
|
+
openVideo: function () {
|
|
281
|
+
var _openVideo = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee10(value) {
|
|
282
|
+
return regeneratorRuntime.wrap(function _callee10$(_context10) {
|
|
283
|
+
while (1) {
|
|
284
|
+
switch (_context10.prev = _context10.next) {
|
|
285
|
+
case 0:
|
|
286
|
+
case "end":
|
|
287
|
+
return _context10.stop();
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
}, _callee10);
|
|
291
|
+
}));
|
|
292
|
+
|
|
293
|
+
function openVideo(_x11) {
|
|
294
|
+
return _openVideo.apply(this, arguments);
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
return openVideo;
|
|
298
|
+
}(),
|
|
299
|
+
refreshAccessToken: function () {
|
|
300
|
+
var _refreshAccessToken = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee11() {
|
|
301
|
+
return regeneratorRuntime.wrap(function _callee11$(_context11) {
|
|
302
|
+
while (1) {
|
|
303
|
+
switch (_context11.prev = _context11.next) {
|
|
304
|
+
case 0:
|
|
305
|
+
case "end":
|
|
306
|
+
return _context11.stop();
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
}, _callee11);
|
|
310
|
+
}));
|
|
311
|
+
|
|
312
|
+
function refreshAccessToken() {
|
|
313
|
+
return _refreshAccessToken.apply(this, arguments);
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
return refreshAccessToken;
|
|
317
|
+
}(),
|
|
318
|
+
refreshData: function () {
|
|
319
|
+
var _refreshData = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee12(value) {
|
|
320
|
+
return regeneratorRuntime.wrap(function _callee12$(_context12) {
|
|
321
|
+
while (1) {
|
|
322
|
+
switch (_context12.prev = _context12.next) {
|
|
323
|
+
case 0:
|
|
324
|
+
case "end":
|
|
325
|
+
return _context12.stop();
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
}, _callee12);
|
|
329
|
+
}));
|
|
330
|
+
|
|
331
|
+
function refreshData(_x12) {
|
|
332
|
+
return _refreshData.apply(this, arguments);
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
return refreshData;
|
|
336
|
+
}(),
|
|
337
|
+
removeGeoLocationListener: function () {
|
|
338
|
+
var _removeGeoLocationListener = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee13(id) {
|
|
339
|
+
return regeneratorRuntime.wrap(function _callee13$(_context13) {
|
|
340
|
+
while (1) {
|
|
341
|
+
switch (_context13.prev = _context13.next) {
|
|
342
|
+
case 0:
|
|
343
|
+
case "end":
|
|
344
|
+
return _context13.stop();
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
}, _callee13);
|
|
348
|
+
}));
|
|
349
|
+
|
|
350
|
+
function removeGeoLocationListener(_x13) {
|
|
351
|
+
return _removeGeoLocationListener.apply(this, arguments);
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
return removeGeoLocationListener;
|
|
355
|
+
}(),
|
|
356
|
+
removeScrollListener: function () {
|
|
357
|
+
var _removeScrollListener = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee14(id) {
|
|
358
|
+
return regeneratorRuntime.wrap(function _callee14$(_context14) {
|
|
359
|
+
while (1) {
|
|
360
|
+
switch (_context14.prev = _context14.next) {
|
|
361
|
+
case 0:
|
|
362
|
+
case "end":
|
|
363
|
+
return _context14.stop();
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
}, _callee14);
|
|
367
|
+
}));
|
|
368
|
+
|
|
369
|
+
function removeScrollListener(_x14) {
|
|
370
|
+
return _removeScrollListener.apply(this, arguments);
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
return removeScrollListener;
|
|
374
|
+
}(),
|
|
375
|
+
removeVisibilityChangeListener: function removeVisibilityChangeListener(number) {
|
|
376
|
+
_removeVisibilityChangeListener(number);
|
|
377
|
+
|
|
166
378
|
return Promise.resolve();
|
|
167
379
|
},
|
|
168
|
-
removeWindowMetricsListener:
|
|
169
|
-
|
|
170
|
-
|
|
380
|
+
removeWindowMetricsListener: function () {
|
|
381
|
+
var _removeWindowMetricsListener = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee15(id) {
|
|
382
|
+
return regeneratorRuntime.wrap(function _callee15$(_context15) {
|
|
383
|
+
while (1) {
|
|
384
|
+
switch (_context15.prev = _context15.next) {
|
|
385
|
+
case 0:
|
|
386
|
+
case "end":
|
|
387
|
+
return _context15.stop();
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
}, _callee15);
|
|
391
|
+
}));
|
|
392
|
+
|
|
393
|
+
function removeWindowMetricsListener(_x15) {
|
|
394
|
+
return _removeWindowMetricsListener.apply(this, arguments);
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
return removeWindowMetricsListener;
|
|
398
|
+
}(),
|
|
399
|
+
selectPage: function () {
|
|
400
|
+
var _selectPage = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee16(options) {
|
|
401
|
+
return regeneratorRuntime.wrap(function _callee16$(_context16) {
|
|
402
|
+
while (1) {
|
|
403
|
+
switch (_context16.prev = _context16.next) {
|
|
404
|
+
case 0:
|
|
405
|
+
case "end":
|
|
406
|
+
return _context16.stop();
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
}, _callee16);
|
|
410
|
+
}));
|
|
411
|
+
|
|
412
|
+
function selectPage(_x16) {
|
|
413
|
+
return _selectPage.apply(this, arguments);
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
return selectPage;
|
|
417
|
+
}(),
|
|
418
|
+
scrollToY: function () {
|
|
419
|
+
var _scrollToY = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee17(position, duration) {
|
|
420
|
+
return regeneratorRuntime.wrap(function _callee17$(_context17) {
|
|
421
|
+
while (1) {
|
|
422
|
+
switch (_context17.prev = _context17.next) {
|
|
423
|
+
case 0:
|
|
424
|
+
case "end":
|
|
425
|
+
return _context17.stop();
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
}, _callee17);
|
|
429
|
+
}));
|
|
430
|
+
|
|
431
|
+
function scrollToY(_x17, _x18) {
|
|
432
|
+
return _scrollToY.apply(this, arguments);
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
return scrollToY;
|
|
436
|
+
}(),
|
|
171
437
|
// sendMessageToGroup: async (groupId, message) => {
|
|
172
438
|
// },
|
|
173
439
|
// sendMessageToPage: async (message) => {
|
|
174
440
|
// },
|
|
175
441
|
// sendMessageToUser: async (userId, message) => {
|
|
176
442
|
// },
|
|
177
|
-
setAdminMode:
|
|
443
|
+
setAdminMode: function () {
|
|
444
|
+
var _setAdminMode = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee18(enabled) {
|
|
445
|
+
return regeneratorRuntime.wrap(function _callee18$(_context18) {
|
|
446
|
+
while (1) {
|
|
447
|
+
switch (_context18.prev = _context18.next) {
|
|
448
|
+
case 0:
|
|
449
|
+
case "end":
|
|
450
|
+
return _context18.stop();
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
}, _callee18);
|
|
454
|
+
}));
|
|
455
|
+
|
|
456
|
+
function setAdminMode(_x19) {
|
|
457
|
+
return _setAdminMode.apply(this, arguments);
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
return setAdminMode;
|
|
461
|
+
}(),
|
|
178
462
|
// setDisplayTimeout: async (value) => {
|
|
179
463
|
// },
|
|
180
|
-
setFloatingButton:
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
464
|
+
setFloatingButton: function () {
|
|
465
|
+
var _setFloatingButton = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee19(value, callback) {
|
|
466
|
+
return regeneratorRuntime.wrap(function _callee19$(_context19) {
|
|
467
|
+
while (1) {
|
|
468
|
+
switch (_context19.prev = _context19.next) {
|
|
469
|
+
case 0:
|
|
470
|
+
case "end":
|
|
471
|
+
return _context19.stop();
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
}, _callee19);
|
|
475
|
+
}));
|
|
476
|
+
|
|
477
|
+
function setFloatingButton(_x20, _x21) {
|
|
478
|
+
return _setFloatingButton.apply(this, arguments);
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
return setFloatingButton;
|
|
482
|
+
}(),
|
|
483
|
+
setHeight: function () {
|
|
484
|
+
var _setHeight = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee20(value) {
|
|
485
|
+
return regeneratorRuntime.wrap(function _callee20$(_context20) {
|
|
486
|
+
while (1) {
|
|
487
|
+
switch (_context20.prev = _context20.next) {
|
|
488
|
+
case 0:
|
|
489
|
+
case "end":
|
|
490
|
+
return _context20.stop();
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
}, _callee20);
|
|
494
|
+
}));
|
|
495
|
+
|
|
496
|
+
function setHeight(_x22) {
|
|
497
|
+
return _setHeight.apply(this, arguments);
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
return setHeight;
|
|
501
|
+
}(),
|
|
502
|
+
setOverlay: function () {
|
|
503
|
+
var _setOverlay = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee21(value, callback) {
|
|
504
|
+
return regeneratorRuntime.wrap(function _callee21$(_context21) {
|
|
505
|
+
while (1) {
|
|
506
|
+
switch (_context21.prev = _context21.next) {
|
|
507
|
+
case 0:
|
|
508
|
+
case "end":
|
|
509
|
+
return _context21.stop();
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
}, _callee21);
|
|
513
|
+
}));
|
|
514
|
+
|
|
515
|
+
function setOverlay(_x23, _x24) {
|
|
516
|
+
return _setOverlay.apply(this, arguments);
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
return setOverlay;
|
|
520
|
+
}(),
|
|
521
|
+
setRefreshScrollEnabled: function () {
|
|
522
|
+
var _setRefreshScrollEnabled = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee22(isEnabled) {
|
|
523
|
+
return regeneratorRuntime.wrap(function _callee22$(_context22) {
|
|
524
|
+
while (1) {
|
|
525
|
+
switch (_context22.prev = _context22.next) {
|
|
526
|
+
case 0:
|
|
527
|
+
invokeAppCall({
|
|
528
|
+
action: 0,
|
|
529
|
+
value: {
|
|
530
|
+
enabled: isEnabled
|
|
531
|
+
}
|
|
532
|
+
});
|
|
533
|
+
return _context22.abrupt("return", {
|
|
534
|
+
isEnabled: isEnabled
|
|
535
|
+
});
|
|
536
|
+
|
|
537
|
+
case 2:
|
|
538
|
+
case "end":
|
|
539
|
+
return _context22.stop();
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
}, _callee22);
|
|
543
|
+
}));
|
|
544
|
+
|
|
545
|
+
function setRefreshScrollEnabled(_x25) {
|
|
546
|
+
return _setRefreshScrollEnabled.apply(this, arguments);
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
return setRefreshScrollEnabled;
|
|
550
|
+
}(),
|
|
194
551
|
// setScanQrCode: async (value) => {
|
|
195
552
|
// },
|
|
196
|
-
setTempDesignSettings:
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
}
|
|
553
|
+
setTempDesignSettings: function () {
|
|
554
|
+
var _setTempDesignSettings = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee23(value) {
|
|
555
|
+
return regeneratorRuntime.wrap(function _callee23$(_context23) {
|
|
556
|
+
while (1) {
|
|
557
|
+
switch (_context23.prev = _context23.next) {
|
|
558
|
+
case 0:
|
|
559
|
+
case "end":
|
|
560
|
+
return _context23.stop();
|
|
561
|
+
}
|
|
562
|
+
}
|
|
563
|
+
}, _callee23);
|
|
564
|
+
}));
|
|
209
565
|
|
|
210
|
-
|
|
566
|
+
function setTempDesignSettings(_x26) {
|
|
567
|
+
return _setTempDesignSettings.apply(this, arguments);
|
|
568
|
+
}
|
|
211
569
|
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
570
|
+
return setTempDesignSettings;
|
|
571
|
+
}(),
|
|
572
|
+
setWaitCursor: function () {
|
|
573
|
+
var _setWaitCursor = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee24(value) {
|
|
574
|
+
return regeneratorRuntime.wrap(function _callee24$(_context24) {
|
|
575
|
+
while (1) {
|
|
576
|
+
switch (_context24.prev = _context24.next) {
|
|
577
|
+
case 0:
|
|
578
|
+
case "end":
|
|
579
|
+
return _context24.stop();
|
|
580
|
+
}
|
|
581
|
+
}
|
|
582
|
+
}, _callee24);
|
|
583
|
+
}));
|
|
584
|
+
|
|
585
|
+
function setWaitCursor(_x27) {
|
|
586
|
+
return _setWaitCursor.apply(this, arguments);
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
return setWaitCursor;
|
|
590
|
+
}(),
|
|
591
|
+
storageGetItem: function () {
|
|
592
|
+
var _storageGetItem = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee25(key, accessMode) {
|
|
593
|
+
return regeneratorRuntime.wrap(function _callee25$(_context25) {
|
|
594
|
+
while (1) {
|
|
595
|
+
switch (_context25.prev = _context25.next) {
|
|
596
|
+
case 0:
|
|
597
|
+
case "end":
|
|
598
|
+
return _context25.stop();
|
|
599
|
+
}
|
|
600
|
+
}
|
|
601
|
+
}, _callee25);
|
|
602
|
+
}));
|
|
603
|
+
|
|
604
|
+
function storageGetItem(_x28, _x29) {
|
|
605
|
+
return _storageGetItem.apply(this, arguments);
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
return storageGetItem;
|
|
609
|
+
}(),
|
|
610
|
+
storageRemoveItem: function () {
|
|
611
|
+
var _storageRemoveItem = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee26(key, accessMode) {
|
|
612
|
+
return regeneratorRuntime.wrap(function _callee26$(_context26) {
|
|
613
|
+
while (1) {
|
|
614
|
+
switch (_context26.prev = _context26.next) {
|
|
615
|
+
case 0:
|
|
616
|
+
case "end":
|
|
617
|
+
return _context26.stop();
|
|
618
|
+
}
|
|
619
|
+
}
|
|
620
|
+
}, _callee26);
|
|
621
|
+
}));
|
|
622
|
+
|
|
623
|
+
function storageRemoveItem(_x30, _x31) {
|
|
624
|
+
return _storageRemoveItem.apply(this, arguments);
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
return storageRemoveItem;
|
|
628
|
+
}(),
|
|
629
|
+
storageSetItem: function () {
|
|
630
|
+
var _storageSetItem = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee27(key, value, accessMode, tappIds) {
|
|
631
|
+
return regeneratorRuntime.wrap(function _callee27$(_context27) {
|
|
632
|
+
while (1) {
|
|
633
|
+
switch (_context27.prev = _context27.next) {
|
|
634
|
+
case 0:
|
|
635
|
+
case "end":
|
|
636
|
+
return _context27.stop();
|
|
637
|
+
}
|
|
638
|
+
}
|
|
639
|
+
}, _callee27);
|
|
640
|
+
}));
|
|
641
|
+
|
|
642
|
+
function storageSetItem(_x32, _x33, _x34, _x35) {
|
|
643
|
+
return _storageSetItem.apply(this, arguments);
|
|
223
644
|
}
|
|
224
|
-
|
|
645
|
+
|
|
646
|
+
return storageSetItem;
|
|
647
|
+
}(),
|
|
648
|
+
vibrate: function () {
|
|
649
|
+
var _vibrate = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee28(value) {
|
|
650
|
+
return regeneratorRuntime.wrap(function _callee28$(_context28) {
|
|
651
|
+
while (1) {
|
|
652
|
+
switch (_context28.prev = _context28.next) {
|
|
653
|
+
case 0:
|
|
654
|
+
case "end":
|
|
655
|
+
return _context28.stop();
|
|
656
|
+
}
|
|
657
|
+
}
|
|
658
|
+
}, _callee28);
|
|
659
|
+
}));
|
|
660
|
+
|
|
661
|
+
function vibrate(_x36) {
|
|
662
|
+
return _vibrate.apply(this, arguments);
|
|
663
|
+
}
|
|
664
|
+
|
|
665
|
+
return vibrate;
|
|
666
|
+
}()
|
|
225
667
|
});
|
|
226
|
-
return undefined;
|
|
227
|
-
}
|
|
228
|
-
getSSRData() {
|
|
229
|
-
return null;
|
|
230
668
|
}
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
669
|
+
|
|
670
|
+
_createClass(AppWrapper, [{
|
|
671
|
+
key: "mapOldApiToNew",
|
|
672
|
+
value: function mapOldApiToNew(_ref2) {
|
|
673
|
+
var _window, _window2, _AppInfo$TappSelected;
|
|
674
|
+
|
|
675
|
+
var retVal = _ref2.retVal;
|
|
676
|
+
var AppInfo = retVal.AppInfo,
|
|
677
|
+
AppUser = retVal.AppUser;
|
|
678
|
+
this.accessToken = AppUser.TobitAccessToken;
|
|
679
|
+
return {
|
|
680
|
+
device: getDeviceInfo(navigator.userAgent, 'image/webp'),
|
|
681
|
+
environment: {
|
|
682
|
+
buildEnvironment: Environment.Production,
|
|
683
|
+
runtimeEnvironment: RuntimeEnviroment.Unknown
|
|
684
|
+
},
|
|
685
|
+
language: {
|
|
686
|
+
site: AppInfo.Language,
|
|
687
|
+
translation: null,
|
|
688
|
+
device: AppInfo.Language,
|
|
689
|
+
active: AppInfo.Language
|
|
690
|
+
},
|
|
691
|
+
// ToDo: Find better way to detect
|
|
692
|
+
site: {
|
|
693
|
+
id: AppInfo.SiteID,
|
|
694
|
+
locationId: AppInfo.LocationID,
|
|
695
|
+
url: (_window = window) === null || _window === void 0 ? void 0 : _window.location.href.split('#')[0],
|
|
696
|
+
layoutDisposition: {
|
|
697
|
+
contentWide: false,
|
|
698
|
+
barOnTop: false,
|
|
699
|
+
barWide: false,
|
|
700
|
+
coverDetached: false,
|
|
701
|
+
coverHidden: false,
|
|
702
|
+
coverWide: false,
|
|
703
|
+
docked: false
|
|
704
|
+
},
|
|
705
|
+
title: AppInfo.Title,
|
|
706
|
+
colorMode: AppInfo.colorMode,
|
|
707
|
+
color: AppInfo.color,
|
|
708
|
+
domain: AppInfo.domain,
|
|
709
|
+
font: {
|
|
710
|
+
id: Font.Roboto,
|
|
711
|
+
headlineFont: Font.Roboto,
|
|
712
|
+
dynamicFontSize: false
|
|
713
|
+
},
|
|
714
|
+
dynamicFontSize: false,
|
|
715
|
+
locationPersonId: AppInfo.LocationPersonId,
|
|
716
|
+
urlHash: (_window2 = window) === null || _window2 === void 0 ? void 0 : _window2.location.hash.replace('#', '')
|
|
717
|
+
},
|
|
718
|
+
parameters: _toConsumableArray(new URLSearchParams(location.search)),
|
|
719
|
+
user: {
|
|
720
|
+
firstName: AppUser.FirstName,
|
|
721
|
+
lastName: AppUser.LastName,
|
|
722
|
+
gender: Gender.Unknown,
|
|
723
|
+
userId: AppUser.TobitUserID,
|
|
724
|
+
personId: AppUser.PersonID,
|
|
725
|
+
uacGroups: []
|
|
726
|
+
},
|
|
727
|
+
customData: null,
|
|
728
|
+
isAdminModeActive: AppUser.AdminMode,
|
|
729
|
+
currentPage: {
|
|
730
|
+
id: (_AppInfo$TappSelected = AppInfo.TappSelected) === null || _AppInfo$TappSelected === void 0 ? void 0 : _AppInfo$TappSelected.TappID,
|
|
731
|
+
siteId: AppInfo.SiteID
|
|
732
|
+
},
|
|
733
|
+
pages: AppInfo.Tapps.map(function (x) {
|
|
734
|
+
return {
|
|
735
|
+
id: x.TappID,
|
|
736
|
+
icon: '',
|
|
737
|
+
iconType: IconType.Font,
|
|
738
|
+
customUrl: '',
|
|
739
|
+
isExclusive: x.isExclusiveView,
|
|
740
|
+
isHiddenFromMenu: x.isHiddenFromMenu,
|
|
741
|
+
minAge: null,
|
|
742
|
+
name: x.ShowName,
|
|
743
|
+
sortId: x.SortUID
|
|
744
|
+
};
|
|
745
|
+
})
|
|
746
|
+
};
|
|
747
|
+
}
|
|
748
|
+
}, {
|
|
749
|
+
key: "appCall",
|
|
750
|
+
value: function appCall(call) {
|
|
751
|
+
// generate uuid just in case multiple AppWrapper in one window
|
|
752
|
+
call.value.callback = "window.chaynsApiV5Callback_" + this.counter++;
|
|
753
|
+
invokeAppCall(call);
|
|
754
|
+
} // @ts-ignore
|
|
755
|
+
|
|
756
|
+
}, {
|
|
757
|
+
key: "init",
|
|
758
|
+
value: function () {
|
|
759
|
+
var _init = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee29() {
|
|
760
|
+
var _this2 = this;
|
|
761
|
+
|
|
762
|
+
return regeneratorRuntime.wrap(function _callee29$(_context29) {
|
|
763
|
+
while (1) {
|
|
764
|
+
switch (_context29.prev = _context29.next) {
|
|
765
|
+
case 0:
|
|
766
|
+
_context29.next = 2;
|
|
767
|
+
return new Promise(function (resolve) {
|
|
768
|
+
// @ts-ignore
|
|
769
|
+
window.globalDataCallback = function (data) {
|
|
770
|
+
_this2.values = _this2.mapOldApiToNew(data);
|
|
771
|
+
resolve(data);
|
|
772
|
+
};
|
|
773
|
+
|
|
774
|
+
invokeAppCall({
|
|
775
|
+
action: 18,
|
|
776
|
+
value: {
|
|
777
|
+
callback: 'window.globalDataCallback'
|
|
778
|
+
}
|
|
779
|
+
});
|
|
780
|
+
});
|
|
781
|
+
|
|
782
|
+
case 2:
|
|
783
|
+
return _context29.abrupt("return", undefined);
|
|
784
|
+
|
|
785
|
+
case 3:
|
|
786
|
+
case "end":
|
|
787
|
+
return _context29.stop();
|
|
788
|
+
}
|
|
789
|
+
}
|
|
790
|
+
}, _callee29);
|
|
791
|
+
}));
|
|
792
|
+
|
|
793
|
+
function init() {
|
|
794
|
+
return _init.apply(this, arguments);
|
|
795
|
+
}
|
|
796
|
+
|
|
797
|
+
return init;
|
|
798
|
+
}()
|
|
799
|
+
}, {
|
|
800
|
+
key: "getSSRData",
|
|
801
|
+
value: function getSSRData() {
|
|
802
|
+
return null;
|
|
803
|
+
}
|
|
804
|
+
}, {
|
|
805
|
+
key: "addDataListener",
|
|
806
|
+
value: function addDataListener(cb) {
|
|
807
|
+
var listener = function listener(ev) {
|
|
808
|
+
return ev.detail && cb(ev.detail);
|
|
809
|
+
};
|
|
810
|
+
|
|
811
|
+
document.addEventListener('chayns_api_data', listener);
|
|
812
|
+
return function () {
|
|
813
|
+
document.removeEventListener('chayns_api_data', listener);
|
|
814
|
+
};
|
|
815
|
+
}
|
|
816
|
+
}, {
|
|
817
|
+
key: "getInitialData",
|
|
818
|
+
value: function getInitialData() {
|
|
819
|
+
return this.values;
|
|
820
|
+
}
|
|
821
|
+
}]);
|
|
822
|
+
|
|
823
|
+
return AppWrapper;
|
|
824
|
+
}();
|