react-native-inapp-inspector 2.5.8 → 2.5.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. package/dist/commonjs/components/BrandCircleIcon.js +8 -3
  2. package/dist/commonjs/components/Inspector/ConsoleExportModal.d.ts +10 -0
  3. package/dist/commonjs/components/Inspector/ConsoleExportModal.js +317 -0
  4. package/dist/commonjs/components/Inspector/ConsoleTab.js +20 -15
  5. package/dist/commonjs/components/Inspector/FabLauncher.js +8 -8
  6. package/dist/commonjs/components/Inspector/FloatingCaptureWidget.js +4 -4
  7. package/dist/commonjs/components/Inspector/InspectorHeader.js +30 -45
  8. package/dist/commonjs/components/Inspector/MainScreen.js +1 -1
  9. package/dist/commonjs/components/Inspector/MediaGalleryTab.js +34 -20
  10. package/dist/commonjs/components/Inspector/MediaPreviewModal.js +49 -44
  11. package/dist/commonjs/components/Inspector/NpmUpdateToast.js +5 -5
  12. package/dist/commonjs/components/Inspector/SkeletonPlaceholder.js +3 -3
  13. package/dist/commonjs/components/SkeletonPlaceholder.js +3 -3
  14. package/dist/commonjs/constants/version.d.ts +1 -1
  15. package/dist/commonjs/constants/version.js +1 -1
  16. package/dist/commonjs/customHooks/networkLogger.d.ts +1 -17
  17. package/dist/commonjs/customHooks/networkLogger.js +1 -1
  18. package/dist/commonjs/helpers/shareFormatter.d.ts +15 -0
  19. package/dist/commonjs/helpers/shareFormatter.js +15 -8
  20. package/dist/commonjs/i18n/locales/ar.json +1 -1
  21. package/dist/commonjs/i18n/locales/bn.json +1 -1
  22. package/dist/commonjs/i18n/locales/de.json +1 -1
  23. package/dist/commonjs/i18n/locales/en.json +1 -1
  24. package/dist/commonjs/i18n/locales/es.json +1 -1
  25. package/dist/commonjs/i18n/locales/fr.json +1 -1
  26. package/dist/commonjs/i18n/locales/gu.json +1 -1
  27. package/dist/commonjs/i18n/locales/hi.json +1 -1
  28. package/dist/commonjs/i18n/locales/id.json +1 -1
  29. package/dist/commonjs/i18n/locales/it.json +1 -1
  30. package/dist/commonjs/i18n/locales/ja.json +1 -1
  31. package/dist/commonjs/i18n/locales/kn.json +1 -1
  32. package/dist/commonjs/i18n/locales/ko.json +1 -1
  33. package/dist/commonjs/i18n/locales/ml.json +1 -1
  34. package/dist/commonjs/i18n/locales/mr.json +1 -1
  35. package/dist/commonjs/i18n/locales/nl.json +1 -1
  36. package/dist/commonjs/i18n/locales/pa.json +1 -1
  37. package/dist/commonjs/i18n/locales/pl.json +1 -1
  38. package/dist/commonjs/i18n/locales/pt.json +1 -1
  39. package/dist/commonjs/i18n/locales/ru.json +1 -1
  40. package/dist/commonjs/i18n/locales/ta.json +1 -1
  41. package/dist/commonjs/i18n/locales/te.json +1 -1
  42. package/dist/commonjs/i18n/locales/tr.json +1 -1
  43. package/dist/commonjs/i18n/locales/vi.json +1 -1
  44. package/dist/commonjs/i18n/locales/zh.json +1 -1
  45. package/dist/commonjs/index.js +1 -1
  46. package/dist/commonjs/styles/index.d.ts +3 -0
  47. package/dist/commonjs/styles/index.js +1 -1
  48. package/dist/commonjs/types/interfaces.d.ts +4 -2
  49. package/dist/esm/components/BrandCircleIcon.js +9 -4
  50. package/dist/esm/components/Inspector/ConsoleExportModal.d.ts +10 -0
  51. package/dist/esm/components/Inspector/ConsoleExportModal.js +317 -0
  52. package/dist/esm/components/Inspector/ConsoleTab.js +38 -33
  53. package/dist/esm/components/Inspector/FabLauncher.js +1 -1
  54. package/dist/esm/components/Inspector/FloatingCaptureWidget.js +9 -9
  55. package/dist/esm/components/Inspector/InspectorHeader.js +75 -90
  56. package/dist/esm/components/Inspector/MainScreen.js +1 -1
  57. package/dist/esm/components/Inspector/MediaGalleryTab.js +88 -74
  58. package/dist/esm/components/Inspector/MediaPreviewModal.js +178 -173
  59. package/dist/esm/components/Inspector/NpmUpdateToast.js +18 -18
  60. package/dist/esm/components/Inspector/SkeletonPlaceholder.js +11 -11
  61. package/dist/esm/components/SkeletonPlaceholder.js +11 -11
  62. package/dist/esm/constants/version.d.ts +1 -1
  63. package/dist/esm/constants/version.js +1 -1
  64. package/dist/esm/customHooks/networkLogger.d.ts +1 -17
  65. package/dist/esm/customHooks/networkLogger.js +1 -1
  66. package/dist/esm/helpers/shareFormatter.d.ts +15 -0
  67. package/dist/esm/helpers/shareFormatter.js +15 -8
  68. package/dist/esm/i18n/locales/ar.json +1 -1
  69. package/dist/esm/i18n/locales/bn.json +1 -1
  70. package/dist/esm/i18n/locales/de.json +1 -1
  71. package/dist/esm/i18n/locales/en.json +1 -1
  72. package/dist/esm/i18n/locales/es.json +1 -1
  73. package/dist/esm/i18n/locales/fr.json +1 -1
  74. package/dist/esm/i18n/locales/gu.json +1 -1
  75. package/dist/esm/i18n/locales/hi.json +1 -1
  76. package/dist/esm/i18n/locales/id.json +1 -1
  77. package/dist/esm/i18n/locales/it.json +1 -1
  78. package/dist/esm/i18n/locales/ja.json +1 -1
  79. package/dist/esm/i18n/locales/kn.json +1 -1
  80. package/dist/esm/i18n/locales/ko.json +1 -1
  81. package/dist/esm/i18n/locales/ml.json +1 -1
  82. package/dist/esm/i18n/locales/mr.json +1 -1
  83. package/dist/esm/i18n/locales/nl.json +1 -1
  84. package/dist/esm/i18n/locales/pa.json +1 -1
  85. package/dist/esm/i18n/locales/pl.json +1 -1
  86. package/dist/esm/i18n/locales/pt.json +1 -1
  87. package/dist/esm/i18n/locales/ru.json +1 -1
  88. package/dist/esm/i18n/locales/ta.json +1 -1
  89. package/dist/esm/i18n/locales/te.json +1 -1
  90. package/dist/esm/i18n/locales/tr.json +1 -1
  91. package/dist/esm/i18n/locales/vi.json +1 -1
  92. package/dist/esm/i18n/locales/zh.json +1 -1
  93. package/dist/esm/index.js +4 -4
  94. package/dist/esm/styles/index.d.ts +3 -0
  95. package/dist/esm/styles/index.js +1 -1
  96. package/dist/esm/types/interfaces.d.ts +4 -2
  97. package/package.json +1 -1
@@ -1,19 +1,19 @@
1
- import{useState as N,useEffect as G,useRef as R}from"react";import{Animated as r,Linking as J,StyleSheet as K,Text as S,TouchableOpacity as P,View as T}from"react-native";import B,{Path as C}from"react-native-svg";import{useInspector as Q}from"./InspectorContext";import{LIB_VERSION as X}from"../../constants";import{NpmIcon as Z}from"../NetworkIcons";import{copyToClipboard as ee}from"../../helpers";import{showToast as te}from"../../helpers/toast";import{AppColors as e}from"../../styles/AppColors";import{AppFonts as oe}from"../../styles/AppFonts";import{useTranslation as ie}from"../../i18n";const Ce=({size:t=13,color:i=e.slate400})=><B width={t}height={t}viewBox="0 0 24 24"fill="none">
1
+ import{useState as N,useEffect as J,useRef as B}from"react";import{Animated as r,Linking as K,StyleSheet as Q,Text as S,TouchableOpacity as _,View as T}from"react-native";import I,{Path as C}from"react-native-svg";import{useInspector as X}from"./InspectorContext";import{LIB_VERSION as Z}from"../../constants";import{NpmIcon as Ce}from"../NetworkIcons";import{copyToClipboard as Ve}from"../../helpers";import{showToast as xe}from"../../helpers/toast";import{AppColors as e}from"../../styles/AppColors";import{AppFonts as Te}from"../../styles/AppFonts";import{useTranslation as Se}from"../../i18n";const Le=({size:t=13,color:i=e.slate400})=><I width={t}height={t}viewBox="0 0 24 24"fill="none">
2
2
  <C d="M18 6L6 18M6 6l12 12"stroke={i}strokeWidth="2.4"strokeLinecap="round"strokeLinejoin="round"/>
3
- </B>,Ve=({size:t=11,color:i=e.slate400})=><B width={t}height={t}viewBox="0 0 24 24"fill="none">
3
+ </I>,Re=({size:t=11,color:i=e.slate400})=><I width={t}height={t}viewBox="0 0 24 24"fill="none">
4
4
  <C d="M8 4v12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2h-8a2 2 0 0 0-2 2z"stroke={i}strokeWidth="2"strokeLinecap="round"strokeLinejoin="round"/>
5
5
  <C d="M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"stroke={i}strokeWidth="2"strokeLinecap="round"strokeLinejoin="round"/>
6
- </B>,Te=({size:t=11,color:i=e.greenColor})=><B width={t}height={t}viewBox="0 0 24 24"fill="none">
6
+ </I>,Be=({size:t=11,color:i=e.greenColor})=><I width={t}height={t}viewBox="0 0 24 24"fill="none">
7
7
  <C d="M20 6L9 17l-5-5"stroke={i}strokeWidth="2.4"strokeLinecap="round"strokeLinejoin="round"/>
8
- </B>,Se=({size:t=11,color:i=e.white})=><B width={t}height={t}viewBox="0 0 24 24"fill="none">
8
+ </I>,Ie=({size:t=11,color:i=e.white})=><I width={t}height={t}viewBox="0 0 24 24"fill="none">
9
9
  <C d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"stroke={i}strokeWidth="2"strokeLinecap="round"strokeLinejoin="round"/>
10
10
  <C d="M15 3h6v6"stroke={i}strokeWidth="2"strokeLinecap="round"strokeLinejoin="round"/>
11
11
  <C d="M10 14L21 3"stroke={i}strokeWidth="2"strokeLinecap="round"strokeLinejoin="round"/>
12
- </B>,H=7e3;export const NpmUpdateToast=()=>{const{t}=ie(),{updateAvailable:i,latestNpmVersion:V,showUpdateToast:O}=Q(),[_,U]=N(!1),[F,j]=N(!1),[W,E]=N(!1),I=R(new r.Value(60)).current,D=R(new r.Value(0)).current,z=R(new r.Value(1)).current,A=R(null);G(()=>(O&&i&&V&&!_&&(j(!0),r.parallel([r.spring(I,{toValue:0,friction:8,tension:40,useNativeDriver:!0}),r.timing(D,{toValue:1,duration:250,useNativeDriver:!0})]).start(),z.setValue(1),r.timing(z,{toValue:0,duration:H,useNativeDriver:!1}).start(),A.current=setTimeout(()=>{M()},H)),()=>{A.current&&clearTimeout(A.current)}),[O,i,V,_]);const M=()=>{r.parallel([r.timing(D,{toValue:0,duration:180,useNativeDriver:!0}),r.timing(I,{toValue:60,duration:180,useNativeDriver:!0})]).start(()=>{j(!1),U(!0)})},$=()=>{ee("npm install react-native-inapp-inspector@latest","Install Command"),E(!0),te(t("about.copiedInstallCommand","Copied npm install command!")),setTimeout(()=>{E(!1)},2e3)},Y=()=>{J.openURL("https://www.npmjs.com/package/react-native-inapp-inspector").catch(()=>{}),M()};if(typeof __DEV__>"u"||!__DEV__||!O||!F||!i||!V)return null;const q=z.interpolate({inputRange:[0,1],outputRange:["0%","100%"]});return<r.View style={[o.container,{opacity:D,transform:[{translateY:I}]}]}>
12
+ </I>,U=7e3;export const NpmUpdateToast=()=>{const{t}=Se(),{updateAvailable:i,latestNpmVersion:V,showUpdateToast:O,setIsUpdatePopupVisible:R}=X(),[j,F]=N(!1),[$,E]=N(!1),[W,H]=N(!1),D=B(new r.Value(60)).current,P=B(new r.Value(0)).current,z=B(new r.Value(1)).current,A=B(null);J(()=>(O&&i&&V&&!j&&(E(!0),R?.(!0),r.parallel([r.spring(D,{toValue:0,friction:8,tension:40,useNativeDriver:!0}),r.timing(P,{toValue:1,duration:250,useNativeDriver:!0})]).start(),z.setValue(1),r.timing(z,{toValue:0,duration:U,useNativeDriver:!1}).start(),A.current=setTimeout(()=>{M()},U)),()=>{A.current&&clearTimeout(A.current),R?.(!1)}),[O,i,V,j,R]);const M=()=>{r.parallel([r.timing(P,{toValue:0,duration:180,useNativeDriver:!0}),r.timing(D,{toValue:60,duration:180,useNativeDriver:!0})]).start(()=>{E(!1),F(!0),R?.(!1)})},Y=()=>{Ve("npm install react-native-inapp-inspector@latest","Install Command"),H(!0),xe(t("about.copiedInstallCommand","Copied npm install command!")),setTimeout(()=>{H(!1)},2e3)},q=()=>{K.openURL("https://www.npmjs.com/package/react-native-inapp-inspector").catch(()=>{}),M()};if(typeof __DEV__>"u"||!__DEV__||!O||!$||!i||!V)return null;const G=z.interpolate({inputRange:[0,1],outputRange:["0%","100%"]});return<r.View style={[o.container,{opacity:P,transform:[{translateY:D}]}]}>
13
13
  <T style={o.contentRow}>
14
14
 
15
15
  <T style={o.npmIconContainer}>
16
- <Z size={15}color={e.npmRed}/>
16
+ <Ce size={15}color={e.npmRed}/>
17
17
  </T>
18
18
 
19
19
  <T style={o.textContainer}>
@@ -24,32 +24,32 @@ import{useState as N,useEffect as G,useRef as R}from"react";import{Animated as r
24
24
  </T>
25
25
  </T>
26
26
  <S style={o.subtitleText}>
27
- {t("header.updateAvailable",{latestVersion:V,currentVersion:X,defaultValue:`react-native-inapp-inspector v${V} is available on NPM.`})}
27
+ {t("header.updateAvailable",{latestVersion:V,currentVersion:Z,defaultValue:`react-native-inapp-inspector v${V} is available on NPM.`})}
28
28
  </S>
29
29
  </T>
30
30
 
31
31
 
32
- <P style={o.copyButton}onPress={$}activeOpacity={.7}hitSlop={{top:8,bottom:8,left:4,right:4}}>
33
- {W?<Te size={11}color={e.greenColor}/>:<Ve size={11}color={e.slate400}/>}
32
+ <_ style={o.copyButton}onPress={Y}activeOpacity={.7}hitSlop={{top:8,bottom:8,left:4,right:4}}>
33
+ {W?<Be size={11}color={e.greenColor}/>:<Re size={11}color={e.slate400}/>}
34
34
  <S style={[o.copyButtonText,W&&{color:e.greenColor}]}>
35
35
  {W?t("common.copied","Copied"):t("header.copyCommand","Copy")}
36
36
  </S>
37
- </P>
37
+ </_>
38
38
 
39
39
 
40
- <P style={o.actionButton}onPress={Y}activeOpacity={.8}hitSlop={{top:8,bottom:8,left:4,right:4}}>
40
+ <_ style={o.actionButton}onPress={q}activeOpacity={.8}hitSlop={{top:8,bottom:8,left:4,right:4}}>
41
41
  <S style={o.actionButtonText}>{t("header.viewNpm","View")}</S>
42
- <Se size={10}color={e.white}/>
43
- </P>
42
+ <Ie size={10}color={e.white}/>
43
+ </_>
44
44
 
45
45
 
46
- <P style={o.closeButton}onPress={M}activeOpacity={.7}hitSlop={{top:10,bottom:10,left:10,right:10}}>
47
- <Ce size={12}color={e.slate400}/>
48
- </P>
46
+ <_ style={o.closeButton}onPress={M}activeOpacity={.7}hitSlop={{top:10,bottom:10,left:10,right:10}}>
47
+ <Le size={12}color={e.slate400}/>
48
+ </_>
49
49
  </T>
50
50
 
51
51
 
52
52
  <T style={o.progressBarTrack}>
53
- <r.View style={[o.progressBarFill,{width:q}]}/>
53
+ <r.View style={[o.progressBarFill,{width:G}]}/>
54
54
  </T>
55
- </r.View>};const L={fontFamily:oe.interRegular},o=K.create({container:{position:"absolute",bottom:24,left:14,right:14,backgroundColor:e.slate900,borderRadius:16,borderWidth:1,borderColor:e.slate700,shadowColor:e.black,shadowOffset:{width:0,height:12},shadowOpacity:.4,shadowRadius:24,elevation:24,overflow:"hidden",zIndex:99999},contentRow:{flexDirection:"row",alignItems:"center",paddingVertical:11,paddingHorizontal:12,gap:8},npmIconContainer:{width:32,height:32,borderRadius:9,backgroundColor:e.white,justifyContent:"center",alignItems:"center",borderWidth:1,borderColor:e.slate200,flexShrink:0,shadowColor:e.black,shadowOffset:{width:0,height:1},shadowOpacity:.15,shadowRadius:2,elevation:2},textContainer:{flex:1,minWidth:0},titleRow:{flexDirection:"row",alignItems:"center",gap:5},titleText:{fontSize:12.5,fontWeight:"700",color:e.slate50,letterSpacing:-.2,...L},versionPill:{backgroundColor:`${e.offerPurple}33`,paddingHorizontal:5.5,paddingVertical:1.5,borderRadius:5,borderWidth:1,borderColor:`${e.violet500}80`},versionPillText:{fontSize:10,fontWeight:"700",color:e.purpleLightMuted,...L},subtitleText:{fontSize:10.5,color:e.slate400,marginTop:1,...L},copyButton:{flexDirection:"row",alignItems:"center",gap:3.5,backgroundColor:e.slate800,paddingVertical:5.5,paddingHorizontal:8,borderRadius:7,borderWidth:1,borderColor:e.slate700,flexShrink:0},copyButtonText:{fontSize:10.5,fontWeight:"600",color:e.slate400,...L},actionButton:{flexDirection:"row",alignItems:"center",gap:3.5,backgroundColor:e.offerPurple,paddingVertical:5.5,paddingHorizontal:9,borderRadius:7,flexShrink:0,shadowColor:e.offerPurple,shadowOffset:{width:0,height:2},shadowOpacity:.35,shadowRadius:4,elevation:3},actionButtonText:{fontSize:11,fontWeight:"700",color:e.white,...L},closeButton:{width:22,height:22,borderRadius:11,backgroundColor:e.slate800,justifyContent:"center",alignItems:"center",flexShrink:0},progressBarTrack:{height:2.5,width:"100%",backgroundColor:e.slate800},progressBarFill:{height:"100%",backgroundColor:e.violet500}});export default NpmUpdateToast;
55
+ </r.View>};const L={fontFamily:Te.interRegular},o=Q.create({container:{position:"absolute",bottom:24,left:14,right:14,backgroundColor:e.slate900,borderRadius:16,borderWidth:1,borderColor:e.slate700,shadowColor:e.black,shadowOffset:{width:0,height:12},shadowOpacity:.4,shadowRadius:24,elevation:24,overflow:"hidden",zIndex:99999},contentRow:{flexDirection:"row",alignItems:"center",paddingVertical:11,paddingHorizontal:12,gap:8},npmIconContainer:{width:32,height:32,borderRadius:9,backgroundColor:e.white,justifyContent:"center",alignItems:"center",borderWidth:1,borderColor:e.slate200,flexShrink:0,shadowColor:e.black,shadowOffset:{width:0,height:1},shadowOpacity:.15,shadowRadius:2,elevation:2},textContainer:{flex:1,minWidth:0},titleRow:{flexDirection:"row",alignItems:"center",gap:5},titleText:{fontSize:12.5,fontWeight:"700",color:e.slate50,letterSpacing:-.2,...L},versionPill:{backgroundColor:`${e.offerPurple}33`,paddingHorizontal:5.5,paddingVertical:1.5,borderRadius:5,borderWidth:1,borderColor:`${e.violet500}80`},versionPillText:{fontSize:10,fontWeight:"700",color:e.purpleLightMuted,...L},subtitleText:{fontSize:10.5,color:e.slate400,marginTop:1,...L},copyButton:{flexDirection:"row",alignItems:"center",gap:3.5,backgroundColor:e.slate800,paddingVertical:5.5,paddingHorizontal:8,borderRadius:7,borderWidth:1,borderColor:e.slate700,flexShrink:0},copyButtonText:{fontSize:10.5,fontWeight:"600",color:e.slate400,...L},actionButton:{flexDirection:"row",alignItems:"center",gap:3.5,backgroundColor:e.offerPurple,paddingVertical:5.5,paddingHorizontal:9,borderRadius:7,flexShrink:0,shadowColor:e.offerPurple,shadowOffset:{width:0,height:2},shadowOpacity:.35,shadowRadius:4,elevation:3},actionButtonText:{fontSize:11,fontWeight:"700",color:e.white,...L},closeButton:{width:22,height:22,borderRadius:11,backgroundColor:e.slate800,justifyContent:"center",alignItems:"center",flexShrink:0},progressBarTrack:{height:2.5,width:"100%",backgroundColor:e.slate800},progressBarFill:{height:"100%",backgroundColor:e.violet500}});export default NpmUpdateToast;
@@ -1,23 +1,23 @@
1
- import B,{useEffect as R,useRef as x}from"react";import{Animated as k,StyleSheet as v,View as S}from"react-native";import{AppColors as w}from"../../styles/AppColors";export const SkeletonPlaceholder=B.memo(function({cardCount:C=4}){const b=x(new k.Value(.35)).current;return R(()=>{const f=k.loop(k.sequence([k.timing(b,{toValue:.85,duration:750,useNativeDriver:!1}),k.timing(b,{toValue:.35,duration:750,useNativeDriver:!1})]));return f.start(),()=>f.stop()},[b]),<S style={e.container}>
1
+ import x,{useEffect as v,useRef as D}from"react";import{Animated as f,StyleSheet as L,View as S}from"react-native";import{AppColors as b}from"../../styles/AppColors";export const SkeletonPlaceholder=x.memo(function({cardCount:B=4}){const C=D(new f.Value(.45)).current;return v(()=>{const V=f.loop(f.sequence([f.timing(C,{toValue:.95,duration:750,useNativeDriver:!1}),f.timing(C,{toValue:.45,duration:750,useNativeDriver:!1})]));return V.start(),()=>V.stop()},[C]),<S style={e.container}>
2
2
 
3
3
  <S style={e.toolbarSkeleton}>
4
- <k.View style={[e.searchBarSkeleton,{opacity:b}]}/>
4
+ <f.View style={[e.searchBarSkeleton,{opacity:C}]}/>
5
5
  <S style={e.actionButtonsRow}>
6
- <k.View style={[e.iconButtonSkeleton,{opacity:b}]}/>
7
- <k.View style={[e.iconButtonSkeleton,{opacity:b}]}/>
6
+ <f.View style={[e.iconButtonSkeleton,{opacity:C}]}/>
7
+ <f.View style={[e.iconButtonSkeleton,{opacity:C}]}/>
8
8
  </S>
9
9
  </S>
10
10
 
11
11
 
12
12
  <S style={e.chipStripSkeleton}>
13
- <k.View style={[e.chipSkeleton,{width:48,opacity:b}]}/>
14
- <k.View style={[e.chipSkeleton,{width:68,opacity:b}]}/>
15
- <k.View style={[e.chipSkeleton,{width:76,opacity:b}]}/>
16
- <k.View style={[e.chipSkeleton,{width:58,opacity:b}]}/>
13
+ <f.View style={[e.chipSkeleton,{width:48,opacity:C}]}/>
14
+ <f.View style={[e.chipSkeleton,{width:68,opacity:C}]}/>
15
+ <f.View style={[e.chipSkeleton,{width:76,opacity:C}]}/>
16
+ <f.View style={[e.chipSkeleton,{width:58,opacity:C}]}/>
17
17
  </S>
18
18
 
19
19
 
20
- {Array.from({length:C}).map((f,V)=><k.View key={`skeleton_card_${V}`}style={[e.cardSkeleton,{opacity:b}]}>
20
+ {Array.from({length:B}).map((V,R)=><f.View key={`skeleton_card_${R}`}style={[e.cardSkeleton,{opacity:C}]}>
21
21
 
22
22
  <S style={e.cardTopRow}>
23
23
  <S style={e.badgeGroup}>
@@ -36,5 +36,5 @@ import B,{useEffect as R,useRef as x}from"react";import{Animated as k,StyleSheet
36
36
  <S style={e.metaPillSkeleton}/>
37
37
  <S style={e.metaPillSkeleton}/>
38
38
  </S>
39
- </k.View>)}
40
- </S>});const e=v.create({container:{flex:1,paddingHorizontal:12,paddingTop:8},toolbarSkeleton:{flexDirection:"row",alignItems:"center",gap:8,marginBottom:8},searchBarSkeleton:{flex:1,height:36,borderRadius:8,backgroundColor:w.graySurface,borderWidth:1,borderColor:w.dividerColor},actionButtonsRow:{flexDirection:"row",gap:6},iconButtonSkeleton:{width:36,height:36,borderRadius:8,backgroundColor:w.graySurface,borderWidth:1,borderColor:w.dividerColor},chipStripSkeleton:{flexDirection:"row",gap:6,marginBottom:10},chipSkeleton:{height:24,borderRadius:6,backgroundColor:w.graySurface,borderWidth:1,borderColor:w.dividerColor},cardSkeleton:{backgroundColor:w.primaryLight,borderRadius:10,padding:12,marginBottom:8,borderWidth:1,borderColor:w.dividerColor},cardTopRow:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",marginBottom:8},badgeGroup:{flexDirection:"row",alignItems:"center",gap:6},statusBadgeSkeleton:{width:38,height:18,borderRadius:4,backgroundColor:w.graySurface},methodBadgeSkeleton:{width:44,height:18,borderRadius:4,backgroundColor:w.graySurface},timeSkeleton:{width:48,height:12,borderRadius:4,backgroundColor:w.graySurface},urlLineLong:{height:13,borderRadius:4,backgroundColor:w.graySurface,marginBottom:5,width:"90%"},urlLineShort:{height:11,borderRadius:4,backgroundColor:w.graySurface,marginBottom:8,width:"55%"},cardBottomRow:{flexDirection:"row",gap:8,marginTop:2},metaPillSkeleton:{width:52,height:14,borderRadius:4,backgroundColor:w.graySurface}});export default SkeletonPlaceholder;
39
+ </f.View>)}
40
+ </S>});const e=L.create({container:{flex:1,paddingHorizontal:12,paddingTop:8},toolbarSkeleton:{flexDirection:"row",alignItems:"center",gap:8,marginBottom:8},searchBarSkeleton:{flex:1,height:36,borderRadius:8,backgroundColor:b.graySurface,borderWidth:1,borderColor:b.dividerColor},actionButtonsRow:{flexDirection:"row",gap:6},iconButtonSkeleton:{width:36,height:36,borderRadius:8,backgroundColor:b.graySurface,borderWidth:1,borderColor:b.dividerColor},chipStripSkeleton:{flexDirection:"row",gap:6,marginBottom:10},chipSkeleton:{height:24,borderRadius:6,backgroundColor:b.graySurface,borderWidth:1,borderColor:b.dividerColor},cardSkeleton:{backgroundColor:b.primaryLight,borderRadius:10,padding:12,marginBottom:8,borderWidth:1,borderColor:b.dividerColor},cardTopRow:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",marginBottom:8},badgeGroup:{flexDirection:"row",alignItems:"center",gap:6},statusBadgeSkeleton:{width:38,height:18,borderRadius:4,backgroundColor:b.slate200},methodBadgeSkeleton:{width:44,height:18,borderRadius:4,backgroundColor:b.slate200},timeSkeleton:{width:48,height:12,borderRadius:4,backgroundColor:b.slate200},urlLineLong:{height:13,borderRadius:4,backgroundColor:b.slate200,marginBottom:5,width:"90%"},urlLineShort:{height:11,borderRadius:4,backgroundColor:b.slate200,marginBottom:8,width:"55%"},cardBottomRow:{flexDirection:"row",gap:8,marginTop:2},metaPillSkeleton:{width:52,height:14,borderRadius:4,backgroundColor:b.slate200}});export default SkeletonPlaceholder;
@@ -1,23 +1,23 @@
1
- import B,{useEffect as R,useRef as x}from"react";import{Animated as k,StyleSheet as v,View as S}from"react-native";import{AppColors as w}from"../styles/AppColors";export const SkeletonPlaceholder=B.memo(function({cardCount:C=4}){const b=x(new k.Value(.35)).current;return R(()=>{const f=k.loop(k.sequence([k.timing(b,{toValue:.85,duration:750,useNativeDriver:!1}),k.timing(b,{toValue:.35,duration:750,useNativeDriver:!1})]));return f.start(),()=>f.stop()},[b]),<S style={e.container}>
1
+ import x,{useEffect as v,useRef as D}from"react";import{Animated as f,StyleSheet as L,View as S}from"react-native";import{AppColors as b}from"../styles/AppColors";export const SkeletonPlaceholder=x.memo(function({cardCount:B=4}){const C=D(new f.Value(.45)).current;return v(()=>{const V=f.loop(f.sequence([f.timing(C,{toValue:.95,duration:750,useNativeDriver:!1}),f.timing(C,{toValue:.45,duration:750,useNativeDriver:!1})]));return V.start(),()=>V.stop()},[C]),<S style={e.container}>
2
2
 
3
3
  <S style={e.toolbarSkeleton}>
4
- <k.View style={[e.searchBarSkeleton,{opacity:b}]}/>
4
+ <f.View style={[e.searchBarSkeleton,{opacity:C}]}/>
5
5
  <S style={e.actionButtonsRow}>
6
- <k.View style={[e.iconButtonSkeleton,{opacity:b}]}/>
7
- <k.View style={[e.iconButtonSkeleton,{opacity:b}]}/>
6
+ <f.View style={[e.iconButtonSkeleton,{opacity:C}]}/>
7
+ <f.View style={[e.iconButtonSkeleton,{opacity:C}]}/>
8
8
  </S>
9
9
  </S>
10
10
 
11
11
 
12
12
  <S style={e.chipStripSkeleton}>
13
- <k.View style={[e.chipSkeleton,{width:48,opacity:b}]}/>
14
- <k.View style={[e.chipSkeleton,{width:68,opacity:b}]}/>
15
- <k.View style={[e.chipSkeleton,{width:76,opacity:b}]}/>
16
- <k.View style={[e.chipSkeleton,{width:58,opacity:b}]}/>
13
+ <f.View style={[e.chipSkeleton,{width:48,opacity:C}]}/>
14
+ <f.View style={[e.chipSkeleton,{width:68,opacity:C}]}/>
15
+ <f.View style={[e.chipSkeleton,{width:76,opacity:C}]}/>
16
+ <f.View style={[e.chipSkeleton,{width:58,opacity:C}]}/>
17
17
  </S>
18
18
 
19
19
 
20
- {Array.from({length:C}).map((f,V)=><k.View key={`skeleton_card_${V}`}style={[e.cardSkeleton,{opacity:b}]}>
20
+ {Array.from({length:B}).map((V,R)=><f.View key={`skeleton_card_${R}`}style={[e.cardSkeleton,{opacity:C}]}>
21
21
 
22
22
  <S style={e.cardTopRow}>
23
23
  <S style={e.badgeGroup}>
@@ -36,5 +36,5 @@ import B,{useEffect as R,useRef as x}from"react";import{Animated as k,StyleSheet
36
36
  <S style={e.metaPillSkeleton}/>
37
37
  <S style={e.metaPillSkeleton}/>
38
38
  </S>
39
- </k.View>)}
40
- </S>});const e=v.create({container:{flex:1,paddingHorizontal:12,paddingTop:8},toolbarSkeleton:{flexDirection:"row",alignItems:"center",gap:8,marginBottom:8},searchBarSkeleton:{flex:1,height:36,borderRadius:8,backgroundColor:w.graySurface,borderWidth:1,borderColor:w.dividerColor},actionButtonsRow:{flexDirection:"row",gap:6},iconButtonSkeleton:{width:36,height:36,borderRadius:8,backgroundColor:w.graySurface,borderWidth:1,borderColor:w.dividerColor},chipStripSkeleton:{flexDirection:"row",gap:6,marginBottom:10},chipSkeleton:{height:24,borderRadius:6,backgroundColor:w.graySurface,borderWidth:1,borderColor:w.dividerColor},cardSkeleton:{backgroundColor:w.primaryLight,borderRadius:10,padding:12,marginBottom:8,borderWidth:1,borderColor:w.dividerColor},cardTopRow:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",marginBottom:8},badgeGroup:{flexDirection:"row",alignItems:"center",gap:6},statusBadgeSkeleton:{width:38,height:18,borderRadius:4,backgroundColor:w.graySurface},methodBadgeSkeleton:{width:44,height:18,borderRadius:4,backgroundColor:w.graySurface},timeSkeleton:{width:48,height:12,borderRadius:4,backgroundColor:w.graySurface},urlLineLong:{height:13,borderRadius:4,backgroundColor:w.graySurface,marginBottom:5,width:"90%"},urlLineShort:{height:11,borderRadius:4,backgroundColor:w.graySurface,marginBottom:8,width:"55%"},cardBottomRow:{flexDirection:"row",gap:8,marginTop:2},metaPillSkeleton:{width:52,height:14,borderRadius:4,backgroundColor:w.graySurface}});export default SkeletonPlaceholder;
39
+ </f.View>)}
40
+ </S>});const e=L.create({container:{flex:1,paddingHorizontal:12,paddingTop:8},toolbarSkeleton:{flexDirection:"row",alignItems:"center",gap:8,marginBottom:8},searchBarSkeleton:{flex:1,height:36,borderRadius:8,backgroundColor:b.graySurface,borderWidth:1,borderColor:b.dividerColor},actionButtonsRow:{flexDirection:"row",gap:6},iconButtonSkeleton:{width:36,height:36,borderRadius:8,backgroundColor:b.graySurface,borderWidth:1,borderColor:b.dividerColor},chipStripSkeleton:{flexDirection:"row",gap:6,marginBottom:10},chipSkeleton:{height:24,borderRadius:6,backgroundColor:b.graySurface,borderWidth:1,borderColor:b.dividerColor},cardSkeleton:{backgroundColor:b.primaryLight,borderRadius:10,padding:12,marginBottom:8,borderWidth:1,borderColor:b.dividerColor},cardTopRow:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",marginBottom:8},badgeGroup:{flexDirection:"row",alignItems:"center",gap:6},statusBadgeSkeleton:{width:38,height:18,borderRadius:4,backgroundColor:b.slate200},methodBadgeSkeleton:{width:44,height:18,borderRadius:4,backgroundColor:b.slate200},timeSkeleton:{width:48,height:12,borderRadius:4,backgroundColor:b.slate200},urlLineLong:{height:13,borderRadius:4,backgroundColor:b.slate200,marginBottom:5,width:"90%"},urlLineShort:{height:11,borderRadius:4,backgroundColor:b.slate200,marginBottom:8,width:"55%"},cardBottomRow:{flexDirection:"row",gap:8,marginTop:2},metaPillSkeleton:{width:52,height:14,borderRadius:4,backgroundColor:b.slate200}});export default SkeletonPlaceholder;
@@ -1 +1 @@
1
- export declare const LIB_VERSION = "2.5.8";
1
+ export declare const LIB_VERSION = "2.5.10";
@@ -1 +1 @@
1
- export const LIB_VERSION="2.5.8";
1
+ export const LIB_VERSION="2.5.10";
@@ -1,19 +1,4 @@
1
- import { RouteInfo } from "../types";
2
- type NetworkLog = {
3
- id: number;
4
- url: string;
5
- method: string;
6
- status?: number;
7
- request?: any;
8
- response?: any;
9
- duration?: number;
10
- startTime: number;
11
- caller?: string;
12
- client?: string;
13
- requestHeaders?: Record<string, string>;
14
- responseHeaders?: Record<string, string>;
15
- routeInfo?: RouteInfo;
16
- };
1
+ import { NetworkLog, RouteInfo } from "../types";
17
2
  export declare const setRouteInfoProvider: (provider: (() => RouteInfo | null) | null) => void;
18
3
  export declare const setNetworkModuleEnabled: (enabled: boolean) => void;
19
4
  export declare const getNetworkModuleEnabled: () => boolean;
@@ -25,4 +10,3 @@ export declare const getMaxNetworkLogsLimit: () => number;
25
10
  export declare const pruneNetworkLogs: (targetCount?: number) => number;
26
11
  export declare const setupNetworkLogger: () => void;
27
12
  export declare const addAxiosInterceptors: (axiosInstance: any) => void;
28
- export {};
@@ -1 +1 @@
1
- import R from"axios";import{setupGlobalCrashHandler as k}from"./crashHandler";let c=[],b=[],w=0,T=!0,f=null;export const setRouteInfoProvider=e=>{f=e},setNetworkModuleEnabled=e=>{T=e},getNetworkModuleEnabled=()=>T;const A=["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS","CONNECT","TRACE"],C=[/\/symbolicate(?:\?|$)/i,/\/index\.bundle(?:\?|$)/i,/\/open-debugger(?:\?|$)/i,/:(?:8081|8082|8083|19000|19001)\/(?:index\.bundle|symbolicate|hot|message|status)/i,/google-analytics\.com\/mp\/collect/i,/analytics\.google\.com/i];function x(e){return e?C.some(t=>t.test(e)):!1}function U(e){if(!e||typeof e!="string")return;const t=e.trim().split(/[\r\n]+/),s={};return t.forEach(n=>{const o=n.indexOf(":");if(o>0){const i=n.substring(0,o).trim().toLowerCase(),r=n.substring(o+1).trim();s[i]=r}}),Object.keys(s).length>0?s:void 0}function m(e){if(!e)return;if(typeof e.forEach=="function"){const n={};return e.forEach((o,i)=>{n[i]=o}),Object.keys(n).length>0?n:void 0}if(Array.isArray(e)){const n={};return e.forEach(([o,i])=>{n[o]=i}),Object.keys(n).length>0?n:void 0}const t=e,s={};return Object.entries(t).forEach(([n,o])=>{o!=null&&(s[n]=String(o))}),Object.keys(s).length>0?s:void 0}function I(e){if(!e)return e;if(e&&e._parts&&Array.isArray(e._parts)){const t={};return e._parts.forEach(s=>{const n=s[0],o=s[1];o&&typeof o=="object"&&o.uri?t[n]={_isFile:!0,name:o.name||"unknown",type:o.type||"unknown",uri:o.uri}:t[n]=o}),{_isFormData:!0,...t}}return e}export const subscribeNetworkLogs=e=>(b.push(e),e([...c]),()=>{b=b.filter(t=>t!==e)}),clearNetworkLogs=()=>{c=[],H()},getNetworkLogs=()=>[...c];let N=1/0;export const setMaxNetworkLogsLimit=e=>{N=e},getMaxNetworkLogsLimit=()=>N,pruneNetworkLogs=e=>{const t=e!==void 0?Math.max(0,e):Math.floor(c.length/2),s=c.length-t;return s>0&&(c=c.slice(0,t),H()),Math.max(0,s)};const H=()=>{const e=[...c];b.forEach(t=>t(e))},h=e=>{if(!T)return;const t=e.method?.toUpperCase();if(t&&!A.includes(t)||x(e.url))return;const s=c.findIndex(n=>n.id===e.id);s>=0?c[s]={...c[s],...e}:c.unshift(e),H()};let D=!1;export const setupNetworkLogger=()=>{if(globalThis.__NETWORK_LOGGER_INITIALIZED__)return;globalThis.__NETWORK_LOGGER__=h;const e=globalThis.XMLHttpRequest;if(e&&e.prototype&&!globalThis.__XHR_LOGGER_INITIALIZED__){globalThis.__XHR_LOGGER_INITIALIZED__=!0;const s=e.prototype.open,n=e.prototype.send,o=e.prototype.setRequestHeader;e.prototype.open=function(i,r,u,d,l){return this.__logMethod=(i||"GET").toUpperCase(),this.__logUrl=typeof r=="string"?r:String(r),this.__logRequestHeaders={},this.__logStartTime=Date.now(),s.apply(this,[i,r,u!==!1,d,l])},e.prototype.setRequestHeader=function(i,r){return i&&r!=null&&(this.__logRequestHeaders||(this.__logRequestHeaders={}),this.__logRequestHeaders[i.toLowerCase()]=String(r)),o.apply(this,[i,r])},e.prototype.send=function(i){if(!T||D||this.__inAppInspectorTracked)return n.apply(this,[i]);const r=this.__logUrl||"",u=this.__logMethod||"GET";if(x(r))return n.apply(this,[i]);const d=w++;this.__logId=d;const l=this.__logStartTime||Date.now(),a=this.__logRequestHeaders;let _="xhr";(a?.["apollographql-client-name"]||r.toLowerCase().includes("/graphql"))&&(_="apollo");const y=f?f():null;h({id:d,url:r,method:u,startTime:l,client:_,routeInfo:y||void 0,request:u==="GET"?void 0:I(i),requestHeaders:Object.keys(a||{}).length>0?a:void 0});const g=()=>{if(this.__logFinished)return;this.__logFinished=!0;const L=Date.now()-l;let p=null;try{if(this.responseType===""||this.responseType==="text"){const O=this.responseText;try{p=JSON.parse(O)}catch{p=O}}else this.responseType==="json"?p=this.response:this.responseType==="blob"?p=`[Blob: ${this.response?.size||0} bytes]`:p=`[${this.responseType||"Unknown"} Data]`}catch{p=this.response||null}const q=this.getAllResponseHeaders?this.getAllResponseHeaders():"",G=U(q);h({id:d,url:r,method:u,status:this.status,response:p,duration:L,startTime:l,client:_,responseHeaders:G})},E=()=>{if(this.__logFinished)return;this.__logFinished=!0;const L=Date.now()-l;h({id:d,url:r,method:u,status:this.status||0,response:"Network request failed",duration:L,startTime:l,client:_})};return this.addEventListener("load",g),this.addEventListener("error",E),this.addEventListener("abort",E),this.addEventListener("timeout",E),n.apply(this,[i])}}const t=globalThis.fetch;t&&(globalThis.fetch=async(s,n={})=>{if(!T)return t(s,n);const o=(n?.method||"GET").toUpperCase(),i=w++,r=Date.now(),u=typeof s=="string"?s:s?.url;if(x(u))return t(s,n);let d,l="fetch";try{d=m(n?.headers),d?.["apollographql-client-name"]||u?.toLowerCase().includes("/graphql")?l="apollo":d?.["x-requested-with"]?.toLowerCase().includes("xmlhttprequest")&&(l="xhr");const a=f?f():null;h({id:i,url:u,method:o,startTime:r,client:l,routeInfo:a||void 0,request:o==="GET"?void 0:I(n?.body),requestHeaders:d})}catch{}try{D=!0;let a;try{a=await t(s,n)}finally{D=!1}const _=Date.now()-r;try{const y=m(a.headers);let g=null;if((y?.["content-type"]||y?.["Content-Type"]||"").includes("image/"))g="[Image Data]";else try{const p=await a.clone().text();try{g=JSON.parse(p)}catch{g=p}}catch{}h({id:i,url:u,method:o,status:a.status,response:g,duration:_,startTime:r,client:l,responseHeaders:y})}catch{}return a}catch(a){try{h({id:i,url:u,method:o,status:0,startTime:r,response:a,client:l,duration:Date.now()-r})}catch{}throw a}});try{if(R){addAxiosInterceptors(R);const s=R.create;typeof s=="function"&&(R.create=function(...n){const o=s.apply(this,n);return addAxiosInterceptors(o),o})}}catch{}try{k()}catch{}globalThis.__NETWORK_LOGGER_INITIALIZED__=!0},addAxiosInterceptors=e=>{e.interceptors.request.use(async t=>{const s=(t.method||"GET").toUpperCase(),n=w++,o=Date.now();let i=t.url??"";if(i.startsWith("http")||(i=`${t.baseURL??""}${i}`),x(i))return t;t.__logId=n,t.__logStart=o;const r=f?f():null;return h({id:n,url:i,method:s,startTime:o,client:"axios",routeInfo:r||void 0,request:s==="GET"?void 0:I(t.data),requestHeaders:m(t.headers)}),t}),e.interceptors.response.use(t=>{const s=t.config||{},n=s.__logId,o=s.__logStart,i=(s.method||"GET").toUpperCase();if(n==null)return t;let r=s.url??"";return r.startsWith("http")||(r=`${s.baseURL??""}${r}`),h({id:n,url:r,method:i,status:t.status,response:t.data,startTime:o||Date.now(),duration:o!=null?Date.now()-o:void 0,client:"axios",responseHeaders:m(t.headers)}),t},t=>{const s=t.config||{},n=s.__logId,o=s.__logStart,i=(s.method||"GET").toUpperCase();if(n!=null){let r=s.url??"";r.startsWith("http")||(r=`${s.baseURL??""}${r}`),h({id:n,url:r,method:i,status:t.response?.status??0,response:t.response?.data??t.message,startTime:o||Date.now(),duration:o!=null?Date.now()-o:void 0,client:"axios",responseHeaders:m(t.response?.headers)})}return Promise.reject(t)})};if(typeof globalThis<"u")try{setupNetworkLogger()}catch{}
1
+ import R from"axios";import{setupGlobalCrashHandler as S}from"./crashHandler";let l=[],b=[],H=0,E=!0,y=null;export const setRouteInfoProvider=e=>{y=e},setNetworkModuleEnabled=e=>{E=e},getNetworkModuleEnabled=()=>E;const A=["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS","CONNECT","TRACE"],C=[/\/symbolicate(?:\?|$)/i,/\/index\.bundle(?:\?|$)/i,/\/open-debugger(?:\?|$)/i,/:(?:8081|8082|8083|19000|19001)\/(?:index\.bundle|symbolicate|hot|message|status)/i,/google-analytics\.com\/mp\/collect/i,/analytics\.google\.com/i];function w(e){return e?C.some(t=>t.test(e)):!1}function U(e){if(!e||typeof e!="string")return;const t=e.trim().split(/[\r\n]+/),s={};return t.forEach(n=>{const o=n.indexOf(":");if(o>0){const i=n.substring(0,o).trim().toLowerCase(),r=n.substring(o+1).trim();s[i]=r}}),Object.keys(s).length>0?s:void 0}function L(e){if(!e)return;if(typeof e.forEach=="function"){const n={};return e.forEach((o,i)=>{n[i]=o}),Object.keys(n).length>0?n:void 0}if(Array.isArray(e)){const n={};return e.forEach(([o,i])=>{n[o]=i}),Object.keys(n).length>0?n:void 0}const t=e,s={};return Object.entries(t).forEach(([n,o])=>{o!=null&&(s[n]=String(o))}),Object.keys(s).length>0?s:void 0}function N(e){if(!e)return e;if(e&&e._parts&&Array.isArray(e._parts)){const t={};return e._parts.forEach(s=>{const n=s[0],o=s[1];o&&typeof o=="object"&&o.uri?t[n]={_isFile:!0,name:o.name||"unknown",type:o.type||"unknown",uri:o.uri}:t[n]=o}),{_isFormData:!0,...t}}return e}export const subscribeNetworkLogs=e=>(b.push(e),e([...l]),()=>{b=b.filter(t=>t!==e)}),clearNetworkLogs=()=>{l=[],q()},getNetworkLogs=()=>[...l];let x=1/0;export const setMaxNetworkLogsLimit=e=>{x=e},getMaxNetworkLogsLimit=()=>x,pruneNetworkLogs=e=>{const t=e!==void 0?Math.max(0,e):Math.floor(l.length/2),s=l.length-t;return s>0&&(l=l.slice(0,t),q()),Math.max(0,s)};const q=()=>{const e=[...l];b.forEach(t=>t(e))},p=e=>{if(!E)return;const t=(e.method||"GET").toUpperCase();if(t&&!A.includes(t)||w(e.url))return;const s={...e,method:t},n=l.findIndex(o=>o.id===e.id);n>=0?l[n]={...l[n],...s}:(l.unshift(s),l.length>x&&(l=l.slice(0,x))),q()};let O=!1;export const setupNetworkLogger=()=>{if(globalThis.__NETWORK_LOGGER_INITIALIZED__)return;globalThis.__NETWORK_LOGGER__=p;const e=globalThis.XMLHttpRequest;if(e&&e.prototype&&!globalThis.__XHR_LOGGER_INITIALIZED__){globalThis.__XHR_LOGGER_INITIALIZED__=!0;const s=e.prototype.open,n=e.prototype.send,o=e.prototype.setRequestHeader;e.prototype.open=function(i,r,u,d,c){return this.__logMethod=(i||"GET").toUpperCase(),this.__logUrl=typeof r=="string"?r:String(r),this.__logRequestHeaders={},this.__logStartTime=Date.now(),s.apply(this,[i,r,u!==!1,d,c])},e.prototype.setRequestHeader=function(i,r){return i&&r!=null&&(this.__logRequestHeaders||(this.__logRequestHeaders={}),this.__logRequestHeaders[i.toLowerCase()]=String(r)),o.apply(this,[i,r])},e.prototype.send=function(i){if(!E||O||this.__inAppInspectorTracked)return n.apply(this,[i]);const r=this.__logUrl||"",u=this.__logMethod||"GET";if(w(r))return n.apply(this,[i]);const d=H++;this.__logId=d;const c=this.__logStartTime||Date.now(),a=this.__logRequestHeaders;let h="xhr";(a?.["apollographql-client-name"]||r.toLowerCase().includes("/graphql"))&&(h="apollo");const T=y?y():null;p({id:d,url:r,method:u,startTime:c,client:h,routeInfo:T||void 0,request:u==="GET"?void 0:N(i),requestHeaders:Object.keys(a||{}).length>0?a:void 0});const g=()=>{if(this.__logFinished)return;this.__logFinished=!0;const f=Date.now()-c;let _=null;try{if(this.responseType===""||this.responseType==="text"){const D=this.responseText;try{_=JSON.parse(D)}catch{_=D}}else this.responseType==="json"?_=this.response:this.responseType==="blob"?_=`[Blob: ${this.response?.size||0} bytes]`:_=`[${this.responseType||"Unknown"} Data]`}catch{_=this.response||null}const k=this.getAllResponseHeaders?this.getAllResponseHeaders():"",G=U(k);p({id:d,url:r,method:u,status:this.status,response:_,duration:f,startTime:c,client:h,responseHeaders:G})},m=()=>{if(this.__logFinished)return;this.__logFinished=!0;const f=Date.now()-c;p({id:d,url:r,method:u,status:this.status||0,response:"Network request failed",duration:f,startTime:c,client:h})};this.addEventListener("load",g),this.addEventListener("error",m),this.addEventListener("abort",m),this.addEventListener("timeout",m);const I=this.onreadystatechange;return this.onreadystatechange=function(...f){if(this.readyState===4&&(this.status>=200?g():m()),typeof I=="function")return I.apply(this,f)},n.apply(this,[i])}}const t=globalThis.fetch;t&&(globalThis.fetch=async(s,n={})=>{if(!E)return t(s,n);const o=(n?.method||"GET").toUpperCase(),i=H++,r=Date.now(),u=typeof s=="string"?s:s?.url||s?.href||(s?String(s):"");if(w(u))return t(s,n);let d,c="fetch";try{d=L(n?.headers),d?.["apollographql-client-name"]||u?.toLowerCase().includes("/graphql")?c="apollo":d?.["x-requested-with"]?.toLowerCase().includes("xmlhttprequest")&&(c="xhr");const a=y?y():null;p({id:i,url:u,method:o,startTime:r,client:c,routeInfo:a||void 0,request:o==="GET"?void 0:N(n?.body),requestHeaders:d})}catch{}try{O=!0;let a;try{a=await t(s,n)}finally{O=!1}const h=Date.now()-r;try{const T=L(a.headers);let g=null;if((T?.["content-type"]||T?.["Content-Type"]||"").includes("image/"))g="[Image Data]";else try{const f=await a.clone().text();try{g=JSON.parse(f)}catch{g=f}}catch{}p({id:i,url:u,method:o,status:a.status,response:g,duration:h,startTime:r,client:c,responseHeaders:T})}catch{}return a}catch(a){try{const h=a instanceof Error?a.message||a.name||"Network request failed":String(a||"Network request failed");p({id:i,url:u,method:o,status:0,startTime:r,response:h,client:c,duration:Date.now()-r})}catch{}throw a}});try{if(R){addAxiosInterceptors(R);const s=R.create;typeof s=="function"&&(R.create=function(...n){const o=s.apply(this,n);return addAxiosInterceptors(o),o})}}catch{}try{S()}catch{}globalThis.__NETWORK_LOGGER_INITIALIZED__=!0},addAxiosInterceptors=e=>{e.interceptors.request.use(async t=>{const s=(t.method||"GET").toUpperCase(),n=H++,o=Date.now();let i=t.url??"";if(i.startsWith("http")||(i=`${t.baseURL??""}${i}`),w(i))return t;t.__logId=n,t.__logStart=o;const r=y?y():null;return p({id:n,url:i,method:s,startTime:o,client:"axios",routeInfo:r||void 0,request:s==="GET"?void 0:N(t.data),requestHeaders:L(t.headers)}),t}),e.interceptors.response.use(t=>{const s=t.config||{},n=s.__logId,o=s.__logStart,i=(s.method||"GET").toUpperCase();if(n==null)return t;let r=s.url??"";return r.startsWith("http")||(r=`${s.baseURL??""}${r}`),p({id:n,url:r,method:i,status:t.status,response:t.data,startTime:o||Date.now(),duration:o!=null?Date.now()-o:void 0,client:"axios",responseHeaders:L(t.headers)}),t},t=>{const s=t.config||{},n=s.__logId,o=s.__logStart,i=(s.method||"GET").toUpperCase();if(n!=null){let r=s.url??"";r.startsWith("http")||(r=`${s.baseURL??""}${r}`),p({id:n,url:r,method:i,status:t.response?.status??0,response:t.response?.data??(t instanceof Error?t.message:String(t||"Network request failed")),startTime:o||Date.now(),duration:o!=null?Date.now()-o:void 0,client:"axios",responseHeaders:L(t.response?.headers)})}return Promise.reject(t)})};if(typeof globalThis<"u")try{setupNetworkLogger()}catch{}
@@ -13,3 +13,18 @@ export declare function shareReduxReport(action: ReduxHistoryEntry): Promise<voi
13
13
  export declare function shareLogReport(log: ConsoleLog): Promise<void>;
14
14
  export declare function formatSocketReport(record: SocketConnectionRecord): string;
15
15
  export declare function shareSocketReport(record: SocketConnectionRecord): Promise<void>;
16
+ export type ConsoleLogExportFormat = 'txt' | 'log' | 'json' | 'text' | 'markdown' | 'csv';
17
+ export interface ConsoleLogExportOptions {
18
+ includeStackTrace?: boolean;
19
+ includeArguments?: boolean;
20
+ includeCaller?: boolean;
21
+ includeTimestamps?: boolean;
22
+ includeAppInfo?: boolean;
23
+ includeDuplicates?: boolean;
24
+ ignorePattern?: string;
25
+ }
26
+ export declare const DEFAULT_CONSOLE_EXPORT_OPTIONS: ConsoleLogExportOptions;
27
+ export declare function generateConsoleLogsFilename(format?: ConsoleLogExportFormat): string;
28
+ export declare function formatConsoleLogsExport(logs: ConsoleLog[], format?: ConsoleLogExportFormat, options?: ConsoleLogExportOptions): string;
29
+ export declare function estimateConsoleLogsExportSize(logs: ConsoleLog[], format?: ConsoleLogExportFormat, options?: ConsoleLogExportOptions): number;
30
+ export declare function shareConsoleLogs(logs: ConsoleLog[], format?: ConsoleLogExportFormat, options?: ConsoleLogExportOptions, customTitle?: string): Promise<void>;
@@ -1,8 +1,15 @@
1
- import{Alert as l,Share as $}from"react-native";import{formatDateTime as i,getCurlCommand as c}from"./index";function p(e){if(e===void 0)return"undefined";if(e===null)return"null";if(typeof e=="string")return e;try{return JSON.stringify(e,null,2)}catch{return String(e)}}export function formatApiReport(e){const n=(e.method||"GET").toUpperCase(),t=e.status===0?"Failed / Network Error":e.status!=null?`${e.status} ${e.status===200?"OK":""}`.trim():"Pending",u=e.duration!=null?`${e.duration}ms`:"N/A",o=i(e.startTime||Date.now()),s=c(e),a=["\u{1F680} API INSPECTION REPORT","\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501",`\u{1F4CC} Method: ${n}`,`\u{1F4CA} Status: ${t}`,`\u23F1\uFE0F Duration: ${u}`,`\u{1F552} Time: ${o}`];return e.client&&a.push(`\u{1F50C} Client: ${e.client.toUpperCase()}`),a.push(`\u{1F310} URL: ${e.url||"N/A"}`),a.push(""),e.requestHeaders&&Object.keys(e.requestHeaders).length>0&&(a.push("\u{1F4CB} Request Headers:"),a.push(p(e.requestHeaders)),a.push("")),e.request!=null&&e.request!==""&&(a.push("\u{1F4DD} Request Body:"),a.push(p(e.request)),a.push("")),e.responseHeaders&&Object.keys(e.responseHeaders).length>0&&(a.push("\u{1F4D1} Response Headers:"),a.push(p(e.responseHeaders)),a.push("")),e.response!=null&&e.response!==""&&(a.push("\u{1F4E5} Response Data:"),a.push(p(e.response)),a.push("")),s&&(a.push("\u{1F4BB} cURL Command:"),a.push(s),a.push("")),a.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),a.push("Generated by React Native InApp Inspector"),a.join(`
2
- `)}export function formatPushReport(e){const n=i(e.timestamp||Date.now()),t=(e.source||"push").toUpperCase(),u=(e.appState||"unknown").toUpperCase(),o=(e.action||"received").toUpperCase(),s=["\u{1F514} PUSH NOTIFICATION REPORT","\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501",`\u{1F4CC} Title: ${e.title||"(No Title)"}`,`\u{1F4DD} Body: ${e.body||"(No Body)"}`,`\u{1F3E2} Source: ${t}${e.domain?` (${e.domain})`:""}`,`\u{1F194} Message ID: ${e.id||"N/A"}`,`\u{1F4F1} App State: ${u}`,`\u{1F3AF} Action: ${o}`,`\u{1F552} Time: ${n}`];return e.subtitle&&s.push(`\u{1F4D1} Subtitle: ${e.subtitle}`),e.channelId&&s.push(`\u{1F3F7}\uFE0F Channel: ${e.channelId}`),e.priority&&s.push(`\u26A1 Priority: ${e.priority}`),e.badge!=null&&s.push(`\u{1F522} Badge: ${e.badge}`),e.sound&&s.push(`\u{1F50A} Sound: ${e.sound}`),e.imageUrl&&s.push(`\u{1F5BC}\uFE0F Image: ${e.imageUrl}`),s.push(""),e.data&&Object.keys(e.data).length>0&&(s.push("\u{1F4E6} Custom Data Payload:"),s.push(p(e.data)),s.push("")),e.customDomainAttributes&&Object.keys(e.customDomainAttributes).length>0&&(s.push("\u{1F3E2} Domain Attributes:"),s.push(p(e.customDomainAttributes)),s.push("")),e.rawPayload!=null&&(s.push("\u2699\uFE0F Raw Payload:"),s.push(p(e.rawPayload)),s.push("")),s.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),s.push("Generated by React Native InApp Inspector"),s.join(`
3
- `)}export function formatCrashReport(e){const n=`${e.dateStr||""} ${e.timeStr||""}`.trim()||i(e.timestamp),t=["\u{1F4A5} CRASH REPORT","\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501",`\u26A0\uFE0F Error: ${e.name||"Error"}: ${e.message||"Unknown error"}`,`\u{1F6A8} Fatal: ${e.isFatal?"YES (Fatal)":"NO (Caught)"}`,`\u{1F3F7}\uFE0F Type: ${(e.type||"js").toUpperCase()}`,`\u{1F552} Time: ${n}`];return e.deviceInfo&&t.push(`\u{1F4F1} Platform: ${e.deviceInfo.platform||"N/A"} (OS: ${e.deviceInfo.osVersion||"N/A"}, RN: ${e.deviceInfo.rnVersion||"N/A"})`),e.memoryInfo?.usedJSHeapSize&&t.push(`\u{1F4BE} Used Heap: ${Math.round(e.memoryInfo.usedJSHeapSize/(1024*1024))} MB`),t.push(""),e.stack&&(t.push("\u{1F4DC} Stack Trace:"),t.push(e.stack),t.push("")),e.breadcrumbs&&e.breadcrumbs.length>0&&(t.push(`\u{1F43E} Breadcrumbs (${e.breadcrumbs.length}):`),e.breadcrumbs.slice(-10).forEach(u=>{t.push(` \u2022 [${u.type}] ${u.message} (${i(u.timestamp)})`)}),t.push("")),t.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),t.push("Generated by React Native InApp Inspector"),t.join(`
4
- `)}export function formatAnalyticsReport(e){const n=i(e.timestamp),t=["\u{1F4CA} ANALYTICS EVENT REPORT","\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501",`\u{1F4CC} Event Name: ${e.name||"Unknown"}`,`\u{1F3E2} Source: ${(e.source||"manual").toUpperCase()}`,`\u{1F552} Timestamp: ${n}`];return e.screenName&&t.push(`\u{1F4F1} Screen Name: ${e.screenName}`),e.userId&&t.push(`\u{1F464} User ID: ${e.userId}`),e.trackingId&&t.push(`\u{1F194} Tracking ID: ${e.trackingId}`),t.push(""),e.params&&Object.keys(e.params).length>0&&(t.push("\u{1F4E6} Event Parameters:"),t.push(p(e.params)),t.push("")),e.userProperties&&Object.keys(e.userProperties).length>0&&(t.push("\u{1F464} User Properties:"),t.push(p(e.userProperties)),t.push("")),t.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),t.push("Generated by React Native InApp Inspector"),t.join(`
5
- `)}export function formatReduxReport(e){const n=typeof e.timestamp=="number"?i(e.timestamp):e.timestamp,t=["\u{1F504} REDUX ACTION REPORT","\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501",`\u{1F4CC} Action Type: ${e.type||"UNKNOWN"}`,`\u{1F552} Timestamp: ${n}`];return e.caller&&t.push(`\u{1F4CD} Caller: ${e.caller}`),e.originType&&t.push(`\u2699\uFE0F Origin: ${e.originType}`),e.affectedSlices&&e.affectedSlices.length>0&&t.push(`\u{1F370} Slices: ${e.affectedSlices.join(", ")}`),t.push(""),t.push("\u{1F4E6} Action Payload:"),t.push(p(e.payload)),t.push(""),e.prevState!==void 0&&(t.push("\u23EE\uFE0F Previous State:"),t.push(p(e.prevState)),t.push("")),e.nextState!==void 0&&(t.push("\u23ED\uFE0F Next State:"),t.push(p(e.nextState)),t.push("")),t.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),t.push("Generated by React Native InApp Inspector"),t.join(`
6
- `)}export function formatLogReport(e){const n=i(e.timestamp),t=["\u{1F4DC} CONSOLE LOG REPORT","\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501",`\u{1F4CC} Level: ${(e.type||"info").toUpperCase()}`,`\u{1F552} Timestamp: ${n}`,`\u{1F4AC} Message: ${e.message||""}`];return e.caller&&t.push(`\u{1F4CD} Caller: ${e.caller}`),t.push(""),e.rawArgs&&e.rawArgs.length>0&&(t.push("\u{1F4E6} Arguments:"),t.push(p(e.rawArgs)),t.push("")),(e.stack||e.errorStack)&&(t.push("\u{1F4DC} Stack Trace:"),t.push(e.stack||e.errorStack||""),t.push("")),t.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),t.push("Generated by React Native InApp Inspector"),t.join(`
7
- `)}async function r(e,n){try{await $.share({title:e,message:n},{dialogTitle:e})}catch(t){t?.message!=="User did not share"&&l.alert("Share Error",t?.message||"Failed to open share sheet")}}export async function shareApiReport(e){const n=formatApiReport(e),t=`API: ${e.method||"GET"} ${e.url?.substring(0,40)||""}`;await r(t,n)}export async function sharePushReport(e){const n=formatPushReport(e),t=`Push: ${e.title||e.id||"Notification"}`;await r(t,n)}export async function shareCrashReport(e){const n=formatCrashReport(e),t=`Crash: ${e.name||e.message||"Error"}`;await r(t,n)}export async function shareAnalyticsReport(e){const n=formatAnalyticsReport(e),t=`Analytics: ${e.name||"Event"}`;await r(t,n)}export async function shareReduxReport(e){const n=formatReduxReport(e),t=`Redux: ${e.type||"Action"}`;await r(t,n)}export async function shareLogReport(e){const n=formatLogReport(e),t=`Log: ${(e.type||"info").toUpperCase()} - ${e.message?.substring(0,30)||""}`;await r(t,n)}export function formatSocketReport(e){const n=(e.client||"websocket").toUpperCase(),t=(e.status||"open").toUpperCase(),u=e.duration!=null?`${e.duration}ms`:"Active / Open",o=i(e.startTime||Date.now()),s=["\u{1F50C} WEBSOCKET / SOCKET.IO REPORT","\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501",`\u{1F4E1} Client: ${n}`,`\u{1F310} URL: ${e.url||"N/A"}`,`\u26A1 Status: ${t}`,`\u23F1\uFE0F Connected: ${o}`,`\u23F3 Duration: ${u}`,`\u{1F4E6} Total Frames: ${e.frames?.length||0} (${e.sentCount||0} sent, ${e.receivedCount||0} recvd)`,`\u{1F4CA} Data Size: ${(e.totalBytesSent||0)+(e.totalBytesReceived||0)} bytes`];return e.protocols&&s.push(`\u{1F4DC} Protocols: ${Array.isArray(e.protocols)?e.protocols.join(", "):e.protocols}`),e.closeCode!=null&&s.push(`\u{1F6D1} Close Code: ${e.closeCode} (${e.closeReason||"N/A"})`),e.error&&s.push(`\u274C Error: ${e.error}`),e.caller&&s.push(`\u{1F4CD} Caller: ${e.caller}`),e.query&&Object.keys(e.query).length>0&&(s.push(""),s.push("\u{1F50D} Query Parameters:"),s.push(p(e.query))),e.frames&&e.frames.length>0&&(s.push(""),s.push("\u{1F4AC} Recent Message Frames:"),e.frames.slice(-10).forEach((a,h)=>{const m=a.direction==="send"?"\u2B06\uFE0F SEND":"\u2B07\uFE0F RECV",f=a.eventName?` [${a.eventName}]`:"";s.push(`--- Frame #${h+1} (${m}${f}, ${a.type}, ${a.size||0}B) ---`),s.push(p(a.data))})),s.push(""),s.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),s.push("Generated by React Native InApp Inspector"),s.join(`
8
- `)}export async function shareSocketReport(e){const n=formatSocketReport(e),t=`Socket: ${e.client?.toUpperCase()||"WS"} ${e.url?.substring(0,35)||""}`;await r(t,n)}
1
+ import{Alert as b,Share as x}from"react-native";import{formatDateTime as c,getCurlCommand as P}from"./index";function r(e){if(e===void 0)return"undefined";if(e===null)return"null";if(typeof e=="string")return e;try{return JSON.stringify(e,null,2)}catch{return String(e)}}export function formatApiReport(e){const n=(e.method||"GET").toUpperCase(),t=e.status===0?"Failed / Network Error":e.status!=null?`${e.status} ${e.status===200?"OK":""}`.trim():"Pending",i=e.duration!=null?`${e.duration}ms`:"N/A",o=c(e.startTime||Date.now()),s=P(e),a=["\u{1F680} API INSPECTION REPORT","\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501",`\u{1F4CC} Method: ${n}`,`\u{1F4CA} Status: ${t}`,`\u23F1\uFE0F Duration: ${i}`,`\u{1F552} Time: ${o}`];return e.client&&a.push(`\u{1F50C} Client: ${e.client.toUpperCase()}`),a.push(`\u{1F310} URL: ${e.url||"N/A"}`),a.push(""),e.requestHeaders&&Object.keys(e.requestHeaders).length>0&&(a.push("\u{1F4CB} Request Headers:"),a.push(r(e.requestHeaders)),a.push("")),e.request!=null&&e.request!==""&&(a.push("\u{1F4DD} Request Body:"),a.push(r(e.request)),a.push("")),e.responseHeaders&&Object.keys(e.responseHeaders).length>0&&(a.push("\u{1F4D1} Response Headers:"),a.push(r(e.responseHeaders)),a.push("")),e.response!=null&&e.response!==""&&(a.push("\u{1F4E5} Response Data:"),a.push(r(e.response)),a.push("")),s&&(a.push("\u{1F4BB} cURL Command:"),a.push(s),a.push("")),a.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),a.push("Generated by React Native InApp Inspector"),a.join(`
2
+ `)}export function formatPushReport(e){const n=c(e.timestamp||Date.now()),t=(e.source||"push").toUpperCase(),i=(e.appState||"unknown").toUpperCase(),o=(e.action||"received").toUpperCase(),s=["\u{1F514} PUSH NOTIFICATION REPORT","\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501",`\u{1F4CC} Title: ${e.title||"(No Title)"}`,`\u{1F4DD} Body: ${e.body||"(No Body)"}`,`\u{1F3E2} Source: ${t}${e.domain?` (${e.domain})`:""}`,`\u{1F194} Message ID: ${e.id||"N/A"}`,`\u{1F4F1} App State: ${i}`,`\u{1F3AF} Action: ${o}`,`\u{1F552} Time: ${n}`];return e.subtitle&&s.push(`\u{1F4D1} Subtitle: ${e.subtitle}`),e.channelId&&s.push(`\u{1F3F7}\uFE0F Channel: ${e.channelId}`),e.priority&&s.push(`\u26A1 Priority: ${e.priority}`),e.badge!=null&&s.push(`\u{1F522} Badge: ${e.badge}`),e.sound&&s.push(`\u{1F50A} Sound: ${e.sound}`),e.imageUrl&&s.push(`\u{1F5BC}\uFE0F Image: ${e.imageUrl}`),s.push(""),e.data&&Object.keys(e.data).length>0&&(s.push("\u{1F4E6} Custom Data Payload:"),s.push(r(e.data)),s.push("")),e.customDomainAttributes&&Object.keys(e.customDomainAttributes).length>0&&(s.push("\u{1F3E2} Domain Attributes:"),s.push(r(e.customDomainAttributes)),s.push("")),e.rawPayload!=null&&(s.push("\u2699\uFE0F Raw Payload:"),s.push(r(e.rawPayload)),s.push("")),s.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),s.push("Generated by React Native InApp Inspector"),s.join(`
3
+ `)}export function formatCrashReport(e){const n=`${e.dateStr||""} ${e.timeStr||""}`.trim()||c(e.timestamp),t=["\u{1F4A5} CRASH REPORT","\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501",`\u26A0\uFE0F Error: ${e.name||"Error"}: ${e.message||"Unknown error"}`,`\u{1F6A8} Fatal: ${e.isFatal?"YES (Fatal)":"NO (Caught)"}`,`\u{1F3F7}\uFE0F Type: ${(e.type||"js").toUpperCase()}`,`\u{1F552} Time: ${n}`];return e.deviceInfo&&t.push(`\u{1F4F1} Platform: ${e.deviceInfo.platform||"N/A"} (OS: ${e.deviceInfo.osVersion||"N/A"}, RN: ${e.deviceInfo.rnVersion||"N/A"})`),e.memoryInfo?.usedJSHeapSize&&t.push(`\u{1F4BE} Used Heap: ${Math.round(e.memoryInfo.usedJSHeapSize/(1024*1024))} MB`),t.push(""),e.stack&&(t.push("\u{1F4DC} Stack Trace:"),t.push(e.stack),t.push("")),e.breadcrumbs&&e.breadcrumbs.length>0&&(t.push(`\u{1F43E} Breadcrumbs (${e.breadcrumbs.length}):`),e.breadcrumbs.slice(-10).forEach(i=>{t.push(` \u2022 [${i.type}] ${i.message} (${c(i.timestamp)})`)}),t.push("")),t.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),t.push("Generated by React Native InApp Inspector"),t.join(`
4
+ `)}export function formatAnalyticsReport(e){const n=c(e.timestamp),t=["\u{1F4CA} ANALYTICS EVENT REPORT","\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501",`\u{1F4CC} Event Name: ${e.name||"Unknown"}`,`\u{1F3E2} Source: ${(e.source||"manual").toUpperCase()}`,`\u{1F552} Timestamp: ${n}`];return e.screenName&&t.push(`\u{1F4F1} Screen Name: ${e.screenName}`),e.userId&&t.push(`\u{1F464} User ID: ${e.userId}`),e.trackingId&&t.push(`\u{1F194} Tracking ID: ${e.trackingId}`),t.push(""),e.params&&Object.keys(e.params).length>0&&(t.push("\u{1F4E6} Event Parameters:"),t.push(r(e.params)),t.push("")),e.userProperties&&Object.keys(e.userProperties).length>0&&(t.push("\u{1F464} User Properties:"),t.push(r(e.userProperties)),t.push("")),t.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),t.push("Generated by React Native InApp Inspector"),t.join(`
5
+ `)}export function formatReduxReport(e){const n=typeof e.timestamp=="number"?c(e.timestamp):e.timestamp,t=["\u{1F504} REDUX ACTION REPORT","\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501",`\u{1F4CC} Action Type: ${e.type||"UNKNOWN"}`,`\u{1F552} Timestamp: ${n}`];return e.caller&&t.push(`\u{1F4CD} Caller: ${e.caller}`),e.originType&&t.push(`\u2699\uFE0F Origin: ${e.originType}`),e.affectedSlices&&e.affectedSlices.length>0&&t.push(`\u{1F370} Slices: ${e.affectedSlices.join(", ")}`),t.push(""),t.push("\u{1F4E6} Action Payload:"),t.push(r(e.payload)),t.push(""),e.prevState!==void 0&&(t.push("\u23EE\uFE0F Previous State:"),t.push(r(e.prevState)),t.push("")),e.nextState!==void 0&&(t.push("\u23ED\uFE0F Next State:"),t.push(r(e.nextState)),t.push("")),t.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),t.push("Generated by React Native InApp Inspector"),t.join(`
6
+ `)}export function formatLogReport(e){const n=c(e.timestamp),t=["\u{1F4DC} CONSOLE LOG REPORT","\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501",`\u{1F4CC} Level: ${(e.type||"info").toUpperCase()}`,`\u{1F552} Timestamp: ${n}`,`\u{1F4AC} Message: ${e.message||""}`];return e.caller&&t.push(`\u{1F4CD} Caller: ${e.caller}`),t.push(""),e.rawArgs&&e.rawArgs.length>0&&(t.push("\u{1F4E6} Arguments:"),t.push(r(e.rawArgs)),t.push("")),(e.stack||e.errorStack)&&(t.push("\u{1F4DC} Stack Trace:"),t.push(e.stack||e.errorStack||""),t.push("")),t.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),t.push("Generated by React Native InApp Inspector"),t.join(`
7
+ `)}async function m(e,n){try{await x.share({title:e,message:n},{dialogTitle:e})}catch(t){t?.message!=="User did not share"&&b.alert("Share Error",t?.message||"Failed to open share sheet")}}export async function shareApiReport(e){const n=formatApiReport(e),t=`API: ${e.method||"GET"} ${e.url?.substring(0,40)||""}`;await m(t,n)}export async function sharePushReport(e){const n=formatPushReport(e),t=`Push: ${e.title||e.id||"Notification"}`;await m(t,n)}export async function shareCrashReport(e){const n=formatCrashReport(e),t=`Crash: ${e.name||e.message||"Error"}`;await m(t,n)}export async function shareAnalyticsReport(e){const n=formatAnalyticsReport(e),t=`Analytics: ${e.name||"Event"}`;await m(t,n)}export async function shareReduxReport(e){const n=formatReduxReport(e),t=`Redux: ${e.type||"Action"}`;await m(t,n)}export async function shareLogReport(e){const n=formatLogReport(e),t=`Log: ${(e.type||"info").toUpperCase()} - ${e.message?.substring(0,30)||""}`;await m(t,n)}export function formatSocketReport(e){const n=(e.client||"websocket").toUpperCase(),t=(e.status||"open").toUpperCase(),i=e.duration!=null?`${e.duration}ms`:"Active / Open",o=c(e.startTime||Date.now()),s=["\u{1F50C} WEBSOCKET / SOCKET.IO REPORT","\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501",`\u{1F4E1} Client: ${n}`,`\u{1F310} URL: ${e.url||"N/A"}`,`\u26A1 Status: ${t}`,`\u23F1\uFE0F Connected: ${o}`,`\u23F3 Duration: ${i}`,`\u{1F4E6} Total Frames: ${e.frames?.length||0} (${e.sentCount||0} sent, ${e.receivedCount||0} recvd)`,`\u{1F4CA} Data Size: ${(e.totalBytesSent||0)+(e.totalBytesReceived||0)} bytes`];return e.protocols&&s.push(`\u{1F4DC} Protocols: ${Array.isArray(e.protocols)?e.protocols.join(", "):e.protocols}`),e.closeCode!=null&&s.push(`\u{1F6D1} Close Code: ${e.closeCode} (${e.closeReason||"N/A"})`),e.error&&s.push(`\u274C Error: ${e.error}`),e.caller&&s.push(`\u{1F4CD} Caller: ${e.caller}`),e.query&&Object.keys(e.query).length>0&&(s.push(""),s.push("\u{1F50D} Query Parameters:"),s.push(r(e.query))),e.frames&&e.frames.length>0&&(s.push(""),s.push("\u{1F4AC} Recent Message Frames:"),e.frames.slice(-10).forEach((a,$)=>{const g=a.direction==="send"?"\u2B06\uFE0F SEND":"\u2B07\uFE0F RECV",f=a.eventName?` [${a.eventName}]`:"";s.push(`--- Frame #${$+1} (${g}${f}, ${a.type}, ${a.size||0}B) ---`),s.push(r(a.data))})),s.push(""),s.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),s.push("Generated by React Native InApp Inspector"),s.join(`
8
+ `)}export async function shareSocketReport(e){const n=formatSocketReport(e),t=`Socket: ${e.client?.toUpperCase()||"WS"} ${e.url?.substring(0,35)||""}`;await m(t,n)}export const DEFAULT_CONSOLE_EXPORT_OPTIONS={includeStackTrace:!1,includeArguments:!1,includeCaller:!1,includeTimestamps:!1,includeAppInfo:!1,includeDuplicates:!1,ignorePattern:""};export function generateConsoleLogsFilename(e="txt"){const n=new Date,t=String(n.getDate()).padStart(2,"0"),i=String(n.getMonth()+1).padStart(2,"0"),o=String(n.getFullYear()).slice(-2),s=Math.random().toString(36).substring(2,8).padEnd(6,"0");return`log_${t}${i}${o}_${s}.${e==="log"?"log":"txt"}`}export function formatConsoleLogsExport(e,n="txt",t=DEFAULT_CONSOLE_EXPORT_OPTIONS){if(!e||e.length===0)return"No console logs to export.";const{includeStackTrace:i=!1,includeArguments:o=!1,includeCaller:s=!1,includeTimestamps:a=!1,includeAppInfo:$=!1,includeDuplicates:g=!1,ignorePattern:f=""}=t;let C=e;if(f&&f.trim().length>0)try{const p=new RegExp(f.trim(),"i");C=e.filter(l=>{const S=l.message||"",d=l.rawArgs?r(l.rawArgs):"",y=l.caller||"";return!p.test(S)&&!p.test(d)&&!p.test(y)})}catch{}if(C.length===0)return"No console logs to export (all filtered out).";const R=new Date().toLocaleString(),h="********************************************************************************",A=[];$&&A.push(`/${h}`,` * \u{1F4DC} CONSOLE LOGS EXPORT (${n.toUpperCase()})`,` * \u{1F552} Exported At: ${R}`,` * \u{1F4CA} Total Logs: ${e.length}`," * \u2699\uFE0F Generator: React Native InApp Inspector",` ${h}/`,"");const N=e.map((p,l)=>{const S=l+1,d=c(p.timestamp),y=(p.type||"info").toUpperCase(),O=g&&p.duplicateCount&&p.duplicateCount>1?` [DUPLICATES: \xD7${p.duplicateCount}]`:"",u=[`/${h}`,` * \u{1F4CC} LOG #${S} Starts [${y}]${a?` - ${d}`:""}${O}`,` ${h}/`];if(s&&p.caller&&u.push(`\u{1F4CD} Caller: ${p.caller}`),a&&u.push(`\u{1F552} Time: ${d}`),u.push(`\u{1F3F7}\uFE0F Level: ${y}`),p.sourceMethod&&p.sourceMethod!==p.type&&u.push(`\u2699\uFE0F Method: console.${p.sourceMethod}()`),u.push(""),u.push("\u{1F4AC} Message:"),u.push(p.message||"(Empty message)"),o&&p.rawArgs&&p.rawArgs.length>0&&(u.push(""),u.push("\u{1F4E6} Arguments / Data:"),u.push(r(p.rawArgs))),i&&(p.stack||p.errorStack)){u.push(""),u.push("\u{1F4DC} Stack Trace & Frames:");const E=(p.stack||p.errorStack||"").split(`
9
+ `).map(I=>` ${I}`).join(`
10
+ `);u.push(E)}return u.push(""),u.push(`/${h}`),u.push(` * \u{1F3C1} LOG #${S} Ends`),u.push(` ${h}/`),u.join(`
11
+ `)}).join(`
12
+
13
+ `),T=$?["",`/${h}`," * \u{1F3C1} END OF CONSOLE LOGS EXPORT",` ${h}/`].join(`
14
+ `):"";return`${A.join(`
15
+ `)}${N}${T}`}export function estimateConsoleLogsExportSize(e,n="txt",t=DEFAULT_CONSOLE_EXPORT_OPTIONS){if(!e||e.length===0)return 0;const i=Math.min(e.length,20),o=e.slice(0,i),a=formatConsoleLogsExport(o,n,t).length/i;return Math.round(a*e.length)}export async function shareConsoleLogs(e,n="txt",t=DEFAULT_CONSOLE_EXPORT_OPTIONS,i){const o=formatConsoleLogsExport(e,n,t),s=generateConsoleLogsFilename(n);await m(i||s,o)}