react-native-inapp-inspector 1.0.8 → 1.0.10
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 +5 -6
- package/assets/social_preview.png +0 -0
- package/dist/commonjs/components/AnalyticsDetail.js +28 -23
- package/dist/commonjs/components/AnalyticsEventCard.js +9 -9
- package/dist/commonjs/components/BrandCircleIcon.d.ts +5 -0
- package/dist/commonjs/components/BrandCircleIcon.js +180 -0
- package/dist/commonjs/components/BrandSquareIcon.d.ts +5 -0
- package/dist/commonjs/components/BrandSquareIcon.js +180 -0
- package/dist/commonjs/components/CodeSnippet.js +32 -24
- package/dist/commonjs/components/ConsoleLogCard.js +127 -70
- package/dist/commonjs/components/JsonViewer.d.ts +2 -1
- package/dist/commonjs/components/JsonViewer.js +2 -2
- package/dist/commonjs/components/MetaAccordion.d.ts +1 -1
- package/dist/commonjs/components/MetaAccordion.js +45 -2
- package/dist/commonjs/components/NetworkIcons.d.ts +8 -0
- package/dist/commonjs/components/NetworkIcons.js +44 -1
- package/dist/commonjs/components/ReduxTreeView.d.ts +6 -0
- package/dist/commonjs/components/ReduxTreeView.js +403 -0
- package/dist/commonjs/components/TouchableScale.js +15 -1
- package/dist/commonjs/components/TreeNode.js +3 -3
- package/dist/commonjs/customHooks/reduxLogger.d.ts +4 -0
- package/dist/commonjs/customHooks/reduxLogger.js +48 -2
- package/dist/commonjs/index.js +1520 -506
- package/dist/commonjs/styles/index.d.ts +11 -1
- package/dist/commonjs/styles/index.js +19 -9
- package/dist/commonjs/types/index.d.ts +4 -0
- package/dist/esm/components/AnalyticsDetail.js +28 -23
- package/dist/esm/components/AnalyticsEventCard.js +9 -9
- package/dist/esm/components/BrandCircleIcon.d.ts +5 -0
- package/dist/esm/components/BrandCircleIcon.js +140 -0
- package/dist/esm/components/BrandSquareIcon.d.ts +5 -0
- package/dist/esm/components/BrandSquareIcon.js +140 -0
- package/dist/esm/components/CodeSnippet.js +32 -24
- package/dist/esm/components/ConsoleLogCard.js +127 -70
- package/dist/esm/components/JsonViewer.d.ts +2 -1
- package/dist/esm/components/JsonViewer.js +2 -2
- package/dist/esm/components/MetaAccordion.d.ts +1 -1
- package/dist/esm/components/MetaAccordion.js +46 -3
- package/dist/esm/components/NetworkIcons.d.ts +8 -0
- package/dist/esm/components/NetworkIcons.js +35 -0
- package/dist/esm/components/ReduxTreeView.d.ts +6 -0
- package/dist/esm/components/ReduxTreeView.js +366 -0
- package/dist/esm/components/TouchableScale.js +16 -2
- package/dist/esm/components/TreeNode.js +3 -3
- package/dist/esm/customHooks/reduxLogger.d.ts +4 -0
- package/dist/esm/customHooks/reduxLogger.js +43 -1
- package/dist/esm/index.js +1523 -509
- package/dist/esm/styles/index.d.ts +11 -1
- package/dist/esm/styles/index.js +19 -9
- package/dist/esm/types/index.d.ts +4 -0
- package/example/App.tsx +46 -0
- package/package.json +7 -5
|
@@ -262,7 +262,7 @@ const getStyleForType = (type) => {
|
|
|
262
262
|
case 'value':
|
|
263
263
|
return styles.value;
|
|
264
264
|
default:
|
|
265
|
-
return styles.plain;
|
|
265
|
+
return [styles.plain, { color: AppColors_1.AppColors.primaryBlack }];
|
|
266
266
|
}
|
|
267
267
|
};
|
|
268
268
|
const ArrowUpIcon = ({ color = '#64748B', size = 16 }) => (<react_native_svg_1.default width={size} height={size} viewBox="0 0 24 24" fill="none">
|
|
@@ -296,26 +296,32 @@ const CodeSnippetLine = react_1.default.memo(({ line, lineIndex, language, searc
|
|
|
296
296
|
};
|
|
297
297
|
return (<react_native_1.View style={[styles.lineRow, isActiveMatch && styles.activeMatchRow]}>
|
|
298
298
|
{/* Gutter Line Number */}
|
|
299
|
-
<react_native_1.View style={[styles.gutter, isActiveMatch && styles.activeMatchGutter]}>
|
|
300
|
-
<react_native_1.Text style={[styles.lineNumber, isActiveMatch && styles.activeMatchLineNumber]}>{lineIndex + 1}</react_native_1.Text>
|
|
299
|
+
<react_native_1.View style={[styles.gutter, { backgroundColor: AppColors_1.AppColors.grayBackground, borderRightColor: AppColors_1.AppColors.grayBorderSecondary }, isActiveMatch && styles.activeMatchGutter]}>
|
|
300
|
+
<react_native_1.Text style={[styles.lineNumber, { color: AppColors_1.AppColors.grayTextWeak }, isActiveMatch && styles.activeMatchLineNumber]}>{lineIndex + 1}</react_native_1.Text>
|
|
301
301
|
</react_native_1.View>
|
|
302
302
|
|
|
303
303
|
{/* Highlighted Code Line */}
|
|
304
304
|
<react_native_1.View style={styles.codeLine}>
|
|
305
|
-
<react_native_1.Text style={styles.codeLineText}>
|
|
306
|
-
{tokens.length === 0 ? (<react_native_1.Text style={styles.plain}> </react_native_1.Text>) : (tokens.map((token, tokenIdx) => (<react_1.default.Fragment key={tokenIdx}>
|
|
305
|
+
<react_native_1.Text style={[styles.codeLineText, { color: AppColors_1.AppColors.primaryBlack }]}>
|
|
306
|
+
{tokens.length === 0 ? (<react_native_1.Text style={[styles.plain, { color: AppColors_1.AppColors.primaryBlack }]}> </react_native_1.Text>) : (tokens.map((token, tokenIdx) => (<react_1.default.Fragment key={tokenIdx}>
|
|
307
307
|
{renderTokenText(token.text, token.type)}
|
|
308
308
|
</react_1.default.Fragment>)))}
|
|
309
309
|
</react_native_1.Text>
|
|
310
310
|
</react_native_1.View>
|
|
311
311
|
</react_native_1.View>);
|
|
312
312
|
});
|
|
313
|
-
const CodeSnippet = ({ code, language, }) => {
|
|
313
|
+
const CodeSnippet = ({ code, language, search, }) => {
|
|
314
314
|
const [searchQuery, setSearchQuery] = (0, react_1.useState)('');
|
|
315
315
|
const [debouncedQuery, setDebouncedQuery] = (0, react_1.useState)('');
|
|
316
316
|
const [currentMatchIdx, setCurrentMatchIdx] = (0, react_1.useState)(-1);
|
|
317
317
|
const [visibleLinesCount, setVisibleLinesCount] = (0, react_1.useState)(200);
|
|
318
318
|
const flatListRef = (0, react_1.useRef)(null);
|
|
319
|
+
// Sync prop search to searchQuery
|
|
320
|
+
(0, react_1.useEffect)(() => {
|
|
321
|
+
if (search !== undefined) {
|
|
322
|
+
setSearchQuery(search);
|
|
323
|
+
}
|
|
324
|
+
}, [search]);
|
|
319
325
|
// Debounce search query updates
|
|
320
326
|
(0, react_1.useEffect)(() => {
|
|
321
327
|
const timer = setTimeout(() => {
|
|
@@ -360,7 +366,7 @@ const CodeSnippet = ({ code, language, }) => {
|
|
|
360
366
|
// Reset scroll and states on code/language changes
|
|
361
367
|
(0, react_1.useEffect)(() => {
|
|
362
368
|
setVisibleLinesCount(200);
|
|
363
|
-
setSearchQuery('');
|
|
369
|
+
setSearchQuery(search || '');
|
|
364
370
|
setCurrentMatchIdx(-1);
|
|
365
371
|
}, [code, language]);
|
|
366
372
|
// Auto-scroll to the first match when search query returns matches
|
|
@@ -386,32 +392,32 @@ const CodeSnippet = ({ code, language, }) => {
|
|
|
386
392
|
try {
|
|
387
393
|
flatListRef.current?.scrollToIndex({
|
|
388
394
|
index: lineIdx,
|
|
389
|
-
animated:
|
|
390
|
-
viewPosition: 0.
|
|
395
|
+
animated: false,
|
|
396
|
+
viewPosition: 0.3,
|
|
391
397
|
});
|
|
392
398
|
}
|
|
393
399
|
catch (e) {
|
|
394
400
|
// Fallback recovery is handled by onScrollToIndexFailed
|
|
395
401
|
}
|
|
396
|
-
},
|
|
402
|
+
}, 50);
|
|
397
403
|
};
|
|
398
404
|
const onScrollToIndexFailed = (error) => {
|
|
399
405
|
flatListRef.current?.scrollToOffset({
|
|
400
406
|
offset: error.averageItemLength * error.index,
|
|
401
|
-
animated:
|
|
407
|
+
animated: false,
|
|
402
408
|
});
|
|
403
409
|
setTimeout(() => {
|
|
404
410
|
try {
|
|
405
411
|
flatListRef.current?.scrollToIndex({
|
|
406
412
|
index: error.index,
|
|
407
|
-
animated:
|
|
408
|
-
viewPosition: 0.
|
|
413
|
+
animated: false,
|
|
414
|
+
viewPosition: 0.3,
|
|
409
415
|
});
|
|
410
416
|
}
|
|
411
417
|
catch (err) {
|
|
412
418
|
console.warn('Scroll to line index failed after fallback retry:', err);
|
|
413
419
|
}
|
|
414
|
-
},
|
|
420
|
+
}, 60);
|
|
415
421
|
};
|
|
416
422
|
const handleNextMatch = () => {
|
|
417
423
|
if (matches.length === 0)
|
|
@@ -442,12 +448,12 @@ const CodeSnippet = ({ code, language, }) => {
|
|
|
442
448
|
return (<react_native_1.View style={{ flex: 1 }}>
|
|
443
449
|
{/* Search Header Row */}
|
|
444
450
|
<react_native_1.View style={styles.searchRow}>
|
|
445
|
-
<react_native_1.View style={styles.searchBar}>
|
|
451
|
+
<react_native_1.View style={[styles.searchBar, { backgroundColor: AppColors_1.AppColors.primaryLight, borderColor: AppColors_1.AppColors.grayBorderSecondary }]}>
|
|
446
452
|
<NetworkIcons_1.SearchIcon color={AppColors_1.AppColors.grayTextWeak} size={15}/>
|
|
447
|
-
<react_native_1.TextInput placeholder={`Search ${language.toUpperCase()}...`} placeholderTextColor={AppColors_1.AppColors.grayTextWeak} value={searchQuery} onChangeText={setSearchQuery} style={styles.searchInput} autoCorrect={false} autoCapitalize="none"/>
|
|
453
|
+
<react_native_1.TextInput placeholder={`Search ${language.toUpperCase()}...`} placeholderTextColor={AppColors_1.AppColors.grayTextWeak} value={searchQuery} onChangeText={setSearchQuery} style={[styles.searchInput, { color: AppColors_1.AppColors.primaryBlack }]} autoCorrect={false} autoCapitalize="none"/>
|
|
448
454
|
|
|
449
455
|
{/* Matches Info */}
|
|
450
|
-
{debouncedQuery.length >= 2 && (<react_native_1.Text style={styles.matchCountText}>
|
|
456
|
+
{debouncedQuery.length >= 2 && (<react_native_1.Text style={[styles.matchCountText, { backgroundColor: AppColors_1.AppColors.grayBackground, color: AppColors_1.AppColors.grayTextWeak }]}>
|
|
451
457
|
{matches.length > 0 ? `${currentMatchIdx + 1}/${matches.length}` : '0/0'}
|
|
452
458
|
</react_native_1.Text>)}
|
|
453
459
|
|
|
@@ -457,12 +463,12 @@ const CodeSnippet = ({ code, language, }) => {
|
|
|
457
463
|
</react_native_1.View>
|
|
458
464
|
|
|
459
465
|
{/* Up / Down Arrow Navigation Buttons */}
|
|
460
|
-
{matches.length > 0 && (<react_native_1.View style={styles.navArrowsGroup}>
|
|
466
|
+
{matches.length > 0 && (<react_native_1.View style={[styles.navArrowsGroup, { backgroundColor: AppColors_1.AppColors.primaryLight, borderColor: AppColors_1.AppColors.grayBorderSecondary }]}>
|
|
461
467
|
<TouchableScale_1.default onPress={handlePrevMatch} hitSlop={8} style={styles.navArrowBtn}>
|
|
462
|
-
<ArrowUpIcon color=
|
|
468
|
+
<ArrowUpIcon color={AppColors_1.AppColors.grayTextStrong} size={14}/>
|
|
463
469
|
</TouchableScale_1.default>
|
|
464
470
|
<TouchableScale_1.default onPress={handleNextMatch} hitSlop={8} style={styles.navArrowBtn}>
|
|
465
|
-
<ArrowDownIcon color=
|
|
471
|
+
<ArrowDownIcon color={AppColors_1.AppColors.grayTextStrong} size={14}/>
|
|
466
472
|
</TouchableScale_1.default>
|
|
467
473
|
</react_native_1.View>)}
|
|
468
474
|
|
|
@@ -470,7 +476,7 @@ const CodeSnippet = ({ code, language, }) => {
|
|
|
470
476
|
</react_native_1.View>
|
|
471
477
|
|
|
472
478
|
{/* Code Snippet list container */}
|
|
473
|
-
<react_native_1.View style={styles.container}>
|
|
479
|
+
<react_native_1.View style={[styles.container, { backgroundColor: AppColors_1.AppColors.grayBackground, borderColor: AppColors_1.AppColors.grayBorderSecondary }]}>
|
|
474
480
|
<react_native_1.FlatList ref={flatListRef} data={visibleLines} renderItem={renderLine} keyExtractor={(_, index) => String(index)} maxToRenderPerBatch={30} windowSize={5} initialNumToRender={50} removeClippedSubviews={react_native_1.Platform.OS === 'android'} onEndReached={handleEndReached} onEndReachedThreshold={0.5} onScrollToIndexFailed={onScrollToIndexFailed}/>
|
|
475
481
|
</react_native_1.View>
|
|
476
482
|
</react_native_1.View>);
|
|
@@ -546,7 +552,9 @@ const styles = react_native_1.StyleSheet.create({
|
|
|
546
552
|
paddingVertical: 1,
|
|
547
553
|
},
|
|
548
554
|
activeMatchRow: {
|
|
549
|
-
backgroundColor: 'rgba(234, 179, 8, 0.
|
|
555
|
+
backgroundColor: 'rgba(234, 179, 8, 0.22)',
|
|
556
|
+
borderLeftWidth: 4,
|
|
557
|
+
borderLeftColor: '#EAB308',
|
|
550
558
|
},
|
|
551
559
|
gutter: {
|
|
552
560
|
width: 40,
|
|
@@ -559,8 +567,8 @@ const styles = react_native_1.StyleSheet.create({
|
|
|
559
567
|
paddingTop: 1,
|
|
560
568
|
},
|
|
561
569
|
activeMatchGutter: {
|
|
562
|
-
backgroundColor: 'rgba(234, 179, 8, 0.
|
|
563
|
-
borderRightColor: 'rgba(234, 179, 8, 0.
|
|
570
|
+
backgroundColor: 'rgba(234, 179, 8, 0.35)',
|
|
571
|
+
borderRightColor: 'rgba(234, 179, 8, 0.5)',
|
|
564
572
|
},
|
|
565
573
|
lineNumber: {
|
|
566
574
|
fontFamily: monoFont,
|
|
@@ -154,6 +154,7 @@ exports.ConsoleLogCard = react_1.default.memo(function ConsoleLogCard({ item, se
|
|
|
154
154
|
const isUserLog = !isWebView && item.sourceMethod === 'log';
|
|
155
155
|
const caller = 'caller' in item ? item.caller : undefined;
|
|
156
156
|
const getLogColors = () => {
|
|
157
|
+
const isDark = AppColors_1.AppColors.primaryLight !== '#FFFFFF';
|
|
157
158
|
if (isWebView) {
|
|
158
159
|
const label = item.type.toUpperCase();
|
|
159
160
|
switch (item.type) {
|
|
@@ -163,7 +164,7 @@ exports.ConsoleLogCard = react_1.default.memo(function ConsoleLogCard({ item, se
|
|
|
163
164
|
badgeBg: `${AppColors_1.AppColors.errorColor}15`,
|
|
164
165
|
badgeText: AppColors_1.AppColors.errorColor,
|
|
165
166
|
label,
|
|
166
|
-
cardBg: '#FFF5F6',
|
|
167
|
+
cardBg: isDark ? 'rgba(239, 68, 68, 0.15)' : '#FFF5F6',
|
|
167
168
|
};
|
|
168
169
|
case 'warn':
|
|
169
170
|
return {
|
|
@@ -171,15 +172,15 @@ exports.ConsoleLogCard = react_1.default.memo(function ConsoleLogCard({ item, se
|
|
|
171
172
|
badgeBg: `${AppColors_1.AppColors.lightOrange}15`,
|
|
172
173
|
badgeText: AppColors_1.AppColors.darkOrange || AppColors_1.AppColors.lightOrange,
|
|
173
174
|
label,
|
|
174
|
-
cardBg: '#FFFDF6',
|
|
175
|
+
cardBg: isDark ? 'rgba(245, 158, 11, 0.15)' : '#FFFDF6',
|
|
175
176
|
};
|
|
176
177
|
default:
|
|
177
178
|
return {
|
|
178
179
|
border: '#475569',
|
|
179
|
-
badgeBg: '#F1F5F9',
|
|
180
|
-
badgeText: '#475569',
|
|
180
|
+
badgeBg: isDark ? '#374151' : '#F1F5F9',
|
|
181
|
+
badgeText: isDark ? '#9CA3AF' : '#475569',
|
|
181
182
|
label,
|
|
182
|
-
cardBg: '#F8FAFC',
|
|
183
|
+
cardBg: isDark ? '#1E1E24' : '#F8FAFC',
|
|
183
184
|
};
|
|
184
185
|
}
|
|
185
186
|
}
|
|
@@ -189,7 +190,7 @@ exports.ConsoleLogCard = react_1.default.memo(function ConsoleLogCard({ item, se
|
|
|
189
190
|
badgeBg: `${AppColors_1.AppColors.skyBlue}15`,
|
|
190
191
|
badgeText: AppColors_1.AppColors.skyBlue,
|
|
191
192
|
label: 'ERROR',
|
|
192
|
-
cardBg: '
|
|
193
|
+
cardBg: isDark ? 'rgba(96, 165, 250, 0.15)' : '#E6F2FF',
|
|
193
194
|
};
|
|
194
195
|
}
|
|
195
196
|
switch (item.type) {
|
|
@@ -199,7 +200,7 @@ exports.ConsoleLogCard = react_1.default.memo(function ConsoleLogCard({ item, se
|
|
|
199
200
|
badgeBg: `${AppColors_1.AppColors.errorColor}15`,
|
|
200
201
|
badgeText: AppColors_1.AppColors.errorColor,
|
|
201
202
|
label: 'ERROR',
|
|
202
|
-
cardBg: '
|
|
203
|
+
cardBg: isDark ? 'rgba(239, 68, 68, 0.15)' : '#FFF5F6',
|
|
203
204
|
};
|
|
204
205
|
case 'warn':
|
|
205
206
|
return {
|
|
@@ -207,16 +208,16 @@ exports.ConsoleLogCard = react_1.default.memo(function ConsoleLogCard({ item, se
|
|
|
207
208
|
badgeBg: `${AppColors_1.AppColors.lightOrange}15`,
|
|
208
209
|
badgeText: AppColors_1.AppColors.darkOrange || AppColors_1.AppColors.lightOrange,
|
|
209
210
|
label: 'WARN',
|
|
210
|
-
cardBg: '
|
|
211
|
+
cardBg: isDark ? 'rgba(245, 158, 11, 0.15)' : '#FFFDF6',
|
|
211
212
|
};
|
|
212
213
|
default:
|
|
213
214
|
if (isUserLog) {
|
|
214
215
|
return {
|
|
215
216
|
border: '#475569',
|
|
216
|
-
badgeBg: '#E2E8F0',
|
|
217
|
-
badgeText: '#334155',
|
|
217
|
+
badgeBg: isDark ? '#374151' : '#E2E8F0',
|
|
218
|
+
badgeText: isDark ? '#D1D5DB' : '#334155',
|
|
218
219
|
label: 'INFO',
|
|
219
|
-
cardBg: '#F1F5F9',
|
|
220
|
+
cardBg: isDark ? '#1E1E24' : '#F1F5F9',
|
|
220
221
|
};
|
|
221
222
|
}
|
|
222
223
|
return {
|
|
@@ -224,7 +225,7 @@ exports.ConsoleLogCard = react_1.default.memo(function ConsoleLogCard({ item, se
|
|
|
224
225
|
badgeBg: `${AppColors_1.AppColors.purple}15`,
|
|
225
226
|
badgeText: AppColors_1.AppColors.purple,
|
|
226
227
|
label: 'INFO',
|
|
227
|
-
cardBg: '
|
|
228
|
+
cardBg: isDark ? 'rgba(167, 139, 250, 0.12)' : '#F9F5FF',
|
|
228
229
|
};
|
|
229
230
|
}
|
|
230
231
|
};
|
|
@@ -243,84 +244,138 @@ exports.ConsoleLogCard = react_1.default.memo(function ConsoleLogCard({ item, se
|
|
|
243
244
|
borderLeftWidth: 4,
|
|
244
245
|
borderLeftColor: colors.border,
|
|
245
246
|
backgroundColor: colors.cardBg,
|
|
247
|
+
borderColor: AppColors_1.AppColors.grayBorderSecondary,
|
|
248
|
+
flexDirection: 'row',
|
|
249
|
+
alignItems: 'center',
|
|
250
|
+
paddingRight: 4,
|
|
246
251
|
},
|
|
247
252
|
]}>
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
253
|
+
|
|
254
|
+
{/* Left Content Area */}
|
|
255
|
+
<react_native_1.Pressable onPress={() => setExpanded(prev => !prev)} style={{ flex: 1, paddingRight: 6 }}>
|
|
256
|
+
|
|
257
|
+
<react_native_1.View style={styles.cardHeader}>
|
|
258
|
+
<react_native_1.View style={styles.headerLeft}>
|
|
259
|
+
<CopyButton_1.default value={item.message} label="Log message"/>
|
|
260
|
+
<react_native_1.View style={[styles.badge, { backgroundColor: colors.badgeBg }]}>
|
|
261
|
+
<react_native_1.Text style={[styles.badgeText, { color: colors.badgeText }]}>
|
|
262
|
+
{colors.label}
|
|
263
|
+
</react_native_1.Text>
|
|
264
|
+
</react_native_1.View>
|
|
265
|
+
<react_native_1.View style={[
|
|
266
|
+
styles.badge,
|
|
267
|
+
{
|
|
268
|
+
backgroundColor: 'rgba(107, 78, 255, 0.08)',
|
|
269
|
+
borderColor: 'rgba(107, 78, 255, 0.2)',
|
|
270
|
+
borderWidth: 1,
|
|
271
|
+
},
|
|
272
|
+
]}>
|
|
273
|
+
<react_native_1.Text style={[styles.badgeText, { color: '#6B4EFF' }]}>
|
|
274
|
+
console.{('sourceMethod' in item ? item.sourceMethod : undefined) || item.type || 'log'}
|
|
275
|
+
</react_native_1.Text>
|
|
276
|
+
</react_native_1.View>
|
|
277
|
+
{jsonContent && (<react_native_1.View style={[
|
|
278
|
+
styles.badge,
|
|
279
|
+
{
|
|
280
|
+
backgroundColor: 'rgba(13, 148, 136, 0.08)',
|
|
281
|
+
borderColor: 'rgba(13, 148, 136, 0.18)',
|
|
282
|
+
borderWidth: 1,
|
|
283
|
+
},
|
|
284
|
+
]}>
|
|
285
|
+
<react_native_1.Text style={[styles.badgeText, { color: '#0D9488' }]}>
|
|
286
|
+
{Array.isArray(jsonContent.data) ? `Array[${jsonContent.data.length}]` : `Object{${Object.keys(jsonContent.data).length}}`}
|
|
287
|
+
</react_native_1.Text>
|
|
288
|
+
</react_native_1.View>)}
|
|
289
|
+
{isAnalyticsError && (<react_native_1.View style={[
|
|
257
290
|
styles.badge,
|
|
258
291
|
{ backgroundColor: `${AppColors_1.AppColors.skyBlue}15` },
|
|
259
292
|
]}>
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
293
|
+
<react_native_1.Text style={[styles.badgeText, { color: AppColors_1.AppColors.skyBlue }]}>
|
|
294
|
+
Analytics
|
|
295
|
+
</react_native_1.Text>
|
|
296
|
+
</react_native_1.View>)}
|
|
297
|
+
{isUserLog && (<react_native_1.View style={[
|
|
265
298
|
styles.badge,
|
|
266
299
|
{
|
|
267
|
-
backgroundColor:
|
|
268
|
-
borderColor:
|
|
300
|
+
backgroundColor: AppColors_1.AppColors.grayBackground,
|
|
301
|
+
borderColor: AppColors_1.AppColors.grayBorderSecondary,
|
|
269
302
|
borderWidth: 1,
|
|
270
303
|
},
|
|
271
304
|
]}>
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
305
|
+
<react_native_1.Text style={[styles.badgeText, { color: AppColors_1.AppColors.grayTextStrong }]}>
|
|
306
|
+
user-log
|
|
307
|
+
</react_native_1.Text>
|
|
308
|
+
</react_native_1.View>)}
|
|
309
|
+
{isWebView && (<react_native_1.View style={[
|
|
277
310
|
styles.badge,
|
|
278
311
|
{
|
|
279
|
-
backgroundColor:
|
|
280
|
-
borderColor:
|
|
312
|
+
backgroundColor: AppColors_1.AppColors.grayBackground,
|
|
313
|
+
borderColor: AppColors_1.AppColors.grayBorderSecondary,
|
|
281
314
|
borderWidth: 1,
|
|
282
315
|
},
|
|
283
316
|
]}>
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
{caller && caller !== 'Unknown' && (<react_native_1.Text style={styles.callerText} numberOfLines={1} ellipsizeMode="middle">
|
|
317
|
+
<react_native_1.Text style={[styles.badgeText, { color: AppColors_1.AppColors.grayText }]}>
|
|
318
|
+
webview
|
|
319
|
+
</react_native_1.Text>
|
|
320
|
+
</react_native_1.View>)}
|
|
321
|
+
<react_native_1.Text style={[styles.serialNumber, { color: AppColors_1.AppColors.grayTextWeak }]}>#{item.id + 1}</react_native_1.Text>
|
|
322
|
+
<react_native_1.Text style={[styles.timestamp, { color: AppColors_1.AppColors.grayTextWeak }]}>{formatTime(item.timestamp)}</react_native_1.Text>
|
|
323
|
+
</react_native_1.View>
|
|
324
|
+
|
|
325
|
+
{caller && caller !== 'Unknown' && (<react_native_1.Text style={[styles.callerText, { color: AppColors_1.AppColors.grayTextWeak, marginRight: 4 }]} numberOfLines={1} ellipsizeMode="middle">
|
|
293
326
|
{caller.split('/').pop() || caller}
|
|
294
327
|
</react_native_1.Text>)}
|
|
295
|
-
<react_native_1.View style={{ transform: [{ rotate: expanded ? '180deg' : '0deg' }] }}>
|
|
296
|
-
<NetworkIcons_1.ChevronIcon size={14} color={AppColors_1.AppColors.grayTextWeak}/>
|
|
297
|
-
</react_native_1.View>
|
|
298
328
|
</react_native_1.View>
|
|
329
|
+
|
|
330
|
+
<react_native_1.View style={[styles.cardBody, { backgroundColor: AppColors_1.AppColors.primaryLight, borderColor: AppColors_1.AppColors.dividerColor }]}>
|
|
331
|
+
{jsonContent ? (<>
|
|
332
|
+
{jsonContent.header ? (<react_native_1.Pressable onPress={() => setExpanded(prev => !prev)}>
|
|
333
|
+
{getLogMessageWithBadges(jsonContent.header, searchStr, [styles.messageText, { color: AppColors_1.AppColors.primaryBlack }], styles.highlight, numLines)}
|
|
334
|
+
</react_native_1.Pressable>) : null}
|
|
335
|
+
{expanded ? (<react_native_1.View style={[styles.jsonContainer, { backgroundColor: AppColors_1.AppColors.grayBackground, borderColor: AppColors_1.AppColors.dividerColor }]}>
|
|
336
|
+
<JsonViewer_1.default data={jsonContent.data} search={searchStr} forceOpen={expanded}/>
|
|
337
|
+
</react_native_1.View>) : (<react_native_1.Pressable onPress={() => setExpanded(prev => !prev)} style={[styles.jsonPreviewContainer, { backgroundColor: AppColors_1.AppColors.grayBackground, borderColor: AppColors_1.AppColors.dividerColor }]}>
|
|
338
|
+
<HighlightText_1.default text={getJsonPreviewText(jsonContent.data).text} search={searchStr} style={[styles.jsonPreviewText, { color: AppColors_1.AppColors.primaryBlack }]} highlightStyle={styles.highlight} detectLinks={true}/>
|
|
339
|
+
</react_native_1.Pressable>)}
|
|
340
|
+
</>) : (<react_native_1.Pressable onPress={() => setExpanded(prev => !prev)}>
|
|
341
|
+
{getLogMessageWithBadges(item.message, searchStr, [styles.messageText, { color: AppColors_1.AppColors.primaryBlack }], styles.highlight, numLines)}
|
|
342
|
+
</react_native_1.Pressable>)}
|
|
343
|
+
{hasLongMessage && (<react_native_1.Pressable onPress={() => setExpanded(prev => !prev)} style={styles.seeMoreBtn} hitSlop={8}>
|
|
344
|
+
<react_native_1.Text style={styles.seeMoreText}>
|
|
345
|
+
{expanded ? 'See Less' : 'See More'}
|
|
346
|
+
</react_native_1.Text>
|
|
347
|
+
</react_native_1.Pressable>)}
|
|
348
|
+
</react_native_1.View>
|
|
349
|
+
|
|
350
|
+
{expanded && (<react_native_1.View style={[styles.cardFooter, { borderTopColor: AppColors_1.AppColors.dividerColor, gap: 6 }]}>
|
|
351
|
+
<react_native_1.View style={{ flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center' }}>
|
|
352
|
+
<react_native_1.Text style={{ fontFamily: AppFonts_1.AppFonts.interRegular, fontSize: 10.5, color: AppColors_1.AppColors.grayTextWeak }}>
|
|
353
|
+
Length: {item.message.length} chars • Size: {encodeURIComponent(item.message).replace(/%[0-9A-F]{2}/g, 'a').length} bytes
|
|
354
|
+
</react_native_1.Text>
|
|
355
|
+
</react_native_1.View>
|
|
356
|
+
{caller && caller !== 'Unknown' && (<react_native_1.View style={{ flexDirection: 'row', alignItems: 'center', justifyContent: 'space-between', marginTop: 4 }}>
|
|
357
|
+
<react_native_1.Text style={[styles.fullCallerText, { color: AppColors_1.AppColors.grayText, flex: 1, marginRight: 8 }]} numberOfLines={2}>
|
|
358
|
+
Caller: {caller}
|
|
359
|
+
</react_native_1.Text>
|
|
360
|
+
<CopyButton_1.default value={caller} label="Caller stack frame"/>
|
|
361
|
+
</react_native_1.View>)}
|
|
362
|
+
</react_native_1.View>)}
|
|
299
363
|
</react_native_1.Pressable>
|
|
300
364
|
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
{hasLongMessage && (<react_native_1.Pressable onPress={() => setExpanded(prev => !prev)} style={styles.seeMoreBtn} hitSlop={8}>
|
|
315
|
-
<react_native_1.Text style={styles.seeMoreText}>
|
|
316
|
-
{expanded ? 'See Less' : 'See More'}
|
|
317
|
-
</react_native_1.Text>
|
|
318
|
-
</react_native_1.Pressable>)}
|
|
319
|
-
</react_native_1.View>
|
|
365
|
+
{/* Right Isolated Chevron Area */}
|
|
366
|
+
<react_native_1.Pressable onPress={() => setExpanded(prev => !prev)} style={{
|
|
367
|
+
width: 28,
|
|
368
|
+
alignItems: 'center',
|
|
369
|
+
justifyContent: 'center',
|
|
370
|
+
alignSelf: expanded ? 'flex-start' : 'center',
|
|
371
|
+
marginTop: expanded ? 8 : 0,
|
|
372
|
+
height: expanded ? 32 : undefined,
|
|
373
|
+
}} hitSlop={12}>
|
|
374
|
+
<react_native_1.View style={{ transform: [{ rotate: expanded ? '180deg' : '0deg' }] }}>
|
|
375
|
+
<NetworkIcons_1.ChevronIcon size={16} color={AppColors_1.AppColors.grayTextWeak}/>
|
|
376
|
+
</react_native_1.View>
|
|
377
|
+
</react_native_1.Pressable>
|
|
320
378
|
|
|
321
|
-
{caller && caller !== 'Unknown' && expanded && (<react_native_1.View style={styles.cardFooter}>
|
|
322
|
-
<react_native_1.Text style={styles.fullCallerText}>Caller: {caller}</react_native_1.Text>
|
|
323
|
-
</react_native_1.View>)}
|
|
324
379
|
</react_native_1.View>
|
|
325
380
|
</react_native_1.View>);
|
|
326
381
|
});
|
|
@@ -353,7 +408,9 @@ const styles = react_native_1.StyleSheet.create({
|
|
|
353
408
|
headerLeft: {
|
|
354
409
|
flexDirection: 'row',
|
|
355
410
|
alignItems: 'center',
|
|
356
|
-
|
|
411
|
+
flexWrap: 'wrap',
|
|
412
|
+
gap: 6,
|
|
413
|
+
flex: 1,
|
|
357
414
|
},
|
|
358
415
|
badge: {
|
|
359
416
|
paddingHorizontal: 6,
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
declare const JsonViewer: ({ data, search, forceOpen, }: {
|
|
2
|
+
declare const JsonViewer: ({ data, search, forceOpen, defaultExpandDepth, }: {
|
|
3
3
|
data: unknown;
|
|
4
4
|
search?: string;
|
|
5
5
|
forceOpen?: boolean;
|
|
6
|
+
defaultExpandDepth?: number;
|
|
6
7
|
}) => React.JSX.Element;
|
|
7
8
|
export default JsonViewer;
|
|
@@ -9,10 +9,10 @@ const react_native_1 = require("react-native");
|
|
|
9
9
|
const TreeNode_1 = __importDefault(require("./TreeNode"));
|
|
10
10
|
// Stylesheet
|
|
11
11
|
const styles_1 = __importDefault(require("../styles"));
|
|
12
|
-
const JsonViewer = ({ data, search, forceOpen, }) => {
|
|
12
|
+
const JsonViewer = ({ data, search, forceOpen, defaultExpandDepth, }) => {
|
|
13
13
|
return (<react_native_1.ScrollView horizontal showsHorizontalScrollIndicator={true} style={styles_1.default.codeBlockScroll}>
|
|
14
14
|
<react_native_1.View style={styles_1.default.codeBlock}>
|
|
15
|
-
<TreeNode_1.default data={data} search={search} forceOpen={forceOpen}/>
|
|
15
|
+
<TreeNode_1.default data={data} search={search} forceOpen={forceOpen} defaultExpandDepth={defaultExpandDepth}/>
|
|
16
16
|
</react_native_1.View>
|
|
17
17
|
</react_native_1.ScrollView>);
|
|
18
18
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { MetaAccordionProps } from '../types';
|
|
3
|
-
declare const MetaAccordion: ({ status, statusColor, duration, size, triggeredAt, }: MetaAccordionProps) => React.JSX.Element;
|
|
3
|
+
declare const MetaAccordion: ({ status, statusColor, duration, size, triggeredAt, method, contentType, url, }: MetaAccordionProps) => React.JSX.Element;
|
|
4
4
|
export default MetaAccordion;
|
|
@@ -16,8 +16,9 @@ const NetworkIcons_1 = require("./NetworkIcons");
|
|
|
16
16
|
// Stylesheet
|
|
17
17
|
const AppColors_1 = require("../styles/AppColors");
|
|
18
18
|
const styles_1 = __importDefault(require("../styles"));
|
|
19
|
-
const
|
|
20
|
-
|
|
19
|
+
const AppFonts_1 = require("../styles/AppFonts");
|
|
20
|
+
const MetaAccordion = ({ status, statusColor, duration, size, triggeredAt, method, contentType, url, }) => {
|
|
21
|
+
const { toggleOpen, chevronStyle, bodyStyle } = (0, useAccordion_1.default)(true, 400, 390);
|
|
21
22
|
const isFailed = status === 0 || status == null;
|
|
22
23
|
return (<react_native_1.View style={styles_1.default.metaContainer}>
|
|
23
24
|
<react_native_1.Pressable onPress={toggleOpen} hitSlop={12}>
|
|
@@ -44,6 +45,26 @@ const MetaAccordion = ({ status, statusColor, duration, size, triggeredAt, }) =>
|
|
|
44
45
|
</react_native_1.Text>
|
|
45
46
|
</react_native_1.View>
|
|
46
47
|
<react_native_1.View style={styles_1.default.metaDivider}/>
|
|
48
|
+
|
|
49
|
+
<react_native_1.View style={styles_1.default.metaRow}>
|
|
50
|
+
<react_native_1.View style={styles_1.default.metaLabelRow}>
|
|
51
|
+
<NetworkIcons_1.TerminalIcon color={AppColors_1.AppColors.grayTextWeak} size={14}/>
|
|
52
|
+
<react_native_1.Text style={styles_1.default.metaLabel}>Method</react_native_1.Text>
|
|
53
|
+
</react_native_1.View>
|
|
54
|
+
<react_native_1.View style={[
|
|
55
|
+
styles_1.default.statusChip,
|
|
56
|
+
{
|
|
57
|
+
borderColor: 'rgba(107, 78, 255, 0.25)',
|
|
58
|
+
backgroundColor: 'rgba(107, 78, 255, 0.08)',
|
|
59
|
+
}
|
|
60
|
+
]}>
|
|
61
|
+
<react_native_1.Text style={[styles_1.default.statusText, { color: AppColors_1.AppColors.purple, fontFamily: AppFonts_1.AppFonts.interBold }]}>
|
|
62
|
+
{method || 'GET'}
|
|
63
|
+
</react_native_1.Text>
|
|
64
|
+
</react_native_1.View>
|
|
65
|
+
</react_native_1.View>
|
|
66
|
+
<react_native_1.View style={styles_1.default.metaDivider}/>
|
|
67
|
+
|
|
47
68
|
<react_native_1.View style={styles_1.default.metaRow}>
|
|
48
69
|
<react_native_1.View style={styles_1.default.metaLabelRow}>
|
|
49
70
|
<NetworkIcons_1.StatusIcon color={AppColors_1.AppColors.grayTextWeak}/>
|
|
@@ -69,6 +90,16 @@ const MetaAccordion = ({ status, statusColor, duration, size, triggeredAt, }) =>
|
|
|
69
90
|
</react_native_1.View>
|
|
70
91
|
</react_native_1.View>
|
|
71
92
|
<react_native_1.View style={styles_1.default.metaDivider}/>
|
|
93
|
+
|
|
94
|
+
<react_native_1.View style={styles_1.default.metaRow}>
|
|
95
|
+
<react_native_1.View style={styles_1.default.metaLabelRow}>
|
|
96
|
+
<NetworkIcons_1.GlobeIcon color={AppColors_1.AppColors.grayTextWeak} size={14}/>
|
|
97
|
+
<react_native_1.Text style={styles_1.default.metaLabel}>Content Type</react_native_1.Text>
|
|
98
|
+
</react_native_1.View>
|
|
99
|
+
<react_native_1.Text style={styles_1.default.metaValue}>{contentType || 'application/json'}</react_native_1.Text>
|
|
100
|
+
</react_native_1.View>
|
|
101
|
+
<react_native_1.View style={styles_1.default.metaDivider}/>
|
|
102
|
+
|
|
72
103
|
<react_native_1.View style={styles_1.default.metaRow}>
|
|
73
104
|
<react_native_1.View style={styles_1.default.metaLabelRow}>
|
|
74
105
|
<NetworkIcons_1.ClockIcon color={AppColors_1.AppColors.grayTextWeak} size={14}/>
|
|
@@ -99,6 +130,7 @@ const MetaAccordion = ({ status, statusColor, duration, size, triggeredAt, }) =>
|
|
|
99
130
|
</react_native_1.View>
|
|
100
131
|
</react_native_1.View>
|
|
101
132
|
<react_native_1.View style={styles_1.default.metaDivider}/>
|
|
133
|
+
|
|
102
134
|
<react_native_1.View style={styles_1.default.metaRow}>
|
|
103
135
|
<react_native_1.View style={styles_1.default.metaLabelRow}>
|
|
104
136
|
<NetworkIcons_1.SizeIcon color={AppColors_1.AppColors.grayTextWeak}/>
|
|
@@ -106,6 +138,17 @@ const MetaAccordion = ({ status, statusColor, duration, size, triggeredAt, }) =>
|
|
|
106
138
|
</react_native_1.View>
|
|
107
139
|
<react_native_1.Text style={styles_1.default.metaValue}>{size}</react_native_1.Text>
|
|
108
140
|
</react_native_1.View>
|
|
141
|
+
<react_native_1.View style={styles_1.default.metaDivider}/>
|
|
142
|
+
|
|
143
|
+
<react_native_1.View style={[styles_1.default.metaRow, { alignItems: 'flex-start' }]}>
|
|
144
|
+
<react_native_1.View style={styles_1.default.metaLabelRow}>
|
|
145
|
+
<NetworkIcons_1.GlobeIcon color={AppColors_1.AppColors.grayTextWeak} size={14}/>
|
|
146
|
+
<react_native_1.Text style={styles_1.default.metaLabel}>Full URL</react_native_1.Text>
|
|
147
|
+
</react_native_1.View>
|
|
148
|
+
<react_native_1.Text selectable={true} numberOfLines={3} ellipsizeMode="tail" style={[styles_1.default.metaValue, { fontSize: 11.5, color: AppColors_1.AppColors.grayTextWeak, flex: 1, textAlign: 'right', lineHeight: 16 }]}>
|
|
149
|
+
{url || '—'}
|
|
150
|
+
</react_native_1.Text>
|
|
151
|
+
</react_native_1.View>
|
|
109
152
|
</react_native_1.View>
|
|
110
153
|
</react_native_1.Animated.View>
|
|
111
154
|
</react_native_1.View>);
|
|
@@ -34,3 +34,11 @@ export declare const InsightsIcon: ({ color, size, }: any) => React.JSX.Element;
|
|
|
34
34
|
export declare const DebugIcon: ({ color, size }: any) => React.JSX.Element;
|
|
35
35
|
export declare const SunIcon: ({ color, size }: any) => React.JSX.Element;
|
|
36
36
|
export declare const MoonIcon: ({ color, size }: any) => React.JSX.Element;
|
|
37
|
+
export { BrandCircleIcon } from './BrandCircleIcon';
|
|
38
|
+
export { BrandSquareIcon } from './BrandSquareIcon';
|
|
39
|
+
export declare const HtmlIcon: ({ color, size }: any) => React.JSX.Element;
|
|
40
|
+
export declare const CssIcon: ({ color, size }: any) => React.JSX.Element;
|
|
41
|
+
export declare const JsIcon: ({ color, size }: any) => React.JSX.Element;
|
|
42
|
+
export declare const EyeIcon: ({ color, size }: any) => React.JSX.Element;
|
|
43
|
+
export declare const SettingsIcon: ({ color, size }: any) => React.JSX.Element;
|
|
44
|
+
export declare const FolderIcon: ({ color, size }: any) => React.JSX.Element;
|