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.
Files changed (129) hide show
  1. package/README.md +0 -8
  2. package/android/src/main/java/com/inappinspector/NetworkInspectorModule.kt +118 -31
  3. package/dist/commonjs/components/Inspector/ConsoleExportModal.js +1 -1
  4. package/dist/commonjs/components/Inspector/ConsoleTab.js +7 -7
  5. package/dist/commonjs/components/Inspector/FabLauncher.js +3 -3
  6. package/dist/commonjs/components/Inspector/InspectorHeader.js +30 -30
  7. package/dist/commonjs/components/Inspector/MainScreen.js +38 -75
  8. package/dist/commonjs/components/Inspector/NetworkExportModal.js +4 -4
  9. package/dist/commonjs/components/Inspector/NetworkTab.js +51 -51
  10. package/dist/commonjs/components/Inspector/SecondaryTelemetryStrip.d.ts +1 -0
  11. package/dist/commonjs/components/Inspector/SecondaryTelemetryStrip.js +17 -16
  12. package/dist/commonjs/components/Inspector/SettingsPanel.js +40 -41
  13. package/dist/commonjs/components/Inspector/SkeletonPlaceholder.d.ts +3 -0
  14. package/dist/commonjs/components/Inspector/SkeletonPlaceholder.js +34 -3
  15. package/dist/commonjs/components/Inspector/TabBar.js +9 -15
  16. package/dist/commonjs/components/LogCard.js +7 -7
  17. package/dist/commonjs/components/SkeletonPlaceholder.d.ts +3 -0
  18. package/dist/commonjs/components/SkeletonPlaceholder.js +34 -3
  19. package/dist/commonjs/constants/telemetryConfig.d.ts +3 -3
  20. package/dist/commonjs/constants/telemetryConfig.js +1 -1
  21. package/dist/commonjs/constants/version.d.ts +1 -1
  22. package/dist/commonjs/constants/version.js +1 -1
  23. package/dist/commonjs/helpers/remoteConfig.js +1 -1
  24. package/dist/commonjs/helpers/shareFormatter.js +14 -14
  25. package/dist/commonjs/index.d.ts +1 -1
  26. package/dist/commonjs/index.js +3 -3
  27. package/dist/commonjs/native/NativeInspector.d.ts +2 -0
  28. package/dist/commonjs/native/NativeInspector.js +1 -1
  29. package/dist/commonjs/native/NativeNetworkInspector.d.ts +2 -0
  30. package/dist/commonjs/styles/AppFonts.d.ts +4 -0
  31. package/dist/commonjs/styles/AppFonts.js +1 -1
  32. package/dist/commonjs/styles/index.d.ts +2 -0
  33. package/dist/commonjs/styles/index.js +1 -1
  34. package/dist/commonjs/types/enums.d.ts +0 -2
  35. package/dist/commonjs/types/enums.js +1 -1
  36. package/dist/commonjs/types/interfaces.d.ts +1 -1
  37. package/dist/esm/components/Inspector/ConsoleExportModal.js +1 -1
  38. package/dist/esm/components/Inspector/ConsoleTab.js +48 -48
  39. package/dist/esm/components/Inspector/FabLauncher.js +42 -42
  40. package/dist/esm/components/Inspector/InspectorHeader.js +50 -50
  41. package/dist/esm/components/Inspector/MainScreen.js +87 -124
  42. package/dist/esm/components/Inspector/NetworkExportModal.js +1 -1
  43. package/dist/esm/components/Inspector/NetworkTab.js +83 -83
  44. package/dist/esm/components/Inspector/SecondaryTelemetryStrip.d.ts +1 -0
  45. package/dist/esm/components/Inspector/SecondaryTelemetryStrip.js +23 -22
  46. package/dist/esm/components/Inspector/SettingsPanel.js +106 -107
  47. package/dist/esm/components/Inspector/SkeletonPlaceholder.d.ts +3 -0
  48. package/dist/esm/components/Inspector/SkeletonPlaceholder.js +42 -11
  49. package/dist/esm/components/Inspector/TabBar.js +35 -41
  50. package/dist/esm/components/LogCard.js +53 -53
  51. package/dist/esm/components/SkeletonPlaceholder.d.ts +3 -0
  52. package/dist/esm/components/SkeletonPlaceholder.js +42 -11
  53. package/dist/esm/constants/telemetryConfig.d.ts +3 -3
  54. package/dist/esm/constants/telemetryConfig.js +1 -1
  55. package/dist/esm/constants/version.d.ts +1 -1
  56. package/dist/esm/constants/version.js +1 -1
  57. package/dist/esm/helpers/remoteConfig.js +1 -1
  58. package/dist/esm/helpers/shareFormatter.js +14 -14
  59. package/dist/esm/index.d.ts +1 -1
  60. package/dist/esm/index.js +8 -8
  61. package/dist/esm/native/NativeInspector.d.ts +2 -0
  62. package/dist/esm/native/NativeInspector.js +1 -1
  63. package/dist/esm/native/NativeNetworkInspector.d.ts +2 -0
  64. package/dist/esm/styles/AppFonts.d.ts +4 -0
  65. package/dist/esm/styles/AppFonts.js +1 -1
  66. package/dist/esm/styles/index.d.ts +2 -0
  67. package/dist/esm/styles/index.js +1 -1
  68. package/dist/esm/types/enums.d.ts +0 -2
  69. package/dist/esm/types/enums.js +1 -1
  70. package/dist/esm/types/interfaces.d.ts +1 -1
  71. package/ios/NetworkInspectorModule.mm +288 -325
  72. package/package.json +1 -1
  73. package/src/native/NativeInspector.ts +30 -0
  74. package/src/native/NativeNetworkInspector.ts +2 -0
  75. package/android/.gradle/8.9/checksums/checksums.lock +0 -0
  76. package/android/.gradle/8.9/dependencies-accessors/gc.properties +0 -0
  77. package/android/.gradle/8.9/executionHistory/executionHistory.lock +0 -0
  78. package/android/.gradle/8.9/fileChanges/last-build.bin +0 -0
  79. package/android/.gradle/8.9/fileHashes/fileHashes.lock +0 -0
  80. package/android/.gradle/8.9/gc.properties +0 -0
  81. package/android/.gradle/9.2.0/checksums/checksums.lock +0 -0
  82. package/android/.gradle/9.2.0/fileChanges/last-build.bin +0 -0
  83. package/android/.gradle/9.2.0/fileHashes/fileHashes.bin +0 -0
  84. package/android/.gradle/9.2.0/fileHashes/fileHashes.lock +0 -0
  85. package/android/.gradle/9.2.0/gc.properties +0 -0
  86. package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  87. package/android/.gradle/buildOutputCleanup/cache.properties +0 -2
  88. package/android/.gradle/vcs-1/gc.properties +0 -0
  89. package/android/.settings/org.eclipse.buildship.core.prefs +0 -13
  90. package/dist/commonjs/components/Inspector/BoxModelVisualizer.d.ts +0 -8
  91. package/dist/commonjs/components/Inspector/BoxModelVisualizer.js +0 -76
  92. package/dist/commonjs/components/Inspector/DebuggingTab.d.ts +0 -3
  93. package/dist/commonjs/components/Inspector/DebuggingTab.js +0 -197
  94. package/dist/commonjs/components/Inspector/UiA11yAuditPanel.d.ts +0 -7
  95. package/dist/commonjs/components/Inspector/UiA11yAuditPanel.js +0 -97
  96. package/dist/commonjs/components/Inspector/UiInspectorDetail.d.ts +0 -2
  97. package/dist/commonjs/components/Inspector/UiInspectorDetail.js +0 -485
  98. package/dist/commonjs/components/Inspector/UiInspectorOverlay.d.ts +0 -2
  99. package/dist/commonjs/components/Inspector/UiInspectorOverlay.js +0 -199
  100. package/dist/commonjs/components/Inspector/UiInspectorTab.d.ts +0 -2
  101. package/dist/commonjs/components/Inspector/UiInspectorTab.js +0 -117
  102. package/dist/commonjs/components/Inspector/UiLiveStyleTweaker.d.ts +0 -10
  103. package/dist/commonjs/components/Inspector/UiLiveStyleTweaker.js +0 -148
  104. package/dist/commonjs/components/Inspector/index.d.ts +0 -28
  105. package/dist/commonjs/components/Inspector/index.js +0 -1
  106. package/dist/commonjs/customHooks/uiInspectorManager.d.ts +0 -22
  107. package/dist/commonjs/customHooks/uiInspectorManager.js +0 -1
  108. package/dist/commonjs/helpers/uiInspectorEngine.d.ts +0 -62
  109. package/dist/commonjs/helpers/uiInspectorEngine.js +0 -19
  110. package/dist/esm/components/Inspector/BoxModelVisualizer.d.ts +0 -8
  111. package/dist/esm/components/Inspector/BoxModelVisualizer.js +0 -76
  112. package/dist/esm/components/Inspector/DebuggingTab.d.ts +0 -3
  113. package/dist/esm/components/Inspector/DebuggingTab.js +0 -197
  114. package/dist/esm/components/Inspector/UiA11yAuditPanel.d.ts +0 -7
  115. package/dist/esm/components/Inspector/UiA11yAuditPanel.js +0 -97
  116. package/dist/esm/components/Inspector/UiInspectorDetail.d.ts +0 -2
  117. package/dist/esm/components/Inspector/UiInspectorDetail.js +0 -422
  118. package/dist/esm/components/Inspector/UiInspectorOverlay.d.ts +0 -2
  119. package/dist/esm/components/Inspector/UiInspectorOverlay.js +0 -138
  120. package/dist/esm/components/Inspector/UiInspectorTab.d.ts +0 -2
  121. package/dist/esm/components/Inspector/UiInspectorTab.js +0 -117
  122. package/dist/esm/components/Inspector/UiLiveStyleTweaker.d.ts +0 -10
  123. package/dist/esm/components/Inspector/UiLiveStyleTweaker.js +0 -148
  124. package/dist/esm/components/Inspector/index.d.ts +0 -28
  125. package/dist/esm/components/Inspector/index.js +0 -1
  126. package/dist/esm/customHooks/uiInspectorManager.d.ts +0 -22
  127. package/dist/esm/customHooks/uiInspectorManager.js +0 -1
  128. package/dist/esm/helpers/uiInspectorEngine.d.ts +0 -48
  129. package/dist/esm/helpers/uiInspectorEngine.js +0 -19
@@ -1,62 +0,0 @@
1
- import { A11yAuditResult, BoxModelMetrics, ComponentTreeNode, HierarchyBreadcrumbItem, InspectedElementInfo } from '../types';
2
- export declare function getCleanComponentName(type: any): string;
3
- export declare function buildHierarchyFromFiber(fiber: any): HierarchyBreadcrumbItem[];
4
- export interface IndexedFiberItem {
5
- fiber: any;
6
- name: string;
7
- isHost: boolean;
8
- props: Record<string, any>;
9
- styles: Record<string, any>;
10
- nativeTag?: number;
11
- text?: string;
12
- sourceLocation?: string;
13
- depth: number;
14
- }
15
- export declare function getAllAppFibers(): IndexedFiberItem[];
16
- export declare function getFullComponentTree(): ComponentTreeNode[];
17
- export declare function inspectFiberTreeAtPoint(locationX: number, locationY: number, nativeHit?: any): InspectedElementInfo | null;
18
- export declare function getDynamicInspectorDataForPoint(locationX: number, locationY: number, inspectedViewRef?: any): Promise<InspectedElementInfo | null>;
19
- export declare function extractBoxModel(flattenedStyle?: Record<string, any>, layout?: {
20
- width: number;
21
- height: number;
22
- }): BoxModelMetrics;
23
- export declare function categorizeStyles(flattened?: Record<string, any>): {
24
- layout: Record<string, any>;
25
- dimensions: Record<string, any>;
26
- position: Record<string, any>;
27
- spacing: Record<string, any>;
28
- typography: Record<string, any>;
29
- appearance: Record<string, any>;
30
- borders: Record<string, any>;
31
- transforms: Record<string, any>;
32
- other: Record<string, any>;
33
- };
34
- export declare function calculateContrastRatio(textColor?: string, bgColor?: string): {
35
- ratio: any;
36
- score: "N/A";
37
- } | {
38
- ratio: number;
39
- score: "AAA" | "AA" | "Fail";
40
- };
41
- export declare function auditAccessibility(props?: Record<string, any>, layout?: {
42
- width: number;
43
- height: number;
44
- }, styles?: Record<string, any>): A11yAuditResult;
45
- export declare function generateJsxSnippet(componentName: string, props?: Record<string, any>, styles?: Record<string, any>): string;
46
- export declare function generateFullJsxSegmentSnippet(componentName: string, props?: Record<string, any>, styles?: Record<string, any>): {
47
- code: string;
48
- sourceFile?: string;
49
- sourceLocation?: string;
50
- lineNumber?: number;
51
- columnNumber?: number;
52
- };
53
- export declare function generateStyleSheetSnippet(componentName: string, styles?: Record<string, any>): string;
54
- export declare function generateCssSnippet(componentName: string, styles?: Record<string, any>): string;
55
- export declare function createInspectedElement(componentName: string, props: Record<string, any>, layout: {
56
- x: number;
57
- y: number;
58
- width: number;
59
- height: number;
60
- pageX: number;
61
- pageY: number;
62
- }, hierarchy?: HierarchyBreadcrumbItem[], nativeTag?: number, snapshotUri?: string, snapshotBase64?: string): InspectedElementInfo;
@@ -1,19 +0,0 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getCleanComponentName=getCleanComponentName,exports.buildHierarchyFromFiber=buildHierarchyFromFiber,exports.getAllAppFibers=getAllAppFibers,exports.getFullComponentTree=getFullComponentTree,exports.inspectFiberTreeAtPoint=inspectFiberTreeAtPoint,exports.getDynamicInspectorDataForPoint=getDynamicInspectorDataForPoint,exports.extractBoxModel=extractBoxModel,exports.categorizeStyles=categorizeStyles,exports.calculateContrastRatio=calculateContrastRatio,exports.auditAccessibility=auditAccessibility,exports.generateJsxSnippet=generateJsxSnippet,exports.generateFullJsxSegmentSnippet=generateFullJsxSegmentSnippet,exports.generateStyleSheetSnippet=generateStyleSheetSnippet,exports.generateCssSnippet=generateCssSnippet,exports.createInspectedElement=createInspectedElement;const react_native_1=require("react-native");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 isInternalWrapper(t){if(!t)return!0;const e=t.toLowerCase();return e.includes("provider")||e.includes("consumer")||e.includes("context")||e.includes("safearray")||e==="errorboundary"||e==="moduleerrorboundary"||e.includes("inspector")||e.includes("screengroup")||e.includes("screenstack")||e.includes("screencontainer")||e.includes("nativestackview")||e.includes("navigationcontainerinner")||e==="anonymous"}function extractTextFromFiber(t){if(!t)return;const e=t.memoizedProps||t.pendingProps;if(typeof e?.children=="string")return e.children;if(typeof e?.title=="string")return e.title;if(typeof e?.label=="string")return e.label;if(typeof e?.text=="string")return e.text;if(typeof e?.accessibilityLabel=="string")return e.accessibilityLabel}function buildHierarchyFromFiber(t){const e=[];let o=t,i=0;for(;o&&i<30;){if(o.type){const n=getCleanComponentName(o.type),l=typeof o.type=="string",a=o.memoizedProps||o.pendingProps||{},c=a.style?react_native_1.StyleSheet.flatten(a.style):void 0,r=extractTextFromFiber(o),s=o._debugSource||a.__source||a._source,d=s?.fileName&&s?.lineNumber?`${s.fileName.replace(/^.*[\\/]/,"")}:${s.lineNumber}`:void 0;(!isInternalWrapper(n)||e.length===0)&&e.unshift({id:`crumb_${i}_${n}_${Math.random().toString(36).substring(2,5)}`,displayName:n,componentName:n,depth:i,isHostComponent:l,props:a,styles:c})}o=o.return,i++}return e}function getAllAppFibers(){const t=[];try{const e=globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__||typeof window<"u"&&window.__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!e||!e._fiberRoots)return t;for(const o of e._fiberRoots.values())if(!(!o||o.size===0))for(const i of o.values()){const n=i?.current;if(!n)continue;const l=[{fiber:n,depth:0}],a=new Set;let c=0;for(;l.length>0&&c<8e3;){const{fiber:r,depth:s}=l.pop();if(!r||a.has(r)||(a.add(r),c++,r.sibling&&l.push({fiber:r.sibling,depth:s}),r.child&&l.push({fiber:r.child,depth:s+1}),!r.type))continue;const d=getCleanComponentName(r.type),u=d.toLowerCase();if(u.includes("inappinspector")||u.includes("uiinspector")||u.includes("floatingcapture")||u.includes("tabbar")||u.includes("devtools"))continue;const p=r.memoizedProps||r.pendingProps||{},f=p.style?react_native_1.StyleSheet.flatten(p.style)||{}:{},g=typeof r.type=="string",y=extractTextFromFiber(r),m=r._debugSource||p.__source||p._source,_=m?.fileName&&m?.lineNumber?`${m.fileName.replace(/^.*[\\/]/,"")}:${m.lineNumber}`:void 0;let w;r.stateNode&&(w=r.stateNode._nativeTag||r.stateNode.canonical?.nativeTag||r.stateNode.node||(typeof r.stateNode=="number"?r.stateNode:void 0)),t.push({fiber:r,name:d,isHost:g,props:p,styles:f,nativeTag:w,text:y,sourceLocation:_,depth:s})}}}catch{}return t}function getFullComponentTree(){try{const t=globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__||typeof window<"u"&&window.__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!t||!t._fiberRoots)return[];const e=[];for(const o of t._fiberRoots.values())if(!(!o||o.size===0))for(const i of o.values()){let n=function(c,r){if(!c||r>20)return null;const s=getCleanComponentName(c.type),d=s.toLowerCase();if(d.includes("inappinspector")||d.includes("uiinspector")||d.includes("floatingcapture")||d.includes("tabbar"))return null;const u=typeof c.type=="string",p=c.memoizedProps||c.pendingProps||{},f=[];let g=c.child;for(;g;){const y=n(g,r+1);y&&f.push(y),g=g.sibling}return isInternalWrapper(s)&&f.length>0?f.length===1?f[0]:{id:`tree_${r}_${s}_${Math.random().toString(36).substring(2,5)}`,name:s,displayName:s,depth:r,isHostComponent:u,props:p,children:f}:{id:`tree_${r}_${s}_${Math.random().toString(36).substring(2,5)}`,name:s,displayName:s,depth:r,isHostComponent:u,props:p,children:f}};const l=i?.current;if(!l)continue;const a=n(l,0);a&&e.push(a)}return e}catch{return[]}}function inspectFiberTreeAtPoint(t,e,o){try{const i=getAllAppFibers();if(i.length===0)return null;let n=null;if(o?.tag||o?.id){const u=o.tag||o.id;n=i.find(p=>p.nativeTag===u)||null}if(!n&&o?.text&&o.text.trim().length>0){const u=o.text.trim();n=i.find(p=>p.text&&(p.text===u||p.text.includes(u)))||null}if(!n&&o?.className){const u=o.className.replace(/^RCT/,"").replace(/^Android/,"");n=i.find(p=>!isInternalWrapper(p.name)&&(p.name===u||p.name===o.className))||null}if(!n){const u=i.filter(p=>!p.isHost&&!isInternalWrapper(p.name));if(u.length>0)n=u[u.length-1];else{const p=i.filter(f=>!isInternalWrapper(f.name));n=p.length>0?p[p.length-1]:i[i.length-1]}}if(!n)return null;const l=buildHierarchyFromFiber(n.fiber),a=o?.x??n.styles.left??t,c=o?.y??n.styles.top??e,r=o?.width??n.styles.width??160,s=o?.height??n.styles.height??44,d={x:a,y:c,width:r,height:s,pageX:a,pageY:c};return createInspectedElement(n.name,n.props,d,l,n.nativeTag)}catch{return null}}async function getDynamicInspectorDataForPoint(t,e,o){let i=null;try{const{findNativeViewAtPoint:l}=require("../native/NativeInspector");typeof l=="function"&&(i=await l(t,e))}catch{}const n=inspectFiberTreeAtPoint(t,e,i);return n&&n.hierarchy&&n.hierarchy.length>0?(i&&i.width>0&&i.height>0&&(n.layout={x:i.x,y:i.y,width:i.width,height:i.height,pageX:i.x,pageY:i.y},n.boxModel=extractBoxModel(n.flattenedStyles,n.layout)),n):new Promise(l=>{let a=!1;const c=setTimeout(()=>{a||(a=!0,l(inspectFiberTreeAtPoint(t,e,i)))},100);try{const r=globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__||typeof window<"u"&&window.__REACT_DEVTOOLS_GLOBAL_HOOK__;if(r&&r.renderers){const s=Array.from(r.renderers.values());for(const d of s){const u=d?.rendererConfig?.getInspectorDataForViewAtPoint;typeof u=="function"&&u(o||null,t,e,p=>{if(a)return!0;if(p&&(p.frame||p.hierarchy&&p.hierarchy.length>0)){a=!0,clearTimeout(c);const{frame:f,props:g,hierarchy:y,selectedIndex:m,touchedViewTag:_,closestInstance:w}=p,b=[];Array.isArray(y)&&y.forEach((h,T)=>{const N=h?.type||h,$=h?.name||getCleanComponentName(N)||`View_${T}`;let C={};try{if(typeof h.getInspectorData=="function"){const V=h.getInspectorData();V?.props&&(C=V.props)}else h.props?C=h.props:h.memoizedProps&&(C=h.memoizedProps)}catch{}const v=C?.style||typeof h.getInspectorData=="function"&&h.getInspectorData()?.props?.style,H=v?react_native_1.StyleSheet.flatten(v):void 0;b.push({id:`crumb_${T}_${$}`,displayName:getCleanComponentName($),componentName:$,depth:T,isHostComponent:typeof $=="string"&&($.startsWith("RCT")||$==="View"||$==="Text"||$==="Image"),props:C,styles:H})});const S=m!=null&&b[m]?b[m]:b[b.length-1],A=S?.componentName||(w?getCleanComponentName(w.type):"View"),R=getCleanComponentName(A),x=g&&Object.keys(g).length>0?g:S?.props||{},O=x.style?react_native_1.StyleSheet.flatten(x.style):S?.styles||{},L={x:f?.left??t,y:f?.top??e,width:f?.width??(i?.width||120),height:f?.height??(i?.height||44),pageX:f?.left??t,pageY:f?.top??e};return l(createInspectedElement(R,x,L,b.length>0?b:void 0,_)),!0}return!1})}}}catch{clearTimeout(c),l(inspectFiberTreeAtPoint(t,e,i))}})}function extractBoxModel(t={},e={width:0,height:0}){const o=(h,T=0)=>{const N=typeof h=="number"?h:parseFloat(h);return isNaN(N)?T:N},i=o(t.margin,0),n=o(t.marginVertical,i),l=o(t.marginHorizontal,i),a=o(t.marginTop,n),c=o(t.marginBottom,n),r=o(t.marginLeft,l),s=o(t.marginRight,l),d=o(t.padding,0),u=o(t.paddingVertical,d),p=o(t.paddingHorizontal,d),f=o(t.paddingTop,u),g=o(t.paddingBottom,u),y=o(t.paddingLeft,p),m=o(t.paddingRight,p),_=o(t.borderWidth,0),w=o(t.borderTopWidth,_),b=o(t.borderBottomWidth,_),S=o(t.borderLeftWidth,_),A=o(t.borderRightWidth,_),R=e.width||o(t.width,0),x=e.height||o(t.height,0),O=Math.max(0,R-(y+m+S+A)),L=Math.max(0,x-(f+g+w+b));return{margin:{top:a,right:s,bottom:c,left:r},border:{top:w,right:A,bottom:b,left:S},padding:{top:f,right:m,bottom:g,left:y},content:{width:Math.round(O*10)/10,height:Math.round(L*10)/10}}}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"]),i=new Set(["width","height","minWidth","maxWidth","minHeight","maxHeight","aspectRatio"]),n=new Set(["position","top","bottom","left","right","start","end","zIndex"]),l=new Set(["padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingHorizontal","paddingVertical","paddingStart","paddingEnd","margin","marginTop","marginRight","marginBottom","marginLeft","marginHorizontal","marginVertical","marginStart","marginEnd"]),a=new Set(["color","fontSize","fontWeight","fontFamily","fontStyle","lineHeight","letterSpacing","textAlign","textAlignVertical","textDecorationLine","textDecorationStyle","textDecorationColor","textTransform","includeFontPadding"]),c=new Set(["backgroundColor","opacity","overflow","elevation","shadowColor","shadowOffset","shadowOpacity","shadowRadius","backfaceVisibility"]),r=new Set(["borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","borderRadius","borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius","borderStyle"]);for(const[s,d]of Object.entries(t))d!==void 0&&(o.has(s)?e.layout[s]=d:i.has(s)?e.dimensions[s]=d:n.has(s)?e.position[s]=d:l.has(s)?e.spacing[s]=d:a.has(s)?e.typography[s]=d:c.has(s)?e.appearance[s]=d:r.has(s)?e.borders[s]=d:s==="transform"?e.transforms[s]=d:e.other[s]=d);return e}function getLuminance(t){const e=t.replace("#","");if(e.length<6)return .5;const o=parseInt(e.substring(0,2),16)/255,i=parseInt(e.substring(2,4),16)/255,n=parseInt(e.substring(4,6),16)/255,l=[o,i,n].map(a=>a<=.03928?a/12.92:Math.pow((a+.055)/1.055,2.4));return .2126*l[0]+.7152*l[1]+.0722*l[2]}function calculateContrastRatio(t,e){if(!t||!e||!t.startsWith("#")||!e.startsWith("#"))return{ratio:void 0,score:"N/A"};const o=getLuminance(t),i=getLuminance(e),n=Math.max(o,i),l=Math.min(o,i),a=(n+.05)/(l+.05),c=Math.round(a*100)/100;let r="Fail";return c>=7?r="AAA":c>=4.5&&(r="AA"),{ratio:c,score:r}}function auditAccessibility(t={},e={width:0,height:0},o={}){const i=react_native_1.Platform.OS==="android",n=i?48:44,l=typeof t.onPress=="function"||typeof t.onLongPress=="function"||t.accessible===!0,a=e.width||o.width||0,c=e.height||o.height||0,r=[];let s=!0;l&&(a>0||c>0)&&(a<n||c<n)&&(s=!1,r.push(`Touch target is ${Math.round(a)}\xD7${Math.round(c)}pt. Recommended min is ${n}\xD7${n}pt for ${i?"Android Material Design":"Apple iOS HIG"}.`));const d=!!(t.accessibilityLabel||t["aria-label"]||t.accessibilityTitle);l&&!d&&!t.children&&typeof t.children!="string"&&r.push("Interactive element is missing an accessibilityLabel / aria-label.");const u=o.color,p=o.backgroundColor,f=calculateContrastRatio(u,p);return f.score==="Fail"&&f.ratio!==void 0&&r.push(`Contrast ratio is ${f.ratio}:1 (below WCAG AA minimum 4.5:1).`),{hasValidTouchTarget:s,touchTargetWidth:a,touchTargetHeight:c,recommendedMinSize:n,contrastRatio:f.ratio,contrastScore:f.score,textColor:u,backgroundColor:p,hasAccessibilityLabel:d,accessibilityRole:t.accessibilityRole||t.role,accessibilityHint:t.accessibilityHint,issues:r}}function generateJsxSnippet(t,e={},o={}){return generateFullJsxSegmentSnippet(t,e,o).code}function formatJsxProp(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 formatJsxChildren(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(i=>formatJsxChildren(i,e)).filter(Boolean).join(`
2
- `);if(typeof t=="object"&&t.type){const i=typeof t.type=="string"?t.type:t.type.displayName||t.type.name||"Component",n=t.props||{},l=[];for(const[c,r]of Object.entries(n))c==="children"||c==="__source"||c==="__self"||c==="_source"||l.push(formatJsxProp(c,r));const a=l.length?" "+l.join(" "):"";if(n.children){const c=formatJsxChildren(n.children,e+1);return`${o}<${i}${a}>
3
- ${c}
4
- ${o}</${i}>`}return`${o}<${i}${a} />`}return""}function generateFullJsxSegmentSnippet(t,e={},o={}){const i=e.__source||e._source,n=i?.fileName,l=i?.lineNumber,a=i?.columnNumber,c=n?n.replace(/^.*[\\/]/,""):void 0,r=c&&l?`${c}:${l}${a?`:${a}`:""}`:void 0,s=[];for(const[p,f]of Object.entries(e))p==="children"||p==="style"||p==="key"||p==="__source"||p==="__self"||p==="_source"||s.push(formatJsxProp(p,f));Object.keys(o).length>0&&s.push(`style={styles.${t.toLowerCase()||"container"}}`);const d=formatJsxChildren(e.children,1);let u="";return s.length<=1&&!d?u=`<${t}${s.length?" "+s.join(" "):""} />`:d?u=`<${t}${s.length?`
5
- `+s.join(`
6
- `):""}>
7
- ${d}
8
- </${t}>`:u=`<${t}
9
- ${s.join(`
10
- `)}
11
- />`,{code:u,sourceFile:n,sourceLocation:r,lineNumber:l,columnNumber:a}}function generateStyleSheetSnippet(t,e={}){const o=" ",i=[];for(const[l,a]of Object.entries(e)){if(a===void 0)continue;const c=typeof a=="string"?`'${a}'`:typeof a=="object"?JSON.stringify(a):String(a);i.push(`${o}${l}: ${c},`)}const n=i.length>0?`{
12
- ${i.join(`
13
- `)}
14
- }`:"{}";return`const styles = StyleSheet.create({
15
- ${t.toLowerCase()}Container: ${n},
16
- });`}function generateCssSnippet(t,e={}){const o=[];for(const[n,l]of Object.entries(e)){if(l===void 0)continue;const a=n.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase(),c=typeof l=="number"?`${l}px`:String(l);o.push(` ${a}: ${c};`)}const i=o.length>0?`{
17
- ${o.join(`
18
- `)}
19
- }`:"{}";return`.${t.toLowerCase()}-element ${i}`}function createInspectedElement(t,e={},o,i=[],n,l,a){const c=e.style?react_native_1.StyleSheet.flatten(e.style)||{}:{},r={...c},s=extractBoxModel(r,o),d=auditAccessibility(e,o,r);return{id:`elem_${Date.now()}_${Math.random().toString(36).substring(2,6)}`,componentName:t,displayName:t,hierarchy:i.length>0?i:[{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:r}],props:e,originalStyles:c,flattenedStyles:r,tweakedStyles:{},layout:o,boxModel:s,a11y:d,nativeTag:n,snapshotUri:l,snapshotBase64:a,timestamp:Date.now()}}
@@ -1,8 +0,0 @@
1
- import React from 'react';
2
- import { BoxModelMetrics } from '../../types';
3
- interface BoxModelVisualizerProps {
4
- boxModel: BoxModelMetrics;
5
- compact?: boolean;
6
- }
7
- export declare const BoxModelVisualizer: React.FC<BoxModelVisualizerProps>;
8
- export {};
@@ -1,76 +0,0 @@
1
- import"react";import{StyleSheet as I,Text as B,View as T}from"react-native";import{AppColors as C}from"../../styles/AppColors";import{AppFonts as h}from"../../styles/AppFonts";export const BoxModelVisualizer=({boxModel:v,compact:z=!1})=>{const{margin:w,border:R,padding:F,content:S}=v;return<T style={e.container}>
2
-
3
- <T style={e.marginBox}>
4
- <T style={e.labelRow}>
5
- <B style={e.boxLabelMargin}>MARGIN</B>
6
- </T>
7
- <B style={e.valueTop}>{w.top}</B>
8
-
9
- <T style={e.middleRow}>
10
- <B style={e.valueLeft}>{w.left}</B>
11
-
12
-
13
- <T style={e.borderBox}>
14
- <T style={e.labelRow}>
15
- <B style={e.boxLabelBorder}>BORDER</B>
16
- </T>
17
- <B style={e.valueTop}>{R.top}</B>
18
-
19
- <T style={e.middleRow}>
20
- <B style={e.valueLeft}>{R.left}</B>
21
-
22
-
23
- <T style={e.paddingBox}>
24
- <T style={e.labelRow}>
25
- <B style={e.boxLabelPadding}>PADDING</B>
26
- </T>
27
- <B style={e.valueTop}>{F.top}</B>
28
-
29
- <T style={e.middleRow}>
30
- <B style={e.valueLeft}>{F.left}</B>
31
-
32
-
33
- <T style={e.contentBox}>
34
- <B style={e.contentDimensions}>
35
- {S.width} × {S.height}
36
- </B>
37
- </T>
38
-
39
- <B style={e.valueRight}>{F.right}</B>
40
- </T>
41
-
42
- <B style={e.valueBottom}>{F.bottom}</B>
43
- </T>
44
-
45
- <B style={e.valueRight}>{R.right}</B>
46
- </T>
47
-
48
- <B style={e.valueBottom}>{R.bottom}</B>
49
- </T>
50
-
51
- <B style={e.valueRight}>{w.right}</B>
52
- </T>
53
-
54
- <B style={e.valueBottom}>{w.bottom}</B>
55
- </T>
56
-
57
-
58
- {!z&&<T style={e.legendContainer}>
59
- <T style={e.legendItem}>
60
- <T style={[e.legendSwatch,{backgroundColor:"#F59E0B2B",borderColor:"#F59E0B"}]}/>
61
- <B style={e.legendText}>Margin</B>
62
- </T>
63
- <T style={e.legendItem}>
64
- <T style={[e.legendSwatch,{backgroundColor:"#FDE0473D",borderColor:"#EAB308"}]}/>
65
- <B style={e.legendText}>Border</B>
66
- </T>
67
- <T style={e.legendItem}>
68
- <T style={[e.legendSwatch,{backgroundColor:"#10B9812B",borderColor:"#10B981"}]}/>
69
- <B style={e.legendText}>Padding</B>
70
- </T>
71
- <T style={e.legendItem}>
72
- <T style={[e.legendSwatch,{backgroundColor:"#4F46E52B",borderColor:"#4F46E5"}]}/>
73
- <B style={e.legendText}>Content</B>
74
- </T>
75
- </T>}
76
- </T>};const e=I.create({container:{alignItems:"center",marginVertical:8},marginBox:{width:"100%",backgroundColor:"#F59E0B1A",borderWidth:1,borderColor:"#F59E0B66",borderRadius:8,padding:6,alignItems:"center"},borderBox:{flex:1,backgroundColor:"#FDE04724",borderWidth:1,borderColor:"#EAB30877",borderRadius:6,padding:6,alignItems:"center",marginHorizontal:4},paddingBox:{flex:1,backgroundColor:"#10B9811A",borderWidth:1,borderColor:"#10B98166",borderRadius:4,padding:6,alignItems:"center",marginHorizontal:4},contentBox:{flex:1,backgroundColor:"#4F46E524",borderWidth:1,borderColor:"#4F46E577",borderRadius:3,paddingVertical:12,paddingHorizontal:8,alignItems:"center",justifyContent:"center",marginHorizontal:4,minHeight:40},labelRow:{position:"absolute",top:3,left:6},boxLabelMargin:{fontSize:9,fontFamily:h.medium,color:"#D97706",letterSpacing:.5},boxLabelBorder:{fontSize:9,fontFamily:h.medium,color:"#CA8A04",letterSpacing:.5},boxLabelPadding:{fontSize:9,fontFamily:h.medium,color:"#059669",letterSpacing:.5},middleRow:{flexDirection:"row",alignItems:"center",width:"100%",marginVertical:2},valueTop:{fontSize:11,fontFamily:h.semiBold,color:C.grayText,marginBottom:2},valueBottom:{fontSize:11,fontFamily:h.semiBold,color:C.grayText,marginTop:2},valueLeft:{fontSize:11,fontFamily:h.semiBold,color:C.grayText,marginRight:2},valueRight:{fontSize:11,fontFamily:h.semiBold,color:C.grayText,marginLeft:2},contentDimensions:{fontSize:12,fontFamily:h.bold,color:C.brandPurple},legendContainer:{flexDirection:"row",justifyContent:"center",gap:16,marginTop:12},legendItem:{flexDirection:"row",alignItems:"center",gap:6},legendSwatch:{width:12,height:12,borderRadius:3,borderWidth:1},legendText:{fontSize:11,fontFamily:h.medium,color:C.grayTextWeak}});
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- export declare const DebuggingTab: React.FC;
3
- export default DebuggingTab;
@@ -1,197 +0,0 @@
1
- import{useState as L,useEffect as _,useMemo as We,useCallback as ie,useRef as X}from"react";import{View as T,Text as C,ScrollView as Te,StyleSheet as Pe,NativeModules as He,TouchableOpacity as G,ActivityIndicator as Ce,Animated as Z}from"react-native";import{AppColors as e}from"../../styles/AppColors";import{AppFonts as B}from"../../styles/AppFonts";import{useTranslation as $e}from"../../i18n";import Ne from"../QRCodeView";import Se from"../TouchableScale";import{showToast as J}from"../../helpers/toast";import{triggerNativeHaptic as H}from"../../native/NativeInspector";import{InfoCircleIcon as Ee,CheckIcon as Be,BoltIcon as Re,CircleXIcon as Ie,SparkleIcon as Ge,AndroidIcon as Ue,RepeatIcon as _e,WrenchIcon as Ke}from"../NetworkIcons";import Qe,{Path as Xe}from"react-native-svg";const Ze=({color:k=e.purple,size:I=13})=><Qe width={I}height={I}viewBox="0 0 24 24"fill="none">
2
- <Xe d="M4 17l6-6-6-6M12 19h8"stroke={k}strokeWidth="2"strokeLinecap="round"strokeLinejoin="round"/>
3
- </Qe>;export const DebuggingTab=()=>{const{t:k}=$e(),I=We(()=>{const R=He.SourceCode?.scriptURL||"";let z="localhost",S=8081;try{if(R.includes("://")){const A=R.split("://")[1].split("/")[0];if(A.includes(":")){const F=A.split(":");z=F[0];const P=parseInt(F[1],10);isNaN(P)||(S=P)}else z=A}}catch{}return{host:z,port:S,scriptURL:R}},[]),[Y,Ve]=L(()=>I.host&&I.host!=="localhost"&&I.host!=="127.0.0.1"&&I.host!=="10.0.2.2"?I.host:"192.168.1.2"),[$,ze]=L(I.port||8083),[De,ee]=L("app-debug.apk"),[q,te]=L(null),[O,oe]=L("assembleRelease"),[W,ve]=L(!0),[V,U]=L({status:"idle",scheme:"assembleRelease",clean:!0,progress:0,currentTask:"",error:null,apkName:null,apkSize:null}),v=X(null),K=X(new Z.Value(0)).current,[Q,Ae]=L(!0),re=X(null);_(()=>{Z.timing(K,{toValue:Math.max(0,Math.min(100,V.progress)),duration:350,useNativeDriver:!1}).start()},[V.progress,K]),_(()=>{V.logs&&V.logs.length>0&&setTimeout(()=>{re.current?.scrollToEnd({animated:!0})},50)},[V.logs]);const E=ie(async()=>{const R=Array.from(new Set([I.host,"10.0.2.2","localhost","127.0.0.1"].filter(Boolean))),z=Array.from(new Set([I.port,8083,8081,8082].filter(Boolean)));for(const S of R)for(const M of z)try{const A=new AbortController,F=setTimeout(()=>A.abort(),1200),P=await fetch(`http://${S}:${M}/__inapp_inspector/apk-info`,{signal:A.signal});if(clearTimeout(F),P.ok){const D=await P.json();D.hostIp&&D.hostIp!=="127.0.0.1"&&D.hostIp!=="localhost"&&D.hostIp!=="10.0.2.2"&&Ve(D.hostIp),D.port&&ze(D.port),D.apkName&&ee(D.apkName),D.apkSize&&te((D.apkSize/(1024*1024)).toFixed(1));return}}catch{}},[I.host,I.port]);_(()=>{E()},[E]),_(()=>()=>{v.current&&clearInterval(v.current)},[]);const Fe=ie(()=>{v.current&&clearInterval(v.current);const R=I.host||"10.0.2.2";v.current=setInterval(async()=>{try{const z=await fetch(`http://${R}:${$}/__inapp_inspector/build-status`);if(z.ok){const S=await z.json();U(S),S.status==="completed"?(v.current&&clearInterval(v.current),H("success"),J(k("debugging.buildSuccess","APK Build Generated Successfully!")),S.apkSize&&te((S.apkSize/(1024*1024)).toFixed(1)),S.apkName&&ee(S.apkName),E()):S.status==="failed"&&(v.current&&clearInterval(v.current),H("error"),J(k("debugging.buildFailed",{error:S.error||"Gradle error"})))}}catch{}},1e3)},[I.host,$,E]),Oe=async()=>{H("medium"),U({status:"running",scheme:O,clean:W,progress:5,currentTask:W?"Cleaning build cache...":"Initializing build...",error:null,apkName:null,apkSize:null});const R=Array.from(new Set([I.host,"10.0.2.2","localhost","127.0.0.1"].filter(Boolean))),z=Array.from(new Set([$,8083,8081,8082].filter(Boolean)));let S=!1;for(const M of R)for(const A of z)try{const F=new AbortController,P=setTimeout(()=>F.abort(),2e3),D=await fetch(`http://${M}:${A}/__inapp_inspector/build-apk?scheme=${O}&clean=${W}`,{signal:F.signal});if(clearTimeout(P),D.ok){S=!0,Fe();return}}catch{}S||U(M=>({...M,status:"failed",error:"Cannot reach build server. Ensure npm start or npm run serve-apk is running on host."}))},Me=async()=>{H("warning"),v.current&&clearInterval(v.current);const R=Array.from(new Set([I.host,"10.0.2.2","localhost","127.0.0.1"].filter(Boolean))),z=Array.from(new Set([$,8083,8081,8082].filter(Boolean)));for(const S of R)for(const M of z)try{const A=new AbortController,F=setTimeout(()=>A.abort(),1500);await fetch(`http://${S}:${M}/__inapp_inspector/stop-build`,{signal:A.signal}),clearTimeout(F)}catch{}U(S=>({...S,status:"idle",currentTask:k("debugging.buildCancelled","Build cancelled by user"),logs:[...S.logs||[],`[Build] ${k("debugging.buildCancelled","Build cancelled by user")}.`]})),J(k("debugging.buildCancelled","Build cancelled"))},Le=`http://${Y}:${$}/${De.replace(/^\/+/,"")}`,N=V.status==="running";return<Te style={t.scrollArea}contentContainerStyle={t.scrollContent}showsVerticalScrollIndicator={!1}>
4
-
5
- <T style={t.heroCard}>
6
- <T style={t.heroHeader}>
7
- <T style={t.heroIconWrap}>
8
- <Ue size={20}color={e.white}/>
9
- </T>
10
- <T style={{flex:1,minWidth:0}}>
11
- <C style={t.heroTitle}numberOfLines={1}>
12
- {k("debugging.apkInstallerTitle","Multi-Device APK Installer")}
13
- </C>
14
- <C style={t.heroSubtitle}numberOfLines={1}>
15
- {k("debugging.apkInstallerSubtitle","Scan QR code with another Android device to download")}
16
- </C>
17
- </T>
18
- <T style={t.heroBadge}>
19
- <T style={t.pulseDot}/>
20
- <C style={t.heroBadgeText}>{k("debugging.liveMetro","Live Metro")}</C>
21
- </T>
22
- </T>
23
-
24
-
25
- <T style={t.heroMetricsStrip}>
26
- <T style={t.heroMetricItem}>
27
- <C style={t.heroMetricLabel}>HOST IP</C>
28
- <C style={t.heroMetricValue}numberOfLines={1}>
29
- {Y}
30
- </C>
31
- </T>
32
- <T style={t.heroMetricDivider}/>
33
- <T style={t.heroMetricItem}>
34
- <C style={t.heroMetricLabel}>PORT</C>
35
- <C style={t.heroMetricValue}>{$}</C>
36
- </T>
37
- <T style={t.heroMetricDivider}/>
38
- <T style={t.heroMetricItem}>
39
- <C style={t.heroMetricLabel}>APK SIZE</C>
40
- <C style={[t.heroMetricValue,{color:q?e.emerald500:e.grayTextWeak}]}>
41
- {q?`${q} MB`:"Detected"}
42
- </C>
43
- </T>
44
- <T style={t.heroMetricDivider}/>
45
- <T style={t.heroMetricItem}>
46
- <C style={t.heroMetricLabel}>STATUS</C>
47
- <C style={[t.heroMetricValue,{color:e.emerald500}]}>
48
- Ready
49
- </C>
50
- </T>
51
- </T>
52
- </T>
53
-
54
-
55
- <T style={t.sectionCard}>
56
- <T style={t.sectionHeaderRow}>
57
- <C style={t.sectionTitle}>{k("debugging.qrCodeTitle","QR CODE & DIRECT DOWNLOAD")}</C>
58
- <G activeOpacity={.7}onPress={E}style={t.refreshBtn}>
59
- <_e size={12}color={e.purple}/>
60
- <C style={t.refreshBtnText}>Refresh</C>
61
- </G>
62
- </T>
63
-
64
-
65
- <T style={t.qrCenteredWrapper}>
66
- <T style={t.qrInnerFrame}>
67
- <Ne value={Le}size={235}color={e.primaryBlack}backgroundColor={e.white}/>
68
- </T>
69
- </T>
70
- </T>
71
-
72
-
73
- <T style={t.sectionCard}>
74
- <T style={t.sectionHeaderRow}>
75
- <T style={{flexDirection:"row",alignItems:"center",gap:6}}>
76
- <Re size={13}color={e.purple}/>
77
- <C style={t.sectionTitle}>{k("debugging.buildGeneratorTitle","BUILD GENERATOR (GRADLE)")}</C>
78
- </T>
79
- {V.status==="completed"&&<T style={t.completedBadge}>
80
- <Be size={10}color={e.emerald500}/>
81
- <C style={t.completedBadgeText}>{k("debugging.ready100","100% Ready")}</C>
82
- </T>}
83
- </T>
84
-
85
-
86
- <T style={t.subTabStrip}>
87
- <G disabled={N}activeOpacity={.7}onPress={()=>{H("light"),oe("assembleRelease")}}style={[t.subTabItem,O==="assembleRelease"&&t.subTabItemActive]}>
88
- <T style={{flexDirection:"row",alignItems:"center",gap:5}}>
89
- <Re size={12}color={O==="assembleRelease"?e.white:e.grayText}/>
90
- <C style={[t.subTabText,O==="assembleRelease"&&t.subTabTextActive]}>
91
- {k("debugging.releaseBuild","Release (assembleRelease)")}
92
- </C>
93
- </T>
94
- </G>
95
-
96
- <G disabled={N}activeOpacity={.7}onPress={()=>{H("light"),oe("assembleDebug")}}style={[t.subTabItem,O==="assembleDebug"&&t.subTabItemActive]}>
97
- <T style={{flexDirection:"row",alignItems:"center",gap:5}}>
98
- <Ke size={12}color={O==="assembleDebug"?e.white:e.grayText}/>
99
- <C style={[t.subTabText,O==="assembleDebug"&&t.subTabTextActive]}>
100
- {k("debugging.debugBuild","Debug (assembleDebug)")}
101
- </C>
102
- </T>
103
- </G>
104
- </T>
105
-
106
-
107
- <G disabled={N}activeOpacity={.7}onPress={()=>{H("light"),ve(!W)}}style={t.cleanRow}>
108
- <T style={[t.checkboxBox,W&&t.checkboxBoxActive]}>
109
- {W&&<Be size={11}color={e.white}/>}
110
- </T>
111
- <C style={t.cleanLabel}>
112
- Clean build cache <C style={t.cleanCode}>{k("debugging.cleanBuild","(./gradlew clean)")}</C>
113
- </C>
114
- </G>
115
-
116
-
117
- {N&&<T style={t.progressContainer}>
118
- <T style={t.progressTopRow}>
119
- <T style={t.progressTaskGroup}>
120
- <Ce size="small"color={e.purple}/>
121
- <C style={t.progressTaskText}numberOfLines={1}>
122
- {V.currentTask||"Executing Gradle tasks..."}
123
- </C>
124
- </T>
125
- <C style={t.progressPercentageText}>
126
- {V.progress}%
127
- </C>
128
- </T>
129
-
130
-
131
- <T style={t.progressBarTrack}>
132
- <Z.View style={[t.progressBarFill,{width:K.interpolate({inputRange:[0,100],outputRange:["5%","100%"]})}]}/>
133
- </T>
134
- </T>}
135
-
136
-
137
- {V.status==="failed"&&<T style={t.errorContainer}>
138
- <Ie size={13}color={e.errorColor}/>
139
- <C style={t.errorText}numberOfLines={2}>
140
- {V.error||"Build execution failed."}
141
- </C>
142
- </T>}
143
-
144
-
145
- {(V.logs&&V.logs.length>0||N)&&<T style={t.consoleContainer}>
146
- <T style={t.consoleHeaderRow}>
147
- <T style={{flexDirection:"row",alignItems:"center",gap:6}}>
148
- <Ze color={e.sky400}size={12}/>
149
- <C style={t.consoleHeaderTitle}>{k("debugging.gradleVerboseOutput","GRADLE VERBOSE OUTPUT")}</C>
150
- </T>
151
- <G activeOpacity={.7}onPress={()=>Ae(!Q)}style={t.consoleToggleBtn}>
152
- <C style={t.consoleToggleText}>
153
- {Q?"Hide Console":"Show Console"}
154
- </C>
155
- </G>
156
- </T>
157
-
158
- {Q&&<Te ref={re}style={t.consoleLogBox}contentContainerStyle={t.consoleLogContent}nestedScrollEnabled showsVerticalScrollIndicator>
159
- {V.logs&&V.logs.length>0?V.logs.map((R,z)=>{let S=e.slate400;return R.startsWith("> Task :")?S=e.sky400:R.includes("BUILD SUCCESSFUL")?S=e.buildSuccessGreen:R.includes("FAILURE")||R.includes("error:")?S=e.buildFailureRed:R.includes("UP-TO-DATE")&&(S=e.purple400),<C key={z}style={[t.consoleLogLine,{color:S}]}>
160
- {R}
161
- </C>}):<C style={t.consoleLogPlaceholder}>
162
- {k("debugging.waitingForGradle","Waiting for Gradle daemon output...")}
163
- </C>}
164
- </Te>}
165
- </T>}
166
-
167
-
168
- {N?<T style={t.buildingActionsRow}>
169
- <T style={t.buildingStatusPill}>
170
- <Ce size="small"color={e.purple}/>
171
- <C style={t.buildingStatusPillText}numberOfLines={1}>
172
- Building ({V.progress}%)
173
- </C>
174
- </T>
175
-
176
- <Se onPress={Me}style={t.stopBtn}>
177
- <Ie size={13}color={e.white}/>
178
- <C style={t.stopBtnText}>{k("debugging.stopBuild","Stop Build")}</C>
179
- </Se>
180
- </T>:<Se onPress={Oe}style={t.generateBtn}>
181
- <T style={t.ctaContentRow}>
182
- <Ge size={14}color={e.white}/>
183
- <C style={t.generateBtnText}>
184
- {W?"Clean & Generate Build":"Generate Build"}
185
- </C>
186
- </T>
187
- </Se>}
188
- </T>
189
-
190
-
191
- <T style={t.footerNoteRow}>
192
- <Ee size={13}color={e.grayTextWeak}/>
193
- <C style={t.footerNoteText}>
194
- {k("debugging.sameWifiNote","Ensure both Android devices are connected to the same Wi-Fi network.")}
195
- </C>
196
- </T>
197
- </Te>};const t=Pe.create({scrollArea:{flex:1,backgroundColor:e.contentBg},scrollContent:{padding:12,gap:12,paddingBottom:100},heroCard:{backgroundColor:e.primaryLight,borderRadius:14,borderWidth:1,borderColor:e.grayBorderSecondary,padding:14,shadowColor:e.black,shadowOpacity:.04,shadowRadius:4,shadowOffset:{width:0,height:2},elevation:1,gap:12},heroHeader:{flexDirection:"row",alignItems:"center",gap:10},heroIconWrap:{width:38,height:38,borderRadius:10,backgroundColor:e.purple,alignItems:"center",justifyContent:"center",shadowColor:e.purple,shadowOpacity:.25,shadowRadius:4,shadowOffset:{width:0,height:2},elevation:2},heroTitle:{fontFamily:B.interBold,fontSize:15,color:e.primaryBlack,letterSpacing:-.2},heroSubtitle:{fontFamily:B.interRegular,fontSize:11.5,color:e.grayText,marginTop:1},heroBadge:{flexDirection:"row",alignItems:"center",gap:4,backgroundColor:`${e.emerald500}18`,paddingHorizontal:7,paddingVertical:3,borderRadius:6},pulseDot:{width:6,height:6,borderRadius:3,backgroundColor:e.emerald500},heroBadgeText:{fontFamily:B.interBold,fontSize:9.5,color:e.emerald500},heroMetricsStrip:{flexDirection:"row",alignItems:"center",backgroundColor:e.grayBackground,borderRadius:10,paddingVertical:8,paddingHorizontal:10},heroMetricItem:{flex:1,alignItems:"center",paddingHorizontal:2,minWidth:0},heroMetricLabel:{fontFamily:B.interBold,fontSize:8.5,color:e.grayTextWeak,letterSpacing:.4},heroMetricValue:{fontFamily:B.interBold,fontSize:11,color:e.primaryBlack,marginTop:2},heroMetricDivider:{width:1,height:20,backgroundColor:e.dividerColor},sectionCard:{backgroundColor:e.primaryLight,borderRadius:14,borderWidth:1,borderColor:e.grayBorderSecondary,padding:14,shadowColor:e.black,shadowOpacity:.03,shadowRadius:3,shadowOffset:{width:0,height:1},elevation:1,gap:12},sectionHeaderRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-between"},sectionTitle:{fontFamily:B.interBold,fontSize:10.5,color:e.grayTextWeak,letterSpacing:.8,textTransform:"uppercase"},refreshBtn:{flexDirection:"row",alignItems:"center",gap:4,paddingHorizontal:7,paddingVertical:3,borderRadius:6,backgroundColor:`${e.purple}12`},refreshBtnText:{fontFamily:B.interBold,fontSize:10,color:e.purple},qrCenteredWrapper:{alignItems:"center",justifyContent:"center",backgroundColor:e.grayBackground,padding:12,borderRadius:12,borderWidth:1,borderColor:e.grayBorderSecondary},qrInnerFrame:{backgroundColor:e.white,padding:6,borderRadius:8},urlBox:{flexDirection:"row",alignItems:"center",backgroundColor:e.grayBackground,borderRadius:10,paddingLeft:10,paddingRight:6,paddingVertical:6,borderWidth:1,borderColor:e.grayBorderSecondary,gap:8},urlText:{flex:1,fontFamily:B.interMedium,fontSize:11.5,color:e.skyBlue},actionsRow:{flexDirection:"row",gap:10},actionBtnSecondary:{flex:1,flexDirection:"row",alignItems:"center",justifyContent:"center",gap:6,paddingVertical:9,borderRadius:10,borderWidth:1,borderColor:e.grayBorderSecondary,backgroundColor:e.grayBackground},actionBtnSecondaryText:{fontFamily:B.interBold,fontSize:12,color:e.grayTextStrong},actionBtnPrimary:{flex:1,flexDirection:"row",alignItems:"center",justifyContent:"center",gap:6,paddingVertical:9,borderRadius:10,backgroundColor:e.purple,shadowColor:e.purple,shadowOpacity:.25,shadowRadius:4,shadowOffset:{width:0,height:2},elevation:2},actionBtnPrimaryText:{fontFamily:B.interBold,fontSize:12,color:e.white},completedBadge:{flexDirection:"row",alignItems:"center",gap:3,backgroundColor:`${e.emerald500}18`,paddingHorizontal:6,paddingVertical:2,borderRadius:5},completedBadgeText:{fontFamily:B.interBold,fontSize:9.5,color:e.emerald500},subTabStrip:{flexDirection:"row",backgroundColor:e.grayBackground,borderRadius:8,padding:2,borderWidth:1,borderColor:e.grayBorderSecondary},subTabItem:{flex:1,paddingVertical:7,borderRadius:6,alignItems:"center",justifyContent:"center"},subTabItemActive:{backgroundColor:e.purple,shadowColor:e.purple,shadowOpacity:.2,shadowRadius:3,shadowOffset:{width:0,height:1},elevation:1},subTabText:{fontFamily:B.interMedium,fontSize:11,color:e.grayText},subTabTextActive:{fontFamily:B.interBold,color:e.white},cleanRow:{flexDirection:"row",alignItems:"center",gap:8,paddingVertical:2},checkboxBox:{width:18,height:18,borderRadius:4,borderWidth:1.5,borderColor:e.grayBorderSecondary,backgroundColor:e.grayBackground,alignItems:"center",justifyContent:"center"},checkboxBoxActive:{backgroundColor:e.purple,borderColor:e.purple},cleanLabel:{fontFamily:B.interMedium,fontSize:11.5,color:e.grayTextStrong},cleanCode:{fontFamily:B.interRegular,color:e.grayTextWeak,fontSize:10.5},progressContainer:{backgroundColor:e.grayBackground,borderRadius:10,padding:10,gap:6,borderWidth:1,borderColor:e.grayBorderSecondary},progressTopRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-between"},progressTaskGroup:{flexDirection:"row",alignItems:"center",gap:6,flex:1,paddingRight:8},progressTaskText:{fontFamily:B.interMedium,fontSize:11,color:e.primaryBlack,flex:1},progressPercentageText:{fontFamily:B.interBold,fontSize:11.5,color:e.purple},progressBarTrack:{width:"100%",height:6,borderRadius:3,backgroundColor:e.grayBorderSecondary,overflow:"hidden"},progressBarFill:{height:"100%",backgroundColor:e.purple,borderRadius:3},errorContainer:{flexDirection:"row",alignItems:"center",gap:6,backgroundColor:`${e.errorColor}12`,padding:8,borderRadius:8,borderWidth:1,borderColor:`${e.errorColor}25`},errorText:{fontFamily:B.interRegular,fontSize:11,color:e.errorColor,flex:1},consoleContainer:{backgroundColor:e.slate900,borderRadius:10,borderWidth:1,borderColor:e.slate800,overflow:"hidden",marginTop:4},consoleHeaderRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",backgroundColor:e.slate800,paddingHorizontal:10,paddingVertical:6},consoleHeaderTitle:{fontFamily:B.interBold,fontSize:10,color:e.sky400,letterSpacing:.5},consoleToggleBtn:{paddingHorizontal:6,paddingVertical:2,borderRadius:4,backgroundColor:"rgba(255,255,255,0.1)"},consoleToggleText:{fontFamily:B.interMedium,fontSize:9.5,color:e.slate400},consoleLogBox:{maxHeight:140,paddingHorizontal:10,paddingVertical:8},consoleLogContent:{gap:3},consoleLogLine:{fontFamily:B.interRegular,fontSize:10,lineHeight:14},consoleLogPlaceholder:{fontFamily:B.interRegular,fontSize:10,color:e.slate500,fontStyle:"italic"},generateBtn:{backgroundColor:e.purple,borderRadius:10,paddingVertical:10,alignItems:"center",justifyContent:"center",shadowColor:e.purple,shadowOpacity:.25,shadowRadius:4,shadowOffset:{width:0,height:2},elevation:2},generateBtnDisabled:{opacity:.7},buildingActionsRow:{flexDirection:"row",alignItems:"center",gap:10},buildingStatusPill:{flex:1,flexDirection:"row",alignItems:"center",justifyContent:"center",gap:8,backgroundColor:`${e.purple}14`,borderRadius:10,paddingVertical:10,borderWidth:1,borderColor:`${e.purple}30`},buildingStatusPillText:{fontFamily:B.interBold,fontSize:12,color:e.purple},stopBtn:{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:6,backgroundColor:e.errorColor,borderRadius:10,paddingHorizontal:16,paddingVertical:10,shadowColor:e.errorColor,shadowOpacity:.25,shadowRadius:4,shadowOffset:{width:0,height:2},elevation:2},stopBtnText:{fontFamily:B.interBold,fontSize:12,color:e.white},ctaContentRow:{flexDirection:"row",alignItems:"center",gap:6},generateBtnText:{fontFamily:B.interBold,fontSize:12.5,color:e.white},footerNoteRow:{flexDirection:"row",alignItems:"center",gap:6,paddingHorizontal:8},footerNoteText:{fontFamily:B.interRegular,fontSize:11,color:e.grayTextWeak,textAlign:"center",flex:1}});export default DebuggingTab;
@@ -1,7 +0,0 @@
1
- import React from 'react';
2
- import { A11yAuditResult } from '../../types';
3
- interface UiA11yAuditPanelProps {
4
- a11y: A11yAuditResult;
5
- }
6
- export declare const UiA11yAuditPanel: React.FC<UiA11yAuditPanelProps>;
7
- export {};
@@ -1,97 +0,0 @@
1
- import"react";import{StyleSheet as L,Text as T,View as S}from"react-native";import{AppColors as f}from"../../styles/AppColors";import{AppFonts as x}from"../../styles/AppFonts";import{AccessibilityIcon as H,AlertTriangleIcon as P}from"../NetworkIcons";export const UiA11yAuditPanel=({a11y:W})=>{const{hasValidTouchTarget:C,touchTargetWidth:R,touchTargetHeight:k,recommendedMinSize:h,contrastRatio:p,contrastScore:A,textColor:D,backgroundColor:V,hasAccessibilityLabel:w,accessibilityRole:B,accessibilityHint:z,issues:F}=W;return<S style={e.container}>
2
-
3
- <S style={e.card}>
4
- <S style={e.cardHeader}>
5
- <S style={e.cardTitleRow}>
6
- <H color={f.brandPurple}size={18}/>
7
- <T style={e.cardTitle}>Touch Target Size</T>
8
- </S>
9
- <S style={[e.badge,C?e.badgeSuccess:e.badgeWarning]}>
10
- <T style={[e.badgeText,C?e.badgeTextSuccess:e.badgeTextWarning]}>
11
- {C?"COMPLIANT":"SUB-OPTIMAL"}
12
- </T>
13
- </S>
14
- </S>
15
-
16
- <S style={e.metricRow}>
17
- <S style={e.metricItem}>
18
- <T style={e.metricLabel}>Actual Size</T>
19
- <T style={e.metricValue}>
20
- {Math.round(R)} × {Math.round(k)} pt
21
- </T>
22
- </S>
23
- <S style={e.metricItem}>
24
- <T style={e.metricLabel}>Target Guideline</T>
25
- <T style={e.metricValue}>
26
- ≥ {h} × {h} pt
27
- </T>
28
- </S>
29
- </S>
30
- </S>
31
-
32
-
33
- <S style={e.card}>
34
- <S style={e.cardHeader}>
35
- <S style={e.cardTitleRow}>
36
- <T style={e.cardTitle}>WCAG Color Contrast</T>
37
- </S>
38
- <S style={[e.badge,A==="AAA"||A==="AA"?e.badgeSuccess:A==="Fail"?e.badgeError:e.badgeNeutral]}>
39
- <T style={[e.badgeText,A==="AAA"||A==="AA"?e.badgeTextSuccess:A==="Fail"?e.badgeTextError:e.badgeTextNeutral]}>
40
- {A==="N/A"?"NOT APPLICABLE":`WCAG ${A}`}
41
- </T>
42
- </S>
43
- </S>
44
-
45
- {p!==void 0?<S style={e.contrastPreview}>
46
- <S style={[e.contrastSwatch,{backgroundColor:V||"#FFFFFF"}]}>
47
- <T style={[e.contrastSampleText,{color:D||"#000000"}]}>
48
- Sample Text
49
- </T>
50
- </S>
51
- <S style={e.contrastDetails}>
52
- <T style={e.contrastRatioValue}>{p}:1</T>
53
- <T style={e.contrastSubtext}>
54
- {p>=7?"Passes AAA (Enhanced Contrast)":p>=4.5?"Passes AA (Minimum Standard)":"Fails AA (Low Contrast Warning)"}
55
- </T>
56
- </S>
57
- </S>:<T style={e.naSubtext}>
58
- Text or background color is transparent or dynamically inherited.
59
- </T>}
60
- </S>
61
-
62
-
63
- <S style={e.card}>
64
- <T style={[e.cardTitle,{marginBottom:10}]}>Accessibility Attributes</T>
65
-
66
- <S style={e.attributeRow}>
67
- <T style={e.attributeLabel}>accessibilityLabel:</T>
68
- <T style={[e.attributeValue,!w&&{color:f.grayTextWeak,fontStyle:"italic"}]}>
69
- {w?"Provided":"None specified"}
70
- </T>
71
- </S>
72
-
73
- <S style={e.attributeRow}>
74
- <T style={e.attributeLabel}>accessibilityRole:</T>
75
- <T style={[e.attributeValue,!B&&{color:f.grayTextWeak,fontStyle:"italic"}]}>
76
- {B||"None"}
77
- </T>
78
- </S>
79
-
80
- {z&&<S style={e.attributeRow}>
81
- <T style={e.attributeLabel}>accessibilityHint:</T>
82
- <T style={e.attributeValue}>{z}</T>
83
- </S>}
84
- </S>
85
-
86
-
87
- {F.length>0&&<S style={[e.card,e.issuesCard]}>
88
- <S style={e.issuesHeader}>
89
- <P color="#D97706"size={16}/>
90
- <T style={e.issuesTitle}>Recommendations ({F.length})</T>
91
- </S>
92
- {F.map((I,E)=><S key={E}style={e.issueItem}>
93
- <T style={e.issueBullet}>•</T>
94
- <T style={e.issueText}>{I}</T>
95
- </S>)}
96
- </S>}
97
- </S>};const e=L.create({container:{gap:10,paddingVertical:4},card:{backgroundColor:f.white,borderRadius:12,padding:14,borderWidth:1,borderColor:f.grayBorderSecondary},cardHeader:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",marginBottom:10},cardTitleRow:{flexDirection:"row",alignItems:"center",gap:8},cardTitle:{fontSize:14,fontFamily:x.semiBold,color:f.slate900},badge:{paddingHorizontal:8,paddingVertical:3,borderRadius:6},badgeSuccess:{backgroundColor:"#10B9811A",borderColor:"#10B98144",borderWidth:1},badgeWarning:{backgroundColor:"#F59E0B1A",borderColor:"#F59E0B44",borderWidth:1},badgeError:{backgroundColor:"#E11D481A",borderColor:"#E11D4844",borderWidth:1},badgeNeutral:{backgroundColor:f.slate100},badgeText:{fontSize:10,fontFamily:x.bold},badgeTextSuccess:{color:"#059669"},badgeTextWarning:{color:"#D97706"},badgeTextError:{color:"#E11D48"},badgeTextNeutral:{color:f.slate600},metricRow:{flexDirection:"row",gap:16},metricItem:{flex:1,backgroundColor:f.slate50,padding:10,borderRadius:8},metricLabel:{fontSize:11,fontFamily:x.medium,color:f.grayTextWeak,marginBottom:4},metricValue:{fontSize:13,fontFamily:x.semiBold,color:f.slate900},contrastPreview:{flexDirection:"row",alignItems:"center",gap:12},contrastSwatch:{paddingVertical:12,paddingHorizontal:16,borderRadius:8,borderWidth:1,borderColor:f.grayBorderSecondary},contrastSampleText:{fontSize:13,fontFamily:x.semiBold},contrastDetails:{flex:1},contrastRatioValue:{fontSize:16,fontFamily:x.bold,color:f.slate900},contrastSubtext:{fontSize:11,fontFamily:x.medium,color:f.grayTextWeak,marginTop:2},naSubtext:{fontSize:12,fontFamily:x.medium,color:f.grayTextWeak},attributeRow:{flexDirection:"row",justifyContent:"space-between",paddingVertical:6,borderBottomWidth:1,borderBottomColor:f.slate100},attributeLabel:{fontSize:12,fontFamily:x.medium,color:f.slate600},attributeValue:{fontSize:12,fontFamily:x.semiBold,color:f.slate900},issuesCard:{backgroundColor:"#FEF3C722",borderColor:"#F59E0B44"},issuesHeader:{flexDirection:"row",alignItems:"center",gap:6,marginBottom:8},issuesTitle:{fontSize:13,fontFamily:x.semiBold,color:"#D97706"},issueItem:{flexDirection:"row",alignItems:"flex-start",gap:6,marginVertical:3},issueBullet:{fontSize:12,color:"#D97706"},issueText:{fontSize:12,fontFamily:x.medium,color:f.slate700,flex:1,lineHeight:16}});
@@ -1,2 +0,0 @@
1
- import React from 'react';
2
- export declare const UiInspectorDetail: React.FC;