react-native-debug-toolkit 0.6.3 → 2.0.0
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/LICENSE +21 -0
- package/README.md +150 -212
- package/lib/commonjs/components/ClipboardTab.js +92 -0
- package/lib/commonjs/components/ClipboardTab.js.map +1 -0
- package/lib/commonjs/components/ConsoleLogTab.js +295 -0
- package/lib/commonjs/components/ConsoleLogTab.js.map +1 -0
- package/lib/commonjs/components/EnvironmentTab.js +288 -0
- package/lib/commonjs/components/EnvironmentTab.js.map +1 -0
- package/lib/commonjs/components/FloatPanelView.js +797 -0
- package/lib/commonjs/components/FloatPanelView.js.map +1 -0
- package/lib/commonjs/components/NavigationLogTab.js +131 -0
- package/lib/commonjs/components/NavigationLogTab.js.map +1 -0
- package/lib/commonjs/components/NetworkLogTab.js +575 -0
- package/lib/commonjs/components/NetworkLogTab.js.map +1 -0
- package/lib/commonjs/components/ThirdPartyLibsTab.js +97 -0
- package/lib/commonjs/components/ThirdPartyLibsTab.js.map +1 -0
- package/lib/commonjs/components/TrackLogTab.js +372 -0
- package/lib/commonjs/components/TrackLogTab.js.map +1 -0
- package/lib/commonjs/components/ZustandLogTab.js +451 -0
- package/lib/commonjs/components/ZustandLogTab.js.map +1 -0
- package/lib/commonjs/components/shared/CollapsibleSection.js +84 -0
- package/lib/commonjs/components/shared/CollapsibleSection.js.map +1 -0
- package/lib/commonjs/components/shared/CopyButton.js +64 -0
- package/lib/commonjs/components/shared/CopyButton.js.map +1 -0
- package/lib/commonjs/components/shared/JsonView.js +157 -0
- package/lib/commonjs/components/shared/JsonView.js.map +1 -0
- package/lib/commonjs/core/DebugToolkit.js +142 -0
- package/lib/commonjs/core/DebugToolkit.js.map +1 -0
- package/lib/commonjs/core/DebugToolkitProvider.js +64 -0
- package/lib/commonjs/core/DebugToolkitProvider.js.map +1 -0
- package/lib/commonjs/features/ClipboardFeature.js +17 -0
- package/lib/commonjs/features/ClipboardFeature.js.map +1 -0
- package/lib/commonjs/features/ConsoleLogFeature.js +98 -0
- package/lib/commonjs/features/ConsoleLogFeature.js.map +1 -0
- package/lib/commonjs/features/EnvironmentFeature.js +168 -0
- package/lib/commonjs/features/EnvironmentFeature.js.map +1 -0
- package/lib/commonjs/features/NavigationLogFeature.js +60 -0
- package/lib/commonjs/features/NavigationLogFeature.js.map +1 -0
- package/lib/commonjs/features/NetworkFeature.js +328 -0
- package/lib/commonjs/features/NetworkFeature.js.map +1 -0
- package/lib/commonjs/features/ThirdPartyLibsFeature.js +51 -0
- package/lib/commonjs/features/ThirdPartyLibsFeature.js.map +1 -0
- package/lib/commonjs/features/TrackFeature.js +55 -0
- package/lib/commonjs/features/TrackFeature.js.map +1 -0
- package/lib/commonjs/features/ZustandLogFeature.js +76 -0
- package/lib/commonjs/features/ZustandLogFeature.js.map +1 -0
- package/lib/commonjs/hooks/useNavigationLogger.js +78 -0
- package/lib/commonjs/hooks/useNavigationLogger.js.map +1 -0
- package/lib/commonjs/hooks/useSlideDetailAnimation.js +53 -0
- package/lib/commonjs/hooks/useSlideDetailAnimation.js.map +1 -0
- package/lib/commonjs/index.js +165 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/initialize.js +161 -0
- package/lib/commonjs/initialize.js.map +1 -0
- package/lib/commonjs/native/NativeDebugLibs.js +58 -0
- package/lib/commonjs/native/NativeDebugLibs.js.map +1 -0
- package/lib/commonjs/package.json +1 -0
- package/lib/commonjs/types/index.js +6 -0
- package/lib/commonjs/types/index.js.map +1 -0
- package/lib/commonjs/utils/constants.js +135 -0
- package/lib/commonjs/utils/constants.js.map +1 -0
- package/lib/commonjs/utils/copyToComputer.js +97 -0
- package/lib/commonjs/utils/copyToComputer.js.map +1 -0
- package/lib/commonjs/utils/createEventChannel.js +21 -0
- package/lib/commonjs/utils/createEventChannel.js.map +1 -0
- package/lib/commonjs/utils/createObservableStore.js +38 -0
- package/lib/commonjs/utils/createObservableStore.js.map +1 -0
- package/lib/commonjs/utils/safeStringify.js +27 -0
- package/lib/commonjs/utils/safeStringify.js.map +1 -0
- package/lib/module/components/ClipboardTab.js +86 -0
- package/lib/module/components/ClipboardTab.js.map +1 -0
- package/lib/module/components/ConsoleLogTab.js +290 -0
- package/lib/module/components/ConsoleLogTab.js.map +1 -0
- package/lib/module/components/EnvironmentTab.js +282 -0
- package/lib/module/components/EnvironmentTab.js.map +1 -0
- package/lib/module/components/FloatPanelView.js +791 -0
- package/lib/module/components/FloatPanelView.js.map +1 -0
- package/lib/module/components/NavigationLogTab.js +126 -0
- package/lib/module/components/NavigationLogTab.js.map +1 -0
- package/lib/module/components/NetworkLogTab.js +570 -0
- package/lib/module/components/NetworkLogTab.js.map +1 -0
- package/lib/module/components/ThirdPartyLibsTab.js +91 -0
- package/lib/module/components/ThirdPartyLibsTab.js.map +1 -0
- package/lib/module/components/TrackLogTab.js +367 -0
- package/lib/module/components/TrackLogTab.js.map +1 -0
- package/lib/module/components/ZustandLogTab.js +446 -0
- package/lib/module/components/ZustandLogTab.js.map +1 -0
- package/lib/module/components/shared/CollapsibleSection.js +78 -0
- package/lib/module/components/shared/CollapsibleSection.js.map +1 -0
- package/lib/module/components/shared/CopyButton.js +58 -0
- package/lib/module/components/shared/CopyButton.js.map +1 -0
- package/lib/module/components/shared/JsonView.js +152 -0
- package/lib/module/components/shared/JsonView.js.map +1 -0
- package/lib/module/core/DebugToolkit.js +137 -0
- package/lib/module/core/DebugToolkit.js.map +1 -0
- package/lib/module/core/DebugToolkitProvider.js +58 -0
- package/lib/module/core/DebugToolkitProvider.js.map +1 -0
- package/lib/module/features/ClipboardFeature.js +12 -0
- package/lib/module/features/ClipboardFeature.js.map +1 -0
- package/lib/module/features/ConsoleLogFeature.js +93 -0
- package/lib/module/features/ConsoleLogFeature.js.map +1 -0
- package/lib/module/features/EnvironmentFeature.js +164 -0
- package/lib/module/features/EnvironmentFeature.js.map +1 -0
- package/lib/module/features/NavigationLogFeature.js +54 -0
- package/lib/module/features/NavigationLogFeature.js.map +1 -0
- package/lib/module/features/NetworkFeature.js +322 -0
- package/lib/module/features/NetworkFeature.js.map +1 -0
- package/lib/module/features/ThirdPartyLibsFeature.js +46 -0
- package/lib/module/features/ThirdPartyLibsFeature.js.map +1 -0
- package/lib/module/features/TrackFeature.js +49 -0
- package/lib/module/features/TrackFeature.js.map +1 -0
- package/lib/module/features/ZustandLogFeature.js +69 -0
- package/lib/module/features/ZustandLogFeature.js.map +1 -0
- package/lib/module/hooks/useNavigationLogger.js +74 -0
- package/lib/module/hooks/useNavigationLogger.js.map +1 -0
- package/lib/module/hooks/useSlideDetailAnimation.js +50 -0
- package/lib/module/hooks/useSlideDetailAnimation.js.map +1 -0
- package/lib/module/index.js +29 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/initialize.js +156 -0
- package/lib/module/initialize.js.map +1 -0
- package/lib/module/native/NativeDebugLibs.js +54 -0
- package/lib/module/native/NativeDebugLibs.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/module/types/index.js +4 -0
- package/lib/module/types/index.js.map +1 -0
- package/lib/module/utils/constants.js +130 -0
- package/lib/module/utils/constants.js.map +1 -0
- package/lib/module/utils/copyToComputer.js +91 -0
- package/lib/module/utils/copyToComputer.js.map +1 -0
- package/lib/module/utils/createEventChannel.js +17 -0
- package/lib/module/utils/createEventChannel.js.map +1 -0
- package/lib/module/utils/createObservableStore.js +34 -0
- package/lib/module/utils/createObservableStore.js.map +1 -0
- package/lib/module/utils/safeStringify.js +23 -0
- package/lib/module/utils/safeStringify.js.map +1 -0
- package/lib/typescript/src/components/ClipboardTab.d.ts +4 -0
- package/lib/typescript/src/components/ClipboardTab.d.ts.map +1 -0
- package/lib/typescript/src/components/ConsoleLogTab.d.ts +4 -0
- package/lib/typescript/src/components/ConsoleLogTab.d.ts.map +1 -0
- package/lib/typescript/src/components/EnvironmentTab.d.ts +4 -0
- package/lib/typescript/src/components/EnvironmentTab.d.ts.map +1 -0
- package/lib/typescript/src/components/FloatPanelView.d.ts +64 -0
- package/lib/typescript/src/components/FloatPanelView.d.ts.map +1 -0
- package/lib/typescript/src/components/NavigationLogTab.d.ts +4 -0
- package/lib/typescript/src/components/NavigationLogTab.d.ts.map +1 -0
- package/lib/typescript/src/components/NetworkLogTab.d.ts +4 -0
- package/lib/typescript/src/components/NetworkLogTab.d.ts.map +1 -0
- package/lib/typescript/src/components/ThirdPartyLibsTab.d.ts +4 -0
- package/lib/typescript/src/components/ThirdPartyLibsTab.d.ts.map +1 -0
- package/lib/typescript/src/components/TrackLogTab.d.ts +4 -0
- package/lib/typescript/src/components/TrackLogTab.d.ts.map +1 -0
- package/lib/typescript/src/components/ZustandLogTab.d.ts +4 -0
- package/lib/typescript/src/components/ZustandLogTab.d.ts.map +1 -0
- package/lib/typescript/src/components/shared/CollapsibleSection.d.ts +9 -0
- package/lib/typescript/src/components/shared/CollapsibleSection.d.ts.map +1 -0
- package/lib/typescript/src/components/shared/CopyButton.d.ts +12 -0
- package/lib/typescript/src/components/shared/CopyButton.d.ts.map +1 -0
- package/lib/typescript/src/components/shared/JsonView.d.ts +6 -0
- package/lib/typescript/src/components/shared/JsonView.d.ts.map +1 -0
- package/lib/typescript/src/core/DebugToolkit.d.ts +27 -0
- package/lib/typescript/src/core/DebugToolkit.d.ts.map +1 -0
- package/lib/typescript/src/core/DebugToolkitProvider.d.ts +18 -0
- package/lib/typescript/src/core/DebugToolkitProvider.d.ts.map +1 -0
- package/lib/typescript/src/features/ClipboardFeature.d.ts +3 -0
- package/lib/typescript/src/features/ClipboardFeature.d.ts.map +1 -0
- package/lib/typescript/src/features/ConsoleLogFeature.d.ts +7 -0
- package/lib/typescript/src/features/ConsoleLogFeature.d.ts.map +1 -0
- package/lib/typescript/src/features/EnvironmentFeature.d.ts +8 -0
- package/lib/typescript/src/features/EnvironmentFeature.d.ts.map +1 -0
- package/lib/typescript/src/features/NavigationLogFeature.d.ts +8 -0
- package/lib/typescript/src/features/NavigationLogFeature.d.ts.map +1 -0
- package/lib/typescript/src/features/NetworkFeature.d.ts +28 -0
- package/lib/typescript/src/features/NetworkFeature.d.ts.map +1 -0
- package/lib/typescript/src/features/ThirdPartyLibsFeature.d.ts +3 -0
- package/lib/typescript/src/features/ThirdPartyLibsFeature.d.ts.map +1 -0
- package/lib/typescript/src/features/TrackFeature.d.ts +12 -0
- package/lib/typescript/src/features/TrackFeature.d.ts.map +1 -0
- package/lib/typescript/src/features/ZustandLogFeature.d.ts +29 -0
- package/lib/typescript/src/features/ZustandLogFeature.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useNavigationLogger.d.ts +20 -0
- package/lib/typescript/src/hooks/useNavigationLogger.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useSlideDetailAnimation.d.ts +11 -0
- package/lib/typescript/src/hooks/useSlideDetailAnimation.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +26 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/lib/typescript/src/initialize.d.ts +51 -0
- package/lib/typescript/src/initialize.d.ts.map +1 -0
- package/lib/typescript/src/native/NativeDebugLibs.d.ts +11 -0
- package/lib/typescript/src/native/NativeDebugLibs.d.ts.map +1 -0
- package/lib/typescript/src/types/index.d.ts +112 -0
- package/lib/typescript/src/types/index.d.ts.map +1 -0
- package/lib/typescript/src/utils/constants.d.ts +96 -0
- package/lib/typescript/src/utils/constants.d.ts.map +1 -0
- package/lib/typescript/src/utils/copyToComputer.d.ts +30 -0
- package/lib/typescript/src/utils/copyToComputer.d.ts.map +1 -0
- package/lib/typescript/src/utils/createEventChannel.d.ts +7 -0
- package/lib/typescript/src/utils/createEventChannel.d.ts.map +1 -0
- package/lib/typescript/src/utils/createObservableStore.d.ts +9 -0
- package/lib/typescript/src/utils/createObservableStore.d.ts.map +1 -0
- package/lib/typescript/src/utils/safeStringify.d.ts +6 -0
- package/lib/typescript/src/utils/safeStringify.d.ts.map +1 -0
- package/package.json +63 -24
- package/src/components/ClipboardTab.tsx +81 -0
- package/src/components/ConsoleLogTab.tsx +209 -0
- package/src/components/EnvironmentTab.tsx +276 -0
- package/src/components/FloatPanelView.tsx +714 -0
- package/src/components/NavigationLogTab.tsx +66 -0
- package/src/components/NetworkLogTab.tsx +411 -0
- package/src/components/ThirdPartyLibsTab.tsx +63 -0
- package/src/components/TrackLogTab.tsx +245 -0
- package/src/components/ZustandLogTab.tsx +305 -0
- package/src/components/shared/CollapsibleSection.tsx +78 -0
- package/src/components/shared/CopyButton.tsx +68 -0
- package/src/components/shared/JsonView.tsx +125 -0
- package/src/core/DebugToolkit.tsx +174 -0
- package/src/core/DebugToolkitProvider.tsx +89 -0
- package/src/features/ClipboardFeature.ts +11 -0
- package/src/features/ConsoleLogFeature.ts +118 -0
- package/src/features/EnvironmentFeature.ts +194 -0
- package/src/features/NavigationLogFeature.ts +74 -0
- package/src/features/NetworkFeature.ts +488 -0
- package/src/features/ThirdPartyLibsFeature.ts +42 -0
- package/src/features/TrackFeature.ts +69 -0
- package/src/features/ZustandLogFeature.ts +127 -0
- package/src/hooks/useNavigationLogger.ts +107 -0
- package/src/hooks/useSlideDetailAnimation.ts +45 -0
- package/src/index.ts +52 -0
- package/src/initialize.ts +214 -0
- package/src/native/NativeDebugLibs.ts +74 -0
- package/src/types/index.ts +138 -0
- package/src/utils/constants.ts +91 -0
- package/src/utils/copyToComputer.ts +104 -0
- package/src/utils/createEventChannel.ts +22 -0
- package/src/utils/createObservableStore.ts +42 -0
- package/src/utils/safeStringify.ts +25 -0
- package/.cursor/rules/react-native.mdc +0 -41
- package/README.zh-CN.md +0 -230
- package/android/build.gradle +0 -34
- package/android/src/main/AndroidManifest.xml +0 -8
- package/android/src/main/java/com/reactnative/debuglibs/BuildTypeModule.java +0 -44
- package/android/src/main/java/com/reactnative/debuglibs/BuildTypePackage.java +0 -25
- package/android/src/main/java/com/reactnative/debuglibs/RNDebugLibsModule.java +0 -75
- package/android/src/main/java/com/reactnative/debuglibs/RNDebugLibsPackage.java +0 -28
- package/index.js +0 -41
- package/ios/BuildTypeModule.h +0 -9
- package/ios/BuildTypeModule.m +0 -42
- package/ios/RNDebugLibs.h +0 -10
- package/ios/RNDebugLibs.m +0 -79
- package/lib/DebugToolKit.js +0 -126
- package/lib/EnvironmentManager.ts +0 -80
- package/lib/NativeDebugLibs.js +0 -67
- package/lib/features/ConsoleLogFeature.js +0 -70
- package/lib/features/NavigationLogFeature.js +0 -45
- package/lib/features/NetworkFeature.js +0 -389
- package/lib/features/PerformanceFeature.js +0 -390
- package/lib/features/ThirdPartyLibsFeature.js +0 -63
- package/lib/features/TrackFeature.js +0 -94
- package/lib/features/ZustandLogFeature.js +0 -44
- package/lib/hooks/useNavigationLogger.js +0 -92
- package/lib/index.js +0 -114
- package/lib/navigation/NavigationLogger.js +0 -1
- package/lib/types/TrackTypes.ts +0 -92
- package/lib/utils/DebugConst.js +0 -67
- package/lib/utils/StorageUtils.js +0 -80
- package/lib/views/ConsoleLogDetails.js +0 -314
- package/lib/views/FloatPanelView.js +0 -697
- package/lib/views/HttpLogDetails.js +0 -648
- package/lib/views/NavigationLogDetails.js +0 -302
- package/lib/views/RestartModal.js +0 -75
- package/lib/views/SubViewConsoleLogs.js +0 -209
- package/lib/views/SubViewEnvironment.js +0 -73
- package/lib/views/SubViewHTTPLogs.js +0 -235
- package/lib/views/SubViewNavigationLogs.js +0 -199
- package/lib/views/SubViewPerformance.js +0 -515
- package/lib/views/SubViewThirdPartyLibs.js +0 -239
- package/lib/views/SubViewTrackLogs.js +0 -318
- package/lib/views/SubViewZustandLogs.js +0 -279
- package/lib/views/TabView.js +0 -66
- package/lib/views/TrackLogDetails.js +0 -481
- package/lib/views/ZustandLogDetails.js +0 -355
- package/react-native-debug-toolkit.podspec +0 -25
- package/react-native.config.js +0 -18
|
@@ -1,239 +0,0 @@
|
|
|
1
|
-
import React, { useState, useEffect } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
View,
|
|
4
|
-
Text,
|
|
5
|
-
StyleSheet,
|
|
6
|
-
FlatList,
|
|
7
|
-
TouchableOpacity,
|
|
8
|
-
TextInput,
|
|
9
|
-
Platform,
|
|
10
|
-
} from 'react-native';
|
|
11
|
-
|
|
12
|
-
const SubViewThirdPartyLibs = ({ libraries = [] }) => {
|
|
13
|
-
const [expandedLibs, setExpandedLibs] = useState(new Set());
|
|
14
|
-
const [actionParams, setActionParams] = useState({});
|
|
15
|
-
|
|
16
|
-
// Set all libraries to expanded by default and set default product ID
|
|
17
|
-
useEffect(() => {
|
|
18
|
-
// Create a set of all library IDs to set them as expanded
|
|
19
|
-
const allLibIds = new Set(libraries.map(lib => lib.id));
|
|
20
|
-
setExpandedLibs(allLibIds);
|
|
21
|
-
|
|
22
|
-
// Initialize default product ID for all actions that might need it
|
|
23
|
-
const defaultParams = {};
|
|
24
|
-
libraries.forEach(lib => {
|
|
25
|
-
lib.actions.forEach(action => {
|
|
26
|
-
if (action.hasParam) {
|
|
27
|
-
defaultParams[`${lib.id}_${action.id}`] = 'default';
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
});
|
|
31
|
-
setActionParams(defaultParams);
|
|
32
|
-
}, [libraries]);
|
|
33
|
-
|
|
34
|
-
// Handle lib expansion/collapse
|
|
35
|
-
const toggleLibExpand = (libId) => {
|
|
36
|
-
setExpandedLibs(prev => {
|
|
37
|
-
const newSet = new Set(prev);
|
|
38
|
-
if (newSet.has(libId)) {
|
|
39
|
-
newSet.delete(libId);
|
|
40
|
-
} else {
|
|
41
|
-
newSet.add(libId);
|
|
42
|
-
}
|
|
43
|
-
return newSet;
|
|
44
|
-
});
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
// Execute library action
|
|
48
|
-
const executeAction = (action, libId) => {
|
|
49
|
-
try {
|
|
50
|
-
if (action.hasParam) {
|
|
51
|
-
// Get parameter value (if needed)
|
|
52
|
-
const paramValue = actionParams[`${libId}_${action.id}`] || 'default';
|
|
53
|
-
action.method(paramValue);
|
|
54
|
-
} else {
|
|
55
|
-
action.method();
|
|
56
|
-
}
|
|
57
|
-
// No alerts shown as per requirement
|
|
58
|
-
} catch (error) {
|
|
59
|
-
// Silent error handling as per requirement
|
|
60
|
-
console.error(`Failed to execute ${action.label}:`, error);
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
// Handle param input change
|
|
65
|
-
const handleParamChange = (libId, actionId, value) => {
|
|
66
|
-
setActionParams({
|
|
67
|
-
...actionParams,
|
|
68
|
-
[`${libId}_${actionId}`]: value,
|
|
69
|
-
});
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
// Render a single library card
|
|
73
|
-
const renderLibraryItem = ({ item }) => {
|
|
74
|
-
const isExpanded = expandedLibs.has(item.id);
|
|
75
|
-
const isPlatformSupported = item.platform === 'both' ||
|
|
76
|
-
item.platform === Platform.OS;
|
|
77
|
-
|
|
78
|
-
if (!isPlatformSupported) return null;
|
|
79
|
-
|
|
80
|
-
return (
|
|
81
|
-
<View style={styles.libraryCard}>
|
|
82
|
-
<TouchableOpacity
|
|
83
|
-
style={styles.libraryHeader}
|
|
84
|
-
onPress={() => toggleLibExpand(item.id)}>
|
|
85
|
-
<View style={styles.libraryTitle}>
|
|
86
|
-
<Text style={styles.libraryName}>{item.name}</Text>
|
|
87
|
-
<Text style={styles.platformBadge}>
|
|
88
|
-
{item.platform === 'both' ? 'iOS & Android' : item.platform}
|
|
89
|
-
</Text>
|
|
90
|
-
</View>
|
|
91
|
-
<Text style={styles.expandIcon}>{isExpanded ? '▼' : '▶'}</Text>
|
|
92
|
-
</TouchableOpacity>
|
|
93
|
-
|
|
94
|
-
<Text style={styles.libraryDescription}>{item.description}</Text>
|
|
95
|
-
|
|
96
|
-
{isExpanded && (
|
|
97
|
-
<View style={styles.actionsContainer}>
|
|
98
|
-
{item.actions.map((action) => (
|
|
99
|
-
<View key={action.id} style={styles.actionItem}>
|
|
100
|
-
{action.hasParam && (
|
|
101
|
-
<TextInput
|
|
102
|
-
style={styles.paramInput}
|
|
103
|
-
placeholder={action.paramPlaceholder || 'Parameter'}
|
|
104
|
-
value={actionParams[`${item.id}_${action.id}`] || 'default'}
|
|
105
|
-
onChangeText={(text) =>
|
|
106
|
-
handleParamChange(item.id, action.id, text)
|
|
107
|
-
}
|
|
108
|
-
/>
|
|
109
|
-
)}
|
|
110
|
-
<TouchableOpacity
|
|
111
|
-
style={styles.actionButton}
|
|
112
|
-
onPress={() => executeAction(action, item.id)}>
|
|
113
|
-
<Text style={styles.actionButtonText}>{action.label}</Text>
|
|
114
|
-
</TouchableOpacity>
|
|
115
|
-
</View>
|
|
116
|
-
))}
|
|
117
|
-
</View>
|
|
118
|
-
)}
|
|
119
|
-
</View>
|
|
120
|
-
);
|
|
121
|
-
};
|
|
122
|
-
|
|
123
|
-
// Filter platform-supported libraries
|
|
124
|
-
const supportedLibraries = libraries.filter(
|
|
125
|
-
lib => lib.platform === 'both' || lib.platform === Platform.OS
|
|
126
|
-
);
|
|
127
|
-
|
|
128
|
-
return (
|
|
129
|
-
<View style={styles.container}>
|
|
130
|
-
{supportedLibraries.length === 0 ? (
|
|
131
|
-
<Text style={styles.emptyText}>
|
|
132
|
-
No debug libraries available for this platform
|
|
133
|
-
</Text>
|
|
134
|
-
) : (
|
|
135
|
-
<FlatList
|
|
136
|
-
data={supportedLibraries}
|
|
137
|
-
renderItem={renderLibraryItem}
|
|
138
|
-
keyExtractor={(item) => item.id}
|
|
139
|
-
contentContainerStyle={styles.listContent}
|
|
140
|
-
/>
|
|
141
|
-
)}
|
|
142
|
-
</View>
|
|
143
|
-
);
|
|
144
|
-
};
|
|
145
|
-
|
|
146
|
-
const styles = StyleSheet.create({
|
|
147
|
-
container: {
|
|
148
|
-
flex: 1,
|
|
149
|
-
backgroundColor: '#fff',
|
|
150
|
-
},
|
|
151
|
-
listContent: {
|
|
152
|
-
padding: 12,
|
|
153
|
-
},
|
|
154
|
-
emptyText: {
|
|
155
|
-
textAlign: 'center',
|
|
156
|
-
color: '#999',
|
|
157
|
-
marginTop: 20,
|
|
158
|
-
fontSize: 16,
|
|
159
|
-
},
|
|
160
|
-
libraryCard: {
|
|
161
|
-
backgroundColor: '#f8f9fa',
|
|
162
|
-
borderRadius: 8,
|
|
163
|
-
borderWidth: 1,
|
|
164
|
-
borderColor: '#e9ecef',
|
|
165
|
-
marginBottom: 16,
|
|
166
|
-
padding: 12,
|
|
167
|
-
elevation: 1,
|
|
168
|
-
shadowColor: '#000',
|
|
169
|
-
shadowOffset: { width: 0, height: 1 },
|
|
170
|
-
shadowOpacity: 0.1,
|
|
171
|
-
shadowRadius: 1,
|
|
172
|
-
},
|
|
173
|
-
libraryHeader: {
|
|
174
|
-
flexDirection: 'row',
|
|
175
|
-
justifyContent: 'space-between',
|
|
176
|
-
alignItems: 'center',
|
|
177
|
-
},
|
|
178
|
-
libraryTitle: {
|
|
179
|
-
flexDirection: 'row',
|
|
180
|
-
alignItems: 'center',
|
|
181
|
-
flex: 1,
|
|
182
|
-
},
|
|
183
|
-
libraryName: {
|
|
184
|
-
fontSize: 18,
|
|
185
|
-
fontWeight: 'bold',
|
|
186
|
-
color: '#333',
|
|
187
|
-
marginRight: 8,
|
|
188
|
-
},
|
|
189
|
-
platformBadge: {
|
|
190
|
-
fontSize: 12,
|
|
191
|
-
color: '#666',
|
|
192
|
-
backgroundColor: '#e9ecef',
|
|
193
|
-
paddingHorizontal: 8,
|
|
194
|
-
paddingVertical: 2,
|
|
195
|
-
borderRadius: 12,
|
|
196
|
-
overflow: 'hidden',
|
|
197
|
-
},
|
|
198
|
-
expandIcon: {
|
|
199
|
-
fontSize: 14,
|
|
200
|
-
color: '#666',
|
|
201
|
-
},
|
|
202
|
-
libraryDescription: {
|
|
203
|
-
marginTop: 8,
|
|
204
|
-
marginBottom: 12,
|
|
205
|
-
color: '#666',
|
|
206
|
-
fontSize: 14,
|
|
207
|
-
lineHeight: 20,
|
|
208
|
-
},
|
|
209
|
-
actionsContainer: {
|
|
210
|
-
marginTop: 8,
|
|
211
|
-
borderTopWidth: 1,
|
|
212
|
-
borderTopColor: '#eee',
|
|
213
|
-
paddingTop: 12,
|
|
214
|
-
},
|
|
215
|
-
actionItem: {
|
|
216
|
-
marginBottom: 8,
|
|
217
|
-
},
|
|
218
|
-
paramInput: {
|
|
219
|
-
borderWidth: 1,
|
|
220
|
-
borderColor: '#ddd',
|
|
221
|
-
borderRadius: 4,
|
|
222
|
-
padding: 8,
|
|
223
|
-
marginBottom: 8,
|
|
224
|
-
fontSize: 14,
|
|
225
|
-
},
|
|
226
|
-
actionButton: {
|
|
227
|
-
backgroundColor: '#0D96F2',
|
|
228
|
-
padding: 10,
|
|
229
|
-
borderRadius: 4,
|
|
230
|
-
alignItems: 'center',
|
|
231
|
-
},
|
|
232
|
-
actionButtonText: {
|
|
233
|
-
color: '#fff',
|
|
234
|
-
fontWeight: '500',
|
|
235
|
-
fontSize: 14,
|
|
236
|
-
},
|
|
237
|
-
});
|
|
238
|
-
|
|
239
|
-
export default SubViewThirdPartyLibs;
|
|
@@ -1,318 +0,0 @@
|
|
|
1
|
-
import React, { useState } from 'react'
|
|
2
|
-
import {
|
|
3
|
-
View,
|
|
4
|
-
Text,
|
|
5
|
-
StyleSheet,
|
|
6
|
-
FlatList,
|
|
7
|
-
TouchableOpacity,
|
|
8
|
-
} from 'react-native'
|
|
9
|
-
import TrackLogDetails from './TrackLogDetails'
|
|
10
|
-
|
|
11
|
-
const SubViewTrackLogs = ({ logs = [] }) => {
|
|
12
|
-
const [selectedLog, setSelectedLog] = useState(null)
|
|
13
|
-
|
|
14
|
-
const getEventColor = (eventName) => {
|
|
15
|
-
if (eventName?.includes('error')) return '#ff4444'
|
|
16
|
-
if (eventName?.includes('click')) return '#4CAF50'
|
|
17
|
-
if (eventName?.includes('view')) return '#2196F3'
|
|
18
|
-
if (eventName?.includes('search')) return '#FF9800'
|
|
19
|
-
return '#9C27B0'
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
const getTimeAgo = (timestamp) => {
|
|
23
|
-
const now = new Date()
|
|
24
|
-
const eventTime = new Date(timestamp)
|
|
25
|
-
const diffMs = now - eventTime
|
|
26
|
-
const diffSeconds = Math.floor(diffMs / 1000)
|
|
27
|
-
const diffMinutes = Math.floor(diffSeconds / 60)
|
|
28
|
-
const diffHours = Math.floor(diffMinutes / 60)
|
|
29
|
-
|
|
30
|
-
if (diffSeconds < 60) {
|
|
31
|
-
return `${diffSeconds}s ago`
|
|
32
|
-
} else if (diffMinutes < 60) {
|
|
33
|
-
return `${diffMinutes}m ago`
|
|
34
|
-
} else if (diffHours < 24) {
|
|
35
|
-
return `${diffHours}h ago`
|
|
36
|
-
} else {
|
|
37
|
-
const diffDays = Math.floor(diffHours / 24)
|
|
38
|
-
return `${diffDays}d ago`
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
const renderLogItem = ({ item }) => {
|
|
43
|
-
const eventColor = getEventColor(item.eventName)
|
|
44
|
-
|
|
45
|
-
return (
|
|
46
|
-
<TouchableOpacity
|
|
47
|
-
style={styles.logItem}
|
|
48
|
-
onPress={() => setSelectedLog(item)}>
|
|
49
|
-
<View style={styles.logItemContainer}>
|
|
50
|
-
<View
|
|
51
|
-
style={[styles.eventIndicator, { backgroundColor: eventColor }]}
|
|
52
|
-
/>
|
|
53
|
-
|
|
54
|
-
<View style={styles.logContent}>
|
|
55
|
-
<View style={styles.eventRow}>
|
|
56
|
-
<Text style={[styles.eventName, { color: eventColor }]}>
|
|
57
|
-
{item.eventName || 'Unknown Event'}
|
|
58
|
-
</Text>
|
|
59
|
-
{item.entityType && (
|
|
60
|
-
<Text style={styles.entityType}>
|
|
61
|
-
{item.entityType}
|
|
62
|
-
</Text>
|
|
63
|
-
)}
|
|
64
|
-
</View>
|
|
65
|
-
|
|
66
|
-
{item.entityName && (
|
|
67
|
-
<Text style={styles.entityName} numberOfLines={1}>
|
|
68
|
-
{item.entityName}
|
|
69
|
-
</Text>
|
|
70
|
-
)}
|
|
71
|
-
|
|
72
|
-
{item.frontOperation && (
|
|
73
|
-
<Text style={styles.operation} numberOfLines={1}>
|
|
74
|
-
Operation: {item.frontOperation}
|
|
75
|
-
</Text>
|
|
76
|
-
)}
|
|
77
|
-
|
|
78
|
-
<View style={styles.logFooter}>
|
|
79
|
-
<Text style={styles.time}>
|
|
80
|
-
{item.timestamp
|
|
81
|
-
? getTimeAgo(item.timestamp)
|
|
82
|
-
: 'Unknown time'}
|
|
83
|
-
</Text>
|
|
84
|
-
|
|
85
|
-
<View style={styles.additionalInfo}>
|
|
86
|
-
{item.pageId && (
|
|
87
|
-
<Text style={styles.pageId} numberOfLines={1}>
|
|
88
|
-
Page: {item.pageId}
|
|
89
|
-
</Text>
|
|
90
|
-
)}
|
|
91
|
-
{item.position && (
|
|
92
|
-
<Text style={styles.position}>
|
|
93
|
-
Pos: {item.position}
|
|
94
|
-
</Text>
|
|
95
|
-
)}
|
|
96
|
-
</View>
|
|
97
|
-
</View>
|
|
98
|
-
</View>
|
|
99
|
-
</View>
|
|
100
|
-
</TouchableOpacity>
|
|
101
|
-
)
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
// If a log is selected, show the details view with a back button
|
|
105
|
-
if (selectedLog) {
|
|
106
|
-
return (
|
|
107
|
-
<View style={styles.container}>
|
|
108
|
-
<View style={styles.detailsHeader}>
|
|
109
|
-
<TouchableOpacity
|
|
110
|
-
style={styles.backButton}
|
|
111
|
-
onPress={() => setSelectedLog(null)}>
|
|
112
|
-
<Text style={styles.backButtonText}>← Back</Text>
|
|
113
|
-
</TouchableOpacity>
|
|
114
|
-
<View style={styles.headerEventInfo}>
|
|
115
|
-
<Text
|
|
116
|
-
style={[
|
|
117
|
-
styles.headerEvent,
|
|
118
|
-
{ color: getEventColor(selectedLog.eventName) },
|
|
119
|
-
]}>
|
|
120
|
-
{selectedLog.eventName || 'Unknown Event'}
|
|
121
|
-
</Text>
|
|
122
|
-
{selectedLog.entityType && (
|
|
123
|
-
<Text style={styles.headerEntityType}>
|
|
124
|
-
{selectedLog.entityType}
|
|
125
|
-
</Text>
|
|
126
|
-
)}
|
|
127
|
-
</View>
|
|
128
|
-
</View>
|
|
129
|
-
<TrackLogDetails log={selectedLog} />
|
|
130
|
-
</View>
|
|
131
|
-
)
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
// Otherwise show the list view
|
|
135
|
-
return (
|
|
136
|
-
<View style={styles.container}>
|
|
137
|
-
{logs.length === 0 ? (
|
|
138
|
-
<View style={styles.emptyContainer}>
|
|
139
|
-
<Text style={styles.emptyText}>No track events logged yet</Text>
|
|
140
|
-
<Text style={styles.emptySubtext}>
|
|
141
|
-
Track events will appear here as they occur during development
|
|
142
|
-
</Text>
|
|
143
|
-
</View>
|
|
144
|
-
) : (
|
|
145
|
-
<>
|
|
146
|
-
<View style={styles.statsContainer}>
|
|
147
|
-
<Text style={styles.statsText}>
|
|
148
|
-
{logs.length} events logged
|
|
149
|
-
</Text>
|
|
150
|
-
</View>
|
|
151
|
-
<FlatList
|
|
152
|
-
data={[...logs].sort((a, b) => new Date(b.timestamp) - new Date(a.timestamp))}
|
|
153
|
-
renderItem={renderLogItem}
|
|
154
|
-
keyExtractor={(item, index) => `${item.timestamp}-${index}`}
|
|
155
|
-
style={styles.list}
|
|
156
|
-
showsVerticalScrollIndicator={true}
|
|
157
|
-
/>
|
|
158
|
-
</>
|
|
159
|
-
)}
|
|
160
|
-
</View>
|
|
161
|
-
)
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
const styles = StyleSheet.create({
|
|
165
|
-
container: {
|
|
166
|
-
flex: 1,
|
|
167
|
-
backgroundColor: '#fff',
|
|
168
|
-
},
|
|
169
|
-
list: {
|
|
170
|
-
flex: 1,
|
|
171
|
-
},
|
|
172
|
-
emptyContainer: {
|
|
173
|
-
flex: 1,
|
|
174
|
-
justifyContent: 'center',
|
|
175
|
-
alignItems: 'center',
|
|
176
|
-
padding: 40,
|
|
177
|
-
},
|
|
178
|
-
emptyText: {
|
|
179
|
-
textAlign: 'center',
|
|
180
|
-
color: '#666',
|
|
181
|
-
fontSize: 16,
|
|
182
|
-
fontWeight: '500',
|
|
183
|
-
marginBottom: 8,
|
|
184
|
-
},
|
|
185
|
-
emptySubtext: {
|
|
186
|
-
textAlign: 'center',
|
|
187
|
-
color: '#999',
|
|
188
|
-
fontSize: 14,
|
|
189
|
-
},
|
|
190
|
-
statsContainer: {
|
|
191
|
-
padding: 12,
|
|
192
|
-
borderBottomWidth: 1,
|
|
193
|
-
borderBottomColor: '#eee',
|
|
194
|
-
backgroundColor: '#f8f9fa',
|
|
195
|
-
},
|
|
196
|
-
statsText: {
|
|
197
|
-
fontSize: 12,
|
|
198
|
-
color: '#666',
|
|
199
|
-
fontWeight: '500',
|
|
200
|
-
},
|
|
201
|
-
logItem: {
|
|
202
|
-
borderBottomWidth: 1,
|
|
203
|
-
borderBottomColor: '#eee',
|
|
204
|
-
},
|
|
205
|
-
logItemContainer: {
|
|
206
|
-
flexDirection: 'row',
|
|
207
|
-
padding: 12,
|
|
208
|
-
},
|
|
209
|
-
eventIndicator: {
|
|
210
|
-
width: 4,
|
|
211
|
-
borderRadius: 2,
|
|
212
|
-
marginRight: 12,
|
|
213
|
-
},
|
|
214
|
-
logContent: {
|
|
215
|
-
flex: 1,
|
|
216
|
-
},
|
|
217
|
-
eventRow: {
|
|
218
|
-
flexDirection: 'row',
|
|
219
|
-
alignItems: 'center',
|
|
220
|
-
marginBottom: 4,
|
|
221
|
-
},
|
|
222
|
-
eventName: {
|
|
223
|
-
fontSize: 15,
|
|
224
|
-
fontWeight: 'bold',
|
|
225
|
-
marginRight: 8,
|
|
226
|
-
},
|
|
227
|
-
entityType: {
|
|
228
|
-
fontSize: 11,
|
|
229
|
-
backgroundColor: '#f0f0f0',
|
|
230
|
-
color: '#666',
|
|
231
|
-
paddingHorizontal: 6,
|
|
232
|
-
paddingVertical: 2,
|
|
233
|
-
borderRadius: 6,
|
|
234
|
-
fontWeight: '500',
|
|
235
|
-
},
|
|
236
|
-
entityName: {
|
|
237
|
-
fontSize: 14,
|
|
238
|
-
color: '#333',
|
|
239
|
-
marginBottom: 4,
|
|
240
|
-
fontWeight: '500',
|
|
241
|
-
},
|
|
242
|
-
operation: {
|
|
243
|
-
fontSize: 13,
|
|
244
|
-
color: '#666',
|
|
245
|
-
marginBottom: 6,
|
|
246
|
-
fontStyle: 'italic',
|
|
247
|
-
},
|
|
248
|
-
logFooter: {
|
|
249
|
-
flexDirection: 'row',
|
|
250
|
-
justifyContent: 'space-between',
|
|
251
|
-
alignItems: 'flex-end',
|
|
252
|
-
},
|
|
253
|
-
time: {
|
|
254
|
-
fontSize: 12,
|
|
255
|
-
color: '#999',
|
|
256
|
-
},
|
|
257
|
-
additionalInfo: {
|
|
258
|
-
flexDirection: 'row',
|
|
259
|
-
alignItems: 'center',
|
|
260
|
-
gap: 8,
|
|
261
|
-
},
|
|
262
|
-
pageId: {
|
|
263
|
-
fontSize: 11,
|
|
264
|
-
color: '#666',
|
|
265
|
-
backgroundColor: '#f8f9fa',
|
|
266
|
-
paddingHorizontal: 4,
|
|
267
|
-
paddingVertical: 1,
|
|
268
|
-
borderRadius: 3,
|
|
269
|
-
maxWidth: 80,
|
|
270
|
-
},
|
|
271
|
-
position: {
|
|
272
|
-
fontSize: 11,
|
|
273
|
-
color: '#666',
|
|
274
|
-
backgroundColor: '#f8f9fa',
|
|
275
|
-
paddingHorizontal: 4,
|
|
276
|
-
paddingVertical: 1,
|
|
277
|
-
borderRadius: 3,
|
|
278
|
-
},
|
|
279
|
-
detailsHeader: {
|
|
280
|
-
flexDirection: 'row',
|
|
281
|
-
alignItems: 'center',
|
|
282
|
-
padding: 15,
|
|
283
|
-
borderBottomWidth: 1,
|
|
284
|
-
borderBottomColor: '#eee',
|
|
285
|
-
backgroundColor: '#f8f9fa',
|
|
286
|
-
},
|
|
287
|
-
backButton: {
|
|
288
|
-
paddingHorizontal: 10,
|
|
289
|
-
paddingVertical: 5,
|
|
290
|
-
borderRadius: 4,
|
|
291
|
-
backgroundColor: '#eee',
|
|
292
|
-
marginRight: 10,
|
|
293
|
-
},
|
|
294
|
-
backButtonText: {
|
|
295
|
-
color: '#333',
|
|
296
|
-
fontWeight: '500',
|
|
297
|
-
},
|
|
298
|
-
headerEventInfo: {
|
|
299
|
-
flexDirection: 'row',
|
|
300
|
-
alignItems: 'center',
|
|
301
|
-
},
|
|
302
|
-
headerEvent: {
|
|
303
|
-
fontSize: 16,
|
|
304
|
-
fontWeight: 'bold',
|
|
305
|
-
marginRight: 10,
|
|
306
|
-
},
|
|
307
|
-
headerEntityType: {
|
|
308
|
-
fontSize: 12,
|
|
309
|
-
backgroundColor: '#f0f0f0',
|
|
310
|
-
color: '#666',
|
|
311
|
-
paddingHorizontal: 8,
|
|
312
|
-
paddingVertical: 3,
|
|
313
|
-
borderRadius: 8,
|
|
314
|
-
fontWeight: '500',
|
|
315
|
-
},
|
|
316
|
-
})
|
|
317
|
-
|
|
318
|
-
export default SubViewTrackLogs
|