@robylon/react-native-sdk 2.0.27-staging.8 → 2.0.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/lib/commonjs/config.js +1 -1
  2. package/lib/commonjs/config.js.map +1 -1
  3. package/lib/commonjs/constants.js +1 -1
  4. package/lib/commonjs/constants.js.map +1 -1
  5. package/lib/commonjs/utils/systemInfo.js +1 -1
  6. package/lib/commonjs/utils/systemInfo.js.map +1 -1
  7. package/lib/commonjs/versions/version.staging.js +1 -1
  8. package/lib/module/config.js +1 -1
  9. package/lib/module/config.js.map +1 -1
  10. package/lib/module/constants.js +1 -1
  11. package/lib/module/constants.js.map +1 -1
  12. package/lib/module/openChatbot.js +1 -2
  13. package/lib/module/openChatbot.js.map +1 -1
  14. package/lib/module/utils/systemInfo.js +1 -1
  15. package/lib/module/utils/systemInfo.js.map +1 -1
  16. package/lib/module/versions/version.staging.js +1 -1
  17. package/lib/typescript/utils/systemInfo.d.ts +0 -2
  18. package/lib/typescript/utils/systemInfo.d.ts.map +1 -1
  19. package/lib/typescript/versions/version.staging.d.ts +1 -1
  20. package/package.json +1 -1
  21. package/src/Chatbotsdk.tsx +0 -877
  22. package/src/FloatingButton/launchers/ImageLauncher.tsx +0 -75
  23. package/src/FloatingButton/launchers/TextLauncher.tsx +0 -84
  24. package/src/FloatingButton/launchers/TextualImageLauncher.tsx +0 -133
  25. package/src/FloatingButton.tsx +0 -97
  26. package/src/LoadingIndicator.tsx +0 -11
  27. package/src/Toast.tsx +0 -65
  28. package/src/components/DebugButton.tsx +0 -46
  29. package/src/components/ErrorBoundary.tsx +0 -38
  30. package/src/config.ts +0 -4
  31. package/src/constants/errorConstants.ts +0 -21
  32. package/src/constants/fontStyles.ts +0 -3
  33. package/src/constants.ts +0 -5
  34. package/src/global.d.ts +0 -11
  35. package/src/hooks/useChatbotEvents.ts +0 -93
  36. package/src/index.tsx +0 -10
  37. package/src/openChatbot.ts +0 -11
  38. package/src/openChatbot.tsx +0 -0
  39. package/src/services/ErrorTrackingService.ts +0 -217
  40. package/src/types/events.ts +0 -25
  41. package/src/types/react-native-flipper-performance-plugin.d.ts +0 -3
  42. package/src/types/react-native-globals.d.ts +0 -10
  43. package/src/utils/animations.ts +0 -120
  44. package/src/utils/colorUtils.ts +0 -35
  45. package/src/utils/cookieUtils.ts +0 -7
  46. package/src/utils/debugConfig.ts +0 -56
  47. package/src/utils/debugMenu.ts +0 -14
  48. package/src/utils/errorHandler.ts +0 -58
  49. package/src/utils/fileDownload.ts +0 -70
  50. package/src/utils/logger.ts +0 -14
  51. package/src/utils/systemInfo.ts +0 -113
  52. package/src/utils/webViewStorage.ts +0 -62
  53. package/src/version.ts +0 -2
  54. package/src/versions/version.dev.ts +0 -2
  55. package/src/versions/version.production.ts +0 -2
  56. package/src/versions/version.staging.ts +0 -2
@@ -1,113 +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
- browser_version: string | null;
14
- browser_language: string | null;
15
- sdk_version: string;
16
- device: string;
17
- screen_size: ScreenSize;
18
- user_agent: any;
19
- }
20
-
21
- // Get device type based on platform and screen dimensions
22
- const getDeviceType = (): string => {
23
- const { width, height } = Dimensions.get("window");
24
- const aspectRatio = height / width;
25
-
26
- if (Platform.OS === "ios") {
27
- return Platform.isPad ? "iPad" : "iPhone";
28
- } else if (Platform.OS === "android") {
29
- return aspectRatio < 1.6 ? "Android Tablet" : "Android Phone";
30
- }
31
- return "Desktop";
32
- };
33
-
34
- // Get screen dimensions with pixel ratio
35
- const getScreenSize = (): ScreenSize => {
36
- return {
37
- width: Math.round(Dimensions.get("window").width * PixelRatio.get()),
38
- height: Math.round(Dimensions.get("window").height * PixelRatio.get()),
39
- };
40
- };
41
-
42
- // Get browser detection script
43
- export const getBrowserAndOSInfoScript = (): string => {
44
- return `
45
- function getOSAndBrowser() {
46
- const userAgent = navigator.userAgent;
47
-
48
- // OS Detection
49
- let os = "unknown";
50
- if (userAgent.indexOf("Win") !== -1) os = "Windows";
51
- else if (userAgent.indexOf("Mac") !== -1) os = "MacOS";
52
- else if (userAgent.indexOf("Linux") !== -1) os = "Linux";
53
- else if (userAgent.indexOf("Android") !== -1) os = "Android";
54
- else if (userAgent.indexOf("like Mac") !== -1) os = "iOS";
55
-
56
- // Browser Detection
57
- let browser = "unknown";
58
- let browserVersion = null;
59
- if (userAgent.indexOf("Chrome") !== -1) {
60
- browser = "Chrome";
61
- const chromeMatch = userAgent.match(/Chrome\\/([0-9.]+)/);
62
- browserVersion = chromeMatch ? chromeMatch[1] : null;
63
- } else if (userAgent.indexOf("Safari") !== -1) {
64
- browser = "Safari";
65
- const safariMatch = userAgent.match(/Version\\/([0-9.]+)/);
66
- browserVersion = safariMatch ? safariMatch[1] : null;
67
- } else if (userAgent.indexOf("Firefox") !== -1) {
68
- browser = "Firefox";
69
- const firefoxMatch = userAgent.match(/Firefox\\/([0-9.]+)/);
70
- browserVersion = firefoxMatch ? firefoxMatch[1] : null;
71
- } else if (userAgent.indexOf("Edge") !== -1) {
72
- browser = "Edge";
73
- const edgeMatch = userAgent.match(/Edge\\/([0-9.]+)/);
74
- browserVersion = edgeMatch ? edgeMatch[1] : null;
75
- } else if (userAgent.indexOf("MSIE") !== -1 || userAgent.indexOf("Trident/") !== -1) {
76
- browser = "IE";
77
- const ieMatch = userAgent.match(/(?:MSIE |rv:)([0-9.]+)/);
78
- browserVersion = ieMatch ? ieMatch[1] : null;
79
- }
80
-
81
- // Browser Language
82
- const browserLanguage = navigator.language || navigator.languages?.[0] || null;
83
-
84
- window.ReactNativeWebView.postMessage(JSON.stringify({
85
- type: 'SYSTEM_INFO',
86
- data: { os, browser, browser_version: browserVersion, browser_language: browserLanguage }
87
- }));
88
- }
89
- getOSAndBrowser();
90
- true;
91
- `;
92
- };
93
-
94
- // Get complete system information
95
- export const getSystemInfo = (webViewSystemInfo: {
96
- os: string;
97
- browser: string;
98
- browser_version?: string | null;
99
- browser_language?: string | null;
100
- user_agent?: string | null;
101
- }): SystemInfo => {
102
- return {
103
- platform: Platform.OS,
104
- os: webViewSystemInfo.os || Platform.OS,
105
- browser: webViewSystemInfo.browser || "WebView",
106
- browser_version: webViewSystemInfo.browser_version || null,
107
- browser_language: webViewSystemInfo.browser_language || null,
108
- sdk_version: SDK_VERSION,
109
- device: getDeviceType(),
110
- screen_size: getScreenSize(),
111
- user_agent: webViewSystemInfo?.user_agent || null,
112
- };
113
- };
@@ -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
@@ -1,2 +0,0 @@
1
- // This file is auto-generated. Do not modify it manually.
2
- export { SDK_VERSION } from './versions/version.staging';
@@ -1,2 +0,0 @@
1
- // This file is auto-generated. Do not modify it manually.
2
- export const SDK_VERSION = '2.0.22-dev.0';
@@ -1,2 +0,0 @@
1
- // This file is auto-generated. Do not modify it manually.
2
- export const SDK_VERSION = "0.0.0";
@@ -1,2 +0,0 @@
1
- // This file is auto-generated. Do not modify it manually.
2
- export const SDK_VERSION = '2.0.27-staging.8';