chayns-api 1.1.0-2 → 1.1.0-21
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/chayns-api.js +2 -0
- package/dist/chayns-api.js.LICENSE.txt +41 -0
- package/dist/cjs/calls/dialogs/chaynsDialog.js +3 -6
- package/dist/cjs/calls/dialogs/date.js +29 -2
- package/dist/cjs/calls/dialogs/fileSelect.js +1 -2
- package/dist/cjs/calls/dialogs/input.js +2 -3
- package/dist/cjs/calls/dialogs/select.js +2 -3
- package/dist/cjs/calls/getUserInfo.js +1 -2
- package/dist/cjs/calls/index.js +93 -82
- package/dist/cjs/calls/toolbarChangeListener.js +1 -0
- package/dist/cjs/components/AppDialogWrapper.js +7 -7
- package/dist/cjs/components/ChaynsContext.js +2 -4
- package/dist/cjs/components/ChaynsProvider.js +10 -13
- package/dist/cjs/components/ErrorBoundary.js +31 -0
- package/dist/cjs/components/moduleWrapper.js +9 -0
- package/dist/cjs/components/withCompatMode.js +8 -7
- package/dist/cjs/components/withHydrationBoundary.js +54 -0
- package/dist/cjs/constants/hydrationContext.js +16 -0
- package/dist/cjs/constants/index.js +16 -0
- package/dist/cjs/constants/languages.js +19 -0
- package/dist/cjs/handler/DialogHandler.js +4 -2
- package/dist/cjs/hooks/useAccessToken.js +1 -0
- package/dist/cjs/hooks/useDialogState.js +2 -2
- package/dist/cjs/hooks/usePages.js +2 -2
- package/dist/cjs/host/ChaynsHost.js +21 -41
- package/dist/cjs/host/iframe/HostIframe.js +4 -6
- package/dist/cjs/host/iframe/utils/useUpdateData.js +1 -2
- package/dist/cjs/host/module/ModuleHost.js +9 -24
- package/dist/cjs/host/module/Test3.js +141 -0
- package/dist/cjs/host/module/utils/loadComponent.js +94 -49
- package/dist/cjs/index.js +63 -5
- package/dist/cjs/types/IChaynsReact.js +140 -107
- package/dist/cjs/util/appCall.js +3 -4
- package/dist/cjs/util/deviceHelper.js +18 -13
- package/dist/cjs/util/transferNestedFunctions.js +39 -0
- package/dist/cjs/util/url.js +1 -1
- package/dist/cjs/wrapper/AppWrapper.js +79 -16
- package/dist/cjs/wrapper/FrameWrapper.js +16 -5
- package/dist/cjs/wrapper/StaticChaynsApi.js +22 -0
- package/dist/esm/calls/index.js +22 -1
- package/dist/esm/calls/toolbarChangeListener.js +0 -0
- package/dist/esm/components/AppDialogWrapper.js +4 -3
- package/dist/esm/components/ChaynsProvider.js +6 -7
- package/dist/esm/components/ErrorBoundary.js +23 -0
- package/dist/esm/components/moduleWrapper.js +3 -0
- package/dist/esm/components/withCompatMode.js +5 -4
- package/dist/esm/components/withHydrationBoundary.js +47 -0
- package/dist/esm/constants/hydrationContext.js +10 -0
- package/dist/esm/constants/index.js +1 -0
- package/dist/esm/constants/languages.js +13 -0
- package/dist/esm/handler/DialogHandler.js +6 -4
- package/dist/esm/hooks/useAccessToken.js +1 -0
- package/dist/esm/hooks/useDialogState.js +2 -2
- package/dist/esm/hooks/usePages.js +1 -1
- package/dist/esm/host/ChaynsHost.js +18 -39
- package/dist/esm/host/iframe/HostIframe.js +1 -2
- package/dist/esm/host/module/ModuleHost.js +6 -20
- package/dist/esm/host/module/Test3.js +135 -0
- package/dist/esm/host/module/utils/loadComponent.js +95 -49
- package/dist/esm/index.js +7 -1
- package/dist/esm/types/IChaynsReact.js +142 -87
- package/dist/esm/util/appCall.js +2 -2
- package/dist/esm/util/deviceHelper.js +17 -11
- package/dist/esm/util/transferNestedFunctions.js +35 -0
- package/dist/esm/util/url.js +2 -2
- package/dist/esm/wrapper/AppWrapper.js +80 -16
- package/dist/esm/wrapper/FrameWrapper.js +16 -5
- package/dist/esm/wrapper/StaticChaynsApi.js +20 -0
- package/dist/types/calls/index.d.ts +19 -5
- package/dist/types/calls/toolbarChangeListener.d.ts +0 -0
- package/dist/types/components/AppDialogWrapper.d.ts +2 -2
- package/dist/types/components/ChaynsProvider.d.ts +1 -4
- package/dist/types/components/ErrorBoundary.d.ts +13 -0
- package/dist/types/components/moduleWrapper.d.ts +4 -0
- package/dist/types/components/withHydrationBoundary.d.ts +17 -0
- package/dist/types/constants/hydrationContext.d.ts +9 -0
- package/dist/types/constants/index.d.ts +1 -0
- package/dist/types/constants/languages.d.ts +12 -0
- package/dist/types/handler/DialogHandler.d.ts +0 -1
- package/dist/types/hooks/useAccessToken.d.ts +1 -0
- package/dist/types/hooks/useCurrentPage.d.ts +4 -1
- package/dist/types/host/ChaynsHost.d.ts +0 -1
- package/dist/types/host/module/ModuleHost.d.ts +2 -0
- package/dist/types/host/module/Test3.d.ts +8 -0
- package/dist/types/host/module/utils/loadComponent.d.ts +3 -1
- package/dist/types/index.d.ts +7 -1
- package/dist/types/types/IChaynsReact.d.ts +136 -28
- package/dist/types/util/deviceHelper.d.ts +2 -2
- package/dist/types/util/transferNestedFunctions.d.ts +1 -0
- package/dist/types/wrapper/StaticChaynsApi.d.ts +9 -0
- package/package.json +33 -22
- package/toolkit.config.js +20 -0
|
@@ -3,46 +3,73 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.TappEvent = exports.SharingApp = exports.ScreenSize = exports.ScanQrCodeCodeType = exports.ScanQrCodeCameraTypes = exports.RuntimeEnviroment = exports.Language = exports.IconType = exports.Gender = exports.Font = exports.FloatingButtonPosition = exports.Environment = exports.DialogType = exports.DialogButtonType = exports.DeviceOs = exports.ColorMode = exports.BrowserName = exports.AppName = exports.AccessMode = void 0;
|
|
7
|
-
let
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
exports.ToastType = exports.TappEvent = exports.SharingApp = exports.ScreenSize = exports.ScanQrCodeCodeType = exports.ScanQrCodeCameraTypes = exports.RuntimeEnviroment = exports.MediaType = exports.Language = exports.IconType = exports.Gender = exports.Font = exports.FloatingButtonPosition = exports.Environment = exports.DialogType = exports.DialogSelectType = exports.DialogInputType = exports.DialogIconType = exports.DialogButtonType = exports.DialogAnimation = exports.DeviceOs = exports.DateType = exports.ColorMode = exports.BrowserName = exports.AppName = exports.AccessMode = void 0;
|
|
7
|
+
let DateType = exports.DateType = /*#__PURE__*/function (DateType) {
|
|
8
|
+
DateType[DateType["DATE"] = 0] = "DATE";
|
|
9
|
+
DateType[DateType["TIME"] = 1] = "TIME";
|
|
10
|
+
DateType[DateType["DATE_TIME"] = 2] = "DATE_TIME";
|
|
11
|
+
return DateType;
|
|
12
|
+
}({});
|
|
13
|
+
let ToastType = exports.ToastType = /*#__PURE__*/function (ToastType) {
|
|
14
|
+
ToastType[ToastType["NEUTRAL"] = 1] = "NEUTRAL";
|
|
15
|
+
ToastType[ToastType["SUCCESS"] = 2] = "SUCCESS";
|
|
16
|
+
ToastType[ToastType["WARNING"] = 3] = "WARNING";
|
|
17
|
+
ToastType[ToastType["ERROR"] = 4] = "ERROR";
|
|
18
|
+
return ToastType;
|
|
19
|
+
}({});
|
|
20
|
+
let DialogInputType = exports.DialogInputType = /*#__PURE__*/function (DialogInputType) {
|
|
21
|
+
DialogInputType["NUMBER"] = "number";
|
|
22
|
+
DialogInputType["PASSWORD"] = "password";
|
|
23
|
+
DialogInputType["TELEPHONE"] = "tel";
|
|
24
|
+
DialogInputType["TEXT"] = "text";
|
|
25
|
+
DialogInputType["TEXTAREA"] = "textarea";
|
|
26
|
+
return DialogInputType;
|
|
27
|
+
}({});
|
|
28
|
+
let DialogSelectType = exports.DialogSelectType = /*#__PURE__*/function (DialogSelectType) {
|
|
29
|
+
DialogSelectType[DialogSelectType["DEFAULT"] = 0] = "DEFAULT";
|
|
30
|
+
DialogSelectType[DialogSelectType["ICON"] = 1] = "ICON";
|
|
31
|
+
DialogSelectType[DialogSelectType["IMAGE"] = 2] = "IMAGE";
|
|
32
|
+
return DialogSelectType;
|
|
33
|
+
}({});
|
|
34
|
+
let DialogButtonType = exports.DialogButtonType = /*#__PURE__*/function (DialogButtonType) {
|
|
10
35
|
DialogButtonType[DialogButtonType["OK"] = 1] = "OK";
|
|
11
36
|
DialogButtonType[DialogButtonType["CANCEL"] = -1] = "CANCEL";
|
|
12
37
|
DialogButtonType[DialogButtonType["NEGATIVE"] = 0] = "NEGATIVE";
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
exports.ScreenSize = ScreenSize
|
|
16
|
-
(function (ScreenSize) {
|
|
38
|
+
return DialogButtonType;
|
|
39
|
+
}({});
|
|
40
|
+
let ScreenSize = exports.ScreenSize = /*#__PURE__*/function (ScreenSize) {
|
|
17
41
|
ScreenSize[ScreenSize["XS"] = 0] = "XS";
|
|
18
42
|
ScreenSize[ScreenSize["SM"] = 1] = "SM";
|
|
19
43
|
ScreenSize[ScreenSize["MD"] = 2] = "MD";
|
|
20
44
|
ScreenSize[ScreenSize["LG"] = 3] = "LG";
|
|
21
45
|
ScreenSize[ScreenSize["XL"] = 4] = "XL";
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
46
|
+
return ScreenSize;
|
|
47
|
+
}({});
|
|
48
|
+
/**
|
|
49
|
+
* @ignore
|
|
50
|
+
*/
|
|
51
|
+
/**
|
|
52
|
+
* @ignore
|
|
53
|
+
*/
|
|
54
|
+
let AccessMode = exports.AccessMode = /*#__PURE__*/function (AccessMode) {
|
|
26
55
|
AccessMode[AccessMode["public"] = 0] = "public";
|
|
27
56
|
AccessMode[AccessMode["protected"] = 1] = "protected";
|
|
28
57
|
AccessMode[AccessMode["private"] = 2] = "private";
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
exports.ScanQrCodeCodeType = ScanQrCodeCodeType
|
|
32
|
-
(function (ScanQrCodeCodeType) {
|
|
58
|
+
return AccessMode;
|
|
59
|
+
}({});
|
|
60
|
+
let ScanQrCodeCodeType = exports.ScanQrCodeCodeType = /*#__PURE__*/function (ScanQrCodeCodeType) {
|
|
33
61
|
ScanQrCodeCodeType[ScanQrCodeCodeType["QR"] = 0] = "QR";
|
|
34
62
|
ScanQrCodeCodeType[ScanQrCodeCodeType["BARCODE"] = 0] = "BARCODE";
|
|
35
63
|
ScanQrCodeCodeType[ScanQrCodeCodeType["ALL"] = 2] = "ALL";
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
exports.ScanQrCodeCameraTypes = ScanQrCodeCameraTypes
|
|
39
|
-
(function (ScanQrCodeCameraTypes) {
|
|
64
|
+
return ScanQrCodeCodeType;
|
|
65
|
+
}({});
|
|
66
|
+
let ScanQrCodeCameraTypes = exports.ScanQrCodeCameraTypes = /*#__PURE__*/function (ScanQrCodeCameraTypes) {
|
|
40
67
|
ScanQrCodeCameraTypes[ScanQrCodeCameraTypes["AUTO"] = 0] = "AUTO";
|
|
41
68
|
ScanQrCodeCameraTypes[ScanQrCodeCameraTypes["BACK"] = 1] = "BACK";
|
|
42
69
|
ScanQrCodeCameraTypes[ScanQrCodeCameraTypes["FRONT"] = 2] = "FRONT";
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
70
|
+
return ScanQrCodeCameraTypes;
|
|
71
|
+
}({});
|
|
72
|
+
var IOSFeedbackVibration = /*#__PURE__*/function (IOSFeedbackVibration) {
|
|
46
73
|
IOSFeedbackVibration[IOSFeedbackVibration["Unknown"] = 0] = "Unknown";
|
|
47
74
|
IOSFeedbackVibration[IOSFeedbackVibration["SelectionChanged"] = 1] = "SelectionChanged";
|
|
48
75
|
IOSFeedbackVibration[IOSFeedbackVibration["NotificationError"] = 2] = "NotificationError";
|
|
@@ -53,25 +80,25 @@ var IOSFeedbackVibration;
|
|
|
53
80
|
IOSFeedbackVibration[IOSFeedbackVibration["Heavy"] = 7] = "Heavy";
|
|
54
81
|
IOSFeedbackVibration[IOSFeedbackVibration["Soft"] = 8] = "Soft";
|
|
55
82
|
IOSFeedbackVibration[IOSFeedbackVibration["Rigid"] = 9] = "Rigid";
|
|
56
|
-
|
|
83
|
+
return IOSFeedbackVibration;
|
|
84
|
+
}(IOSFeedbackVibration || {});
|
|
57
85
|
// region design settings
|
|
58
|
-
var SnapshotType
|
|
59
|
-
(function (SnapshotType) {
|
|
86
|
+
var SnapshotType = /*#__PURE__*/function (SnapshotType) {
|
|
60
87
|
SnapshotType["Background"] = "background";
|
|
61
88
|
SnapshotType["Settings"] = "settings";
|
|
62
89
|
SnapshotType["ColorScheme"] = "colorScheme";
|
|
63
90
|
SnapshotType["Cover"] = "cover";
|
|
64
91
|
SnapshotType["Tapp"] = "tapp";
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
92
|
+
return SnapshotType;
|
|
93
|
+
}(SnapshotType || {});
|
|
94
|
+
var DesignSettingsUpdateBackgroundType = /*#__PURE__*/function (DesignSettingsUpdateBackgroundType) {
|
|
68
95
|
DesignSettingsUpdateBackgroundType[DesignSettingsUpdateBackgroundType["None"] = 0] = "None";
|
|
69
96
|
DesignSettingsUpdateBackgroundType[DesignSettingsUpdateBackgroundType["Image"] = 1] = "Image";
|
|
70
97
|
DesignSettingsUpdateBackgroundType[DesignSettingsUpdateBackgroundType["Video"] = 2] = "Video";
|
|
71
98
|
DesignSettingsUpdateBackgroundType[DesignSettingsUpdateBackgroundType["Color"] = 3] = "Color";
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
99
|
+
return DesignSettingsUpdateBackgroundType;
|
|
100
|
+
}(DesignSettingsUpdateBackgroundType || {});
|
|
101
|
+
var DesignSettingsUpdateSeasonTypes = /*#__PURE__*/function (DesignSettingsUpdateSeasonTypes) {
|
|
75
102
|
DesignSettingsUpdateSeasonTypes[DesignSettingsUpdateSeasonTypes["None"] = 0] = "None";
|
|
76
103
|
DesignSettingsUpdateSeasonTypes[DesignSettingsUpdateSeasonTypes["Snowm"] = 1] = "Snowm";
|
|
77
104
|
DesignSettingsUpdateSeasonTypes[DesignSettingsUpdateSeasonTypes["Confetti"] = 2] = "Confetti";
|
|
@@ -81,95 +108,88 @@ var DesignSettingsUpdateSeasonTypes;
|
|
|
81
108
|
DesignSettingsUpdateSeasonTypes[DesignSettingsUpdateSeasonTypes["Eastern"] = 6] = "Eastern";
|
|
82
109
|
DesignSettingsUpdateSeasonTypes[DesignSettingsUpdateSeasonTypes["Clover"] = 7] = "Clover";
|
|
83
110
|
DesignSettingsUpdateSeasonTypes[DesignSettingsUpdateSeasonTypes["Coins"] = 8] = "Coins";
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
111
|
+
return DesignSettingsUpdateSeasonTypes;
|
|
112
|
+
}(DesignSettingsUpdateSeasonTypes || {});
|
|
113
|
+
var DesignSettingsUpdateGalleryAnimationTypes = /*#__PURE__*/function (DesignSettingsUpdateGalleryAnimationTypes) {
|
|
87
114
|
DesignSettingsUpdateGalleryAnimationTypes[DesignSettingsUpdateGalleryAnimationTypes["Swipe"] = 0] = "Swipe";
|
|
88
115
|
DesignSettingsUpdateGalleryAnimationTypes[DesignSettingsUpdateGalleryAnimationTypes["Fade"] = 1] = "Fade";
|
|
89
116
|
DesignSettingsUpdateGalleryAnimationTypes[DesignSettingsUpdateGalleryAnimationTypes["Parallax"] = 2] = "Parallax";
|
|
90
117
|
DesignSettingsUpdateGalleryAnimationTypes[DesignSettingsUpdateGalleryAnimationTypes["KenBurns"] = 3] = "KenBurns";
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
118
|
+
return DesignSettingsUpdateGalleryAnimationTypes;
|
|
119
|
+
}(DesignSettingsUpdateGalleryAnimationTypes || {});
|
|
120
|
+
var DesignSettingsUpdateCoverTypes = /*#__PURE__*/function (DesignSettingsUpdateCoverTypes) {
|
|
94
121
|
DesignSettingsUpdateCoverTypes[DesignSettingsUpdateCoverTypes["Image"] = 0] = "Image";
|
|
95
122
|
DesignSettingsUpdateCoverTypes[DesignSettingsUpdateCoverTypes["Video"] = 1] = "Video";
|
|
96
123
|
DesignSettingsUpdateCoverTypes[DesignSettingsUpdateCoverTypes["Slideshow"] = 2] = "Slideshow";
|
|
97
124
|
DesignSettingsUpdateCoverTypes[DesignSettingsUpdateCoverTypes["Frame"] = 3] = "Frame";
|
|
98
125
|
DesignSettingsUpdateCoverTypes[DesignSettingsUpdateCoverTypes["None"] = 4] = "None";
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
126
|
+
return DesignSettingsUpdateCoverTypes;
|
|
127
|
+
}(DesignSettingsUpdateCoverTypes || {});
|
|
128
|
+
var DesignSettingsUpdateColorSchemeMode = /*#__PURE__*/function (DesignSettingsUpdateColorSchemeMode) {
|
|
102
129
|
DesignSettingsUpdateColorSchemeMode[DesignSettingsUpdateColorSchemeMode["Normal"] = 0] = "Normal";
|
|
103
130
|
DesignSettingsUpdateColorSchemeMode[DesignSettingsUpdateColorSchemeMode["Dark"] = 1] = "Dark";
|
|
104
131
|
DesignSettingsUpdateColorSchemeMode[DesignSettingsUpdateColorSchemeMode["Bright"] = 2] = "Bright";
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
132
|
+
return DesignSettingsUpdateColorSchemeMode;
|
|
133
|
+
}(DesignSettingsUpdateColorSchemeMode || {});
|
|
134
|
+
var DesignSettingsUpdateTappViewModes = /*#__PURE__*/function (DesignSettingsUpdateTappViewModes) {
|
|
108
135
|
DesignSettingsUpdateTappViewModes[DesignSettingsUpdateTappViewModes["Normal"] = 0] = "Normal";
|
|
109
136
|
DesignSettingsUpdateTappViewModes[DesignSettingsUpdateTappViewModes["Exclusive"] = 1] = "Exclusive";
|
|
110
137
|
DesignSettingsUpdateTappViewModes[DesignSettingsUpdateTappViewModes["Wide"] = 2] = "Wide";
|
|
111
138
|
DesignSettingsUpdateTappViewModes[DesignSettingsUpdateTappViewModes["Fullscreen"] = 3] = "Fullscreen";
|
|
112
139
|
DesignSettingsUpdateTappViewModes[DesignSettingsUpdateTappViewModes["FullscreenWithBackground"] = 4] = "FullscreenWithBackground";
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
140
|
+
return DesignSettingsUpdateTappViewModes;
|
|
141
|
+
}(DesignSettingsUpdateTappViewModes || {}); // endregion
|
|
142
|
+
var LoginState = /*#__PURE__*/function (LoginState) {
|
|
116
143
|
LoginState[LoginState["FACEBOOK"] = 0] = "FACEBOOK";
|
|
117
144
|
LoginState[LoginState["T_WEB"] = 1] = "T_WEB";
|
|
118
145
|
LoginState[LoginState["LoginFailed"] = 2] = "LoginFailed";
|
|
119
146
|
LoginState[LoginState["AlreadyLoggedIn"] = 3] = "AlreadyLoggedIn";
|
|
120
147
|
LoginState[LoginState["SUCCESS"] = 4] = "SUCCESS";
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
exports.FloatingButtonPosition = FloatingButtonPosition
|
|
124
|
-
(function (FloatingButtonPosition) {
|
|
148
|
+
return LoginState;
|
|
149
|
+
}(LoginState || {});
|
|
150
|
+
let FloatingButtonPosition = exports.FloatingButtonPosition = /*#__PURE__*/function (FloatingButtonPosition) {
|
|
125
151
|
FloatingButtonPosition[FloatingButtonPosition["Right"] = 0] = "Right";
|
|
126
152
|
FloatingButtonPosition[FloatingButtonPosition["Center"] = 1] = "Center";
|
|
127
153
|
FloatingButtonPosition[FloatingButtonPosition["Left"] = 2] = "Left";
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
exports.SharingApp = SharingApp
|
|
131
|
-
(function (SharingApp) {
|
|
154
|
+
return FloatingButtonPosition;
|
|
155
|
+
}({});
|
|
156
|
+
let SharingApp = exports.SharingApp = /*#__PURE__*/function (SharingApp) {
|
|
132
157
|
SharingApp[SharingApp["Mail"] = 0] = "Mail";
|
|
133
158
|
SharingApp[SharingApp["WhatsApp"] = 1] = "WhatsApp";
|
|
134
159
|
SharingApp[SharingApp["Facebook"] = 2] = "Facebook";
|
|
135
160
|
SharingApp[SharingApp["FacebookMessenger"] = 3] = "FacebookMessenger";
|
|
136
161
|
SharingApp[SharingApp["GooglePlus"] = 4] = "GooglePlus";
|
|
137
162
|
SharingApp[SharingApp["Twitter"] = 5] = "Twitter";
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
exports.TappEvent = TappEvent
|
|
141
|
-
(function (TappEvent) {
|
|
163
|
+
return SharingApp;
|
|
164
|
+
}({});
|
|
165
|
+
let TappEvent = exports.TappEvent = /*#__PURE__*/function (TappEvent) {
|
|
142
166
|
TappEvent[TappEvent["OnShow"] = 0] = "OnShow";
|
|
143
167
|
TappEvent[TappEvent["OnHide"] = 1] = "OnHide";
|
|
144
168
|
TappEvent[TappEvent["OnRefresh"] = 2] = "OnRefresh";
|
|
145
169
|
TappEvent[TappEvent["OnOpenCcScanner"] = 3] = "OnOpenCcScanner";
|
|
146
170
|
TappEvent[TappEvent["OnCloseCcScanner"] = 4] = "OnCloseCcScanner";
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
exports.IconType = IconType
|
|
150
|
-
(function (IconType) {
|
|
171
|
+
return TappEvent;
|
|
172
|
+
}({});
|
|
173
|
+
let IconType = exports.IconType = /*#__PURE__*/function (IconType) {
|
|
151
174
|
IconType[IconType["Font"] = 0] = "Font";
|
|
152
175
|
IconType[IconType["Base64"] = 1] = "Base64";
|
|
153
176
|
IconType[IconType["Url"] = 2] = "Url";
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
exports.Gender = Gender
|
|
157
|
-
(function (Gender) {
|
|
177
|
+
return IconType;
|
|
178
|
+
}({});
|
|
179
|
+
let Gender = exports.Gender = /*#__PURE__*/function (Gender) {
|
|
158
180
|
Gender[Gender["Unknown"] = 0] = "Unknown";
|
|
159
181
|
Gender[Gender["male"] = 1] = "male";
|
|
160
182
|
Gender[Gender["female"] = 2] = "female";
|
|
161
183
|
Gender[Gender["diverse"] = 9] = "diverse";
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
exports.ColorMode = ColorMode
|
|
165
|
-
(function (ColorMode) {
|
|
184
|
+
return Gender;
|
|
185
|
+
}({});
|
|
186
|
+
let ColorMode = exports.ColorMode = /*#__PURE__*/function (ColorMode) {
|
|
166
187
|
ColorMode[ColorMode["Classic"] = 0] = "Classic";
|
|
167
188
|
ColorMode[ColorMode["Dark"] = 1] = "Dark";
|
|
168
189
|
ColorMode[ColorMode["Light"] = 2] = "Light";
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
exports.Language = Language
|
|
172
|
-
(function (Language) {
|
|
190
|
+
return ColorMode;
|
|
191
|
+
}({});
|
|
192
|
+
let Language = exports.Language = /*#__PURE__*/function (Language) {
|
|
173
193
|
Language["Unknown"] = "unknown";
|
|
174
194
|
Language["German"] = "de";
|
|
175
195
|
Language["English"] = "en";
|
|
@@ -181,57 +201,54 @@ exports.Language = Language;
|
|
|
181
201
|
Language["Turkish"] = "tr";
|
|
182
202
|
Language["Polish"] = "pl";
|
|
183
203
|
Language["Ukrainian"] = "uk";
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
exports.RuntimeEnviroment = RuntimeEnviroment
|
|
187
|
-
(function (RuntimeEnviroment) {
|
|
204
|
+
return Language;
|
|
205
|
+
}({});
|
|
206
|
+
let RuntimeEnviroment = exports.RuntimeEnviroment = /*#__PURE__*/function (RuntimeEnviroment) {
|
|
188
207
|
RuntimeEnviroment[RuntimeEnviroment["Unknown"] = 0] = "Unknown";
|
|
189
208
|
RuntimeEnviroment[RuntimeEnviroment["ChaynsDe"] = 1] = "ChaynsDe";
|
|
190
209
|
RuntimeEnviroment[RuntimeEnviroment["ChaynsWeb"] = 2] = "ChaynsWeb";
|
|
191
210
|
RuntimeEnviroment[RuntimeEnviroment["ChaynsRuntime"] = 3] = "ChaynsRuntime";
|
|
192
211
|
RuntimeEnviroment[RuntimeEnviroment["IntercomPlugin"] = 4] = "IntercomPlugin";
|
|
193
212
|
RuntimeEnviroment[RuntimeEnviroment["PagemakerPlugin"] = 5] = "PagemakerPlugin";
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
exports.DeviceOs = DeviceOs
|
|
197
|
-
(function (DeviceOs) {
|
|
213
|
+
return RuntimeEnviroment;
|
|
214
|
+
}({});
|
|
215
|
+
let DeviceOs = exports.DeviceOs = /*#__PURE__*/function (DeviceOs) {
|
|
198
216
|
DeviceOs["Unknown"] = "unknown";
|
|
199
217
|
DeviceOs["Android"] = "android";
|
|
200
218
|
DeviceOs["IOS"] = "ios";
|
|
201
219
|
DeviceOs["Windows"] = "windows";
|
|
202
220
|
DeviceOs["MacOs"] = "macos";
|
|
203
221
|
DeviceOs["Linux"] = "linux";
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
exports.AppName = AppName
|
|
207
|
-
(function (AppName) {
|
|
222
|
+
return DeviceOs;
|
|
223
|
+
}({});
|
|
224
|
+
let AppName = exports.AppName = /*#__PURE__*/function (AppName) {
|
|
208
225
|
AppName[AppName["Unknown"] = 0] = "Unknown";
|
|
209
226
|
AppName[AppName["David"] = 1] = "David";
|
|
210
227
|
AppName[AppName["Chayns"] = 2] = "Chayns";
|
|
211
228
|
AppName[AppName["Location"] = 3] = "Location";
|
|
212
229
|
AppName[AppName["Intercom"] = 4] = "Intercom";
|
|
213
230
|
AppName[AppName["ChaynsLauncher"] = 5] = "ChaynsLauncher";
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
231
|
+
AppName[AppName["TobitChat"] = 6] = "TobitChat";
|
|
232
|
+
AppName[AppName["Sidekick"] = 7] = "Sidekick";
|
|
233
|
+
AppName[AppName["Team"] = 8] = "Team";
|
|
234
|
+
return AppName;
|
|
235
|
+
}({});
|
|
236
|
+
let BrowserName = exports.BrowserName = /*#__PURE__*/function (BrowserName) {
|
|
218
237
|
BrowserName["Unknown"] = "unknown";
|
|
219
238
|
BrowserName["Chrome"] = "chrome";
|
|
220
239
|
BrowserName["Safari"] = "safari";
|
|
221
240
|
BrowserName["Firefox"] = "firefox";
|
|
222
241
|
BrowserName["Edge"] = "edge";
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
exports.Environment = Environment
|
|
226
|
-
(function (Environment) {
|
|
242
|
+
return BrowserName;
|
|
243
|
+
}({});
|
|
244
|
+
let Environment = exports.Environment = /*#__PURE__*/function (Environment) {
|
|
227
245
|
Environment[Environment["Development"] = 0] = "Development";
|
|
228
246
|
Environment[Environment["Qa"] = 1] = "Qa";
|
|
229
247
|
Environment[Environment["Staging"] = 2] = "Staging";
|
|
230
248
|
Environment[Environment["Production"] = 3] = "Production";
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
exports.Font = Font
|
|
234
|
-
(function (Font) {
|
|
249
|
+
return Environment;
|
|
250
|
+
}({});
|
|
251
|
+
let Font = exports.Font = /*#__PURE__*/function (Font) {
|
|
235
252
|
Font[Font["Unknown"] = 0] = "Unknown";
|
|
236
253
|
Font[Font["Roboto"] = 1] = "Roboto";
|
|
237
254
|
Font[Font["OpenSans"] = 2] = "OpenSans";
|
|
@@ -260,15 +277,14 @@ exports.Font = Font;
|
|
|
260
277
|
Font[Font["RobotoBold"] = 25] = "RobotoBold";
|
|
261
278
|
Font[Font["RobotoRegular"] = 26] = "RobotoRegular";
|
|
262
279
|
Font[Font["Inter"] = 27] = "Inter";
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
280
|
+
return Font;
|
|
281
|
+
}({});
|
|
282
|
+
var selectType = /*#__PURE__*/function (selectType) {
|
|
266
283
|
selectType[selectType["DEFAULT"] = 0] = "DEFAULT";
|
|
267
284
|
selectType[selectType["ICON"] = 1] = "ICON";
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
exports.DialogType = DialogType
|
|
271
|
-
(function (DialogType) {
|
|
285
|
+
return selectType;
|
|
286
|
+
}(selectType || {});
|
|
287
|
+
let DialogType = exports.DialogType = /*#__PURE__*/function (DialogType) {
|
|
272
288
|
DialogType["ALERT"] = "alert";
|
|
273
289
|
DialogType["CONFIRM"] = "confirm";
|
|
274
290
|
DialogType["DATE"] = "date";
|
|
@@ -278,4 +294,21 @@ exports.DialogType = DialogType;
|
|
|
278
294
|
DialogType["INPUT"] = "input";
|
|
279
295
|
DialogType["SELECT"] = "select";
|
|
280
296
|
DialogType["TOAST"] = "toast";
|
|
281
|
-
|
|
297
|
+
DialogType["SIGNATURE"] = "signature";
|
|
298
|
+
return DialogType;
|
|
299
|
+
}({});
|
|
300
|
+
let MediaType = exports.MediaType = /*#__PURE__*/function (MediaType) {
|
|
301
|
+
MediaType["IMAGE"] = "image";
|
|
302
|
+
MediaType["VIDEO"] = "video";
|
|
303
|
+
return MediaType;
|
|
304
|
+
}({});
|
|
305
|
+
let DialogAnimation = exports.DialogAnimation = /*#__PURE__*/function (DialogAnimation) {
|
|
306
|
+
DialogAnimation["CONFETTI"] = "confetti";
|
|
307
|
+
return DialogAnimation;
|
|
308
|
+
}({});
|
|
309
|
+
let DialogIconType = exports.DialogIconType = /*#__PURE__*/function (DialogIconType) {
|
|
310
|
+
DialogIconType["SuccessIcon"] = "%%DialogSuccessIcon%%";
|
|
311
|
+
DialogIconType["WarningIcon"] = "%%DialogWarningIcon%%";
|
|
312
|
+
DialogIconType["ErrorIcon"] = "%%DialogErrorIcon%%";
|
|
313
|
+
return DialogIconType;
|
|
314
|
+
}({});
|
package/dist/cjs/util/appCall.js
CHANGED
|
@@ -7,9 +7,9 @@ exports.default = void 0;
|
|
|
7
7
|
// @ts-nocheck
|
|
8
8
|
|
|
9
9
|
const invokeAppCall = call => {
|
|
10
|
-
var _window$webkit, _window$
|
|
10
|
+
var _window$webkit, _window$chaynsApp, _window$chaynsElectro;
|
|
11
11
|
call = JSON.stringify(call);
|
|
12
|
-
if ((_window$webkit = window.webkit) !== null && _window$webkit !== void 0 && (_window$webkit
|
|
12
|
+
if ((_window$webkit = window.webkit) !== null && _window$webkit !== void 0 && (_window$webkit = _window$webkit.messageHandlers) !== null && _window$webkit !== void 0 && _window$webkit.jsonCall) {
|
|
13
13
|
window.webkit.messageHandlers.jsonCall.postMessage(call);
|
|
14
14
|
} else if ((_window$chaynsApp = window.chaynsApp) !== null && _window$chaynsApp !== void 0 && _window$chaynsApp.jsonCall) {
|
|
15
15
|
window.chaynsApp.jsonCall(call);
|
|
@@ -19,5 +19,4 @@ const invokeAppCall = call => {
|
|
|
19
19
|
throw new Error('jsoncall interface not found');
|
|
20
20
|
}
|
|
21
21
|
};
|
|
22
|
-
var _default = invokeAppCall;
|
|
23
|
-
exports.default = _default;
|
|
22
|
+
var _default = exports.default = invokeAppCall;
|
|
@@ -11,9 +11,15 @@ const getDeviceInfo = (userAgent, acceptHeader) => {
|
|
|
11
11
|
const parsedUA = (0, _detectBrowser.parseUserAgent)(userAgent);
|
|
12
12
|
let appName = _IChaynsReact.AppName.Unknown;
|
|
13
13
|
const match = /(?:my)?chayns\/(?<version>\d+).*(?<siteId>\d{5}-\d{5})/i.exec(userAgent);
|
|
14
|
-
if ((
|
|
14
|
+
if (/\sintercom\/\d+/i.test(userAgent)) {
|
|
15
|
+
appName = _IChaynsReact.AppName.TobitChat;
|
|
16
|
+
} else if (/\ssidekick\/\d+/i.test(userAgent)) {
|
|
17
|
+
appName = _IChaynsReact.AppName.Sidekick;
|
|
18
|
+
} else if (/\steam\/\d+/i.test(userAgent)) {
|
|
19
|
+
appName = _IChaynsReact.AppName.Team;
|
|
20
|
+
} else if ((match === null || match === void 0 || (_match$groups = match.groups) === null || _match$groups === void 0 ? void 0 : _match$groups.siteId) === '60021-08989') {
|
|
15
21
|
appName = _IChaynsReact.AppName.Chayns;
|
|
16
|
-
} else if ((match === null || match === void 0
|
|
22
|
+
} else if ((match === null || match === void 0 || (_match$groups2 = match.groups) === null || _match$groups2 === void 0 ? void 0 : _match$groups2.siteId) === '77892-10814') {
|
|
17
23
|
appName = _IChaynsReact.AppName.David;
|
|
18
24
|
} else if (match) {
|
|
19
25
|
appName = _IChaynsReact.AppName.Location;
|
|
@@ -24,7 +30,7 @@ const getDeviceInfo = (userAgent, acceptHeader) => {
|
|
|
24
30
|
result.browser = {
|
|
25
31
|
name: parsedUA === null || parsedUA === void 0 ? void 0 : parsedUA.name,
|
|
26
32
|
version: parsedUA === null || parsedUA === void 0 ? void 0 : parsedUA.version,
|
|
27
|
-
majorVersion: Number.parseInt((_parsedUA$version$spl = parsedUA === null || parsedUA === void 0
|
|
33
|
+
majorVersion: Number.parseInt((_parsedUA$version$spl = parsedUA === null || parsedUA === void 0 || (_parsedUA$version = parsedUA.version) === null || _parsedUA$version === void 0 ? void 0 : _parsedUA$version.split('.')[0]) !== null && _parsedUA$version$spl !== void 0 ? _parsedUA$version$spl : '0', 10) || 0,
|
|
28
34
|
isWebPSupported: acceptHeader.includes('image/webp')
|
|
29
35
|
};
|
|
30
36
|
result.app = {
|
|
@@ -35,7 +41,8 @@ const getDeviceInfo = (userAgent, acceptHeader) => {
|
|
|
35
41
|
result.accessToken = undefined; // TODO
|
|
36
42
|
result.os = parsedUA === null || parsedUA === void 0 ? void 0 : parsedUA.os;
|
|
37
43
|
if (typeof window !== 'undefined') {
|
|
38
|
-
result.screenSize = getScreenSize(window.innerWidth
|
|
44
|
+
result.screenSize = getScreenSize(window.innerWidth);
|
|
45
|
+
result.isTouch = getClientDeviceInfo().isTouch;
|
|
39
46
|
} else {
|
|
40
47
|
// estimate size over user agent, very inaccurate, could be improved by setting a cookie with the screensize
|
|
41
48
|
const screenSizeByUA = /mobi/i.test(userAgent) ? _IChaynsReact.ScreenSize.SM : _IChaynsReact.ScreenSize.XL;
|
|
@@ -46,19 +53,18 @@ const getDeviceInfo = (userAgent, acceptHeader) => {
|
|
|
46
53
|
|
|
47
54
|
// Infos that are only available on client or iframe side
|
|
48
55
|
const getClientDeviceInfo = () => ({
|
|
49
|
-
isTouch: navigator.maxTouchPoints > 0 && window.matchMedia('(pointer: coarse)')
|
|
56
|
+
isTouch: navigator.maxTouchPoints > 0 && window.matchMedia('(pointer: coarse)').matches
|
|
50
57
|
});
|
|
51
58
|
exports.getClientDeviceInfo = getClientDeviceInfo;
|
|
52
|
-
const getScreenSize =
|
|
53
|
-
const size = Math.max(width, height);
|
|
59
|
+
const getScreenSize = width => {
|
|
54
60
|
let value;
|
|
55
|
-
if (
|
|
61
|
+
if (width > 1200) {
|
|
56
62
|
value = _IChaynsReact.ScreenSize.XL;
|
|
57
|
-
} else if (
|
|
63
|
+
} else if (width > 993) {
|
|
58
64
|
value = _IChaynsReact.ScreenSize.LG;
|
|
59
|
-
} else if (
|
|
65
|
+
} else if (width > 769) {
|
|
60
66
|
value = _IChaynsReact.ScreenSize.MD;
|
|
61
|
-
} else if (
|
|
67
|
+
} else if (width > 556) {
|
|
62
68
|
value = _IChaynsReact.ScreenSize.SM;
|
|
63
69
|
} else {
|
|
64
70
|
value = _IChaynsReact.ScreenSize.XS;
|
|
@@ -66,5 +72,4 @@ const getScreenSize = (width, height) => {
|
|
|
66
72
|
return value;
|
|
67
73
|
};
|
|
68
74
|
exports.getScreenSize = getScreenSize;
|
|
69
|
-
var _default = getDeviceInfo;
|
|
70
|
-
exports.default = _default;
|
|
75
|
+
var _default = exports.default = getDeviceInfo;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var Comlink = _interopRequireWildcard(require("comlink"));
|
|
4
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
5
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
6
|
+
// @ts-nocheck
|
|
7
|
+
|
|
8
|
+
Comlink.transferHandlers.set("FUNCTION", {
|
|
9
|
+
canHandle: obj => {
|
|
10
|
+
return obj && typeof obj === "object" && Object.values(obj).some(x => typeof x === 'function');
|
|
11
|
+
},
|
|
12
|
+
serialize(obj) {
|
|
13
|
+
obj._functionKeys = [];
|
|
14
|
+
const ports = [];
|
|
15
|
+
Object.entries(obj).forEach(([k, v]) => {
|
|
16
|
+
if (typeof v === 'function') {
|
|
17
|
+
const {
|
|
18
|
+
port1,
|
|
19
|
+
port2
|
|
20
|
+
} = new MessageChannel();
|
|
21
|
+
obj._functionKeys.push(k);
|
|
22
|
+
Comlink.expose(obj[k], port1);
|
|
23
|
+
obj[k] = port2;
|
|
24
|
+
ports.push(port2);
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
return [obj, ports];
|
|
28
|
+
},
|
|
29
|
+
deserialize(obj) {
|
|
30
|
+
obj._functionKeys.forEach(x => {
|
|
31
|
+
// under certain conditions deserialize can be called more than once on same object
|
|
32
|
+
if (obj[x] instanceof MessagePort) {
|
|
33
|
+
obj[x].start();
|
|
34
|
+
obj[x] = Comlink.wrap(obj[x]);
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
return obj;
|
|
38
|
+
}
|
|
39
|
+
});
|
package/dist/cjs/util/url.js
CHANGED
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.replaceStagingUrl = void 0;
|
|
7
7
|
var _IChaynsReact = require("../types/IChaynsReact");
|
|
8
8
|
const replaceStagingUrl = (prevent, url, environment) => {
|
|
9
|
-
if (prevent) return url;
|
|
9
|
+
if (prevent || !url) return url;
|
|
10
10
|
let replacedUrl = url;
|
|
11
11
|
if (environment === _IChaynsReact.Environment.Qa || environment === _IChaynsReact.Environment.Development) {
|
|
12
12
|
replacedUrl = replacedUrl.replace('tapp.chayns-static.space', 'tapp-dev.chayns-static.space');
|