react-native-inapp-inspector 2.3.23 → 2.3.24
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/dist/commonjs/components/Inspector/LogDetail.js +6 -6
- package/dist/commonjs/components/Inspector/ReduxDetail.js +1 -1
- package/dist/commonjs/components/JsonViewer.js +23 -23
- package/dist/commonjs/constants/version.d.ts +1 -1
- package/dist/commonjs/constants/version.js +1 -1
- package/dist/esm/components/Inspector/LogDetail.js +1 -1
- package/dist/esm/components/Inspector/ReduxDetail.js +1 -1
- package/dist/esm/components/JsonViewer.js +78 -78
- package/dist/esm/constants/version.d.ts +1 -1
- package/dist/esm/constants/version.js +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
"use strict";var __createBinding=this&&this.__createBinding||(Object.create?(function(o,t,l,i){i===void 0&&(i=l);var a=Object.getOwnPropertyDescriptor(t,l);(!a||("get"in a?!t.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return t[l]}}),Object.defineProperty(o,i,a)}):(function(o,t,l,i){i===void 0&&(i=l),o[i]=t[l]})),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?(function(o,t){Object.defineProperty(o,"default",{enumerable:!0,value:t})}):function(o,t){o.default=t}),__importStar=this&&this.__importStar||(function(){var o=function(t){return o=Object.getOwnPropertyNames||function(l){var i=[];for(var a in l)Object.prototype.hasOwnProperty.call(l,a)&&(i[i.length]=a);return i},o(t)};return function(t){if(t&&t.__esModule)return t;var l={};if(t!=null)for(var i=o(t),a=0;a<i.length;a++)i[a]!=="default"&&__createBinding(l,t,i[a]);return __setModuleDefault(l,t),l}})(),__importDefault=this&&this.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(exports,"__esModule",{value:!0});const react_1=__importStar(require("react")),i18n_1=require("../../i18n"),react_native_1=require("react-native"),InspectorContext_1=require("./InspectorContext"),HighlightText_1=__importDefault(require("../HighlightText")),JsonViewer_1=__importDefault(require("../JsonViewer")),CopyButton_1=__importDefault(require("../CopyButton")),SegmentedTabs_1=__importDefault(require("../SegmentedTabs")),NetworkIcons_1=require("../NetworkIcons"),AppColors_1=require("../../styles/AppColors"),AppFonts_1=require("../../styles/AppFonts"),styles_1=__importDefault(require("../../styles")),helpers_1=require("../../helpers"),getRelativeTime=o=>{const l=Date.now()-o,i=Math.floor(l/1e3),a=Math.floor(i/60),
|
|
2
|
-
`).map(e=>e.trim()).filter(e=>e.length>0).map((e,n)=>(0,helpers_1.parseStackLine)(e,n===0)):[],[
|
|
1
|
+
"use strict";var __createBinding=this&&this.__createBinding||(Object.create?(function(o,t,l,i){i===void 0&&(i=l);var a=Object.getOwnPropertyDescriptor(t,l);(!a||("get"in a?!t.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return t[l]}}),Object.defineProperty(o,i,a)}):(function(o,t,l,i){i===void 0&&(i=l),o[i]=t[l]})),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?(function(o,t){Object.defineProperty(o,"default",{enumerable:!0,value:t})}):function(o,t){o.default=t}),__importStar=this&&this.__importStar||(function(){var o=function(t){return o=Object.getOwnPropertyNames||function(l){var i=[];for(var a in l)Object.prototype.hasOwnProperty.call(l,a)&&(i[i.length]=a);return i},o(t)};return function(t){if(t&&t.__esModule)return t;var l={};if(t!=null)for(var i=o(t),a=0;a<i.length;a++)i[a]!=="default"&&__createBinding(l,t,i[a]);return __setModuleDefault(l,t),l}})(),__importDefault=this&&this.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(exports,"__esModule",{value:!0});const react_1=__importStar(require("react")),i18n_1=require("../../i18n"),react_native_1=require("react-native"),InspectorContext_1=require("./InspectorContext"),HighlightText_1=__importDefault(require("../HighlightText")),JsonViewer_1=__importDefault(require("../JsonViewer")),CopyButton_1=__importDefault(require("../CopyButton")),SegmentedTabs_1=__importDefault(require("../SegmentedTabs")),NetworkIcons_1=require("../NetworkIcons"),AppColors_1=require("../../styles/AppColors"),AppFonts_1=require("../../styles/AppFonts"),styles_1=__importDefault(require("../../styles")),helpers_1=require("../../helpers"),getRelativeTime=o=>{const l=Date.now()-o,i=Math.floor(l/1e3),a=Math.floor(i/60),C=Math.floor(a/60),b=Math.floor(C/24);return i<60?`${i}s ago`:a<60?`${a}m ago`:C<24?`${C}h ago`:`${b}d ago`},LogDetail=react_1.default.memo(()=>{const{t:o}=(0,i18n_1.useTranslation)(),{selectedLog:t}=(0,InspectorContext_1.useInspector)(),[l,i]=(0,react_1.useState)("output"),[a,C]=(0,react_1.useState)(""),[b,v]=(0,react_1.useState)("raw"),p=(0,react_1.useMemo)(()=>t?(0,helpers_1.getJsonContent)(t.message):null,[t]),[d,h]=(0,react_1.useState)("structured"),[m,V]=(0,react_1.useState)("caller"),[_,k]=(0,react_1.useState)("app"),y=(0,react_1.useMemo)(()=>t?m==="error"&&t.errorStack?t.errorStack:t.stack||t.caller||"":"",[t,m]),s=(0,react_1.useMemo)(()=>y?y.split(`
|
|
2
|
+
`).map(e=>e.trim()).filter(e=>e.length>0).map((e,n)=>(0,helpers_1.parseStackLine)(e,n===0)):[],[y]),u=(0,react_1.useMemo)(()=>s.filter(e=>e.frameType==="app"||!e.isRuntimeNoise),[s]),x=(0,react_1.useMemo)(()=>_==="app"&&u.length>0?u:s,[_,u,s]),r=(0,react_1.useMemo)(()=>t?u.length>0?u[0]:t.caller&&t.caller!=="Unknown"?(0,helpers_1.parseStackLine)(t.caller,!0):s.length>0?s[0]:null:null,[t,u,s]);if(!t)return null;const g=AppColors_1.AppColors.primaryLight!==AppColors_1.AppColors.white,f=(()=>{const e=(t.type||"log").toLowerCase(),n=(t.sourceMethod||e).toLowerCase();return e==="error"||n==="error"?{border:AppColors_1.AppColors.red500,badgeBg:AppColors_1.AppColors.red100,badgeText:AppColors_1.AppColors.redErrorText,label:"ERROR",methodBorder:AppColors_1.AppColors.errorBorder,methodBg:AppColors_1.AppColors.red100,methodText:AppColors_1.AppColors.redErrorText}:e==="warn"||n==="warn"?{border:AppColors_1.AppColors.amber500,badgeBg:AppColors_1.AppColors.amber100,badgeText:AppColors_1.AppColors.amber800Warm,label:"WARN",methodBorder:AppColors_1.AppColors.amber200,methodBg:AppColors_1.AppColors.amber100,methodText:AppColors_1.AppColors.amber800Warm}:e==="debug"||n==="debug"?{border:AppColors_1.AppColors.violet500,badgeBg:AppColors_1.AppColors.purple100,badgeText:AppColors_1.AppColors.violet600,label:"DEBUG",methodBorder:AppColors_1.AppColors.purple200,methodBg:AppColors_1.AppColors.purple100,methodText:AppColors_1.AppColors.violet600}:e==="info"||n==="info"?{border:AppColors_1.AppColors.sky500,badgeBg:AppColors_1.AppColors.sky100,badgeText:AppColors_1.AppColors.sky600,label:"INFO",methodBorder:AppColors_1.AppColors.sky400,methodBg:AppColors_1.AppColors.sky100,methodText:AppColors_1.AppColors.sky600}:{border:AppColors_1.AppColors.indigo500,badgeBg:AppColors_1.AppColors.indigo50,badgeText:AppColors_1.AppColors.indigo600Alt,label:"LOG",methodBorder:AppColors_1.AppColors.indigo400,methodBg:AppColors_1.AppColors.indigo50,methodText:AppColors_1.AppColors.indigo600Alt}})(),T=t.rawArgs!=null&&t.rawArgs.length>1,S=!!(t.stack&&t.stack.trim().length>0),B=[{key:"output",label:o("console.tabOutput"),icon:e=><NetworkIcons_1.TerminalIcon color={e?AppColors_1.AppColors.white:AppColors_1.AppColors.grayTextWeak}size={12}/>},...T?[{key:"arguments",label:o("console.tabArgs",{count:t.rawArgs?.length}),icon:e=><NetworkIcons_1.RequestIcon color={e?AppColors_1.AppColors.white:AppColors_1.AppColors.grayTextWeak}size={12}/>}]:[],...S?[{key:"stack",label:o("console.tabStack"),icon:e=><NetworkIcons_1.LayersIcon color={e?AppColors_1.AppColors.white:AppColors_1.AppColors.grayTextWeak}size={12}/>}]:[],{key:"metadata",label:o("console.tabMetadata"),icon:e=><NetworkIcons_1.InfoCircleIcon color={e?AppColors_1.AppColors.white:AppColors_1.AppColors.grayTextWeak}size={12}/>}];return<react_native_1.View style={{flex:1}}>
|
|
3
3
|
|
|
4
4
|
<react_native_1.View style={styles_1.default.detailInfoBar}>
|
|
5
5
|
<react_native_1.View style={{flexDirection:"column",gap:10}}>
|
|
@@ -102,8 +102,8 @@
|
|
|
102
102
|
<react_native_1.View style={[styles_1.default.detailSearchRow,{marginBottom:0}]}>
|
|
103
103
|
<react_native_1.View style={[styles_1.default.detailSearchBox,{backgroundColor:g?`${AppColors_1.AppColors.brandPurple}10`:AppColors_1.AppColors.purpleShade50,borderWidth:1,borderColor:AppColors_1.AppColors.dividerColor}]}>
|
|
104
104
|
<NetworkIcons_1.SearchIcon color={AppColors_1.AppColors.grayTextWeak}size={15}/>
|
|
105
|
-
<react_native_1.TextInput placeholder="Search in log details..."placeholderTextColor={AppColors_1.AppColors.grayTextWeak}value={a}onChangeText={
|
|
106
|
-
{a.length>0&&<react_native_1.Pressable onPress={()=>
|
|
105
|
+
<react_native_1.TextInput placeholder="Search in log details..."placeholderTextColor={AppColors_1.AppColors.grayTextWeak}value={a}onChangeText={C}style={styles_1.default.detailSearchInput}autoCorrect={!1}autoCapitalize="none"/>
|
|
106
|
+
{a.length>0&&<react_native_1.Pressable onPress={()=>C("")}hitSlop={10}style={{padding:6}}>
|
|
107
107
|
<NetworkIcons_1.ClearIcon color={AppColors_1.AppColors.grayTextWeak}size={13}/>
|
|
108
108
|
</react_native_1.Pressable>}
|
|
109
109
|
</react_native_1.View>
|
|
@@ -191,7 +191,7 @@
|
|
|
191
191
|
</react_native_1.Pressable>
|
|
192
192
|
</react_native_1.View>
|
|
193
193
|
|
|
194
|
-
<CopyButton_1.default value={
|
|
194
|
+
<CopyButton_1.default value={y}label={o("console.fullStackTrace")}/>
|
|
195
195
|
</react_native_1.View>
|
|
196
196
|
</react_native_1.View>
|
|
197
197
|
|
|
@@ -259,7 +259,7 @@
|
|
|
259
259
|
{o("console.noStackAvailable")}
|
|
260
260
|
</react_native_1.Text>}
|
|
261
261
|
</react_native_1.View>:<react_native_1.View style={{backgroundColor:AppColors_1.AppColors.primaryLight,padding:12}}>
|
|
262
|
-
{
|
|
262
|
+
{y.split(`
|
|
263
263
|
`).filter(e=>e.trim().length>0).map((e,n)=><react_native_1.View key={n}style={{flexDirection:"row",alignItems:"flex-start",paddingVertical:2}}>
|
|
264
264
|
<react_native_1.Text style={{width:28,textAlign:"right",paddingRight:8,fontFamily:AppFonts_1.AppFonts.interRegular,fontSize:11,color:AppColors_1.AppColors.grayTextWeak,lineHeight:17}}>
|
|
265
265
|
{n+1}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var __createBinding=this&&this.__createBinding||(Object.create?(function(e,i,l,r){r===void 0&&(r=l);var t=Object.getOwnPropertyDescriptor(i,l);(!t||("get"in t?!i.__esModule:t.writable||t.configurable))&&(t={enumerable:!0,get:function(){return i[l]}}),Object.defineProperty(e,r,t)}):(function(e,i,l,r){r===void 0&&(r=l),e[r]=i[l]})),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?(function(e,i){Object.defineProperty(e,"default",{enumerable:!0,value:i})}):function(e,i){e.default=i}),__importStar=this&&this.__importStar||(function(){var e=function(i){return e=Object.getOwnPropertyNames||function(l){var r=[];for(var t in l)Object.prototype.hasOwnProperty.call(l,t)&&(r[r.length]=t);return r},e(i)};return function(i){if(i&&i.__esModule)return i;var l={};if(i!=null)for(var r=e(i),t=0;t<r.length;t++)r[t]!=="default"&&__createBinding(l,i,r[t]);return __setModuleDefault(l,i),l}})(),__importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0});const react_1=__importStar(require("react")),react_native_1=require("react-native"),i18n_1=require("../../i18n"),InspectorContext_1=require("./InspectorContext"),SegmentedTabs_1=__importDefault(require("../SegmentedTabs")),JsonViewer_1=__importDefault(require("../JsonViewer")),DiffViewer_1=__importDefault(require("../DiffViewer")),CopyButton_1=__importDefault(require("../CopyButton")),TouchableScale_1=__importDefault(require("../TouchableScale")),HighlightText_1=__importDefault(require("../HighlightText")),AnimatedEntrance_1=__importDefault(require("../AnimatedEntrance")),reduxLogger_1=require("../../customHooks/reduxLogger"),helpers_1=require("../../helpers"),settingsStore_1=require("../../helpers/settingsStore"),AppColors_1=require("../../styles/AppColors"),AppFonts_1=require("../../styles/AppFonts"),NetworkIcons_1=require("../NetworkIcons"),getOriginBadge=e=>{switch(e){case"saga":return{label:"SAGA",renderIcon:(i,l=9)=><NetworkIcons_1.BoltIcon color={i}size={l}/>,bg:AppColors_1.AppColors.purple100,text:AppColors_1.AppColors.brandPurple,border:AppColors_1.AppColors.purple200};case"thunk":return{label:"THUNK",renderIcon:(i,l=9)=><NetworkIcons_1.AtomIcon color={i}size={l}/>,bg:AppColors_1.AppColors.amber100,text:AppColors_1.AppColors.amber800Warm,border:AppColors_1.AppColors.amber200};case"ui":return{label:"UI",renderIcon:(i,l=9)=><NetworkIcons_1.ScreenIcon color={i}size={l}/>,bg:AppColors_1.AppColors.sky100,text:AppColors_1.AppColors.sky600,border:AppColors_1.AppColors.sky400};case"listener":return{label:"LISTENER",renderIcon:(i,l=9)=><NetworkIcons_1.ListenerIcon color={i}size={l}/>,bg:AppColors_1.AppColors.teal100,text:AppColors_1.AppColors.teal700,border:AppColors_1.AppColors.teal400};default:return{label:"DIRECT",renderIcon:(i,l=9)=><NetworkIcons_1.BoltIcon color={i}size={l}/>,bg:AppColors_1.AppColors.slate100,text:AppColors_1.AppColors.slate700,border:AppColors_1.AppColors.slate200}}},ReduxDetail=react_1.default.memo(()=>{const{t:e}=(0,i18n_1.useTranslation)(),{reduxState:i,reduxLastActionMap:l,selectedReduxSlice:r,selectedReduxAction:t,setSelectedReduxSlice:R}=(0,InspectorContext_1.useInspector)(),[d,S]=(0,react_1.useState)(""),[y,V]=(0,react_1.useState)("live"),[b,F]=(0,react_1.useState)("payload"),[k,B]=(0,react_1.useState)("
|
|
1
|
+
"use strict";var __createBinding=this&&this.__createBinding||(Object.create?(function(e,i,l,r){r===void 0&&(r=l);var t=Object.getOwnPropertyDescriptor(i,l);(!t||("get"in t?!i.__esModule:t.writable||t.configurable))&&(t={enumerable:!0,get:function(){return i[l]}}),Object.defineProperty(e,r,t)}):(function(e,i,l,r){r===void 0&&(r=l),e[r]=i[l]})),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?(function(e,i){Object.defineProperty(e,"default",{enumerable:!0,value:i})}):function(e,i){e.default=i}),__importStar=this&&this.__importStar||(function(){var e=function(i){return e=Object.getOwnPropertyNames||function(l){var r=[];for(var t in l)Object.prototype.hasOwnProperty.call(l,t)&&(r[r.length]=t);return r},e(i)};return function(i){if(i&&i.__esModule)return i;var l={};if(i!=null)for(var r=e(i),t=0;t<r.length;t++)r[t]!=="default"&&__createBinding(l,i,r[t]);return __setModuleDefault(l,i),l}})(),__importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0});const react_1=__importStar(require("react")),react_native_1=require("react-native"),i18n_1=require("../../i18n"),InspectorContext_1=require("./InspectorContext"),SegmentedTabs_1=__importDefault(require("../SegmentedTabs")),JsonViewer_1=__importDefault(require("../JsonViewer")),DiffViewer_1=__importDefault(require("../DiffViewer")),CopyButton_1=__importDefault(require("../CopyButton")),TouchableScale_1=__importDefault(require("../TouchableScale")),HighlightText_1=__importDefault(require("../HighlightText")),AnimatedEntrance_1=__importDefault(require("../AnimatedEntrance")),reduxLogger_1=require("../../customHooks/reduxLogger"),helpers_1=require("../../helpers"),settingsStore_1=require("../../helpers/settingsStore"),AppColors_1=require("../../styles/AppColors"),AppFonts_1=require("../../styles/AppFonts"),NetworkIcons_1=require("../NetworkIcons"),getOriginBadge=e=>{switch(e){case"saga":return{label:"SAGA",renderIcon:(i,l=9)=><NetworkIcons_1.BoltIcon color={i}size={l}/>,bg:AppColors_1.AppColors.purple100,text:AppColors_1.AppColors.brandPurple,border:AppColors_1.AppColors.purple200};case"thunk":return{label:"THUNK",renderIcon:(i,l=9)=><NetworkIcons_1.AtomIcon color={i}size={l}/>,bg:AppColors_1.AppColors.amber100,text:AppColors_1.AppColors.amber800Warm,border:AppColors_1.AppColors.amber200};case"ui":return{label:"UI",renderIcon:(i,l=9)=><NetworkIcons_1.ScreenIcon color={i}size={l}/>,bg:AppColors_1.AppColors.sky100,text:AppColors_1.AppColors.sky600,border:AppColors_1.AppColors.sky400};case"listener":return{label:"LISTENER",renderIcon:(i,l=9)=><NetworkIcons_1.ListenerIcon color={i}size={l}/>,bg:AppColors_1.AppColors.teal100,text:AppColors_1.AppColors.teal700,border:AppColors_1.AppColors.teal400};default:return{label:"DIRECT",renderIcon:(i,l=9)=><NetworkIcons_1.BoltIcon color={i}size={l}/>,bg:AppColors_1.AppColors.slate100,text:AppColors_1.AppColors.slate700,border:AppColors_1.AppColors.slate200}}},ReduxDetail=react_1.default.memo(()=>{const{t:e}=(0,i18n_1.useTranslation)(),{reduxState:i,reduxLastActionMap:l,selectedReduxSlice:r,selectedReduxAction:t,setSelectedReduxSlice:R}=(0,InspectorContext_1.useInspector)(),[d,S]=(0,react_1.useState)(""),[y,V]=(0,react_1.useState)("live"),[b,F]=(0,react_1.useState)("payload"),[k,B]=(0,react_1.useState)("raw"),[P,W]=(0,react_1.useState)(null),[_,T]=(0,react_1.useState)(!1),[A,g]=(0,react_1.useState)(null),h=(0,react_1.useMemo)(()=>(0,reduxLogger_1.getActionHistory)(),[l]),x=(0,react_1.useMemo)(()=>r?h.filter(a=>!a.affectedSlices||a.affectedSlices.length===0?!0:a.affectedSlices.includes(r)):h,[h,r]),I=(0,react_1.useMemo)(()=>{if(!d.trim())return x;const a=d.toLowerCase();return x.filter(p=>p.type.toLowerCase().includes(a)||p.callerFile&&p.callerFile.toLowerCase().includes(a)||p.payload&&JSON.stringify(p.payload).toLowerCase().includes(a))},[x,d]);(0,react_1.useEffect)(()=>{if(!r)return;async function a(){try{const p=(0,settingsStore_1.getCustomStorage)();if(!p){T(!1),g(null);return}let c=await p.getItem(`persist:${r}`);if(c){try{g(JSON.parse(c))}catch{g(c)}T(!0);return}let n=await p.getItem("persist:root");if(n){const o=JSON.parse(n);if(o&&o[r]!==void 0){const s=o[r];try{g(typeof s=="string"?JSON.parse(s):s)}catch{g(s)}T(!0);return}}}catch{}T(!1),g(null)}a()},[r]);const z=()=>{r&&react_native_1.Alert.alert("Clear Persisted State",`Are you sure you want to delete persisted storage for slice "${r}"?`,[{text:"Cancel",style:"cancel"},{text:"Delete",style:"destructive",onPress:async()=>{try{const a=(0,settingsStore_1.getCustomStorage)();if(!a)return;typeof a.removeItem=="function"?await a.removeItem(`persist:${r}`):await a.setItem(`persist:${r}`,""),T(!1),g(null),V("live"),react_native_1.Platform.OS==="android"?react_native_1.ToastAndroid.show("Persisted state cleared",react_native_1.ToastAndroid.SHORT):react_native_1.Alert.alert("Cleared","Persisted state has been cleared.")}catch{react_native_1.Alert.alert("Error","Failed to clear persisted state.")}}}])};if(r!=null){const a=i?.[r],p=a&&typeof a=="object"?Object.keys(a).length:typeof a<"u"?1:0,c=l[r],n=[{key:"live",label:e("redux.liveState","Live State"),icon:o=><NetworkIcons_1.LiveStateIcon color={o?AppColors_1.AppColors.white:AppColors_1.AppColors.grayText}size={12}/>},{key:"timeline",label:`${e("redux.timeline","Timeline")} (${x.length})`,icon:o=><NetworkIcons_1.TimelineIcon color={o?AppColors_1.AppColors.white:AppColors_1.AppColors.grayText}size={12}/>},{key:"persisted",label:_?e("redux.persisted","Persisted"):e("redux.storage","Storage"),icon:o=><NetworkIcons_1.StorageIcon color={o?AppColors_1.AppColors.white:AppColors_1.AppColors.grayText}size={12}/>},{key:"metadata",label:e("redux.metadata","Metadata"),icon:o=><NetworkIcons_1.MetadataIcon color={o?AppColors_1.AppColors.white:AppColors_1.AppColors.grayText}size={12}/>}];return<react_native_1.View style={{flex:1,backgroundColor:AppColors_1.AppColors.grayBackground}}>
|
|
2
2
|
|
|
3
3
|
<react_native_1.View style={reduxDetailStyles.infoBar}>
|
|
4
4
|
<react_native_1.View style={reduxDetailStyles.infoTopRow}>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var __createBinding=this&&this.__createBinding||(Object.create?(function(e,t,r,i){i===void 0&&(i=r);var o=Object.getOwnPropertyDescriptor(t,r);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,i,o)}):(function(e,t,r,i){i===void 0&&(i=r),e[i]=t[r]})),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),__importStar=this&&this.__importStar||(function(){var e=function(t){return e=Object.getOwnPropertyNames||function(r){var i=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(i[i.length]=o);return i},e(t)};return function(t){if(t&&t.__esModule)return t;var r={};if(t!=null)for(var i=e(t),o=0;o<i.length;o++)i[o]!=="default"&&__createBinding(r,t,i[o]);return __setModuleDefault(r,t),r}})(),__importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0});const react_1=__importStar(require("react")),react_native_1=require("react-native"),i18n_1=require("../i18n"),TreeNode_1=__importDefault(require("./TreeNode")),HighlightText_1=__importDefault(require("./HighlightText")),TouchableScale_1=__importDefault(require("./TouchableScale")),NetworkIcons_1=require("./NetworkIcons"),helpers_1=require("../helpers"),NativeInspector_1=require("../native/NativeInspector"),monoFont=react_native_1.Platform.select({ios:"Menlo",android:"monospace",default:"monospace"}),getTypeDetails=e=>e===null?{label:"null",color:"#E11D48",bg:"#FFF1F2",border:"#FECDD3"}:e===void 0?{label:"undef",color:"#E11D48",bg:"#FFF1F2",border:"#FECDD3"}:Array.isArray(e)?{label:`arr[${e.length}]`,color:"#2563EB",bg:"#EFF6FF",border:"#BFDBFE"}:typeof e=="object"?{label:`obj{${Object.keys(e).length}}`,color:"#7C3AED",bg:"#F5F3FF",border:"#DDD6FE"}:typeof e=="number"?{label:"num",color:"#D97706",bg:"#FEF3C7",border:"#FDE68A"}:typeof e=="boolean"?{label:"bool",color:"#DB2777",bg:"#FDF2F8",border:"#FBCFE8"}:{label:"str",color:"#059669",bg:"#ECFDF5",border:"#A7F3D0"},JsonTableRow=react_1.default.memo(({itemKey:e,val:t,search:r,index:i})=>{const[o,
|
|
1
|
+
"use strict";var __createBinding=this&&this.__createBinding||(Object.create?(function(e,t,r,i){i===void 0&&(i=r);var o=Object.getOwnPropertyDescriptor(t,r);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,i,o)}):(function(e,t,r,i){i===void 0&&(i=r),e[i]=t[r]})),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),__importStar=this&&this.__importStar||(function(){var e=function(t){return e=Object.getOwnPropertyNames||function(r){var i=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(i[i.length]=o);return i},e(t)};return function(t){if(t&&t.__esModule)return t;var r={};if(t!=null)for(var i=e(t),o=0;o<i.length;o++)i[o]!=="default"&&__createBinding(r,t,i[o]);return __setModuleDefault(r,t),r}})(),__importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0});const react_1=__importStar(require("react")),react_native_1=require("react-native"),i18n_1=require("../i18n"),TreeNode_1=__importDefault(require("./TreeNode")),HighlightText_1=__importDefault(require("./HighlightText")),TouchableScale_1=__importDefault(require("./TouchableScale")),NetworkIcons_1=require("./NetworkIcons"),helpers_1=require("../helpers"),NativeInspector_1=require("../native/NativeInspector"),monoFont=react_native_1.Platform.select({ios:"Menlo",android:"monospace",default:"monospace"}),getTypeDetails=e=>e===null?{label:"null",color:"#E11D48",bg:"#FFF1F2",border:"#FECDD3"}:e===void 0?{label:"undef",color:"#E11D48",bg:"#FFF1F2",border:"#FECDD3"}:Array.isArray(e)?{label:`arr[${e.length}]`,color:"#2563EB",bg:"#EFF6FF",border:"#BFDBFE"}:typeof e=="object"?{label:`obj{${Object.keys(e).length}}`,color:"#7C3AED",bg:"#F5F3FF",border:"#DDD6FE"}:typeof e=="number"?{label:"num",color:"#D97706",bg:"#FEF3C7",border:"#FDE68A"}:typeof e=="boolean"?{label:"bool",color:"#DB2777",bg:"#FDF2F8",border:"#FBCFE8"}:{label:"str",color:"#059669",bg:"#ECFDF5",border:"#A7F3D0"},JsonTableRow=react_1.default.memo(({itemKey:e,val:t,search:r,index:i})=>{const[o,g]=(0,react_1.useState)(!1),f=t!==null&&typeof t=="object",d=getTypeDetails(t);let c="";if(t===null)c="null";else if(t===void 0)c="undefined";else if(f)try{c=JSON.stringify(t,null,2)}catch{c=String(t)}else c=String(t);const F=c.includes(`
|
|
2
2
|
`)||c.length>80;return<react_native_1.View style={[localStyles.tableRow,i%2===1&&localStyles.tableRowAlt]}>
|
|
3
3
|
|
|
4
4
|
<react_native_1.View style={localStyles.tableColKey}>
|
|
@@ -15,15 +15,15 @@
|
|
|
15
15
|
<react_native_1.View style={f?localStyles.tableCodeBox:void 0}>
|
|
16
16
|
<HighlightText_1.default text={c}search={r}style={[localStyles.tableCellValue,t==null?localStyles.syntaxNull:void 0,typeof t=="number"?localStyles.syntaxNumber:void 0,typeof t=="boolean"?localStyles.syntaxBoolean:void 0,typeof t=="string"?localStyles.syntaxString:void 0]}highlightStyle={localStyles.highlight}numberOfLines={o?void 0:3}selectable={!0}/>
|
|
17
17
|
</react_native_1.View>
|
|
18
|
-
{F&&<react_native_1.TouchableOpacity onPress={()=>
|
|
18
|
+
{F&&<react_native_1.TouchableOpacity onPress={()=>g(y=>!y)}hitSlop={6}style={localStyles.showMoreBtn}>
|
|
19
19
|
<react_native_1.Text style={localStyles.showMoreText}>
|
|
20
20
|
{o?"Collapse":"Expand"}
|
|
21
21
|
</react_native_1.Text>
|
|
22
22
|
<NetworkIcons_1.ChevronIcon direction={o?"up":"down"}size={9}color="#4F46E5"/>
|
|
23
23
|
</react_native_1.TouchableOpacity>}
|
|
24
24
|
</react_native_1.View>
|
|
25
|
-
</react_native_1.View>}),JsonViewer=react_1.default.memo(({data:e,search:t,forceOpen:r,defaultExpandDepth:i=1,wrap:o,fullHeight:
|
|
26
|
-
`):[""],[S]),
|
|
25
|
+
</react_native_1.View>}),JsonViewer=react_1.default.memo(({data:e,search:t,forceOpen:r,defaultExpandDepth:i=1,wrap:o,fullHeight:g=!1,maxHeight:f,mode:d,onModeChange:c,hideTabs:F=!1})=>{const{t:y}=(0,i18n_1.useTranslation)(),[A,B]=(0,react_1.useState)(d??"raw"),[E,D]=(0,react_1.useState)(!1),[b,O]=(0,react_1.useState)(o??!1),[T,z]=(0,react_1.useState)(r),a=c&&d?d:A,x=n=>{B(n),c&&c(n)};(0,react_1.useEffect)(()=>{o!==void 0&&O(o)},[o]),(0,react_1.useEffect)(()=>{r!==void 0&&z(r)},[r]);const R=(0,react_1.useMemo)(()=>{if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e,null,2)??""}catch{return String(e)||""}},[e]),u=(0,react_1.useMemo)(()=>{if(typeof e=="string")return e;try{return JSON.stringify(e)??""}catch{return String(e)||""}},[e]),H=u,[P,k]=(0,react_1.useState)(!1),I=5e4,V=typeof u=="string"?u:"",C=V.length>I&&!P,S=C?V.slice(0,I):V,K=typeof R=="string"?R:"",h=(0,react_1.useMemo)(()=>S?S.split(`
|
|
26
|
+
`):[""],[S]),W=h.length,N=(0,react_1.useMemo)(()=>(0,helpers_1.getSize)(e),[e]);(0,react_1.useEffect)(()=>{d&&B(d)},[d]);const M=()=>{(0,NativeInspector_1.triggerNativeHaptic)("success"),(0,helpers_1.copyToClipboard)(H||u,"JSON"),D(!0),setTimeout(()=>D(!1),1200)},m=typeof e=="object"&&e!==null,L=e==null||m&&Object.keys(e).length===0,j=()=>{if(!m)return<react_native_1.View style={localStyles.tableRow}>
|
|
27
27
|
<react_native_1.View style={localStyles.tableColKey}>
|
|
28
28
|
<react_native_1.Text style={localStyles.tableCellKey}>{y("network.jsonViewer.value")}</react_native_1.Text>
|
|
29
29
|
</react_native_1.View>
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
<react_native_1.Text style={[localStyles.tableHeaderCell,{flex:3}]}>VALUE</react_native_1.Text>
|
|
42
42
|
</react_native_1.View>
|
|
43
43
|
{n.map((l,s)=><JsonTableRow key={l}index={s}itemKey={l}val={e[l]}search={t}/>)}
|
|
44
|
-
</react_native_1.View>},_=<TreeNode_1.default data={e}search={t}forceOpen={T}defaultExpandDepth={T?99:i}/>;return<react_native_1.View style={[localStyles.container,
|
|
44
|
+
</react_native_1.View>},_=<TreeNode_1.default data={e}search={t}forceOpen={T}defaultExpandDepth={T?99:i}/>;return<react_native_1.View style={[localStyles.container,g&&{flex:1}]}>
|
|
45
45
|
|
|
46
46
|
<react_native_1.View style={localStyles.snippetHeader}>
|
|
47
47
|
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
</react_native_1.View>
|
|
52
52
|
<react_native_1.View style={localStyles.metaBadge}>
|
|
53
53
|
<react_native_1.Text style={localStyles.metaBadgeText}numberOfLines={1}ellipsizeMode="tail">
|
|
54
|
-
{
|
|
54
|
+
{W} {W===1?"line":"lines"} · {N}
|
|
55
55
|
</react_native_1.Text>
|
|
56
56
|
</react_native_1.View>
|
|
57
57
|
</react_native_1.View>
|
|
@@ -96,21 +96,21 @@
|
|
|
96
96
|
</react_native_1.TouchableOpacity>}
|
|
97
97
|
|
|
98
98
|
|
|
99
|
-
<TouchableScale_1.default onPress={
|
|
99
|
+
<TouchableScale_1.default onPress={M}hitSlop={8}style={[localStyles.copyBtn,E&&localStyles.copyBtnSuccess]}>
|
|
100
100
|
{E?<NetworkIcons_1.CheckIcon color="#10B981"size={13}/>:<NetworkIcons_1.CopyIcon color="#64748B"size={13}/>}
|
|
101
101
|
</TouchableScale_1.default>
|
|
102
102
|
</react_native_1.View>
|
|
103
103
|
</react_native_1.View>
|
|
104
104
|
|
|
105
|
-
<react_native_1.View style={[localStyles.editorBody,
|
|
105
|
+
<react_native_1.View style={[localStyles.editorBody,g&&{flex:1,maxHeight:void 0},!g&&f!=null&&{maxHeight:f}]}>
|
|
106
106
|
|
|
107
|
-
{a==="pretty"&&(
|
|
107
|
+
{a==="pretty"&&(L?<react_native_1.View style={localStyles.emptyContainer}>
|
|
108
108
|
<react_native_1.Text style={localStyles.emptyText}>
|
|
109
109
|
{y("network.jsonViewer.emptyPayload")}
|
|
110
110
|
</react_native_1.Text>
|
|
111
|
-
</react_native_1.View>:b?
|
|
111
|
+
</react_native_1.View>:b?g?<react_native_1.ScrollView style={{flex:1}}contentContainerStyle={localStyles.prettyContainer}>
|
|
112
112
|
{_}
|
|
113
|
-
</react_native_1.ScrollView>:<react_native_1.View style={localStyles.prettyContainer}>{_}</react_native_1.View>:
|
|
113
|
+
</react_native_1.ScrollView>:<react_native_1.View style={localStyles.prettyContainer}>{_}</react_native_1.View>:g?<react_native_1.ScrollView style={{flex:1}}contentContainerStyle={{flexGrow:1}}>
|
|
114
114
|
<react_native_1.ScrollView horizontal showsHorizontalScrollIndicator={!0}contentContainerStyle={localStyles.prettyContainer}>
|
|
115
115
|
{_}
|
|
116
116
|
</react_native_1.ScrollView>
|
|
@@ -119,7 +119,7 @@
|
|
|
119
119
|
</react_native_1.ScrollView>)}
|
|
120
120
|
|
|
121
121
|
|
|
122
|
-
{a==="raw"&&(
|
|
122
|
+
{a==="raw"&&(g?<react_native_1.ScrollView style={{flex:1}}contentContainerStyle={{flexGrow:1}}showsVerticalScrollIndicator={!0}>
|
|
123
123
|
<react_native_1.View style={localStyles.rawEditorRow}>
|
|
124
124
|
|
|
125
125
|
<react_native_1.View style={localStyles.gutter}>
|
|
@@ -133,17 +133,17 @@
|
|
|
133
133
|
<react_native_1.View style={localStyles.rawTextContainer}>
|
|
134
134
|
{h.map((n,l)=>{const s=n.match(/^(\s+)(.*)$/);if(s){const p=s[1],w=s[2],v=p.replace(/ /g,"\xB7 ").replace(/ /g,"\xB7");return<react_native_1.View key={l}style={localStyles.rawCodeLineRow}>
|
|
135
135
|
<react_native_1.Text style={localStyles.indentDots}>{v}</react_native_1.Text>
|
|
136
|
-
<HighlightText_1.default text={w}search={t}detectLinks={
|
|
136
|
+
<HighlightText_1.default text={w}search={t}detectLinks={u.length<2e4}style={localStyles.rawMonospaceText}selectable={!0}highlightStyle={localStyles.highlight}/>
|
|
137
137
|
</react_native_1.View>}return<react_native_1.View key={l}style={localStyles.rawCodeLineRow}>
|
|
138
|
-
<HighlightText_1.default text={n}search={t}detectLinks={
|
|
138
|
+
<HighlightText_1.default text={n}search={t}detectLinks={u.length<2e4}style={localStyles.rawMonospaceText}selectable={!0}highlightStyle={localStyles.highlight}/>
|
|
139
139
|
</react_native_1.View>})}
|
|
140
140
|
</react_native_1.View>
|
|
141
141
|
</react_native_1.ScrollView>
|
|
142
142
|
</react_native_1.View>
|
|
143
143
|
|
|
144
|
-
{C&&<react_native_1.TouchableOpacity onPress={()=>
|
|
144
|
+
{C&&<react_native_1.TouchableOpacity onPress={()=>k(!0)}style={localStyles.truncationBanner}>
|
|
145
145
|
<react_native_1.Text style={localStyles.truncationText}>
|
|
146
|
-
Showing first 50 KB ({Math.round(
|
|
146
|
+
Showing first 50 KB ({Math.round(u.length/1024)} KB total) · Tap to load full payload
|
|
147
147
|
</react_native_1.Text>
|
|
148
148
|
</react_native_1.TouchableOpacity>}
|
|
149
149
|
</react_native_1.ScrollView>:<react_native_1.View>
|
|
@@ -160,26 +160,26 @@
|
|
|
160
160
|
<react_native_1.View style={localStyles.rawTextContainer}>
|
|
161
161
|
{h.map((n,l)=>{const s=n.match(/^(\s+)(.*)$/);if(s){const p=s[1],w=s[2],v=p.replace(/ /g,"\xB7 ").replace(/ /g,"\xB7");return<react_native_1.View key={l}style={localStyles.rawCodeLineRow}>
|
|
162
162
|
<react_native_1.Text style={localStyles.indentDots}>{v}</react_native_1.Text>
|
|
163
|
-
<HighlightText_1.default text={w}search={t}detectLinks={
|
|
163
|
+
<HighlightText_1.default text={w}search={t}detectLinks={u.length<2e4}style={localStyles.rawMonospaceText}selectable={!0}highlightStyle={localStyles.highlight}/>
|
|
164
164
|
</react_native_1.View>}return<react_native_1.View key={l}style={localStyles.rawCodeLineRow}>
|
|
165
|
-
<HighlightText_1.default text={n}search={t}detectLinks={
|
|
165
|
+
<HighlightText_1.default text={n}search={t}detectLinks={u.length<2e4}style={localStyles.rawMonospaceText}selectable={!0}highlightStyle={localStyles.highlight}/>
|
|
166
166
|
</react_native_1.View>})}
|
|
167
167
|
</react_native_1.View>
|
|
168
168
|
</react_native_1.ScrollView>
|
|
169
169
|
</react_native_1.View>
|
|
170
170
|
|
|
171
|
-
{C&&<react_native_1.TouchableOpacity onPress={()=>
|
|
171
|
+
{C&&<react_native_1.TouchableOpacity onPress={()=>k(!0)}style={localStyles.truncationBanner}>
|
|
172
172
|
<react_native_1.Text style={localStyles.truncationText}>
|
|
173
|
-
Showing first 50 KB ({Math.round(
|
|
173
|
+
Showing first 50 KB ({Math.round(u.length/1024)} KB total) · Tap to load full payload
|
|
174
174
|
</react_native_1.Text>
|
|
175
175
|
</react_native_1.TouchableOpacity>}
|
|
176
176
|
</react_native_1.View>)}
|
|
177
177
|
|
|
178
178
|
|
|
179
|
-
{a==="table"&&(
|
|
180
|
-
{
|
|
179
|
+
{a==="table"&&(g?<react_native_1.ScrollView style={{flex:1}}>
|
|
180
|
+
{j()}
|
|
181
181
|
</react_native_1.ScrollView>:<react_native_1.View style={localStyles.tableView}>
|
|
182
|
-
{
|
|
182
|
+
{j()}
|
|
183
183
|
</react_native_1.View>)}
|
|
184
184
|
</react_native_1.View>
|
|
185
185
|
</react_native_1.View>}),localStyles=react_native_1.StyleSheet.create({container:{backgroundColor:"#FFFFFF",borderRadius:12,borderWidth:1.5,borderColor:"#E2E8F0",overflow:"hidden",shadowColor:"#4F46E5",shadowOpacity:.05,shadowRadius:6,shadowOffset:{width:0,height:2},elevation:2,width:"100%"},snippetHeader:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",backgroundColor:"#F1F5F9",borderBottomWidth:1,borderBottomColor:"#E2E8F0",paddingHorizontal:8,paddingVertical:6,gap:6},headerLeft:{flexDirection:"row",alignItems:"center",gap:5,flexShrink:1,minWidth:0},langBadge:{backgroundColor:"#FFFFFF",borderRadius:4,borderWidth:1,borderColor:"#CBD5E1",paddingHorizontal:5,paddingVertical:2},langBadgeText:{fontFamily:monoFont,fontSize:9.5,color:"#475569",fontWeight:"700",letterSpacing:.4},metaBadge:{backgroundColor:"#FFFFFF",borderRadius:4,borderWidth:1,borderColor:"#CBD5E1",paddingHorizontal:5,paddingVertical:2,flexShrink:1},metaBadgeText:{fontFamily:monoFont,fontSize:9.5,color:"#64748B",fontWeight:"600"},metaStats:{fontFamily:monoFont,fontSize:9.5,color:"#64748B",flexShrink:1},headerRight:{flexDirection:"row",alignItems:"center",gap:5},snippetTabs:{flexDirection:"row",alignItems:"center",backgroundColor:"#E2E8F0",borderRadius:6,padding:2,borderWidth:1,borderColor:"#CBD5E1",gap:2},snippetTabBtn:{flexDirection:"row",alignItems:"center",gap:3.5,paddingVertical:2.5,paddingHorizontal:6,borderRadius:4},snippetTabBtnActive:{backgroundColor:"#4F46E5",shadowColor:"#4F46E5",shadowOffset:{width:0,height:1},shadowOpacity:.2,shadowRadius:2,elevation:1},snippetTabText:{fontFamily:monoFont,fontSize:9.5,color:"#64748B",fontWeight:"600"},snippetTabTextActive:{color:"#FFFFFF",fontWeight:"700"},toolToggleBtn:{paddingHorizontal:6,paddingVertical:2.5,borderRadius:5,backgroundColor:"#FFFFFF",borderWidth:1,borderColor:"#CBD5E1",alignItems:"center",justifyContent:"center"},toolToggleBtnActive:{backgroundColor:"#EEF2FF",borderColor:"#C7D2FE"},toolToggleText:{fontFamily:monoFont,fontSize:9.5,color:"#64748B",fontWeight:"600"},toolToggleTextActive:{color:"#4F46E5",fontWeight:"700"},copyBtn:{width:24,height:24,borderRadius:5,backgroundColor:"#FFFFFF",borderWidth:1,borderColor:"#CBD5E1",alignItems:"center",justifyContent:"center"},copyBtnSuccess:{borderColor:"#10B981",backgroundColor:"#ECFDF5"},editorBody:{backgroundColor:"#FFFFFF",minHeight:100},prettyContainer:{padding:12,minWidth:"100%",backgroundColor:"#FFFFFF"},rawEditorRow:{flexDirection:"row",alignItems:"stretch",minHeight:100},gutter:{backgroundColor:"#F1F5F9",borderRightWidth:1,borderRightColor:"#E2E8F0",paddingVertical:10,paddingHorizontal:8,alignItems:"flex-end",userSelect:"none"},gutterNumber:{fontFamily:monoFont,fontSize:11.5,height:18,lineHeight:18,color:"#94A3B8",textAlign:"right"},rawTextContainer:{paddingVertical:10,paddingHorizontal:12,backgroundColor:"#FFFFFF"},rawCodeLineRow:{flexDirection:"row",alignItems:"center",height:18},indentDots:{fontFamily:monoFont,fontSize:11.5,lineHeight:18,color:"#CBD5E1",letterSpacing:.5},rawMonospaceText:{fontFamily:monoFont,fontSize:11.5,lineHeight:18,color:"#0F172A"},truncationBanner:{margin:10,backgroundColor:"#EEF2FF",paddingVertical:8,paddingHorizontal:12,borderRadius:6,alignItems:"center",borderWidth:1,borderColor:"#C7D2FE"},truncationText:{fontFamily:monoFont,fontSize:10.5,color:"#4F46E5",fontWeight:"600"},tableView:{flex:1},tableHeaderRow:{flexDirection:"row",backgroundColor:"#F1F5F9",borderBottomWidth:1,borderBottomColor:"#E2E8F0",paddingVertical:7,paddingHorizontal:12},tableHeaderCell:{fontFamily:monoFont,fontSize:10,color:"#475569",fontWeight:"700",letterSpacing:.5},tableRow:{flexDirection:"row",borderBottomWidth:1,borderBottomColor:"#F1F5F9",paddingVertical:8,paddingHorizontal:12,alignItems:"flex-start",backgroundColor:"#FFFFFF"},tableRowAlt:{backgroundColor:"#F8FAFC"},tableColKey:{flex:2,paddingRight:8},tableColVal:{flex:3},tableCellKey:{fontFamily:monoFont,fontSize:11.5,fontWeight:"700",color:"#4F46E5"},typePill:{alignSelf:"flex-start",borderRadius:4,borderWidth:1,paddingHorizontal:4,paddingVertical:1,marginTop:3},typePillText:{fontFamily:monoFont,fontSize:9,fontWeight:"700"},tableCellValue:{fontFamily:monoFont,fontSize:11.5,color:"#0F172A",lineHeight:17},tableCodeBox:{backgroundColor:"#F1F5F9",borderRadius:6,borderWidth:1,borderColor:"#E2E8F0",padding:6},showMoreBtn:{flexDirection:"row",alignItems:"center",gap:4,alignSelf:"flex-start",marginTop:4,paddingVertical:2,paddingHorizontal:4},showMoreText:{fontFamily:monoFont,fontSize:10,color:"#4F46E5",fontWeight:"600"},emptyContainer:{padding:24,alignItems:"center",justifyContent:"center"},emptyText:{fontFamily:monoFont,fontSize:11.5,color:"#64748B"},highlight:{backgroundColor:"#FEF08A",color:"#854D0E",fontFamily:monoFont,fontWeight:"700",borderRadius:2,paddingHorizontal:2},syntaxNull:{color:"#E11D48",fontStyle:"italic"},syntaxNumber:{color:"#D97706"},syntaxBoolean:{color:"#DB2777"},syntaxString:{color:"#059669"}});exports.default=JsonViewer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const LIB_VERSION = "2.3.
|
|
1
|
+
export declare const LIB_VERSION = "2.3.24";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.LIB_VERSION=void 0,exports.LIB_VERSION="2.3.
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.LIB_VERSION=void 0,exports.LIB_VERSION="2.3.24";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import De,{useMemo as A,useState as L}from"react";import{useTranslation as Ie}from"../../i18n";import{Pressable as Q,ScrollView as Ne,StyleSheet as Re,Text as T,TextInput as He,View as C}from"react-native";import{useInspector as Pe}from"./InspectorContext";import X from"../HighlightText";import Ce from"../JsonViewer";import M from"../CopyButton";import Y from"../SegmentedTabs";import{ClearIcon as Ae,SearchIcon as Le,PrettyIcon as Me,RawIcon as Te,TableIcon as Ee,LayersIcon as Se,TerminalIcon as Oe,RequestIcon as Ue,InfoCircleIcon as Je,DocIcon as Ke,ExternalLinkIcon as Ge,FolderIcon as Qe}from"../NetworkIcons";import{AppColors as e}from"../../styles/AppColors";import{AppFonts as B}from"../../styles/AppFonts";import z from"../../styles";import{getJsonContent as Xe,getSize as _,formatDateTime as ee,parseStackLine as Ve,openInVSCode as Ye}from"../../helpers";const Be=S=>{const D=Date.now()-S,E=Math.floor(D/1e3),$=Math.floor(E/60),P=Math.floor($/60),J=Math.floor(P/24);return E<60?`${E}s ago`:$<60?`${$}m ago`:P<24?`${P}h ago`:`${J}d ago`},Ze=De.memo(()=>{const{t:S}=Ie(),{selectedLog:r}=Pe(),[D,E]=L("output"),[$,P]=L(""),[J,ze]=L("
|
|
1
|
+
import De,{useMemo as A,useState as L}from"react";import{useTranslation as Ie}from"../../i18n";import{Pressable as Q,ScrollView as Ne,StyleSheet as Re,Text as T,TextInput as He,View as C}from"react-native";import{useInspector as Pe}from"./InspectorContext";import X from"../HighlightText";import Ce from"../JsonViewer";import M from"../CopyButton";import Y from"../SegmentedTabs";import{ClearIcon as Ae,SearchIcon as Le,PrettyIcon as Me,RawIcon as Te,TableIcon as Ee,LayersIcon as Se,TerminalIcon as Oe,RequestIcon as Ue,InfoCircleIcon as Je,DocIcon as Ke,ExternalLinkIcon as Ge,FolderIcon as Qe}from"../NetworkIcons";import{AppColors as e}from"../../styles/AppColors";import{AppFonts as B}from"../../styles/AppFonts";import z from"../../styles";import{getJsonContent as Xe,getSize as _,formatDateTime as ee,parseStackLine as Ve,openInVSCode as Ye}from"../../helpers";const Be=S=>{const D=Date.now()-S,E=Math.floor(D/1e3),$=Math.floor(E/60),P=Math.floor($/60),J=Math.floor(P/24);return E<60?`${E}s ago`:$<60?`${$}m ago`:P<24?`${P}h ago`:`${J}d ago`},Ze=De.memo(()=>{const{t:S}=Ie(),{selectedLog:r}=Pe(),[D,E]=L("output"),[$,P]=L(""),[J,ze]=L("raw"),W=A(()=>r?Xe(r.message):null,[r]),[N,re]=L("structured"),[K,ve]=L("caller"),[Z,We]=L("app"),O=A(()=>r?K==="error"&&r.errorStack?r.errorStack:r.stack||r.caller||"":"",[r,K]),F=A(()=>O?O.split(`
|
|
2
2
|
`).map(t=>t.trim()).filter(t=>t.length>0).map((t,v)=>Ve(t,v===0)):[],[O]),R=A(()=>F.filter(t=>t.frameType==="app"||!t.isRuntimeNoise),[F]),oe=A(()=>Z==="app"&&R.length>0?R:F,[Z,R,F]),V=A(()=>r?R.length>0?R[0]:r.caller&&r.caller!=="Unknown"?Ve(r.caller,!0):F.length>0?F[0]:null:null,[r,R,F]);if(!r)return null;const H=e.primaryLight!==e.white,U=(()=>{const t=(r.type||"log").toLowerCase(),v=(r.sourceMethod||t).toLowerCase();return t==="error"||v==="error"?{border:e.red500,badgeBg:e.red100,badgeText:e.redErrorText,label:"ERROR",methodBorder:e.errorBorder,methodBg:e.red100,methodText:e.redErrorText}:t==="warn"||v==="warn"?{border:e.amber500,badgeBg:e.amber100,badgeText:e.amber800Warm,label:"WARN",methodBorder:e.amber200,methodBg:e.amber100,methodText:e.amber800Warm}:t==="debug"||v==="debug"?{border:e.violet500,badgeBg:e.purple100,badgeText:e.violet600,label:"DEBUG",methodBorder:e.purple200,methodBg:e.purple100,methodText:e.violet600}:t==="info"||v==="info"?{border:e.sky500,badgeBg:e.sky100,badgeText:e.sky600,label:"INFO",methodBorder:e.sky400,methodBg:e.sky100,methodText:e.sky600}:{border:e.indigo500,badgeBg:e.indigo50,badgeText:e.indigo600Alt,label:"LOG",methodBorder:e.indigo400,methodBg:e.indigo50,methodText:e.indigo600Alt}})(),le=r.rawArgs!=null&&r.rawArgs.length>1,$e=!!(r.stack&&r.stack.trim().length>0),Fe=[{key:"output",label:S("console.tabOutput"),icon:t=><Oe color={t?e.white:e.grayTextWeak}size={12}/>},...le?[{key:"arguments",label:S("console.tabArgs",{count:r.rawArgs?.length}),icon:t=><Ue color={t?e.white:e.grayTextWeak}size={12}/>}]:[],...$e?[{key:"stack",label:S("console.tabStack"),icon:t=><Se color={t?e.white:e.grayTextWeak}size={12}/>}]:[],{key:"metadata",label:S("console.tabMetadata"),icon:t=><Je color={t?e.white:e.grayTextWeak}size={12}/>}];return<C style={{flex:1}}>
|
|
3
3
|
|
|
4
4
|
<C style={z.detailInfoBar}>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import Ze,{useState as E,useMemo as Ve,useEffect as _e}from"react";import{Alert as ze,Platform as et,Pressable as U,ScrollView as Z,StyleSheet as tt,Text as C,TextInput as Tt,ToastAndroid as Oe,TouchableOpacity as Ne,View as T}from"react-native";import{useTranslation as ht}from"../../i18n";import{useInspector as wt}from"./InspectorContext";import Me from"../SegmentedTabs";import K from"../JsonViewer";import He from"../DiffViewer";import Ee from"../CopyButton";import Ct from"../TouchableScale";import St from"../HighlightText";import Bt from"../AnimatedEntrance";import{getActionHistory as Vt}from"../../customHooks/reduxLogger";import{getSize as q,openInVSCode as _,parseStackLine as je}from"../../helpers";import{getCustomStorage as $e}from"../../helpers/settingsStore";import{AppColors as e}from"../../styles/AppColors";import{AppFonts as k}from"../../styles/AppFonts";import{TerminalIcon as It,SearchIcon as Pt,ClearIcon as Wt,ClockIcon as Ie,LayersIcon as Je,TrashIcon as Ge,ForwardChevronIcon as Rt,LiveStateIcon as Ue,TimelineIcon as Te,StorageIcon as Ce,MetadataIcon as Ft,BoltIcon as Pe,AtomIcon as Dt,ScreenIcon as At,ListenerIcon as Lt,DocIcon as We,ExternalLinkIcon as Se,CodeBracketsIcon as Ot}from"../NetworkIcons";const Ke=z=>{switch(z){case"saga":return{label:"SAGA",renderIcon:(A,D=9)=><Pe color={A}size={D}/>,bg:e.purple100,text:e.brandPurple,border:e.purple200};case"thunk":return{label:"THUNK",renderIcon:(A,D=9)=><Dt color={A}size={D}/>,bg:e.amber100,text:e.amber800Warm,border:e.amber200};case"ui":return{label:"UI",renderIcon:(A,D=9)=><At color={A}size={D}/>,bg:e.sky100,text:e.sky600,border:e.sky400};case"listener":return{label:"LISTENER",renderIcon:(A,D=9)=><Lt color={A}size={D}/>,bg:e.teal100,text:e.teal700,border:e.teal400};default:return{label:"DIRECT",renderIcon:(A,D=9)=><Pe color={A}size={D}/>,bg:e.slate100,text:e.slate700,border:e.slate200}}},Nt=Ze.memo(()=>{const{t:z}=ht(),{reduxState:A,reduxLastActionMap:D,selectedReduxSlice:W,selectedReduxAction:V,setSelectedReduxSlice:Mt}=wt(),[F,Re]=E(""),[O,ve]=E("live"),[Q,qe]=E("payload"),[Fe,De]=E("
|
|
1
|
+
import Ze,{useState as E,useMemo as Ve,useEffect as _e}from"react";import{Alert as ze,Platform as et,Pressable as U,ScrollView as Z,StyleSheet as tt,Text as C,TextInput as Tt,ToastAndroid as Oe,TouchableOpacity as Ne,View as T}from"react-native";import{useTranslation as ht}from"../../i18n";import{useInspector as wt}from"./InspectorContext";import Me from"../SegmentedTabs";import K from"../JsonViewer";import He from"../DiffViewer";import Ee from"../CopyButton";import Ct from"../TouchableScale";import St from"../HighlightText";import Bt from"../AnimatedEntrance";import{getActionHistory as Vt}from"../../customHooks/reduxLogger";import{getSize as q,openInVSCode as _,parseStackLine as je}from"../../helpers";import{getCustomStorage as $e}from"../../helpers/settingsStore";import{AppColors as e}from"../../styles/AppColors";import{AppFonts as k}from"../../styles/AppFonts";import{TerminalIcon as It,SearchIcon as Pt,ClearIcon as Wt,ClockIcon as Ie,LayersIcon as Je,TrashIcon as Ge,ForwardChevronIcon as Rt,LiveStateIcon as Ue,TimelineIcon as Te,StorageIcon as Ce,MetadataIcon as Ft,BoltIcon as Pe,AtomIcon as Dt,ScreenIcon as At,ListenerIcon as Lt,DocIcon as We,ExternalLinkIcon as Se,CodeBracketsIcon as Ot}from"../NetworkIcons";const Ke=z=>{switch(z){case"saga":return{label:"SAGA",renderIcon:(A,D=9)=><Pe color={A}size={D}/>,bg:e.purple100,text:e.brandPurple,border:e.purple200};case"thunk":return{label:"THUNK",renderIcon:(A,D=9)=><Dt color={A}size={D}/>,bg:e.amber100,text:e.amber800Warm,border:e.amber200};case"ui":return{label:"UI",renderIcon:(A,D=9)=><At color={A}size={D}/>,bg:e.sky100,text:e.sky600,border:e.sky400};case"listener":return{label:"LISTENER",renderIcon:(A,D=9)=><Lt color={A}size={D}/>,bg:e.teal100,text:e.teal700,border:e.teal400};default:return{label:"DIRECT",renderIcon:(A,D=9)=><Pe color={A}size={D}/>,bg:e.slate100,text:e.slate700,border:e.slate200}}},Nt=Ze.memo(()=>{const{t:z}=ht(),{reduxState:A,reduxLastActionMap:D,selectedReduxSlice:W,selectedReduxAction:V,setSelectedReduxSlice:Mt}=wt(),[F,Re]=E(""),[O,ve]=E("live"),[Q,qe]=E("payload"),[Fe,De]=E("raw"),[Qe,Xe]=E(null),[J,G]=E(!1),[X,N]=E(null),ke=Ve(()=>Vt(),[D]),j=Ve(()=>W?ke.filter(B=>!B.affectedSlices||B.affectedSlices.length===0?!0:B.affectedSlices.includes(W)):ke,[ke,W]),Ae=Ve(()=>{if(!F.trim())return j;const B=F.toLowerCase();return j.filter(R=>R.type.toLowerCase().includes(B)||R.callerFile&&R.callerFile.toLowerCase().includes(B)||R.payload&&JSON.stringify(R.payload).toLowerCase().includes(B))},[j,F]);_e(()=>{if(!W)return;async function B(){try{const R=$e();if(!R){G(!1),N(null);return}let v=await R.getItem(`persist:${W}`);if(v){try{N(JSON.parse(v))}catch{N(v)}G(!0);return}let I=await R.getItem("persist:root");if(I){const S=JSON.parse(I);if(S&&S[W]!==void 0){const P=S[W];try{N(typeof P=="string"?JSON.parse(P):P)}catch{N(P)}G(!0);return}}}catch{}G(!1),N(null)}B()},[W]);const Le=()=>{W&&ze.alert("Clear Persisted State",`Are you sure you want to delete persisted storage for slice "${W}"?`,[{text:"Cancel",style:"cancel"},{text:"Delete",style:"destructive",onPress:async()=>{try{const B=$e();if(!B)return;typeof B.removeItem=="function"?await B.removeItem(`persist:${W}`):await B.setItem(`persist:${W}`,""),G(!1),N(null),ve("live"),et.OS==="android"?Oe.show("Persisted state cleared",Oe.SHORT):ze.alert("Cleared","Persisted state has been cleared.")}catch{ze.alert("Error","Failed to clear persisted state.")}}}])};if(W!=null){const B=A?.[W],R=B&&typeof B=="object"?Object.keys(B).length:typeof B<"u"?1:0,v=D[W],I=[{key:"live",label:z("redux.liveState","Live State"),icon:S=><Ue color={S?e.white:e.grayText}size={12}/>},{key:"timeline",label:`${z("redux.timeline","Timeline")} (${j.length})`,icon:S=><Te color={S?e.white:e.grayText}size={12}/>},{key:"persisted",label:J?z("redux.persisted","Persisted"):z("redux.storage","Storage"),icon:S=><Ce color={S?e.white:e.grayText}size={12}/>},{key:"metadata",label:z("redux.metadata","Metadata"),icon:S=><Ft color={S?e.white:e.grayText}size={12}/>}];return<T style={{flex:1,backgroundColor:e.grayBackground}}>
|
|
2
2
|
|
|
3
3
|
<T style={t.infoBar}>
|
|
4
4
|
<T style={t.infoTopRow}>
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
`)||
|
|
1
|
+
import ge,{useState as H,useEffect as ee,useMemo as v}from"react";import{ScrollView as I,View as F,Text as T,StyleSheet as ue,TouchableOpacity as A,Platform as we}from"react-native";import{useTranslation as Te}from"../i18n";import Ce from"./TreeNode";import L from"./HighlightText";import Se from"./TouchableScale";import{PrettyIcon as Ve,RawIcon as Be,TableIcon as Ee,ChevronIcon as De,CopyIcon as Re,CheckIcon as We}from"./NetworkIcons";import{getSize as Ie,copyToClipboard as Ae}from"../helpers";import{triggerNativeHaptic as Oe}from"../native/NativeInspector";const C=we.select({ios:"Menlo",android:"monospace",default:"monospace"}),He=t=>t===null?{label:"null",color:"#E11D48",bg:"#FFF1F2",border:"#FECDD3"}:t===void 0?{label:"undef",color:"#E11D48",bg:"#FFF1F2",border:"#FECDD3"}:Array.isArray(t)?{label:`arr[${t.length}]`,color:"#2563EB",bg:"#EFF6FF",border:"#BFDBFE"}:typeof t=="object"?{label:`obj{${Object.keys(t).length}}`,color:"#7C3AED",bg:"#F5F3FF",border:"#DDD6FE"}:typeof t=="number"?{label:"num",color:"#D97706",bg:"#FEF3C7",border:"#FDE68A"}:typeof t=="boolean"?{label:"bool",color:"#DB2777",bg:"#FDF2F8",border:"#FBCFE8"}:{label:"str",color:"#059669",bg:"#ECFDF5",border:"#A7F3D0"},Le=ge.memo(({itemKey:t,val:f,search:O,index:$})=>{const[k,z]=H(!1),P=f!==null&&typeof f=="object",E=He(f);let V="";if(f===null)V="null";else if(f===void 0)V="undefined";else if(P)try{V=JSON.stringify(f,null,2)}catch{V=String(f)}else V=String(f);const _=V.includes(`
|
|
2
|
+
`)||V.length>80;return<F style={[e.tableRow,$%2===1&&e.tableRowAlt]}>
|
|
3
3
|
|
|
4
4
|
<F style={e.tableColKey}>
|
|
5
|
-
<L text={t}search={
|
|
6
|
-
<F style={[e.typePill,{backgroundColor:
|
|
7
|
-
<T style={[e.typePillText,{color:
|
|
8
|
-
{
|
|
5
|
+
<L text={t}search={O}style={e.tableCellKey}highlightStyle={e.highlight}/>
|
|
6
|
+
<F style={[e.typePill,{backgroundColor:E.bg,borderColor:E.border}]}>
|
|
7
|
+
<T style={[e.typePillText,{color:E.color}]}>
|
|
8
|
+
{E.label}
|
|
9
9
|
</T>
|
|
10
10
|
</F>
|
|
11
11
|
</F>
|
|
@@ -13,26 +13,26 @@ import de,{useState as j,useEffect as ee,useMemo as v}from"react";import{ScrollV
|
|
|
13
13
|
|
|
14
14
|
<F style={e.tableColVal}>
|
|
15
15
|
<F style={P?e.tableCodeBox:void 0}>
|
|
16
|
-
<L text={
|
|
16
|
+
<L text={V}search={O}style={[e.tableCellValue,f==null?e.syntaxNull:void 0,typeof f=="number"?e.syntaxNumber:void 0,typeof f=="boolean"?e.syntaxBoolean:void 0,typeof f=="string"?e.syntaxString:void 0]}highlightStyle={e.highlight}numberOfLines={k?void 0:3}selectable={!0}/>
|
|
17
17
|
</F>
|
|
18
|
-
{_&&<
|
|
18
|
+
{_&&<A onPress={()=>z(R=>!R)}hitSlop={6}style={e.showMoreBtn}>
|
|
19
19
|
<T style={e.showMoreText}>
|
|
20
|
-
{
|
|
20
|
+
{k?"Collapse":"Expand"}
|
|
21
21
|
</T>
|
|
22
|
-
<
|
|
23
|
-
</
|
|
22
|
+
<De direction={k?"up":"down"}size={9}color="#4F46E5"/>
|
|
23
|
+
</A>}
|
|
24
24
|
</F>
|
|
25
|
-
</F>}),
|
|
26
|
-
`):[""],[Q]),
|
|
25
|
+
</F>}),Pe=ge.memo(({data:t,search:f,forceOpen:O,defaultExpandDepth:$=1,wrap:k,fullHeight:z=!1,maxHeight:P,mode:E,onModeChange:V,hideTabs:_=!1})=>{const{t:R}=Te(),[ye,te]=H(E??"raw"),[oe,re]=H(!1),[N,le]=H(k??!1),[G,ne]=H(O),S=V&&E?E:ye,Y=m=>{te(m),V&&V(m)};ee(()=>{k!==void 0&&le(k)},[k]),ee(()=>{O!==void 0&&ne(O)},[O]);const ie=v(()=>{if(t==null)return"";if(typeof t=="string")return t;try{return JSON.stringify(t,null,2)??""}catch{return String(t)||""}},[t]),D=v(()=>{if(typeof t=="string")return t;try{return JSON.stringify(t)??""}catch{return String(t)||""}},[t]),pe=D,[be,ae]=H(!1),se=5e4,q=typeof D=="string"?D:"",U=q.length>se&&!be,Q=U?q.slice(0,se):q,Ne=typeof ie=="string"?ie:"",K=v(()=>Q?Q.split(`
|
|
26
|
+
`):[""],[Q]),ce=K.length,Fe=v(()=>Ie(t),[t]);ee(()=>{E&&te(E)},[E]);const fe=()=>{Oe("success"),Ae(pe||D,"JSON"),re(!0),setTimeout(()=>re(!1),1200)},X=typeof t=="object"&&t!==null,he=t==null||X&&Object.keys(t).length===0,de=()=>{if(!X)return<F style={e.tableRow}>
|
|
27
27
|
<F style={e.tableColKey}>
|
|
28
|
-
<T style={e.tableCellKey}>{
|
|
28
|
+
<T style={e.tableCellKey}>{R("network.jsonViewer.value")}</T>
|
|
29
29
|
</F>
|
|
30
30
|
<F style={e.tableColVal}>
|
|
31
31
|
<T style={e.tableCellValue}>{String(t)}</T>
|
|
32
32
|
</F>
|
|
33
|
-
</F>;let
|
|
33
|
+
</F>;let m=Object.keys(t);if(f&&f.trim().length>0){const x=f.trim().toLowerCase();m=m.filter(B=>{const W=t[B],M=typeof W=="object"&&W!==null?JSON.stringify(W):String(W);return B.toLowerCase().includes(x)||M.toLowerCase().includes(x)})}return m.length===0?<F style={e.emptyContainer}>
|
|
34
34
|
<T style={e.emptyText}>
|
|
35
|
-
{f&&f.trim().length>0?"No matching keys or values found":
|
|
35
|
+
{f&&f.trim().length>0?"No matching keys or values found":R("network.jsonViewer.emptyTable")}
|
|
36
36
|
</T>
|
|
37
37
|
</F>:<F style={e.tableView}>
|
|
38
38
|
|
|
@@ -40,8 +40,8 @@ import de,{useState as j,useEffect as ee,useMemo as v}from"react";import{ScrollV
|
|
|
40
40
|
<T style={[e.tableHeaderCell,{flex:2}]}>KEY / PROPERTY</T>
|
|
41
41
|
<T style={[e.tableHeaderCell,{flex:3}]}>VALUE</T>
|
|
42
42
|
</F>
|
|
43
|
-
{
|
|
44
|
-
</F>},J=<
|
|
43
|
+
{m.map((x,B)=><Le key={x}index={B}itemKey={x}val={t[x]}search={f}/>)}
|
|
44
|
+
</F>},J=<Ce data={t}search={f}forceOpen={G}defaultExpandDepth={G?99:$}/>;return<F style={[e.container,z&&{flex:1}]}>
|
|
45
45
|
|
|
46
46
|
<F style={e.snippetHeader}>
|
|
47
47
|
|
|
@@ -51,7 +51,7 @@ import de,{useState as j,useEffect as ee,useMemo as v}from"react";import{ScrollV
|
|
|
51
51
|
</F>
|
|
52
52
|
<F style={e.metaBadge}>
|
|
53
53
|
<T style={e.metaBadgeText}numberOfLines={1}ellipsizeMode="tail">
|
|
54
|
-
{
|
|
54
|
+
{ce} {ce===1?"line":"lines"} · {Fe}
|
|
55
55
|
</T>
|
|
56
56
|
</F>
|
|
57
57
|
</F>
|
|
@@ -59,127 +59,127 @@ import de,{useState as j,useEffect as ee,useMemo as v}from"react";import{ScrollV
|
|
|
59
59
|
|
|
60
60
|
<F style={e.headerRight}>
|
|
61
61
|
{!_&&<F style={e.snippetTabs}>
|
|
62
|
-
<
|
|
63
|
-
<
|
|
64
|
-
<T style={[e.snippetTabText,
|
|
65
|
-
{
|
|
62
|
+
<A onPress={()=>Y("pretty")}activeOpacity={.7}hitSlop={{top:8,bottom:8,left:4,right:4}}style={[e.snippetTabBtn,S==="pretty"&&e.snippetTabBtnActive]}>
|
|
63
|
+
<Ve color={S==="pretty"?"#FFFFFF":"#64748B"}size={11}/>
|
|
64
|
+
<T style={[e.snippetTabText,S==="pretty"&&e.snippetTabTextActive]}>
|
|
65
|
+
{R("network.jsonViewer.pretty")}
|
|
66
66
|
</T>
|
|
67
|
-
</
|
|
67
|
+
</A>
|
|
68
68
|
|
|
69
|
-
<
|
|
70
|
-
<
|
|
71
|
-
<T style={[e.snippetTabText,
|
|
72
|
-
{
|
|
69
|
+
<A onPress={()=>Y("raw")}activeOpacity={.7}hitSlop={{top:8,bottom:8,left:4,right:4}}style={[e.snippetTabBtn,S==="raw"&&e.snippetTabBtnActive]}>
|
|
70
|
+
<Be color={S==="raw"?"#FFFFFF":"#64748B"}size={11}/>
|
|
71
|
+
<T style={[e.snippetTabText,S==="raw"&&e.snippetTabTextActive]}>
|
|
72
|
+
{R("network.jsonViewer.raw")}
|
|
73
73
|
</T>
|
|
74
|
-
</
|
|
74
|
+
</A>
|
|
75
75
|
|
|
76
|
-
<
|
|
77
|
-
<
|
|
78
|
-
<T style={[e.snippetTabText,
|
|
79
|
-
{
|
|
76
|
+
<A onPress={()=>Y("table")}activeOpacity={.7}hitSlop={{top:8,bottom:8,left:4,right:4}}style={[e.snippetTabBtn,S==="table"&&e.snippetTabBtnActive]}>
|
|
77
|
+
<Ee color={S==="table"?"#FFFFFF":"#64748B"}size={11}/>
|
|
78
|
+
<T style={[e.snippetTabText,S==="table"&&e.snippetTabTextActive]}>
|
|
79
|
+
{R("network.jsonViewer.table")}
|
|
80
80
|
</T>
|
|
81
|
-
</
|
|
81
|
+
</A>
|
|
82
82
|
</F>}
|
|
83
83
|
|
|
84
84
|
|
|
85
|
-
{
|
|
85
|
+
{S==="pretty"&&X&&<A onPress={()=>ne(m=>!m)}hitSlop={{top:6,bottom:6,left:4,right:4}}style={e.toolToggleBtn}>
|
|
86
86
|
<T style={e.toolToggleText}>
|
|
87
87
|
{G?"Fold":"Expand"}
|
|
88
88
|
</T>
|
|
89
|
-
</
|
|
89
|
+
</A>}
|
|
90
90
|
|
|
91
91
|
|
|
92
|
-
{
|
|
92
|
+
{S==="raw"&&<A onPress={()=>le(m=>!m)}hitSlop={{top:6,bottom:6,left:4,right:4}}style={[e.toolToggleBtn,N&&e.toolToggleBtnActive]}>
|
|
93
93
|
<T style={[e.toolToggleText,N&&e.toolToggleTextActive]}>
|
|
94
94
|
Wrap
|
|
95
95
|
</T>
|
|
96
|
-
</
|
|
96
|
+
</A>}
|
|
97
97
|
|
|
98
98
|
|
|
99
|
-
<
|
|
100
|
-
{oe?<
|
|
101
|
-
</
|
|
99
|
+
<Se onPress={fe}hitSlop={8}style={[e.copyBtn,oe&&e.copyBtnSuccess]}>
|
|
100
|
+
{oe?<We color="#10B981"size={13}/>:<Re color="#64748B"size={13}/>}
|
|
101
|
+
</Se>
|
|
102
102
|
</F>
|
|
103
103
|
</F>
|
|
104
104
|
|
|
105
105
|
<F style={[e.editorBody,z&&{flex:1,maxHeight:void 0},!z&&P!=null&&{maxHeight:P}]}>
|
|
106
106
|
|
|
107
|
-
{
|
|
107
|
+
{S==="pretty"&&(he?<F style={e.emptyContainer}>
|
|
108
108
|
<T style={e.emptyText}>
|
|
109
|
-
{
|
|
109
|
+
{R("network.jsonViewer.emptyPayload")}
|
|
110
110
|
</T>
|
|
111
|
-
</F>:N?z?<
|
|
111
|
+
</F>:N?z?<I style={{flex:1}}contentContainerStyle={e.prettyContainer}>
|
|
112
112
|
{J}
|
|
113
|
-
</
|
|
114
|
-
<
|
|
113
|
+
</I>:<F style={e.prettyContainer}>{J}</F>:z?<I style={{flex:1}}contentContainerStyle={{flexGrow:1}}>
|
|
114
|
+
<I horizontal showsHorizontalScrollIndicator={!0}contentContainerStyle={e.prettyContainer}>
|
|
115
115
|
{J}
|
|
116
|
-
</
|
|
117
|
-
</
|
|
116
|
+
</I>
|
|
117
|
+
</I>:<I horizontal showsHorizontalScrollIndicator={!0}contentContainerStyle={e.prettyContainer}>
|
|
118
118
|
{J}
|
|
119
|
-
</
|
|
119
|
+
</I>)}
|
|
120
120
|
|
|
121
121
|
|
|
122
|
-
{
|
|
122
|
+
{S==="raw"&&(z?<I style={{flex:1}}contentContainerStyle={{flexGrow:1}}showsVerticalScrollIndicator={!0}>
|
|
123
123
|
<F style={e.rawEditorRow}>
|
|
124
124
|
|
|
125
125
|
<F style={e.gutter}>
|
|
126
|
-
{K.map((x
|
|
127
|
-
{
|
|
126
|
+
{K.map((m,x)=><T key={x}style={e.gutterNumber}>
|
|
127
|
+
{x+1}
|
|
128
128
|
</T>)}
|
|
129
129
|
</F>
|
|
130
130
|
|
|
131
131
|
|
|
132
|
-
<
|
|
132
|
+
<I horizontal={!N}showsHorizontalScrollIndicator={!0}style={{flex:1}}>
|
|
133
133
|
<F style={e.rawTextContainer}>
|
|
134
|
-
{K.map((x
|
|
134
|
+
{K.map((m,x)=>{const B=m.match(/^(\s+)(.*)$/);if(B){const W=B[1],M=B[2],Z=W.replace(/ /g,"\xB7 ").replace(/ /g,"\xB7");return<F key={x}style={e.rawCodeLineRow}>
|
|
135
135
|
<T style={e.indentDots}>{Z}</T>
|
|
136
|
-
<L text={M}search={f}detectLinks={
|
|
137
|
-
</F>}return<F key={
|
|
138
|
-
<L text={
|
|
136
|
+
<L text={M}search={f}detectLinks={D.length<2e4}style={e.rawMonospaceText}selectable={!0}highlightStyle={e.highlight}/>
|
|
137
|
+
</F>}return<F key={x}style={e.rawCodeLineRow}>
|
|
138
|
+
<L text={m}search={f}detectLinks={D.length<2e4}style={e.rawMonospaceText}selectable={!0}highlightStyle={e.highlight}/>
|
|
139
139
|
</F>})}
|
|
140
140
|
</F>
|
|
141
|
-
</
|
|
141
|
+
</I>
|
|
142
142
|
</F>
|
|
143
143
|
|
|
144
|
-
{U&&<
|
|
144
|
+
{U&&<A onPress={()=>ae(!0)}style={e.truncationBanner}>
|
|
145
145
|
<T style={e.truncationText}>
|
|
146
|
-
Showing first 50 KB ({Math.round(
|
|
146
|
+
Showing first 50 KB ({Math.round(D.length/1024)} KB total) · Tap to load full payload
|
|
147
147
|
</T>
|
|
148
|
-
</
|
|
149
|
-
</
|
|
148
|
+
</A>}
|
|
149
|
+
</I>:<F>
|
|
150
150
|
<F style={e.rawEditorRow}>
|
|
151
151
|
|
|
152
152
|
<F style={e.gutter}>
|
|
153
|
-
{K.map((x
|
|
154
|
-
{
|
|
153
|
+
{K.map((m,x)=><T key={x}style={e.gutterNumber}>
|
|
154
|
+
{x+1}
|
|
155
155
|
</T>)}
|
|
156
156
|
</F>
|
|
157
157
|
|
|
158
158
|
|
|
159
|
-
<
|
|
159
|
+
<I horizontal={!N}showsHorizontalScrollIndicator={!0}style={{flex:1}}>
|
|
160
160
|
<F style={e.rawTextContainer}>
|
|
161
|
-
{K.map((x
|
|
161
|
+
{K.map((m,x)=>{const B=m.match(/^(\s+)(.*)$/);if(B){const W=B[1],M=B[2],Z=W.replace(/ /g,"\xB7 ").replace(/ /g,"\xB7");return<F key={x}style={e.rawCodeLineRow}>
|
|
162
162
|
<T style={e.indentDots}>{Z}</T>
|
|
163
|
-
<L text={M}search={f}detectLinks={
|
|
164
|
-
</F>}return<F key={
|
|
165
|
-
<L text={
|
|
163
|
+
<L text={M}search={f}detectLinks={D.length<2e4}style={e.rawMonospaceText}selectable={!0}highlightStyle={e.highlight}/>
|
|
164
|
+
</F>}return<F key={x}style={e.rawCodeLineRow}>
|
|
165
|
+
<L text={m}search={f}detectLinks={D.length<2e4}style={e.rawMonospaceText}selectable={!0}highlightStyle={e.highlight}/>
|
|
166
166
|
</F>})}
|
|
167
167
|
</F>
|
|
168
|
-
</
|
|
168
|
+
</I>
|
|
169
169
|
</F>
|
|
170
170
|
|
|
171
|
-
{U&&<
|
|
171
|
+
{U&&<A onPress={()=>ae(!0)}style={e.truncationBanner}>
|
|
172
172
|
<T style={e.truncationText}>
|
|
173
|
-
Showing first 50 KB ({Math.round(
|
|
173
|
+
Showing first 50 KB ({Math.round(D.length/1024)} KB total) · Tap to load full payload
|
|
174
174
|
</T>
|
|
175
|
-
</
|
|
175
|
+
</A>}
|
|
176
176
|
</F>)}
|
|
177
177
|
|
|
178
178
|
|
|
179
|
-
{
|
|
180
|
-
{
|
|
181
|
-
</
|
|
182
|
-
{
|
|
179
|
+
{S==="table"&&(z?<I style={{flex:1}}>
|
|
180
|
+
{de()}
|
|
181
|
+
</I>:<F style={e.tableView}>
|
|
182
|
+
{de()}
|
|
183
183
|
</F>)}
|
|
184
184
|
</F>
|
|
185
|
-
</F>}),e=
|
|
185
|
+
</F>}),e=ue.create({container:{backgroundColor:"#FFFFFF",borderRadius:12,borderWidth:1.5,borderColor:"#E2E8F0",overflow:"hidden",shadowColor:"#4F46E5",shadowOpacity:.05,shadowRadius:6,shadowOffset:{width:0,height:2},elevation:2,width:"100%"},snippetHeader:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",backgroundColor:"#F1F5F9",borderBottomWidth:1,borderBottomColor:"#E2E8F0",paddingHorizontal:8,paddingVertical:6,gap:6},headerLeft:{flexDirection:"row",alignItems:"center",gap:5,flexShrink:1,minWidth:0},langBadge:{backgroundColor:"#FFFFFF",borderRadius:4,borderWidth:1,borderColor:"#CBD5E1",paddingHorizontal:5,paddingVertical:2},langBadgeText:{fontFamily:C,fontSize:9.5,color:"#475569",fontWeight:"700",letterSpacing:.4},metaBadge:{backgroundColor:"#FFFFFF",borderRadius:4,borderWidth:1,borderColor:"#CBD5E1",paddingHorizontal:5,paddingVertical:2,flexShrink:1},metaBadgeText:{fontFamily:C,fontSize:9.5,color:"#64748B",fontWeight:"600"},metaStats:{fontFamily:C,fontSize:9.5,color:"#64748B",flexShrink:1},headerRight:{flexDirection:"row",alignItems:"center",gap:5},snippetTabs:{flexDirection:"row",alignItems:"center",backgroundColor:"#E2E8F0",borderRadius:6,padding:2,borderWidth:1,borderColor:"#CBD5E1",gap:2},snippetTabBtn:{flexDirection:"row",alignItems:"center",gap:3.5,paddingVertical:2.5,paddingHorizontal:6,borderRadius:4},snippetTabBtnActive:{backgroundColor:"#4F46E5",shadowColor:"#4F46E5",shadowOffset:{width:0,height:1},shadowOpacity:.2,shadowRadius:2,elevation:1},snippetTabText:{fontFamily:C,fontSize:9.5,color:"#64748B",fontWeight:"600"},snippetTabTextActive:{color:"#FFFFFF",fontWeight:"700"},toolToggleBtn:{paddingHorizontal:6,paddingVertical:2.5,borderRadius:5,backgroundColor:"#FFFFFF",borderWidth:1,borderColor:"#CBD5E1",alignItems:"center",justifyContent:"center"},toolToggleBtnActive:{backgroundColor:"#EEF2FF",borderColor:"#C7D2FE"},toolToggleText:{fontFamily:C,fontSize:9.5,color:"#64748B",fontWeight:"600"},toolToggleTextActive:{color:"#4F46E5",fontWeight:"700"},copyBtn:{width:24,height:24,borderRadius:5,backgroundColor:"#FFFFFF",borderWidth:1,borderColor:"#CBD5E1",alignItems:"center",justifyContent:"center"},copyBtnSuccess:{borderColor:"#10B981",backgroundColor:"#ECFDF5"},editorBody:{backgroundColor:"#FFFFFF",minHeight:100},prettyContainer:{padding:12,minWidth:"100%",backgroundColor:"#FFFFFF"},rawEditorRow:{flexDirection:"row",alignItems:"stretch",minHeight:100},gutter:{backgroundColor:"#F1F5F9",borderRightWidth:1,borderRightColor:"#E2E8F0",paddingVertical:10,paddingHorizontal:8,alignItems:"flex-end",userSelect:"none"},gutterNumber:{fontFamily:C,fontSize:11.5,height:18,lineHeight:18,color:"#94A3B8",textAlign:"right"},rawTextContainer:{paddingVertical:10,paddingHorizontal:12,backgroundColor:"#FFFFFF"},rawCodeLineRow:{flexDirection:"row",alignItems:"center",height:18},indentDots:{fontFamily:C,fontSize:11.5,lineHeight:18,color:"#CBD5E1",letterSpacing:.5},rawMonospaceText:{fontFamily:C,fontSize:11.5,lineHeight:18,color:"#0F172A"},truncationBanner:{margin:10,backgroundColor:"#EEF2FF",paddingVertical:8,paddingHorizontal:12,borderRadius:6,alignItems:"center",borderWidth:1,borderColor:"#C7D2FE"},truncationText:{fontFamily:C,fontSize:10.5,color:"#4F46E5",fontWeight:"600"},tableView:{flex:1},tableHeaderRow:{flexDirection:"row",backgroundColor:"#F1F5F9",borderBottomWidth:1,borderBottomColor:"#E2E8F0",paddingVertical:7,paddingHorizontal:12},tableHeaderCell:{fontFamily:C,fontSize:10,color:"#475569",fontWeight:"700",letterSpacing:.5},tableRow:{flexDirection:"row",borderBottomWidth:1,borderBottomColor:"#F1F5F9",paddingVertical:8,paddingHorizontal:12,alignItems:"flex-start",backgroundColor:"#FFFFFF"},tableRowAlt:{backgroundColor:"#F8FAFC"},tableColKey:{flex:2,paddingRight:8},tableColVal:{flex:3},tableCellKey:{fontFamily:C,fontSize:11.5,fontWeight:"700",color:"#4F46E5"},typePill:{alignSelf:"flex-start",borderRadius:4,borderWidth:1,paddingHorizontal:4,paddingVertical:1,marginTop:3},typePillText:{fontFamily:C,fontSize:9,fontWeight:"700"},tableCellValue:{fontFamily:C,fontSize:11.5,color:"#0F172A",lineHeight:17},tableCodeBox:{backgroundColor:"#F1F5F9",borderRadius:6,borderWidth:1,borderColor:"#E2E8F0",padding:6},showMoreBtn:{flexDirection:"row",alignItems:"center",gap:4,alignSelf:"flex-start",marginTop:4,paddingVertical:2,paddingHorizontal:4},showMoreText:{fontFamily:C,fontSize:10,color:"#4F46E5",fontWeight:"600"},emptyContainer:{padding:24,alignItems:"center",justifyContent:"center"},emptyText:{fontFamily:C,fontSize:11.5,color:"#64748B"},highlight:{backgroundColor:"#FEF08A",color:"#854D0E",fontFamily:C,fontWeight:"700",borderRadius:2,paddingHorizontal:2},syntaxNull:{color:"#E11D48",fontStyle:"italic"},syntaxNumber:{color:"#D97706"},syntaxBoolean:{color:"#DB2777"},syntaxString:{color:"#059669"}});export default Pe;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const LIB_VERSION = "2.3.
|
|
1
|
+
export declare const LIB_VERSION = "2.3.24";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const LIB_VERSION="2.3.
|
|
1
|
+
export const LIB_VERSION="2.3.24";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-inapp-inspector",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.24",
|
|
4
4
|
"description": "The zero-config, all-in-one in-app debugger for React Native & Expo. Inspect Network (fetch/axios), Console logs, Stack Traces, Redux State, Firebase Analytics, and JS Bundle size directly on device.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|