react-native-inapp-inspector 2.3.9 → 2.3.11

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 (65) hide show
  1. package/dist/commonjs/components/Inspector/DebuggingTab.d.ts +3 -0
  2. package/dist/commonjs/components/Inspector/DebuggingTab.js +682 -0
  3. package/dist/commonjs/components/Inspector/MainScreen.js +2 -0
  4. package/dist/commonjs/components/Inspector/NetworkDetail.js +2 -1
  5. package/dist/commonjs/components/Inspector/NetworkFilterModal.d.ts +19 -0
  6. package/dist/commonjs/components/Inspector/NetworkFilterModal.js +648 -0
  7. package/dist/commonjs/components/Inspector/NetworkTab.js +89 -147
  8. package/dist/commonjs/components/Inspector/SettingsPanel.js +12 -0
  9. package/dist/commonjs/components/Inspector/TabBar.js +9 -0
  10. package/dist/commonjs/components/LogCard.js +5 -26
  11. package/dist/commonjs/components/NetworkIcons.d.ts +2 -0
  12. package/dist/commonjs/components/NetworkIcons.js +13 -1
  13. package/dist/commonjs/components/QRCodeView.d.ts +9 -0
  14. package/dist/commonjs/components/QRCodeView.js +79 -0
  15. package/dist/commonjs/constants/index.js +3 -0
  16. package/dist/commonjs/constants/version.d.ts +1 -1
  17. package/dist/commonjs/constants/version.js +1 -1
  18. package/dist/commonjs/helpers/qrGenerator.d.ts +2 -0
  19. package/dist/commonjs/helpers/qrGenerator.js +170 -0
  20. package/dist/commonjs/index.js +2 -0
  21. package/dist/commonjs/styles/index.d.ts +11 -0
  22. package/dist/commonjs/styles/index.js +20 -5
  23. package/dist/commonjs/types/enums.d.ts +5 -0
  24. package/dist/commonjs/types/enums.js +5 -0
  25. package/dist/esm/components/Inspector/DebuggingTab.d.ts +3 -0
  26. package/dist/esm/components/Inspector/DebuggingTab.js +642 -0
  27. package/dist/esm/components/Inspector/MainScreen.js +2 -0
  28. package/dist/esm/components/Inspector/NetworkDetail.js +2 -1
  29. package/dist/esm/components/Inspector/NetworkFilterModal.d.ts +19 -0
  30. package/dist/esm/components/Inspector/NetworkFilterModal.js +607 -0
  31. package/dist/esm/components/Inspector/NetworkTab.js +91 -149
  32. package/dist/esm/components/Inspector/SettingsPanel.js +13 -1
  33. package/dist/esm/components/Inspector/TabBar.js +10 -1
  34. package/dist/esm/components/LogCard.js +5 -26
  35. package/dist/esm/components/NetworkIcons.d.ts +2 -0
  36. package/dist/esm/components/NetworkIcons.js +10 -0
  37. package/dist/esm/components/QRCodeView.d.ts +9 -0
  38. package/dist/esm/components/QRCodeView.js +42 -0
  39. package/dist/esm/constants/index.js +3 -0
  40. package/dist/esm/constants/version.d.ts +1 -1
  41. package/dist/esm/constants/version.js +1 -1
  42. package/dist/esm/helpers/qrGenerator.d.ts +2 -0
  43. package/dist/esm/helpers/qrGenerator.js +167 -0
  44. package/dist/esm/index.js +2 -0
  45. package/dist/esm/styles/index.d.ts +11 -0
  46. package/dist/esm/styles/index.js +20 -5
  47. package/dist/esm/types/enums.d.ts +5 -0
  48. package/dist/esm/types/enums.js +5 -0
  49. package/package.json +2 -2
  50. package/src/components/Inspector/DebuggingTab.tsx +755 -0
  51. package/src/components/Inspector/MainScreen.tsx +2 -0
  52. package/src/components/Inspector/NetworkDetail.tsx +2 -1
  53. package/src/components/Inspector/NetworkFilterModal.tsx +710 -0
  54. package/src/components/Inspector/NetworkTab.tsx +127 -204
  55. package/src/components/Inspector/SettingsPanel.tsx +20 -0
  56. package/src/components/Inspector/TabBar.tsx +11 -0
  57. package/src/components/LogCard.tsx +5 -30
  58. package/src/components/NetworkIcons.tsx +66 -0
  59. package/src/components/QRCodeView.tsx +71 -0
  60. package/src/constants/index.ts +3 -0
  61. package/src/constants/version.ts +1 -1
  62. package/src/helpers/qrGenerator.ts +184 -0
  63. package/src/index.tsx +2 -0
  64. package/src/styles/index.ts +20 -5
  65. package/src/types/enums.ts +5 -0
@@ -0,0 +1,648 @@
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
+ var __importDefault = (this && this.__importDefault) || function (mod) {
36
+ return (mod && mod.__esModule) ? mod : { "default": mod };
37
+ };
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.NetworkFilterModal = exports.isNetworkFiltersDefault = exports.DEFAULT_NETWORK_FILTERS = void 0;
40
+ const react_1 = __importStar(require("react"));
41
+ const react_native_1 = require("react-native");
42
+ const InspectorContext_1 = require("./InspectorContext");
43
+ const AppColors_1 = require("../../styles/AppColors");
44
+ const AppFonts_1 = require("../../styles/AppFonts");
45
+ const i18n_1 = require("../../i18n");
46
+ const constants_1 = require("../../constants");
47
+ const NetworkIcons_1 = require("../NetworkIcons");
48
+ const TouchableScale_1 = __importDefault(require("../TouchableScale"));
49
+ exports.DEFAULT_NETWORK_FILTERS = {
50
+ statusCodes: new Set(['all']),
51
+ methods: new Set(['all']),
52
+ latency: 'all',
53
+ protocol: 'all',
54
+ sortBy: 'time_desc',
55
+ };
56
+ const isNetworkFiltersDefault = (f) => (f.statusCodes.has('all') || f.statusCodes.size === 0) &&
57
+ (f.methods.has('all') || f.methods.size === 0) &&
58
+ f.latency === 'all' &&
59
+ f.protocol === 'all' &&
60
+ f.sortBy === 'time_desc';
61
+ exports.isNetworkFiltersDefault = isNetworkFiltersDefault;
62
+ const NetworkFilterModal = ({ visible, onClose, filters, onApply, searchQuery = '', }) => {
63
+ const { t } = (0, i18n_1.useTranslation)();
64
+ const { logs } = (0, InspectorContext_1.useInspector)();
65
+ const [draft, setDraft] = (0, react_1.useState)(() => ({
66
+ ...filters,
67
+ statusCodes: new Set(filters.statusCodes),
68
+ methods: new Set(filters.methods),
69
+ }));
70
+ (0, react_1.useEffect)(() => {
71
+ if (visible) {
72
+ setDraft({
73
+ ...filters,
74
+ statusCodes: new Set(filters.statusCodes),
75
+ methods: new Set(filters.methods),
76
+ });
77
+ }
78
+ }, [visible, filters]);
79
+ const counts = (0, react_1.useMemo)(() => {
80
+ const statusMap = {
81
+ all: logs.length,
82
+ '2xx': 0,
83
+ '3xx': 0,
84
+ '4xx': 0,
85
+ '5xx': 0,
86
+ failed: 0,
87
+ };
88
+ const methodMap = { all: logs.length };
89
+ let fastCount = 0;
90
+ let normalCount = 0;
91
+ let slowCount = 0;
92
+ let httpsCount = 0;
93
+ let httpCount = 0;
94
+ for (const log of logs) {
95
+ const s = typeof log.status === 'number' ? log.status : parseInt(String(log.status), 10);
96
+ if (log.status === 0 || log.status == null) {
97
+ statusMap.failed = (statusMap.failed || 0) + 1;
98
+ }
99
+ else if (!isNaN(s)) {
100
+ if (s >= 200 && s < 300)
101
+ statusMap['2xx'] = (statusMap['2xx'] || 0) + 1;
102
+ else if (s >= 300 && s < 400)
103
+ statusMap['3xx'] = (statusMap['3xx'] || 0) + 1;
104
+ else if (s >= 400 && s < 500)
105
+ statusMap['4xx'] = (statusMap['4xx'] || 0) + 1;
106
+ else if (s >= 500)
107
+ statusMap['5xx'] = (statusMap['5xx'] || 0) + 1;
108
+ }
109
+ const m = (log.method || 'GET').toUpperCase();
110
+ methodMap[m] = (methodMap[m] || 0) + 1;
111
+ const dur = log.duration || 0;
112
+ if (dur < 200)
113
+ fastCount++;
114
+ else if (dur <= 500)
115
+ normalCount++;
116
+ else
117
+ slowCount++;
118
+ if ((log.url || '').toLowerCase().startsWith('https'))
119
+ httpsCount++;
120
+ else
121
+ httpCount++;
122
+ }
123
+ return {
124
+ statusMap,
125
+ methodMap,
126
+ fastCount,
127
+ normalCount,
128
+ slowCount,
129
+ httpsCount,
130
+ httpCount,
131
+ };
132
+ }, [logs]);
133
+ const previewMatchCount = (0, react_1.useMemo)(() => {
134
+ return logs.filter(log => {
135
+ if (!draft.statusCodes.has('all') && draft.statusCodes.size > 0) {
136
+ const s = typeof log.status === 'number' ? log.status : parseInt(String(log.status), 10);
137
+ let matches = false;
138
+ if (draft.statusCodes.has('failed') && (log.status === 0 || log.status == null))
139
+ matches = true;
140
+ if (draft.statusCodes.has('2xx') && !isNaN(s) && s >= 200 && s < 300)
141
+ matches = true;
142
+ if (draft.statusCodes.has('3xx') && !isNaN(s) && s >= 300 && s < 400)
143
+ matches = true;
144
+ if (draft.statusCodes.has('4xx') && !isNaN(s) && s >= 400 && s < 500)
145
+ matches = true;
146
+ if (draft.statusCodes.has('5xx') && !isNaN(s) && s >= 500)
147
+ matches = true;
148
+ if (!matches)
149
+ return false;
150
+ }
151
+ if (!draft.methods.has('all') && draft.methods.size > 0) {
152
+ const m = (log.method || 'GET').toUpperCase();
153
+ if (!draft.methods.has(m))
154
+ return false;
155
+ }
156
+ const dur = log.duration || 0;
157
+ if (draft.latency === 'fast' && dur >= 200)
158
+ return false;
159
+ if (draft.latency === 'normal' && (dur < 200 || dur > 500))
160
+ return false;
161
+ if (draft.latency === 'slow' && dur <= 500)
162
+ return false;
163
+ const isHttps = (log.url || '').toLowerCase().startsWith('https');
164
+ if (draft.protocol === 'https' && !isHttps)
165
+ return false;
166
+ if (draft.protocol === 'http' && isHttps)
167
+ return false;
168
+ if (searchQuery.trim().length > 0) {
169
+ const q = searchQuery.toLowerCase();
170
+ const u = (log.url || '').toLowerCase();
171
+ if (!u.includes(q))
172
+ return false;
173
+ }
174
+ return true;
175
+ }).length;
176
+ }, [logs, draft, searchQuery]);
177
+ const toggleStatus = (key) => {
178
+ setDraft(prev => {
179
+ const next = new Set(prev.statusCodes);
180
+ if (key === 'all') {
181
+ return { ...prev, statusCodes: new Set(['all']) };
182
+ }
183
+ next.delete('all');
184
+ if (next.has(key)) {
185
+ next.delete(key);
186
+ if (next.size === 0)
187
+ next.add('all');
188
+ }
189
+ else {
190
+ next.add(key);
191
+ }
192
+ return { ...prev, statusCodes: next };
193
+ });
194
+ };
195
+ const toggleMethod = (key) => {
196
+ setDraft(prev => {
197
+ const next = new Set(prev.methods);
198
+ if (key === 'all') {
199
+ return { ...prev, methods: new Set(['all']) };
200
+ }
201
+ next.delete('all');
202
+ if (next.has(key)) {
203
+ next.delete(key);
204
+ if (next.size === 0)
205
+ next.add('all');
206
+ }
207
+ else {
208
+ next.add(key);
209
+ }
210
+ return { ...prev, methods: next };
211
+ });
212
+ };
213
+ const handleReset = () => {
214
+ setDraft({
215
+ statusCodes: new Set(['all']),
216
+ methods: new Set(['all']),
217
+ latency: 'all',
218
+ protocol: 'all',
219
+ sortBy: 'time_desc',
220
+ });
221
+ };
222
+ const handleApply = () => {
223
+ onApply(draft);
224
+ onClose();
225
+ };
226
+ const activeFiltersCount = (0, react_1.useMemo)(() => {
227
+ let count = 0;
228
+ if (!draft.statusCodes.has('all') && draft.statusCodes.size > 0)
229
+ count += draft.statusCodes.size;
230
+ if (!draft.methods.has('all') && draft.methods.size > 0)
231
+ count += draft.methods.size;
232
+ if (draft.latency !== 'all')
233
+ count++;
234
+ if (draft.protocol !== 'all')
235
+ count++;
236
+ if (draft.sortBy !== 'time_desc')
237
+ count++;
238
+ return count;
239
+ }, [draft]);
240
+ return (<react_native_1.Modal visible={visible} transparent animationType="fade" onRequestClose={onClose}>
241
+ <react_native_1.Pressable style={styles.overlay} onPress={onClose}>
242
+ <react_native_1.Pressable style={styles.modalCard} onPress={e => e.stopPropagation()}>
243
+
244
+ <react_native_1.View style={styles.header}>
245
+ <react_native_1.View style={styles.headerLeft}>
246
+ <react_native_1.View style={styles.iconCircle}>
247
+ <NetworkIcons_1.FilterIcon size={16} color={AppColors_1.AppColors.purple}/>
248
+ </react_native_1.View>
249
+ <react_native_1.View>
250
+ <react_native_1.View style={{ flexDirection: 'row', alignItems: 'center', gap: 6 }}>
251
+ <react_native_1.Text style={styles.title}>Network Filters</react_native_1.Text>
252
+ {activeFiltersCount > 0 && (<react_native_1.View style={styles.activeBadge}>
253
+ <react_native_1.Text style={styles.activeBadgeText}>{activeFiltersCount} active</react_native_1.Text>
254
+ </react_native_1.View>)}
255
+ </react_native_1.View>
256
+ <react_native_1.Text style={styles.subtitle}>Filter requests by status, method & speed</react_native_1.Text>
257
+ </react_native_1.View>
258
+ </react_native_1.View>
259
+ <react_native_1.TouchableOpacity onPress={onClose} hitSlop={10} style={styles.closeBtn}>
260
+ <NetworkIcons_1.CloseWhite size={14} color={AppColors_1.AppColors.grayText}/>
261
+ </react_native_1.TouchableOpacity>
262
+ </react_native_1.View>
263
+
264
+ <react_native_1.ScrollView style={styles.scrollArea} contentContainerStyle={styles.scrollContent} showsVerticalScrollIndicator={false}>
265
+
266
+ <react_native_1.View style={styles.section}>
267
+ <react_native_1.Text style={styles.sectionTitle}>HTTP STATUS CODE</react_native_1.Text>
268
+ <react_native_1.View style={styles.chipsWrap}>
269
+ {[
270
+ { key: 'all', label: 'All Statuses', color: AppColors_1.AppColors.purple, icon: NetworkIcons_1.LayersIcon, count: counts.statusMap.all },
271
+ { key: '2xx', label: '2xx Success', color: AppColors_1.AppColors.greenColor, icon: NetworkIcons_1.CircleCheckIcon, count: counts.statusMap['2xx'] || 0 },
272
+ { key: '3xx', label: '3xx Redirect', color: AppColors_1.AppColors.warningIconGold, icon: NetworkIcons_1.RepeatIcon, count: counts.statusMap['3xx'] || 0 },
273
+ { key: '4xx', label: '4xx Client Error', color: AppColors_1.AppColors.darkOrange, icon: NetworkIcons_1.CircleAlertIcon, count: counts.statusMap['4xx'] || 0 },
274
+ { key: '5xx', label: '5xx Server Error', color: AppColors_1.AppColors.errorColor, icon: NetworkIcons_1.CircleXIcon, count: counts.statusMap['5xx'] || 0 },
275
+ { key: 'failed', label: 'Network Failed / 0', color: AppColors_1.AppColors.errorColor, icon: NetworkIcons_1.ShieldAlertIcon, count: counts.statusMap.failed || 0 },
276
+ ].map(item => {
277
+ const isSelected = draft.statusCodes.has(item.key);
278
+ const IconComp = item.icon;
279
+ return (<react_native_1.TouchableOpacity key={item.key} activeOpacity={0.7} onPress={() => toggleStatus(item.key)} style={[
280
+ styles.chip,
281
+ isSelected && {
282
+ backgroundColor: `${item.color}15`,
283
+ borderColor: item.color,
284
+ },
285
+ ]}>
286
+ <IconComp size={13} color={isSelected ? item.color : AppColors_1.AppColors.grayTextWeak}/>
287
+ <react_native_1.Text style={[
288
+ styles.chipLabel,
289
+ isSelected && { color: item.color, fontFamily: AppFonts_1.AppFonts.interBold },
290
+ ]}>
291
+ {item.label}
292
+ </react_native_1.Text>
293
+ <react_native_1.View style={[
294
+ styles.countPill,
295
+ isSelected && { backgroundColor: `${item.color}25` },
296
+ ]}>
297
+ <react_native_1.Text style={[
298
+ styles.countPillText,
299
+ isSelected && { color: item.color },
300
+ ]}>
301
+ {item.count}
302
+ </react_native_1.Text>
303
+ </react_native_1.View>
304
+ </react_native_1.TouchableOpacity>);
305
+ })}
306
+ </react_native_1.View>
307
+ </react_native_1.View>
308
+
309
+
310
+ <react_native_1.View style={styles.section}>
311
+ <react_native_1.Text style={styles.sectionTitle}>HTTP METHOD</react_native_1.Text>
312
+ <react_native_1.View style={styles.chipsWrap}>
313
+ <react_native_1.TouchableOpacity activeOpacity={0.7} onPress={() => toggleMethod('all')} style={[
314
+ styles.chip,
315
+ draft.methods.has('all') && {
316
+ backgroundColor: `${AppColors_1.AppColors.purple}15`,
317
+ borderColor: AppColors_1.AppColors.purple,
318
+ },
319
+ ]}>
320
+ <NetworkIcons_1.LayersIcon size={12} color={draft.methods.has('all') ? AppColors_1.AppColors.purple : AppColors_1.AppColors.grayTextWeak}/>
321
+ <react_native_1.Text style={[
322
+ styles.chipLabel,
323
+ draft.methods.has('all') && { color: AppColors_1.AppColors.purple, fontFamily: AppFonts_1.AppFonts.interBold },
324
+ ]}>
325
+ All Methods
326
+ </react_native_1.Text>
327
+ <react_native_1.View style={[styles.countPill, draft.methods.has('all') && { backgroundColor: `${AppColors_1.AppColors.purple}25` }]}>
328
+ <react_native_1.Text style={[styles.countPillText, draft.methods.has('all') && { color: AppColors_1.AppColors.purple }]}>
329
+ {counts.methodMap.all}
330
+ </react_native_1.Text>
331
+ </react_native_1.View>
332
+ </react_native_1.TouchableOpacity>
333
+
334
+ {['GET', 'POST', 'PUT', 'DELETE', 'PATCH', 'QUERY', 'OPTIONS', 'HEAD'].map(m => {
335
+ const isSelected = draft.methods.has(m);
336
+ const mColor = constants_1.METHOD_COLORS[m] || AppColors_1.AppColors.grayText;
337
+ const count = counts.methodMap[m] || 0;
338
+ return (<react_native_1.TouchableOpacity key={m} activeOpacity={0.7} onPress={() => toggleMethod(m)} style={[
339
+ styles.chip,
340
+ isSelected && {
341
+ backgroundColor: `${mColor}18`,
342
+ borderColor: mColor,
343
+ },
344
+ ]}>
345
+ <react_native_1.View style={[styles.methodDot, { backgroundColor: mColor }]}/>
346
+ <react_native_1.Text style={[
347
+ styles.chipLabel,
348
+ isSelected && { color: mColor, fontFamily: AppFonts_1.AppFonts.interBold },
349
+ ]}>
350
+ {m}
351
+ </react_native_1.Text>
352
+ <react_native_1.View style={[
353
+ styles.countPill,
354
+ isSelected && { backgroundColor: `${mColor}25` },
355
+ ]}>
356
+ <react_native_1.Text style={[
357
+ styles.countPillText,
358
+ isSelected && { color: mColor },
359
+ ]}>
360
+ {count}
361
+ </react_native_1.Text>
362
+ </react_native_1.View>
363
+ </react_native_1.TouchableOpacity>);
364
+ })}
365
+ </react_native_1.View>
366
+ </react_native_1.View>
367
+
368
+
369
+ <react_native_1.View style={styles.section}>
370
+ <react_native_1.Text style={styles.sectionTitle}>LATENCY & SPEED</react_native_1.Text>
371
+ <react_native_1.View style={styles.chipsWrap}>
372
+ {[
373
+ { key: 'all', label: 'All Speeds', color: AppColors_1.AppColors.purple },
374
+ { key: 'fast', label: '⚡ Fast (<200ms)', color: AppColors_1.AppColors.greenColor, count: counts.fastCount },
375
+ { key: 'normal', label: '⏱️ Normal (200-500ms)', color: AppColors_1.AppColors.skyBlue, count: counts.normalCount },
376
+ { key: 'slow', label: '⚠️ Slow (>500ms)', color: AppColors_1.AppColors.errorColor, count: counts.slowCount },
377
+ ].map(item => {
378
+ const isSelected = draft.latency === item.key;
379
+ return (<react_native_1.TouchableOpacity key={item.key} activeOpacity={0.7} onPress={() => setDraft(prev => ({ ...prev, latency: item.key }))} style={[
380
+ styles.chip,
381
+ isSelected && {
382
+ backgroundColor: `${item.color}15`,
383
+ borderColor: item.color,
384
+ },
385
+ ]}>
386
+ <react_native_1.Text style={[
387
+ styles.chipLabel,
388
+ isSelected && { color: item.color, fontFamily: AppFonts_1.AppFonts.interBold },
389
+ ]}>
390
+ {item.label}
391
+ </react_native_1.Text>
392
+ {item.count != null && (<react_native_1.View style={[styles.countPill, isSelected && { backgroundColor: `${item.color}25` }]}>
393
+ <react_native_1.Text style={[styles.countPillText, isSelected && { color: item.color }]}>
394
+ {item.count}
395
+ </react_native_1.Text>
396
+ </react_native_1.View>)}
397
+ </react_native_1.TouchableOpacity>);
398
+ })}
399
+ </react_native_1.View>
400
+ </react_native_1.View>
401
+
402
+
403
+ <react_native_1.View style={styles.section}>
404
+ <react_native_1.Text style={styles.sectionTitle}>PROTOCOL</react_native_1.Text>
405
+ <react_native_1.View style={styles.chipsWrap}>
406
+ {[
407
+ { key: 'all', label: 'All Protocols', color: AppColors_1.AppColors.purple },
408
+ { key: 'https', label: '🔒 HTTPS Secure', color: AppColors_1.AppColors.mintGreenText, count: counts.httpsCount },
409
+ { key: 'http', label: '🔓 HTTP Insecure', color: AppColors_1.AppColors.amber700, count: counts.httpCount },
410
+ ].map(item => {
411
+ const isSelected = draft.protocol === item.key;
412
+ return (<react_native_1.TouchableOpacity key={item.key} activeOpacity={0.7} onPress={() => setDraft(prev => ({ ...prev, protocol: item.key }))} style={[
413
+ styles.chip,
414
+ isSelected && {
415
+ backgroundColor: `${item.color}15`,
416
+ borderColor: item.color,
417
+ },
418
+ ]}>
419
+ <react_native_1.Text style={[
420
+ styles.chipLabel,
421
+ isSelected && { color: item.color, fontFamily: AppFonts_1.AppFonts.interBold },
422
+ ]}>
423
+ {item.label}
424
+ </react_native_1.Text>
425
+ {item.count != null && (<react_native_1.View style={[styles.countPill, isSelected && { backgroundColor: `${item.color}25` }]}>
426
+ <react_native_1.Text style={[styles.countPillText, isSelected && { color: item.color }]}>
427
+ {item.count}
428
+ </react_native_1.Text>
429
+ </react_native_1.View>)}
430
+ </react_native_1.TouchableOpacity>);
431
+ })}
432
+ </react_native_1.View>
433
+ </react_native_1.View>
434
+
435
+
436
+ <react_native_1.View style={styles.section}>
437
+ <react_native_1.Text style={styles.sectionTitle}>SORT BY</react_native_1.Text>
438
+ <react_native_1.View style={styles.chipsWrap}>
439
+ {[
440
+ { key: 'time_desc', label: '⏱️ Newest First (Default)' },
441
+ { key: 'time_asc', label: '⌛ Oldest First' },
442
+ { key: 'duration_desc', label: '🐢 Slowest Response' },
443
+ { key: 'duration_asc', label: '🚀 Fastest Response' },
444
+ { key: 'size_desc', label: '📦 Largest Response Size' },
445
+ ].map(item => {
446
+ const isSelected = draft.sortBy === item.key;
447
+ return (<react_native_1.TouchableOpacity key={item.key} activeOpacity={0.7} onPress={() => setDraft(prev => ({ ...prev, sortBy: item.key }))} style={[
448
+ styles.chip,
449
+ isSelected && {
450
+ backgroundColor: `${AppColors_1.AppColors.purple}15`,
451
+ borderColor: AppColors_1.AppColors.purple,
452
+ },
453
+ ]}>
454
+ <react_native_1.Text style={[
455
+ styles.chipLabel,
456
+ isSelected && { color: AppColors_1.AppColors.purple, fontFamily: AppFonts_1.AppFonts.interBold },
457
+ ]}>
458
+ {item.label}
459
+ </react_native_1.Text>
460
+ </react_native_1.TouchableOpacity>);
461
+ })}
462
+ </react_native_1.View>
463
+ </react_native_1.View>
464
+ </react_native_1.ScrollView>
465
+
466
+
467
+ <react_native_1.View style={styles.footer}>
468
+ <TouchableScale_1.default onPress={handleReset} style={styles.resetBtn}>
469
+ <react_native_1.Text style={styles.resetBtnText}>Reset All</react_native_1.Text>
470
+ </TouchableScale_1.default>
471
+
472
+ <TouchableScale_1.default onPress={handleApply} style={styles.applyBtn}>
473
+ <react_native_1.Text style={styles.applyBtnText}>
474
+ Apply ({previewMatchCount} Request{previewMatchCount === 1 ? '' : 's'})
475
+ </react_native_1.Text>
476
+ </TouchableScale_1.default>
477
+ </react_native_1.View>
478
+ </react_native_1.Pressable>
479
+ </react_native_1.Pressable>
480
+ </react_native_1.Modal>);
481
+ };
482
+ exports.NetworkFilterModal = NetworkFilterModal;
483
+ const styles = react_native_1.StyleSheet.create({
484
+ overlay: {
485
+ flex: 1,
486
+ backgroundColor: 'rgba(0, 0, 0, 0.55)',
487
+ justifyContent: 'flex-end',
488
+ },
489
+ modalCard: {
490
+ backgroundColor: AppColors_1.AppColors.primaryLight,
491
+ borderTopLeftRadius: 20,
492
+ borderTopRightRadius: 20,
493
+ maxHeight: '85%',
494
+ shadowColor: AppColors_1.AppColors.black,
495
+ shadowOffset: { width: 0, height: -4 },
496
+ shadowOpacity: 0.15,
497
+ shadowRadius: 10,
498
+ elevation: 8,
499
+ },
500
+ header: {
501
+ flexDirection: 'row',
502
+ alignItems: 'center',
503
+ justifyContent: 'space-between',
504
+ paddingHorizontal: 16,
505
+ paddingTop: 16,
506
+ paddingBottom: 12,
507
+ borderBottomWidth: 1,
508
+ borderBottomColor: AppColors_1.AppColors.grayBorderSecondary,
509
+ },
510
+ headerLeft: {
511
+ flexDirection: 'row',
512
+ alignItems: 'center',
513
+ gap: 10,
514
+ flex: 1,
515
+ },
516
+ iconCircle: {
517
+ width: 34,
518
+ height: 34,
519
+ borderRadius: 10,
520
+ backgroundColor: `${AppColors_1.AppColors.purple}15`,
521
+ alignItems: 'center',
522
+ justifyContent: 'center',
523
+ },
524
+ title: {
525
+ fontFamily: AppFonts_1.AppFonts.interBold,
526
+ fontSize: 16,
527
+ color: AppColors_1.AppColors.primaryBlack,
528
+ },
529
+ subtitle: {
530
+ fontFamily: AppFonts_1.AppFonts.interRegular,
531
+ fontSize: 11,
532
+ color: AppColors_1.AppColors.grayText,
533
+ marginTop: 1,
534
+ },
535
+ activeBadge: {
536
+ backgroundColor: `${AppColors_1.AppColors.purple}20`,
537
+ paddingHorizontal: 6,
538
+ paddingVertical: 1.5,
539
+ borderRadius: 8,
540
+ borderWidth: 1,
541
+ borderColor: `${AppColors_1.AppColors.purple}40`,
542
+ },
543
+ activeBadgeText: {
544
+ fontFamily: AppFonts_1.AppFonts.interBold,
545
+ fontSize: 9.5,
546
+ color: AppColors_1.AppColors.purple,
547
+ },
548
+ closeBtn: {
549
+ padding: 6,
550
+ },
551
+ scrollArea: {
552
+ maxHeight: 460,
553
+ },
554
+ scrollContent: {
555
+ padding: 16,
556
+ gap: 16,
557
+ },
558
+ section: {
559
+ gap: 8,
560
+ },
561
+ sectionTitle: {
562
+ fontFamily: AppFonts_1.AppFonts.interBold,
563
+ fontSize: 11,
564
+ color: AppColors_1.AppColors.grayTextWeak,
565
+ letterSpacing: 0.8,
566
+ },
567
+ chipsWrap: {
568
+ flexDirection: 'row',
569
+ flexWrap: 'wrap',
570
+ gap: 8,
571
+ },
572
+ chip: {
573
+ flexDirection: 'row',
574
+ alignItems: 'center',
575
+ gap: 6,
576
+ paddingHorizontal: 10,
577
+ paddingVertical: 6,
578
+ borderRadius: 8,
579
+ backgroundColor: AppColors_1.AppColors.grayBackground,
580
+ borderWidth: 1,
581
+ borderColor: AppColors_1.AppColors.grayBorderSecondary,
582
+ },
583
+ chipLabel: {
584
+ fontFamily: AppFonts_1.AppFonts.interMedium,
585
+ fontSize: 12,
586
+ color: AppColors_1.AppColors.primaryBlack,
587
+ },
588
+ methodDot: {
589
+ width: 6.5,
590
+ height: 6.5,
591
+ borderRadius: 3.5,
592
+ },
593
+ countPill: {
594
+ backgroundColor: `${AppColors_1.AppColors.grayBorderSecondary}50`,
595
+ paddingHorizontal: 5,
596
+ paddingVertical: 1,
597
+ borderRadius: 6,
598
+ },
599
+ countPillText: {
600
+ fontFamily: AppFonts_1.AppFonts.interBold,
601
+ fontSize: 9.5,
602
+ color: AppColors_1.AppColors.grayText,
603
+ },
604
+ footer: {
605
+ flexDirection: 'row',
606
+ alignItems: 'center',
607
+ gap: 10,
608
+ paddingHorizontal: 16,
609
+ paddingVertical: 14,
610
+ borderTopWidth: 1,
611
+ borderTopColor: AppColors_1.AppColors.grayBorderSecondary,
612
+ backgroundColor: AppColors_1.AppColors.primaryLight,
613
+ },
614
+ resetBtn: {
615
+ flex: 1,
616
+ paddingVertical: 11,
617
+ borderRadius: 10,
618
+ borderWidth: 1,
619
+ borderColor: AppColors_1.AppColors.grayBorderSecondary,
620
+ alignItems: 'center',
621
+ justifyContent: 'center',
622
+ backgroundColor: AppColors_1.AppColors.grayBackground,
623
+ },
624
+ resetBtnText: {
625
+ fontFamily: AppFonts_1.AppFonts.interBold,
626
+ fontSize: 13,
627
+ color: AppColors_1.AppColors.grayTextStrong,
628
+ },
629
+ applyBtn: {
630
+ flex: 2,
631
+ paddingVertical: 11,
632
+ borderRadius: 10,
633
+ alignItems: 'center',
634
+ justifyContent: 'center',
635
+ backgroundColor: AppColors_1.AppColors.purple,
636
+ shadowColor: AppColors_1.AppColors.purple,
637
+ shadowOffset: { width: 0, height: 2 },
638
+ shadowOpacity: 0.25,
639
+ shadowRadius: 4,
640
+ elevation: 3,
641
+ },
642
+ applyBtnText: {
643
+ fontFamily: AppFonts_1.AppFonts.interBold,
644
+ fontSize: 13,
645
+ color: AppColors_1.AppColors.white,
646
+ },
647
+ });
648
+ exports.default = exports.NetworkFilterModal;