@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,174 +1 @@
1
- "use strict";
2
-
3
- import { useState } from "react";
4
- import { StyleSheet, Text, TextInput, TouchableOpacity, View } from "react-native";
5
- import { absoluteFill, macOSColors } from "@buoy-gg/shared-ui";
6
-
7
- /**
8
- * Entering one number, without the keyboard eating the screen.
9
- *
10
- * The custom status / delay / times fields used to be inline inputs sitting
11
- * mid-form. Focusing one raises the keyboard, which on a phone covers roughly
12
- * the bottom half of the tool — including, depending on where you'd scrolled,
13
- * the field you were typing into and the Save button you needed next.
14
- *
15
- * Pinning the panel to the TOP is the fix, and it's the same one
16
- * `StorageValueEditModal` reached for: a centred panel gets shoved up or
17
- * covered the moment the field focuses, and a bottom sheet is simply
18
- * underneath it. At the top it stays put and stays readable.
19
- *
20
- * Deliberately not a reuse of that component — this asks for a number and
21
- * nothing else. It has no type inference, no raw-JSON escape hatch and no
22
- * shape-preservation rules, so borrowing 400 lines to avoid writing 100 would
23
- * be the wrong trade.
24
- */
25
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
26
- export function NetworkNumberPrompt({
27
- title,
28
- hint,
29
- value,
30
- placeholder = "Number",
31
- min,
32
- max,
33
- onSubmit,
34
- onCancel
35
- }) {
36
- const [text, setText] = useState(value != null ? String(value) : "");
37
- const submit = () => {
38
- const trimmed = text.trim();
39
- if (!trimmed) {
40
- onSubmit(null);
41
- return;
42
- }
43
- const parsed = Number(trimmed);
44
- if (!Number.isFinite(parsed)) {
45
- onSubmit(null);
46
- return;
47
- }
48
- // Clamped here rather than accepted-then-silently-changed: a field that
49
- // takes 999 and stores 599 is a field that lies.
50
- let next = parsed;
51
- if (min != null) next = Math.max(min, next);
52
- if (max != null) next = Math.min(max, next);
53
- onSubmit(next);
54
- };
55
- return /*#__PURE__*/_jsxs(View, {
56
- style: styles.overlay,
57
- children: [/*#__PURE__*/_jsx(TouchableOpacity, {
58
- style: styles.backdrop,
59
- activeOpacity: 1,
60
- onPress: onCancel,
61
- "sentry-label": "ignore dismiss number prompt"
62
- }), /*#__PURE__*/_jsxs(View, {
63
- style: styles.panel,
64
- children: [/*#__PURE__*/_jsx(Text, {
65
- style: styles.title,
66
- children: title
67
- }), /*#__PURE__*/_jsx(TextInput, {
68
- style: styles.input,
69
- value: text,
70
- onChangeText: setText,
71
- placeholder: placeholder,
72
- placeholderTextColor: macOSColors.text.muted,
73
- keyboardType: "number-pad",
74
- autoFocus: true,
75
- selectTextOnFocus: true,
76
- onSubmitEditing: submit,
77
- returnKeyType: "done",
78
- "sentry-label": "ignore number prompt input",
79
- accessibilityLabel: title
80
- }), hint ? /*#__PURE__*/_jsx(Text, {
81
- style: styles.hint,
82
- children: hint
83
- }) : null, /*#__PURE__*/_jsxs(View, {
84
- style: styles.actions,
85
- children: [/*#__PURE__*/_jsx(TouchableOpacity, {
86
- onPress: onCancel,
87
- "sentry-label": "ignore cancel number prompt",
88
- style: [styles.button, styles.cancelButton],
89
- children: /*#__PURE__*/_jsx(Text, {
90
- style: styles.cancelText,
91
- children: "Cancel"
92
- })
93
- }), /*#__PURE__*/_jsx(TouchableOpacity, {
94
- onPress: submit,
95
- "sentry-label": "ignore save number prompt",
96
- style: [styles.button, styles.saveButton],
97
- children: /*#__PURE__*/_jsx(Text, {
98
- style: styles.saveText,
99
- children: "Set"
100
- })
101
- })]
102
- })]
103
- })]
104
- });
105
- }
106
- const styles = StyleSheet.create({
107
- overlay: {
108
- ...absoluteFill,
109
- zIndex: 40
110
- },
111
- backdrop: {
112
- ...absoluteFill,
113
- backgroundColor: "rgba(0,0,0,0.6)"
114
- },
115
- panel: {
116
- marginHorizontal: 12,
117
- marginTop: 12,
118
- padding: 14,
119
- borderRadius: 10,
120
- borderWidth: 1,
121
- borderColor: macOSColors.border.hover,
122
- backgroundColor: macOSColors.background.card,
123
- gap: 10
124
- },
125
- title: {
126
- fontSize: 13,
127
- fontWeight: "700",
128
- color: macOSColors.text.primary
129
- },
130
- input: {
131
- backgroundColor: macOSColors.background.input,
132
- borderWidth: 1,
133
- borderColor: macOSColors.border.input,
134
- borderRadius: 6,
135
- paddingHorizontal: 12,
136
- paddingVertical: 10,
137
- fontSize: 16,
138
- fontWeight: "700",
139
- color: macOSColors.text.primary
140
- },
141
- hint: {
142
- fontSize: 10,
143
- color: macOSColors.text.muted
144
- },
145
- actions: {
146
- flexDirection: "row",
147
- gap: 8
148
- },
149
- button: {
150
- flex: 1,
151
- paddingVertical: 10,
152
- borderRadius: 6,
153
- alignItems: "center",
154
- borderWidth: 1
155
- },
156
- cancelButton: {
157
- borderColor: macOSColors.border.default,
158
- backgroundColor: macOSColors.background.base
159
- },
160
- cancelText: {
161
- fontSize: 12,
162
- fontWeight: "600",
163
- color: macOSColors.text.secondary
164
- },
165
- saveButton: {
166
- borderColor: macOSColors.semantic.info,
167
- backgroundColor: `${macOSColors.semantic.info}22`
168
- },
169
- saveText: {
170
- fontSize: 12,
171
- fontWeight: "700",
172
- color: macOSColors.semantic.info
173
- }
174
- });
1
+ "use strict";import{useState as C}from"react";import{StyleSheet as S,Text as n,TextInput as v,TouchableOpacity as i,View as a}from"react-native";import{absoluteFill as f,macOSColors as e}from"@buoy-gg/shared-ui";import{jsx as r,jsxs as s}from"react/jsx-runtime";export function NetworkNumberPrompt({title:c,hint:d,value:u,placeholder:T="Number",min:b,max:p,onSubmit:l,onCancel:m}){const[g,k]=C(u!=null?String(u):"");const y=()=>{const h=g.trim();if(!h){l(null);return}const x=Number(h);if(!Number.isFinite(x)){l(null);return}let o=x;if(b!=null)o=Math.max(b,o);if(p!=null)o=Math.min(p,o);l(o)};return s(a,{style:t.overlay,children:[r(i,{style:t.backdrop,activeOpacity:1,onPress:m,"sentry-label":"ignore dismiss number prompt"}),s(a,{style:t.panel,children:[r(n,{style:t.title,children:c}),r(v,{style:t.input,value:g,onChangeText:k,placeholder:T,placeholderTextColor:e.text.muted,keyboardType:"number-pad",autoFocus:true,selectTextOnFocus:true,onSubmitEditing:y,returnKeyType:"done","sentry-label":"ignore number prompt input",accessibilityLabel:c}),d?r(n,{style:t.hint,children:d}):null,s(a,{style:t.actions,children:[r(i,{onPress:m,"sentry-label":"ignore cancel number prompt",style:[t.button,t.cancelButton],children:r(n,{style:t.cancelText,children:"Cancel"})}),r(i,{onPress:y,"sentry-label":"ignore save number prompt",style:[t.button,t.saveButton],children:r(n,{style:t.saveText,children:"Set"})})]})]})]})}const t=S.create({overlay:{...f,zIndex:40},backdrop:{...f,backgroundColor:"rgba(0,0,0,0.6)"},panel:{marginHorizontal:12,marginTop:12,padding:14,borderRadius:10,borderWidth:1,borderColor:e.border.hover,backgroundColor:e.background.card,gap:10},title:{fontSize:13,fontWeight:"700",color:e.text.primary},input:{backgroundColor:e.background.input,borderWidth:1,borderColor:e.border.input,borderRadius:6,paddingHorizontal:12,paddingVertical:10,fontSize:16,fontWeight:"700",color:e.text.primary},hint:{fontSize:10,color:e.text.muted},actions:{flexDirection:"row",gap:8},button:{flex:1,paddingVertical:10,borderRadius:6,alignItems:"center",borderWidth:1},cancelButton:{borderColor:e.border.default,backgroundColor:e.background.base},cancelText:{fontSize:12,fontWeight:"600",color:e.text.secondary},saveButton:{borderColor:e.semantic.info,backgroundColor:`${e.semantic.info}22`},saveText:{fontSize:12,fontWeight:"700",color:e.semantic.info}});
@@ -1,230 +1 @@
1
- "use strict";
2
-
3
- /**
4
- * NetworkNumberPrompt.web — DOM twin of NetworkNumberPrompt.tsx.
5
- *
6
- * Entering one number, pinned to the TOP of the tool so the (mobile) keyboard
7
- * can't cover it — the panel keeps the same placement so the two surfaces
8
- * read identically. Same clamp-on-submit semantics: a field that takes 999
9
- * and stores 599 is a field that lies, so min/max clamp BEFORE `onSubmit`.
10
- *
11
- * shared-ui RN chrome is replicated as DOM with provenance (web consumers
12
- * resolve `@buoy-gg/shared-ui` to a minimal shim):
13
- * - `macOSColors` — inlined verbatim subset from
14
- * shared/src/ui/gameUI/constants/macOSDesignSystemColors.ts.
15
- * - `absoluteFill` — inset: 0.
16
- *
17
- * Intentional deviations (all logged):
18
- * - `selectTextOnFocus` → an explicit `select()` in the autoFocus ref
19
- * callback (DOM inputs don't select-all on focus by default).
20
- * - `keyboardType="number-pad"` → `inputMode="numeric"`; Enter submits
21
- * (native `onSubmitEditing`/`returnKeyType="done"`), Escape cancels (the
22
- * keyboard affordance the backdrop tap covers on touch).
23
- *
24
- * @platform React DOM Web
25
- */
26
-
27
- import { useState } from "react";
28
-
29
- /** macOSColors subset — shared/src/ui/gameUI/constants/macOSDesignSystemColors.ts, verbatim. */
30
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
31
- const macOSColors = {
32
- background: {
33
- base: "#0A0A0C",
34
- card: "#1A1A1C",
35
- input: "#26262A"
36
- },
37
- border: {
38
- default: "#2D2D2F",
39
- input: "#3D3D42",
40
- hover: "#4D4D4F"
41
- },
42
- text: {
43
- primary: "#F5F5F7",
44
- secondary: "#A1A1A6",
45
- muted: "#8E8E93"
46
- },
47
- semantic: {
48
- info: "#00B8E6"
49
- }
50
- };
51
- export function NetworkNumberPrompt({
52
- title,
53
- hint,
54
- value,
55
- placeholder = "Number",
56
- min,
57
- max,
58
- onSubmit,
59
- onCancel
60
- }) {
61
- const [text, setText] = useState(value != null ? String(value) : "");
62
- const submit = () => {
63
- const trimmed = text.trim();
64
- if (!trimmed) {
65
- onSubmit(null);
66
- return;
67
- }
68
- const parsed = Number(trimmed);
69
- if (!Number.isFinite(parsed)) {
70
- onSubmit(null);
71
- return;
72
- }
73
- // Clamped here rather than accepted-then-silently-changed: a field that
74
- // takes 999 and stores 599 is a field that lies. (Native comment.)
75
- let next = parsed;
76
- if (min != null) next = Math.max(min, next);
77
- if (max != null) next = Math.min(max, next);
78
- onSubmit(next);
79
- };
80
- return /*#__PURE__*/_jsxs("div", {
81
- style: styles.overlay,
82
- children: [/*#__PURE__*/_jsx("button", {
83
- type: "button",
84
- "aria-label": "Dismiss",
85
- onClick: onCancel,
86
- style: styles.backdrop
87
- }), /*#__PURE__*/_jsxs("div", {
88
- style: styles.panel,
89
- children: [/*#__PURE__*/_jsx("div", {
90
- style: styles.title,
91
- children: title
92
- }), /*#__PURE__*/_jsx("input", {
93
- style: styles.input,
94
- value: text,
95
- onChange: e => setText(e.target.value),
96
- placeholder: placeholder,
97
- inputMode: "numeric"
98
- // DEVIATION (logged in the file header): autoFocus + select() stands
99
- // in for native `selectTextOnFocus`.
100
- ,
101
- ref: node => {
102
- if (node) {
103
- node.focus();
104
- node.select();
105
- }
106
- },
107
- onKeyDown: e => {
108
- if (e.key === "Enter") submit();
109
- if (e.key === "Escape") onCancel();
110
- },
111
- "aria-label": title
112
- }), hint ? /*#__PURE__*/_jsx("div", {
113
- style: styles.hint,
114
- children: hint
115
- }) : null, /*#__PURE__*/_jsxs("div", {
116
- style: styles.actions,
117
- children: [/*#__PURE__*/_jsx("button", {
118
- type: "button",
119
- onClick: onCancel,
120
- style: {
121
- ...styles.button,
122
- ...styles.cancelButton
123
- },
124
- children: /*#__PURE__*/_jsx("span", {
125
- style: styles.cancelText,
126
- children: "Cancel"
127
- })
128
- }), /*#__PURE__*/_jsx("button", {
129
- type: "button",
130
- onClick: submit,
131
- style: {
132
- ...styles.button,
133
- ...styles.saveButton
134
- },
135
- children: /*#__PURE__*/_jsx("span", {
136
- style: styles.saveText,
137
- children: "Set"
138
- })
139
- })]
140
- })]
141
- })]
142
- });
143
- }
144
-
145
- // Values mirror the native StyleSheet block 1:1.
146
- const styles = {
147
- overlay: {
148
- position: "absolute",
149
- inset: 0,
150
- zIndex: 40
151
- },
152
- backdrop: {
153
- position: "absolute",
154
- inset: 0,
155
- backgroundColor: "rgba(0,0,0,0.6)",
156
- border: "none",
157
- padding: 0,
158
- margin: 0,
159
- cursor: "default",
160
- width: "100%",
161
- height: "100%"
162
- },
163
- panel: {
164
- position: "relative",
165
- margin: "12px 12px 0",
166
- padding: 14,
167
- borderRadius: 10,
168
- border: `1px solid ${macOSColors.border.hover}`,
169
- backgroundColor: macOSColors.background.card,
170
- display: "flex",
171
- flexDirection: "column",
172
- gap: 10
173
- },
174
- title: {
175
- fontSize: 13,
176
- fontWeight: 700,
177
- color: macOSColors.text.primary
178
- },
179
- input: {
180
- backgroundColor: macOSColors.background.input,
181
- border: `1px solid ${macOSColors.border.input}`,
182
- borderRadius: 6,
183
- padding: "10px 12px",
184
- fontSize: 16,
185
- fontWeight: 700,
186
- color: macOSColors.text.primary,
187
- outline: "none",
188
- fontFamily: "inherit",
189
- boxSizing: "border-box",
190
- width: "100%"
191
- },
192
- hint: {
193
- fontSize: 10,
194
- color: macOSColors.text.muted
195
- },
196
- actions: {
197
- display: "flex",
198
- flexDirection: "row",
199
- gap: 8
200
- },
201
- button: {
202
- flex: 1,
203
- padding: "10px 0",
204
- borderRadius: 6,
205
- display: "inline-flex",
206
- alignItems: "center",
207
- justifyContent: "center",
208
- cursor: "pointer",
209
- margin: 0,
210
- boxSizing: "border-box"
211
- },
212
- cancelButton: {
213
- border: `1px solid ${macOSColors.border.default}`,
214
- backgroundColor: macOSColors.background.base
215
- },
216
- cancelText: {
217
- fontSize: 12,
218
- fontWeight: 600,
219
- color: macOSColors.text.secondary
220
- },
221
- saveButton: {
222
- border: `1px solid ${macOSColors.semantic.info}`,
223
- backgroundColor: `${macOSColors.semantic.info}22`
224
- },
225
- saveText: {
226
- fontSize: 12,
227
- fontWeight: 700,
228
- color: macOSColors.semantic.info
229
- }
230
- };
1
+ "use strict";import{useState as m}from"react";import{jsx as n,jsxs as a}from"react/jsx-runtime";const t={background:{base:"#0A0A0C",card:"#1A1A1C",input:"#26262A"},border:{default:"#2D2D2F",input:"#3D3D42",hover:"#4D4D4F"},text:{primary:"#F5F5F7",secondary:"#A1A1A6",muted:"#8E8E93"},semantic:{info:"#00B8E6"}};export function NetworkNumberPrompt({title:s,hint:d,value:c,placeholder:g="Number",min:u,max:p,onSubmit:i,onCancel:l}){const[b,y]=m(c!=null?String(c):"");const x=()=>{const o=b.trim();if(!o){i(null);return}const f=Number(o);if(!Number.isFinite(f)){i(null);return}let r=f;if(u!=null)r=Math.max(u,r);if(p!=null)r=Math.min(p,r);i(r)};return a("div",{style:e.overlay,children:[n("button",{type:"button","aria-label":"Dismiss",onClick:l,style:e.backdrop}),a("div",{style:e.panel,children:[n("div",{style:e.title,children:s}),n("input",{style:e.input,value:b,onChange:o=>y(o.target.value),placeholder:g,inputMode:"numeric",ref:o=>{if(o){o.focus();o.select()}},onKeyDown:o=>{if(o.key==="Enter")x();if(o.key==="Escape")l()},"aria-label":s}),d?n("div",{style:e.hint,children:d}):null,a("div",{style:e.actions,children:[n("button",{type:"button",onClick:l,style:{...e.button,...e.cancelButton},children:n("span",{style:e.cancelText,children:"Cancel"})}),n("button",{type:"button",onClick:x,style:{...e.button,...e.saveButton},children:n("span",{style:e.saveText,children:"Set"})})]})]})]})}const e={overlay:{position:"absolute",inset:0,zIndex:40},backdrop:{position:"absolute",inset:0,backgroundColor:"rgba(0,0,0,0.6)",border:"none",padding:0,margin:0,cursor:"default",width:"100%",height:"100%"},panel:{position:"relative",margin:"12px 12px 0",padding:14,borderRadius:10,border:`1px solid ${t.border.hover}`,backgroundColor:t.background.card,display:"flex",flexDirection:"column",gap:10},title:{fontSize:13,fontWeight:700,color:t.text.primary},input:{backgroundColor:t.background.input,border:`1px solid ${t.border.input}`,borderRadius:6,padding:"10px 12px",fontSize:16,fontWeight:700,color:t.text.primary,outline:"none",fontFamily:"inherit",boxSizing:"border-box",width:"100%"},hint:{fontSize:10,color:t.text.muted},actions:{display:"flex",flexDirection:"row",gap:8},button:{flex:1,padding:"10px 0",borderRadius:6,display:"inline-flex",alignItems:"center",justifyContent:"center",cursor:"pointer",margin:0,boxSizing:"border-box"},cancelButton:{border:`1px solid ${t.border.default}`,backgroundColor:t.background.base},cancelText:{fontSize:12,fontWeight:600,color:t.text.secondary},saveButton:{border:`1px solid ${t.semantic.info}`,backgroundColor:`${t.semantic.info}22`},saveText:{fontSize:12,fontWeight:700,color:t.semantic.info}};