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,355 +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
|
-
import { getZustandActionColor } from '../utils/DebugConst'
|
|
6
|
-
|
|
7
|
-
// Re-using the theme from ConsoleLogDetails for consistency
|
|
8
|
-
const theme = {
|
|
9
|
-
scheme: 'monokai',
|
|
10
|
-
author: 'wimer hazenberg (http://www.monokai.nl)',
|
|
11
|
-
base00: '#272822',
|
|
12
|
-
base01: '#383830',
|
|
13
|
-
base02: '#49483e',
|
|
14
|
-
base03: '#75715e',
|
|
15
|
-
base04: '#a59f85',
|
|
16
|
-
base05: '#f8f8f2',
|
|
17
|
-
base06: '#f5f4f1',
|
|
18
|
-
base07: '#f9f8f5',
|
|
19
|
-
base08: '#f92672',
|
|
20
|
-
base09: '#fd971f',
|
|
21
|
-
base0A: '#f4bf75',
|
|
22
|
-
base0B: '#a6e22e',
|
|
23
|
-
base0C: '#a1efe4',
|
|
24
|
-
base0D: '#66d9ef',
|
|
25
|
-
base0E: '#ae81ff',
|
|
26
|
-
base0F: '#cc6633'
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
const CopyButton = ({ text, style }) => {
|
|
30
|
-
const [copied, setCopied] = React.useState(false)
|
|
31
|
-
|
|
32
|
-
const handleCopy = async () => {
|
|
33
|
-
await Clipboard.setString(text)
|
|
34
|
-
setCopied(true)
|
|
35
|
-
setTimeout(() => setCopied(false), 2000)
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
return (
|
|
39
|
-
<Pressable style={[styles.copyButton, style]} onPress={handleCopy}>
|
|
40
|
-
<Text style={styles.copyButtonText}>{copied ? 'Copied!' : 'Copy'}</Text>
|
|
41
|
-
</Pressable>
|
|
42
|
-
)
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
const CollapsibleSection = ({ title, children, initiallyExpanded = false }) => {
|
|
46
|
-
const [expanded, setExpanded] = React.useState(initiallyExpanded)
|
|
47
|
-
|
|
48
|
-
return (
|
|
49
|
-
<View style={styles.collapsibleSection}>
|
|
50
|
-
<Pressable
|
|
51
|
-
style={styles.sectionHeader}
|
|
52
|
-
onPress={() => setExpanded(!expanded)}>
|
|
53
|
-
<Text style={styles.sectionTitle}>{title}</Text>
|
|
54
|
-
<Text style={styles.expandIcon}>{expanded ? '▼' : '▶'}</Text>
|
|
55
|
-
</Pressable>
|
|
56
|
-
{expanded && children}
|
|
57
|
-
</View>
|
|
58
|
-
)
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
const ZustandLogDetails = ({ log }) => {
|
|
62
|
-
if (!log) {
|
|
63
|
-
return (
|
|
64
|
-
<View style={styles.errorContainer}>
|
|
65
|
-
<Text style={styles.errorText}>Log data is missing</Text>
|
|
66
|
-
</View>
|
|
67
|
-
)
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
const { timestamp, action, prevState, nextState, actionCompleteTime, storeName } = log
|
|
71
|
-
const actionColor = getZustandActionColor(action);
|
|
72
|
-
|
|
73
|
-
// Format data for display and copying
|
|
74
|
-
const formatStateToString = (state) => {
|
|
75
|
-
try {
|
|
76
|
-
return JSON.stringify(state, null, 2);
|
|
77
|
-
} catch (e) {
|
|
78
|
-
return '[unserializable state]';
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
const formattedPrevState = formatStateToString(prevState);
|
|
83
|
-
const formattedNextState = formatStateToString(nextState);
|
|
84
|
-
|
|
85
|
-
// Format for the full log copy
|
|
86
|
-
const formattedLog = `Action: ${action}${storeName ? ` (${storeName})` : ''}
|
|
87
|
-
Previous State: ${formattedPrevState}
|
|
88
|
-
Next State: ${formattedNextState}${actionCompleteTime ? `\nAction Complete Time: ${actionCompleteTime}ms` : ''}`;
|
|
89
|
-
|
|
90
|
-
// Function to find differences between states
|
|
91
|
-
const findDifferences = () => {
|
|
92
|
-
const changes = [];
|
|
93
|
-
|
|
94
|
-
if (!prevState || !nextState) return changes;
|
|
95
|
-
|
|
96
|
-
// Helper to find differences in objects recursively
|
|
97
|
-
const findChangesRecursive = (prev, next, path = '') => {
|
|
98
|
-
if (prev === next) return;
|
|
99
|
-
|
|
100
|
-
if (typeof prev !== 'object' || typeof next !== 'object' ||
|
|
101
|
-
prev === null || next === null) {
|
|
102
|
-
changes.push({
|
|
103
|
-
path: path || 'root',
|
|
104
|
-
prevValue: prev,
|
|
105
|
-
nextValue: next
|
|
106
|
-
});
|
|
107
|
-
return;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
// Check for object keys
|
|
111
|
-
const allKeys = [...new Set([...Object.keys(prev || {}), ...Object.keys(next || {})])];
|
|
112
|
-
|
|
113
|
-
for (const key of allKeys) {
|
|
114
|
-
const newPath = path ? `${path}.${key}` : key;
|
|
115
|
-
if (!(key in prev)) {
|
|
116
|
-
changes.push({
|
|
117
|
-
path: newPath,
|
|
118
|
-
prevValue: undefined,
|
|
119
|
-
nextValue: next[key]
|
|
120
|
-
});
|
|
121
|
-
} else if (!(key in next)) {
|
|
122
|
-
changes.push({
|
|
123
|
-
path: newPath,
|
|
124
|
-
prevValue: prev[key],
|
|
125
|
-
nextValue: undefined
|
|
126
|
-
});
|
|
127
|
-
} else {
|
|
128
|
-
findChangesRecursive(prev[key], next[key], newPath);
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
};
|
|
132
|
-
|
|
133
|
-
findChangesRecursive(prevState, nextState);
|
|
134
|
-
return changes;
|
|
135
|
-
};
|
|
136
|
-
|
|
137
|
-
const stateChanges = findDifferences();
|
|
138
|
-
const hasChanges = stateChanges.length > 0;
|
|
139
|
-
|
|
140
|
-
const actionDisplay = storeName ? `${action} (${storeName})` : action;
|
|
141
|
-
|
|
142
|
-
return (
|
|
143
|
-
<ScrollView
|
|
144
|
-
style={styles.container}
|
|
145
|
-
contentContainerStyle={styles.contentContainer}
|
|
146
|
-
showsVerticalScrollIndicator={true}
|
|
147
|
-
scrollEventThrottle={16}
|
|
148
|
-
keyboardShouldPersistTaps='handled'>
|
|
149
|
-
|
|
150
|
-
<View style={styles.header}>
|
|
151
|
-
<View style={styles.headerInfo}>
|
|
152
|
-
<Text style={styles.actionIndicator}>
|
|
153
|
-
Action: <Text style={[styles.actionName, { color: actionColor }]}>{actionDisplay}</Text>
|
|
154
|
-
</Text>
|
|
155
|
-
<Text style={styles.timestamp}>
|
|
156
|
-
{timestamp
|
|
157
|
-
? new Date(timestamp).toLocaleString()
|
|
158
|
-
: 'Unknown time'}
|
|
159
|
-
</Text>
|
|
160
|
-
{actionCompleteTime && (
|
|
161
|
-
<Text style={styles.actionTime}>
|
|
162
|
-
Completed in: {actionCompleteTime}ms
|
|
163
|
-
</Text>
|
|
164
|
-
)}
|
|
165
|
-
</View>
|
|
166
|
-
<CopyButton text={formattedLog} />
|
|
167
|
-
</View>
|
|
168
|
-
|
|
169
|
-
{hasChanges && (
|
|
170
|
-
<CollapsibleSection title='State Changes' initiallyExpanded={true}>
|
|
171
|
-
<View style={styles.dataContentWrapper}>
|
|
172
|
-
<View style={styles.dataContent}>
|
|
173
|
-
{stateChanges.map((change, index) => (
|
|
174
|
-
<View key={index} style={[styles.changeItem, index === stateChanges.length - 1 && styles.changeItemLast]}>
|
|
175
|
-
<Text style={styles.changePath}>{change.path}</Text>
|
|
176
|
-
<View style={styles.changeValues}>
|
|
177
|
-
<View style={styles.changeValue}>
|
|
178
|
-
<Text style={styles.changeLabel}>From:</Text>
|
|
179
|
-
<JSONTree
|
|
180
|
-
data={change.prevValue}
|
|
181
|
-
theme={theme}
|
|
182
|
-
invertTheme={true}
|
|
183
|
-
hideRoot={true}
|
|
184
|
-
shouldExpandNode={() => true}
|
|
185
|
-
/>
|
|
186
|
-
</View>
|
|
187
|
-
<View style={styles.changeValue}>
|
|
188
|
-
<Text style={styles.changeLabel}>To:</Text>
|
|
189
|
-
<JSONTree
|
|
190
|
-
data={change.nextValue}
|
|
191
|
-
theme={theme}
|
|
192
|
-
invertTheme={true}
|
|
193
|
-
hideRoot={true}
|
|
194
|
-
shouldExpandNode={() => true}
|
|
195
|
-
/>
|
|
196
|
-
</View>
|
|
197
|
-
</View>
|
|
198
|
-
</View>
|
|
199
|
-
))}
|
|
200
|
-
</View>
|
|
201
|
-
</View>
|
|
202
|
-
</CollapsibleSection>
|
|
203
|
-
)}
|
|
204
|
-
|
|
205
|
-
<CollapsibleSection title='Previous State' initiallyExpanded={false}>
|
|
206
|
-
<View style={styles.dataContentWrapper}>
|
|
207
|
-
<View style={styles.dataContent}>
|
|
208
|
-
<JSONTree
|
|
209
|
-
data={prevState || {}}
|
|
210
|
-
theme={theme}
|
|
211
|
-
invertTheme={true}
|
|
212
|
-
hideRoot={true}
|
|
213
|
-
shouldExpandNode={(keyPath, data, level) => level < 1}
|
|
214
|
-
/>
|
|
215
|
-
</View>
|
|
216
|
-
</View>
|
|
217
|
-
</CollapsibleSection>
|
|
218
|
-
|
|
219
|
-
<CollapsibleSection title='Next State' initiallyExpanded={true}>
|
|
220
|
-
<View style={styles.dataContentWrapper}>
|
|
221
|
-
<View style={styles.dataContent}>
|
|
222
|
-
<JSONTree
|
|
223
|
-
data={nextState || {}}
|
|
224
|
-
theme={theme}
|
|
225
|
-
invertTheme={true}
|
|
226
|
-
hideRoot={true}
|
|
227
|
-
shouldExpandNode={(keyPath, data, level) => level < 1}
|
|
228
|
-
/>
|
|
229
|
-
</View>
|
|
230
|
-
</View>
|
|
231
|
-
</CollapsibleSection>
|
|
232
|
-
|
|
233
|
-
</ScrollView>
|
|
234
|
-
)
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
// Re-using and adapting styles from ConsoleLogDetails
|
|
238
|
-
const styles = StyleSheet.create({
|
|
239
|
-
container: {
|
|
240
|
-
flex: 1,
|
|
241
|
-
backgroundColor: '#fff',
|
|
242
|
-
},
|
|
243
|
-
contentContainer: {
|
|
244
|
-
paddingBottom: 20,
|
|
245
|
-
},
|
|
246
|
-
header: {
|
|
247
|
-
flexDirection: 'row',
|
|
248
|
-
padding: 15,
|
|
249
|
-
borderBottomWidth: 1,
|
|
250
|
-
borderBottomColor: '#eee',
|
|
251
|
-
alignItems: 'center',
|
|
252
|
-
justifyContent: 'space-between',
|
|
253
|
-
},
|
|
254
|
-
headerInfo: {
|
|
255
|
-
flexShrink: 1,
|
|
256
|
-
marginRight: 10,
|
|
257
|
-
},
|
|
258
|
-
actionIndicator: {
|
|
259
|
-
fontSize: 14,
|
|
260
|
-
marginBottom: 5,
|
|
261
|
-
},
|
|
262
|
-
actionName: {
|
|
263
|
-
fontWeight: 'bold',
|
|
264
|
-
},
|
|
265
|
-
timestamp: {
|
|
266
|
-
fontSize: 13,
|
|
267
|
-
color: '#666',
|
|
268
|
-
},
|
|
269
|
-
actionTime: {
|
|
270
|
-
fontSize: 13,
|
|
271
|
-
color: '#666',
|
|
272
|
-
marginTop: 2,
|
|
273
|
-
},
|
|
274
|
-
collapsibleSection: {
|
|
275
|
-
marginBottom: 1,
|
|
276
|
-
backgroundColor: '#fff',
|
|
277
|
-
},
|
|
278
|
-
sectionHeader: {
|
|
279
|
-
flexDirection: 'row',
|
|
280
|
-
justifyContent: 'space-between',
|
|
281
|
-
alignItems: 'center',
|
|
282
|
-
padding: 15,
|
|
283
|
-
backgroundColor: '#f5f5f5',
|
|
284
|
-
},
|
|
285
|
-
sectionTitle: {
|
|
286
|
-
fontSize: 15,
|
|
287
|
-
fontWeight: 'bold',
|
|
288
|
-
color: '#333',
|
|
289
|
-
},
|
|
290
|
-
expandIcon: {
|
|
291
|
-
fontSize: 14,
|
|
292
|
-
color: '#666',
|
|
293
|
-
},
|
|
294
|
-
dataContentWrapper: {
|
|
295
|
-
flex: 1,
|
|
296
|
-
padding: 10,
|
|
297
|
-
},
|
|
298
|
-
dataContent: {
|
|
299
|
-
backgroundColor: '#f8f9fa',
|
|
300
|
-
padding: 10,
|
|
301
|
-
borderRadius: 4,
|
|
302
|
-
borderWidth: 1,
|
|
303
|
-
borderColor: '#e9ecef',
|
|
304
|
-
},
|
|
305
|
-
errorContainer: {
|
|
306
|
-
flex: 1,
|
|
307
|
-
justifyContent: 'center',
|
|
308
|
-
alignItems: 'center',
|
|
309
|
-
padding: 20,
|
|
310
|
-
},
|
|
311
|
-
errorText: {
|
|
312
|
-
color: '#ff4444',
|
|
313
|
-
fontSize: 16,
|
|
314
|
-
},
|
|
315
|
-
copyButton: {
|
|
316
|
-
backgroundColor: '#e9ecef',
|
|
317
|
-
paddingHorizontal: 10,
|
|
318
|
-
paddingVertical: 5,
|
|
319
|
-
borderRadius: 4,
|
|
320
|
-
flexShrink: 0,
|
|
321
|
-
},
|
|
322
|
-
copyButtonText: {
|
|
323
|
-
fontSize: 12,
|
|
324
|
-
color: '#666',
|
|
325
|
-
},
|
|
326
|
-
changeItem: {
|
|
327
|
-
borderBottomWidth: 1,
|
|
328
|
-
borderBottomColor: '#eee',
|
|
329
|
-
paddingVertical: 8,
|
|
330
|
-
},
|
|
331
|
-
changeItemLast: {
|
|
332
|
-
borderBottomWidth: 0,
|
|
333
|
-
},
|
|
334
|
-
changePath: {
|
|
335
|
-
fontWeight: 'bold',
|
|
336
|
-
color: '#333',
|
|
337
|
-
marginBottom: 5,
|
|
338
|
-
fontFamily: 'monospace',
|
|
339
|
-
},
|
|
340
|
-
changeValues: {
|
|
341
|
-
flexDirection: 'row',
|
|
342
|
-
justifyContent: 'space-between',
|
|
343
|
-
},
|
|
344
|
-
changeValue: {
|
|
345
|
-
flex: 1,
|
|
346
|
-
padding: 5,
|
|
347
|
-
},
|
|
348
|
-
changeLabel: {
|
|
349
|
-
color: '#666',
|
|
350
|
-
fontSize: 12,
|
|
351
|
-
marginBottom: 3,
|
|
352
|
-
},
|
|
353
|
-
});
|
|
354
|
-
|
|
355
|
-
export default ZustandLogDetails
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
require 'json'
|
|
2
|
-
package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
|
|
3
|
-
|
|
4
|
-
Pod::Spec.new do |s|
|
|
5
|
-
s.name = "react-native-debug-toolkit"
|
|
6
|
-
s.version = package['version']
|
|
7
|
-
s.summary = package['description']
|
|
8
|
-
s.homepage = package['repository']['url']
|
|
9
|
-
s.license = package['license']
|
|
10
|
-
s.author = package['author']
|
|
11
|
-
s.platform = :ios, "11.0"
|
|
12
|
-
s.source = { :git => package['repository']['url'], :tag => "#{s.version}" }
|
|
13
|
-
s.source_files = "ios/**/*.{h,m}"
|
|
14
|
-
|
|
15
|
-
s.dependency "React-Core"
|
|
16
|
-
|
|
17
|
-
# FLEX is only needed for debug builds
|
|
18
|
-
s.dependency "FLEX", "~> 5.0"
|
|
19
|
-
|
|
20
|
-
# DoraemonKit is only needed for debug builds
|
|
21
|
-
# s.dependency "DoraemonKit/Core", "~> 3.0"
|
|
22
|
-
|
|
23
|
-
# This ensures FLEX and DoraemonKit are only included in debug builds
|
|
24
|
-
s.pod_target_xcconfig = { 'OTHER_CFLAGS' => '-DDebug=$(CONFIGURATION)' }
|
|
25
|
-
end
|
package/react-native.config.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
// react-native.config.js
|
|
2
|
-
|
|
3
|
-
module.exports = {
|
|
4
|
-
// Let React Native's auto-linking handle all dependencies normally
|
|
5
|
-
dependencies: {
|
|
6
|
-
"react-native-debug-toolkit": {
|
|
7
|
-
platforms: {
|
|
8
|
-
ios: {
|
|
9
|
-
podspecPath: "./react-native-debug-toolkit.podspec",
|
|
10
|
-
sourceDir: "./ios"
|
|
11
|
-
},
|
|
12
|
-
// android: {
|
|
13
|
-
// sourceDir: "./android"
|
|
14
|
-
// }
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
};
|