react-native-inapp-inspector 2.3.24 → 2.4.0
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 +26 -5
- package/dist/commonjs/components/AnalyticsDetail.js +15 -12
- package/dist/commonjs/components/AnalyticsEventCard.js +11 -8
- package/dist/commonjs/components/AppHeaderLogo.js +4 -6
- package/dist/commonjs/components/ConsoleLogCard.d.ts +1 -0
- package/dist/commonjs/components/ConsoleLogCard.js +92 -80
- package/dist/commonjs/components/EndOfListFooter.d.ts +5 -1
- package/dist/commonjs/components/EndOfListFooter.js +27 -5
- package/dist/commonjs/components/Inspector/AnalyticsFilterModal.js +1 -1
- package/dist/commonjs/components/Inspector/AnalyticsTab.js +27 -299
- package/dist/commonjs/components/Inspector/ConsoleTab.js +36 -94
- package/dist/commonjs/components/Inspector/CrashDetail.js +11 -10
- package/dist/commonjs/components/Inspector/CrashTab.js +43 -33
- package/dist/commonjs/components/Inspector/DebuggingTab.js +13 -13
- package/dist/commonjs/components/Inspector/DeviceInfoTab.js +107 -71
- package/dist/commonjs/components/Inspector/FabLauncher.js +8 -9
- package/dist/commonjs/components/Inspector/InspectorHeader.js +93 -70
- package/dist/commonjs/components/Inspector/LogDetail.js +10 -7
- package/dist/commonjs/components/Inspector/MainScreen.js +66 -30
- package/dist/commonjs/components/Inspector/MediaGalleryTab.js +1 -1
- package/dist/commonjs/components/Inspector/MediaPreviewModal.js +3 -3
- package/dist/commonjs/components/Inspector/NetworkDetail.js +29 -28
- package/dist/commonjs/components/Inspector/NetworkFilterModal.js +1 -1
- package/dist/commonjs/components/Inspector/NetworkTab.js +87 -85
- package/dist/commonjs/components/Inspector/NpmStarPrompt.js +3 -3
- package/dist/commonjs/components/Inspector/NpmUpdateToast.js +21 -22
- package/dist/commonjs/components/Inspector/PushCard.d.ts +4 -0
- package/dist/commonjs/components/Inspector/PushCard.js +89 -0
- package/dist/commonjs/components/Inspector/PushDetail.d.ts +4 -0
- package/dist/commonjs/components/Inspector/PushDetail.js +190 -0
- package/dist/commonjs/components/Inspector/PushTab.d.ts +3 -0
- package/dist/commonjs/components/Inspector/PushTab.js +45 -0
- package/dist/commonjs/components/Inspector/ReduxDetail.js +16 -13
- package/dist/commonjs/components/Inspector/ReduxTab.js +109 -106
- package/dist/commonjs/components/Inspector/SettingsPanel.js +230 -134
- package/dist/commonjs/components/Inspector/StorageTab.js +55 -51
- package/dist/commonjs/components/Inspector/TabBar.js +30 -26
- package/dist/commonjs/components/Inspector/UpdateAvailableModal.js +2 -2
- package/dist/commonjs/components/JsonViewer.js +151 -159
- package/dist/commonjs/components/LogCard.js +34 -38
- package/dist/commonjs/components/LogSyntaxHighlighter.js +3 -3
- package/dist/commonjs/components/ModuleErrorBoundary.d.ts +24 -0
- package/dist/commonjs/components/ModuleErrorBoundary.js +33 -0
- package/dist/commonjs/components/NetworkIcons.d.ts +3 -3
- package/dist/commonjs/components/NetworkIcons.js +10 -6
- package/dist/commonjs/components/SegmentedTabs.d.ts +8 -2
- package/dist/commonjs/components/SegmentedTabs.js +11 -7
- package/dist/commonjs/components/ShareButton.d.ts +11 -0
- package/dist/commonjs/components/ShareButton.js +6 -0
- package/dist/commonjs/constants/index.js +1 -1
- package/dist/commonjs/constants/version.d.ts +1 -1
- package/dist/commonjs/constants/version.js +1 -1
- package/dist/commonjs/customHooks/crashHandler.js +4 -4
- package/dist/commonjs/customHooks/networkLogger.js +1 -2
- package/dist/commonjs/customHooks/pushNotificationLogger.d.ts +19 -0
- package/dist/commonjs/customHooks/pushNotificationLogger.js +1 -0
- package/dist/commonjs/helpers/index.d.ts +6 -0
- package/dist/commonjs/helpers/index.js +4 -4
- package/dist/commonjs/helpers/memoryManager.d.ts +2 -2
- package/dist/commonjs/helpers/memoryManager.js +1 -1
- package/dist/commonjs/helpers/remoteConfig.js +1 -1
- package/dist/commonjs/helpers/settingsStore.d.ts +1 -0
- package/dist/commonjs/helpers/settingsStore.js +1 -1
- package/dist/commonjs/helpers/shareFormatter.d.ts +13 -0
- package/dist/commonjs/helpers/shareFormatter.js +7 -0
- package/dist/commonjs/i18n/index.d.ts +35 -0
- package/dist/commonjs/i18n/index.js +1 -1
- package/dist/commonjs/i18n/locales/ar.json +1 -0
- package/dist/commonjs/i18n/locales/de.json +1 -0
- package/dist/commonjs/i18n/locales/en.json +1 -1
- package/dist/commonjs/i18n/locales/es.json +1 -0
- package/dist/commonjs/i18n/locales/fr.json +1 -0
- package/dist/commonjs/i18n/locales/hi.json +1 -0
- package/dist/commonjs/i18n/locales/ja.json +1 -0
- package/dist/commonjs/i18n/locales/ko.json +1 -0
- package/dist/commonjs/i18n/locales/pt.json +1 -0
- package/dist/commonjs/i18n/locales/ru.json +1 -0
- package/dist/commonjs/i18n/locales/zh.json +1 -0
- package/dist/commonjs/index.d.ts +6 -5
- package/dist/commonjs/index.js +4 -4
- package/dist/commonjs/push.d.ts +4 -0
- package/dist/commonjs/push.js +1 -0
- package/dist/commonjs/styles/AppColors.d.ts +40 -0
- package/dist/commonjs/styles/AppColors.js +1 -1
- package/dist/commonjs/styles/index.js +1 -1
- package/dist/commonjs/types/enums.d.ts +30 -20
- package/dist/commonjs/types/enums.js +1 -1
- package/dist/commonjs/types/index.d.ts +10 -0
- package/dist/commonjs/types/interfaces.d.ts +63 -7
- package/dist/esm/components/AnalyticsDetail.js +84 -81
- package/dist/esm/components/AnalyticsEventCard.js +20 -17
- package/dist/esm/components/AppHeaderLogo.js +5 -7
- package/dist/esm/components/ConsoleLogCard.d.ts +1 -0
- package/dist/esm/components/ConsoleLogCard.js +98 -86
- package/dist/esm/components/EndOfListFooter.d.ts +5 -1
- package/dist/esm/components/EndOfListFooter.js +36 -14
- package/dist/esm/components/Inspector/AnalyticsFilterModal.js +14 -14
- package/dist/esm/components/Inspector/AnalyticsTab.js +44 -316
- package/dist/esm/components/Inspector/ConsoleTab.js +55 -113
- package/dist/esm/components/Inspector/CrashDetail.js +53 -52
- package/dist/esm/components/Inspector/CrashTab.js +74 -64
- package/dist/esm/components/Inspector/DebuggingTab.js +33 -33
- package/dist/esm/components/Inspector/DeviceInfoTab.js +174 -138
- package/dist/esm/components/Inspector/FabLauncher.js +41 -42
- package/dist/esm/components/Inspector/InspectorHeader.js +138 -115
- package/dist/esm/components/Inspector/LogDetail.js +24 -21
- package/dist/esm/components/Inspector/MainScreen.js +98 -62
- package/dist/esm/components/Inspector/MediaGalleryTab.js +1 -1
- package/dist/esm/components/Inspector/MediaPreviewModal.js +31 -31
- package/dist/esm/components/Inspector/NetworkDetail.js +88 -87
- package/dist/esm/components/Inspector/NetworkFilterModal.js +8 -8
- package/dist/esm/components/Inspector/NetworkTab.js +132 -130
- package/dist/esm/components/Inspector/NpmStarPrompt.js +42 -42
- package/dist/esm/components/Inspector/NpmUpdateToast.js +45 -46
- package/dist/esm/components/Inspector/PushCard.d.ts +4 -0
- package/dist/esm/components/Inspector/PushCard.js +89 -0
- package/dist/esm/components/Inspector/PushDetail.d.ts +4 -0
- package/dist/esm/components/Inspector/PushDetail.js +190 -0
- package/dist/esm/components/Inspector/PushTab.d.ts +3 -0
- package/dist/esm/components/Inspector/PushTab.js +45 -0
- package/dist/esm/components/Inspector/ReduxDetail.js +40 -37
- package/dist/esm/components/Inspector/ReduxTab.js +155 -152
- package/dist/esm/components/Inspector/SettingsPanel.js +380 -284
- package/dist/esm/components/Inspector/StorageTab.js +177 -173
- package/dist/esm/components/Inspector/TabBar.js +38 -34
- package/dist/esm/components/Inspector/UpdateAvailableModal.js +1 -1
- package/dist/esm/components/JsonViewer.js +161 -169
- package/dist/esm/components/LogCard.js +38 -42
- package/dist/esm/components/LogSyntaxHighlighter.js +1 -1
- package/dist/esm/components/ModuleErrorBoundary.d.ts +24 -0
- package/dist/esm/components/ModuleErrorBoundary.js +33 -0
- package/dist/esm/components/NetworkIcons.d.ts +3 -3
- package/dist/esm/components/NetworkIcons.js +7 -3
- package/dist/esm/components/SegmentedTabs.d.ts +8 -2
- package/dist/esm/components/SegmentedTabs.js +12 -8
- package/dist/esm/components/ShareButton.d.ts +11 -0
- package/dist/esm/components/ShareButton.js +6 -0
- package/dist/esm/constants/index.js +1 -1
- package/dist/esm/constants/version.d.ts +1 -1
- package/dist/esm/constants/version.js +1 -1
- package/dist/esm/customHooks/crashHandler.js +6 -6
- package/dist/esm/customHooks/networkLogger.js +1 -2
- package/dist/esm/customHooks/pushNotificationLogger.d.ts +19 -0
- package/dist/esm/customHooks/pushNotificationLogger.js +1 -0
- package/dist/esm/helpers/index.d.ts +6 -0
- package/dist/esm/helpers/index.js +4 -4
- package/dist/esm/helpers/memoryManager.d.ts +2 -2
- package/dist/esm/helpers/memoryManager.js +1 -1
- package/dist/esm/helpers/remoteConfig.js +1 -1
- package/dist/esm/helpers/settingsStore.d.ts +1 -0
- package/dist/esm/helpers/settingsStore.js +1 -1
- package/dist/esm/helpers/shareFormatter.d.ts +13 -0
- package/dist/esm/helpers/shareFormatter.js +7 -0
- package/dist/esm/i18n/index.d.ts +35 -0
- package/dist/esm/i18n/index.js +1 -1
- package/dist/esm/i18n/locales/ar.json +1 -0
- package/dist/esm/i18n/locales/de.json +1 -0
- package/dist/esm/i18n/locales/en.json +1 -1
- package/dist/esm/i18n/locales/es.json +1 -0
- package/dist/esm/i18n/locales/fr.json +1 -0
- package/dist/esm/i18n/locales/hi.json +1 -0
- package/dist/esm/i18n/locales/ja.json +1 -0
- package/dist/esm/i18n/locales/ko.json +1 -0
- package/dist/esm/i18n/locales/pt.json +1 -0
- package/dist/esm/i18n/locales/ru.json +1 -0
- package/dist/esm/i18n/locales/zh.json +1 -0
- package/dist/esm/index.d.ts +6 -5
- package/dist/esm/index.js +7 -7
- package/dist/esm/push.d.ts +4 -0
- package/dist/esm/push.js +1 -0
- package/dist/esm/styles/AppColors.d.ts +40 -0
- package/dist/esm/styles/AppColors.js +1 -1
- package/dist/esm/styles/index.js +1 -1
- package/dist/esm/types/enums.d.ts +30 -20
- package/dist/esm/types/enums.js +1 -1
- package/dist/esm/types/index.d.ts +10 -0
- package/dist/esm/types/interfaces.d.ts +63 -7
- package/package.json +53 -24
- package/src/native/NativeInspector.ts +0 -1
- package/dist/commonjs/bundle.d.ts +0 -2
- package/dist/commonjs/bundle.js +0 -1
- package/dist/commonjs/components/BrandSquareIcon.d.ts +0 -5
- package/dist/commonjs/components/BrandSquareIcon.js +0 -112
- package/dist/commonjs/components/Inspector/BundleTab.d.ts +0 -48
- package/dist/commonjs/components/Inspector/BundleTab.js +0 -1297
- package/dist/commonjs/components/Inspector/PerformanceTab.d.ts +0 -27
- package/dist/commonjs/components/Inspector/PerformanceTab.js +0 -454
- package/dist/commonjs/customHooks/bundleAnalyzer.d.ts +0 -115
- package/dist/commonjs/customHooks/bundleAnalyzer.js +0 -1
- package/dist/commonjs/customHooks/performanceTracker.d.ts +0 -144
- package/dist/commonjs/customHooks/performanceTracker.js +0 -63
- package/dist/commonjs/performance.d.ts +0 -2
- package/dist/commonjs/performance.js +0 -1
- package/dist/esm/bundle.d.ts +0 -2
- package/dist/esm/bundle.js +0 -1
- package/dist/esm/components/BrandSquareIcon.d.ts +0 -5
- package/dist/esm/components/BrandSquareIcon.js +0 -112
- package/dist/esm/components/Inspector/BundleTab.d.ts +0 -48
- package/dist/esm/components/Inspector/BundleTab.js +0 -1297
- package/dist/esm/components/Inspector/PerformanceTab.d.ts +0 -27
- package/dist/esm/components/Inspector/PerformanceTab.js +0 -454
- package/dist/esm/customHooks/bundleAnalyzer.d.ts +0 -115
- package/dist/esm/customHooks/bundleAnalyzer.js +0 -1
- package/dist/esm/customHooks/performanceTracker.d.ts +0 -144
- package/dist/esm/customHooks/performanceTracker.js +0 -63
- package/dist/esm/performance.d.ts +0 -2
- package/dist/esm/performance.js +0 -1
|
@@ -1,151 +1,153 @@
|
|
|
1
|
-
import
|
|
2
|
-
<
|
|
3
|
-
</
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
{ae("network.successRate")}
|
|
23
|
-
</I>
|
|
24
|
-
</S>
|
|
25
|
-
|
|
26
|
-
<S style={{width:1,height:11,backgroundColor:e.dividerColor}}/>
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
<S style={{flexDirection:"row",alignItems:"center",gap:4}}>
|
|
30
|
-
<Te color={e.purple}size={10}/>
|
|
31
|
-
<I style={{fontFamily:B.interBold,fontSize:10.5,color:e.purple}}>
|
|
32
|
-
{v.avgDuration}ms
|
|
33
|
-
</I>
|
|
34
|
-
<I style={{fontFamily:B.interRegular,fontSize:10,color:e.grayTextWeak}}>
|
|
35
|
-
{ae("network.avgLatency")}
|
|
36
|
-
</I>
|
|
37
|
-
</S>
|
|
1
|
+
import X,{useCallback as de,useMemo as J,useRef as Oe}from"react";import{FlatList as $e,Platform as qe,Pressable as Ne,ScrollView as He,Text as R,TextInput as Ae,View as C}from"react-native";import{useInspector as De}from"./InspectorContext";import O from"../TouchableScale";import Ce from"../AnimatedEntrance";import Me from"../DomainHeader";import Ee from"../LogCard";import We from"../EmptyState";import Ge from"../EndOfListFooter";import Qe from"./NetworkFilterModal";import b from"../../styles";import{AppColors as e}from"../../styles/AppColors";import{AppFonts as k}from"../../styles/AppFonts";import{METHOD_COLORS as Se}from"../../constants";import{useTranslation as _e}from"../../i18n";import{SearchIcon as Ue,ClearIcon as Ke,TrashIcon as Xe,SortArrowIcon as Je,FilterIcon as Te,ChevronIcon as Ye,CheckIcon as Ze,CircleCheckIcon as Co,CircleXIcon as So,LayersIcon as To,ClockIcon as Vo,RequestIcon as Io,ResponseIcon as Ro,AtomIcon as Fo}from"../NetworkIcons";const Lo=X.memo(()=>{const{groupedData:Y,loadMoreSection:Z,search:F,setSearch:M,setSearchScope:xe,quickFilter:G,setQuickFilter:j,handleDelete:Ve,selectedLogs:E,sortOrder:Q,setSortOrder:v,statusFilters:x,setStatusFilters:q,methodFilters:V,setMethodFilters:N,filteredLogs:$,logs:H,toggleSectionFilter:ee,toggleSectionCollapse:oe,minStart:te,totalRange:re,newLogIds:le,toggleSelect:ie,setSelected:se}=De(),{t:_}=_e(),Ie=Oe(null),[Re,U]=X.useState(!1),[ae,ne]=X.useState(!1),ke=J(()=>({statusCodes:x.size>0?new Set(x):new Set(["all"]),methods:V.size>0?new Set(V):new Set(["all"]),latency:"all",protocol:"all",sortBy:Q==="newest"?"time_desc":"time_asc"}),[x,V,Q]),Fe=de(o=>{o.statusCodes.has("all")||o.statusCodes.size===0?q(new Set):q(new Set(o.statusCodes)),o.methods.has("all")||o.methods.size===0?N(new Set):N(new Set([...o.methods].map(z=>z))),o.sortBy==="time_asc"?v("oldest"):v("newest")},[q,N,v]),L=J(()=>{let o=0,z=0,T=0,I=0,A=0,W=0;return H.forEach(S=>{const P=typeof S.status=="number"?S.status:parseInt(String(S.status),10);S.status===0||S.status==null||!isNaN(P)&&P>=400?o++:!isNaN(P)&&P>=200&&P<400&&z++,(S.duration||0)>=500&&T++;const B=(S.method||"").toUpperCase();B==="POST"&&I++,B==="GET"&&A++;const K=(S.url||"").toLowerCase(),D=(S.client||"").toLowerCase();(K.includes("graphql")||D.includes("graphql")||D.includes("apollo"))&&W++}),{all:H.length,errors:o,success:z,slow:T,post:I,get:A,graphql:W}},[H]),Le=J(()=>[{id:"all",label:"All",count:L.all,color:e.purple},{id:"errors",label:"Errors",count:L.errors,color:e.errorColor},{id:"success",label:"2xx OK",count:L.success,color:e.greenColor},{id:"slow",label:"Slow >500ms",count:L.slow,color:e.warningIconGold},{id:"POST",label:"POST",count:L.post,color:Se.POST||"#3B82F6"},{id:"GET",label:"GET",count:L.get,color:Se.GET||"#10B981"},{id:"graphql",label:"GraphQL",count:L.graphql,color:e.graphqlPink}],[L]),Be=de(({item:o,index:z})=>{if(o.type==="header")return<Ce index={z}distance={8}>
|
|
2
|
+
<Me pageName={o.pageName}color={o.color}stats={o.stats}activeFilters={o.activeFilters}onToggleFilter={ee}isCollapsed={o.isCollapsed}onToggleCollapse={oe}isFirst={o.isFirst}timestamp={o.timestamp}/>
|
|
3
|
+
</Ce>;if(o.type==="loadMore"){const{pageName:W,color:S,remainingCount:P,totalCount:B,loadedCount:K,loadMoreStep:D,hasMore:Pe}=o;return<C style={[b.treeNodeRow,b.treeNodeRowLast]}>
|
|
4
|
+
<C style={b.treeLines}>
|
|
5
|
+
<C style={[b.modernTreeLine,{borderColor:S},b.modernTreeLineLast]}/>
|
|
6
|
+
</C>
|
|
7
|
+
<C style={b.treeCardWrapper}>
|
|
8
|
+
{Pe?<O onPress={()=>Z(W,50)}hitSlop={6}style={{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingVertical:9,paddingHorizontal:12,marginVertical:3,marginRight:2,borderRadius:10,backgroundColor:`${S}14`,borderWidth:1.5,borderColor:`${S}40`,shadowColor:S,shadowOffset:{width:0,height:1.5},shadowOpacity:.1,shadowRadius:3,elevation:2}}>
|
|
9
|
+
<C style={{flexDirection:"row",alignItems:"center",gap:8}}>
|
|
10
|
+
<C style={{width:22,height:22,borderRadius:11,backgroundColor:S,alignItems:"center",justifyContent:"center",shadowColor:S,shadowOffset:{width:0,height:1},shadowOpacity:.25,shadowRadius:2,elevation:1}}>
|
|
11
|
+
<Ye color={e.white}size={9}direction="down"/>
|
|
12
|
+
</C>
|
|
13
|
+
<C>
|
|
14
|
+
<R style={{fontFamily:k.interBold,fontSize:12,color:S}}>
|
|
15
|
+
{_("footer.loadMoreRequests",{count:D,defaultValue:`Load ${D} More Requests`})}
|
|
16
|
+
</R>
|
|
17
|
+
<R style={{fontFamily:k.interRegular,fontSize:9.5,color:e.grayTextWeak,marginTop:1}}>
|
|
18
|
+
Showing {K} of {B} requests
|
|
19
|
+
</R>
|
|
20
|
+
</C>
|
|
21
|
+
</C>
|
|
38
22
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
23
|
+
<C style={{flexDirection:"row",alignItems:"center",backgroundColor:`${S}25`,paddingHorizontal:8,paddingVertical:4,borderRadius:8,borderWidth:1,borderColor:`${S}40`,gap:3}}>
|
|
24
|
+
<R style={{fontFamily:k.interBold,fontSize:10.5,color:S}}>
|
|
25
|
+
+{P}
|
|
26
|
+
</R>
|
|
27
|
+
<R style={{fontFamily:k.interRegular,fontSize:9,color:S}}>
|
|
28
|
+
more
|
|
29
|
+
</R>
|
|
30
|
+
</C>
|
|
31
|
+
</O>:<C style={{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingVertical:7,paddingHorizontal:11,marginVertical:3,marginRight:2,borderRadius:9,backgroundColor:`${S}0A`,borderWidth:1,borderColor:`${S}25`}}>
|
|
32
|
+
<C style={{flexDirection:"row",alignItems:"center",gap:7}}>
|
|
33
|
+
<C style={{width:17,height:17,borderRadius:8.5,backgroundColor:`${S}25`,alignItems:"center",justifyContent:"center"}}>
|
|
34
|
+
<Ze color={S}size={8}/>
|
|
35
|
+
</C>
|
|
36
|
+
<R style={{fontFamily:k.interMedium,fontSize:11,color:e.grayTextStrong}}>
|
|
37
|
+
{_("footer.allLoaded",{count:B,defaultValue:`All ${B} requests loaded`})}
|
|
38
|
+
</R>
|
|
39
|
+
</C>
|
|
51
40
|
|
|
41
|
+
<C style={{backgroundColor:`${S}18`,paddingHorizontal:7,paddingVertical:2,borderRadius:6}}>
|
|
42
|
+
<R style={{fontFamily:k.interBold,fontSize:9.5,color:S}}>
|
|
43
|
+
{B}/{B}
|
|
44
|
+
</R>
|
|
45
|
+
</C>
|
|
46
|
+
</C>}
|
|
47
|
+
</C>
|
|
48
|
+
</C>}const{log:T,isLast:I,color:A}=o;return<Ce index={z}distance={8}style={[b.treeNodeRow,I&&b.treeNodeRowLast]}>
|
|
49
|
+
<C style={b.treeLines}>
|
|
50
|
+
<C style={[b.modernTreeLine,{borderColor:A},I&&b.modernTreeLineLast]}/>
|
|
51
|
+
{!I&&<C style={[b.modernTreeBranch,{borderColor:A}]}/>}
|
|
52
|
+
</C>
|
|
53
|
+
<C style={b.treeCardWrapper}>
|
|
54
|
+
<Ee item={T}isSelected={E.has(T.id)}onToggleSelect={ie}onPress={()=>{se(T)}}timelineMinStart={te}timelineTotalRange={re}isNew={le.has(T.id)}searchStr={F}/>
|
|
55
|
+
</C>
|
|
56
|
+
</Ce>},[te,re,le,E,ie,F,ee,oe,Z,se,_]);return<C style={{flex:1}}>
|
|
57
|
+
<C style={{marginTop:6}}>
|
|
52
58
|
|
|
53
|
-
<
|
|
54
|
-
<
|
|
55
|
-
<
|
|
56
|
-
<Ae placeholder="Search URL, status, method, headers, body..."placeholderTextColor={e.grayTextWeak}value={
|
|
57
|
-
|
|
58
|
-
{L.length>0&&<S style={{flexDirection:"row",alignItems:"center",gap:4}}>
|
|
59
|
-
<S style={{backgroundColor:`${e.purple}20`,borderRadius:10,paddingHorizontal:6,paddingVertical:1.5}}>
|
|
60
|
-
<I style={{color:e.purple,fontSize:9.5,fontFamily:B.interBold}}>
|
|
61
|
-
{M.length}
|
|
62
|
-
</I>
|
|
63
|
-
</S>
|
|
64
|
-
<Ee onPress={()=>q("")}hitSlop={10}style={w.clearBtn}>
|
|
65
|
-
<Xe color={e.grayTextWeak}size={13}/>
|
|
66
|
-
</Ee>
|
|
67
|
-
</S>}
|
|
68
|
-
</S>
|
|
59
|
+
<C style={b.toolbarRow}>
|
|
60
|
+
<C style={[b.searchContainer,ae&&{borderColor:e.purple,borderWidth:1.5}]}>
|
|
61
|
+
<Ue color={ae?e.purple:e.grayTextWeak}size={15}/>
|
|
62
|
+
<Ae placeholder="Search URL, status, method, headers, body..."placeholderTextColor={e.grayTextWeak}value={F}onChangeText={M}onFocus={()=>ne(!0)}onBlur={()=>ne(!1)}style={b.searchInput}autoCorrect={!1}autoCapitalize="none"/>
|
|
69
63
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
64
|
+
{F.length>0&&<C style={{flexDirection:"row",alignItems:"center",gap:4}}>
|
|
65
|
+
<C style={{backgroundColor:`${e.purple}20`,borderRadius:10,paddingHorizontal:6,paddingVertical:1.5}}>
|
|
66
|
+
<R style={{color:e.purple,fontSize:9.5,fontFamily:k.interBold}}>
|
|
67
|
+
{$.length}
|
|
68
|
+
</R>
|
|
69
|
+
</C>
|
|
70
|
+
<Ne onPress={()=>M("")}hitSlop={10}style={b.clearBtn}>
|
|
71
|
+
<Ke color={e.grayTextWeak}size={13}/>
|
|
72
|
+
</Ne>
|
|
73
|
+
</C>}
|
|
74
|
+
</C>
|
|
74
75
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
{
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
76
|
+
<C style={b.toolbarRight}>
|
|
77
|
+
<O style={[b.toolbarBtn,{borderColor:`${e.errorColor}38`,backgroundColor:`${e.errorColor}0F`}]}onPress={Ve}hitSlop={6}>
|
|
78
|
+
<Xe color={e.errorColor}size={15}/>
|
|
79
|
+
{E.size>0&&<C style={b.trashBadge}>
|
|
80
|
+
<R style={b.trashBadgeText}>
|
|
81
|
+
{E.size}
|
|
82
|
+
</R>
|
|
83
|
+
</C>}
|
|
84
|
+
</O>
|
|
83
85
|
|
|
84
|
-
<
|
|
85
|
-
<
|
|
86
|
-
</
|
|
86
|
+
<O style={b.toolbarBtn}onPress={()=>v(o=>o==="newest"?"oldest":"newest")}hitSlop={10}>
|
|
87
|
+
<Je direction={Q==="newest"?"down":"up"}color={e.grayTextStrong}size={18}/>
|
|
88
|
+
</O>
|
|
87
89
|
|
|
88
|
-
<
|
|
89
|
-
<
|
|
90
|
-
{(
|
|
91
|
-
</
|
|
92
|
-
</
|
|
93
|
-
</
|
|
90
|
+
<O style={[b.toolbarBtn,(x.size>0||V.size>0)&&{borderColor:e.purple,backgroundColor:`${e.purple}15`}]}onPress={()=>U(!0)}hitSlop={6}>
|
|
91
|
+
<Te color={x.size>0||V.size>0?e.purple:e.grayTextStrong}size={16}/>
|
|
92
|
+
{(x.size>0||V.size>0)&&<C style={b.activeFilterDot}/>}
|
|
93
|
+
</O>
|
|
94
|
+
</C>
|
|
95
|
+
</C>
|
|
94
96
|
|
|
95
97
|
|
|
96
|
-
<
|
|
98
|
+
<C style={{flexDirection:"row",alignItems:"center",marginBottom:8,paddingHorizontal:12,gap:6}}>
|
|
97
99
|
<He horizontal showsHorizontalScrollIndicator={!1}style={{flex:1}}contentContainerStyle={{flexDirection:"row",alignItems:"center",gap:6,paddingRight:6}}>
|
|
98
|
-
{
|
|
99
|
-
<
|
|
100
|
-
{o.id==="all"&&<
|
|
101
|
-
{o.id==="errors"&&<So size={11}color={
|
|
102
|
-
{o.id==="success"&&<
|
|
103
|
-
{o.id==="slow"&&<
|
|
104
|
-
{o.id==="POST"&&<Io size={11}color={
|
|
105
|
-
{o.id==="GET"&&<
|
|
106
|
-
{o.id==="graphql"&&<
|
|
107
|
-
<
|
|
100
|
+
{Le.map(o=>{const z=G===o.id,T=o.color||e.purple,I=z?e.white:T;return<O key={o.id}onPress={()=>{j(z?"all":o.id)}}>
|
|
101
|
+
<C style={{flexDirection:"row",alignItems:"center",paddingHorizontal:9,paddingVertical:4.5,borderRadius:8,backgroundColor:z?T:`${T}12`,borderWidth:1,borderColor:z?T:`${T}30`,gap:5}}>
|
|
102
|
+
{o.id==="all"&&<To size={11}color={I}/>}
|
|
103
|
+
{o.id==="errors"&&<So size={11}color={I}/>}
|
|
104
|
+
{o.id==="success"&&<Co size={11}color={I}/>}
|
|
105
|
+
{o.id==="slow"&&<Vo size={11}color={I}/>}
|
|
106
|
+
{o.id==="POST"&&<Io size={11}color={I}/>}
|
|
107
|
+
{o.id==="GET"&&<Ro size={11}color={I}/>}
|
|
108
|
+
{o.id==="graphql"&&<Fo size={11}color={I}/>}
|
|
109
|
+
<R style={{fontFamily:k.interBold,fontSize:10.5,color:z?e.white:e.primaryBlack}}>
|
|
108
110
|
{o.label}
|
|
109
|
-
</
|
|
110
|
-
<
|
|
111
|
-
<
|
|
111
|
+
</R>
|
|
112
|
+
<C style={{backgroundColor:z?"rgba(255,255,255,0.25)":`${T}20`,paddingHorizontal:5,paddingVertical:1,borderRadius:8}}>
|
|
113
|
+
<R style={{fontFamily:k.interBold,fontSize:9,color:z?e.white:T}}>
|
|
112
114
|
{o.count}
|
|
113
|
-
</
|
|
114
|
-
</
|
|
115
|
-
</
|
|
116
|
-
</
|
|
115
|
+
</R>
|
|
116
|
+
</C>
|
|
117
|
+
</C>
|
|
118
|
+
</O>})}
|
|
117
119
|
</He>
|
|
118
120
|
|
|
119
|
-
<
|
|
120
|
-
<
|
|
121
|
-
<
|
|
122
|
-
<
|
|
121
|
+
<O onPress={()=>U(!0)}style={{flexShrink:0}}>
|
|
122
|
+
<C style={{flexDirection:"row",alignItems:"center",paddingHorizontal:10,paddingVertical:4.5,borderRadius:8,backgroundColor:x.size>0||V.size>0?`${e.purple}20`:e.grayBackground,borderWidth:1,borderColor:x.size>0||V.size>0?e.purple:e.grayBorderSecondary,gap:5,shadowColor:e.black,shadowOpacity:.04,shadowRadius:2,shadowOffset:{width:0,height:1},elevation:1}}>
|
|
123
|
+
<Te size={11}color={x.size>0||V.size>0?e.purple:e.grayText}/>
|
|
124
|
+
<R style={{fontFamily:k.interBold,fontSize:10.5,color:x.size>0||V.size>0?e.purple:e.grayText}}>
|
|
123
125
|
More Filters
|
|
124
|
-
</
|
|
125
|
-
{(
|
|
126
|
-
<
|
|
127
|
-
{
|
|
128
|
-
</
|
|
129
|
-
</
|
|
130
|
-
</
|
|
131
|
-
</
|
|
132
|
-
</
|
|
126
|
+
</R>
|
|
127
|
+
{(x.size>0||V.size>0)&&<C style={{backgroundColor:e.purple,paddingHorizontal:4.5,paddingVertical:1,borderRadius:6}}>
|
|
128
|
+
<R style={{fontFamily:k.interBold,fontSize:8.5,color:e.white}}>
|
|
129
|
+
{x.size+V.size}
|
|
130
|
+
</R>
|
|
131
|
+
</C>}
|
|
132
|
+
</C>
|
|
133
|
+
</O>
|
|
134
|
+
</C>
|
|
133
135
|
|
|
134
136
|
|
|
135
|
-
{(
|
|
136
|
-
<
|
|
137
|
-
Showing {
|
|
138
|
-
</
|
|
139
|
-
<
|
|
140
|
-
<
|
|
137
|
+
{(G!=="all"||F.trim().length>0||x.size>0||V.size>0||$.length!==H.length)&&<C style={{flexDirection:"row",alignItems:"center",justifyContent:"space-between",marginHorizontal:12,marginBottom:8,paddingHorizontal:10,paddingVertical:5.5,backgroundColor:`${e.purple}10`,borderRadius:8,borderWidth:1,borderColor:`${e.purple}25`}}>
|
|
138
|
+
<R style={{fontFamily:k.interMedium,fontSize:10.5,color:e.purple}}>
|
|
139
|
+
Showing {$.length} of {H.length} requests
|
|
140
|
+
</R>
|
|
141
|
+
<O onPress={()=>{M(""),j("all"),q(new Set),N(new Set)}}>
|
|
142
|
+
<R style={{fontFamily:k.interBold,fontSize:10.5,color:e.errorColor}}>
|
|
141
143
|
Clear All Filters
|
|
142
|
-
</
|
|
143
|
-
</
|
|
144
|
-
</
|
|
145
|
-
</
|
|
144
|
+
</R>
|
|
145
|
+
</O>
|
|
146
|
+
</C>}
|
|
147
|
+
</C>
|
|
146
148
|
|
|
147
|
-
|
|
149
|
+
<$e ref={Ie}data={Y}keyExtractor={o=>o?.id?.toString()}renderItem={Be}initialNumToRender={15}maxToRenderPerBatch={10}windowSize={9}removeClippedSubviews={qe.OS==="android"}renderToHardwareTextureAndroid={!0}ListEmptyComponent={<We isSearch={F.length>0||x.size>0||V.size>0||G!=="all"}searchQuery={F}customTitle={F.length>0?"No matching API requests":"No network activity"}onClearSearch={()=>{M(""),q(new Set),N(new Set),j("all"),xe("all")}}/>}ListFooterComponent={Y.length>0?<Ge count={$.length}totalCount={$.length}label="requests"/>:null}contentContainerStyle={[b.listContent,$.length===0&&{flexGrow:1}]}keyboardShouldPersistTaps="handled"/>
|
|
148
150
|
|
|
149
151
|
|
|
150
|
-
<
|
|
151
|
-
</
|
|
152
|
+
<Qe visible={Re}onClose={()=>U(!1)}filters={ke}onApply={Fe}searchQuery={F}/>
|
|
153
|
+
</C>});export default Lo;
|
|
@@ -1,78 +1,78 @@
|
|
|
1
|
-
import{useEffect as
|
|
2
|
-
<r.View style={[
|
|
3
|
-
<P style={
|
|
1
|
+
import{useEffect as K,useRef as z,useState as J}from"react";import{Animated as r,Linking as j,Modal as Q,Platform as I,StyleSheet as F,Text as T,TouchableOpacity as P,View as S}from"react-native";import{AppColors as t}from"../../styles/AppColors";import{AppFonts as x}from"../../styles/AppFonts";import E from"../TouchableScale";import{loadSettings as C,saveSettings as B}from"../../helpers/settingsStore";import{trackTelemetryEvent as R}from"../../helpers/telemetry";import{StarIcon as M,CloseWhite as X,CheckIcon as Z,GitHubIcon as St,NpmIcon as Tt}from"../NetworkIcons";const xt=7200*60*1e3,Ct="https://github.com/vengatmacuser/react-native-inapp-inspector",Bt="https://www.npmjs.com/package/react-native-inapp-inspector";export const NpmStarPrompt=()=>{const[L,H]=J(!1),_=z(new r.Value(200)).current,A=z(new r.Value(0)).current,O=z(new r.Value(1)).current;K(()=>{let o=!0;async function $(){try{const k=await C();if(k.starPromptActioned)return;const D=Date.now(),Y=k.starPromptFirstSeen||D;k.starPromptFirstSeen||await B({...k,starPromptFirstSeen:D});const q=k.starPromptLastShown||Y;D-q>=xt&&Math.random()<.65&&o&&setTimeout(()=>{o&&N()},1800)}catch{}}return $(),()=>{o=!1}},[]);const N=async()=>{H(!0);try{const o=await C();await B({...o,starPromptLastShown:Date.now()}),R("npm_star_prompt_shown",{trigger:"5_day_interval",platform:I.OS})}catch{}r.parallel([r.spring(_,{toValue:0,friction:8,tension:50,useNativeDriver:!0}),r.timing(A,{toValue:1,duration:250,useNativeDriver:!0})]).start(),r.loop(r.sequence([r.timing(O,{toValue:1.15,duration:900,useNativeDriver:!0}),r.timing(O,{toValue:1,duration:900,useNativeDriver:!0})])).start()},V=o=>{r.parallel([r.timing(A,{toValue:0,duration:180,useNativeDriver:!0}),r.timing(_,{toValue:200,duration:180,useNativeDriver:!0})]).start(()=>{H(!1),o&&o()})},G=async()=>{try{const o=await C();await B({...o,starPromptActioned:!0}),R("npm_star_prompt_action",{action:"starred",platform:I.OS})}catch{}V(()=>{j.openURL(Ct).catch(()=>{j.openURL(Bt).catch(()=>{})})})},W=async()=>{try{const o=await C();await B({...o,starPromptActioned:!0}),R("npm_star_prompt_action",{action:"already_starred",platform:I.OS})}catch{}V()},v=async()=>{try{const o=await C();await B({...o,starPromptLastShown:Date.now()}),R("npm_star_prompt_action",{action:"remind_later",platform:I.OS})}catch{}V()},U=async()=>{try{const o=await C();await B({...o,starPromptActioned:!0}),R("npm_star_prompt_action",{action:"dont_ask_again",platform:I.OS})}catch{}V()};return L?<Q transparent visible={L}animationType="none"onRequestClose={v}>
|
|
2
|
+
<r.View style={[e.backdrop,{opacity:A}]}>
|
|
3
|
+
<P style={F.absoluteFill}activeOpacity={1}onPress={v}/>
|
|
4
4
|
|
|
5
|
-
<r.View style={[
|
|
5
|
+
<r.View style={[e.cardContainer,{transform:[{translateY:_}]}]}>
|
|
6
6
|
|
|
7
|
-
<S style={
|
|
8
|
-
<r.View style={[
|
|
9
|
-
<S style={
|
|
10
|
-
<
|
|
7
|
+
<S style={e.headerIconWrapper}>
|
|
8
|
+
<r.View style={[e.iconGlow,{transform:[{scale:O}]}]}/>
|
|
9
|
+
<S style={e.iconCircle}>
|
|
10
|
+
<M size={26}color={t.amber500}/>
|
|
11
11
|
</S>
|
|
12
12
|
</S>
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
<P onPress={v}hitSlop={{top:10,bottom:10,left:10,right:10}}style={
|
|
16
|
-
<
|
|
15
|
+
<P onPress={v}hitSlop={{top:10,bottom:10,left:10,right:10}}style={e.closeBtn}>
|
|
16
|
+
<X size={12}color={t.grayText}/>
|
|
17
17
|
</P>
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
<S style={
|
|
21
|
-
<
|
|
20
|
+
<S style={e.pillBadge}>
|
|
21
|
+
<T style={e.pillBadgeText}>SUPPORT OPEN SOURCE</T>
|
|
22
22
|
</S>
|
|
23
23
|
|
|
24
24
|
|
|
25
|
-
<
|
|
26
|
-
<
|
|
25
|
+
<T style={e.title}>Enjoying In-App Inspector?</T>
|
|
26
|
+
<T style={e.description}>
|
|
27
27
|
If this debugging tool saves you time, please consider giving us a
|
|
28
28
|
star on GitHub & npm. Your support helps us build more features!
|
|
29
|
-
</
|
|
29
|
+
</T>
|
|
30
30
|
|
|
31
31
|
|
|
32
|
-
<S style={
|
|
33
|
-
<S style={
|
|
34
|
-
<
|
|
35
|
-
<
|
|
32
|
+
<S style={e.metricsBar}>
|
|
33
|
+
<S style={e.metricItem}>
|
|
34
|
+
<St size={13}color={t.grayText}/>
|
|
35
|
+
<T style={e.metricText}>GitHub Star</T>
|
|
36
36
|
</S>
|
|
37
|
-
<S style={
|
|
38
|
-
<S style={
|
|
39
|
-
<Tt size={13}color=
|
|
40
|
-
<
|
|
37
|
+
<S style={e.metricDot}/>
|
|
38
|
+
<S style={e.metricItem}>
|
|
39
|
+
<Tt size={13}color={t.npmRed}/>
|
|
40
|
+
<T style={e.metricText}>npm Package</T>
|
|
41
41
|
</S>
|
|
42
|
-
<S style={
|
|
43
|
-
<S style={
|
|
44
|
-
<
|
|
42
|
+
<S style={e.metricDot}/>
|
|
43
|
+
<S style={e.metricItem}>
|
|
44
|
+
<T style={e.metricText}>100% Free</T>
|
|
45
45
|
</S>
|
|
46
46
|
</S>
|
|
47
47
|
|
|
48
48
|
|
|
49
|
-
<
|
|
50
|
-
<S style={
|
|
51
|
-
<
|
|
52
|
-
<
|
|
49
|
+
<E accessible={!0}accessibilityRole="button"accessibilityLabel="Star on GitHub"onPress={G}style={e.primaryButton}>
|
|
50
|
+
<S style={e.primaryButtonContent}>
|
|
51
|
+
<M size={16}color={t.white}/>
|
|
52
|
+
<T style={e.primaryButtonText}>Star on GitHub & npm</T>
|
|
53
53
|
</S>
|
|
54
|
-
</
|
|
54
|
+
</E>
|
|
55
55
|
|
|
56
56
|
|
|
57
|
-
<
|
|
58
|
-
<S style={
|
|
59
|
-
<
|
|
60
|
-
<
|
|
57
|
+
<E accessible={!0}accessibilityRole="button"accessibilityLabel="I already starred"onPress={W}style={e.secondaryButton}>
|
|
58
|
+
<S style={e.secondaryButtonContent}>
|
|
59
|
+
<Z size={13}color={t.purple}/>
|
|
60
|
+
<T style={e.secondaryButtonText}>I Already Starred</T>
|
|
61
61
|
</S>
|
|
62
|
-
</
|
|
62
|
+
</E>
|
|
63
63
|
|
|
64
64
|
|
|
65
|
-
<S style={
|
|
65
|
+
<S style={e.footerRow}>
|
|
66
66
|
<P onPress={v}hitSlop={{top:8,bottom:8,left:8,right:8}}>
|
|
67
|
-
<
|
|
67
|
+
<T style={e.footerLinkText}>Remind Me Later</T>
|
|
68
68
|
</P>
|
|
69
69
|
|
|
70
|
-
<S style={
|
|
70
|
+
<S style={e.footerSeparator}/>
|
|
71
71
|
|
|
72
|
-
<P onPress={
|
|
73
|
-
<
|
|
72
|
+
<P onPress={U}hitSlop={{top:8,bottom:8,left:8,right:8}}>
|
|
73
|
+
<T style={e.footerLinkTextMuted}>Don't Ask Again</T>
|
|
74
74
|
</P>
|
|
75
75
|
</S>
|
|
76
76
|
</r.View>
|
|
77
77
|
</r.View>
|
|
78
|
-
</
|
|
78
|
+
</Q>:null};const e=F.create({backdrop:{...F.absoluteFillObject,backgroundColor:"rgba(15, 23, 42, 0.65)",justifyContent:"center",alignItems:"center",paddingHorizontal:20,zIndex:99999},cardContainer:{width:"100%",maxWidth:380,backgroundColor:t.white,borderRadius:22,padding:22,alignItems:"center",shadowColor:t.black,shadowOffset:{width:0,height:8},shadowOpacity:.22,shadowRadius:20,elevation:12,borderWidth:1.5,borderColor:`${t.purple}25`},headerIconWrapper:{position:"relative",alignItems:"center",justifyContent:"center",marginBottom:12},iconGlow:{position:"absolute",width:68,height:68,borderRadius:34,backgroundColor:`${t.amber500}22`},iconCircle:{width:54,height:54,borderRadius:27,backgroundColor:t.amber100,borderWidth:2,borderColor:t.amber200,alignItems:"center",justifyContent:"center"},closeBtn:{position:"absolute",top:14,right:14,width:28,height:28,borderRadius:14,backgroundColor:t.grayBackground,alignItems:"center",justifyContent:"center"},pillBadge:{backgroundColor:`${t.purple}14`,paddingHorizontal:9,paddingVertical:3,borderRadius:10,marginBottom:8},pillBadgeText:{fontFamily:x.interBold,fontSize:9.5,color:t.purple,letterSpacing:.6},title:{fontFamily:x.interBold,fontSize:18,lineHeight:23,color:t.primaryBlack,textAlign:"center",marginBottom:6},description:{fontFamily:x.interRegular,fontSize:12.5,lineHeight:18,color:t.grayText,textAlign:"center",marginBottom:14,paddingHorizontal:8},metricsBar:{flexDirection:"row",alignItems:"center",justifyContent:"center",backgroundColor:t.grayBackground,paddingVertical:7,paddingHorizontal:14,borderRadius:10,marginBottom:16,gap:8},metricItem:{flexDirection:"row",alignItems:"center",gap:4},metricText:{fontFamily:x.interMedium,fontSize:11,color:t.primaryBlack},metricDot:{width:3.5,height:3.5,borderRadius:2,backgroundColor:t.dividerColor},primaryButton:{width:"100%",backgroundColor:t.purple,borderRadius:12,paddingVertical:12,alignItems:"center",justifyContent:"center",marginBottom:8,shadowColor:t.purple,shadowOffset:{width:0,height:4},shadowOpacity:.3,shadowRadius:8,elevation:4},primaryButtonContent:{flexDirection:"row",alignItems:"center",gap:7},primaryButtonText:{fontFamily:x.interBold,fontSize:14,color:t.white},secondaryButton:{width:"100%",backgroundColor:`${t.purple}10`,borderWidth:1,borderColor:`${t.purple}30`,borderRadius:12,paddingVertical:10,alignItems:"center",justifyContent:"center",marginBottom:14},secondaryButtonContent:{flexDirection:"row",alignItems:"center",gap:6},secondaryButtonText:{fontFamily:x.interBold,fontSize:13,color:t.purple},footerRow:{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:12},footerLinkText:{fontFamily:x.interMedium,fontSize:11.5,color:t.grayText},footerSeparator:{width:1,height:12,backgroundColor:t.dividerColor},footerLinkTextMuted:{fontFamily:x.interRegular,fontSize:11.5,color:t.grayTextWeak}});export default NpmStarPrompt;
|
|
@@ -1,56 +1,55 @@
|
|
|
1
|
-
import{useState as
|
|
2
|
-
<C d="M18 6L6 18M6 6l12 12"stroke={
|
|
3
|
-
</
|
|
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={
|
|
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={
|
|
6
|
-
</
|
|
7
|
-
<C d="M20 6L9 17l-5-5"stroke={
|
|
8
|
-
</
|
|
9
|
-
<C d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"stroke={
|
|
10
|
-
<C d="M15 3h6v6"stroke={
|
|
11
|
-
<C d="M10 14L21 3"stroke={
|
|
12
|
-
</
|
|
13
|
-
<
|
|
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">
|
|
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">
|
|
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
|
+
<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">
|
|
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">
|
|
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
|
+
<C d="M15 3h6v6"stroke={i}strokeWidth="2"strokeLinecap="round"strokeLinejoin="round"/>
|
|
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("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}]}]}>
|
|
13
|
+
<T style={o.contentRow}>
|
|
14
14
|
|
|
15
|
-
<
|
|
16
|
-
|
|
17
|
-
</
|
|
15
|
+
<T style={o.npmIconContainer}>
|
|
16
|
+
<Z size={15}color={e.npmRed}/>
|
|
17
|
+
</T>
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
<
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
</F>
|
|
19
|
+
<T style={o.textContainer}>
|
|
20
|
+
<T style={o.titleRow}>
|
|
21
|
+
<S style={o.titleText}>{t("header.newVersionAvailable","Update Available")}</S>
|
|
22
|
+
<T style={o.versionPill}>
|
|
23
|
+
<S style={o.versionPillText}>v{V}</S>
|
|
24
|
+
</T>
|
|
25
|
+
</T>
|
|
26
|
+
<S style={o.subtitleText}>
|
|
27
|
+
{t("header.updateAvailable",{latestVersion:V,currentVersion:X,defaultValue:`react-native-inapp-inspector v${V} is available on NPM.`})}
|
|
28
|
+
</S>
|
|
29
|
+
</T>
|
|
31
30
|
|
|
32
31
|
|
|
33
|
-
<
|
|
34
|
-
{
|
|
35
|
-
<
|
|
36
|
-
{
|
|
37
|
-
</
|
|
38
|
-
</
|
|
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}/>}
|
|
34
|
+
<S style={[o.copyButtonText,W&&{color:e.greenColor}]}>
|
|
35
|
+
{W?t("common.copied","Copied"):t("header.copyCommand","Copy")}
|
|
36
|
+
</S>
|
|
37
|
+
</P>
|
|
39
38
|
|
|
40
39
|
|
|
41
|
-
<
|
|
42
|
-
<
|
|
43
|
-
<
|
|
44
|
-
</
|
|
40
|
+
<P style={o.actionButton}onPress={Y}activeOpacity={.8}hitSlop={{top:8,bottom:8,left:4,right:4}}>
|
|
41
|
+
<S style={o.actionButtonText}>{t("header.viewNpm","View")}</S>
|
|
42
|
+
<Se size={10}color={e.white}/>
|
|
43
|
+
</P>
|
|
45
44
|
|
|
46
45
|
|
|
47
|
-
<
|
|
48
|
-
<
|
|
49
|
-
</
|
|
50
|
-
</
|
|
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>
|
|
49
|
+
</T>
|
|
51
50
|
|
|
52
51
|
|
|
53
|
-
<
|
|
54
|
-
<
|
|
55
|
-
</
|
|
56
|
-
</
|
|
52
|
+
<T style={o.progressBarTrack}>
|
|
53
|
+
<r.View style={[o.progressBarFill,{width:q}]}/>
|
|
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;
|