chayns-api 1.0.35 → 1.0.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/calls/dialogs/date.js +28 -0
- package/dist/cjs/calls/index.js +70 -65
- package/dist/cjs/components/ChaynsProvider.js +5 -7
- package/dist/cjs/components/moduleWrapper.js +10 -0
- package/dist/cjs/components/withCompatMode.js +1 -1
- package/dist/cjs/hooks/useDialogState.js +2 -2
- package/dist/cjs/hooks/usePages.js +2 -2
- package/dist/cjs/index.js +8 -0
- package/dist/cjs/types/IChaynsReact.js +136 -123
- package/dist/cjs/util/appCall.js +2 -2
- package/dist/cjs/util/deviceHelper.js +3 -3
- package/dist/cjs/wrapper/FrameWrapper.js +4 -0
- package/dist/cjs/wrapper/StaticChaynsApi.js +23 -0
- package/dist/esm/calls/dialogs/date.js +0 -1
- package/dist/esm/calls/index.js +7 -1
- package/dist/esm/components/ChaynsProvider.js +3 -4
- package/dist/esm/components/moduleWrapper.js +3 -0
- package/dist/esm/hooks/useDialogState.js +2 -2
- package/dist/esm/hooks/usePages.js +1 -1
- package/dist/esm/index.js +1 -0
- package/dist/esm/types/IChaynsReact.js +114 -99
- package/dist/esm/util/appCall.js +2 -2
- package/dist/esm/util/deviceHelper.js +3 -3
- package/dist/esm/wrapper/FrameWrapper.js +4 -0
- package/dist/esm/wrapper/StaticChaynsApi.js +20 -0
- package/dist/types/calls/index.d.ts +4 -0
- package/dist/types/components/AppDialogWrapper.d.ts +2 -2
- package/dist/types/components/ChaynsProvider.d.ts +1 -4
- package/dist/types/components/moduleWrapper.d.ts +4 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/types/IChaynsReact.d.ts +19 -2
- package/dist/types/wrapper/StaticChaynsApi.d.ts +9 -0
- package/package.json +3 -1
- package/toolkit.config.js +20 -0
|
@@ -3,75 +3,81 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.ToastType = 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.DialogSelectType = exports.DialogInputType = exports.DialogButtonType = exports.DeviceOs = exports.DateType = exports.ColorMode = exports.BrowserName = exports.AppName = exports.AccessMode = void 0;
|
|
7
|
-
let DateType
|
|
8
|
-
exports.DateType = DateType;
|
|
9
|
-
(function (DateType) {
|
|
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.DialogButtonType = exports.DeviceOs = exports.DateType = exports.ColorMode = exports.BrowserName = exports.AppName = exports.AccessMode = void 0;
|
|
7
|
+
let DateType = /*#__PURE__*/function (DateType) {
|
|
10
8
|
DateType[DateType["DATE"] = 0] = "DATE";
|
|
11
9
|
DateType[DateType["TIME"] = 1] = "TIME";
|
|
12
10
|
DateType[DateType["DATE_TIME"] = 2] = "DATE_TIME";
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
exports.
|
|
16
|
-
|
|
11
|
+
return DateType;
|
|
12
|
+
}({});
|
|
13
|
+
exports.DateType = DateType;
|
|
14
|
+
let ToastType = /*#__PURE__*/function (ToastType) {
|
|
17
15
|
ToastType[ToastType["NEUTRAL"] = 1] = "NEUTRAL";
|
|
18
16
|
ToastType[ToastType["SUCCESS"] = 2] = "SUCCESS";
|
|
19
17
|
ToastType[ToastType["WARNING"] = 3] = "WARNING";
|
|
20
18
|
ToastType[ToastType["ERROR"] = 4] = "ERROR";
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
exports.
|
|
24
|
-
|
|
19
|
+
return ToastType;
|
|
20
|
+
}({});
|
|
21
|
+
exports.ToastType = ToastType;
|
|
22
|
+
let DialogInputType = /*#__PURE__*/function (DialogInputType) {
|
|
25
23
|
DialogInputType["NUMBER"] = "number";
|
|
26
24
|
DialogInputType["PASSWORD"] = "password";
|
|
27
25
|
DialogInputType["TELEPHONE"] = "tel";
|
|
28
26
|
DialogInputType["TEXT"] = "text";
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
27
|
+
DialogInputType["TEXTAREA"] = "textarea";
|
|
28
|
+
return DialogInputType;
|
|
29
|
+
}({});
|
|
30
|
+
exports.DialogInputType = DialogInputType;
|
|
31
|
+
let DialogSelectType = /*#__PURE__*/function (DialogSelectType) {
|
|
33
32
|
DialogSelectType[DialogSelectType["DEFAULT"] = 0] = "DEFAULT";
|
|
34
33
|
DialogSelectType[DialogSelectType["ICON"] = 1] = "ICON";
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
exports.
|
|
38
|
-
|
|
34
|
+
return DialogSelectType;
|
|
35
|
+
}({});
|
|
36
|
+
exports.DialogSelectType = DialogSelectType;
|
|
37
|
+
let DialogButtonType = /*#__PURE__*/function (DialogButtonType) {
|
|
39
38
|
DialogButtonType[DialogButtonType["OK"] = 1] = "OK";
|
|
40
39
|
DialogButtonType[DialogButtonType["CANCEL"] = -1] = "CANCEL";
|
|
41
40
|
DialogButtonType[DialogButtonType["NEGATIVE"] = 0] = "NEGATIVE";
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
exports.
|
|
45
|
-
|
|
41
|
+
return DialogButtonType;
|
|
42
|
+
}({});
|
|
43
|
+
exports.DialogButtonType = DialogButtonType;
|
|
44
|
+
let ScreenSize = /*#__PURE__*/function (ScreenSize) {
|
|
46
45
|
ScreenSize[ScreenSize["XS"] = 0] = "XS";
|
|
47
46
|
ScreenSize[ScreenSize["SM"] = 1] = "SM";
|
|
48
47
|
ScreenSize[ScreenSize["MD"] = 2] = "MD";
|
|
49
48
|
ScreenSize[ScreenSize["LG"] = 3] = "LG";
|
|
50
49
|
ScreenSize[ScreenSize["XL"] = 4] = "XL";
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
50
|
+
return ScreenSize;
|
|
51
|
+
}({});
|
|
52
|
+
/**
|
|
53
|
+
* @ignore
|
|
54
|
+
*/
|
|
55
|
+
/**
|
|
56
|
+
* @ignore
|
|
57
|
+
*/
|
|
58
|
+
exports.ScreenSize = ScreenSize;
|
|
59
|
+
let AccessMode = /*#__PURE__*/function (AccessMode) {
|
|
55
60
|
AccessMode[AccessMode["public"] = 0] = "public";
|
|
56
61
|
AccessMode[AccessMode["protected"] = 1] = "protected";
|
|
57
62
|
AccessMode[AccessMode["private"] = 2] = "private";
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
exports.
|
|
61
|
-
|
|
63
|
+
return AccessMode;
|
|
64
|
+
}({});
|
|
65
|
+
exports.AccessMode = AccessMode;
|
|
66
|
+
let ScanQrCodeCodeType = /*#__PURE__*/function (ScanQrCodeCodeType) {
|
|
62
67
|
ScanQrCodeCodeType[ScanQrCodeCodeType["QR"] = 0] = "QR";
|
|
63
68
|
ScanQrCodeCodeType[ScanQrCodeCodeType["BARCODE"] = 0] = "BARCODE";
|
|
64
69
|
ScanQrCodeCodeType[ScanQrCodeCodeType["ALL"] = 2] = "ALL";
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
exports.
|
|
68
|
-
|
|
70
|
+
return ScanQrCodeCodeType;
|
|
71
|
+
}({});
|
|
72
|
+
exports.ScanQrCodeCodeType = ScanQrCodeCodeType;
|
|
73
|
+
let ScanQrCodeCameraTypes = /*#__PURE__*/function (ScanQrCodeCameraTypes) {
|
|
69
74
|
ScanQrCodeCameraTypes[ScanQrCodeCameraTypes["AUTO"] = 0] = "AUTO";
|
|
70
75
|
ScanQrCodeCameraTypes[ScanQrCodeCameraTypes["BACK"] = 1] = "BACK";
|
|
71
76
|
ScanQrCodeCameraTypes[ScanQrCodeCameraTypes["FRONT"] = 2] = "FRONT";
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
77
|
+
return ScanQrCodeCameraTypes;
|
|
78
|
+
}({});
|
|
79
|
+
exports.ScanQrCodeCameraTypes = ScanQrCodeCameraTypes;
|
|
80
|
+
var IOSFeedbackVibration = /*#__PURE__*/function (IOSFeedbackVibration) {
|
|
75
81
|
IOSFeedbackVibration[IOSFeedbackVibration["Unknown"] = 0] = "Unknown";
|
|
76
82
|
IOSFeedbackVibration[IOSFeedbackVibration["SelectionChanged"] = 1] = "SelectionChanged";
|
|
77
83
|
IOSFeedbackVibration[IOSFeedbackVibration["NotificationError"] = 2] = "NotificationError";
|
|
@@ -82,25 +88,25 @@ var IOSFeedbackVibration;
|
|
|
82
88
|
IOSFeedbackVibration[IOSFeedbackVibration["Heavy"] = 7] = "Heavy";
|
|
83
89
|
IOSFeedbackVibration[IOSFeedbackVibration["Soft"] = 8] = "Soft";
|
|
84
90
|
IOSFeedbackVibration[IOSFeedbackVibration["Rigid"] = 9] = "Rigid";
|
|
85
|
-
|
|
91
|
+
return IOSFeedbackVibration;
|
|
92
|
+
}(IOSFeedbackVibration || {});
|
|
86
93
|
// region design settings
|
|
87
|
-
var SnapshotType
|
|
88
|
-
(function (SnapshotType) {
|
|
94
|
+
var SnapshotType = /*#__PURE__*/function (SnapshotType) {
|
|
89
95
|
SnapshotType["Background"] = "background";
|
|
90
96
|
SnapshotType["Settings"] = "settings";
|
|
91
97
|
SnapshotType["ColorScheme"] = "colorScheme";
|
|
92
98
|
SnapshotType["Cover"] = "cover";
|
|
93
99
|
SnapshotType["Tapp"] = "tapp";
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
100
|
+
return SnapshotType;
|
|
101
|
+
}(SnapshotType || {});
|
|
102
|
+
var DesignSettingsUpdateBackgroundType = /*#__PURE__*/function (DesignSettingsUpdateBackgroundType) {
|
|
97
103
|
DesignSettingsUpdateBackgroundType[DesignSettingsUpdateBackgroundType["None"] = 0] = "None";
|
|
98
104
|
DesignSettingsUpdateBackgroundType[DesignSettingsUpdateBackgroundType["Image"] = 1] = "Image";
|
|
99
105
|
DesignSettingsUpdateBackgroundType[DesignSettingsUpdateBackgroundType["Video"] = 2] = "Video";
|
|
100
106
|
DesignSettingsUpdateBackgroundType[DesignSettingsUpdateBackgroundType["Color"] = 3] = "Color";
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
107
|
+
return DesignSettingsUpdateBackgroundType;
|
|
108
|
+
}(DesignSettingsUpdateBackgroundType || {});
|
|
109
|
+
var DesignSettingsUpdateSeasonTypes = /*#__PURE__*/function (DesignSettingsUpdateSeasonTypes) {
|
|
104
110
|
DesignSettingsUpdateSeasonTypes[DesignSettingsUpdateSeasonTypes["None"] = 0] = "None";
|
|
105
111
|
DesignSettingsUpdateSeasonTypes[DesignSettingsUpdateSeasonTypes["Snowm"] = 1] = "Snowm";
|
|
106
112
|
DesignSettingsUpdateSeasonTypes[DesignSettingsUpdateSeasonTypes["Confetti"] = 2] = "Confetti";
|
|
@@ -110,95 +116,94 @@ var DesignSettingsUpdateSeasonTypes;
|
|
|
110
116
|
DesignSettingsUpdateSeasonTypes[DesignSettingsUpdateSeasonTypes["Eastern"] = 6] = "Eastern";
|
|
111
117
|
DesignSettingsUpdateSeasonTypes[DesignSettingsUpdateSeasonTypes["Clover"] = 7] = "Clover";
|
|
112
118
|
DesignSettingsUpdateSeasonTypes[DesignSettingsUpdateSeasonTypes["Coins"] = 8] = "Coins";
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
119
|
+
return DesignSettingsUpdateSeasonTypes;
|
|
120
|
+
}(DesignSettingsUpdateSeasonTypes || {});
|
|
121
|
+
var DesignSettingsUpdateGalleryAnimationTypes = /*#__PURE__*/function (DesignSettingsUpdateGalleryAnimationTypes) {
|
|
116
122
|
DesignSettingsUpdateGalleryAnimationTypes[DesignSettingsUpdateGalleryAnimationTypes["Swipe"] = 0] = "Swipe";
|
|
117
123
|
DesignSettingsUpdateGalleryAnimationTypes[DesignSettingsUpdateGalleryAnimationTypes["Fade"] = 1] = "Fade";
|
|
118
124
|
DesignSettingsUpdateGalleryAnimationTypes[DesignSettingsUpdateGalleryAnimationTypes["Parallax"] = 2] = "Parallax";
|
|
119
125
|
DesignSettingsUpdateGalleryAnimationTypes[DesignSettingsUpdateGalleryAnimationTypes["KenBurns"] = 3] = "KenBurns";
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
126
|
+
return DesignSettingsUpdateGalleryAnimationTypes;
|
|
127
|
+
}(DesignSettingsUpdateGalleryAnimationTypes || {});
|
|
128
|
+
var DesignSettingsUpdateCoverTypes = /*#__PURE__*/function (DesignSettingsUpdateCoverTypes) {
|
|
123
129
|
DesignSettingsUpdateCoverTypes[DesignSettingsUpdateCoverTypes["Image"] = 0] = "Image";
|
|
124
130
|
DesignSettingsUpdateCoverTypes[DesignSettingsUpdateCoverTypes["Video"] = 1] = "Video";
|
|
125
131
|
DesignSettingsUpdateCoverTypes[DesignSettingsUpdateCoverTypes["Slideshow"] = 2] = "Slideshow";
|
|
126
132
|
DesignSettingsUpdateCoverTypes[DesignSettingsUpdateCoverTypes["Frame"] = 3] = "Frame";
|
|
127
133
|
DesignSettingsUpdateCoverTypes[DesignSettingsUpdateCoverTypes["None"] = 4] = "None";
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
134
|
+
return DesignSettingsUpdateCoverTypes;
|
|
135
|
+
}(DesignSettingsUpdateCoverTypes || {});
|
|
136
|
+
var DesignSettingsUpdateColorSchemeMode = /*#__PURE__*/function (DesignSettingsUpdateColorSchemeMode) {
|
|
131
137
|
DesignSettingsUpdateColorSchemeMode[DesignSettingsUpdateColorSchemeMode["Normal"] = 0] = "Normal";
|
|
132
138
|
DesignSettingsUpdateColorSchemeMode[DesignSettingsUpdateColorSchemeMode["Dark"] = 1] = "Dark";
|
|
133
139
|
DesignSettingsUpdateColorSchemeMode[DesignSettingsUpdateColorSchemeMode["Bright"] = 2] = "Bright";
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
140
|
+
return DesignSettingsUpdateColorSchemeMode;
|
|
141
|
+
}(DesignSettingsUpdateColorSchemeMode || {});
|
|
142
|
+
var DesignSettingsUpdateTappViewModes = /*#__PURE__*/function (DesignSettingsUpdateTappViewModes) {
|
|
137
143
|
DesignSettingsUpdateTappViewModes[DesignSettingsUpdateTappViewModes["Normal"] = 0] = "Normal";
|
|
138
144
|
DesignSettingsUpdateTappViewModes[DesignSettingsUpdateTappViewModes["Exclusive"] = 1] = "Exclusive";
|
|
139
145
|
DesignSettingsUpdateTappViewModes[DesignSettingsUpdateTappViewModes["Wide"] = 2] = "Wide";
|
|
140
146
|
DesignSettingsUpdateTappViewModes[DesignSettingsUpdateTappViewModes["Fullscreen"] = 3] = "Fullscreen";
|
|
141
147
|
DesignSettingsUpdateTappViewModes[DesignSettingsUpdateTappViewModes["FullscreenWithBackground"] = 4] = "FullscreenWithBackground";
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
148
|
+
return DesignSettingsUpdateTappViewModes;
|
|
149
|
+
}(DesignSettingsUpdateTappViewModes || {}); // endregion
|
|
150
|
+
var LoginState = /*#__PURE__*/function (LoginState) {
|
|
145
151
|
LoginState[LoginState["FACEBOOK"] = 0] = "FACEBOOK";
|
|
146
152
|
LoginState[LoginState["T_WEB"] = 1] = "T_WEB";
|
|
147
153
|
LoginState[LoginState["LoginFailed"] = 2] = "LoginFailed";
|
|
148
154
|
LoginState[LoginState["AlreadyLoggedIn"] = 3] = "AlreadyLoggedIn";
|
|
149
155
|
LoginState[LoginState["SUCCESS"] = 4] = "SUCCESS";
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
(function (FloatingButtonPosition) {
|
|
156
|
+
return LoginState;
|
|
157
|
+
}(LoginState || {});
|
|
158
|
+
let FloatingButtonPosition = /*#__PURE__*/function (FloatingButtonPosition) {
|
|
154
159
|
FloatingButtonPosition[FloatingButtonPosition["Right"] = 0] = "Right";
|
|
155
160
|
FloatingButtonPosition[FloatingButtonPosition["Center"] = 1] = "Center";
|
|
156
161
|
FloatingButtonPosition[FloatingButtonPosition["Left"] = 2] = "Left";
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
exports.
|
|
160
|
-
|
|
162
|
+
return FloatingButtonPosition;
|
|
163
|
+
}({});
|
|
164
|
+
exports.FloatingButtonPosition = FloatingButtonPosition;
|
|
165
|
+
let SharingApp = /*#__PURE__*/function (SharingApp) {
|
|
161
166
|
SharingApp[SharingApp["Mail"] = 0] = "Mail";
|
|
162
167
|
SharingApp[SharingApp["WhatsApp"] = 1] = "WhatsApp";
|
|
163
168
|
SharingApp[SharingApp["Facebook"] = 2] = "Facebook";
|
|
164
169
|
SharingApp[SharingApp["FacebookMessenger"] = 3] = "FacebookMessenger";
|
|
165
170
|
SharingApp[SharingApp["GooglePlus"] = 4] = "GooglePlus";
|
|
166
171
|
SharingApp[SharingApp["Twitter"] = 5] = "Twitter";
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
exports.
|
|
170
|
-
|
|
172
|
+
return SharingApp;
|
|
173
|
+
}({});
|
|
174
|
+
exports.SharingApp = SharingApp;
|
|
175
|
+
let TappEvent = /*#__PURE__*/function (TappEvent) {
|
|
171
176
|
TappEvent[TappEvent["OnShow"] = 0] = "OnShow";
|
|
172
177
|
TappEvent[TappEvent["OnHide"] = 1] = "OnHide";
|
|
173
178
|
TappEvent[TappEvent["OnRefresh"] = 2] = "OnRefresh";
|
|
174
179
|
TappEvent[TappEvent["OnOpenCcScanner"] = 3] = "OnOpenCcScanner";
|
|
175
180
|
TappEvent[TappEvent["OnCloseCcScanner"] = 4] = "OnCloseCcScanner";
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
exports.
|
|
179
|
-
|
|
181
|
+
return TappEvent;
|
|
182
|
+
}({});
|
|
183
|
+
exports.TappEvent = TappEvent;
|
|
184
|
+
let IconType = /*#__PURE__*/function (IconType) {
|
|
180
185
|
IconType[IconType["Font"] = 0] = "Font";
|
|
181
186
|
IconType[IconType["Base64"] = 1] = "Base64";
|
|
182
187
|
IconType[IconType["Url"] = 2] = "Url";
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
exports.
|
|
186
|
-
|
|
188
|
+
return IconType;
|
|
189
|
+
}({});
|
|
190
|
+
exports.IconType = IconType;
|
|
191
|
+
let Gender = /*#__PURE__*/function (Gender) {
|
|
187
192
|
Gender[Gender["Unknown"] = 0] = "Unknown";
|
|
188
193
|
Gender[Gender["male"] = 1] = "male";
|
|
189
194
|
Gender[Gender["female"] = 2] = "female";
|
|
190
195
|
Gender[Gender["diverse"] = 9] = "diverse";
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
exports.
|
|
194
|
-
|
|
196
|
+
return Gender;
|
|
197
|
+
}({});
|
|
198
|
+
exports.Gender = Gender;
|
|
199
|
+
let ColorMode = /*#__PURE__*/function (ColorMode) {
|
|
195
200
|
ColorMode[ColorMode["Classic"] = 0] = "Classic";
|
|
196
201
|
ColorMode[ColorMode["Dark"] = 1] = "Dark";
|
|
197
202
|
ColorMode[ColorMode["Light"] = 2] = "Light";
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
exports.
|
|
201
|
-
|
|
203
|
+
return ColorMode;
|
|
204
|
+
}({});
|
|
205
|
+
exports.ColorMode = ColorMode;
|
|
206
|
+
let Language = /*#__PURE__*/function (Language) {
|
|
202
207
|
Language["Unknown"] = "unknown";
|
|
203
208
|
Language["German"] = "de";
|
|
204
209
|
Language["English"] = "en";
|
|
@@ -210,57 +215,57 @@ exports.Language = Language;
|
|
|
210
215
|
Language["Turkish"] = "tr";
|
|
211
216
|
Language["Polish"] = "pl";
|
|
212
217
|
Language["Ukrainian"] = "uk";
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
exports.
|
|
216
|
-
|
|
218
|
+
return Language;
|
|
219
|
+
}({});
|
|
220
|
+
exports.Language = Language;
|
|
221
|
+
let RuntimeEnviroment = /*#__PURE__*/function (RuntimeEnviroment) {
|
|
217
222
|
RuntimeEnviroment[RuntimeEnviroment["Unknown"] = 0] = "Unknown";
|
|
218
223
|
RuntimeEnviroment[RuntimeEnviroment["ChaynsDe"] = 1] = "ChaynsDe";
|
|
219
224
|
RuntimeEnviroment[RuntimeEnviroment["ChaynsWeb"] = 2] = "ChaynsWeb";
|
|
220
225
|
RuntimeEnviroment[RuntimeEnviroment["ChaynsRuntime"] = 3] = "ChaynsRuntime";
|
|
221
226
|
RuntimeEnviroment[RuntimeEnviroment["IntercomPlugin"] = 4] = "IntercomPlugin";
|
|
222
227
|
RuntimeEnviroment[RuntimeEnviroment["PagemakerPlugin"] = 5] = "PagemakerPlugin";
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
exports.
|
|
226
|
-
|
|
228
|
+
return RuntimeEnviroment;
|
|
229
|
+
}({});
|
|
230
|
+
exports.RuntimeEnviroment = RuntimeEnviroment;
|
|
231
|
+
let DeviceOs = /*#__PURE__*/function (DeviceOs) {
|
|
227
232
|
DeviceOs["Unknown"] = "unknown";
|
|
228
233
|
DeviceOs["Android"] = "android";
|
|
229
234
|
DeviceOs["IOS"] = "ios";
|
|
230
235
|
DeviceOs["Windows"] = "windows";
|
|
231
236
|
DeviceOs["MacOs"] = "macos";
|
|
232
237
|
DeviceOs["Linux"] = "linux";
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
exports.
|
|
236
|
-
|
|
238
|
+
return DeviceOs;
|
|
239
|
+
}({});
|
|
240
|
+
exports.DeviceOs = DeviceOs;
|
|
241
|
+
let AppName = /*#__PURE__*/function (AppName) {
|
|
237
242
|
AppName[AppName["Unknown"] = 0] = "Unknown";
|
|
238
243
|
AppName[AppName["David"] = 1] = "David";
|
|
239
244
|
AppName[AppName["Chayns"] = 2] = "Chayns";
|
|
240
245
|
AppName[AppName["Location"] = 3] = "Location";
|
|
241
246
|
AppName[AppName["Intercom"] = 4] = "Intercom";
|
|
242
247
|
AppName[AppName["ChaynsLauncher"] = 5] = "ChaynsLauncher";
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
exports.
|
|
246
|
-
|
|
248
|
+
return AppName;
|
|
249
|
+
}({});
|
|
250
|
+
exports.AppName = AppName;
|
|
251
|
+
let BrowserName = /*#__PURE__*/function (BrowserName) {
|
|
247
252
|
BrowserName["Unknown"] = "unknown";
|
|
248
253
|
BrowserName["Chrome"] = "chrome";
|
|
249
254
|
BrowserName["Safari"] = "safari";
|
|
250
255
|
BrowserName["Firefox"] = "firefox";
|
|
251
256
|
BrowserName["Edge"] = "edge";
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
exports.
|
|
255
|
-
|
|
257
|
+
return BrowserName;
|
|
258
|
+
}({});
|
|
259
|
+
exports.BrowserName = BrowserName;
|
|
260
|
+
let Environment = /*#__PURE__*/function (Environment) {
|
|
256
261
|
Environment[Environment["Development"] = 0] = "Development";
|
|
257
262
|
Environment[Environment["Qa"] = 1] = "Qa";
|
|
258
263
|
Environment[Environment["Staging"] = 2] = "Staging";
|
|
259
264
|
Environment[Environment["Production"] = 3] = "Production";
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
exports.
|
|
263
|
-
|
|
265
|
+
return Environment;
|
|
266
|
+
}({});
|
|
267
|
+
exports.Environment = Environment;
|
|
268
|
+
let Font = /*#__PURE__*/function (Font) {
|
|
264
269
|
Font[Font["Unknown"] = 0] = "Unknown";
|
|
265
270
|
Font[Font["Roboto"] = 1] = "Roboto";
|
|
266
271
|
Font[Font["OpenSans"] = 2] = "OpenSans";
|
|
@@ -289,15 +294,15 @@ exports.Font = Font;
|
|
|
289
294
|
Font[Font["RobotoBold"] = 25] = "RobotoBold";
|
|
290
295
|
Font[Font["RobotoRegular"] = 26] = "RobotoRegular";
|
|
291
296
|
Font[Font["Inter"] = 27] = "Inter";
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
297
|
+
return Font;
|
|
298
|
+
}({});
|
|
299
|
+
exports.Font = Font;
|
|
300
|
+
var selectType = /*#__PURE__*/function (selectType) {
|
|
295
301
|
selectType[selectType["DEFAULT"] = 0] = "DEFAULT";
|
|
296
302
|
selectType[selectType["ICON"] = 1] = "ICON";
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
(function (DialogType) {
|
|
303
|
+
return selectType;
|
|
304
|
+
}(selectType || {});
|
|
305
|
+
let DialogType = /*#__PURE__*/function (DialogType) {
|
|
301
306
|
DialogType["ALERT"] = "alert";
|
|
302
307
|
DialogType["CONFIRM"] = "confirm";
|
|
303
308
|
DialogType["DATE"] = "date";
|
|
@@ -307,4 +312,12 @@ exports.DialogType = DialogType;
|
|
|
307
312
|
DialogType["INPUT"] = "input";
|
|
308
313
|
DialogType["SELECT"] = "select";
|
|
309
314
|
DialogType["TOAST"] = "toast";
|
|
310
|
-
|
|
315
|
+
return DialogType;
|
|
316
|
+
}({});
|
|
317
|
+
exports.DialogType = DialogType;
|
|
318
|
+
let MediaType = /*#__PURE__*/function (MediaType) {
|
|
319
|
+
MediaType["IMAGE"] = "image";
|
|
320
|
+
MediaType["VIDEO"] = "video";
|
|
321
|
+
return MediaType;
|
|
322
|
+
}({});
|
|
323
|
+
exports.MediaType = MediaType;
|
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);
|
|
@@ -11,9 +11,9 @@ 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 ((match === null || match === void 0
|
|
14
|
+
if ((match === null || match === void 0 || (_match$groups = match.groups) === null || _match$groups === void 0 ? void 0 : _match$groups.siteId) === '60021-08989') {
|
|
15
15
|
appName = _IChaynsReact.AppName.Chayns;
|
|
16
|
-
} else if ((match === null || match === void 0
|
|
16
|
+
} else if ((match === null || match === void 0 || (_match$groups2 = match.groups) === null || _match$groups2 === void 0 ? void 0 : _match$groups2.siteId) === '77892-10814') {
|
|
17
17
|
appName = _IChaynsReact.AppName.David;
|
|
18
18
|
} else if (match) {
|
|
19
19
|
appName = _IChaynsReact.AppName.Location;
|
|
@@ -24,7 +24,7 @@ const getDeviceInfo = (userAgent, acceptHeader) => {
|
|
|
24
24
|
result.browser = {
|
|
25
25
|
name: parsedUA === null || parsedUA === void 0 ? void 0 : parsedUA.name,
|
|
26
26
|
version: parsedUA === null || parsedUA === void 0 ? void 0 : parsedUA.version,
|
|
27
|
-
majorVersion: Number.parseInt((_parsedUA$version$spl = parsedUA === null || parsedUA === void 0
|
|
27
|
+
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
28
|
isWebPSupported: acceptHeader.includes('image/webp')
|
|
29
29
|
};
|
|
30
30
|
result.app = {
|
|
@@ -105,6 +105,10 @@ class FrameWrapper {
|
|
|
105
105
|
if (!this.initialized) await this.ready;
|
|
106
106
|
return this.exposedFunctions.openImage(value);
|
|
107
107
|
},
|
|
108
|
+
openMedia: async value => {
|
|
109
|
+
if (!this.initialized) await this.ready;
|
|
110
|
+
return this.exposedFunctions.openMedia(value);
|
|
111
|
+
},
|
|
108
112
|
openUrl: async value => {
|
|
109
113
|
if (!this.initialized) await this.ready;
|
|
110
114
|
return this.exposedFunctions.openUrl(value);
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _moduleWrapper = require("../components/moduleWrapper");
|
|
8
|
+
var _FrameWrapper = require("./FrameWrapper");
|
|
9
|
+
class StaticChaynsApi {
|
|
10
|
+
constructor() {
|
|
11
|
+
const wrapper = new _FrameWrapper.FrameWrapper();
|
|
12
|
+
_moduleWrapper.moduleWrapper.current = wrapper;
|
|
13
|
+
this._wrapper = wrapper;
|
|
14
|
+
this.ready = wrapper.init();
|
|
15
|
+
this.addDataListener = wrapper.addDataListener;
|
|
16
|
+
Object.entries(wrapper.functions).forEach(([k, v]) => {
|
|
17
|
+
this[k] = v;
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
getSite = () => this._wrapper.values.site;
|
|
21
|
+
}
|
|
22
|
+
var _default = StaticChaynsApi;
|
|
23
|
+
exports.default = _default;
|
package/dist/esm/calls/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { moduleWrapper } from '../components/
|
|
1
|
+
import { moduleWrapper } from '../components/moduleWrapper';
|
|
2
2
|
/**
|
|
3
3
|
* This adds a listener to determine your location.
|
|
4
4
|
* @category Event listener
|
|
@@ -101,6 +101,12 @@ export const navigateBack = function () {
|
|
|
101
101
|
export const openImage = function () {
|
|
102
102
|
return moduleWrapper.current.functions.openImage(...arguments);
|
|
103
103
|
};
|
|
104
|
+
/**
|
|
105
|
+
* The images and videos specified in the items array is shown in gallery mode.
|
|
106
|
+
*/
|
|
107
|
+
export const openMedia = function () {
|
|
108
|
+
return moduleWrapper.current.functions.openMedia(...arguments);
|
|
109
|
+
};
|
|
104
110
|
/**
|
|
105
111
|
* Opens an URL in the chayns environment.
|
|
106
112
|
*/
|
|
@@ -7,12 +7,11 @@ import { FrameWrapper } from '../wrapper/FrameWrapper';
|
|
|
7
7
|
import { ModuleFederationWrapper } from '../wrapper/ModuleFederationWrapper';
|
|
8
8
|
import { SsrWrapper } from '../wrapper/SsrWrapper';
|
|
9
9
|
import { ChaynsContext, ChaynsFunctionsContext } from './ChaynsContext';
|
|
10
|
-
import AppDialogWrapper from
|
|
10
|
+
import AppDialogWrapper from './AppDialogWrapper';
|
|
11
|
+
import { moduleWrapper } from './moduleWrapper';
|
|
11
12
|
|
|
12
13
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
13
|
-
|
|
14
|
-
current: undefined
|
|
15
|
-
};
|
|
14
|
+
|
|
16
15
|
const isServer = typeof window === 'undefined';
|
|
17
16
|
const InitialDataProvider = /*#__PURE__*/React.memo(_ref => {
|
|
18
17
|
let {
|
|
@@ -10,7 +10,7 @@ export const useDialogState = () => {
|
|
|
10
10
|
const addDataListener = useContextSelector(ChaynsFunctionsContext, v => v === null || v === void 0 ? void 0 : v.addDialogHostEventListener);
|
|
11
11
|
const isClosingRequested = useContextSelector(ChaynsContext, v => {
|
|
12
12
|
var _v$dialog;
|
|
13
|
-
return v === null || v === void 0
|
|
13
|
+
return v === null || v === void 0 || (_v$dialog = v.dialog) === null || _v$dialog === void 0 ? void 0 : _v$dialog.isClosingRequested;
|
|
14
14
|
});
|
|
15
15
|
return {
|
|
16
16
|
setResult,
|
|
@@ -26,7 +26,7 @@ export const useDialogState = () => {
|
|
|
26
26
|
export const useDialogData = () => {
|
|
27
27
|
const inputData = useContextSelector(ChaynsContext, v => {
|
|
28
28
|
var _v$dialog2;
|
|
29
|
-
return v === null || v === void 0
|
|
29
|
+
return v === null || v === void 0 || (_v$dialog2 = v.dialog) === null || _v$dialog2 === void 0 ? void 0 : _v$dialog2.dialogInput;
|
|
30
30
|
});
|
|
31
31
|
return inputData;
|
|
32
32
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useContextSelector } from 'use-context-selector';
|
|
2
2
|
import { ChaynsContext } from '../components/ChaynsContext';
|
|
3
|
-
import { moduleWrapper } from
|
|
3
|
+
import { moduleWrapper } from '../components/moduleWrapper';
|
|
4
4
|
/**
|
|
5
5
|
* @category Hooks
|
|
6
6
|
*/
|
package/dist/esm/index.js
CHANGED
|
@@ -8,6 +8,7 @@ export * from './hooks';
|
|
|
8
8
|
export * from './components/WaitUntil';
|
|
9
9
|
export * from './types/IChaynsReact';
|
|
10
10
|
export * from './components/withCompatMode';
|
|
11
|
+
export { default as StaticChaynsApi } from './wrapper/StaticChaynsApi';
|
|
11
12
|
export { default as DialogHandler } from './handler/DialogHandler';
|
|
12
13
|
import * as _dialog from './calls/dialogs/index';
|
|
13
14
|
export { _dialog as dialog };
|