@buoy-gg/network 7.0.41 → 7.0.43

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 (272) hide show
  1. package/README.md +11 -85
  2. package/lib/commonjs/index.js +1 -332
  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 -403
  22. package/lib/commonjs/network/components/NetworkListScreen.web.js +1 -624
  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 -135
  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 -510
  61. package/lib/commonjs/network/overrides/engine.js +1 -93
  62. package/lib/commonjs/network/overrides/matchRule.js +1 -87
  63. package/lib/commonjs/network/overrides/overriddenRows.js +1 -37
  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 -411
  80. package/lib/commonjs/network/utils/networkListener.js +4 -1352
  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 -16
  85. package/lib/commonjs/network/utils/resolveRequestUrl.js +1 -15
  86. package/lib/commonjs/network/utils/selectSavedEvents.js +1 -39
  87. package/lib/commonjs/network/utils/startNetworkCapture.js +1 -24
  88. package/lib/commonjs/network/utils/withPinnedFirst.js +1 -32
  89. package/lib/commonjs/preset.js +1 -93
  90. package/lib/module/index.js +1 -104
  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 -399
  110. package/lib/module/network/components/NetworkListScreen.web.js +1 -622
  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 -131
  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 -502
  149. package/lib/module/network/overrides/engine.js +1 -85
  150. package/lib/module/network/overrides/matchRule.js +1 -81
  151. package/lib/module/network/overrides/overriddenRows.js +1 -33
  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 -409
  168. package/lib/module/network/utils/networkListener.js +4 -1341
  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 -12
  173. package/lib/module/network/utils/resolveRequestUrl.js +1 -11
  174. package/lib/module/network/utils/selectSavedEvents.js +1 -35
  175. package/lib/module/network/utils/startNetworkCapture.js +1 -21
  176. package/lib/module/network/utils/withPinnedFirst.js +1 -28
  177. package/lib/module/preset.js +1 -91
  178. package/lib/typescript/network/overrides/engine.d.ts +1 -1
  179. package/lib/typescript/network/overrides/matchRule.d.ts +1 -1
  180. package/lib/typescript/network/overrides/resolveOverride.d.ts +2 -2
  181. package/lib/typescript/network/overrides/types.d.ts +9 -0
  182. package/lib/typescript/network/utils/networkListener.d.ts +11 -0
  183. package/lib/typescript/network/utils/realNow.d.ts +18 -0
  184. package/lib/web/index.mjs +73 -74
  185. package/package.json +3 -6
  186. package/lib/typescript/index.d.ts.map +0 -1
  187. package/lib/typescript/index.web.d.ts.map +0 -1
  188. package/lib/typescript/network/components/DataViewer.web.d.ts.map +0 -1
  189. package/lib/typescript/network/components/NetworkCopyScreen.web.d.ts.map +0 -1
  190. package/lib/typescript/network/components/NetworkCopySettingsView.d.ts.map +0 -1
  191. package/lib/typescript/network/components/NetworkCopySettingsView.web.d.ts.map +0 -1
  192. package/lib/typescript/network/components/NetworkDetailScreen.web.d.ts.map +0 -1
  193. package/lib/typescript/network/components/NetworkDetailStepper.d.ts.map +0 -1
  194. package/lib/typescript/network/components/NetworkDetailStepper.web.d.ts.map +0 -1
  195. package/lib/typescript/network/components/NetworkEventDetailView.d.ts.map +0 -1
  196. package/lib/typescript/network/components/NetworkEventDetailView.web.d.ts.map +0 -1
  197. package/lib/typescript/network/components/NetworkEventItemCompact.d.ts.map +0 -1
  198. package/lib/typescript/network/components/NetworkEventItemCompact.web.d.ts.map +0 -1
  199. package/lib/typescript/network/components/NetworkFilterScreen.web.d.ts.map +0 -1
  200. package/lib/typescript/network/components/NetworkFilterViewV3.d.ts.map +0 -1
  201. package/lib/typescript/network/components/NetworkFilterViewV3.web.d.ts.map +0 -1
  202. package/lib/typescript/network/components/NetworkHeaderLive.d.ts.map +0 -1
  203. package/lib/typescript/network/components/NetworkHeaderLive.web.d.ts.map +0 -1
  204. package/lib/typescript/network/components/NetworkHeaderMenu.d.ts.map +0 -1
  205. package/lib/typescript/network/components/NetworkListScreen.d.ts.map +0 -1
  206. package/lib/typescript/network/components/NetworkListScreen.web.d.ts.map +0 -1
  207. package/lib/typescript/network/components/NetworkModal.d.ts.map +0 -1
  208. package/lib/typescript/network/components/NetworkNumberPrompt.d.ts.map +0 -1
  209. package/lib/typescript/network/components/NetworkNumberPrompt.web.d.ts.map +0 -1
  210. package/lib/typescript/network/components/NetworkOverrideEditor.d.ts.map +0 -1
  211. package/lib/typescript/network/components/NetworkOverrideEditor.web.d.ts.map +0 -1
  212. package/lib/typescript/network/components/NetworkOverrideHeaderButton.d.ts.map +0 -1
  213. package/lib/typescript/network/components/NetworkOverrideHeaderButton.web.d.ts.map +0 -1
  214. package/lib/typescript/network/components/NetworkOverridesButton.d.ts.map +0 -1
  215. package/lib/typescript/network/components/NetworkOverridesButton.web.d.ts.map +0 -1
  216. package/lib/typescript/network/components/NetworkOverridesScreen.d.ts.map +0 -1
  217. package/lib/typescript/network/components/NetworkOverridesScreen.web.d.ts.map +0 -1
  218. package/lib/typescript/network/components/NetworkSavedScreen.d.ts.map +0 -1
  219. package/lib/typescript/network/components/NetworkSavedScreen.web.d.ts.map +0 -1
  220. package/lib/typescript/network/components/NetworkUpgradeBanner.d.ts.map +0 -1
  221. package/lib/typescript/network/components/response-editor/Explorer.d.ts.map +0 -1
  222. package/lib/typescript/network/components/response-editor/Explorer.web.d.ts.map +0 -1
  223. package/lib/typescript/network/components/response-editor/deleteNestedDataByPath.d.ts.map +0 -1
  224. package/lib/typescript/network/components/response-editor/editorContext.d.ts.map +0 -1
  225. package/lib/typescript/network/components/response-editor/updateNestedDataByPath.d.ts.map +0 -1
  226. package/lib/typescript/network/conditions/NetworkConditionsControl.d.ts.map +0 -1
  227. package/lib/typescript/network/conditions/NetworkConditionsControl.test.d.ts.map +0 -1
  228. package/lib/typescript/network/conditions/NetworkConditionsIcon.d.ts.map +0 -1
  229. package/lib/typescript/network/conditions/NetworkFloatingTool.d.ts.map +0 -1
  230. package/lib/typescript/network/conditions/NetworkFloatingTool.test.d.ts.map +0 -1
  231. package/lib/typescript/network/conditions/store.d.ts.map +0 -1
  232. package/lib/typescript/network/conditions/wait.d.ts.map +0 -1
  233. package/lib/typescript/network/conditions/xhr.d.ts.map +0 -1
  234. package/lib/typescript/network/hooks/useLiveNetworkEvent.d.ts.map +0 -1
  235. package/lib/typescript/network/hooks/useNetworkBadgeCounts.d.ts.map +0 -1
  236. package/lib/typescript/network/hooks/useNetworkEventList.d.ts.map +0 -1
  237. package/lib/typescript/network/hooks/useNetworkEvents.d.ts.map +0 -1
  238. package/lib/typescript/network/hooks/useNetworkHasMatches.d.ts.map +0 -1
  239. package/lib/typescript/network/hooks/useNetworkSaved.d.ts.map +0 -1
  240. package/lib/typescript/network/hooks/useNetworkSelection.d.ts.map +0 -1
  241. package/lib/typescript/network/hooks/useOverrideRules.d.ts.map +0 -1
  242. package/lib/typescript/network/hooks/useTickEveryMinute.d.ts.map +0 -1
  243. package/lib/typescript/network/overrides/applyToFetch.d.ts.map +0 -1
  244. package/lib/typescript/network/overrides/applyToXhr.d.ts.map +0 -1
  245. package/lib/typescript/network/overrides/engine.d.ts.map +0 -1
  246. package/lib/typescript/network/overrides/matchRule.d.ts.map +0 -1
  247. package/lib/typescript/network/overrides/overriddenRows.d.ts.map +0 -1
  248. package/lib/typescript/network/overrides/overrideRulesStore.d.ts.map +0 -1
  249. package/lib/typescript/network/overrides/presets.d.ts.map +0 -1
  250. package/lib/typescript/network/overrides/resolveOverride.d.ts.map +0 -1
  251. package/lib/typescript/network/overrides/types.d.ts.map +0 -1
  252. package/lib/typescript/network/sync/networkBodyResolver.d.ts.map +0 -1
  253. package/lib/typescript/network/sync/networkSyncAdapter.d.ts.map +0 -1
  254. package/lib/typescript/network/sync/overrideHonesty.release.test.d.ts.map +0 -1
  255. package/lib/typescript/network/types/index.d.ts.map +0 -1
  256. package/lib/typescript/network/utils/extractOperationName.d.ts.map +0 -1
  257. package/lib/typescript/network/utils/filterNetworkEvents.d.ts.map +0 -1
  258. package/lib/typescript/network/utils/formatGraphQLVariables.d.ts.map +0 -1
  259. package/lib/typescript/network/utils/formatting.d.ts.map +0 -1
  260. package/lib/typescript/network/utils/generateCurl.d.ts.map +0 -1
  261. package/lib/typescript/network/utils/generateNetworkCopyText.d.ts.map +0 -1
  262. package/lib/typescript/network/utils/httpCompletion.d.ts.map +0 -1
  263. package/lib/typescript/network/utils/networkEventStore.d.ts.map +0 -1
  264. package/lib/typescript/network/utils/networkListener.d.ts.map +0 -1
  265. package/lib/typescript/network/utils/networkSavedStore.d.ts.map +0 -1
  266. package/lib/typescript/network/utils/networkSelectionStore.d.ts.map +0 -1
  267. package/lib/typescript/network/utils/requestId.d.ts.map +0 -1
  268. package/lib/typescript/network/utils/resolveRequestUrl.d.ts.map +0 -1
  269. package/lib/typescript/network/utils/selectSavedEvents.d.ts.map +0 -1
  270. package/lib/typescript/network/utils/startNetworkCapture.d.ts.map +0 -1
  271. package/lib/typescript/network/utils/withPinnedFirst.d.ts.map +0 -1
  272. package/lib/typescript/preset.d.ts.map +0 -1
@@ -1,366 +1 @@
1
- "use strict";
2
-
3
- /**
4
- * The header pieces that consume LIVE event data, decomposed out of
5
- * NetworkModal per rule3 (decompose by responsibility) so each one is its
6
- * own narrow store subscriber and the modal root/header never re-render
7
- * per network event:
8
- *
9
- * - `NetworkHeaderBadges` — success/error/pending count chips
10
- * - `NetworkClearButton` — trash button (enabled = store has events;
11
- * clear handler co-located here per rule2)
12
- * - `NetworkHeaderCopyButton` — copy-all button; the copy TEXT is
13
- * resolved lazily at press time (CopyButton accepts a function value —
14
- * rule2's latest-ref pattern), so no string is built per event
15
- *
16
- * Profiling evidence for this decomposition: tool-bench 2026-07-06 —
17
- * Trash2/CopyButton re-rendered 15× for 15 network events when the
18
- * subscription lived at the modal root.
19
- */
20
-
21
- import { StyleSheet, Text, TouchableOpacity, View } from "react-native";
22
- import { Bookmark, CheckCircle, XCircle, Clock, Copy, Pin, Trash2, CopyButton, macOSColors, night, useLimit, monoFont } from "@buoy-gg/shared-ui";
23
- import { networkEventStore } from "../utils/networkEventStore";
24
- import { flagsForEventId, networkSavedStore, MAX_PINNED, MAX_SAVED } from "../utils/networkSavedStore";
25
- import { useNetworkSaved } from "../hooks/useNetworkSaved";
26
- import { useSelectedNetworkEventId } from "../hooks/useNetworkSelection";
27
- import { useNetworkBadgeCounts } from "../hooks/useNetworkBadgeCounts";
28
- import { useNetworkHasEvents, useNetworkHasMatches } from "../hooks/useNetworkHasMatches";
29
- import { generateNetworkCopyText } from "../utils/generateNetworkCopyText";
30
- import { applyIgnoredPatterns, filterNetworkEvents } from "../utils/filterNetworkEvents";
31
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
32
- /** Success / error / pending chips — tap to toggle the status filter. */
33
- export function NetworkHeaderBadges({
34
- activeStatus,
35
- onToggleStatus,
36
- ignoredPatterns,
37
- paused
38
- }) {
39
- const counts = useNetworkBadgeCounts({
40
- ignoredPatterns,
41
- paused
42
- });
43
- return /*#__PURE__*/_jsx(NetworkHeaderBadgesView, {
44
- counts: counts,
45
- activeStatus: activeStatus,
46
- onToggleStatus: onToggleStatus
47
- });
48
- }
49
- /**
50
- * The chips themselves, fed by props — what the parity sheet renders with
51
- * fixture counts (`NetworkHeaderBadges` reads the live store).
52
- */
53
- export function NetworkHeaderBadgesView({
54
- counts,
55
- activeStatus,
56
- onToggleStatus
57
- }) {
58
- return /*#__PURE__*/_jsxs(View, {
59
- style: styles.headerChipRow,
60
- children: [/*#__PURE__*/_jsxs(TouchableOpacity, {
61
- style: [styles.headerChip, activeStatus === "success" && styles.headerChipActive],
62
- onPress: () => onToggleStatus("success"),
63
- children: [/*#__PURE__*/_jsx(CheckCircle, {
64
- size: 12,
65
- color: macOSColors.semantic.success
66
- }), /*#__PURE__*/_jsx(Text, {
67
- style: [styles.headerChipValue, {
68
- color: macOSColors.semantic.success
69
- }],
70
- children: counts.successful
71
- })]
72
- }), /*#__PURE__*/_jsxs(TouchableOpacity, {
73
- style: [styles.headerChip, activeStatus === "error" && styles.headerChipActive],
74
- onPress: () => onToggleStatus("error"),
75
- children: [/*#__PURE__*/_jsx(XCircle, {
76
- size: 12,
77
- color: macOSColors.semantic.error
78
- }), /*#__PURE__*/_jsx(Text, {
79
- style: [styles.headerChipValue, {
80
- color: macOSColors.semantic.error
81
- }],
82
- children: counts.failed
83
- })]
84
- }), /*#__PURE__*/_jsxs(TouchableOpacity, {
85
- style: [styles.headerChip, activeStatus === "pending" && styles.headerChipActive],
86
- onPress: () => onToggleStatus("pending"),
87
- children: [/*#__PURE__*/_jsx(Clock, {
88
- size: 12,
89
- color: macOSColors.semantic.warning
90
- }), /*#__PURE__*/_jsx(Text, {
91
- style: [styles.headerChipValue, {
92
- color: macOSColors.semantic.warning
93
- }],
94
- children: counts.pending
95
- })]
96
- })]
97
- });
98
- }
99
- /** Trash button — handler co-located; enabled while the store has events.
100
- * Subscribes to a flip-guarded boolean, so it renders when the store goes
101
- * empty↔non-empty, not on every count change. */
102
- export function NetworkClearButton({
103
- paused
104
- }) {
105
- const hasEvents = useNetworkHasEvents({
106
- paused
107
- });
108
- return /*#__PURE__*/_jsx(TouchableOpacity, {
109
- "sentry-label": "ignore clear events",
110
- testID: "buoy-network-clear",
111
- accessibilityLabel: "Clear network requests",
112
- accessibilityRole: "button",
113
- onPress: () => networkEventStore.clearEvents(),
114
- style: [styles.headerActionButton, !hasEvents && styles.headerActionButtonDisabled],
115
- disabled: !hasEvents,
116
- children: /*#__PURE__*/_jsx(Trash2, {
117
- size: 14,
118
- color: hasEvents ? night.color.textSecondary : night.color.textTertiary
119
- })
120
- });
121
- }
122
- /**
123
- * Entry point to the Saved screen, with its count. A self-subscribing leaf so
124
- * the badge tracks the store without the modal header re-rendering.
125
- */
126
- export function NetworkSavedButton({
127
- onPress
128
- }) {
129
- const {
130
- savedRecords
131
- } = useNetworkSaved();
132
- const count = savedRecords.length;
133
- return /*#__PURE__*/_jsxs(TouchableOpacity, {
134
- "sentry-label": "ignore open saved",
135
- onPress: onPress,
136
- accessibilityLabel: "Saved requests",
137
- style: styles.headerActionButton,
138
- children: [/*#__PURE__*/_jsx(Bookmark, {
139
- size: 14,
140
- color: count > 0 ? night.color.accent : night.color.textSecondary
141
- }), count > 0 ? /*#__PURE__*/_jsx(View, {
142
- style: styles.savedBadge,
143
- children: /*#__PURE__*/_jsx(Text, {
144
- style: styles.savedBadgeText,
145
- children: count > 99 ? "99+" : count
146
- })
147
- }) : null]
148
- });
149
- }
150
- /**
151
- * Pin + Save toggles for the request-detail header.
152
- *
153
- * Lives here, as a self-subscribing leaf, for two reasons. First the usual
154
- * one: the modal root stays free of subscriptions. Second, and the real
155
- * constraint — these buttons deliberately do NOT go inside
156
- * `NetworkEventDetailView`, because the Events tool renders that same detail
157
- * view (UnifiedEventDetail) and has no saved store behind it. The header is
158
- * the Network tool's own surface, so the feature stays where it belongs.
159
- *
160
- * The event object is resolved at PRESS time rather than held as a prop: the
161
- * live store has the fresh copy while the request is in flight, and the saved
162
- * store is the only copy once it has been cleared or aged out.
163
- *
164
- * The selected id is SUBSCRIBED here rather than passed down, so stepping
165
- * through requests doesn't have to re-render the modal root just to rebuild
166
- * the header around a new prop.
167
- */
168
- export function NetworkDetailPinActions({
169
- isPro,
170
- onUpgradePress
171
- }) {
172
- const eventId = useSelectedNetworkEventId();
173
- const state = useNetworkSaved();
174
- const {
175
- pinned,
176
- saved
177
- } = flagsForEventId(state, eventId);
178
- const savedLimit = useLimit("network.saved");
179
- const atPinCap = !pinned && state.pinnedEvents.length >= MAX_PINNED;
180
- const atSavedCap = !saved && state.savedRecords.length >= savedLimit;
181
- const resolveEvent = () => {
182
- if (!eventId) return null;
183
- return networkEventStore.getEvents().find(event => event.id === eventId) ?? networkSavedStore.getEventById(eventId);
184
- };
185
- const handlePin = () => {
186
- const event = resolveEvent();
187
- if (event) state.togglePin(event);
188
- };
189
- const handleSave = () => {
190
- // Hitting the free ceiling is an upgrade moment, not a dead button.
191
- if (atSavedCap && !isPro) {
192
- onUpgradePress();
193
- return;
194
- }
195
- const event = resolveEvent();
196
- if (event) state.toggleSave(event);
197
- };
198
- return /*#__PURE__*/_jsxs(_Fragment, {
199
- children: [/*#__PURE__*/_jsx(TouchableOpacity, {
200
- "sentry-label": "ignore pin request",
201
- onPress: handlePin,
202
- disabled: atPinCap,
203
- testID: "buoy-network-pin",
204
- accessibilityRole: "button",
205
- accessibilityLabel: pinned ? "Unpin request" : "Pin request",
206
- accessibilityHint: atPinCap ? `Pin limit reached (${MAX_PINNED})` : undefined,
207
- style: [styles.headerActionButton, pinned && styles.headerActionButtonActive, atPinCap && styles.headerActionButtonDisabled],
208
- children: /*#__PURE__*/_jsx(Pin, {
209
- size: 14,
210
- active: pinned,
211
- color: pinned ? night.color.accent : atPinCap ? night.color.textTertiary : night.color.textSecondary
212
- })
213
- }), /*#__PURE__*/_jsx(TouchableOpacity, {
214
- "sentry-label": "ignore save request",
215
- onPress: handleSave,
216
- disabled: atSavedCap && isPro,
217
- testID: "buoy-network-save",
218
- accessibilityRole: "button",
219
- accessibilityLabel: saved ? "Remove from saved" : "Save request",
220
- accessibilityHint: atSavedCap && isPro ? `Saved limit reached (${MAX_SAVED})` : undefined,
221
- style: [styles.headerActionButton, saved && styles.headerActionButtonSaved, atSavedCap && isPro && styles.headerActionButtonDisabled],
222
- children: /*#__PURE__*/_jsx(Bookmark, {
223
- size: 14,
224
- color: saved ? night.color.accent : atSavedCap && isPro ? night.color.textTertiary : night.color.textSecondary
225
- })
226
- })]
227
- });
228
- }
229
- /**
230
- * Copy-all-requests button. Subscribes to a flip-guarded boolean (its
231
- * enabled state); the copy text is generated at PRESS time from a live
232
- * store read, so there's no per-event work and no stale closure.
233
- */
234
- export function NetworkHeaderCopyButton({
235
- isPro,
236
- filter,
237
- ignoredPatterns,
238
- copySettings,
239
- paused,
240
- onUpgradePress,
241
- label
242
- }) {
243
- const hasEvents = useNetworkHasMatches({
244
- filter,
245
- ignoredPatterns,
246
- paused
247
- });
248
- if (!isPro) {
249
- return /*#__PURE__*/_jsxs(TouchableOpacity, {
250
- "sentry-label": "ignore copy pro",
251
- onPress: onUpgradePress,
252
- style: [label ? styles.copyMenuRow : styles.headerActionButton, !hasEvents && styles.headerActionButtonDisabled],
253
- disabled: !hasEvents,
254
- children: [/*#__PURE__*/_jsx(Copy, {
255
- size: 14,
256
- color: hasEvents ? night.color.textSecondary : night.color.textTertiary
257
- }), label ? /*#__PURE__*/_jsx(Text, {
258
- style: styles.copyMenuLabel,
259
- children: label
260
- }) : null]
261
- });
262
- }
263
- return /*#__PURE__*/_jsx(CopyButton
264
- // Lazy value: resolved at copy time by CopyButton's latest-ref
265
- // pattern, reading the LIVE store — no per-event work, no staleness.
266
- , {
267
- value: () => generateNetworkCopyText(filterNetworkEvents(applyIgnoredPatterns(networkEventStore.getEvents(), ignoredPatterns), filter), copySettings),
268
- size: 14,
269
- label: label,
270
- buttonStyle: label ? styles.copyMenuRow : styles.headerActionButton,
271
- labelStyle: styles.copyMenuLabel,
272
- colors: {
273
- idle: hasEvents ? night.color.textSecondary : night.color.textTertiary,
274
- success: macOSColors.semantic.success,
275
- error: macOSColors.semantic.error
276
- },
277
- disabled: !hasEvents
278
- });
279
- }
280
- const styles = StyleSheet.create({
281
- /** The overflow-menu variant: a full-width row, matching the other items. */
282
- copyMenuRow: {
283
- flexDirection: "row",
284
- alignItems: "center",
285
- gap: 10,
286
- paddingHorizontal: 6,
287
- paddingVertical: 11,
288
- justifyContent: "flex-start"
289
- },
290
- copyMenuLabel: {
291
- fontSize: 13,
292
- fontWeight: "600",
293
- color: night.color.text
294
- },
295
- headerChipRow: {
296
- flexDirection: "row",
297
- alignItems: "center",
298
- gap: 8
299
- },
300
- /**
301
- * Counter chips and toolbar buttons on the night dark-glass fill — the
302
- * hairline outline barely registers on the star field, and the fill marks
303
- * the active filter in the brand accent (the night selection language).
304
- * Status glyph/count colors stay on the classic semantic palette on
305
- * purpose — see getStatusColor in NetworkEventItemCompact.
306
- */
307
- headerChip: {
308
- flexDirection: "row",
309
- alignItems: "center",
310
- gap: 4,
311
- backgroundColor: night.color.buttonSurface,
312
- paddingHorizontal: 10,
313
- paddingVertical: 5,
314
- borderRadius: 12,
315
- borderWidth: 1,
316
- borderColor: night.color.border
317
- },
318
- headerChipActive: {
319
- backgroundColor: night.color.accentSoft,
320
- borderColor: night.color.accentBorderStrong
321
- },
322
- headerChipValue: {
323
- fontSize: 12,
324
- fontWeight: "600",
325
- fontFamily: monoFont
326
- },
327
- headerActionButton: {
328
- width: 32,
329
- height: 32,
330
- borderRadius: 8,
331
- backgroundColor: night.color.buttonSurface,
332
- borderWidth: 1,
333
- borderColor: night.color.border,
334
- alignItems: "center",
335
- justifyContent: "center"
336
- },
337
- headerActionButtonDisabled: {
338
- opacity: 0.55
339
- },
340
- headerActionButtonActive: {
341
- backgroundColor: night.color.accentSoft,
342
- borderColor: night.color.accentBorderStrong
343
- },
344
- headerActionButtonSaved: {
345
- backgroundColor: night.color.accentSoft,
346
- borderColor: night.color.accentBorderStrong
347
- },
348
- savedBadge: {
349
- position: "absolute",
350
- top: -3,
351
- right: -3,
352
- minWidth: 14,
353
- height: 14,
354
- paddingHorizontal: 3,
355
- borderRadius: 7,
356
- backgroundColor: night.color.accent,
357
- alignItems: "center",
358
- justifyContent: "center"
359
- },
360
- savedBadgeText: {
361
- color: night.color.onAccent,
362
- fontSize: 9,
363
- fontWeight: "700",
364
- fontFamily: monoFont
365
- }
366
- });
1
+ "use strict";import{StyleSheet as A,Text as g,TouchableOpacity as l,View as m}from"react-native";import{Bookmark as C,CheckCircle as z,XCircle as E,Clock as N,Copy as D,Pin as I,Trash2 as R,CopyButton as P,macOSColors as d,night as t,useLimit as H,monoFont as S}from"@buoy-gg/shared-ui";import{networkEventStore as v}from"../utils/networkEventStore";import{flagsForEventId as T,networkSavedStore as L,MAX_PINNED as w,MAX_SAVED as M}from"../utils/networkSavedStore";import{useNetworkSaved as B}from"../hooks/useNetworkSaved";import{useSelectedNetworkEventId as V}from"../hooks/useNetworkSelection";import{useNetworkBadgeCounts as j}from"../hooks/useNetworkBadgeCounts";import{useNetworkHasEvents as q,useNetworkHasMatches as F}from"../hooks/useNetworkHasMatches";import{generateNetworkCopyText as W}from"../utils/generateNetworkCopyText";import{applyIgnoredPatterns as _,filterNetworkEvents as X}from"../utils/filterNetworkEvents";import{jsx as o,jsxs as p,Fragment as O}from"react/jsx-runtime";export function NetworkHeaderBadges({activeStatus:n,onToggleStatus:i,ignoredPatterns:r,paused:s}){const a=j({ignoredPatterns:r,paused:s});return o(NetworkHeaderBadgesView,{counts:a,activeStatus:n,onToggleStatus:i})}export function NetworkHeaderBadgesView({counts:n,activeStatus:i,onToggleStatus:r}){return p(m,{style:e.headerChipRow,children:[p(l,{style:[e.headerChip,i==="success"&&e.headerChipActive],onPress:()=>r("success"),children:[o(z,{size:12,color:d.semantic.success}),o(g,{style:[e.headerChipValue,{color:d.semantic.success}],children:n.successful})]}),p(l,{style:[e.headerChip,i==="error"&&e.headerChipActive],onPress:()=>r("error"),children:[o(E,{size:12,color:d.semantic.error}),o(g,{style:[e.headerChipValue,{color:d.semantic.error}],children:n.failed})]}),p(l,{style:[e.headerChip,i==="pending"&&e.headerChipActive],onPress:()=>r("pending"),children:[o(N,{size:12,color:d.semantic.warning}),o(g,{style:[e.headerChipValue,{color:d.semantic.warning}],children:n.pending})]})]})}export function NetworkClearButton({paused:n}){const i=q({paused:n});return o(l,{"sentry-label":"ignore clear events",testID:"buoy-network-clear",accessibilityLabel:"Clear network requests",accessibilityRole:"button",onPress:()=>v.clearEvents(),style:[e.headerActionButton,!i&&e.headerActionButtonDisabled],disabled:!i,children:o(R,{size:14,color:i?t.color.textSecondary:t.color.textTertiary})})}export function NetworkSavedButton({onPress:n}){const{savedRecords:i}=B();const r=i.length;return p(l,{"sentry-label":"ignore open saved",onPress:n,accessibilityLabel:"Saved requests",style:e.headerActionButton,children:[o(C,{size:14,color:r>0?t.color.accent:t.color.textSecondary}),r>0?o(m,{style:e.savedBadge,children:o(g,{style:e.savedBadgeText,children:r>99?"99+":r})}):null]})}export function NetworkDetailPinActions({isPro:n,onUpgradePress:i}){const r=V();const s=B();const{pinned:a,saved:y}=T(s,r);const u=H("network.saved");const c=!a&&s.pinnedEvents.length>=w;const b=!y&&s.savedRecords.length>=u;const f=()=>{if(!r)return null;return v.getEvents().find(h=>h.id===r)??L.getEventById(r)};const k=()=>{const h=f();if(h)s.togglePin(h)};const x=()=>{if(b&&!n){i();return}const h=f();if(h)s.toggleSave(h)};return p(O,{children:[o(l,{"sentry-label":"ignore pin request",onPress:k,disabled:c,testID:"buoy-network-pin",accessibilityRole:"button",accessibilityLabel:a?"Unpin request":"Pin request",accessibilityHint:c?`Pin limit reached (${w})`:void 0,style:[e.headerActionButton,a&&e.headerActionButtonActive,c&&e.headerActionButtonDisabled],children:o(I,{size:14,active:a,color:a?t.color.accent:c?t.color.textTertiary:t.color.textSecondary})}),o(l,{"sentry-label":"ignore save request",onPress:x,disabled:b&&n,testID:"buoy-network-save",accessibilityRole:"button",accessibilityLabel:y?"Remove from saved":"Save request",accessibilityHint:b&&n?`Saved limit reached (${M})`:void 0,style:[e.headerActionButton,y&&e.headerActionButtonSaved,b&&n&&e.headerActionButtonDisabled],children:o(C,{size:14,color:y?t.color.accent:b&&n?t.color.textTertiary:t.color.textSecondary})})]})}export function NetworkHeaderCopyButton({isPro:n,filter:i,ignoredPatterns:r,copySettings:s,paused:a,onUpgradePress:y,label:u}){const c=F({filter:i,ignoredPatterns:r,paused:a});if(!n){return p(l,{"sentry-label":"ignore copy pro",onPress:y,style:[u?e.copyMenuRow:e.headerActionButton,!c&&e.headerActionButtonDisabled],disabled:!c,children:[o(D,{size:14,color:c?t.color.textSecondary:t.color.textTertiary}),u?o(g,{style:e.copyMenuLabel,children:u}):null]})}return o(P,{value:()=>W(X(_(v.getEvents(),r),i),s),size:14,label:u,buttonStyle:u?e.copyMenuRow:e.headerActionButton,labelStyle:e.copyMenuLabel,colors:{idle:c?t.color.textSecondary:t.color.textTertiary,success:d.semantic.success,error:d.semantic.error},disabled:!c})}const e=A.create({copyMenuRow:{flexDirection:"row",alignItems:"center",gap:10,paddingHorizontal:6,paddingVertical:11,justifyContent:"flex-start"},copyMenuLabel:{fontSize:13,fontWeight:"600",color:t.color.text},headerChipRow:{flexDirection:"row",alignItems:"center",gap:8},headerChip:{flexDirection:"row",alignItems:"center",gap:4,backgroundColor:t.color.buttonSurface,paddingHorizontal:10,paddingVertical:5,borderRadius:12,borderWidth:1,borderColor:t.color.border},headerChipActive:{backgroundColor:t.color.accentSoft,borderColor:t.color.accentBorderStrong},headerChipValue:{fontSize:12,fontWeight:"600",fontFamily:S},headerActionButton:{width:32,height:32,borderRadius:8,backgroundColor:t.color.buttonSurface,borderWidth:1,borderColor:t.color.border,alignItems:"center",justifyContent:"center"},headerActionButtonDisabled:{opacity:.55},headerActionButtonActive:{backgroundColor:t.color.accentSoft,borderColor:t.color.accentBorderStrong},headerActionButtonSaved:{backgroundColor:t.color.accentSoft,borderColor:t.color.accentBorderStrong},savedBadge:{position:"absolute",top:-3,right:-3,minWidth:14,height:14,paddingHorizontal:3,borderRadius:7,backgroundColor:t.color.accent,alignItems:"center",justifyContent:"center"},savedBadgeText:{color:t.color.onAccent,fontSize:9,fontWeight:"700",fontFamily:S}});