@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,942 +1 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.NetworkOverrideEditor = NetworkOverrideEditor;
7
- var _react = require("react");
8
- var _Explorer = _interopRequireDefault(require("./response-editor/Explorer.web"));
9
- var _editorContext = require("./response-editor/editorContext");
10
- var _NetworkNumberPrompt = require("./NetworkNumberPrompt.web");
11
- var _types = require("../overrides/types");
12
- var _jsxRuntime = require("react/jsx-runtime");
13
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
14
- /**
15
- * NetworkOverrideEditor.web — DOM twin of NetworkOverrideEditor.tsx.
16
- *
17
- * The rule form — one decision, everything else out of the way. Same shape as
18
- * native: a collapsed "Applies to" disclosure (URL pattern + method chips),
19
- * the OUTCOME grid (kind + status + failKind folded into one list), the
20
- * collapsed "Response body" disclosure (the response-editor Explorer tree, or
21
- * the empty "Edit all" paste buffer), always-visible Delay and Fires rows,
22
- * the top-pinned NetworkNumberPrompt for custom numbers, and the
23
- * Cancel/Save footer (Save disabled until a URL pattern exists).
24
- *
25
- * REUSED, not forked (all platform-free): `OverrideRuleDraft`,
26
- * `STATUS_MIN`/`STATUS_MAX`, `ResponseEditorContext` — plus the response
27
- * tree itself via the Explorer DOM twin (which reuses the pure nested-data
28
- * ops).
29
- *
30
- * shared-ui RN chrome is replicated as DOM with provenance (web consumers
31
- * resolve `@buoy-gg/shared-ui` to a minimal shim):
32
- * - `macOSColors` — inlined verbatim subset from
33
- * shared/src/ui/gameUI/constants/macOSDesignSystemColors.ts.
34
- * - Icons — inline lucide SVGs (shared-ui's icons are lucide re-exports).
35
- *
36
- * Intentional deviations (all logged):
37
- * - `useSafeAreaInsets` is not ported: `applySafeAreaInset` is accepted for
38
- * API compatibility and ignored — a floating web panel (and a desktop
39
- * window) has no home indicator to clear, the exact case native gates OFF.
40
- * - `keyboardShouldPersistTaps` is a RN-keyboard concern with no DOM
41
- * equivalent.
42
- *
43
- * @platform React DOM Web
44
- */
45
-
46
- // =============================
47
- // Native palette (provenance)
48
- // =============================
49
-
50
- /** macOSColors subset — shared/src/ui/gameUI/constants/macOSDesignSystemColors.ts, verbatim. */const macOSColors = {
51
- background: {
52
- base: "#0A0A0C",
53
- card: "#1A1A1C",
54
- input: "#26262A"
55
- },
56
- border: {
57
- default: "#2D2D2F",
58
- input: "#3D3D42"
59
- },
60
- text: {
61
- primary: "#F5F5F7",
62
- secondary: "#A1A1A6",
63
- muted: "#8E8E93"
64
- },
65
- semantic: {
66
- error: "#FF453A",
67
- info: "#00B8E6"
68
- }
69
- };
70
-
71
- // =============================
72
- // Inline lucide icons (shared-ui icons are lucide re-exports)
73
- // =============================
74
-
75
- function Svg({
76
- size = 14,
77
- color = "currentColor",
78
- children
79
- }) {
80
- return /*#__PURE__*/(0, _jsxRuntime.jsx)("svg", {
81
- width: size,
82
- height: size,
83
- viewBox: "0 0 24 24",
84
- fill: "none",
85
- stroke: color,
86
- strokeWidth: 2,
87
- strokeLinecap: "round",
88
- strokeLinejoin: "round",
89
- style: {
90
- flexShrink: 0,
91
- display: "block"
92
- },
93
- children: children
94
- });
95
- }
96
- const ChevronDown = p => /*#__PURE__*/(0, _jsxRuntime.jsx)(Svg, {
97
- ...p,
98
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
99
- d: "m6 9 6 6 6-6"
100
- })
101
- });
102
- const ChevronRight = p => /*#__PURE__*/(0, _jsxRuntime.jsx)(Svg, {
103
- ...p,
104
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
105
- d: "m9 18 6-6-6-6"
106
- })
107
- });
108
- const METHODS = ["GET", "POST", "PUT", "PATCH", "DELETE"];
109
- const DELAY_PRESETS = [0, 500, 1000, 3000, 10000];
110
-
111
- /**
112
- * The single decision, ordered by how often a developer reaches for it — the
113
- * OUTCOMES list, native verbatim (plain-language name AND status code).
114
- */
115
-
116
- const OUTCOMES = [{
117
- id: "500",
118
- label: "Server error",
119
- code: "500",
120
- danger: true,
121
- patch: {
122
- kind: "respond",
123
- status: 500,
124
- statusText: "Internal Server Error"
125
- }
126
- }, {
127
- id: "401",
128
- label: "Unauthorized",
129
- code: "401",
130
- danger: true,
131
- patch: {
132
- kind: "respond",
133
- status: 401,
134
- statusText: "Unauthorized"
135
- }
136
- }, {
137
- id: "404",
138
- label: "Not found",
139
- code: "404",
140
- danger: true,
141
- patch: {
142
- kind: "respond",
143
- status: 404,
144
- statusText: "Not Found"
145
- }
146
- }, {
147
- id: "403",
148
- label: "Forbidden",
149
- code: "403",
150
- danger: true,
151
- patch: {
152
- kind: "respond",
153
- status: 403,
154
- statusText: "Forbidden"
155
- }
156
- }, {
157
- id: "429",
158
- label: "Rate limited",
159
- code: "429",
160
- danger: true,
161
- patch: {
162
- kind: "respond",
163
- status: 429,
164
- statusText: "Too Many Requests"
165
- }
166
- }, {
167
- id: "503",
168
- label: "Unavailable",
169
- code: "503",
170
- danger: true,
171
- patch: {
172
- kind: "respond",
173
- status: 503,
174
- statusText: "Service Unavailable"
175
- }
176
- }, {
177
- id: "400",
178
- label: "Bad request",
179
- code: "400",
180
- danger: true,
181
- patch: {
182
- kind: "respond",
183
- status: 400,
184
- statusText: "Bad Request"
185
- }
186
- }, {
187
- id: "200",
188
- label: "Success",
189
- code: "200",
190
- patch: {
191
- kind: "respond",
192
- status: 200,
193
- statusText: "OK"
194
- }
195
- }, {
196
- id: "offline",
197
- label: "Offline",
198
- danger: true,
199
- patch: {
200
- kind: "fail",
201
- failKind: "network"
202
- }
203
- }, {
204
- id: "timeout",
205
- label: "Timeout",
206
- danger: true,
207
- patch: {
208
- kind: "fail",
209
- failKind: "timeout"
210
- }
211
- }, {
212
- id: "passthrough",
213
- label: "Real response",
214
- patch: {
215
- kind: "delay"
216
- }
217
- }];
218
- function outcomeIdFor(draft) {
219
- if (draft.kind === "delay") return "passthrough";
220
- if (draft.kind === "fail") {
221
- return draft.failKind === "timeout" ? "timeout" : "offline";
222
- }
223
- return String(draft.status ?? 200);
224
- }
225
- function OutcomeChip({
226
- outcome,
227
- active,
228
- onPress
229
- }) {
230
- const accent = outcome.danger ? macOSColors.semantic.error : macOSColors.semantic.info;
231
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)("button", {
232
- type: "button",
233
- onClick: onPress,
234
- "aria-label": `${outcome.label}${outcome.code ? ` ${outcome.code}` : ""}`,
235
- "aria-pressed": active,
236
- style: {
237
- ...styles.outcome,
238
- ...(active ? {
239
- border: `1px solid ${accent}`,
240
- backgroundColor: `${accent}1F`
241
- } : null)
242
- },
243
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
244
- style: {
245
- ...styles.outcomeLabel,
246
- ...(active ? {
247
- color: accent
248
- } : null)
249
- },
250
- children: outcome.label
251
- }), outcome.code ? /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
252
- style: {
253
- ...styles.outcomeCode,
254
- ...(active ? {
255
- color: accent
256
- } : null)
257
- },
258
- children: outcome.code
259
- }) : null]
260
- });
261
- }
262
-
263
- /** A collapsed row that opens to reveal its controls. */
264
- function Disclosure({
265
- title,
266
- summary,
267
- open,
268
- onToggle,
269
- children
270
- }) {
271
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
272
- style: styles.disclosure,
273
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("button", {
274
- type: "button",
275
- onClick: onToggle,
276
- "aria-expanded": open,
277
- style: styles.disclosureHeader,
278
- children: [open ? /*#__PURE__*/(0, _jsxRuntime.jsx)(ChevronDown, {
279
- size: 12,
280
- color: macOSColors.text.muted
281
- }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(ChevronRight, {
282
- size: 12,
283
- color: macOSColors.text.muted
284
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
285
- style: styles.disclosureTitle,
286
- children: title
287
- }), summary && !open ? /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
288
- style: styles.disclosureSummary,
289
- children: summary
290
- }) : null]
291
- }), open ? /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
292
- style: styles.disclosureBody,
293
- children: children
294
- }) : null]
295
- });
296
- }
297
- function Chip({
298
- label,
299
- active,
300
- onPress
301
- }) {
302
- return /*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
303
- type: "button",
304
- onClick: onPress,
305
- "aria-pressed": active,
306
- style: {
307
- ...styles.chip,
308
- ...(active ? styles.chipActive : null)
309
- },
310
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
311
- style: {
312
- ...styles.chipText,
313
- ...(active ? styles.chipTextActive : null)
314
- },
315
- children: label
316
- })
317
- });
318
- }
319
- function NetworkOverrideEditor({
320
- draft,
321
- onChange,
322
- onSave,
323
- onCancel,
324
- saveLabel = "Save",
325
- applySafeAreaInset: _applySafeAreaInset = false
326
- }) {
327
- const patch = next => onChange({
328
- ...draft,
329
- ...next
330
- });
331
-
332
- // A rule made from a request arrives with its scope already right, so it
333
- // starts closed. A blank one has nothing to match on yet, so it starts open.
334
- const [scopeOpen, setScopeOpen] = (0, _react.useState)(!draft.urlPattern.trim());
335
- const [bodyOpen, setBodyOpen] = (0, _react.useState)(false);
336
- /**
337
- * The "Edit all" buffer — deliberately NOT seeded with the current body
338
- * (native comment: you only reach for this to REPLACE the whole thing, and
339
- * starting empty means paste-and-go).
340
- */
341
- const [pasteText, setPasteText] = (0, _react.useState)(null);
342
- /** Which custom number the top-of-screen prompt is asking for, if any. */
343
- const [prompt, setPrompt] = (0, _react.useState)(null);
344
- const activeOutcome = outcomeIdFor(draft);
345
- /** True when the status is a real one that no listed outcome covers. */
346
- const customStatusActive = draft.kind === "respond" && typeof draft.status === "number" && !OUTCOMES.some(outcome => outcome.code === String(draft.status));
347
- const showsBody = draft.kind === "respond";
348
- const method = draft.methods?.[0];
349
- const scopeSummary = `${method ?? "Any"} ${draft.urlPattern || "No URL yet"}`;
350
- const bodySummary = (0, _react.useMemo)(() => {
351
- const body = (draft.body ?? "").trim();
352
- if (!body) return "Empty";
353
- const lines = body.split("\n").length;
354
- return `${lines} line${lines === 1 ? "" : "s"}`;
355
- }, [draft.body]);
356
-
357
- /**
358
- * The body as a tree, or null when it can't be one (empty, or not JSON).
359
- * Memoized on the raw string — an override body can be large.
360
- */
361
- const parsedBody = (0, _react.useMemo)(() => {
362
- const body = (draft.body ?? "").trim();
363
- if (!body) return null;
364
- try {
365
- return JSON.parse(body);
366
- } catch {
367
- return null;
368
- }
369
- }, [draft.body]);
370
- const bodyIsNonJsonText = (draft.body ?? "").trim().length > 0 && !parsedBody;
371
- const delayMs = draft.delayMs ?? 0;
372
- /** Custom fields own the value only when no preset chip already claims it. */
373
- const customDelayActive = delayMs > 0 && !DELAY_PRESETS.includes(delayMs);
374
- const customTimesActive = !draft.alternate && typeof draft.times === "number" && draft.times !== 1;
375
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
376
- style: styles.root,
377
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
378
- style: styles.scroll,
379
- children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
380
- style: styles.scrollContent,
381
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(Disclosure, {
382
- title: "Applies to",
383
- summary: scopeSummary,
384
- open: scopeOpen,
385
- onToggle: () => setScopeOpen(v => !v),
386
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("textarea", {
387
- style: styles.input,
388
- value: draft.urlPattern,
389
- onChange: e => patch({
390
- urlPattern: e.target.value
391
- }),
392
- placeholder: "https://api.example.com/v1/users*",
393
- autoCapitalize: "none",
394
- autoCorrect: "off",
395
- spellCheck: false,
396
- rows: 2,
397
- "aria-label": "URL pattern"
398
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
399
- style: styles.chipRow,
400
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(Chip, {
401
- label: "Any",
402
- active: !method,
403
- onPress: () => patch({
404
- methods: undefined
405
- })
406
- }), METHODS.map(m => /*#__PURE__*/(0, _jsxRuntime.jsx)(Chip, {
407
- label: m,
408
- active: method === m,
409
- onPress: () => patch({
410
- methods: [m]
411
- })
412
- }, m))]
413
- })]
414
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
415
- style: styles.outcomeGrid,
416
- children: [OUTCOMES.map(outcome => /*#__PURE__*/(0, _jsxRuntime.jsx)(OutcomeChip, {
417
- outcome: outcome,
418
- active: activeOutcome === outcome.id,
419
- onPress: () => patch(outcome.patch)
420
- }, outcome.id)), /*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
421
- type: "button",
422
- onClick: () => setPrompt("status"),
423
- "aria-label": "Custom status code",
424
- style: {
425
- ...styles.customField,
426
- ...(customStatusActive ? styles.customFieldActive : null)
427
- },
428
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
429
- style: {
430
- ...styles.customValue,
431
- ...(customStatusActive ? styles.customInputActive : null)
432
- },
433
- children: customStatusActive ? String(draft.status) : "Custom"
434
- })
435
- })]
436
- }), showsBody ? /*#__PURE__*/(0, _jsxRuntime.jsx)(Disclosure, {
437
- title: "Response body",
438
- summary: bodySummary,
439
- open: bodyOpen,
440
- onToggle: () => setBodyOpen(v => !v),
441
- children: pasteText !== null ?
442
- /*#__PURE__*/
443
- /* Replace-the-whole-thing mode. Starts empty — see `pasteText`. */
444
- (0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
445
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("textarea", {
446
- style: {
447
- ...styles.input,
448
- ...styles.bodyInput
449
- },
450
- value: pasteText,
451
- onChange: e => setPasteText(e.target.value),
452
- placeholder: "Paste a new body\u2026",
453
- autoCapitalize: "none",
454
- autoCorrect: "off",
455
- spellCheck: false,
456
- autoFocus: true,
457
- "aria-label": "New response body"
458
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
459
- style: styles.inlineActions,
460
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
461
- type: "button",
462
- onClick: () => setPasteText(null),
463
- style: styles.textButton,
464
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
465
- style: styles.textButtonMuted,
466
- children: "Cancel"
467
- })
468
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
469
- type: "button",
470
- onClick: () => {
471
- const next = pasteText.trim();
472
- // Pretty-print JSON on the way in so the tree it
473
- // becomes is readable; anything else is kept exactly
474
- // as pasted.
475
- try {
476
- patch({
477
- body: JSON.stringify(JSON.parse(next), null, 2)
478
- });
479
- } catch {
480
- patch({
481
- body: next
482
- });
483
- }
484
- setPasteText(null);
485
- },
486
- disabled: !pasteText.trim(),
487
- style: styles.textButton,
488
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
489
- style: {
490
- ...styles.textButtonLabel,
491
- ...(!pasteText.trim() ? styles.textButtonDisabled : null)
492
- },
493
- children: "Replace"
494
- })
495
- })]
496
- })]
497
- }) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
498
- children: [parsedBody !== null ?
499
- /*#__PURE__*/
500
- /* The SAME tree as the request detail — type into a value
501
- to edit it. Editing writes the whole document back as
502
- the rule's body, so the two surfaces behave
503
- identically. */
504
- (0, _jsxRuntime.jsx)(_editorContext.ResponseEditorContext.Provider, {
505
- value: {
506
- root: parsedBody,
507
- onChange: next => patch({
508
- body: JSON.stringify(next, null, 2)
509
- })
510
- },
511
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Explorer.default, {
512
- editable: true,
513
- label: "",
514
- value: parsedBody,
515
- defaultExpanded: [""]
516
- })
517
- }) : /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
518
- style: styles.emptyBody,
519
- children: bodyIsNonJsonText ? "This body isn't JSON, so there's no tree to show." : "No body yet."
520
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
521
- type: "button",
522
- onClick: () => setPasteText(""),
523
- style: styles.textButton,
524
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
525
- style: styles.textButtonLabel,
526
- children: "Edit all"
527
- })
528
- })]
529
- })
530
- }) : null, /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
531
- style: styles.field,
532
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
533
- style: styles.subLabel,
534
- children: "Delay"
535
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
536
- style: styles.chipRow,
537
- children: [DELAY_PRESETS.map(ms => /*#__PURE__*/(0, _jsxRuntime.jsx)(Chip, {
538
- label: ms === 0 ? "None" : `${ms / 1000}s`,
539
- active: delayMs === ms,
540
- onPress: () => patch({
541
- delayMs: ms
542
- })
543
- }, ms)), /*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
544
- type: "button",
545
- onClick: () => setPrompt("delay"),
546
- "aria-label": "Custom delay in seconds",
547
- style: {
548
- ...styles.customField,
549
- ...(customDelayActive ? styles.customFieldActive : null)
550
- },
551
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
552
- style: {
553
- ...styles.customValue,
554
- ...(customDelayActive ? styles.customInputActive : null)
555
- },
556
- children: customDelayActive ? `${delayMs / 1000}s` : "Custom"
557
- })
558
- })]
559
- })]
560
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
561
- style: styles.field,
562
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
563
- style: styles.subLabel,
564
- children: "Fires"
565
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
566
- style: styles.subHint,
567
- children: "A limited rule switches itself off once it's used up. Every other alternates forever \u2014 the first request through, the next overridden."
568
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
569
- style: styles.chipRow,
570
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(Chip, {
571
- label: "Always",
572
- active: !draft.alternate && draft.times == null,
573
- onPress: () => patch({
574
- alternate: false,
575
- times: null
576
- })
577
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(Chip, {
578
- label: "Once",
579
- active: !draft.alternate && draft.times === 1,
580
- onPress: () => patch({
581
- alternate: false,
582
- times: 1
583
- })
584
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(Chip, {
585
- label: "Every other",
586
- active: draft.alternate === true,
587
- onPress: () => patch({
588
- alternate: true,
589
- times: null
590
- })
591
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
592
- type: "button",
593
- onClick: () => {
594
- patch({
595
- alternate: false
596
- });
597
- setPrompt("times");
598
- },
599
- "aria-label": "Custom number of times",
600
- style: {
601
- ...styles.customField,
602
- ...(customTimesActive ? styles.customFieldActive : null)
603
- },
604
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
605
- style: {
606
- ...styles.customValue,
607
- ...(customTimesActive ? styles.customInputActive : null)
608
- },
609
- children: customTimesActive ? `${draft.times}×` : "Custom"
610
- })
611
- })]
612
- })]
613
- })]
614
- })
615
- }), prompt === "status" ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_NetworkNumberPrompt.NetworkNumberPrompt, {
616
- title: "Custom status code",
617
- hint: `${_types.STATUS_MIN}–${_types.STATUS_MAX}`,
618
- value: customStatusActive ? draft.status : undefined,
619
- min: _types.STATUS_MIN,
620
- max: _types.STATUS_MAX,
621
- onSubmit: next => {
622
- patch({
623
- kind: "respond",
624
- status: next ?? undefined,
625
- statusText: undefined
626
- });
627
- setPrompt(null);
628
- },
629
- onCancel: () => setPrompt(null)
630
- }) : null, prompt === "delay" ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_NetworkNumberPrompt.NetworkNumberPrompt, {
631
- title: "Custom delay",
632
- hint: "Seconds",
633
- value: customDelayActive ? delayMs / 1000 : undefined,
634
- min: 0,
635
- onSubmit: next => {
636
- patch({
637
- delayMs: next != null ? Math.round(next * 1000) : 0
638
- });
639
- setPrompt(null);
640
- },
641
- onCancel: () => setPrompt(null)
642
- }) : null, prompt === "times" ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_NetworkNumberPrompt.NetworkNumberPrompt, {
643
- title: "Fires how many times",
644
- hint: "Leave empty for always",
645
- value: customTimesActive ? draft.times : undefined,
646
- min: 1,
647
- onSubmit: next => {
648
- // Empty or zero means "no limit" rather than a rule that is spent
649
- // before it ever fires.
650
- patch({
651
- alternate: false,
652
- times: next && next > 0 ? next : null
653
- });
654
- setPrompt(null);
655
- },
656
- onCancel: () => setPrompt(null)
657
- }) : null, /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
658
- style: styles.footer,
659
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
660
- type: "button",
661
- onClick: onCancel,
662
- style: {
663
- ...styles.footerButton,
664
- ...styles.cancelButton
665
- },
666
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
667
- style: styles.cancelText,
668
- children: "Cancel"
669
- })
670
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
671
- type: "button",
672
- onClick: onSave,
673
- disabled: !draft.urlPattern.trim(),
674
- style: {
675
- ...styles.footerButton,
676
- ...styles.saveButton,
677
- ...(!draft.urlPattern.trim() ? styles.saveButtonDisabled : null)
678
- },
679
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
680
- style: styles.saveText,
681
- children: saveLabel
682
- })
683
- })]
684
- })]
685
- });
686
- }
687
-
688
- // Values mirror the native StyleSheet block 1:1.
689
- const styles = {
690
- root: {
691
- position: "relative",
692
- display: "flex",
693
- flexDirection: "column",
694
- flex: 1,
695
- minHeight: 0
696
- },
697
- scroll: {
698
- flex: 1,
699
- minHeight: 0,
700
- overflowY: "auto"
701
- },
702
- scrollContent: {
703
- padding: "12px 12px 24px",
704
- display: "flex",
705
- flexDirection: "column",
706
- gap: 4
707
- },
708
- field: {
709
- display: "flex",
710
- flexDirection: "column",
711
- gap: 8,
712
- padding: "6px 0"
713
- },
714
- outcomeGrid: {
715
- display: "flex",
716
- flexDirection: "row",
717
- flexWrap: "wrap",
718
- gap: 6,
719
- padding: "10px 0"
720
- },
721
- outcome: {
722
- display: "inline-flex",
723
- flexDirection: "row",
724
- alignItems: "center",
725
- gap: 6,
726
- padding: "9px 10px",
727
- borderRadius: 6,
728
- border: `1px solid ${macOSColors.border.default}`,
729
- backgroundColor: macOSColors.background.card,
730
- cursor: "pointer",
731
- margin: 0,
732
- boxSizing: "border-box"
733
- },
734
- outcomeLabel: {
735
- fontSize: 12,
736
- fontWeight: 600,
737
- color: macOSColors.text.primary
738
- },
739
- outcomeCode: {
740
- fontSize: 10,
741
- fontWeight: 700,
742
- color: macOSColors.text.muted
743
- },
744
- disclosure: {
745
- borderRadius: 6,
746
- border: `1px solid ${macOSColors.border.default}`,
747
- backgroundColor: macOSColors.background.card,
748
- overflow: "hidden"
749
- },
750
- disclosureHeader: {
751
- display: "flex",
752
- flexDirection: "row",
753
- alignItems: "center",
754
- gap: 6,
755
- padding: "10px 10px",
756
- width: "100%",
757
- boxSizing: "border-box",
758
- background: "none",
759
- border: "none",
760
- cursor: "pointer",
761
- margin: 0,
762
- textAlign: "left",
763
- font: "inherit"
764
- },
765
- disclosureTitle: {
766
- fontSize: 12,
767
- fontWeight: 600,
768
- color: macOSColors.text.primary,
769
- whiteSpace: "nowrap"
770
- },
771
- disclosureSummary: {
772
- flex: 1,
773
- minWidth: 0,
774
- textAlign: "right",
775
- fontSize: 11,
776
- color: macOSColors.text.muted,
777
- whiteSpace: "nowrap",
778
- overflow: "hidden",
779
- textOverflow: "ellipsis"
780
- },
781
- disclosureBody: {
782
- padding: "0 10px 10px",
783
- display: "flex",
784
- flexDirection: "column",
785
- gap: 8
786
- },
787
- input: {
788
- backgroundColor: macOSColors.background.input,
789
- border: `1px solid ${macOSColors.border.input}`,
790
- borderRadius: 6,
791
- padding: "8px 10px",
792
- color: macOSColors.text.primary,
793
- fontSize: 12,
794
- fontFamily: "ui-monospace, Menlo, monospace",
795
- minHeight: 40,
796
- outline: "none",
797
- resize: "vertical",
798
- boxSizing: "border-box",
799
- width: "100%"
800
- },
801
- bodyInput: {
802
- minHeight: 140
803
- },
804
- chipRow: {
805
- display: "flex",
806
- flexDirection: "row",
807
- flexWrap: "wrap",
808
- gap: 6
809
- },
810
- chip: {
811
- padding: "6px 10px",
812
- borderRadius: 5,
813
- border: `1px solid ${macOSColors.border.default}`,
814
- backgroundColor: macOSColors.background.base,
815
- cursor: "pointer",
816
- margin: 0,
817
- boxSizing: "border-box"
818
- },
819
- chipActive: {
820
- border: `1px solid ${macOSColors.semantic.info}`,
821
- backgroundColor: `${macOSColors.semantic.info}1F`
822
- },
823
- chipText: {
824
- fontSize: 11,
825
- fontWeight: 600,
826
- color: macOSColors.text.secondary
827
- },
828
- chipTextActive: {
829
- color: macOSColors.semantic.info
830
- },
831
- customField: {
832
- display: "inline-flex",
833
- flexDirection: "row",
834
- alignItems: "center",
835
- padding: "0 8px",
836
- borderRadius: 5,
837
- border: `1px solid ${macOSColors.border.default}`,
838
- backgroundColor: macOSColors.background.base,
839
- cursor: "pointer",
840
- margin: 0,
841
- boxSizing: "border-box"
842
- },
843
- customFieldActive: {
844
- border: `1px solid ${macOSColors.semantic.info}`,
845
- backgroundColor: `${macOSColors.semantic.info}1F`
846
- },
847
- customValue: {
848
- padding: "6px 0",
849
- fontSize: 11,
850
- fontWeight: 600,
851
- color: macOSColors.text.secondary
852
- },
853
- customInputActive: {
854
- color: macOSColors.semantic.info
855
- },
856
- subHint: {
857
- fontSize: 10,
858
- lineHeight: "14px",
859
- color: macOSColors.text.muted,
860
- marginTop: -2
861
- },
862
- subLabel: {
863
- fontSize: 10,
864
- fontWeight: 700,
865
- letterSpacing: 0.6,
866
- color: macOSColors.text.muted,
867
- textTransform: "uppercase"
868
- },
869
- textButton: {
870
- alignSelf: "flex-start",
871
- padding: "4px 0",
872
- background: "none",
873
- border: "none",
874
- cursor: "pointer",
875
- margin: 0
876
- },
877
- textButtonLabel: {
878
- fontSize: 11,
879
- fontWeight: 600,
880
- color: macOSColors.semantic.info
881
- },
882
- textButtonMuted: {
883
- fontSize: 11,
884
- fontWeight: 600,
885
- color: macOSColors.text.secondary
886
- },
887
- textButtonDisabled: {
888
- opacity: 0.4
889
- },
890
- inlineActions: {
891
- display: "flex",
892
- flexDirection: "row",
893
- alignItems: "center",
894
- justifyContent: "space-between"
895
- },
896
- emptyBody: {
897
- fontSize: 11,
898
- color: macOSColors.text.muted,
899
- padding: "6px 0"
900
- },
901
- footer: {
902
- display: "flex",
903
- flexDirection: "row",
904
- gap: 8,
905
- padding: 12,
906
- borderTop: `1px solid ${macOSColors.border.default}`,
907
- backgroundColor: macOSColors.background.base
908
- },
909
- footerButton: {
910
- flex: 1,
911
- padding: "11px 0",
912
- borderRadius: 6,
913
- display: "inline-flex",
914
- alignItems: "center",
915
- justifyContent: "center",
916
- cursor: "pointer",
917
- margin: 0,
918
- boxSizing: "border-box"
919
- },
920
- cancelButton: {
921
- border: `1px solid ${macOSColors.border.default}`,
922
- backgroundColor: macOSColors.background.card
923
- },
924
- cancelText: {
925
- fontSize: 12,
926
- fontWeight: 600,
927
- color: macOSColors.text.secondary
928
- },
929
- saveButton: {
930
- border: `1px solid ${macOSColors.semantic.info}`,
931
- backgroundColor: `${macOSColors.semantic.info}22`
932
- },
933
- saveButtonDisabled: {
934
- opacity: 0.4,
935
- cursor: "default"
936
- },
937
- saveText: {
938
- fontSize: 12,
939
- fontWeight: 700,
940
- color: macOSColors.semantic.info
941
- }
942
- };
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.NetworkOverrideEditor=NetworkOverrideEditor;var _react=require("react");var _Explorer=_interopRequireDefault(require("./response-editor/Explorer.web"));var _editorContext=require("./response-editor/editorContext");var _NetworkNumberPrompt=require("./NetworkNumberPrompt.web");var _types=require("../overrides/types");var _jsxRuntime=require("react/jsx-runtime");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}const macOSColors={background:{base:"#0A0A0C",card:"#1A1A1C",input:"#26262A"},border:{default:"#2D2D2F",input:"#3D3D42"},text:{primary:"#F5F5F7",secondary:"#A1A1A6",muted:"#8E8E93"},semantic:{error:"#FF453A",info:"#00B8E6"}};function Svg({size:e=14,color:o="currentColor",children:l}){return(0,_jsxRuntime.jsx)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:o,strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",style:{flexShrink:0,display:"block"},children:l})}const ChevronDown=e=>(0,_jsxRuntime.jsx)(Svg,{...e,children:(0,_jsxRuntime.jsx)("path",{d:"m6 9 6 6 6-6"})});const ChevronRight=e=>(0,_jsxRuntime.jsx)(Svg,{...e,children:(0,_jsxRuntime.jsx)("path",{d:"m9 18 6-6-6-6"})});const METHODS=["GET","POST","PUT","PATCH","DELETE"];const DELAY_PRESETS=[0,500,1e3,3e3,1e4];const OUTCOMES=[{id:"500",label:"Server error",code:"500",danger:true,patch:{kind:"respond",status:500,statusText:"Internal Server Error"}},{id:"401",label:"Unauthorized",code:"401",danger:true,patch:{kind:"respond",status:401,statusText:"Unauthorized"}},{id:"404",label:"Not found",code:"404",danger:true,patch:{kind:"respond",status:404,statusText:"Not Found"}},{id:"403",label:"Forbidden",code:"403",danger:true,patch:{kind:"respond",status:403,statusText:"Forbidden"}},{id:"429",label:"Rate limited",code:"429",danger:true,patch:{kind:"respond",status:429,statusText:"Too Many Requests"}},{id:"503",label:"Unavailable",code:"503",danger:true,patch:{kind:"respond",status:503,statusText:"Service Unavailable"}},{id:"400",label:"Bad request",code:"400",danger:true,patch:{kind:"respond",status:400,statusText:"Bad Request"}},{id:"200",label:"Success",code:"200",patch:{kind:"respond",status:200,statusText:"OK"}},{id:"offline",label:"Offline",danger:true,patch:{kind:"fail",failKind:"network"}},{id:"timeout",label:"Timeout",danger:true,patch:{kind:"fail",failKind:"timeout"}},{id:"passthrough",label:"Real response",patch:{kind:"delay"}}];function outcomeIdFor(e){if(e.kind==="delay")return"passthrough";if(e.kind==="fail"){return e.failKind==="timeout"?"timeout":"offline"}return String(e.status??200)}function OutcomeChip({outcome:e,active:o,onPress:l}){const i=e.danger?macOSColors.semantic.error:macOSColors.semantic.info;return(0,_jsxRuntime.jsxs)("button",{type:"button",onClick:l,"aria-label":`${e.label}${e.code?` ${e.code}`:""}`,"aria-pressed":o,style:{...styles.outcome,...o?{border:`1px solid ${i}`,backgroundColor:`${i}1F`}:null},children:[(0,_jsxRuntime.jsx)("span",{style:{...styles.outcomeLabel,...o?{color:i}:null},children:e.label}),e.code?(0,_jsxRuntime.jsx)("span",{style:{...styles.outcomeCode,...o?{color:i}:null},children:e.code}):null]})}function Disclosure({title:e,summary:o,open:l,onToggle:i,children:b}){return(0,_jsxRuntime.jsxs)("div",{style:styles.disclosure,children:[(0,_jsxRuntime.jsxs)("button",{type:"button",onClick:i,"aria-expanded":l,style:styles.disclosureHeader,children:[l?(0,_jsxRuntime.jsx)(ChevronDown,{size:12,color:macOSColors.text.muted}):(0,_jsxRuntime.jsx)(ChevronRight,{size:12,color:macOSColors.text.muted}),(0,_jsxRuntime.jsx)("span",{style:styles.disclosureTitle,children:e}),o&&!l?(0,_jsxRuntime.jsx)("span",{style:styles.disclosureSummary,children:o}):null]}),l?(0,_jsxRuntime.jsx)("div",{style:styles.disclosureBody,children:b}):null]})}function Chip({label:e,active:o,onPress:l}){return(0,_jsxRuntime.jsx)("button",{type:"button",onClick:l,"aria-pressed":o,style:{...styles.chip,...o?styles.chipActive:null},children:(0,_jsxRuntime.jsx)("span",{style:{...styles.chipText,...o?styles.chipTextActive:null},children:e})})}function NetworkOverrideEditor({draft:e,onChange:o,onSave:l,onCancel:i,saveLabel:b="Save",applySafeAreaInset:A=false}){const n=t=>o({...e,...t});const[f,g]=(0,_react.useState)(!e.urlPattern.trim());const[v,j]=(0,_react.useState)(false);const[r,d]=(0,_react.useState)(null);const[m,s]=(0,_react.useState)(null);const S=outcomeIdFor(e);const u=e.kind==="respond"&&typeof e.status==="number"&&!OUTCOMES.some(t=>t.code===String(e.status));const k=e.kind==="respond";const y=e.methods?.[0];const C=`${y??"Any"} ${e.urlPattern||"No URL yet"}`;const T=(0,_react.useMemo)(()=>{const t=(e.body??"").trim();if(!t)return"Empty";const h=t.split("\n").length;return`${h} line${h===1?"":"s"}`},[e.body]);const c=(0,_react.useMemo)(()=>{const t=(e.body??"").trim();if(!t)return null;try{return JSON.parse(t)}catch{return null}},[e.body]);const w=(e.body??"").trim().length>0&&!c;const a=e.delayMs??0;const p=a>0&&!DELAY_PRESETS.includes(a);const x=!e.alternate&&typeof e.times==="number"&&e.times!==1;return(0,_jsxRuntime.jsxs)("div",{style:styles.root,children:[(0,_jsxRuntime.jsx)("div",{style:styles.scroll,children:(0,_jsxRuntime.jsxs)("div",{style:styles.scrollContent,children:[(0,_jsxRuntime.jsxs)(Disclosure,{title:"Applies to",summary:C,open:f,onToggle:()=>g(t=>!t),children:[(0,_jsxRuntime.jsx)("textarea",{style:styles.input,value:e.urlPattern,onChange:t=>n({urlPattern:t.target.value}),placeholder:"https://api.example.com/v1/users*",autoCapitalize:"none",autoCorrect:"off",spellCheck:false,rows:2,"aria-label":"URL pattern"}),(0,_jsxRuntime.jsxs)("div",{style:styles.chipRow,children:[(0,_jsxRuntime.jsx)(Chip,{label:"Any",active:!y,onPress:()=>n({methods:void 0})}),METHODS.map(t=>(0,_jsxRuntime.jsx)(Chip,{label:t,active:y===t,onPress:()=>n({methods:[t]})},t))]})]}),(0,_jsxRuntime.jsxs)("div",{style:styles.outcomeGrid,children:[OUTCOMES.map(t=>(0,_jsxRuntime.jsx)(OutcomeChip,{outcome:t,active:S===t.id,onPress:()=>n(t.patch)},t.id)),(0,_jsxRuntime.jsx)("button",{type:"button",onClick:()=>s("status"),"aria-label":"Custom status code",style:{...styles.customField,...u?styles.customFieldActive:null},children:(0,_jsxRuntime.jsx)("span",{style:{...styles.customValue,...u?styles.customInputActive:null},children:u?String(e.status):"Custom"})})]}),k?(0,_jsxRuntime.jsx)(Disclosure,{title:"Response body",summary:T,open:v,onToggle:()=>j(t=>!t),children:r!==null?(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[(0,_jsxRuntime.jsx)("textarea",{style:{...styles.input,...styles.bodyInput},value:r,onChange:t=>d(t.target.value),placeholder:"Paste a new body\u2026",autoCapitalize:"none",autoCorrect:"off",spellCheck:false,autoFocus:true,"aria-label":"New response body"}),(0,_jsxRuntime.jsxs)("div",{style:styles.inlineActions,children:[(0,_jsxRuntime.jsx)("button",{type:"button",onClick:()=>d(null),style:styles.textButton,children:(0,_jsxRuntime.jsx)("span",{style:styles.textButtonMuted,children:"Cancel"})}),(0,_jsxRuntime.jsx)("button",{type:"button",onClick:()=>{const t=r.trim();try{n({body:JSON.stringify(JSON.parse(t),null,2)})}catch{n({body:t})}d(null)},disabled:!r.trim(),style:styles.textButton,children:(0,_jsxRuntime.jsx)("span",{style:{...styles.textButtonLabel,...!r.trim()?styles.textButtonDisabled:null},children:"Replace"})})]})]}):(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[c!==null?(0,_jsxRuntime.jsx)(_editorContext.ResponseEditorContext.Provider,{value:{root:c,onChange:t=>n({body:JSON.stringify(t,null,2)})},children:(0,_jsxRuntime.jsx)(_Explorer.default,{editable:true,label:"",value:c,defaultExpanded:[""]})}):(0,_jsxRuntime.jsx)("span",{style:styles.emptyBody,children:w?"This body isn't JSON, so there's no tree to show.":"No body yet."}),(0,_jsxRuntime.jsx)("button",{type:"button",onClick:()=>d(""),style:styles.textButton,children:(0,_jsxRuntime.jsx)("span",{style:styles.textButtonLabel,children:"Edit all"})})]})}):null,(0,_jsxRuntime.jsxs)("div",{style:styles.field,children:[(0,_jsxRuntime.jsx)("span",{style:styles.subLabel,children:"Delay"}),(0,_jsxRuntime.jsxs)("div",{style:styles.chipRow,children:[DELAY_PRESETS.map(t=>(0,_jsxRuntime.jsx)(Chip,{label:t===0?"None":`${t/1e3}s`,active:a===t,onPress:()=>n({delayMs:t})},t)),(0,_jsxRuntime.jsx)("button",{type:"button",onClick:()=>s("delay"),"aria-label":"Custom delay in seconds",style:{...styles.customField,...p?styles.customFieldActive:null},children:(0,_jsxRuntime.jsx)("span",{style:{...styles.customValue,...p?styles.customInputActive:null},children:p?`${a/1e3}s`:"Custom"})})]})]}),(0,_jsxRuntime.jsxs)("div",{style:styles.field,children:[(0,_jsxRuntime.jsx)("span",{style:styles.subLabel,children:"Fires"}),(0,_jsxRuntime.jsx)("span",{style:styles.subHint,children:"A limited rule switches itself off once it's used up. Every other alternates forever \u2014 the first request through, the next overridden."}),(0,_jsxRuntime.jsxs)("div",{style:styles.chipRow,children:[(0,_jsxRuntime.jsx)(Chip,{label:"Always",active:!e.alternate&&e.times==null,onPress:()=>n({alternate:false,times:null})}),(0,_jsxRuntime.jsx)(Chip,{label:"Once",active:!e.alternate&&e.times===1,onPress:()=>n({alternate:false,times:1})}),(0,_jsxRuntime.jsx)(Chip,{label:"Every other",active:e.alternate===true,onPress:()=>n({alternate:true,times:null})}),(0,_jsxRuntime.jsx)("button",{type:"button",onClick:()=>{n({alternate:false});s("times")},"aria-label":"Custom number of times",style:{...styles.customField,...x?styles.customFieldActive:null},children:(0,_jsxRuntime.jsx)("span",{style:{...styles.customValue,...x?styles.customInputActive:null},children:x?`${e.times}\xD7`:"Custom"})})]})]})]})}),m==="status"?(0,_jsxRuntime.jsx)(_NetworkNumberPrompt.NetworkNumberPrompt,{title:"Custom status code",hint:`${_types.STATUS_MIN}\u2013${_types.STATUS_MAX}`,value:u?e.status:void 0,min:_types.STATUS_MIN,max:_types.STATUS_MAX,onSubmit:t=>{n({kind:"respond",status:t??void 0,statusText:void 0});s(null)},onCancel:()=>s(null)}):null,m==="delay"?(0,_jsxRuntime.jsx)(_NetworkNumberPrompt.NetworkNumberPrompt,{title:"Custom delay",hint:"Seconds",value:p?a/1e3:void 0,min:0,onSubmit:t=>{n({delayMs:t!=null?Math.round(t*1e3):0});s(null)},onCancel:()=>s(null)}):null,m==="times"?(0,_jsxRuntime.jsx)(_NetworkNumberPrompt.NetworkNumberPrompt,{title:"Fires how many times",hint:"Leave empty for always",value:x?e.times:void 0,min:1,onSubmit:t=>{n({alternate:false,times:t&&t>0?t:null});s(null)},onCancel:()=>s(null)}):null,(0,_jsxRuntime.jsxs)("div",{style:styles.footer,children:[(0,_jsxRuntime.jsx)("button",{type:"button",onClick:i,style:{...styles.footerButton,...styles.cancelButton},children:(0,_jsxRuntime.jsx)("span",{style:styles.cancelText,children:"Cancel"})}),(0,_jsxRuntime.jsx)("button",{type:"button",onClick:l,disabled:!e.urlPattern.trim(),style:{...styles.footerButton,...styles.saveButton,...!e.urlPattern.trim()?styles.saveButtonDisabled:null},children:(0,_jsxRuntime.jsx)("span",{style:styles.saveText,children:b})})]})]})}const styles={root:{position:"relative",display:"flex",flexDirection:"column",flex:1,minHeight:0},scroll:{flex:1,minHeight:0,overflowY:"auto"},scrollContent:{padding:"12px 12px 24px",display:"flex",flexDirection:"column",gap:4},field:{display:"flex",flexDirection:"column",gap:8,padding:"6px 0"},outcomeGrid:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:6,padding:"10px 0"},outcome:{display:"inline-flex",flexDirection:"row",alignItems:"center",gap:6,padding:"9px 10px",borderRadius:6,border:`1px solid ${macOSColors.border.default}`,backgroundColor:macOSColors.background.card,cursor:"pointer",margin:0,boxSizing:"border-box"},outcomeLabel:{fontSize:12,fontWeight:600,color:macOSColors.text.primary},outcomeCode:{fontSize:10,fontWeight:700,color:macOSColors.text.muted},disclosure:{borderRadius:6,border:`1px solid ${macOSColors.border.default}`,backgroundColor:macOSColors.background.card,overflow:"hidden"},disclosureHeader:{display:"flex",flexDirection:"row",alignItems:"center",gap:6,padding:"10px 10px",width:"100%",boxSizing:"border-box",background:"none",border:"none",cursor:"pointer",margin:0,textAlign:"left",font:"inherit"},disclosureTitle:{fontSize:12,fontWeight:600,color:macOSColors.text.primary,whiteSpace:"nowrap"},disclosureSummary:{flex:1,minWidth:0,textAlign:"right",fontSize:11,color:macOSColors.text.muted,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},disclosureBody:{padding:"0 10px 10px",display:"flex",flexDirection:"column",gap:8},input:{backgroundColor:macOSColors.background.input,border:`1px solid ${macOSColors.border.input}`,borderRadius:6,padding:"8px 10px",color:macOSColors.text.primary,fontSize:12,fontFamily:"ui-monospace, Menlo, monospace",minHeight:40,outline:"none",resize:"vertical",boxSizing:"border-box",width:"100%"},bodyInput:{minHeight:140},chipRow:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:6},chip:{padding:"6px 10px",borderRadius:5,border:`1px solid ${macOSColors.border.default}`,backgroundColor:macOSColors.background.base,cursor:"pointer",margin:0,boxSizing:"border-box"},chipActive:{border:`1px solid ${macOSColors.semantic.info}`,backgroundColor:`${macOSColors.semantic.info}1F`},chipText:{fontSize:11,fontWeight:600,color:macOSColors.text.secondary},chipTextActive:{color:macOSColors.semantic.info},customField:{display:"inline-flex",flexDirection:"row",alignItems:"center",padding:"0 8px",borderRadius:5,border:`1px solid ${macOSColors.border.default}`,backgroundColor:macOSColors.background.base,cursor:"pointer",margin:0,boxSizing:"border-box"},customFieldActive:{border:`1px solid ${macOSColors.semantic.info}`,backgroundColor:`${macOSColors.semantic.info}1F`},customValue:{padding:"6px 0",fontSize:11,fontWeight:600,color:macOSColors.text.secondary},customInputActive:{color:macOSColors.semantic.info},subHint:{fontSize:10,lineHeight:"14px",color:macOSColors.text.muted,marginTop:-2},subLabel:{fontSize:10,fontWeight:700,letterSpacing:.6,color:macOSColors.text.muted,textTransform:"uppercase"},textButton:{alignSelf:"flex-start",padding:"4px 0",background:"none",border:"none",cursor:"pointer",margin:0},textButtonLabel:{fontSize:11,fontWeight:600,color:macOSColors.semantic.info},textButtonMuted:{fontSize:11,fontWeight:600,color:macOSColors.text.secondary},textButtonDisabled:{opacity:.4},inlineActions:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},emptyBody:{fontSize:11,color:macOSColors.text.muted,padding:"6px 0"},footer:{display:"flex",flexDirection:"row",gap:8,padding:12,borderTop:`1px solid ${macOSColors.border.default}`,backgroundColor:macOSColors.background.base},footerButton:{flex:1,padding:"11px 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.card},cancelText:{fontSize:12,fontWeight:600,color:macOSColors.text.secondary},saveButton:{border:`1px solid ${macOSColors.semantic.info}`,backgroundColor:`${macOSColors.semantic.info}22`},saveButtonDisabled:{opacity:.4,cursor:"default"},saveText:{fontSize:12,fontWeight:700,color:macOSColors.semantic.info}};