react-native-inapp-inspector 2.3.14 → 2.3.16
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/README.md +1 -0
- package/dist/commonjs/components/AnimatedEntrance.js +3 -3
- package/dist/commonjs/components/ConsoleLogCard.js +174 -100
- package/dist/commonjs/components/Inspector/AnalyticsTab.js +0 -22
- package/dist/commonjs/components/Inspector/ConsoleTab.js +25 -38
- package/dist/commonjs/components/Inspector/CrashTab.js +19 -28
- package/dist/commonjs/components/Inspector/DeviceInfoTab.js +198 -98
- package/dist/commonjs/components/Inspector/FeedbackModal.d.ts +7 -0
- package/dist/commonjs/components/Inspector/FeedbackModal.js +552 -0
- package/dist/commonjs/components/Inspector/InspectorHeader.js +58 -6
- package/dist/commonjs/components/Inspector/MainScreen.js +100 -58
- package/dist/commonjs/components/Inspector/NetworkTab.js +26 -371
- package/dist/commonjs/components/Inspector/NpmStarPrompt.d.ts +3 -0
- package/dist/commonjs/components/Inspector/NpmStarPrompt.js +494 -0
- package/dist/commonjs/components/Inspector/PerformanceTab.js +40 -7
- package/dist/commonjs/components/Inspector/ReduxTab.js +3 -23
- package/dist/commonjs/components/Inspector/SettingsPanel.js +1035 -173
- package/dist/commonjs/components/Inspector/StorageTab.js +23 -28
- package/dist/commonjs/components/Inspector/TabBar.js +50 -15
- package/dist/commonjs/components/JsonViewer.js +14 -2
- package/dist/commonjs/components/LogCard.js +428 -227
- package/dist/commonjs/components/NetworkIcons.d.ts +5 -0
- package/dist/commonjs/components/NetworkIcons.js +33 -2
- package/dist/commonjs/constants/version.d.ts +1 -1
- package/dist/commonjs/constants/version.js +1 -1
- package/dist/commonjs/customHooks/analyticsLogger.js +1 -1
- package/dist/commonjs/customHooks/consoleLogger.js +34 -2
- package/dist/commonjs/customHooks/crashHandler.js +1 -1
- package/dist/commonjs/customHooks/networkLogger.js +184 -26
- package/dist/commonjs/helpers/index.d.ts +1 -0
- package/dist/commonjs/helpers/index.js +1 -0
- package/dist/commonjs/helpers/remoteConfig.d.ts +4 -0
- package/dist/commonjs/helpers/remoteConfig.js +165 -0
- package/dist/commonjs/helpers/searchQueryParser.d.ts +1 -1
- package/dist/commonjs/helpers/searchQueryParser.js +39 -291
- package/dist/commonjs/helpers/telemetry.d.ts +5 -0
- package/dist/commonjs/helpers/telemetry.js +339 -8
- package/dist/commonjs/index.d.ts +1 -0
- package/dist/commonjs/index.js +173 -29
- package/dist/commonjs/styles/AppFonts.d.ts +2 -0
- package/dist/commonjs/styles/AppFonts.js +1 -0
- package/dist/commonjs/styles/index.d.ts +22 -0
- package/dist/commonjs/styles/index.js +19 -0
- package/dist/commonjs/types/enums.d.ts +1 -0
- package/dist/commonjs/types/enums.js +1 -0
- package/dist/commonjs/types/interfaces.d.ts +12 -0
- package/dist/esm/components/AnimatedEntrance.js +3 -3
- package/dist/esm/components/ConsoleLogCard.js +141 -100
- package/dist/esm/components/Inspector/AnalyticsTab.js +1 -23
- package/dist/esm/components/Inspector/ConsoleTab.js +26 -39
- package/dist/esm/components/Inspector/CrashTab.js +20 -29
- package/dist/esm/components/Inspector/DeviceInfoTab.js +198 -98
- package/dist/esm/components/Inspector/FeedbackModal.d.ts +7 -0
- package/dist/esm/components/Inspector/FeedbackModal.js +515 -0
- package/dist/esm/components/Inspector/InspectorHeader.js +60 -8
- package/dist/esm/components/Inspector/MainScreen.js +101 -59
- package/dist/esm/components/Inspector/NetworkTab.js +27 -372
- package/dist/esm/components/Inspector/NpmStarPrompt.d.ts +3 -0
- package/dist/esm/components/Inspector/NpmStarPrompt.js +454 -0
- package/dist/esm/components/Inspector/PerformanceTab.js +40 -7
- package/dist/esm/components/Inspector/ReduxTab.js +4 -24
- package/dist/esm/components/Inspector/SettingsPanel.js +1038 -176
- package/dist/esm/components/Inspector/StorageTab.js +23 -28
- package/dist/esm/components/Inspector/TabBar.js +50 -15
- package/dist/esm/components/JsonViewer.js +14 -2
- package/dist/esm/components/LogCard.js +422 -221
- package/dist/esm/components/NetworkIcons.d.ts +5 -0
- package/dist/esm/components/NetworkIcons.js +26 -0
- package/dist/esm/constants/version.d.ts +1 -1
- package/dist/esm/constants/version.js +1 -1
- package/dist/esm/customHooks/analyticsLogger.js +1 -1
- package/dist/esm/customHooks/consoleLogger.js +34 -2
- package/dist/esm/customHooks/crashHandler.js +1 -1
- package/dist/esm/customHooks/networkLogger.js +184 -26
- package/dist/esm/helpers/index.d.ts +1 -0
- package/dist/esm/helpers/index.js +1 -0
- package/dist/esm/helpers/remoteConfig.d.ts +4 -0
- package/dist/esm/helpers/remoteConfig.js +160 -0
- package/dist/esm/helpers/searchQueryParser.d.ts +1 -1
- package/dist/esm/helpers/searchQueryParser.js +39 -291
- package/dist/esm/helpers/telemetry.d.ts +5 -0
- package/dist/esm/helpers/telemetry.js +332 -9
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.js +171 -29
- package/dist/esm/styles/AppFonts.d.ts +2 -0
- package/dist/esm/styles/AppFonts.js +1 -0
- package/dist/esm/styles/index.d.ts +22 -0
- package/dist/esm/styles/index.js +19 -0
- package/dist/esm/types/enums.d.ts +1 -0
- package/dist/esm/types/enums.js +1 -0
- package/dist/esm/types/interfaces.d.ts +12 -0
- package/package.json +1 -1
- package/src/components/AnimatedEntrance.tsx +3 -3
- package/src/components/ConsoleLogCard.tsx +154 -103
- package/src/components/Inspector/AnalyticsTab.tsx +0 -23
- package/src/components/Inspector/ConsoleTab.tsx +27 -41
- package/src/components/Inspector/CrashTab.tsx +19 -28
- package/src/components/Inspector/DeviceInfoTab.tsx +224 -102
- package/src/components/Inspector/FeedbackModal.tsx +626 -0
- package/src/components/Inspector/InspectorHeader.tsx +83 -5
- package/src/components/Inspector/MainScreen.tsx +61 -6
- package/src/components/Inspector/NetworkTab.tsx +70 -480
- package/src/components/Inspector/NpmStarPrompt.tsx +532 -0
- package/src/components/Inspector/PerformanceTab.tsx +44 -8
- package/src/components/Inspector/ReduxTab.tsx +9 -24
- package/src/components/Inspector/SettingsPanel.tsx +1162 -197
- package/src/components/Inspector/StorageTab.tsx +27 -30
- package/src/components/Inspector/TabBar.tsx +57 -20
- package/src/components/JsonViewer.tsx +15 -2
- package/src/components/LogCard.tsx +528 -339
- package/src/components/NetworkIcons.tsx +92 -0
- package/src/constants/version.ts +1 -1
- package/src/customHooks/analyticsLogger.ts +1 -1
- package/src/customHooks/consoleLogger.ts +36 -3
- package/src/customHooks/crashHandler.ts +1 -1
- package/src/customHooks/networkLogger.ts +214 -26
- package/src/helpers/index.ts +1 -0
- package/src/helpers/remoteConfig.ts +212 -0
- package/src/helpers/searchQueryParser.ts +42 -284
- package/src/helpers/telemetry.ts +381 -10
- package/src/index.tsx +374 -211
- package/src/styles/AppFonts.ts +2 -0
- package/src/styles/index.ts +20 -1
- package/src/types/enums.ts +1 -0
- package/src/types/interfaces.ts +12 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
2
|
import { useTranslation } from '../i18n';
|
|
3
3
|
import { Pressable, StyleSheet, Text, View, } from 'react-native';
|
|
4
4
|
import { AppColors } from '../styles/AppColors';
|
|
@@ -62,8 +62,8 @@ const getLogMessageWithBadges = (message, searchStr, textStyle, highlightStyle,
|
|
|
62
62
|
return (<View key={i} style={[
|
|
63
63
|
styles.prefixTag,
|
|
64
64
|
{
|
|
65
|
-
backgroundColor: `${dec.color}
|
|
66
|
-
borderColor: `${dec.color}
|
|
65
|
+
backgroundColor: `${dec.color}14`,
|
|
66
|
+
borderColor: `${dec.color}33`,
|
|
67
67
|
},
|
|
68
68
|
]}>
|
|
69
69
|
<IconComp color={dec.color} size={10}/>
|
|
@@ -81,6 +81,7 @@ const getLogMessageWithBadges = (message, searchStr, textStyle, highlightStyle,
|
|
|
81
81
|
export const ConsoleLogCard = React.memo(function ConsoleLogCard({ item, searchStr = '', }) {
|
|
82
82
|
const { setSelectedLog } = useInspector();
|
|
83
83
|
const { t } = useTranslation();
|
|
84
|
+
const [isExpanded, setIsExpanded] = useState(false);
|
|
84
85
|
const jsonContent = getJsonContent(item.message);
|
|
85
86
|
const isAnalyticsError = item.message
|
|
86
87
|
.toLowerCase()
|
|
@@ -95,61 +96,61 @@ export const ConsoleLogCard = React.memo(function ConsoleLogCard({ item, searchS
|
|
|
95
96
|
if (isAnalyticsError || type === 'error' || method === 'error') {
|
|
96
97
|
return {
|
|
97
98
|
border: AppColors.errorColor,
|
|
98
|
-
badgeBg: AppColors.
|
|
99
|
-
badgeText: AppColors.
|
|
99
|
+
badgeBg: `${AppColors.errorColor}18`,
|
|
100
|
+
badgeText: AppColors.errorColor,
|
|
100
101
|
label: 'ERROR',
|
|
101
|
-
cardBg:
|
|
102
|
-
methodBorder: AppColors.
|
|
103
|
-
methodBg: AppColors.
|
|
104
|
-
methodText: AppColors.
|
|
102
|
+
cardBg: '#FFF8F8',
|
|
103
|
+
methodBorder: `${AppColors.errorColor}30`,
|
|
104
|
+
methodBg: `${AppColors.errorColor}12`,
|
|
105
|
+
methodText: AppColors.errorColor,
|
|
105
106
|
textColor: AppColors.redErrorText,
|
|
106
107
|
};
|
|
107
108
|
}
|
|
108
109
|
if (type === 'warn' || method === 'warn') {
|
|
109
110
|
return {
|
|
110
111
|
border: AppColors.amber600,
|
|
111
|
-
badgeBg: AppColors.
|
|
112
|
-
badgeText: AppColors.
|
|
112
|
+
badgeBg: `${AppColors.amber600}18`,
|
|
113
|
+
badgeText: AppColors.amber800,
|
|
113
114
|
label: 'WARN',
|
|
114
|
-
cardBg:
|
|
115
|
-
methodBorder: AppColors.
|
|
116
|
-
methodBg: AppColors.
|
|
117
|
-
methodText: AppColors.
|
|
118
|
-
textColor: AppColors.
|
|
115
|
+
cardBg: '#FFFDF5',
|
|
116
|
+
methodBorder: `${AppColors.amber600}33`,
|
|
117
|
+
methodBg: `${AppColors.amber600}14`,
|
|
118
|
+
methodText: AppColors.amber800,
|
|
119
|
+
textColor: AppColors.amber800,
|
|
119
120
|
};
|
|
120
121
|
}
|
|
121
122
|
if (type === 'debug' || method === 'debug') {
|
|
122
123
|
return {
|
|
123
124
|
border: AppColors.purple500,
|
|
124
|
-
badgeBg: AppColors.
|
|
125
|
-
badgeText: AppColors.
|
|
125
|
+
badgeBg: `${AppColors.purple500}18`,
|
|
126
|
+
badgeText: AppColors.purple,
|
|
126
127
|
label: 'DEBUG',
|
|
127
|
-
cardBg:
|
|
128
|
-
methodBorder: AppColors.
|
|
129
|
-
methodBg: AppColors.
|
|
130
|
-
methodText: AppColors.
|
|
128
|
+
cardBg: '#FAF8FD',
|
|
129
|
+
methodBorder: `${AppColors.purple500}33`,
|
|
130
|
+
methodBg: `${AppColors.purple500}12`,
|
|
131
|
+
methodText: AppColors.purple,
|
|
131
132
|
textColor: AppColors.purpleText,
|
|
132
133
|
};
|
|
133
134
|
}
|
|
134
135
|
if (type === 'info' || method === 'info') {
|
|
135
136
|
return {
|
|
136
137
|
border: AppColors.sky500,
|
|
137
|
-
badgeBg: AppColors.
|
|
138
|
-
badgeText: AppColors.
|
|
138
|
+
badgeBg: `${AppColors.sky500}18`,
|
|
139
|
+
badgeText: AppColors.sky600,
|
|
139
140
|
label: 'INFO',
|
|
140
|
-
cardBg:
|
|
141
|
-
methodBorder: AppColors.
|
|
142
|
-
methodBg: AppColors.
|
|
143
|
-
methodText: AppColors.
|
|
141
|
+
cardBg: '#F8FAFC',
|
|
142
|
+
methodBorder: `${AppColors.sky500}33`,
|
|
143
|
+
methodBg: `${AppColors.sky500}12`,
|
|
144
|
+
methodText: AppColors.sky600,
|
|
144
145
|
textColor: AppColors.blue800,
|
|
145
146
|
};
|
|
146
147
|
}
|
|
147
148
|
return {
|
|
148
149
|
border: AppColors.indigo500,
|
|
149
|
-
badgeBg: AppColors.
|
|
150
|
+
badgeBg: `${AppColors.indigo500}15`,
|
|
150
151
|
badgeText: AppColors.indigo600Alt,
|
|
151
152
|
label: 'LOG',
|
|
152
|
-
cardBg: AppColors.
|
|
153
|
+
cardBg: AppColors.white,
|
|
153
154
|
methodBorder: AppColors.dividerColor,
|
|
154
155
|
methodBg: AppColors.indigo50,
|
|
155
156
|
methodText: AppColors.indigo600Alt,
|
|
@@ -163,6 +164,10 @@ export const ConsoleLogCard = React.memo(function ConsoleLogCard({ item, searchS
|
|
|
163
164
|
const openDetail = () => {
|
|
164
165
|
setSelectedLog(item);
|
|
165
166
|
};
|
|
167
|
+
const toggleExpand = (e) => {
|
|
168
|
+
e?.stopPropagation?.();
|
|
169
|
+
setIsExpanded(prev => !prev);
|
|
170
|
+
};
|
|
166
171
|
return (<View style={styles.container}>
|
|
167
172
|
<Pressable onPress={openDetail} style={({ pressed }) => [
|
|
168
173
|
styles.card,
|
|
@@ -173,6 +178,7 @@ export const ConsoleLogCard = React.memo(function ConsoleLogCard({ item, searchS
|
|
|
173
178
|
},
|
|
174
179
|
pressed && styles.cardPressed,
|
|
175
180
|
]}>
|
|
181
|
+
|
|
176
182
|
<View style={styles.cardHeader}>
|
|
177
183
|
<View style={styles.headerLeft}>
|
|
178
184
|
<View style={[styles.typeChip, { backgroundColor: colors.badgeBg }]}>
|
|
@@ -198,11 +204,11 @@ export const ConsoleLogCard = React.memo(function ConsoleLogCard({ item, searchS
|
|
|
198
204
|
{jsonContent && (<View style={[
|
|
199
205
|
styles.metaChip,
|
|
200
206
|
{
|
|
201
|
-
backgroundColor: AppColors.
|
|
202
|
-
borderColor: AppColors.
|
|
207
|
+
backgroundColor: `${AppColors.teal600}14`,
|
|
208
|
+
borderColor: `${AppColors.teal600}33`,
|
|
203
209
|
},
|
|
204
210
|
]}>
|
|
205
|
-
<Text style={[styles.metaChipText, { color: AppColors.
|
|
211
|
+
<Text style={[styles.metaChipText, { color: AppColors.teal600, fontFamily: AppFonts.interBold }]}>
|
|
206
212
|
{Array.isArray(jsonContent.data)
|
|
207
213
|
? `Array[${jsonContent.data.length}]`
|
|
208
214
|
: `Object{${Object.keys(jsonContent.data).length}}`}
|
|
@@ -229,23 +235,31 @@ export const ConsoleLogCard = React.memo(function ConsoleLogCard({ item, searchS
|
|
|
229
235
|
</View>
|
|
230
236
|
</View>
|
|
231
237
|
|
|
238
|
+
|
|
232
239
|
<View style={styles.cardBody}>
|
|
233
240
|
{jsonContent ? (<>
|
|
234
|
-
{jsonContent.header ? (getLogMessageWithBadges(jsonContent.header, searchStr, [styles.messageText, { color: AppColors.primaryBlack }], styles.highlight, 2)) : null}
|
|
241
|
+
{jsonContent.header ? (getLogMessageWithBadges(jsonContent.header, searchStr, [styles.messageText, { color: AppColors.primaryBlack }], styles.highlight, isExpanded ? undefined : 2)) : null}
|
|
235
242
|
{jsonPreview && (<View style={styles.jsonPreviewContainer}>
|
|
236
243
|
<LogSyntaxHighlighter text={jsonPreview.text} search={searchStr} style={[
|
|
237
244
|
styles.jsonPreviewText,
|
|
238
245
|
{ color: AppColors.primaryBlack },
|
|
239
|
-
]} detectLinks={false} numberOfLines={
|
|
246
|
+
]} detectLinks={false} numberOfLines={isExpanded ? undefined : 4}/>
|
|
247
|
+
{jsonPreview.text.split('\n').length > 4 && (<Pressable onPress={toggleExpand} hitSlop={6} style={styles.expandToggle}>
|
|
248
|
+
<Text style={styles.expandToggleText}>
|
|
249
|
+
{isExpanded ? 'Show less' : 'Show full preview'}
|
|
250
|
+
</Text>
|
|
251
|
+
<ChevronIcon color={AppColors.purple} size={11} direction={isExpanded ? 'up' : 'down'}/>
|
|
252
|
+
</Pressable>)}
|
|
240
253
|
</View>)}
|
|
241
|
-
</>) : (getLogMessageWithBadges(item.message, searchStr, [styles.messageText, { color: AppColors.primaryBlack }], styles.highlight,
|
|
254
|
+
</>) : (getLogMessageWithBadges(item.message, searchStr, [styles.messageText, { color: AppColors.primaryBlack }], styles.highlight, isExpanded ? undefined : 4))}
|
|
242
255
|
</View>
|
|
243
256
|
|
|
257
|
+
|
|
244
258
|
<View style={styles.cardFooter}>
|
|
245
259
|
<View style={styles.footerLeft}>
|
|
246
|
-
<Text style={styles.
|
|
260
|
+
<Text style={styles.footerId}>#{item.id + 1}</Text>
|
|
247
261
|
<View style={styles.footerDot}/>
|
|
248
|
-
<Text style={styles.
|
|
262
|
+
<Text style={styles.footerTime}>{formatTime(item.timestamp)}</Text>
|
|
249
263
|
{parsedCaller && (<>
|
|
250
264
|
<View style={styles.footerDot}/>
|
|
251
265
|
<Pressable onPress={e => {
|
|
@@ -253,44 +267,27 @@ export const ConsoleLogCard = React.memo(function ConsoleLogCard({ item, searchS
|
|
|
253
267
|
openInVSCode(parsedCaller.rawFilePath ||
|
|
254
268
|
parsedCaller.fullPath ||
|
|
255
269
|
parsedCaller.fileName, parsedCaller.lineNumber, parsedCaller.columnNumber);
|
|
256
|
-
}} hitSlop={8} style={
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
paddingHorizontal: 3.5,
|
|
274
|
-
paddingVertical: 0.5,
|
|
275
|
-
}}>
|
|
276
|
-
<Text style={{
|
|
277
|
-
fontFamily: AppFonts.interBold,
|
|
278
|
-
fontSize: 8,
|
|
279
|
-
color: parsedCaller.fileExt === 'tsx' || parsedCaller.fileExt === 'ts'
|
|
280
|
-
? AppColors.brandPurple
|
|
281
|
-
: AppColors.teal600,
|
|
282
|
-
}}>
|
|
270
|
+
}} hitSlop={8} style={styles.callerPill}>
|
|
271
|
+
{parsedCaller.fileExt && parsedCaller.fileExt !== 'other' && (<View style={[
|
|
272
|
+
styles.extBadge,
|
|
273
|
+
{
|
|
274
|
+
backgroundColor: parsedCaller.fileExt === 'tsx' || parsedCaller.fileExt === 'ts'
|
|
275
|
+
? `${AppColors.brandPurple}22`
|
|
276
|
+
: `${AppColors.teal600}22`,
|
|
277
|
+
},
|
|
278
|
+
]}>
|
|
279
|
+
<Text style={[
|
|
280
|
+
styles.extBadgeText,
|
|
281
|
+
{
|
|
282
|
+
color: parsedCaller.fileExt === 'tsx' || parsedCaller.fileExt === 'ts'
|
|
283
|
+
? AppColors.brandPurple
|
|
284
|
+
: AppColors.teal600,
|
|
285
|
+
},
|
|
286
|
+
]}>
|
|
283
287
|
{parsedCaller.fileExt.toUpperCase()}
|
|
284
288
|
</Text>
|
|
285
289
|
</View>)}
|
|
286
|
-
<Text style={
|
|
287
|
-
styles.footerText,
|
|
288
|
-
{
|
|
289
|
-
fontFamily: AppFonts.interBold,
|
|
290
|
-
color: AppColors.sky600,
|
|
291
|
-
fontSize: 9.5,
|
|
292
|
-
},
|
|
293
|
-
]} numberOfLines={1} ellipsizeMode="middle">
|
|
290
|
+
<Text style={styles.callerFileName} numberOfLines={1} ellipsizeMode="middle">
|
|
294
291
|
{parsedCaller.fileName}
|
|
295
292
|
{parsedCaller.lineNumber ? `:${parsedCaller.lineNumber}` : ''}
|
|
296
293
|
</Text>
|
|
@@ -329,32 +326,34 @@ export const ConsoleLogCard = React.memo(function ConsoleLogCard({ item, searchS
|
|
|
329
326
|
});
|
|
330
327
|
const styles = StyleSheet.create({
|
|
331
328
|
container: {
|
|
332
|
-
paddingHorizontal:
|
|
333
|
-
paddingVertical:
|
|
329
|
+
paddingHorizontal: 10,
|
|
330
|
+
paddingVertical: 3.5,
|
|
334
331
|
},
|
|
335
332
|
card: {
|
|
336
333
|
alignSelf: 'stretch',
|
|
337
|
-
borderRadius:
|
|
334
|
+
borderRadius: 11,
|
|
338
335
|
borderWidth: 1,
|
|
339
336
|
borderColor: AppColors.grayBorderSecondary,
|
|
340
337
|
borderLeftWidth: 3.5,
|
|
341
|
-
|
|
342
|
-
|
|
338
|
+
paddingHorizontal: 12,
|
|
339
|
+
paddingTop: 10,
|
|
340
|
+
paddingBottom: 9,
|
|
341
|
+
backgroundColor: AppColors.white,
|
|
343
342
|
shadowColor: AppColors.black,
|
|
344
|
-
shadowOpacity: 0.
|
|
345
|
-
shadowRadius:
|
|
346
|
-
shadowOffset: { width: 0, height:
|
|
347
|
-
elevation:
|
|
343
|
+
shadowOpacity: 0.04,
|
|
344
|
+
shadowRadius: 3,
|
|
345
|
+
shadowOffset: { width: 0, height: 1.5 },
|
|
346
|
+
elevation: 1.5,
|
|
348
347
|
},
|
|
349
348
|
cardPressed: {
|
|
350
|
-
opacity: 0.
|
|
351
|
-
transform: [{ scale: 0.
|
|
349
|
+
opacity: 0.88,
|
|
350
|
+
transform: [{ scale: 0.995 }],
|
|
352
351
|
},
|
|
353
352
|
cardHeader: {
|
|
354
353
|
flexDirection: 'row',
|
|
355
354
|
justifyContent: 'space-between',
|
|
356
355
|
alignItems: 'center',
|
|
357
|
-
marginBottom:
|
|
356
|
+
marginBottom: 6,
|
|
358
357
|
gap: 8,
|
|
359
358
|
},
|
|
360
359
|
headerLeft: {
|
|
@@ -367,7 +366,7 @@ const styles = StyleSheet.create({
|
|
|
367
366
|
headerRight: {
|
|
368
367
|
flexDirection: 'row',
|
|
369
368
|
alignItems: 'center',
|
|
370
|
-
gap:
|
|
369
|
+
gap: 6,
|
|
371
370
|
},
|
|
372
371
|
typeChip: {
|
|
373
372
|
flexDirection: 'row',
|
|
@@ -389,7 +388,7 @@ const styles = StyleSheet.create({
|
|
|
389
388
|
},
|
|
390
389
|
metaChip: {
|
|
391
390
|
paddingHorizontal: 6,
|
|
392
|
-
paddingVertical: 2
|
|
391
|
+
paddingVertical: 2,
|
|
393
392
|
borderRadius: 6,
|
|
394
393
|
borderWidth: 1,
|
|
395
394
|
},
|
|
@@ -399,12 +398,7 @@ const styles = StyleSheet.create({
|
|
|
399
398
|
letterSpacing: 0.2,
|
|
400
399
|
},
|
|
401
400
|
cardBody: {
|
|
402
|
-
|
|
403
|
-
paddingHorizontal: 10,
|
|
404
|
-
paddingVertical: 8,
|
|
405
|
-
borderRadius: 9,
|
|
406
|
-
borderWidth: 1,
|
|
407
|
-
borderColor: AppColors.grayBorderSecondary,
|
|
401
|
+
paddingVertical: 2,
|
|
408
402
|
},
|
|
409
403
|
messageText: {
|
|
410
404
|
fontFamily: AppFonts.interMedium,
|
|
@@ -420,10 +414,11 @@ const styles = StyleSheet.create({
|
|
|
420
414
|
jsonPreviewContainer: {
|
|
421
415
|
marginTop: 6,
|
|
422
416
|
backgroundColor: AppColors.grayBackground,
|
|
423
|
-
borderRadius:
|
|
417
|
+
borderRadius: 8,
|
|
424
418
|
borderWidth: 1,
|
|
425
419
|
borderColor: AppColors.grayBorderSecondary,
|
|
426
|
-
|
|
420
|
+
paddingHorizontal: 9,
|
|
421
|
+
paddingVertical: 7,
|
|
427
422
|
},
|
|
428
423
|
jsonPreviewText: {
|
|
429
424
|
fontFamily: AppFonts.interRegular,
|
|
@@ -431,11 +426,29 @@ const styles = StyleSheet.create({
|
|
|
431
426
|
color: AppColors.primaryBlack,
|
|
432
427
|
lineHeight: 16,
|
|
433
428
|
},
|
|
429
|
+
expandToggle: {
|
|
430
|
+
flexDirection: 'row',
|
|
431
|
+
alignItems: 'center',
|
|
432
|
+
justifyContent: 'center',
|
|
433
|
+
gap: 4,
|
|
434
|
+
marginTop: 5,
|
|
435
|
+
paddingVertical: 2,
|
|
436
|
+
borderTopWidth: 1,
|
|
437
|
+
borderTopColor: AppColors.dividerColor,
|
|
438
|
+
},
|
|
439
|
+
expandToggleText: {
|
|
440
|
+
fontFamily: AppFonts.interBold,
|
|
441
|
+
fontSize: 10,
|
|
442
|
+
color: AppColors.purple,
|
|
443
|
+
},
|
|
434
444
|
cardFooter: {
|
|
435
445
|
flexDirection: 'row',
|
|
436
446
|
alignItems: 'center',
|
|
437
447
|
justifyContent: 'space-between',
|
|
438
|
-
marginTop:
|
|
448
|
+
marginTop: 7,
|
|
449
|
+
paddingTop: 6,
|
|
450
|
+
borderTopWidth: 1,
|
|
451
|
+
borderTopColor: `${AppColors.dividerColor}88`,
|
|
439
452
|
gap: 6,
|
|
440
453
|
},
|
|
441
454
|
footerLeft: {
|
|
@@ -457,14 +470,42 @@ const styles = StyleSheet.create({
|
|
|
457
470
|
backgroundColor: AppColors.grayTextWeak,
|
|
458
471
|
opacity: 0.6,
|
|
459
472
|
},
|
|
460
|
-
|
|
461
|
-
fontFamily: AppFonts.
|
|
473
|
+
footerId: {
|
|
474
|
+
fontFamily: AppFonts.interBold,
|
|
475
|
+
fontSize: 10,
|
|
476
|
+
color: AppColors.grayTextWeak,
|
|
477
|
+
},
|
|
478
|
+
footerTime: {
|
|
479
|
+
fontFamily: AppFonts.interMedium,
|
|
462
480
|
fontSize: 10,
|
|
463
481
|
color: AppColors.grayTextWeak,
|
|
464
482
|
letterSpacing: 0.1,
|
|
465
483
|
},
|
|
466
|
-
|
|
467
|
-
|
|
484
|
+
callerPill: {
|
|
485
|
+
flexDirection: 'row',
|
|
486
|
+
alignItems: 'center',
|
|
487
|
+
gap: 4,
|
|
488
|
+
maxWidth: 185,
|
|
489
|
+
backgroundColor: `${AppColors.sky600}10`,
|
|
490
|
+
borderColor: `${AppColors.sky600}2B`,
|
|
491
|
+
borderWidth: 1,
|
|
492
|
+
borderRadius: 5,
|
|
493
|
+
paddingHorizontal: 5,
|
|
494
|
+
paddingVertical: 1.5,
|
|
495
|
+
},
|
|
496
|
+
extBadge: {
|
|
497
|
+
borderRadius: 3,
|
|
498
|
+
paddingHorizontal: 3.5,
|
|
499
|
+
paddingVertical: 0.5,
|
|
500
|
+
},
|
|
501
|
+
extBadgeText: {
|
|
502
|
+
fontFamily: AppFonts.interBold,
|
|
503
|
+
fontSize: 8,
|
|
504
|
+
},
|
|
505
|
+
callerFileName: {
|
|
506
|
+
fontFamily: AppFonts.interBold,
|
|
507
|
+
color: AppColors.sky600,
|
|
508
|
+
fontSize: 9.5,
|
|
468
509
|
},
|
|
469
510
|
footerBadge: {
|
|
470
511
|
paddingHorizontal: 6,
|
|
@@ -13,7 +13,7 @@ import Svg, { Path, Rect, Line, Circle, G, Defs, LinearGradient as SvgLinearGrad
|
|
|
13
13
|
import TouchableScale from '../TouchableScale';
|
|
14
14
|
import { getCurrentUserId, getCurrentUserProperties, getDefaultEventParameters, getCollectionEnabled, } from '../../customHooks/analyticsLogger';
|
|
15
15
|
import { getEventCategory, } from '../../helpers';
|
|
16
|
-
import { LayersIcon, SearchIcon, ClearIcon, TrashIcon, HeaderPauseIcon, FilterIcon, CartIcon, GlobeIcon, BoltIcon, SparkleIcon, PinIcon, MoneyIcon,
|
|
16
|
+
import { LayersIcon, SearchIcon, ClearIcon, TrashIcon, HeaderPauseIcon, FilterIcon, CartIcon, GlobeIcon, BoltIcon, SparkleIcon, PinIcon, MoneyIcon, } from '../NetworkIcons';
|
|
17
17
|
const AnalyticsHeader = React.memo(() => {
|
|
18
18
|
const { t } = useTranslation();
|
|
19
19
|
const { analyticsEvents, filteredAnalyticsEvents, analyticsFilters, setAnalyticsFilters, analyticsHeaderExpanded, setAnalyticsHeaderExpanded, } = useInspector();
|
|
@@ -934,28 +934,6 @@ const AnalyticsTab = React.memo(() => {
|
|
|
934
934
|
flexGrow: 1,
|
|
935
935
|
},
|
|
936
936
|
]} keyboardShouldPersistTaps="handled"/>
|
|
937
|
-
|
|
938
|
-
<TouchableScale onPress={() => {
|
|
939
|
-
try {
|
|
940
|
-
listRef.current?.scrollToOffset({
|
|
941
|
-
offset: 0,
|
|
942
|
-
animated: true,
|
|
943
|
-
});
|
|
944
|
-
}
|
|
945
|
-
catch {
|
|
946
|
-
try {
|
|
947
|
-
listRef.current?.scrollToIndex({
|
|
948
|
-
index: 0,
|
|
949
|
-
animated: true,
|
|
950
|
-
});
|
|
951
|
-
}
|
|
952
|
-
catch { }
|
|
953
|
-
}
|
|
954
|
-
}} hitSlop={12} style={styles.scrollTopBtn}>
|
|
955
|
-
<View style={{ transform: [{ rotate: '180deg' }] }}>
|
|
956
|
-
<ChevronIcon color={AppColors.white} size={18}/>
|
|
957
|
-
</View>
|
|
958
|
-
</TouchableScale>
|
|
959
937
|
</>) : null}
|
|
960
938
|
</View>
|
|
961
939
|
</>);
|
|
@@ -10,7 +10,7 @@ import EndOfListFooter from '../EndOfListFooter';
|
|
|
10
10
|
import styles from '../../styles';
|
|
11
11
|
import { AppColors } from '../../styles/AppColors';
|
|
12
12
|
import { AppFonts } from '../../styles/AppFonts';
|
|
13
|
-
import { SearchIcon, ClearIcon, SortArrowIcon, TrashIcon, LayersIcon, UserIcon, InfoCircleIcon, WarningTriangleIcon, ErrorCircleIcon, AnalyticsIcon, HeaderPauseIcon,
|
|
13
|
+
import { SearchIcon, ClearIcon, SortArrowIcon, TrashIcon, LayersIcon, UserIcon, InfoCircleIcon, WarningTriangleIcon, ErrorCircleIcon, AnalyticsIcon, HeaderPauseIcon, } from '../NetworkIcons';
|
|
14
14
|
const ConsoleTab = React.memo(() => {
|
|
15
15
|
const { t } = useTranslation();
|
|
16
16
|
const { logSearch, setLogSearch, logSortOrder, setLogSortOrder, handleDelete, logFilters, setLogFilters, logCounts, filteredConsoleLogs, visibleConsoleLogs, isConsolePaused, setIsConsolePaused, } = useInspector();
|
|
@@ -25,31 +25,40 @@ const ConsoleTab = React.memo(() => {
|
|
|
25
25
|
const isAllSelected = logFilters.has('all') ||
|
|
26
26
|
!Array.from(logFilters).some(f => f !== 'all');
|
|
27
27
|
if (isAllSelected) {
|
|
28
|
-
return (<
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
28
|
+
return (<View style={{ paddingHorizontal: 12, paddingTop: 8, paddingBottom: 3 }}>
|
|
29
|
+
<Text style={{
|
|
30
|
+
fontFamily: AppFonts.interMedium,
|
|
31
|
+
fontSize: 11,
|
|
32
|
+
color: AppColors.grayTextWeak,
|
|
33
|
+
letterSpacing: 0.2,
|
|
34
|
+
}}>
|
|
35
|
+
{filtered === total
|
|
36
|
+
? `Showing ${total} logs`
|
|
37
|
+
: `Showing ${filtered} of ${total} logs`}
|
|
38
|
+
</Text>
|
|
39
|
+
</View>);
|
|
34
40
|
}
|
|
35
41
|
else {
|
|
36
42
|
const activeFilterNames = Array.from(logFilters)
|
|
37
43
|
.filter(f => f !== 'all')
|
|
38
44
|
.map(f => {
|
|
39
45
|
if (f === 'user-log')
|
|
40
|
-
return '
|
|
46
|
+
return 'Log';
|
|
41
47
|
if (f === 'analytics')
|
|
42
48
|
return 'Analytics';
|
|
43
49
|
return (f.charAt(0).toUpperCase() +
|
|
44
50
|
f.slice(1));
|
|
45
51
|
});
|
|
46
|
-
return (<
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
52
|
+
return (<View style={{ paddingHorizontal: 12, paddingTop: 8, paddingBottom: 3 }}>
|
|
53
|
+
<Text style={{
|
|
54
|
+
fontFamily: AppFonts.interMedium,
|
|
55
|
+
fontSize: 11,
|
|
56
|
+
color: AppColors.grayTextWeak,
|
|
57
|
+
letterSpacing: 0.2,
|
|
58
|
+
}}>
|
|
59
|
+
Filtered by {activeFilterNames.join(', ')} ({filtered} of {total} logs)
|
|
60
|
+
</Text>
|
|
61
|
+
</View>);
|
|
53
62
|
}
|
|
54
63
|
}, [visibleConsoleLogs.length, filteredConsoleLogs.length, logFilters]);
|
|
55
64
|
const [isSearchFocused, setIsSearchFocused] = React.useState(false);
|
|
@@ -481,37 +490,15 @@ const ConsoleTab = React.memo(() => {
|
|
|
481
490
|
</ScrollView>
|
|
482
491
|
</View>
|
|
483
492
|
|
|
484
|
-
<FlatList ref={listRef} data={filteredConsoleLogs} keyExtractor={keyExtractor} ListHeaderComponent={listHeader} renderItem={renderItem} initialNumToRender={12} maxToRenderPerBatch={8} windowSize={5} removeClippedSubviews={true} renderToHardwareTextureAndroid={true} ListEmptyComponent={<EmptyState isSearch={logSearch.length > 0 || logFilters.
|
|
493
|
+
<FlatList ref={listRef} data={filteredConsoleLogs} keyExtractor={keyExtractor} ListHeaderComponent={listHeader} renderItem={renderItem} initialNumToRender={12} maxToRenderPerBatch={8} windowSize={5} removeClippedSubviews={true} renderToHardwareTextureAndroid={true} ListEmptyComponent={<EmptyState isSearch={logSearch.length > 0 || !logFilters.has('all')} searchQuery={logSearch} customTitle={logSearch.length > 0
|
|
485
494
|
? 'No matching console logs'
|
|
486
495
|
: 'No console logs'} onClearSearch={() => {
|
|
487
496
|
setLogSearch('');
|
|
488
|
-
setLogFilters(new Set());
|
|
497
|
+
setLogFilters(new Set(['all']));
|
|
489
498
|
}}/>} ListFooterComponent={filteredConsoleLogs.length > 0 ? (<EndOfListFooter count={filteredConsoleLogs.length} label="logs"/>) : null} contentContainerStyle={[
|
|
490
499
|
styles.listContent,
|
|
491
500
|
filteredConsoleLogs.length === 0 && { flexGrow: 1 },
|
|
492
501
|
]} keyboardShouldPersistTaps="handled"/>
|
|
493
|
-
|
|
494
|
-
<TouchableScale onPress={() => {
|
|
495
|
-
try {
|
|
496
|
-
listRef.current?.scrollToOffset({
|
|
497
|
-
offset: 0,
|
|
498
|
-
animated: true,
|
|
499
|
-
});
|
|
500
|
-
}
|
|
501
|
-
catch {
|
|
502
|
-
try {
|
|
503
|
-
listRef.current?.scrollToIndex({
|
|
504
|
-
index: 0,
|
|
505
|
-
animated: true,
|
|
506
|
-
});
|
|
507
|
-
}
|
|
508
|
-
catch { }
|
|
509
|
-
}
|
|
510
|
-
}} hitSlop={12} style={styles.scrollTopBtn}>
|
|
511
|
-
<View style={{ transform: [{ rotate: '180deg' }] }}>
|
|
512
|
-
<ChevronIcon color={AppColors.white} size={18}/>
|
|
513
|
-
</View>
|
|
514
|
-
</TouchableScale>
|
|
515
502
|
</View>);
|
|
516
503
|
});
|
|
517
504
|
export default ConsoleTab;
|
|
@@ -7,12 +7,11 @@ import AnimatedEntrance from '../AnimatedEntrance';
|
|
|
7
7
|
import EndOfListFooter from '../EndOfListFooter';
|
|
8
8
|
import FeatureUnderDevNotice from './FeatureUnderDevNotice';
|
|
9
9
|
import HighlightText from '../HighlightText';
|
|
10
|
-
import styles from '../../styles';
|
|
11
10
|
import { AppColors } from '../../styles/AppColors';
|
|
12
11
|
import { AppFonts } from '../../styles/AppFonts';
|
|
13
12
|
import { clearCrashRecords, } from '../../customHooks/crashHandler';
|
|
14
13
|
import CrashFilterModal, { DEFAULT_CRASH_FILTERS, isCrashFiltersDefault, } from './CrashFilterModal';
|
|
15
|
-
import { SearchIcon, ClearIcon, TrashIcon, TerminalIcon, LayersIcon, ClockIcon, ShieldAlertIcon, FlameIcon, JsIcon, HourglassIcon, SkullIcon, LayoutIcon, ChipIcon, AppleIcon, AndroidIcon, RepeatIcon, CodeBracketsIcon, FilterIcon,
|
|
14
|
+
import { SearchIcon, ClearIcon, TrashIcon, TerminalIcon, LayersIcon, ClockIcon, ShieldAlertIcon, FlameIcon, JsIcon, HourglassIcon, SkullIcon, LayoutIcon, ChipIcon, AppleIcon, AndroidIcon, RepeatIcon, CodeBracketsIcon, FilterIcon, } from '../NetworkIcons';
|
|
16
15
|
const getRelativeTime = (timestamp) => {
|
|
17
16
|
const now = Date.now();
|
|
18
17
|
const diff = Math.max(0, now - timestamp);
|
|
@@ -387,13 +386,27 @@ const CrashTab = React.memo(() => {
|
|
|
387
386
|
<View style={localStyles.emptyIconCircle}>
|
|
388
387
|
<ShieldAlertIcon size={38} color={AppColors.greenColor}/>
|
|
389
388
|
</View>
|
|
390
|
-
<Text style={localStyles.emptyTitle}>
|
|
389
|
+
<Text style={localStyles.emptyTitle}>
|
|
390
|
+
{searchQuery.length > 0
|
|
391
|
+
? 'No matching crash entries'
|
|
392
|
+
: filterType !== 'all' || !isCrashFiltersDefault(crashFilters)
|
|
393
|
+
? 'No crashes match filters'
|
|
394
|
+
: t('crash.emptyTitle')}
|
|
395
|
+
</Text>
|
|
391
396
|
<Text style={localStyles.emptySub}>
|
|
392
397
|
{searchQuery
|
|
393
|
-
?
|
|
394
|
-
:
|
|
398
|
+
? `No crash entries matched "${searchQuery}"`
|
|
399
|
+
: filterType !== 'all' || !isCrashFiltersDefault(crashFilters)
|
|
400
|
+
? 'Try adjusting your filters or search keywords.'
|
|
401
|
+
: t('crash.emptySubtitle')}
|
|
395
402
|
</Text>
|
|
396
|
-
{searchQuery.length > 0
|
|
403
|
+
{(searchQuery.length > 0 ||
|
|
404
|
+
filterType !== 'all' ||
|
|
405
|
+
!isCrashFiltersDefault(crashFilters)) && (<TouchableScale onPress={() => {
|
|
406
|
+
setSearchQuery('');
|
|
407
|
+
setFilterType('all');
|
|
408
|
+
setCrashFilters(DEFAULT_CRASH_FILTERS);
|
|
409
|
+
}} style={{
|
|
397
410
|
marginTop: 10,
|
|
398
411
|
paddingHorizontal: 14,
|
|
399
412
|
paddingVertical: 7,
|
|
@@ -405,33 +418,11 @@ const CrashTab = React.memo(() => {
|
|
|
405
418
|
fontSize: 11.5,
|
|
406
419
|
color: AppColors.white,
|
|
407
420
|
}}>
|
|
408
|
-
Clear Search
|
|
421
|
+
Clear Search & Filters
|
|
409
422
|
</Text>
|
|
410
423
|
</TouchableScale>)}
|
|
411
424
|
</ScrollView>) : (<>
|
|
412
425
|
<FlatList ref={listRef} data={filteredList} keyExtractor={item => item.id} renderItem={renderCard} initialNumToRender={12} maxToRenderPerBatch={8} windowSize={5} removeClippedSubviews={true} renderToHardwareTextureAndroid={true} contentContainerStyle={localStyles.listContent} showsVerticalScrollIndicator={false} ListFooterComponent={<EndOfListFooter />}/>
|
|
413
|
-
|
|
414
|
-
<TouchableScale onPress={() => {
|
|
415
|
-
try {
|
|
416
|
-
listRef.current?.scrollToOffset({
|
|
417
|
-
offset: 0,
|
|
418
|
-
animated: true,
|
|
419
|
-
});
|
|
420
|
-
}
|
|
421
|
-
catch {
|
|
422
|
-
try {
|
|
423
|
-
listRef.current?.scrollToIndex({
|
|
424
|
-
index: 0,
|
|
425
|
-
animated: true,
|
|
426
|
-
});
|
|
427
|
-
}
|
|
428
|
-
catch { }
|
|
429
|
-
}
|
|
430
|
-
}} hitSlop={12} style={styles.scrollTopBtn}>
|
|
431
|
-
<View style={{ transform: [{ rotate: '180deg' }] }}>
|
|
432
|
-
<ChevronIcon color={AppColors.white} size={18}/>
|
|
433
|
-
</View>
|
|
434
|
-
</TouchableScale>
|
|
435
426
|
</>)}
|
|
436
427
|
|
|
437
428
|
|