@buoy-gg/core 7.0.40 → 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 (269) hide show
  1. package/README.md +14 -85
  2. package/bin/buoy.js +20 -347
  3. package/lib/commonjs/Buoy.js +1 -107
  4. package/lib/commonjs/browserRegister.js +1 -0
  5. package/lib/commonjs/browserRegister.server.js +1 -0
  6. package/lib/commonjs/earlyHookScript.js +1 -0
  7. package/lib/commonjs/earlyNetwork.js +1 -0
  8. package/lib/commonjs/floatingMenu/AppHost.js +1 -460
  9. package/lib/commonjs/floatingMenu/AppHost.web.js +1 -364
  10. package/lib/commonjs/floatingMenu/AppHostLogic.js +1 -50
  11. package/lib/commonjs/floatingMenu/AppIcon.js +1 -91
  12. package/lib/commonjs/floatingMenu/AppIcon.web.js +1 -53
  13. package/lib/commonjs/floatingMenu/BrowserToolRuntime.js +1 -0
  14. package/lib/commonjs/floatingMenu/DefaultConfigContext.js +1 -45
  15. package/lib/commonjs/floatingMenu/DevToolsSettingsModal.js +1 -1119
  16. package/lib/commonjs/floatingMenu/DevToolsSettingsModal.shared.js +1 -0
  17. package/lib/commonjs/floatingMenu/DevToolsSettingsModal.web.js +1 -1048
  18. package/lib/commonjs/floatingMenu/DevToolsVisibilityContext.js +1 -49
  19. package/lib/commonjs/floatingMenu/FloatingDevTools.js +1 -554
  20. package/lib/commonjs/floatingMenu/FloatingDevTools.web.js +1 -401
  21. package/lib/commonjs/floatingMenu/FloatingMenu.js +1 -371
  22. package/lib/commonjs/floatingMenu/MinimizedToolsContext.js +1 -274
  23. package/lib/commonjs/floatingMenu/MinimizedToolsStack.js +1 -288
  24. package/lib/commonjs/floatingMenu/MinimizedToolsStack.web.js +1 -371
  25. package/lib/commonjs/floatingMenu/ToggleStateManager.js +1 -36
  26. package/lib/commonjs/floatingMenu/ToolHost.js +1 -281
  27. package/lib/commonjs/floatingMenu/ToolOpenerBridge.js +1 -41
  28. package/lib/commonjs/floatingMenu/autoDiscoverPresets.js +1 -461
  29. package/lib/commonjs/floatingMenu/autoExternalSync.js +1 -434
  30. package/lib/commonjs/floatingMenu/defaultConfig.js +1 -167
  31. package/lib/commonjs/floatingMenu/deviceIdentity.js +1 -173
  32. package/lib/commonjs/floatingMenu/dial/DialDevTools.js +1 -904
  33. package/lib/commonjs/floatingMenu/dial/DialDevTools.web.js +1 -821
  34. package/lib/commonjs/floatingMenu/dial/DialHyperspace.js +1 -177
  35. package/lib/commonjs/floatingMenu/dial/DialIcon.js +1 -302
  36. package/lib/commonjs/floatingMenu/dial/DialPagination.js +1 -165
  37. package/lib/commonjs/floatingMenu/dial/DialSnow.js +1 -92
  38. package/lib/commonjs/floatingMenu/dial/OnboardingTooltip.js +1 -246
  39. package/lib/commonjs/floatingMenu/dial/OnboardingTooltip.web.js +2 -147
  40. package/lib/commonjs/floatingMenu/dial/dialUsageStore.js +1 -93
  41. package/lib/commonjs/floatingMenu/dial/onboardingConstants.js +1 -42
  42. package/lib/commonjs/floatingMenu/dial/onboardingConstants.web.js +1 -42
  43. package/lib/commonjs/floatingMenu/externalSyncGate.js +1 -49
  44. package/lib/commonjs/floatingMenu/floatingTools.js +1 -42
  45. package/lib/commonjs/floatingMenu/floatingTools.web.js +1 -30
  46. package/lib/commonjs/floatingMenu/optionalRequire.js +1 -37
  47. package/lib/commonjs/floatingMenu/settingsBus.js +1 -23
  48. package/lib/commonjs/floatingMenu/sync/appSyncAdapter.js +1 -115
  49. package/lib/commonjs/floatingMenu/types.js +1 -5
  50. package/lib/commonjs/floatingMenu/useDesktopSyncStatus.js +1 -28
  51. package/lib/commonjs/floatingMenu/useDesktopSyncStatus.web.js +1 -0
  52. package/lib/commonjs/index.js +1 -291
  53. package/lib/commonjs/index.web.js +1 -150
  54. package/lib/commonjs/reactDevtoolsTypes.js +1 -0
  55. package/lib/commonjs/releaseOptIn.js +1 -0
  56. package/lib/commonjs/telemetry/installPing.js +1 -131
  57. package/lib/commonjs/toolkit.js +1 -584
  58. package/lib/commonjs/toolkitComponents.js +1 -241
  59. package/lib/commonjs/utils/autoDiscoverPresets.web.js +1 -219
  60. package/lib/commonjs/utils/createWebTool.js +1 -0
  61. package/lib/commonjs/utils/createWebTools.js +1 -0
  62. package/lib/commonjs/version.js +1 -18
  63. package/lib/module/Buoy.js +1 -102
  64. package/lib/module/browserRegister.js +1 -0
  65. package/lib/module/browserRegister.server.js +1 -0
  66. package/lib/module/earlyHookScript.js +1 -0
  67. package/lib/module/earlyNetwork.js +1 -0
  68. package/lib/module/floatingMenu/AppHost.js +1 -452
  69. package/lib/module/floatingMenu/AppHost.web.js +1 -356
  70. package/lib/module/floatingMenu/AppHostLogic.js +1 -45
  71. package/lib/module/floatingMenu/AppIcon.js +1 -84
  72. package/lib/module/floatingMenu/AppIcon.web.js +1 -47
  73. package/lib/module/floatingMenu/BrowserToolRuntime.js +1 -0
  74. package/lib/module/floatingMenu/DefaultConfigContext.js +1 -39
  75. package/lib/module/floatingMenu/DevToolsSettingsModal.js +1 -1115
  76. package/lib/module/floatingMenu/DevToolsSettingsModal.shared.js +1 -0
  77. package/lib/module/floatingMenu/DevToolsSettingsModal.web.js +1 -1055
  78. package/lib/module/floatingMenu/DevToolsVisibilityContext.js +1 -44
  79. package/lib/module/floatingMenu/FloatingDevTools.js +1 -551
  80. package/lib/module/floatingMenu/FloatingDevTools.web.js +1 -399
  81. package/lib/module/floatingMenu/FloatingMenu.js +1 -366
  82. package/lib/module/floatingMenu/MinimizedToolsContext.js +1 -266
  83. package/lib/module/floatingMenu/MinimizedToolsStack.js +1 -285
  84. package/lib/module/floatingMenu/MinimizedToolsStack.web.js +1 -368
  85. package/lib/module/floatingMenu/ToggleStateManager.js +1 -32
  86. package/lib/module/floatingMenu/ToolHost.js +1 -273
  87. package/lib/module/floatingMenu/ToolOpenerBridge.js +1 -37
  88. package/lib/module/floatingMenu/autoDiscoverPresets.js +1 -457
  89. package/lib/module/floatingMenu/autoExternalSync.js +1 -427
  90. package/lib/module/floatingMenu/defaultConfig.js +1 -158
  91. package/lib/module/floatingMenu/deviceIdentity.js +1 -163
  92. package/lib/module/floatingMenu/dial/DialDevTools.js +1 -900
  93. package/lib/module/floatingMenu/dial/DialDevTools.web.js +1 -818
  94. package/lib/module/floatingMenu/dial/DialHyperspace.js +1 -173
  95. package/lib/module/floatingMenu/dial/DialIcon.js +1 -299
  96. package/lib/module/floatingMenu/dial/DialPagination.js +1 -160
  97. package/lib/module/floatingMenu/dial/DialSnow.js +1 -90
  98. package/lib/module/floatingMenu/dial/OnboardingTooltip.js +1 -240
  99. package/lib/module/floatingMenu/dial/OnboardingTooltip.web.js +2 -142
  100. package/lib/module/floatingMenu/dial/dialUsageStore.js +1 -85
  101. package/lib/module/floatingMenu/dial/onboardingConstants.js +1 -3
  102. package/lib/module/floatingMenu/dial/onboardingConstants.web.js +1 -3
  103. package/lib/module/floatingMenu/externalSyncGate.js +1 -44
  104. package/lib/module/floatingMenu/floatingTools.js +1 -27
  105. package/lib/module/floatingMenu/floatingTools.web.js +1 -3
  106. package/lib/module/floatingMenu/optionalRequire.js +1 -33
  107. package/lib/module/floatingMenu/settingsBus.js +1 -19
  108. package/lib/module/floatingMenu/sync/appSyncAdapter.js +1 -112
  109. package/lib/module/floatingMenu/types.js +1 -3
  110. package/lib/module/floatingMenu/useDesktopSyncStatus.js +1 -25
  111. package/lib/module/floatingMenu/useDesktopSyncStatus.web.js +1 -0
  112. package/lib/module/index.js +1 -41
  113. package/lib/module/index.web.js +1 -29
  114. package/lib/module/reactDevtoolsTypes.js +1 -0
  115. package/lib/module/releaseOptIn.js +1 -0
  116. package/lib/module/telemetry/installPing.js +1 -127
  117. package/lib/module/toolkit.js +1 -62
  118. package/lib/module/toolkitComponents.js +1 -230
  119. package/lib/module/utils/autoDiscoverPresets.web.js +1 -213
  120. package/lib/module/utils/createWebTool.js +1 -0
  121. package/lib/module/utils/createWebTools.js +1 -0
  122. package/lib/module/version.js +1 -14
  123. package/lib/typescript/commonjs/browserRegister.d.ts +13 -0
  124. package/lib/typescript/commonjs/browserRegister.server.d.ts +6 -0
  125. package/lib/typescript/commonjs/earlyHookScript.d.ts +12 -0
  126. package/lib/typescript/commonjs/earlyNetwork.d.ts +52 -0
  127. package/lib/typescript/commonjs/floatingMenu/AppHost.web.d.ts +3 -3
  128. package/lib/typescript/commonjs/floatingMenu/BrowserToolRuntime.d.ts +14 -0
  129. package/lib/typescript/commonjs/floatingMenu/DevToolsSettingsModal.d.ts +2 -67
  130. package/lib/typescript/commonjs/floatingMenu/DevToolsSettingsModal.shared.d.ts +71 -0
  131. package/lib/typescript/commonjs/floatingMenu/DevToolsSettingsModal.web.d.ts +3 -16
  132. package/lib/typescript/commonjs/floatingMenu/FloatingDevTools.web.d.ts +12 -6
  133. package/lib/typescript/commonjs/floatingMenu/defaultConfig.d.ts +1 -1
  134. package/lib/typescript/commonjs/floatingMenu/settingsBus.d.ts +1 -9
  135. package/lib/typescript/commonjs/floatingMenu/useDesktopSyncStatus.web.d.ts +3 -0
  136. package/lib/typescript/commonjs/index.web.d.ts +7 -0
  137. package/lib/typescript/commonjs/reactDevtoolsTypes.d.ts +8 -0
  138. package/lib/typescript/commonjs/releaseOptIn.d.ts +4 -0
  139. package/lib/typescript/commonjs/utils/autoDiscoverPresets.web.d.ts +3 -40
  140. package/lib/typescript/commonjs/utils/createWebTool.d.ts +6 -0
  141. package/lib/typescript/commonjs/utils/createWebTools.d.ts +4 -0
  142. package/lib/typescript/commonjs/version.d.ts +1 -1
  143. package/lib/typescript/module/browserRegister.d.ts +13 -0
  144. package/lib/typescript/module/browserRegister.server.d.ts +6 -0
  145. package/lib/typescript/module/earlyHookScript.d.ts +12 -0
  146. package/lib/typescript/module/earlyNetwork.d.ts +52 -0
  147. package/lib/typescript/module/floatingMenu/AppHost.web.d.ts +3 -3
  148. package/lib/typescript/module/floatingMenu/BrowserToolRuntime.d.ts +14 -0
  149. package/lib/typescript/module/floatingMenu/DevToolsSettingsModal.d.ts +2 -67
  150. package/lib/typescript/module/floatingMenu/DevToolsSettingsModal.shared.d.ts +71 -0
  151. package/lib/typescript/module/floatingMenu/DevToolsSettingsModal.web.d.ts +3 -16
  152. package/lib/typescript/module/floatingMenu/FloatingDevTools.web.d.ts +12 -6
  153. package/lib/typescript/module/floatingMenu/defaultConfig.d.ts +1 -1
  154. package/lib/typescript/module/floatingMenu/settingsBus.d.ts +1 -9
  155. package/lib/typescript/module/floatingMenu/useDesktopSyncStatus.web.d.ts +3 -0
  156. package/lib/typescript/module/index.web.d.ts +7 -0
  157. package/lib/typescript/module/reactDevtoolsTypes.d.ts +8 -0
  158. package/lib/typescript/module/releaseOptIn.d.ts +4 -0
  159. package/lib/typescript/module/utils/autoDiscoverPresets.web.d.ts +3 -40
  160. package/lib/typescript/module/utils/createWebTool.d.ts +6 -0
  161. package/lib/typescript/module/utils/createWebTools.d.ts +4 -0
  162. package/lib/typescript/module/version.d.ts +1 -1
  163. package/lib/web/chunks/chunk-5SGL6QL4.mjs +1 -0
  164. package/lib/web/chunks/chunk-FROELTJH.mjs +1 -0
  165. package/lib/web/chunks/chunk-QZDVCMCT.mjs +1 -0
  166. package/lib/web/chunks/chunk-R7RGRTY5.mjs +1 -0
  167. package/lib/web/index.mjs +10 -0
  168. package/lib/web/register-server.mjs +1 -0
  169. package/lib/web/register.mjs +1 -0
  170. package/lib/web/toolkit.mjs +1 -0
  171. package/package.json +50 -12
  172. package/lib/typescript/commonjs/Buoy.d.ts.map +0 -1
  173. package/lib/typescript/commonjs/floatingMenu/AppHost.d.ts.map +0 -1
  174. package/lib/typescript/commonjs/floatingMenu/AppHost.web.d.ts.map +0 -1
  175. package/lib/typescript/commonjs/floatingMenu/AppHostLogic.d.ts.map +0 -1
  176. package/lib/typescript/commonjs/floatingMenu/AppIcon.d.ts.map +0 -1
  177. package/lib/typescript/commonjs/floatingMenu/AppIcon.web.d.ts.map +0 -1
  178. package/lib/typescript/commonjs/floatingMenu/DefaultConfigContext.d.ts.map +0 -1
  179. package/lib/typescript/commonjs/floatingMenu/DevToolsSettingsModal.d.ts.map +0 -1
  180. package/lib/typescript/commonjs/floatingMenu/DevToolsSettingsModal.web.d.ts.map +0 -1
  181. package/lib/typescript/commonjs/floatingMenu/DevToolsVisibilityContext.d.ts.map +0 -1
  182. package/lib/typescript/commonjs/floatingMenu/FloatingDevTools.d.ts.map +0 -1
  183. package/lib/typescript/commonjs/floatingMenu/FloatingDevTools.web.d.ts.map +0 -1
  184. package/lib/typescript/commonjs/floatingMenu/FloatingMenu.d.ts.map +0 -1
  185. package/lib/typescript/commonjs/floatingMenu/MinimizedToolsContext.d.ts.map +0 -1
  186. package/lib/typescript/commonjs/floatingMenu/MinimizedToolsStack.d.ts.map +0 -1
  187. package/lib/typescript/commonjs/floatingMenu/MinimizedToolsStack.web.d.ts.map +0 -1
  188. package/lib/typescript/commonjs/floatingMenu/ToggleStateManager.d.ts.map +0 -1
  189. package/lib/typescript/commonjs/floatingMenu/ToolHost.d.ts.map +0 -1
  190. package/lib/typescript/commonjs/floatingMenu/ToolOpenerBridge.d.ts.map +0 -1
  191. package/lib/typescript/commonjs/floatingMenu/autoDiscoverPresets.d.ts.map +0 -1
  192. package/lib/typescript/commonjs/floatingMenu/autoExternalSync.d.ts.map +0 -1
  193. package/lib/typescript/commonjs/floatingMenu/defaultConfig.d.ts.map +0 -1
  194. package/lib/typescript/commonjs/floatingMenu/deviceIdentity.d.ts.map +0 -1
  195. package/lib/typescript/commonjs/floatingMenu/dial/DialDevTools.d.ts.map +0 -1
  196. package/lib/typescript/commonjs/floatingMenu/dial/DialDevTools.web.d.ts.map +0 -1
  197. package/lib/typescript/commonjs/floatingMenu/dial/DialHyperspace.d.ts.map +0 -1
  198. package/lib/typescript/commonjs/floatingMenu/dial/DialIcon.d.ts.map +0 -1
  199. package/lib/typescript/commonjs/floatingMenu/dial/DialPagination.d.ts.map +0 -1
  200. package/lib/typescript/commonjs/floatingMenu/dial/DialSnow.d.ts.map +0 -1
  201. package/lib/typescript/commonjs/floatingMenu/dial/OnboardingTooltip.d.ts.map +0 -1
  202. package/lib/typescript/commonjs/floatingMenu/dial/OnboardingTooltip.web.d.ts.map +0 -1
  203. package/lib/typescript/commonjs/floatingMenu/dial/dialUsageStore.d.ts.map +0 -1
  204. package/lib/typescript/commonjs/floatingMenu/dial/onboardingConstants.d.ts.map +0 -1
  205. package/lib/typescript/commonjs/floatingMenu/dial/onboardingConstants.web.d.ts.map +0 -1
  206. package/lib/typescript/commonjs/floatingMenu/externalSyncGate.d.ts.map +0 -1
  207. package/lib/typescript/commonjs/floatingMenu/floatingTools.d.ts.map +0 -1
  208. package/lib/typescript/commonjs/floatingMenu/floatingTools.web.d.ts.map +0 -1
  209. package/lib/typescript/commonjs/floatingMenu/optionalRequire.d.ts.map +0 -1
  210. package/lib/typescript/commonjs/floatingMenu/settingsBus.d.ts.map +0 -1
  211. package/lib/typescript/commonjs/floatingMenu/sync/appSyncAdapter.d.ts.map +0 -1
  212. package/lib/typescript/commonjs/floatingMenu/types.d.ts.map +0 -1
  213. package/lib/typescript/commonjs/floatingMenu/useDesktopSyncStatus.d.ts.map +0 -1
  214. package/lib/typescript/commonjs/index.d.ts.map +0 -1
  215. package/lib/typescript/commonjs/index.web.d.ts.map +0 -1
  216. package/lib/typescript/commonjs/telemetry/installPing.d.ts.map +0 -1
  217. package/lib/typescript/commonjs/toolkit.d.ts.map +0 -1
  218. package/lib/typescript/commonjs/toolkitComponents.d.ts.map +0 -1
  219. package/lib/typescript/commonjs/utils/autoDiscoverPresets.web.d.ts.map +0 -1
  220. package/lib/typescript/commonjs/version.d.ts.map +0 -1
  221. package/lib/typescript/module/Buoy.d.ts.map +0 -1
  222. package/lib/typescript/module/floatingMenu/AppHost.d.ts.map +0 -1
  223. package/lib/typescript/module/floatingMenu/AppHost.web.d.ts.map +0 -1
  224. package/lib/typescript/module/floatingMenu/AppHostLogic.d.ts.map +0 -1
  225. package/lib/typescript/module/floatingMenu/AppIcon.d.ts.map +0 -1
  226. package/lib/typescript/module/floatingMenu/AppIcon.web.d.ts.map +0 -1
  227. package/lib/typescript/module/floatingMenu/DefaultConfigContext.d.ts.map +0 -1
  228. package/lib/typescript/module/floatingMenu/DevToolsSettingsModal.d.ts.map +0 -1
  229. package/lib/typescript/module/floatingMenu/DevToolsSettingsModal.web.d.ts.map +0 -1
  230. package/lib/typescript/module/floatingMenu/DevToolsVisibilityContext.d.ts.map +0 -1
  231. package/lib/typescript/module/floatingMenu/FloatingDevTools.d.ts.map +0 -1
  232. package/lib/typescript/module/floatingMenu/FloatingDevTools.web.d.ts.map +0 -1
  233. package/lib/typescript/module/floatingMenu/FloatingMenu.d.ts.map +0 -1
  234. package/lib/typescript/module/floatingMenu/MinimizedToolsContext.d.ts.map +0 -1
  235. package/lib/typescript/module/floatingMenu/MinimizedToolsStack.d.ts.map +0 -1
  236. package/lib/typescript/module/floatingMenu/MinimizedToolsStack.web.d.ts.map +0 -1
  237. package/lib/typescript/module/floatingMenu/ToggleStateManager.d.ts.map +0 -1
  238. package/lib/typescript/module/floatingMenu/ToolHost.d.ts.map +0 -1
  239. package/lib/typescript/module/floatingMenu/ToolOpenerBridge.d.ts.map +0 -1
  240. package/lib/typescript/module/floatingMenu/autoDiscoverPresets.d.ts.map +0 -1
  241. package/lib/typescript/module/floatingMenu/autoExternalSync.d.ts.map +0 -1
  242. package/lib/typescript/module/floatingMenu/defaultConfig.d.ts.map +0 -1
  243. package/lib/typescript/module/floatingMenu/deviceIdentity.d.ts.map +0 -1
  244. package/lib/typescript/module/floatingMenu/dial/DialDevTools.d.ts.map +0 -1
  245. package/lib/typescript/module/floatingMenu/dial/DialDevTools.web.d.ts.map +0 -1
  246. package/lib/typescript/module/floatingMenu/dial/DialHyperspace.d.ts.map +0 -1
  247. package/lib/typescript/module/floatingMenu/dial/DialIcon.d.ts.map +0 -1
  248. package/lib/typescript/module/floatingMenu/dial/DialPagination.d.ts.map +0 -1
  249. package/lib/typescript/module/floatingMenu/dial/DialSnow.d.ts.map +0 -1
  250. package/lib/typescript/module/floatingMenu/dial/OnboardingTooltip.d.ts.map +0 -1
  251. package/lib/typescript/module/floatingMenu/dial/OnboardingTooltip.web.d.ts.map +0 -1
  252. package/lib/typescript/module/floatingMenu/dial/dialUsageStore.d.ts.map +0 -1
  253. package/lib/typescript/module/floatingMenu/dial/onboardingConstants.d.ts.map +0 -1
  254. package/lib/typescript/module/floatingMenu/dial/onboardingConstants.web.d.ts.map +0 -1
  255. package/lib/typescript/module/floatingMenu/externalSyncGate.d.ts.map +0 -1
  256. package/lib/typescript/module/floatingMenu/floatingTools.d.ts.map +0 -1
  257. package/lib/typescript/module/floatingMenu/floatingTools.web.d.ts.map +0 -1
  258. package/lib/typescript/module/floatingMenu/optionalRequire.d.ts.map +0 -1
  259. package/lib/typescript/module/floatingMenu/settingsBus.d.ts.map +0 -1
  260. package/lib/typescript/module/floatingMenu/sync/appSyncAdapter.d.ts.map +0 -1
  261. package/lib/typescript/module/floatingMenu/types.d.ts.map +0 -1
  262. package/lib/typescript/module/floatingMenu/useDesktopSyncStatus.d.ts.map +0 -1
  263. package/lib/typescript/module/index.d.ts.map +0 -1
  264. package/lib/typescript/module/index.web.d.ts.map +0 -1
  265. package/lib/typescript/module/telemetry/installPing.d.ts.map +0 -1
  266. package/lib/typescript/module/toolkit.d.ts.map +0 -1
  267. package/lib/typescript/module/toolkitComponents.d.ts.map +0 -1
  268. package/lib/typescript/module/utils/autoDiscoverPresets.web.d.ts.map +0 -1
  269. package/lib/typescript/module/version.d.ts.map +0 -1
@@ -1,32 +1 @@
1
- "use strict";
2
-
3
- /**
4
- * ToggleStateManager
5
- *
6
- * Global event emitter for toggle-only dev tools to notify when their state changes.
7
- * This allows FloatingMenu to re-render and update icon colors.
8
- */
9
-
10
- class ToggleStateManager {
11
- listeners = new Set();
12
-
13
- /**
14
- * Subscribe to any toggle state change
15
- */
16
- subscribe(listener) {
17
- this.listeners.add(listener);
18
- return () => {
19
- this.listeners.delete(listener);
20
- };
21
- }
22
-
23
- /**
24
- * Notify all subscribers that a toggle state changed
25
- */
26
- notify() {
27
- this.listeners.forEach(listener => listener());
28
- }
29
- }
30
-
31
- // Singleton instance
32
- export const toggleStateManager = new ToggleStateManager();
1
+ "use strict";class t{listeners=new Set;subscribe(e){this.listeners.add(e);return()=>{this.listeners.delete(e)}}notify(){this.listeners.forEach(e=>e())}}export const toggleStateManager=new t;
@@ -1,273 +1 @@
1
- "use strict";
2
-
3
- /**
4
- * ToolHost — the declarative chrome layer for custom tools.
5
- *
6
- * When an `InstalledApp` declares `modal: {...}`, the AppHost renders its
7
- * component inside `ToolModalShell` instead of raw: the shared JsModal
8
- * (drag/resize, floating⇄bottom-sheet, minimize, dimension persistence) plus
9
- * a managed header (title/subtitle, back navigation, search, actions) and a
10
- * lightweight toast layer. The tool body talks back to the shell through
11
- * `useToolHost()` / `useToolHeader()`.
12
- */
13
- import React, { createContext, useCallback, useContext, useEffect, useMemo, useRef, useState } from "react";
14
- import { Animated, StyleSheet, Text, View } from "react-native";
15
- import { JsModal, ModalHeader, HeaderSearchButton, TickProvider, devToolsStorageKeys, buoyColors, gameUIColors } from "@buoy-gg/shared-ui";
16
-
17
- /** Per-screen header overrides a tool body can apply (see `useToolHeader`). */
18
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
19
- const noop = () => {};
20
- const FALLBACK_CONTEXT = {
21
- search: "",
22
- isSearchActive: false,
23
- clearSearch: noop,
24
- close: noop,
25
- minimize: noop,
26
- showToast: noop,
27
- setHeaderOverride: noop
28
- };
29
- const ToolHostContext = /*#__PURE__*/createContext(null);
30
-
31
- /**
32
- * Access the hosting shell from a custom tool body: search query, toasts,
33
- * close. Safe to call outside the shell (returns inert no-ops) so tool
34
- * components can also be mounted standalone.
35
- */
36
- export function useToolHost() {
37
- return useContext(ToolHostContext) ?? FALLBACK_CONTEXT;
38
- }
39
-
40
- /**
41
- * Declare per-screen header state (title/subtitle/actions/back) from inside a
42
- * tool body. Applies while the calling component is mounted and reverts to
43
- * the preset's static config on unmount — so a detail screen simply mounts
44
- * with its own header and the list header returns when it unmounts.
45
- *
46
- * ```tsx
47
- * useToolHeader(
48
- * { title: flag.key, onBack: () => setScreen("list"), actions: <CopyButton value={flag} /> },
49
- * [flag.key]
50
- * );
51
- * ```
52
- */
53
- export function useToolHeader(override, deps) {
54
- const {
55
- setHeaderOverride
56
- } = useToolHost();
57
- useEffect(() => {
58
- setHeaderOverride(override);
59
- return () => setHeaderOverride(null);
60
- // Caller-provided deps intentionally control when the override refreshes.
61
- // eslint-disable-next-line react-hooks/exhaustive-deps
62
- }, deps);
63
- }
64
-
65
- // ---------------------------------------------------------------------------
66
- // Toast layer
67
- // ---------------------------------------------------------------------------
68
-
69
- const TOAST_DURATION_MS = 2200;
70
- const TOAST_COLORS = {
71
- success: gameUIColors.success,
72
- error: gameUIColors.error,
73
- info: gameUIColors.info
74
- };
75
- function ToastView({
76
- message,
77
- type,
78
- nonce
79
- }) {
80
- const opacity = useRef(new Animated.Value(0)).current;
81
- useEffect(() => {
82
- opacity.setValue(0);
83
- Animated.sequence([Animated.timing(opacity, {
84
- toValue: 1,
85
- duration: 150,
86
- useNativeDriver: true
87
- }), Animated.delay(TOAST_DURATION_MS - 450), Animated.timing(opacity, {
88
- toValue: 0,
89
- duration: 300,
90
- useNativeDriver: true
91
- })]).start();
92
- }, [nonce, opacity]);
93
- const color = TOAST_COLORS[type];
94
- return /*#__PURE__*/_jsxs(Animated.View, {
95
- pointerEvents: "none",
96
- style: [styles.toast, {
97
- opacity,
98
- borderColor: color + "60"
99
- }],
100
- children: [/*#__PURE__*/_jsx(View, {
101
- style: [styles.toastDot, {
102
- backgroundColor: color
103
- }]
104
- }), /*#__PURE__*/_jsx(Text, {
105
- style: styles.toastText,
106
- numberOfLines: 2,
107
- children: message
108
- })]
109
- });
110
- }
111
-
112
- // ---------------------------------------------------------------------------
113
- // Shell
114
- // ---------------------------------------------------------------------------
115
-
116
- export function ToolModalShell({
117
- app,
118
- config,
119
- visible,
120
- zIndex,
121
- onClose,
122
- onMinimize,
123
- initialModalState,
124
- enableSharedModalDimensions,
125
- bodyProps
126
- }) {
127
- const Body = app.component;
128
- const [isSearchActive, setIsSearchActive] = useState(false);
129
- const [search, setSearch] = useState("");
130
- const [headerOverride, setHeaderOverride] = useState(null);
131
- const [toast, setToast] = useState(null);
132
- const toastTimeoutRef = useRef(null);
133
- const clearSearch = useCallback(() => {
134
- setIsSearchActive(false);
135
- setSearch("");
136
- }, []);
137
- const showToast = useCallback((message, type = "info") => {
138
- if (toastTimeoutRef.current) clearTimeout(toastTimeoutRef.current);
139
- setToast(prev => ({
140
- message,
141
- type,
142
- nonce: (prev?.nonce ?? 0) + 1
143
- }));
144
- toastTimeoutRef.current = setTimeout(() => setToast(null), TOAST_DURATION_MS);
145
- }, []);
146
- useEffect(() => {
147
- return () => {
148
- if (toastTimeoutRef.current) clearTimeout(toastTimeoutRef.current);
149
- };
150
- }, []);
151
- const contextValue = useMemo(() => ({
152
- search: isSearchActive ? search : "",
153
- isSearchActive,
154
- clearSearch,
155
- close: onClose,
156
- // Bare call: JsModal persists its own dimensions, so restoring brings
157
- // the tool back the size the user last left it.
158
- minimize: () => onMinimize(),
159
- showToast,
160
- setHeaderOverride,
161
- instanceId: app.instanceId
162
- }), [search, isSearchActive, clearSearch, onClose, onMinimize, showToast, app.instanceId]);
163
- const title = headerOverride?.title ?? config.title ?? app.title ?? app.id;
164
- const subtitle = headerOverride?.subtitle ?? config.subtitle;
165
- const onBack = headerOverride?.onBack;
166
- const actions = headerOverride?.actions ?? config.headerActions;
167
- const searchable = headerOverride?.searchable ?? config.searchable;
168
-
169
- // A screen that hides search while it's open would strand the input with
170
- // no way to dismiss it — close it on entry instead.
171
- useEffect(() => {
172
- if (!searchable && isSearchActive) clearSearch();
173
- }, [searchable, isSearchActive, clearSearch]);
174
-
175
- // Tool-scoped persistence via the custom namespace unless the user has the
176
- // shared-dimensions global setting on (all tools share one window size).
177
- const persistenceKey = enableSharedModalDimensions ? devToolsStorageKeys.modal.root() : devToolsStorageKeys.custom(app.id).modal();
178
- const header = /*#__PURE__*/_jsxs(ModalHeader, {
179
- children: [onBack && !isSearchActive && /*#__PURE__*/_jsx(ModalHeader.Navigation, {
180
- onBack: onBack
181
- }), isSearchActive ? /*#__PURE__*/_jsx(ModalHeader.Search, {
182
- value: search,
183
- onChangeText: setSearch,
184
- onCancel: clearSearch,
185
- placeholder: config.searchPlaceholder,
186
- testID: `tool-search-field-${app.id}`
187
- }) : /*#__PURE__*/_jsx(ModalHeader.Content, {
188
- title: title,
189
- subtitle: subtitle
190
- }), /*#__PURE__*/_jsxs(ModalHeader.Actions, {
191
- children: [!isSearchActive && actions, searchable && !isSearchActive && /*#__PURE__*/_jsx(HeaderSearchButton, {
192
- variant: "chip",
193
- testID: `tool-search-${app.id}`,
194
- onPress: () => setIsSearchActive(true)
195
- })]
196
- })]
197
- });
198
- return /*#__PURE__*/_jsx(ToolHostContext.Provider, {
199
- value: contextValue,
200
- children: /*#__PURE__*/_jsx(JsModal, {
201
- visible: visible,
202
- onClose: onClose,
203
- onBack: onBack,
204
- onMinimize: onMinimize,
205
- initialModalState: initialModalState,
206
- zIndex: zIndex,
207
- persistenceKey: persistenceKey,
208
- enablePersistence: true,
209
- initialMode: config.initialMode ?? "bottomSheet",
210
- header: {
211
- customContent: header,
212
- showToggleButton: true
213
- }
214
- // Tool bodies own their scrolling (ScrollView/FlatList) — the shell
215
- // must not add a competing wrapper.
216
- ,
217
- disableScrollWrapper: true,
218
- styles: {},
219
- children: /*#__PURE__*/_jsxs(View, {
220
- style: styles.bodyRoot,
221
- children: [/*#__PURE__*/_jsx(TickProvider, {
222
- children: /*#__PURE__*/_jsx(Body, {
223
- ...bodyProps
224
- })
225
- }), toast && /*#__PURE__*/_jsx(ToastView, {
226
- message: toast.message,
227
- type: toast.type,
228
- nonce: toast.nonce
229
- })]
230
- })
231
- })
232
- });
233
- }
234
- const styles = StyleSheet.create({
235
- bodyRoot: {
236
- flex: 1,
237
- minHeight: 0,
238
- // Transparent so JsModal's ToolBackground shows through (the modal paints opaque base beneath it).
239
- backgroundColor: "transparent"
240
- },
241
- toast: {
242
- position: "absolute",
243
- bottom: 16,
244
- alignSelf: "center",
245
- flexDirection: "row",
246
- alignItems: "center",
247
- gap: 8,
248
- maxWidth: "86%",
249
- backgroundColor: buoyColors.card,
250
- borderWidth: 1,
251
- borderRadius: 8,
252
- paddingHorizontal: 12,
253
- paddingVertical: 8,
254
- shadowColor: "#000",
255
- shadowOpacity: 0.4,
256
- shadowRadius: 8,
257
- shadowOffset: {
258
- width: 0,
259
- height: 2
260
- },
261
- elevation: 6
262
- },
263
- toastDot: {
264
- width: 6,
265
- height: 6,
266
- borderRadius: 3
267
- },
268
- toastText: {
269
- flex: 1,
270
- fontSize: 12,
271
- color: buoyColors.text
272
- }
273
- });
1
+ "use strict";import ae,{createContext as J,useCallback as H,useContext as X,useEffect as T,useMemo as G,useRef as I,useState as b}from"react";import{Animated as i,StyleSheet as Q,Text as Y,View as R}from"react-native";import{JsModal as Z,ModalHeader as u,HeaderSearchButton as ee,TickProvider as te,devToolsStorageKeys as k,buoyColors as V,gameUIColors as g}from"@buoy-gg/shared-ui";import{jsx as t,jsxs as f}from"react/jsx-runtime";const h=()=>{};const oe={search:"",isSearchActive:false,clearSearch:h,close:h,minimize:h,showToast:h,setHeaderOverride:h};const B=J(null);export function useToolHost(){return X(B)??oe}export function useToolHeader(e,o){const{setHeaderOverride:n}=useToolHost();T(()=>{n(e);return()=>n(null)},o)}const D=2200;const se={success:g.success,error:g.error,info:g.info};function re({message:e,type:o,nonce:n}){const r=I(new i.Value(0)).current;T(()=>{r.setValue(0);i.sequence([i.timing(r,{toValue:1,duration:150,useNativeDriver:true}),i.delay(D-450),i.timing(r,{toValue:0,duration:300,useNativeDriver:true})]).start()},[n,r]);const a=se[o];return f(i.View,{pointerEvents:"none",style:[S.toast,{opacity:r,borderColor:a+"60"}],children:[t(R,{style:[S.toastDot,{backgroundColor:a}]}),t(Y,{style:S.toastText,numberOfLines:2,children:e})]})}export function ToolModalShell({app:e,config:o,visible:n,zIndex:r,onClose:a,onMinimize:v,initialModalState:M,enableSharedModalDimensions:_,bodyProps:N}){const P=e.component;const[s,w]=b(false);const[x,O]=b("");const[c,j]=b(null);const[m,p]=b(null);const l=I(null);const d=H(()=>{w(false);O("")},[]);const A=H(($,q="info")=>{if(l.current)clearTimeout(l.current);p(F=>({message:$,type:q,nonce:(F?.nonce??0)+1}));l.current=setTimeout(()=>p(null),D)},[]);T(()=>{return()=>{if(l.current)clearTimeout(l.current)}},[]);const z=G(()=>({search:s?x:"",isSearchActive:s,clearSearch:d,close:a,minimize:()=>v(),showToast:A,setHeaderOverride:j,instanceId:e.instanceId}),[x,s,d,a,v,A,e.instanceId]);const K=c?.title??o.title??e.title??e.id;const L=c?.subtitle??o.subtitle;const y=c?.onBack;const E=c?.actions??o.headerActions;const C=c?.searchable??o.searchable;T(()=>{if(!C&&s)d()},[C,s,d]);const W=_?k.modal.root():k.custom(e.id).modal();const U=f(u,{children:[y&&!s&&t(u.Navigation,{onBack:y}),s?t(u.Search,{value:x,onChangeText:O,onCancel:d,placeholder:o.searchPlaceholder,testID:`tool-search-field-${e.id}`}):t(u.Content,{title:K,subtitle:L}),f(u.Actions,{children:[!s&&E,C&&!s&&t(ee,{variant:"chip",testID:`tool-search-${e.id}`,onPress:()=>w(true)})]})]});return t(B.Provider,{value:z,children:t(Z,{visible:n,onClose:a,onBack:y,onMinimize:v,initialModalState:M,zIndex:r,persistenceKey:W,enablePersistence:true,initialMode:o.initialMode??"bottomSheet",header:{customContent:U,showToggleButton:true},disableScrollWrapper:true,styles:{},children:f(R,{style:S.bodyRoot,children:[t(te,{children:t(P,{...N})}),m&&t(re,{message:m.message,type:m.type,nonce:m.nonce})]})})})}const S=Q.create({bodyRoot:{flex:1,minHeight:0,backgroundColor:"transparent"},toast:{position:"absolute",bottom:16,alignSelf:"center",flexDirection:"row",alignItems:"center",gap:8,maxWidth:"86%",backgroundColor:V.card,borderWidth:1,borderRadius:8,paddingHorizontal:12,paddingVertical:8,shadowColor:"#000",shadowOpacity:.4,shadowRadius:8,shadowOffset:{width:0,height:2},elevation:6},toastDot:{width:6,height:6,borderRadius:3},toastText:{flex:1,fontSize:12,color:V.text}});
@@ -1,37 +1 @@
1
- "use strict";
2
-
3
- /**
4
- * ToolOpenerBridge — publishes "bring a tool back on screen" to the overlays.
5
- *
6
- * Renders nothing. It exists only to sit INSIDE `AppHostProvider` (where the
7
- * open-tool state lives) and hand that capability out through the global seam
8
- * in `@buoy-gg/shared-ui`, so an overlay rendered as a sibling of the provider
9
- * can still offer a button that opens a tool. See `toolUiBridge.ts` for why the
10
- * overlays can't just be moved inside the provider.
11
- *
12
- * It only RESTORES a tool that is already open — including one that has been
13
- * minimized, which is the case that matters (the macro recorder minimizes
14
- * Scenarios so the tester can drive the app, then needs it back). It
15
- * deliberately does not construct and open a tool from scratch: an opener that
16
- * guesses at an instance is a worse failure than reporting that it couldn't,
17
- * and every caller already has to handle `false`.
18
- */
19
-
20
- import { useEffect } from "react";
21
- import { registerToolOpener } from "@buoy-gg/shared-ui";
22
- import { useAppHost } from "./AppHost";
23
- export function ToolOpenerBridge() {
24
- const {
25
- openApps,
26
- restore
27
- } = useAppHost();
28
- useEffect(() => {
29
- return registerToolOpener(toolId => {
30
- const instance = openApps.find(app => app.id === toolId);
31
- if (!instance) return false;
32
- restore(instance.instanceId);
33
- return true;
34
- });
35
- }, [openApps, restore]);
36
- return null;
37
- }
1
+ "use strict";import{useEffect as s}from"react";import{registerToolOpener as i}from"@buoy-gg/shared-ui";import{useAppHost as p}from"./AppHost";export function ToolOpenerBridge(){const{openApps:r,restore:e}=p();s(()=>{return i(n=>{const t=r.find(o=>o.id===n);if(!t)return false;e(t.instanceId);return true})},[r,e]);return null}