react-native-inapp-inspector 2.3.20 → 2.3.22
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.md +14 -14
- package/android/src/main/java/com/inappinspector/NetworkInspectorModule.kt +58 -1
- package/dist/commonjs/components/AppHeaderLogo.js +2 -2
- package/dist/commonjs/components/ConsoleLogCard.js +1 -1
- package/dist/commonjs/components/HighlightText.js +13 -13
- package/dist/commonjs/components/Inspector/AboutModal.js +143 -251
- package/dist/commonjs/components/Inspector/DebuggingTab.js +19 -13
- package/dist/commonjs/components/Inspector/InspectorHeader.js +54 -80
- package/dist/commonjs/components/Inspector/MainScreen.js +13 -23
- package/dist/commonjs/components/Inspector/MediaGalleryTab.js +4 -4
- package/dist/commonjs/components/Inspector/MediaPreviewModal.js +1 -1
- package/dist/commonjs/components/Inspector/NpmStarPrompt.js +1 -1
- package/dist/commonjs/components/Inspector/TabBar.js +7 -7
- package/dist/commonjs/components/Inspector/UpdateAvailableModal.js +23 -24
- package/dist/commonjs/components/LogCard.js +16 -16
- package/dist/commonjs/components/NetworkIcons.d.ts +10 -0
- package/dist/commonjs/components/NetworkIcons.js +46 -4
- package/dist/commonjs/components/QRCodeView.js +2 -2
- package/dist/commonjs/components/TreeNode.js +16 -16
- package/dist/commonjs/constants/version.d.ts +1 -1
- package/dist/commonjs/constants/version.js +1 -1
- package/dist/commonjs/customHooks/bundleAnalyzer.js +1 -1
- package/dist/commonjs/helpers/index.d.ts +1 -0
- package/dist/commonjs/helpers/index.js +2 -2
- package/dist/commonjs/index.js +1 -1
- package/dist/commonjs/native/NativeInspector.d.ts +1 -0
- package/dist/commonjs/native/NativeInspector.js +1 -1
- package/dist/commonjs/types/interfaces.d.ts +0 -2
- package/dist/esm/components/AppHeaderLogo.js +6 -6
- package/dist/esm/components/ConsoleLogCard.js +6 -6
- package/dist/esm/components/HighlightText.js +17 -17
- package/dist/esm/components/Inspector/AboutModal.js +205 -313
- package/dist/esm/components/Inspector/DebuggingTab.js +32 -26
- package/dist/esm/components/Inspector/InspectorHeader.js +96 -122
- package/dist/esm/components/Inspector/MainScreen.js +66 -76
- package/dist/esm/components/Inspector/MediaGalleryTab.js +19 -19
- package/dist/esm/components/Inspector/MediaPreviewModal.js +18 -18
- package/dist/esm/components/Inspector/NpmStarPrompt.js +1 -1
- package/dist/esm/components/Inspector/TabBar.js +21 -21
- package/dist/esm/components/Inspector/UpdateAvailableModal.js +65 -66
- package/dist/esm/components/LogCard.js +43 -43
- package/dist/esm/components/NetworkIcons.d.ts +10 -0
- package/dist/esm/components/NetworkIcons.js +191 -149
- package/dist/esm/components/QRCodeView.js +4 -4
- package/dist/esm/components/TreeNode.js +53 -53
- package/dist/esm/constants/version.d.ts +1 -1
- package/dist/esm/constants/version.js +1 -1
- package/dist/esm/customHooks/bundleAnalyzer.js +1 -1
- package/dist/esm/helpers/index.d.ts +1 -0
- package/dist/esm/helpers/index.js +4 -4
- package/dist/esm/index.js +7 -7
- package/dist/esm/native/NativeInspector.d.ts +1 -0
- package/dist/esm/native/NativeInspector.js +1 -1
- package/dist/esm/types/interfaces.d.ts +0 -2
- package/ios/NetworkInspectorModule.mm +39 -3
- package/package.json +1 -1
- package/src/native/NativeInspector.ts +18 -0
- package/dist/commonjs/components/Inspector/FeedbackModal.d.ts +0 -16
- package/dist/commonjs/components/Inspector/FeedbackModal.js +0 -198
- package/dist/esm/components/Inspector/FeedbackModal.d.ts +0 -16
- package/dist/esm/components/Inspector/FeedbackModal.js +0 -198
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import oe,{useRef as
|
|
1
|
+
import oe,{useRef as $,useState as E}from"react";import{Platform as te,ScrollView as Ce,Text as F,TouchableOpacity as U,View as C}from"react-native";import{useInspector as we}from"./InspectorContext";import k from"../../styles";import{AppColors as o}from"../../styles/AppColors";import{AppFonts as ke}from"../../styles/AppFonts";import G from"../TouchableScale";import{SignalIcon as Se,TerminalIcon as Re,AnalyticsIcon as Te,PackageIcon as Ie,ReduxIcon as Le,PerformanceIcon as Ae,CrashIcon as Be,SmartphoneIcon as Ve,DatabaseIcon as Oe,QrCodeIcon as Pe,ScreencastIcon as De,ChevronIcon as Q}from"../NetworkIcons";import{isReduxConnected as Me}from"../../customHooks/reduxLogger";import{isAnalyticsConnected as He}from"../../customHooks/analyticsLogger";import{isLocalDebugEnvironment as We}from"../../helpers";const $e=oe.memo(()=>{const{activeTab:R,switchActiveTab:B,tabVisibility:x,logs:V,consoleLogs:O,analyticsEvents:q,crashRecords:P,lastReadApisCount:J,lastReadLogsCount:K,lastReadCrashesCount:N,mediaCount:j}=we(),X=Me(),Y=He(),S=R==="media",z=(x?.media??!0)&&j>0,D=$(null),[L,Z]=E(!1),[M,_]=E(!0),H=$(0),ee=e=>{const{contentOffset:w,layoutMeasurement:t,contentSize:A}=e.nativeEvent,T=w.x;H.current=T;const v=T>8,I=T<A.width-t.width-8;L!==v&&Z(v),M!==I&&_(I)},W=e=>{D.current?.scrollTo({x:Math.max(0,H.current+e),animated:!0})};return<C style={[k.tabBarContainer,{flexDirection:"row",alignItems:"center",paddingHorizontal:0}]}>
|
|
2
2
|
|
|
3
|
-
{L&&<U onPress={()=>
|
|
4
|
-
<C style={{width:22,height:22,borderRadius:11,backgroundColor:
|
|
3
|
+
{L&&<U onPress={()=>W(-160)}hitSlop={{top:6,bottom:6,left:6,right:6}}activeOpacity={.7}style={{paddingLeft:6,paddingRight:2,justifyContent:"center",alignItems:"center"}}>
|
|
4
|
+
<C style={{width:22,height:22,borderRadius:11,backgroundColor:o.grayBorderSecondary,alignItems:"center",justifyContent:"center"}}>
|
|
5
5
|
<Q direction="left"size={13}color={o.purple}/>
|
|
6
6
|
</C>
|
|
7
7
|
</U>}
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
<Ce ref={
|
|
11
|
-
{[{id:1,key:"apis",label:"APIs",count:
|
|
10
|
+
<Ce ref={D}horizontal showsHorizontalScrollIndicator={!1}onScroll={ee}scrollEventThrottle={16}style={{flex:1}}contentContainerStyle={{paddingLeft:L?4:12,paddingRight:z?6:12}}>
|
|
11
|
+
{[{id:1,key:"apis",label:"APIs",count:V.length,icon:"apis"},{id:2,key:"logs",label:"Logs",count:O.length,icon:"logs"},{id:3,key:"analytics",label:"Analytics",count:q.length,icon:"analytics"},{id:4,key:"redux",label:"Redux",count:0,icon:"redux"},{id:5,key:"storage",label:"Storage",count:0,icon:"storage"},{id:6,key:"device",label:"Device",count:0,icon:"device"},{id:7,key:"crash",label:"Crash",count:P?.length||0,icon:"crash"},{id:8,key:"bundle",label:"Bundle",count:0,icon:"bundle"},{id:9,key:"performance",label:"Performance",count:0,icon:"performance"},{id:10,key:"debugging",label:"Debugging",count:0,icon:"debugging"}].filter(e=>e.key==="debugging"?te.OS==="android"&&We()&&!!x?.debugging:!(!x?.[e.key]||e.key==="redux"&&!X||e.key==="analytics"&&!Y)).map(e=>{const w=R===e.key,t=w?o.white:e.key==="crash"&&e.count>0?o.errorColor:o.grayText,A=e.count>9?"9+":String(e.count),T=R!=="apis"&&V.length>J,v=R!=="logs"&&O.length>K,I=R!=="crash"&&(P?.length||0)>(N||0);return<G key={e.key}onPress={()=>{B(e.key)}}style={[k.contentTabButton,w&&k.contentTabButtonActive]}>
|
|
12
12
|
<C style={{flexDirection:"row",alignItems:"center",gap:6}}>
|
|
13
|
-
{e.icon==="apis"&&<
|
|
14
|
-
{e.icon==="logs"&&<
|
|
15
|
-
{e.icon==="analytics"&&<
|
|
13
|
+
{e.icon==="apis"&&<Se color={t}size={14}/>}
|
|
14
|
+
{e.icon==="logs"&&<Re color={t}size={14}/>}
|
|
15
|
+
{e.icon==="analytics"&&<Te color={t}size={14}/>}
|
|
16
16
|
{e.icon==="redux"&&<Le color={t}size={14}/>}
|
|
17
|
-
{e.icon==="storage"&&<
|
|
18
|
-
{e.icon==="device"&&<
|
|
19
|
-
{e.icon==="crash"&&<
|
|
20
|
-
{e.icon==="bundle"&&<
|
|
17
|
+
{e.icon==="storage"&&<Oe color={t}size={14}/>}
|
|
18
|
+
{e.icon==="device"&&<Ve color={t}size={14}/>}
|
|
19
|
+
{e.icon==="crash"&&<Be color={t}size={14}/>}
|
|
20
|
+
{e.icon==="bundle"&&<Ie color={t}size={14}/>}
|
|
21
21
|
{e.icon==="performance"&&<Ae color={t}size={14}/>}
|
|
22
|
-
{e.icon==="debugging"&&<
|
|
22
|
+
{e.icon==="debugging"&&<Pe color={t}size={14}/>}
|
|
23
23
|
<C style={{minWidth:20,height:20,paddingHorizontal:4,borderRadius:10,backgroundColor:w?`${o.white}33`:`${o.purple}1F`,borderWidth:1,borderColor:w?`${o.white}66`:`${o.purple}40`,alignItems:"center",justifyContent:"center"}}>
|
|
24
24
|
<F style={{fontFamily:ke.interBold,fontSize:9.5,lineHeight:12,color:w?o.white:o.purple}}>
|
|
25
25
|
#{e.id}
|
|
@@ -28,25 +28,25 @@ import oe,{useRef as W,useState as $}from"react";import{Platform as te,ScrollVie
|
|
|
28
28
|
<F numberOfLines={1}ellipsizeMode="tail"style={[k.contentTabButtonText,w&&k.contentTabButtonTextActive]}>
|
|
29
29
|
{e.label} {e.count>0?`(${A})`:""}
|
|
30
30
|
</F>
|
|
31
|
-
{(e.key==="apis"&&
|
|
31
|
+
{(e.key==="apis"&&T||e.key==="logs"&&v||e.key==="crash"&&I)&&<C style={{width:6,height:6,borderRadius:3,backgroundColor:o.errorColor,marginLeft:4,alignSelf:"center"}}/>}
|
|
32
32
|
</C>
|
|
33
33
|
</G>})}
|
|
34
34
|
</Ce>
|
|
35
35
|
|
|
36
36
|
|
|
37
|
-
{
|
|
38
|
-
<C style={{width:22,height:22,borderRadius:11,backgroundColor:
|
|
37
|
+
{M&&<U onPress={()=>W(160)}hitSlop={{top:6,bottom:6,left:6,right:6}}activeOpacity={.7}style={{paddingLeft:2,paddingRight:z?4:8,justifyContent:"center",alignItems:"center"}}>
|
|
38
|
+
<C style={{width:22,height:22,borderRadius:11,backgroundColor:o.grayBorderSecondary,alignItems:"center",justifyContent:"center"}}>
|
|
39
39
|
<Q direction="right"size={13}color={o.purple}/>
|
|
40
40
|
</C>
|
|
41
41
|
</U>}
|
|
42
42
|
|
|
43
43
|
|
|
44
|
-
{z&&<C style={{paddingLeft:6,paddingRight:10,borderLeftWidth:1,borderLeftColor:
|
|
45
|
-
<G key="media"onPress={()=>{
|
|
44
|
+
{z&&<C style={{paddingLeft:6,paddingRight:10,borderLeftWidth:1,borderLeftColor:o.dividerColor,backgroundColor:o.primaryLight,justifyContent:"center",shadowColor:o.shadowColorString,shadowOffset:{width:-3,height:0},shadowOpacity:.12,shadowRadius:4,elevation:4,zIndex:10}}>
|
|
45
|
+
<G key="media"onPress={()=>{B("media")}}accessibilityRole="button"accessibilityLabel="Media Gallery"style={[k.contentTabButton,{marginRight:0,borderRadius:8,backgroundColor:S?o.purple:o.graySurface,borderColor:S?o.purple:o.dividerColor,borderWidth:1,paddingHorizontal:10,paddingVertical:7,alignItems:"center",justifyContent:"center"},S&&k.contentTabButtonActive]}>
|
|
46
46
|
<C style={{position:"relative",alignItems:"center",justifyContent:"center"}}>
|
|
47
|
-
<
|
|
48
|
-
{
|
|
47
|
+
<De color={S?o.white:o.grayText}size={15}/>
|
|
48
|
+
{j>0&&<C style={{position:"absolute",top:-3,right:-4,width:7,height:7,borderRadius:3.5,backgroundColor:S?o.emerald400:o.purple,borderWidth:1.2,borderColor:S?o.purple:o.white}}/>}
|
|
49
49
|
</C>
|
|
50
50
|
</G>
|
|
51
51
|
</C>}
|
|
52
|
-
</C>});export default
|
|
52
|
+
</C>});export default $e;
|
|
@@ -1,94 +1,93 @@
|
|
|
1
|
-
import{useState as
|
|
2
|
-
<
|
|
3
|
-
<
|
|
4
|
-
</
|
|
5
|
-
<
|
|
6
|
-
</
|
|
7
|
-
<
|
|
8
|
-
<
|
|
9
|
-
<
|
|
10
|
-
</
|
|
11
|
-
<
|
|
12
|
-
</
|
|
13
|
-
<
|
|
14
|
-
</
|
|
15
|
-
<
|
|
16
|
-
</
|
|
17
|
-
<C style={
|
|
18
|
-
<
|
|
1
|
+
import{useState as M,useEffect as F}from"react";import{Modal as G,View as C,Text as S,TouchableOpacity as O,StyleSheet as Y,Animated as T,Linking as J}from"react-native";import B,{Path as L}from"react-native-svg";import{BrandSquareIcon as K}from"../BrandSquareIcon";import{NpmIcon as Q}from"../NetworkIcons";import{LIB_VERSION as X}from"../../constants";import{copyToClipboard as Z}from"../../helpers";import{showToast as $}from"../../helpers/toast";import{AppFonts as P}from"../../styles/AppFonts";import{AppColors as e}from"../../styles/AppColors";const Ce=({size:o=14,color:r=e.grayTextWeak})=><B width={o}height={o}viewBox="0 0 24 24"fill="none">
|
|
2
|
+
<L 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={r}strokeWidth="2"strokeLinecap="round"strokeLinejoin="round"/>
|
|
3
|
+
<L 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={r}strokeWidth="2"strokeLinecap="round"strokeLinejoin="round"/>
|
|
4
|
+
</B>,N=({size:o=14,color:r=e.emerald500})=><B width={o}height={o}viewBox="0 0 24 24"fill="none">
|
|
5
|
+
<L d="M20 6L9 17l-5-5"stroke={r}strokeWidth="2.4"strokeLinecap="round"strokeLinejoin="round"/>
|
|
6
|
+
</B>,Se=({size:o=13,color:r=e.white})=><B width={o}height={o}viewBox="0 0 24 24"fill="none">
|
|
7
|
+
<L d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"stroke={r}strokeWidth="2"strokeLinecap="round"strokeLinejoin="round"/>
|
|
8
|
+
<L d="M15 3h6v6"stroke={r}strokeWidth="2"strokeLinecap="round"strokeLinejoin="round"/>
|
|
9
|
+
<L d="M10 14L21 3"stroke={r}strokeWidth="2"strokeLinecap="round"strokeLinejoin="round"/>
|
|
10
|
+
</B>,Te=({size:o=13,color:r=e.grayTextWeak})=><B width={o}height={o}viewBox="0 0 24 24"fill="none">
|
|
11
|
+
<L d="M18 6L6 18M6 6l12 12"stroke={r}strokeWidth="2.2"strokeLinecap="round"strokeLinejoin="round"/>
|
|
12
|
+
</B>,Le=({size:o=14,color:r=e.amber500})=><B width={o}height={o}viewBox="0 0 24 24"fill="none">
|
|
13
|
+
<L d="M12 2l2.4 6.6L21 11l-6.6 2.4L12 20l-2.4-6.6L3 11l6.6-2.4L12 2z"fill={r}/>
|
|
14
|
+
</B>,Ve=({size:o=14,color:r=e.slate400})=><B width={o}height={o}viewBox="0 0 24 24"fill="none">
|
|
15
|
+
<L d="M5 12h14M12 5l7 7-7 7"stroke={r}strokeWidth="2.2"strokeLinecap="round"strokeLinejoin="round"/>
|
|
16
|
+
</B>;export const UpdateAvailableModal=({visible:o,latestVersion:r,onClose:_})=>{const[A,D]=M(!1),W=M(new T.Value(0))[0],R=M(new T.Value(.92))[0],H="npm install react-native-inapp-inspector@latest";if(typeof __DEV__>"u"||!__DEV__)return null;F(()=>{o&&(D(!1),T.parallel([T.timing(W,{toValue:1,duration:220,useNativeDriver:!0}),T.spring(R,{toValue:1,friction:8,tension:50,useNativeDriver:!0})]).start())},[o,W,R]);const I=()=>{T.parallel([T.timing(W,{toValue:0,duration:160,useNativeDriver:!0}),T.timing(R,{toValue:.92,duration:160,useNativeDriver:!0})]).start(()=>{_()})},E=()=>{Z(H,"Install Command"),D(!0),$("Copied npm install command to clipboard!"),setTimeout(()=>{D(!1)},2500)},U=()=>{J.openURL("https://www.npmjs.com/package/react-native-inapp-inspector").catch(()=>{}),I()};return o?<G transparent visible={o}animationType="none"statusBarTranslucent onRequestClose={I}>
|
|
17
|
+
<C style={t.overlay}>
|
|
18
|
+
<T.View style={[t.card,{opacity:W,transform:[{scale:R}]}]}>
|
|
19
19
|
|
|
20
|
-
<
|
|
21
|
-
|
|
22
|
-
</
|
|
20
|
+
<O style={t.topCloseButton}onPress={I}hitSlop={10}activeOpacity={.7}>
|
|
21
|
+
<Te size={13}color={e.grayTextWeak}/>
|
|
22
|
+
</O>
|
|
23
23
|
|
|
24
24
|
|
|
25
|
-
<C style={
|
|
26
|
-
<C style={
|
|
27
|
-
<
|
|
28
|
-
<C style={
|
|
29
|
-
<
|
|
25
|
+
<C style={t.headerSection}>
|
|
26
|
+
<C style={t.iconHaloRing}>
|
|
27
|
+
<K size={38}/>
|
|
28
|
+
<C style={t.sparkleBadge}>
|
|
29
|
+
<Le size={13}color={e.amber500}/>
|
|
30
30
|
</C>
|
|
31
31
|
</C>
|
|
32
|
-
|
|
33
|
-
<
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
</F>
|
|
32
|
+
<S style={t.title}>Update Available</S>
|
|
33
|
+
<S style={t.subtitle}>
|
|
34
|
+
A new version of react-native-inapp-inspector is ready to install
|
|
35
|
+
</S>
|
|
37
36
|
</C>
|
|
38
37
|
|
|
39
38
|
|
|
40
|
-
<C style={
|
|
41
|
-
<C style={
|
|
42
|
-
<
|
|
43
|
-
<C style={
|
|
44
|
-
<
|
|
39
|
+
<C style={t.versionComparisonCard}>
|
|
40
|
+
<C style={t.versionColumn}>
|
|
41
|
+
<S style={t.versionLabel}>INSTALLED</S>
|
|
42
|
+
<C style={t.installedChip}>
|
|
43
|
+
<S style={t.installedText}>v{X}</S>
|
|
45
44
|
</C>
|
|
46
45
|
</C>
|
|
47
46
|
|
|
48
|
-
<C style={
|
|
49
|
-
<
|
|
47
|
+
<C style={t.arrowContainer}>
|
|
48
|
+
<Ve size={14}color={e.slate400}/>
|
|
50
49
|
</C>
|
|
51
50
|
|
|
52
|
-
<C style={
|
|
53
|
-
<
|
|
54
|
-
<C style={
|
|
55
|
-
<
|
|
56
|
-
<
|
|
51
|
+
<C style={t.versionColumn}>
|
|
52
|
+
<S style={t.versionLabel}>LATEST</S>
|
|
53
|
+
<C style={t.latestChip}>
|
|
54
|
+
<Q size={12}color={e.npmRed}/>
|
|
55
|
+
<S style={t.latestText}>v{r}</S>
|
|
57
56
|
</C>
|
|
58
57
|
</C>
|
|
59
58
|
</C>
|
|
60
59
|
|
|
61
60
|
|
|
62
|
-
<C style={
|
|
63
|
-
<C style={
|
|
64
|
-
<
|
|
65
|
-
{
|
|
66
|
-
<
|
|
67
|
-
<
|
|
61
|
+
<C style={t.codeSnippetBox}>
|
|
62
|
+
<C style={t.codeSnippetHeader}>
|
|
63
|
+
<S style={t.codeSnippetLabel}>UPGRADE COMMAND</S>
|
|
64
|
+
{A&&<C style={t.copiedIndicator}>
|
|
65
|
+
<N size={11}color={e.emerald500}/>
|
|
66
|
+
<S style={t.copiedText}>Copied</S>
|
|
68
67
|
</C>}
|
|
69
68
|
</C>
|
|
70
69
|
|
|
71
|
-
<
|
|
72
|
-
<
|
|
73
|
-
{
|
|
74
|
-
</
|
|
75
|
-
<C style={
|
|
76
|
-
{
|
|
70
|
+
<O activeOpacity={.75}onPress={E}style={t.commandRow}>
|
|
71
|
+
<S style={t.commandText}numberOfLines={1}>
|
|
72
|
+
{H}
|
|
73
|
+
</S>
|
|
74
|
+
<C style={t.copyIconWrapper}>
|
|
75
|
+
{A?<N size={14}color={e.emerald500}/>:<Ce size={14}color={e.grayTextWeak}/>}
|
|
77
76
|
</C>
|
|
78
|
-
</
|
|
77
|
+
</O>
|
|
79
78
|
</C>
|
|
80
79
|
|
|
81
80
|
|
|
82
|
-
<C style={
|
|
83
|
-
<
|
|
84
|
-
<
|
|
85
|
-
</
|
|
81
|
+
<C style={t.buttonRow}>
|
|
82
|
+
<O activeOpacity={.7}onPress={I}style={t.secondaryButton}>
|
|
83
|
+
<S style={t.secondaryButtonText}>Later</S>
|
|
84
|
+
</O>
|
|
86
85
|
|
|
87
|
-
<
|
|
88
|
-
<
|
|
89
|
-
<
|
|
90
|
-
</
|
|
86
|
+
<O activeOpacity={.8}onPress={U}style={t.primaryButton}>
|
|
87
|
+
<S style={t.primaryButtonText}>View on NPM</S>
|
|
88
|
+
<Se size={12}color={e.white}/>
|
|
89
|
+
</O>
|
|
91
90
|
</C>
|
|
92
|
-
</
|
|
91
|
+
</T.View>
|
|
93
92
|
</C>
|
|
94
|
-
</
|
|
93
|
+
</G>:null};const V={fontFamily:P.interRegular},t=Y.create({overlay:{flex:1,backgroundColor:e.overlayDark,justifyContent:"center",alignItems:"center",paddingHorizontal:20,zIndex:999999},card:{width:"100%",maxWidth:360,backgroundColor:e.primaryLight,borderRadius:24,borderWidth:1,borderColor:e.dividerColor,paddingHorizontal:20,paddingTop:22,paddingBottom:20,alignItems:"center",shadowColor:e.shadowColorString,shadowOffset:{width:0,height:18},shadowOpacity:.24,shadowRadius:36,elevation:24},topCloseButton:{position:"absolute",top:14,right:14,width:28,height:28,borderRadius:14,backgroundColor:e.grayBackground,justifyContent:"center",alignItems:"center",borderWidth:1,borderColor:e.dividerColor,zIndex:10},headerSection:{alignItems:"center",width:"100%",marginBottom:12},iconHaloRing:{width:66,height:66,borderRadius:20,backgroundColor:e.purple50,justifyContent:"center",alignItems:"center",borderWidth:1.5,borderColor:e.purple100,marginBottom:8,shadowColor:e.offerPurple,shadowOffset:{width:0,height:4},shadowOpacity:.16,shadowRadius:10,elevation:4},sparkleBadge:{position:"absolute",top:-4,right:-4,width:22,height:22,borderRadius:11,backgroundColor:e.paleYellow,justifyContent:"center",alignItems:"center",borderWidth:1.5,borderColor:e.white},title:{fontSize:17.5,fontWeight:"800",color:e.primaryBlack,letterSpacing:-.4,textAlign:"center",lineHeight:22,marginBottom:2,...V},subtitle:{fontSize:12,fontWeight:"500",color:e.grayTextWeak,textAlign:"center",lineHeight:16,paddingHorizontal:8,...V},versionComparisonCard:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",backgroundColor:e.grayBackground,borderRadius:14,borderWidth:1,borderColor:e.dividerColor,paddingVertical:10,paddingHorizontal:14,marginBottom:12,width:"100%"},versionColumn:{alignItems:"center",gap:4},versionLabel:{fontSize:9.5,fontWeight:"700",color:e.slate400,letterSpacing:.6,...V},installedChip:{backgroundColor:e.grayBorderSecondary,paddingHorizontal:8,paddingVertical:3,borderRadius:6},installedText:{fontSize:12,fontWeight:"700",color:e.grayText,...V},arrowContainer:{paddingHorizontal:6},arrowText:{fontSize:14,color:e.slate400,fontWeight:"700"},latestChip:{flexDirection:"row",alignItems:"center",gap:4,backgroundColor:e.violetSoftBg,paddingHorizontal:8,paddingVertical:3,borderRadius:6,borderWidth:1,borderColor:e.violetSoftBorder},latestText:{fontSize:12,fontWeight:"800",color:e.offerPurple,...V},codeSnippetBox:{backgroundColor:e.slate900,borderRadius:12,padding:10,width:"100%",marginBottom:14,borderWidth:1,borderColor:e.slate800},codeSnippetHeader:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",marginBottom:6},codeSnippetLabel:{fontSize:9.5,fontWeight:"700",color:e.grayTextWeak,letterSpacing:.6,...V},copiedIndicator:{flexDirection:"row",alignItems:"center",gap:3},copiedText:{fontSize:9.5,fontWeight:"600",color:e.emerald500,...V},commandRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",backgroundColor:e.slate800,borderRadius:8,paddingVertical:7,paddingHorizontal:9,gap:8},commandText:{flex:1,fontSize:11,fontFamily:P.interRegular,color:e.sky400},copyIconWrapper:{width:22,height:22,borderRadius:6,backgroundColor:e.slate700,justifyContent:"center",alignItems:"center"},buttonRow:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",gap:10,width:"100%"},secondaryButton:{flex:1,alignItems:"center",justifyContent:"center",paddingVertical:11,borderRadius:12,backgroundColor:e.graySurface,borderWidth:1,borderColor:e.dividerColor},secondaryButtonText:{fontSize:13,fontWeight:"600",color:e.grayText,...V},primaryButton:{flex:1.3,flexDirection:"row",alignItems:"center",justifyContent:"center",gap:6,paddingVertical:11,borderRadius:12,backgroundColor:e.offerPurple,shadowColor:e.offerPurple,shadowOffset:{width:0,height:3},shadowOpacity:.28,shadowRadius:6,elevation:4},primaryButtonText:{fontSize:13,fontWeight:"700",color:e.white,...V}});export default UpdateAvailableModal;
|
|
@@ -1,112 +1,112 @@
|
|
|
1
|
-
import oe,{useEffect as te,useRef as le,useMemo as
|
|
1
|
+
import oe,{useEffect as te,useRef as le,useMemo as j}from"react";import{Alert as ae,Animated as W,Linking as D,View as C,Pressable as A,Text as T,StyleSheet as U}from"react-native";import Ce,{Path as Te}from"react-native-svg";import{AppColors as e}from"../styles/AppColors";import{METHOD_COLORS as E}from"../constants";import{getStatusColor as Be,getDurationColor as Se,formatDateTime as Re,getSize as ze,getPath as Ve,getBaseUrl as He}from"../helpers";import{CalendarIcon as Le,ClockIcon as N,SizeIcon as $e,CircleCheckIcon as Ie,CircleAlertIcon as We,CircleXIcon as De,RepeatIcon as Fe,PinIcon as Oe}from"./NetworkIcons";import{AppFonts as B}from"../styles/AppFonts";import Pe from"./HighlightText";import Me from"./TouchableScale";import{useTranslation as je}from"../i18n";const Ae=oe.memo(function({item:r,onPress:_,timelineMinStart:Ee,timelineTotalRange:qe,isNew:$,isSelected:F,onToggleSelect:G,searchStr:J}){const{t:H}=je(),O=E[r.method]??E.ALL,S=j(()=>{try{const t=new URL(r.url),V=t.host,M=t.pathname+(t.search?t.search:""),re=t.protocol==="https:";return{host:V,path:M||"/",isHttps:re}}catch{const t=r.url.toLowerCase().startsWith("https:"),V=Ve(r.url);return{host:He(r.url).replace(/^https?:\/\//,""),path:V||r.url,isHttps:t}}},[r.url]),P=j(()=>{if(!r.caller||r.caller==="Unknown")return null;const t=r.caller.split(/[\/\\]/);return(t[t.length-1]||r.caller).replace(/\?.*$/,"").replace(/^[a-zA-Z0-9_$]+@/,"")},[r.caller]),K=t=>{t?.stopPropagation?.(),ae.alert(H("common.openInBrowser")||"Open in Browser",`${H("common.openInBrowserPrompt")||"Are you sure you want to open this URL in your external browser?"}
|
|
2
2
|
|
|
3
|
-
${
|
|
4
|
-
<
|
|
3
|
+
${r.url}`,[{text:H("common.cancel")||"Cancel",style:"cancel"},{text:H("common.open")||"Open",onPress:()=>{D.canOpenURL(r.url).then(V=>{V?D.openURL(r.url):D.openURL(r.url).catch(()=>{})}).catch(()=>{})}}])},R=r.status===0||r.status!=null&&r.status>=400,z=r.status==null,I=Be(r.status),L=Se(r.duration),Q=z?e.darkOrange:R?e.errorColor:e.greenColor,v=le(new W.Value($?.35:0)).current;te(()=>{$&&W.timing(v,{toValue:0,duration:1200,useNativeDriver:!1}).start()},[$]);const X=()=>{if(z)return"...";if(r.status===0||r.status==null)return H("network.statusFailed")||"FAILED";const t=typeof r.status=="number"?r.status:parseInt(String(r.status||0),10);return t===200?"200 OK":t===201?"201 Created":t===204?"204 No Content":t===304?"304 Not Modified":t===400?"400 Bad Req":t===401?"401 Unauth":t===403?"403 Forbidden":t===404?"404 Not Found":t===500?"500 Error":String(r.status)},Z=()=>{if(z)return<N color={e.darkOrange}size={10}/>;const t=typeof r.status=="number"?r.status:parseInt(String(r.status||0),10);return t>=200&&t<300?<Ie color={e.greenColor}size={10}/>:t>=300&&t<400?<Fe color={e.amber700}size={10}/>:t>=400&&t<500?<We color={e.darkOrange}size={10}/>:<De color={e.errorColor}size={10}/>},Y=Re(r.startTime),ee=r.url.split("?")[0].toLowerCase().endsWith(".json");return<C style={o.container}>
|
|
4
|
+
<Me onPress={_}style={[o.card,{borderLeftWidth:3.5,borderLeftColor:Q,backgroundColor:R?e.errorCardBg:e.white}]}>
|
|
5
5
|
<C style={o.cardBody}>
|
|
6
6
|
|
|
7
7
|
<C style={o.cardHeaderRow}>
|
|
8
8
|
<C style={o.cardHeaderLeft}>
|
|
9
|
-
<
|
|
10
|
-
{
|
|
11
|
-
<Te d="M20 6L9 17l-5-5"stroke={
|
|
9
|
+
<A onPress={()=>G(r.id)}hitSlop={12}style={[o.smallCheckbox,F&&o.smallCheckboxChecked]}>
|
|
10
|
+
{F&&<Ce width={9}height={9}viewBox="0 0 24 24"fill="none">
|
|
11
|
+
<Te d="M20 6L9 17l-5-5"stroke={e.white}strokeWidth="4"strokeLinecap="round"strokeLinejoin="round"/>
|
|
12
12
|
</Ce>}
|
|
13
|
-
</
|
|
13
|
+
</A>
|
|
14
14
|
|
|
15
|
-
<T style={o.serialNumber}>#{
|
|
15
|
+
<T style={o.serialNumber}>#{r.id+1}</T>
|
|
16
16
|
|
|
17
|
-
<C style={[o.methodBadge,{backgroundColor:
|
|
17
|
+
<C style={[o.methodBadge,{backgroundColor:O}]}>
|
|
18
18
|
<T style={o.methodBadgeText}>
|
|
19
|
-
{
|
|
19
|
+
{r.method}
|
|
20
20
|
</T>
|
|
21
21
|
</C>
|
|
22
22
|
|
|
23
|
-
{
|
|
24
|
-
<T style={[o.chipText,{color:
|
|
25
|
-
{
|
|
23
|
+
{r.client&&<C style={[o.chip,{backgroundColor:r.client==="axios"?`${e.purple}14`:r.client==="apollo"||r.client==="graphql"?`${e.pink500}14`:r.client==="xhr"?`${e.amber500}14`:`${e.sky500}14`,borderColor:r.client==="axios"?`${e.purple}30`:r.client==="apollo"||r.client==="graphql"?`${e.pink500}30`:r.client==="xhr"?`${e.amber500}30`:`${e.sky500}30`}]}>
|
|
24
|
+
<T style={[o.chipText,{color:r.client==="axios"?e.purple:r.client==="apollo"||r.client==="graphql"?e.pink500:r.client==="xhr"?e.amber700:e.sky600}]}>
|
|
25
|
+
{r.client.toUpperCase()}
|
|
26
26
|
</T>
|
|
27
27
|
</C>}
|
|
28
28
|
|
|
29
29
|
|
|
30
|
-
{(
|
|
31
|
-
<T style={[o.chipText,{color:
|
|
30
|
+
{(r.url.toLowerCase().includes("graphql")||r.client==="apollo"||r.client==="graphql")&&<C style={[o.chip,{backgroundColor:e.roseBg,borderColor:e.roseBorder}]}>
|
|
31
|
+
<T style={[o.chipText,{color:e.pink600}]}>
|
|
32
32
|
GQL
|
|
33
33
|
</T>
|
|
34
34
|
</C>}
|
|
35
35
|
</C>
|
|
36
36
|
|
|
37
|
-
<C style={[o.statusPill,{backgroundColor:
|
|
37
|
+
<C style={[o.statusPill,{backgroundColor:R?`${e.errorColor}14`:z?`${e.darkOrange}14`:`${I}14`,borderColor:R?`${e.errorColor}33`:z?`${e.darkOrange}33`:`${I}33`}]}>
|
|
38
38
|
{Z()}
|
|
39
|
-
<T style={[o.statusPillText,{color:
|
|
39
|
+
<T style={[o.statusPillText,{color:R?e.errorColor:z?e.darkOrange:I}]}>
|
|
40
40
|
{X()}
|
|
41
41
|
</T>
|
|
42
42
|
</C>
|
|
43
43
|
</C>
|
|
44
44
|
|
|
45
45
|
|
|
46
|
-
<
|
|
46
|
+
<A onPress={K}hitSlop={6}style={o.urlBox}>
|
|
47
47
|
<C style={o.urlMainRow}>
|
|
48
|
-
<
|
|
48
|
+
<Pe text={S.path}search={J}style={o.pathText}highlightStyle={o.highlight}numberOfLines={2}ellipsizeMode="middle"/>
|
|
49
49
|
<C style={o.urlBadgeRow}>
|
|
50
50
|
{ee&&<C style={o.jsonBadge}>
|
|
51
51
|
<T style={o.jsonBadgeText}>.json</T>
|
|
52
52
|
</C>}
|
|
53
|
-
{
|
|
54
|
-
<T style={o.dupBadgeText}>×{
|
|
53
|
+
{r.duplicateCount!=null&&r.duplicateCount>1&&<C style={o.dupBadge}>
|
|
54
|
+
<T style={o.dupBadgeText}>×{r.duplicateCount}</T>
|
|
55
55
|
</C>}
|
|
56
56
|
</C>
|
|
57
57
|
</C>
|
|
58
58
|
|
|
59
|
-
{
|
|
60
|
-
<C style={[o.protoBadge,{backgroundColor:
|
|
61
|
-
<T style={[o.protoBadgeText,{color:
|
|
62
|
-
{
|
|
59
|
+
{S.host?<C style={o.hostRow}>
|
|
60
|
+
<C style={[o.protoBadge,{backgroundColor:S.isHttps?`${e.emerald600}12`:`${e.amber600}12`,borderColor:S.isHttps?`${e.emerald600}2B`:`${e.amber600}2B`}]}>
|
|
61
|
+
<T style={[o.protoBadgeText,{color:S.isHttps?e.emerald600:e.amber700}]}>
|
|
62
|
+
{S.isHttps?"HTTPS":"HTTP"}
|
|
63
63
|
</T>
|
|
64
64
|
</C>
|
|
65
65
|
<T style={o.hostText}numberOfLines={1}ellipsizeMode="tail">
|
|
66
|
-
{
|
|
66
|
+
{S.host}
|
|
67
67
|
</T>
|
|
68
68
|
</C>:null}
|
|
69
|
-
</
|
|
69
|
+
</A>
|
|
70
70
|
|
|
71
71
|
|
|
72
72
|
<C style={o.cardFooterRow}>
|
|
73
73
|
<C style={o.footerLeft}>
|
|
74
74
|
<C style={o.cardDateRow}>
|
|
75
|
-
<
|
|
75
|
+
<Le color={e.grayTextWeak}size={10}/>
|
|
76
76
|
<T style={o.cardDateText}>{Y}</T>
|
|
77
77
|
</C>
|
|
78
78
|
|
|
79
|
-
{
|
|
80
|
-
<
|
|
79
|
+
{P&&<C style={o.callerChip}>
|
|
80
|
+
<Oe color={e.sky600}size={8.5}/>
|
|
81
81
|
<T style={o.callerChipText}numberOfLines={1}ellipsizeMode="middle">
|
|
82
|
-
{
|
|
82
|
+
{P}
|
|
83
83
|
</T>
|
|
84
84
|
</C>}
|
|
85
85
|
</C>
|
|
86
86
|
|
|
87
87
|
<C style={o.footerRight}>
|
|
88
|
-
{
|
|
89
|
-
|
|
88
|
+
{r.response!=null&&<C style={o.metaStatChip}>
|
|
89
|
+
<$e color={e.purple}size={9}/>
|
|
90
90
|
<T style={o.metaStatText}>
|
|
91
|
-
{
|
|
91
|
+
{ze(r.response)}
|
|
92
92
|
</T>
|
|
93
93
|
</C>}
|
|
94
94
|
|
|
95
|
-
{
|
|
96
|
-
<N color={
|
|
97
|
-
<T style={[o.metaStatText,{color:
|
|
98
|
-
{
|
|
95
|
+
{r.duration!=null&&!R&&<C style={[o.metaStatChip,{backgroundColor:`${L}12`,borderColor:`${L}2E`}]}>
|
|
96
|
+
<N color={L}size={9}/>
|
|
97
|
+
<T style={[o.metaStatText,{color:L}]}>
|
|
98
|
+
{r.duration}ms
|
|
99
99
|
</T>
|
|
100
100
|
</C>}
|
|
101
101
|
</C>
|
|
102
102
|
</C>
|
|
103
103
|
|
|
104
104
|
|
|
105
|
-
{typeof
|
|
106
|
-
<C style={[o.waterfallBar,{width:`${Math.min(100,Math.max(6,
|
|
105
|
+
{typeof r.duration=="number"&&r.duration>0&&!R&&<C style={o.waterfallContainer}>
|
|
106
|
+
<C style={[o.waterfallBar,{width:`${Math.min(100,Math.max(6,r.duration/1200*100))}%`,backgroundColor:L}]}/>
|
|
107
107
|
</C>}
|
|
108
108
|
</C>
|
|
109
109
|
|
|
110
|
-
{
|
|
111
|
-
</
|
|
112
|
-
</C>}),o=
|
|
110
|
+
{$&&<W.View pointerEvents="none"style={[U.absoluteFill,{backgroundColor:O,opacity:v}]}/>}
|
|
111
|
+
</Me>
|
|
112
|
+
</C>}),o=U.create({container:{paddingHorizontal:8,paddingVertical:3},card:{alignSelf:"stretch",borderRadius:10,overflow:"hidden",borderWidth:1,borderColor:e.dividerColor,shadowColor:e.shadowColorString},cardBody:{paddingHorizontal:11,paddingTop:8,paddingBottom:7},cardHeaderRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",marginBottom:5,minHeight:20},cardHeaderLeft:{flexDirection:"row",alignItems:"center",flex:1,marginRight:6,gap:5,minWidth:0,flexWrap:"wrap"},smallCheckbox:{width:14,height:14,borderRadius:3.5,borderWidth:1.5,borderColor:e.grayTextWeak,alignItems:"center",justifyContent:"center",backgroundColor:e.white},smallCheckboxChecked:{backgroundColor:e.purple,borderColor:e.purple},serialNumber:{fontFamily:B.interBold,color:e.grayTextWeak,fontSize:9.5},methodBadge:{paddingHorizontal:6,paddingVertical:2,borderRadius:5,alignItems:"center",justifyContent:"center"},methodBadgeText:{fontFamily:B.interBold,fontSize:9,lineHeight:11,letterSpacing:.5,color:e.white},chip:{paddingHorizontal:5,paddingVertical:1.5,borderRadius:4,borderWidth:1},chipText:{fontFamily:B.interBold,fontSize:8.5,lineHeight:11},statusPill:{flexDirection:"row",alignItems:"center",gap:3.5,paddingHorizontal:6.5,paddingVertical:2,borderRadius:6,borderWidth:1,flexShrink:0},statusPillText:{fontFamily:B.interBold,fontSize:9.5,lineHeight:12},urlBox:{backgroundColor:e.grayBackground,borderRadius:7,borderWidth:1,borderColor:e.dividerColor,paddingHorizontal:8,paddingVertical:5,marginVertical:3,gap:3},urlMainRow:{flexDirection:"row",alignItems:"flex-start",justifyContent:"space-between",gap:6},pathText:{fontFamily:B.interBold,fontSize:12,lineHeight:16,color:e.primaryBlack,flex:1},urlBadgeRow:{flexDirection:"row",alignItems:"center",gap:4,flexShrink:0},jsonBadge:{backgroundColor:`${e.darkOrange}14`,borderColor:`${e.darkOrange}2E`,borderWidth:1,paddingHorizontal:4,paddingVertical:1,borderRadius:3},jsonBadgeText:{fontFamily:B.interBold,fontSize:8.5,color:e.darkOrange},dupBadge:{backgroundColor:`${e.purple}14`,borderColor:`${e.purple}2E`,borderWidth:1,paddingHorizontal:4,paddingVertical:1,borderRadius:3},dupBadgeText:{fontFamily:B.interBold,fontSize:8.5,color:e.purple},hostRow:{flexDirection:"row",alignItems:"center",gap:4.5},protoBadge:{paddingHorizontal:4,paddingVertical:1,borderRadius:3,borderWidth:1},protoBadgeText:{fontFamily:B.interBold,fontSize:7.5,lineHeight:9},hostText:{fontFamily:B.interMedium,fontSize:10,lineHeight:13,color:e.grayTextWeak,flex:1},highlight:{backgroundColor:e.yellowHighlight,color:e.primaryBlack,borderRadius:2},cardFooterRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",marginTop:3,gap:6},footerLeft:{flexDirection:"row",alignItems:"center",gap:5,flex:1,minWidth:0},footerRight:{flexDirection:"row",alignItems:"center",gap:4,flexShrink:0},cardDateRow:{flexDirection:"row",alignItems:"center",gap:3},cardDateText:{fontFamily:B.interRegular,fontSize:9.5,lineHeight:12,color:e.slate400},callerChip:{flexDirection:"row",alignItems:"center",gap:2.5,backgroundColor:e.skySoftBg,borderColor:e.skySoftBorder,borderWidth:1,paddingHorizontal:4.5,paddingVertical:1,borderRadius:4,flexShrink:1,minWidth:0},callerChipText:{color:e.skySoftText,fontSize:8.5,lineHeight:11,fontFamily:B.interBold},metaStatChip:{flexDirection:"row",alignItems:"center",gap:2.5,backgroundColor:e.violetSoftBg,borderColor:e.violetSoftBorder,borderWidth:1,paddingHorizontal:5,paddingVertical:1.5,borderRadius:4},metaStatText:{fontFamily:B.interBold,color:e.violetSoftText,fontSize:9,lineHeight:11},waterfallContainer:{height:2,width:"100%",backgroundColor:e.graySurface,borderRadius:1,overflow:"hidden",marginTop:5},waterfallBar:{height:"100%",borderRadius:1}});export default Ae;
|
|
@@ -158,3 +158,13 @@ export declare const ScreencastIcon: ({ color, size, }: IconProps) => React.JSX.
|
|
|
158
158
|
export declare const ListIcon: ({ color, size }: IconProps) => React.JSX.Element;
|
|
159
159
|
export declare const GridIcon: ({ color, size }: IconProps) => React.JSX.Element;
|
|
160
160
|
export declare const MinimizeWindowIcon: ({ color, size }: IconProps) => React.JSX.Element;
|
|
161
|
+
export declare const BookOpenIcon: ({ color, size, }: IconProps) => React.JSX.Element;
|
|
162
|
+
export declare const WrenchIcon: ({ color, size, }: IconProps) => React.JSX.Element;
|
|
163
|
+
export declare const ChevronUpIcon: ({ color, size, }: IconProps) => React.JSX.Element;
|
|
164
|
+
export declare const MessageSquareIcon: ({ color, size, }: IconProps) => React.JSX.Element;
|
|
165
|
+
export declare const SparklesIcon: ({ color, size, }: IconProps) => React.JSX.Element;
|
|
166
|
+
export declare const AngryFaceIcon: ({ color, size, }: IconProps) => React.JSX.Element;
|
|
167
|
+
export declare const NeutralFaceIcon: ({ color, size, }: IconProps) => React.JSX.Element;
|
|
168
|
+
export declare const SmileFaceIcon: ({ color, size, }: IconProps) => React.JSX.Element;
|
|
169
|
+
export declare const StarFaceIcon: ({ color, size, }: IconProps) => React.JSX.Element;
|
|
170
|
+
export declare const HeartFaceIcon: ({ color, size, }: IconProps) => React.JSX.Element;
|