react-native-inapp-inspector 2.5.10 → 2.5.12
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/README.ar.md +0 -8
- package/README.de.md +0 -8
- package/README.es.md +0 -8
- package/README.fr.md +0 -8
- package/README.hi.md +0 -8
- package/README.ja.md +0 -8
- package/README.ko.md +0 -8
- package/README.md +54 -26
- package/README.pt-BR.md +0 -8
- package/README.ru.md +0 -8
- package/README.zh-CN.md +0 -8
- package/dist/commonjs/components/ConsoleLogCard.js +32 -26
- package/dist/commonjs/components/ErrorBoundary.js +1 -1
- package/dist/commonjs/components/Inspector/ConsoleTab.js +19 -14
- package/dist/commonjs/components/Inspector/FloatingCaptureWidget.js +4 -4
- package/dist/commonjs/components/Inspector/InspectorHeader.js +73 -65
- package/dist/commonjs/components/Inspector/MainScreen.js +9 -6
- package/dist/commonjs/components/Inspector/MediaGalleryTab.js +187 -90
- package/dist/commonjs/components/Inspector/NetworkDetail.js +11 -8
- package/dist/commonjs/components/Inspector/NetworkTab.js +33 -31
- package/dist/commonjs/components/Inspector/PerformanceTab.d.ts +2 -0
- package/dist/commonjs/components/Inspector/PerformanceTab.js +652 -0
- package/dist/commonjs/components/Inspector/SettingsPanel.js +346 -245
- package/dist/commonjs/components/Inspector/TabBar.js +17 -16
- package/dist/commonjs/components/LogCard.js +11 -8
- package/dist/commonjs/components/ModuleErrorBoundary.js +1 -1
- package/dist/commonjs/components/NetworkIcons.d.ts +9 -0
- package/dist/commonjs/components/NetworkIcons.js +51 -6
- package/dist/commonjs/constants/index.d.ts +1 -0
- package/dist/commonjs/constants/index.js +1 -1
- package/dist/commonjs/constants/version.d.ts +1 -1
- package/dist/commonjs/constants/version.js +1 -1
- package/dist/commonjs/customHooks/crashHandler.d.ts +9 -1
- package/dist/commonjs/customHooks/crashHandler.js +4 -4
- package/dist/commonjs/helpers/index.d.ts +3 -0
- package/dist/commonjs/helpers/index.js +8 -6
- package/dist/commonjs/helpers/performanceSampler.d.ts +88 -0
- package/dist/commonjs/helpers/performanceSampler.js +1 -0
- package/dist/commonjs/helpers/remoteConfig.d.ts +6 -0
- package/dist/commonjs/helpers/remoteConfig.js +1 -1
- package/dist/commonjs/helpers/telemetry.js +1 -1
- package/dist/commonjs/i18n/locales/ar.json +1 -1
- package/dist/commonjs/i18n/locales/bn.json +1 -1
- package/dist/commonjs/i18n/locales/de.json +1 -1
- package/dist/commonjs/i18n/locales/en.json +1 -1
- package/dist/commonjs/i18n/locales/es.json +1 -1
- package/dist/commonjs/i18n/locales/fr.json +1 -1
- package/dist/commonjs/i18n/locales/gu.json +1 -1
- package/dist/commonjs/i18n/locales/hi.json +1 -1
- package/dist/commonjs/i18n/locales/id.json +1 -1
- package/dist/commonjs/i18n/locales/it.json +1 -1
- package/dist/commonjs/i18n/locales/ja.json +1 -1
- package/dist/commonjs/i18n/locales/kn.json +1 -1
- package/dist/commonjs/i18n/locales/ko.json +1 -1
- package/dist/commonjs/i18n/locales/ml.json +1 -1
- package/dist/commonjs/i18n/locales/mr.json +1 -1
- package/dist/commonjs/i18n/locales/nl.json +1 -1
- package/dist/commonjs/i18n/locales/pa.json +1 -1
- package/dist/commonjs/i18n/locales/pl.json +1 -1
- package/dist/commonjs/i18n/locales/pt.json +1 -1
- package/dist/commonjs/i18n/locales/ru.json +1 -1
- package/dist/commonjs/i18n/locales/ta.json +1 -1
- package/dist/commonjs/i18n/locales/te.json +1 -1
- package/dist/commonjs/i18n/locales/tr.json +1 -1
- package/dist/commonjs/i18n/locales/vi.json +1 -1
- package/dist/commonjs/i18n/locales/zh.json +1 -1
- package/dist/commonjs/index.d.ts +4 -2
- package/dist/commonjs/index.js +3 -3
- package/dist/commonjs/styles/index.js +1 -1
- package/dist/commonjs/types/enums.d.ts +1 -0
- package/dist/commonjs/types/enums.js +1 -1
- package/dist/commonjs/types/interfaces.d.ts +28 -0
- package/dist/esm/components/ConsoleLogCard.js +67 -61
- package/dist/esm/components/ErrorBoundary.js +10 -10
- package/dist/esm/components/Inspector/ConsoleTab.js +33 -28
- package/dist/esm/components/Inspector/FloatingCaptureWidget.js +22 -22
- package/dist/esm/components/Inspector/InspectorHeader.js +194 -186
- package/dist/esm/components/Inspector/MainScreen.js +61 -58
- package/dist/esm/components/Inspector/MediaGalleryTab.js +254 -157
- package/dist/esm/components/Inspector/NetworkDetail.js +62 -59
- package/dist/esm/components/Inspector/NetworkTab.js +39 -37
- package/dist/esm/components/Inspector/PerformanceTab.d.ts +2 -0
- package/dist/esm/components/Inspector/PerformanceTab.js +652 -0
- package/dist/esm/components/Inspector/SettingsPanel.js +407 -306
- package/dist/esm/components/Inspector/TabBar.js +4 -3
- package/dist/esm/components/LogCard.js +37 -34
- package/dist/esm/components/ModuleErrorBoundary.js +1 -1
- package/dist/esm/components/NetworkIcons.d.ts +9 -0
- package/dist/esm/components/NetworkIcons.js +48 -3
- package/dist/esm/constants/index.d.ts +1 -0
- package/dist/esm/constants/index.js +1 -1
- package/dist/esm/constants/version.d.ts +1 -1
- package/dist/esm/constants/version.js +1 -1
- package/dist/esm/customHooks/crashHandler.d.ts +9 -1
- package/dist/esm/customHooks/crashHandler.js +6 -6
- package/dist/esm/helpers/index.d.ts +3 -0
- package/dist/esm/helpers/index.js +8 -6
- package/dist/esm/helpers/performanceSampler.d.ts +88 -0
- package/dist/esm/helpers/performanceSampler.js +1 -0
- package/dist/esm/helpers/remoteConfig.d.ts +6 -0
- package/dist/esm/helpers/remoteConfig.js +1 -1
- package/dist/esm/helpers/telemetry.js +1 -1
- package/dist/esm/i18n/locales/ar.json +1 -1
- package/dist/esm/i18n/locales/bn.json +1 -1
- package/dist/esm/i18n/locales/de.json +1 -1
- package/dist/esm/i18n/locales/en.json +1 -1
- package/dist/esm/i18n/locales/es.json +1 -1
- package/dist/esm/i18n/locales/fr.json +1 -1
- package/dist/esm/i18n/locales/gu.json +1 -1
- package/dist/esm/i18n/locales/hi.json +1 -1
- package/dist/esm/i18n/locales/id.json +1 -1
- package/dist/esm/i18n/locales/it.json +1 -1
- package/dist/esm/i18n/locales/ja.json +1 -1
- package/dist/esm/i18n/locales/kn.json +1 -1
- package/dist/esm/i18n/locales/ko.json +1 -1
- package/dist/esm/i18n/locales/ml.json +1 -1
- package/dist/esm/i18n/locales/mr.json +1 -1
- package/dist/esm/i18n/locales/nl.json +1 -1
- package/dist/esm/i18n/locales/pa.json +1 -1
- package/dist/esm/i18n/locales/pl.json +1 -1
- package/dist/esm/i18n/locales/pt.json +1 -1
- package/dist/esm/i18n/locales/ru.json +1 -1
- package/dist/esm/i18n/locales/ta.json +1 -1
- package/dist/esm/i18n/locales/te.json +1 -1
- package/dist/esm/i18n/locales/tr.json +1 -1
- package/dist/esm/i18n/locales/vi.json +1 -1
- package/dist/esm/i18n/locales/zh.json +1 -1
- package/dist/esm/index.d.ts +4 -2
- package/dist/esm/index.js +8 -8
- package/dist/esm/styles/index.js +1 -1
- package/dist/esm/types/enums.d.ts +1 -0
- package/dist/esm/types/enums.js +1 -1
- package/dist/esm/types/interfaces.d.ts +28 -0
- package/package.json +24 -1
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
import{useCallback as
|
|
1
|
+
import{useCallback as te,useEffect as W,useRef as v,useState as j}from"react";import{Animated as n,Dimensions as Be,PanResponder as ze,Platform as N,StyleSheet as re,Text as $,View as S}from"react-native";import Se from"react-native-linear-gradient";import{useInspector as Le}from"./InspectorContext";import X from"../TouchableScale";import{GripVerticalIcon as Ae,ScreenshotCaptureIcon as Ee,ScreenRecordIcon as Oe}from"../NetworkIcons";import{ScreenCapture as T,generateCaptureId as Y}from"../../capture";import{triggerNativeHaptic as F}from"../../native/NativeInspector";import{showToast as x}from"../../helpers/toast";import{AppColors as i}from"../../styles/AppColors";import{AppFonts as ve}from"../../styles/AppFonts";import{useTranslation as Ge}from"../../i18n";import{MediaPreviewModal as We}from"./MediaPreviewModal";export const FloatingCaptureWidget=()=>{const{refreshMediaCount:I,captureFps:H,captureScale:U,captureBitrate:z,captureMaxDurationSeconds:_,captureAudioMode:J,captureWidgetEnabled:xe,activeTab:Ie,settingsPage:Re,peekMode:je,previewMediaItem:L,setPreviewMediaItem:M,isUpdatePopupVisible:Ce}=Le(),{t:s}=Ge(),[V,k]=j(!1),[Te,A]=j(!1),[Me,E]=j(0),R=v(null),P=v(new n.Value(1)).current,B=v(new n.Value(0)).current,a=v(new n.ValueXY({x:0,y:0})).current,C=v({x:0,y:0});W(()=>{const e=a.x.addListener(o=>C.current.x=o.value),t=a.y.addListener(o=>C.current.y=o.value);return()=>{a.x.removeListener(e),a.y.removeListener(t)}},[a]);const D=v(!1),Ve=v(ze.create({onStartShouldSetPanResponder:()=>!0,onStartShouldSetPanResponderCapture:()=>!1,onMoveShouldSetPanResponder:(e,t)=>Math.abs(t.dx)>2||Math.abs(t.dy)>2,onMoveShouldSetPanResponderCapture:(e,t)=>Math.abs(t.dx)>4||Math.abs(t.dy)>4,onPanResponderGrant:()=>{D.current=!0,a.setOffset({x:C.current.x,y:C.current.y}),a.setValue({x:0,y:0})},onPanResponderMove:n.event([null,{dx:a.x,dy:a.y}],{useNativeDriver:!1}),onPanResponderTerminationRequest:()=>!1,onShouldBlockNativeResponder:()=>!0,onPanResponderRelease:()=>{a.flattenOffset(),setTimeout(()=>{D.current=!1},100);const{width:e,height:t}=Be.get("window"),o=e/2-20,Q=-o,Z=20,ee=-(t-140),O=C.current.x,G=C.current.y;if(O<Q||O>o||G<ee||G>Z){const De=Math.min(Math.max(O,Q),o),Fe=Math.min(Math.max(G,ee),Z);n.spring(a,{toValue:{x:De,y:Fe},friction:7,tension:50,useNativeDriver:!1}).start()}},onPanResponderTerminate:()=>{a.flattenOffset(),D.current=!1}})).current;W(()=>{T.isRecording().then(e=>{k(e)}).catch(()=>{})},[]),W(()=>{let e=null;return V?(E(0),R.current=setInterval(()=>{E(t=>t+1)},1e3),e=n.loop(n.sequence([n.timing(P,{toValue:1.15,duration:500,useNativeDriver:!0}),n.timing(P,{toValue:1,duration:500,useNativeDriver:!0})])),e.start()):(R.current&&(clearInterval(R.current),R.current=null),E(0),P.setValue(1)),()=>{R.current&&clearInterval(R.current),e&&e.stop()}},[V,P]);const ke=te(async()=>{if(!D.current)try{F("light"),A(!0),await new Promise(t=>setTimeout(t,60));const e=await T.takeScreenshot({format:"png",quality:.9,hideInspector:!1});if(A(!1),n.sequence([n.timing(B,{toValue:.65,duration:70,useNativeDriver:!0}),n.timing(B,{toValue:0,duration:200,useNativeDriver:!0})]).start(),e){F("success");const t=Y("screenshot",e.format||"png"),o={id:t,type:"image",format:e.format,uri:e.uri,filename:e.uri.split("/").pop()||t,sizeBytes:e.sizeBytes,timestamp:e.timestamp,width:e.width,height:e.height};M(o),I?.().catch(()=>{}),x(s("header.screenshotCaptured","Screenshot captured"))}else x(s("header.screenshotFailed","Failed to capture screenshot"))}catch{A(!1),x(s("header.screenshotError","Error capturing screenshot"))}},[I,B,s]),K=te(async()=>{if(!D.current)try{if(V){F("medium");const e=await T.stopRecording();if(k(!1),e){F("success");const t=Y("video",e.format),o={id:t,type:e.format==="gif"?"gif":"video",format:e.format,uri:e.uri,filename:e.uri.split("/").pop()||t,sizeBytes:e.sizeBytes,timestamp:e.timestamp,durationMs:e.durationMs,width:e.width,height:e.height,hasAudio:e.hasAudio,thumbnailUri:e.thumbnailUri};M(o),I?.().catch(()=>{}),x(s("header.recordingSaved",{duration:(e.durationMs/1e3).toFixed(1),defaultValue:`Recording saved (${(e.durationMs/1e3).toFixed(1)}s)`}))}}else F("medium"),k(!0),await T.startRecording({fps:H,scale:U,audioSource:J,bitrate:z>0?z:void 0,maxDurationSeconds:_})?x(s("header.recordingStarted","Recording started")):(k(!1),x(s("header.recordingStartFailed","Failed to start recording")))}catch{x(s("header.recordingError","Error during screen recording")),k(!1)}},[V,H,U,z,_,J,I,s]),Pe=e=>{const t=Math.floor(e/60),o=e%60;return`${t<10?"0":""}${t}:${o<10?"0":""}${o}`};return!xe||Ie==="media"||Re==="media"||Ce?null:<>
|
|
2
2
|
|
|
3
|
-
<n.View pointerEvents="none"style={[r.flashOverlay,{opacity:
|
|
3
|
+
<n.View pointerEvents="none"style={[r.flashOverlay,{opacity:B}]}/>
|
|
4
4
|
|
|
5
|
-
{!
|
|
5
|
+
{!Te&&!L&&<n.View{...Ve.panHandlers}style={[r.container,{transform:a.getTranslateTransform()}]}>
|
|
6
6
|
|
|
7
|
-
{
|
|
8
|
-
|
|
7
|
+
{V?<S style={r.recordingShadowWrapper}>
|
|
8
|
+
<X onPress={K}style={r.recordingPillWrapper}>
|
|
9
9
|
<Se colors={[i.rose600,i.rose700]}start={{x:0,y:0}}end={{x:1,y:0}}style={r.recordingPill}>
|
|
10
|
-
<n.View style={[r.recordingDot,{transform:[{scale:
|
|
11
|
-
|
|
12
|
-
REC {
|
|
13
|
-
|
|
10
|
+
<n.View style={[r.recordingDot,{transform:[{scale:P}]}]}/>
|
|
11
|
+
<$ style={r.recordingText}>
|
|
12
|
+
REC {Pe(Me)}
|
|
13
|
+
</$>
|
|
14
14
|
<S style={r.stopIconBadge}>
|
|
15
15
|
<S style={r.stopIconSquare}/>
|
|
16
16
|
</S>
|
|
17
17
|
</Se>
|
|
18
|
-
|
|
18
|
+
</X>
|
|
19
19
|
</S>:<S style={r.dockShadowWrapper}>
|
|
20
20
|
<Se colors={[i.navy900,i.navy800,i.navy900]}start={{x:0,y:0}}end={{x:1,y:0}}style={r.dockBar}>
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
<X onPress={ke}style={r.menuItemBtn}accessible={!0}accessibilityLabel="Take Screenshot">
|
|
23
23
|
<S style={[r.menuItemIconCircle,{backgroundColor:`${i.sky400}38`}]}>
|
|
24
|
-
<
|
|
24
|
+
<Ee size={14}color={i.sky400}/>
|
|
25
25
|
</S>
|
|
26
|
-
|
|
26
|
+
<$ style={r.menuItemText}>
|
|
27
27
|
{s("header.screenshot","Screenshot")}
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
</$>
|
|
29
|
+
</X>
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
<S style={r.dockDivider}/>
|
|
33
33
|
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
<X onPress={K}style={r.menuItemBtn}accessible={!0}accessibilityLabel={s("header.recordScreen","Record Screen")}>
|
|
36
36
|
<S style={[r.menuItemIconCircle,{backgroundColor:`${i.rose500}3D`}]}>
|
|
37
37
|
<Oe size={14}color={i.rose400}/>
|
|
38
38
|
</S>
|
|
39
|
-
|
|
39
|
+
<$ style={r.menuItemText}>
|
|
40
40
|
{s("header.record","Record")}
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
</$>
|
|
42
|
+
</X>
|
|
43
43
|
|
|
44
44
|
|
|
45
45
|
<S style={r.dragGripArea}>
|
|
46
|
-
<
|
|
46
|
+
<Ae size={14}color="rgba(255, 255, 255, 0.55)"/>
|
|
47
47
|
</S>
|
|
48
48
|
</Se>
|
|
49
49
|
</S>}
|
|
50
50
|
</n.View>}
|
|
51
51
|
|
|
52
52
|
|
|
53
|
-
<
|
|
54
|
-
</>};const r=
|
|
53
|
+
<We item={L}visible={!!L}onClose={()=>M(null)}onDelete={async e=>{await T.deleteMedia(e.uri),I?.().catch(()=>{}),M(null)}}onConvertToGif={async e=>{const t=await T.convertToGif(e.uri,{fps:12,width:480});if(t){I?.().catch(()=>{});const o=Y("anim","gif");M({id:o,type:"gif",format:"gif",uri:t.uri,filename:t.uri.split("/").pop()||o,sizeBytes:t.sizeBytes,timestamp:t.timestamp,durationMs:t.durationMs})}}}/>
|
|
54
|
+
</>};const r=re.create({flashOverlay:{...re.absoluteFillObject,backgroundColor:i.white,zIndex:999999},container:{position:"absolute",bottom:N.OS==="ios"?22:16,alignSelf:"center",alignItems:"center",justifyContent:"center",zIndex:999999,elevation:999999},dockShadowWrapper:{borderRadius:24,backgroundColor:"#0D1120",...N.select({ios:{shadowColor:i.black,shadowOffset:{width:0,height:6},shadowOpacity:.45,shadowRadius:14},android:{elevation:16}})},dockBar:{flexDirection:"row",alignItems:"center",borderRadius:24,overflow:"hidden"},dragGripArea:{paddingLeft:6,paddingRight:12,paddingVertical:10,alignItems:"center",justifyContent:"center"},dockDivider:{width:1,height:18,backgroundColor:"rgba(255, 255, 255, 0.14)"},menuItemBtn:{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:7,paddingVertical:8.5,paddingHorizontal:12},menuItemIconCircle:{width:24,height:24,borderRadius:12,alignItems:"center",justifyContent:"center"},menuItemText:{fontFamily:ve.interSemiBold,fontSize:12,color:i.white,letterSpacing:.1},recordingShadowWrapper:{borderRadius:22,alignItems:"center",justifyContent:"center",...N.select({ios:{shadowColor:"#E11D48",shadowOffset:{width:0,height:4},shadowOpacity:.5,shadowRadius:12},android:{elevation:14}})},recordingPillWrapper:{borderRadius:22,overflow:"hidden"},recordingPill:{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:8,height:38,paddingHorizontal:14,borderRadius:22,borderWidth:1.5,borderColor:"rgba(255, 255, 255, 0.45)"},recordingDot:{width:8,height:8,borderRadius:4,backgroundColor:"#FFFFFF"},recordingText:{fontFamily:ve.interBold,fontSize:12,color:i.white,letterSpacing:.4},stopIconBadge:{width:18,height:18,borderRadius:9,backgroundColor:"rgba(255, 255, 255, 0.28)",alignItems:"center",justifyContent:"center",marginLeft:3},stopIconSquare:{width:6,height:6,borderRadius:1.5,backgroundColor:i.white}});export default FloatingCaptureWidget;
|