react-native-inapp-inspector 2.3.18 → 2.3.19
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 +47 -0
- package/dist/commonjs/capture.d.ts +2 -0
- package/dist/commonjs/capture.js +3 -0
- package/dist/commonjs/components/EmptyState.d.ts +1 -0
- package/dist/commonjs/components/EmptyState.js +2 -2
- package/dist/commonjs/components/Inspector/FabLauncher.js +494 -39
- package/dist/commonjs/components/Inspector/InspectorHeader.js +45 -26
- package/dist/commonjs/components/Inspector/MainScreen.js +4 -3
- package/dist/commonjs/components/Inspector/MediaGalleryTab.js +418 -13
- package/dist/commonjs/components/Inspector/MediaPreviewModal.js +376 -88
- package/dist/commonjs/components/Inspector/NetworkDetail.js +49 -63
- package/dist/commonjs/components/Inspector/SettingsPanel.js +499 -119
- package/dist/commonjs/components/Inspector/TabBar.js +166 -4
- package/dist/commonjs/components/JsonViewer.js +4 -3
- package/dist/commonjs/components/NetworkIcons.d.ts +4 -0
- package/dist/commonjs/components/NetworkIcons.js +26 -1
- package/dist/commonjs/components/SegmentedTabs.js +1 -0
- package/dist/commonjs/constants/version.d.ts +1 -1
- package/dist/commonjs/constants/version.js +1 -1
- package/dist/commonjs/i18n/locales/en.json +20 -2
- package/dist/commonjs/index.js +45 -30
- package/dist/commonjs/native/NativeInspector.d.ts +3 -0
- package/dist/commonjs/native/NativeInspector.js +14 -1
- package/dist/commonjs/native/NativeNetworkInspector.d.ts +1 -0
- package/dist/commonjs/styles/AppColors.js +78 -78
- package/dist/commonjs/types/enums.d.ts +2 -0
- package/dist/commonjs/types/enums.js +2 -0
- package/dist/commonjs/types/interfaces.d.ts +5 -0
- package/dist/esm/capture.d.ts +2 -0
- package/dist/esm/capture.js +4 -1
- package/dist/esm/components/EmptyState.d.ts +1 -0
- package/dist/esm/components/EmptyState.js +2 -2
- package/dist/esm/components/Inspector/FabLauncher.js +462 -40
- package/dist/esm/components/Inspector/InspectorHeader.js +46 -27
- package/dist/esm/components/Inspector/MainScreen.js +4 -3
- package/dist/esm/components/Inspector/MediaGalleryTab.js +419 -14
- package/dist/esm/components/Inspector/MediaPreviewModal.js +379 -91
- package/dist/esm/components/Inspector/NetworkDetail.js +49 -63
- package/dist/esm/components/Inspector/SettingsPanel.js +500 -120
- package/dist/esm/components/Inspector/TabBar.js +135 -6
- package/dist/esm/components/JsonViewer.js +4 -3
- package/dist/esm/components/NetworkIcons.d.ts +4 -0
- package/dist/esm/components/NetworkIcons.js +21 -0
- package/dist/esm/components/SegmentedTabs.js +1 -0
- package/dist/esm/constants/version.d.ts +1 -1
- package/dist/esm/constants/version.js +1 -1
- package/dist/esm/i18n/locales/en.json +20 -2
- package/dist/esm/index.js +44 -29
- package/dist/esm/native/NativeInspector.d.ts +3 -0
- package/dist/esm/native/NativeInspector.js +12 -0
- package/dist/esm/native/NativeNetworkInspector.d.ts +1 -0
- package/dist/esm/styles/AppColors.js +78 -78
- package/dist/esm/types/enums.d.ts +2 -0
- package/dist/esm/types/enums.js +2 -0
- package/dist/esm/types/interfaces.d.ts +5 -0
- package/ios/NetworkInspectorModule.mm +241 -136
- package/package.json +1 -1
- package/react-native-inapp-inspector.podspec +1 -1
- package/src/capture.ts +8 -0
- package/src/components/EmptyState.tsx +3 -1
- package/src/components/Inspector/FabLauncher.tsx +562 -52
- package/src/components/Inspector/InspectorHeader.tsx +60 -22
- package/src/components/Inspector/MainScreen.tsx +3 -2
- package/src/components/Inspector/MediaGalleryTab.tsx +502 -28
- package/src/components/Inspector/MediaPreviewModal.tsx +465 -117
- package/src/components/Inspector/NetworkDetail.tsx +80 -97
- package/src/components/Inspector/SettingsPanel.tsx +708 -152
- package/src/components/Inspector/TabBar.tsx +174 -6
- package/src/components/JsonViewer.tsx +4 -2
- package/src/components/NetworkIcons.tsx +56 -0
- package/src/components/SegmentedTabs.tsx +1 -0
- package/src/constants/version.ts +1 -1
- package/src/i18n/locales/en.json +20 -4
- package/src/index.tsx +46 -31
- package/src/native/NativeInspector.ts +17 -0
- package/src/native/NativeNetworkInspector.ts +1 -0
- package/src/styles/AppColors.ts +80 -80
- package/src/types/enums.ts +2 -0
- package/src/types/interfaces.ts +5 -0
|
@@ -1,9 +1,42 @@
|
|
|
1
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
|
+
})();
|
|
2
35
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
37
|
};
|
|
5
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const react_1 =
|
|
39
|
+
const react_1 = __importStar(require("react"));
|
|
7
40
|
const react_native_1 = require("react-native");
|
|
8
41
|
const InspectorContext_1 = require("./InspectorContext");
|
|
9
42
|
const styles_1 = __importDefault(require("../../styles"));
|
|
@@ -15,11 +48,64 @@ const reduxLogger_1 = require("../../customHooks/reduxLogger");
|
|
|
15
48
|
const analyticsLogger_1 = require("../../customHooks/analyticsLogger");
|
|
16
49
|
const helpers_1 = require("../../helpers");
|
|
17
50
|
const TabBar = react_1.default.memo(() => {
|
|
18
|
-
const { activeTab, switchActiveTab, tabVisibility, logs, consoleLogs, analyticsEvents, crashRecords, lastReadApisCount, lastReadLogsCount, lastReadCrashesCount,
|
|
51
|
+
const { activeTab, switchActiveTab, tabVisibility, logs, consoleLogs, analyticsEvents, crashRecords, lastReadApisCount, lastReadLogsCount, lastReadCrashesCount, mediaCount, } = (0, InspectorContext_1.useInspector)();
|
|
19
52
|
const isReduxAvail = (0, reduxLogger_1.isReduxConnected)();
|
|
20
53
|
const isAnalyticsAvail = (0, analyticsLogger_1.isAnalyticsConnected)();
|
|
21
|
-
|
|
22
|
-
|
|
54
|
+
const isMediaActive = activeTab === 'media';
|
|
55
|
+
const showMediaTab = (tabVisibility?.media ?? true) && mediaCount > 0;
|
|
56
|
+
const scrollViewRef = (0, react_1.useRef)(null);
|
|
57
|
+
const [canScrollLeft, setCanScrollLeft] = (0, react_1.useState)(false);
|
|
58
|
+
const [canScrollRight, setCanScrollRight] = (0, react_1.useState)(true);
|
|
59
|
+
const scrollOffsetRef = (0, react_1.useRef)(0);
|
|
60
|
+
const handleScroll = (event) => {
|
|
61
|
+
const { contentOffset, layoutMeasurement, contentSize } = event.nativeEvent;
|
|
62
|
+
const x = contentOffset.x;
|
|
63
|
+
scrollOffsetRef.current = x;
|
|
64
|
+
const hasLeft = x > 8;
|
|
65
|
+
const hasRight = x < contentSize.width - layoutMeasurement.width - 8;
|
|
66
|
+
if (canScrollLeft !== hasLeft)
|
|
67
|
+
setCanScrollLeft(hasLeft);
|
|
68
|
+
if (canScrollRight !== hasRight)
|
|
69
|
+
setCanScrollRight(hasRight);
|
|
70
|
+
};
|
|
71
|
+
const scrollTabs = (offset) => {
|
|
72
|
+
scrollViewRef.current?.scrollTo({
|
|
73
|
+
x: Math.max(0, scrollOffsetRef.current + offset),
|
|
74
|
+
animated: true,
|
|
75
|
+
});
|
|
76
|
+
};
|
|
77
|
+
return (<react_native_1.View style={[
|
|
78
|
+
styles_1.default.tabBarContainer,
|
|
79
|
+
{
|
|
80
|
+
flexDirection: 'row',
|
|
81
|
+
alignItems: 'center',
|
|
82
|
+
paddingHorizontal: 0,
|
|
83
|
+
},
|
|
84
|
+
]}>
|
|
85
|
+
|
|
86
|
+
{canScrollLeft && (<react_native_1.TouchableOpacity onPress={() => scrollTabs(-160)} hitSlop={{ top: 6, bottom: 6, left: 6, right: 6 }} activeOpacity={0.7} style={{
|
|
87
|
+
paddingLeft: 6,
|
|
88
|
+
paddingRight: 2,
|
|
89
|
+
justifyContent: 'center',
|
|
90
|
+
alignItems: 'center',
|
|
91
|
+
}}>
|
|
92
|
+
<react_native_1.View style={{
|
|
93
|
+
width: 22,
|
|
94
|
+
height: 22,
|
|
95
|
+
borderRadius: 11,
|
|
96
|
+
backgroundColor: '#E5E7EB',
|
|
97
|
+
alignItems: 'center',
|
|
98
|
+
justifyContent: 'center',
|
|
99
|
+
}}>
|
|
100
|
+
<NetworkIcons_1.ChevronIcon direction="left" size={13} color={AppColors_1.AppColors.purple}/>
|
|
101
|
+
</react_native_1.View>
|
|
102
|
+
</react_native_1.TouchableOpacity>)}
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
<react_native_1.ScrollView ref={scrollViewRef} horizontal showsHorizontalScrollIndicator={false} onScroll={handleScroll} scrollEventThrottle={16} style={{ flex: 1 }} contentContainerStyle={{
|
|
106
|
+
paddingLeft: canScrollLeft ? 4 : 12,
|
|
107
|
+
paddingRight: showMediaTab ? 6 : 12,
|
|
108
|
+
}}>
|
|
23
109
|
{[
|
|
24
110
|
{
|
|
25
111
|
id: 1,
|
|
@@ -183,6 +269,82 @@ const TabBar = react_1.default.memo(() => {
|
|
|
183
269
|
</TouchableScale_1.default>);
|
|
184
270
|
})}
|
|
185
271
|
</react_native_1.ScrollView>
|
|
272
|
+
|
|
273
|
+
|
|
274
|
+
{canScrollRight && (<react_native_1.TouchableOpacity onPress={() => scrollTabs(160)} hitSlop={{ top: 6, bottom: 6, left: 6, right: 6 }} activeOpacity={0.7} style={{
|
|
275
|
+
paddingLeft: 2,
|
|
276
|
+
paddingRight: showMediaTab ? 4 : 8,
|
|
277
|
+
justifyContent: 'center',
|
|
278
|
+
alignItems: 'center',
|
|
279
|
+
}}>
|
|
280
|
+
<react_native_1.View style={{
|
|
281
|
+
width: 22,
|
|
282
|
+
height: 22,
|
|
283
|
+
borderRadius: 11,
|
|
284
|
+
backgroundColor: '#E5E7EB',
|
|
285
|
+
alignItems: 'center',
|
|
286
|
+
justifyContent: 'center',
|
|
287
|
+
}}>
|
|
288
|
+
<NetworkIcons_1.ChevronIcon direction="right" size={13} color={AppColors_1.AppColors.purple}/>
|
|
289
|
+
</react_native_1.View>
|
|
290
|
+
</react_native_1.TouchableOpacity>)}
|
|
291
|
+
|
|
292
|
+
|
|
293
|
+
{showMediaTab && (<react_native_1.View style={{
|
|
294
|
+
paddingLeft: 6,
|
|
295
|
+
paddingRight: 10,
|
|
296
|
+
borderLeftWidth: 1,
|
|
297
|
+
borderLeftColor: '#E5E7EB',
|
|
298
|
+
backgroundColor: '#ffffff',
|
|
299
|
+
justifyContent: 'center',
|
|
300
|
+
shadowColor: '#000000',
|
|
301
|
+
shadowOffset: { width: -3, height: 0 },
|
|
302
|
+
shadowOpacity: 0.12,
|
|
303
|
+
shadowRadius: 4,
|
|
304
|
+
elevation: 4,
|
|
305
|
+
zIndex: 10,
|
|
306
|
+
}}>
|
|
307
|
+
<TouchableScale_1.default key="media" onPress={() => {
|
|
308
|
+
switchActiveTab('media');
|
|
309
|
+
}} accessibilityRole="button" accessibilityLabel="Media Gallery" style={[
|
|
310
|
+
styles_1.default.contentTabButton,
|
|
311
|
+
{
|
|
312
|
+
marginRight: 0,
|
|
313
|
+
borderRadius: 8,
|
|
314
|
+
backgroundColor: isMediaActive ? AppColors_1.AppColors.purple : '#eeeeee',
|
|
315
|
+
borderColor: isMediaActive ? AppColors_1.AppColors.purple : '#E5E7EB',
|
|
316
|
+
borderWidth: 1,
|
|
317
|
+
paddingHorizontal: 10,
|
|
318
|
+
paddingVertical: 7,
|
|
319
|
+
alignItems: 'center',
|
|
320
|
+
justifyContent: 'center',
|
|
321
|
+
},
|
|
322
|
+
isMediaActive && styles_1.default.contentTabButtonActive,
|
|
323
|
+
]}>
|
|
324
|
+
<react_native_1.View style={{
|
|
325
|
+
position: 'relative',
|
|
326
|
+
alignItems: 'center',
|
|
327
|
+
justifyContent: 'center',
|
|
328
|
+
}}>
|
|
329
|
+
<NetworkIcons_1.ScreencastIcon color={isMediaActive ? AppColors_1.AppColors.white : AppColors_1.AppColors.grayText} size={15}/>
|
|
330
|
+
{mediaCount > 0 && (<react_native_1.View style={{
|
|
331
|
+
position: 'absolute',
|
|
332
|
+
top: -3,
|
|
333
|
+
right: -4,
|
|
334
|
+
width: 7,
|
|
335
|
+
height: 7,
|
|
336
|
+
borderRadius: 3.5,
|
|
337
|
+
backgroundColor: isMediaActive
|
|
338
|
+
? AppColors_1.AppColors.emerald400
|
|
339
|
+
: AppColors_1.AppColors.purple,
|
|
340
|
+
borderWidth: 1.2,
|
|
341
|
+
borderColor: isMediaActive
|
|
342
|
+
? AppColors_1.AppColors.purple
|
|
343
|
+
: AppColors_1.AppColors.white,
|
|
344
|
+
}}/>)}
|
|
345
|
+
</react_native_1.View>
|
|
346
|
+
</TouchableScale_1.default>
|
|
347
|
+
</react_native_1.View>)}
|
|
186
348
|
</react_native_1.View>);
|
|
187
349
|
});
|
|
188
350
|
exports.default = TabBar;
|
|
@@ -179,7 +179,7 @@ const JsonViewer = react_1.default.memo(({ data, search, forceOpen, defaultExpan
|
|
|
179
179
|
return (<react_native_1.View style={[localStyles.container, fullHeight && { flex: 1 }]}>
|
|
180
180
|
|
|
181
181
|
{!hideTabs && (<react_native_1.View style={localStyles.toolbar}>
|
|
182
|
-
<SegmentedTabs_1.default tabs={[
|
|
182
|
+
<SegmentedTabs_1.default style={{ flex: 1, minWidth: 0, marginRight: 8 }} tabs={[
|
|
183
183
|
{
|
|
184
184
|
key: 'pretty',
|
|
185
185
|
label: t('network.jsonViewer.pretty'),
|
|
@@ -296,8 +296,9 @@ const localStyles = react_native_1.StyleSheet.create({
|
|
|
296
296
|
backgroundColor: AppColors_1.AppColors.slate50,
|
|
297
297
|
borderBottomWidth: 1,
|
|
298
298
|
borderBottomColor: AppColors_1.AppColors.slate200,
|
|
299
|
-
paddingHorizontal:
|
|
300
|
-
paddingVertical:
|
|
299
|
+
paddingHorizontal: 8,
|
|
300
|
+
paddingVertical: 6,
|
|
301
|
+
gap: 8,
|
|
301
302
|
},
|
|
302
303
|
contentWrapper: {
|
|
303
304
|
backgroundColor: AppColors_1.AppColors.white,
|
|
@@ -151,3 +151,7 @@ export declare const PlayIcon: ({ color, size, }: IconProps) => React.JSX.Elemen
|
|
|
151
151
|
export declare const PauseIcon: ({ color, size, }: IconProps) => React.JSX.Element;
|
|
152
152
|
export declare const ImageIcon: ({ color, size, }: IconProps) => React.JSX.Element;
|
|
153
153
|
export declare const FilmIcon: ({ color, size, }: IconProps) => React.JSX.Element;
|
|
154
|
+
export declare const ScreencastIcon: ({ color, size, }: IconProps) => React.JSX.Element;
|
|
155
|
+
export declare const ListIcon: ({ color, size }: IconProps) => React.JSX.Element;
|
|
156
|
+
export declare const GridIcon: ({ color, size }: IconProps) => React.JSX.Element;
|
|
157
|
+
export declare const MinimizeWindowIcon: ({ color, size }: IconProps) => React.JSX.Element;
|
|
@@ -38,7 +38,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
39
|
exports.InfoCircleIcon = exports.UserIcon = exports.LayersIcon = exports.WipeIcon = exports.FolderIcon = exports.SettingsIcon = exports.EyeIcon = exports.JsIcon = exports.CssIcon = exports.HtmlIcon = exports.BrandSquareIcon = exports.BrandCircleIcon = exports.MoonIcon = exports.SunIcon = exports.DebugIcon = exports.InsightsIcon = exports.AnalyticsIcon = exports.WhiteBackNavigation = exports.CloseWhite = exports.DownloadIcon = exports.FilterIcon = exports.ChevronIcon = exports.SortArrowIcon = exports.GlobeIcon = exports.DiffIcon = exports.SignalIcon = exports.ExportIcon = exports.HeaderPauseIcon = exports.TrashIcon = exports.FailIcon = exports.CircleAlertIcon = exports.CircleXIcon = exports.CircleCheckIcon = exports.CheckIcon = exports.TerminalIcon = exports.FetchIcon = exports.CopyIcon = exports.HeadersIcon = exports.ResponseIcon = exports.RequestIcon = exports.SizeIcon = exports.StatusIcon = exports.CalendarIcon = exports.ClockIcon = exports.ClearIcon = exports.SearchIcon = exports.ExpandCollapseIcon = exports.ScreenIcon = exports.MapPinIcon = exports.EmptyRadarIcon = void 0;
|
|
40
40
|
exports.StackTraceIcon = exports.LayoutIcon = exports.ChipIcon = exports.SkullIcon = exports.ShieldAlertIcon = exports.CrashIcon = exports.UserCheckIcon = exports.TargetGoalIcon = exports.RepeatIcon = exports.PinIcon = exports.HourglassIcon = exports.FlameIcon = exports.CodeBracketsIcon = exports.AndroidIcon = exports.AppleIcon = exports.LinkChainIcon = exports.GitHubIcon = exports.StarIcon = exports.PackageBoxIcon = exports.ExternalLinkIcon = exports.MoneyIcon = exports.CartIcon = exports.TextAaIcon = exports.BrainIcon = exports.AtomIcon = exports.MapIcon = exports.SparkleIcon = exports.LightbulbIcon = exports.DocIcon = exports.FolderOpenIcon = exports.BanIcon = exports.BoltIcon = exports.PerformanceIcon = exports.ReduxIcon = exports.MetadataIcon = exports.StorageIcon = exports.RefreshCcwIcon = exports.TimelineIcon = exports.LiveStateIcon = exports.BundleIcon = exports.ForwardChevronIcon = exports.PackageIcon = exports.TableIcon = exports.RawIcon = exports.PrettyIcon = exports.SortIcon = exports.MotionIcon = exports.TrendingUpIcon = exports.ErrorCircleIcon = exports.WarningTriangleIcon = void 0;
|
|
41
|
-
exports.FilmIcon = exports.ImageIcon = exports.PauseIcon = exports.PlayIcon = exports.GifIcon = exports.MicrophoneIcon = exports.VideoCameraIcon = exports.CameraIcon = exports.LifeBuoyIcon = exports.SendIcon = exports.HelpCircleIcon = exports.HeadphonesIcon = exports.TurtleIcon = exports.RocketIcon = exports.UnlockIcon = exports.QrCodeIcon = exports.LockIcon = exports.PlusIcon = exports.PencilIcon = exports.DatabaseIcon = exports.ShieldCheckIcon = exports.WifiIcon = exports.CpuIcon = exports.ChevronDownIcon = exports.ResetIcon = exports.NpmIcon = exports.TagIcon = exports.BugIcon = exports.AlertTriangleIcon = exports.SmartphoneIcon = exports.KeyIcon = exports.BarChartIcon = exports.DiceIcon = exports.ZapIcon = exports.FlaskIcon = exports.LoadingSpinnerIcon = exports.ListenerIcon = exports.AllFramesIcon = exports.AppFramesIcon = exports.RawJsonIcon = exports.TrailIcon = exports.DiagnosticsIcon = void 0;
|
|
41
|
+
exports.MinimizeWindowIcon = exports.GridIcon = exports.ListIcon = exports.ScreencastIcon = exports.FilmIcon = exports.ImageIcon = exports.PauseIcon = exports.PlayIcon = exports.GifIcon = exports.MicrophoneIcon = exports.VideoCameraIcon = exports.CameraIcon = exports.LifeBuoyIcon = exports.SendIcon = exports.HelpCircleIcon = exports.HeadphonesIcon = exports.TurtleIcon = exports.RocketIcon = exports.UnlockIcon = exports.QrCodeIcon = exports.LockIcon = exports.PlusIcon = exports.PencilIcon = exports.DatabaseIcon = exports.ShieldCheckIcon = exports.WifiIcon = exports.CpuIcon = exports.ChevronDownIcon = exports.ResetIcon = exports.NpmIcon = exports.TagIcon = exports.BugIcon = exports.AlertTriangleIcon = exports.SmartphoneIcon = exports.KeyIcon = exports.BarChartIcon = exports.DiceIcon = exports.ZapIcon = exports.FlaskIcon = exports.LoadingSpinnerIcon = exports.ListenerIcon = exports.AllFramesIcon = exports.AppFramesIcon = exports.RawJsonIcon = exports.TrailIcon = exports.DiagnosticsIcon = void 0;
|
|
42
42
|
const react_1 = __importDefault(require("react"));
|
|
43
43
|
const react_native_svg_1 = __importStar(require("react-native-svg"));
|
|
44
44
|
const AppColors_1 = require("../styles/AppColors");
|
|
@@ -1010,3 +1010,28 @@ const FilmIcon = ({ color = AppColors_1.AppColors.white, size = 18, }) => (<reac
|
|
|
1010
1010
|
<react_native_svg_1.Line x1="17" y1="7" x2="22" y2="7" stroke={color} strokeWidth="2"/>
|
|
1011
1011
|
</react_native_svg_1.default>);
|
|
1012
1012
|
exports.FilmIcon = FilmIcon;
|
|
1013
|
+
const ScreencastIcon = ({ color = AppColors_1.AppColors.white, size = 18, }) => (<react_native_svg_1.default width={size} height={size} viewBox="0 0 24 24" fill="none">
|
|
1014
|
+
<react_native_svg_1.Path d="M2 16.1A5 5 0 0 1 5.9 20M2 12.05A9 9 0 0 1 9.95 20M2 20h.01" stroke={color} strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
|
|
1015
|
+
<react_native_svg_1.Path d="M2 8V6a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2h-6" stroke={color} strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
|
|
1016
|
+
</react_native_svg_1.default>);
|
|
1017
|
+
exports.ScreencastIcon = ScreencastIcon;
|
|
1018
|
+
const ListIcon = ({ color = AppColors_1.AppColors.white, size = 14 }) => (<react_native_svg_1.default width={size} height={size} viewBox="0 0 24 24" fill="none">
|
|
1019
|
+
<react_native_svg_1.Line x1="8" y1="6" x2="21" y2="6" stroke={color} strokeWidth="2" strokeLinecap="round"/>
|
|
1020
|
+
<react_native_svg_1.Line x1="8" y1="12" x2="21" y2="12" stroke={color} strokeWidth="2" strokeLinecap="round"/>
|
|
1021
|
+
<react_native_svg_1.Line x1="8" y1="18" x2="21" y2="18" stroke={color} strokeWidth="2" strokeLinecap="round"/>
|
|
1022
|
+
<react_native_svg_1.Circle cx="4" cy="6" r="1.5" fill={color}/>
|
|
1023
|
+
<react_native_svg_1.Circle cx="4" cy="12" r="1.5" fill={color}/>
|
|
1024
|
+
<react_native_svg_1.Circle cx="4" cy="18" r="1.5" fill={color}/>
|
|
1025
|
+
</react_native_svg_1.default>);
|
|
1026
|
+
exports.ListIcon = ListIcon;
|
|
1027
|
+
const GridIcon = ({ color = AppColors_1.AppColors.white, size = 14 }) => (<react_native_svg_1.default width={size} height={size} viewBox="0 0 24 24" fill="none">
|
|
1028
|
+
<react_native_svg_1.Rect x="3" y="3" width="7" height="7" rx="1.5" stroke={color} strokeWidth="2"/>
|
|
1029
|
+
<react_native_svg_1.Rect x="14" y="3" width="7" height="7" rx="1.5" stroke={color} strokeWidth="2"/>
|
|
1030
|
+
<react_native_svg_1.Rect x="14" y="14" width="7" height="7" rx="1.5" stroke={color} strokeWidth="2"/>
|
|
1031
|
+
<react_native_svg_1.Rect x="3" y="14" width="7" height="7" rx="1.5" stroke={color} strokeWidth="2"/>
|
|
1032
|
+
</react_native_svg_1.default>);
|
|
1033
|
+
exports.GridIcon = GridIcon;
|
|
1034
|
+
const MinimizeWindowIcon = ({ color = AppColors_1.AppColors.white, size = 14 }) => (<react_native_svg_1.default width={size} height={size} viewBox="0 0 24 24" fill="none">
|
|
1035
|
+
<react_native_svg_1.Path d="M4 14h6v6M20 10h-6V4M14 10l7-7M10 14l-7 7" stroke={color} strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
|
|
1036
|
+
</react_native_svg_1.default>);
|
|
1037
|
+
exports.MinimizeWindowIcon = MinimizeWindowIcon;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const LIB_VERSION = "2.3.
|
|
1
|
+
export declare const LIB_VERSION = "2.3.19";
|
|
@@ -16,6 +16,8 @@
|
|
|
16
16
|
"viewOnNpm": "View on NPM",
|
|
17
17
|
"later": "Later",
|
|
18
18
|
"source": "SOURCE",
|
|
19
|
+
"minimize": "Minimize",
|
|
20
|
+
"tapToExpand": "Tap to expand",
|
|
19
21
|
"open": "Open",
|
|
20
22
|
"openInBrowser": "Open in Browser",
|
|
21
23
|
"openInBrowserPrompt": "Are you sure you want to open this URL in your external browser?"
|
|
@@ -54,7 +56,7 @@
|
|
|
54
56
|
"crash": "Crash",
|
|
55
57
|
"device": "Device",
|
|
56
58
|
"storage": "Storage",
|
|
57
|
-
"media": "
|
|
59
|
+
"media": "Screencast"
|
|
58
60
|
},
|
|
59
61
|
"settings": {
|
|
60
62
|
"mainTitle": "Settings & Modules",
|
|
@@ -1109,14 +1111,30 @@
|
|
|
1109
1111
|
"allPurged": "All captured media purged",
|
|
1110
1112
|
"converting": "Converting...",
|
|
1111
1113
|
"convertToGif": "Convert to GIF",
|
|
1114
|
+
"playVideo": "Play Video",
|
|
1115
|
+
"playError": "Unable to play video",
|
|
1112
1116
|
"convertedSuccess": "Converted to Animated GIF successfully!",
|
|
1113
1117
|
"convertFailed": "Failed to convert to GIF",
|
|
1114
1118
|
"share": "Share",
|
|
1115
1119
|
"copyUri": "Copy URI",
|
|
1116
1120
|
"uriCopied": "File URI copied to clipboard",
|
|
1117
1121
|
"delete": "Delete",
|
|
1122
|
+
"deleteSelected": "Delete ({{count}})",
|
|
1123
|
+
"deleteSelectedTitle": "Delete Selected",
|
|
1124
|
+
"deleteSelectedMessage": "Are you sure you want to delete {{count}} selected media items?",
|
|
1125
|
+
"deletedCount": "Deleted {{count}} media items",
|
|
1118
1126
|
"deleteTitle": "Delete Media",
|
|
1119
1127
|
"deleteMessage": "Are you sure you want to delete {{filename}}?",
|
|
1120
|
-
"shareUnavailable": "Sharing not available on this device"
|
|
1128
|
+
"shareUnavailable": "Sharing not available on this device",
|
|
1129
|
+
"showingResults": "Showing {{count}} results",
|
|
1130
|
+
"showingFilteredResults": "Showing {{count}} of {{total}} results",
|
|
1131
|
+
"selectedOfResults": "Selected {{selected}} of {{total}} results",
|
|
1132
|
+
"minimize": "Minimize",
|
|
1133
|
+
"expand": "Expand Fullscreen",
|
|
1134
|
+
"collapse": "Exit Fullscreen",
|
|
1135
|
+
"speed": "Speed",
|
|
1136
|
+
"loop": "Loop",
|
|
1137
|
+
"pause": "Pause",
|
|
1138
|
+
"play": "Play"
|
|
1121
1139
|
}
|
|
1122
1140
|
}
|
package/dist/commonjs/index.js
CHANGED
|
@@ -60,6 +60,7 @@ const performanceTracker_1 = require("./customHooks/performanceTracker");
|
|
|
60
60
|
const bundleAnalyzer_1 = require("./customHooks/bundleAnalyzer");
|
|
61
61
|
const NativeInspector_2 = require("./native/NativeInspector");
|
|
62
62
|
const remoteConfig_1 = require("./helpers/remoteConfig");
|
|
63
|
+
const capture_1 = require("./capture");
|
|
63
64
|
const constants_1 = require("./constants");
|
|
64
65
|
const styles_1 = require("./styles");
|
|
65
66
|
const NetworkInspector = ({ enabled = true, storage, navigationRef, appIcon, environment, initialVisible = false, visible: controlledVisible, remoteConfig, }) => {
|
|
@@ -71,6 +72,11 @@ const NetworkInspector = ({ enabled = true, storage, navigationRef, appIcon, env
|
|
|
71
72
|
const [modalAnimationType, setModalAnimationType] = (0, react_1.useState)('slide');
|
|
72
73
|
const [logs, setLogs] = (0, react_1.useState)([]);
|
|
73
74
|
const [visible, setVisible] = (0, react_1.useState)(controlledVisible ?? initialVisible ?? false);
|
|
75
|
+
const [isMinimized, setIsMinimized] = (0, react_1.useState)(false);
|
|
76
|
+
const minimizeInspector = (0, react_1.useCallback)(() => {
|
|
77
|
+
setIsMinimized(true);
|
|
78
|
+
setVisible(false);
|
|
79
|
+
}, []);
|
|
74
80
|
(0, react_1.useEffect)(() => {
|
|
75
81
|
if (controlledVisible !== undefined) {
|
|
76
82
|
setVisible(controlledVisible);
|
|
@@ -132,6 +138,24 @@ const NetworkInspector = ({ enabled = true, storage, navigationRef, appIcon, env
|
|
|
132
138
|
const [lastReadLogsCount, setLastReadLogsCount] = (0, react_1.useState)(0);
|
|
133
139
|
const [lastReadApisCount, setLastReadApisCount] = (0, react_1.useState)(0);
|
|
134
140
|
const [lastReadCrashesCount, setLastReadCrashesCount] = (0, react_1.useState)(0);
|
|
141
|
+
const [mediaCount, setMediaCount] = (0, react_1.useState)(0);
|
|
142
|
+
const refreshMediaCount = (0, react_1.useCallback)(async () => {
|
|
143
|
+
try {
|
|
144
|
+
const items = await capture_1.ScreenCapture.getMediaList();
|
|
145
|
+
const count = items ? items.length : 0;
|
|
146
|
+
setMediaCount(count);
|
|
147
|
+
return count;
|
|
148
|
+
}
|
|
149
|
+
catch {
|
|
150
|
+
setMediaCount(0);
|
|
151
|
+
return 0;
|
|
152
|
+
}
|
|
153
|
+
}, []);
|
|
154
|
+
(0, react_1.useEffect)(() => {
|
|
155
|
+
if (visible) {
|
|
156
|
+
refreshMediaCount();
|
|
157
|
+
}
|
|
158
|
+
}, [visible, refreshMediaCount]);
|
|
135
159
|
const [crashRecords, setCrashRecords] = (0, react_1.useState)(() => (0, crashHandler_1.getCrashRecords)());
|
|
136
160
|
const [selectedCrash, setSelectedCrash] = (0, react_1.useState)(null);
|
|
137
161
|
const [maxCrashLogs, setMaxCrashLogs] = (0, react_1.useState)(50);
|
|
@@ -212,6 +236,7 @@ const NetworkInspector = ({ enabled = true, storage, navigationRef, appIcon, env
|
|
|
212
236
|
device: false,
|
|
213
237
|
storage: false,
|
|
214
238
|
debugging: false,
|
|
239
|
+
media: true,
|
|
215
240
|
});
|
|
216
241
|
const [maxNetworkLogs, setMaxNetworkLogs] = (0, react_1.useState)(250);
|
|
217
242
|
const [maxAnalyticsEventsLimit, setMaxAnalyticsEventsLimit] = (0, react_1.useState)(150);
|
|
@@ -266,6 +291,7 @@ const NetworkInspector = ({ enabled = true, storage, navigationRef, appIcon, env
|
|
|
266
291
|
device: false,
|
|
267
292
|
storage: false,
|
|
268
293
|
debugging: false,
|
|
294
|
+
media: true,
|
|
269
295
|
});
|
|
270
296
|
setDefaultTab('apis');
|
|
271
297
|
setIsAutoRamLimitEnabled(true);
|
|
@@ -728,10 +754,11 @@ const NetworkInspector = ({ enabled = true, storage, navigationRef, appIcon, env
|
|
|
728
754
|
const loop = react_native_1.Animated.loop(react_native_1.Animated.sequence([
|
|
729
755
|
react_native_1.Animated.timing(fabShineAnim, {
|
|
730
756
|
toValue: 1,
|
|
731
|
-
duration:
|
|
757
|
+
duration: 3200,
|
|
758
|
+
easing: react_native_1.Easing.inOut(react_native_1.Easing.ease),
|
|
732
759
|
useNativeDriver: false,
|
|
733
760
|
}),
|
|
734
|
-
react_native_1.Animated.delay(
|
|
761
|
+
react_native_1.Animated.delay(3500),
|
|
735
762
|
react_native_1.Animated.timing(fabShineAnim, {
|
|
736
763
|
toValue: 0,
|
|
737
764
|
duration: 0,
|
|
@@ -776,31 +803,10 @@ const NetworkInspector = ({ enabled = true, storage, navigationRef, appIcon, env
|
|
|
776
803
|
const isNativeModule = (0, react_1.useMemo)(() => (0, NativeInspector_2.isNativeModuleAvailable)(), []);
|
|
777
804
|
const useNativeFab = (react_native_1.Platform.OS === 'ios' || react_native_1.Platform.OS === 'android') && isNativeModule;
|
|
778
805
|
(0, react_1.useEffect)(() => {
|
|
779
|
-
if (
|
|
780
|
-
if (useNativeFab) {
|
|
781
|
-
(0, NativeInspector_2.hideNativeFloatingButton)().catch(() => { });
|
|
782
|
-
}
|
|
783
|
-
return;
|
|
784
|
-
}
|
|
785
|
-
if (visible) {
|
|
806
|
+
if (useNativeFab) {
|
|
786
807
|
(0, NativeInspector_2.hideNativeFloatingButton)().catch(() => { });
|
|
787
808
|
}
|
|
788
|
-
|
|
789
|
-
(0, NativeInspector_2.showNativeFloatingButton)().catch(() => { });
|
|
790
|
-
(0, NativeInspector_2.setNativeFloatingButtonBadge)(logs.length > 0 || analyticsEvents.length > 0).catch(() => { });
|
|
791
|
-
}
|
|
792
|
-
return () => {
|
|
793
|
-
if (useNativeFab) {
|
|
794
|
-
(0, NativeInspector_2.hideNativeFloatingButton)().catch(() => { });
|
|
795
|
-
}
|
|
796
|
-
};
|
|
797
|
-
}, [
|
|
798
|
-
useNativeFab,
|
|
799
|
-
enabled,
|
|
800
|
-
visible,
|
|
801
|
-
logs.length,
|
|
802
|
-
analyticsEvents.length,
|
|
803
|
-
]);
|
|
809
|
+
}, [useNativeFab, visible]);
|
|
804
810
|
(0, react_1.useEffect)(() => {
|
|
805
811
|
if (!useNativeFab)
|
|
806
812
|
return;
|
|
@@ -1527,8 +1533,9 @@ const NetworkInspector = ({ enabled = true, storage, navigationRef, appIcon, env
|
|
|
1527
1533
|
analytics: `${searchedLogs.filter(l => l.message.toLowerCase().includes('[analytics error]')).length}/${total}`,
|
|
1528
1534
|
};
|
|
1529
1535
|
}, [visibleConsoleLogs, logSearch]);
|
|
1530
|
-
|
|
1536
|
+
const closeModal = (0, react_1.useCallback)(() => {
|
|
1531
1537
|
setVisible(false);
|
|
1538
|
+
setIsMinimized(false);
|
|
1532
1539
|
setTimeout(() => {
|
|
1533
1540
|
setSelected(null);
|
|
1534
1541
|
setSelectedEvent(null);
|
|
@@ -1537,7 +1544,7 @@ const NetworkInspector = ({ enabled = true, storage, navigationRef, appIcon, env
|
|
|
1537
1544
|
setSelectedReduxAction(null);
|
|
1538
1545
|
setSelectedCrash(null);
|
|
1539
1546
|
}, 300);
|
|
1540
|
-
}
|
|
1547
|
+
}, []);
|
|
1541
1548
|
function handleClearAll() {
|
|
1542
1549
|
(0, networkLogger_1.clearNetworkLogs)();
|
|
1543
1550
|
setLogs([]);
|
|
@@ -1674,6 +1681,9 @@ const NetworkInspector = ({ enabled = true, storage, navigationRef, appIcon, env
|
|
|
1674
1681
|
visible,
|
|
1675
1682
|
setVisible,
|
|
1676
1683
|
closeModal,
|
|
1684
|
+
isMinimized,
|
|
1685
|
+
setIsMinimized,
|
|
1686
|
+
minimizeInspector,
|
|
1677
1687
|
isReady,
|
|
1678
1688
|
enabled,
|
|
1679
1689
|
isEnabled: enabled,
|
|
@@ -1691,6 +1701,8 @@ const NetworkInspector = ({ enabled = true, storage, navigationRef, appIcon, env
|
|
|
1691
1701
|
toggleTabVisibility,
|
|
1692
1702
|
lastReadApisCount,
|
|
1693
1703
|
lastReadLogsCount,
|
|
1704
|
+
mediaCount,
|
|
1705
|
+
refreshMediaCount,
|
|
1694
1706
|
selected,
|
|
1695
1707
|
setSelected,
|
|
1696
1708
|
selectedEvent,
|
|
@@ -1856,6 +1868,8 @@ const NetworkInspector = ({ enabled = true, storage, navigationRef, appIcon, env
|
|
|
1856
1868
|
toggleTabVisibility,
|
|
1857
1869
|
lastReadApisCount,
|
|
1858
1870
|
lastReadLogsCount,
|
|
1871
|
+
mediaCount,
|
|
1872
|
+
refreshMediaCount,
|
|
1859
1873
|
selected,
|
|
1860
1874
|
selectedEvent,
|
|
1861
1875
|
selectedLog,
|
|
@@ -1946,6 +1960,7 @@ const NetworkInspector = ({ enabled = true, storage, navigationRef, appIcon, env
|
|
|
1946
1960
|
deviceFreeRamMb,
|
|
1947
1961
|
reduxAutoRefresh,
|
|
1948
1962
|
reduxExpandDepth,
|
|
1963
|
+
isMinimized,
|
|
1949
1964
|
]);
|
|
1950
1965
|
return (<InspectorContext_1.InspectorContext.Provider value={contextValue}>
|
|
1951
1966
|
<MainScreen_1.default />
|
|
@@ -2148,8 +2163,8 @@ Object.defineProperty(exports, "I18nextProvider", { enumerable: true, get: funct
|
|
|
2148
2163
|
var remoteConfig_2 = require("./helpers/remoteConfig");
|
|
2149
2164
|
Object.defineProperty(exports, "fetchRemoteConfigModuleStatus", { enumerable: true, get: function () { return remoteConfig_2.fetchRemoteConfigModuleStatus; } });
|
|
2150
2165
|
Object.defineProperty(exports, "isFirebaseRemoteConfigAvailable", { enumerable: true, get: function () { return remoteConfig_2.isFirebaseRemoteConfigAvailable; } });
|
|
2151
|
-
var
|
|
2152
|
-
Object.defineProperty(exports, "ScreenCapture", { enumerable: true, get: function () { return
|
|
2153
|
-
Object.defineProperty(exports, "ScreenRecorder", { enumerable: true, get: function () { return
|
|
2166
|
+
var capture_2 = require("./capture");
|
|
2167
|
+
Object.defineProperty(exports, "ScreenCapture", { enumerable: true, get: function () { return capture_2.ScreenCapture; } });
|
|
2168
|
+
Object.defineProperty(exports, "ScreenRecorder", { enumerable: true, get: function () { return capture_2.ScreenRecorder; } });
|
|
2154
2169
|
var version_1 = require("./constants/version");
|
|
2155
2170
|
Object.defineProperty(exports, "LIB_VERSION", { enumerable: true, get: function () { return version_1.LIB_VERSION; } });
|
|
@@ -100,6 +100,7 @@ export interface RecordingOptions {
|
|
|
100
100
|
}
|
|
101
101
|
export interface RecordingResult {
|
|
102
102
|
uri: string;
|
|
103
|
+
thumbnailUri?: string;
|
|
103
104
|
format: 'mp4' | 'gif';
|
|
104
105
|
durationMs: number;
|
|
105
106
|
hasAudio: boolean;
|
|
@@ -118,6 +119,7 @@ export interface CapturedMediaItem {
|
|
|
118
119
|
type: 'image' | 'video' | 'gif';
|
|
119
120
|
format: string;
|
|
120
121
|
uri: string;
|
|
122
|
+
thumbnailUri?: string;
|
|
121
123
|
filename: string;
|
|
122
124
|
sizeBytes: number;
|
|
123
125
|
timestamp: number;
|
|
@@ -130,6 +132,7 @@ export declare const takeNativeScreenshot: (options?: ScreenshotOptions) => Prom
|
|
|
130
132
|
export declare const startNativeVideoRecording: (options?: RecordingOptions) => Promise<boolean>;
|
|
131
133
|
export declare const stopNativeVideoRecording: () => Promise<RecordingResult | null>;
|
|
132
134
|
export declare const isNativeRecordingActive: () => Promise<boolean>;
|
|
135
|
+
export declare const playNativeVideo: (videoUri: string) => Promise<boolean>;
|
|
133
136
|
export declare const convertNativeVideoToGif: (videoUri: string, options?: GifConversionOptions) => Promise<RecordingResult | null>;
|
|
134
137
|
export declare const fetchCapturedMediaList: () => Promise<CapturedMediaItem[]>;
|
|
135
138
|
export declare const deleteCapturedMediaFile: (uri: string) => Promise<boolean>;
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.clearAllCapturedMediaFiles = exports.deleteCapturedMediaFile = exports.fetchCapturedMediaList = exports.convertNativeVideoToGif = exports.isNativeRecordingActive = exports.stopNativeVideoRecording = exports.startNativeVideoRecording = exports.takeNativeScreenshot = exports.fetchNativeCachedPage = exports.pushNativeLogRecord = exports.getNativeSystemMetrics = exports.triggerNativeHaptic = exports.setNativeStorageItem = exports.getNativeStorageItem = exports.subscribeNativeDeviceShake = exports.getNativeFpsMetrics = exports.stopNativeFpsMonitoring = exports.startNativeFpsMonitoring = exports.subscribeNativeFloatingButtonPress = exports.setNativeFloatingButtonBadge = exports.hideNativeFloatingButton = exports.showNativeFloatingButton = exports.subscribeNativeCrashes = exports.enableNativeCrashProtection = exports.getNativeDeviceMetrics = exports.isNativeModuleAvailable = void 0;
|
|
6
|
+
exports.clearAllCapturedMediaFiles = exports.deleteCapturedMediaFile = exports.fetchCapturedMediaList = exports.convertNativeVideoToGif = exports.playNativeVideo = exports.isNativeRecordingActive = exports.stopNativeVideoRecording = exports.startNativeVideoRecording = exports.takeNativeScreenshot = exports.fetchNativeCachedPage = exports.pushNativeLogRecord = exports.getNativeSystemMetrics = exports.triggerNativeHaptic = exports.setNativeStorageItem = exports.getNativeStorageItem = exports.subscribeNativeDeviceShake = exports.getNativeFpsMetrics = exports.stopNativeFpsMonitoring = exports.startNativeFpsMonitoring = exports.subscribeNativeFloatingButtonPress = exports.setNativeFloatingButtonBadge = exports.hideNativeFloatingButton = exports.showNativeFloatingButton = exports.subscribeNativeCrashes = exports.enableNativeCrashProtection = exports.getNativeDeviceMetrics = exports.isNativeModuleAvailable = void 0;
|
|
7
7
|
const react_native_1 = require("react-native");
|
|
8
8
|
const NativeNetworkInspector_1 = __importDefault(require("./NativeNetworkInspector"));
|
|
9
9
|
const NativeModule = NativeNetworkInspector_1.default || react_native_1.NativeModules.NetworkInspectorModule;
|
|
@@ -345,6 +345,19 @@ const isNativeRecordingActive = async () => {
|
|
|
345
345
|
}
|
|
346
346
|
};
|
|
347
347
|
exports.isNativeRecordingActive = isNativeRecordingActive;
|
|
348
|
+
const playNativeVideo = async (videoUri) => {
|
|
349
|
+
if (!NativeModule || !NativeModule.playVideo) {
|
|
350
|
+
return false;
|
|
351
|
+
}
|
|
352
|
+
try {
|
|
353
|
+
const result = await NativeModule.playVideo(videoUri);
|
|
354
|
+
return !!result;
|
|
355
|
+
}
|
|
356
|
+
catch {
|
|
357
|
+
return false;
|
|
358
|
+
}
|
|
359
|
+
};
|
|
360
|
+
exports.playNativeVideo = playNativeVideo;
|
|
348
361
|
const convertNativeVideoToGif = async (videoUri, options) => {
|
|
349
362
|
if (!NativeModule || !NativeModule.convertToGif) {
|
|
350
363
|
return null;
|
|
@@ -20,6 +20,7 @@ export interface Spec extends TurboModule {
|
|
|
20
20
|
stopVideoRecording(): Promise<Object>;
|
|
21
21
|
isRecording(): Promise<boolean>;
|
|
22
22
|
convertToGif(videoUri: string, options: Object): Promise<Object>;
|
|
23
|
+
playVideo(videoUri: string): Promise<boolean>;
|
|
23
24
|
getCapturedMedia(): Promise<string>;
|
|
24
25
|
deleteCapturedMedia(uri: string): Promise<boolean>;
|
|
25
26
|
clearAllCapturedMedia(): Promise<boolean>;
|