react-native-prod-debugger 1.0.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 (227) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +350 -0
  3. package/lib/commonjs/core/DebugBubble.js +139 -0
  4. package/lib/commonjs/core/DebugBubble.js.map +1 -0
  5. package/lib/commonjs/core/DebugOverlay.js +184 -0
  6. package/lib/commonjs/core/DebugOverlay.js.map +1 -0
  7. package/lib/commonjs/core/DebuggerProvider.js +174 -0
  8. package/lib/commonjs/core/DebuggerProvider.js.map +1 -0
  9. package/lib/commonjs/core/GestureDetector.js +83 -0
  10. package/lib/commonjs/core/GestureDetector.js.map +1 -0
  11. package/lib/commonjs/core/PluginRegistry.js +124 -0
  12. package/lib/commonjs/core/PluginRegistry.js.map +1 -0
  13. package/lib/commonjs/core/theme.js +50 -0
  14. package/lib/commonjs/core/theme.js.map +1 -0
  15. package/lib/commonjs/core/types.js +6 -0
  16. package/lib/commonjs/core/types.js.map +1 -0
  17. package/lib/commonjs/core/useDebugger.js +27 -0
  18. package/lib/commonjs/core/useDebugger.js.map +1 -0
  19. package/lib/commonjs/core/utils.js +239 -0
  20. package/lib/commonjs/core/utils.js.map +1 -0
  21. package/lib/commonjs/index.js +132 -0
  22. package/lib/commonjs/index.js.map +1 -0
  23. package/lib/commonjs/plugins/console/ConsoleInterceptor.js +103 -0
  24. package/lib/commonjs/plugins/console/ConsoleInterceptor.js.map +1 -0
  25. package/lib/commonjs/plugins/console/ConsoleViewerPlugin.js +269 -0
  26. package/lib/commonjs/plugins/console/ConsoleViewerPlugin.js.map +1 -0
  27. package/lib/commonjs/plugins/crashReporter/CrashReporterPlugin.js +363 -0
  28. package/lib/commonjs/plugins/crashReporter/CrashReporterPlugin.js.map +1 -0
  29. package/lib/commonjs/plugins/customActions/CustomActionsPlugin.js +218 -0
  30. package/lib/commonjs/plugins/customActions/CustomActionsPlugin.js.map +1 -0
  31. package/lib/commonjs/plugins/customActions/actionStore.js +46 -0
  32. package/lib/commonjs/plugins/customActions/actionStore.js.map +1 -0
  33. package/lib/commonjs/plugins/deepLinkTester/DeepLinkTesterPlugin.js +268 -0
  34. package/lib/commonjs/plugins/deepLinkTester/DeepLinkTesterPlugin.js.map +1 -0
  35. package/lib/commonjs/plugins/deviceInfo/DeviceInfoPlugin.js +184 -0
  36. package/lib/commonjs/plugins/deviceInfo/DeviceInfoPlugin.js.map +1 -0
  37. package/lib/commonjs/plugins/featureFlags/FeatureFlagsPlugin.js +381 -0
  38. package/lib/commonjs/plugins/featureFlags/FeatureFlagsPlugin.js.map +1 -0
  39. package/lib/commonjs/plugins/featureFlags/flagStore.js +125 -0
  40. package/lib/commonjs/plugins/featureFlags/flagStore.js.map +1 -0
  41. package/lib/commonjs/plugins/navigationInspector/NavigationInspectorPlugin.js +250 -0
  42. package/lib/commonjs/plugins/navigationInspector/NavigationInspectorPlugin.js.map +1 -0
  43. package/lib/commonjs/plugins/navigationInspector/navigationStore.js +65 -0
  44. package/lib/commonjs/plugins/navigationInspector/navigationStore.js.map +1 -0
  45. package/lib/commonjs/plugins/network/NetworkInspectorPlugin.js +709 -0
  46. package/lib/commonjs/plugins/network/NetworkInspectorPlugin.js.map +1 -0
  47. package/lib/commonjs/plugins/network/NetworkInterceptor.js +305 -0
  48. package/lib/commonjs/plugins/network/NetworkInterceptor.js.map +1 -0
  49. package/lib/commonjs/plugins/performance/PerformanceMonitorPlugin.js +261 -0
  50. package/lib/commonjs/plugins/performance/PerformanceMonitorPlugin.js.map +1 -0
  51. package/lib/commonjs/plugins/remoteConfig/RemoteConfigPlugin.js +265 -0
  52. package/lib/commonjs/plugins/remoteConfig/RemoteConfigPlugin.js.map +1 -0
  53. package/lib/commonjs/plugins/remoteConfig/remoteConfigStore.js +50 -0
  54. package/lib/commonjs/plugins/remoteConfig/remoteConfigStore.js.map +1 -0
  55. package/lib/commonjs/plugins/stateInspector/StateInspectorPlugin.js +378 -0
  56. package/lib/commonjs/plugins/stateInspector/StateInspectorPlugin.js.map +1 -0
  57. package/lib/commonjs/plugins/stateInspector/stateAdapterRegistry.js +62 -0
  58. package/lib/commonjs/plugins/stateInspector/stateAdapterRegistry.js.map +1 -0
  59. package/lib/commonjs/plugins/storageBrowser/StorageBrowserPlugin.js +496 -0
  60. package/lib/commonjs/plugins/storageBrowser/StorageBrowserPlugin.js.map +1 -0
  61. package/lib/commonjs/plugins/storageBrowser/storageAdapterRegistry.js +44 -0
  62. package/lib/commonjs/plugins/storageBrowser/storageAdapterRegistry.js.map +1 -0
  63. package/lib/commonjs/plugins/timeline/TimelinePlugin.js +294 -0
  64. package/lib/commonjs/plugins/timeline/TimelinePlugin.js.map +1 -0
  65. package/lib/commonjs/plugins/timeline/timelineStore.js +61 -0
  66. package/lib/commonjs/plugins/timeline/timelineStore.js.map +1 -0
  67. package/lib/module/core/DebugBubble.js +131 -0
  68. package/lib/module/core/DebugBubble.js.map +1 -0
  69. package/lib/module/core/DebugOverlay.js +176 -0
  70. package/lib/module/core/DebugOverlay.js.map +1 -0
  71. package/lib/module/core/DebuggerProvider.js +167 -0
  72. package/lib/module/core/DebuggerProvider.js.map +1 -0
  73. package/lib/module/core/GestureDetector.js +75 -0
  74. package/lib/module/core/GestureDetector.js.map +1 -0
  75. package/lib/module/core/PluginRegistry.js +116 -0
  76. package/lib/module/core/PluginRegistry.js.map +1 -0
  77. package/lib/module/core/theme.js +43 -0
  78. package/lib/module/core/theme.js.map +1 -0
  79. package/lib/module/core/types.js +2 -0
  80. package/lib/module/core/types.js.map +1 -0
  81. package/lib/module/core/useDebugger.js +21 -0
  82. package/lib/module/core/useDebugger.js.map +1 -0
  83. package/lib/module/core/utils.js +219 -0
  84. package/lib/module/core/utils.js.map +1 -0
  85. package/lib/module/index.js +44 -0
  86. package/lib/module/index.js.map +1 -0
  87. package/lib/module/plugins/console/ConsoleInterceptor.js +97 -0
  88. package/lib/module/plugins/console/ConsoleInterceptor.js.map +1 -0
  89. package/lib/module/plugins/console/ConsoleViewerPlugin.js +262 -0
  90. package/lib/module/plugins/console/ConsoleViewerPlugin.js.map +1 -0
  91. package/lib/module/plugins/crashReporter/CrashReporterPlugin.js +357 -0
  92. package/lib/module/plugins/crashReporter/CrashReporterPlugin.js.map +1 -0
  93. package/lib/module/plugins/customActions/CustomActionsPlugin.js +211 -0
  94. package/lib/module/plugins/customActions/CustomActionsPlugin.js.map +1 -0
  95. package/lib/module/plugins/customActions/actionStore.js +38 -0
  96. package/lib/module/plugins/customActions/actionStore.js.map +1 -0
  97. package/lib/module/plugins/deepLinkTester/DeepLinkTesterPlugin.js +261 -0
  98. package/lib/module/plugins/deepLinkTester/DeepLinkTesterPlugin.js.map +1 -0
  99. package/lib/module/plugins/deviceInfo/DeviceInfoPlugin.js +177 -0
  100. package/lib/module/plugins/deviceInfo/DeviceInfoPlugin.js.map +1 -0
  101. package/lib/module/plugins/featureFlags/FeatureFlagsPlugin.js +374 -0
  102. package/lib/module/plugins/featureFlags/FeatureFlagsPlugin.js.map +1 -0
  103. package/lib/module/plugins/featureFlags/flagStore.js +117 -0
  104. package/lib/module/plugins/featureFlags/flagStore.js.map +1 -0
  105. package/lib/module/plugins/navigationInspector/NavigationInspectorPlugin.js +243 -0
  106. package/lib/module/plugins/navigationInspector/NavigationInspectorPlugin.js.map +1 -0
  107. package/lib/module/plugins/navigationInspector/navigationStore.js +58 -0
  108. package/lib/module/plugins/navigationInspector/navigationStore.js.map +1 -0
  109. package/lib/module/plugins/network/NetworkInspectorPlugin.js +703 -0
  110. package/lib/module/plugins/network/NetworkInspectorPlugin.js.map +1 -0
  111. package/lib/module/plugins/network/NetworkInterceptor.js +299 -0
  112. package/lib/module/plugins/network/NetworkInterceptor.js.map +1 -0
  113. package/lib/module/plugins/performance/PerformanceMonitorPlugin.js +254 -0
  114. package/lib/module/plugins/performance/PerformanceMonitorPlugin.js.map +1 -0
  115. package/lib/module/plugins/remoteConfig/RemoteConfigPlugin.js +258 -0
  116. package/lib/module/plugins/remoteConfig/RemoteConfigPlugin.js.map +1 -0
  117. package/lib/module/plugins/remoteConfig/remoteConfigStore.js +43 -0
  118. package/lib/module/plugins/remoteConfig/remoteConfigStore.js.map +1 -0
  119. package/lib/module/plugins/stateInspector/StateInspectorPlugin.js +372 -0
  120. package/lib/module/plugins/stateInspector/StateInspectorPlugin.js.map +1 -0
  121. package/lib/module/plugins/stateInspector/stateAdapterRegistry.js +54 -0
  122. package/lib/module/plugins/stateInspector/stateAdapterRegistry.js.map +1 -0
  123. package/lib/module/plugins/storageBrowser/StorageBrowserPlugin.js +489 -0
  124. package/lib/module/plugins/storageBrowser/StorageBrowserPlugin.js.map +1 -0
  125. package/lib/module/plugins/storageBrowser/storageAdapterRegistry.js +36 -0
  126. package/lib/module/plugins/storageBrowser/storageAdapterRegistry.js.map +1 -0
  127. package/lib/module/plugins/timeline/TimelinePlugin.js +287 -0
  128. package/lib/module/plugins/timeline/TimelinePlugin.js.map +1 -0
  129. package/lib/module/plugins/timeline/timelineStore.js +54 -0
  130. package/lib/module/plugins/timeline/timelineStore.js.map +1 -0
  131. package/lib/typescript/core/DebugBubble.d.ts +22 -0
  132. package/lib/typescript/core/DebugBubble.d.ts.map +1 -0
  133. package/lib/typescript/core/DebugOverlay.d.ts +18 -0
  134. package/lib/typescript/core/DebugOverlay.d.ts.map +1 -0
  135. package/lib/typescript/core/DebuggerProvider.d.ts +25 -0
  136. package/lib/typescript/core/DebuggerProvider.d.ts.map +1 -0
  137. package/lib/typescript/core/GestureDetector.d.ts +20 -0
  138. package/lib/typescript/core/GestureDetector.d.ts.map +1 -0
  139. package/lib/typescript/core/PluginRegistry.d.ts +41 -0
  140. package/lib/typescript/core/PluginRegistry.d.ts.map +1 -0
  141. package/lib/typescript/core/theme.d.ts +11 -0
  142. package/lib/typescript/core/theme.d.ts.map +1 -0
  143. package/lib/typescript/core/types.d.ts +269 -0
  144. package/lib/typescript/core/types.d.ts.map +1 -0
  145. package/lib/typescript/core/useDebugger.d.ts +14 -0
  146. package/lib/typescript/core/useDebugger.d.ts.map +1 -0
  147. package/lib/typescript/core/utils.d.ts +46 -0
  148. package/lib/typescript/core/utils.d.ts.map +1 -0
  149. package/lib/typescript/index.d.ts +23 -0
  150. package/lib/typescript/index.d.ts.map +1 -0
  151. package/lib/typescript/plugins/console/ConsoleInterceptor.d.ts +32 -0
  152. package/lib/typescript/plugins/console/ConsoleInterceptor.d.ts.map +1 -0
  153. package/lib/typescript/plugins/console/ConsoleViewerPlugin.d.ts +3 -0
  154. package/lib/typescript/plugins/console/ConsoleViewerPlugin.d.ts.map +1 -0
  155. package/lib/typescript/plugins/crashReporter/CrashReporterPlugin.d.ts +3 -0
  156. package/lib/typescript/plugins/crashReporter/CrashReporterPlugin.d.ts.map +1 -0
  157. package/lib/typescript/plugins/customActions/CustomActionsPlugin.d.ts +3 -0
  158. package/lib/typescript/plugins/customActions/CustomActionsPlugin.d.ts.map +1 -0
  159. package/lib/typescript/plugins/customActions/actionStore.d.ts +16 -0
  160. package/lib/typescript/plugins/customActions/actionStore.d.ts.map +1 -0
  161. package/lib/typescript/plugins/deepLinkTester/DeepLinkTesterPlugin.d.ts +3 -0
  162. package/lib/typescript/plugins/deepLinkTester/DeepLinkTesterPlugin.d.ts.map +1 -0
  163. package/lib/typescript/plugins/deviceInfo/DeviceInfoPlugin.d.ts +3 -0
  164. package/lib/typescript/plugins/deviceInfo/DeviceInfoPlugin.d.ts.map +1 -0
  165. package/lib/typescript/plugins/featureFlags/FeatureFlagsPlugin.d.ts +3 -0
  166. package/lib/typescript/plugins/featureFlags/FeatureFlagsPlugin.d.ts.map +1 -0
  167. package/lib/typescript/plugins/featureFlags/flagStore.d.ts +45 -0
  168. package/lib/typescript/plugins/featureFlags/flagStore.d.ts.map +1 -0
  169. package/lib/typescript/plugins/navigationInspector/NavigationInspectorPlugin.d.ts +3 -0
  170. package/lib/typescript/plugins/navigationInspector/NavigationInspectorPlugin.d.ts.map +1 -0
  171. package/lib/typescript/plugins/navigationInspector/navigationStore.d.ts +30 -0
  172. package/lib/typescript/plugins/navigationInspector/navigationStore.d.ts.map +1 -0
  173. package/lib/typescript/plugins/network/NetworkInspectorPlugin.d.ts +3 -0
  174. package/lib/typescript/plugins/network/NetworkInspectorPlugin.d.ts.map +1 -0
  175. package/lib/typescript/plugins/network/NetworkInterceptor.d.ts +42 -0
  176. package/lib/typescript/plugins/network/NetworkInterceptor.d.ts.map +1 -0
  177. package/lib/typescript/plugins/performance/PerformanceMonitorPlugin.d.ts +3 -0
  178. package/lib/typescript/plugins/performance/PerformanceMonitorPlugin.d.ts.map +1 -0
  179. package/lib/typescript/plugins/remoteConfig/RemoteConfigPlugin.d.ts +3 -0
  180. package/lib/typescript/plugins/remoteConfig/RemoteConfigPlugin.d.ts.map +1 -0
  181. package/lib/typescript/plugins/remoteConfig/remoteConfigStore.d.ts +20 -0
  182. package/lib/typescript/plugins/remoteConfig/remoteConfigStore.d.ts.map +1 -0
  183. package/lib/typescript/plugins/stateInspector/StateInspectorPlugin.d.ts +3 -0
  184. package/lib/typescript/plugins/stateInspector/StateInspectorPlugin.d.ts.map +1 -0
  185. package/lib/typescript/plugins/stateInspector/stateAdapterRegistry.d.ts +34 -0
  186. package/lib/typescript/plugins/stateInspector/stateAdapterRegistry.d.ts.map +1 -0
  187. package/lib/typescript/plugins/storageBrowser/StorageBrowserPlugin.d.ts +3 -0
  188. package/lib/typescript/plugins/storageBrowser/StorageBrowserPlugin.d.ts.map +1 -0
  189. package/lib/typescript/plugins/storageBrowser/storageAdapterRegistry.d.ts +16 -0
  190. package/lib/typescript/plugins/storageBrowser/storageAdapterRegistry.d.ts.map +1 -0
  191. package/lib/typescript/plugins/timeline/TimelinePlugin.d.ts +3 -0
  192. package/lib/typescript/plugins/timeline/TimelinePlugin.d.ts.map +1 -0
  193. package/lib/typescript/plugins/timeline/timelineStore.d.ts +24 -0
  194. package/lib/typescript/plugins/timeline/timelineStore.d.ts.map +1 -0
  195. package/package.json +131 -0
  196. package/src/core/DebugBubble.tsx +149 -0
  197. package/src/core/DebugOverlay.tsx +211 -0
  198. package/src/core/DebuggerProvider.tsx +211 -0
  199. package/src/core/GestureDetector.tsx +95 -0
  200. package/src/core/PluginRegistry.ts +118 -0
  201. package/src/core/theme.ts +41 -0
  202. package/src/core/types.ts +339 -0
  203. package/src/core/useDebugger.ts +24 -0
  204. package/src/core/utils.ts +221 -0
  205. package/src/index.ts +67 -0
  206. package/src/plugins/console/ConsoleInterceptor.ts +110 -0
  207. package/src/plugins/console/ConsoleViewerPlugin.tsx +241 -0
  208. package/src/plugins/crashReporter/CrashReporterPlugin.tsx +316 -0
  209. package/src/plugins/customActions/CustomActionsPlugin.tsx +199 -0
  210. package/src/plugins/customActions/actionStore.ts +49 -0
  211. package/src/plugins/deepLinkTester/DeepLinkTesterPlugin.tsx +213 -0
  212. package/src/plugins/deviceInfo/DeviceInfoPlugin.tsx +153 -0
  213. package/src/plugins/featureFlags/FeatureFlagsPlugin.tsx +338 -0
  214. package/src/plugins/featureFlags/flagStore.ts +118 -0
  215. package/src/plugins/navigationInspector/NavigationInspectorPlugin.tsx +170 -0
  216. package/src/plugins/navigationInspector/navigationStore.ts +70 -0
  217. package/src/plugins/network/NetworkInspectorPlugin.tsx +598 -0
  218. package/src/plugins/network/NetworkInterceptor.ts +344 -0
  219. package/src/plugins/performance/PerformanceMonitorPlugin.tsx +194 -0
  220. package/src/plugins/remoteConfig/RemoteConfigPlugin.tsx +205 -0
  221. package/src/plugins/remoteConfig/remoteConfigStore.ts +48 -0
  222. package/src/plugins/stateInspector/StateInspectorPlugin.tsx +342 -0
  223. package/src/plugins/stateInspector/stateAdapterRegistry.ts +66 -0
  224. package/src/plugins/storageBrowser/StorageBrowserPlugin.tsx +410 -0
  225. package/src/plugins/storageBrowser/storageAdapterRegistry.ts +47 -0
  226. package/src/plugins/timeline/TimelinePlugin.tsx +242 -0
  227. package/src/plugins/timeline/timelineStore.ts +65 -0
@@ -0,0 +1,703 @@
1
+ import React, { useState, useEffect, useCallback, useMemo } from 'react';
2
+ import { View, Text, FlatList, TouchableOpacity, TextInput, StyleSheet, ScrollView } from 'react-native';
3
+ import { NetworkInterceptor } from './NetworkInterceptor';
4
+ import { formatDuration, formatBytes, formatTimestamp, getStatusColor, getMethodColor, truncate, toCurl, copyToClipboard, safeStringify, shareText } from '../../core/utils';
5
+
6
+ // ─── Network Inspector Plugin Component ─────────────────────────────────────
7
+
8
+ const NetworkInspectorPanel = ({
9
+ theme
10
+ }) => {
11
+ const [requests, setRequests] = useState([]);
12
+ const [searchQuery, setSearchQuery] = useState('');
13
+ const [selectedRequest, setSelectedRequest] = useState(null);
14
+ const [activeDetailTab, setActiveDetailTab] = useState('headers');
15
+ const [methodFilter, setMethodFilter] = useState(null);
16
+ useEffect(() => {
17
+ const unsubscribe = NetworkInterceptor.subscribe(setRequests);
18
+ return unsubscribe;
19
+ }, []);
20
+ const filteredRequests = useMemo(() => {
21
+ let filtered = requests;
22
+ if (searchQuery) {
23
+ const q = searchQuery.toLowerCase();
24
+ filtered = filtered.filter(r => r.url.toLowerCase().includes(q) || r.method.toLowerCase().includes(q) || r.gqlOperation?.toLowerCase().includes(q) || String(r.status).includes(q));
25
+ }
26
+ if (methodFilter) {
27
+ filtered = filtered.filter(r => r.method === methodFilter);
28
+ }
29
+ return filtered;
30
+ }, [requests, searchQuery, methodFilter]);
31
+ const stats = useMemo(() => {
32
+ const total = requests.length;
33
+ const errors = requests.filter(r => r.isError).length;
34
+ const pending = requests.filter(r => !r.endTime).length;
35
+ return {
36
+ total,
37
+ errors,
38
+ pending
39
+ };
40
+ }, [requests]);
41
+ const handleClear = useCallback(() => {
42
+ NetworkInterceptor.clear();
43
+ setSelectedRequest(null);
44
+ }, []);
45
+ const handleCopyCurl = useCallback(req => {
46
+ copyToClipboard(toCurl(req));
47
+ }, []);
48
+ const handleShareRequest = useCallback(req => {
49
+ const data = safeStringify({
50
+ url: req.url,
51
+ method: req.method,
52
+ status: req.status,
53
+ duration: req.duration,
54
+ requestHeaders: req.requestHeaders,
55
+ responseHeaders: req.responseHeaders,
56
+ requestBody: req.requestBody,
57
+ responseBody: req.responseBody
58
+ });
59
+ shareText(data, `${req.method} ${req.url}`);
60
+ }, []);
61
+ if (selectedRequest) {
62
+ return /*#__PURE__*/React.createElement(RequestDetail, {
63
+ request: selectedRequest,
64
+ theme: theme,
65
+ activeTab: activeDetailTab,
66
+ onTabChange: setActiveDetailTab,
67
+ onBack: () => setSelectedRequest(null),
68
+ onCopyCurl: handleCopyCurl,
69
+ onShare: handleShareRequest
70
+ });
71
+ }
72
+ return /*#__PURE__*/React.createElement(View, {
73
+ style: styles.container
74
+ }, /*#__PURE__*/React.createElement(View, {
75
+ style: [styles.statsBar, {
76
+ backgroundColor: theme.surface
77
+ }]
78
+ }, /*#__PURE__*/React.createElement(View, {
79
+ style: styles.statsRow
80
+ }, /*#__PURE__*/React.createElement(Text, {
81
+ style: [styles.statText, {
82
+ color: theme.text
83
+ }]
84
+ }, stats.total, " requests"), stats.errors > 0 && /*#__PURE__*/React.createElement(Text, {
85
+ style: [styles.statText, {
86
+ color: theme.error
87
+ }]
88
+ }, stats.errors, " errors"), stats.pending > 0 && /*#__PURE__*/React.createElement(Text, {
89
+ style: [styles.statText, {
90
+ color: theme.warning
91
+ }]
92
+ }, stats.pending, " pending")), /*#__PURE__*/React.createElement(TouchableOpacity, {
93
+ onPress: handleClear,
94
+ activeOpacity: 0.7
95
+ }, /*#__PURE__*/React.createElement(Text, {
96
+ style: [styles.clearButton, {
97
+ color: theme.error
98
+ }]
99
+ }, "Clear"))), /*#__PURE__*/React.createElement(View, {
100
+ style: [styles.searchContainer, {
101
+ backgroundColor: theme.surface
102
+ }]
103
+ }, /*#__PURE__*/React.createElement(TextInput, {
104
+ style: [styles.searchInput, {
105
+ color: theme.text,
106
+ backgroundColor: theme.surfaceAlt,
107
+ borderColor: theme.border
108
+ }],
109
+ placeholder: "Search URL, method, status...",
110
+ placeholderTextColor: theme.textMuted,
111
+ value: searchQuery,
112
+ onChangeText: setSearchQuery,
113
+ autoCapitalize: "none",
114
+ autoCorrect: false
115
+ })), /*#__PURE__*/React.createElement(ScrollView, {
116
+ horizontal: true,
117
+ showsHorizontalScrollIndicator: false,
118
+ style: [styles.filterContainer, {
119
+ backgroundColor: theme.surface
120
+ }],
121
+ contentContainerStyle: styles.filterContent
122
+ }, ['ALL', 'GET', 'POST', 'PUT', 'PATCH', 'DELETE'].map(method => /*#__PURE__*/React.createElement(TouchableOpacity, {
123
+ key: method,
124
+ style: [styles.filterChip, {
125
+ backgroundColor: method === 'ALL' && !methodFilter || methodFilter === method ? theme.accent : theme.surfaceAlt,
126
+ borderColor: theme.border
127
+ }],
128
+ onPress: () => setMethodFilter(method === 'ALL' ? null : method),
129
+ activeOpacity: 0.7
130
+ }, /*#__PURE__*/React.createElement(Text, {
131
+ style: [styles.filterChipText, {
132
+ color: method === 'ALL' && !methodFilter || methodFilter === method ? '#FFFFFF' : theme.textSecondary
133
+ }]
134
+ }, method)))), /*#__PURE__*/React.createElement(FlatList, {
135
+ data: filteredRequests,
136
+ keyExtractor: item => item.id,
137
+ renderItem: ({
138
+ item
139
+ }) => /*#__PURE__*/React.createElement(RequestRow, {
140
+ request: item,
141
+ theme: theme,
142
+ onPress: () => setSelectedRequest(item)
143
+ }),
144
+ ListEmptyComponent: /*#__PURE__*/React.createElement(View, {
145
+ style: styles.emptyContainer
146
+ }, /*#__PURE__*/React.createElement(Text, {
147
+ style: [styles.emptyText, {
148
+ color: theme.textMuted
149
+ }]
150
+ }, searchQuery ? 'No matching requests' : 'No network requests captured yet')),
151
+ initialNumToRender: 20,
152
+ maxToRenderPerBatch: 10,
153
+ windowSize: 10
154
+ }));
155
+ };
156
+
157
+ // ─── Request Row ────────────────────────────────────────────────────────────
158
+
159
+ const RequestRow = /*#__PURE__*/React.memo(({
160
+ request,
161
+ theme,
162
+ onPress
163
+ }) => {
164
+ const urlPath = useMemo(() => {
165
+ try {
166
+ const parsed = new URL(request.url);
167
+ return parsed.pathname + parsed.search;
168
+ } catch {
169
+ return request.url;
170
+ }
171
+ }, [request.url]);
172
+ return /*#__PURE__*/React.createElement(TouchableOpacity, {
173
+ style: [styles.requestRow, {
174
+ backgroundColor: request.isError ? `${theme.error}10` : theme.surface,
175
+ borderBottomColor: theme.border
176
+ }],
177
+ onPress: onPress,
178
+ activeOpacity: 0.7
179
+ }, /*#__PURE__*/React.createElement(View, {
180
+ style: styles.requestRowLeft
181
+ }, /*#__PURE__*/React.createElement(View, {
182
+ style: styles.requestMethodContainer
183
+ }, /*#__PURE__*/React.createElement(Text, {
184
+ style: [styles.requestMethod, {
185
+ color: getMethodColor(request.method)
186
+ }]
187
+ }, request.method), /*#__PURE__*/React.createElement(Text, {
188
+ style: [styles.requestStatus, {
189
+ color: getStatusColor(request.status)
190
+ }]
191
+ }, request.status ?? '...')), /*#__PURE__*/React.createElement(Text, {
192
+ style: [styles.requestUrl, {
193
+ color: theme.text
194
+ }],
195
+ numberOfLines: 1
196
+ }, request.gqlOperation ? `[${request.gqlType}] ${request.gqlOperation}` : truncate(urlPath, 60))), /*#__PURE__*/React.createElement(View, {
197
+ style: styles.requestRowRight
198
+ }, /*#__PURE__*/React.createElement(Text, {
199
+ style: [styles.requestDuration, {
200
+ color: theme.textSecondary
201
+ }]
202
+ }, formatDuration(request.duration)), /*#__PURE__*/React.createElement(Text, {
203
+ style: [styles.requestSize, {
204
+ color: theme.textMuted
205
+ }]
206
+ }, formatBytes(request.responseSize)), /*#__PURE__*/React.createElement(Text, {
207
+ style: [styles.requestTime, {
208
+ color: theme.textMuted
209
+ }]
210
+ }, formatTimestamp(request.startTime))));
211
+ });
212
+
213
+ // ─── Request Detail ─────────────────────────────────────────────────────────
214
+
215
+ const RequestDetail = ({
216
+ request,
217
+ theme,
218
+ activeTab,
219
+ onTabChange,
220
+ onBack,
221
+ onCopyCurl,
222
+ onShare
223
+ }) => {
224
+ const tabs = ['headers', 'request', 'response', 'timing'];
225
+ return /*#__PURE__*/React.createElement(View, {
226
+ style: styles.container
227
+ }, /*#__PURE__*/React.createElement(View, {
228
+ style: [styles.detailHeader, {
229
+ backgroundColor: theme.surface,
230
+ borderBottomColor: theme.border
231
+ }]
232
+ }, /*#__PURE__*/React.createElement(TouchableOpacity, {
233
+ onPress: onBack,
234
+ activeOpacity: 0.7
235
+ }, /*#__PURE__*/React.createElement(Text, {
236
+ style: [styles.backButton, {
237
+ color: theme.accent
238
+ }]
239
+ }, "\u2190 Back")), /*#__PURE__*/React.createElement(View, {
240
+ style: styles.detailActions
241
+ }, /*#__PURE__*/React.createElement(TouchableOpacity, {
242
+ onPress: () => onCopyCurl(request),
243
+ style: [styles.actionButton, {
244
+ backgroundColor: theme.surfaceAlt
245
+ }],
246
+ activeOpacity: 0.7
247
+ }, /*#__PURE__*/React.createElement(Text, {
248
+ style: [styles.actionButtonText, {
249
+ color: theme.textSecondary
250
+ }]
251
+ }, "cURL")), /*#__PURE__*/React.createElement(TouchableOpacity, {
252
+ onPress: () => onShare(request),
253
+ style: [styles.actionButton, {
254
+ backgroundColor: theme.surfaceAlt
255
+ }],
256
+ activeOpacity: 0.7
257
+ }, /*#__PURE__*/React.createElement(Text, {
258
+ style: [styles.actionButtonText, {
259
+ color: theme.textSecondary
260
+ }]
261
+ }, "Share")))), /*#__PURE__*/React.createElement(View, {
262
+ style: [styles.urlDisplay, {
263
+ backgroundColor: theme.codeBackground
264
+ }]
265
+ }, /*#__PURE__*/React.createElement(Text, {
266
+ style: [styles.urlMethod, {
267
+ color: getMethodColor(request.method)
268
+ }]
269
+ }, request.method), /*#__PURE__*/React.createElement(Text, {
270
+ style: [styles.urlText, {
271
+ color: theme.codeText
272
+ }],
273
+ selectable: true
274
+ }, request.url)), /*#__PURE__*/React.createElement(View, {
275
+ style: [styles.detailTabBar, {
276
+ backgroundColor: theme.surface
277
+ }]
278
+ }, tabs.map(tab => /*#__PURE__*/React.createElement(TouchableOpacity, {
279
+ key: tab,
280
+ style: [styles.detailTab, {
281
+ borderBottomColor: activeTab === tab ? theme.accent : 'transparent'
282
+ }],
283
+ onPress: () => onTabChange(tab),
284
+ activeOpacity: 0.7
285
+ }, /*#__PURE__*/React.createElement(Text, {
286
+ style: [styles.detailTabText, {
287
+ color: activeTab === tab ? theme.accent : theme.textSecondary
288
+ }]
289
+ }, tab.charAt(0).toUpperCase() + tab.slice(1))))), /*#__PURE__*/React.createElement(ScrollView, {
290
+ style: styles.detailContent
291
+ }, activeTab === 'headers' && /*#__PURE__*/React.createElement(HeadersView, {
292
+ request: request,
293
+ theme: theme
294
+ }), activeTab === 'request' && /*#__PURE__*/React.createElement(BodyView, {
295
+ body: request.requestBody,
296
+ theme: theme,
297
+ label: "Request Body"
298
+ }), activeTab === 'response' && /*#__PURE__*/React.createElement(BodyView, {
299
+ body: request.responseBody,
300
+ theme: theme,
301
+ label: "Response Body"
302
+ }), activeTab === 'timing' && /*#__PURE__*/React.createElement(TimingView, {
303
+ request: request,
304
+ theme: theme
305
+ })));
306
+ };
307
+
308
+ // ─── Sub-views ──────────────────────────────────────────────────────────────
309
+
310
+ const HeadersView = ({
311
+ request,
312
+ theme
313
+ }) => /*#__PURE__*/React.createElement(View, {
314
+ style: styles.sectionContainer
315
+ }, /*#__PURE__*/React.createElement(Text, {
316
+ style: [styles.sectionTitle, {
317
+ color: theme.text
318
+ }]
319
+ }, "Request Headers"), request.requestHeaders && Object.keys(request.requestHeaders).length > 0 ? Object.entries(request.requestHeaders).map(([key, value]) => /*#__PURE__*/React.createElement(View, {
320
+ key: key,
321
+ style: [styles.headerRow, {
322
+ borderBottomColor: theme.border
323
+ }]
324
+ }, /*#__PURE__*/React.createElement(Text, {
325
+ style: [styles.headerKey, {
326
+ color: theme.accent
327
+ }]
328
+ }, key), /*#__PURE__*/React.createElement(Text, {
329
+ style: [styles.headerValue, {
330
+ color: theme.text
331
+ }],
332
+ selectable: true
333
+ }, value))) : /*#__PURE__*/React.createElement(Text, {
334
+ style: [styles.emptyText, {
335
+ color: theme.textMuted
336
+ }]
337
+ }, "No headers"), /*#__PURE__*/React.createElement(Text, {
338
+ style: [styles.sectionTitle, {
339
+ color: theme.text,
340
+ marginTop: 16
341
+ }]
342
+ }, "Response Headers"), request.responseHeaders && Object.keys(request.responseHeaders).length > 0 ? Object.entries(request.responseHeaders).map(([key, value]) => /*#__PURE__*/React.createElement(View, {
343
+ key: key,
344
+ style: [styles.headerRow, {
345
+ borderBottomColor: theme.border
346
+ }]
347
+ }, /*#__PURE__*/React.createElement(Text, {
348
+ style: [styles.headerKey, {
349
+ color: theme.accent
350
+ }]
351
+ }, key), /*#__PURE__*/React.createElement(Text, {
352
+ style: [styles.headerValue, {
353
+ color: theme.text
354
+ }],
355
+ selectable: true
356
+ }, value))) : /*#__PURE__*/React.createElement(Text, {
357
+ style: [styles.emptyText, {
358
+ color: theme.textMuted
359
+ }]
360
+ }, request.endTime ? 'No headers' : 'Pending...'));
361
+ const BodyView = ({
362
+ body,
363
+ theme,
364
+ label
365
+ }) => {
366
+ const formatted = useMemo(() => {
367
+ if (!body) return null;
368
+ try {
369
+ const parsed = JSON.parse(body);
370
+ return JSON.stringify(parsed, null, 2);
371
+ } catch {
372
+ return body;
373
+ }
374
+ }, [body]);
375
+ return /*#__PURE__*/React.createElement(View, {
376
+ style: styles.sectionContainer
377
+ }, /*#__PURE__*/React.createElement(View, {
378
+ style: styles.sectionHeaderRow
379
+ }, /*#__PURE__*/React.createElement(Text, {
380
+ style: [styles.sectionTitle, {
381
+ color: theme.text
382
+ }]
383
+ }, label), formatted && /*#__PURE__*/React.createElement(TouchableOpacity, {
384
+ onPress: () => copyToClipboard(formatted),
385
+ activeOpacity: 0.7
386
+ }, /*#__PURE__*/React.createElement(Text, {
387
+ style: [styles.copyButton, {
388
+ color: theme.accent
389
+ }]
390
+ }, "Copy"))), formatted ? /*#__PURE__*/React.createElement(View, {
391
+ style: [styles.codeBlock, {
392
+ backgroundColor: theme.codeBackground
393
+ }]
394
+ }, /*#__PURE__*/React.createElement(Text, {
395
+ style: [styles.codeText, {
396
+ color: theme.codeText
397
+ }],
398
+ selectable: true
399
+ }, formatted)) : /*#__PURE__*/React.createElement(Text, {
400
+ style: [styles.emptyText, {
401
+ color: theme.textMuted
402
+ }]
403
+ }, "No body"));
404
+ };
405
+ const TimingView = ({
406
+ request,
407
+ theme
408
+ }) => /*#__PURE__*/React.createElement(View, {
409
+ style: styles.sectionContainer
410
+ }, /*#__PURE__*/React.createElement(View, {
411
+ style: [styles.timingRow, {
412
+ borderBottomColor: theme.border
413
+ }]
414
+ }, /*#__PURE__*/React.createElement(Text, {
415
+ style: [styles.timingLabel, {
416
+ color: theme.textSecondary
417
+ }]
418
+ }, "Started"), /*#__PURE__*/React.createElement(Text, {
419
+ style: [styles.timingValue, {
420
+ color: theme.text
421
+ }]
422
+ }, formatTimestamp(request.startTime))), request.endTime && /*#__PURE__*/React.createElement(View, {
423
+ style: [styles.timingRow, {
424
+ borderBottomColor: theme.border
425
+ }]
426
+ }, /*#__PURE__*/React.createElement(Text, {
427
+ style: [styles.timingLabel, {
428
+ color: theme.textSecondary
429
+ }]
430
+ }, "Completed"), /*#__PURE__*/React.createElement(Text, {
431
+ style: [styles.timingValue, {
432
+ color: theme.text
433
+ }]
434
+ }, formatTimestamp(request.endTime))), /*#__PURE__*/React.createElement(View, {
435
+ style: [styles.timingRow, {
436
+ borderBottomColor: theme.border
437
+ }]
438
+ }, /*#__PURE__*/React.createElement(Text, {
439
+ style: [styles.timingLabel, {
440
+ color: theme.textSecondary
441
+ }]
442
+ }, "Duration"), /*#__PURE__*/React.createElement(Text, {
443
+ style: [styles.timingValue, {
444
+ color: request.duration && request.duration > 3000 ? theme.warning : theme.success
445
+ }]
446
+ }, formatDuration(request.duration))), /*#__PURE__*/React.createElement(View, {
447
+ style: [styles.timingRow, {
448
+ borderBottomColor: theme.border
449
+ }]
450
+ }, /*#__PURE__*/React.createElement(Text, {
451
+ style: [styles.timingLabel, {
452
+ color: theme.textSecondary
453
+ }]
454
+ }, "Request Size"), /*#__PURE__*/React.createElement(Text, {
455
+ style: [styles.timingValue, {
456
+ color: theme.text
457
+ }]
458
+ }, formatBytes(request.requestSize))), /*#__PURE__*/React.createElement(View, {
459
+ style: [styles.timingRow, {
460
+ borderBottomColor: theme.border
461
+ }]
462
+ }, /*#__PURE__*/React.createElement(Text, {
463
+ style: [styles.timingLabel, {
464
+ color: theme.textSecondary
465
+ }]
466
+ }, "Response Size"), /*#__PURE__*/React.createElement(Text, {
467
+ style: [styles.timingValue, {
468
+ color: theme.text
469
+ }]
470
+ }, formatBytes(request.responseSize))));
471
+
472
+ // ─── Styles ─────────────────────────────────────────────────────────────────
473
+
474
+ const styles = StyleSheet.create({
475
+ container: {
476
+ flex: 1
477
+ },
478
+ statsBar: {
479
+ flexDirection: 'row',
480
+ justifyContent: 'space-between',
481
+ alignItems: 'center',
482
+ paddingHorizontal: 12,
483
+ paddingVertical: 8
484
+ },
485
+ statsRow: {
486
+ flexDirection: 'row',
487
+ gap: 12
488
+ },
489
+ statText: {
490
+ fontSize: 12,
491
+ fontWeight: '600'
492
+ },
493
+ clearButton: {
494
+ fontSize: 13,
495
+ fontWeight: '700'
496
+ },
497
+ searchContainer: {
498
+ paddingHorizontal: 12,
499
+ paddingBottom: 8
500
+ },
501
+ searchInput: {
502
+ height: 36,
503
+ borderRadius: 8,
504
+ paddingHorizontal: 12,
505
+ fontSize: 13,
506
+ borderWidth: 1
507
+ },
508
+ filterContainer: {
509
+ maxHeight: 44
510
+ },
511
+ filterContent: {
512
+ paddingHorizontal: 12,
513
+ paddingBottom: 8,
514
+ gap: 6
515
+ },
516
+ filterChip: {
517
+ paddingHorizontal: 12,
518
+ paddingVertical: 4,
519
+ borderRadius: 12,
520
+ borderWidth: 1
521
+ },
522
+ filterChipText: {
523
+ fontSize: 11,
524
+ fontWeight: '600'
525
+ },
526
+ requestRow: {
527
+ flexDirection: 'row',
528
+ justifyContent: 'space-between',
529
+ alignItems: 'center',
530
+ paddingHorizontal: 12,
531
+ paddingVertical: 10,
532
+ borderBottomWidth: StyleSheet.hairlineWidth
533
+ },
534
+ requestRowLeft: {
535
+ flex: 1,
536
+ marginRight: 8
537
+ },
538
+ requestRowRight: {
539
+ alignItems: 'flex-end'
540
+ },
541
+ requestMethodContainer: {
542
+ flexDirection: 'row',
543
+ alignItems: 'center',
544
+ gap: 8,
545
+ marginBottom: 2
546
+ },
547
+ requestMethod: {
548
+ fontSize: 11,
549
+ fontWeight: '800',
550
+ letterSpacing: 0.5
551
+ },
552
+ requestStatus: {
553
+ fontSize: 11,
554
+ fontWeight: '700'
555
+ },
556
+ requestUrl: {
557
+ fontSize: 12
558
+ },
559
+ requestDuration: {
560
+ fontSize: 11,
561
+ fontWeight: '600'
562
+ },
563
+ requestSize: {
564
+ fontSize: 10,
565
+ marginTop: 1
566
+ },
567
+ requestTime: {
568
+ fontSize: 10,
569
+ marginTop: 1
570
+ },
571
+ emptyContainer: {
572
+ alignItems: 'center',
573
+ paddingVertical: 40
574
+ },
575
+ emptyText: {
576
+ fontSize: 13
577
+ },
578
+ detailHeader: {
579
+ flexDirection: 'row',
580
+ justifyContent: 'space-between',
581
+ alignItems: 'center',
582
+ paddingHorizontal: 12,
583
+ paddingVertical: 10,
584
+ borderBottomWidth: StyleSheet.hairlineWidth
585
+ },
586
+ backButton: {
587
+ fontSize: 14,
588
+ fontWeight: '600'
589
+ },
590
+ detailActions: {
591
+ flexDirection: 'row',
592
+ gap: 8
593
+ },
594
+ actionButton: {
595
+ paddingHorizontal: 10,
596
+ paddingVertical: 4,
597
+ borderRadius: 8
598
+ },
599
+ actionButtonText: {
600
+ fontSize: 11,
601
+ fontWeight: '600'
602
+ },
603
+ urlDisplay: {
604
+ padding: 12,
605
+ flexDirection: 'row',
606
+ alignItems: 'flex-start',
607
+ gap: 8
608
+ },
609
+ urlMethod: {
610
+ fontSize: 12,
611
+ fontWeight: '800'
612
+ },
613
+ urlText: {
614
+ fontSize: 11,
615
+ flex: 1
616
+ },
617
+ detailTabBar: {
618
+ flexDirection: 'row'
619
+ },
620
+ detailTab: {
621
+ flex: 1,
622
+ alignItems: 'center',
623
+ paddingVertical: 10,
624
+ borderBottomWidth: 2
625
+ },
626
+ detailTabText: {
627
+ fontSize: 12,
628
+ fontWeight: '600'
629
+ },
630
+ detailContent: {
631
+ flex: 1
632
+ },
633
+ sectionContainer: {
634
+ padding: 12
635
+ },
636
+ sectionTitle: {
637
+ fontSize: 14,
638
+ fontWeight: '700',
639
+ marginBottom: 8
640
+ },
641
+ sectionHeaderRow: {
642
+ flexDirection: 'row',
643
+ justifyContent: 'space-between',
644
+ alignItems: 'center',
645
+ marginBottom: 8
646
+ },
647
+ copyButton: {
648
+ fontSize: 12,
649
+ fontWeight: '600'
650
+ },
651
+ headerRow: {
652
+ flexDirection: 'row',
653
+ paddingVertical: 6,
654
+ borderBottomWidth: StyleSheet.hairlineWidth
655
+ },
656
+ headerKey: {
657
+ fontSize: 11,
658
+ fontWeight: '600',
659
+ width: 120,
660
+ marginRight: 8
661
+ },
662
+ headerValue: {
663
+ fontSize: 11,
664
+ flex: 1
665
+ },
666
+ codeBlock: {
667
+ padding: 12,
668
+ borderRadius: 8
669
+ },
670
+ codeText: {
671
+ fontSize: 11,
672
+ fontFamily: 'monospace',
673
+ lineHeight: 18
674
+ },
675
+ timingRow: {
676
+ flexDirection: 'row',
677
+ justifyContent: 'space-between',
678
+ paddingVertical: 10,
679
+ borderBottomWidth: StyleSheet.hairlineWidth
680
+ },
681
+ timingLabel: {
682
+ fontSize: 13
683
+ },
684
+ timingValue: {
685
+ fontSize: 13,
686
+ fontWeight: '600'
687
+ }
688
+ });
689
+
690
+ // ─── Plugin Factory ─────────────────────────────────────────────────────────
691
+
692
+ export function createNetworkInspectorPlugin() {
693
+ return {
694
+ id: 'network-inspector',
695
+ name: 'Network',
696
+ icon: '🌐',
697
+ component: NetworkInspectorPanel,
698
+ order: 10,
699
+ onInit: () => NetworkInterceptor.start(),
700
+ onDestroy: () => NetworkInterceptor.stop()
701
+ };
702
+ }
703
+ //# sourceMappingURL=NetworkInspectorPlugin.js.map