@buoy-gg/shared-ui 7.0.39 → 7.0.41

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 (377) hide show
  1. package/README.md +6 -0
  2. package/lib/commonjs/JsModal.js +13 -61
  3. package/lib/commonjs/JsModal.web.js +32 -95
  4. package/lib/commonjs/clipboard/autoDetectClipboard.js +1 -1
  5. package/lib/commonjs/clipboard/clipboard-impl.web.js +21 -0
  6. package/lib/commonjs/dataViewer/tree/TreeDiffViewer.js +4 -2
  7. package/lib/commonjs/hooks/index.js +1 -1
  8. package/lib/commonjs/hooks/safe-area-impl.js +1 -1
  9. package/lib/commonjs/hooks/usePersistedState.js +1 -1
  10. package/lib/commonjs/hooks/useSafeAreaInsets.web.js +41 -0
  11. package/lib/commonjs/icons/index.js +14 -0
  12. package/lib/commonjs/index.js +34 -0
  13. package/lib/commonjs/license/AccountSetup.js +4 -25
  14. package/lib/commonjs/license/AccountSetup.web.js +78 -64
  15. package/lib/commonjs/license/AccountSetupContent.js +482 -0
  16. package/lib/commonjs/license/FreeAccountPrompt.js +32 -178
  17. package/lib/commonjs/license/LicenseEntryModal.js +5 -12
  18. package/lib/commonjs/license/accountRuntime.js +8 -0
  19. package/lib/commonjs/license/accountRuntime.web.js +9 -0
  20. package/lib/commonjs/license/licenseModule.js +2 -0
  21. package/lib/commonjs/settings/components/BubbleSettingsSection.js +1 -1
  22. package/lib/commonjs/storage/definePersistedSetting.js +1 -1
  23. package/lib/commonjs/stores/ignoredPatternsCore.js +8 -1
  24. package/lib/commonjs/stores/ignoredPatternsStore.js +10 -199
  25. package/lib/commonjs/stores/ignoredPatternsStore.shared.js +205 -0
  26. package/lib/commonjs/stores/ignoredPatternsStore.web.js +10 -230
  27. package/lib/commonjs/ui/backgrounds/backgroundStore.js +1 -1
  28. package/lib/commonjs/ui/backgrounds/variants/wormhole.js +3 -0
  29. package/lib/commonjs/ui/components/CopyButton.js +1 -1
  30. package/lib/commonjs/ui/components/EventStepperFooter.js +1 -1
  31. package/lib/commonjs/ui/components/ToolFooter.js +1 -1
  32. package/lib/commonjs/ui/floating/FloatingTool.web.js +12 -2
  33. package/lib/commonjs/ui/night/primitives.js +10 -3
  34. package/lib/commonjs/ui/otto/OttoSprite.js +1 -1
  35. package/lib/commonjs/utils/browserAsyncStorage.js +157 -0
  36. package/lib/commonjs/utils/browserNavigation.js +116 -0
  37. package/lib/commonjs/utils/devServer.js +8 -4
  38. package/lib/commonjs/utils/devServer.web.js +10 -0
  39. package/lib/commonjs/utils/domRuntime.js +143 -0
  40. package/lib/commonjs/utils/expoRouterModule.js +51 -0
  41. package/lib/commonjs/utils/expoRouterModule.web.js +14 -0
  42. package/lib/commonjs/utils/getSafeAreaInsets.web.js +35 -0
  43. package/lib/commonjs/utils/index.js +111 -4
  44. package/lib/commonjs/utils/loadToolModule.js +46 -0
  45. package/lib/commonjs/utils/loadToolModule.web.js +12 -0
  46. package/lib/commonjs/utils/modalStorage.js +42 -0
  47. package/lib/commonjs/utils/nativeWeb.js +454 -0
  48. package/lib/commonjs/utils/persistentStorage.web.js +78 -0
  49. package/lib/commonjs/utils/reloadApp.js +18 -57
  50. package/lib/commonjs/utils/reloadPlatform.js +37 -0
  51. package/lib/commonjs/utils/reloadPlatform.web.js +17 -0
  52. package/lib/commonjs/utils/safeExpoRouter.js +3 -53
  53. package/lib/commonjs/utils/safeExpoRouter.web.js +48 -0
  54. package/lib/commonjs/utils/toolModules.js +25 -0
  55. package/lib/module/JsModal.js +11 -59
  56. package/lib/module/JsModal.web.js +28 -91
  57. package/lib/module/clipboard/autoDetectClipboard.js +2 -2
  58. package/lib/module/clipboard/clipboard-impl.web.js +14 -0
  59. package/lib/module/dataViewer/tree/TreeDiffViewer.js +4 -2
  60. package/lib/module/hooks/index.js +2 -2
  61. package/lib/module/hooks/safe-area-impl.js +1 -1
  62. package/lib/module/hooks/usePersistedState.js +1 -1
  63. package/lib/module/hooks/useSafeAreaInsets.web.js +30 -0
  64. package/lib/module/icons/index.js +2 -1
  65. package/lib/module/index.js +3 -0
  66. package/lib/module/license/AccountSetup.js +5 -26
  67. package/lib/module/license/AccountSetup.web.js +79 -65
  68. package/lib/module/license/AccountSetupContent.js +476 -0
  69. package/lib/module/license/FreeAccountPrompt.js +27 -176
  70. package/lib/module/license/LicenseEntryModal.js +6 -13
  71. package/lib/module/license/accountRuntime.js +3 -0
  72. package/lib/module/license/accountRuntime.web.js +4 -0
  73. package/lib/module/license/licenseModule.js +2 -0
  74. package/lib/module/settings/components/BubbleSettingsSection.js +1 -1
  75. package/lib/module/storage/definePersistedSetting.js +1 -1
  76. package/lib/module/stores/ignoredPatternsCore.js +8 -1
  77. package/lib/module/stores/ignoredPatternsStore.js +1 -187
  78. package/lib/module/stores/ignoredPatternsStore.shared.js +189 -0
  79. package/lib/module/stores/ignoredPatternsStore.web.js +1 -219
  80. package/lib/module/ui/backgrounds/backgroundStore.js +1 -1
  81. package/lib/module/ui/backgrounds/variants/wormhole.js +3 -0
  82. package/lib/module/ui/components/CopyButton.js +1 -1
  83. package/lib/module/ui/components/EventStepperFooter.js +1 -1
  84. package/lib/module/ui/components/ToolFooter.js +1 -1
  85. package/lib/module/ui/floating/FloatingTool.web.js +12 -2
  86. package/lib/module/ui/night/primitives.js +11 -4
  87. package/lib/module/ui/otto/OttoSprite.js +1 -1
  88. package/lib/module/utils/browserAsyncStorage.js +151 -0
  89. package/lib/module/utils/browserNavigation.js +108 -0
  90. package/lib/module/utils/devServer.js +8 -4
  91. package/lib/module/utils/devServer.web.js +6 -0
  92. package/lib/module/utils/domRuntime.js +134 -0
  93. package/lib/module/utils/expoRouterModule.js +46 -0
  94. package/lib/module/utils/expoRouterModule.web.js +9 -0
  95. package/lib/module/utils/getSafeAreaInsets.web.js +31 -0
  96. package/lib/module/utils/index.js +9 -4
  97. package/lib/module/utils/loadToolModule.js +42 -0
  98. package/lib/module/utils/loadToolModule.web.js +8 -0
  99. package/lib/module/utils/modalStorage.js +37 -0
  100. package/lib/module/utils/nativeWeb.js +107 -0
  101. package/lib/module/utils/persistentStorage.web.js +72 -0
  102. package/lib/module/utils/reloadApp.js +13 -51
  103. package/lib/module/utils/reloadPlatform.js +31 -0
  104. package/lib/module/utils/reloadPlatform.web.js +11 -0
  105. package/lib/module/utils/safeExpoRouter.js +3 -53
  106. package/lib/module/utils/safeExpoRouter.web.js +37 -0
  107. package/lib/module/utils/toolModules.js +19 -0
  108. package/lib/typescript/commonjs/JsModal.d.ts.map +1 -1
  109. package/lib/typescript/commonjs/JsModal.web.d.ts +7 -18
  110. package/lib/typescript/commonjs/JsModal.web.d.ts.map +1 -1
  111. package/lib/typescript/commonjs/clipboard/clipboard-impl.web.d.ts +5 -0
  112. package/lib/typescript/commonjs/clipboard/clipboard-impl.web.d.ts.map +1 -0
  113. package/lib/typescript/commonjs/dataViewer/tree/TreeDiffViewer.d.ts.map +1 -1
  114. package/lib/typescript/commonjs/hooks/safe-area-impl.d.ts +1 -1
  115. package/lib/typescript/commonjs/hooks/useSafeAreaInsets.web.d.ts +6 -0
  116. package/lib/typescript/commonjs/hooks/useSafeAreaInsets.web.d.ts.map +1 -0
  117. package/lib/typescript/commonjs/icons/index.d.ts +1 -0
  118. package/lib/typescript/commonjs/icons/index.d.ts.map +1 -1
  119. package/lib/typescript/commonjs/index.d.ts +2 -0
  120. package/lib/typescript/commonjs/index.d.ts.map +1 -1
  121. package/lib/typescript/commonjs/license/AccountSetup.d.ts.map +1 -1
  122. package/lib/typescript/commonjs/license/AccountSetup.web.d.ts +1 -1
  123. package/lib/typescript/commonjs/license/AccountSetup.web.d.ts.map +1 -1
  124. package/lib/typescript/commonjs/license/AccountSetupContent.d.ts +11 -0
  125. package/lib/typescript/commonjs/license/AccountSetupContent.d.ts.map +1 -0
  126. package/lib/typescript/commonjs/license/FreeAccountPrompt.d.ts +3 -15
  127. package/lib/typescript/commonjs/license/FreeAccountPrompt.d.ts.map +1 -1
  128. package/lib/typescript/commonjs/license/LicenseEntryModal.d.ts.map +1 -1
  129. package/lib/typescript/commonjs/license/accountRuntime.d.ts +2 -0
  130. package/lib/typescript/commonjs/license/accountRuntime.d.ts.map +1 -0
  131. package/lib/typescript/commonjs/license/accountRuntime.web.d.ts +2 -0
  132. package/lib/typescript/commonjs/license/accountRuntime.web.d.ts.map +1 -0
  133. package/lib/typescript/commonjs/license/licenseModule.d.ts +3 -1
  134. package/lib/typescript/commonjs/license/licenseModule.d.ts.map +1 -1
  135. package/lib/typescript/commonjs/stores/ignoredPatternsCore.d.ts +5 -1
  136. package/lib/typescript/commonjs/stores/ignoredPatternsCore.d.ts.map +1 -1
  137. package/lib/typescript/commonjs/stores/ignoredPatternsStore.d.ts +1 -59
  138. package/lib/typescript/commonjs/stores/ignoredPatternsStore.d.ts.map +1 -1
  139. package/lib/typescript/commonjs/stores/ignoredPatternsStore.shared.d.ts +60 -0
  140. package/lib/typescript/commonjs/stores/ignoredPatternsStore.shared.d.ts.map +1 -0
  141. package/lib/typescript/commonjs/stores/ignoredPatternsStore.web.d.ts +1 -71
  142. package/lib/typescript/commonjs/stores/ignoredPatternsStore.web.d.ts.map +1 -1
  143. package/lib/typescript/commonjs/ui/floating/FloatingTool.web.d.ts.map +1 -1
  144. package/lib/typescript/commonjs/ui/night/primitives.d.ts.map +1 -1
  145. package/lib/typescript/commonjs/ui/otto/ottoEngine.d.ts +1 -1
  146. package/lib/typescript/commonjs/utils/browserAsyncStorage.d.ts +25 -0
  147. package/lib/typescript/commonjs/utils/browserAsyncStorage.d.ts.map +1 -0
  148. package/lib/typescript/commonjs/utils/browserNavigation.d.ts +31 -0
  149. package/lib/typescript/commonjs/utils/browserNavigation.d.ts.map +1 -0
  150. package/lib/typescript/commonjs/utils/devServer.d.ts.map +1 -1
  151. package/lib/typescript/commonjs/utils/devServer.web.d.ts +2 -0
  152. package/lib/typescript/commonjs/utils/devServer.web.d.ts.map +1 -0
  153. package/lib/typescript/commonjs/utils/domRuntime.d.ts +27 -0
  154. package/lib/typescript/commonjs/utils/domRuntime.d.ts.map +1 -0
  155. package/lib/typescript/commonjs/utils/expoRouterModule.d.ts +3 -0
  156. package/lib/typescript/commonjs/utils/expoRouterModule.d.ts.map +1 -0
  157. package/lib/typescript/commonjs/utils/expoRouterModule.web.d.ts +3 -0
  158. package/lib/typescript/commonjs/utils/expoRouterModule.web.d.ts.map +1 -0
  159. package/lib/typescript/commonjs/utils/getSafeAreaInsets.web.d.ts +8 -0
  160. package/lib/typescript/commonjs/utils/getSafeAreaInsets.web.d.ts.map +1 -0
  161. package/lib/typescript/commonjs/utils/index.d.ts +5 -0
  162. package/lib/typescript/commonjs/utils/index.d.ts.map +1 -1
  163. package/lib/typescript/commonjs/utils/loadToolModule.d.ts +3 -0
  164. package/lib/typescript/commonjs/utils/loadToolModule.d.ts.map +1 -0
  165. package/lib/typescript/commonjs/utils/loadToolModule.web.d.ts +2 -0
  166. package/lib/typescript/commonjs/utils/loadToolModule.web.d.ts.map +1 -0
  167. package/lib/typescript/commonjs/utils/modalStorage.d.ts +21 -0
  168. package/lib/typescript/commonjs/utils/modalStorage.d.ts.map +1 -0
  169. package/lib/typescript/commonjs/utils/nativeWeb.d.ts +22 -0
  170. package/lib/typescript/commonjs/utils/nativeWeb.d.ts.map +1 -0
  171. package/lib/typescript/commonjs/utils/persistentStorage.web.d.ts +6 -0
  172. package/lib/typescript/commonjs/utils/persistentStorage.web.d.ts.map +1 -0
  173. package/lib/typescript/commonjs/utils/reloadApp.d.ts +7 -25
  174. package/lib/typescript/commonjs/utils/reloadApp.d.ts.map +1 -1
  175. package/lib/typescript/commonjs/utils/reloadPlatform.d.ts +8 -0
  176. package/lib/typescript/commonjs/utils/reloadPlatform.d.ts.map +1 -0
  177. package/lib/typescript/commonjs/utils/reloadPlatform.web.d.ts +4 -0
  178. package/lib/typescript/commonjs/utils/reloadPlatform.web.d.ts.map +1 -0
  179. package/lib/typescript/commonjs/utils/safeExpoRouter.d.ts.map +1 -1
  180. package/lib/typescript/commonjs/utils/safeExpoRouter.web.d.ts +43 -0
  181. package/lib/typescript/commonjs/utils/safeExpoRouter.web.d.ts.map +1 -0
  182. package/lib/typescript/commonjs/utils/toolModules.d.ts +5 -0
  183. package/lib/typescript/commonjs/utils/toolModules.d.ts.map +1 -0
  184. package/lib/typescript/module/JsModal.d.ts.map +1 -1
  185. package/lib/typescript/module/JsModal.web.d.ts +7 -18
  186. package/lib/typescript/module/JsModal.web.d.ts.map +1 -1
  187. package/lib/typescript/module/clipboard/clipboard-impl.web.d.ts +5 -0
  188. package/lib/typescript/module/clipboard/clipboard-impl.web.d.ts.map +1 -0
  189. package/lib/typescript/module/dataViewer/tree/TreeDiffViewer.d.ts.map +1 -1
  190. package/lib/typescript/module/hooks/safe-area-impl.d.ts +1 -1
  191. package/lib/typescript/module/hooks/useSafeAreaInsets.web.d.ts +6 -0
  192. package/lib/typescript/module/hooks/useSafeAreaInsets.web.d.ts.map +1 -0
  193. package/lib/typescript/module/icons/index.d.ts +1 -0
  194. package/lib/typescript/module/icons/index.d.ts.map +1 -1
  195. package/lib/typescript/module/index.d.ts +2 -0
  196. package/lib/typescript/module/index.d.ts.map +1 -1
  197. package/lib/typescript/module/license/AccountSetup.d.ts.map +1 -1
  198. package/lib/typescript/module/license/AccountSetup.web.d.ts +1 -1
  199. package/lib/typescript/module/license/AccountSetup.web.d.ts.map +1 -1
  200. package/lib/typescript/module/license/AccountSetupContent.d.ts +11 -0
  201. package/lib/typescript/module/license/AccountSetupContent.d.ts.map +1 -0
  202. package/lib/typescript/module/license/FreeAccountPrompt.d.ts +3 -15
  203. package/lib/typescript/module/license/FreeAccountPrompt.d.ts.map +1 -1
  204. package/lib/typescript/module/license/LicenseEntryModal.d.ts.map +1 -1
  205. package/lib/typescript/module/license/accountRuntime.d.ts +2 -0
  206. package/lib/typescript/module/license/accountRuntime.d.ts.map +1 -0
  207. package/lib/typescript/module/license/accountRuntime.web.d.ts +2 -0
  208. package/lib/typescript/module/license/accountRuntime.web.d.ts.map +1 -0
  209. package/lib/typescript/module/license/licenseModule.d.ts +3 -1
  210. package/lib/typescript/module/license/licenseModule.d.ts.map +1 -1
  211. package/lib/typescript/module/stores/ignoredPatternsCore.d.ts +5 -1
  212. package/lib/typescript/module/stores/ignoredPatternsCore.d.ts.map +1 -1
  213. package/lib/typescript/module/stores/ignoredPatternsStore.d.ts +1 -59
  214. package/lib/typescript/module/stores/ignoredPatternsStore.d.ts.map +1 -1
  215. package/lib/typescript/module/stores/ignoredPatternsStore.shared.d.ts +60 -0
  216. package/lib/typescript/module/stores/ignoredPatternsStore.shared.d.ts.map +1 -0
  217. package/lib/typescript/module/stores/ignoredPatternsStore.web.d.ts +1 -71
  218. package/lib/typescript/module/stores/ignoredPatternsStore.web.d.ts.map +1 -1
  219. package/lib/typescript/module/ui/floating/FloatingTool.web.d.ts.map +1 -1
  220. package/lib/typescript/module/ui/night/primitives.d.ts.map +1 -1
  221. package/lib/typescript/module/ui/otto/ottoEngine.d.ts +1 -1
  222. package/lib/typescript/module/utils/browserAsyncStorage.d.ts +25 -0
  223. package/lib/typescript/module/utils/browserAsyncStorage.d.ts.map +1 -0
  224. package/lib/typescript/module/utils/browserNavigation.d.ts +31 -0
  225. package/lib/typescript/module/utils/browserNavigation.d.ts.map +1 -0
  226. package/lib/typescript/module/utils/devServer.d.ts.map +1 -1
  227. package/lib/typescript/module/utils/devServer.web.d.ts +2 -0
  228. package/lib/typescript/module/utils/devServer.web.d.ts.map +1 -0
  229. package/lib/typescript/module/utils/domRuntime.d.ts +27 -0
  230. package/lib/typescript/module/utils/domRuntime.d.ts.map +1 -0
  231. package/lib/typescript/module/utils/expoRouterModule.d.ts +3 -0
  232. package/lib/typescript/module/utils/expoRouterModule.d.ts.map +1 -0
  233. package/lib/typescript/module/utils/expoRouterModule.web.d.ts +3 -0
  234. package/lib/typescript/module/utils/expoRouterModule.web.d.ts.map +1 -0
  235. package/lib/typescript/module/utils/getSafeAreaInsets.web.d.ts +8 -0
  236. package/lib/typescript/module/utils/getSafeAreaInsets.web.d.ts.map +1 -0
  237. package/lib/typescript/module/utils/index.d.ts +5 -0
  238. package/lib/typescript/module/utils/index.d.ts.map +1 -1
  239. package/lib/typescript/module/utils/loadToolModule.d.ts +3 -0
  240. package/lib/typescript/module/utils/loadToolModule.d.ts.map +1 -0
  241. package/lib/typescript/module/utils/loadToolModule.web.d.ts +2 -0
  242. package/lib/typescript/module/utils/loadToolModule.web.d.ts.map +1 -0
  243. package/lib/typescript/module/utils/modalStorage.d.ts +21 -0
  244. package/lib/typescript/module/utils/modalStorage.d.ts.map +1 -0
  245. package/lib/typescript/module/utils/nativeWeb.d.ts +22 -0
  246. package/lib/typescript/module/utils/nativeWeb.d.ts.map +1 -0
  247. package/lib/typescript/module/utils/persistentStorage.web.d.ts +6 -0
  248. package/lib/typescript/module/utils/persistentStorage.web.d.ts.map +1 -0
  249. package/lib/typescript/module/utils/reloadApp.d.ts +7 -25
  250. package/lib/typescript/module/utils/reloadApp.d.ts.map +1 -1
  251. package/lib/typescript/module/utils/reloadPlatform.d.ts +8 -0
  252. package/lib/typescript/module/utils/reloadPlatform.d.ts.map +1 -0
  253. package/lib/typescript/module/utils/reloadPlatform.web.d.ts +4 -0
  254. package/lib/typescript/module/utils/reloadPlatform.web.d.ts.map +1 -0
  255. package/lib/typescript/module/utils/safeExpoRouter.d.ts.map +1 -1
  256. package/lib/typescript/module/utils/safeExpoRouter.web.d.ts +43 -0
  257. package/lib/typescript/module/utils/safeExpoRouter.web.d.ts.map +1 -0
  258. package/lib/typescript/module/utils/toolModules.d.ts +5 -0
  259. package/lib/typescript/module/utils/toolModules.d.ts.map +1 -0
  260. package/lib/web/asyncStorage.mjs +2 -0
  261. package/lib/web/chunks/chunk-2MHKRRQW.mjs +8 -0
  262. package/lib/web/chunks/chunk-2Q3SDPH2.mjs +14 -0
  263. package/lib/web/chunks/chunk-34YQ42KI.mjs +2 -0
  264. package/lib/web/chunks/chunk-3NNNCQYP.mjs +14 -0
  265. package/lib/web/chunks/chunk-3UTMGIUG.mjs +2 -0
  266. package/lib/web/chunks/chunk-46CXXOQB.mjs +2 -0
  267. package/lib/web/chunks/chunk-475BSDCB.mjs +2 -0
  268. package/lib/web/chunks/chunk-53J2FMUD.mjs +2 -0
  269. package/lib/web/chunks/chunk-552W4COI.mjs +2 -0
  270. package/lib/web/chunks/chunk-56TTTMX4.mjs +6145 -0
  271. package/lib/web/chunks/chunk-5LOQZINQ.mjs +14 -0
  272. package/lib/web/chunks/chunk-5NOIO6ZM.mjs +16 -0
  273. package/lib/web/chunks/chunk-5NZOQR6Q.mjs +2 -0
  274. package/lib/web/chunks/chunk-6CCRCSA2.mjs +2 -0
  275. package/lib/web/chunks/chunk-6Q52HRBL.mjs +2 -0
  276. package/lib/web/chunks/chunk-6TEDFSNM.mjs +655 -0
  277. package/lib/web/chunks/chunk-7BMRSMHN.mjs +2 -0
  278. package/lib/web/chunks/chunk-A2SOFE47.mjs +24 -0
  279. package/lib/web/chunks/chunk-A7KJCK4R.mjs +14 -0
  280. package/lib/web/chunks/chunk-AEXGGXS7.mjs +2 -0
  281. package/lib/web/chunks/chunk-AGD7ZT6O.mjs +15 -0
  282. package/lib/web/chunks/chunk-AIEOQWNG.mjs +2 -0
  283. package/lib/web/chunks/chunk-ASTM35HG.mjs +16 -0
  284. package/lib/web/chunks/chunk-AZBMFPMX.mjs +1421 -0
  285. package/lib/web/chunks/chunk-B2V2UDCU.mjs +16 -0
  286. package/lib/web/chunks/chunk-BFGKGTAC.mjs +2 -0
  287. package/lib/web/chunks/chunk-BHW6AFO6.mjs +2 -0
  288. package/lib/web/chunks/chunk-BWRW3NJ2.mjs +16 -0
  289. package/lib/web/chunks/chunk-CBM2IZAK.mjs +2 -0
  290. package/lib/web/chunks/chunk-CDLCFF44.mjs +2 -0
  291. package/lib/web/chunks/chunk-CE5U3CSQ.mjs +2 -0
  292. package/lib/web/chunks/chunk-CI5CO7FQ.mjs +2 -0
  293. package/lib/web/chunks/chunk-CIB4U2YK.mjs +2 -0
  294. package/lib/web/chunks/chunk-CLLTZQGD.mjs +596 -0
  295. package/lib/web/chunks/chunk-D5HQLRFW.mjs +655 -0
  296. package/lib/web/chunks/chunk-DZDTNXXK.mjs +2 -0
  297. package/lib/web/chunks/chunk-FDOZ6YSS.mjs +2 -0
  298. package/lib/web/chunks/chunk-FMEWNGQO.mjs +2 -0
  299. package/lib/web/chunks/chunk-G4DH7GMT.mjs +2 -0
  300. package/lib/web/chunks/chunk-GBUZCZE4.mjs +2 -0
  301. package/lib/web/chunks/chunk-GF5C5DVX.mjs +2 -0
  302. package/lib/web/chunks/chunk-GLMS5ZLJ.mjs +445 -0
  303. package/lib/web/chunks/chunk-GNGMIA7V.mjs +2 -0
  304. package/lib/web/chunks/chunk-GTYIS7H7.mjs +15 -0
  305. package/lib/web/chunks/chunk-HJ36IONA.mjs +15 -0
  306. package/lib/web/chunks/chunk-HXPTZMAZ.mjs +2 -0
  307. package/lib/web/chunks/chunk-I27M4JCS.mjs +2 -0
  308. package/lib/web/chunks/chunk-IVCT27JB.mjs +2 -0
  309. package/lib/web/chunks/chunk-JG4QSK5B.mjs +2 -0
  310. package/lib/web/chunks/chunk-JR7BJW6B.mjs +389 -0
  311. package/lib/web/chunks/chunk-K46ZJUXJ.mjs +90 -0
  312. package/lib/web/chunks/chunk-K4LXMO4D.mjs +2 -0
  313. package/lib/web/chunks/chunk-K7CGIEFU.mjs +2 -0
  314. package/lib/web/chunks/chunk-KBTYK5YE.mjs +662 -0
  315. package/lib/web/chunks/chunk-KHP6CSSM.mjs +2 -0
  316. package/lib/web/chunks/chunk-KRDRIW7T.mjs +14 -0
  317. package/lib/web/chunks/chunk-L2DTKDER.mjs +2 -0
  318. package/lib/web/chunks/chunk-LFDFDGHY.mjs +655 -0
  319. package/lib/web/chunks/chunk-LZ7FZZ7R.mjs +2 -0
  320. package/lib/web/chunks/chunk-MAIUUK4E.mjs +2 -0
  321. package/lib/web/chunks/chunk-MKJKS3IG.mjs +275 -0
  322. package/lib/web/chunks/chunk-MRQKVLXG.mjs +2 -0
  323. package/lib/web/chunks/chunk-NK3OISOL.mjs +14 -0
  324. package/lib/web/chunks/chunk-NLJDDIXW.mjs +2 -0
  325. package/lib/web/chunks/chunk-OENR3XFI.mjs +11 -0
  326. package/lib/web/chunks/chunk-OZB3VKZE.mjs +2 -0
  327. package/lib/web/chunks/chunk-P64PFJT3.mjs +17618 -0
  328. package/lib/web/chunks/chunk-PACPGYH7.mjs +2 -0
  329. package/lib/web/chunks/chunk-PART6HOE.mjs +14 -0
  330. package/lib/web/chunks/chunk-PMRXUQRH.mjs +2 -0
  331. package/lib/web/chunks/chunk-PTK5FO6C.mjs +2 -0
  332. package/lib/web/chunks/chunk-PZ45TQ55.mjs +14 -0
  333. package/lib/web/chunks/chunk-Q5LN7GET.mjs +17624 -0
  334. package/lib/web/chunks/chunk-QCD6T6L4.mjs +297 -0
  335. package/lib/web/chunks/chunk-QD5EUANU.mjs +2 -0
  336. package/lib/web/chunks/chunk-QJTECJCO.mjs +2 -0
  337. package/lib/web/chunks/chunk-QPIZURPZ.mjs +2 -0
  338. package/lib/web/chunks/chunk-QPY45R5F.mjs +274 -0
  339. package/lib/web/chunks/chunk-R2SGZIG5.mjs +2 -0
  340. package/lib/web/chunks/chunk-S3GYQYVJ.mjs +16 -0
  341. package/lib/web/chunks/chunk-SCCXVTDM.mjs +2 -0
  342. package/lib/web/chunks/chunk-SHJHD646.mjs +2 -0
  343. package/lib/web/chunks/chunk-TCRVZ55E.mjs +2 -0
  344. package/lib/web/chunks/chunk-TJ6ZVV2L.mjs +15 -0
  345. package/lib/web/chunks/chunk-TPSY4RC3.mjs +14 -0
  346. package/lib/web/chunks/chunk-U5KNX5O6.mjs +17624 -0
  347. package/lib/web/chunks/chunk-UCKELQSM.mjs +2 -0
  348. package/lib/web/chunks/chunk-UGGCYHRH.mjs +15 -0
  349. package/lib/web/chunks/chunk-UNYQJZET.mjs +16 -0
  350. package/lib/web/chunks/chunk-VE72SWLV.mjs +15 -0
  351. package/lib/web/chunks/chunk-VKONO6MI.mjs +2 -0
  352. package/lib/web/chunks/chunk-W4BGMPJO.mjs +2 -0
  353. package/lib/web/chunks/chunk-WHNEEKLR.mjs +2 -0
  354. package/lib/web/chunks/chunk-WLGUP3KY.mjs +16 -0
  355. package/lib/web/chunks/chunk-WY7D4WBZ.mjs +2 -0
  356. package/lib/web/chunks/chunk-XRNB2MHO.mjs +107 -0
  357. package/lib/web/chunks/chunk-XXTIAXQY.mjs +2 -0
  358. package/lib/web/chunks/chunk-XYUAUO57.mjs +2 -0
  359. package/lib/web/chunks/chunk-YG6DIKQD.mjs +2 -0
  360. package/lib/web/chunks/chunk-YIZFMU66.mjs +2 -0
  361. package/lib/web/chunks/chunk-YOGAPOGC.mjs +2 -0
  362. package/lib/web/chunks/chunk-Z7373DS5.mjs +2 -0
  363. package/lib/web/chunks/chunk-Z76GRN66.mjs +17627 -0
  364. package/lib/web/chunks/persistentStorage.web-4FBAOYJ4.mjs +12 -0
  365. package/lib/web/chunks/persistentStorage.web-7W3Y6Q24.mjs +12 -0
  366. package/lib/web/chunks/persistentStorage.web-GOWNFMVT.mjs +2 -0
  367. package/lib/web/chunks/persistentStorage.web-RF47FXIK.mjs +12 -0
  368. package/lib/web/colors.mjs +2 -0
  369. package/lib/web/dataViewer.mjs +3 -0
  370. package/lib/web/floating.mjs +2 -0
  371. package/lib/web/history.mjs +2 -0
  372. package/lib/web/hooks.mjs +2 -0
  373. package/lib/web/index.mjs +15 -0
  374. package/lib/web/native.mjs +2 -0
  375. package/lib/web/ui.mjs +2 -0
  376. package/lib/web/utils.mjs +2 -0
  377. package/package.json +118 -36
@@ -1,199 +1,50 @@
1
1
  "use strict";
2
2
 
3
- /**
4
- * The account setup sheet — what a locked manager shows instead of the tools.
5
- *
6
- * Deliberately not the Pro modal. The next step is a free account and takes
7
- * about thirty seconds, so asking for money here would be asking the wrong
8
- * question at the wrong moment. Pro is still offered, as a secondary action.
9
- *
10
- * The command is shown inline and copyable rather than linked, because
11
- * someone who cannot open the tools needs the fix in front of them, not a link
12
- * to a page that has a link to a command.
13
- */
14
-
15
- import React, { useCallback, useEffect, useRef, useState } from "react";
16
- import { Modal, StyleSheet, Text, TouchableOpacity } from "react-native";
17
- import { buoyColors } from "../ui/gameUI/constants/gameUIColors.js";
18
- import { Check, Copy, X } from "../icons/lucide-icons.js";
19
- import { copyToClipboard } from "../clipboard/index.js";
20
- import { openPricing } from "./openPricing.js";
21
- import { getUseAccountAccess, retryAccountAccess } from "./licenseModule.js";
22
- import { monoFont } from "../ui/fonts.js";
23
- /** The one thing a reader has to be able to act on. */
3
+ import { Modal, Pressable, ScrollView, StyleSheet, View } from "react-native";
4
+ import { AccountSetupCard } from "./AccountSetupContent.js";
24
5
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
25
- export const LOGIN_COMMAND = "npx buoy login";
26
- export const FreeAccountPrompt = ({
6
+ export { LOGIN_COMMAND } from "./AccountSetupContent.js";
7
+ /** Native presentation of the shared account card. */
8
+ export function FreeAccountPrompt({
27
9
  visible,
28
10
  onClose
29
- }) => {
30
- const access = getUseAccountAccess()();
31
- const [copied, setCopied] = useState(false);
32
- const resetTimer = useRef(null);
33
- useEffect(() => () => {
34
- if (resetTimer.current) clearTimeout(resetTimer.current);
35
- }, []);
36
- const handleCopy = useCallback(() => {
37
- void copyToClipboard(LOGIN_COMMAND).then(ok => {
38
- if (!ok) return;
39
- setCopied(true);
40
- if (resetTimer.current) clearTimeout(resetTimer.current);
41
- resetTimer.current = setTimeout(() => setCopied(false), 1500);
42
- });
43
- }, []);
11
+ }) {
44
12
  if (!visible) return null;
45
13
  return /*#__PURE__*/_jsx(Modal, {
46
- visible: visible,
14
+ visible: true,
47
15
  transparent: true,
48
16
  animationType: "fade",
49
17
  onRequestClose: onClose,
50
- children: /*#__PURE__*/_jsx(TouchableOpacity, {
18
+ children: /*#__PURE__*/_jsxs(View, {
51
19
  style: styles.overlay,
52
- onPress: onClose,
53
- activeOpacity: 1,
54
- children: /*#__PURE__*/_jsxs(TouchableOpacity, {
55
- style: styles.card,
56
- activeOpacity: 1,
57
- onPress: () => {},
58
- children: [/*#__PURE__*/_jsx(TouchableOpacity, {
59
- style: styles.close,
60
- onPress: onClose,
61
- activeOpacity: 0.7,
62
- children: /*#__PURE__*/_jsx(X, {
63
- size: 18,
64
- color: buoyColors.textMuted
65
- })
66
- }), /*#__PURE__*/_jsx(Text, {
67
- style: styles.title,
68
- children: access.status === "initializing" ? "Checking your account…" : "Sign in to use Buoy"
69
- }), /*#__PURE__*/_jsx(Text, {
70
- style: styles.subtitle,
71
- children: "A Free or Pro account is required. Run this command in your project, then reload the app to use your account key."
72
- }), /*#__PURE__*/_jsxs(TouchableOpacity, {
73
- style: styles.command,
74
- onPress: handleCopy,
75
- activeOpacity: 0.7,
76
- accessibilityLabel: `Copy ${LOGIN_COMMAND}`,
77
- children: [/*#__PURE__*/_jsx(Text, {
78
- style: styles.commandText,
79
- children: LOGIN_COMMAND
80
- }), copied ? /*#__PURE__*/_jsx(Check, {
81
- size: 14,
82
- color: buoyColors.success
83
- }) : /*#__PURE__*/_jsx(Copy, {
84
- size: 14,
85
- color: buoyColors.textMuted
86
- })]
87
- }), access.status !== "admitted" && /*#__PURE__*/_jsx(TouchableOpacity, {
88
- style: styles.secondary,
89
- onPress: () => {
90
- void retryAccountAccess();
91
- },
92
- children: /*#__PURE__*/_jsx(Text, {
93
- style: styles.secondaryText,
94
- children: "Retry verification"
95
- })
96
- }), /*#__PURE__*/_jsx(Text, {
97
- style: styles.reassure,
98
- children: "Free forever. No card. About thirty seconds."
99
- }), /*#__PURE__*/_jsx(TouchableOpacity, {
100
- style: styles.secondary,
101
- onPress: () => openPricing("https://github.com/Buoy-gg/buoy/issues/new/choose"),
102
- children: /*#__PURE__*/_jsx(Text, {
103
- style: styles.secondaryText,
104
- children: "Contact support on GitHub"
105
- })
106
- }), /*#__PURE__*/_jsx(TouchableOpacity, {
107
- style: styles.secondary,
108
- onPress: () => openPricing("mailto:support@buoy.gg"),
109
- children: /*#__PURE__*/_jsx(Text, {
110
- style: styles.secondaryText,
111
- children: "Email support@buoy.gg"
112
- })
113
- }), /*#__PURE__*/_jsx(TouchableOpacity, {
114
- style: styles.secondary,
115
- onPress: () => openPricing(),
116
- activeOpacity: 0.8,
117
- children: /*#__PURE__*/_jsx(Text, {
118
- style: styles.secondaryText,
119
- children: "Or see Pro"
120
- })
121
- })]
122
- })
20
+ accessibilityViewIsModal: true,
21
+ children: [/*#__PURE__*/_jsx(Pressable, {
22
+ style: StyleSheet.absoluteFill,
23
+ onPress: onClose,
24
+ accessible: false
25
+ }), /*#__PURE__*/_jsx(ScrollView, {
26
+ style: styles.frame,
27
+ bounces: false,
28
+ children: /*#__PURE__*/_jsx(AccountSetupCard, {
29
+ onClose: onClose
30
+ })
31
+ })]
123
32
  })
124
33
  });
125
- };
34
+ }
126
35
  const styles = StyleSheet.create({
127
36
  overlay: {
128
37
  flex: 1,
129
- backgroundColor: "rgba(0, 0, 0, 0.75)",
38
+ backgroundColor: "rgba(0, 0, 0, 0.65)",
130
39
  alignItems: "center",
131
40
  justifyContent: "center",
132
41
  padding: 20
133
42
  },
134
- card: {
135
- backgroundColor: buoyColors.card,
136
- borderRadius: 16,
137
- borderWidth: 1,
138
- borderColor: buoyColors.primary + "60",
139
- padding: 24,
140
- maxWidth: 340,
43
+ frame: {
141
44
  width: "100%",
142
- position: "relative"
143
- },
144
- close: {
145
- position: "absolute",
146
- top: 12,
147
- right: 12,
148
- padding: 6,
149
- zIndex: 1
150
- },
151
- title: {
152
- fontSize: 20,
153
- fontWeight: "700",
154
- color: buoyColors.text,
155
- textAlign: "center",
156
- marginBottom: 8
157
- },
158
- subtitle: {
159
- fontSize: 13,
160
- lineHeight: 19,
161
- color: buoyColors.textMuted,
162
- textAlign: "center",
163
- marginBottom: 20
164
- },
165
- command: {
166
- flexDirection: "row",
167
- alignItems: "center",
168
- justifyContent: "space-between",
169
- backgroundColor: buoyColors.base,
170
- borderRadius: 8,
171
- borderWidth: 1,
172
- borderColor: buoyColors.border,
173
- paddingHorizontal: 14,
174
- paddingVertical: 12,
175
- gap: 10
176
- },
177
- commandText: {
178
- fontSize: 14,
179
- fontWeight: "600",
180
- color: buoyColors.text,
181
- fontFamily: monoFont
182
- },
183
- reassure: {
184
- fontSize: 12,
185
- color: buoyColors.textMuted,
186
- textAlign: "center",
187
- marginTop: 10
188
- },
189
- secondary: {
190
- marginTop: 18,
191
- paddingVertical: 10,
192
- alignItems: "center"
193
- },
194
- secondaryText: {
195
- fontSize: 13,
196
- fontWeight: "600",
197
- color: buoyColors.textMuted
45
+ maxWidth: 368,
46
+ maxHeight: "90%",
47
+ flexGrow: 0,
48
+ borderRadius: 20
198
49
  }
199
50
  });
@@ -15,17 +15,11 @@ import { macOSColors } from "../ui/gameUI/constants/macOSDesignSystemColors.js";
15
15
  import { openPricing, isWeb } from "./openPricing.js";
16
16
  import { X, Key, Link, FileCode, Copy } from "../icons/lucide-icons.js";
17
17
  import { monoFont } from "../ui/fonts.js";
18
- // For clipboard functionality
19
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
20
- let Clipboard = null;
21
- try {
22
- Clipboard = require("@react-native-clipboard/clipboard").default;
23
- } catch {
24
- // Clipboard not available
25
- }
18
+ import { copyToClipboard } from "../clipboard/index.js";
19
+ import { isClipboardAvailable } from "../clipboard/autoDetectClipboard.js";
26
20
 
27
21
  // Keep these for backwards compatibility but they're no longer used
28
-
22
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
29
23
  const CODE_SNIPPET = `import { Buoy } from '@buoy-gg/core';
30
24
 
31
25
  Buoy.init({
@@ -40,9 +34,8 @@ export const LicenseEntryModal = ({
40
34
  const handleGetLicense = useCallback(() => {
41
35
  openPricing(purchaseUrl);
42
36
  }, [purchaseUrl]);
43
- const handleCopyCode = useCallback(() => {
44
- if (Clipboard?.setString) {
45
- Clipboard.setString(CODE_SNIPPET);
37
+ const handleCopyCode = useCallback(async () => {
38
+ if (await copyToClipboard(CODE_SNIPPET)) {
46
39
  setCopied(true);
47
40
  setTimeout(() => setCopied(false), 2000);
48
41
  }
@@ -177,7 +170,7 @@ export const LicenseEntryModal = ({
177
170
  style: styles.codePunctuation,
178
171
  children: "});"
179
172
  })]
180
- }), Clipboard?.setString && /*#__PURE__*/_jsxs(TouchableOpacity, {
173
+ }), isClipboardAvailable() && /*#__PURE__*/_jsxs(TouchableOpacity, {
181
174
  style: styles.copyButton,
182
175
  onPress: handleCopyCode,
183
176
  activeOpacity: 0.7,
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+
3
+ export const canInitializeAccount = () => true;
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+
3
+ // A server import must not initialize an account or retain revalidation timers.
4
+ export const canInitializeAccount = () => typeof window !== "undefined";
@@ -9,6 +9,7 @@
9
9
  */
10
10
 
11
11
  import * as licenseModule from "@buoy-gg/license";
12
+ import { canInitializeAccount } from "./accountRuntime";
12
13
 
13
14
  /** Tier. Mirrors BuoyTier in @buoy-gg/license. */
14
15
 
@@ -71,6 +72,7 @@ const LOCKED = {
71
72
  // Resolve at the boundary, after module initialization. Do not cache an absent
72
73
  // manager during a circular import or grant access for older package versions.
73
74
  function accountManager() {
75
+ if (!canInitializeAccount()) return null;
74
76
  try {
75
77
  const manager = licenseModule.LicenseManager;
76
78
  void manager?.initialize?.();
@@ -5,7 +5,7 @@ import { Settings, EyeOff, Database } from "../../icons/index.js";
5
5
  import { useState, useEffect } from "react";
6
6
  import { CyberpunkSectionButton } from "../../ui/console/CyberpunkSectionButton.js";
7
7
  import { devToolsStorageKeys } from "../../storage/devToolsStorageKeys.js";
8
- import { persistentStorage } from "../../utils/persistentStorage.js";
8
+ import { persistentStorage } from "../../utils/persistentStorage";
9
9
  import { macOSColors } from "../../ui/gameUI/constants/macOSDesignSystemColors.js";
10
10
  import { buoyColors } from "../../ui/gameUI/constants/gameUIColors.js";
11
11
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
@@ -14,7 +14,7 @@
14
14
  * callers that treat first launch differently.
15
15
  */
16
16
 
17
- import { persistentStorage } from "../utils/persistentStorage.js";
17
+ import { persistentStorage } from "../utils/persistentStorage";
18
18
  function isPlainObject(value) {
19
19
  return typeof value === "object" && value !== null && !Array.isArray(value);
20
20
  }
@@ -20,8 +20,15 @@
20
20
 
21
21
  /** A single exclude pattern with its match mode. */
22
22
 
23
- /** Patterns hidden by default — Buoy's own license API traffic. */
23
+ /**
24
+ * Patterns hidden by default — Buoy's own license traffic. License checks go
25
+ * to buoy.gg/api/license (7.0.39+); older SDKs called api.keygen.sh directly,
26
+ * and a persisted list from then still names it.
27
+ */
24
28
  export const DEFAULT_IGNORED_PATTERNS = [{
29
+ value: "buoy.gg/api/license",
30
+ mode: "contains"
31
+ }, {
25
32
  value: "api.keygen.sh",
26
33
  mode: "contains"
27
34
  }];
@@ -1,189 +1,3 @@
1
1
  "use strict";
2
2
 
3
- /**
4
- * Shared "ignored patterns" store for network-style URL filtering.
5
- *
6
- * This is the SINGLE source of truth for the domains/URL patterns that the
7
- * Network tool (and now the Events tool) hide from their lists. Both tools read
8
- * and mutate this one singleton, so an ignore toggled in either place is shared
9
- * everywhere and persisted to the same storage key.
10
- *
11
- * Lives in @buoy-gg/shared-ui (a hard dependency of both @buoy-gg/network and
12
- * @buoy-gg/events) so the filter logic can be shared without @buoy-gg/events
13
- * having to take a hard dependency on @buoy-gg/network (which is optional).
14
- */
15
-
16
- import { useEffect, useMemo, useState } from "react";
17
- import { persistentStorage } from "../utils/persistentStorage.js";
18
- import { devToolsStorageKeys } from "../storage/devToolsStorageKeys.js";
19
-
20
- // Pure matching types/helpers live in ignoredPatternsCore.ts (web-shim-safe);
21
- // re-exported here so the shared-ui barrel surface is unchanged.
22
- import { DEFAULT_IGNORED_PATTERNS } from "./ignoredPatternsCore.js";
23
- export { urlMatchesIgnoredPattern, isUrlIgnored } from "./ignoredPatternsCore.js";
24
- const DEFAULT_PATTERNS = DEFAULT_IGNORED_PATTERNS;
25
-
26
- /** Tolerate the legacy `string[]` persisted format and stray junk. */
27
- function migratePatterns(raw) {
28
- if (!Array.isArray(raw)) return [];
29
- const migrated = [];
30
- for (const entry of raw) {
31
- if (typeof entry === "string" && entry.trim()) {
32
- migrated.push({
33
- value: entry,
34
- mode: "contains"
35
- });
36
- } else if (entry && typeof entry === "object" && typeof entry.value === "string") {
37
- const e = entry;
38
- migrated.push({
39
- value: e.value,
40
- mode: e.mode === "exact" ? "exact" : "contains"
41
- });
42
- }
43
- }
44
- return migrated;
45
- }
46
-
47
- /** Always keep the default patterns present (e.g. Buoy's license API). */
48
- function ensureDefaults(patterns) {
49
- const result = [...patterns];
50
- for (const def of DEFAULT_PATTERNS) {
51
- if (!result.some(p => p.value === def.value)) {
52
- result.push({
53
- ...def
54
- });
55
- }
56
- }
57
- return result;
58
- }
59
- /**
60
- * Singleton store. One instance per JS runtime, so every consumer (Network tool,
61
- * Events tool, on mobile or on the desktop dashboard) shares the same patterns.
62
- */
63
- class IgnoredPatternsStore {
64
- patterns = ensureDefaults(DEFAULT_PATTERNS.map(p => ({
65
- ...p
66
- })));
67
- listeners = new Set();
68
- loaded = false;
69
- loadPromise = null;
70
- /** Set once a mutation happens so a slow initial load can't clobber it. */
71
- dirty = false;
72
-
73
- /** Current patterns (stable reference until a mutation occurs). */
74
- getPatterns() {
75
- return this.patterns;
76
- }
77
- subscribe(listener) {
78
- this.listeners.add(listener);
79
- // Lazily hydrate from storage the first time anyone cares.
80
- void this.ensureLoaded();
81
- return () => {
82
- this.listeners.delete(listener);
83
- };
84
- }
85
- emit() {
86
- this.listeners.forEach(l => l());
87
- }
88
- ensureLoaded() {
89
- if (this.loaded) return Promise.resolve();
90
- if (this.loadPromise) return this.loadPromise;
91
- this.loadPromise = (async () => {
92
- try {
93
- const stored = await persistentStorage.getItem(devToolsStorageKeys.network.ignoredDomains());
94
- // A mutation may have raced this read — never overwrite user intent.
95
- if (stored && !this.dirty) {
96
- const migrated = ensureDefaults(migratePatterns(JSON.parse(stored)));
97
- this.patterns = migrated;
98
- }
99
- } catch {
100
- // Silently fall back to defaults.
101
- } finally {
102
- this.loaded = true;
103
- this.emit();
104
- }
105
- })();
106
- return this.loadPromise;
107
- }
108
- persist() {
109
- persistentStorage.setItem(devToolsStorageKeys.network.ignoredDomains(), JSON.stringify(this.patterns)).catch(() => {
110
- // Silently fail — patterns remain in memory.
111
- });
112
- }
113
- commit(next) {
114
- this.dirty = true;
115
- this.patterns = next;
116
- this.emit();
117
- this.persist();
118
- }
119
-
120
- /** Add a pattern (no-op if its value already exists). */
121
- add(pattern) {
122
- const value = pattern.value.trim();
123
- if (!value) return;
124
- if (this.patterns.some(p => p.value === value)) return;
125
- this.commit([...this.patterns, {
126
- value,
127
- mode: pattern.mode
128
- }]);
129
- }
130
-
131
- /** Remove a pattern by value. */
132
- remove(value) {
133
- if (!this.patterns.some(p => p.value === value)) return;
134
- this.commit(this.patterns.filter(p => p.value !== value));
135
- }
136
-
137
- /** Add as `contains` if absent, otherwise remove (used by detail-view chips). */
138
- toggle(value) {
139
- const trimmed = value.trim();
140
- if (!trimmed) return;
141
- this.commit(this.patterns.some(p => p.value === trimmed) ? this.patterns.filter(p => p.value !== trimmed) : [...this.patterns, {
142
- value: trimmed,
143
- mode: "contains"
144
- }]);
145
- }
146
-
147
- /** Flip an existing pattern between `contains` and `exact`. */
148
- toggleMode(value) {
149
- if (!this.patterns.some(p => p.value === value)) return;
150
- this.commit(this.patterns.map(p => p.value === value ? {
151
- ...p,
152
- mode: p.mode === "contains" ? "exact" : "contains"
153
- } : p));
154
- }
155
- }
156
- export const ignoredPatternsStore = new IgnoredPatternsStore();
157
- /**
158
- * Mutations live at module scope so they keep a STABLE identity across
159
- * renders. They used to be inline arrows in the return object, which handed
160
- * every consumer a fresh `toggle` on each render and defeated `memo` on
161
- * anything they were passed down to — measured on the network detail view,
162
- * where it forced a full re-render of the inspector per step.
163
- */
164
- const addPattern = pattern => ignoredPatternsStore.add(pattern);
165
- const removePattern = value => ignoredPatternsStore.remove(value);
166
- const togglePattern = value => ignoredPatternsStore.toggle(value);
167
- const togglePatternMode = value => ignoredPatternsStore.toggleMode(value);
168
-
169
- /**
170
- * Subscribe to the shared ignored-patterns store. All consumers in a runtime
171
- * see the same patterns and the same mutations.
172
- */
173
- export function useIgnoredPatterns() {
174
- const [patterns, setPatterns] = useState(() => ignoredPatternsStore.getPatterns());
175
- useEffect(() => {
176
- return ignoredPatternsStore.subscribe(() => {
177
- setPatterns(ignoredPatternsStore.getPatterns());
178
- });
179
- }, []);
180
- const values = useMemo(() => new Set(patterns.map(p => p.value)), [patterns]);
181
- return {
182
- patterns,
183
- values,
184
- add: addPattern,
185
- remove: removePattern,
186
- toggle: togglePattern,
187
- toggleMode: togglePatternMode
188
- };
189
- }
3
+ export * from "./ignoredPatternsStore.shared.js";