@buoy-gg/network 7.0.41 → 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 (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 +2 -2
  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,820 +1,2 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.NetworkEventItemCompact = void 0;
7
- var _react = require("react");
8
- var _formatGraphQLVariables = require("../utils/formatGraphQLVariables");
9
- var _jsxRuntime = require("react/jsx-runtime");
10
- /**
11
- * NetworkEventItemCompact.web — DOM twin of NetworkEventItemCompact.tsx.
12
- *
13
- * Same row layout, prop contract, memoization and display logic as the native
14
- * file: method badge + size indicators on the left, 2-line URL / GraphQL
15
- * operation display in the middle (via the SAME pure `formatGraphQLDisplay`
16
- * util), content-type badge + chevron on the right, absolute-positioned
17
- * status/client chips top-right and duration/relative-time bottom-right, and
18
- * the pinned/saved/overridden glyphs.
19
- *
20
- * Web consumers resolve `@buoy-gg/shared-ui` to a minimal shim (storage +
21
- * JsModal + ignored-pattern helpers only), so the RN-only chrome the native
22
- * row imports from shared-ui is replicated here as DOM with provenance:
23
- * - `DevToolsCard` / `MethodBadge` / `TypeBadge` — inlined DOM twins, values
24
- * copied from shared/src/ui/components/DevToolsCard.tsx and Badge.tsx
25
- * (buoyColors palette inlined below).
26
- * - `macOSColors` — inlined verbatim subset from
27
- * shared/src/ui/gameUI/constants/macOSDesignSystemColors.ts.
28
- * - Icons — inline lucide SVGs (shared-ui's icons are lucide re-exports,
29
- * 24×24 viewBox, strokeWidth 2).
30
- * - `formatBytes` / `formatDuration` — copied verbatim from
31
- * shared/src/utils/formatting/dataFormatting.ts (not in the web shim).
32
- * - `formatRelativeTime` — copied verbatim from
33
- * shared/src/utils/time/formatRelativeTime.ts.
34
- *
35
- * Intentional deviations (all logged):
36
- * - `useTickEveryMinute` (shared-ui TickProvider context, 5s interval as
37
- * mounted by NetworkModal) is replaced by a module-level shared 5s interval
38
- * hook — the shim exposes no `useTick`, and one shared timer keeps the
39
- * native "one clock for all rows" behavior.
40
- * - `onLongPress` (pin toggle) fires after a 500ms pointer hold — the native
41
- * TouchableOpacity default `delayLongPress`. The click that follows a long
42
- * press is swallowed, matching native semantics.
43
- * - `activeOpacity={0.8}` press feedback is a pointer-driven opacity state.
44
- * - `numberOfLines={2}` → `-webkit-line-clamp: 2`.
45
- * - The duration/relative-time separator is two literal spaces natively;
46
- * `white-space: pre` preserves them (HTML would collapse to one).
47
- *
48
- * @platform React DOM Web
49
- */
50
-
51
- // =============================
52
- // Native palettes (provenance)
53
- // =============================
54
-
55
- /** macOSColors subset — shared/src/ui/gameUI/constants/macOSDesignSystemColors.ts, verbatim. */const macOSColors = {
56
- text: {
57
- primary: "#F5F5F7",
58
- secondary: "#A1A1A6",
59
- muted: "#8E8E93"
60
- },
61
- semantic: {
62
- success: "#34C759",
63
- error: "#FF453A",
64
- warning: "#FFEB3B",
65
- info: "#00B8E6",
66
- debug: "#BF5AF2"
67
- }
68
- };
69
-
70
- /** buoyColors subset — shared/src/ui/gameUI/constants/gameUIColors.ts (macOS theme), verbatim. */
71
- const buoy = {
72
- card: "#1A1A1A",
73
- border: "#333333",
74
- primary: "#20C997",
75
- // Buoy teal (success/primary are the same value)
76
- success: "#20C997",
77
- warning: "#FFA94D",
78
- error: "#EF4444",
79
- textSecondary: "#A0A0A0",
80
- textMuted: "#888888"
81
- };
82
-
83
- // =============================
84
- // Inline lucide icons (shared-ui icons are lucide re-exports)
85
- // =============================
86
-
87
- function Svg({
88
- size = 14,
89
- color = "currentColor",
90
- children
91
- }) {
92
- return /*#__PURE__*/(0, _jsxRuntime.jsx)("svg", {
93
- width: size,
94
- height: size,
95
- viewBox: "0 0 24 24",
96
- fill: "none",
97
- stroke: color,
98
- strokeWidth: 2,
99
- strokeLinecap: "round",
100
- strokeLinejoin: "round",
101
- style: {
102
- flexShrink: 0,
103
- display: "block"
104
- },
105
- children: children
106
- });
107
- }
108
- const ChevronRight = p => /*#__PURE__*/(0, _jsxRuntime.jsx)(Svg, {
109
- ...p,
110
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
111
- d: "m9 18 6-6-6-6"
112
- })
113
- });
114
- const Upload = p => /*#__PURE__*/(0, _jsxRuntime.jsxs)(Svg, {
115
- ...p,
116
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
117
- d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"
118
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("polyline", {
119
- points: "17 8 12 3 7 8"
120
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("line", {
121
- x1: "12",
122
- x2: "12",
123
- y1: "3",
124
- y2: "15"
125
- })]
126
- });
127
- const Download = p => /*#__PURE__*/(0, _jsxRuntime.jsxs)(Svg, {
128
- ...p,
129
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
130
- d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"
131
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("polyline", {
132
- points: "7 10 12 15 17 10"
133
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("line", {
134
- x1: "12",
135
- x2: "12",
136
- y1: "15",
137
- y2: "3"
138
- })]
139
- });
140
- const Clock = p => /*#__PURE__*/(0, _jsxRuntime.jsxs)(Svg, {
141
- ...p,
142
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("circle", {
143
- cx: "12",
144
- cy: "12",
145
- r: "10"
146
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("polyline", {
147
- points: "12 6 12 12 16 14"
148
- })]
149
- });
150
- const AlertCircle = p => /*#__PURE__*/(0, _jsxRuntime.jsxs)(Svg, {
151
- ...p,
152
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("circle", {
153
- cx: "12",
154
- cy: "12",
155
- r: "10"
156
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("line", {
157
- x1: "12",
158
- x2: "12",
159
- y1: "8",
160
- y2: "12"
161
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("line", {
162
- x1: "12",
163
- x2: "12.01",
164
- y1: "16",
165
- y2: "16"
166
- })]
167
- });
168
- const Bookmark = p => /*#__PURE__*/(0, _jsxRuntime.jsx)(Svg, {
169
- ...p,
170
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
171
- d: "m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z"
172
- })
173
- });
174
- const FlaskConical = p => /*#__PURE__*/(0, _jsxRuntime.jsxs)(Svg, {
175
- ...p,
176
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
177
- d: "M10 2v7.527a2 2 0 0 1-.211.896L4.72 20.55a1 1 0 0 0 .9 1.45h12.76a1 1 0 0 0 .9-1.45l-5.069-10.127A2 2 0 0 1 14 9.527V2"
178
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
179
- d: "M8.5 2h7"
180
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
181
- d: "M7 16h10"
182
- })]
183
- });
184
- const Pin = ({
185
- active,
186
- ...p
187
- }) => /*#__PURE__*/(0, _jsxRuntime.jsx)(Svg, {
188
- ...p,
189
- children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("g", {
190
- transform: active ? "rotate(-45 12 12) translate(12 12) scale(0.92) translate(-12 -12)" : undefined,
191
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
192
- d: "M2.97 21.03 8.18 15.82"
193
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
194
- d: "M4.4 10.81 13.19 19.6"
195
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
196
- d: "M5.17 10.54 11.43 8.83"
197
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
198
- d: "M13.46 18.83 15.17 12.57"
199
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("rect", {
200
- x: "12.15",
201
- y: "5.4",
202
- width: "9.38",
203
- height: "3.52",
204
- rx: "1.07",
205
- transform: "rotate(-45 16.84 7.16)"
206
- })]
207
- })
208
- });
209
-
210
- // =============================
211
- // Shared formatters (provenance copies — not in the web shim)
212
- // =============================
213
-
214
- /** shared/src/utils/formatting/dataFormatting.ts — verbatim. */
215
- function formatBytes(bytes) {
216
- if (bytes === undefined || bytes === null) return "N/A";
217
- if (bytes === 0) return "0 B";
218
- const k = 1024;
219
- const sizes = ["B", "KB", "MB", "GB", "TB"];
220
- const i = Math.floor(Math.log(bytes) / Math.log(k));
221
- return `${(bytes / Math.pow(k, i)).toFixed(1)} ${sizes[i]}`;
222
- }
223
-
224
- /** shared/src/utils/formatting/dataFormatting.ts — verbatim. */
225
- function formatDuration(ms) {
226
- if (ms === undefined || ms === null) return "N/A";
227
- if (ms < 1000) {
228
- return `${ms}ms`;
229
- }
230
- if (ms < 60000) {
231
- return `${(ms / 1000).toFixed(1)}s`;
232
- }
233
- if (ms < 3600000) {
234
- const minutes = Math.floor(ms / 60000);
235
- const seconds = Math.floor(ms % 60000 / 1000);
236
- return seconds > 0 ? `${minutes}m ${seconds}s` : `${minutes}m`;
237
- }
238
- const hours = Math.floor(ms / 3600000);
239
- const minutes = Math.floor(ms % 3600000 / 60000);
240
- return minutes > 0 ? `${hours}h ${minutes}m` : `${hours}h`;
241
- }
242
-
243
- /** shared/src/utils/time/formatRelativeTime.ts — verbatim. */
244
- function formatRelativeTime(timestamp, currentTime = Date.now()) {
245
- const timestampMs = timestamp instanceof Date ? timestamp.getTime() : timestamp;
246
- const seconds = Math.floor((currentTime - timestampMs) / 1000);
247
- if (seconds < 0) {
248
- return "just now";
249
- }
250
- if (seconds < 60) {
251
- return seconds === 0 ? "just now" : `${seconds}s ago`;
252
- }
253
- const minutes = Math.floor(seconds / 60);
254
- if (minutes < 60) {
255
- return `${minutes}m ago`;
256
- }
257
- const hours = Math.floor(minutes / 60);
258
- if (hours < 24) {
259
- return `${hours}h ago`;
260
- }
261
- const days = Math.floor(hours / 24);
262
- return `${days}d ago`;
263
- }
264
-
265
- // =============================
266
- // Shared tick (DEVIATION: replaces shared-ui TickProvider/useTick)
267
- // =============================
268
-
269
- /**
270
- * One module-level 5s clock shared by every mounted row — the same cadence the
271
- * native rows get from NetworkModal's `TickProvider` (default `intervalMs`
272
- * 5_000). The interval only runs while at least one row is mounted.
273
- */
274
- const tickListeners = new Set();
275
- let tickInterval = null;
276
- function subscribeTick(listener) {
277
- tickListeners.add(listener);
278
- if (tickInterval == null) {
279
- tickInterval = setInterval(() => {
280
- const now = Date.now();
281
- tickListeners.forEach(l => l(now));
282
- }, 5_000);
283
- }
284
- return () => {
285
- tickListeners.delete(listener);
286
- if (tickListeners.size === 0 && tickInterval != null) {
287
- clearInterval(tickInterval);
288
- tickInterval = null;
289
- }
290
- };
291
- }
292
- function useSharedTick() {
293
- const [tick, setTick] = (0, _react.useState)(() => Date.now());
294
- (0, _react.useEffect)(() => subscribeTick(setTick), []);
295
- return tick;
296
- }
297
-
298
- // =============================
299
- // Pure display helpers (copied verbatim from the native file)
300
- // =============================
301
-
302
- // Get color based on status
303
- function getStatusColor(status, error) {
304
- if (error) return macOSColors.semantic.error;
305
- if (!status) return macOSColors.semantic.warning;
306
- if (status >= 200 && status < 300) return macOSColors.semantic.success;
307
- if (status >= 300 && status < 400) return macOSColors.semantic.info;
308
- if (status >= 400) return macOSColors.semantic.error;
309
- return macOSColors.text.muted;
310
- }
311
-
312
- // Get content type badge with color
313
- function getContentTypeBadge(headers) {
314
- const contentType = headers?.["content-type"] || headers?.["Content-Type"] || "";
315
- if (contentType.includes("json")) return "JSON";
316
- if (contentType.includes("xml")) return "XML";
317
- if (contentType.includes("html")) return "HTML";
318
- if (contentType.includes("text")) return "TEXT";
319
- if (contentType.includes("image")) return "IMG";
320
- if (contentType.includes("video")) return "VIDEO";
321
- if (contentType.includes("audio")) return "AUDIO";
322
- if (contentType.includes("form")) return "FORM";
323
- return null;
324
- }
325
-
326
- /**
327
- * The transport chip (`fetch` / `GQL` / `gRPC` / `XHR`), one brand colour each.
328
- */
329
- function getClientChipColors(requestClient) {
330
- switch (requestClient) {
331
- case "fetch":
332
- return {
333
- backgroundColor: "rgba(74, 144, 226, 0.15)",
334
- color: "#4A90E2"
335
- };
336
- case "graphql":
337
- return {
338
- backgroundColor: "rgba(229, 53, 171, 0.15)",
339
- color: "#E535AB"
340
- };
341
- case "grpc-web":
342
- return {
343
- backgroundColor: "rgba(16, 185, 129, 0.15)",
344
- color: "#10B981"
345
- };
346
- case "xhr":
347
- return {
348
- backgroundColor: "rgba(245, 158, 11, 0.15)",
349
- color: "#F59E0B"
350
- };
351
- default:
352
- return {
353
- backgroundColor: "rgba(147, 51, 234, 0.15)",
354
- color: "#9333EA"
355
- };
356
- }
357
- }
358
-
359
- // =============================
360
- // shared-ui DOM twins (provenance: Badge.tsx / DevToolsCard.tsx)
361
- // =============================
362
-
363
- /**
364
- * MethodBadge twin — shared/src/ui/components/Badge.tsx `MethodBadge`
365
- * (`size="small"`: 6/2 padding, 11px, weight 700, minWidth 45, `${color}15`
366
- * fill, `${color}40` border, radius 4). METHOD_COLORS map, verbatim.
367
- */
368
- const METHOD_COLORS = {
369
- GET: buoy.success,
370
- POST: buoy.primary,
371
- PUT: buoy.warning,
372
- PATCH: buoy.textSecondary,
373
- DELETE: buoy.error,
374
- HEAD: buoy.textMuted,
375
- OPTIONS: buoy.primary
376
- };
377
- function MethodBadgeWeb({
378
- method
379
- }) {
380
- const color = METHOD_COLORS[method.toUpperCase()] || "#6B7280";
381
- return /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
382
- style: {
383
- display: "inline-flex",
384
- alignItems: "center",
385
- justifyContent: "center",
386
- minWidth: 45,
387
- boxSizing: "border-box",
388
- padding: "2px 6px",
389
- fontSize: 11,
390
- fontWeight: 700,
391
- color,
392
- backgroundColor: `${color}15`,
393
- border: `1px solid ${color}40`,
394
- borderRadius: 4
395
- },
396
- children: method.toUpperCase()
397
- });
398
- }
399
-
400
- /**
401
- * TypeBadge twin — shared/src/ui/components/Badge.tsx `TypeBadge`
402
- * (`size="small"`). Content types ("JSON" etc.) are not in `getTypeColor`'s
403
- * map, so they all resolve to `buoyColors.textMuted` — same as native.
404
- */
405
- function TypeBadgeWeb({
406
- type
407
- }) {
408
- const color = buoy.textMuted;
409
- return /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
410
- style: {
411
- display: "inline-flex",
412
- alignItems: "center",
413
- padding: "2px 6px",
414
- fontSize: 11,
415
- fontWeight: 600,
416
- color,
417
- backgroundColor: `${color}15`,
418
- border: `1px solid ${color}40`,
419
- borderRadius: 4
420
- },
421
- children: type
422
- });
423
- }
424
-
425
- /**
426
- * DevToolsCard twin — shared/src/ui/components/DevToolsCard.tsx. Wrapper
427
- * margin 4px vertical (the native row overrides horizontal to 8), card =
428
- * buoyColors.card fill, `${border}40` outline + bottom hairline, radius 8,
429
- * padding 12, minHeight 44, activeOpacity 0.8. Long-press = 500ms pointer
430
- * hold (TouchableOpacity default delayLongPress) — see file header.
431
- */
432
- function DevToolsCardWeb({
433
- onPress,
434
- onLongPress,
435
- children,
436
- contentStyle
437
- }) {
438
- const [pressed, setPressed] = (0, _react.useState)(false);
439
- const longPressTimer = (0, _react.useRef)(null);
440
- const longPressFired = (0, _react.useRef)(false);
441
- const clearTimer = () => {
442
- if (longPressTimer.current != null) {
443
- clearTimeout(longPressTimer.current);
444
- longPressTimer.current = null;
445
- }
446
- };
447
- return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
448
- style: {
449
- margin: "4px 8px"
450
- },
451
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
452
- type: "button",
453
- onPointerDown: () => {
454
- setPressed(true);
455
- if (onLongPress) {
456
- longPressFired.current = false;
457
- clearTimer();
458
- longPressTimer.current = setTimeout(() => {
459
- longPressFired.current = true;
460
- onLongPress();
461
- }, 500);
462
- }
463
- },
464
- onPointerUp: () => {
465
- setPressed(false);
466
- clearTimer();
467
- },
468
- onPointerLeave: () => {
469
- setPressed(false);
470
- clearTimer();
471
- },
472
- onPointerCancel: () => {
473
- setPressed(false);
474
- clearTimer();
475
- },
476
- onClick: () => {
477
- // A long press toggles the pin; it must not ALSO open the detail.
478
- if (longPressFired.current) {
479
- longPressFired.current = false;
480
- return;
481
- }
482
- onPress();
483
- },
484
- style: {
485
- position: "relative",
486
- display: "flex",
487
- width: "100%",
488
- boxSizing: "border-box",
489
- backgroundColor: buoy.card,
490
- borderRadius: 8,
491
- border: `1px solid ${buoy.border}40`,
492
- borderBottom: `1px solid ${buoy.border}40`,
493
- padding: 12,
494
- minHeight: 44,
495
- margin: 0,
496
- textAlign: "left",
497
- cursor: "pointer",
498
- fontFamily: "inherit",
499
- color: "inherit",
500
- userSelect: "none",
501
- WebkitUserSelect: "none",
502
- opacity: pressed ? 0.8 : 1,
503
- ...contentStyle
504
- },
505
- children: children
506
- })
507
- });
508
- }
509
-
510
- // =============================
511
- // Row (structure mirrors the native file 1:1)
512
- // =============================
513
-
514
- // Status indicator component - single responsibility
515
- function StatusIndicator({
516
- event,
517
- isPending,
518
- statusColor
519
- }) {
520
- if (isPending) {
521
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
522
- style: styles.pendingBadge,
523
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(Clock, {
524
- size: 10,
525
- color: macOSColors.semantic.warning
526
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
527
- style: styles.pendingText,
528
- children: "..."
529
- })]
530
- });
531
- }
532
- if (event.error) {
533
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
534
- style: styles.errorBadge,
535
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(AlertCircle, {
536
- size: 10,
537
- color: macOSColors.semantic.error
538
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
539
- style: styles.errorText,
540
- children: "ERR"
541
- })]
542
- });
543
- }
544
- return /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
545
- style: styles.statusBadge,
546
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
547
- style: {
548
- ...styles.statusText,
549
- color: statusColor
550
- },
551
- children: String(event.status)
552
- })
553
- });
554
- }
555
-
556
- // Size indicators component - single responsibility
557
- function SizeIndicators({
558
- requestSize,
559
- responseSize
560
- }) {
561
- if (!requestSize && !responseSize) return null;
562
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
563
- style: styles.sizeRow,
564
- children: [requestSize ? /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
565
- style: styles.sizeItem,
566
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(Upload, {
567
- size: 8,
568
- color: macOSColors.semantic.info
569
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
570
- style: styles.sizeText,
571
- children: formatBytes(requestSize)
572
- })]
573
- }) : null, responseSize ? /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
574
- style: styles.sizeItem,
575
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(Download, {
576
- size: 8,
577
- color: macOSColors.semantic.success
578
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
579
- style: styles.sizeText,
580
- children: formatBytes(responseSize)
581
- })]
582
- }) : null]
583
- });
584
- }
585
-
586
- /**
587
- * Sole tick consumer in the row (rule2: composition over memo) — the periodic
588
- * relative-timestamp tick re-renders ONLY this leaf, not the whole card.
589
- */
590
- function BottomRightTime({
591
- timestamp,
592
- duration
593
- }) {
594
- const tick = useSharedTick();
595
- const relativeTime = formatRelativeTime(timestamp, tick);
596
- return duration ? /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
597
- style: styles.bottomRightText,
598
- children: [formatDuration(duration), " ", relativeTime]
599
- }) : /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
600
- style: styles.bottomRightText,
601
- children: relativeTime
602
- });
603
- }
604
- const NetworkEventItemCompact = exports.NetworkEventItemCompact = /*#__PURE__*/(0, _react.memo)(function NetworkEventItemCompact({
605
- event,
606
- onPress,
607
- pinned = false,
608
- saved = false,
609
- overridden = false,
610
- onLongPress
611
- }) {
612
- const statusColor = getStatusColor(event.status, event.error);
613
- const isPending = !event.status && !event.error;
614
- const contentType = getContentTypeBadge(event.responseHeaders);
615
-
616
- // Format URL for display (max 2 lines)
617
- let displayUrl = event.path || event.url.replace(/^https?:\/\/[^/]+/, "");
618
-
619
- // If this is a GraphQL request, show operation name with variables using
620
- // arrow notation (same pure util as native).
621
- if (event.requestClient === "graphql") {
622
- if (event.operationName) {
623
- displayUrl = (0, _formatGraphQLVariables.formatGraphQLDisplay)(event.operationName, event.graphqlVariables);
624
- } else {
625
- displayUrl = displayUrl.replace(/\/graphql[^?]*/, "/graphql");
626
- }
627
- } else if (event.operationName) {
628
- // For non-GraphQL requests with operation names (e.g., gRPC)
629
- displayUrl = `${displayUrl}\n(${event.operationName})`;
630
- }
631
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(DevToolsCardWeb, {
632
- onPress: () => onPress(event),
633
- onLongPress: onLongPress ? () => onLongPress(event) : undefined,
634
- contentStyle: {
635
- flexDirection: "row",
636
- alignItems: "center",
637
- borderLeft: `3px solid ${statusColor}`
638
- },
639
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
640
- style: styles.topRightContainer,
641
- children: [pinned ? /*#__PURE__*/(0, _jsxRuntime.jsx)(Pin, {
642
- size: 10,
643
- active: true,
644
- color: macOSColors.semantic.info
645
- }) : null, saved ? /*#__PURE__*/(0, _jsxRuntime.jsx)(Bookmark, {
646
- size: 10,
647
- color: macOSColors.semantic.debug
648
- }) : null, overridden || event.override ? /*#__PURE__*/(0, _jsxRuntime.jsx)(FlaskConical, {
649
- size: 10,
650
- color: macOSColors.semantic.warning
651
- }) : null, /*#__PURE__*/(0, _jsxRuntime.jsx)(StatusIndicator, {
652
- event: event,
653
- isPending: isPending,
654
- statusColor: statusColor
655
- }), event.requestClient ? /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
656
- style: {
657
- ...styles.topRightBadge,
658
- backgroundColor: getClientChipColors(event.requestClient).backgroundColor
659
- },
660
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
661
- style: {
662
- ...styles.clientText,
663
- color: getClientChipColors(event.requestClient).color
664
- },
665
- children: event.requestClient === "graphql" ? "GQL" : event.requestClient === "grpc-web" ? "gRPC" : event.requestClient === "xhr" ? "XHR" : event.requestClient
666
- })
667
- }) : null]
668
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
669
- style: styles.leftSection,
670
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(MethodBadgeWeb, {
671
- method: event.method
672
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(SizeIndicators, {
673
- requestSize: event.requestSize,
674
- responseSize: event.responseSize
675
- })]
676
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
677
- style: styles.middleSection,
678
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
679
- style: styles.urlText,
680
- children: displayUrl
681
- })
682
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
683
- style: styles.rightSection,
684
- children: [contentType ? /*#__PURE__*/(0, _jsxRuntime.jsx)(TypeBadgeWeb, {
685
- type: contentType
686
- }) : null, /*#__PURE__*/(0, _jsxRuntime.jsx)(ChevronRight, {
687
- size: 14,
688
- color: macOSColors.text.muted
689
- })]
690
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
691
- style: styles.bottomRightContainer,
692
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(BottomRightTime, {
693
- timestamp: event.timestamp,
694
- duration: event.duration
695
- })
696
- })]
697
- });
698
- });
699
- NetworkEventItemCompact.displayName = "NetworkEventItemCompact";
700
-
701
- // Values mirror the native StyleSheet block 1:1.
702
- const styles = {
703
- leftSection: {
704
- display: "flex",
705
- flexDirection: "column",
706
- marginRight: 8,
707
- alignItems: "flex-start"
708
- },
709
- topRightContainer: {
710
- position: "absolute",
711
- top: 1,
712
- right: 1,
713
- display: "flex",
714
- flexDirection: "row",
715
- alignItems: "center",
716
- gap: 4
717
- },
718
- topRightBadge: {
719
- display: "inline-flex",
720
- padding: "2px 4px",
721
- borderRadius: 4
722
- },
723
- middleSection: {
724
- flex: 1,
725
- minWidth: 0,
726
- display: "flex",
727
- flexDirection: "column",
728
- justifyContent: "center",
729
- paddingRight: 8
730
- },
731
- urlText: {
732
- fontSize: 12,
733
- color: macOSColors.text.primary,
734
- lineHeight: "16px",
735
- fontFamily: "ui-monospace, Menlo, monospace",
736
- display: "-webkit-box",
737
- WebkitLineClamp: 2,
738
- WebkitBoxOrient: "vertical",
739
- overflow: "hidden",
740
- whiteSpace: "pre-wrap",
741
- wordBreak: "break-all"
742
- },
743
- rightSection: {
744
- display: "flex",
745
- flexDirection: "row",
746
- alignItems: "center",
747
- gap: 6
748
- },
749
- bottomRightContainer: {
750
- position: "absolute",
751
- bottom: 4,
752
- right: 8
753
- },
754
- bottomRightText: {
755
- fontSize: 9,
756
- color: macOSColors.text.muted,
757
- fontFamily: "ui-monospace, Menlo, monospace",
758
- whiteSpace: "pre"
759
- },
760
- statusBadge: {
761
- display: "inline-flex",
762
- padding: "1px 4px",
763
- borderRadius: 3
764
- },
765
- statusText: {
766
- fontSize: 10,
767
- fontWeight: 600
768
- },
769
- pendingBadge: {
770
- display: "inline-flex",
771
- flexDirection: "row",
772
- alignItems: "center",
773
- gap: 2,
774
- padding: "1px 4px",
775
- backgroundColor: macOSColors.semantic.warning + "26",
776
- borderRadius: 3
777
- },
778
- pendingText: {
779
- fontSize: 10,
780
- color: macOSColors.semantic.warning,
781
- fontWeight: 600
782
- },
783
- errorBadge: {
784
- display: "inline-flex",
785
- flexDirection: "row",
786
- alignItems: "center",
787
- gap: 2,
788
- padding: "1px 4px",
789
- backgroundColor: macOSColors.semantic.error + "26",
790
- borderRadius: 3
791
- },
792
- errorText: {
793
- fontSize: 10,
794
- color: macOSColors.semantic.error,
795
- fontWeight: 600
796
- },
797
- sizeRow: {
798
- display: "flex",
799
- flexDirection: "row",
800
- gap: 4,
801
- marginTop: 4
802
- },
803
- sizeItem: {
804
- display: "inline-flex",
805
- flexDirection: "row",
806
- alignItems: "center",
807
- gap: 2
808
- },
809
- sizeText: {
810
- fontSize: 8,
811
- color: macOSColors.text.secondary,
812
- fontFamily: "ui-monospace, Menlo, monospace"
813
- },
814
- clientText: {
815
- fontSize: 8,
816
- fontWeight: 700,
817
- letterSpacing: 0.3,
818
- textTransform: "uppercase"
819
- }
820
- };
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.NetworkEventItemCompact=void 0;var _react=require("react");var _formatGraphQLVariables=require("../utils/formatGraphQLVariables");var _jsxRuntime=require("react/jsx-runtime");const macOSColors={text:{primary:"#F5F5F7",secondary:"#A1A1A6",muted:"#8E8E93"},semantic:{success:"#34C759",error:"#FF453A",warning:"#FFEB3B",info:"#00B8E6",debug:"#BF5AF2"}};const buoy={card:"#1A1A1A",border:"#333333",primary:"#20C997",success:"#20C997",warning:"#FFA94D",error:"#EF4444",textSecondary:"#A0A0A0",textMuted:"#888888"};function Svg({size:t=14,color:e="currentColor",children:r}){return(0,_jsxRuntime.jsx)("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:e,strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",style:{flexShrink:0,display:"block"},children:r})}const ChevronRight=t=>(0,_jsxRuntime.jsx)(Svg,{...t,children:(0,_jsxRuntime.jsx)("path",{d:"m9 18 6-6-6-6"})});const Upload=t=>(0,_jsxRuntime.jsxs)(Svg,{...t,children:[(0,_jsxRuntime.jsx)("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),(0,_jsxRuntime.jsx)("polyline",{points:"17 8 12 3 7 8"}),(0,_jsxRuntime.jsx)("line",{x1:"12",x2:"12",y1:"3",y2:"15"})]});const Download=t=>(0,_jsxRuntime.jsxs)(Svg,{...t,children:[(0,_jsxRuntime.jsx)("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),(0,_jsxRuntime.jsx)("polyline",{points:"7 10 12 15 17 10"}),(0,_jsxRuntime.jsx)("line",{x1:"12",x2:"12",y1:"15",y2:"3"})]});const Clock=t=>(0,_jsxRuntime.jsxs)(Svg,{...t,children:[(0,_jsxRuntime.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,_jsxRuntime.jsx)("polyline",{points:"12 6 12 12 16 14"})]});const AlertCircle=t=>(0,_jsxRuntime.jsxs)(Svg,{...t,children:[(0,_jsxRuntime.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,_jsxRuntime.jsx)("line",{x1:"12",x2:"12",y1:"8",y2:"12"}),(0,_jsxRuntime.jsx)("line",{x1:"12",x2:"12.01",y1:"16",y2:"16"})]});const Bookmark=t=>(0,_jsxRuntime.jsx)(Svg,{...t,children:(0,_jsxRuntime.jsx)("path",{d:"m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z"})});const FlaskConical=t=>(0,_jsxRuntime.jsxs)(Svg,{...t,children:[(0,_jsxRuntime.jsx)("path",{d:"M10 2v7.527a2 2 0 0 1-.211.896L4.72 20.55a1 1 0 0 0 .9 1.45h12.76a1 1 0 0 0 .9-1.45l-5.069-10.127A2 2 0 0 1 14 9.527V2"}),(0,_jsxRuntime.jsx)("path",{d:"M8.5 2h7"}),(0,_jsxRuntime.jsx)("path",{d:"M7 16h10"})]});const Pin=({active:t,...e})=>(0,_jsxRuntime.jsx)(Svg,{...e,children:(0,_jsxRuntime.jsxs)("g",{transform:t?"rotate(-45 12 12) translate(12 12) scale(0.92) translate(-12 -12)":void 0,children:[(0,_jsxRuntime.jsx)("path",{d:"M2.97 21.03 8.18 15.82"}),(0,_jsxRuntime.jsx)("path",{d:"M4.4 10.81 13.19 19.6"}),(0,_jsxRuntime.jsx)("path",{d:"M5.17 10.54 11.43 8.83"}),(0,_jsxRuntime.jsx)("path",{d:"M13.46 18.83 15.17 12.57"}),(0,_jsxRuntime.jsx)("rect",{x:"12.15",y:"5.4",width:"9.38",height:"3.52",rx:"1.07",transform:"rotate(-45 16.84 7.16)"})]})});function formatBytes(t){if(t===void 0||t===null)return"N/A";if(t===0)return"0 B";const e=1024;const r=["B","KB","MB","GB","TB"];const n=Math.floor(Math.log(t)/Math.log(e));return`${(t/Math.pow(e,n)).toFixed(1)} ${r[n]}`}function formatDuration(t){if(t===void 0||t===null)return"N/A";if(t<1e3){return`${t}ms`}if(t<6e4){return`${(t/1e3).toFixed(1)}s`}if(t<36e5){const n=Math.floor(t/6e4);const o=Math.floor(t%6e4/1e3);return o>0?`${n}m ${o}s`:`${n}m`}const e=Math.floor(t/36e5);const r=Math.floor(t%36e5/6e4);return r>0?`${e}h ${r}m`:`${e}h`}function formatRelativeTime(t,e=Date.now()){const r=t instanceof Date?t.getTime():t;const n=Math.floor((e-r)/1e3);if(n<0){return"just now"}if(n<60){return n===0?"just now":`${n}s ago`}const o=Math.floor(n/60);if(o<60){return`${o}m ago`}const i=Math.floor(o/60);if(i<24){return`${i}h ago`}const s=Math.floor(i/24);return`${s}d ago`}const tickListeners=new Set;let tickInterval=null;function subscribeTick(t){tickListeners.add(t);if(tickInterval==null){tickInterval=setInterval(()=>{const e=Date.now();tickListeners.forEach(r=>r(e))},5e3)}return()=>{tickListeners.delete(t);if(tickListeners.size===0&&tickInterval!=null){clearInterval(tickInterval);tickInterval=null}}}function useSharedTick(){const[t,e]=(0,_react.useState)(()=>Date.now());(0,_react.useEffect)(()=>subscribeTick(e),[]);return t}function getStatusColor(t,e){if(e)return macOSColors.semantic.error;if(!t)return macOSColors.semantic.warning;if(t>=200&&t<300)return macOSColors.semantic.success;if(t>=300&&t<400)return macOSColors.semantic.info;if(t>=400)return macOSColors.semantic.error;return macOSColors.text.muted}function getContentTypeBadge(t){const e=t?.["content-type"]||t?.["Content-Type"]||"";if(e.includes("json"))return"JSON";if(e.includes("xml"))return"XML";if(e.includes("html"))return"HTML";if(e.includes("text"))return"TEXT";if(e.includes("image"))return"IMG";if(e.includes("video"))return"VIDEO";if(e.includes("audio"))return"AUDIO";if(e.includes("form"))return"FORM";return null}function getClientChipColors(t){switch(t){case"fetch":return{backgroundColor:"rgba(74, 144, 226, 0.15)",color:"#4A90E2"};case"graphql":return{backgroundColor:"rgba(229, 53, 171, 0.15)",color:"#E535AB"};case"grpc-web":return{backgroundColor:"rgba(16, 185, 129, 0.15)",color:"#10B981"};case"xhr":return{backgroundColor:"rgba(245, 158, 11, 0.15)",color:"#F59E0B"};default:return{backgroundColor:"rgba(147, 51, 234, 0.15)",color:"#9333EA"}}}const METHOD_COLORS={GET:buoy.success,POST:buoy.primary,PUT:buoy.warning,PATCH:buoy.textSecondary,DELETE:buoy.error,HEAD:buoy.textMuted,OPTIONS:buoy.primary};function MethodBadgeWeb({method:t}){const e=METHOD_COLORS[t.toUpperCase()]||"#6B7280";return(0,_jsxRuntime.jsx)("span",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:45,boxSizing:"border-box",padding:"2px 6px",fontSize:11,fontWeight:700,color:e,backgroundColor:`${e}15`,border:`1px solid ${e}40`,borderRadius:4},children:t.toUpperCase()})}function TypeBadgeWeb({type:t}){const e=buoy.textMuted;return(0,_jsxRuntime.jsx)("span",{style:{display:"inline-flex",alignItems:"center",padding:"2px 6px",fontSize:11,fontWeight:600,color:e,backgroundColor:`${e}15`,border:`1px solid ${e}40`,borderRadius:4},children:t})}function DevToolsCardWeb({onPress:t,onLongPress:e,children:r,contentStyle:n}){const[o,i]=(0,_react.useState)(false);const s=(0,_react.useRef)(null);const l=(0,_react.useRef)(false);const a=()=>{if(s.current!=null){clearTimeout(s.current);s.current=null}};return(0,_jsxRuntime.jsx)("div",{style:{margin:"4px 8px"},children:(0,_jsxRuntime.jsx)("button",{type:"button",onPointerDown:()=>{i(true);if(e){l.current=false;a();s.current=setTimeout(()=>{l.current=true;e()},500)}},onPointerUp:()=>{i(false);a()},onPointerLeave:()=>{i(false);a()},onPointerCancel:()=>{i(false);a()},onClick:()=>{if(l.current){l.current=false;return}t()},style:{position:"relative",display:"flex",width:"100%",boxSizing:"border-box",backgroundColor:buoy.card,borderRadius:8,border:`1px solid ${buoy.border}40`,borderBottom:`1px solid ${buoy.border}40`,padding:12,minHeight:44,margin:0,textAlign:"left",cursor:"pointer",fontFamily:"inherit",color:"inherit",userSelect:"none",WebkitUserSelect:"none",opacity:o?.8:1,...n},children:r})})}function StatusIndicator({event:t,isPending:e,statusColor:r}){if(e){return(0,_jsxRuntime.jsxs)("span",{style:styles.pendingBadge,children:[(0,_jsxRuntime.jsx)(Clock,{size:10,color:macOSColors.semantic.warning}),(0,_jsxRuntime.jsx)("span",{style:styles.pendingText,children:"..."})]})}if(t.error){return(0,_jsxRuntime.jsxs)("span",{style:styles.errorBadge,children:[(0,_jsxRuntime.jsx)(AlertCircle,{size:10,color:macOSColors.semantic.error}),(0,_jsxRuntime.jsx)("span",{style:styles.errorText,children:"ERR"})]})}return(0,_jsxRuntime.jsx)("span",{style:styles.statusBadge,children:(0,_jsxRuntime.jsx)("span",{style:{...styles.statusText,color:r},children:String(t.status)})})}function SizeIndicators({requestSize:t,responseSize:e}){if(!t&&!e)return null;return(0,_jsxRuntime.jsxs)("span",{style:styles.sizeRow,children:[t?(0,_jsxRuntime.jsxs)("span",{style:styles.sizeItem,children:[(0,_jsxRuntime.jsx)(Upload,{size:8,color:macOSColors.semantic.info}),(0,_jsxRuntime.jsx)("span",{style:styles.sizeText,children:formatBytes(t)})]}):null,e?(0,_jsxRuntime.jsxs)("span",{style:styles.sizeItem,children:[(0,_jsxRuntime.jsx)(Download,{size:8,color:macOSColors.semantic.success}),(0,_jsxRuntime.jsx)("span",{style:styles.sizeText,children:formatBytes(e)})]}):null]})}function BottomRightTime({timestamp:t,duration:e}){const r=useSharedTick();const n=formatRelativeTime(t,r);return e?(0,_jsxRuntime.jsxs)("span",{style:styles.bottomRightText,children:[formatDuration(e)," ",n]}):(0,_jsxRuntime.jsx)("span",{style:styles.bottomRightText,children:n})}const NetworkEventItemCompact=exports.NetworkEventItemCompact=(0,_react.memo)(function t({event:e,onPress:r,pinned:n=false,saved:o=false,overridden:i=false,onLongPress:s}){const l=getStatusColor(e.status,e.error);const a=!e.status&&!e.error;const d=getContentTypeBadge(e.responseHeaders);let c=e.path||e.url.replace(/^https?:\/\/[^/]+/,"");if(e.requestClient==="graphql"){if(e.operationName){c=(0,_formatGraphQLVariables.formatGraphQLDisplay)(e.operationName,e.graphqlVariables)}else{c=c.replace(/\/graphql[^?]*/,"/graphql")}}else if(e.operationName){c=`${c}
2
+ (${e.operationName})`}return(0,_jsxRuntime.jsxs)(DevToolsCardWeb,{onPress:()=>r(e),onLongPress:s?()=>s(e):void 0,contentStyle:{flexDirection:"row",alignItems:"center",borderLeft:`3px solid ${l}`},children:[(0,_jsxRuntime.jsxs)("span",{style:styles.topRightContainer,children:[n?(0,_jsxRuntime.jsx)(Pin,{size:10,active:true,color:macOSColors.semantic.info}):null,o?(0,_jsxRuntime.jsx)(Bookmark,{size:10,color:macOSColors.semantic.debug}):null,i||e.override?(0,_jsxRuntime.jsx)(FlaskConical,{size:10,color:macOSColors.semantic.warning}):null,(0,_jsxRuntime.jsx)(StatusIndicator,{event:e,isPending:a,statusColor:l}),e.requestClient?(0,_jsxRuntime.jsx)("span",{style:{...styles.topRightBadge,backgroundColor:getClientChipColors(e.requestClient).backgroundColor},children:(0,_jsxRuntime.jsx)("span",{style:{...styles.clientText,color:getClientChipColors(e.requestClient).color},children:e.requestClient==="graphql"?"GQL":e.requestClient==="grpc-web"?"gRPC":e.requestClient==="xhr"?"XHR":e.requestClient})}):null]}),(0,_jsxRuntime.jsxs)("span",{style:styles.leftSection,children:[(0,_jsxRuntime.jsx)(MethodBadgeWeb,{method:e.method}),(0,_jsxRuntime.jsx)(SizeIndicators,{requestSize:e.requestSize,responseSize:e.responseSize})]}),(0,_jsxRuntime.jsx)("span",{style:styles.middleSection,children:(0,_jsxRuntime.jsx)("span",{style:styles.urlText,children:c})}),(0,_jsxRuntime.jsxs)("span",{style:styles.rightSection,children:[d?(0,_jsxRuntime.jsx)(TypeBadgeWeb,{type:d}):null,(0,_jsxRuntime.jsx)(ChevronRight,{size:14,color:macOSColors.text.muted})]}),(0,_jsxRuntime.jsx)("span",{style:styles.bottomRightContainer,children:(0,_jsxRuntime.jsx)(BottomRightTime,{timestamp:e.timestamp,duration:e.duration})})]})});NetworkEventItemCompact.displayName="NetworkEventItemCompact";const styles={leftSection:{display:"flex",flexDirection:"column",marginRight:8,alignItems:"flex-start"},topRightContainer:{position:"absolute",top:1,right:1,display:"flex",flexDirection:"row",alignItems:"center",gap:4},topRightBadge:{display:"inline-flex",padding:"2px 4px",borderRadius:4},middleSection:{flex:1,minWidth:0,display:"flex",flexDirection:"column",justifyContent:"center",paddingRight:8},urlText:{fontSize:12,color:macOSColors.text.primary,lineHeight:"16px",fontFamily:"ui-monospace, Menlo, monospace",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden",whiteSpace:"pre-wrap",wordBreak:"break-all"},rightSection:{display:"flex",flexDirection:"row",alignItems:"center",gap:6},bottomRightContainer:{position:"absolute",bottom:4,right:8},bottomRightText:{fontSize:9,color:macOSColors.text.muted,fontFamily:"ui-monospace, Menlo, monospace",whiteSpace:"pre"},statusBadge:{display:"inline-flex",padding:"1px 4px",borderRadius:3},statusText:{fontSize:10,fontWeight:600},pendingBadge:{display:"inline-flex",flexDirection:"row",alignItems:"center",gap:2,padding:"1px 4px",backgroundColor:macOSColors.semantic.warning+"26",borderRadius:3},pendingText:{fontSize:10,color:macOSColors.semantic.warning,fontWeight:600},errorBadge:{display:"inline-flex",flexDirection:"row",alignItems:"center",gap:2,padding:"1px 4px",backgroundColor:macOSColors.semantic.error+"26",borderRadius:3},errorText:{fontSize:10,color:macOSColors.semantic.error,fontWeight:600},sizeRow:{display:"flex",flexDirection:"row",gap:4,marginTop:4},sizeItem:{display:"inline-flex",flexDirection:"row",alignItems:"center",gap:2},sizeText:{fontSize:8,color:macOSColors.text.secondary,fontFamily:"ui-monospace, Menlo, monospace"},clientText:{fontSize:8,fontWeight:700,letterSpacing:.3,textTransform:"uppercase"}};