react-native-inapp-inspector 1.1.29 → 1.1.32
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/dist/commonjs/components/AnalyticsDetail.js +668 -108
- package/dist/commonjs/components/AppHeaderLogo.js +5 -2
- package/dist/commonjs/components/ConsoleLogCard.js +81 -59
- package/dist/commonjs/components/DomainHeader.js +21 -17
- package/dist/commonjs/components/Inspector/AnalyticsTab.js +297 -200
- package/dist/commonjs/components/Inspector/ConsoleTab.js +162 -56
- package/dist/commonjs/components/Inspector/InspectorHeader.js +56 -119
- package/dist/commonjs/components/Inspector/LogDetail.js +45 -12
- package/dist/commonjs/components/Inspector/NetworkTab.js +4 -1
- package/dist/commonjs/components/Inspector/ReduxDetail.js +237 -42
- package/dist/commonjs/components/Inspector/ReduxTab.js +456 -35
- package/dist/commonjs/components/JsonViewer.js +1 -1
- package/dist/commonjs/components/NetworkIcons.js +19 -10
- package/dist/commonjs/components/TreeNode.js +12 -2
- package/dist/commonjs/constants/version.d.ts +1 -1
- package/dist/commonjs/constants/version.js +1 -1
- package/dist/commonjs/customHooks/reduxLogger.js +128 -5
- package/dist/commonjs/helpers/index.d.ts +1 -1
- package/dist/commonjs/helpers/index.js +32 -16
- package/dist/commonjs/i18n/locales/en.json +45 -2
- package/dist/commonjs/styles/AppColors.d.ts +6 -0
- package/dist/commonjs/styles/AppColors.js +6 -0
- package/dist/commonjs/styles/index.d.ts +22 -1
- package/dist/commonjs/styles/index.js +25 -4
- package/dist/commonjs/types/interfaces.d.ts +7 -0
- package/dist/esm/components/AnalyticsDetail.js +670 -110
- package/dist/esm/components/AppHeaderLogo.js +5 -2
- package/dist/esm/components/ConsoleLogCard.js +81 -59
- package/dist/esm/components/DomainHeader.js +21 -17
- package/dist/esm/components/Inspector/AnalyticsTab.js +298 -201
- package/dist/esm/components/Inspector/ConsoleTab.js +163 -57
- package/dist/esm/components/Inspector/InspectorHeader.js +57 -120
- package/dist/esm/components/Inspector/LogDetail.js +45 -12
- package/dist/esm/components/Inspector/NetworkTab.js +4 -1
- package/dist/esm/components/Inspector/ReduxDetail.js +239 -44
- package/dist/esm/components/Inspector/ReduxTab.js +458 -37
- package/dist/esm/components/JsonViewer.js +1 -1
- package/dist/esm/components/NetworkIcons.js +19 -10
- package/dist/esm/components/TreeNode.js +12 -2
- package/dist/esm/constants/version.d.ts +1 -1
- package/dist/esm/constants/version.js +1 -1
- package/dist/esm/customHooks/reduxLogger.js +128 -5
- package/dist/esm/helpers/index.d.ts +1 -1
- package/dist/esm/helpers/index.js +32 -16
- package/dist/esm/i18n/locales/en.json +45 -2
- package/dist/esm/styles/AppColors.d.ts +6 -0
- package/dist/esm/styles/AppColors.js +6 -0
- package/dist/esm/styles/index.d.ts +22 -1
- package/dist/esm/styles/index.js +25 -4
- package/dist/esm/types/interfaces.d.ts +7 -0
- package/package.json +11 -11
|
@@ -29,14 +29,17 @@ const logoStyles = StyleSheet.create({
|
|
|
29
29
|
container: {
|
|
30
30
|
borderRadius: 10,
|
|
31
31
|
overflow: 'hidden',
|
|
32
|
-
backgroundColor: '
|
|
32
|
+
backgroundColor: 'rgba(255, 255, 255, 0.15)',
|
|
33
|
+
borderWidth: 1,
|
|
34
|
+
borderColor: 'rgba(255, 255, 255, 0.28)',
|
|
35
|
+
padding: 2.5,
|
|
33
36
|
alignItems: 'center',
|
|
34
37
|
justifyContent: 'center',
|
|
35
38
|
},
|
|
36
39
|
image: {
|
|
37
40
|
width: '100%',
|
|
38
41
|
height: '100%',
|
|
39
|
-
borderRadius:
|
|
42
|
+
borderRadius: 7.5,
|
|
40
43
|
},
|
|
41
44
|
});
|
|
42
45
|
export default AppHeaderLogo;
|
|
@@ -20,37 +20,37 @@ const getLogMessageWithBadges = (message, searchStr, textStyle, highlightStyle,
|
|
|
20
20
|
const getTagDecorator = (tag) => {
|
|
21
21
|
const clean = tag.replace(/[\[\]]/g, '').trim().toUpperCase();
|
|
22
22
|
if (clean === 'AXIOS') {
|
|
23
|
-
return { color:
|
|
23
|
+
return { color: AppColors.emerald600, icon: '⚡', label: 'AXIOS' };
|
|
24
24
|
}
|
|
25
25
|
if (clean === 'API' || clean === 'FETCH' || clean === 'HTTP' || clean === 'NETWORK') {
|
|
26
|
-
return { color:
|
|
26
|
+
return { color: AppColors.sky600, icon: '🌐', label: clean };
|
|
27
27
|
}
|
|
28
28
|
if (clean === 'SAMPLE' || clean === 'BATCH') {
|
|
29
|
-
return { color:
|
|
29
|
+
return { color: AppColors.indigo600Alt, icon: '🎲', label: clean };
|
|
30
30
|
}
|
|
31
31
|
if (clean === 'REDUX' || clean === 'STORE' || clean === 'STATE') {
|
|
32
|
-
return { color:
|
|
32
|
+
return { color: AppColors.violet600, icon: '⚛️', label: clean };
|
|
33
33
|
}
|
|
34
34
|
if (clean === 'ANALYTICS' || clean === 'FIREBASE' || clean === 'GA4' || clean === 'GA') {
|
|
35
|
-
return { color:
|
|
35
|
+
return { color: AppColors.teal600, icon: '📊', label: clean };
|
|
36
36
|
}
|
|
37
37
|
if (clean === 'AUTH' || clean === 'TOKEN' || clean === 'SESSION') {
|
|
38
|
-
return { color:
|
|
38
|
+
return { color: AppColors.amber600, icon: '🔑', label: clean };
|
|
39
39
|
}
|
|
40
40
|
if (clean === 'APP') {
|
|
41
|
-
return { color:
|
|
41
|
+
return { color: AppColors.indigo600Alt, icon: '📱', label: 'APP' };
|
|
42
42
|
}
|
|
43
43
|
if (clean === 'TEST') {
|
|
44
|
-
return { color:
|
|
44
|
+
return { color: AppColors.emerald500, icon: '🧪', label: 'TEST' };
|
|
45
45
|
}
|
|
46
46
|
if (clean === 'WARN' || clean === 'WARNING') {
|
|
47
|
-
return { color:
|
|
47
|
+
return { color: AppColors.amber600, icon: '⚠️', label: 'WARN' };
|
|
48
48
|
}
|
|
49
49
|
if (clean === 'ERROR' || clean === 'CRASH' || clean === 'BUG') {
|
|
50
|
-
return { color:
|
|
50
|
+
return { color: AppColors.red600, icon: '💥', label: 'ERROR' };
|
|
51
51
|
}
|
|
52
52
|
if (clean === 'PERF' || clean === 'RENDER') {
|
|
53
|
-
return { color:
|
|
53
|
+
return { color: AppColors.violet500, icon: '⚡', label: clean };
|
|
54
54
|
}
|
|
55
55
|
return { color: AppColors.slate600, icon: '🏷️', label: clean };
|
|
56
56
|
};
|
|
@@ -89,51 +89,72 @@ export const ConsoleLogCard = React.memo(function ConsoleLogCard({ item, searchS
|
|
|
89
89
|
? parseStackLine(item.caller, true)
|
|
90
90
|
: null;
|
|
91
91
|
const getLogColors = () => {
|
|
92
|
-
const
|
|
93
|
-
|
|
92
|
+
const type = (item.type || 'log').toLowerCase();
|
|
93
|
+
const method = (item.sourceMethod || type).toLowerCase();
|
|
94
|
+
if (isAnalyticsError || type === 'error' || method === 'error') {
|
|
94
95
|
return {
|
|
95
|
-
border:
|
|
96
|
-
badgeBg:
|
|
97
|
-
badgeText:
|
|
96
|
+
border: '#EF4444',
|
|
97
|
+
badgeBg: '#FEE2E2',
|
|
98
|
+
badgeText: '#DC2626',
|
|
98
99
|
label: 'ERROR',
|
|
99
|
-
cardBg:
|
|
100
|
+
cardBg: '#FEF2F2',
|
|
101
|
+
methodBorder: '#FECACA',
|
|
102
|
+
methodBg: '#FEE2E2',
|
|
103
|
+
methodText: '#DC2626',
|
|
104
|
+
textColor: '#991B1B',
|
|
100
105
|
};
|
|
101
106
|
}
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
};
|
|
128
|
-
}
|
|
129
|
-
return {
|
|
130
|
-
border: AppColors.purple,
|
|
131
|
-
badgeBg: `${AppColors.purple}15`,
|
|
132
|
-
badgeText: AppColors.purple,
|
|
133
|
-
label: 'INFO',
|
|
134
|
-
cardBg: isDark ? `${AppColors.purple}1F` : AppColors.purpleShade50,
|
|
135
|
-
};
|
|
107
|
+
if (type === 'warn' || method === 'warn') {
|
|
108
|
+
return {
|
|
109
|
+
border: '#F59E0B',
|
|
110
|
+
badgeBg: '#FEF3C7',
|
|
111
|
+
badgeText: '#D97706',
|
|
112
|
+
label: 'WARN',
|
|
113
|
+
cardBg: '#FFFBEB',
|
|
114
|
+
methodBorder: '#FDE68A',
|
|
115
|
+
methodBg: '#FEF3C7',
|
|
116
|
+
methodText: '#D97706',
|
|
117
|
+
textColor: '#92400E',
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
if (type === 'debug' || method === 'debug') {
|
|
121
|
+
return {
|
|
122
|
+
border: '#8B5CF6',
|
|
123
|
+
badgeBg: '#EDE9FE',
|
|
124
|
+
badgeText: '#7C3AED',
|
|
125
|
+
label: 'DEBUG',
|
|
126
|
+
cardBg: '#F5F3FF',
|
|
127
|
+
methodBorder: '#DDD6FE',
|
|
128
|
+
methodBg: '#EDE9FE',
|
|
129
|
+
methodText: '#7C3AED',
|
|
130
|
+
textColor: '#4C1D95',
|
|
131
|
+
};
|
|
136
132
|
}
|
|
133
|
+
if (type === 'info' || method === 'info') {
|
|
134
|
+
return {
|
|
135
|
+
border: '#0EA5E9',
|
|
136
|
+
badgeBg: '#E0F2FE',
|
|
137
|
+
badgeText: '#0284C7',
|
|
138
|
+
label: 'INFO',
|
|
139
|
+
cardBg: '#F0F9FF',
|
|
140
|
+
methodBorder: '#BAE6FD',
|
|
141
|
+
methodBg: '#E0F2FE',
|
|
142
|
+
methodText: '#0284C7',
|
|
143
|
+
textColor: '#075985',
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
// Default / Standard console.log
|
|
147
|
+
return {
|
|
148
|
+
border: '#6366F1',
|
|
149
|
+
badgeBg: '#EEF2FF',
|
|
150
|
+
badgeText: '#4F46E5',
|
|
151
|
+
label: 'LOG',
|
|
152
|
+
cardBg: '#FFFFFF',
|
|
153
|
+
methodBorder: '#E0E7FF',
|
|
154
|
+
methodBg: '#EEF2FF',
|
|
155
|
+
methodText: '#4F46E5',
|
|
156
|
+
textColor: '#0F172A',
|
|
157
|
+
};
|
|
137
158
|
};
|
|
138
159
|
const colors = getLogColors();
|
|
139
160
|
const jsonPreview = jsonContent
|
|
@@ -147,6 +168,7 @@ export const ConsoleLogCard = React.memo(function ConsoleLogCard({ item, searchS
|
|
|
147
168
|
styles.card,
|
|
148
169
|
{
|
|
149
170
|
borderLeftColor: colors.border,
|
|
171
|
+
borderLeftWidth: 3.5,
|
|
150
172
|
backgroundColor: colors.cardBg,
|
|
151
173
|
},
|
|
152
174
|
pressed && styles.cardPressed,
|
|
@@ -155,18 +177,18 @@ export const ConsoleLogCard = React.memo(function ConsoleLogCard({ item, searchS
|
|
|
155
177
|
<View style={styles.headerLeft}>
|
|
156
178
|
<View style={[styles.typeChip, { backgroundColor: colors.badgeBg }]}>
|
|
157
179
|
<View style={[styles.typeDot, { backgroundColor: colors.badgeText }]}/>
|
|
158
|
-
<Text style={[styles.typeChipText, { color: colors.badgeText }]}>
|
|
180
|
+
<Text style={[styles.typeChipText, { color: colors.badgeText, fontFamily: AppFonts.interBold }]}>
|
|
159
181
|
{colors.label}
|
|
160
182
|
</Text>
|
|
161
183
|
</View>
|
|
162
184
|
<View style={[
|
|
163
185
|
styles.metaChip,
|
|
164
186
|
{
|
|
165
|
-
backgroundColor:
|
|
166
|
-
borderColor:
|
|
187
|
+
backgroundColor: colors.methodBg,
|
|
188
|
+
borderColor: colors.methodBorder,
|
|
167
189
|
},
|
|
168
190
|
]}>
|
|
169
|
-
<Text style={[styles.metaChipText, { color:
|
|
191
|
+
<Text style={[styles.metaChipText, { color: colors.methodText, fontFamily: AppFonts.interBold }]}>
|
|
170
192
|
console.
|
|
171
193
|
{('sourceMethod' in item ? item.sourceMethod : undefined) ||
|
|
172
194
|
item.type ||
|
|
@@ -176,11 +198,11 @@ export const ConsoleLogCard = React.memo(function ConsoleLogCard({ item, searchS
|
|
|
176
198
|
{jsonContent && (<View style={[
|
|
177
199
|
styles.metaChip,
|
|
178
200
|
{
|
|
179
|
-
backgroundColor:
|
|
180
|
-
borderColor:
|
|
201
|
+
backgroundColor: '#ECFDF5',
|
|
202
|
+
borderColor: '#A7F3D0',
|
|
181
203
|
},
|
|
182
204
|
]}>
|
|
183
|
-
<Text style={[styles.metaChipText, { color:
|
|
205
|
+
<Text style={[styles.metaChipText, { color: '#059669', fontFamily: AppFonts.interBold }]}>
|
|
184
206
|
{Array.isArray(jsonContent.data)
|
|
185
207
|
? `Array[${jsonContent.data.length}]`
|
|
186
208
|
: `Object{${Object.keys(jsonContent.data).length}}`}
|
|
@@ -195,7 +217,7 @@ export const ConsoleLogCard = React.memo(function ConsoleLogCard({ item, searchS
|
|
|
195
217
|
borderColor: `${AppColors.purple}3D`,
|
|
196
218
|
},
|
|
197
219
|
]}>
|
|
198
|
-
<Text style={[styles.metaChipText, { color: AppColors.purple }]}>
|
|
220
|
+
<Text style={[styles.metaChipText, { color: AppColors.purple, fontFamily: AppFonts.interBold }]}>
|
|
199
221
|
×{item.duplicateCount}
|
|
200
222
|
</Text>
|
|
201
223
|
</View>)}
|
|
@@ -27,18 +27,21 @@ const DomainHeader = ({ pageName, color, stats, activeFilters, onToggleFilter, i
|
|
|
27
27
|
const pctSuccess = total > 0 ? Math.round((stats.success / total) * 100) : 0;
|
|
28
28
|
const pctFailed = total > 0 ? Math.round((stats.failed / total) * 100) : 0;
|
|
29
29
|
const pctLoading = total > 0 ? Math.round((stats.loading / total) * 100) : 0;
|
|
30
|
-
return (<Pressable style={
|
|
30
|
+
return (<Pressable style={[
|
|
31
|
+
styles.domainHeaderCard,
|
|
32
|
+
!isCollapsed && styles.domainHeaderCardExpanded,
|
|
33
|
+
]} onPress={() => onToggleCollapse(pageName)}>
|
|
31
34
|
<View style={styles.domainHeaderTopRow}>
|
|
32
35
|
<View style={styles.domainHeaderLeft}>
|
|
33
|
-
<Animated.View style={{ transform: [{ rotate: chevronRotate }] }}>
|
|
36
|
+
<Animated.View style={{ transform: [{ rotate: chevronRotate }], flexShrink: 0 }}>
|
|
34
37
|
<ChevronIcon color={AppColors.grayTextWeak} size={13}/>
|
|
35
38
|
</Animated.View>
|
|
36
|
-
<View style={[styles.domainIconWrap, { backgroundColor: `${color}18
|
|
39
|
+
<View style={[styles.domainIconWrap, { backgroundColor: `${color}18`, flexShrink: 0 }]}>
|
|
37
40
|
<ScreenIcon color={color} size={14}/>
|
|
38
41
|
</View>
|
|
39
42
|
<View style={{ flex: 1, justifyContent: 'center', minWidth: 0 }}>
|
|
40
|
-
<View style={{ flexDirection: 'row', alignItems: 'center', gap: 6 }}>
|
|
41
|
-
<Text style={[styles.domainTitleText, { flexShrink: 1 }]} numberOfLines={1}>
|
|
43
|
+
<View style={{ flexDirection: 'row', alignItems: 'center', gap: 6, minWidth: 0 }}>
|
|
44
|
+
<Text style={[styles.domainTitleText, { flexShrink: 1 }]} numberOfLines={1} ellipsizeMode="tail">
|
|
42
45
|
{pageName}
|
|
43
46
|
</Text>
|
|
44
47
|
{total > 0 && (<View style={{
|
|
@@ -46,52 +49,53 @@ const DomainHeader = ({ pageName, color, stats, activeFilters, onToggleFilter, i
|
|
|
46
49
|
alignItems: 'center',
|
|
47
50
|
gap: 4,
|
|
48
51
|
backgroundColor: stats.failed > 0
|
|
49
|
-
?
|
|
52
|
+
? AppColors.red100
|
|
50
53
|
: stats.loading > 0
|
|
51
|
-
?
|
|
52
|
-
:
|
|
54
|
+
? AppColors.amber100
|
|
55
|
+
: AppColors.emerald100,
|
|
53
56
|
paddingHorizontal: 5,
|
|
54
57
|
paddingVertical: 1.5,
|
|
55
58
|
borderRadius: 4,
|
|
59
|
+
flexShrink: 0,
|
|
56
60
|
}}>
|
|
57
61
|
<View style={{
|
|
58
|
-
width:
|
|
62
|
+
width: 22,
|
|
59
63
|
height: 3.5,
|
|
60
64
|
borderRadius: 2,
|
|
61
|
-
backgroundColor:
|
|
65
|
+
backgroundColor: AppColors.gray200,
|
|
62
66
|
flexDirection: 'row',
|
|
63
67
|
overflow: 'hidden',
|
|
64
68
|
}}>
|
|
65
69
|
{pctSuccess > 0 && (<View style={{
|
|
66
70
|
width: `${pctSuccess}%`,
|
|
67
71
|
height: '100%',
|
|
68
|
-
backgroundColor:
|
|
72
|
+
backgroundColor: AppColors.emerald500,
|
|
69
73
|
}}/>)}
|
|
70
74
|
{pctFailed > 0 && (<View style={{
|
|
71
75
|
width: `${pctFailed}%`,
|
|
72
76
|
height: '100%',
|
|
73
|
-
backgroundColor:
|
|
77
|
+
backgroundColor: AppColors.red500,
|
|
74
78
|
}}/>)}
|
|
75
79
|
{pctLoading > 0 && (<View style={{
|
|
76
80
|
width: `${pctLoading}%`,
|
|
77
81
|
height: '100%',
|
|
78
|
-
backgroundColor:
|
|
82
|
+
backgroundColor: AppColors.amber500,
|
|
79
83
|
}}/>)}
|
|
80
84
|
</View>
|
|
81
85
|
<Text style={{
|
|
82
86
|
fontFamily: AppFonts.interBold,
|
|
83
87
|
fontSize: 8.5,
|
|
84
88
|
color: stats.failed > 0
|
|
85
|
-
?
|
|
89
|
+
? AppColors.redErrorText
|
|
86
90
|
: stats.loading > 0
|
|
87
|
-
?
|
|
88
|
-
:
|
|
91
|
+
? AppColors.amber800Warm
|
|
92
|
+
: AppColors.emerald700,
|
|
89
93
|
}}>
|
|
90
94
|
{pctSuccess}%
|
|
91
95
|
</Text>
|
|
92
96
|
</View>)}
|
|
93
97
|
</View>
|
|
94
|
-
<Text style={styles.domainSummaryText} numberOfLines={1}>
|
|
98
|
+
<Text style={styles.domainSummaryText} numberOfLines={1} ellipsizeMode="tail">
|
|
95
99
|
{formatDateTime(timestamp)}
|
|
96
100
|
</Text>
|
|
97
101
|
</View>
|