react-native-inapp-inspector 1.1.28 → 1.1.29

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.
Files changed (57) hide show
  1. package/android/src/main/java/com/inappinspector/NetworkInspectorModule.java +29 -80
  2. package/dist/commonjs/components/AppHeaderLogo.js +12 -15
  3. package/dist/commonjs/components/ConsoleLogCard.js +31 -7
  4. package/dist/commonjs/components/CopyButton.js +15 -1
  5. package/dist/commonjs/components/DomainHeader.js +56 -28
  6. package/dist/commonjs/components/HighlightText.js +7 -1
  7. package/dist/commonjs/components/Inspector/AnalyticsTab.js +35 -21
  8. package/dist/commonjs/components/Inspector/InspectorHeader.js +17 -3
  9. package/dist/commonjs/components/Inspector/LogDetail.js +8 -5
  10. package/dist/commonjs/components/Inspector/MainScreen.js +4 -0
  11. package/dist/commonjs/components/Inspector/NetworkDetail.js +24 -24
  12. package/dist/commonjs/components/JsonViewer.js +25 -3
  13. package/dist/commonjs/components/LogCard.js +103 -11
  14. package/dist/commonjs/components/Toast.d.ts +3 -0
  15. package/dist/commonjs/components/Toast.js +152 -0
  16. package/dist/commonjs/components/TouchableScale.d.ts +1 -0
  17. package/dist/commonjs/components/TouchableScale.js +3 -3
  18. package/dist/commonjs/components/TreeNode.js +1 -1
  19. package/dist/commonjs/constants/index.js +6 -6
  20. package/dist/commonjs/constants/version.d.ts +1 -1
  21. package/dist/commonjs/constants/version.js +1 -1
  22. package/dist/commonjs/helpers/index.d.ts +4 -0
  23. package/dist/commonjs/helpers/index.js +91 -92
  24. package/dist/commonjs/helpers/toast.d.ts +4 -0
  25. package/dist/commonjs/helpers/toast.js +20 -0
  26. package/dist/commonjs/i18n/locales/en.json +4 -1
  27. package/dist/commonjs/styles/index.d.ts +60 -14
  28. package/dist/commonjs/styles/index.js +71 -26
  29. package/dist/esm/components/AppHeaderLogo.js +12 -15
  30. package/dist/esm/components/ConsoleLogCard.js +33 -9
  31. package/dist/esm/components/CopyButton.js +15 -1
  32. package/dist/esm/components/DomainHeader.js +56 -28
  33. package/dist/esm/components/HighlightText.js +7 -1
  34. package/dist/esm/components/Inspector/AnalyticsTab.js +36 -22
  35. package/dist/esm/components/Inspector/InspectorHeader.js +18 -4
  36. package/dist/esm/components/Inspector/LogDetail.js +10 -7
  37. package/dist/esm/components/Inspector/MainScreen.js +4 -0
  38. package/dist/esm/components/Inspector/NetworkDetail.js +25 -25
  39. package/dist/esm/components/JsonViewer.js +25 -3
  40. package/dist/esm/components/LogCard.js +105 -13
  41. package/dist/esm/components/Toast.d.ts +3 -0
  42. package/dist/esm/components/Toast.js +117 -0
  43. package/dist/esm/components/TouchableScale.d.ts +1 -0
  44. package/dist/esm/components/TouchableScale.js +3 -3
  45. package/dist/esm/components/TreeNode.js +1 -1
  46. package/dist/esm/constants/index.js +6 -6
  47. package/dist/esm/constants/version.d.ts +1 -1
  48. package/dist/esm/constants/version.js +1 -1
  49. package/dist/esm/helpers/index.d.ts +4 -0
  50. package/dist/esm/helpers/index.js +86 -92
  51. package/dist/esm/helpers/toast.d.ts +4 -0
  52. package/dist/esm/helpers/toast.js +15 -0
  53. package/dist/esm/i18n/locales/en.json +4 -1
  54. package/dist/esm/styles/index.d.ts +60 -14
  55. package/dist/esm/styles/index.js +71 -26
  56. package/ios/NetworkInspectorModule.m +0 -10
  57. package/package.json +4 -1
@@ -25,6 +25,26 @@ const NetworkIcons_1 = require("../NetworkIcons");
25
25
  const NetworkDetail = react_1.default.memo(() => {
26
26
  const { t } = (0, i18n_1.useTranslation)();
27
27
  const { selected, detailDisplayUrl, apiDetailActiveTab, setApiDetailActiveTab, detailSearch, setDetailSearch, reqExpanded, setReqExpanded, resExpanded, setResExpanded, showReqDiff, setShowReqDiff, showResDiff, setShowResDiff, prevRequestData, prevResponseData, logRouteMapRef, } = (0, InspectorContext_1.useInspector)();
28
+ const handleOpenUrl = () => {
29
+ react_native_1.Alert.alert(t('common.openInBrowser') || 'Open in Browser', `${t('common.openInBrowserPrompt') || 'Are you sure you want to open this URL in your external browser?'}\n\n${detailDisplayUrl}`, [
30
+ { text: t('common.cancel') || 'Cancel', style: 'cancel' },
31
+ {
32
+ text: t('common.open') || 'Open',
33
+ onPress: () => {
34
+ react_native_1.Linking.canOpenURL(detailDisplayUrl)
35
+ .then(supported => {
36
+ if (supported) {
37
+ react_native_1.Linking.openURL(detailDisplayUrl);
38
+ }
39
+ else {
40
+ react_native_1.Linking.openURL(detailDisplayUrl).catch(() => { });
41
+ }
42
+ })
43
+ .catch(() => { });
44
+ },
45
+ },
46
+ ]);
47
+ };
28
48
  if (!selected)
29
49
  return null;
30
50
  return (<react_native_1.View style={{ flex: 1 }}>
@@ -232,7 +252,7 @@ const NetworkDetail = react_1.default.memo(() => {
232
252
  </react_native_1.View>
233
253
 
234
254
  <react_native_1.View style={styles_1.default.detailInfoRight}>
235
- <TouchableScale_1.default style={[styles_1.default.iconSquareBtn, { backgroundColor: `${AppColors_1.AppColors.sky600}15` }]} onPress={() => react_native_1.Linking.openURL(detailDisplayUrl)} hitSlop={12}>
255
+ <TouchableScale_1.default style={[styles_1.default.iconSquareBtn, { backgroundColor: `${AppColors_1.AppColors.sky600}15` }]} onPress={handleOpenUrl} hitSlop={12}>
236
256
  <NetworkIcons_1.ExternalLinkIcon color={AppColors_1.AppColors.sky600} size={14}/>
237
257
  </TouchableScale_1.default>
238
258
  <CopyButton_1.default value={(0, helpers_1.getFetchCommand)(selected)} label="fetch()" iconType="fetch"/>
@@ -250,7 +270,7 @@ const NetworkDetail = react_1.default.memo(() => {
250
270
  padding: 10,
251
271
  marginTop: 8,
252
272
  gap: 6,
253
- }} onPress={() => react_native_1.Linking.openURL(detailDisplayUrl)}>
273
+ }} onPress={handleOpenUrl}>
254
274
  <react_native_1.View style={{
255
275
  flexDirection: 'row',
256
276
  alignItems: 'center',
@@ -433,7 +453,7 @@ const NetworkDetail = react_1.default.memo(() => {
433
453
  if (!reqExpanded && !showReqDiff)
434
454
  setReqExpanded(true);
435
455
  }}/>
436
- {showReqDiff ? (<DiffViewer_1.default oldData={prevRequestData} newData={selected.request} forceOpen={reqExpanded}/>) : reqExpanded ? (<JsonViewer_1.default data={selected.request} search={detailSearch} forceOpen/>) : (<react_native_1.View style={styles_1.default.codeBlock}>
456
+ {showReqDiff ? (<DiffViewer_1.default oldData={prevRequestData} newData={selected.request} forceOpen={reqExpanded}/>) : reqExpanded ? (<JsonViewer_1.default data={selected.request} search={detailSearch}/>) : (<react_native_1.View style={styles_1.default.codeBlock}>
437
457
  <react_native_1.Text style={[
438
458
  styles_1.default.codeText,
439
459
  { color: AppColors_1.AppColors.grayTextWeak },
@@ -452,26 +472,6 @@ const NetworkDetail = react_1.default.memo(() => {
452
472
  <NetworkIcons_1.ClearIcon color={AppColors_1.AppColors.grayTextWeak} size={14}/>
453
473
  </react_native_1.Pressable>)}
454
474
  </react_native_1.View>
455
- {selected.response != null && (<react_native_1.View style={{
456
- flexDirection: 'row',
457
- alignItems: 'center',
458
- gap: 4,
459
- paddingHorizontal: 10,
460
- height: 34,
461
- borderRadius: 8,
462
- borderWidth: 1,
463
- borderColor: `${AppColors_1.AppColors.purple}30`,
464
- backgroundColor: `${AppColors_1.AppColors.purple}10`,
465
- }}>
466
- <NetworkIcons_1.SizeIcon color={AppColors_1.AppColors.purple} size={12}/>
467
- <react_native_1.Text style={{
468
- fontFamily: AppFonts_1.AppFonts.interBold,
469
- fontSize: 10.5,
470
- color: AppColors_1.AppColors.purple,
471
- }}>
472
- {(0, helpers_1.getSize)(selected.response)}
473
- </react_native_1.Text>
474
- </react_native_1.View>)}
475
475
  </react_native_1.View>
476
476
 
477
477
  <react_native_1.View style={styles_1.default.sectionContainer}>
@@ -480,7 +480,7 @@ const NetworkDetail = react_1.default.memo(() => {
480
480
  if (!resExpanded && !showResDiff)
481
481
  setResExpanded(true);
482
482
  }}/>
483
- {showResDiff ? (<DiffViewer_1.default oldData={prevResponseData} newData={selected.response} forceOpen={resExpanded}/>) : resExpanded ? (<JsonViewer_1.default data={selected.response} search={detailSearch} forceOpen wrap/>) : (<react_native_1.View style={styles_1.default.codeBlock}>
483
+ {showResDiff ? (<DiffViewer_1.default oldData={prevResponseData} newData={selected.response} forceOpen={resExpanded}/>) : resExpanded ? (<JsonViewer_1.default data={selected.response} search={detailSearch} wrap/>) : (<react_native_1.View style={styles_1.default.codeBlock}>
484
484
  <react_native_1.Text style={[
485
485
  styles_1.default.codeText,
486
486
  { color: AppColors_1.AppColors.grayTextWeak },
@@ -95,7 +95,7 @@ const JsonTableRow = react_1.default.memo(({ itemKey, val, search, }) => {
95
95
  // ── JsonViewer Component ─────────────────────────────────────────────────────
96
96
  const JsonViewer = react_1.default.memo(({ data, search, forceOpen, defaultExpandDepth, wrap, fullHeight = false, maxHeight, mode: externalMode, onModeChange, hideTabs = false, }) => {
97
97
  const { t } = (0, i18n_1.useTranslation)();
98
- const [internalMode, setInternalMode] = (0, react_1.useState)('pretty');
98
+ const [internalMode, setInternalMode] = (0, react_1.useState)('raw');
99
99
  const mode = externalMode ?? internalMode;
100
100
  const setMode = (newMode) => {
101
101
  if (onModeChange) {
@@ -116,6 +116,10 @@ const JsonViewer = react_1.default.memo(({ data, search, forceOpen, defaultExpan
116
116
  return String(data);
117
117
  }
118
118
  }, [data]);
119
+ const [showFullRaw, setShowFullRaw] = (0, react_1.useState)(false);
120
+ const RAW_LIMIT = 50000;
121
+ const isTruncated = rawText.length > RAW_LIMIT && !showFullRaw;
122
+ const displayRawText = isTruncated ? rawText.slice(0, RAW_LIMIT) : rawText;
119
123
  (0, react_1.useEffect)(() => {
120
124
  if (externalMode) {
121
125
  setInternalMode(externalMode);
@@ -186,7 +190,7 @@ const JsonViewer = react_1.default.memo(({ data, search, forceOpen, defaultExpan
186
190
  <react_native_1.View style={contentWrapperStyle}>
187
191
  {mode === 'pretty' && (isEmpty ? (<react_native_1.View style={localStyles.emptyTable}>
188
192
  <react_native_1.Text style={localStyles.emptyTableText}>
189
- {t('network.emptyResponse')}
193
+ {t('network.jsonViewer.emptyPayload')}
190
194
  </react_native_1.Text>
191
195
  </react_native_1.View>) : (wrap ? (fullHeight ? (<react_native_1.ScrollView style={{ flex: 1 }} contentContainerStyle={{ flexGrow: 1 }}>
192
196
  <react_native_1.View style={[styles_1.default.codeBlock, { width: '100%' }]}>{tree}</react_native_1.View>
@@ -201,12 +205,30 @@ const JsonViewer = react_1.default.memo(({ data, search, forceOpen, defaultExpan
201
205
  </react_native_1.ScrollView>))))}
202
206
 
203
207
  {mode === 'raw' && (<react_native_1.ScrollView style={scrollStyle} contentContainerStyle={localStyles.rawContainer} showsVerticalScrollIndicator={true} nestedScrollEnabled={true}>
204
- <HighlightText_1.default text={rawText} search={search} detectLinks={true} style={localStyles.rawPlainText} highlightStyle={{
208
+ <HighlightText_1.default text={displayRawText} search={search} detectLinks={rawText.length < 20000} style={localStyles.rawPlainText} selectable={true} highlightStyle={{
205
209
  backgroundColor: AppColors_1.AppColors.yellowHighlight,
206
210
  color: AppColors_1.AppColors.primaryBlack,
207
211
  borderRadius: 3,
208
212
  paddingHorizontal: 2,
209
213
  }}/>
214
+ {isTruncated && (<react_native_1.TouchableOpacity onPress={() => setShowFullRaw(true)} style={{
215
+ marginTop: 10,
216
+ backgroundColor: `${AppColors_1.AppColors.brandPurple}15`,
217
+ paddingVertical: 8,
218
+ paddingHorizontal: 12,
219
+ borderRadius: 6,
220
+ alignItems: 'center',
221
+ borderWidth: 1,
222
+ borderColor: `${AppColors_1.AppColors.brandPurple}30`,
223
+ }}>
224
+ <react_native_1.Text style={{
225
+ fontFamily: AppFonts_1.AppFonts.interBold,
226
+ fontSize: 11,
227
+ color: AppColors_1.AppColors.brandPurple,
228
+ }}>
229
+ Showing first 50 KB ({Math.round(rawText.length / 1024)} KB total) · Tap to load full
230
+ </react_native_1.Text>
231
+ </react_native_1.TouchableOpacity>)}
210
232
  </react_native_1.ScrollView>)}
211
233
 
212
234
  {mode === 'table' && (fullHeight ? (<react_native_1.ScrollView style={scrollStyle}>
@@ -51,6 +51,27 @@ const i18n_1 = require("../i18n");
51
51
  const LogCard = react_1.default.memo(function LogCard({ item, onPress, timelineMinStart, timelineTotalRange, isNew, isSelected, onToggleSelect, searchStr, }) {
52
52
  const { t } = (0, i18n_1.useTranslation)();
53
53
  const methodColor = constants_1.METHOD_COLORS[item.method] ?? constants_1.METHOD_COLORS.ALL;
54
+ const handleOpenUrl = (e) => {
55
+ e?.stopPropagation?.();
56
+ react_native_1.Alert.alert(t('common.openInBrowser') || 'Open in Browser', `${t('common.openInBrowserPrompt') || 'Are you sure you want to open this URL in your external browser?'}\n\n${item.url}`, [
57
+ { text: t('common.cancel') || 'Cancel', style: 'cancel' },
58
+ {
59
+ text: t('common.open') || 'Open',
60
+ onPress: () => {
61
+ react_native_1.Linking.canOpenURL(item.url)
62
+ .then(supported => {
63
+ if (supported) {
64
+ react_native_1.Linking.openURL(item.url);
65
+ }
66
+ else {
67
+ react_native_1.Linking.openURL(item.url).catch(() => { });
68
+ }
69
+ })
70
+ .catch(() => { });
71
+ },
72
+ },
73
+ ]);
74
+ };
54
75
  const isFailed = item.status === 0 || (item.status != null && item.status >= 400);
55
76
  const isLoading = item.status == null;
56
77
  const statusColor = (0, helpers_1.getStatusColor)(item.status);
@@ -76,10 +97,6 @@ const LogCard = react_1.default.memo(function LogCard({ item, onPress, timelineM
76
97
  }).start();
77
98
  }
78
99
  }, [isNew]);
79
- const path = (0, helpers_1.getPath)(item.url);
80
- const baseUrl = (0, helpers_1.getBaseUrl)(item.url) || item.url;
81
- const slug = path && path !== '/' ? path : item.url;
82
- const showSlug = slug !== baseUrl && slug !== item.url;
83
100
  const triggeredAt = (0, helpers_1.formatDateTime)(item.startTime);
84
101
  const isJson = item.url.split('?')[0].toLowerCase().endsWith('.json');
85
102
  return (<TouchableScale_1.default onPress={onPress} style={[
@@ -90,7 +107,7 @@ const LogCard = react_1.default.memo(function LogCard({ item, onPress, timelineM
90
107
  },
91
108
  ]}>
92
109
  <react_native_1.View style={styles_1.default.cardBody}>
93
- {/* Row 1: Header (Checkbox, Serial, Method Badge, Base URL / Host with HTTPS, Status Pill) */}
110
+ {/* Row 1: Header (Checkbox, Serial, Method Badge, Client Tag, Status Pill) */}
94
111
  <react_native_1.View style={styles_1.default.cardHeaderRow}>
95
112
  <react_native_1.View style={styles_1.default.cardHeaderLeft}>
96
113
  <react_native_1.Pressable onPress={() => onToggleSelect(item.id)} hitSlop={12} style={[
@@ -150,7 +167,82 @@ const LogCard = react_1.default.memo(function LogCard({ item, onPress, timelineM
150
167
  </react_native_1.Text>
151
168
  </react_native_1.View>)}
152
169
 
153
- <HighlightText_1.default text={baseUrl || item.url} search={searchStr} style={styles_1.default.cardHostText} highlightStyle={styles_1.default.highlight} numberOfLines={1} ellipsizeMode="tail"/>
170
+ {/* Protocol / HTTPS Badge */}
171
+ <react_native_1.View style={[
172
+ styles_1.default.chip,
173
+ {
174
+ backgroundColor: item.url.toLowerCase().startsWith('https')
175
+ ? '#ECFDF5'
176
+ : '#FFFBEB',
177
+ borderColor: item.url.toLowerCase().startsWith('https')
178
+ ? '#A7F3D0'
179
+ : '#FDE68A',
180
+ paddingHorizontal: 4,
181
+ paddingVertical: 1,
182
+ borderRadius: 4,
183
+ },
184
+ ]}>
185
+ <react_native_1.Text style={[
186
+ styles_1.default.chipText,
187
+ {
188
+ fontFamily: AppFonts_1.AppFonts.interBold,
189
+ fontSize: 8,
190
+ color: item.url.toLowerCase().startsWith('https')
191
+ ? '#059669'
192
+ : '#D97706',
193
+ },
194
+ ]}>
195
+ {item.url.toLowerCase().startsWith('https') ? 'HTTPS' : 'HTTP'}
196
+ </react_native_1.Text>
197
+ </react_native_1.View>
198
+
199
+ {/* GraphQL Indicator */}
200
+ {(item.url.toLowerCase().includes('graphql') ||
201
+ item.client === 'apollo' ||
202
+ item.client === 'graphql') && (<react_native_1.View style={[
203
+ styles_1.default.chip,
204
+ {
205
+ backgroundColor: '#FDF2F8',
206
+ borderColor: '#FBCFE8',
207
+ paddingHorizontal: 4,
208
+ paddingVertical: 1,
209
+ borderRadius: 4,
210
+ },
211
+ ]}>
212
+ <react_native_1.Text style={[
213
+ styles_1.default.chipText,
214
+ {
215
+ fontFamily: AppFonts_1.AppFonts.interBold,
216
+ fontSize: 8,
217
+ color: '#DB2777',
218
+ },
219
+ ]}>
220
+ GQL
221
+ </react_native_1.Text>
222
+ </react_native_1.View>)}
223
+
224
+ {/* In-Line Duration / Latency Pill */}
225
+ {item.duration != null && !isFailed && (<react_native_1.View style={[
226
+ styles_1.default.chip,
227
+ {
228
+ backgroundColor: `${durationColor}12`,
229
+ borderColor: `${durationColor}2E`,
230
+ paddingHorizontal: 4.5,
231
+ paddingVertical: 1,
232
+ borderRadius: 4,
233
+ },
234
+ ]}>
235
+ <react_native_1.Text style={[
236
+ styles_1.default.chipText,
237
+ {
238
+ fontFamily: AppFonts_1.AppFonts.interBold,
239
+ fontSize: 8.5,
240
+ color: durationColor,
241
+ },
242
+ ]}>
243
+ {item.duration}ms
244
+ </react_native_1.Text>
245
+ </react_native_1.View>)}
154
246
  </react_native_1.View>
155
247
 
156
248
  <react_native_1.View style={[
@@ -187,12 +279,12 @@ const LogCard = react_1.default.memo(function LogCard({ item, onPress, timelineM
187
279
  </react_native_1.View>
188
280
  </react_native_1.View>
189
281
 
190
- {/* Row 2: Full URL Capsule Container */}
282
+ {/* Row 2: Full URL Capsule Container (Clickable with link prompt) */}
191
283
  <react_native_1.View style={styles_1.default.cardSlugBox}>
192
- <react_native_1.View style={styles_1.default.slugLeft}>
193
- <react_native_1.Text style={styles_1.default.slugTag}>URL</react_native_1.Text>
194
- <HighlightText_1.default text={item.url} search={searchStr} style={styles_1.default.slugText} highlightStyle={styles_1.default.highlight} numberOfLines={2} ellipsizeMode="middle"/>
195
- </react_native_1.View>
284
+ <react_native_1.Pressable onPress={handleOpenUrl} style={styles_1.default.slugLeft} hitSlop={6}>
285
+ <react_native_1.Text style={styles_1.default.slugTag}>URL ↗</react_native_1.Text>
286
+ <HighlightText_1.default text={item.url} search={searchStr} style={[styles_1.default.slugText, { color: AppColors_1.AppColors.skyBlue, textDecorationLine: 'underline' }]} highlightStyle={styles_1.default.highlight} numberOfLines={2} ellipsizeMode="middle"/>
287
+ </react_native_1.Pressable>
196
288
 
197
289
  <react_native_1.View style={styles_1.default.slugRight}>
198
290
  {isJson && (<react_native_1.View style={[
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const Toast: React.MemoExoticComponent<() => React.JSX.Element>;
3
+ export default Toast;
@@ -0,0 +1,152 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ const react_1 = __importStar(require("react"));
37
+ const react_native_1 = require("react-native");
38
+ const toast_1 = require("../helpers/toast");
39
+ const NetworkIcons_1 = require("./NetworkIcons");
40
+ const AppColors_1 = require("../styles/AppColors");
41
+ const AppFonts_1 = require("../styles/AppFonts");
42
+ const Toast = react_1.default.memo(() => {
43
+ const [toastMessage, setToastMessage] = (0, react_1.useState)(null);
44
+ const opacityAnim = (0, react_1.useRef)(new react_native_1.Animated.Value(0)).current;
45
+ const translateYAnim = (0, react_1.useRef)(new react_native_1.Animated.Value(20)).current;
46
+ const hideTimerRef = (0, react_1.useRef)(null);
47
+ (0, react_1.useEffect)(() => {
48
+ const unsubscribe = (0, toast_1.subscribeToast)((message) => {
49
+ if (hideTimerRef.current) {
50
+ clearTimeout(hideTimerRef.current);
51
+ }
52
+ setToastMessage(message);
53
+ react_native_1.Animated.parallel([
54
+ react_native_1.Animated.timing(opacityAnim, {
55
+ toValue: 1,
56
+ duration: 180,
57
+ useNativeDriver: true,
58
+ }),
59
+ react_native_1.Animated.spring(translateYAnim, {
60
+ toValue: 0,
61
+ tension: 80,
62
+ friction: 8,
63
+ useNativeDriver: true,
64
+ }),
65
+ ]).start();
66
+ hideTimerRef.current = setTimeout(() => {
67
+ react_native_1.Animated.parallel([
68
+ react_native_1.Animated.timing(opacityAnim, {
69
+ toValue: 0,
70
+ duration: 200,
71
+ useNativeDriver: true,
72
+ }),
73
+ react_native_1.Animated.timing(translateYAnim, {
74
+ toValue: 20,
75
+ duration: 200,
76
+ useNativeDriver: true,
77
+ }),
78
+ ]).start(() => {
79
+ setToastMessage(null);
80
+ });
81
+ }, 2000);
82
+ });
83
+ return () => {
84
+ unsubscribe();
85
+ if (hideTimerRef.current) {
86
+ clearTimeout(hideTimerRef.current);
87
+ }
88
+ };
89
+ }, [opacityAnim, translateYAnim]);
90
+ if (!toastMessage) {
91
+ return null;
92
+ }
93
+ return (<react_native_1.Animated.View pointerEvents="none" style={[
94
+ styles.toastContainer,
95
+ {
96
+ opacity: opacityAnim,
97
+ transform: [{ translateY: translateYAnim }],
98
+ },
99
+ ]}>
100
+ <react_native_1.View style={styles.toastCard}>
101
+ <react_native_1.View style={styles.iconCircle}>
102
+ <NetworkIcons_1.CheckIcon color={AppColors_1.AppColors.white} size={11}/>
103
+ </react_native_1.View>
104
+ <react_native_1.Text style={styles.toastText} numberOfLines={2}>
105
+ {toastMessage}
106
+ </react_native_1.Text>
107
+ </react_native_1.View>
108
+ </react_native_1.Animated.View>);
109
+ });
110
+ const styles = react_native_1.StyleSheet.create({
111
+ toastContainer: {
112
+ position: 'absolute',
113
+ bottom: react_native_1.Platform.OS === 'ios' ? 44 : 28,
114
+ left: 20,
115
+ right: 20,
116
+ alignItems: 'center',
117
+ justifyContent: 'center',
118
+ zIndex: 999999,
119
+ },
120
+ toastCard: {
121
+ flexDirection: 'row',
122
+ alignItems: 'center',
123
+ backgroundColor: '#0F172AEE', // dark slate glass
124
+ paddingVertical: 10,
125
+ paddingHorizontal: 16,
126
+ borderRadius: 24,
127
+ shadowColor: '#000000',
128
+ shadowOffset: { width: 0, height: 6 },
129
+ shadowOpacity: 0.28,
130
+ shadowRadius: 10,
131
+ elevation: 8,
132
+ borderWidth: 1,
133
+ borderColor: '#33415588',
134
+ maxWidth: '90%',
135
+ gap: 9,
136
+ },
137
+ iconCircle: {
138
+ width: 18,
139
+ height: 18,
140
+ borderRadius: 9,
141
+ backgroundColor: AppColors_1.AppColors.greenColor,
142
+ alignItems: 'center',
143
+ justifyContent: 'center',
144
+ },
145
+ toastText: {
146
+ color: AppColors_1.AppColors.white,
147
+ fontFamily: AppFonts_1.AppFonts.interBold,
148
+ fontSize: 12.5,
149
+ letterSpacing: -0.1,
150
+ },
151
+ });
152
+ exports.default = Toast;
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  declare const TouchableScale: React.NamedExoticComponent<{
3
3
  onPress?: () => void;
4
+ onLongPress?: () => void;
4
5
  style?: any;
5
6
  children?: React.ReactNode;
6
7
  hitSlop?: any;
@@ -35,9 +35,9 @@ var __importStar = (this && this.__importStar) || (function () {
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
36
  const react_1 = __importStar(require("react"));
37
37
  const react_native_1 = require("react-native");
38
- const TouchableScale = react_1.default.memo(function TouchableScale({ onPress, style, children, hitSlop, disabled, }) {
38
+ const TouchableScale = react_1.default.memo(function TouchableScale({ onPress, onLongPress, style, children, hitSlop, disabled, }) {
39
39
  if (react_native_1.Platform.OS === 'android') {
40
- return (<react_native_1.Pressable disabled={disabled} onPress={onPress} hitSlop={hitSlop} style={({ pressed }) => [
40
+ return (<react_native_1.Pressable disabled={disabled} onPress={onPress} onLongPress={onLongPress} hitSlop={hitSlop} style={({ pressed }) => [
41
41
  style,
42
42
  { opacity: pressed ? 0.75 : 1 },
43
43
  ]}>
@@ -73,7 +73,7 @@ const TouchableScale = react_1.default.memo(function TouchableScale({ onPress, s
73
73
  flexShrink: flattenedStyle.flexShrink,
74
74
  gap: flattenedStyle.gap,
75
75
  };
76
- return (<react_native_1.Pressable disabled={disabled} style={style} onPressIn={() => animatePress(true)} onPressOut={() => animatePress(false)} onPress={onPress} hitSlop={hitSlop}>
76
+ return (<react_native_1.Pressable disabled={disabled} style={style} onPressIn={() => animatePress(true)} onPressOut={() => animatePress(false)} onPress={onPress} onLongPress={onLongPress} hitSlop={hitSlop}>
77
77
  <react_native_1.Animated.View style={[{ opacity, transform: [{ scale }] }, layoutStyle]}>
78
78
  {children}
79
79
  </react_native_1.Animated.View>
@@ -46,7 +46,7 @@ const NetworkIcons_1 = require("./NetworkIcons");
46
46
  const AppColors_1 = require("../styles/AppColors");
47
47
  const styles_1 = __importDefault(require("../styles"));
48
48
  const TreeNode = react_1.default.memo(function TreeNode({ data, name, level = 0, search, forceOpen, defaultExpandDepth, }) {
49
- const [localOpen, setLocalOpen] = (0, react_1.useState)(forceOpen || level < (defaultExpandDepth ?? 1));
49
+ const [localOpen, setLocalOpen] = (0, react_1.useState)(forceOpen || (defaultExpandDepth !== undefined ? level < defaultExpandDepth : false));
50
50
  const open = localOpen;
51
51
  const isObject = typeof data === 'object' && data !== null;
52
52
  const isArray = Array.isArray(data);
@@ -12,12 +12,12 @@ exports.STATUS_FILTERS = [
12
12
  'Failed',
13
13
  ];
14
14
  exports.METHOD_COLORS = {
15
- ALL: AppColors_1.AppColors.grayText,
16
- GET: AppColors_1.AppColors.purple,
17
- POST: AppColors_1.AppColors.greenColor,
18
- PUT: AppColors_1.AppColors.lightOrange,
19
- PATCH: AppColors_1.AppColors.offerPurple,
20
- DELETE: AppColors_1.AppColors.errorColor,
15
+ ALL: '#64748B', // Slate
16
+ GET: '#059669', // Emerald
17
+ POST: '#2563EB', // Royal Blue
18
+ PUT: '#D97706', // Amber Gold
19
+ PATCH: '#7C3AED', // Rich Violet
20
+ DELETE: '#DC2626', // Crimson Red
21
21
  };
22
22
  exports.DOMAIN_COLORS = AppColors_1.AppColors.domainColors;
23
23
  exports.DURATION_FAST_MS = 200;
@@ -1 +1 @@
1
- export declare const LIB_VERSION = "1.1.28";
1
+ export declare const LIB_VERSION = "1.1.29";
@@ -3,4 +3,4 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.LIB_VERSION = void 0;
4
4
  // AUTO-GENERATED FILE — do not edit by hand.
5
5
  // Regenerated from package.json on every build by scripts/gen-version.js.
6
- exports.LIB_VERSION = '1.1.28';
6
+ exports.LIB_VERSION = '1.1.29';
@@ -1,6 +1,7 @@
1
1
  import { NetworkLog, RouteInfo, DiffResult, JsonContent, StackFrameType } from '../types';
2
2
  export declare const getDomainColor: (domain: string) => string;
3
3
  export declare const formatDateTime: (timestamp: number) => string;
4
+ export declare const formatTimestamp: (timestamp: number) => string;
4
5
  export declare const getStatusColor: (status: number | null) => string;
5
6
  export declare const getDurationColor: (duration: number | null) => string;
6
7
  export declare const getSize: (data: unknown) => string;
@@ -44,6 +45,7 @@ export interface ParsedStackFrame {
44
45
  frameType: StackFrameType | 'app' | 'dependency' | 'runtime' | 'native';
45
46
  isUserCode: boolean;
46
47
  isRuntimeNoise: boolean;
48
+ rawFilePath?: string;
47
49
  lineNumber?: string;
48
50
  columnNumber?: string;
49
51
  isOrigin?: boolean;
@@ -51,6 +53,8 @@ export interface ParsedStackFrame {
51
53
  }
52
54
  /** Parses a stack trace line to extract function name, file name, extension (.tsx/.jsx/.ts), line, and column numbers */
53
55
  export declare const parseStackLine: (rawLine: string, isOrigin?: boolean) => ParsedStackFrame;
56
+ /** Opens a file and line number directly in VS Code */
57
+ export declare const openInVSCode: (filePath: string, lineNumber?: string | number, columnNumber?: string | number) => void;
54
58
  export declare const ANALYTICS_EVENT_PALETTE: string[];
55
59
  export declare const getEventColor: (name: string) => string;
56
60
  export { getEventCategory, registerGAPlugin, type GAEventCategory, type GAPlugin, } from './gaAnalyticsRegistry';