react-native-inapp-inspector 2.5.13 → 2.5.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -8
- package/android/src/main/java/com/inappinspector/NetworkInspectorModule.kt +118 -31
- package/dist/commonjs/components/Inspector/ConsoleExportModal.js +1 -1
- package/dist/commonjs/components/Inspector/ConsoleTab.js +7 -7
- package/dist/commonjs/components/Inspector/FabLauncher.js +3 -3
- package/dist/commonjs/components/Inspector/InspectorHeader.js +30 -30
- package/dist/commonjs/components/Inspector/MainScreen.js +38 -75
- package/dist/commonjs/components/Inspector/NetworkExportModal.js +4 -4
- package/dist/commonjs/components/Inspector/NetworkTab.js +51 -51
- package/dist/commonjs/components/Inspector/SecondaryTelemetryStrip.d.ts +1 -0
- package/dist/commonjs/components/Inspector/SecondaryTelemetryStrip.js +17 -16
- package/dist/commonjs/components/Inspector/SettingsPanel.js +40 -41
- package/dist/commonjs/components/Inspector/SkeletonPlaceholder.d.ts +3 -0
- package/dist/commonjs/components/Inspector/SkeletonPlaceholder.js +34 -3
- package/dist/commonjs/components/Inspector/TabBar.js +9 -15
- package/dist/commonjs/components/LogCard.js +7 -7
- package/dist/commonjs/components/SkeletonPlaceholder.d.ts +3 -0
- package/dist/commonjs/components/SkeletonPlaceholder.js +34 -3
- package/dist/commonjs/constants/telemetryConfig.d.ts +3 -3
- package/dist/commonjs/constants/telemetryConfig.js +1 -1
- package/dist/commonjs/constants/version.d.ts +1 -1
- package/dist/commonjs/constants/version.js +1 -1
- package/dist/commonjs/helpers/remoteConfig.js +1 -1
- package/dist/commonjs/helpers/shareFormatter.js +14 -14
- package/dist/commonjs/index.d.ts +1 -1
- package/dist/commonjs/index.js +3 -3
- package/dist/commonjs/native/NativeInspector.d.ts +2 -0
- package/dist/commonjs/native/NativeInspector.js +1 -1
- package/dist/commonjs/native/NativeNetworkInspector.d.ts +2 -0
- package/dist/commonjs/styles/AppFonts.d.ts +4 -0
- package/dist/commonjs/styles/AppFonts.js +1 -1
- package/dist/commonjs/styles/index.d.ts +2 -0
- package/dist/commonjs/styles/index.js +1 -1
- package/dist/commonjs/types/enums.d.ts +0 -2
- package/dist/commonjs/types/enums.js +1 -1
- package/dist/commonjs/types/interfaces.d.ts +1 -1
- package/dist/esm/components/Inspector/ConsoleExportModal.js +1 -1
- package/dist/esm/components/Inspector/ConsoleTab.js +48 -48
- package/dist/esm/components/Inspector/FabLauncher.js +42 -42
- package/dist/esm/components/Inspector/InspectorHeader.js +50 -50
- package/dist/esm/components/Inspector/MainScreen.js +87 -124
- package/dist/esm/components/Inspector/NetworkExportModal.js +1 -1
- package/dist/esm/components/Inspector/NetworkTab.js +83 -83
- package/dist/esm/components/Inspector/SecondaryTelemetryStrip.d.ts +1 -0
- package/dist/esm/components/Inspector/SecondaryTelemetryStrip.js +23 -22
- package/dist/esm/components/Inspector/SettingsPanel.js +106 -107
- package/dist/esm/components/Inspector/SkeletonPlaceholder.d.ts +3 -0
- package/dist/esm/components/Inspector/SkeletonPlaceholder.js +42 -11
- package/dist/esm/components/Inspector/TabBar.js +35 -41
- package/dist/esm/components/LogCard.js +53 -53
- package/dist/esm/components/SkeletonPlaceholder.d.ts +3 -0
- package/dist/esm/components/SkeletonPlaceholder.js +42 -11
- package/dist/esm/constants/telemetryConfig.d.ts +3 -3
- package/dist/esm/constants/telemetryConfig.js +1 -1
- package/dist/esm/constants/version.d.ts +1 -1
- package/dist/esm/constants/version.js +1 -1
- package/dist/esm/helpers/remoteConfig.js +1 -1
- package/dist/esm/helpers/shareFormatter.js +14 -14
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.js +8 -8
- package/dist/esm/native/NativeInspector.d.ts +2 -0
- package/dist/esm/native/NativeInspector.js +1 -1
- package/dist/esm/native/NativeNetworkInspector.d.ts +2 -0
- package/dist/esm/styles/AppFonts.d.ts +4 -0
- package/dist/esm/styles/AppFonts.js +1 -1
- package/dist/esm/styles/index.d.ts +2 -0
- package/dist/esm/styles/index.js +1 -1
- package/dist/esm/types/enums.d.ts +0 -2
- package/dist/esm/types/enums.js +1 -1
- package/dist/esm/types/interfaces.d.ts +1 -1
- package/ios/NetworkInspectorModule.mm +288 -325
- package/package.json +1 -1
- package/src/native/NativeInspector.ts +30 -0
- package/src/native/NativeNetworkInspector.ts +2 -0
- package/android/.gradle/8.9/checksums/checksums.lock +0 -0
- package/android/.gradle/8.9/dependencies-accessors/gc.properties +0 -0
- package/android/.gradle/8.9/executionHistory/executionHistory.lock +0 -0
- package/android/.gradle/8.9/fileChanges/last-build.bin +0 -0
- package/android/.gradle/8.9/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/8.9/gc.properties +0 -0
- package/android/.gradle/9.2.0/checksums/checksums.lock +0 -0
- package/android/.gradle/9.2.0/fileChanges/last-build.bin +0 -0
- package/android/.gradle/9.2.0/fileHashes/fileHashes.bin +0 -0
- package/android/.gradle/9.2.0/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/9.2.0/gc.properties +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +0 -2
- package/android/.gradle/vcs-1/gc.properties +0 -0
- package/android/.settings/org.eclipse.buildship.core.prefs +0 -13
- package/dist/commonjs/components/Inspector/BoxModelVisualizer.d.ts +0 -8
- package/dist/commonjs/components/Inspector/BoxModelVisualizer.js +0 -76
- package/dist/commonjs/components/Inspector/DebuggingTab.d.ts +0 -3
- package/dist/commonjs/components/Inspector/DebuggingTab.js +0 -197
- package/dist/commonjs/components/Inspector/UiA11yAuditPanel.d.ts +0 -7
- package/dist/commonjs/components/Inspector/UiA11yAuditPanel.js +0 -97
- package/dist/commonjs/components/Inspector/UiInspectorDetail.d.ts +0 -2
- package/dist/commonjs/components/Inspector/UiInspectorDetail.js +0 -485
- package/dist/commonjs/components/Inspector/UiInspectorOverlay.d.ts +0 -2
- package/dist/commonjs/components/Inspector/UiInspectorOverlay.js +0 -199
- package/dist/commonjs/components/Inspector/UiInspectorTab.d.ts +0 -2
- package/dist/commonjs/components/Inspector/UiInspectorTab.js +0 -117
- package/dist/commonjs/components/Inspector/UiLiveStyleTweaker.d.ts +0 -10
- package/dist/commonjs/components/Inspector/UiLiveStyleTweaker.js +0 -148
- package/dist/commonjs/components/Inspector/index.d.ts +0 -28
- package/dist/commonjs/components/Inspector/index.js +0 -1
- package/dist/commonjs/customHooks/uiInspectorManager.d.ts +0 -22
- package/dist/commonjs/customHooks/uiInspectorManager.js +0 -1
- package/dist/commonjs/helpers/uiInspectorEngine.d.ts +0 -62
- package/dist/commonjs/helpers/uiInspectorEngine.js +0 -19
- package/dist/esm/components/Inspector/BoxModelVisualizer.d.ts +0 -8
- package/dist/esm/components/Inspector/BoxModelVisualizer.js +0 -76
- package/dist/esm/components/Inspector/DebuggingTab.d.ts +0 -3
- package/dist/esm/components/Inspector/DebuggingTab.js +0 -197
- package/dist/esm/components/Inspector/UiA11yAuditPanel.d.ts +0 -7
- package/dist/esm/components/Inspector/UiA11yAuditPanel.js +0 -97
- package/dist/esm/components/Inspector/UiInspectorDetail.d.ts +0 -2
- package/dist/esm/components/Inspector/UiInspectorDetail.js +0 -422
- package/dist/esm/components/Inspector/UiInspectorOverlay.d.ts +0 -2
- package/dist/esm/components/Inspector/UiInspectorOverlay.js +0 -138
- package/dist/esm/components/Inspector/UiInspectorTab.d.ts +0 -2
- package/dist/esm/components/Inspector/UiInspectorTab.js +0 -117
- package/dist/esm/components/Inspector/UiLiveStyleTweaker.d.ts +0 -10
- package/dist/esm/components/Inspector/UiLiveStyleTweaker.js +0 -148
- package/dist/esm/components/Inspector/index.d.ts +0 -28
- package/dist/esm/components/Inspector/index.js +0 -1
- package/dist/esm/customHooks/uiInspectorManager.d.ts +0 -22
- package/dist/esm/customHooks/uiInspectorManager.js +0 -1
- package/dist/esm/helpers/uiInspectorEngine.d.ts +0 -48
- package/dist/esm/helpers/uiInspectorEngine.js +0 -19
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
import"react";import{ScrollView as G,StyleSheet as A,Text as C,TouchableOpacity as B,View as T}from"react-native";import{useInspector as v}from"./InspectorContext";import{ChevronIcon as M,EmptyRadarIcon as N,InspectPointerIcon as O,LayersIcon as U,RulerIcon as J,SlidersIcon as X,TrashIcon as Y}from"../NetworkIcons";import P from"../TouchableScale";import{AppColors as t}from"../../styles/AppColors";import{AppFonts as f}from"../../styles/AppFonts";import{triggerNativeHaptic as w}from"../../native/NativeInspector";import{showToast as W}from"../../helpers/toast";import{BoxModelVisualizer as K}from"./BoxModelVisualizer";export const UiInspectorTab=()=>{const{selectedUiElement:S,setSelectedUiElement:D,setIsInspectModeActive:E,setVisible:H,showAlignmentGrid:I,setShowAlignmentGrid:L,uiInspectorHistory:F,clearUiInspectorHistory:V}=v(),z=()=>{w(),H(!1),E(!0),W("Touch anywhere to inspect JSX components")};return<G showsVerticalScrollIndicator={!1}contentContainerStyle={e.container}>
|
|
2
|
-
|
|
3
|
-
<T style={e.heroCard}>
|
|
4
|
-
<T style={e.heroLeft}>
|
|
5
|
-
<T style={e.heroIconBadge}>
|
|
6
|
-
<O color={t.white}size={22}/>
|
|
7
|
-
</T>
|
|
8
|
-
<T style={e.heroTextGroup}>
|
|
9
|
-
<C style={e.heroTitle}>Inspect Elements On Screen</C>
|
|
10
|
-
<C style={e.heroSubtitle}>
|
|
11
|
-
Tap, drag, and highlight rendered JSX components to inspect styles, props & box model in real-time.
|
|
12
|
-
</C>
|
|
13
|
-
</T>
|
|
14
|
-
</T>
|
|
15
|
-
|
|
16
|
-
<P style={e.heroButton}onPress={z}>
|
|
17
|
-
<U color={t.brandPurple}size={16}/>
|
|
18
|
-
<C style={e.heroButtonText}>Start Inspect Mode</C>
|
|
19
|
-
</P>
|
|
20
|
-
</T>
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
{S?<T style={e.selectedCard}>
|
|
24
|
-
<T style={e.selectedHeader}>
|
|
25
|
-
<T style={e.selectedTitleGroup}>
|
|
26
|
-
<T style={e.tagBadge}>
|
|
27
|
-
<C style={e.tagBadgeText}><{S.componentName}></C>
|
|
28
|
-
</T>
|
|
29
|
-
<C style={e.dimensionsBadge}>
|
|
30
|
-
{Math.round(S.layout.width)} × {Math.round(S.layout.height)} pt
|
|
31
|
-
</C>
|
|
32
|
-
</T>
|
|
33
|
-
|
|
34
|
-
<T style={e.a11yScoreBadge}>
|
|
35
|
-
<C style={[e.a11yScoreText,S.a11y.hasValidTouchTarget?e.a11yScoreTextPass:e.a11yScoreTextWarn]}>
|
|
36
|
-
{S.a11y.hasValidTouchTarget?"A11y Pass":"A11y Warning"}
|
|
37
|
-
</C>
|
|
38
|
-
</T>
|
|
39
|
-
</T>
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
<K boxModel={S.boxModel}compact/>
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
<T style={e.metricsBar}>
|
|
46
|
-
<T style={e.metricChip}>
|
|
47
|
-
<C style={e.metricChipLabel}>Props:</C>
|
|
48
|
-
<C style={e.metricChipValue}>
|
|
49
|
-
{Object.keys(S.props).length}
|
|
50
|
-
</C>
|
|
51
|
-
</T>
|
|
52
|
-
<T style={e.metricChip}>
|
|
53
|
-
<C style={e.metricChipLabel}>Styles:</C>
|
|
54
|
-
<C style={e.metricChipValue}>
|
|
55
|
-
{Object.keys(S.flattenedStyles).length}
|
|
56
|
-
</C>
|
|
57
|
-
</T>
|
|
58
|
-
<T style={e.metricChip}>
|
|
59
|
-
<C style={e.metricChipLabel}>Depth:</C>
|
|
60
|
-
<C style={e.metricChipValue}>
|
|
61
|
-
{S.hierarchy.length} levels
|
|
62
|
-
</C>
|
|
63
|
-
</T>
|
|
64
|
-
</T>
|
|
65
|
-
</T>:<T style={e.emptyCard}>
|
|
66
|
-
<N color={t.grayTextWeak}size={32}/>
|
|
67
|
-
<C style={e.emptyCardTitle}>No Element Selected</C>
|
|
68
|
-
<C style={e.emptyCardSubtitle}>
|
|
69
|
-
Launch Inspect Mode to select an on-screen JSX component.
|
|
70
|
-
</C>
|
|
71
|
-
</T>}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
<T style={e.toolsSection}>
|
|
75
|
-
<C style={e.sectionHeader}>DESIGN & ALIGNMENT TOOLS</C>
|
|
76
|
-
<T style={e.toolsGrid}>
|
|
77
|
-
<B style={[e.toolCard,I&&e.toolCardActive]}onPress={()=>{w(),L(!I)}}>
|
|
78
|
-
<J color={I?t.brandPurple:t.slate600}size={18}/>
|
|
79
|
-
<C style={[e.toolCardTitle,I&&e.toolCardTitleActive]}>
|
|
80
|
-
8pt Grid Guide
|
|
81
|
-
</C>
|
|
82
|
-
<C style={e.toolCardSub}>
|
|
83
|
-
{I?"Enabled":"Disabled"}
|
|
84
|
-
</C>
|
|
85
|
-
</B>
|
|
86
|
-
|
|
87
|
-
<B style={e.toolCard}onPress={z}>
|
|
88
|
-
<X color={t.brandPurple}size={18}/>
|
|
89
|
-
<C style={e.toolCardTitle}>Live Tweaker</C>
|
|
90
|
-
<C style={e.toolCardSub}>Sandbox Styles</C>
|
|
91
|
-
</B>
|
|
92
|
-
</T>
|
|
93
|
-
</T>
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
{F.length>0&&<T style={e.historySection}>
|
|
97
|
-
<T style={e.historyHeader}>
|
|
98
|
-
<C style={e.sectionHeader}>RECENTLY INSPECTED ({F.length})</C>
|
|
99
|
-
<P style={e.clearHistoryBtn}onPress={()=>{w(),V(),W("Cleared inspection history")}}>
|
|
100
|
-
<Y color={t.grayTextWeak}size={12}/>
|
|
101
|
-
<C style={e.clearHistoryBtnText}>Clear</C>
|
|
102
|
-
</P>
|
|
103
|
-
</T>
|
|
104
|
-
|
|
105
|
-
<T style={e.historyList}>
|
|
106
|
-
{F.map((x,R)=><B key={x.id||R}style={e.historyItem}onPress={()=>{w(),D(x)}}>
|
|
107
|
-
<T style={e.historyItemLeft}>
|
|
108
|
-
<C style={e.historyItemTag}><{x.componentName}></C>
|
|
109
|
-
<C style={e.historyItemDim}>
|
|
110
|
-
{Math.round(x.layout.width)} × {Math.round(x.layout.height)} pt
|
|
111
|
-
</C>
|
|
112
|
-
</T>
|
|
113
|
-
<M color={t.grayTextWeak}size={12}direction="right"/>
|
|
114
|
-
</B>)}
|
|
115
|
-
</T>
|
|
116
|
-
</T>}
|
|
117
|
-
</G>};const e=A.create({container:{padding:12,gap:12},heroCard:{backgroundColor:t.brandPurple,borderRadius:14,padding:16,gap:14,shadowColor:t.brandPurple,shadowOffset:{width:0,height:4},shadowOpacity:.25,shadowRadius:8,elevation:4},heroLeft:{flexDirection:"row",gap:12,alignItems:"flex-start"},heroIconBadge:{width:40,height:40,borderRadius:10,backgroundColor:"#FFFFFF22",alignItems:"center",justifyContent:"center"},heroTextGroup:{flex:1},heroTitle:{fontSize:16,fontFamily:f.bold,color:t.white,marginBottom:4},heroSubtitle:{fontSize:12,fontFamily:f.medium,color:"#EEF2FF",lineHeight:17},heroButton:{flexDirection:"row",alignItems:"center",justifyContent:"center",backgroundColor:t.white,paddingVertical:10,borderRadius:10,gap:8},heroButtonText:{fontSize:13,fontFamily:f.bold,color:t.brandPurple},selectedCard:{backgroundColor:t.white,borderRadius:12,padding:14,borderWidth:1,borderColor:t.grayBorderSecondary,gap:10},selectedHeader:{flexDirection:"row",justifyContent:"space-between",alignItems:"center"},selectedTitleGroup:{flexDirection:"row",alignItems:"center",gap:8},tagBadge:{backgroundColor:"#4F46E518",paddingHorizontal:8,paddingVertical:4,borderRadius:6,borderWidth:1,borderColor:"#4F46E533"},tagBadgeText:{fontSize:13,fontFamily:f.bold,color:t.brandPurple},dimensionsBadge:{fontSize:12,fontFamily:f.medium,color:t.grayTextWeak},a11yScoreBadge:{paddingHorizontal:8,paddingVertical:3,borderRadius:5,backgroundColor:t.slate100},a11yScoreText:{fontSize:10,fontFamily:f.bold},a11yScoreTextPass:{color:"#059669"},a11yScoreTextWarn:{color:"#D97706"},metricsBar:{flexDirection:"row",backgroundColor:t.slate50,borderRadius:8,padding:8,justifyContent:"space-around"},metricChip:{flexDirection:"row",gap:4,alignItems:"center"},metricChipLabel:{fontSize:11,fontFamily:f.medium,color:t.grayTextWeak},metricChipValue:{fontSize:11,fontFamily:f.bold,color:t.slate900},emptyCard:{backgroundColor:t.white,borderRadius:12,padding:24,alignItems:"center",justifyContent:"center",borderWidth:1,borderColor:t.grayBorderSecondary,borderStyle:"dashed",gap:6},emptyCardTitle:{fontSize:14,fontFamily:f.semiBold,color:t.slate700,marginTop:4},emptyCardSubtitle:{fontSize:12,fontFamily:f.medium,color:t.grayTextWeak,textAlign:"center"},sectionHeader:{fontSize:10,fontFamily:f.bold,color:t.grayTextWeak,letterSpacing:.8},toolsSection:{gap:8},toolsGrid:{flexDirection:"row",gap:10},toolCard:{flex:1,backgroundColor:t.white,borderRadius:10,padding:12,borderWidth:1,borderColor:t.grayBorderSecondary,gap:4},toolCardActive:{borderColor:t.brandPurple,backgroundColor:"#EEF2FF"},toolCardTitle:{fontSize:12,fontFamily:f.semiBold,color:t.slate900,marginTop:4},toolCardTitleActive:{color:t.brandPurple},toolCardSub:{fontSize:10,fontFamily:f.medium,color:t.grayTextWeak},historySection:{gap:8,marginTop:4},historyHeader:{flexDirection:"row",justifyContent:"space-between",alignItems:"center"},clearHistoryBtn:{flexDirection:"row",alignItems:"center",gap:4},clearHistoryBtnText:{fontSize:10,fontFamily:f.medium,color:t.grayTextWeak},historyList:{backgroundColor:t.white,borderRadius:10,borderWidth:1,borderColor:t.grayBorderSecondary,overflow:"hidden"},historyItem:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",paddingHorizontal:12,paddingVertical:10,borderBottomWidth:1,borderBottomColor:t.slate100},historyItemLeft:{flexDirection:"row",alignItems:"center",gap:8},historyItemTag:{fontSize:12,fontFamily:f.bold,color:t.brandPurple},historyItemDim:{fontSize:11,fontFamily:f.medium,color:t.grayTextWeak}});
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
interface UiLiveStyleTweakerProps {
|
|
3
|
-
componentName: string;
|
|
4
|
-
originalStyles: Record<string, any>;
|
|
5
|
-
tweakedStyles: Record<string, any>;
|
|
6
|
-
onApplyStyle: (key: string, value: any) => void;
|
|
7
|
-
onResetStyles: () => void;
|
|
8
|
-
}
|
|
9
|
-
export declare const UiLiveStyleTweaker: React.FC<UiLiveStyleTweakerProps>;
|
|
10
|
-
export {};
|
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
import"react";import{ScrollView as G,StyleSheet as M,Text as B,TouchableOpacity as R,View as T}from"react-native";import{AppColors as w}from"../../styles/AppColors";import{AppFonts as S}from"../../styles/AppFonts";import{RotateCcwIcon as O,SlidersIcon as N,CopyIcon as U}from"../NetworkIcons";import W from"../TouchableScale";import{generateStyleSheetSnippet as q}from"../../helpers/uiInspectorEngine";import{triggerNativeHaptic as C}from"../../native/NativeInspector";import{showToast as P}from"../../helpers/toast";import J from"@react-native-clipboard/clipboard";const K=["#4F46E5","#7C3AED","#2563EB","#0D9488","#10B981","#F59E0B","#E11D48","#0F172A","#F8FAFC","#FFFFFF","transparent"];export const UiLiveStyleTweaker=({componentName:k,originalStyles:z,tweakedStyles:D,onApplyStyle:F,onResetStyles:A})=>{const f={...z,...D},I=Object.keys(D).length>0,V=()=>{const x=q(k,f);J.setString(x),C(),P("Copied tweaked StyleSheet to clipboard")},h=(x,E,v=0)=>{const H=typeof f[x]=="number"?f[x]:0,L=Math.max(v,H+E);F(x,L),C()};return<G showsVerticalScrollIndicator={!1}contentContainerStyle={e.container}>
|
|
2
|
-
|
|
3
|
-
<T style={e.topActionsRow}>
|
|
4
|
-
<T style={e.titleWithBadge}>
|
|
5
|
-
<N color={w.brandPurple}size={18}/>
|
|
6
|
-
<B style={e.sectionTitle}>Live Style Sandbox</B>
|
|
7
|
-
{I&&<T style={e.modifiedBadge}>
|
|
8
|
-
<B style={e.modifiedBadgeText}>MODIFIED</B>
|
|
9
|
-
</T>}
|
|
10
|
-
</T>
|
|
11
|
-
|
|
12
|
-
<T style={e.actionButtonsGroup}>
|
|
13
|
-
{I&&<W style={e.resetButton}onPress={()=>{A(),C(),P("Reset styles to original")}}>
|
|
14
|
-
<O color="#E11D48"size={14}/>
|
|
15
|
-
<B style={e.resetButtonText}>Reset</B>
|
|
16
|
-
</W>}
|
|
17
|
-
|
|
18
|
-
<W style={e.exportButton}onPress={V}>
|
|
19
|
-
<U color={w.white}size={14}/>
|
|
20
|
-
<B style={e.exportButtonText}>Copy CSS</B>
|
|
21
|
-
</W>
|
|
22
|
-
</T>
|
|
23
|
-
</T>
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
<T style={e.card}>
|
|
27
|
-
<B style={e.cardHeader}>Padding & Margin</B>
|
|
28
|
-
|
|
29
|
-
<T style={e.controlRow}>
|
|
30
|
-
<B style={e.controlLabel}>Padding</B>
|
|
31
|
-
<T style={e.stepperContainer}>
|
|
32
|
-
<R style={e.stepperBtn}onPress={()=>h("padding",-2)}>
|
|
33
|
-
<B style={e.stepperBtnText}>-</B>
|
|
34
|
-
</R>
|
|
35
|
-
<B style={e.stepperValue}>{f.padding??0} pt</B>
|
|
36
|
-
<R style={e.stepperBtn}onPress={()=>h("padding",2)}>
|
|
37
|
-
<B style={e.stepperBtnText}>+</B>
|
|
38
|
-
</R>
|
|
39
|
-
</T>
|
|
40
|
-
</T>
|
|
41
|
-
|
|
42
|
-
<T style={e.controlRow}>
|
|
43
|
-
<B style={e.controlLabel}>Margin</B>
|
|
44
|
-
<T style={e.stepperContainer}>
|
|
45
|
-
<R style={e.stepperBtn}onPress={()=>h("margin",-2)}>
|
|
46
|
-
<B style={e.stepperBtnText}>-</B>
|
|
47
|
-
</R>
|
|
48
|
-
<B style={e.stepperValue}>{f.margin??0} pt</B>
|
|
49
|
-
<R style={e.stepperBtn}onPress={()=>h("margin",2)}>
|
|
50
|
-
<B style={e.stepperBtnText}>+</B>
|
|
51
|
-
</R>
|
|
52
|
-
</T>
|
|
53
|
-
</T>
|
|
54
|
-
|
|
55
|
-
<T style={e.controlRow}>
|
|
56
|
-
<B style={e.controlLabel}>Gap</B>
|
|
57
|
-
<T style={e.stepperContainer}>
|
|
58
|
-
<R style={e.stepperBtn}onPress={()=>h("gap",-2)}>
|
|
59
|
-
<B style={e.stepperBtnText}>-</B>
|
|
60
|
-
</R>
|
|
61
|
-
<B style={e.stepperValue}>{f.gap??0} pt</B>
|
|
62
|
-
<R style={e.stepperBtn}onPress={()=>h("gap",2)}>
|
|
63
|
-
<B style={e.stepperBtnText}>+</B>
|
|
64
|
-
</R>
|
|
65
|
-
</T>
|
|
66
|
-
</T>
|
|
67
|
-
</T>
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
<T style={e.card}>
|
|
71
|
-
<B style={e.cardHeader}>Borders & Corners</B>
|
|
72
|
-
|
|
73
|
-
<T style={e.controlRow}>
|
|
74
|
-
<B style={e.controlLabel}>Border Radius</B>
|
|
75
|
-
<T style={e.stepperContainer}>
|
|
76
|
-
<R style={e.stepperBtn}onPress={()=>h("borderRadius",-2)}>
|
|
77
|
-
<B style={e.stepperBtnText}>-</B>
|
|
78
|
-
</R>
|
|
79
|
-
<B style={e.stepperValue}>{f.borderRadius??0} pt</B>
|
|
80
|
-
<R style={e.stepperBtn}onPress={()=>h("borderRadius",2)}>
|
|
81
|
-
<B style={e.stepperBtnText}>+</B>
|
|
82
|
-
</R>
|
|
83
|
-
</T>
|
|
84
|
-
</T>
|
|
85
|
-
|
|
86
|
-
<T style={e.controlRow}>
|
|
87
|
-
<B style={e.controlLabel}>Border Width</B>
|
|
88
|
-
<T style={e.stepperContainer}>
|
|
89
|
-
<R style={e.stepperBtn}onPress={()=>h("borderWidth",-1)}>
|
|
90
|
-
<B style={e.stepperBtnText}>-</B>
|
|
91
|
-
</R>
|
|
92
|
-
<B style={e.stepperValue}>{f.borderWidth??0} pt</B>
|
|
93
|
-
<R style={e.stepperBtn}onPress={()=>h("borderWidth",1)}>
|
|
94
|
-
<B style={e.stepperBtnText}>+</B>
|
|
95
|
-
</R>
|
|
96
|
-
</T>
|
|
97
|
-
</T>
|
|
98
|
-
</T>
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
<T style={e.card}>
|
|
102
|
-
<B style={e.cardHeader}>Typography</B>
|
|
103
|
-
|
|
104
|
-
<T style={e.controlRow}>
|
|
105
|
-
<B style={e.controlLabel}>Font Size</B>
|
|
106
|
-
<T style={e.stepperContainer}>
|
|
107
|
-
<R style={e.stepperBtn}onPress={()=>h("fontSize",-1,8)}>
|
|
108
|
-
<B style={e.stepperBtnText}>-</B>
|
|
109
|
-
</R>
|
|
110
|
-
<B style={e.stepperValue}>{f.fontSize??14} pt</B>
|
|
111
|
-
<R style={e.stepperBtn}onPress={()=>h("fontSize",1)}>
|
|
112
|
-
<B style={e.stepperBtnText}>+</B>
|
|
113
|
-
</R>
|
|
114
|
-
</T>
|
|
115
|
-
</T>
|
|
116
|
-
|
|
117
|
-
<T style={e.segmentedRow}>
|
|
118
|
-
<B style={e.controlLabel}>Weight</B>
|
|
119
|
-
<T style={e.segmentedGroup}>
|
|
120
|
-
{["normal","500","600","bold"].map(x=><R key={x}style={[e.segmentItem,f.fontWeight===x&&e.segmentItemActive]}onPress={()=>{F("fontWeight",x),C()}}>
|
|
121
|
-
<B style={[e.segmentText,f.fontWeight===x&&e.segmentTextActive]}>
|
|
122
|
-
{x}
|
|
123
|
-
</B>
|
|
124
|
-
</R>)}
|
|
125
|
-
</T>
|
|
126
|
-
</T>
|
|
127
|
-
</T>
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
<T style={e.card}>
|
|
131
|
-
<B style={e.cardHeader}>Background Color</B>
|
|
132
|
-
<T style={e.paletteGrid}>
|
|
133
|
-
{K.map(x=><R key={x}style={[e.colorSwatch,{backgroundColor:x},f.backgroundColor===x&&e.colorSwatchActive]}onPress={()=>{F("backgroundColor",x),C()}}/>)}
|
|
134
|
-
</T>
|
|
135
|
-
</T>
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
<T style={e.card}>
|
|
139
|
-
<B style={e.cardHeader}>Opacity & Elevation</B>
|
|
140
|
-
<T style={e.segmentedGroup}>
|
|
141
|
-
{[1,.8,.6,.4,.2].map(x=><R key={x}style={[e.segmentItem,f.opacity===x&&e.segmentItemActive]}onPress={()=>{F("opacity",x),C()}}>
|
|
142
|
-
<B style={[e.segmentText,f.opacity===x&&e.segmentTextActive]}>
|
|
143
|
-
{Math.round(x*100)}%
|
|
144
|
-
</B>
|
|
145
|
-
</R>)}
|
|
146
|
-
</T>
|
|
147
|
-
</T>
|
|
148
|
-
</G>};const e=M.create({container:{paddingVertical:6,gap:10},topActionsRow:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",marginBottom:4},titleWithBadge:{flexDirection:"row",alignItems:"center",gap:6},sectionTitle:{fontSize:14,fontFamily:S.semiBold,color:w.slate900},modifiedBadge:{backgroundColor:"#F59E0B22",paddingHorizontal:6,paddingVertical:2,borderRadius:4,borderWidth:1,borderColor:"#F59E0B55"},modifiedBadgeText:{fontSize:9,fontFamily:S.bold,color:"#D97706"},actionButtonsGroup:{flexDirection:"row",gap:8},resetButton:{flexDirection:"row",alignItems:"center",gap:4,backgroundColor:"#E11D4811",borderWidth:1,borderColor:"#E11D4833",paddingHorizontal:8,paddingVertical:5,borderRadius:6},resetButtonText:{fontSize:11,fontFamily:S.semiBold,color:"#E11D48"},exportButton:{flexDirection:"row",alignItems:"center",gap:4,backgroundColor:w.brandPurple,paddingHorizontal:10,paddingVertical:5,borderRadius:6},exportButtonText:{fontSize:11,fontFamily:S.semiBold,color:w.white},card:{backgroundColor:w.white,borderRadius:12,padding:12,borderWidth:1,borderColor:w.grayBorderSecondary,gap:8},cardHeader:{fontSize:12,fontFamily:S.semiBold,color:w.slate700,marginBottom:2},controlRow:{flexDirection:"row",justifyContent:"space-between",alignItems:"center"},controlLabel:{fontSize:12,fontFamily:S.medium,color:w.slate600},stepperContainer:{flexDirection:"row",alignItems:"center",gap:8,backgroundColor:w.slate50,borderRadius:6,padding:2},stepperBtn:{width:28,height:28,backgroundColor:w.white,borderRadius:5,alignItems:"center",justifyContent:"center",borderWidth:1,borderColor:w.grayBorderSecondary},stepperBtnText:{fontSize:15,fontFamily:S.bold,color:w.slate900},stepperValue:{fontSize:12,fontFamily:S.semiBold,color:w.slate900,minWidth:44,textAlign:"center"},segmentedRow:{flexDirection:"row",justifyContent:"space-between",alignItems:"center"},segmentedGroup:{flexDirection:"row",backgroundColor:w.slate100,borderRadius:8,padding:2,gap:2},segmentItem:{paddingHorizontal:10,paddingVertical:5,borderRadius:6},segmentItemActive:{backgroundColor:w.brandPurple},segmentText:{fontSize:11,fontFamily:S.medium,color:w.slate600},segmentTextActive:{color:w.white,fontFamily:S.semiBold},paletteGrid:{flexDirection:"row",flexWrap:"wrap",gap:8},colorSwatch:{width:28,height:28,borderRadius:6,borderWidth:1,borderColor:w.grayBorderSecondary},colorSwatchActive:{borderColor:w.brandPurple,borderWidth:3}});
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
export { default as MainScreen } from './MainScreen';
|
|
2
|
-
export { default as TabBar } from './TabBar';
|
|
3
|
-
export { default as InspectorHeader } from './InspectorHeader';
|
|
4
|
-
export { default as FabLauncher } from './FabLauncher';
|
|
5
|
-
export { default as NetworkTab } from './NetworkTab';
|
|
6
|
-
export { default as NetworkDetail } from './NetworkDetail';
|
|
7
|
-
export { default as ConsoleTab } from './ConsoleTab';
|
|
8
|
-
export { default as LogDetail } from './LogDetail';
|
|
9
|
-
export { PerformanceTab } from './PerformanceTab';
|
|
10
|
-
export { default as AnalyticsTab } from './AnalyticsTab';
|
|
11
|
-
export { default as ReduxTab } from './ReduxTab';
|
|
12
|
-
export { default as ReduxDetail } from './ReduxDetail';
|
|
13
|
-
export { default as CrashTab } from './CrashTab';
|
|
14
|
-
export { default as CrashDetail } from './CrashDetail';
|
|
15
|
-
export { default as PushTab } from './PushTab';
|
|
16
|
-
export { default as PushDetail } from './PushDetail';
|
|
17
|
-
export { default as SocketTab } from './SocketTab';
|
|
18
|
-
export { default as SocketDetail } from './SocketDetail';
|
|
19
|
-
export { default as DeviceInfoTab } from './DeviceInfoTab';
|
|
20
|
-
export { default as StorageTab } from './StorageTab';
|
|
21
|
-
export { default as DebuggingTab } from './DebuggingTab';
|
|
22
|
-
export { MediaGalleryTab } from './MediaGalleryTab';
|
|
23
|
-
export { default as SettingsPanel } from './SettingsPanel';
|
|
24
|
-
export { UiInspectorTab } from './UiInspectorTab';
|
|
25
|
-
export { UiInspectorDetail } from './UiInspectorDetail';
|
|
26
|
-
export { UiInspectorOverlay } from './UiInspectorOverlay';
|
|
27
|
-
export { BoxModelVisualizer } from './BoxModelVisualizer';
|
|
28
|
-
export { UiA11yAuditPanel } from './UiA11yAuditPanel';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{default as MainScreen}from"./MainScreen";export{default as TabBar}from"./TabBar";export{default as InspectorHeader}from"./InspectorHeader";export{default as FabLauncher}from"./FabLauncher";export{default as NetworkTab}from"./NetworkTab";export{default as NetworkDetail}from"./NetworkDetail";export{default as ConsoleTab}from"./ConsoleTab";export{default as LogDetail}from"./LogDetail";export{PerformanceTab}from"./PerformanceTab";export{default as AnalyticsTab}from"./AnalyticsTab";export{default as ReduxTab}from"./ReduxTab";export{default as ReduxDetail}from"./ReduxDetail";export{default as CrashTab}from"./CrashTab";export{default as CrashDetail}from"./CrashDetail";export{default as PushTab}from"./PushTab";export{default as PushDetail}from"./PushDetail";export{default as SocketTab}from"./SocketTab";export{default as SocketDetail}from"./SocketDetail";export{default as DeviceInfoTab}from"./DeviceInfoTab";export{default as StorageTab}from"./StorageTab";export{default as DebuggingTab}from"./DebuggingTab";export{MediaGalleryTab}from"./MediaGalleryTab";export{default as SettingsPanel}from"./SettingsPanel";export{UiInspectorTab}from"./UiInspectorTab";export{UiInspectorDetail}from"./UiInspectorDetail";export{UiInspectorOverlay}from"./UiInspectorOverlay";export{BoxModelVisualizer}from"./BoxModelVisualizer";export{UiA11yAuditPanel}from"./UiA11yAuditPanel";
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { InspectedElementInfo, UiInspectorSubTab } from '../types';
|
|
2
|
-
type UiInspectorListener = (state: UiInspectorState) => void;
|
|
3
|
-
export interface UiInspectorState {
|
|
4
|
-
isInspectModeActive: boolean;
|
|
5
|
-
selectedElement: InspectedElementInfo | null;
|
|
6
|
-
activeSubTab: UiInspectorSubTab;
|
|
7
|
-
showAlignmentGrid: boolean;
|
|
8
|
-
showDistanceGuides: boolean;
|
|
9
|
-
history: InspectedElementInfo[];
|
|
10
|
-
tweakedStyles: Record<string, any>;
|
|
11
|
-
}
|
|
12
|
-
export declare function subscribeUiInspectorState(listener: UiInspectorListener): () => void;
|
|
13
|
-
export declare function getUiInspectorState(): UiInspectorState;
|
|
14
|
-
export declare function setInspectModeActive(active: boolean): void;
|
|
15
|
-
export declare function setSelectedUiElement(element: InspectedElementInfo | null): void;
|
|
16
|
-
export declare function setUiInspectorSubTab(subTab: UiInspectorSubTab): void;
|
|
17
|
-
export declare function toggleAlignmentGrid(show?: boolean): void;
|
|
18
|
-
export declare function toggleDistanceGuides(show?: boolean): void;
|
|
19
|
-
export declare function applyLiveStyleOverride(key: string, value: any): void;
|
|
20
|
-
export declare function resetLiveStyleOverrides(): void;
|
|
21
|
-
export declare function clearUiInspectorHistory(): void;
|
|
22
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
let e={isInspectModeActive:!1,selectedElement:null,activeSubTab:"styles",showAlignmentGrid:!1,showDistanceGuides:!0,history:[],tweakedStyles:{}};const i=new Set;function s(){const t={...e,history:[...e.history],tweakedStyles:{...e.tweakedStyles}};i.forEach(n=>{try{n(t)}catch(o){console.warn("[UIInspector] Listener notification error:",o)}})}export function subscribeUiInspectorState(t){return i.add(t),t(e),()=>{i.delete(t)}}export function getUiInspectorState(){return e}export function setInspectModeActive(t){e.isInspectModeActive=t,s()}export function setSelectedUiElement(t){e.selectedElement=t,t?(e.tweakedStyles={...t.tweakedStyles},e.history.some(n=>n.id===t.id)||(e.history=[t,...e.history.slice(0,19)])):e.tweakedStyles={},s()}export function setUiInspectorSubTab(t){e.activeSubTab=t,s()}export function toggleAlignmentGrid(t){e.showAlignmentGrid=typeof t=="boolean"?t:!e.showAlignmentGrid,s()}export function toggleDistanceGuides(t){e.showDistanceGuides=typeof t=="boolean"?t:!e.showDistanceGuides,s()}export function applyLiveStyleOverride(t,n){e.tweakedStyles={...e.tweakedStyles,[t]:n},e.selectedElement&&(e.selectedElement={...e.selectedElement,tweakedStyles:{...e.tweakedStyles},flattenedStyles:{...e.selectedElement.originalStyles,...e.tweakedStyles}}),s()}export function resetLiveStyleOverrides(){e.tweakedStyles={},e.selectedElement&&(e.selectedElement={...e.selectedElement,tweakedStyles:{},flattenedStyles:{...e.selectedElement.originalStyles}}),s()}export function clearUiInspectorHistory(){e.history=[],s()}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { A11yAuditResult, BoxModelMetrics, HierarchyBreadcrumbItem, InspectedElementInfo } from '../types';
|
|
2
|
-
export declare function getCleanComponentName(type: any): string;
|
|
3
|
-
export declare function buildHierarchyFromFiber(fiber: any): HierarchyBreadcrumbItem[];
|
|
4
|
-
export declare function getDynamicInspectorDataForPoint(locationX: number, locationY: number, inspectedViewRef?: any): Promise<InspectedElementInfo | null>;
|
|
5
|
-
export declare function extractBoxModel(flattenedStyle?: Record<string, any>, layout?: {
|
|
6
|
-
width: number;
|
|
7
|
-
height: number;
|
|
8
|
-
}): BoxModelMetrics;
|
|
9
|
-
export declare function categorizeStyles(flattened?: Record<string, any>): {
|
|
10
|
-
layout: Record<string, any>;
|
|
11
|
-
dimensions: Record<string, any>;
|
|
12
|
-
position: Record<string, any>;
|
|
13
|
-
spacing: Record<string, any>;
|
|
14
|
-
typography: Record<string, any>;
|
|
15
|
-
appearance: Record<string, any>;
|
|
16
|
-
borders: Record<string, any>;
|
|
17
|
-
transforms: Record<string, any>;
|
|
18
|
-
other: Record<string, any>;
|
|
19
|
-
};
|
|
20
|
-
export declare function calculateContrastRatio(textColor?: string, bgColor?: string): {
|
|
21
|
-
ratio: any;
|
|
22
|
-
score: "N/A";
|
|
23
|
-
} | {
|
|
24
|
-
ratio: number;
|
|
25
|
-
score: "AAA" | "AA" | "Fail";
|
|
26
|
-
};
|
|
27
|
-
export declare function auditAccessibility(props?: Record<string, any>, layout?: {
|
|
28
|
-
width: number;
|
|
29
|
-
height: number;
|
|
30
|
-
}, styles?: Record<string, any>): A11yAuditResult;
|
|
31
|
-
export declare function generateJsxSnippet(componentName: string, props?: Record<string, any>, styles?: Record<string, any>): string;
|
|
32
|
-
export declare function generateFullJsxSegmentSnippet(componentName: string, props?: Record<string, any>, styles?: Record<string, any>): {
|
|
33
|
-
code: string;
|
|
34
|
-
sourceFile?: string;
|
|
35
|
-
sourceLocation?: string;
|
|
36
|
-
lineNumber?: number;
|
|
37
|
-
columnNumber?: number;
|
|
38
|
-
};
|
|
39
|
-
export declare function generateStyleSheetSnippet(componentName: string, styles?: Record<string, any>): string;
|
|
40
|
-
export declare function generateCssSnippet(componentName: string, styles?: Record<string, any>): string;
|
|
41
|
-
export declare function createInspectedElement(componentName: string, props: Record<string, any>, layout: {
|
|
42
|
-
x: number;
|
|
43
|
-
y: number;
|
|
44
|
-
width: number;
|
|
45
|
-
height: number;
|
|
46
|
-
pageX: number;
|
|
47
|
-
pageY: number;
|
|
48
|
-
}, hierarchy?: HierarchyBreadcrumbItem[], nativeTag?: number, snapshotUri?: string, snapshotBase64?: string): InspectedElementInfo;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import{StyleSheet as S,Platform as j}from"react-native";export function getCleanComponentName(t){if(!t)return"Unknown";if(typeof t=="string")return t==="RCTView"||t==="AndroidHorizontalScrollView"?"View":t==="RCTText"||t==="RCTRawText"||t==="RCTVirtualText"?"Text":t==="RCTImageView"||t==="RCTCxxImageView"?"Image":t==="RCTScrollView"?"ScrollView":t==="RCTModalHostView"?"Modal":t==="RCTSafeAreaView"?"SafeAreaView":t.replace(/^RCT/,"").replace(/^Android/,"");if(typeof t=="function")return t.displayName||t.name||"Component";if(typeof t=="object"){if(t.$$typeof?.toString().includes("memo")&&t.type)return`Memo(${getCleanComponentName(t.type)})`;if(t.$$typeof?.toString().includes("forward_ref")&&(t.render||t.type))return t.displayName||`ForwardRef(${getCleanComponentName(t.render||t.type)})`;if(t.displayName)return t.displayName;if(t.name)return t.name}return"Component"}function I(t){if(!t)return!0;const e=t.toLowerCase();return e.includes("provider")||e.includes("consumer")||e.includes("context")||e==="errorboundary"||e==="moduleerrorboundary"||e.includes("inspector")||e==="anonymous"}export function buildHierarchyFromFiber(t){const e=[];let o=t,a=0;for(;o&&a<25;){if(o.type){const r=getCleanComponentName(o.type),s=typeof o.type=="string",l=o.memoizedProps||{},n=l.style?S.flatten(l.style):void 0;(!I(r)||e.length===0)&&e.unshift({id:`breadcrumb_${a}_${r}`,displayName:r,componentName:r,depth:a,isHostComponent:s,props:l,styles:n})}o=o.return,a++}return e}export function getDynamicInspectorDataForPoint(t,e,o){return new Promise(a=>{let r=!1;const s=setTimeout(()=>{if(!r){r=!0;const n=L(t,e);a(n)}},120),l=n=>{if(!r&&n&&(n.frame||n.hierarchy&&n.hierarchy.length>0)){r=!0,clearTimeout(s);const{frame:c,props:i,hierarchy:p,selectedIndex:d,touchedViewTag:f,closestInstance:u}=n,h=[];Array.isArray(p)&&p.forEach((m,_)=>{const N=m?.type||m,g=m?.name||getCleanComponentName(N)||`View_${_}`;let y={};try{if(typeof m.getInspectorData=="function"){const H=m.getInspectorData();H?.props&&(y=H.props)}else m.props?y=m.props:m.memoizedProps&&(y=m.memoizedProps)}catch{}const R=y?.style||typeof m.getInspectorData=="function"&&m.getInspectorData()?.props?.style,A=R?S.flatten(R):void 0;h.push({id:`crumb_${_}_${g}`,displayName:getCleanComponentName(g),componentName:g,depth:_,isHostComponent:typeof g=="string"&&(g.startsWith("RCT")||g==="View"||g==="Text"||g==="Image"),props:y,styles:A})});const b=d!=null&&h[d]?h[d]:h[h.length-1],x=b?.componentName||(u?getCleanComponentName(u.type):"View"),$=getCleanComponentName(x),w=i&&Object.keys(i).length>0?i:b?.props||{},O=w.style?S.flatten(w.style):b?.styles||{},C={x:c?.left??t,y:c?.top??e,width:c?.width??0,height:c?.height??0,pageX:c?.left??t,pageY:c?.top??e},T=createInspectedElement($,w,C,h.length>0?h:void 0,f);a(T)}};try{const n=globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__||typeof window<"u"&&window.__REACT_DEVTOOLS_GLOBAL_HOOK__;if(n&&n.renderers){const c=Array.from(n.renderers.values());let i=!1,p=o||null;if(!p&&n._fiberRoots)try{for(const d of n._fiberRoots.values())if(d&&d.size>0){const f=Array.from(d.values())[0];if(f?.containerInfo){p=f.containerInfo;break}}}catch{}for(const d of c){const f=d?.rendererConfig?.getInspectorDataForViewAtPoint;if(typeof f=="function")try{f(p,t,e,u=>(l(u),!0)),i=!0}catch{}}if(!i){clearTimeout(s),r=!0;const d=L(t,e);a(d)}}else{clearTimeout(s),r=!0;const c=L(t,e);a(c)}}catch{clearTimeout(s),r=!0;const n=L(t,e);a(n)}})}function L(t,e){try{const o=globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__||typeof window<"u"&&window.__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!o||!o._fiberRoots)return null;let a=null;for(const d of o._fiberRoots.values())if(d&&d.size>0){const f=Array.from(d.values())[0];if(f?.current){a=f.current;break}}if(!a)return null;const r=[];let s=a,l=0;for(;s&&l<30;){if(s.type){const d=getCleanComponentName(s.type),f=typeof s.type=="string",u=s.memoizedProps||s.pendingProps||{},h=u.style?S.flatten(u.style):void 0;I(d)||r.push({id:`fiber_crumb_${l}_${d}`,displayName:d,componentName:d,depth:l,isHostComponent:f,props:u,styles:h})}s=s.child,l++}if(r.length===0)return null;const n=r[r.length-1],c=n.props||{},i=n.styles||{},p={x:i.left??t,y:i.top??e,width:i.width??120,height:i.height??44,pageX:i.left??t,pageY:i.top??e};return createInspectedElement(n.componentName,c,p,r)}catch{return null}}export function extractBoxModel(t={},e={width:0,height:0}){const o=(y,R=0)=>{const A=typeof y=="number"?y:parseFloat(y);return isNaN(A)?R:A},a=o(t.margin,0),r=o(t.marginVertical,a),s=o(t.marginHorizontal,a),l=o(t.marginTop,r),n=o(t.marginBottom,r),c=o(t.marginLeft,s),i=o(t.marginRight,s),p=o(t.padding,0),d=o(t.paddingVertical,p),f=o(t.paddingHorizontal,p),u=o(t.paddingTop,d),h=o(t.paddingBottom,d),b=o(t.paddingLeft,f),x=o(t.paddingRight,f),$=o(t.borderWidth,0),w=o(t.borderTopWidth,$),O=o(t.borderBottomWidth,$),C=o(t.borderLeftWidth,$),T=o(t.borderRightWidth,$),m=e.width||o(t.width,0),_=e.height||o(t.height,0),N=Math.max(0,m-(b+x+C+T)),g=Math.max(0,_-(u+h+w+O));return{margin:{top:l,right:i,bottom:n,left:c},border:{top:w,right:T,bottom:O,left:C},padding:{top:u,right:x,bottom:h,left:b},content:{width:Math.round(N*10)/10,height:Math.round(g*10)/10}}}export function categorizeStyles(t={}){const e={layout:{},dimensions:{},position:{},spacing:{},typography:{},appearance:{},borders:{},transforms:{},other:{}},o=new Set(["flex","flexDirection","justifyContent","alignItems","alignSelf","alignContent","flexWrap","flexGrow","flexShrink","flexBasis","gap","rowGap","columnGap"]),a=new Set(["width","height","minWidth","maxWidth","minHeight","maxHeight","aspectRatio"]),r=new Set(["position","top","bottom","left","right","start","end","zIndex"]),s=new Set(["padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingHorizontal","paddingVertical","paddingStart","paddingEnd","margin","marginTop","marginRight","marginBottom","marginLeft","marginHorizontal","marginVertical","marginStart","marginEnd"]),l=new Set(["color","fontSize","fontWeight","fontFamily","fontStyle","lineHeight","letterSpacing","textAlign","textAlignVertical","textDecorationLine","textDecorationStyle","textDecorationColor","textTransform","includeFontPadding"]),n=new Set(["backgroundColor","opacity","overflow","elevation","shadowColor","shadowOffset","shadowOpacity","shadowRadius","backfaceVisibility"]),c=new Set(["borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","borderRadius","borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius","borderStyle"]);for(const[i,p]of Object.entries(t))p!==void 0&&(o.has(i)?e.layout[i]=p:a.has(i)?e.dimensions[i]=p:r.has(i)?e.position[i]=p:s.has(i)?e.spacing[i]=p:l.has(i)?e.typography[i]=p:n.has(i)?e.appearance[i]=p:c.has(i)?e.borders[i]=p:i==="transform"?e.transforms[i]=p:e.other[i]=p);return e}function v(t){const e=t.replace("#","");if(e.length<6)return .5;const o=parseInt(e.substring(0,2),16)/255,a=parseInt(e.substring(2,4),16)/255,r=parseInt(e.substring(4,6),16)/255,s=[o,a,r].map(l=>l<=.03928?l/12.92:Math.pow((l+.055)/1.055,2.4));return .2126*s[0]+.7152*s[1]+.0722*s[2]}export function calculateContrastRatio(t,e){if(!t||!e||!t.startsWith("#")||!e.startsWith("#"))return{ratio:void 0,score:"N/A"};const o=v(t),a=v(e),r=Math.max(o,a),s=Math.min(o,a),l=(r+.05)/(s+.05),n=Math.round(l*100)/100;let c="Fail";return n>=7?c="AAA":n>=4.5&&(c="AA"),{ratio:n,score:c}}export function auditAccessibility(t={},e={width:0,height:0},o={}){const a=j.OS==="android",r=a?48:44,s=typeof t.onPress=="function"||typeof t.onLongPress=="function"||t.accessible===!0,l=e.width||o.width||0,n=e.height||o.height||0,c=[];let i=!0;s&&(l>0||n>0)&&(l<r||n<r)&&(i=!1,c.push(`Touch target is ${Math.round(l)}\xD7${Math.round(n)}pt. Recommended min is ${r}\xD7${r}pt for ${a?"Android Material Design":"Apple iOS HIG"}.`));const p=!!(t.accessibilityLabel||t["aria-label"]||t.accessibilityTitle);s&&!p&&!t.children&&typeof t.children!="string"&&c.push("Interactive element is missing an accessibilityLabel / aria-label.");const d=o.color,f=o.backgroundColor,u=calculateContrastRatio(d,f);return u.score==="Fail"&&u.ratio!==void 0&&c.push(`Contrast ratio is ${u.ratio}:1 (below WCAG AA minimum 4.5:1).`),{hasValidTouchTarget:i,touchTargetWidth:l,touchTargetHeight:n,recommendedMinSize:r,contrastRatio:u.ratio,contrastScore:u.score,textColor:d,backgroundColor:f,hasAccessibilityLabel:p,accessibilityRole:t.accessibilityRole||t.role,accessibilityHint:t.accessibilityHint,issues:c}}export function generateJsxSnippet(t,e={},o={}){return generateFullJsxSegmentSnippet(t,e,o).code}function D(t,e){return typeof e=="string"?`${t}="${e}"`:typeof e=="boolean"?e?t:`${t}={false}`:typeof e=="number"?`${t}={${e}}`:typeof e=="function"?`${t}={() => {}}`:typeof e=="object"&&e!==null?`${t}={${JSON.stringify(e)}}`:`${t}={${String(e)}}`}function V(t,e=1){if(t==null)return"";const o=" ".repeat(e);if(typeof t=="string"||typeof t=="number")return`${o}${t}`;if(Array.isArray(t))return t.map(a=>V(a,e)).filter(Boolean).join(`
|
|
2
|
-
`);if(typeof t=="object"&&t.type){const a=typeof t.type=="string"?t.type:t.type.displayName||t.type.name||"Component",r=t.props||{},s=[];for(const[n,c]of Object.entries(r))n==="children"||n==="__source"||n==="__self"||n==="_source"||s.push(D(n,c));const l=s.length?" "+s.join(" "):"";if(r.children){const n=V(r.children,e+1);return`${o}<${a}${l}>
|
|
3
|
-
${n}
|
|
4
|
-
${o}</${a}>`}return`${o}<${a}${l} />`}return""}export function generateFullJsxSegmentSnippet(t,e={},o={}){const a=e.__source||e._source,r=a?.fileName,s=a?.lineNumber,l=a?.columnNumber,n=r?r.replace(/^.*[\\/]/,""):void 0,c=n&&s?`${n}:${s}${l?`:${l}`:""}`:void 0,i=[];for(const[f,u]of Object.entries(e))f==="children"||f==="style"||f==="key"||f==="__source"||f==="__self"||f==="_source"||i.push(D(f,u));Object.keys(o).length>0&&i.push(`style={styles.${t.toLowerCase()||"container"}}`);const p=V(e.children,1);let d="";return i.length<=1&&!p?d=`<${t}${i.length?" "+i.join(" "):""} />`:p?d=`<${t}${i.length?`
|
|
5
|
-
`+i.join(`
|
|
6
|
-
`):""}>
|
|
7
|
-
${p}
|
|
8
|
-
</${t}>`:d=`<${t}
|
|
9
|
-
${i.join(`
|
|
10
|
-
`)}
|
|
11
|
-
/>`,{code:d,sourceFile:r,sourceLocation:c,lineNumber:s,columnNumber:l}}export function generateStyleSheetSnippet(t,e={}){const o=" ",a=[];for(const[s,l]of Object.entries(e)){if(l===void 0)continue;const n=typeof l=="string"?`'${l}'`:typeof l=="object"?JSON.stringify(l):String(l);a.push(`${o}${s}: ${n},`)}const r=a.length>0?`{
|
|
12
|
-
${a.join(`
|
|
13
|
-
`)}
|
|
14
|
-
}`:"{}";return`const styles = StyleSheet.create({
|
|
15
|
-
${t.toLowerCase()}Container: ${r},
|
|
16
|
-
});`}export function generateCssSnippet(t,e={}){const o=[];for(const[r,s]of Object.entries(e)){if(s===void 0)continue;const l=r.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase(),n=typeof s=="number"?`${s}px`:String(s);o.push(` ${l}: ${n};`)}const a=o.length>0?`{
|
|
17
|
-
${o.join(`
|
|
18
|
-
`)}
|
|
19
|
-
}`:"{}";return`.${t.toLowerCase()}-element ${a}`}export function createInspectedElement(t,e={},o,a=[],r,s,l){const n=e.style?S.flatten(e.style)||{}:{},c={...n},i=extractBoxModel(c,o),p=auditAccessibility(e,o,c);return{id:`elem_${Date.now()}_${Math.random().toString(36).substring(2,6)}`,componentName:t,displayName:t,hierarchy:a.length>0?a:[{id:"root_app",displayName:"App",componentName:"App",depth:0,isHostComponent:!1},{id:"inspected_node",displayName:t,componentName:t,depth:1,isHostComponent:!0,props:e,styles:c}],props:e,originalStyles:n,flattenedStyles:c,tweakedStyles:{},layout:o,boxModel:i,a11y:p,nativeTag:r,snapshotUri:s,snapshotBase64:l,timestamp:Date.now()}}
|