react-native-inapp-inspector 2.4.0 → 2.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.ar.md +163 -0
- package/README.de.md +163 -0
- package/README.es.md +164 -0
- package/README.fr.md +163 -0
- package/README.hi.md +163 -0
- package/README.ja.md +180 -0
- package/README.ko.md +163 -0
- package/README.md +340 -243
- package/README.pt-BR.md +163 -0
- package/README.ru.md +163 -0
- package/README.zh-CN.md +387 -0
- package/android/src/main/java/com/inappinspector/NetworkInspectorModule.kt +82 -21
- package/assets/banner_dark.svg +186 -0
- package/assets/banner_light.svg +186 -0
- package/assets/icon_circle.svg +148 -0
- package/assets/icon_square.svg +369 -0
- package/assets/inapp_inspector_icon.gif +0 -0
- package/assets/inapp_inspector_icon_original.gif +0 -0
- package/assets/social_preview.png +0 -0
- package/assets/walkthrough.gif +0 -0
- package/dist/commonjs/components/AnimatedBrandOwl.d.ts +7 -0
- package/dist/commonjs/components/AnimatedBrandOwl.js +175 -0
- package/dist/commonjs/components/AppHeaderLogo.d.ts +1 -0
- package/dist/commonjs/components/AppHeaderLogo.js +7 -5
- package/dist/commonjs/components/BrandSquareIcon.d.ts +5 -0
- package/dist/commonjs/components/BrandSquareIcon.js +139 -0
- package/dist/commonjs/components/ConsoleLogCard.d.ts +2 -1
- package/dist/commonjs/components/ConsoleLogCard.js +23 -39
- package/dist/commonjs/components/Inspector/AboutModal.js +44 -54
- package/dist/commonjs/components/Inspector/AnalyticsTab.js +16 -16
- package/dist/commonjs/components/Inspector/ConfirmationModal.d.ts +13 -0
- package/dist/commonjs/components/Inspector/ConfirmationModal.js +32 -0
- package/dist/commonjs/components/Inspector/ConsoleTab.js +15 -15
- package/dist/commonjs/components/Inspector/CrashTab.js +25 -23
- package/dist/commonjs/components/Inspector/DebuggingTab.js +17 -17
- package/dist/commonjs/components/Inspector/FabLauncher.js +22 -30
- package/dist/commonjs/components/Inspector/FeatureUnderDevNotice.js +2 -2
- package/dist/commonjs/components/Inspector/LanguageSelectorModal.d.ts +15 -0
- package/dist/commonjs/components/Inspector/LanguageSelectorModal.js +90 -0
- package/dist/commonjs/components/Inspector/MainScreen.js +46 -33
- package/dist/commonjs/components/Inspector/MediaGalleryTab.js +21 -19
- package/dist/commonjs/components/Inspector/MediaPreviewModal.js +85 -101
- package/dist/commonjs/components/Inspector/NetworkTab.js +50 -50
- package/dist/commonjs/components/Inspector/NpmUpdateToast.js +1 -1
- package/dist/commonjs/components/Inspector/PushCard.d.ts +3 -2
- package/dist/commonjs/components/Inspector/PushCard.js +5 -4
- package/dist/commonjs/components/Inspector/PushDetail.js +32 -23
- package/dist/commonjs/components/Inspector/PushTab.js +13 -13
- package/dist/commonjs/components/Inspector/ReduxDetail.js +32 -32
- package/dist/commonjs/components/Inspector/ReduxTab.js +14 -14
- package/dist/commonjs/components/Inspector/SettingsPanel.js +258 -139
- package/dist/commonjs/components/Inspector/SocketCard.d.ts +5 -0
- package/dist/commonjs/components/Inspector/SocketCard.js +116 -0
- package/dist/commonjs/components/Inspector/SocketDetail.d.ts +4 -0
- package/dist/commonjs/components/Inspector/SocketDetail.js +317 -0
- package/dist/commonjs/components/Inspector/SocketFilterModal.d.ts +13 -0
- package/dist/commonjs/components/Inspector/SocketFilterModal.js +69 -0
- package/dist/commonjs/components/Inspector/SocketTab.d.ts +3 -0
- package/dist/commonjs/components/Inspector/SocketTab.js +112 -0
- package/dist/commonjs/components/Inspector/StorageTab.js +34 -32
- package/dist/commonjs/components/Inspector/SupportModal.d.ts +7 -0
- package/dist/commonjs/components/Inspector/SupportModal.js +125 -0
- package/dist/commonjs/components/Inspector/SupportPage.d.ts +5 -0
- package/dist/commonjs/components/Inspector/SupportPage.js +227 -0
- package/dist/commonjs/components/Inspector/TabBar.js +24 -23
- package/dist/commonjs/components/Inspector/UpdateAvailableModal.js +24 -24
- package/dist/commonjs/components/JsonViewer.js +7 -7
- package/dist/commonjs/components/LogCard.d.ts +3 -2
- package/dist/commonjs/components/LogCard.js +17 -14
- package/dist/commonjs/components/LogSyntaxHighlighter.js +5 -5
- package/dist/commonjs/components/ModuleErrorBoundary.js +2 -2
- package/dist/commonjs/components/NetworkIcons.d.ts +15 -0
- package/dist/commonjs/components/NetworkIcons.js +38 -3
- package/dist/commonjs/components/SegmentedTabs.js +1 -1
- package/dist/commonjs/constants/version.d.ts +1 -1
- package/dist/commonjs/constants/version.js +1 -1
- package/dist/commonjs/customHooks/socketLogger.d.ts +26 -0
- package/dist/commonjs/customHooks/socketLogger.js +2 -0
- package/dist/commonjs/helpers/index.js +3 -3
- package/dist/commonjs/helpers/memoryManager.d.ts +1 -0
- package/dist/commonjs/helpers/memoryManager.js +1 -1
- package/dist/commonjs/helpers/searchQueryParser.d.ts +1 -1
- package/dist/commonjs/helpers/searchQueryParser.js +5 -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 +3 -1
- package/dist/commonjs/helpers/shareFormatter.js +8 -7
- package/dist/commonjs/i18n/index.d.ts +99 -1
- package/dist/commonjs/i18n/index.js +1 -1
- package/dist/commonjs/i18n/locales/ar.json +1 -1
- package/dist/commonjs/i18n/locales/bn.json +1 -0
- package/dist/commonjs/i18n/locales/de.json +1 -1
- package/dist/commonjs/i18n/locales/en.json +1 -1
- package/dist/commonjs/i18n/locales/es.json +1 -1
- package/dist/commonjs/i18n/locales/fr.json +1 -1
- package/dist/commonjs/i18n/locales/gu.json +1 -0
- package/dist/commonjs/i18n/locales/hi.json +1 -1
- package/dist/commonjs/i18n/locales/id.json +1 -0
- package/dist/commonjs/i18n/locales/it.json +1 -0
- package/dist/commonjs/i18n/locales/ja.json +1 -1
- package/dist/commonjs/i18n/locales/kn.json +1 -0
- package/dist/commonjs/i18n/locales/ko.json +1 -1
- package/dist/commonjs/i18n/locales/ml.json +1 -0
- package/dist/commonjs/i18n/locales/mr.json +1 -0
- package/dist/commonjs/i18n/locales/nl.json +1 -0
- package/dist/commonjs/i18n/locales/pa.json +1 -0
- package/dist/commonjs/i18n/locales/pl.json +1 -0
- package/dist/commonjs/i18n/locales/pt.json +1 -1
- package/dist/commonjs/i18n/locales/ru.json +1 -1
- package/dist/commonjs/i18n/locales/ta.json +1 -0
- package/dist/commonjs/i18n/locales/te.json +1 -0
- package/dist/commonjs/i18n/locales/tr.json +1 -0
- package/dist/commonjs/i18n/locales/vi.json +1 -0
- package/dist/commonjs/i18n/locales/zh.json +1 -1
- package/dist/commonjs/index.d.ts +13 -13
- package/dist/commonjs/index.js +5 -4
- package/dist/commonjs/native/NativeInspector.d.ts +1 -0
- package/dist/commonjs/socket.d.ts +4 -0
- package/dist/commonjs/socket.js +1 -0
- package/dist/commonjs/styles/index.d.ts +23 -0
- package/dist/commonjs/styles/index.js +1 -1
- package/dist/commonjs/types/enums.d.ts +40 -0
- package/dist/commonjs/types/enums.js +1 -1
- package/dist/commonjs/types/interfaces.d.ts +122 -1
- package/dist/esm/components/AnimatedBrandOwl.d.ts +7 -0
- package/dist/esm/components/AnimatedBrandOwl.js +175 -0
- package/dist/esm/components/AppHeaderLogo.d.ts +1 -0
- package/dist/esm/components/AppHeaderLogo.js +7 -5
- package/dist/esm/components/BrandSquareIcon.d.ts +5 -0
- package/dist/esm/components/BrandSquareIcon.js +139 -0
- package/dist/esm/components/ConsoleLogCard.d.ts +2 -1
- package/dist/esm/components/ConsoleLogCard.js +61 -77
- package/dist/esm/components/Inspector/AboutModal.js +85 -95
- package/dist/esm/components/Inspector/AnalyticsTab.js +31 -31
- package/dist/esm/components/Inspector/ConfirmationModal.d.ts +13 -0
- package/dist/esm/components/Inspector/ConfirmationModal.js +32 -0
- package/dist/esm/components/Inspector/ConsoleTab.js +49 -49
- package/dist/esm/components/Inspector/CrashTab.js +40 -38
- package/dist/esm/components/Inspector/DebuggingTab.js +29 -29
- package/dist/esm/components/Inspector/FabLauncher.js +50 -58
- package/dist/esm/components/Inspector/FeatureUnderDevNotice.js +7 -7
- package/dist/esm/components/Inspector/LanguageSelectorModal.d.ts +15 -0
- package/dist/esm/components/Inspector/LanguageSelectorModal.js +90 -0
- package/dist/esm/components/Inspector/MainScreen.js +123 -110
- package/dist/esm/components/Inspector/MediaGalleryTab.js +64 -62
- package/dist/esm/components/Inspector/MediaPreviewModal.js +107 -123
- package/dist/esm/components/Inspector/NetworkTab.js +90 -90
- package/dist/esm/components/Inspector/NpmUpdateToast.js +1 -1
- package/dist/esm/components/Inspector/PushCard.d.ts +3 -2
- package/dist/esm/components/Inspector/PushCard.js +23 -22
- package/dist/esm/components/Inspector/PushDetail.js +34 -25
- package/dist/esm/components/Inspector/PushTab.js +25 -25
- package/dist/esm/components/Inspector/ReduxDetail.js +42 -42
- package/dist/esm/components/Inspector/ReduxTab.js +35 -35
- package/dist/esm/components/Inspector/SettingsPanel.js +495 -376
- package/dist/esm/components/Inspector/SocketCard.d.ts +5 -0
- package/dist/esm/components/Inspector/SocketCard.js +116 -0
- package/dist/esm/components/Inspector/SocketDetail.d.ts +4 -0
- package/dist/esm/components/Inspector/SocketDetail.js +317 -0
- package/dist/esm/components/Inspector/SocketFilterModal.d.ts +13 -0
- package/dist/esm/components/Inspector/SocketFilterModal.js +69 -0
- package/dist/esm/components/Inspector/SocketTab.d.ts +3 -0
- package/dist/esm/components/Inspector/SocketTab.js +112 -0
- package/dist/esm/components/Inspector/StorageTab.js +136 -134
- package/dist/esm/components/Inspector/SupportModal.d.ts +7 -0
- package/dist/esm/components/Inspector/SupportModal.js +125 -0
- package/dist/esm/components/Inspector/SupportPage.d.ts +5 -0
- package/dist/esm/components/Inspector/SupportPage.js +227 -0
- package/dist/esm/components/Inspector/TabBar.js +36 -35
- package/dist/esm/components/Inspector/UpdateAvailableModal.js +22 -22
- package/dist/esm/components/JsonViewer.js +55 -55
- package/dist/esm/components/LogCard.d.ts +3 -2
- package/dist/esm/components/LogCard.js +61 -58
- package/dist/esm/components/LogSyntaxHighlighter.js +5 -5
- package/dist/esm/components/ModuleErrorBoundary.js +23 -23
- package/dist/esm/components/NetworkIcons.d.ts +15 -0
- package/dist/esm/components/NetworkIcons.js +38 -3
- package/dist/esm/components/SegmentedTabs.js +7 -7
- package/dist/esm/constants/version.d.ts +1 -1
- package/dist/esm/constants/version.js +1 -1
- package/dist/esm/customHooks/socketLogger.d.ts +26 -0
- package/dist/esm/customHooks/socketLogger.js +2 -0
- package/dist/esm/helpers/index.js +3 -3
- package/dist/esm/helpers/memoryManager.d.ts +1 -0
- package/dist/esm/helpers/memoryManager.js +1 -1
- package/dist/esm/helpers/searchQueryParser.d.ts +1 -1
- package/dist/esm/helpers/searchQueryParser.js +5 -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 +3 -1
- package/dist/esm/helpers/shareFormatter.js +8 -7
- package/dist/esm/i18n/index.d.ts +99 -1
- package/dist/esm/i18n/index.js +1 -1
- package/dist/esm/i18n/locales/ar.json +1 -1
- package/dist/esm/i18n/locales/bn.json +1 -0
- package/dist/esm/i18n/locales/de.json +1 -1
- package/dist/esm/i18n/locales/en.json +1 -1
- package/dist/esm/i18n/locales/es.json +1 -1
- package/dist/esm/i18n/locales/fr.json +1 -1
- package/dist/esm/i18n/locales/gu.json +1 -0
- package/dist/esm/i18n/locales/hi.json +1 -1
- package/dist/esm/i18n/locales/id.json +1 -0
- package/dist/esm/i18n/locales/it.json +1 -0
- package/dist/esm/i18n/locales/ja.json +1 -1
- package/dist/esm/i18n/locales/kn.json +1 -0
- package/dist/esm/i18n/locales/ko.json +1 -1
- package/dist/esm/i18n/locales/ml.json +1 -0
- package/dist/esm/i18n/locales/mr.json +1 -0
- package/dist/esm/i18n/locales/nl.json +1 -0
- package/dist/esm/i18n/locales/pa.json +1 -0
- package/dist/esm/i18n/locales/pl.json +1 -0
- package/dist/esm/i18n/locales/pt.json +1 -1
- package/dist/esm/i18n/locales/ru.json +1 -1
- package/dist/esm/i18n/locales/ta.json +1 -0
- package/dist/esm/i18n/locales/te.json +1 -0
- package/dist/esm/i18n/locales/tr.json +1 -0
- package/dist/esm/i18n/locales/vi.json +1 -0
- package/dist/esm/i18n/locales/zh.json +1 -1
- package/dist/esm/index.d.ts +13 -13
- package/dist/esm/index.js +8 -7
- package/dist/esm/native/NativeInspector.d.ts +1 -0
- package/dist/esm/socket.d.ts +4 -0
- package/dist/esm/socket.js +1 -0
- package/dist/esm/styles/index.d.ts +23 -0
- package/dist/esm/styles/index.js +1 -1
- package/dist/esm/types/enums.d.ts +40 -0
- package/dist/esm/types/enums.js +1 -1
- package/dist/esm/types/interfaces.d.ts +122 -1
- package/ios/NetworkInspectorModule.mm +102 -12
- package/package.json +204 -2
- package/src/native/NativeInspector.ts +8 -0
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import Q,{useState as
|
|
1
|
+
import Q,{useState as L,useEffect as le,useMemo as G,useCallback as Ie}from"react";import{ScrollView as O,View as T,Text as V,StyleSheet as We,TouchableOpacity as Te,Platform as Fe}from"react-native";import{useTranslation as Ae}from"../i18n";import Pe from"./TreeNode";import X from"./HighlightText";import D from"./TouchableScale";import{PrettyIcon as Ne,RawIcon as Oe,TableIcon as Le,ChevronIcon as De,CopyIcon as Ee,CheckIcon as Ke}from"./NetworkIcons";import{AppColors as t}from"../styles/AppColors";import{AppFonts as N}from"../styles/AppFonts";import{getSize as Me,copyToClipboard as ve}from"../helpers";import{triggerNativeHaptic as Je}from"../native/NativeInspector";const W=Fe.select({ios:"Menlo",android:"monospace",default:"monospace"}),$e=o=>o===null?{label:"null",color:t.errorColor,bg:t.errorCardBg,border:t.errorBorder}:o===void 0?{label:"undef",color:t.errorColor,bg:t.errorCardBg,border:t.errorBorder}:Array.isArray(o)?{label:`arr[${o.length}]`,color:t.blue600,bg:t.blueBg,border:t.sky100}:typeof o=="object"?{label:`obj{${Object.keys(o).length}}`,color:t.violet600,bg:t.purple50,border:t.purple200}:typeof o=="number"?{label:"num",color:t.amber600,bg:t.amber100,border:t.amber200}:typeof o=="boolean"?{label:"bool",color:t.pink600,bg:t.roseBg,border:t.roseBorder}:{label:"str",color:t.emerald600,bg:t.emeraldBg,border:t.emeraldBorder},Se=Q.memo(({text:o,search:S,detectLinks:A})=>{const B=o.trim();let z=e.rawMonospaceText;return B.startsWith('"')?z=e.syntaxString:B==="null"||B.startsWith("null,")||B==="undefined"?z=e.syntaxNull:B==="true"||B.startsWith("true,")||B==="false"||B.startsWith("false,")?z=e.syntaxBoolean:/^-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?,?$/.test(B)&&(z=e.syntaxNumber),<X text={o}search={S}detectLinks={A}style={z}selectable={!0}highlightStyle={e.highlight}/>}),Ge=Q.memo(({line:o,search:S,detectLinks:A})=>{const B=o.match(/^(\s+)(.*)$/),z=B?B[1]:"",P=B?B[2]:o,j=z?z.replace(/ /g,"\xB7 ").replace(/ /g,"\xB7"):"",R=P.match(/^("(?:[^"\\]|\\.)*")(\s*:\s*)(.*)$/);if(R){const H=R[1],K=R[2],I=R[3];return<T style={e.rawLineContentRow}>
|
|
2
2
|
{j.length>0&&<V style={e.indentDots}>{j}</V>}
|
|
3
|
-
<X text={
|
|
3
|
+
<X text={H}search={S}style={e.syntaxKey}selectable={!0}highlightStyle={e.highlight}/>
|
|
4
4
|
<V style={e.syntaxColon}>{K}</V>
|
|
5
|
-
<Se text={
|
|
5
|
+
<Se text={I}search={S}detectLinks={A}/>
|
|
6
6
|
</T>}return<T style={e.rawLineContentRow}>
|
|
7
7
|
{j.length>0&&<V style={e.indentDots}>{j}</V>}
|
|
8
8
|
<Se text={P}search={S}detectLinks={A}/>
|
|
9
|
-
</T>}),Ye=Q.memo(({itemKey:o,val:S,search:A,index:B})=>{const[
|
|
10
|
-
`)||
|
|
9
|
+
</T>}),Ye=Q.memo(({itemKey:o,val:S,search:A,index:B})=>{const[z,P]=L(!1),j=S!==null&&typeof S=="object",R=$e(S);let H="";if(S===null)H="null";else if(S===void 0)H="undefined";else if(j)try{H=JSON.stringify(S,null,2)}catch{H=String(S)}else H=String(S);const K=H.includes(`
|
|
10
|
+
`)||H.length>80;return<T style={[e.tableRow,B%2===1&&e.tableRowAlt]}>
|
|
11
11
|
|
|
12
12
|
<T style={e.tableColKey}>
|
|
13
13
|
<X text={o}search={A}style={e.tableCellKey}highlightStyle={e.highlight}/>
|
|
14
|
-
<T style={[e.typePill,{backgroundColor:
|
|
15
|
-
<V style={[e.typePillText,{color:
|
|
16
|
-
{
|
|
14
|
+
<T style={[e.typePill,{backgroundColor:R.bg,borderColor:R.border}]}>
|
|
15
|
+
<V style={[e.typePillText,{color:R.color}]}>
|
|
16
|
+
{R.label}
|
|
17
17
|
</V>
|
|
18
18
|
</T>
|
|
19
19
|
</T>
|
|
@@ -21,29 +21,29 @@ import Q,{useState as D,useEffect as le,useMemo as G,useCallback as He}from"reac
|
|
|
21
21
|
|
|
22
22
|
<T style={e.tableColVal}>
|
|
23
23
|
<T style={j?e.tableCodeBox:void 0}>
|
|
24
|
-
<X text={
|
|
24
|
+
<X text={H}search={A}style={[e.tableCellValue,S==null?e.syntaxNull:void 0,typeof S=="number"?e.syntaxNumber:void 0,typeof S=="boolean"?e.syntaxBoolean:void 0,typeof S=="string"?e.syntaxString:void 0]}highlightStyle={e.highlight}numberOfLines={z?void 0:3}selectable={!0}/>
|
|
25
25
|
</T>
|
|
26
|
-
{K&&<Te onPress={()=>P(
|
|
26
|
+
{K&&<Te onPress={()=>P(I=>!I)}hitSlop={6}style={e.showMoreBtn}>
|
|
27
27
|
<V style={e.showMoreText}>
|
|
28
|
-
{
|
|
28
|
+
{z?"Collapse":"Expand"}
|
|
29
29
|
</V>
|
|
30
|
-
<
|
|
30
|
+
<De direction={z?"up":"down"}size={9}color="#4F46E5"/>
|
|
31
31
|
</Te>}
|
|
32
32
|
</T>
|
|
33
|
-
</T>}),qe=Q.memo(({data:o,search:S,forceOpen:A,defaultExpandDepth:B=1,wrap:
|
|
34
|
-
`):[""],[te]),Ue=G(()=>
|
|
35
|
-
`).length:1,[
|
|
33
|
+
</T>}),qe=Q.memo(({data:o,search:S,forceOpen:A,defaultExpandDepth:B=1,wrap:z,fullHeight:P=!1,maxHeight:j,mode:R,onModeChange:H,hideTabs:K=!1})=>{const{t:I}=Ae(),[Ce,ne]=L(R??"raw"),[ie,ae]=L(!1),[M,se]=L(z??!0),[v,Ve]=L("compact"),[J,ce]=L(A),[Be,ze]=L(!1),k=H&&R?R:Ce,Z=C=>{ne(C),H&&H(C)};le(()=>{z!==void 0&&se(z)},[z]),le(()=>{A!==void 0&&ce(A)},[A]),le(()=>{R&&ne(R)},[R]);const E=G(()=>{if(o==null)return"";if(typeof o=="string"){const C=o.trim();try{const F=JSON.parse(C);return JSON.stringify(F,null,2)}catch{return o}}try{return JSON.stringify(o,null,2)??""}catch{return String(o)||""}},[o]),ee=G(()=>{if(typeof o=="string"){const C=o.trim();try{const F=JSON.parse(C);return JSON.stringify(F)}catch{return o}}try{return JSON.stringify(o)??""}catch{return String(o)||""}},[o]),de=v==="formatted"?E:ee,ge=5e4,$=typeof de=="string"?de:"",ye=$.length>ge&&!Be,te=ye?$.slice(0,ge):$,oe=G(()=>te?te.split(`
|
|
34
|
+
`):[""],[te]),Ue=G(()=>k==="raw"?oe.length:E?E.split(`
|
|
35
|
+
`).length:1,[k,oe.length,E]),_e=G(()=>Me(o),[o]),Re=Ie(()=>{Je("success"),ve(v==="compact"?ee:E,"JSON"),ae(!0),setTimeout(()=>ae(!1),1200)},[v,ee,E]),re=typeof o=="object"&&o!==null,ke=o==null||re&&Object.keys(o).length===0,pe=()=>{if(!re)return<T style={e.tableRow}>
|
|
36
36
|
<T style={e.tableColKey}>
|
|
37
37
|
<V style={e.tableCellKey}>
|
|
38
|
-
{
|
|
38
|
+
{I("network.jsonViewer.value")}
|
|
39
39
|
</V>
|
|
40
40
|
</T>
|
|
41
41
|
<T style={e.tableColVal}>
|
|
42
42
|
<V style={e.tableCellValue}>{String(o)}</V>
|
|
43
43
|
</T>
|
|
44
|
-
</T>;let C=Object.keys(o);if(S&&S.trim().length>0){const
|
|
44
|
+
</T>;let C=Object.keys(o);if(S&&S.trim().length>0){const F=S.trim().toLowerCase();C=C.filter(U=>{const _=o[U],He=typeof _=="object"&&_!==null?JSON.stringify(_):String(_);return U.toLowerCase().includes(F)||He.toLowerCase().includes(F)})}return C.length===0?<T style={e.emptyContainer}>
|
|
45
45
|
<V style={e.emptyText}>
|
|
46
|
-
{S&&S.trim().length>0?"No matching keys or values found":
|
|
46
|
+
{S&&S.trim().length>0?"No matching keys or values found":I("network.jsonViewer.emptyTable")}
|
|
47
47
|
</V>
|
|
48
48
|
</T>:<T style={e.tableView}>
|
|
49
49
|
|
|
@@ -53,13 +53,13 @@ import Q,{useState as D,useEffect as le,useMemo as G,useCallback as He}from"reac
|
|
|
53
53
|
</V>
|
|
54
54
|
<V style={[e.tableHeaderCell,{flex:3}]}>VALUE</V>
|
|
55
55
|
</T>
|
|
56
|
-
{C.map((
|
|
56
|
+
{C.map((F,U)=><Ye key={F}index={U}itemKey={F}val={o[F]}search={S}/>)}
|
|
57
57
|
</T>},Y=<Pe data={o}search={S}forceOpen={J}defaultExpandDepth={J?99:B}/>,q=()=><T style={e.rawLinesWrapper}>
|
|
58
|
-
{oe.map((C,
|
|
58
|
+
{oe.map((C,F)=><T key={F}style={e.rawCodeLineRow}>
|
|
59
59
|
|
|
60
60
|
<T style={e.gutterCell}>
|
|
61
61
|
<V style={e.gutterNumber}selectable={!1}>
|
|
62
|
-
{
|
|
62
|
+
{F+1}
|
|
63
63
|
</V>
|
|
64
64
|
</T>
|
|
65
65
|
|
|
@@ -68,7 +68,7 @@ import Q,{useState as D,useEffect as le,useMemo as G,useCallback as He}from"reac
|
|
|
68
68
|
<Ge line={C}search={S}detectLinks={$.length<2e4}/>
|
|
69
69
|
</T>
|
|
70
70
|
</T>)}
|
|
71
|
-
</T>,ue=()=>ye?<Te onPress={()=>
|
|
71
|
+
</T>,ue=()=>ye?<Te onPress={()=>ze(!0)}activeOpacity={.8}style={e.truncationBanner}>
|
|
72
72
|
<V style={e.truncationText}>
|
|
73
73
|
Showing first 50 KB ({Math.round($.length/1024)} KB
|
|
74
74
|
total) · Tap to load full payload
|
|
@@ -78,65 +78,65 @@ import Q,{useState as D,useEffect as le,useMemo as G,useCallback as He}from"reac
|
|
|
78
78
|
<T style={e.snippetHeader}>
|
|
79
79
|
|
|
80
80
|
{!K&&<T style={e.snippetTabs}>
|
|
81
|
-
<
|
|
82
|
-
<Oe color={
|
|
83
|
-
<V style={[e.snippetTabText,
|
|
84
|
-
{
|
|
81
|
+
<D onPress={()=>Z("raw")}style={[e.snippetTabBtn,k==="raw"&&e.snippetTabBtnActive]}>
|
|
82
|
+
<Oe color={k==="raw"?t.white:t.grayText}size={11.5}/>
|
|
83
|
+
<V style={[e.snippetTabText,k==="raw"&&e.snippetTabTextActive]}>
|
|
84
|
+
{I("network.jsonViewer.raw","Raw")}
|
|
85
85
|
</V>
|
|
86
|
-
</
|
|
86
|
+
</D>
|
|
87
87
|
|
|
88
|
-
<
|
|
89
|
-
<Ne color={
|
|
90
|
-
<V style={[e.snippetTabText,
|
|
91
|
-
{
|
|
88
|
+
<D onPress={()=>Z("pretty")}style={[e.snippetTabBtn,k==="pretty"&&e.snippetTabBtnActive]}>
|
|
89
|
+
<Ne color={k==="pretty"?t.white:t.grayText}size={11.5}/>
|
|
90
|
+
<V style={[e.snippetTabText,k==="pretty"&&e.snippetTabTextActive]}>
|
|
91
|
+
{I("network.jsonViewer.pretty","Pretty")}
|
|
92
92
|
</V>
|
|
93
|
-
</
|
|
93
|
+
</D>
|
|
94
94
|
|
|
95
|
-
<
|
|
96
|
-
<
|
|
97
|
-
<V style={[e.snippetTabText,
|
|
98
|
-
{
|
|
95
|
+
<D onPress={()=>Z("table")}style={[e.snippetTabBtn,k==="table"&&e.snippetTabBtnActive]}>
|
|
96
|
+
<Le color={k==="table"?t.white:t.grayText}size={11.5}/>
|
|
97
|
+
<V style={[e.snippetTabText,k==="table"&&e.snippetTabTextActive]}>
|
|
98
|
+
{I("network.jsonViewer.table","Table")}
|
|
99
99
|
</V>
|
|
100
|
-
</
|
|
100
|
+
</D>
|
|
101
101
|
</T>}
|
|
102
102
|
|
|
103
103
|
|
|
104
104
|
<T style={e.headerRight}>
|
|
105
105
|
|
|
106
|
-
{
|
|
107
|
-
<
|
|
106
|
+
{k==="raw"&&<>
|
|
107
|
+
<D onPress={()=>Ve(C=>C==="compact"?"formatted":"compact")}style={[e.toolToggleBtn,v==="compact"&&e.toolToggleBtnActive]}>
|
|
108
108
|
<V style={[e.toolToggleText,v==="compact"&&e.toolToggleTextActive]}>
|
|
109
|
-
{
|
|
109
|
+
{I("jsonViewer.min","Min")}
|
|
110
110
|
</V>
|
|
111
|
-
</
|
|
111
|
+
</D>
|
|
112
112
|
|
|
113
|
-
<
|
|
113
|
+
<D onPress={()=>se(C=>!C)}style={[e.toolToggleBtn,M&&e.toolToggleBtnActive]}>
|
|
114
114
|
<V style={[e.toolToggleText,M&&e.toolToggleTextActive]}>
|
|
115
|
-
{
|
|
115
|
+
{I("jsonViewer.wrap","Wrap")}
|
|
116
116
|
</V>
|
|
117
|
-
</
|
|
117
|
+
</D>
|
|
118
118
|
</>}
|
|
119
119
|
|
|
120
120
|
|
|
121
|
-
{
|
|
121
|
+
{k==="pretty"&&re&&<D onPress={()=>ce(C=>!C)}style={[e.toolToggleBtn,J&&e.toolToggleBtnActive]}>
|
|
122
122
|
<V style={[e.toolToggleText,J&&e.toolToggleTextActive]}>
|
|
123
|
-
{J?
|
|
123
|
+
{J?I("jsonViewer.fold","Fold"):I("jsonViewer.expand","Expand")}
|
|
124
124
|
</V>
|
|
125
|
-
</
|
|
125
|
+
</D>}
|
|
126
126
|
|
|
127
127
|
|
|
128
|
-
<
|
|
129
|
-
{ie?<Ke color={t.emerald500}size={13}/>:<
|
|
130
|
-
</
|
|
128
|
+
<D onPress={Re}hitSlop={6}style={[e.copyBtn,ie&&e.copyBtnSuccess]}>
|
|
129
|
+
{ie?<Ke color={t.emerald500}size={13}/>:<Ee color={t.grayText}size={13}/>}
|
|
130
|
+
</D>
|
|
131
131
|
</T>
|
|
132
132
|
</T>
|
|
133
133
|
|
|
134
134
|
|
|
135
135
|
<T style={[e.editorBody,P&&{flex:1,maxHeight:void 0},!P&&j!=null&&{maxHeight:j}]}>
|
|
136
136
|
|
|
137
|
-
{
|
|
137
|
+
{k==="pretty"&&(ke?<T style={e.emptyContainer}>
|
|
138
138
|
<V style={e.emptyText}>
|
|
139
|
-
{
|
|
139
|
+
{I("network.jsonViewer.emptyPayload")}
|
|
140
140
|
</V>
|
|
141
141
|
</T>:M?P?<O style={{flex:1}}contentContainerStyle={e.prettyContainer}showsVerticalScrollIndicator={!0}>
|
|
142
142
|
{Y}
|
|
@@ -149,7 +149,7 @@ import Q,{useState as D,useEffect as le,useMemo as G,useCallback as He}from"reac
|
|
|
149
149
|
</O>)}
|
|
150
150
|
|
|
151
151
|
|
|
152
|
-
{
|
|
152
|
+
{k==="raw"&&(P?<O style={e.fullHeightScrollView}contentContainerStyle={e.fullHeightScrollContent}showsVerticalScrollIndicator={!0}showsHorizontalScrollIndicator={!1}>
|
|
153
153
|
{M?<T style={e.rawEditorFullWidth}>
|
|
154
154
|
{q()}
|
|
155
155
|
</T>:<O horizontal showsHorizontalScrollIndicator={!0}contentContainerStyle={e.rawHorizontalContent}>
|
|
@@ -170,8 +170,8 @@ import Q,{useState as D,useEffect as le,useMemo as G,useCallback as He}from"reac
|
|
|
170
170
|
</T>)}
|
|
171
171
|
|
|
172
172
|
|
|
173
|
-
{
|
|
173
|
+
{k==="table"&&(P?<O style={{flex:1}}contentContainerStyle={{flexGrow:1}}showsVerticalScrollIndicator={!0}>
|
|
174
174
|
{pe()}
|
|
175
175
|
</O>:<T style={e.tableView}>{pe()}</T>)}
|
|
176
176
|
</T>
|
|
177
|
-
</T>}),e=
|
|
177
|
+
</T>}),e=We.create({container:{backgroundColor:t.white,borderRadius:12,borderWidth:1,borderColor:t.grayBorderSecondary,overflow:"hidden",shadowColor:t.brandPurple,shadowOpacity:.04,shadowRadius:6,shadowOffset:{width:0,height:2},elevation:2,width:"100%"},snippetHeader:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",backgroundColor:t.grayBackground,borderBottomWidth:1,borderBottomColor:t.grayBorderSecondary,paddingHorizontal:8,paddingVertical:5,gap:6,minHeight:38},headerLeft:{flexDirection:"row",alignItems:"center",gap:5,flexShrink:1,minWidth:0},langBadge:{flexDirection:"row",alignItems:"center",backgroundColor:t.white,borderRadius:6,borderWidth:1,borderColor:t.grayBorderSecondary,paddingHorizontal:6,paddingVertical:2.5,gap:4.5},langDot:{width:5,height:5,borderRadius:2.5,backgroundColor:t.emerald500},langBadgeText:{fontFamily:W,fontSize:9.5,color:t.primaryBlack,fontWeight:"700",letterSpacing:.3},metaBadge:{backgroundColor:t.white,borderRadius:6,borderWidth:1,borderColor:t.grayBorderSecondary,paddingHorizontal:6,paddingVertical:2.5,flexShrink:1},metaBadgeText:{fontFamily:W,fontSize:9.5,color:t.grayTextWeak,fontWeight:"600"},headerRight:{flexDirection:"row",alignItems:"center",gap:4.5,flexShrink:0},snippetTabs:{flexDirection:"row",alignItems:"center",backgroundColor:`${t.slate200}80`,borderRadius:8,padding:2.5,borderWidth:1,borderColor:t.dividerColor,gap:2},snippetTabBtn:{flexDirection:"row",alignItems:"center",gap:4,paddingVertical:3.5,paddingHorizontal:8,borderRadius:6},snippetTabBtnActive:{backgroundColor:t.brandPurple,shadowColor:t.brandPurple,shadowOffset:{width:0,height:1},shadowOpacity:.25,shadowRadius:2,elevation:1},snippetTabText:{fontFamily:N.interSemiBold,fontSize:10.5,color:t.grayText},snippetTabTextActive:{color:t.white,fontFamily:N.interBold},toolToggleBtn:{paddingHorizontal:8,paddingVertical:3.5,borderRadius:6,backgroundColor:t.white,borderWidth:1,borderColor:t.grayBorderSecondary,alignItems:"center",justifyContent:"center"},toolToggleBtnActive:{backgroundColor:t.purpleShade50,borderColor:`${t.brandPurple}60`},toolToggleText:{fontFamily:N.interSemiBold,fontSize:10.5,color:t.grayText},toolToggleTextActive:{color:t.brandPurple,fontFamily:N.interBold},copyBtn:{width:27,height:27,borderRadius:6,backgroundColor:t.white,borderWidth:1,borderColor:t.grayBorderSecondary,alignItems:"center",justifyContent:"center"},copyBtnSuccess:{borderColor:t.greenMintBorder,backgroundColor:t.greenMintBg},editorBody:{backgroundColor:t.white,minHeight:80},prettyContainer:{padding:10,minWidth:"100%",backgroundColor:t.white},fullHeightScrollView:{flex:1},fullHeightScrollContent:{flexGrow:1},rawEditorAutoHeight:{width:"100%"},rawEditorFullWidth:{width:"100%"},rawHorizontalContent:{minWidth:"100%"},rawLinesWrapper:{paddingVertical:6,backgroundColor:t.white,width:"100%"},rawCodeLineRow:{flexDirection:"row",alignItems:"flex-start",minHeight:20,width:"100%"},gutterCell:{width:38,paddingRight:8,paddingTop:1,alignItems:"flex-end",justifyContent:"flex-start",borderRightWidth:1,borderRightColor:t.grayBorderSecondary,backgroundColor:t.grayBackground,userSelect:"none"},gutterNumber:{fontFamily:W,fontSize:11,lineHeight:18,color:t.slate400,textAlign:"right"},rawTextCell:{flex:1,paddingLeft:8,paddingRight:8,paddingTop:1,alignItems:"flex-start"},rawLineContentRow:{flexDirection:"row",alignItems:"flex-start",flexWrap:"wrap",minHeight:18},indentDots:{fontFamily:W,fontSize:11.5,lineHeight:18,color:t.gray300,letterSpacing:.5},rawMonospaceText:{fontFamily:W,fontSize:11.5,lineHeight:18,color:t.slate900},syntaxKey:{fontFamily:W,fontSize:11.5,lineHeight:18,color:t.syntaxKey,fontWeight:"700"},syntaxColon:{fontFamily:W,fontSize:11.5,lineHeight:18,color:t.syntaxColon,marginRight:4},syntaxString:{fontFamily:W,fontSize:11.5,lineHeight:18,color:t.syntaxString},syntaxNumber:{fontFamily:W,fontSize:11.5,lineHeight:18,color:t.syntaxNumber},syntaxBoolean:{fontFamily:W,fontSize:11.5,lineHeight:18,color:t.syntaxBoolean},syntaxNull:{fontFamily:W,fontSize:11.5,lineHeight:18,color:t.syntaxNull,fontStyle:"italic"},truncationBanner:{margin:10,backgroundColor:t.purple50,paddingVertical:8,paddingHorizontal:12,borderRadius:6,alignItems:"center",borderWidth:1,borderColor:t.purple200},truncationText:{fontFamily:N.interSemiBold,fontSize:11,color:t.brandPurple},tableView:{flex:1,width:"100%"},tableHeaderRow:{flexDirection:"row",backgroundColor:t.slate100,borderBottomWidth:1,borderBottomColor:t.slate200,paddingVertical:7,paddingHorizontal:12},tableHeaderCell:{fontFamily:N.interBold,fontSize:10.5,color:t.slate600,letterSpacing:.5,textTransform:"uppercase"},tableRow:{flexDirection:"row",borderBottomWidth:1,borderBottomColor:t.slate100,paddingVertical:8,paddingHorizontal:12,alignItems:"flex-start",backgroundColor:t.white},tableRowAlt:{backgroundColor:t.slate50},tableColKey:{flex:2,paddingRight:8},tableColVal:{flex:3},tableCellKey:{fontFamily:W,fontSize:11.5,fontWeight:"700",color:t.brandPurple},typePill:{alignSelf:"flex-start",borderRadius:4,borderWidth:1,paddingHorizontal:4,paddingVertical:1,marginTop:3},typePillText:{fontFamily:N.interBold,fontSize:9},tableCellValue:{fontFamily:W,fontSize:11.5,color:t.slate900,lineHeight:17},tableCodeBox:{backgroundColor:t.slate100,borderRadius:6,borderWidth:1,borderColor:t.slate200,padding:6},showMoreBtn:{flexDirection:"row",alignItems:"center",gap:4,alignSelf:"flex-start",marginTop:4,paddingVertical:2,paddingHorizontal:4},showMoreText:{fontFamily:N.interSemiBold,fontSize:10.5,color:t.brandPurple},emptyContainer:{padding:24,alignItems:"center",justifyContent:"center"},emptyText:{fontFamily:N.interMedium,fontSize:12,color:t.slate500},highlight:{backgroundColor:t.yellow200,color:t.yellow800,fontFamily:W,fontWeight:"700",borderRadius:2,paddingHorizontal:2}});export default qe;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { LogCardProps } from '../types';
|
|
3
|
-
declare
|
|
4
|
-
|
|
3
|
+
declare function LogCard({ item, onPress, timelineMinStart, timelineTotalRange, isNew, isSelected, onToggleSelect, searchStr, }: LogCardProps): React.JSX.Element;
|
|
4
|
+
declare const _default: React.MemoExoticComponent<typeof LogCard>;
|
|
5
|
+
export default _default;
|
|
@@ -1,108 +1,111 @@
|
|
|
1
|
-
import
|
|
1
|
+
import re,{useEffect as te,useRef as oe,useMemo as ne}from"react";import{Alert as ae,Animated as D,Linking as F,View as C,Pressable as A,Text as T,StyleSheet as E}from"react-native";import Ce,{Path as Te}from"react-native-svg";import{AppColors as r}from"../styles/AppColors";import{METHOD_COLORS as U}from"../constants";import{getStatusColor as Se,getDurationColor as Be,formatDateTime as Re,getSize as He,getPath as Ve,getBaseUrl as ze}from"../helpers";import{CalendarIcon as Ie,ClockIcon as N,SizeIcon as Le,CircleCheckIcon as $e,CircleAlertIcon as Oe,CircleXIcon as We,RepeatIcon as De,ForwardChevronIcon as Fe,GlobeIcon as Pe}from"./NetworkIcons";import{AppFonts as S}from"../styles/AppFonts";import Me from"./HighlightText";import Ae from"./TouchableScale";import{useTranslation as Ee}from"../i18n";function Ue({item:e,onPress:B,timelineMinStart:Ne,timelineTotalRange:Ge,isNew:$,isSelected:P,onToggleSelect:G,searchStr:J}){const{t:z}=Ee(),j=U[e.method]??U.ALL,H=ne(()=>{try{const o=new URL(e.url),L=o.host,M=o.pathname+(o.search?o.search:""),ee=o.protocol==="https:";return{host:L,path:M||"/",isHttps:ee}}catch{const o=e.url.toLowerCase().startsWith("https:"),L=Ve(e.url);return{host:ze(e.url).replace(/^https?:\/\//,""),path:L||e.url,isHttps:o}}},[e.url]),K=o=>{o?.stopPropagation?.(),ae.alert(z("common.openInBrowser")||"Open in Browser",`${z("common.openInBrowserPrompt")||"Are you sure you want to open this URL in your external browser?"}
|
|
2
2
|
|
|
3
|
-
${
|
|
4
|
-
<
|
|
5
|
-
<C style={
|
|
3
|
+
${e.url}`,[{text:z("common.cancel")||"Cancel",style:"cancel"},{text:z("common.open")||"Open",onPress:()=>{F.canOpenURL(e.url).then(L=>{L?F.openURL(e.url):F.openURL(e.url).catch(()=>{})}).catch(()=>{})}}])},R=e.status===0||e.status!=null&&e.status>=400,V=e.status==null,O=Se(e.status),I=Be(e.duration),Q=V?r.darkOrange:R?r.errorColor:r.greenColor,W=oe(new D.Value($?.35:0)).current;te(()=>{$&&D.timing(W,{toValue:0,duration:1200,useNativeDriver:!0}).start()},[$,W]);const X=()=>{if(V)return"...";if(e.status===0||e.status==null)return z("network.statusFailed")||"FAILED";const o=typeof e.status=="number"?e.status:parseInt(String(e.status||0),10);return o===200?"200 OK":o===201?"201 Created":o===204?"204 No Content":o===304?"304 Not Modified":o===400?"400 Bad Req":o===401?"401 Unauth":o===403?"403 Forbidden":o===404?"404 Not Found":o===500?"500 Error":String(e.status)},_=()=>{if(V)return<N color={r.darkOrange}size={10}/>;const o=typeof e.status=="number"?e.status:parseInt(String(e.status||0),10);return o>=200&&o<300?<$e color={r.greenColor}size={10}/>:o>=300&&o<400?<De color={r.amber700}size={10}/>:o>=400&&o<500?<Oe color={r.darkOrange}size={10}/>:<We color={r.errorColor}size={10}/>},Y=Re(e.startTime),Z=e.url.split("?")[0].toLowerCase().endsWith(".json");return<C style={t.container}>
|
|
4
|
+
<Ae onPress={B}style={[t.card,{borderLeftWidth:3.5,borderLeftColor:Q,backgroundColor:R?r.errorCardBg:r.white}]}>
|
|
5
|
+
<C style={t.cardBody}>
|
|
6
6
|
|
|
7
|
-
<C style={
|
|
8
|
-
<C style={
|
|
9
|
-
<
|
|
10
|
-
{
|
|
11
|
-
<Te d="M20 6L9 17l-5-5"stroke={
|
|
7
|
+
<C style={t.cardHeaderRow}>
|
|
8
|
+
<C style={t.cardHeaderLeft}>
|
|
9
|
+
<A onPress={()=>G(e.id)}hitSlop={12}style={[t.smallCheckbox,P&&t.smallCheckboxChecked]}>
|
|
10
|
+
{P&&<Ce width={9}height={9}viewBox="0 0 24 24"fill="none">
|
|
11
|
+
<Te d="M20 6L9 17l-5-5"stroke={r.white}strokeWidth="4"strokeLinecap="round"strokeLinejoin="round"/>
|
|
12
12
|
</Ce>}
|
|
13
|
-
</
|
|
13
|
+
</A>
|
|
14
14
|
|
|
15
|
-
<T style={
|
|
15
|
+
<T style={t.serialNumber}>#{e.id+1}</T>
|
|
16
16
|
|
|
17
|
-
<C style={[
|
|
18
|
-
<T style={
|
|
19
|
-
{
|
|
17
|
+
<C style={[t.methodBadge,{backgroundColor:j}]}>
|
|
18
|
+
<T style={t.methodBadgeText}>
|
|
19
|
+
{e.method}
|
|
20
20
|
</T>
|
|
21
21
|
</C>
|
|
22
22
|
|
|
23
|
-
{
|
|
24
|
-
<T style={[
|
|
25
|
-
{
|
|
23
|
+
{e.client&&<C style={[t.chip,{backgroundColor:e.client==="axios"?`${r.purple}14`:e.client==="apollo"||e.client==="graphql"?`${r.pink500}14`:e.client==="xhr"?`${r.amber500}14`:`${r.sky500}14`,borderColor:e.client==="axios"?`${r.purple}30`:e.client==="apollo"||e.client==="graphql"?`${r.pink500}30`:e.client==="xhr"?`${r.amber500}30`:`${r.sky500}30`}]}>
|
|
24
|
+
<T style={[t.chipText,{color:e.client==="axios"?r.purple:e.client==="apollo"||e.client==="graphql"?r.pink500:e.client==="xhr"?r.amber700:r.sky600}]}>
|
|
25
|
+
{e.client.toUpperCase()}
|
|
26
26
|
</T>
|
|
27
27
|
</C>}
|
|
28
28
|
|
|
29
29
|
|
|
30
|
-
{(
|
|
31
|
-
<T style={[
|
|
30
|
+
{(e.url.toLowerCase().includes("graphql")||e.client==="apollo"||e.client==="graphql")&&<C style={[t.chip,{backgroundColor:r.roseBg,borderColor:r.roseBorder}]}>
|
|
31
|
+
<T style={[t.chipText,{color:r.pink600}]}>
|
|
32
32
|
GQL
|
|
33
33
|
</T>
|
|
34
34
|
</C>}
|
|
35
35
|
</C>
|
|
36
36
|
|
|
37
|
-
<C style={
|
|
38
|
-
<C style={[
|
|
39
|
-
{
|
|
40
|
-
<T style={[
|
|
41
|
-
{
|
|
37
|
+
<C style={t.cardHeaderRight}>
|
|
38
|
+
<C style={[t.statusPill,{backgroundColor:R?`${r.errorColor}14`:V?`${r.darkOrange}14`:`${O}14`,borderColor:R?`${r.errorColor}33`:V?`${r.darkOrange}33`:`${O}33`}]}>
|
|
39
|
+
{_()}
|
|
40
|
+
<T style={[t.statusPillText,{color:R?r.errorColor:V?r.darkOrange:O}]}>
|
|
41
|
+
{X()}
|
|
42
42
|
</T>
|
|
43
43
|
</C>
|
|
44
|
-
<
|
|
44
|
+
<A onPress={K}hitSlop={8}style={t.globeBtn}accessibilityRole="button"accessibilityLabel="Open in Browser">
|
|
45
|
+
<Pe color={r.grayTextWeak}size={12}/>
|
|
46
|
+
</A>
|
|
47
|
+
<Fe color={r.grayTextWeak}size={13}/>
|
|
45
48
|
</C>
|
|
46
49
|
</C>
|
|
47
50
|
|
|
48
51
|
|
|
49
|
-
<
|
|
50
|
-
<C style={
|
|
51
|
-
<
|
|
52
|
-
<C style={
|
|
53
|
-
{
|
|
54
|
-
<T style={
|
|
52
|
+
<C style={t.urlBox}>
|
|
53
|
+
<C style={t.urlMainRow}>
|
|
54
|
+
<Me text={H.path}search={J}style={t.pathText}highlightStyle={t.highlight}numberOfLines={1}ellipsizeMode="middle"/>
|
|
55
|
+
<C style={t.urlBadgeRow}>
|
|
56
|
+
{Z&&<C style={t.jsonBadge}>
|
|
57
|
+
<T style={t.jsonBadgeText}>.json</T>
|
|
55
58
|
</C>}
|
|
56
|
-
{
|
|
57
|
-
<T style={
|
|
59
|
+
{e.duplicateCount!=null&&e.duplicateCount>1&&<C style={t.dupBadge}>
|
|
60
|
+
<T style={t.dupBadgeText}>×{e.duplicateCount}</T>
|
|
58
61
|
</C>}
|
|
59
62
|
</C>
|
|
60
63
|
</C>
|
|
61
64
|
|
|
62
|
-
<C style={
|
|
63
|
-
<C style={[
|
|
64
|
-
<T style={[
|
|
65
|
+
<C style={t.hostRow}>
|
|
66
|
+
<C style={[t.protoBadge,{backgroundColor:H.isHttps?`${r.emerald600}12`:`${r.amber600}12`,borderColor:H.isHttps?`${r.emerald600}2B`:`${r.amber600}2B`}]}>
|
|
67
|
+
<T style={[t.protoBadgeText,{color:H.isHttps?r.emerald600:r.amber700}]}>
|
|
65
68
|
{H.isHttps?"HTTPS":"HTTP"}
|
|
66
69
|
</T>
|
|
67
70
|
</C>
|
|
68
|
-
<T style={
|
|
69
|
-
{H.host||
|
|
71
|
+
<T style={t.hostText}numberOfLines={1}ellipsizeMode="tail">
|
|
72
|
+
{H.host||e.url}
|
|
70
73
|
</T>
|
|
71
74
|
</C>
|
|
72
|
-
</
|
|
75
|
+
</C>
|
|
73
76
|
|
|
74
77
|
|
|
75
|
-
<C style={
|
|
76
|
-
<C style={
|
|
77
|
-
<C style={
|
|
78
|
-
<
|
|
79
|
-
<T style={
|
|
78
|
+
<C style={t.cardFooterRow}>
|
|
79
|
+
<C style={t.footerLeft}>
|
|
80
|
+
<C style={t.cardDateRow}>
|
|
81
|
+
<Ie color={r.grayTextWeak}size={10}/>
|
|
82
|
+
<T style={t.cardDateText}numberOfLines={1}>{Y}</T>
|
|
80
83
|
</C>
|
|
81
84
|
</C>
|
|
82
85
|
|
|
83
|
-
<C style={
|
|
84
|
-
{
|
|
85
|
-
<
|
|
86
|
-
<T style={
|
|
87
|
-
{
|
|
86
|
+
<C style={t.footerRight}>
|
|
87
|
+
{e.response!=null&&<C style={t.metaStatChip}>
|
|
88
|
+
<Le color={r.purple}size={9}/>
|
|
89
|
+
<T style={t.metaStatText}>
|
|
90
|
+
{He(e.response)}
|
|
88
91
|
</T>
|
|
89
92
|
</C>}
|
|
90
93
|
|
|
91
|
-
{
|
|
92
|
-
<
|
|
93
|
-
<T style={[
|
|
94
|
-
{
|
|
94
|
+
{e.duration!=null&&!R&&<C style={[t.metaStatChip,{backgroundColor:`${I}12`,borderColor:`${I}2E`}]}>
|
|
95
|
+
<N color={I}size={9}/>
|
|
96
|
+
<T style={[t.metaStatText,{color:I}]}>
|
|
97
|
+
{e.duration}ms
|
|
95
98
|
</T>
|
|
96
99
|
</C>}
|
|
97
100
|
</C>
|
|
98
101
|
</C>
|
|
99
102
|
|
|
100
103
|
|
|
101
|
-
<C style={
|
|
102
|
-
{typeof
|
|
104
|
+
<C style={t.waterfallContainer}>
|
|
105
|
+
{typeof e.duration=="number"&&e.duration>0&&!R&&<C style={[t.waterfallBar,{width:`${Math.min(100,Math.max(6,e.duration/1200*100))}%`,backgroundColor:I}]}/>}
|
|
103
106
|
</C>
|
|
104
107
|
</C>
|
|
105
108
|
|
|
106
|
-
{
|
|
107
|
-
</
|
|
108
|
-
</C>}
|
|
109
|
+
{$&&<D.View pointerEvents="none"style={[E.absoluteFill,{backgroundColor:j,opacity:W}]}/>}
|
|
110
|
+
</Ae>
|
|
111
|
+
</C>}const t=E.create({container:{paddingHorizontal:8,paddingVertical:4,height:126,justifyContent:"center"},card:{height:118,alignSelf:"stretch",borderRadius:10,overflow:"hidden",borderWidth:1,borderColor:r.dividerColor,shadowColor:r.shadowColorString},cardBody:{height:"100%",paddingHorizontal:12,paddingTop:9,paddingBottom:7,justifyContent:"space-between"},cardHeaderRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",height:22,minHeight:22,maxHeight:22},cardHeaderLeft:{flexDirection:"row",alignItems:"center",flex:1,marginRight:8,gap:6,minWidth:0,overflow:"hidden"},cardHeaderRight:{flexDirection:"row",alignItems:"center",gap:6,flexShrink:0},smallCheckbox:{width:15,height:15,borderRadius:4,borderWidth:1.5,borderColor:r.grayTextWeak,alignItems:"center",justifyContent:"center",backgroundColor:r.white},smallCheckboxChecked:{backgroundColor:r.purple,borderColor:r.purple},serialNumber:{fontFamily:S.interBold,color:r.grayTextWeak,fontSize:10},methodBadge:{paddingHorizontal:7,paddingVertical:2.5,borderRadius:5,alignItems:"center",justifyContent:"center"},methodBadgeText:{fontFamily:S.interBold,fontSize:9.5,lineHeight:12,letterSpacing:.5,color:r.white},chip:{paddingHorizontal:6,paddingVertical:2,borderRadius:4,borderWidth:1},chipText:{fontFamily:S.interBold,fontSize:9,lineHeight:12},statusPill:{flexDirection:"row",alignItems:"center",gap:4,paddingHorizontal:7,paddingVertical:2.5,borderRadius:6,borderWidth:1,flexShrink:0},statusPillText:{fontFamily:S.interBold,fontSize:10,lineHeight:13},globeBtn:{padding:3,borderRadius:4,backgroundColor:`${r.grayTextWeak}12`,alignItems:"center",justifyContent:"center"},urlBox:{backgroundColor:r.grayBackground,borderRadius:7,borderWidth:1,borderColor:r.dividerColor,paddingHorizontal:9,paddingVertical:5,height:48,minHeight:48,maxHeight:48,justifyContent:"center",gap:3,overflow:"hidden"},urlMainRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:6},pathText:{fontFamily:S.interBold,fontSize:12,lineHeight:16,color:r.primaryBlack,flex:1},urlBadgeRow:{flexDirection:"row",alignItems:"center",gap:4,flexShrink:0},jsonBadge:{backgroundColor:`${r.darkOrange}14`,borderColor:`${r.darkOrange}2E`,borderWidth:1,paddingHorizontal:4.5,paddingVertical:1,borderRadius:3.5},jsonBadgeText:{fontFamily:S.interBold,fontSize:8.5,color:r.darkOrange},dupBadge:{backgroundColor:`${r.purple}14`,borderColor:`${r.purple}2E`,borderWidth:1,paddingHorizontal:4.5,paddingVertical:1,borderRadius:3.5},dupBadgeText:{fontFamily:S.interBold,fontSize:8.5,color:r.purple},hostRow:{flexDirection:"row",alignItems:"center",gap:5,minHeight:15},protoBadge:{paddingHorizontal:4.5,paddingVertical:1,borderRadius:3.5,borderWidth:1},protoBadgeText:{fontFamily:S.interBold,fontSize:8,lineHeight:10},hostText:{fontFamily:S.interMedium,fontSize:10,lineHeight:13,color:r.grayTextWeak,flex:1},highlight:{backgroundColor:r.yellowHighlight,color:r.primaryBlack,borderRadius:2},cardFooterRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",height:18,minHeight:18,maxHeight:18,gap:6},footerLeft:{flexDirection:"row",alignItems:"center",gap:6,flex:1,minWidth:0,overflow:"hidden"},footerRight:{flexDirection:"row",alignItems:"center",gap:5,flexShrink:0},cardDateRow:{flexDirection:"row",alignItems:"center",gap:3.5},cardDateText:{fontFamily:S.interRegular,fontSize:10,lineHeight:13,color:r.slate400},metaStatChip:{flexDirection:"row",alignItems:"center",gap:3,backgroundColor:r.violetSoftBg,borderColor:r.violetSoftBorder,borderWidth:1,paddingHorizontal:5.5,paddingVertical:1.5,borderRadius:4},metaStatText:{fontFamily:S.interBold,color:r.violetSoftText,fontSize:9,lineHeight:12},waterfallContainer:{height:2.5,width:"100%",backgroundColor:r.graySurface,borderRadius:1.5,overflow:"hidden",marginTop:2},waterfallBar:{height:"100%",borderRadius:1.5}});function qe(e,B){return e.item===B.item&&e.isSelected===B.isSelected&&e.isNew===B.isNew&&e.searchStr===B.searchStr&&e.timelineMinStart===B.timelineMinStart&&e.timelineTotalRange===B.timelineTotalRange&&e.onPress===B.onPress&&e.onToggleSelect===B.onToggleSelect}export default re.memo(Ue,qe);
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import F from"react";import{StyleSheet as G,Text as T}from"react-native";import{AppColors as r}from"../styles/AppColors";import{AppFonts as
|
|
1
|
+
import F from"react";import{StyleSheet as G,Text as T}from"react-native";import{AppColors as r}from"../styles/AppColors";import{AppFonts as R}from"../styles/AppFonts";import{escapeRegex as U,handleOpenExternalLink as H}from"../helpers";const M=/("(?:\\.|[^"\\])*"(?=\s*:))|("(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*')|(\b-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?\b)|(\b(?:true|false)\b)|(\b(?:null|undefined|NaN)\b)|(https?:\/\/[^\s"',]+)|(\[[\w\s_-]+\])|([{}[\],:])|([^"'\d\s{}[\],:]+|[ \t\r\n]+)/g;export const tokenizeText=l=>{if(!l)return[];const t=[];let e;for(M.lastIndex=0;(e=M.exec(l))!==null;)e[1]?t.push({type:"key",value:e[1]}):e[2]?t.push({type:"string",value:e[2]}):e[3]?t.push({type:"number",value:e[3]}):e[4]?t.push({type:"boolean",value:e[4]}):e[5]?t.push({type:"null",value:e[5]}):e[6]?t.push({type:"url",value:e[6]}):e[7]?t.push({type:"tag",value:e[7]}):e[8]?t.push({type:"bracket",value:e[8]}):e[9]&&t.push({type:"plain",value:e[9]});return t};const X=l=>{switch(l){case"key":return r.sky600;case"string":return r.emerald600;case"number":return r.amber600;case"boolean":return r.purple;case"null":return r.red600;case"url":return r.sky600;case"tag":return r.violet600;case"bracket":return r.slate500;default:return r.primaryBlack}};export const LogSyntaxHighlighter=F.memo(({text:l,search:t,numberOfLines:e,style:O,detectLinks:L=!0})=>{if(!l)return null;const z=F.useMemo(()=>tokenizeText(l),[l]),A=(n,S)=>{const K=X(n.type),C=n.type==="url",P=n.type==="key",w={color:K,fontFamily:P?R.interBold:R.interRegular,textDecorationLine:C?"underline":"none"};if(!t||t.trim().length===0)return<T key={S}style={w}onPress={C&&L?()=>H(n.value):void 0}>
|
|
2
2
|
{n.value}
|
|
3
|
-
</T>;const _=new RegExp(`(${U(t.trim())})`,"gi"),D=n.value.split(_);return<T key={S}style={
|
|
4
|
-
{D.map((E,B)=>E.toLowerCase()===t.trim().toLowerCase()?<T key={B}style={[
|
|
3
|
+
</T>;const _=new RegExp(`(${U(t.trim())})`,"gi"),D=n.value.split(_);return<T key={S}style={w}>
|
|
4
|
+
{D.map((E,B)=>E.toLowerCase()===t.trim().toLowerCase()?<T key={B}style={[w,N.searchHighlight]}>
|
|
5
5
|
{E}
|
|
6
|
-
</T>:<T key={B}style={
|
|
6
|
+
</T>:<T key={B}style={w}onPress={C&&L?()=>H(n.value):void 0}>
|
|
7
7
|
{E}
|
|
8
8
|
</T>)}
|
|
9
9
|
</T>};return<T style={[N.containerText,O]}numberOfLines={e}>
|
|
10
10
|
{z.map(A)}
|
|
11
|
-
</T>});const N=G.create({containerText:{fontFamily:
|
|
11
|
+
</T>});const N=G.create({containerText:{fontFamily:R.interRegular,fontSize:12,lineHeight:18,color:r.primaryBlack},searchHighlight:{backgroundColor:r.yellow200,color:r.yellow800,fontFamily:R.interBold,borderRadius:2}});export default LogSyntaxHighlighter;
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import{Component as
|
|
1
|
+
import{Component as k}from"react";import{StyleSheet as z,Text as T,View as C,TouchableOpacity as F,Platform as D}from"react-native";import{AppFonts as S}from"../styles/AppFonts";import{AppColors as e}from"../styles/AppColors";import{copyToClipboard as I}from"../helpers";import{WarningTriangleIcon as O,RefreshCcwIcon as V,CopyIcon as B}from"./NetworkIcons";import{handleInterceptedCrash as W}from"../customHooks/crashHandler";import{CrashType as M}from"../types/enums";export class ModuleErrorBoundary extends k{constructor(){super(...arguments),this.state={hasError:!1,error:null,copied:!1},this.handleRetry=()=>{this.setState({hasError:!1,error:null,copied:!1}),this.props.onRetry&&this.props.onRetry()},this.handleCopy=()=>{if(!this.state.error)return;const t=`[Module Error: ${this.props.moduleName||"Micro-Feature"}]
|
|
2
2
|
Message: ${this.state.error.message}
|
|
3
|
-
Stack: ${this.state.error.stack||"N/A"}`;
|
|
4
|
-
<C style={
|
|
5
|
-
<C style={
|
|
6
|
-
<
|
|
7
|
-
<
|
|
8
|
-
{
|
|
9
|
-
</
|
|
3
|
+
Stack: ${this.state.error.stack||"N/A"}`;I(t),this.setState({copied:!0}),setTimeout(()=>{this.setState({copied:!1})},2e3)}}static getDerivedStateFromError(t){return{hasError:!0,error:t}}componentDidCatch(t,R){try{W(t,t?.stack,!1,M.Js,R.componentStack||void 0)}catch{}this.props.onError&&this.props.onError(t,R)}render(){if(this.state.hasError&&this.state.error){const{fallback:t,moduleName:R="UI Module",containerStyle:E}=this.props;return typeof t=="function"?t(this.state.error,this.handleRetry):t||<C style={[r.card,E]}>
|
|
4
|
+
<C style={r.headerRow}>
|
|
5
|
+
<C style={r.titleRow}>
|
|
6
|
+
<O color="#DC2626"size={16}/>
|
|
7
|
+
<T style={r.moduleName}numberOfLines={1}>
|
|
8
|
+
{R}
|
|
9
|
+
</T>
|
|
10
10
|
</C>
|
|
11
|
-
<C style={
|
|
12
|
-
<
|
|
11
|
+
<C style={r.badge}>
|
|
12
|
+
<T style={r.badgeText}>FAULT ISOLATED</T>
|
|
13
13
|
</C>
|
|
14
14
|
</C>
|
|
15
15
|
|
|
16
|
-
<
|
|
16
|
+
<T style={r.message}numberOfLines={2}>
|
|
17
17
|
{this.state.error.message||"An unexpected rendering error occurred in this module."}
|
|
18
|
-
</
|
|
18
|
+
</T>
|
|
19
19
|
|
|
20
|
-
<C style={
|
|
21
|
-
<
|
|
22
|
-
<
|
|
23
|
-
<
|
|
24
|
-
</
|
|
20
|
+
<C style={r.actionsRow}>
|
|
21
|
+
<F style={r.retryButton}onPress={this.handleRetry}activeOpacity={.7}>
|
|
22
|
+
<V color="#FFFFFF"size={12}/>
|
|
23
|
+
<T style={r.retryText}>Retry Module</T>
|
|
24
|
+
</F>
|
|
25
25
|
|
|
26
|
-
<
|
|
27
|
-
<
|
|
28
|
-
<
|
|
26
|
+
<F style={r.copyButton}onPress={this.handleCopy}activeOpacity={.7}>
|
|
27
|
+
<B color="#475569"size={12}/>
|
|
28
|
+
<T style={r.copyText}>
|
|
29
29
|
{this.state.copied?"Copied":"Copy Error"}
|
|
30
|
-
</
|
|
31
|
-
</
|
|
30
|
+
</T>
|
|
31
|
+
</F>
|
|
32
32
|
</C>
|
|
33
|
-
</C>}return this.props.children}}export default ModuleErrorBoundary;const
|
|
33
|
+
</C>}return this.props.children}}export default ModuleErrorBoundary;const r=z.create({card:{backgroundColor:e.red50,borderColor:`${e.red500}33`,borderWidth:1.2,borderRadius:16,padding:14,marginVertical:6,gap:10,...D.select({ios:{shadowColor:e.red600,shadowOffset:{width:0,height:2},shadowOpacity:.06,shadowRadius:6},android:{elevation:2}})},headerRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:6},titleRow:{flexDirection:"row",alignItems:"center",gap:6,flexShrink:1},moduleName:{fontSize:12.5,fontWeight:"800",color:e.redErrorText,fontFamily:S.interBold,flexShrink:1},badge:{backgroundColor:e.red100,paddingHorizontal:6,paddingVertical:2,borderRadius:6,borderWidth:1,borderColor:`${e.red500}4D`},badgeText:{fontSize:8.5,fontWeight:"800",color:e.rose700,letterSpacing:.4},message:{fontSize:11.5,color:e.redErrorText,lineHeight:16,fontFamily:S.interRegular},actionsRow:{flexDirection:"row",alignItems:"center",gap:8,marginTop:2},retryButton:{flex:1,flexDirection:"row",alignItems:"center",justifyContent:"center",gap:6,backgroundColor:e.red600,paddingVertical:7,paddingHorizontal:12,borderRadius:9},retryText:{fontSize:11,fontWeight:"700",color:e.white,fontFamily:S.interBold},copyButton:{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:4,backgroundColor:e.graySurface,paddingVertical:7,paddingHorizontal:12,borderRadius:9,borderWidth:1,borderColor:e.grayBorderSecondary},copyText:{fontSize:11,fontWeight:"600",color:e.grayText,fontFamily:S.interMedium}});
|