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
package/lib/index.js
DELETED
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
import DebugToolKit from './DebugToolKit'
|
|
2
|
-
import { createNetworkFeature } from './features/NetworkFeature'
|
|
3
|
-
// import { createPerformanceFeature} from './features/PerformanceFeature'
|
|
4
|
-
import { createConsoleLogFeature } from './features/ConsoleLogFeature'
|
|
5
|
-
import { createZustandLogFeature, zustandLogMiddleware } from './features/ZustandLogFeature'
|
|
6
|
-
import { createNavigationLogFeature, addNavigationLog } from './features/NavigationLogFeature'
|
|
7
|
-
import { createThirdPartyLibsFeature } from './features/ThirdPartyLibsFeature'
|
|
8
|
-
import { createTrackFeature, addTrackLog } from './features/TrackFeature'
|
|
9
|
-
import NativeDebugLibs from './NativeDebugLibs'
|
|
10
|
-
|
|
11
|
-
// Registry mapping feature names (strings) to their creator functions
|
|
12
|
-
const featureRegistry = {
|
|
13
|
-
network: createNetworkFeature,
|
|
14
|
-
track: createTrackFeature,
|
|
15
|
-
console: createConsoleLogFeature,
|
|
16
|
-
// performance: createPerformanceFeature,
|
|
17
|
-
zustand: createZustandLogFeature,
|
|
18
|
-
navigation: createNavigationLogFeature,
|
|
19
|
-
thirdPartyLibs: createThirdPartyLibsFeature,
|
|
20
|
-
// Add other built-in features here
|
|
21
|
-
// 'storage': createStorageFeature,
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
// List of default features (can use strings now)
|
|
25
|
-
const defaultFeatures = ['network', 'track', 'navigation','zustand', 'thirdPartyLibs', 'console']
|
|
26
|
-
|
|
27
|
-
// Export the debug mode status - this is used by the app
|
|
28
|
-
// const isDebugMode = NativeDebugLibs.isDebugBuild();
|
|
29
|
-
const isDebugMode = true
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* Initializes and shows the Debug ToolKit panel with specified features.
|
|
33
|
-
* Only runs in debug mode.
|
|
34
|
-
* Features can be specified as strings (e.g., 'network') or creator functions.
|
|
35
|
-
* @param {Array<string|Function>} features - Array of feature names (strings) or creator functions. Defaults to standard features.
|
|
36
|
-
* @param {Object} options - Additional options like doraemonProductId for third-party debug libraries
|
|
37
|
-
*/
|
|
38
|
-
export function initializeDebugToolkit(features = defaultFeatures, options = {}) {
|
|
39
|
-
// Create instance but it will internally handle debug mode check
|
|
40
|
-
try {
|
|
41
|
-
const debugToolKit = new DebugToolKit();
|
|
42
|
-
|
|
43
|
-
// If not in debug mode, the class methods won't do anything
|
|
44
|
-
if (!isDebugMode) {
|
|
45
|
-
return debugToolKit;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
// Initialize third-party debug libraries if configured
|
|
49
|
-
if (options.doraemonProductId) {
|
|
50
|
-
NativeDebugLibs.installDoraemonKit(options.doraemonProductId);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
features.forEach(featureIdentifier => {
|
|
54
|
-
let feature = null;
|
|
55
|
-
let featureCreator = null;
|
|
56
|
-
|
|
57
|
-
if (typeof featureIdentifier === 'string') {
|
|
58
|
-
// It's a string, look it up in the registry
|
|
59
|
-
featureCreator = featureRegistry[featureIdentifier];
|
|
60
|
-
if (!featureCreator) {
|
|
61
|
-
console.warn(`[DebugToolKit] Unknown feature identifier string: "${featureIdentifier}". Skipping.`);
|
|
62
|
-
return; // Skip this identifier
|
|
63
|
-
}
|
|
64
|
-
feature = featureCreator();
|
|
65
|
-
} else if (typeof featureIdentifier === 'function') {
|
|
66
|
-
// It's a function, assume it's a creator
|
|
67
|
-
featureCreator = featureIdentifier;
|
|
68
|
-
try {
|
|
69
|
-
feature = featureCreator();
|
|
70
|
-
} catch (e) {
|
|
71
|
-
console.error(`[DebugToolKit] Error calling feature creator function:`, e);
|
|
72
|
-
return; // Skip if creator fails
|
|
73
|
-
}
|
|
74
|
-
} else if (typeof featureIdentifier === 'object' && featureIdentifier !== null && featureIdentifier.name) {
|
|
75
|
-
// It might be a pre-created feature object
|
|
76
|
-
feature = featureIdentifier;
|
|
77
|
-
console.warn(`[DebugToolKit] Passing pre-created feature objects is supported but using strings or creators is recommended.`);
|
|
78
|
-
} else {
|
|
79
|
-
console.warn('[DebugToolKit] Invalid feature identifier type:', typeof featureIdentifier, featureIdentifier, '. Skipping.');
|
|
80
|
-
return; // Skip invalid types
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
if (feature) {
|
|
84
|
-
debugToolKit.addFeature(feature);
|
|
85
|
-
} else {
|
|
86
|
-
// This case might happen if a creator function returns null/undefined
|
|
87
|
-
console.warn(`[DebugToolKit] Feature creator for identifier "${typeof featureIdentifier === 'string' ? featureIdentifier : 'custom function'}" did not return a valid feature object.`);
|
|
88
|
-
}
|
|
89
|
-
});
|
|
90
|
-
|
|
91
|
-
debugToolKit.showDebugPanel();
|
|
92
|
-
return debugToolKit; // Return instance if needed elsewhere
|
|
93
|
-
} catch (error) {
|
|
94
|
-
console.error('[DebugToolKit] Failed to initialize:', error);
|
|
95
|
-
return null;
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
// Export existing stuff and the new initializer
|
|
100
|
-
export {
|
|
101
|
-
DebugToolKit,
|
|
102
|
-
createNetworkFeature,
|
|
103
|
-
// createPerformanceFeature,
|
|
104
|
-
createConsoleLogFeature,
|
|
105
|
-
createZustandLogFeature,
|
|
106
|
-
createNavigationLogFeature,
|
|
107
|
-
createThirdPartyLibsFeature,
|
|
108
|
-
addNavigationLog,
|
|
109
|
-
createTrackFeature,
|
|
110
|
-
addTrackLog,
|
|
111
|
-
zustandLogMiddleware, // Export middleware for use in Zustand stores
|
|
112
|
-
featureRegistry,
|
|
113
|
-
isDebugMode
|
|
114
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
package/lib/types/TrackTypes.ts
DELETED
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
// Define the entity types and names as constants for better type safety
|
|
2
|
-
export const EntityType = {
|
|
3
|
-
mine_module: 'mine_module',
|
|
4
|
-
search_module: 'search_module',
|
|
5
|
-
page_view: 'page_view',
|
|
6
|
-
error_module: 'error_module',
|
|
7
|
-
navigation: 'navigation',
|
|
8
|
-
content: 'content',
|
|
9
|
-
user_action: 'user_action',
|
|
10
|
-
} as const
|
|
11
|
-
|
|
12
|
-
export const EntityName = {
|
|
13
|
-
MINE_POST: 'MINE_POST',
|
|
14
|
-
HOME_PAGE: 'HOME_PAGE',
|
|
15
|
-
SEARCH_BAR: 'SEARCH_BAR',
|
|
16
|
-
PROFILE_PAGE: 'PROFILE_PAGE',
|
|
17
|
-
NAVIGATION_TAB: 'NAVIGATION_TAB',
|
|
18
|
-
CONTENT_ITEM: 'CONTENT_ITEM',
|
|
19
|
-
USER_BUTTON: 'USER_BUTTON',
|
|
20
|
-
} as const
|
|
21
|
-
|
|
22
|
-
export type TrackEventOptions = {
|
|
23
|
-
entityType: (typeof EntityType)[keyof typeof EntityType]
|
|
24
|
-
entityName?: (typeof EntityName)[keyof typeof EntityName]
|
|
25
|
-
pageId?: string
|
|
26
|
-
objId?: string
|
|
27
|
-
entityPath?: string
|
|
28
|
-
objType?: number
|
|
29
|
-
objPt?: string // 瀑布流作品pt
|
|
30
|
-
refPageLocation?: string
|
|
31
|
-
position?: string
|
|
32
|
-
entityLocation?: string
|
|
33
|
-
frontOperation?: string
|
|
34
|
-
sessionId?: string //搜索模块需要
|
|
35
|
-
requestId?: string //搜索模块需要
|
|
36
|
-
searchKeywored?: string //搜索模块需要
|
|
37
|
-
enSearchKeywored?: string //搜索模块需要
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
// Complete event structure that includes the event name and all tracking options
|
|
41
|
-
export type TrackEvent = {
|
|
42
|
-
eventName: string
|
|
43
|
-
timestamp: Date
|
|
44
|
-
} & TrackEventOptions
|
|
45
|
-
|
|
46
|
-
// Track feature interface
|
|
47
|
-
export interface ITrackFeature {
|
|
48
|
-
setup(): ITrackFeature
|
|
49
|
-
getData(): TrackEvent[]
|
|
50
|
-
cleanup(): void
|
|
51
|
-
logEvent(eventData: TrackEventOptions & { eventName: string }): void
|
|
52
|
-
getEventStats(): EventStats
|
|
53
|
-
addEventToBlacklist(pattern: string | RegExp): void
|
|
54
|
-
removeEventFromBlacklist(pattern: string | RegExp): void
|
|
55
|
-
clearBlacklist(): void
|
|
56
|
-
getBlacklist(): (string | RegExp)[]
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
// Event statistics structure
|
|
60
|
-
export type EventStats = {
|
|
61
|
-
[eventName: string]: {
|
|
62
|
-
count: number
|
|
63
|
-
lastSeen: Date
|
|
64
|
-
entityTypes: string[]
|
|
65
|
-
operations: string[]
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
// Common event names used in the application
|
|
70
|
-
export const CommonEventNames = {
|
|
71
|
-
LOG_ACTION_FRONT: 'log_action_front',
|
|
72
|
-
LOG_ERROR_FRONT: 'log_error_front',
|
|
73
|
-
LOG_VIEW_FRONT: 'log_view_front',
|
|
74
|
-
LOG_SEARCH_FRONT: 'log_search_front',
|
|
75
|
-
LOG_NAVIGATION_FRONT: 'log_navigation_front',
|
|
76
|
-
} as const
|
|
77
|
-
|
|
78
|
-
// Common front operations
|
|
79
|
-
export const FrontOperations = {
|
|
80
|
-
CLICK: 'click',
|
|
81
|
-
VIEW: 'view',
|
|
82
|
-
SEARCH: 'search',
|
|
83
|
-
SWIPE: 'swipe',
|
|
84
|
-
SCROLL: 'scroll',
|
|
85
|
-
ERROR: 'error',
|
|
86
|
-
NAVIGATE: 'navigate',
|
|
87
|
-
} as const
|
|
88
|
-
|
|
89
|
-
// Helper type for creating events with better type safety
|
|
90
|
-
export type CreateTrackEvent<T extends keyof typeof CommonEventNames> = {
|
|
91
|
-
eventName: (typeof CommonEventNames)[T]
|
|
92
|
-
} & TrackEventOptions
|
package/lib/utils/DebugConst.js
DELETED
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { Dimensions } from 'react-native';
|
|
2
|
-
|
|
3
|
-
const { width: screenWidth, height: screenHeight } = Dimensions.get('window');
|
|
4
|
-
|
|
5
|
-
export const IconRadius = 50;
|
|
6
|
-
export const PanelWidth = screenWidth * 0.85;
|
|
7
|
-
export const PanelHeight = screenHeight * 0.85;
|
|
8
|
-
|
|
9
|
-
export const DebugColors = {
|
|
10
|
-
white: '#FFFFFF',
|
|
11
|
-
blue: '#007AFF',
|
|
12
|
-
text: '#000000',
|
|
13
|
-
border: '#CCCCCC',
|
|
14
|
-
background: '#F5F5F5',
|
|
15
|
-
success: '#4CD964',
|
|
16
|
-
error: '#FF3B30',
|
|
17
|
-
warning: '#FF9500'
|
|
18
|
-
};
|
|
19
|
-
export const getLogLevelColor = (level) => {
|
|
20
|
-
switch (level?.toLowerCase()) {
|
|
21
|
-
case 'log':
|
|
22
|
-
return '#333'; // Dark gray for standard log
|
|
23
|
-
case 'info':
|
|
24
|
-
return '#0D96F2'; // Blue for info
|
|
25
|
-
case 'warn':
|
|
26
|
-
return '#FCA130'; // Orange for warning
|
|
27
|
-
case 'error':
|
|
28
|
-
return '#F93E3E'; // Red for error
|
|
29
|
-
default:
|
|
30
|
-
return '#666666'; // Default gray
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
export const DebugImgs = {
|
|
34
|
-
iconLink: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAADsSURBVGhD7ZgxDoMwDEV9/xvQtReoGBASYmFhYmNiYmNhYWJiQQIJqUh8y05wlAYw+T/pD5Dg9xwnhPR6vV6v1+v1er3eGvuOb7yIhxEQvjAC4hRGQJzGCIhLGAFxGSMgbmEExC2MgLiFERC3MALiFkZA3MIIiFsYAXELIyBuYQTELYyAuIURELcwAuIWRkDcwgiIWxgBcQsjIG5hBMQtjIC4hREQtzAC4hZGQNzCCIhbGAFxCyMgbmEExC2MgLiFERC3MALiFkZA3MIIiFsYAXELIyBuYQTELYyAuIURELcwAuIWRkDcwgiIW/+PYBgfhPtL9WBrfKUAAAAASUVORK5CYII='
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
// Function to get color for Zustand action types
|
|
38
|
-
export const getZustandActionColor = (action) => {
|
|
39
|
-
if (!action) return '#666666'; // Default gray
|
|
40
|
-
|
|
41
|
-
// You can customize this based on common Zustand action patterns
|
|
42
|
-
if (action.startsWith('set')) return '#0D96F2'; // Blue for setters
|
|
43
|
-
if (action.startsWith('update')) return '#4CAF50'; // Green for updates
|
|
44
|
-
if (action.startsWith('delete') || action.startsWith('remove')) return '#F93E3E'; // Red for deletions
|
|
45
|
-
if (action.startsWith('toggle')) return '#FCA130'; // Orange for toggles
|
|
46
|
-
if (action.startsWith('init')) return '#9C27B0'; // Purple for initialization
|
|
47
|
-
|
|
48
|
-
return '#0D96F2'; // Default blue for other actions
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
// Navigation action colors
|
|
52
|
-
export const getNavigationActionColor = (action) => {
|
|
53
|
-
switch (action?.toLowerCase()) {
|
|
54
|
-
case 'push':
|
|
55
|
-
return '#0D96F2'; // Blue for push
|
|
56
|
-
case 'pop':
|
|
57
|
-
return '#6E7072'; // Gray for pop
|
|
58
|
-
case 'replace':
|
|
59
|
-
return '#4CAF50'; // Green for replace
|
|
60
|
-
case 'reset':
|
|
61
|
-
return '#FCA130'; // Orange for reset
|
|
62
|
-
case 'goback':
|
|
63
|
-
return '#9C27B0'; // Purple for go back
|
|
64
|
-
default:
|
|
65
|
-
return '#0D96F2'; // Default blue for navigation
|
|
66
|
-
}
|
|
67
|
-
};
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import { MMKV } from 'react-native-mmkv';
|
|
2
|
-
|
|
3
|
-
// Create MMKV instance for storing debug logs
|
|
4
|
-
const storage = new MMKV({
|
|
5
|
-
id: 'debug-toolkit-storage',
|
|
6
|
-
encryptionKey: 'debug-toolkit-encryption-key'
|
|
7
|
-
});
|
|
8
|
-
|
|
9
|
-
// Storage keys for different features
|
|
10
|
-
const STORAGE_KEYS = {
|
|
11
|
-
CONSOLE_LOGS: 'console_logs',
|
|
12
|
-
NETWORK_LOGS: 'network_logs',
|
|
13
|
-
PERFORMANCE_DATA: 'performance_data',
|
|
14
|
-
ZUSTAND_LOGS: 'zustand_logs',
|
|
15
|
-
NAVIGATION_LOGS: 'navigation_logs',
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Utility class for storing and retrieving logs using MMKV
|
|
20
|
-
*/
|
|
21
|
-
export class StorageUtils {
|
|
22
|
-
/**
|
|
23
|
-
* Save data to MMKV storage
|
|
24
|
-
* @param {string} key - Storage key
|
|
25
|
-
* @param {any} data - Data to store
|
|
26
|
-
*/
|
|
27
|
-
static saveData(key, data) {
|
|
28
|
-
try {
|
|
29
|
-
const jsonString = JSON.stringify(data);
|
|
30
|
-
storage.set(key, jsonString);
|
|
31
|
-
} catch (error) {
|
|
32
|
-
console.error(`Error saving data for key ${key}:`, error);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Retrieve data from MMKV storage
|
|
38
|
-
* @param {string} key - Storage key
|
|
39
|
-
* @param {any} defaultValue - Default value if data doesn't exist
|
|
40
|
-
* @returns {any} - Retrieved data or default value
|
|
41
|
-
*/
|
|
42
|
-
static getData(key, defaultValue = null) {
|
|
43
|
-
try {
|
|
44
|
-
const jsonString = storage.getString(key);
|
|
45
|
-
if (!jsonString) return defaultValue;
|
|
46
|
-
return JSON.parse(jsonString);
|
|
47
|
-
} catch (error) {
|
|
48
|
-
console.error(`Error retrieving data for key ${key}:`, error);
|
|
49
|
-
return defaultValue;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* Delete data from MMKV storage
|
|
55
|
-
* @param {string} key - Storage key
|
|
56
|
-
*/
|
|
57
|
-
static deleteData(key) {
|
|
58
|
-
try {
|
|
59
|
-
storage.delete(key);
|
|
60
|
-
} catch (error) {
|
|
61
|
-
console.error(`Error deleting data for key ${key}:`, error);
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* Clear all debug toolkit data from storage
|
|
67
|
-
*/
|
|
68
|
-
static clearAllData() {
|
|
69
|
-
try {
|
|
70
|
-
Object.values(STORAGE_KEYS).forEach(key => {
|
|
71
|
-
storage.delete(key);
|
|
72
|
-
});
|
|
73
|
-
} catch (error) {
|
|
74
|
-
console.error('Error clearing all data:', error);
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
// Export storage keys for use in features
|
|
80
|
-
export { STORAGE_KEYS };
|
|
@@ -1,314 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import { View, Text, StyleSheet, Clipboard } from 'react-native'
|
|
3
|
-
import { ScrollView, Pressable } from 'react-native'
|
|
4
|
-
import JSONTree from 'react-native-json-tree'
|
|
5
|
-
|
|
6
|
-
// Re-using the theme from HttpLogDetails for consistency
|
|
7
|
-
const theme = {
|
|
8
|
-
scheme: 'monokai',
|
|
9
|
-
author: 'wimer hazenberg (http://www.monokai.nl)',
|
|
10
|
-
base00: '#272822',
|
|
11
|
-
base01: '#383830',
|
|
12
|
-
base02: '#49483e',
|
|
13
|
-
base03: '#75715e',
|
|
14
|
-
base04: '#a59f85',
|
|
15
|
-
base05: '#f8f8f2',
|
|
16
|
-
base06: '#f5f4f1',
|
|
17
|
-
base07: '#f9f8f5',
|
|
18
|
-
base08: '#f92672',
|
|
19
|
-
base09: '#fd971f',
|
|
20
|
-
base0A: '#f4bf75',
|
|
21
|
-
base0B: '#a6e22e',
|
|
22
|
-
base0C: '#a1efe4',
|
|
23
|
-
base0D: '#66d9ef',
|
|
24
|
-
base0E: '#ae81ff',
|
|
25
|
-
base0F: '#cc6633'
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
const CopyButton = ({ text, style }) => {
|
|
29
|
-
const [copied, setCopied] = React.useState(false)
|
|
30
|
-
|
|
31
|
-
const handleCopy = async () => {
|
|
32
|
-
await Clipboard.setString(text)
|
|
33
|
-
setCopied(true)
|
|
34
|
-
setTimeout(() => setCopied(false), 2000)
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
return (
|
|
38
|
-
<Pressable style={[styles.copyButton, style]} onPress={handleCopy}>
|
|
39
|
-
<Text style={styles.copyButtonText}>{copied ? 'Copied!' : 'Copy'}</Text>
|
|
40
|
-
</Pressable>
|
|
41
|
-
)
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
const CollapsibleSection = ({ title, children, initiallyExpanded = false }) => {
|
|
45
|
-
const [expanded, setExpanded] = React.useState(initiallyExpanded)
|
|
46
|
-
|
|
47
|
-
return (
|
|
48
|
-
<View style={styles.collapsibleSection}>
|
|
49
|
-
<Pressable
|
|
50
|
-
style={styles.sectionHeader}
|
|
51
|
-
onPress={() => setExpanded(!expanded)}>
|
|
52
|
-
<Text style={styles.sectionTitle}>{title}</Text>
|
|
53
|
-
<Text style={styles.expandIcon}>{expanded ? '▼' : '▶'}</Text>
|
|
54
|
-
</Pressable>
|
|
55
|
-
{expanded && children}
|
|
56
|
-
</View>
|
|
57
|
-
)
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
// Basic JSONValue renderer, might need adjustments for console log specifics
|
|
61
|
-
const JSONValue = ({ value }) => {
|
|
62
|
-
if (value === null) {
|
|
63
|
-
return <Text style={styles.jsonNull}>null</Text>
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
if (value === undefined) {
|
|
67
|
-
return <Text style={styles.jsonNull}>undefined</Text>
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
if (typeof value === 'boolean') {
|
|
71
|
-
return <Text style={styles.jsonBoolean}>{value.toString()}</Text>
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
if (typeof value === 'number') {
|
|
75
|
-
return <Text style={styles.jsonNumber}>{value}</Text>
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
if (typeof value === 'string') {
|
|
79
|
-
return (
|
|
80
|
-
<Text style={styles.jsonString} selectable={true}>
|
|
81
|
-
"{value}"
|
|
82
|
-
</Text>
|
|
83
|
-
)
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
if (typeof value === 'object') {
|
|
87
|
-
return (
|
|
88
|
-
<JSONTree
|
|
89
|
-
data={value}
|
|
90
|
-
theme={theme}
|
|
91
|
-
invertTheme={true}
|
|
92
|
-
hideRoot={true}
|
|
93
|
-
shouldExpandNode={(keyPath, nodeData, currentLevel) => currentLevel < 1}
|
|
94
|
-
/>
|
|
95
|
-
)
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
return <Text style={styles.jsonOther}>{String(value)}</Text>
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
const ConsoleLogDetails = ({ log }) => {
|
|
103
|
-
if (!log) {
|
|
104
|
-
return (
|
|
105
|
-
<View style={styles.errorContainer}>
|
|
106
|
-
<Text style={styles.errorText}>Log data is missing</Text>
|
|
107
|
-
</View>
|
|
108
|
-
)
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
const logData = log.data || [] // Console logs can have multiple arguments
|
|
112
|
-
const timestamp = log.timestamp
|
|
113
|
-
const level = log.level || 'log' // Default to 'log' if level is not provided
|
|
114
|
-
|
|
115
|
-
// Simple function to format log data for display and copying
|
|
116
|
-
const formatLogData = (dataArray) => {
|
|
117
|
-
return dataArray.map(item => {
|
|
118
|
-
if (typeof item === 'object') {
|
|
119
|
-
try {
|
|
120
|
-
return JSON.stringify(item, null, 2);
|
|
121
|
-
} catch (e) {
|
|
122
|
-
return '[unserializable object]';
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
return String(item);
|
|
126
|
-
}).join(' ');
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
const formattedLog = formatLogData(logData);
|
|
130
|
-
|
|
131
|
-
return (
|
|
132
|
-
<ScrollView
|
|
133
|
-
style={styles.container}
|
|
134
|
-
contentContainerStyle={styles.contentContainer}
|
|
135
|
-
showsVerticalScrollIndicator={true}
|
|
136
|
-
scrollEventThrottle={16}
|
|
137
|
-
keyboardShouldPersistTaps='handled'>
|
|
138
|
-
|
|
139
|
-
<View style={styles.header}>
|
|
140
|
-
<View style={styles.headerInfo}>
|
|
141
|
-
<Text style={[styles.levelIndicator, { color: getLevelColor(level) }]}>
|
|
142
|
-
{level.toUpperCase()}
|
|
143
|
-
</Text>
|
|
144
|
-
<Text style={styles.timestamp}>
|
|
145
|
-
{timestamp
|
|
146
|
-
? new Date(timestamp).toLocaleString()
|
|
147
|
-
: 'Unknown time'}
|
|
148
|
-
</Text>
|
|
149
|
-
</View>
|
|
150
|
-
<CopyButton text={formattedLog} />
|
|
151
|
-
</View>
|
|
152
|
-
|
|
153
|
-
<CollapsibleSection title='Log Data' initiallyExpanded={true}>
|
|
154
|
-
<View style={styles.dataContentWrapper}>
|
|
155
|
-
<View style={styles.dataContent}>
|
|
156
|
-
{logData.map((item, index) => (
|
|
157
|
-
<View key={index} style={[styles.logDataItem, index === logData.length - 1 && styles.logDataItemLast]}>
|
|
158
|
-
<JSONValue value={item} />
|
|
159
|
-
</View>
|
|
160
|
-
))}
|
|
161
|
-
</View>
|
|
162
|
-
</View>
|
|
163
|
-
</CollapsibleSection>
|
|
164
|
-
|
|
165
|
-
</ScrollView>
|
|
166
|
-
)
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
const getLevelColor = (level) => {
|
|
170
|
-
switch (level?.toLowerCase()) {
|
|
171
|
-
case 'log':
|
|
172
|
-
return '#333'; // Dark gray for standard log
|
|
173
|
-
case 'info':
|
|
174
|
-
return '#0D96F2'; // Blue for info
|
|
175
|
-
case 'warn':
|
|
176
|
-
return '#FCA130'; // Orange for warning
|
|
177
|
-
case 'error':
|
|
178
|
-
return '#F93E3E'; // Red for error
|
|
179
|
-
default:
|
|
180
|
-
return '#666666'; // Default gray
|
|
181
|
-
}
|
|
182
|
-
};
|
|
183
|
-
|
|
184
|
-
const getLevelTextStyle = (level) => {
|
|
185
|
-
const baseStyle = { fontSize: 14, fontFamily: 'monospace' }; // Use monospace font
|
|
186
|
-
return { ...baseStyle, color: getLevelColor(level) };
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
// Re-using and adapting styles from HttpLogDetails
|
|
190
|
-
const styles = StyleSheet.create({
|
|
191
|
-
container: {
|
|
192
|
-
flex: 1,
|
|
193
|
-
backgroundColor: '#fff',
|
|
194
|
-
},
|
|
195
|
-
contentContainer: {
|
|
196
|
-
paddingBottom: 20,
|
|
197
|
-
},
|
|
198
|
-
header: {
|
|
199
|
-
flexDirection: 'row',
|
|
200
|
-
padding: 15,
|
|
201
|
-
borderBottomWidth: 1,
|
|
202
|
-
borderBottomColor: '#eee',
|
|
203
|
-
alignItems: 'center', // Align items vertically
|
|
204
|
-
justifyContent: 'space-between', // Space out items
|
|
205
|
-
},
|
|
206
|
-
headerInfo: {
|
|
207
|
-
flexDirection: 'row', // Arrange level and timestamp horizontally
|
|
208
|
-
alignItems: 'center',
|
|
209
|
-
flexShrink: 1, // Allow info to shrink if needed
|
|
210
|
-
marginRight: 10,
|
|
211
|
-
},
|
|
212
|
-
levelIndicator: {
|
|
213
|
-
fontSize: 14,
|
|
214
|
-
fontWeight: 'bold',
|
|
215
|
-
marginRight: 10,
|
|
216
|
-
},
|
|
217
|
-
timestamp: {
|
|
218
|
-
fontSize: 13,
|
|
219
|
-
color: '#666',
|
|
220
|
-
},
|
|
221
|
-
collapsibleSection: {
|
|
222
|
-
marginBottom: 1,
|
|
223
|
-
backgroundColor: '#fff',
|
|
224
|
-
},
|
|
225
|
-
sectionHeader: {
|
|
226
|
-
flexDirection: 'row',
|
|
227
|
-
justifyContent: 'space-between',
|
|
228
|
-
alignItems: 'center',
|
|
229
|
-
padding: 15,
|
|
230
|
-
backgroundColor: '#f5f5f5',
|
|
231
|
-
},
|
|
232
|
-
sectionTitle: {
|
|
233
|
-
fontSize: 15,
|
|
234
|
-
fontWeight: 'bold',
|
|
235
|
-
color: '#333',
|
|
236
|
-
},
|
|
237
|
-
expandIcon: {
|
|
238
|
-
fontSize: 14,
|
|
239
|
-
color: '#666',
|
|
240
|
-
},
|
|
241
|
-
content: {
|
|
242
|
-
padding: 15,
|
|
243
|
-
},
|
|
244
|
-
dataContentWrapper: {
|
|
245
|
-
flex: 1,
|
|
246
|
-
padding: 10, // Add padding around the scroll view
|
|
247
|
-
},
|
|
248
|
-
dataContent: {
|
|
249
|
-
backgroundColor: '#f8f9fa',
|
|
250
|
-
padding: 10,
|
|
251
|
-
borderRadius: 4,
|
|
252
|
-
borderWidth: 1,
|
|
253
|
-
borderColor: '#e9ecef',
|
|
254
|
-
},
|
|
255
|
-
logDataItem: {
|
|
256
|
-
borderBottomWidth: 1,
|
|
257
|
-
borderBottomColor: '#eee',
|
|
258
|
-
paddingVertical: 8,
|
|
259
|
-
},
|
|
260
|
-
logDataItemLast: {
|
|
261
|
-
borderBottomWidth: 0,
|
|
262
|
-
},
|
|
263
|
-
errorContainer: {
|
|
264
|
-
flex: 1,
|
|
265
|
-
justifyContent: 'center',
|
|
266
|
-
alignItems: 'center',
|
|
267
|
-
padding: 20,
|
|
268
|
-
},
|
|
269
|
-
errorText: {
|
|
270
|
-
color: '#ff4444',
|
|
271
|
-
fontSize: 16,
|
|
272
|
-
},
|
|
273
|
-
copyButton: {
|
|
274
|
-
backgroundColor: '#e9ecef',
|
|
275
|
-
paddingHorizontal: 10,
|
|
276
|
-
paddingVertical: 5,
|
|
277
|
-
borderRadius: 4,
|
|
278
|
-
flexShrink: 0, // Prevent button from shrinking
|
|
279
|
-
},
|
|
280
|
-
copyButtonText: {
|
|
281
|
-
fontSize: 12,
|
|
282
|
-
color: '#666',
|
|
283
|
-
},
|
|
284
|
-
// JSON Value Styles (simplified)
|
|
285
|
-
jsonString: {
|
|
286
|
-
color: '#CB772F',
|
|
287
|
-
fontFamily: 'monospace',
|
|
288
|
-
fontSize: 13,
|
|
289
|
-
},
|
|
290
|
-
jsonNumber: {
|
|
291
|
-
color: '#AE81FF',
|
|
292
|
-
fontFamily: 'monospace',
|
|
293
|
-
fontSize: 13,
|
|
294
|
-
},
|
|
295
|
-
jsonBoolean: {
|
|
296
|
-
color: '#66D9EF',
|
|
297
|
-
fontWeight: 'bold',
|
|
298
|
-
fontFamily: 'monospace',
|
|
299
|
-
fontSize: 13,
|
|
300
|
-
},
|
|
301
|
-
jsonNull: {
|
|
302
|
-
color: '#F92672',
|
|
303
|
-
fontStyle: 'italic',
|
|
304
|
-
fontFamily: 'monospace',
|
|
305
|
-
fontSize: 13,
|
|
306
|
-
},
|
|
307
|
-
jsonOther: {
|
|
308
|
-
color: '#75715e',
|
|
309
|
-
fontFamily: 'monospace',
|
|
310
|
-
fontSize: 13,
|
|
311
|
-
},
|
|
312
|
-
});
|
|
313
|
-
|
|
314
|
-
export default ConsoleLogDetails
|