@buoy-gg/core 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 (270) hide show
  1. package/README.md +14 -95
  2. package/bin/buoy.js +19 -340
  3. package/lib/commonjs/Buoy.js +1 -107
  4. package/lib/commonjs/browserRegister.js +1 -48
  5. package/lib/commonjs/browserRegister.server.js +1 -10
  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 -376
  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 -150
  14. package/lib/commonjs/floatingMenu/DefaultConfigContext.js +1 -45
  15. package/lib/commonjs/floatingMenu/DevToolsSettingsModal.js +1 -18
  16. package/lib/commonjs/floatingMenu/DevToolsSettingsModal.shared.js +1 -1114
  17. package/lib/commonjs/floatingMenu/DevToolsSettingsModal.web.js +1 -48
  18. package/lib/commonjs/floatingMenu/DevToolsVisibilityContext.js +1 -49
  19. package/lib/commonjs/floatingMenu/FloatingDevTools.js +1 -559
  20. package/lib/commonjs/floatingMenu/FloatingDevTools.web.js +1 -415
  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 -377
  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 -471
  29. package/lib/commonjs/floatingMenu/autoExternalSync.js +1 -443
  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 -895
  34. package/lib/commonjs/floatingMenu/dial/DialHyperspace.js +1 -177
  35. package/lib/commonjs/floatingMenu/dial/DialIcon.js +1 -304
  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 -12
  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 -14
  52. package/lib/commonjs/index.js +1 -291
  53. package/lib/commonjs/index.web.js +1 -241
  54. package/lib/commonjs/reactDevtoolsTypes.js +1 -1
  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 -46
  60. package/lib/commonjs/utils/createWebTool.js +1 -20
  61. package/lib/commonjs/utils/createWebTools.js +1 -30
  62. package/lib/commonjs/version.js +1 -18
  63. package/lib/module/Buoy.js +1 -102
  64. package/lib/module/browserRegister.js +1 -44
  65. package/lib/module/browserRegister.server.js +1 -6
  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 -368
  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 -146
  74. package/lib/module/floatingMenu/DefaultConfigContext.js +1 -39
  75. package/lib/module/floatingMenu/DevToolsSettingsModal.js +1 -3
  76. package/lib/module/floatingMenu/DevToolsSettingsModal.shared.js +1 -1110
  77. package/lib/module/floatingMenu/DevToolsSettingsModal.web.js +1 -44
  78. package/lib/module/floatingMenu/DevToolsVisibilityContext.js +1 -44
  79. package/lib/module/floatingMenu/FloatingDevTools.js +1 -556
  80. package/lib/module/floatingMenu/FloatingDevTools.web.js +1 -412
  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 -374
  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 -467
  89. package/lib/module/floatingMenu/autoExternalSync.js +1 -436
  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 -891
  94. package/lib/module/floatingMenu/dial/DialHyperspace.js +1 -173
  95. package/lib/module/floatingMenu/dial/DialIcon.js +1 -301
  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 -3
  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 -10
  112. package/lib/module/index.js +1 -41
  113. package/lib/module/index.web.js +1 -36
  114. package/lib/module/reactDevtoolsTypes.js +1 -1
  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 -38
  120. package/lib/module/utils/createWebTool.js +1 -17
  121. package/lib/module/utils/createWebTools.js +1 -25
  122. package/lib/module/version.js +1 -14
  123. package/lib/typescript/commonjs/browserRegister.d.ts +9 -1
  124. package/lib/typescript/commonjs/browserRegister.server.d.ts +1 -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/defaultConfig.d.ts +1 -1
  128. package/lib/typescript/commonjs/index.web.d.ts +1 -0
  129. package/lib/typescript/commonjs/releaseOptIn.d.ts +4 -0
  130. package/lib/typescript/commonjs/version.d.ts +1 -1
  131. package/lib/typescript/module/browserRegister.d.ts +9 -1
  132. package/lib/typescript/module/browserRegister.server.d.ts +1 -0
  133. package/lib/typescript/module/earlyHookScript.d.ts +12 -0
  134. package/lib/typescript/module/earlyNetwork.d.ts +52 -0
  135. package/lib/typescript/module/floatingMenu/defaultConfig.d.ts +1 -1
  136. package/lib/typescript/module/index.web.d.ts +1 -0
  137. package/lib/typescript/module/releaseOptIn.d.ts +4 -0
  138. package/lib/typescript/module/version.d.ts +1 -1
  139. package/lib/web/chunks/chunk-5SGL6QL4.mjs +1 -0
  140. package/lib/web/chunks/chunk-FROELTJH.mjs +1 -0
  141. package/lib/web/chunks/chunk-QZDVCMCT.mjs +1 -2
  142. package/lib/web/chunks/chunk-R7RGRTY5.mjs +1 -2
  143. package/lib/web/index.mjs +2 -3
  144. package/lib/web/register-server.mjs +1 -2
  145. package/lib/web/register.mjs +1 -2
  146. package/lib/web/toolkit.mjs +1 -2
  147. package/package.json +5 -5
  148. package/lib/typescript/commonjs/Buoy.d.ts.map +0 -1
  149. package/lib/typescript/commonjs/browserRegister.d.ts.map +0 -1
  150. package/lib/typescript/commonjs/browserRegister.server.d.ts.map +0 -1
  151. package/lib/typescript/commonjs/floatingMenu/AppHost.d.ts.map +0 -1
  152. package/lib/typescript/commonjs/floatingMenu/AppHost.web.d.ts.map +0 -1
  153. package/lib/typescript/commonjs/floatingMenu/AppHostLogic.d.ts.map +0 -1
  154. package/lib/typescript/commonjs/floatingMenu/AppIcon.d.ts.map +0 -1
  155. package/lib/typescript/commonjs/floatingMenu/AppIcon.web.d.ts.map +0 -1
  156. package/lib/typescript/commonjs/floatingMenu/BrowserToolRuntime.d.ts.map +0 -1
  157. package/lib/typescript/commonjs/floatingMenu/DefaultConfigContext.d.ts.map +0 -1
  158. package/lib/typescript/commonjs/floatingMenu/DevToolsSettingsModal.d.ts.map +0 -1
  159. package/lib/typescript/commonjs/floatingMenu/DevToolsSettingsModal.shared.d.ts.map +0 -1
  160. package/lib/typescript/commonjs/floatingMenu/DevToolsSettingsModal.web.d.ts.map +0 -1
  161. package/lib/typescript/commonjs/floatingMenu/DevToolsVisibilityContext.d.ts.map +0 -1
  162. package/lib/typescript/commonjs/floatingMenu/FloatingDevTools.d.ts.map +0 -1
  163. package/lib/typescript/commonjs/floatingMenu/FloatingDevTools.web.d.ts.map +0 -1
  164. package/lib/typescript/commonjs/floatingMenu/FloatingMenu.d.ts.map +0 -1
  165. package/lib/typescript/commonjs/floatingMenu/MinimizedToolsContext.d.ts.map +0 -1
  166. package/lib/typescript/commonjs/floatingMenu/MinimizedToolsStack.d.ts.map +0 -1
  167. package/lib/typescript/commonjs/floatingMenu/MinimizedToolsStack.web.d.ts.map +0 -1
  168. package/lib/typescript/commonjs/floatingMenu/ToggleStateManager.d.ts.map +0 -1
  169. package/lib/typescript/commonjs/floatingMenu/ToolHost.d.ts.map +0 -1
  170. package/lib/typescript/commonjs/floatingMenu/ToolOpenerBridge.d.ts.map +0 -1
  171. package/lib/typescript/commonjs/floatingMenu/autoDiscoverPresets.d.ts.map +0 -1
  172. package/lib/typescript/commonjs/floatingMenu/autoExternalSync.d.ts.map +0 -1
  173. package/lib/typescript/commonjs/floatingMenu/defaultConfig.d.ts.map +0 -1
  174. package/lib/typescript/commonjs/floatingMenu/deviceIdentity.d.ts.map +0 -1
  175. package/lib/typescript/commonjs/floatingMenu/dial/DialDevTools.d.ts.map +0 -1
  176. package/lib/typescript/commonjs/floatingMenu/dial/DialDevTools.web.d.ts.map +0 -1
  177. package/lib/typescript/commonjs/floatingMenu/dial/DialHyperspace.d.ts.map +0 -1
  178. package/lib/typescript/commonjs/floatingMenu/dial/DialIcon.d.ts.map +0 -1
  179. package/lib/typescript/commonjs/floatingMenu/dial/DialPagination.d.ts.map +0 -1
  180. package/lib/typescript/commonjs/floatingMenu/dial/DialSnow.d.ts.map +0 -1
  181. package/lib/typescript/commonjs/floatingMenu/dial/OnboardingTooltip.d.ts.map +0 -1
  182. package/lib/typescript/commonjs/floatingMenu/dial/OnboardingTooltip.web.d.ts.map +0 -1
  183. package/lib/typescript/commonjs/floatingMenu/dial/dialUsageStore.d.ts.map +0 -1
  184. package/lib/typescript/commonjs/floatingMenu/dial/onboardingConstants.d.ts.map +0 -1
  185. package/lib/typescript/commonjs/floatingMenu/dial/onboardingConstants.web.d.ts.map +0 -1
  186. package/lib/typescript/commonjs/floatingMenu/externalSyncGate.d.ts.map +0 -1
  187. package/lib/typescript/commonjs/floatingMenu/floatingTools.d.ts.map +0 -1
  188. package/lib/typescript/commonjs/floatingMenu/floatingTools.web.d.ts.map +0 -1
  189. package/lib/typescript/commonjs/floatingMenu/optionalRequire.d.ts.map +0 -1
  190. package/lib/typescript/commonjs/floatingMenu/settingsBus.d.ts.map +0 -1
  191. package/lib/typescript/commonjs/floatingMenu/sync/appSyncAdapter.d.ts.map +0 -1
  192. package/lib/typescript/commonjs/floatingMenu/types.d.ts.map +0 -1
  193. package/lib/typescript/commonjs/floatingMenu/useDesktopSyncStatus.d.ts.map +0 -1
  194. package/lib/typescript/commonjs/floatingMenu/useDesktopSyncStatus.web.d.ts.map +0 -1
  195. package/lib/typescript/commonjs/index.d.ts.map +0 -1
  196. package/lib/typescript/commonjs/index.web.d.ts.map +0 -1
  197. package/lib/typescript/commonjs/reactDevtoolsTypes.d.ts.map +0 -1
  198. package/lib/typescript/commonjs/telemetry/installPing.d.ts.map +0 -1
  199. package/lib/typescript/commonjs/toolkit.d.ts.map +0 -1
  200. package/lib/typescript/commonjs/toolkitComponents.d.ts.map +0 -1
  201. package/lib/typescript/commonjs/utils/autoDiscoverPresets.web.d.ts.map +0 -1
  202. package/lib/typescript/commonjs/utils/createWebTool.d.ts.map +0 -1
  203. package/lib/typescript/commonjs/utils/createWebTools.d.ts.map +0 -1
  204. package/lib/typescript/commonjs/version.d.ts.map +0 -1
  205. package/lib/typescript/module/Buoy.d.ts.map +0 -1
  206. package/lib/typescript/module/browserRegister.d.ts.map +0 -1
  207. package/lib/typescript/module/browserRegister.server.d.ts.map +0 -1
  208. package/lib/typescript/module/floatingMenu/AppHost.d.ts.map +0 -1
  209. package/lib/typescript/module/floatingMenu/AppHost.web.d.ts.map +0 -1
  210. package/lib/typescript/module/floatingMenu/AppHostLogic.d.ts.map +0 -1
  211. package/lib/typescript/module/floatingMenu/AppIcon.d.ts.map +0 -1
  212. package/lib/typescript/module/floatingMenu/AppIcon.web.d.ts.map +0 -1
  213. package/lib/typescript/module/floatingMenu/BrowserToolRuntime.d.ts.map +0 -1
  214. package/lib/typescript/module/floatingMenu/DefaultConfigContext.d.ts.map +0 -1
  215. package/lib/typescript/module/floatingMenu/DevToolsSettingsModal.d.ts.map +0 -1
  216. package/lib/typescript/module/floatingMenu/DevToolsSettingsModal.shared.d.ts.map +0 -1
  217. package/lib/typescript/module/floatingMenu/DevToolsSettingsModal.web.d.ts.map +0 -1
  218. package/lib/typescript/module/floatingMenu/DevToolsVisibilityContext.d.ts.map +0 -1
  219. package/lib/typescript/module/floatingMenu/FloatingDevTools.d.ts.map +0 -1
  220. package/lib/typescript/module/floatingMenu/FloatingDevTools.web.d.ts.map +0 -1
  221. package/lib/typescript/module/floatingMenu/FloatingMenu.d.ts.map +0 -1
  222. package/lib/typescript/module/floatingMenu/MinimizedToolsContext.d.ts.map +0 -1
  223. package/lib/typescript/module/floatingMenu/MinimizedToolsStack.d.ts.map +0 -1
  224. package/lib/typescript/module/floatingMenu/MinimizedToolsStack.web.d.ts.map +0 -1
  225. package/lib/typescript/module/floatingMenu/ToggleStateManager.d.ts.map +0 -1
  226. package/lib/typescript/module/floatingMenu/ToolHost.d.ts.map +0 -1
  227. package/lib/typescript/module/floatingMenu/ToolOpenerBridge.d.ts.map +0 -1
  228. package/lib/typescript/module/floatingMenu/autoDiscoverPresets.d.ts.map +0 -1
  229. package/lib/typescript/module/floatingMenu/autoExternalSync.d.ts.map +0 -1
  230. package/lib/typescript/module/floatingMenu/defaultConfig.d.ts.map +0 -1
  231. package/lib/typescript/module/floatingMenu/deviceIdentity.d.ts.map +0 -1
  232. package/lib/typescript/module/floatingMenu/dial/DialDevTools.d.ts.map +0 -1
  233. package/lib/typescript/module/floatingMenu/dial/DialDevTools.web.d.ts.map +0 -1
  234. package/lib/typescript/module/floatingMenu/dial/DialHyperspace.d.ts.map +0 -1
  235. package/lib/typescript/module/floatingMenu/dial/DialIcon.d.ts.map +0 -1
  236. package/lib/typescript/module/floatingMenu/dial/DialPagination.d.ts.map +0 -1
  237. package/lib/typescript/module/floatingMenu/dial/DialSnow.d.ts.map +0 -1
  238. package/lib/typescript/module/floatingMenu/dial/OnboardingTooltip.d.ts.map +0 -1
  239. package/lib/typescript/module/floatingMenu/dial/OnboardingTooltip.web.d.ts.map +0 -1
  240. package/lib/typescript/module/floatingMenu/dial/dialUsageStore.d.ts.map +0 -1
  241. package/lib/typescript/module/floatingMenu/dial/onboardingConstants.d.ts.map +0 -1
  242. package/lib/typescript/module/floatingMenu/dial/onboardingConstants.web.d.ts.map +0 -1
  243. package/lib/typescript/module/floatingMenu/externalSyncGate.d.ts.map +0 -1
  244. package/lib/typescript/module/floatingMenu/floatingTools.d.ts.map +0 -1
  245. package/lib/typescript/module/floatingMenu/floatingTools.web.d.ts.map +0 -1
  246. package/lib/typescript/module/floatingMenu/optionalRequire.d.ts.map +0 -1
  247. package/lib/typescript/module/floatingMenu/settingsBus.d.ts.map +0 -1
  248. package/lib/typescript/module/floatingMenu/sync/appSyncAdapter.d.ts.map +0 -1
  249. package/lib/typescript/module/floatingMenu/types.d.ts.map +0 -1
  250. package/lib/typescript/module/floatingMenu/useDesktopSyncStatus.d.ts.map +0 -1
  251. package/lib/typescript/module/floatingMenu/useDesktopSyncStatus.web.d.ts.map +0 -1
  252. package/lib/typescript/module/index.d.ts.map +0 -1
  253. package/lib/typescript/module/index.web.d.ts.map +0 -1
  254. package/lib/typescript/module/reactDevtoolsTypes.d.ts.map +0 -1
  255. package/lib/typescript/module/telemetry/installPing.d.ts.map +0 -1
  256. package/lib/typescript/module/toolkit.d.ts.map +0 -1
  257. package/lib/typescript/module/toolkitComponents.d.ts.map +0 -1
  258. package/lib/typescript/module/utils/autoDiscoverPresets.web.d.ts.map +0 -1
  259. package/lib/typescript/module/utils/createWebTool.d.ts.map +0 -1
  260. package/lib/typescript/module/utils/createWebTools.d.ts.map +0 -1
  261. package/lib/typescript/module/version.d.ts.map +0 -1
  262. package/lib/web/chunks/chunk-5NZOQR6Q.mjs +0 -2
  263. package/lib/web/chunks/chunk-CGDSLLZF.mjs +0 -2
  264. package/lib/web/chunks/chunk-DCJDUSNR.mjs +0 -2
  265. package/lib/web/chunks/chunk-IDSHFS6G.mjs +0 -2
  266. package/lib/web/chunks/chunk-JOAMJGCS.mjs +0 -2
  267. package/lib/web/chunks/chunk-KYKZ2N52.mjs +0 -2
  268. package/lib/web/chunks/chunk-NGM7JGGS.mjs +0 -2
  269. package/lib/web/chunks/chunk-Z3XWDDIO.mjs +0 -2
  270. package/lib/web/chunks/chunk-ZTGQ6TTY.mjs +0 -2
@@ -1,285 +1 @@
1
- "use strict";
2
-
3
- import React, { useCallback, useEffect, useRef, useSyncExternalStore } from "react";
4
- import { Animated, TouchableOpacity, View, Text, StyleSheet, Easing } from "react-native";
5
- import { ExpandablePopover, getToolAttention, subscribeToolAttention } from "@buoy-gg/shared-ui";
6
- import { useMinimizedTools } from "./MinimizedToolsContext.js";
7
-
8
- /**
9
- * A hidden tool's "I need you". See `setToolAttention` in shared-ui — the tool
10
- * publishes, the rail draws. Read through useSyncExternalStore so a badge set
11
- * from inside a minimized sheet lands on the chip without the rail polling.
12
- */
13
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
14
- function useToolAttention(toolId) {
15
- return useSyncExternalStore(subscribeToolAttention, () => getToolAttention(toolId), () => getToolAttention(toolId));
16
- }
17
- const ATTENTION_COLORS = {
18
- needsInput: "#FF8329",
19
- done: "#20C997",
20
- failed: "#FF3B30"
21
- };
22
-
23
- /** needsInput outranks failed outranks done — the peek shows the one that matters most. */
24
- const ATTENTION_RANK = {
25
- needsInput: 3,
26
- failed: 2,
27
- done: 1
28
- };
29
-
30
- /** The strongest attention across every minimized tool, for the folded peek. */
31
- function useStrongestAttention(toolIds) {
32
- const key = toolIds.join("|");
33
- return useSyncExternalStore(subscribeToolAttention, () => strongest(key), () => strongest(key));
34
- }
35
- const strongestCache = new Map();
36
- function strongest(key) {
37
- let best = null;
38
- for (const id of key ? key.split("|") : []) {
39
- const a = getToolAttention(id);
40
- if (a && (!best || ATTENTION_RANK[a.kind] > ATTENTION_RANK[best.kind])) best = a;
41
- }
42
- // Same value → same object, or useSyncExternalStore re-renders forever.
43
- const prev = strongestCache.get(key);
44
- if (prev && best && prev.kind === best.kind && prev.label === best.label) return prev;
45
- if (!prev && !best) return null;
46
- strongestCache.set(key, best);
47
- return best;
48
- }
49
-
50
- // ============================================================================
51
- // Constants
52
- // ============================================================================
53
-
54
- const PEEK_HEIGHT = 28;
55
- const TOOLBAR_WIDTH = 44;
56
- const TOOL_ITEM_SIZE = 32;
57
- const ICON_GAP = 6;
58
- const TOOLBAR_PADDING = 8;
59
- const COLLAPSE_BUTTON_SIZE = 24;
60
- const STORAGE_KEY_EXPANDED = "@react_buoy_minimized_stack_expanded";
61
-
62
- // Glitch effect constants
63
- const GLITCH_DURATION_MS = 80;
64
- const MIN_GLITCH_DELAY = 2000;
65
- const MAX_GLITCH_DELAY = 6000;
66
-
67
- // ============================================================================
68
- // Glitch Tool Button Component
69
- // ============================================================================
70
-
71
- function GlitchToolButton({
72
- tool,
73
- onSelect,
74
- index
75
- }) {
76
- const attention = useToolAttention(tool.id);
77
- const glitchX = useRef(new Animated.Value(0)).current;
78
- const glitchOpacity = useRef(new Animated.Value(1)).current;
79
- const glitchScale = useRef(new Animated.Value(1)).current;
80
- useEffect(() => {
81
- let isMounted = true;
82
- const runGlitch = () => {
83
- if (!isMounted) return;
84
- const d = GLITCH_DURATION_MS;
85
- Animated.parallel([
86
- // X displacement - quick shake
87
- Animated.sequence([Animated.timing(glitchX, {
88
- toValue: 3,
89
- duration: d * 0.2,
90
- easing: Easing.linear,
91
- useNativeDriver: true
92
- }), Animated.timing(glitchX, {
93
- toValue: -3,
94
- duration: d * 0.2,
95
- easing: Easing.linear,
96
- useNativeDriver: true
97
- }), Animated.timing(glitchX, {
98
- toValue: 2,
99
- duration: d * 0.2,
100
- easing: Easing.linear,
101
- useNativeDriver: true
102
- }), Animated.timing(glitchX, {
103
- toValue: -1,
104
- duration: d * 0.2,
105
- easing: Easing.linear,
106
- useNativeDriver: true
107
- }), Animated.timing(glitchX, {
108
- toValue: 0,
109
- duration: d * 0.2,
110
- easing: Easing.linear,
111
- useNativeDriver: true
112
- })]),
113
- // Opacity flicker
114
- Animated.sequence([Animated.timing(glitchOpacity, {
115
- toValue: 0.4,
116
- duration: d * 0.25,
117
- useNativeDriver: true
118
- }), Animated.timing(glitchOpacity, {
119
- toValue: 1,
120
- duration: d * 0.25,
121
- useNativeDriver: true
122
- }), Animated.timing(glitchOpacity, {
123
- toValue: 0.6,
124
- duration: d * 0.25,
125
- useNativeDriver: true
126
- }), Animated.timing(glitchOpacity, {
127
- toValue: 1,
128
- duration: d * 0.25,
129
- useNativeDriver: true
130
- })]),
131
- // Scale pulse
132
- Animated.sequence([Animated.timing(glitchScale, {
133
- toValue: 1.1,
134
- duration: d * 0.3,
135
- useNativeDriver: true
136
- }), Animated.timing(glitchScale, {
137
- toValue: 0.95,
138
- duration: d * 0.4,
139
- useNativeDriver: true
140
- }), Animated.timing(glitchScale, {
141
- toValue: 1,
142
- duration: d * 0.3,
143
- useNativeDriver: true
144
- })])]).start();
145
- };
146
- const scheduleNextGlitch = () => {
147
- if (!isMounted) return;
148
- const delay = MIN_GLITCH_DELAY + Math.random() * (MAX_GLITCH_DELAY - MIN_GLITCH_DELAY) + index * 300;
149
- setTimeout(() => {
150
- if (isMounted) {
151
- runGlitch();
152
- scheduleNextGlitch();
153
- }
154
- }, delay);
155
- };
156
- const initialDelay = 500 + Math.random() * 1500 + index * 200;
157
- const timeoutId = setTimeout(() => {
158
- if (isMounted) {
159
- runGlitch();
160
- scheduleNextGlitch();
161
- }
162
- }, initialDelay);
163
- return () => {
164
- isMounted = false;
165
- clearTimeout(timeoutId);
166
- };
167
- }, [glitchX, glitchOpacity, glitchScale, index]);
168
- return /*#__PURE__*/_jsxs(TouchableOpacity, {
169
- onPress: () => onSelect(tool),
170
- activeOpacity: 0.7,
171
- style: styles.toolButton,
172
- accessibilityLabel: attention ? `${tool.title} — ${attention.label}. Restore` : `Restore ${tool.title}`,
173
- accessibilityRole: "button",
174
- testID: `buoy-dock-restore-${tool.id}`,
175
- children: [/*#__PURE__*/_jsx(Animated.View, {
176
- style: {
177
- opacity: glitchOpacity,
178
- transform: [{
179
- translateX: glitchX
180
- }, {
181
- scale: glitchScale
182
- }]
183
- },
184
- children: tool.icon
185
- }), attention ? /*#__PURE__*/_jsx(View, {
186
- style: [styles.badge, {
187
- backgroundColor: ATTENTION_COLORS[attention.kind]
188
- }],
189
- testID: `buoy-dock-badge-${tool.id}-${attention.kind}`,
190
- pointerEvents: "none",
191
- children: attention.kind === "needsInput" ? /*#__PURE__*/_jsx(Text, {
192
- style: styles.badgeText,
193
- children: "!"
194
- }) : null
195
- }) : null]
196
- });
197
- }
198
-
199
- // ============================================================================
200
- // Types
201
- // ============================================================================
202
-
203
- // ============================================================================
204
- // Main Component
205
- // ============================================================================
206
-
207
- export function MinimizedToolsStack({
208
- onRestore,
209
- containerWidth = TOOLBAR_WIDTH
210
- }) {
211
- const {
212
- minimizedTools,
213
- restore
214
- } = useMinimizedTools();
215
- const peekAttention = useStrongestAttention(minimizedTools.map(t => t.id));
216
-
217
- // Calculate expanded height based on number of tools
218
- const expandedHeight = TOOLBAR_PADDING + minimizedTools.length * TOOL_ITEM_SIZE + (minimizedTools.length - 1) * ICON_GAP + ICON_GAP + COLLAPSE_BUTTON_SIZE + 4;
219
-
220
- // Handle tool press (restore)
221
- const handleToolPress = useCallback(tool => {
222
- const restored = restore(tool.instanceId);
223
- if (restored && onRestore) {
224
- onRestore(restored);
225
- }
226
- }, [restore, onRestore]);
227
- return /*#__PURE__*/_jsx(ExpandablePopover, {
228
- hasItems: minimizedTools.length > 0,
229
- itemCount: minimizedTools.length,
230
- showCount: true,
231
- width: containerWidth,
232
- expandedHeight: expandedHeight,
233
- persistState: true,
234
- storageKey: STORAGE_KEY_EXPANDED,
235
- peekHeight: PEEK_HEIGHT,
236
- collapsedLabel: `Show ${minimizedTools.length} minimized tools`,
237
- testID: "buoy-dock-peek",
238
- collapseTestID: "buoy-dock-collapse",
239
- attention: peekAttention ? {
240
- color: ATTENTION_COLORS[peekAttention.kind],
241
- glyph: peekAttention.kind === "needsInput" ? "!" : undefined,
242
- label: peekAttention.label
243
- } : null,
244
- children: [...minimizedTools].reverse().map((tool, index) => /*#__PURE__*/_jsx(GlitchToolButton, {
245
- tool: tool,
246
- onSelect: handleToolPress,
247
- index: index
248
- }, tool.instanceId))
249
- });
250
- }
251
-
252
- // ============================================================================
253
- // Styles
254
- // ============================================================================
255
-
256
- const styles = StyleSheet.create({
257
- toolButton: {
258
- width: TOOL_ITEM_SIZE,
259
- height: TOOL_ITEM_SIZE,
260
- alignItems: "center",
261
- justifyContent: "center",
262
- backgroundColor: "transparent"
263
- },
264
- // Top-right of the chip. Needs-input carries a glyph; done/failed are a dot —
265
- // the colour says which, the glyph says "act".
266
- badge: {
267
- position: "absolute",
268
- top: 0,
269
- right: 0,
270
- minWidth: 12,
271
- height: 12,
272
- borderRadius: 6,
273
- paddingHorizontal: 2,
274
- alignItems: "center",
275
- justifyContent: "center",
276
- borderWidth: 1.5,
277
- borderColor: "#0C0C0C"
278
- },
279
- badgeText: {
280
- color: "#000",
281
- fontSize: 8,
282
- fontWeight: "800",
283
- lineHeight: 9
284
- }
285
- });
1
+ "use strict";import q,{useCallback as C,useEffect as O,useRef as m,useSyncExternalStore as f}from"react";import{Animated as t,TouchableOpacity as S,View as V,Text as x,StyleSheet as L,Easing as d}from"react-native";import{ExpandablePopover as H,getToolAttention as h,subscribeToolAttention as v}from"@buoy-gg/shared-ui";import{useMinimizedTools as w}from"./MinimizedToolsContext.js";import{jsx as g,jsxs as G}from"react/jsx-runtime";function M(e){return f(v,()=>h(e),()=>h(e))}const I={needsInput:"#FF8329",done:"#20C997",failed:"#FF3B30"};const D={needsInput:3,failed:2,done:1};function R(e){const i=e.join("|");return f(v,()=>_(i),()=>_(i))}const N=new Map;function _(e){let i=null;for(const a of e?e.split("|"):[]){const o=h(a);if(o&&(!i||D[o.kind]>D[i.kind]))i=o}const n=N.get(e);if(n&&i&&n.kind===i.kind&&n.label===i.label)return n;if(!n&&!i)return null;N.set(e,i);return i}const P=28;const j=44;const p=32;const y=6;const z=8;const B=24;const $="@react_buoy_minimized_stack_expanded";const F=80;const A=2e3;const K=6e3;function W({tool:e,onSelect:i,index:n}){const a=M(e.id);const o=m(new t.Value(0)).current;const u=m(new t.Value(1)).current;const l=m(new t.Value(1)).current;O(()=>{let s=true;const c=()=>{if(!s)return;const r=F;t.parallel([t.sequence([t.timing(o,{toValue:3,duration:r*.2,easing:d.linear,useNativeDriver:true}),t.timing(o,{toValue:-3,duration:r*.2,easing:d.linear,useNativeDriver:true}),t.timing(o,{toValue:2,duration:r*.2,easing:d.linear,useNativeDriver:true}),t.timing(o,{toValue:-1,duration:r*.2,easing:d.linear,useNativeDriver:true}),t.timing(o,{toValue:0,duration:r*.2,easing:d.linear,useNativeDriver:true})]),t.sequence([t.timing(u,{toValue:.4,duration:r*.25,useNativeDriver:true}),t.timing(u,{toValue:1,duration:r*.25,useNativeDriver:true}),t.timing(u,{toValue:.6,duration:r*.25,useNativeDriver:true}),t.timing(u,{toValue:1,duration:r*.25,useNativeDriver:true})]),t.sequence([t.timing(l,{toValue:1.1,duration:r*.3,useNativeDriver:true}),t.timing(l,{toValue:.95,duration:r*.4,useNativeDriver:true}),t.timing(l,{toValue:1,duration:r*.3,useNativeDriver:true})])]).start()};const b=()=>{if(!s)return;const r=A+Math.random()*(K-A)+n*300;setTimeout(()=>{if(s){c();b()}},r)};const E=500+Math.random()*1500+n*200;const k=setTimeout(()=>{if(s){c();b()}},E);return()=>{s=false;clearTimeout(k)}},[o,u,l,n]);return G(S,{onPress:()=>i(e),activeOpacity:.7,style:T.toolButton,accessibilityLabel:a?`${e.title} \u2014 ${a.label}. Restore`:`Restore ${e.title}`,accessibilityRole:"button",testID:`buoy-dock-restore-${e.id}`,children:[g(t.View,{style:{opacity:u,transform:[{translateX:o},{scale:l}]},children:e.icon}),a?g(V,{style:[T.badge,{backgroundColor:I[a.kind]}],testID:`buoy-dock-badge-${e.id}-${a.kind}`,pointerEvents:"none",children:a.kind==="needsInput"?g(x,{style:T.badgeText,children:"!"}):null}):null]})}export function MinimizedToolsStack({onRestore:e,containerWidth:i=j}){const{minimizedTools:n,restore:a}=w();const o=R(n.map(s=>s.id));const u=z+n.length*p+(n.length-1)*y+y+B+4;const l=C(s=>{const c=a(s.instanceId);if(c&&e){e(c)}},[a,e]);return g(H,{hasItems:n.length>0,itemCount:n.length,showCount:true,width:i,expandedHeight:u,persistState:true,storageKey:$,peekHeight:P,collapsedLabel:`Show ${n.length} minimized tools`,testID:"buoy-dock-peek",collapseTestID:"buoy-dock-collapse",attention:o?{color:I[o.kind],glyph:o.kind==="needsInput"?"!":void 0,label:o.label}:null,children:[...n].reverse().map((s,c)=>g(W,{tool:s,onSelect:l,index:c},s.instanceId))})}const T=L.create({toolButton:{width:p,height:p,alignItems:"center",justifyContent:"center",backgroundColor:"transparent"},badge:{position:"absolute",top:0,right:0,minWidth:12,height:12,borderRadius:6,paddingHorizontal:2,alignItems:"center",justifyContent:"center",borderWidth:1.5,borderColor:"#0C0C0C"},badgeText:{color:"#000",fontSize:8,fontWeight:"800",lineHeight:9}});
@@ -1,374 +1 @@
1
- "use strict";
2
-
3
- /**
4
- * MinimizedToolsStack — Web twin of MinimizedToolsStack.tsx +
5
- * shared-ui's ExpandablePopover (inlined: the popover is only used here on
6
- * web). A vertical stack of minimized-tool icons fused to the top of the
7
- * floating bubble's drag handle:
8
- * - collapsed: a 28px "peek" tab (chevron-up + count) with top corners only
9
- * - expanded: animated-height panel, icons newest-first, collapse chevron
10
- * - expanded state persists under "@react_buoy_minimized_stack_expanded"
11
- * - each icon runs the native randomized glitch loop (translateX shake +
12
- * opacity flicker + scale pulse, 80ms), scheduled every 2-6s + index*300ms
13
- *
14
- * Data comes from the web AppHost (openApps with minimized === true) instead
15
- * of the native MinimizedToolsContext — same derivation the MinimizedDock
16
- * used before this replaced it.
17
- */
18
-
19
- import { useCallback, useEffect, useRef, useState, useSyncExternalStore } from 'react';
20
- import { persistentStorage, getToolAttention, subscribeToolAttention } from '@buoy-gg/shared-ui';
21
-
22
- /** Twin of the native hook — see MinimizedToolsStack.tsx. */
23
- function useToolAttention(toolId) {
24
- return useSyncExternalStore(subscribeToolAttention, () => getToolAttention(toolId), () => getToolAttention(toolId));
25
- }
26
- const ATTENTION_COLORS = {
27
- needsInput: '#FF8329',
28
- done: '#20C997',
29
- failed: '#FF3B30'
30
- };
31
- const ATTENTION_RANK = {
32
- needsInput: 3,
33
- failed: 2,
34
- done: 1
35
- };
36
- const strongestCache = new Map();
37
- function strongest(key) {
38
- let best = null;
39
- for (const id of key ? key.split('|') : []) {
40
- const a = getToolAttention(id);
41
- if (a && (!best || ATTENTION_RANK[a.kind] > ATTENTION_RANK[best.kind])) best = a;
42
- }
43
- const prev = strongestCache.get(key);
44
- if (prev && best && prev.kind === best.kind && prev.label === best.label) return prev;
45
- if (!prev && !best) return null;
46
- strongestCache.set(key, best);
47
- return best;
48
- }
49
- /** Twin of the native hook: the strongest attention across the folded dock. */
50
- function useStrongestAttention(toolIds) {
51
- const key = toolIds.join('|');
52
- return useSyncExternalStore(subscribeToolAttention, () => strongest(key), () => strongest(key));
53
- }
54
- import { useAppHost } from "./AppHost.web.js";
55
-
56
- // native MinimizedToolsStack.tsx constants
57
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
58
- const PEEK_HEIGHT = 28;
59
- const TOOL_ITEM_SIZE = 32;
60
- const ICON_GAP = 6;
61
- const TOOLBAR_PADDING = 8;
62
- const COLLAPSE_BUTTON_SIZE = 24;
63
- const STORAGE_KEY_EXPANDED = '@react_buoy_minimized_stack_expanded';
64
- const GLITCH_DURATION_MS = 80;
65
- const MIN_GLITCH_DELAY = 2000;
66
- const MAX_GLITCH_DELAY = 6000;
67
-
68
- // native shared-ui buoyColors (gameUIColors.ts) — card + textMuted
69
- const CARD = '#1A1A1A';
70
- const TEXT_MUTED = '#888888';
71
- function ChevronGlyph({
72
- down = false
73
- }) {
74
- // native: ChevronUp size 12, strokeWidth 2, buoyColors.textMuted
75
- return /*#__PURE__*/_jsx("svg", {
76
- width: 12,
77
- height: 12,
78
- viewBox: "0 0 24 24",
79
- "aria-hidden": "true",
80
- style: {
81
- transform: down ? 'rotate(180deg)' : undefined
82
- },
83
- children: /*#__PURE__*/_jsx("path", {
84
- d: "M18 15l-6-6-6 6",
85
- fill: "none",
86
- stroke: TEXT_MUTED,
87
- strokeWidth: "2",
88
- strokeLinecap: "round",
89
- strokeLinejoin: "round"
90
- })
91
- });
92
- }
93
- function GlitchToolButton({
94
- id,
95
- title,
96
- icon,
97
- index,
98
- onPress
99
- }) {
100
- const attention = useToolAttention(id);
101
- const innerRef = useRef(null);
102
- useEffect(() => {
103
- let mounted = true;
104
- let timer;
105
- const runGlitch = () => {
106
- // native: parallel translateX shake / opacity flicker / scale pulse,
107
- // all inside GLITCH_DURATION_MS — one WAAPI animation with offsets.
108
- innerRef.current?.animate([{
109
- transform: 'translateX(0) scale(1)',
110
- opacity: 1,
111
- offset: 0
112
- }, {
113
- transform: 'translateX(3px) scale(1.05)',
114
- opacity: 0.4,
115
- offset: 0.2
116
- }, {
117
- transform: 'translateX(-3px) scale(1.1)',
118
- opacity: 1,
119
- offset: 0.4
120
- }, {
121
- transform: 'translateX(2px) scale(1.0)',
122
- opacity: 0.6,
123
- offset: 0.6
124
- }, {
125
- transform: 'translateX(-1px) scale(0.95)',
126
- opacity: 1,
127
- offset: 0.8
128
- }, {
129
- transform: 'translateX(0) scale(1)',
130
- opacity: 1,
131
- offset: 1
132
- }], {
133
- duration: GLITCH_DURATION_MS,
134
- easing: 'linear'
135
- });
136
- };
137
- const schedule = initial => {
138
- const delay = initial ? 500 + Math.random() * 1500 + index * 200 : MIN_GLITCH_DELAY + Math.random() * (MAX_GLITCH_DELAY - MIN_GLITCH_DELAY) + index * 300;
139
- timer = setTimeout(() => {
140
- if (!mounted) return;
141
- runGlitch();
142
- schedule(false);
143
- }, delay);
144
- };
145
- schedule(true);
146
- return () => {
147
- mounted = false;
148
- clearTimeout(timer);
149
- };
150
- }, [index]);
151
- return /*#__PURE__*/_jsxs("button", {
152
- type: "button",
153
- "aria-label": attention ? `${title} — ${attention.label}. Restore` : `Restore ${title}`,
154
- onClick: onPress,
155
- style: {
156
- width: TOOL_ITEM_SIZE,
157
- height: TOOL_ITEM_SIZE,
158
- display: 'flex',
159
- alignItems: 'center',
160
- justifyContent: 'center',
161
- background: 'none',
162
- border: 'none',
163
- padding: 0,
164
- cursor: 'pointer',
165
- position: 'relative'
166
- },
167
- children: [/*#__PURE__*/_jsx("div", {
168
- ref: innerRef,
169
- style: {
170
- display: 'flex',
171
- alignItems: 'center',
172
- justifyContent: 'center'
173
- },
174
- children: icon
175
- }), attention ? /*#__PURE__*/_jsx("span", {
176
- "aria-hidden": true,
177
- "data-testid": `buoy-dock-badge-${id}-${attention.kind}`,
178
- style: {
179
- position: 'absolute',
180
- top: 0,
181
- right: 0,
182
- minWidth: 12,
183
- height: 12,
184
- borderRadius: 6,
185
- padding: '0 2px',
186
- boxSizing: 'border-box',
187
- background: ATTENTION_COLORS[attention.kind],
188
- border: '1.5px solid #0C0C0C',
189
- color: '#000',
190
- fontSize: 8,
191
- fontWeight: 800,
192
- lineHeight: '9px',
193
- display: 'flex',
194
- alignItems: 'center',
195
- justifyContent: 'center'
196
- },
197
- children: attention.kind === 'needsInput' ? '!' : ''
198
- }) : null]
199
- });
200
- }
201
- export function MinimizedToolsStack({
202
- containerWidth = 32
203
- }) {
204
- const {
205
- openApps,
206
- restore
207
- } = useAppHost();
208
- const minimized = openApps.filter(app => app.minimized && app.launchMode !== 'toggle-only');
209
- const [isExpanded, setIsExpanded] = useState(false);
210
- const [isStateRestored, setIsStateRestored] = useState(false);
211
- const peekAttention = useStrongestAttention(minimized.map(app => app.id));
212
-
213
- // Restore + persist the expanded flag (native ExpandablePopover persistState).
214
- useEffect(() => {
215
- let cancelled = false;
216
- const load = async () => {
217
- const saved = await persistentStorage.getItem(STORAGE_KEY_EXPANDED);
218
- if (!cancelled && saved === 'true') setIsExpanded(true);
219
- if (!cancelled) setIsStateRestored(true);
220
- };
221
- void load();
222
- return () => {
223
- cancelled = true;
224
- };
225
- }, []);
226
- useEffect(() => {
227
- if (!isStateRestored) return;
228
- void persistentStorage.setItem(STORAGE_KEY_EXPANDED, isExpanded ? 'true' : 'false');
229
- }, [isExpanded, isStateRestored]);
230
- const handleRestore = useCallback(instanceId => {
231
- restore(instanceId);
232
- }, [restore]);
233
- if (minimized.length === 0) return null;
234
-
235
- // native: expandedHeight = padding + n*item + (n-1)*gap + gap + collapse + 4
236
- const expandedHeight = TOOLBAR_PADDING + minimized.length * TOOL_ITEM_SIZE + (minimized.length - 1) * ICON_GAP + ICON_GAP + COLLAPSE_BUTTON_SIZE + 4;
237
- const frame = {
238
- // native peekButton/expandedContainer: card bg, top corners 6, 1px border
239
- // on top/left/right only (fuses with the bubble below)
240
- backgroundColor: CARD,
241
- borderTopLeftRadius: 6,
242
- borderTopRightRadius: 6,
243
- borderTop: `1px solid ${TEXT_MUTED}66`,
244
- borderLeft: `1px solid ${TEXT_MUTED}66`,
245
- borderRight: `1px solid ${TEXT_MUTED}66`,
246
- borderBottom: 'none',
247
- boxSizing: 'border-box'
248
- };
249
- return /*#__PURE__*/_jsxs("div", {
250
- style: {
251
- height: PEEK_HEIGHT,
252
- overflow: 'visible',
253
- position: 'relative'
254
- },
255
- children: [/*#__PURE__*/_jsx("div", {
256
- style: {
257
- position: 'absolute',
258
- bottom: 'var(--buoy-stack-bottom, 0px)',
259
- top: 'var(--buoy-stack-top, auto)',
260
- left: 0,
261
- width: containerWidth,
262
- maxHeight: 'var(--buoy-stack-space, calc(100vh - 48px))',
263
- visibility: isExpanded ? 'visible' : 'hidden',
264
- height: isExpanded ? expandedHeight : 0,
265
- opacity: isExpanded ? 1 : 0,
266
- overflowY: 'auto',
267
- overflowX: 'hidden',
268
- transition: 'height 200ms ease, opacity 200ms ease',
269
- pointerEvents: isExpanded ? 'auto' : 'none',
270
- ...frame
271
- },
272
- children: /*#__PURE__*/_jsxs("div", {
273
- style: {
274
- height: expandedHeight,
275
- display: 'flex',
276
- flexDirection: 'column',
277
- alignItems: 'center',
278
- paddingTop: TOOLBAR_PADDING,
279
- gap: ICON_GAP,
280
- boxSizing: 'border-box'
281
- },
282
- children: [[...minimized].reverse().map((app, index) => /*#__PURE__*/_jsx(GlitchToolButton, {
283
- id: app.id,
284
- title: app.title || app.id,
285
- icon: app.icon ?? /*#__PURE__*/_jsx("span", {
286
- style: {
287
- color: '#fff',
288
- fontSize: 13
289
- },
290
- children: (app.title || app.id).slice(0, 1).toUpperCase()
291
- }),
292
- index: index,
293
- onPress: () => handleRestore(app.instanceId)
294
- }, app.instanceId)), /*#__PURE__*/_jsx("button", {
295
- type: "button",
296
- "aria-label": "Collapse",
297
- onClick: () => setIsExpanded(false),
298
- style: {
299
- width: '100%',
300
- height: COLLAPSE_BUTTON_SIZE,
301
- marginTop: 3,
302
- display: 'flex',
303
- alignItems: 'center',
304
- justifyContent: 'center',
305
- background: 'none',
306
- border: 'none',
307
- cursor: 'pointer',
308
- padding: 0
309
- },
310
- children: /*#__PURE__*/_jsx(ChevronGlyph, {
311
- down: true
312
- })
313
- })]
314
- })
315
- }), /*#__PURE__*/_jsxs("button", {
316
- type: "button",
317
- "aria-label": `Show ${minimized.length} minimized tools`,
318
- tabIndex: isExpanded ? -1 : 0,
319
- "aria-hidden": isExpanded,
320
- onClick: () => setIsExpanded(true),
321
- style: {
322
- position: 'absolute',
323
- bottom: 0,
324
- left: 0,
325
- width: containerWidth,
326
- height: PEEK_HEIGHT,
327
- display: 'flex',
328
- flexDirection: 'row',
329
- alignItems: 'center',
330
- justifyContent: 'center',
331
- gap: 2,
332
- cursor: 'pointer',
333
- padding: 0,
334
- opacity: isExpanded ? 0 : 1,
335
- transform: isExpanded ? 'scale(0.9)' : 'scale(1)',
336
- transition: 'opacity 200ms ease, transform 200ms ease',
337
- pointerEvents: isExpanded ? 'none' : 'auto',
338
- ...frame
339
- },
340
- children: [/*#__PURE__*/_jsx(ChevronGlyph, {}), peekAttention ? /*#__PURE__*/_jsx("span", {
341
- "aria-hidden": true,
342
- "data-testid": `buoy-dock-peek-attention`,
343
- style: {
344
- position: 'absolute',
345
- top: 2,
346
- right: 2,
347
- minWidth: 11,
348
- height: 11,
349
- borderRadius: 6,
350
- padding: '0 2px',
351
- boxSizing: 'border-box',
352
- background: ATTENTION_COLORS[peekAttention.kind],
353
- border: '1.5px solid #0C0C0C',
354
- color: '#000',
355
- fontSize: 8,
356
- fontWeight: 800,
357
- lineHeight: '9px',
358
- display: 'flex',
359
- alignItems: 'center',
360
- justifyContent: 'center'
361
- },
362
- children: peekAttention.kind === 'needsInput' ? '!' : ''
363
- }) : null, minimized.length > 1 && /*#__PURE__*/_jsx("span", {
364
- style: {
365
- fontSize: 9,
366
- fontWeight: 600,
367
- color: TEXT_MUTED,
368
- marginLeft: 1
369
- },
370
- children: minimized.length
371
- })]
372
- })]
373
- });
374
- }
1
+ "use strict";import{useCallback as M,useEffect as m,useRef as N,useState as I,useSyncExternalStore as k}from"react";import{persistentStorage as C,getToolAttention as y,subscribeToolAttention as v}from"@buoy-gg/shared-ui";function G(e){return k(v,()=>y(e),()=>y(e))}const A={needsInput:"#FF8329",done:"#20C997",failed:"#FF3B30"};const _={needsInput:3,failed:2,done:1};const E=new Map;function S(e){let n=null;for(const i of e?e.split("|"):[]){const o=y(i);if(o&&(!n||_[o.kind]>_[n.kind]))n=o}const r=E.get(e);if(r&&n&&r.kind===n.kind&&r.label===n.label)return r;if(!r&&!n)return null;E.set(e,n);return n}function H(e){const n=e.join("|");return k(v,()=>S(n),()=>S(n))}import{useAppHost as X}from"./AppHost.web.js";import{jsx as s,jsxs as h}from"react/jsx-runtime";const R=28;const x=32;const T=6;const L=8;const w=24;const z="@react_buoy_minimized_stack_expanded";const $=80;const O=2e3;const B=6e3;const P="#1A1A1A";const u="#888888";function j({down:e=false}){return s("svg",{width:12,height:12,viewBox:"0 0 24 24","aria-hidden":"true",style:{transform:e?"rotate(180deg)":void 0},children:s("path",{d:"M18 15l-6-6-6 6",fill:"none",stroke:u,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function W({id:e,title:n,icon:r,index:i,onPress:o}){const a=G(e);const d=N(null);m(()=>{let f=true;let l;const g=()=>{d.current?.animate([{transform:"translateX(0) scale(1)",opacity:1,offset:0},{transform:"translateX(3px) scale(1.05)",opacity:.4,offset:.2},{transform:"translateX(-3px) scale(1.1)",opacity:1,offset:.4},{transform:"translateX(2px) scale(1.0)",opacity:.6,offset:.6},{transform:"translateX(-1px) scale(0.95)",opacity:1,offset:.8},{transform:"translateX(0) scale(1)",opacity:1,offset:1}],{duration:$,easing:"linear"})};const c=p=>{const t=p?500+Math.random()*1500+i*200:O+Math.random()*(B-O)+i*300;l=setTimeout(()=>{if(!f)return;g();c(false)},t)};c(true);return()=>{f=false;clearTimeout(l)}},[i]);return h("button",{type:"button","aria-label":a?`${n} \u2014 ${a.label}. Restore`:`Restore ${n}`,onClick:o,style:{width:x,height:x,display:"flex",alignItems:"center",justifyContent:"center",background:"none",border:"none",padding:0,cursor:"pointer",position:"relative"},children:[s("div",{ref:d,style:{display:"flex",alignItems:"center",justifyContent:"center"},children:r}),a?s("span",{"aria-hidden":true,"data-testid":`buoy-dock-badge-${e}-${a.kind}`,style:{position:"absolute",top:0,right:0,minWidth:12,height:12,borderRadius:6,padding:"0 2px",boxSizing:"border-box",background:A[a.kind],border:"1.5px solid #0C0C0C",color:"#000",fontSize:8,fontWeight:800,lineHeight:"9px",display:"flex",alignItems:"center",justifyContent:"center"},children:a.kind==="needsInput"?"!":""}):null]})}export function MinimizedToolsStack({containerWidth:e=32}){const{openApps:n,restore:r}=X();const i=n.filter(t=>t.minimized&&t.launchMode!=="toggle-only");const[o,a]=I(false);const[d,f]=I(false);const l=H(i.map(t=>t.id));m(()=>{let t=false;const b=async()=>{const D=await C.getItem(z);if(!t&&D==="true")a(true);if(!t)f(true)};void b();return()=>{t=true}},[]);m(()=>{if(!d)return;void C.setItem(z,o?"true":"false")},[o,d]);const g=M(t=>{r(t)},[r]);if(i.length===0)return null;const c=L+i.length*x+(i.length-1)*T+T+w+4;const p={backgroundColor:P,borderTopLeftRadius:6,borderTopRightRadius:6,borderTop:`1px solid ${u}66`,borderLeft:`1px solid ${u}66`,borderRight:`1px solid ${u}66`,borderBottom:"none",boxSizing:"border-box"};return h("div",{style:{height:R,overflow:"visible",position:"relative"},children:[s("div",{style:{position:"absolute",bottom:"var(--buoy-stack-bottom, 0px)",top:"var(--buoy-stack-top, auto)",left:0,width:e,maxHeight:"var(--buoy-stack-space, calc(100vh - 48px))",visibility:o?"visible":"hidden",height:o?c:0,opacity:o?1:0,overflowY:"auto",overflowX:"hidden",transition:"height 200ms ease, opacity 200ms ease",pointerEvents:o?"auto":"none",...p},children:h("div",{style:{height:c,display:"flex",flexDirection:"column",alignItems:"center",paddingTop:L,gap:T,boxSizing:"border-box"},children:[[...i].reverse().map((t,b)=>s(W,{id:t.id,title:t.title||t.id,icon:t.icon??s("span",{style:{color:"#fff",fontSize:13},children:(t.title||t.id).slice(0,1).toUpperCase()}),index:b,onPress:()=>g(t.instanceId)},t.instanceId)),s("button",{type:"button","aria-label":"Collapse",onClick:()=>a(false),style:{width:"100%",height:w,marginTop:3,display:"flex",alignItems:"center",justifyContent:"center",background:"none",border:"none",cursor:"pointer",padding:0},children:s(j,{down:true})})]})}),h("button",{type:"button","aria-label":`Show ${i.length} minimized tools`,tabIndex:o?-1:0,"aria-hidden":o,onClick:()=>a(true),style:{position:"absolute",bottom:0,left:0,width:e,height:R,display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",gap:2,cursor:"pointer",padding:0,opacity:o?0:1,transform:o?"scale(0.9)":"scale(1)",transition:"opacity 200ms ease, transform 200ms ease",pointerEvents:o?"none":"auto",...p},children:[s(j,{}),l?s("span",{"aria-hidden":true,"data-testid":`buoy-dock-peek-attention`,style:{position:"absolute",top:2,right:2,minWidth:11,height:11,borderRadius:6,padding:"0 2px",boxSizing:"border-box",background:A[l.kind],border:"1.5px solid #0C0C0C",color:"#000",fontSize:8,fontWeight:800,lineHeight:"9px",display:"flex",alignItems:"center",justifyContent:"center"},children:l.kind==="needsInput"?"!":""}):null,i.length>1&&s("span",{style:{fontSize:9,fontWeight:600,color:u,marginLeft:1},children:i.length})]})]})}