@buoy-gg/network 7.0.40 → 7.0.42

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 (275) hide show
  1. package/README.md +11 -79
  2. package/lib/commonjs/index.js +1 -325
  3. package/lib/commonjs/index.web.js +1 -420
  4. package/lib/commonjs/network/components/DataViewer.web.js +1 -879
  5. package/lib/commonjs/network/components/NetworkCopyScreen.web.js +1 -48
  6. package/lib/commonjs/network/components/NetworkCopySettingsView.js +27 -755
  7. package/lib/commonjs/network/components/NetworkCopySettingsView.web.js +14 -1242
  8. package/lib/commonjs/network/components/NetworkDetailScreen.web.js +1 -101
  9. package/lib/commonjs/network/components/NetworkDetailStepper.js +1 -108
  10. package/lib/commonjs/network/components/NetworkDetailStepper.web.js +1 -298
  11. package/lib/commonjs/network/components/NetworkEventDetailView.js +15 -1130
  12. package/lib/commonjs/network/components/NetworkEventDetailView.web.js +15 -1484
  13. package/lib/commonjs/network/components/NetworkEventItemCompact.js +2 -401
  14. package/lib/commonjs/network/components/NetworkEventItemCompact.web.js +2 -820
  15. package/lib/commonjs/network/components/NetworkFilterScreen.web.js +1 -55
  16. package/lib/commonjs/network/components/NetworkFilterViewV3.js +1 -442
  17. package/lib/commonjs/network/components/NetworkFilterViewV3.web.js +1 -1310
  18. package/lib/commonjs/network/components/NetworkHeaderLive.js +1 -375
  19. package/lib/commonjs/network/components/NetworkHeaderLive.web.js +1 -623
  20. package/lib/commonjs/network/components/NetworkHeaderMenu.js +1 -190
  21. package/lib/commonjs/network/components/NetworkListScreen.js +1 -404
  22. package/lib/commonjs/network/components/NetworkListScreen.web.js +1 -625
  23. package/lib/commonjs/network/components/NetworkModal.js +1 -786
  24. package/lib/commonjs/network/components/NetworkNumberPrompt.js +1 -178
  25. package/lib/commonjs/network/components/NetworkNumberPrompt.web.js +1 -232
  26. package/lib/commonjs/network/components/NetworkOverrideEditor.js +1 -814
  27. package/lib/commonjs/network/components/NetworkOverrideEditor.web.js +1 -942
  28. package/lib/commonjs/network/components/NetworkOverrideHeaderButton.js +1 -107
  29. package/lib/commonjs/network/components/NetworkOverrideHeaderButton.web.js +1 -133
  30. package/lib/commonjs/network/components/NetworkOverridesButton.js +1 -90
  31. package/lib/commonjs/network/components/NetworkOverridesButton.web.js +1 -143
  32. package/lib/commonjs/network/components/NetworkOverridesScreen.js +1 -543
  33. package/lib/commonjs/network/components/NetworkOverridesScreen.web.js +1 -830
  34. package/lib/commonjs/network/components/NetworkSavedScreen.js +1 -226
  35. package/lib/commonjs/network/components/NetworkSavedScreen.web.js +1 -463
  36. package/lib/commonjs/network/components/NetworkUpgradeBanner.js +1 -76
  37. package/lib/commonjs/network/components/response-editor/Explorer.js +1 -973
  38. package/lib/commonjs/network/components/response-editor/Explorer.web.js +1 -1136
  39. package/lib/commonjs/network/components/response-editor/deleteNestedDataByPath.js +1 -56
  40. package/lib/commonjs/network/components/response-editor/editorContext.js +1 -33
  41. package/lib/commonjs/network/components/response-editor/updateNestedDataByPath.js +1 -61
  42. package/lib/commonjs/network/conditions/NetworkConditionsControl.js +1 -235
  43. package/lib/commonjs/network/conditions/NetworkConditionsControl.test.js +1 -136
  44. package/lib/commonjs/network/conditions/NetworkConditionsIcon.js +1 -33
  45. package/lib/commonjs/network/conditions/NetworkFloatingTool.js +1 -310
  46. package/lib/commonjs/network/conditions/NetworkFloatingTool.test.js +1 -219
  47. package/lib/commonjs/network/conditions/store.js +1 -75
  48. package/lib/commonjs/network/conditions/wait.js +1 -43
  49. package/lib/commonjs/network/conditions/xhr.js +1 -110
  50. package/lib/commonjs/network/hooks/useLiveNetworkEvent.js +1 -62
  51. package/lib/commonjs/network/hooks/useNetworkBadgeCounts.js +1 -83
  52. package/lib/commonjs/network/hooks/useNetworkEventList.js +1 -108
  53. package/lib/commonjs/network/hooks/useNetworkEvents.js +1 -318
  54. package/lib/commonjs/network/hooks/useNetworkHasMatches.js +1 -56
  55. package/lib/commonjs/network/hooks/useNetworkSaved.js +1 -38
  56. package/lib/commonjs/network/hooks/useNetworkSelection.js +1 -53
  57. package/lib/commonjs/network/hooks/useOverrideRules.js +1 -36
  58. package/lib/commonjs/network/hooks/useTickEveryMinute.js +1 -21
  59. package/lib/commonjs/network/overrides/applyToFetch.js +1 -80
  60. package/lib/commonjs/network/overrides/applyToXhr.js +2 -453
  61. package/lib/commonjs/network/overrides/engine.js +1 -93
  62. package/lib/commonjs/network/overrides/matchRule.js +1 -81
  63. package/lib/commonjs/network/overrides/overriddenRows.js +1 -0
  64. package/lib/commonjs/network/overrides/overrideRulesStore.js +1 -550
  65. package/lib/commonjs/network/overrides/presets.js +1 -70
  66. package/lib/commonjs/network/overrides/resolveOverride.js +1 -158
  67. package/lib/commonjs/network/overrides/types.js +1 -90
  68. package/lib/commonjs/network/sync/networkBodyResolver.js +1 -39
  69. package/lib/commonjs/network/sync/networkSyncAdapter.js +1 -882
  70. package/lib/commonjs/network/sync/overrideHonesty.release.test.js +1 -36
  71. package/lib/commonjs/network/types/index.js +1 -5
  72. package/lib/commonjs/network/utils/extractOperationName.js +1 -80
  73. package/lib/commonjs/network/utils/filterNetworkEvents.js +1 -96
  74. package/lib/commonjs/network/utils/formatGraphQLVariables.js +1 -219
  75. package/lib/commonjs/network/utils/formatting.js +1 -30
  76. package/lib/commonjs/network/utils/generateCurl.js +2 -71
  77. package/lib/commonjs/network/utils/generateNetworkCopyText.js +37 -166
  78. package/lib/commonjs/network/utils/httpCompletion.js +1 -37
  79. package/lib/commonjs/network/utils/networkEventStore.js +1 -393
  80. package/lib/commonjs/network/utils/networkListener.js +4 -1259
  81. package/lib/commonjs/network/utils/networkSavedStore.js +3 -577
  82. package/lib/commonjs/network/utils/networkSelectionStore.js +1 -193
  83. package/lib/commonjs/network/utils/realNow.js +1 -0
  84. package/lib/commonjs/network/utils/requestId.js +1 -0
  85. package/lib/commonjs/network/utils/resolveRequestUrl.js +1 -0
  86. package/lib/commonjs/network/utils/selectSavedEvents.js +1 -39
  87. package/lib/commonjs/network/utils/startNetworkCapture.js +1 -0
  88. package/lib/commonjs/network/utils/withPinnedFirst.js +1 -32
  89. package/lib/commonjs/preset.js +1 -102
  90. package/lib/module/index.js +1 -103
  91. package/lib/module/index.web.js +1 -82
  92. package/lib/module/network/components/DataViewer.web.js +1 -875
  93. package/lib/module/network/components/NetworkCopyScreen.web.js +1 -44
  94. package/lib/module/network/components/NetworkCopySettingsView.js +27 -750
  95. package/lib/module/network/components/NetworkCopySettingsView.web.js +14 -1237
  96. package/lib/module/network/components/NetworkDetailScreen.web.js +1 -97
  97. package/lib/module/network/components/NetworkDetailStepper.js +1 -104
  98. package/lib/module/network/components/NetworkDetailStepper.web.js +1 -296
  99. package/lib/module/network/components/NetworkEventDetailView.js +15 -1129
  100. package/lib/module/network/components/NetworkEventDetailView.web.js +15 -1482
  101. package/lib/module/network/components/NetworkEventItemCompact.js +2 -398
  102. package/lib/module/network/components/NetworkEventItemCompact.web.js +2 -818
  103. package/lib/module/network/components/NetworkFilterScreen.web.js +1 -51
  104. package/lib/module/network/components/NetworkFilterViewV3.js +1 -438
  105. package/lib/module/network/components/NetworkFilterViewV3.web.js +1 -1306
  106. package/lib/module/network/components/NetworkHeaderLive.js +1 -366
  107. package/lib/module/network/components/NetworkHeaderLive.web.js +1 -617
  108. package/lib/module/network/components/NetworkHeaderMenu.js +1 -184
  109. package/lib/module/network/components/NetworkListScreen.js +1 -400
  110. package/lib/module/network/components/NetworkListScreen.web.js +1 -623
  111. package/lib/module/network/components/NetworkModal.js +1 -781
  112. package/lib/module/network/components/NetworkNumberPrompt.js +1 -174
  113. package/lib/module/network/components/NetworkNumberPrompt.web.js +1 -230
  114. package/lib/module/network/components/NetworkOverrideEditor.js +1 -811
  115. package/lib/module/network/components/NetworkOverrideEditor.web.js +1 -939
  116. package/lib/module/network/components/NetworkOverrideHeaderButton.js +1 -104
  117. package/lib/module/network/components/NetworkOverrideHeaderButton.web.js +1 -131
  118. package/lib/module/network/components/NetworkOverridesButton.js +1 -87
  119. package/lib/module/network/components/NetworkOverridesButton.web.js +1 -141
  120. package/lib/module/network/components/NetworkOverridesScreen.js +1 -539
  121. package/lib/module/network/components/NetworkOverridesScreen.web.js +1 -826
  122. package/lib/module/network/components/NetworkSavedScreen.js +1 -222
  123. package/lib/module/network/components/NetworkSavedScreen.web.js +1 -461
  124. package/lib/module/network/components/NetworkUpgradeBanner.js +1 -72
  125. package/lib/module/network/components/response-editor/Explorer.js +1 -972
  126. package/lib/module/network/components/response-editor/Explorer.web.js +1 -1133
  127. package/lib/module/network/components/response-editor/deleteNestedDataByPath.js +1 -51
  128. package/lib/module/network/components/response-editor/editorContext.js +1 -29
  129. package/lib/module/network/components/response-editor/updateNestedDataByPath.js +1 -56
  130. package/lib/module/network/conditions/NetworkConditionsControl.js +1 -231
  131. package/lib/module/network/conditions/NetworkConditionsControl.test.js +1 -135
  132. package/lib/module/network/conditions/NetworkConditionsIcon.js +1 -29
  133. package/lib/module/network/conditions/NetworkFloatingTool.js +1 -304
  134. package/lib/module/network/conditions/NetworkFloatingTool.test.js +1 -218
  135. package/lib/module/network/conditions/store.js +1 -65
  136. package/lib/module/network/conditions/wait.js +1 -38
  137. package/lib/module/network/conditions/xhr.js +1 -106
  138. package/lib/module/network/hooks/useLiveNetworkEvent.js +1 -58
  139. package/lib/module/network/hooks/useNetworkBadgeCounts.js +1 -79
  140. package/lib/module/network/hooks/useNetworkEventList.js +1 -104
  141. package/lib/module/network/hooks/useNetworkEvents.js +1 -314
  142. package/lib/module/network/hooks/useNetworkHasMatches.js +1 -52
  143. package/lib/module/network/hooks/useNetworkSaved.js +1 -34
  144. package/lib/module/network/hooks/useNetworkSelection.js +1 -46
  145. package/lib/module/network/hooks/useOverrideRules.js +1 -32
  146. package/lib/module/network/hooks/useTickEveryMinute.js +1 -11
  147. package/lib/module/network/overrides/applyToFetch.js +1 -72
  148. package/lib/module/network/overrides/applyToXhr.js +2 -446
  149. package/lib/module/network/overrides/engine.js +1 -85
  150. package/lib/module/network/overrides/matchRule.js +1 -75
  151. package/lib/module/network/overrides/overriddenRows.js +1 -0
  152. package/lib/module/network/overrides/overrideRulesStore.js +1 -547
  153. package/lib/module/network/overrides/presets.js +1 -65
  154. package/lib/module/network/overrides/resolveOverride.js +1 -152
  155. package/lib/module/network/overrides/types.js +1 -86
  156. package/lib/module/network/sync/networkBodyResolver.js +1 -34
  157. package/lib/module/network/sync/networkSyncAdapter.js +1 -880
  158. package/lib/module/network/sync/overrideHonesty.release.test.js +1 -35
  159. package/lib/module/network/types/index.js +1 -3
  160. package/lib/module/network/utils/extractOperationName.js +1 -76
  161. package/lib/module/network/utils/filterNetworkEvents.js +1 -92
  162. package/lib/module/network/utils/formatGraphQLVariables.js +1 -213
  163. package/lib/module/network/utils/formatting.js +1 -9
  164. package/lib/module/network/utils/generateCurl.js +2 -67
  165. package/lib/module/network/utils/generateNetworkCopyText.js +37 -162
  166. package/lib/module/network/utils/httpCompletion.js +1 -32
  167. package/lib/module/network/utils/networkEventStore.js +1 -391
  168. package/lib/module/network/utils/networkListener.js +4 -1249
  169. package/lib/module/network/utils/networkSavedStore.js +3 -572
  170. package/lib/module/network/utils/networkSelectionStore.js +1 -188
  171. package/lib/module/network/utils/realNow.js +1 -0
  172. package/lib/module/network/utils/requestId.js +1 -0
  173. package/lib/module/network/utils/resolveRequestUrl.js +1 -0
  174. package/lib/module/network/utils/selectSavedEvents.js +1 -35
  175. package/lib/module/network/utils/startNetworkCapture.js +1 -0
  176. package/lib/module/network/utils/withPinnedFirst.js +1 -28
  177. package/lib/module/preset.js +1 -100
  178. package/lib/typescript/index.d.ts +1 -0
  179. package/lib/typescript/network/overrides/applyToXhr.d.ts +1 -0
  180. package/lib/typescript/network/overrides/engine.d.ts +1 -1
  181. package/lib/typescript/network/overrides/matchRule.d.ts +1 -1
  182. package/lib/typescript/network/overrides/overriddenRows.d.ts +16 -0
  183. package/lib/typescript/network/overrides/resolveOverride.d.ts +2 -2
  184. package/lib/typescript/network/overrides/types.d.ts +9 -0
  185. package/lib/typescript/network/utils/networkListener.d.ts +14 -4
  186. package/lib/typescript/network/utils/networkSavedStore.d.ts +4 -4
  187. package/lib/typescript/network/utils/realNow.d.ts +18 -0
  188. package/lib/typescript/network/utils/requestId.d.ts +2 -0
  189. package/lib/typescript/network/utils/resolveRequestUrl.d.ts +3 -0
  190. package/lib/typescript/network/utils/startNetworkCapture.d.ts +6 -0
  191. package/lib/web/index.mjs +145 -0
  192. package/package.json +32 -10
  193. package/lib/typescript/index.d.ts.map +0 -1
  194. package/lib/typescript/index.web.d.ts.map +0 -1
  195. package/lib/typescript/network/components/DataViewer.web.d.ts.map +0 -1
  196. package/lib/typescript/network/components/NetworkCopyScreen.web.d.ts.map +0 -1
  197. package/lib/typescript/network/components/NetworkCopySettingsView.d.ts.map +0 -1
  198. package/lib/typescript/network/components/NetworkCopySettingsView.web.d.ts.map +0 -1
  199. package/lib/typescript/network/components/NetworkDetailScreen.web.d.ts.map +0 -1
  200. package/lib/typescript/network/components/NetworkDetailStepper.d.ts.map +0 -1
  201. package/lib/typescript/network/components/NetworkDetailStepper.web.d.ts.map +0 -1
  202. package/lib/typescript/network/components/NetworkEventDetailView.d.ts.map +0 -1
  203. package/lib/typescript/network/components/NetworkEventDetailView.web.d.ts.map +0 -1
  204. package/lib/typescript/network/components/NetworkEventItemCompact.d.ts.map +0 -1
  205. package/lib/typescript/network/components/NetworkEventItemCompact.web.d.ts.map +0 -1
  206. package/lib/typescript/network/components/NetworkFilterScreen.web.d.ts.map +0 -1
  207. package/lib/typescript/network/components/NetworkFilterViewV3.d.ts.map +0 -1
  208. package/lib/typescript/network/components/NetworkFilterViewV3.web.d.ts.map +0 -1
  209. package/lib/typescript/network/components/NetworkHeaderLive.d.ts.map +0 -1
  210. package/lib/typescript/network/components/NetworkHeaderLive.web.d.ts.map +0 -1
  211. package/lib/typescript/network/components/NetworkHeaderMenu.d.ts.map +0 -1
  212. package/lib/typescript/network/components/NetworkListScreen.d.ts.map +0 -1
  213. package/lib/typescript/network/components/NetworkListScreen.web.d.ts.map +0 -1
  214. package/lib/typescript/network/components/NetworkModal.d.ts.map +0 -1
  215. package/lib/typescript/network/components/NetworkNumberPrompt.d.ts.map +0 -1
  216. package/lib/typescript/network/components/NetworkNumberPrompt.web.d.ts.map +0 -1
  217. package/lib/typescript/network/components/NetworkOverrideEditor.d.ts.map +0 -1
  218. package/lib/typescript/network/components/NetworkOverrideEditor.web.d.ts.map +0 -1
  219. package/lib/typescript/network/components/NetworkOverrideHeaderButton.d.ts.map +0 -1
  220. package/lib/typescript/network/components/NetworkOverrideHeaderButton.web.d.ts.map +0 -1
  221. package/lib/typescript/network/components/NetworkOverridesButton.d.ts.map +0 -1
  222. package/lib/typescript/network/components/NetworkOverridesButton.web.d.ts.map +0 -1
  223. package/lib/typescript/network/components/NetworkOverridesScreen.d.ts.map +0 -1
  224. package/lib/typescript/network/components/NetworkOverridesScreen.web.d.ts.map +0 -1
  225. package/lib/typescript/network/components/NetworkSavedScreen.d.ts.map +0 -1
  226. package/lib/typescript/network/components/NetworkSavedScreen.web.d.ts.map +0 -1
  227. package/lib/typescript/network/components/NetworkUpgradeBanner.d.ts.map +0 -1
  228. package/lib/typescript/network/components/response-editor/Explorer.d.ts.map +0 -1
  229. package/lib/typescript/network/components/response-editor/Explorer.web.d.ts.map +0 -1
  230. package/lib/typescript/network/components/response-editor/deleteNestedDataByPath.d.ts.map +0 -1
  231. package/lib/typescript/network/components/response-editor/editorContext.d.ts.map +0 -1
  232. package/lib/typescript/network/components/response-editor/updateNestedDataByPath.d.ts.map +0 -1
  233. package/lib/typescript/network/conditions/NetworkConditionsControl.d.ts.map +0 -1
  234. package/lib/typescript/network/conditions/NetworkConditionsControl.test.d.ts.map +0 -1
  235. package/lib/typescript/network/conditions/NetworkConditionsIcon.d.ts.map +0 -1
  236. package/lib/typescript/network/conditions/NetworkFloatingTool.d.ts.map +0 -1
  237. package/lib/typescript/network/conditions/NetworkFloatingTool.test.d.ts.map +0 -1
  238. package/lib/typescript/network/conditions/store.d.ts.map +0 -1
  239. package/lib/typescript/network/conditions/wait.d.ts.map +0 -1
  240. package/lib/typescript/network/conditions/xhr.d.ts.map +0 -1
  241. package/lib/typescript/network/hooks/useLiveNetworkEvent.d.ts.map +0 -1
  242. package/lib/typescript/network/hooks/useNetworkBadgeCounts.d.ts.map +0 -1
  243. package/lib/typescript/network/hooks/useNetworkEventList.d.ts.map +0 -1
  244. package/lib/typescript/network/hooks/useNetworkEvents.d.ts.map +0 -1
  245. package/lib/typescript/network/hooks/useNetworkHasMatches.d.ts.map +0 -1
  246. package/lib/typescript/network/hooks/useNetworkSaved.d.ts.map +0 -1
  247. package/lib/typescript/network/hooks/useNetworkSelection.d.ts.map +0 -1
  248. package/lib/typescript/network/hooks/useOverrideRules.d.ts.map +0 -1
  249. package/lib/typescript/network/hooks/useTickEveryMinute.d.ts.map +0 -1
  250. package/lib/typescript/network/overrides/applyToFetch.d.ts.map +0 -1
  251. package/lib/typescript/network/overrides/applyToXhr.d.ts.map +0 -1
  252. package/lib/typescript/network/overrides/engine.d.ts.map +0 -1
  253. package/lib/typescript/network/overrides/matchRule.d.ts.map +0 -1
  254. package/lib/typescript/network/overrides/overrideRulesStore.d.ts.map +0 -1
  255. package/lib/typescript/network/overrides/presets.d.ts.map +0 -1
  256. package/lib/typescript/network/overrides/resolveOverride.d.ts.map +0 -1
  257. package/lib/typescript/network/overrides/types.d.ts.map +0 -1
  258. package/lib/typescript/network/sync/networkBodyResolver.d.ts.map +0 -1
  259. package/lib/typescript/network/sync/networkSyncAdapter.d.ts.map +0 -1
  260. package/lib/typescript/network/sync/overrideHonesty.release.test.d.ts.map +0 -1
  261. package/lib/typescript/network/types/index.d.ts.map +0 -1
  262. package/lib/typescript/network/utils/extractOperationName.d.ts.map +0 -1
  263. package/lib/typescript/network/utils/filterNetworkEvents.d.ts.map +0 -1
  264. package/lib/typescript/network/utils/formatGraphQLVariables.d.ts.map +0 -1
  265. package/lib/typescript/network/utils/formatting.d.ts.map +0 -1
  266. package/lib/typescript/network/utils/generateCurl.d.ts.map +0 -1
  267. package/lib/typescript/network/utils/generateNetworkCopyText.d.ts.map +0 -1
  268. package/lib/typescript/network/utils/httpCompletion.d.ts.map +0 -1
  269. package/lib/typescript/network/utils/networkEventStore.d.ts.map +0 -1
  270. package/lib/typescript/network/utils/networkListener.d.ts.map +0 -1
  271. package/lib/typescript/network/utils/networkSavedStore.d.ts.map +0 -1
  272. package/lib/typescript/network/utils/networkSelectionStore.d.ts.map +0 -1
  273. package/lib/typescript/network/utils/selectSavedEvents.d.ts.map +0 -1
  274. package/lib/typescript/network/utils/withPinnedFirst.d.ts.map +0 -1
  275. package/lib/typescript/preset.d.ts.map +0 -1
@@ -1,190 +1 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.NetworkHeaderMenu = NetworkHeaderMenu;
7
- exports.NetworkHeaderMenuButton = NetworkHeaderMenuButton;
8
- exports.NetworkHeaderMenuItem = NetworkHeaderMenuItem;
9
- var _reactNative = require("react-native");
10
- var _sharedUi = require("@buoy-gg/shared-ui");
11
- var _jsxRuntime = require("react/jsx-runtime");
12
- /**
13
- * The header's overflow menu.
14
- *
15
- * The toolbar had grown to three status badges and six icon buttons, which on a
16
- * 402pt screen meant the pending badge was being overlapped by the search
17
- * button. Something had to leave, and the rule for deciding what is:
18
- *
19
- * **A control that COMMUNICATES STATE stays visible. A destination or a rare
20
- * action goes in the menu.**
21
- *
22
- * That keeps the power toggle (are we capturing?), the overrides flask (is the
23
- * app being lied to, and how many rules?), the status badges (what happened)
24
- * and Clear (the reproduce loop is clear → repro → read, and burying the first
25
- * step doubles it). Search stays because it's the only way through 500 rows.
26
- *
27
- * Filters, Saved and Copy leave. Filters is the interesting one — it does show
28
- * state, so the ⋯ carries a dot when a filter is applied rather than hiding
29
- * that fact.
30
- */
31
-
32
- function NetworkHeaderMenuButton({
33
- onPress,
34
- isOpen,
35
- hasIndicator
36
- }) {
37
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.TouchableOpacity, {
38
- onPress: onPress,
39
- "sentry-label": "ignore toggle header menu",
40
- testID: "buoy-network-menu",
41
- accessibilityRole: "button",
42
- accessibilityLabel: isOpen ? "Close menu" : "More actions",
43
- style: [styles.button, isOpen && styles.buttonOpen],
44
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
45
- style: styles.dots,
46
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
47
- style: [styles.dot, isOpen && styles.dotOpen]
48
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
49
- style: [styles.dot, isOpen && styles.dotOpen]
50
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
51
- style: [styles.dot, isOpen && styles.dotOpen]
52
- })]
53
- }), hasIndicator ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
54
- style: styles.indicator
55
- }) : null]
56
- });
57
- }
58
- /**
59
- * The dropdown itself, rendered in the modal BODY rather than the header —
60
- * the header is a fixed-height row and anything overflowing it is clipped, so
61
- * a panel anchored to the top-right of the body lands exactly where a dropdown
62
- * from the ⋯ should appear.
63
- */
64
- function NetworkHeaderMenu({
65
- onClose,
66
- children
67
- }) {
68
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
69
- style: styles.overlay,
70
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
71
- style: styles.backdrop,
72
- activeOpacity: 1,
73
- onPress: onClose,
74
- "sentry-label": "ignore dismiss header menu"
75
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
76
- style: styles.panel,
77
- children: children
78
- })]
79
- });
80
- }
81
- function NetworkHeaderMenuItem({
82
- icon,
83
- label,
84
- detail,
85
- testID,
86
- onPress
87
- }) {
88
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.TouchableOpacity, {
89
- onPress: onPress,
90
- "sentry-label": "ignore header menu item",
91
- testID: testID,
92
- accessibilityRole: "button",
93
- accessibilityLabel: label,
94
- style: styles.item,
95
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
96
- style: styles.itemIcon,
97
- children: icon
98
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
99
- style: styles.itemLabel,
100
- children: label
101
- }), detail ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
102
- style: styles.itemDetail,
103
- children: detail
104
- }) : null]
105
- });
106
- }
107
- const styles = _reactNative.StyleSheet.create({
108
- // The same 32×32 box every other header action uses, minus the fill and
109
- // border. Padding alone gave a 3pt-wide hit area AND a shorter box than its
110
- // neighbours, which is why the dots sat high in the row; a fixed square
111
- // centres the glyph on the same baseline as the search/power/clear icons.
112
- button: {
113
- width: 32,
114
- height: 32,
115
- borderRadius: 8,
116
- alignItems: "center",
117
- justifyContent: "center"
118
- },
119
- // Only lit while the menu is down — the button is the one thing not covered
120
- // by the backdrop, so it has to look like the thing that is currently open.
121
- buttonOpen: {
122
- backgroundColor: _sharedUi.night.color.surfaceElevated
123
- },
124
- dots: {
125
- flexDirection: "column",
126
- gap: 2.5,
127
- alignItems: "center"
128
- },
129
- dot: {
130
- width: 3,
131
- height: 3,
132
- borderRadius: 2,
133
- backgroundColor: _sharedUi.night.color.textSecondary
134
- },
135
- dotOpen: {
136
- backgroundColor: _sharedUi.night.color.text
137
- },
138
- indicator: {
139
- position: "absolute",
140
- // Sits just up-and-right of the top dot. Anchored to the 32pt box's corner
141
- // it would float off on its own, since the dot column is only 3pt wide.
142
- top: 6,
143
- right: 8,
144
- width: 6,
145
- height: 6,
146
- borderRadius: 3,
147
- backgroundColor: _sharedUi.night.color.accent
148
- },
149
- overlay: {
150
- ..._sharedUi.absoluteFill,
151
- zIndex: 50
152
- },
153
- backdrop: {
154
- ..._sharedUi.absoluteFill,
155
- backgroundColor: "rgba(0,0,0,0.5)"
156
- },
157
- // The night card: near-black surface, hairline border, row radius.
158
- panel: {
159
- position: "absolute",
160
- top: 6,
161
- right: 8,
162
- minWidth: 196,
163
- paddingVertical: 4,
164
- borderRadius: 10,
165
- borderWidth: 1,
166
- borderColor: _sharedUi.night.color.border,
167
- backgroundColor: _sharedUi.night.color.surface
168
- },
169
- item: {
170
- flexDirection: "row",
171
- alignItems: "center",
172
- gap: 10,
173
- paddingHorizontal: 12,
174
- paddingVertical: 11
175
- },
176
- itemIcon: {
177
- width: 16,
178
- alignItems: "center"
179
- },
180
- itemLabel: {
181
- flex: 1,
182
- fontSize: 13,
183
- fontWeight: "600",
184
- color: _sharedUi.night.color.text
185
- },
186
- itemDetail: {
187
- fontSize: 11,
188
- color: _sharedUi.night.color.textTertiary
189
- }
190
- });
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.NetworkHeaderMenu=NetworkHeaderMenu;exports.NetworkHeaderMenuButton=NetworkHeaderMenuButton;exports.NetworkHeaderMenuItem=NetworkHeaderMenuItem;var _reactNative=require("react-native");var _sharedUi=require("@buoy-gg/shared-ui");var _jsxRuntime=require("react/jsx-runtime");function NetworkHeaderMenuButton({onPress:t,isOpen:e,hasIndicator:o}){return(0,_jsxRuntime.jsxs)(_reactNative.TouchableOpacity,{onPress:t,"sentry-label":"ignore toggle header menu",testID:"buoy-network-menu",accessibilityRole:"button",accessibilityLabel:e?"Close menu":"More actions",style:[styles.button,e&&styles.buttonOpen],children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.dots,children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.dot,e&&styles.dotOpen]}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.dot,e&&styles.dotOpen]}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.dot,e&&styles.dotOpen]})]}),o?(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.indicator}):null]})}function NetworkHeaderMenu({onClose:t,children:e}){return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.overlay,children:[(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{style:styles.backdrop,activeOpacity:1,onPress:t,"sentry-label":"ignore dismiss header menu"}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.panel,children:e})]})}function NetworkHeaderMenuItem({icon:t,label:e,detail:o,testID:r,onPress:i}){return(0,_jsxRuntime.jsxs)(_reactNative.TouchableOpacity,{onPress:i,"sentry-label":"ignore header menu item",testID:r,accessibilityRole:"button",accessibilityLabel:e,style:styles.item,children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.itemIcon,children:t}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.itemLabel,children:e}),o?(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.itemDetail,children:o}):null]})}const styles=_reactNative.StyleSheet.create({button:{width:32,height:32,borderRadius:8,alignItems:"center",justifyContent:"center"},buttonOpen:{backgroundColor:_sharedUi.night.color.surfaceElevated},dots:{flexDirection:"column",gap:2.5,alignItems:"center"},dot:{width:3,height:3,borderRadius:2,backgroundColor:_sharedUi.night.color.textSecondary},dotOpen:{backgroundColor:_sharedUi.night.color.text},indicator:{position:"absolute",top:6,right:8,width:6,height:6,borderRadius:3,backgroundColor:_sharedUi.night.color.accent},overlay:{..._sharedUi.absoluteFill,zIndex:50},backdrop:{..._sharedUi.absoluteFill,backgroundColor:"rgba(0,0,0,0.5)"},panel:{position:"absolute",top:6,right:8,minWidth:196,paddingVertical:4,borderRadius:10,borderWidth:1,borderColor:_sharedUi.night.color.border,backgroundColor:_sharedUi.night.color.surface},item:{flexDirection:"row",alignItems:"center",gap:10,paddingHorizontal:12,paddingVertical:11},itemIcon:{width:16,alignItems:"center"},itemLabel:{flex:1,fontSize:13,fontWeight:"600",color:_sharedUi.night.color.text},itemDetail:{fontSize:11,color:_sharedUi.night.color.textTertiary}});
@@ -1,404 +1 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.NetworkListScreen = NetworkListScreen;
7
- var _react = require("react");
8
- var _reactNative = require("react-native");
9
- var _sharedUi = require("@buoy-gg/shared-ui");
10
- var _NetworkEventItemCompact = require("./NetworkEventItemCompact");
11
- var _NetworkUpgradeBanner = require("./NetworkUpgradeBanner");
12
- var _useNetworkEventList = require("../hooks/useNetworkEventList");
13
- var _useNetworkSaved = require("../hooks/useNetworkSaved");
14
- var _useOverrideRules = require("../hooks/useOverrideRules");
15
- var _matchRule = require("../overrides/matchRule");
16
- var _withPinnedFirst = require("../utils/withPinnedFirst");
17
- var _jsxRuntime = require("react/jsx-runtime");
18
- /**
19
- * The network tool's LIST screen — owns the event-store subscription, the
20
- * FlatList, empty state, disabled banner, and the free-tier locked-history
21
- * footer. Decomposed from NetworkModal per rule3 so per-event re-renders
22
- * are confined to this subtree (plus the header's live leaves) instead of
23
- * the whole modal.
24
- *
25
- * Stable-tree contract (rule4): hooks run unconditionally, then the
26
- * component returns null when not visible. The subscription is gated with
27
- * `paused || !visible` so a hidden list doesn't subscribe at all.
28
- */
29
-
30
- const keyExtractor = item => item.id;
31
-
32
- /**
33
- * The PINNED strip above the live list.
34
- *
35
- * It renders OUTSIDE the FlatList on purpose. The list's window/batch values
36
- * are a measured configuration (see the FlatList below), and merging pins into
37
- * `data` would mean sentinel items in `keyExtractor`/`renderItem` and a
38
- * section boundary that moves as events arrive. Keeping pins in their own
39
- * bounded strip (capped at MAX_PINNED in the store) leaves that tuning
40
- * untouched — and makes "pins ignore the filters" fall out for free, because
41
- * this strip is never handed the filter.
42
- */
43
- function PinnedSection({
44
- events,
45
- onEventPress,
46
- onLongPress,
47
- savedLiveIds,
48
- onClearPinned
49
- }) {
50
- if (events.length === 0) return null;
51
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
52
- style: styles.pinnedSection,
53
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
54
- style: styles.pinnedHeader,
55
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.Pin, {
56
- size: 11,
57
- active: true,
58
- color: _sharedUi.macOSColors.semantic.info
59
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
60
- style: styles.pinnedTitle,
61
- children: ["PINNED \xB7 ", events.length]
62
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
63
- onPress: onClearPinned,
64
- "sentry-label": "ignore unpin all",
65
- style: styles.pinnedClear,
66
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
67
- style: styles.pinnedClearText,
68
- children: "Unpin all"
69
- })
70
- })]
71
- }), events.map(event => /*#__PURE__*/(0, _jsxRuntime.jsx)(_NetworkEventItemCompact.NetworkEventItemCompact, {
72
- event: event,
73
- onPress: onEventPress,
74
- onLongPress: onLongPress,
75
- pinned: true,
76
- saved: savedLiveIds.has(event.id)
77
- }, event.id))]
78
- });
79
- }
80
-
81
- /**
82
- * The OVERRIDDEN strip, above the pins.
83
- *
84
- * An overridden request is the one thing in this list that isn't true — the app
85
- * got something the server never sent. That has to be impossible to miss, and a
86
- * glyph on a row twenty scroll-positions down isn't. It sits ABOVE pins because
87
- * a stale override explains a bug, whereas a pin only marks one.
88
- *
89
- * Rows are matched against the RULES rather than filtered on the `override`
90
- * mark, so the request you built a rule from hoists immediately instead of
91
- * waiting for the endpoint to be called again.
92
- *
93
- * The header button is PAUSE, not "Manage". Flipping overrides off and on is by
94
- * far the most repeated action in a testing session — force the failure, check
95
- * the UI, turn it off, check the happy path, turn it back on — and it used to
96
- * cost a trip to another screen each way. The manager is still one tap away on
97
- * the toolbar; it just isn't the thing you reach for twenty times an hour.
98
- */
99
- function OverriddenSection({
100
- events,
101
- onEventPress,
102
- onLongPress,
103
- savedLiveIds,
104
- paused,
105
- onTogglePaused
106
- }) {
107
- if (events.length === 0) return null;
108
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
109
- style: [styles.overriddenSection, paused && styles.overriddenSectionOff],
110
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
111
- style: styles.overriddenHeader,
112
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.FlaskConical, {
113
- size: 11,
114
- color: paused ? _sharedUi.macOSColors.text.muted : _sharedUi.macOSColors.semantic.warning
115
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
116
- testID: "buoy-network-overridden-strip",
117
- style: [styles.overriddenTitle, paused && styles.overriddenTitleOff],
118
- children: paused ? `PAUSED · ${events.length}` : `OVERRIDDEN · ${events.length}`
119
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
120
- onPress: onTogglePaused,
121
- "sentry-label": "ignore pause overrides",
122
- style: styles.overriddenManage,
123
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
124
- style: [styles.overriddenManageText, paused && styles.overriddenTitleOff],
125
- children: paused ? "Resume" : "Pause"
126
- })
127
- })]
128
- }), events.map(event => /*#__PURE__*/(0, _jsxRuntime.jsx)(_NetworkEventItemCompact.NetworkEventItemCompact, {
129
- event: event,
130
- onPress: onEventPress,
131
- onLongPress: onLongPress,
132
- overridden: true,
133
- saved: savedLiveIds.has(event.id)
134
- }, event.id))]
135
- });
136
- }
137
- function NetworkListScreen({
138
- visible,
139
- paused,
140
- filter,
141
- ignoredPatterns,
142
- isPro,
143
- searchText,
144
- onEventPress,
145
- onUpgradePress
146
- }) {
147
- const {
148
- visibleEvents,
149
- hasLockedEvents,
150
- lockedEventCount,
151
- totalEvents
152
- } = (0, _useNetworkEventList.useNetworkEventList)({
153
- filter,
154
- ignoredPatterns,
155
- paused,
156
- visible,
157
- isPro
158
- });
159
-
160
- // Pins come from the persisted saved store, NOT from the live list — that is
161
- // what lets a pinned failure survive Clear, the 500-event cap and a reload.
162
- const {
163
- pinnedEvents,
164
- pinnedLiveIds,
165
- savedLiveIds,
166
- togglePin,
167
- clearPinned
168
- } = (0, _useNetworkSaved.useNetworkSaved)();
169
-
170
- // Which rules are live right now — the strip below reflects the rules, not
171
- // the history, so it's correct the moment a rule is made or removed.
172
- const {
173
- rules,
174
- enabled: overridesEnabled,
175
- setEnabled,
176
- isRuleSpent
177
- } = (0, _useOverrideRules.useOverrideRules)();
178
-
179
- // Stable identity: handed to memoized rows.
180
- const handleLongPress = (0, _react.useCallback)(event => {
181
- togglePin(event);
182
- }, [togglePin]);
183
-
184
- // Everything above is a hook and must run unconditionally; everything below
185
- // is work. `splitPinned` is an O(n) pass over the whole list, and this screen
186
- // re-renders on every modal-root state change — including every prev/next
187
- // step, where it is hidden and the result is thrown away.
188
- if (!visible) return null;
189
- const {
190
- pinned,
191
- rest
192
- } = (0, _withPinnedFirst.splitPinned)(visibleEvents, pinnedEvents, pinnedLiveIds);
193
-
194
- // Hoist anything an active rule covers. Done after `splitPinned` so a request
195
- // that is both pinned and overridden appears once, in the louder section.
196
- // Paused rules still populate the strip — that's how you find the thing you
197
- // paused in order to resume it. The header says PAUSED instead.
198
- const activeRules = rules.filter(rule => rule.enabled && !isRuleSpent(rule));
199
- const isOverridden = event => activeRules.some(rule => (0, _matchRule.ruleMatches)(rule, event.url, String(event.method || "GET")));
200
- const overridden = activeRules.length ? [...pinned, ...rest].filter(isOverridden) : [];
201
- const overriddenIds = new Set(overridden.map(event => event.id));
202
- const pinnedRows = pinned.filter(event => !overriddenIds.has(event.id));
203
- const restRows = overriddenIds.size ? rest.filter(event => !overriddenIds.has(event.id)) : rest;
204
- const isEnabled = !paused;
205
- const renderItem = ({
206
- item
207
- }) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_NetworkEventItemCompact.NetworkEventItemCompact, {
208
- event: item,
209
- onPress: onEventPress,
210
- onLongPress: handleLongPress,
211
- saved: savedLiveIds.has(item.id)
212
- });
213
-
214
- // Which flavour of "nothing here" this is. Pins and overrides render
215
- // outside the list, so a screen showing only those is not empty at all.
216
- const renderEmpty = () => {
217
- // Pins and overrides render outside the list, so a screen showing only
218
- // those is not empty at all.
219
- if (pinnedRows.length > 0 || overridden.length > 0) return null;
220
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.ToolEmptyState, {
221
- testID: "buoy-network-empty",
222
- ...(0, _sharedUi.resolveListEmptyState)({
223
- subject: "requests",
224
- search: searchText,
225
- total: totalEvents,
226
- capturing: isEnabled,
227
- waiting: {
228
- // fishing = capture is on and nothing has arrived.
229
- otto: "fishing",
230
- title: "No network events",
231
- message: "Network requests will appear here"
232
- },
233
- paused: {
234
- // paused = capture off. Both are literally what the copy says.
235
- title: "No network events",
236
- message: "Enable interception to start capturing"
237
- }
238
- })
239
- });
240
- };
241
- const renderListFooter = () => {
242
- if (!hasLockedEvents) return null;
243
- const isSearching = searchText.length > 0;
244
- const bannerText = isSearching ? `${lockedEventCount} matching ${lockedEventCount === 1 ? "request" : "requests"} in locked history` : `${lockedEventCount} requests locked`;
245
- const subtextMessage = isSearching ? "Upgrade to Pro to search your full request history" : "Upgrade to Pro to unlock full request history";
246
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_NetworkUpgradeBanner.NetworkUpgradeBanner, {
247
- title: bannerText,
248
- subtitle: subtextMessage,
249
- onPress: onUpgradePress
250
- });
251
- };
252
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
253
- style: styles.root,
254
- children: [!isEnabled ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
255
- style: styles.disabledBanner,
256
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.Power, {
257
- size: 14,
258
- color: _sharedUi.macOSColors.semantic.warning
259
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
260
- style: styles.disabledText,
261
- children: "Network interception is disabled"
262
- })]
263
- }) : null, /*#__PURE__*/(0, _jsxRuntime.jsx)(OverriddenSection, {
264
- events: overridden,
265
- onEventPress: onEventPress,
266
- onLongPress: handleLongPress,
267
- savedLiveIds: savedLiveIds,
268
- paused: !overridesEnabled,
269
- onTogglePaused: () => setEnabled(!overridesEnabled)
270
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(PinnedSection, {
271
- events: pinnedRows,
272
- onEventPress: onEventPress,
273
- onLongPress: handleLongPress,
274
- savedLiveIds: savedLiveIds,
275
- onClearPinned: clearPinned
276
- }), restRows.length > 0 || hasLockedEvents ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.FlatList, {
277
- testID: "buoy-network-list",
278
- data: restRows,
279
- renderItem: renderItem,
280
- keyExtractor: keyExtractor,
281
- contentContainerStyle: styles.listContent,
282
- showsVerticalScrollIndicator: true
283
- // Clipped cells falsely fail Detox's hittability check (known
284
- // RN+Detox issue), so e2e bundles (Metro started with
285
- // EXPO_PUBLIC_E2E=1) turn clipping off — see EVENT_LIST_PRESET.
286
- ,
287
- onEndReachedThreshold: 0.8
288
- // The list OWNS scrolling (NetworkModal passes
289
- // disableScrollWrapper while this screen is visible) so FlatList
290
- // virtualization actually works. The previous shipped config —
291
- // scrollEnabled=false inside JsModal's ScrollView — mounted ALL
292
- // rows: at the store's 500-event cap that measured 17 JS FPS /
293
- // 133% CPU / 1.4GB vs ~53 JS FPS / 52% / 360MB virtualized
294
- // (buoy-optimize batch 2026-07-06, batch-1783396983529-6l7w).
295
- // Window/batch values are the batch's "tuned" winner (EVENT_LIST_PRESET).
296
- ,
297
- scrollEnabled: true,
298
- ..._sharedUi.EVENT_LIST_PRESET,
299
- // Saving a request from the detail view changes a row's glyph
300
- // without changing `data`. VirtualizedList is a PureComponent, so
301
- // the Set has to be declared as a re-render marker rather than
302
- // relying on `renderItem` getting a fresh identity.
303
- extraData: savedLiveIds,
304
- "sentry-label": "ignore network events list",
305
- ListFooterComponent: renderListFooter
306
- }) : renderEmpty()]
307
- });
308
- }
309
- const styles = _reactNative.StyleSheet.create({
310
- root: {
311
- flex: 1,
312
- minHeight: 0
313
- },
314
- /**
315
- * The strip is separated from the live list by a real rule, not just space:
316
- * these rows do NOT obey the filters, and the boundary is what tells the
317
- * user why a request they just filtered out is still on screen.
318
- */
319
- overriddenSection: {
320
- borderBottomWidth: 1,
321
- borderBottomColor: _sharedUi.macOSColors.semantic.warning + "44",
322
- backgroundColor: _sharedUi.macOSColors.semantic.warningBackground
323
- },
324
- overriddenSectionOff: {
325
- borderBottomColor: _sharedUi.macOSColors.border.default,
326
- backgroundColor: _sharedUi.macOSColors.background.card
327
- },
328
- overriddenTitleOff: {
329
- color: _sharedUi.macOSColors.text.muted
330
- },
331
- overriddenHeader: {
332
- flexDirection: "row",
333
- alignItems: "center",
334
- gap: 6,
335
- paddingHorizontal: 12,
336
- paddingTop: 8,
337
- paddingBottom: 4
338
- },
339
- overriddenTitle: {
340
- flex: 1,
341
- fontSize: 10,
342
- fontWeight: "700",
343
- letterSpacing: 0.8,
344
- color: _sharedUi.macOSColors.semantic.warning
345
- },
346
- overriddenManage: {
347
- paddingHorizontal: 6,
348
- paddingVertical: 2
349
- },
350
- overriddenManageText: {
351
- fontSize: 10,
352
- fontWeight: "600",
353
- color: _sharedUi.macOSColors.semantic.warning
354
- },
355
- pinnedSection: {
356
- borderBottomWidth: 1,
357
- borderBottomColor: _sharedUi.macOSColors.border.default,
358
- paddingBottom: 4
359
- },
360
- pinnedHeader: {
361
- flexDirection: "row",
362
- alignItems: "center",
363
- gap: 6,
364
- paddingHorizontal: 20,
365
- paddingTop: 10,
366
- paddingBottom: 6
367
- },
368
- pinnedTitle: {
369
- flex: 1,
370
- color: _sharedUi.macOSColors.semantic.info,
371
- fontSize: 10,
372
- fontWeight: "700",
373
- letterSpacing: 0.6,
374
- fontFamily: _sharedUi.monoFont
375
- },
376
- pinnedClear: {
377
- paddingHorizontal: 6,
378
- paddingVertical: 2
379
- },
380
- pinnedClearText: {
381
- color: _sharedUi.macOSColors.text.muted,
382
- fontSize: 10
383
- },
384
- disabledBanner: {
385
- flexDirection: "row",
386
- alignItems: "center",
387
- gap: 8,
388
- padding: 10,
389
- marginHorizontal: 12,
390
- marginTop: 8,
391
- backgroundColor: _sharedUi.macOSColors.semantic.warningBackground,
392
- borderRadius: 8,
393
- borderWidth: 1,
394
- borderColor: _sharedUi.macOSColors.semantic.warning + "20"
395
- },
396
- disabledText: {
397
- color: _sharedUi.macOSColors.semantic.warning,
398
- fontSize: 11,
399
- flex: 1
400
- },
401
- listContent: {
402
- paddingTop: 8
403
- }
404
- });
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.NetworkListScreen=NetworkListScreen;var _react=require("react");var _reactNative=require("react-native");var _sharedUi=require("@buoy-gg/shared-ui");var _NetworkEventItemCompact=require("./NetworkEventItemCompact");var _NetworkUpgradeBanner=require("./NetworkUpgradeBanner");var _useNetworkEventList=require("../hooks/useNetworkEventList");var _useNetworkSaved=require("../hooks/useNetworkSaved");var _useOverrideRules=require("../hooks/useOverrideRules");var _overriddenRows=require("../overrides/overriddenRows");var _withPinnedFirst=require("../utils/withPinnedFirst");var _jsxRuntime=require("react/jsx-runtime");const keyExtractor=r=>r.id;function PinnedSection({events:r,onEventPress:i,onLongPress:s,savedLiveIds:a,onClearPinned:t}){if(r.length===0)return null;return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.pinnedSection,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.pinnedHeader,children:[(0,_jsxRuntime.jsx)(_sharedUi.Pin,{size:11,active:true,color:_sharedUi.macOSColors.semantic.info}),(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:styles.pinnedTitle,children:["PINNED \xB7 ",r.length]}),(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{onPress:t,"sentry-label":"ignore unpin all",style:styles.pinnedClear,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.pinnedClearText,children:"Unpin all"})})]}),r.map(n=>(0,_jsxRuntime.jsx)(_NetworkEventItemCompact.NetworkEventItemCompact,{event:n,onPress:i,onLongPress:s,pinned:true,saved:a.has(n.id)},n.id))]})}function OverriddenSection({events:r,onEventPress:i,onLongPress:s,savedLiveIds:a,paused:t,onTogglePaused:n}){if(r.length===0)return null;return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:[styles.overriddenSection,t&&styles.overriddenSectionOff],children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.overriddenHeader,children:[(0,_jsxRuntime.jsx)(_sharedUi.FlaskConical,{size:11,color:t?_sharedUi.macOSColors.text.muted:_sharedUi.macOSColors.semantic.warning}),(0,_jsxRuntime.jsx)(_reactNative.Text,{testID:"buoy-network-overridden-strip",style:[styles.overriddenTitle,t&&styles.overriddenTitleOff],children:t?`PAUSED \xB7 ${r.length}`:`OVERRIDDEN \xB7 ${r.length}`}),(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{onPress:n,"sentry-label":"ignore pause overrides",style:styles.overriddenManage,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.overriddenManageText,t&&styles.overriddenTitleOff],children:t?"Resume":"Pause"})})]}),r.map(o=>(0,_jsxRuntime.jsx)(_NetworkEventItemCompact.NetworkEventItemCompact,{event:o,onPress:i,onLongPress:s,overridden:true,saved:a.has(o.id)},o.id))]})}function NetworkListScreen({visible:r,paused:i,filter:s,ignoredPatterns:a,isPro:t,searchText:n,onEventPress:o,onUpgradePress:k}){const{visibleEvents:b,hasLockedEvents:v,lockedEventCount:l,totalEvents:C}=(0,_useNetworkEventList.useNetworkEventList)({filter:s,ignoredPatterns:a,paused:i,visible:r,isPro:t});const{pinnedEvents:y,pinnedLiveIds:E,savedLiveIds:d,togglePin:p,clearPinned:O}=(0,_useNetworkSaved.useNetworkSaved)();const{rules:T,enabled:h,setEnabled:P,isRuleSpent:j}=(0,_useOverrideRules.useOverrideRules)();const c=(0,_react.useCallback)(e=>{p(e)},[p]);if(!r)return null;const{pinned:x,rest:u}=(0,_withPinnedFirst.splitPinned)(b,y,E);const N=T.filter(e=>e.enabled&&!j(e));const g=(0,_overriddenRows.overriddenEvents)([...x,...u],N);const m=new Set(g.map(e=>e.id));const w=x.filter(e=>!m.has(e.id));const S=m.size?u.filter(e=>!m.has(e.id)):u;const f=!i;const I=({item:e})=>(0,_jsxRuntime.jsx)(_NetworkEventItemCompact.NetworkEventItemCompact,{event:e,onPress:o,onLongPress:c,saved:d.has(e.id)});const L=()=>{if(w.length>0||g.length>0)return null;return(0,_jsxRuntime.jsx)(_sharedUi.ToolEmptyState,{testID:"buoy-network-empty",...(0,_sharedUi.resolveListEmptyState)({subject:"requests",search:n,total:C,capturing:f,waiting:{otto:"fishing",title:"No network events",message:"Network requests will appear here"},paused:{title:"No network events",message:"Enable interception to start capturing"}})})};const q=()=>{if(!v)return null;const e=n.length>0;const B=e?`${l} matching ${l===1?"request":"requests"} in locked history`:`${l} requests locked`;const R=e?"Upgrade to Pro to search your full request history":"Upgrade to Pro to unlock full request history";return(0,_jsxRuntime.jsx)(_NetworkUpgradeBanner.NetworkUpgradeBanner,{title:B,subtitle:R,onPress:k})};return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.root,children:[!f?(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.disabledBanner,children:[(0,_jsxRuntime.jsx)(_sharedUi.Power,{size:14,color:_sharedUi.macOSColors.semantic.warning}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.disabledText,children:"Network interception is disabled"})]}):null,(0,_jsxRuntime.jsx)(OverriddenSection,{events:g,onEventPress:o,onLongPress:c,savedLiveIds:d,paused:!h,onTogglePaused:()=>P(!h)}),(0,_jsxRuntime.jsx)(PinnedSection,{events:w,onEventPress:o,onLongPress:c,savedLiveIds:d,onClearPinned:O}),S.length>0||v?(0,_jsxRuntime.jsx)(_reactNative.FlatList,{testID:"buoy-network-list",data:S,renderItem:I,keyExtractor,contentContainerStyle:styles.listContent,showsVerticalScrollIndicator:true,onEndReachedThreshold:.8,scrollEnabled:true,..._sharedUi.EVENT_LIST_PRESET,extraData:d,"sentry-label":"ignore network events list",ListFooterComponent:q}):L()]})}const styles=_reactNative.StyleSheet.create({root:{flex:1,minHeight:0},overriddenSection:{borderBottomWidth:1,borderBottomColor:_sharedUi.macOSColors.semantic.warning+"44",backgroundColor:_sharedUi.macOSColors.semantic.warningBackground},overriddenSectionOff:{borderBottomColor:_sharedUi.macOSColors.border.default,backgroundColor:_sharedUi.macOSColors.background.card},overriddenTitleOff:{color:_sharedUi.macOSColors.text.muted},overriddenHeader:{flexDirection:"row",alignItems:"center",gap:6,paddingHorizontal:12,paddingTop:8,paddingBottom:4},overriddenTitle:{flex:1,fontSize:10,fontWeight:"700",letterSpacing:.8,color:_sharedUi.macOSColors.semantic.warning},overriddenManage:{paddingHorizontal:6,paddingVertical:2},overriddenManageText:{fontSize:10,fontWeight:"600",color:_sharedUi.macOSColors.semantic.warning},pinnedSection:{borderBottomWidth:1,borderBottomColor:_sharedUi.macOSColors.border.default,paddingBottom:4},pinnedHeader:{flexDirection:"row",alignItems:"center",gap:6,paddingHorizontal:20,paddingTop:10,paddingBottom:6},pinnedTitle:{flex:1,color:_sharedUi.macOSColors.semantic.info,fontSize:10,fontWeight:"700",letterSpacing:.6,fontFamily:_sharedUi.monoFont},pinnedClear:{paddingHorizontal:6,paddingVertical:2},pinnedClearText:{color:_sharedUi.macOSColors.text.muted,fontSize:10},disabledBanner:{flexDirection:"row",alignItems:"center",gap:8,padding:10,marginHorizontal:12,marginTop:8,backgroundColor:_sharedUi.macOSColors.semantic.warningBackground,borderRadius:8,borderWidth:1,borderColor:_sharedUi.macOSColors.semantic.warning+"20"},disabledText:{color:_sharedUi.macOSColors.semantic.warning,fontSize:11,flex:1},listContent:{paddingTop:8}});