react-native-inapp-inspector 2.0.0 → 2.0.1
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/android/src/main/java/com/inappinspector/NetworkInspectorModule.kt +10 -24
- package/dist/commonjs/components/ConsoleLogCard.js +5 -5
- package/dist/commonjs/components/EndOfListFooter.js +1 -1
- package/dist/commonjs/components/Inspector/AnalyticsTab.js +19 -71
- package/dist/commonjs/components/Inspector/BundleTab.js +670 -188
- package/dist/commonjs/components/Inspector/ConsoleTab.js +109 -98
- package/dist/commonjs/components/Inspector/CrashTab.js +2 -1
- package/dist/commonjs/components/Inspector/InspectorHeader.js +102 -19
- package/dist/commonjs/components/Inspector/MainScreen.js +147 -17
- package/dist/commonjs/components/Inspector/NetworkTab.js +104 -20
- package/dist/commonjs/components/Inspector/SettingsPanel.js +1111 -1385
- package/dist/commonjs/components/Inspector/TabBar.js +3 -4
- package/dist/commonjs/components/JsonViewer.js +9 -4
- package/dist/commonjs/components/LogCard.js +31 -1
- package/dist/commonjs/components/LogSyntaxHighlighter.d.ts +16 -0
- package/dist/commonjs/components/LogSyntaxHighlighter.js +130 -0
- package/dist/commonjs/components/NetworkIcons.d.ts +2 -0
- package/dist/commonjs/components/NetworkIcons.js +10 -1
- package/dist/commonjs/components/Slider.d.ts +13 -0
- package/dist/commonjs/components/Slider.js +261 -0
- 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/crashHandler.js +1 -1
- package/dist/commonjs/helpers/index.d.ts +1 -0
- package/dist/commonjs/helpers/index.js +15 -0
- package/dist/commonjs/helpers/searchQueryParser.d.ts +6 -0
- package/dist/commonjs/helpers/searchQueryParser.js +236 -0
- package/dist/commonjs/helpers/settingsStore.js +13 -13
- package/dist/commonjs/index.js +7 -20
- package/dist/commonjs/styles/index.js +35 -35
- package/dist/esm/components/ConsoleLogCard.js +5 -5
- package/dist/esm/components/EndOfListFooter.js +2 -2
- package/dist/esm/components/Inspector/AnalyticsTab.js +21 -73
- package/dist/esm/components/Inspector/BundleTab.js +670 -188
- package/dist/esm/components/Inspector/ConsoleTab.js +110 -99
- package/dist/esm/components/Inspector/CrashTab.js +2 -1
- package/dist/esm/components/Inspector/InspectorHeader.js +103 -20
- package/dist/esm/components/Inspector/MainScreen.js +115 -18
- package/dist/esm/components/Inspector/NetworkTab.js +105 -21
- package/dist/esm/components/Inspector/SettingsPanel.js +1114 -1388
- package/dist/esm/components/Inspector/TabBar.js +4 -5
- package/dist/esm/components/JsonViewer.js +9 -4
- package/dist/esm/components/LogCard.js +32 -2
- package/dist/esm/components/LogSyntaxHighlighter.d.ts +16 -0
- package/dist/esm/components/LogSyntaxHighlighter.js +123 -0
- package/dist/esm/components/NetworkIcons.d.ts +2 -0
- package/dist/esm/components/NetworkIcons.js +7 -0
- package/dist/esm/components/Slider.d.ts +13 -0
- package/dist/esm/components/Slider.js +222 -0
- package/dist/esm/constants/version.d.ts +1 -1
- package/dist/esm/constants/version.js +1 -1
- package/dist/esm/customHooks/analyticsLogger.js +1 -1
- package/dist/esm/customHooks/crashHandler.js +1 -1
- package/dist/esm/helpers/index.d.ts +1 -0
- package/dist/esm/helpers/index.js +1 -0
- package/dist/esm/helpers/searchQueryParser.d.ts +6 -0
- package/dist/esm/helpers/searchQueryParser.js +233 -0
- package/dist/esm/helpers/settingsStore.js +13 -13
- package/dist/esm/index.js +8 -21
- package/dist/esm/styles/index.js +35 -35
- package/ios/NetworkInspectorModule.m +81 -41
- package/package.json +1 -1
|
@@ -177,11 +177,20 @@ static NSUncaughtExceptionHandler *previousUncaughtExceptionHandler = NULL;
|
|
|
177
177
|
|
|
178
178
|
@end
|
|
179
179
|
|
|
180
|
+
@interface InAppInspectorFloatingView ()
|
|
181
|
+
@property (nonatomic, assign) CGPoint touchDownPoint;
|
|
182
|
+
@property (nonatomic, assign) CGPoint initialCenter;
|
|
183
|
+
@property (nonatomic, assign) NSTimeInterval touchDownTime;
|
|
184
|
+
@property (nonatomic, assign) BOOL isDragging;
|
|
185
|
+
@end
|
|
186
|
+
|
|
180
187
|
@implementation InAppInspectorFloatingView
|
|
181
188
|
|
|
182
189
|
- (instancetype)initWithFrame:(CGRect)frame {
|
|
183
190
|
self = [super initWithFrame:frame];
|
|
184
191
|
if (self) {
|
|
192
|
+
self.userInteractionEnabled = YES;
|
|
193
|
+
self.multipleTouchEnabled = NO;
|
|
185
194
|
self.layer.cornerRadius = frame.size.width / 2.0;
|
|
186
195
|
self.layer.masksToBounds = NO;
|
|
187
196
|
self.backgroundColor = [UIColor colorWithRed:15.0/255.0 green:23.0/255.0 blue:42.0/255.0 alpha:0.95];
|
|
@@ -198,62 +207,87 @@ static NSUncaughtExceptionHandler *previousUncaughtExceptionHandler = NULL;
|
|
|
198
207
|
CGFloat iconSize = frame.size.width * 0.94;
|
|
199
208
|
CGFloat iconOffset = (frame.size.width - iconSize) / 2.0;
|
|
200
209
|
InAppInspectorOwlView *owlView = [[InAppInspectorOwlView alloc] initWithFrame:CGRectMake(iconOffset, iconOffset, iconSize, iconSize)];
|
|
210
|
+
owlView.userInteractionEnabled = NO;
|
|
201
211
|
[self addSubview:owlView];
|
|
202
|
-
|
|
203
|
-
// Status dot badge
|
|
204
|
-
_badgeDot = [[UIView alloc] initWithFrame:CGRectMake(frame.size.width - 14, 4, 10, 10)];
|
|
205
|
-
_badgeDot.layer.cornerRadius = 5;
|
|
206
|
-
_badgeDot.backgroundColor = [UIColor colorWithRed:34.0/255.0 green:197.0/255.0 blue:94.0/255.0 alpha:1.0];
|
|
207
|
-
_badgeDot.layer.borderColor = [UIColor colorWithRed:15.0/255.0 green:23.0/255.0 blue:42.0/255.0 alpha:1.0].CGColor;
|
|
208
|
-
_badgeDot.layer.borderWidth = 1.5;
|
|
209
|
-
_badgeDot.hidden = YES;
|
|
210
|
-
[self addSubview:_badgeDot];
|
|
211
|
-
|
|
212
|
-
// Gestures (Main UI thread only)
|
|
213
|
-
UIPanGestureRecognizer *pan = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(handlePan:)];
|
|
214
|
-
[self addGestureRecognizer:pan];
|
|
215
|
-
|
|
216
|
-
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleTap:)];
|
|
217
|
-
[self addGestureRecognizer:tap];
|
|
218
|
-
|
|
219
|
-
[tap requireGestureRecognizerToFail:pan];
|
|
220
212
|
}
|
|
221
213
|
return self;
|
|
222
214
|
}
|
|
223
215
|
|
|
224
216
|
- (void)updateBadgeVisible:(BOOL)visible {
|
|
225
|
-
|
|
217
|
+
// Active badge dot removed
|
|
226
218
|
}
|
|
227
219
|
|
|
228
|
-
- (void)
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
220
|
+
- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
|
|
221
|
+
UITouch *touch = [touches anyObject];
|
|
222
|
+
if (!touch) return;
|
|
223
|
+
|
|
224
|
+
if (self.superview) {
|
|
225
|
+
[self.superview bringSubviewToFront:self];
|
|
233
226
|
}
|
|
227
|
+
|
|
228
|
+
self.touchDownPoint = [touch locationInView:self.window];
|
|
229
|
+
self.initialCenter = self.center;
|
|
230
|
+
self.touchDownTime = CACurrentMediaTime();
|
|
231
|
+
self.isDragging = NO;
|
|
232
|
+
|
|
233
|
+
[UIView animateWithDuration:0.08 animations:^{
|
|
234
|
+
self.transform = CGAffineTransformMakeScale(0.92, 0.92);
|
|
235
|
+
}];
|
|
234
236
|
}
|
|
235
237
|
|
|
236
|
-
- (void)
|
|
238
|
+
- (void)touchesMoved:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
|
|
239
|
+
UITouch *touch = [touches anyObject];
|
|
237
240
|
UIView *superview = self.superview;
|
|
238
|
-
if (!superview) return;
|
|
241
|
+
if (!touch || !superview) return;
|
|
239
242
|
|
|
240
|
-
CGPoint
|
|
241
|
-
|
|
243
|
+
CGPoint currentPoint = [touch locationInView:self.window];
|
|
244
|
+
CGFloat dx = currentPoint.x - self.touchDownPoint.x;
|
|
245
|
+
CGFloat dy = currentPoint.y - self.touchDownPoint.y;
|
|
246
|
+
CGFloat distance = hypot(dx, dy);
|
|
242
247
|
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
CGFloat maxX = superview.bounds.size.width - halfW - 10;
|
|
247
|
-
CGFloat minY = halfH + 44;
|
|
248
|
-
CGFloat maxY = superview.bounds.size.height - halfH - 44;
|
|
248
|
+
if (!self.isDragging && distance > 14.0) {
|
|
249
|
+
self.isDragging = YES;
|
|
250
|
+
}
|
|
249
251
|
|
|
250
|
-
|
|
251
|
-
|
|
252
|
+
if (self.isDragging) {
|
|
253
|
+
CGFloat halfW = self.bounds.size.width / 2.0;
|
|
254
|
+
CGFloat halfH = self.bounds.size.height / 2.0;
|
|
255
|
+
CGFloat minX = halfW + 10.0;
|
|
256
|
+
CGFloat maxX = superview.bounds.size.width - halfW - 10.0;
|
|
257
|
+
CGFloat minY = halfH + 44.0;
|
|
258
|
+
CGFloat maxY = superview.bounds.size.height - halfH - 44.0;
|
|
259
|
+
|
|
260
|
+
CGPoint newCenter = CGPointMake(self.initialCenter.x + dx, self.initialCenter.y + dy);
|
|
261
|
+
newCenter.x = MAX(minX, MIN(maxX, newCenter.x));
|
|
262
|
+
newCenter.y = MAX(minY, MIN(maxY, newCenter.y));
|
|
263
|
+
self.center = newCenter;
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
- (void)touchesEnded:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
|
|
268
|
+
UITouch *touch = [touches anyObject];
|
|
269
|
+
UIView *superview = self.superview;
|
|
270
|
+
|
|
271
|
+
[UIView animateWithDuration:0.12 animations:^{
|
|
272
|
+
self.transform = CGAffineTransformIdentity;
|
|
273
|
+
}];
|
|
252
274
|
|
|
253
|
-
|
|
254
|
-
[pan setTranslation:CGPointZero inView:superview];
|
|
275
|
+
if (!touch || !superview) return;
|
|
255
276
|
|
|
256
|
-
|
|
277
|
+
CGPoint currentPoint = [touch locationInView:self.window];
|
|
278
|
+
CGFloat dx = currentPoint.x - self.touchDownPoint.x;
|
|
279
|
+
CGFloat dy = currentPoint.y - self.touchDownPoint.y;
|
|
280
|
+
CGFloat distance = hypot(dx, dy);
|
|
281
|
+
NSTimeInterval elapsed = CACurrentMediaTime() - self.touchDownTime;
|
|
282
|
+
|
|
283
|
+
if (!self.isDragging && distance < 24.0 && elapsed < 0.85) {
|
|
284
|
+
if (self.onTapBlock) {
|
|
285
|
+
self.onTapBlock();
|
|
286
|
+
}
|
|
287
|
+
} else if (self.isDragging) {
|
|
288
|
+
CGFloat halfW = self.bounds.size.width / 2.0;
|
|
289
|
+
CGFloat minX = halfW + 10.0;
|
|
290
|
+
CGFloat maxX = superview.bounds.size.width - halfW - 10.0;
|
|
257
291
|
CGFloat targetX = (self.center.x < superview.bounds.size.width / 2.0) ? minX : maxX;
|
|
258
292
|
[UIView animateWithDuration:0.25 delay:0 usingSpringWithDamping:0.75 initialSpringVelocity:0.5 options:UIViewAnimationOptionCurveEaseOut animations:^{
|
|
259
293
|
self.center = CGPointMake(targetX, self.center.y);
|
|
@@ -261,6 +295,12 @@ static NSUncaughtExceptionHandler *previousUncaughtExceptionHandler = NULL;
|
|
|
261
295
|
}
|
|
262
296
|
}
|
|
263
297
|
|
|
298
|
+
- (void)touchesCancelled:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
|
|
299
|
+
[UIView animateWithDuration:0.12 animations:^{
|
|
300
|
+
self.transform = CGAffineTransformIdentity;
|
|
301
|
+
}];
|
|
302
|
+
}
|
|
303
|
+
|
|
264
304
|
@end
|
|
265
305
|
|
|
266
306
|
static InAppInspectorFloatingView *floatingButtonView = nil;
|
|
@@ -521,8 +561,8 @@ RCT_EXPORT_METHOD(showFloatingButton:(NSDictionary *)options
|
|
|
521
561
|
floatingButtonView = [[InAppInspectorFloatingView alloc] initWithFrame:CGRectMake(initialX, initialY, size, size)];
|
|
522
562
|
__weak NetworkInspectorModule *weakSelf = self;
|
|
523
563
|
floatingButtonView.onTapBlock = ^{
|
|
524
|
-
NetworkInspectorModule *strongSelf = weakSelf;
|
|
525
|
-
if (strongSelf
|
|
564
|
+
NetworkInspectorModule *strongSelf = weakSelf ?: sharedInstance;
|
|
565
|
+
if (strongSelf) {
|
|
526
566
|
[strongSelf sendEventWithName:@"onFloatingButtonPress" body:@{}];
|
|
527
567
|
}
|
|
528
568
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-inapp-inspector",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"description": "The zero-config, all-in-one in-app debugger for React Native & Expo. Inspect Network (fetch/axios), Console logs, Stack Traces, Redux State, Firebase Analytics, and JS Bundle size directly on device.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|