react-native-inapp-inspector 2.3.14 → 2.3.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commonjs/components/AnimatedEntrance.js +3 -3
- package/dist/commonjs/components/ConsoleLogCard.js +174 -100
- package/dist/commonjs/components/Inspector/ConsoleTab.js +25 -16
- package/dist/commonjs/components/Inspector/CrashTab.js +19 -5
- package/dist/commonjs/components/Inspector/DeviceInfoTab.js +198 -98
- package/dist/commonjs/components/Inspector/InspectorHeader.js +2 -2
- package/dist/commonjs/components/Inspector/MainScreen.js +56 -56
- package/dist/commonjs/components/Inspector/NetworkTab.js +1 -335
- package/dist/commonjs/components/Inspector/PerformanceTab.js +32 -6
- package/dist/commonjs/components/Inspector/ReduxTab.js +3 -1
- package/dist/commonjs/components/Inspector/StorageTab.js +23 -5
- package/dist/commonjs/components/JsonViewer.js +14 -2
- package/dist/commonjs/components/LogCard.js +428 -227
- package/dist/commonjs/constants/version.d.ts +1 -1
- package/dist/commonjs/constants/version.js +1 -1
- package/dist/commonjs/customHooks/analyticsLogger.js +1 -1
- package/dist/commonjs/customHooks/consoleLogger.js +34 -2
- package/dist/commonjs/customHooks/crashHandler.js +1 -1
- package/dist/commonjs/customHooks/networkLogger.js +184 -26
- package/dist/commonjs/helpers/searchQueryParser.d.ts +1 -1
- package/dist/commonjs/helpers/searchQueryParser.js +37 -291
- package/dist/commonjs/index.js +141 -27
- package/dist/esm/components/AnimatedEntrance.js +3 -3
- package/dist/esm/components/ConsoleLogCard.js +141 -100
- package/dist/esm/components/Inspector/ConsoleTab.js +25 -16
- package/dist/esm/components/Inspector/CrashTab.js +19 -5
- package/dist/esm/components/Inspector/DeviceInfoTab.js +198 -98
- package/dist/esm/components/Inspector/InspectorHeader.js +3 -3
- package/dist/esm/components/Inspector/MainScreen.js +56 -56
- package/dist/esm/components/Inspector/NetworkTab.js +2 -336
- package/dist/esm/components/Inspector/PerformanceTab.js +32 -6
- package/dist/esm/components/Inspector/ReduxTab.js +3 -1
- package/dist/esm/components/Inspector/StorageTab.js +23 -5
- package/dist/esm/components/JsonViewer.js +14 -2
- package/dist/esm/components/LogCard.js +422 -221
- package/dist/esm/constants/version.d.ts +1 -1
- package/dist/esm/constants/version.js +1 -1
- package/dist/esm/customHooks/analyticsLogger.js +1 -1
- package/dist/esm/customHooks/consoleLogger.js +34 -2
- package/dist/esm/customHooks/crashHandler.js +1 -1
- package/dist/esm/customHooks/networkLogger.js +184 -26
- package/dist/esm/helpers/searchQueryParser.d.ts +1 -1
- package/dist/esm/helpers/searchQueryParser.js +37 -291
- package/dist/esm/index.js +141 -27
- package/package.json +1 -1
- package/src/components/AnimatedEntrance.tsx +3 -3
- package/src/components/ConsoleLogCard.tsx +154 -103
- package/src/components/Inspector/ConsoleTab.tsx +27 -18
- package/src/components/Inspector/CrashTab.tsx +19 -5
- package/src/components/Inspector/DeviceInfoTab.tsx +224 -102
- package/src/components/Inspector/InspectorHeader.tsx +5 -3
- package/src/components/Inspector/MainScreen.tsx +2 -3
- package/src/components/Inspector/NetworkTab.tsx +1 -402
- package/src/components/Inspector/PerformanceTab.tsx +36 -7
- package/src/components/Inspector/ReduxTab.tsx +9 -1
- package/src/components/Inspector/StorageTab.tsx +27 -7
- package/src/components/JsonViewer.tsx +15 -2
- package/src/components/LogCard.tsx +528 -339
- package/src/constants/version.ts +1 -1
- package/src/customHooks/analyticsLogger.ts +1 -1
- package/src/customHooks/consoleLogger.ts +36 -3
- package/src/customHooks/crashHandler.ts +1 -1
- package/src/customHooks/networkLogger.ts +214 -26
- package/src/helpers/searchQueryParser.ts +40 -285
- package/src/index.tsx +332 -211
|
@@ -1,314 +1,60 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.matchNetworkLogQuery = matchNetworkLogQuery;
|
|
4
|
-
function matchNetworkLogQuery(log, searchQuery, routePath,
|
|
4
|
+
function matchNetworkLogQuery(log, searchQuery, routePath, _options) {
|
|
5
5
|
if (!searchQuery || searchQuery.trim().length === 0)
|
|
6
6
|
return true;
|
|
7
|
-
const rawTokens = searchQuery.trim().
|
|
7
|
+
const rawTokens = searchQuery.trim().toLowerCase().split(/\s+/).filter(Boolean);
|
|
8
8
|
if (rawTokens.length === 0)
|
|
9
9
|
return true;
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const methodRaw = log.method || '';
|
|
14
|
-
const urlRaw = log.url || '';
|
|
10
|
+
const methodRaw = (log.method || '').toLowerCase();
|
|
11
|
+
const urlRaw = (log.url || '').toLowerCase();
|
|
12
|
+
const statusStr = log.status != null ? String(log.status).toLowerCase() : 'pending';
|
|
15
13
|
const statusNum = typeof log.status === 'number'
|
|
16
14
|
? log.status
|
|
17
15
|
: log.status != null
|
|
18
16
|
? parseInt(String(log.status), 10)
|
|
19
17
|
: null;
|
|
20
|
-
const
|
|
21
|
-
const
|
|
22
|
-
const
|
|
23
|
-
const callerRaw = log.caller || '';
|
|
18
|
+
const clientRaw = (log.client || '').toLowerCase();
|
|
19
|
+
const callerRaw = (log.caller || '').toLowerCase();
|
|
20
|
+
const pathRaw = (routePath || log?.routeInfo?.path || '').toLowerCase();
|
|
24
21
|
const reqRaw = typeof log.request === 'string'
|
|
25
|
-
? log.request
|
|
22
|
+
? log.request.toLowerCase()
|
|
26
23
|
: log.request != null
|
|
27
|
-
? JSON.stringify(log.request)
|
|
24
|
+
? JSON.stringify(log.request).toLowerCase()
|
|
28
25
|
: '';
|
|
29
26
|
const resRaw = typeof log.response === 'string'
|
|
30
|
-
? log.response
|
|
27
|
+
? log.response.toLowerCase()
|
|
31
28
|
: log.response != null
|
|
32
|
-
? JSON.stringify(log.response)
|
|
29
|
+
? JSON.stringify(log.response).toLowerCase()
|
|
33
30
|
: '';
|
|
34
31
|
const reqHeadersRaw = log.requestHeaders
|
|
35
|
-
? JSON.stringify(log.requestHeaders)
|
|
32
|
+
? JSON.stringify(log.requestHeaders).toLowerCase()
|
|
36
33
|
: '';
|
|
37
34
|
const resHeadersRaw = log.responseHeaders
|
|
38
|
-
? JSON.stringify(log.responseHeaders)
|
|
35
|
+
? JSON.stringify(log.responseHeaders).toLowerCase()
|
|
39
36
|
: '';
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
reqRaw,
|
|
64
|
-
resRaw,
|
|
65
|
-
reqHeadersRaw,
|
|
66
|
-
resHeadersRaw,
|
|
67
|
-
];
|
|
68
|
-
}
|
|
69
|
-
const combined = parts.join(' ');
|
|
70
|
-
return caseSens ? combined : combined.toLowerCase();
|
|
71
|
-
};
|
|
72
|
-
const targetCorpus = getScopedCorpus(isCaseSensitive);
|
|
73
|
-
const methodStr = methodRaw.toLowerCase();
|
|
74
|
-
const urlStr = urlRaw.toLowerCase();
|
|
75
|
-
const clientStr = clientRaw.toLowerCase();
|
|
76
|
-
const callerStr = callerRaw.toLowerCase();
|
|
77
|
-
const reqStr = reqRaw.toLowerCase();
|
|
78
|
-
const resStr = resRaw.toLowerCase();
|
|
79
|
-
const reqHeadersStr = reqHeadersRaw.toLowerCase();
|
|
80
|
-
const resHeadersStr = resHeadersRaw.toLowerCase();
|
|
81
|
-
const pathStr = pathRaw.toLowerCase();
|
|
82
|
-
for (const rawToken of rawTokens) {
|
|
83
|
-
const token = rawToken.replace(/^["']|["']$/g, '').trim();
|
|
84
|
-
if (!token)
|
|
85
|
-
continue;
|
|
86
|
-
const lowerToken = token.toLowerCase();
|
|
87
|
-
if (lowerToken.startsWith('method:') || lowerToken.startsWith('m:')) {
|
|
88
|
-
const targetMethod = lowerToken.replace(/^(method:|m:)/, '').trim();
|
|
89
|
-
if (targetMethod.startsWith('!')) {
|
|
90
|
-
if (methodStr === targetMethod.slice(1))
|
|
91
|
-
return false;
|
|
92
|
-
}
|
|
93
|
-
else {
|
|
94
|
-
if (methodStr !== targetMethod)
|
|
95
|
-
return false;
|
|
96
|
-
}
|
|
97
|
-
continue;
|
|
98
|
-
}
|
|
99
|
-
if (lowerToken.startsWith('status:') || lowerToken.startsWith('s:')) {
|
|
100
|
-
const val = lowerToken.replace(/^(status:|s:)/, '').trim();
|
|
101
|
-
if (val === 'pending' || val === 'loading') {
|
|
102
|
-
if (log.status != null)
|
|
103
|
-
return false;
|
|
104
|
-
}
|
|
105
|
-
else if (val.startsWith('>=')) {
|
|
106
|
-
const threshold = parseInt(val.slice(2), 10);
|
|
107
|
-
if (isNaN(threshold) || statusNum === null || statusNum < threshold)
|
|
108
|
-
return false;
|
|
109
|
-
}
|
|
110
|
-
else if (val.startsWith('>')) {
|
|
111
|
-
const threshold = parseInt(val.slice(1), 10);
|
|
112
|
-
if (isNaN(threshold) || statusNum === null || statusNum <= threshold)
|
|
113
|
-
return false;
|
|
114
|
-
}
|
|
115
|
-
else if (val.startsWith('<=')) {
|
|
116
|
-
const threshold = parseInt(val.slice(2), 10);
|
|
117
|
-
if (isNaN(threshold) || statusNum === null || statusNum > threshold)
|
|
118
|
-
return false;
|
|
119
|
-
}
|
|
120
|
-
else if (val.startsWith('<')) {
|
|
121
|
-
const threshold = parseInt(val.slice(1), 10);
|
|
122
|
-
if (isNaN(threshold) || statusNum === null || statusNum >= threshold)
|
|
123
|
-
return false;
|
|
124
|
-
}
|
|
125
|
-
else if (val.endsWith('xx') || val.endsWith('x')) {
|
|
126
|
-
const prefix = val.replace(/x/g, '');
|
|
127
|
-
if (!statusStr.startsWith(prefix))
|
|
128
|
-
return false;
|
|
129
|
-
}
|
|
130
|
-
else {
|
|
131
|
-
const targetCode = parseInt(val, 10);
|
|
132
|
-
if (!isNaN(targetCode)) {
|
|
133
|
-
if (statusNum !== targetCode)
|
|
134
|
-
return false;
|
|
135
|
-
}
|
|
136
|
-
else if (!statusStr.includes(val)) {
|
|
137
|
-
return false;
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
continue;
|
|
141
|
-
}
|
|
142
|
-
if (lowerToken.startsWith('is:')) {
|
|
143
|
-
const flag = lowerToken.slice(3).trim();
|
|
144
|
-
if (flag === 'error' ||
|
|
145
|
-
flag === 'failed' ||
|
|
146
|
-
flag === 'err' ||
|
|
147
|
-
flag === 'fail') {
|
|
148
|
-
const isErr = log.status === 0 || (statusNum !== null && statusNum >= 400);
|
|
149
|
-
if (!isErr)
|
|
150
|
-
return false;
|
|
151
|
-
}
|
|
152
|
-
else if (flag === 'success' || flag === 'ok' || flag === '2xx') {
|
|
153
|
-
const isSuccess = statusNum !== null && statusNum >= 200 && statusNum < 300;
|
|
154
|
-
if (!isSuccess)
|
|
155
|
-
return false;
|
|
156
|
-
}
|
|
157
|
-
else if (flag === 'pending' || flag === 'loading') {
|
|
158
|
-
if (log.status != null)
|
|
159
|
-
return false;
|
|
160
|
-
}
|
|
161
|
-
else if (flag === 'slow') {
|
|
162
|
-
if (durationNum < 1000)
|
|
163
|
-
return false;
|
|
164
|
-
}
|
|
165
|
-
else if (flag === 'fast') {
|
|
166
|
-
if (durationNum >= 200)
|
|
167
|
-
return false;
|
|
168
|
-
}
|
|
169
|
-
else if (flag === 'graphql' || flag === 'gql') {
|
|
170
|
-
const isGql = urlStr.includes('graphql') ||
|
|
171
|
-
clientStr === 'graphql' ||
|
|
172
|
-
clientStr === 'apollo';
|
|
173
|
-
if (!isGql)
|
|
174
|
-
return false;
|
|
175
|
-
}
|
|
176
|
-
else if (flag === 'https') {
|
|
177
|
-
if (!urlStr.startsWith('https'))
|
|
178
|
-
return false;
|
|
179
|
-
}
|
|
180
|
-
else if (flag === 'http') {
|
|
181
|
-
if (urlStr.startsWith('https') || !urlStr.startsWith('http'))
|
|
182
|
-
return false;
|
|
183
|
-
}
|
|
184
|
-
else if (flag === 'json') {
|
|
185
|
-
const isJson = reqHeadersStr.includes('application/json') ||
|
|
186
|
-
resHeadersStr.includes('application/json') ||
|
|
187
|
-
urlStr.includes('.json');
|
|
188
|
-
if (!isJson)
|
|
189
|
-
return false;
|
|
190
|
-
}
|
|
191
|
-
else if (flag === 'image') {
|
|
192
|
-
const isImg = resHeadersStr.includes('image/') ||
|
|
193
|
-
/\.(png|jpe?g|gif|webp|svg)/i.test(urlStr);
|
|
194
|
-
if (!isImg)
|
|
195
|
-
return false;
|
|
196
|
-
}
|
|
197
|
-
continue;
|
|
198
|
-
}
|
|
199
|
-
if (lowerToken.startsWith('slow:') ||
|
|
200
|
-
lowerToken.startsWith('dur:') ||
|
|
201
|
-
lowerToken.startsWith('duration:')) {
|
|
202
|
-
const val = lowerToken.replace(/^(slow:|dur:|duration:)/, '').trim();
|
|
203
|
-
let thresholdMs = 0;
|
|
204
|
-
let isGreater = true;
|
|
205
|
-
let cleanVal = val;
|
|
206
|
-
if (val.startsWith('>=')) {
|
|
207
|
-
isGreater = true;
|
|
208
|
-
cleanVal = val.slice(2);
|
|
209
|
-
}
|
|
210
|
-
else if (val.startsWith('>')) {
|
|
211
|
-
isGreater = true;
|
|
212
|
-
cleanVal = val.slice(1);
|
|
213
|
-
}
|
|
214
|
-
else if (val.startsWith('<=')) {
|
|
215
|
-
isGreater = false;
|
|
216
|
-
cleanVal = val.slice(2);
|
|
217
|
-
}
|
|
218
|
-
else if (val.startsWith('<')) {
|
|
219
|
-
isGreater = false;
|
|
220
|
-
cleanVal = val.slice(1);
|
|
221
|
-
}
|
|
222
|
-
if (cleanVal.endsWith('s') && !cleanVal.endsWith('ms')) {
|
|
223
|
-
thresholdMs = parseFloat(cleanVal.slice(0, -1)) * 1000;
|
|
224
|
-
}
|
|
225
|
-
else if (cleanVal.endsWith('ms')) {
|
|
226
|
-
thresholdMs = parseFloat(cleanVal.slice(0, -2));
|
|
227
|
-
}
|
|
228
|
-
else {
|
|
229
|
-
thresholdMs = parseFloat(cleanVal);
|
|
230
|
-
}
|
|
231
|
-
if (!isNaN(thresholdMs)) {
|
|
232
|
-
if (isGreater) {
|
|
233
|
-
if (durationNum < thresholdMs)
|
|
234
|
-
return false;
|
|
235
|
-
}
|
|
236
|
-
else {
|
|
237
|
-
if (durationNum > thresholdMs)
|
|
238
|
-
return false;
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
continue;
|
|
242
|
-
}
|
|
243
|
-
if (lowerToken.startsWith('client:') || lowerToken.startsWith('c:')) {
|
|
244
|
-
const targetClient = lowerToken.replace(/^(client:|c:)/, '').trim();
|
|
245
|
-
if (!clientStr.includes(targetClient))
|
|
246
|
-
return false;
|
|
247
|
-
continue;
|
|
248
|
-
}
|
|
249
|
-
if (lowerToken.startsWith('domain:') || lowerToken.startsWith('d:')) {
|
|
250
|
-
const targetDomain = lowerToken.replace(/^(domain:|d:)/, '').trim();
|
|
251
|
-
if (!urlStr.includes(targetDomain))
|
|
252
|
-
return false;
|
|
253
|
-
continue;
|
|
254
|
-
}
|
|
255
|
-
if (lowerToken.startsWith('path:') ||
|
|
256
|
-
lowerToken.startsWith('p:') ||
|
|
257
|
-
lowerToken.startsWith('page:')) {
|
|
258
|
-
const targetPath = lowerToken
|
|
259
|
-
.replace(/^(path:|p:|page:)/, '')
|
|
260
|
-
.trim();
|
|
261
|
-
if (!urlStr.includes(targetPath) &&
|
|
262
|
-
!pathStr.includes(targetPath) &&
|
|
263
|
-
!callerStr.includes(targetPath)) {
|
|
264
|
-
return false;
|
|
265
|
-
}
|
|
266
|
-
continue;
|
|
267
|
-
}
|
|
268
|
-
if (lowerToken.startsWith('req:') || lowerToken.startsWith('body:')) {
|
|
269
|
-
const target = lowerToken.replace(/^(req:|body:)/, '').trim();
|
|
270
|
-
if (!reqStr.includes(target))
|
|
271
|
-
return false;
|
|
272
|
-
continue;
|
|
273
|
-
}
|
|
274
|
-
if (lowerToken.startsWith('res:')) {
|
|
275
|
-
const target = lowerToken.slice(4).trim();
|
|
276
|
-
if (!resStr.includes(target))
|
|
277
|
-
return false;
|
|
278
|
-
continue;
|
|
279
|
-
}
|
|
280
|
-
if (lowerToken.startsWith('header:') || lowerToken.startsWith('h:')) {
|
|
281
|
-
const target = lowerToken.replace(/^(header:|h:)/, '').trim();
|
|
282
|
-
if (!reqHeadersStr.includes(target) && !resHeadersStr.includes(target)) {
|
|
283
|
-
return false;
|
|
284
|
-
}
|
|
285
|
-
continue;
|
|
286
|
-
}
|
|
287
|
-
if (isRegex) {
|
|
288
|
-
try {
|
|
289
|
-
const re = new RegExp(token, isCaseSensitive ? '' : 'i');
|
|
290
|
-
if (!re.test(targetCorpus))
|
|
291
|
-
return false;
|
|
292
|
-
}
|
|
293
|
-
catch {
|
|
294
|
-
const queryTerm = isCaseSensitive ? token : lowerToken;
|
|
295
|
-
if (!targetCorpus.includes(queryTerm))
|
|
296
|
-
return false;
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
|
-
else {
|
|
300
|
-
const queryTerm = isCaseSensitive ? token : lowerToken;
|
|
301
|
-
if (!targetCorpus.includes(queryTerm)) {
|
|
302
|
-
if (queryTerm === 'error' ||
|
|
303
|
-
queryTerm === 'failed' ||
|
|
304
|
-
queryTerm === 'fail') {
|
|
305
|
-
const isErr = log.status === 0 || (statusNum !== null && statusNum >= 400);
|
|
306
|
-
if (isErr)
|
|
307
|
-
continue;
|
|
308
|
-
}
|
|
309
|
-
return false;
|
|
310
|
-
}
|
|
311
|
-
}
|
|
312
|
-
}
|
|
313
|
-
return true;
|
|
37
|
+
const corpus = [
|
|
38
|
+
methodRaw,
|
|
39
|
+
urlRaw,
|
|
40
|
+
statusStr,
|
|
41
|
+
pathRaw,
|
|
42
|
+
callerRaw,
|
|
43
|
+
clientRaw,
|
|
44
|
+
reqRaw,
|
|
45
|
+
resRaw,
|
|
46
|
+
reqHeadersRaw,
|
|
47
|
+
resHeadersRaw,
|
|
48
|
+
].join(' ');
|
|
49
|
+
return rawTokens.every(token => {
|
|
50
|
+
if (corpus.includes(token))
|
|
51
|
+
return true;
|
|
52
|
+
if (token === 'error' || token === 'failed' || token === 'err' || token === 'fail') {
|
|
53
|
+
return log.status === 0 || (statusNum !== null && statusNum >= 400);
|
|
54
|
+
}
|
|
55
|
+
if (token === 'success' || token === 'ok' || token === '2xx') {
|
|
56
|
+
return statusNum !== null && statusNum >= 200 && statusNum < 300;
|
|
57
|
+
}
|
|
58
|
+
return false;
|
|
59
|
+
});
|
|
314
60
|
}
|
package/dist/commonjs/index.js
CHANGED
|
@@ -168,7 +168,7 @@ const NetworkInspector = ({ enabled = true, storage, navigationRef, appIcon, env
|
|
|
168
168
|
const [maxConsoleLogs, setMaxConsoleLogs] = (0, react_1.useState)(100);
|
|
169
169
|
const [showConsoleLevels, setShowConsoleLevels] = (0, react_1.useState)({
|
|
170
170
|
info: true,
|
|
171
|
-
warn:
|
|
171
|
+
warn: true,
|
|
172
172
|
error: true,
|
|
173
173
|
});
|
|
174
174
|
const visibleConsoleLogs = (0, react_1.useMemo)(() => {
|
|
@@ -196,7 +196,7 @@ const NetworkInspector = ({ enabled = true, storage, navigationRef, appIcon, env
|
|
|
196
196
|
return filtered.slice(0, maxConsoleLogs);
|
|
197
197
|
}, [consoleLogs, showConsoleLevels, maxConsoleLogs]);
|
|
198
198
|
const [logSearch, setLogSearch] = (0, react_1.useState)('');
|
|
199
|
-
const [logFilters, setLogFilters] = (0, react_1.useState)(new Set(['
|
|
199
|
+
const [logFilters, setLogFilters] = (0, react_1.useState)(new Set(['all']));
|
|
200
200
|
const [settingsPage, setSettingsPage] = (0, react_1.useState)(null);
|
|
201
201
|
const [settingsActiveSubTab, setSettingsActiveSubTab] = (0, react_1.useState)('module');
|
|
202
202
|
const [tabVisibility, setTabVisibility] = (0, react_1.useState)({
|
|
@@ -211,8 +211,8 @@ const NetworkInspector = ({ enabled = true, storage, navigationRef, appIcon, env
|
|
|
211
211
|
storage: false,
|
|
212
212
|
debugging: false,
|
|
213
213
|
});
|
|
214
|
-
const [maxNetworkLogs, setMaxNetworkLogs] = (0, react_1.useState)(
|
|
215
|
-
const [maxAnalyticsEventsLimit, setMaxAnalyticsEventsLimit] = (0, react_1.useState)(
|
|
214
|
+
const [maxNetworkLogs, setMaxNetworkLogs] = (0, react_1.useState)(250);
|
|
215
|
+
const [maxAnalyticsEventsLimit, setMaxAnalyticsEventsLimit] = (0, react_1.useState)(150);
|
|
216
216
|
const [isAutoRamLimitEnabled, setIsAutoRamLimitEnabled] = (0, react_1.useState)(true);
|
|
217
217
|
const [deviceFreeRamMb, setDeviceFreeRamMb] = (0, react_1.useState)(1800);
|
|
218
218
|
const [reduxAutoRefresh, setReduxAutoRefreshState] = (0, react_1.useState)(true);
|
|
@@ -1407,27 +1407,18 @@ const NetworkInspector = ({ enabled = true, storage, navigationRef, appIcon, env
|
|
|
1407
1407
|
log.caller || '',
|
|
1408
1408
|
log.type || '',
|
|
1409
1409
|
log.sourceMethod || '',
|
|
1410
|
+
log.stack || '',
|
|
1410
1411
|
].join(' ').toLowerCase();
|
|
1411
1412
|
return queryTokens.every(token => {
|
|
1412
|
-
if (token.startsWith('level:') || token.startsWith('is:') || token.startsWith('type:')) {
|
|
1413
|
-
const flag = token.replace(/^(level:|is:|type:)/, '').trim();
|
|
1414
|
-
if (flag === 'error' || flag === 'err')
|
|
1415
|
-
return log.type === 'error';
|
|
1416
|
-
if (flag === 'warn' || flag === 'warning')
|
|
1417
|
-
return log.type === 'warn';
|
|
1418
|
-
if (flag === 'info')
|
|
1419
|
-
return log.type === 'info';
|
|
1420
|
-
if (flag === 'log')
|
|
1421
|
-
return log.sourceMethod === 'log';
|
|
1422
|
-
if (flag === 'analytics')
|
|
1423
|
-
return (log.message || '').toLowerCase().includes('[analytics');
|
|
1424
|
-
}
|
|
1425
1413
|
if (token === 'error' || token === 'err') {
|
|
1426
1414
|
return log.type === 'error' || searchTarget.includes(token);
|
|
1427
1415
|
}
|
|
1428
1416
|
if (token === 'warn' || token === 'warning') {
|
|
1429
1417
|
return log.type === 'warn' || searchTarget.includes(token);
|
|
1430
1418
|
}
|
|
1419
|
+
if (token === 'info') {
|
|
1420
|
+
return log.type === 'info' || searchTarget.includes(token);
|
|
1421
|
+
}
|
|
1431
1422
|
return searchTarget.includes(token);
|
|
1432
1423
|
});
|
|
1433
1424
|
});
|
|
@@ -1472,8 +1463,20 @@ const NetworkInspector = ({ enabled = true, storage, navigationRef, appIcon, env
|
|
|
1472
1463
|
log.caller || '',
|
|
1473
1464
|
log.type || '',
|
|
1474
1465
|
log.sourceMethod || '',
|
|
1466
|
+
log.stack || '',
|
|
1475
1467
|
].join(' ').toLowerCase();
|
|
1476
|
-
return queryTokens.every(token =>
|
|
1468
|
+
return queryTokens.every(token => {
|
|
1469
|
+
if (token === 'error' || token === 'err') {
|
|
1470
|
+
return log.type === 'error' || searchTarget.includes(token);
|
|
1471
|
+
}
|
|
1472
|
+
if (token === 'warn' || token === 'warning') {
|
|
1473
|
+
return log.type === 'warn' || searchTarget.includes(token);
|
|
1474
|
+
}
|
|
1475
|
+
if (token === 'info') {
|
|
1476
|
+
return log.type === 'info' || searchTarget.includes(token);
|
|
1477
|
+
}
|
|
1478
|
+
return searchTarget.includes(token);
|
|
1479
|
+
});
|
|
1477
1480
|
});
|
|
1478
1481
|
}
|
|
1479
1482
|
const total = visibleConsoleLogs.length;
|
|
@@ -1487,14 +1490,15 @@ const NetworkInspector = ({ enabled = true, storage, navigationRef, appIcon, env
|
|
|
1487
1490
|
};
|
|
1488
1491
|
}, [visibleConsoleLogs, logSearch]);
|
|
1489
1492
|
function closeModal() {
|
|
1490
|
-
(0, InspectorContext_1.animateNextLayout)();
|
|
1491
1493
|
setVisible(false);
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1494
|
+
setTimeout(() => {
|
|
1495
|
+
setSelected(null);
|
|
1496
|
+
setSelectedEvent(null);
|
|
1497
|
+
setSelectedLog(null);
|
|
1498
|
+
setSelectedReduxSlice(null);
|
|
1499
|
+
setSelectedReduxAction(null);
|
|
1500
|
+
setSelectedCrash(null);
|
|
1501
|
+
}, 300);
|
|
1498
1502
|
}
|
|
1499
1503
|
function handleClearAll() {
|
|
1500
1504
|
(0, networkLogger_1.clearNetworkLogs)();
|
|
@@ -1504,13 +1508,17 @@ const NetworkInspector = ({ enabled = true, storage, navigationRef, appIcon, env
|
|
|
1504
1508
|
setCollapsedSections(new Set());
|
|
1505
1509
|
setStatusFilters(new Set());
|
|
1506
1510
|
setMethodFilters(new Set());
|
|
1511
|
+
setSearch('');
|
|
1507
1512
|
prevLogIdsRef.current = new Set();
|
|
1508
1513
|
logRouteMapRef.current = new Map();
|
|
1509
1514
|
(0, analyticsLogger_1.clearAnalyticsEvents)();
|
|
1510
1515
|
setAnalyticsEvents([]);
|
|
1516
|
+
setAnalyticsSearch('');
|
|
1511
1517
|
prevEventIdsRef.current = new Set();
|
|
1512
1518
|
(0, consoleLogger_1.clearConsoleLogs)();
|
|
1513
1519
|
setConsoleLogs([]);
|
|
1520
|
+
setLogFilters(new Set(['all']));
|
|
1521
|
+
setLogSearch('');
|
|
1514
1522
|
}
|
|
1515
1523
|
function handleDelete() {
|
|
1516
1524
|
if (activeTab === 'logs') {
|
|
@@ -1624,7 +1632,7 @@ const NetworkInspector = ({ enabled = true, storage, navigationRef, appIcon, env
|
|
|
1624
1632
|
return next;
|
|
1625
1633
|
});
|
|
1626
1634
|
}, []);
|
|
1627
|
-
const contextValue = {
|
|
1635
|
+
const contextValue = (0, react_1.useMemo)(() => ({
|
|
1628
1636
|
visible,
|
|
1629
1637
|
setVisible,
|
|
1630
1638
|
closeModal,
|
|
@@ -1791,7 +1799,113 @@ const NetworkInspector = ({ enabled = true, storage, navigationRef, appIcon, env
|
|
|
1791
1799
|
setReduxAutoRefreshState,
|
|
1792
1800
|
reduxExpandDepth,
|
|
1793
1801
|
setReduxExpandDepth,
|
|
1794
|
-
}
|
|
1802
|
+
}), [
|
|
1803
|
+
visible,
|
|
1804
|
+
closeModal,
|
|
1805
|
+
isReady,
|
|
1806
|
+
enabled,
|
|
1807
|
+
appIcon,
|
|
1808
|
+
environment,
|
|
1809
|
+
modalHeightPercent,
|
|
1810
|
+
modalAnimationType,
|
|
1811
|
+
hasNavigationContext,
|
|
1812
|
+
setNavState,
|
|
1813
|
+
activeTab,
|
|
1814
|
+
switchActiveTab,
|
|
1815
|
+
tabVisibility,
|
|
1816
|
+
toggleTabVisibility,
|
|
1817
|
+
lastReadApisCount,
|
|
1818
|
+
lastReadLogsCount,
|
|
1819
|
+
selected,
|
|
1820
|
+
selectedEvent,
|
|
1821
|
+
selectedLog,
|
|
1822
|
+
showHeaderInfo,
|
|
1823
|
+
settingsPage,
|
|
1824
|
+
updateAvailable,
|
|
1825
|
+
latestNpmVersion,
|
|
1826
|
+
clearAnim,
|
|
1827
|
+
activePulseAnim,
|
|
1828
|
+
unreadPulseAnim,
|
|
1829
|
+
runClearAllWithAnimation,
|
|
1830
|
+
useNativeFab,
|
|
1831
|
+
fabPan,
|
|
1832
|
+
fabPanResponder,
|
|
1833
|
+
pulseAnim,
|
|
1834
|
+
fabShineAnim,
|
|
1835
|
+
logs,
|
|
1836
|
+
filteredLogs,
|
|
1837
|
+
groupedData,
|
|
1838
|
+
search,
|
|
1839
|
+
searchScope,
|
|
1840
|
+
isRegexSearch,
|
|
1841
|
+
isCaseSensitive,
|
|
1842
|
+
quickFilter,
|
|
1843
|
+
statusFilters,
|
|
1844
|
+
methodFilters,
|
|
1845
|
+
availableMethods,
|
|
1846
|
+
sortOrder,
|
|
1847
|
+
selectedLogs,
|
|
1848
|
+
toggleSelect,
|
|
1849
|
+
minStart,
|
|
1850
|
+
totalRange,
|
|
1851
|
+
newLogIds,
|
|
1852
|
+
toggleSectionFilter,
|
|
1853
|
+
toggleSectionCollapse,
|
|
1854
|
+
handleDelete,
|
|
1855
|
+
isNetworkPaused,
|
|
1856
|
+
detailTitle,
|
|
1857
|
+
detailDisplayUrl,
|
|
1858
|
+
apiDetailActiveTab,
|
|
1859
|
+
detailSearch,
|
|
1860
|
+
reqExpanded,
|
|
1861
|
+
resExpanded,
|
|
1862
|
+
showReqDiff,
|
|
1863
|
+
showResDiff,
|
|
1864
|
+
prevRequestData,
|
|
1865
|
+
prevResponseData,
|
|
1866
|
+
consoleLogs,
|
|
1867
|
+
visibleConsoleLogs,
|
|
1868
|
+
filteredConsoleLogs,
|
|
1869
|
+
logSearch,
|
|
1870
|
+
logFilters,
|
|
1871
|
+
logCounts,
|
|
1872
|
+
logSortOrder,
|
|
1873
|
+
isConsolePaused,
|
|
1874
|
+
analyticsEvents,
|
|
1875
|
+
filteredAnalyticsEvents,
|
|
1876
|
+
analyticsSearch,
|
|
1877
|
+
analyticsFilters,
|
|
1878
|
+
isAnalyticsFilterApplied,
|
|
1879
|
+
resetAnalyticsFilters,
|
|
1880
|
+
newEventIds,
|
|
1881
|
+
isAnalyticsLayoutReady,
|
|
1882
|
+
analyticsHeaderExpanded,
|
|
1883
|
+
isAnalyticsPaused,
|
|
1884
|
+
reduxState,
|
|
1885
|
+
reduxLastActionMap,
|
|
1886
|
+
reduxSearch,
|
|
1887
|
+
selectedReduxSlice,
|
|
1888
|
+
selectedReduxAction,
|
|
1889
|
+
reduxActiveSubTab,
|
|
1890
|
+
crashRecords,
|
|
1891
|
+
selectedCrash,
|
|
1892
|
+
lastReadCrashesCount,
|
|
1893
|
+
maxCrashLogs,
|
|
1894
|
+
settingsActiveSubTab,
|
|
1895
|
+
defaultTab,
|
|
1896
|
+
isDark,
|
|
1897
|
+
showDuplicateLogs,
|
|
1898
|
+
showUpdateToast,
|
|
1899
|
+
showConsoleLevels,
|
|
1900
|
+
storage,
|
|
1901
|
+
maxNetworkLogs,
|
|
1902
|
+
maxConsoleLogs,
|
|
1903
|
+
maxAnalyticsEventsLimit,
|
|
1904
|
+
isAutoRamLimitEnabled,
|
|
1905
|
+
deviceFreeRamMb,
|
|
1906
|
+
reduxAutoRefresh,
|
|
1907
|
+
reduxExpandDepth,
|
|
1908
|
+
]);
|
|
1795
1909
|
return (<InspectorContext_1.InspectorContext.Provider value={contextValue}>
|
|
1796
1910
|
<MainScreen_1.default />
|
|
1797
1911
|
</InspectorContext_1.InspectorContext.Provider>);
|
|
@@ -5,15 +5,15 @@ const AnimatedEntrance = React.memo(function AnimatedEntrance({ children, delay
|
|
|
5
5
|
return <View style={style}>{children}</View>;
|
|
6
6
|
}
|
|
7
7
|
const progress = useRef(new Animated.Value(0)).current;
|
|
8
|
+
const initialIndex = useRef(index).current;
|
|
8
9
|
useEffect(() => {
|
|
9
|
-
progress.setValue(0);
|
|
10
10
|
Animated.timing(progress, {
|
|
11
11
|
toValue: 1,
|
|
12
12
|
duration,
|
|
13
|
-
delay: delay + Math.min(
|
|
13
|
+
delay: delay + Math.min(initialIndex, 8) * 12,
|
|
14
14
|
useNativeDriver: true,
|
|
15
15
|
}).start();
|
|
16
|
-
}, [
|
|
16
|
+
}, []);
|
|
17
17
|
return (<Animated.View style={[
|
|
18
18
|
style,
|
|
19
19
|
{
|