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