react-native-inapp-inspector 2.4.1 → 2.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (295) hide show
  1. package/README.ar.md +163 -0
  2. package/README.de.md +163 -0
  3. package/README.es.md +164 -0
  4. package/README.fr.md +163 -0
  5. package/README.hi.md +163 -0
  6. package/README.ja.md +180 -0
  7. package/README.ko.md +163 -0
  8. package/README.md +340 -243
  9. package/README.pt-BR.md +163 -0
  10. package/README.ru.md +163 -0
  11. package/README.zh-CN.md +387 -0
  12. package/android/src/main/java/com/inappinspector/NetworkInspectorModule.kt +605 -23
  13. package/assets/banner_dark.svg +186 -0
  14. package/assets/banner_light.svg +186 -0
  15. package/assets/icon_circle.svg +148 -0
  16. package/assets/icon_square.svg +369 -0
  17. package/assets/inapp_inspector_icon.gif +0 -0
  18. package/assets/inapp_inspector_icon_original.gif +0 -0
  19. package/assets/social_preview.png +0 -0
  20. package/assets/walkthrough.gif +0 -0
  21. package/dist/commonjs/capture.d.ts +2 -0
  22. package/dist/commonjs/capture.js +1 -1
  23. package/dist/commonjs/components/AnalyticsDetail.js +23 -23
  24. package/dist/commonjs/components/AnalyticsEventCard.js +1 -1
  25. package/dist/commonjs/components/AnalyticsGraph.js +44 -44
  26. package/dist/commonjs/components/AnimatedBrandOwl.d.ts +7 -0
  27. package/dist/commonjs/components/AnimatedBrandOwl.js +175 -0
  28. package/dist/commonjs/components/AppHeaderLogo.d.ts +1 -0
  29. package/dist/commonjs/components/AppHeaderLogo.js +5 -3
  30. package/dist/commonjs/components/BrandCircleIcon.js +28 -28
  31. package/dist/commonjs/components/BrandSquareIcon.d.ts +5 -0
  32. package/dist/commonjs/components/BrandSquareIcon.js +139 -0
  33. package/dist/commonjs/components/ConsoleLogCard.d.ts +2 -1
  34. package/dist/commonjs/components/ConsoleLogCard.js +23 -39
  35. package/dist/commonjs/components/Inspector/AboutModal.js +44 -54
  36. package/dist/commonjs/components/Inspector/AnalyticsTab.js +6 -6
  37. package/dist/commonjs/components/Inspector/ConfirmationModal.d.ts +13 -0
  38. package/dist/commonjs/components/Inspector/ConfirmationModal.js +30 -0
  39. package/dist/commonjs/components/Inspector/ConsoleTab.js +12 -12
  40. package/dist/commonjs/components/Inspector/CrashTab.js +44 -9
  41. package/dist/commonjs/components/Inspector/DebuggingTab.js +17 -17
  42. package/dist/commonjs/components/Inspector/DeviceInfoTab.js +1 -1
  43. package/dist/commonjs/components/Inspector/FabLauncher.js +30 -33
  44. package/dist/commonjs/components/Inspector/FeatureUnderDevNotice.js +2 -2
  45. package/dist/commonjs/components/Inspector/FloatingCaptureWidget.d.ts +3 -0
  46. package/dist/commonjs/components/Inspector/FloatingCaptureWidget.js +54 -0
  47. package/dist/commonjs/components/Inspector/GlobalCrashScreenModal.d.ts +11 -0
  48. package/dist/commonjs/components/Inspector/GlobalCrashScreenModal.js +234 -0
  49. package/dist/commonjs/components/Inspector/InspectorHeader.js +137 -127
  50. package/dist/commonjs/components/Inspector/LanguageSelectorModal.d.ts +15 -0
  51. package/dist/commonjs/components/Inspector/LanguageSelectorModal.js +172 -0
  52. package/dist/commonjs/components/Inspector/MainScreen.js +55 -35
  53. package/dist/commonjs/components/Inspector/MediaGalleryTab.js +40 -35
  54. package/dist/commonjs/components/Inspector/MediaPreviewModal.d.ts +36 -0
  55. package/dist/commonjs/components/Inspector/MediaPreviewModal.js +341 -135
  56. package/dist/commonjs/components/Inspector/NetworkTab.js +50 -50
  57. package/dist/commonjs/components/Inspector/NpmUpdateToast.js +1 -1
  58. package/dist/commonjs/components/Inspector/PushCard.d.ts +3 -2
  59. package/dist/commonjs/components/Inspector/PushCard.js +5 -4
  60. package/dist/commonjs/components/Inspector/PushDetail.js +41 -32
  61. package/dist/commonjs/components/Inspector/PushTab.js +12 -12
  62. package/dist/commonjs/components/Inspector/ReduxDetail.js +32 -32
  63. package/dist/commonjs/components/Inspector/ReduxTab.js +10 -8
  64. package/dist/commonjs/components/Inspector/SecondaryTelemetryStrip.d.ts +2 -0
  65. package/dist/commonjs/components/Inspector/SecondaryTelemetryStrip.js +43 -0
  66. package/dist/commonjs/components/Inspector/SettingsPanel.js +287 -139
  67. package/dist/commonjs/components/Inspector/SocketCard.d.ts +5 -0
  68. package/dist/commonjs/components/Inspector/SocketCard.js +116 -0
  69. package/dist/commonjs/components/Inspector/SocketDetail.d.ts +4 -0
  70. package/dist/commonjs/components/Inspector/SocketDetail.js +327 -0
  71. package/dist/commonjs/components/Inspector/SocketFilterModal.d.ts +13 -0
  72. package/dist/commonjs/components/Inspector/SocketFilterModal.js +69 -0
  73. package/dist/commonjs/components/Inspector/SocketTab.d.ts +3 -0
  74. package/dist/commonjs/components/Inspector/SocketTab.js +112 -0
  75. package/dist/commonjs/components/Inspector/StorageTab.js +39 -37
  76. package/dist/commonjs/components/Inspector/SupportModal.d.ts +7 -0
  77. package/dist/commonjs/components/Inspector/SupportModal.js +125 -0
  78. package/dist/commonjs/components/Inspector/SupportPage.d.ts +5 -0
  79. package/dist/commonjs/components/Inspector/SupportPage.js +227 -0
  80. package/dist/commonjs/components/Inspector/TabBar.js +24 -23
  81. package/dist/commonjs/components/Inspector/UpdateAvailableModal.js +24 -24
  82. package/dist/commonjs/components/JsonViewer.js +50 -48
  83. package/dist/commonjs/components/LogCard.d.ts +3 -2
  84. package/dist/commonjs/components/LogCard.js +27 -25
  85. package/dist/commonjs/components/LogSyntaxHighlighter.js +5 -5
  86. package/dist/commonjs/components/ModuleErrorBoundary.js +5 -5
  87. package/dist/commonjs/components/NetworkIcons.d.ts +42 -0
  88. package/dist/commonjs/components/NetworkIcons.js +139 -6
  89. package/dist/commonjs/components/SegmentedTabs.js +1 -1
  90. package/dist/commonjs/constants/version.d.ts +1 -1
  91. package/dist/commonjs/constants/version.js +1 -1
  92. package/dist/commonjs/crash.d.ts +1 -1
  93. package/dist/commonjs/crash.js +1 -1
  94. package/dist/commonjs/customHooks/crashHandler.d.ts +2 -1
  95. package/dist/commonjs/customHooks/crashHandler.js +7 -7
  96. package/dist/commonjs/customHooks/socketLogger.d.ts +26 -0
  97. package/dist/commonjs/customHooks/socketLogger.js +2 -0
  98. package/dist/commonjs/editor.d.ts +13 -0
  99. package/dist/commonjs/editor.js +1 -0
  100. package/dist/commonjs/helpers/index.d.ts +1 -0
  101. package/dist/commonjs/helpers/index.js +3 -3
  102. package/dist/commonjs/helpers/memoryManager.d.ts +1 -0
  103. package/dist/commonjs/helpers/memoryManager.js +1 -1
  104. package/dist/commonjs/helpers/searchQueryParser.d.ts +1 -1
  105. package/dist/commonjs/helpers/searchQueryParser.js +5 -1
  106. package/dist/commonjs/helpers/settingsStore.d.ts +1 -0
  107. package/dist/commonjs/helpers/settingsStore.js +1 -1
  108. package/dist/commonjs/helpers/shareFormatter.d.ts +3 -1
  109. package/dist/commonjs/helpers/shareFormatter.js +8 -7
  110. package/dist/commonjs/helpers/telemetry.js +1 -1
  111. package/dist/commonjs/i18n/index.d.ts +99 -1
  112. package/dist/commonjs/i18n/index.js +1 -1
  113. package/dist/commonjs/i18n/locales/ar.json +1 -1
  114. package/dist/commonjs/i18n/locales/bn.json +1 -0
  115. package/dist/commonjs/i18n/locales/de.json +1 -1
  116. package/dist/commonjs/i18n/locales/en.json +1 -1
  117. package/dist/commonjs/i18n/locales/es.json +1 -1
  118. package/dist/commonjs/i18n/locales/fr.json +1 -1
  119. package/dist/commonjs/i18n/locales/gu.json +1 -0
  120. package/dist/commonjs/i18n/locales/hi.json +1 -1
  121. package/dist/commonjs/i18n/locales/id.json +1 -0
  122. package/dist/commonjs/i18n/locales/it.json +1 -0
  123. package/dist/commonjs/i18n/locales/ja.json +1 -1
  124. package/dist/commonjs/i18n/locales/kn.json +1 -0
  125. package/dist/commonjs/i18n/locales/ko.json +1 -1
  126. package/dist/commonjs/i18n/locales/ml.json +1 -0
  127. package/dist/commonjs/i18n/locales/mr.json +1 -0
  128. package/dist/commonjs/i18n/locales/nl.json +1 -0
  129. package/dist/commonjs/i18n/locales/pa.json +1 -0
  130. package/dist/commonjs/i18n/locales/pl.json +1 -0
  131. package/dist/commonjs/i18n/locales/pt.json +1 -1
  132. package/dist/commonjs/i18n/locales/ru.json +1 -1
  133. package/dist/commonjs/i18n/locales/ta.json +1 -0
  134. package/dist/commonjs/i18n/locales/te.json +1 -0
  135. package/dist/commonjs/i18n/locales/tr.json +1 -0
  136. package/dist/commonjs/i18n/locales/vi.json +1 -0
  137. package/dist/commonjs/i18n/locales/zh.json +1 -1
  138. package/dist/commonjs/index.d.ts +16 -13
  139. package/dist/commonjs/index.js +5 -4
  140. package/dist/commonjs/native/NativeInspector.d.ts +4 -0
  141. package/dist/commonjs/native/NativeInspector.js +1 -1
  142. package/dist/commonjs/native/NativeNetworkInspector.d.ts +4 -0
  143. package/dist/commonjs/socket.d.ts +4 -0
  144. package/dist/commonjs/socket.js +1 -0
  145. package/dist/commonjs/styles/AppColors.d.ts +42 -2
  146. package/dist/commonjs/styles/AppColors.js +1 -1
  147. package/dist/commonjs/styles/common.js +1 -1
  148. package/dist/commonjs/styles/index.d.ts +30 -0
  149. package/dist/commonjs/styles/index.js +1 -1
  150. package/dist/commonjs/types/editor.d.ts +96 -0
  151. package/dist/commonjs/types/editor.js +1 -0
  152. package/dist/commonjs/types/enums.d.ts +40 -0
  153. package/dist/commonjs/types/enums.js +1 -1
  154. package/dist/commonjs/types/interfaces.d.ts +143 -1
  155. package/dist/esm/capture.d.ts +2 -0
  156. package/dist/esm/capture.js +1 -1
  157. package/dist/esm/components/AnalyticsDetail.js +31 -31
  158. package/dist/esm/components/AnalyticsEventCard.js +1 -1
  159. package/dist/esm/components/AnalyticsGraph.js +74 -74
  160. package/dist/esm/components/AnimatedBrandOwl.d.ts +7 -0
  161. package/dist/esm/components/AnimatedBrandOwl.js +175 -0
  162. package/dist/esm/components/AppHeaderLogo.d.ts +1 -0
  163. package/dist/esm/components/AppHeaderLogo.js +7 -5
  164. package/dist/esm/components/BrandCircleIcon.js +70 -70
  165. package/dist/esm/components/BrandSquareIcon.d.ts +5 -0
  166. package/dist/esm/components/BrandSquareIcon.js +139 -0
  167. package/dist/esm/components/ConsoleLogCard.d.ts +2 -1
  168. package/dist/esm/components/ConsoleLogCard.js +61 -77
  169. package/dist/esm/components/Inspector/AboutModal.js +85 -95
  170. package/dist/esm/components/Inspector/AnalyticsTab.js +24 -24
  171. package/dist/esm/components/Inspector/ConfirmationModal.d.ts +13 -0
  172. package/dist/esm/components/Inspector/ConfirmationModal.js +30 -0
  173. package/dist/esm/components/Inspector/ConsoleTab.js +48 -48
  174. package/dist/esm/components/Inspector/CrashTab.js +203 -168
  175. package/dist/esm/components/Inspector/DebuggingTab.js +29 -29
  176. package/dist/esm/components/Inspector/DeviceInfoTab.js +75 -75
  177. package/dist/esm/components/Inspector/FabLauncher.js +57 -60
  178. package/dist/esm/components/Inspector/FeatureUnderDevNotice.js +7 -7
  179. package/dist/esm/components/Inspector/FloatingCaptureWidget.d.ts +3 -0
  180. package/dist/esm/components/Inspector/FloatingCaptureWidget.js +54 -0
  181. package/dist/esm/components/Inspector/GlobalCrashScreenModal.d.ts +11 -0
  182. package/dist/esm/components/Inspector/GlobalCrashScreenModal.js +234 -0
  183. package/dist/esm/components/Inspector/InspectorHeader.js +162 -152
  184. package/dist/esm/components/Inspector/LanguageSelectorModal.d.ts +15 -0
  185. package/dist/esm/components/Inspector/LanguageSelectorModal.js +172 -0
  186. package/dist/esm/components/Inspector/MainScreen.js +130 -110
  187. package/dist/esm/components/Inspector/MediaGalleryTab.js +83 -78
  188. package/dist/esm/components/Inspector/MediaPreviewModal.d.ts +36 -0
  189. package/dist/esm/components/Inspector/MediaPreviewModal.js +345 -139
  190. package/dist/esm/components/Inspector/NetworkTab.js +130 -130
  191. package/dist/esm/components/Inspector/NpmUpdateToast.js +1 -1
  192. package/dist/esm/components/Inspector/PushCard.d.ts +3 -2
  193. package/dist/esm/components/Inspector/PushCard.js +23 -22
  194. package/dist/esm/components/Inspector/PushDetail.js +45 -36
  195. package/dist/esm/components/Inspector/PushTab.js +23 -23
  196. package/dist/esm/components/Inspector/ReduxDetail.js +42 -42
  197. package/dist/esm/components/Inspector/ReduxTab.js +20 -18
  198. package/dist/esm/components/Inspector/SecondaryTelemetryStrip.d.ts +2 -0
  199. package/dist/esm/components/Inspector/SecondaryTelemetryStrip.js +43 -0
  200. package/dist/esm/components/Inspector/SettingsPanel.js +526 -378
  201. package/dist/esm/components/Inspector/SocketCard.d.ts +5 -0
  202. package/dist/esm/components/Inspector/SocketCard.js +116 -0
  203. package/dist/esm/components/Inspector/SocketDetail.d.ts +4 -0
  204. package/dist/esm/components/Inspector/SocketDetail.js +327 -0
  205. package/dist/esm/components/Inspector/SocketFilterModal.d.ts +13 -0
  206. package/dist/esm/components/Inspector/SocketFilterModal.js +69 -0
  207. package/dist/esm/components/Inspector/SocketTab.d.ts +3 -0
  208. package/dist/esm/components/Inspector/SocketTab.js +112 -0
  209. package/dist/esm/components/Inspector/StorageTab.js +139 -137
  210. package/dist/esm/components/Inspector/SupportModal.d.ts +7 -0
  211. package/dist/esm/components/Inspector/SupportModal.js +125 -0
  212. package/dist/esm/components/Inspector/SupportPage.d.ts +5 -0
  213. package/dist/esm/components/Inspector/SupportPage.js +227 -0
  214. package/dist/esm/components/Inspector/TabBar.js +36 -35
  215. package/dist/esm/components/Inspector/UpdateAvailableModal.js +22 -22
  216. package/dist/esm/components/JsonViewer.js +66 -64
  217. package/dist/esm/components/LogCard.d.ts +3 -2
  218. package/dist/esm/components/LogCard.js +57 -55
  219. package/dist/esm/components/LogSyntaxHighlighter.js +5 -5
  220. package/dist/esm/components/ModuleErrorBoundary.js +23 -23
  221. package/dist/esm/components/NetworkIcons.d.ts +42 -0
  222. package/dist/esm/components/NetworkIcons.js +139 -6
  223. package/dist/esm/components/SegmentedTabs.js +7 -7
  224. package/dist/esm/constants/version.d.ts +1 -1
  225. package/dist/esm/constants/version.js +1 -1
  226. package/dist/esm/crash.d.ts +1 -1
  227. package/dist/esm/crash.js +1 -1
  228. package/dist/esm/customHooks/crashHandler.d.ts +2 -1
  229. package/dist/esm/customHooks/crashHandler.js +7 -7
  230. package/dist/esm/customHooks/socketLogger.d.ts +26 -0
  231. package/dist/esm/customHooks/socketLogger.js +2 -0
  232. package/dist/esm/editor.d.ts +13 -0
  233. package/dist/esm/editor.js +1 -0
  234. package/dist/esm/helpers/index.d.ts +1 -0
  235. package/dist/esm/helpers/index.js +4 -4
  236. package/dist/esm/helpers/memoryManager.d.ts +1 -0
  237. package/dist/esm/helpers/memoryManager.js +1 -1
  238. package/dist/esm/helpers/searchQueryParser.d.ts +1 -1
  239. package/dist/esm/helpers/searchQueryParser.js +5 -1
  240. package/dist/esm/helpers/settingsStore.d.ts +1 -0
  241. package/dist/esm/helpers/settingsStore.js +1 -1
  242. package/dist/esm/helpers/shareFormatter.d.ts +3 -1
  243. package/dist/esm/helpers/shareFormatter.js +8 -7
  244. package/dist/esm/helpers/telemetry.js +1 -1
  245. package/dist/esm/i18n/index.d.ts +99 -1
  246. package/dist/esm/i18n/index.js +1 -1
  247. package/dist/esm/i18n/locales/ar.json +1 -1
  248. package/dist/esm/i18n/locales/bn.json +1 -0
  249. package/dist/esm/i18n/locales/de.json +1 -1
  250. package/dist/esm/i18n/locales/en.json +1 -1
  251. package/dist/esm/i18n/locales/es.json +1 -1
  252. package/dist/esm/i18n/locales/fr.json +1 -1
  253. package/dist/esm/i18n/locales/gu.json +1 -0
  254. package/dist/esm/i18n/locales/hi.json +1 -1
  255. package/dist/esm/i18n/locales/id.json +1 -0
  256. package/dist/esm/i18n/locales/it.json +1 -0
  257. package/dist/esm/i18n/locales/ja.json +1 -1
  258. package/dist/esm/i18n/locales/kn.json +1 -0
  259. package/dist/esm/i18n/locales/ko.json +1 -1
  260. package/dist/esm/i18n/locales/ml.json +1 -0
  261. package/dist/esm/i18n/locales/mr.json +1 -0
  262. package/dist/esm/i18n/locales/nl.json +1 -0
  263. package/dist/esm/i18n/locales/pa.json +1 -0
  264. package/dist/esm/i18n/locales/pl.json +1 -0
  265. package/dist/esm/i18n/locales/pt.json +1 -1
  266. package/dist/esm/i18n/locales/ru.json +1 -1
  267. package/dist/esm/i18n/locales/ta.json +1 -0
  268. package/dist/esm/i18n/locales/te.json +1 -0
  269. package/dist/esm/i18n/locales/tr.json +1 -0
  270. package/dist/esm/i18n/locales/vi.json +1 -0
  271. package/dist/esm/i18n/locales/zh.json +1 -1
  272. package/dist/esm/index.d.ts +16 -13
  273. package/dist/esm/index.js +8 -7
  274. package/dist/esm/native/NativeInspector.d.ts +4 -0
  275. package/dist/esm/native/NativeInspector.js +1 -1
  276. package/dist/esm/native/NativeNetworkInspector.d.ts +4 -0
  277. package/dist/esm/socket.d.ts +4 -0
  278. package/dist/esm/socket.js +1 -0
  279. package/dist/esm/styles/AppColors.d.ts +42 -2
  280. package/dist/esm/styles/AppColors.js +1 -1
  281. package/dist/esm/styles/common.js +1 -1
  282. package/dist/esm/styles/index.d.ts +30 -0
  283. package/dist/esm/styles/index.js +1 -1
  284. package/dist/esm/types/editor.d.ts +96 -0
  285. package/dist/esm/types/editor.js +1 -0
  286. package/dist/esm/types/enums.d.ts +40 -0
  287. package/dist/esm/types/enums.js +1 -1
  288. package/dist/esm/types/interfaces.d.ts +143 -1
  289. package/editor.d.ts +1 -0
  290. package/editor.js +1 -0
  291. package/ios/NetworkInspectorModule.mm +531 -12
  292. package/package.json +213 -2
  293. package/react-native-inapp-inspector.podspec +1 -1
  294. package/src/native/NativeInspector.ts +65 -4
  295. package/src/native/NativeNetworkInspector.ts +4 -0
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import type { SocketCardProps } from '../../types';
3
+ declare function SocketCard({ item, onPress, searchStr, isNew, isSelected, onToggleSelect, serialNumber, }: SocketCardProps): React.JSX.Element;
4
+ declare const _default: React.MemoExoticComponent<typeof SocketCard>;
5
+ export default _default;
@@ -0,0 +1,116 @@
1
+ import te,{useMemo as O,useRef as le,useEffect as ae}from"react";import{Alert as ie,Animated as K,Linking as E,Pressable as X,StyleSheet as ne,Text as S,View as C}from"react-native";import Ce,{Path as Se}from"react-native-svg";import{AppColors as e}from"../../styles/AppColors";import{AppFonts as B}from"../../styles/AppFonts";import{formatDateTime as Te,formatTime as ke}from"../../helpers";import{CalendarIcon as Be,ClockIcon as J,CircleCheckIcon as Re,CircleXIcon as $e,ForwardChevronIcon as Ie,GlobeIcon as Q,LockIcon as Ve,ReceiveFrameIcon as We,SendFrameIcon as Pe,SizeIcon as De}from"../NetworkIcons";import Le from"../HighlightText";import Oe from"../TouchableScale";import{useTranslation as Fe}from"../../i18n";function He(o){return!o||o<=0?"0 B":o<1024?`${o} B`:o<1024*1024?`${(o/1024).toFixed(1)} KB`:`${(o/(1024*1024)).toFixed(2)} MB`}function ve({item:o,onPress:T,searchStr:Y,isNew:W,isSelected:M,onToggleSelect:N,serialNumber:A}){const{t:P}=Fe(),$=o.url.startsWith("wss://")||o.url.startsWith("https://"),F=o.client==="socket.io"||o.url.includes("/socket.io"),D=O(()=>F?{label:"SIO",color:e.violet600,bg:`${e.violet600}14`,border:`${e.violet600}35`}:$?{label:"WSS",color:e.emerald600,bg:`${e.emerald600}14`,border:`${e.emerald600}35`}:{label:"WS",color:e.blue600,bg:`${e.blue600}14`,border:`${e.blue600}35`},[F,$]),H=o.status||"open",k=H==="open",V=H==="connecting",z=H==="error",Z=O(()=>k?e.greenColor:V?e.amber600:z?e.errorColor:e.slate400,[k,V,z]),L=O(()=>k?{label:"OPEN",color:e.greenColor,bg:`${e.greenColor}15`,border:`${e.greenColor}40`}:V?{label:"CONNECTING",color:e.amber600,bg:`${e.amber600}15`,border:`${e.amber600}40`}:z?{label:o.closeCode?`ERR ${o.closeCode}`:"ERROR",color:e.errorColor,bg:`${e.errorColor}15`,border:`${e.errorColor}40`}:{label:o.closeCode?`CLOSED (${o.closeCode})`:"CLOSED",color:e.slate500,bg:`${e.slate500}15`,border:`${e.slate500}40`},[k,V,z,o.closeCode]),U=O(()=>{try{const I=o.url.replace(/^(wss?|https?):\/\//,""),R=I.indexOf("/");if(R>=0){const v=I.substring(0,R),re=I.substring(R);return{host:v,path:re}}return{host:I,path:"/"}}catch{return{host:o.url,path:"/"}}},[o.url]),_=I=>{I?.stopPropagation?.();const R=o.url.replace(/^wss:\/\//i,"https://").replace(/^ws:\/\//i,"http://");ie.alert(P("common.openInBrowser","Open in Browser"),`${P("common.openInBrowserPrompt","Are you sure you want to open this URL in your external browser?")}
2
+
3
+ ${R}`,[{text:P("common.cancel","Cancel"),style:"cancel"},{text:P("common.open","Open"),onPress:()=>{E.canOpenURL(R).then(v=>{v?E.openURL(R):E.openURL(R).catch(()=>{})}).catch(()=>{})}}])},j=le(new K.Value(W?.35:0)).current;ae(()=>{W&&K.timing(j,{toValue:0,duration:1200,useNativeDriver:!1}).start()},[W,j]);const G=(o.totalBytesSent||0)+(o.totalBytesReceived||0),ee=o.duration!=null?`${o.duration}ms`:"Active",oe=Te(o.startTime);return<C style={r.container}>
4
+ <Oe onPress={T}style={[r.card,{borderLeftWidth:3.5,borderLeftColor:Z,backgroundColor:z?e.errorCardBg:e.white},W&&r.cardNew]}>
5
+ <C style={r.cardBody}>
6
+
7
+ <C style={r.cardHeaderRow}>
8
+ <C style={r.cardHeaderLeft}>
9
+ {N&&<X onPress={()=>N(o.id)}hitSlop={12}style={[r.smallCheckbox,M&&r.smallCheckboxChecked]}>
10
+ {M&&<Ce width={9}height={9}viewBox="0 0 24 24"fill="none">
11
+ <Se d="M20 6L9 17l-5-5"stroke={e.white}strokeWidth="4"strokeLinecap="round"strokeLinejoin="round"/>
12
+ </Ce>}
13
+ </X>}
14
+
15
+ {A!=null&&<S style={r.serialNumber}>#{A}</S>}
16
+
17
+
18
+ <C style={[r.protocolBadge,{backgroundColor:D.bg,borderColor:D.border}]}>
19
+ <S style={[r.protocolBadgeText,{color:D.color}]}>
20
+ {D.label}
21
+ </S>
22
+ </C>
23
+
24
+
25
+ {F&&<C style={[r.chip,{backgroundColor:`${e.violet600}12`,borderColor:`${e.violet600}2B`}]}>
26
+ <S style={[r.chipText,{color:e.violet600}]}>
27
+ SOCKET.IO
28
+ </S>
29
+ </C>}
30
+ </C>
31
+
32
+ <C style={r.cardHeaderRight}>
33
+
34
+ <C style={[r.statusPill,{backgroundColor:L.bg,borderColor:L.border}]}>
35
+ {k?<C style={r.pulsingDot}/>:V?<J color={e.amber600}size={9}/>:z?<$e color={e.errorColor}size={9}/>:<Re color={e.slate500}size={9}/>}
36
+ <S style={[r.statusPillText,{color:L.color}]}>
37
+ {L.label}
38
+ </S>
39
+ </C>
40
+
41
+ <X onPress={_}hitSlop={8}style={r.globeBtn}accessibilityRole="button"accessibilityLabel="Open in Browser">
42
+ <Q color={e.grayTextWeak}size={12}/>
43
+ </X>
44
+
45
+ <Ie color={e.grayTextWeak}size={13}/>
46
+ </C>
47
+ </C>
48
+
49
+
50
+ <C style={r.urlBox}>
51
+ <C style={r.urlMainRow}>
52
+ <Le text={U.path}search={Y}style={r.pathText}highlightStyle={r.highlight}numberOfLines={1}ellipsizeMode="middle"/>
53
+ </C>
54
+
55
+ <C style={r.hostRow}>
56
+ <C style={[r.protoBadge,{backgroundColor:$?`${e.emerald600}12`:`${e.blue600}12`,borderColor:$?`${e.emerald600}2B`:`${e.blue600}2B`}]}>
57
+ {$?<Ve size={9}color={e.emerald600}/>:<Q size={9}color={e.blue600}/>}
58
+ <S style={[r.protoBadgeText,{color:$?e.emerald600:e.blue600}]}>
59
+ {$?"WSS":"WS"}
60
+ </S>
61
+ </C>
62
+
63
+ <S style={r.hostText}numberOfLines={1}ellipsizeMode="tail">
64
+ {U.host}
65
+ </S>
66
+ </C>
67
+ </C>
68
+
69
+
70
+ <C style={r.cardFooterRow}>
71
+ <C style={r.footerLeft}>
72
+ <C style={r.cardDateRow}>
73
+ <Be color={e.grayTextWeak}size={10}/>
74
+ <S style={r.cardDateText}numberOfLines={1}>
75
+ {oe||ke(o.startTime)}
76
+ </S>
77
+ </C>
78
+ </C>
79
+
80
+ <C style={r.footerRight}>
81
+
82
+ <C style={[r.metaStatChip,{backgroundColor:`${e.blue600}10`,borderColor:`${e.blue600}26`}]}>
83
+ <Pe size={9}color={e.blue600}/>
84
+ <S style={[r.metaStatText,{color:e.blue600}]}>
85
+ {o.sentCount||0}
86
+ </S>
87
+ </C>
88
+
89
+
90
+ <C style={[r.metaStatChip,{backgroundColor:`${e.emerald600}10`,borderColor:`${e.emerald600}26`}]}>
91
+ <We size={9}color={e.emerald600}/>
92
+ <S style={[r.metaStatText,{color:e.emerald600}]}>
93
+ {o.receivedCount||0}
94
+ </S>
95
+ </C>
96
+
97
+
98
+ {G>0&&<C style={[r.metaStatChip,{backgroundColor:`${e.purple}10`,borderColor:`${e.purple}26`}]}>
99
+ <De size={9}color={e.purple}/>
100
+ <S style={[r.metaStatText,{color:e.purple}]}>
101
+ {He(G)}
102
+ </S>
103
+ </C>}
104
+
105
+
106
+ <C style={[r.metaStatChip,{backgroundColor:k?`${e.greenColor}10`:`${e.slate400}10`,borderColor:k?`${e.greenColor}26`:`${e.slate400}26`}]}>
107
+ <J size={9}color={k?e.greenColor:e.grayTextWeak}/>
108
+ <S style={[r.metaStatText,{color:k?e.greenColor:e.grayTextWeak}]}>
109
+ {ee}
110
+ </S>
111
+ </C>
112
+ </C>
113
+ </C>
114
+ </C>
115
+ </Oe>
116
+ </C>}const r=ne.create({container:{marginHorizontal:4,marginBottom:6},card:{borderRadius:12,borderWidth:1,borderColor:e.dividerColor,shadowColor:e.shadowColorString,shadowOffset:{width:0,height:1},shadowOpacity:.05,shadowRadius:2,elevation:1,overflow:"hidden"},cardNew:{borderColor:`${e.brandPurple}66`,backgroundColor:`${e.brandPurple}05`},cardBody:{paddingHorizontal:8,paddingVertical:8},cardHeaderRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",marginBottom:5},cardHeaderLeft:{flexDirection:"row",alignItems:"center",gap:4.5,flex:1,minWidth:0},smallCheckbox:{width:15,height:15,borderRadius:3.5,borderWidth:1.2,borderColor:e.grayTextWeak,alignItems:"center",justifyContent:"center",backgroundColor:e.white,marginRight:2},smallCheckboxChecked:{backgroundColor:e.purple,borderColor:e.purple},serialNumber:{fontFamily:B.interSemiBold,fontSize:10.5,color:e.grayTextWeak},protocolBadge:{paddingHorizontal:5.5,paddingVertical:1.5,borderRadius:5,borderWidth:1},protocolBadgeText:{fontFamily:B.interBold,fontSize:9.5,letterSpacing:.3},chip:{paddingHorizontal:5,paddingVertical:1.5,borderRadius:4,borderWidth:1},chipText:{fontFamily:B.interBold,fontSize:9,letterSpacing:.2},cardHeaderRight:{flexDirection:"row",alignItems:"center",gap:6},statusPill:{flexDirection:"row",alignItems:"center",gap:4,paddingHorizontal:6,paddingVertical:2,borderRadius:5,borderWidth:1},statusPillText:{fontFamily:B.interBold,fontSize:9.5,letterSpacing:.3},pulsingDot:{width:6,height:6,borderRadius:3,backgroundColor:e.greenColor},globeBtn:{padding:3,borderRadius:4,backgroundColor:`${e.grayTextWeak}12`},urlBox:{marginBottom:8},urlMainRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:6,marginBottom:3},pathText:{flex:1,fontFamily:B.interBold,fontSize:12.5,color:e.grayTextStrong,lineHeight:17},highlight:{backgroundColor:"rgba(250, 204, 21, 0.40)",color:e.grayTextStrong,borderRadius:2},hostRow:{flexDirection:"row",alignItems:"center",gap:5},protoBadge:{flexDirection:"row",alignItems:"center",gap:3,paddingHorizontal:4.5,paddingVertical:1,borderRadius:4,borderWidth:1},protoBadgeText:{fontFamily:B.interBold,fontSize:8.5,letterSpacing:.2},hostText:{flex:1,fontFamily:B.interMedium,fontSize:11,color:e.grayTextWeak},cardFooterRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingTop:6,borderTopWidth:1,borderTopColor:e.dividerColor},footerLeft:{flexDirection:"row",alignItems:"center",flex:1,minWidth:0,marginRight:6},cardDateRow:{flexDirection:"row",alignItems:"center",gap:4},cardDateText:{fontFamily:B.interMedium,fontSize:10,color:e.grayTextWeak},footerRight:{flexDirection:"row",alignItems:"center",gap:4},metaStatChip:{flexDirection:"row",alignItems:"center",gap:3,paddingHorizontal:5,paddingVertical:2,borderRadius:4,borderWidth:1},metaStatText:{fontFamily:B.interSemiBold,fontSize:9.5}});function Ee(o,T){return o.item===T.item&&o.isSelected===T.isSelected&&o.isNew===T.isNew&&o.searchStr===T.searchStr&&o.serialNumber===T.serialNumber&&o.onPress===T.onPress&&o.onToggleSelect===T.onToggleSelect}export default te.memo(ve,Ee);
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import type { SocketDetailProps } from '../../types';
3
+ declare const SocketDetail: React.FC<SocketDetailProps>;
4
+ export default SocketDetail;
@@ -0,0 +1,327 @@
1
+ import{useMemo as E,useState as H}from"react";import{Alert as $e,Linking as Z,Pressable as M,ScrollView as F,StyleSheet as Ne,Text as T,TextInput as De,TouchableOpacity as W,View as S}from"react-native";import B from"../../styles";import{AppColors as e}from"../../styles/AppColors";import{AppFonts as h}from"../../styles/AppFonts";import{useTranslation as Le}from"../../i18n";import{animateNextLayout as Ee,useInspector as Me}from"./InspectorContext";import Ke from"../SourcePageCard";import Ue from"../HeadersSection";import Je from"../SegmentedTabs";import _ from"../JsonViewer";import O from"../CopyButton";import Ge from"../ShareButton";import Te from"../CodeSnippet";import Qe from"../HighlightText";import Ye from"../TouchableScale";import{formatDateTime as Se,formatByteSize as Ce}from"../../helpers";import{shareSocketReport as Xe}from"../../helpers/shareFormatter";import{ClockIcon as Ze,ChevronIcon as _e,GlobeIcon as Tt,SendFrameIcon as $,ReceiveFrameIcon as Ve,ClearIcon as St,SearchIcon as Ct,ExternalLinkIcon as Vt,LayersIcon as Bt,TerminalIcon as Rt,SizeIcon as It,FailIcon as Pt,HeadersIcon as Ft}from"../NetworkIcons";const Wt=({item:Be})=>{const{t:C}=Le(),{selectedSocket:ve,logRouteMapRef:j}=Me(),o=Be||ve,[I,ze]=H("messages"),[z,K]=H(""),[v,N]=H("all"),[Re,D]=H(new Set);if(!o)return null;const U=o.url.startsWith("wss://")||o.url.startsWith("https://"),R=o.client==="socket.io"||o.url.includes("/socket.io"),A=E(()=>{const r=(o.status||"open").toLowerCase();return r==="open"?e.greenColor:r==="connecting"?e.amber600:r==="error"?e.errorColor:e.slate500},[o.status]),q=()=>{const r=o.url.replace(/^wss:\/\//,"https://").replace(/^ws:\/\//,"http://");$e.alert(C("common.openInBrowser")||"Open in Browser",`${C("common.openInBrowserPrompt")||"Open URL in browser?"}
2
+
3
+ ${r}`,[{text:C("common.cancel")||"Cancel",style:"cancel"},{text:C("common.open")||"Open",onPress:()=>{Z.canOpenURL(r).then(V=>{V&&Z.openURL(r).catch(()=>{})})}}])},Ie=async()=>{await Xe(o)},Pe=r=>{D(V=>{const k=new Set(V);return k.has(r)?k.delete(r):k.add(r),k})},Fe=()=>{const r=new Set((o.frames||[]).map(V=>V.id));D(r)},We=()=>{D(new Set)},J=E(()=>{let r=o.frames||[];if(v!=="all"&&(r=r.filter(V=>V.direction===v)),z.trim()){const V=z.trim().toLowerCase();r=r.filter(k=>!!(k.eventName&&k.eventName.toLowerCase().includes(V)||k.type&&k.type.toLowerCase().includes(V)||typeof k.data=="string"&&k.data.toLowerCase().includes(V)||k.data&&typeof k.data=="object"&&JSON.stringify(k.data).toLowerCase().includes(V)))}return r},[o.frames,v,z]),Oe=(o.totalBytesSent||0)+(o.totalBytesReceived||0),G=E(()=>R?`import { io } from 'socket.io-client';
4
+
5
+ const socket = io('${o.url}', {
6
+ transports: ['websocket'],
7
+ query: ${JSON.stringify(o.query||{},null,2)}
8
+ });
9
+
10
+ socket.on('connect', () => {
11
+ console.log('Connected with socket ID:', socket.id);
12
+ });
13
+
14
+ socket.on('message', (data) => {
15
+ console.log('Received:', data);
16
+ });`:`// Standard JavaScript WebSocket
17
+ const ws = new WebSocket('${o.url}'${o.protocols?`, ${JSON.stringify(o.protocols)}`:""});
18
+
19
+ ws.onopen = () => {
20
+ console.log('WebSocket connection opened');
21
+ ws.send(JSON.stringify({ type: 'ping' }));
22
+ };
23
+
24
+ ws.onmessage = (event) => {
25
+ console.log('Message from server:', event.data);
26
+ };
27
+
28
+ ws.onerror = (error) => {
29
+ console.error('WebSocket Error:', error);
30
+ };
31
+
32
+ ws.onclose = (event) => {
33
+ console.log('WebSocket closed:', event.code, event.reason);
34
+ };`,[o.url,o.protocols,o.query,R]),Q=`wscat -c "${o.url}"`,Y=o.url.indexOf("://"),P=Y!==-1?o.url.substring(0,Y+3):"";return<S style={{flex:1,backgroundColor:e.contentBg}}>
35
+
36
+ <S style={{paddingHorizontal:8,paddingTop:4}}>
37
+ <S style={B.detailInfoBar}>
38
+
39
+ <S style={{flexDirection:"row",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",gap:6,paddingBottom:8,borderBottomWidth:1,borderBottomColor:e.dividerColor}}>
40
+ <S style={{flexDirection:"row",alignItems:"center",gap:5,flexWrap:"wrap",flex:1}}>
41
+
42
+ <S style={[B.methodBadge,{backgroundColor:R?e.violet600:U?e.emerald600:e.blue600,paddingHorizontal:8,paddingVertical:3.5,borderRadius:6}]}>
43
+ <T style={[B.methodBadgeText,{color:e.white,fontSize:10.5,fontFamily:h.interBold}]}>
44
+ {R?"SIO":U?"WSS":"WS"}
45
+ </T>
46
+ </S>
47
+
48
+
49
+ <S style={[B.chip,{backgroundColor:R?`${e.violet600}14`:`${e.sky500}14`,borderColor:R?`${e.violet600}30`:`${e.sky500}30`,paddingHorizontal:6,paddingVertical:3,borderRadius:6}]}>
50
+ <T style={[B.chipText,{fontFamily:h.interBold,fontSize:9.5,color:R?e.violet600:e.sky600}]}>
51
+ {(o.client||"WEBSOCKET").toUpperCase()}
52
+ </T>
53
+ </S>
54
+
55
+
56
+ <S style={[B.chip,{backgroundColor:`${A}18`,borderColor:`${A}40`,paddingHorizontal:7,paddingVertical:3,borderRadius:6}]}>
57
+ {o.status==="error"?<Pt size={8}color={e.errorColor}/>:<S style={{width:6,height:6,borderRadius:3,backgroundColor:A}}/>}
58
+ <T style={[B.chipText,{color:A,fontFamily:h.interBold,fontSize:10.5}]}>
59
+ {(o.status||"open").toUpperCase()}
60
+ </T>
61
+ </S>
62
+
63
+
64
+ <S style={[B.chip,{backgroundColor:`${e.brandPurple}14`,borderColor:`${e.brandPurple}30`,paddingHorizontal:7,paddingVertical:3,borderRadius:6,gap:4}]}>
65
+ <Ze color={e.brandPurple}size={10}/>
66
+ <T style={[B.chipText,{color:e.brandPurple,fontFamily:h.interBold,fontSize:10.5}]}>
67
+ {o.duration!=null?`${o.duration}ms`:"Active"}
68
+ </T>
69
+ </S>
70
+
71
+
72
+ <S style={[B.chip,{backgroundColor:`${e.teal600}14`,borderColor:`${e.teal600}30`,paddingHorizontal:7,paddingVertical:3,borderRadius:6,gap:4}]}>
73
+ <$ color={e.teal600}size={10}/>
74
+ <T style={[B.chipText,{color:e.teal600,fontFamily:h.interBold,fontSize:10.5}]}>
75
+ {o.frames?.length||0} frames
76
+ </T>
77
+ </S>
78
+
79
+
80
+ <S style={[B.chip,{backgroundColor:`${e.sky600}14`,borderColor:`${e.sky600}30`,paddingHorizontal:7,paddingVertical:3,borderRadius:6,gap:4}]}>
81
+ <It color={e.sky600}size={10}/>
82
+ <T style={[B.chipText,{color:e.sky600,fontFamily:h.interBold,fontSize:10.5}]}>
83
+ {Ce(Oe)}
84
+ </T>
85
+ </S>
86
+ </S>
87
+ </S>
88
+
89
+
90
+ <S style={{backgroundColor:e.grayBackground,borderRadius:10,borderWidth:1,borderColor:e.dividerColor,padding:10,marginTop:8,gap:8}}>
91
+
92
+ <S style={{flexDirection:"row",alignItems:"center",justifyContent:"space-between",flexWrap:"nowrap",gap:6}}>
93
+ <S style={{flexDirection:"row",alignItems:"center",gap:6,flexShrink:1,minWidth:0}}>
94
+ {P?<S style={{backgroundColor:P.startsWith("wss")||P.startsWith("https")?`${e.green600}18`:`${e.amber500}18`,paddingHorizontal:6,paddingVertical:2,borderRadius:4}}>
95
+ <T style={{fontFamily:h.interBold,fontSize:9,color:P.startsWith("wss")||P.startsWith("https")?e.green600:e.amber500}}>
96
+ {P.replace("://","").toUpperCase()}
97
+ </T>
98
+ </S>:null}
99
+
100
+ <T style={{fontFamily:h.interBold,fontSize:10,color:e.grayTextWeak,letterSpacing:.4,textTransform:"uppercase"}}numberOfLines={1}>
101
+ ENDPOINT URL
102
+ </T>
103
+ </S>
104
+
105
+
106
+ <S style={{flexDirection:"row",alignItems:"center",gap:5,flexShrink:0}}>
107
+ <O value={Q}label="wscat"iconType="terminal"/>
108
+ <Ge onShare={Ie}/>
109
+ <O value={G}label="JS"iconType="fetch"/>
110
+ <O value={o.url}label="URL"iconType="copy"/>
111
+ <Ye style={[B.iconSquareBtn,{backgroundColor:`${e.sky600}15`,borderColor:`${e.sky600}35`}]}onPress={q}hitSlop={10}accessibilityLabel="Open in Browser">
112
+ <Vt color={e.sky600}size={13}/>
113
+ </Ye>
114
+ </S>
115
+ </S>
116
+
117
+
118
+ <M onPress={q}>
119
+ <T selectable={!0}style={{fontFamily:h.interMedium,fontSize:12.5,color:e.skyBlue,textDecorationLine:"underline",lineHeight:18}}>
120
+ {o.url}
121
+ </T>
122
+ </M>
123
+ </S>
124
+ </S>
125
+ </S>
126
+
127
+
128
+ <Je tabs={[{key:"messages",label:`${C("socket.messages","Messages")} (${o.frames?.length||0})`,themeColor:e.violet600,icon:r=><$ size={12}color={r?e.white:e.grayText}/>},{key:"overview",label:C("socket.overview","Overview"),themeColor:e.sky600,icon:r=><Tt size={12}color={r?e.white:e.grayText}/>},...o.headers&&Object.keys(o.headers).length>0?[{key:"headers",label:`${C("network.detailTabs.headers","Headers")} (${Object.keys(o.headers).length})`,themeColor:e.purple,icon:r=><Ft size={12}color={r?e.white:e.grayText}/>}]:[],{key:"params",label:`${C("socket.params","Params")} (${Object.keys(o.query||{}).length})`,themeColor:e.teal600,icon:r=><Bt size={12}color={r?e.white:e.grayText}/>},{key:"raw",label:C("socket.rawAndCode","Raw & Code"),themeColor:e.amber600,icon:r=><Rt size={12}color={r?e.white:e.grayText}/>}]}activeKey={I}onChange={r=>{Ee(),ze(r)}}style={{marginHorizontal:6,marginBottom:10,marginTop:6}}/>
129
+
130
+
131
+ {I==="messages"&&<S style={{flex:1}}>
132
+
133
+ <S style={t.frameControlBar}>
134
+ <S style={t.frameSearchBar}>
135
+ <Ct size={13}color={e.grayTextWeak}/>
136
+ <De style={t.frameSearchInput}placeholder={C("socket.searchFramesPlaceholder","Search frame payloads or event names...")}placeholderTextColor={e.grayTextWeak}value={z}onChangeText={K}clearButtonMode="while-editing"/>
137
+ {z.length>0&&<M onPress={()=>K("")}>
138
+ <St size={12}color={e.grayTextWeak}/>
139
+ </M>}
140
+ </S>
141
+
142
+
143
+ <S style={t.frameFilterRow}>
144
+ <S style={t.dirPillGroup}>
145
+ <W onPress={()=>N("all")}style={[t.dirPill,v==="all"&&t.dirPillActive]}>
146
+ <T style={[t.dirPillText,v==="all"&&t.dirPillTextActive]}>
147
+ {C("common.all","All")}
148
+ </T>
149
+ </W>
150
+
151
+ <W onPress={()=>N("send")}style={[t.dirPill,v==="send"&&t.dirPillActive,{flexDirection:"row",alignItems:"center",gap:4}]}>
152
+ <$ size={10}color={v==="send"?e.white:e.emerald600}/>
153
+ <T style={[t.dirPillText,v==="send"&&t.dirPillTextActive]}>
154
+ {C("socket.sent","Sent")}
155
+ </T>
156
+ </W>
157
+
158
+ <W onPress={()=>N("receive")}style={[t.dirPill,v==="receive"&&t.dirPillActive,{flexDirection:"row",alignItems:"center",gap:4}]}>
159
+ <Ve size={10}color={v==="receive"?e.white:e.sky600}/>
160
+ <T style={[t.dirPillText,v==="receive"&&t.dirPillTextActive]}>
161
+ {C("socket.recv","Recv")}
162
+ </T>
163
+ </W>
164
+ </S>
165
+
166
+ <S style={t.expandGroup}>
167
+ <W onPress={Fe}style={t.textBtn}>
168
+ <T style={t.textBtnLabel}>{C("common.expandAll","Expand All")}</T>
169
+ </W>
170
+ <T style={t.textBtnSep}>•</T>
171
+ <W onPress={We}style={t.textBtn}>
172
+ <T style={t.textBtnLabel}>{C("common.collapseAll","Collapse All")}</T>
173
+ </W>
174
+ </S>
175
+ </S>
176
+ </S>
177
+
178
+
179
+ <F style={t.framesScrollView}contentContainerStyle={{padding:12}}>
180
+ {J.length===0?<S style={t.emptyFrames}>
181
+ <T style={t.emptyFramesText}>
182
+ {o.frames?.length===0?"No messages transferred on this connection yet":"No frames match the active search or direction filter"}
183
+ </T>
184
+ </S>:J.map((r,V)=>{const k=r.direction==="send",X=Re.has(r.id),L=k?e.blue600:e.emerald600,Ae=k?`${e.blue600}12`:`${e.emerald600}12`,He=r.timestamp-o.startTime;return<S key={r.id}style={t.frameCard}>
185
+
186
+ <M onPress={()=>Pe(r.id)}style={t.frameCardHeader}>
187
+ <S style={t.frameHeaderLeft}>
188
+ <S style={[t.dirBadge,{backgroundColor:Ae}]}>
189
+ {k?<$ size={10}color={L}/>:<Ve size={10}color={L}/>}
190
+ <T style={[t.dirBadgeText,{color:L}]}>
191
+ {k?"SENT":"RECV"}
192
+ </T>
193
+ </S>
194
+
195
+ {r.eventName&&<S style={t.eventBadge}>
196
+ <T style={t.eventBadgeText}numberOfLines={1}>
197
+ {r.eventName}
198
+ </T>
199
+ </S>}
200
+
201
+ <T style={t.frameIndexText}>#{V+1}</T>
202
+ </S>
203
+
204
+ <S style={t.frameHeaderRight}>
205
+ <T style={t.frameOffsetTime}>
206
+ +{He}ms
207
+ </T>
208
+ <S style={t.frameSizePill}>
209
+ <T style={t.frameSizeText}>
210
+ {Ce(r.size||0)}
211
+ </T>
212
+ </S>
213
+ <O value={r.raw??r.data}label="Frame"/>
214
+ <_e direction={X?"up":"down"}size={12}color={e.grayTextWeak}/>
215
+ </S>
216
+ </M>
217
+
218
+
219
+ <S style={t.frameBody}>
220
+ {typeof r.data=="object"&&r.data!==null?<_ data={r.data}search={z}forceOpen={X}/>:<T style={t.frameRawText}>
221
+ <Qe text={String(r.data)}search={z}/>
222
+ </T>}
223
+ </S>
224
+ </S>})}
225
+ </F>
226
+ </S>}
227
+
228
+
229
+ {I==="overview"&&<F style={t.tabContentScroll}contentContainerStyle={{padding:12}}>
230
+ <S style={t.sectionCard}>
231
+ <T style={t.sectionHeading}>{C("socket.connectionDetails","CONNECTION DETAILS")}</T>
232
+
233
+ <S style={t.infoRow}>
234
+ <T style={t.infoKey}>{C("socket.url","URL")}</T>
235
+ <T style={t.infoVal}selectable>{o.url}</T>
236
+ </S>
237
+
238
+ <S style={t.infoRow}>
239
+ <T style={t.infoKey}>{C("socket.clientEngine","Client Engine")}</T>
240
+ <T style={t.infoVal}>{o.client?.toUpperCase()||"WEBSOCKET"}</T>
241
+ </S>
242
+
243
+ <S style={t.infoRow}>
244
+ <T style={t.infoKey}>{C("socket.readyState","Ready State")}</T>
245
+ <T style={t.infoVal}>
246
+ {o.readyState===1?"1 (OPEN)":o.readyState===0?"0 (CONNECTING)":o.readyState===2?"2 (CLOSING)":"3 (CLOSED)"}
247
+ </T>
248
+ </S>
249
+
250
+ <S style={t.infoRow}>
251
+ <T style={t.infoKey}>{C("socket.connectedAt","Connected At")}</T>
252
+ <T style={t.infoVal}>{Se(o.startTime)}</T>
253
+ </S>
254
+
255
+ {o.endTime&&<S style={t.infoRow}>
256
+ <T style={t.infoKey}>{C("socket.closedAt","Closed At")}</T>
257
+ <T style={t.infoVal}>{Se(o.endTime)}</T>
258
+ </S>}
259
+
260
+ {o.closeCode!=null&&<S style={t.infoRow}>
261
+ <T style={t.infoKey}>{C("socket.closeCodeReason","Close Code & Reason")}</T>
262
+ <T style={t.infoVal}>{o.closeCode} ({o.closeReason||"N/A"})</T>
263
+ </S>}
264
+
265
+ {o.protocols&&<S style={t.infoRow}>
266
+ <T style={t.infoKey}>{C("socket.subprotocols","Subprotocols")}</T>
267
+ <T style={t.infoVal}>
268
+ {Array.isArray(o.protocols)?o.protocols.join(", "):o.protocols}
269
+ </T>
270
+ </S>}
271
+
272
+ {o.caller&&<S style={t.infoRow}>
273
+ <T style={t.infoKey}>{C("socket.callerStack","Caller Stack")}</T>
274
+ <T style={[t.infoVal,{fontFamily:h.interMedium,color:e.brandPurple}]}selectable>
275
+ {o.caller}
276
+ </T>
277
+ </S>}
278
+
279
+ {o.error&&<S style={t.infoRow}>
280
+ <T style={t.infoKey}>{C("socket.error","Error")}</T>
281
+ <T style={[t.infoVal,{color:e.errorColor}]}selectable>
282
+ {o.error}
283
+ </T>
284
+ </S>}
285
+ </S>
286
+
287
+
288
+ {(()=>{const r=o.routeInfo||j?.current&&j.current.get(o.id);return!r||!r.path||r.path==="Navigators"?null:<S style={{marginTop:12}}>
289
+ <Ke routeInfo={r}/>
290
+ </S>})()}
291
+ </F>}
292
+
293
+
294
+ {I==="headers"&&o.headers&&<F style={t.tabContentScroll}contentContainerStyle={{padding:12}}>
295
+ <Ue title={C("socket.handshakeHeaders","Handshake Headers")}headers={o.headers}search=""resetKey={o.id}/>
296
+ </F>}
297
+
298
+
299
+ {I==="params"&&<F style={t.tabContentScroll}contentContainerStyle={{padding:12}}>
300
+ <S style={t.sectionCard}>
301
+ <T style={t.sectionHeading}>{C("socket.handshakeParams","HANDSHAKE QUERY PARAMETERS")}</T>
302
+ {!o.query||Object.keys(o.query).length===0?<T style={t.emptySectionText}>{C("socket.noQueryParams","No query parameters passed in connection URL")}</T>:Object.entries(o.query).map(([r,V])=><S key={r}style={t.paramRow}>
303
+ <T style={t.paramKey}selectable>{r}</T>
304
+ <T style={t.paramVal}selectable>{V}</T>
305
+ <O value={V}label={r}/>
306
+ </S>)}
307
+ </S>
308
+ </F>}
309
+
310
+
311
+ {I==="raw"&&<F style={t.tabContentScroll}contentContainerStyle={{padding:12}}>
312
+ <S style={t.sectionCard}>
313
+ <T style={t.sectionHeading}>{C("socket.jsClientCode","JAVASCRIPT CLIENT CODE")}</T>
314
+ <Te code={G}language="javascript"/>
315
+ </S>
316
+
317
+ <S style={[t.sectionCard,{marginTop:14}]}>
318
+ <T style={t.sectionHeading}>{C("socket.terminalWscat","TERMINAL WSCAT COMMAND")}</T>
319
+ <Te code={Q}language="javascript"/>
320
+ </S>
321
+
322
+ <S style={[t.sectionCard,{marginTop:14}]}>
323
+ <T style={t.sectionHeading}>{C("socket.rawDump","RAW CONNECTION JSON DUMP")}</T>
324
+ <_ data={o}/>
325
+ </S>
326
+ </F>}
327
+ </S>};export default Wt;const t=Ne.create({frameControlBar:{padding:10,backgroundColor:e.graySurface,borderBottomWidth:1,borderBottomColor:e.dividerColor,gap:8},frameSearchBar:{flexDirection:"row",alignItems:"center",backgroundColor:e.contentBg,borderRadius:8,borderWidth:1,borderColor:e.dividerColor,paddingHorizontal:8,height:34,gap:6},frameSearchInput:{flex:1,fontFamily:h.interRegular,fontSize:12,color:e.grayTextStrong,paddingVertical:0},frameFilterRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-between"},dirPillGroup:{flexDirection:"row",gap:6},dirPill:{paddingHorizontal:8,paddingVertical:4,borderRadius:6,borderWidth:1,borderColor:e.dividerColor,backgroundColor:e.contentBg},dirPillActive:{backgroundColor:`${e.brandPurple}18`,borderColor:e.brandPurple},dirPillText:{fontFamily:h.interMedium,fontSize:11,color:e.grayTextWeak},dirPillTextActive:{color:e.brandPurple,fontFamily:h.interBold},expandGroup:{flexDirection:"row",alignItems:"center",gap:4},textBtn:{paddingVertical:2,paddingHorizontal:4},textBtnLabel:{fontFamily:h.interMedium,fontSize:11,color:e.brandPurple},textBtnSep:{color:e.grayTextWeak,fontSize:10},framesScrollView:{flex:1},emptyFrames:{padding:32,alignItems:"center"},emptyFramesText:{fontFamily:h.interMedium,fontSize:12.5,color:e.grayTextWeak,textAlign:"center"},frameCard:{backgroundColor:e.contentBg,borderRadius:8,borderWidth:1,borderColor:e.dividerColor,marginBottom:8,overflow:"hidden"},frameCardHeader:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingHorizontal:10,paddingVertical:7,backgroundColor:e.graySurface,borderBottomWidth:1,borderBottomColor:e.dividerColor},frameHeaderLeft:{flexDirection:"row",alignItems:"center",gap:6},dirBadge:{flexDirection:"row",alignItems:"center",paddingHorizontal:5,paddingVertical:2,borderRadius:4,gap:3},dirBadgeText:{fontFamily:h.interBold,fontSize:9.5},eventBadge:{backgroundColor:`${e.violet600}18`,paddingHorizontal:6,paddingVertical:2,borderRadius:4,maxWidth:130},eventBadgeText:{fontFamily:h.interBold,fontSize:10,color:e.violet600},frameIndexText:{fontFamily:h.interMedium,fontSize:10,color:e.grayTextWeak},frameHeaderRight:{flexDirection:"row",alignItems:"center",gap:6},frameOffsetTime:{fontFamily:h.interRegular,fontSize:10,color:e.grayTextWeak},frameSizePill:{backgroundColor:`${e.slate400}18`,paddingHorizontal:4,paddingVertical:1,borderRadius:4},frameSizeText:{fontFamily:h.interMedium,fontSize:9.5,color:e.grayTextStrong},frameBody:{padding:8},frameRawText:{fontFamily:h.interRegular,fontSize:12,color:e.grayTextStrong,lineHeight:16},tabContentScroll:{flex:1},sectionCard:{backgroundColor:e.contentBg,borderRadius:10,borderWidth:1,borderColor:e.dividerColor,padding:12},sectionHeading:{fontFamily:h.interBold,fontSize:11,color:e.grayTextWeak,letterSpacing:.6,marginBottom:10},infoRow:{paddingVertical:8,borderBottomWidth:1,borderBottomColor:e.dividerColor},infoKey:{fontFamily:h.interMedium,fontSize:11,color:e.grayTextWeak,marginBottom:2},infoVal:{fontFamily:h.interSemiBold,fontSize:12.5,color:e.grayTextStrong,lineHeight:18},emptySectionText:{fontFamily:h.interRegular,fontSize:12,color:e.grayTextWeak,fontStyle:"italic",paddingVertical:8},paramRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingVertical:8,borderBottomWidth:1,borderBottomColor:e.dividerColor,gap:8},paramKey:{fontFamily:h.interBold,fontSize:12,color:e.brandPurple,width:"30%"},paramVal:{flex:1,fontFamily:h.interMedium,fontSize:12,color:e.grayTextStrong}});
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import type { SocketConnectionRecord, SocketFilterState } from '../../types';
3
+ export declare const DEFAULT_SOCKET_FILTERS: SocketFilterState;
4
+ export declare const isSocketFiltersDefault: (f: SocketFilterState) => boolean;
5
+ interface SocketFilterModalProps {
6
+ visible: boolean;
7
+ onClose: () => void;
8
+ filters: SocketFilterState;
9
+ onApply: (filters: SocketFilterState) => void;
10
+ records: SocketConnectionRecord[];
11
+ }
12
+ export declare const SocketFilterModal: React.FC<SocketFilterModalProps>;
13
+ export default SocketFilterModal;
@@ -0,0 +1,69 @@
1
+ import{useEffect as j,useMemo as N,useState as U}from"react";import{Modal as K,Pressable as Y,ScrollView as G,StyleSheet as _,Text as T,TouchableOpacity as V,View as S}from"react-native";import{AppColors as l}from"../../styles/AppColors";import{AppFonts as C}from"../../styles/AppFonts";import{FilterIcon as J,CloseWhite as Q}from"../NetworkIcons";import X from"../TouchableScale";export const DEFAULT_SOCKET_FILTERS={search:"",status:new Set(["all"]),types:new Set(["all"]),sortBy:"time_desc"},isSocketFiltersDefault=k=>(k.status.has("all")||k.status.size===0)&&(k.types.has("all")||k.types.size===0)&&k.sortBy==="time_desc",SocketFilterModal=({visible:k,onClose:O,filters:B,onApply:E,records:W})=>{const[P,F]=U(()=>({...B,status:new Set(B.status),types:new Set(B.types)}));j(()=>{k&&F({...B,status:new Set(B.status),types:new Set(B.types)})},[k,B]);const x=N(()=>{let e=0,o=0,m=0,A=0,I=0,v=0,D=0;return W.forEach(z=>{const R=z.status||"open";R==="open"?e++:R==="closed"?o++:R==="connecting"?m++:R==="error"&&A++,z.client==="socket.io"||z.url.includes("/socket.io")?D++:z.url.startsWith("wss://")?I++:v++}),{all:W.length,open:e,closed:o,connecting:m,error:A,wss:I,ws:v,sio:D}},[W]),L=e=>{const o=new Set(P.status);e==="all"?(o.clear(),o.add("all")):(o.delete("all"),o.has(e)?o.delete(e):o.add(e),o.size===0&&o.add("all")),F(m=>({...m,status:o}))},H=e=>{const o=new Set(P.types);e==="all"?(o.clear(),o.add("all")):(o.delete("all"),o.has(e)?o.delete(e):o.add(e),o.size===0&&o.add("all")),F(m=>({...m,types:o}))},M=()=>{F({search:P.search,status:new Set(["all"]),types:new Set(["all"]),sortBy:"time_desc"})},$=()=>{E(P),O()};return<K visible={k}transparent animationType="fade"onRequestClose={O}>
2
+ <S style={t.backdrop}>
3
+ <Y style={t.backdropPress}onPress={O}/>
4
+ <S style={t.container}>
5
+
6
+ <S style={t.header}>
7
+ <S style={t.headerLeft}>
8
+ <J size={18}color={l.brandPurple}/>
9
+ <T style={t.headerTitle}>Filter WebSockets</T>
10
+ </S>
11
+ <V onPress={O}hitSlop={{top:8,bottom:8,left:8,right:8}}style={t.closeBtn}>
12
+ <Q size={14}color={l.grayTextWeak}/>
13
+ </V>
14
+ </S>
15
+
16
+ <G style={t.content}showsVerticalScrollIndicator={!1}>
17
+
18
+ <T style={t.sectionTitle}>CONNECTION STATUS</T>
19
+ <S style={t.chipRow}>
20
+ {[{key:"all",label:"All",count:x.all,color:l.brandPurple},{key:"open",label:"Open",count:x.open,color:l.greenColor},{key:"closed",label:"Closed",count:x.closed,color:l.slate500},{key:"connecting",label:"Connecting",count:x.connecting,color:l.amber600},{key:"error",label:"Error",count:x.error,color:l.errorColor}].map(e=>{const o=P.status.has(e.key);return<V key={e.key}onPress={()=>L(e.key)}style={[t.chip,o&&{backgroundColor:`${e.color}18`,borderColor:e.color}]}>
21
+ <T style={[t.chipText,o&&{color:e.color,fontFamily:C.interBold}]}>
22
+ {e.label}
23
+ </T>
24
+ <S style={[t.countPill,o&&{backgroundColor:`${e.color}30`}]}>
25
+ <T style={[t.countText,o&&{color:e.color}]}>
26
+ {e.count}
27
+ </T>
28
+ </S>
29
+ </V>})}
30
+ </S>
31
+
32
+
33
+ <T style={t.sectionTitle}>PROTOCOL & CLIENT</T>
34
+ <S style={t.chipRow}>
35
+ {[{key:"all",label:"All Protocols",count:x.all,color:l.brandPurple},{key:"wss",label:"Secure (WSS)",count:x.wss,color:l.emerald600},{key:"ws",label:"Standard (WS)",count:x.ws,color:l.blue600},{key:"sio",label:"Socket.IO",count:x.sio,color:l.violet600}].map(e=>{const o=P.types.has(e.key);return<V key={e.key}onPress={()=>H(e.key)}style={[t.chip,o&&{backgroundColor:`${e.color}18`,borderColor:e.color}]}>
36
+ <T style={[t.chipText,o&&{color:e.color,fontFamily:C.interBold}]}>
37
+ {e.label}
38
+ </T>
39
+ <S style={[t.countPill,o&&{backgroundColor:`${e.color}30`}]}>
40
+ <T style={[t.countText,o&&{color:e.color}]}>
41
+ {e.count}
42
+ </T>
43
+ </S>
44
+ </V>})}
45
+ </S>
46
+
47
+
48
+ <T style={t.sectionTitle}>SORT BY</T>
49
+ <S style={t.chipRow}>
50
+ {[{key:"time_desc",label:"Newest First"},{key:"time_asc",label:"Oldest First"},{key:"frames_desc",label:"Most Frames"},{key:"duration_desc",label:"Longest Duration"}].map(e=>{const o=P.sortBy===e.key;return<V key={e.key}onPress={()=>F(m=>({...m,sortBy:e.key}))}style={[t.chip,o&&t.chipActiveSort]}>
51
+ <T style={[t.chipText,o&&t.chipTextActiveSort]}>
52
+ {e.label}
53
+ </T>
54
+ </V>})}
55
+ </S>
56
+ </G>
57
+
58
+
59
+ <S style={t.footer}>
60
+ <V onPress={M}style={t.resetBtn}>
61
+ <T style={t.resetBtnText}>Reset</T>
62
+ </V>
63
+ <X onPress={$}style={t.applyBtn}>
64
+ <T style={t.applyBtnText}>Apply Filters</T>
65
+ </X>
66
+ </S>
67
+ </S>
68
+ </S>
69
+ </K>};export default SocketFilterModal;const t=_.create({backdrop:{flex:1,backgroundColor:"rgba(0,0,0,0.5)",justifyContent:"center",alignItems:"center",padding:16},backdropPress:{..._.absoluteFillObject},container:{width:"100%",maxHeight:"80%",backgroundColor:l.contentBg,borderRadius:16,overflow:"hidden",shadowColor:l.black,shadowOffset:{width:0,height:4},shadowOpacity:.25,shadowRadius:10,elevation:8},header:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingHorizontal:16,paddingVertical:14,borderBottomWidth:1,borderBottomColor:l.dividerColor},headerLeft:{flexDirection:"row",alignItems:"center",gap:8},headerTitle:{fontFamily:C.interBold,fontSize:16,color:l.grayTextStrong},closeBtn:{padding:4},content:{padding:16},sectionTitle:{fontFamily:C.interBold,fontSize:11,color:l.grayTextWeak,letterSpacing:.6,marginBottom:8,marginTop:10},chipRow:{flexDirection:"row",flexWrap:"wrap",gap:8,marginBottom:12},chip:{flexDirection:"row",alignItems:"center",paddingHorizontal:10,paddingVertical:6,borderRadius:8,borderWidth:1,borderColor:l.dividerColor,backgroundColor:l.graySurface,gap:6},chipActiveSort:{backgroundColor:`${l.brandPurple}18`,borderColor:l.brandPurple},chipText:{fontFamily:C.interMedium,fontSize:12,color:l.grayTextStrong},chipTextActiveSort:{color:l.brandPurple,fontFamily:C.interBold},countPill:{backgroundColor:`${l.slate500}18`,paddingHorizontal:5,paddingVertical:1,borderRadius:10},countText:{fontFamily:C.interBold,fontSize:10,color:l.grayTextWeak},footer:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingHorizontal:16,paddingVertical:12,borderTopWidth:1,borderTopColor:l.dividerColor,gap:12},resetBtn:{paddingVertical:10,paddingHorizontal:16,borderRadius:8,borderWidth:1,borderColor:l.dividerColor},resetBtnText:{fontFamily:C.interSemiBold,fontSize:13,color:l.grayTextWeak},applyBtn:{flex:1,backgroundColor:l.brandPurple,paddingVertical:11,borderRadius:8,alignItems:"center",justifyContent:"center"},applyBtnText:{fontFamily:C.interBold,fontSize:13,color:l.white}});
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const SocketTab: React.MemoExoticComponent<() => React.JSX.Element>;
3
+ export default SocketTab;