@robylon/react-native-sdk 2.0.25-staging.9 → 2.0.26
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/README.md +10 -10
- package/lib/commonjs/Chatbotsdk.js +2 -2
- package/lib/commonjs/Chatbotsdk.js.map +1 -1
- package/lib/commonjs/config.js +1 -1
- package/lib/commonjs/config.js.map +1 -1
- package/lib/commonjs/constants.js +1 -1
- package/lib/commonjs/constants.js.map +1 -1
- package/lib/commonjs/versions/version.staging.js +1 -1
- package/lib/commonjs/versions/version.staging.js.map +1 -1
- package/lib/module/Chatbotsdk.js +2 -2
- package/lib/module/Chatbotsdk.js.map +1 -1
- package/lib/module/config.js +1 -1
- package/lib/module/config.js.map +1 -1
- package/lib/module/constants.js +1 -1
- package/lib/module/constants.js.map +1 -1
- package/lib/module/versions/version.staging.js +1 -1
- package/lib/module/versions/version.staging.js.map +1 -1
- package/lib/typescript/Chatbotsdk.d.ts +2 -1
- package/lib/typescript/Chatbotsdk.d.ts.map +1 -1
- package/lib/typescript/versions/version.staging.d.ts +1 -1
- package/lib/typescript/versions/version.staging.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/Chatbotsdk.tsx +0 -870
- package/src/FloatingButton/launchers/ImageLauncher.tsx +0 -75
- package/src/FloatingButton/launchers/TextLauncher.tsx +0 -84
- package/src/FloatingButton/launchers/TextualImageLauncher.tsx +0 -133
- package/src/FloatingButton.tsx +0 -97
- package/src/LoadingIndicator.tsx +0 -11
- package/src/Toast.tsx +0 -65
- package/src/components/DebugButton.tsx +0 -46
- package/src/components/ErrorBoundary.tsx +0 -38
- package/src/config.ts +0 -4
- package/src/constants/errorConstants.ts +0 -21
- package/src/constants/fontStyles.ts +0 -3
- package/src/constants.ts +0 -5
- package/src/global.d.ts +0 -11
- package/src/hooks/useChatbotEvents.ts +0 -93
- package/src/index.tsx +0 -10
- package/src/openChatbot.ts +0 -11
- package/src/openChatbot.tsx +0 -0
- package/src/services/ErrorTrackingService.ts +0 -217
- package/src/types/events.ts +0 -25
- package/src/types/react-native-flipper-performance-plugin.d.ts +0 -3
- package/src/types/react-native-globals.d.ts +0 -10
- package/src/utils/animations.ts +0 -120
- package/src/utils/colorUtils.ts +0 -35
- package/src/utils/cookieUtils.ts +0 -7
- package/src/utils/debugConfig.ts +0 -56
- package/src/utils/debugMenu.ts +0 -14
- package/src/utils/errorHandler.ts +0 -58
- package/src/utils/fileDownload.ts +0 -70
- package/src/utils/logger.ts +0 -14
- package/src/utils/systemInfo.ts +0 -84
- package/src/utils/webViewStorage.ts +0 -62
- package/src/version.ts +0 -2
- package/src/versions/version.dev.ts +0 -2
- package/src/versions/version.production.ts +0 -2
- package/src/versions/version.staging.ts +0 -2
package/src/utils/systemInfo.ts
DELETED
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import { Platform, Dimensions, PixelRatio } from "react-native";
|
|
2
|
-
import { SDK_VERSION } from "../version";
|
|
3
|
-
|
|
4
|
-
interface ScreenSize {
|
|
5
|
-
width: number;
|
|
6
|
-
height: number;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
interface SystemInfo {
|
|
10
|
-
platform: string;
|
|
11
|
-
os: string;
|
|
12
|
-
browser: string;
|
|
13
|
-
sdk_version: string;
|
|
14
|
-
device: string;
|
|
15
|
-
screen_size: ScreenSize;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
// Get device type based on platform and screen dimensions
|
|
19
|
-
const getDeviceType = (): string => {
|
|
20
|
-
const { width, height } = Dimensions.get("window");
|
|
21
|
-
const aspectRatio = height / width;
|
|
22
|
-
|
|
23
|
-
if (Platform.OS === "ios") {
|
|
24
|
-
return Platform.isPad ? "iPad" : "iPhone";
|
|
25
|
-
} else if (Platform.OS === "android") {
|
|
26
|
-
return aspectRatio < 1.6 ? "Android Tablet" : "Android Phone";
|
|
27
|
-
}
|
|
28
|
-
return "Desktop";
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
// Get screen dimensions with pixel ratio
|
|
32
|
-
const getScreenSize = (): ScreenSize => {
|
|
33
|
-
return {
|
|
34
|
-
width: Math.round(Dimensions.get("window").width * PixelRatio.get()),
|
|
35
|
-
height: Math.round(Dimensions.get("window").height * PixelRatio.get()),
|
|
36
|
-
};
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
// Get browser detection script
|
|
40
|
-
export const getBrowserAndOSInfoScript = (): string => {
|
|
41
|
-
return `
|
|
42
|
-
function getOSAndBrowser() {
|
|
43
|
-
const userAgent = navigator.userAgent;
|
|
44
|
-
|
|
45
|
-
// OS Detection
|
|
46
|
-
let os = "unknown";
|
|
47
|
-
if (userAgent.indexOf("Win") !== -1) os = "Windows";
|
|
48
|
-
else if (userAgent.indexOf("Mac") !== -1) os = "MacOS";
|
|
49
|
-
else if (userAgent.indexOf("Linux") !== -1) os = "Linux";
|
|
50
|
-
else if (userAgent.indexOf("Android") !== -1) os = "Android";
|
|
51
|
-
else if (userAgent.indexOf("like Mac") !== -1) os = "iOS";
|
|
52
|
-
|
|
53
|
-
// Browser Detection
|
|
54
|
-
let browser = "unknown";
|
|
55
|
-
if (userAgent.indexOf("Chrome") !== -1) browser = "Chrome";
|
|
56
|
-
else if (userAgent.indexOf("Safari") !== -1) browser = "Safari";
|
|
57
|
-
else if (userAgent.indexOf("Firefox") !== -1) browser = "Firefox";
|
|
58
|
-
else if (userAgent.indexOf("Edge") !== -1) browser = "Edge";
|
|
59
|
-
else if (userAgent.indexOf("MSIE") !== -1 || userAgent.indexOf("Trident/") !== -1) browser = "IE";
|
|
60
|
-
|
|
61
|
-
window.ReactNativeWebView.postMessage(JSON.stringify({
|
|
62
|
-
type: 'SYSTEM_INFO',
|
|
63
|
-
data: { os, browser }
|
|
64
|
-
}));
|
|
65
|
-
}
|
|
66
|
-
getOSAndBrowser();
|
|
67
|
-
true;
|
|
68
|
-
`;
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
// Get complete system information
|
|
72
|
-
export const getSystemInfo = (webViewSystemInfo: {
|
|
73
|
-
os: string;
|
|
74
|
-
browser: string;
|
|
75
|
-
}): SystemInfo => {
|
|
76
|
-
return {
|
|
77
|
-
platform: Platform.OS,
|
|
78
|
-
os: webViewSystemInfo.os || Platform.OS,
|
|
79
|
-
browser: webViewSystemInfo.browser || "WebView",
|
|
80
|
-
sdk_version: SDK_VERSION,
|
|
81
|
-
device: getDeviceType(),
|
|
82
|
-
screen_size: getScreenSize(),
|
|
83
|
-
};
|
|
84
|
-
};
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { logger } from "./logger";
|
|
2
|
-
|
|
3
|
-
export enum StorageMessageType {
|
|
4
|
-
GET_STORAGE = "GET_STORAGE",
|
|
5
|
-
SET_STORAGE = "SET_STORAGE",
|
|
6
|
-
STORAGE_READY = "STORAGE_READY",
|
|
7
|
-
STORAGE_ERROR = "STORAGE_ERROR",
|
|
8
|
-
STORAGE_RESPONSE = "STORAGE_RESPONSE",
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export interface StorageMessage {
|
|
12
|
-
type: StorageMessageType;
|
|
13
|
-
key?: string;
|
|
14
|
-
value?: string;
|
|
15
|
-
error?: string;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export const getStorageScript = () => `
|
|
19
|
-
window.handleStorageOperation = function(message) {
|
|
20
|
-
try {
|
|
21
|
-
switch(message.type) {
|
|
22
|
-
case '${StorageMessageType.GET_STORAGE}':
|
|
23
|
-
const value = localStorage.getItem(message.key);
|
|
24
|
-
window.ReactNativeWebView.postMessage(JSON.stringify({
|
|
25
|
-
type: '${StorageMessageType.STORAGE_RESPONSE}',
|
|
26
|
-
key: message.key,
|
|
27
|
-
value: value
|
|
28
|
-
}));
|
|
29
|
-
break;
|
|
30
|
-
case '${StorageMessageType.SET_STORAGE}':
|
|
31
|
-
localStorage.setItem(message.key, message.value);
|
|
32
|
-
window.ReactNativeWebView.postMessage(JSON.stringify({
|
|
33
|
-
type: '${StorageMessageType.STORAGE_RESPONSE}',
|
|
34
|
-
key: message.key,
|
|
35
|
-
value: message.value
|
|
36
|
-
}));
|
|
37
|
-
break;
|
|
38
|
-
}
|
|
39
|
-
} catch (error) {
|
|
40
|
-
window.ReactNativeWebView.postMessage(JSON.stringify({
|
|
41
|
-
type: '${StorageMessageType.STORAGE_ERROR}',
|
|
42
|
-
error: error.message
|
|
43
|
-
}));
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
window.ReactNativeWebView.postMessage(JSON.stringify({
|
|
48
|
-
type: '${StorageMessageType.STORAGE_READY}'
|
|
49
|
-
}));
|
|
50
|
-
`;
|
|
51
|
-
|
|
52
|
-
export const createStorageMessage = (
|
|
53
|
-
type: StorageMessageType,
|
|
54
|
-
key?: string,
|
|
55
|
-
value?: string
|
|
56
|
-
): string => {
|
|
57
|
-
return `window.handleStorageOperation(${JSON.stringify({
|
|
58
|
-
type,
|
|
59
|
-
key,
|
|
60
|
-
value,
|
|
61
|
-
})});`;
|
|
62
|
-
};
|
package/src/version.ts
DELETED