@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,173 +1 @@
1
- "use strict";
2
-
3
- /**
4
- * DialHyperspace — the Hyperspace backdrop's lightspeed starfield, scaled
5
- * down to live inside the open dial's face. Replaces DialSnow (kept next
6
- * door for an easy swap back) so the dial matches the tool background.
7
- *
8
- * Same construction as the full preset (shared-ui
9
- * `backgrounds/variants/hyperspace.tsx`, see its header for the derivation):
10
- * the Skia original's per-frame `screen = plane/z` projection becomes scale
11
- * keyframes on phase-offset shells — a layer scaled by 1/z moves every star
12
- * outward on the true hyperbolic curve — with each shell's wrap snap hidden
13
- * inside the fade the original applies to the first/last 6% of a star's
14
- * life. Dial tuning: fewer stars, a slightly gentler cycle and lower alpha
15
- * so the field reads behind the icons instead of competing with them.
16
- * Stars are round crisp points, as in the original — never streaks.
17
- *
18
- * Cost while the dial is open: 1 animated node, ~48 static views — the same
19
- * budget DialSnow ran. The dial is fixed-size (never user-resized), so
20
- * sizing geometry from the passed circle size is correct here, and the
21
- * circle's `overflow: "hidden"` clips the streaks.
22
- */
23
-
24
- import { memo } from "react";
25
- import { Animated, View } from "react-native";
26
- import { RasterLayer, scatter, useLoop, withBgAlpha } from "@buoy-gg/shared-ui";
27
- import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
28
- const Z_SPAN = 0.94;
29
- const MAX_SCALE = 6;
30
- const CYCLE_MS = 2400;
31
- const SHELLS = 3;
32
- const STARS_PER_SHELL = 16;
33
- /** Stride 4: angle, radius, size jitter, palette pick — fixed seeds so the
34
- * field is identical every open. */
35
- const SHELL_TABLES = Array.from({
36
- length: SHELLS
37
- }, (_, k) => scatter(0x5747 ^ k * 0x9e37, STARS_PER_SHELL * 4));
38
- const STAR_COLORS = ["#FFFFFF", "#B3D9FF", "#8CB3FF"];
39
-
40
- /** The dial face draws 6 grid spokes, one every 60° starting at 0°. Star
41
- * motion is radial (uniform scale about the centre), so a star whose angle
42
- * sits near a spoke rides that line for its entire life. Remap the uniform
43
- * angle pick into the clear wedge between spokes, leaving `SPOKE_GAP` of
44
- * clearance centred on each line. */
45
- const SPOKE_STEP = Math.PI / 3;
46
- const SPOKE_GAP = 14 * Math.PI / 180;
47
- function spokeClearAngle(u) {
48
- const sector = Math.min(5, Math.floor(u * 6));
49
- const t = u * 6 - sector;
50
- return sector * SPOKE_STEP + SPOKE_GAP / 2 + t * (SPOKE_STEP - SPOKE_GAP);
51
- }
52
- function scaleAt(p) {
53
- return Math.min(MAX_SCALE, 1 / (1 - p * Z_SPAN));
54
- }
55
- function opacityAt(p) {
56
- let bright = 0.15 + 0.85 * p * p;
57
- // The original's 6% fade at both ends of a star's life.
58
- if (p < 0.06) bright *= p / 0.06;else if (p > 0.94) bright *= (1 - p) / 0.06;
59
- // Dial tuning: never brighter than 0.7 — the icons own the foreground.
60
- return Math.min(0.7, bright);
61
- }
62
-
63
- /** Interpolate stops for shell k (phase = (v + k/K) mod 1), the wrap point
64
- * double-sampled 1e-4 apart inside the zero-opacity sliver. */
65
- function shellStops(k) {
66
- const offset = k / SHELLS;
67
- const vs = [];
68
- const SEGMENTS = 12;
69
- for (let i = 0; i <= SEGMENTS; i++) vs.push(i / SEGMENTS);
70
- const vWrap = (1 - offset) % 1;
71
- if (vWrap > 1e-3 && vWrap < 1 - 1e-3) vs.push(vWrap - 1e-4, vWrap + 1e-4);
72
- vs.sort((a, b) => a - b);
73
- const input = [];
74
- const scale = [];
75
- const opacity = [];
76
- for (const v of vs) {
77
- // At the loop boundary the offset-0 shell's phase must read as END of
78
- // life (p=1, max scale, zero opacity), not wrap to 0 — otherwise the
79
- // last segment lerps scale 6→1 at visible opacity and the stars
80
- // retract to the centre once per cycle.
81
- const p = offset === 0 && v === 1 ? 1 : (v + offset) % 1;
82
- input.push(v);
83
- scale.push(scaleAt(p));
84
- opacity.push(opacityAt(p));
85
- }
86
- return {
87
- input,
88
- scale,
89
- opacity
90
- };
91
- }
92
- const SHELL_STOPS = Array.from({
93
- length: SHELLS
94
- }, (_, k) => shellStops(k));
95
- export const DialHyperspace = /*#__PURE__*/memo(function DialHyperspace({
96
- size
97
- }) {
98
- const drive = useLoop(CYCLE_MS);
99
- const c = size / 2;
100
- const shells = [];
101
- for (let k = 0; k < SHELLS; k++) {
102
- const table = SHELL_TABLES[k];
103
- const stops = SHELL_STOPS[k];
104
- const stars = [];
105
- for (let i = 0; i < STARS_PER_SHELL; i++) {
106
- const ang = spokeClearAngle(table[i * 4]);
107
- // sqrt-biased outward, inner 15% clear of the vanishing point. Offsets
108
- // scale with the HALF-extent, as in the original's projection.
109
- const rad = (0.15 + 0.85 * Math.sqrt(table[i * 4 + 1])) * 0.5 * c;
110
- const color = STAR_COLORS[Math.floor(table[i * 4 + 3] * STAR_COLORS.length) % 3];
111
- const x = c + Math.cos(ang) * rad;
112
- const y = c + Math.sin(ang) * rad;
113
- // Round crisp points, as in the original — the visible star is the
114
- // sprite's lit core (~12.5% of the stamp), so it starts sub-pixel and
115
- // only reaches ~2-3px before the fade-out kills it. A soft halo disc
116
- // at α0.3 stands in for the sprite's blur.
117
- const core = 0.6;
118
- const halo = core * 2.4;
119
- stars.push(/*#__PURE__*/_jsx(View, {
120
- style: {
121
- position: "absolute",
122
- left: x - halo / 2,
123
- top: y - halo / 2,
124
- width: halo,
125
- height: halo,
126
- borderRadius: halo / 2,
127
- backgroundColor: withBgAlpha(color, 0.3)
128
- }
129
- }, `${i}-h`), /*#__PURE__*/_jsx(View, {
130
- style: {
131
- position: "absolute",
132
- left: x - core / 2,
133
- top: y - core / 2,
134
- width: core,
135
- height: core,
136
- borderRadius: core / 2,
137
- backgroundColor: color
138
- }
139
- }, i));
140
- }
141
- shells.push(/*#__PURE__*/_jsx(Animated.View, {
142
- style: {
143
- position: "absolute",
144
- left: 0,
145
- top: 0,
146
- width: size,
147
- height: size,
148
- opacity: drive.interpolate({
149
- inputRange: stops.input,
150
- outputRange: stops.opacity
151
- }),
152
- transform: [{
153
- scale: drive.interpolate({
154
- inputRange: stops.input,
155
- outputRange: stops.scale
156
- })
157
- }]
158
- },
159
- pointerEvents: "none",
160
- children: /*#__PURE__*/_jsx(RasterLayer, {
161
- style: {
162
- width: size,
163
- height: size
164
- },
165
- raster: false,
166
- children: stars
167
- })
168
- }, k));
169
- }
170
- return /*#__PURE__*/_jsx(_Fragment, {
171
- children: shells
172
- });
173
- });
1
+ "use strict";import{memo as F}from"react";import{Animated as R,View as A}from"react-native";import{RasterLayer as b,scatter as P,useLoop as C,withBgAlpha as w}from"@buoy-gg/shared-ui";import{jsx as u,Fragment as x}from"react/jsx-runtime";const H=.94;const T=6;const v=2400;const f=3;const E=16;const O=Array.from({length:f},(o,t)=>P(22343^t*40503,E*4));const L=["#FFFFFF","#B3D9FF","#8CB3FF"];const _=Math.PI/3;const M=14*Math.PI/180;function k(o){const t=Math.min(5,Math.floor(o*6));const e=o*6-t;return t*_+M/2+e*(_-M)}function B(o){return Math.min(T,1/(1-o*H))}function D(o){let t=.15+.85*o*o;if(o<.06)t*=o/.06;else if(o>.94)t*=(1-o)/.06;return Math.min(.7,t)}function j(o){const t=o/f;const e=[];const i=12;for(let n=0;n<=i;n++)e.push(n/i);const c=(1-t)%1;if(c>.001&&c<1-.001)e.push(c-1e-4,c+1e-4);e.sort((n,s)=>n-s);const r=[];const l=[];const a=[];for(const n of e){const s=t===0&&n===1?1:(n+t)%1;r.push(n);l.push(B(s));a.push(D(s))}return{input:r,scale:l,opacity:a}}const G=Array.from({length:f},(o,t)=>j(t));export const DialHyperspace=F(function o({size:t}){const e=C(v);const i=t/2;const c=[];for(let r=0;r<f;r++){const l=O[r];const a=G[r];const n=[];for(let s=0;s<E;s++){const S=k(l[s*4]);const g=(.15+.85*Math.sqrt(l[s*4+1]))*.5*i;const m=L[Math.floor(l[s*4+3]*L.length)%3];const d=i+Math.cos(S)*g;const y=i+Math.sin(S)*g;const h=.6;const p=h*2.4;n.push(u(A,{style:{position:"absolute",left:d-p/2,top:y-p/2,width:p,height:p,borderRadius:p/2,backgroundColor:w(m,.3)}},`${s}-h`),u(A,{style:{position:"absolute",left:d-h/2,top:y-h/2,width:h,height:h,borderRadius:h/2,backgroundColor:m}},s))}c.push(u(R.View,{style:{position:"absolute",left:0,top:0,width:t,height:t,opacity:e.interpolate({inputRange:a.input,outputRange:a.opacity}),transform:[{scale:e.interpolate({inputRange:a.input,outputRange:a.scale})}]},pointerEvents:"none",children:u(b,{style:{width:t,height:t},raster:false,children:n})},r))}return u(x,{children:c})});
@@ -1,299 +1 @@
1
- "use strict";
2
-
3
- import { useMemo, useRef } from "react";
4
- import { StyleSheet, Pressable, View, Text, useWindowDimensions, Animated } from "react-native";
5
- import { getDialLayout, getIconPosition, getIconStaggerInputRange, DIAL_START_ANGLE, DIAL_ICON_SIZE, DIAL_ICON_GLYPH_SIZE, dialColors, dialStyles, dialAnimationConfig } from "@buoy-gg/floating-tools-core";
6
-
7
- /** Full names agents wait for (`waitFor: "Network"`), not the truncated glyph. */
8
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
9
- const DIAL_A11Y = {
10
- network: "Network",
11
- images: "Images",
12
- "image-overlay": "Image Overlay",
13
- assets: "Assets",
14
- query: "React Query",
15
- storage: "Storage",
16
- env: "Env",
17
- console: "Console",
18
- events: "Events",
19
- redux: "Redux",
20
- zustand: "Zustand",
21
- jotai: "Jotai",
22
- "route-events": "Routes",
23
- "time-machine": "Time Machine",
24
- "highlight-updates": "Highlight Updates",
25
- "debug-borders": "Debug Borders",
26
- "perf-monitor": "Perf Monitor",
27
- "js-top": "JS Top",
28
- "js-top-modal": "JS Top",
29
- impersonate: "Impersonate",
30
- "perf-monitor-modal": "Perf Monitor"
31
- };
32
- function dialAccessibilityLabel(id, name) {
33
- if (id && DIAL_A11Y[id]) return DIAL_A11Y[id];
34
- return name;
35
- }
36
-
37
- // The circle radius depends on the live window width and is computed inside
38
- // the component (must match DialDevTools' circle, which does the same).
39
- const VIEW_SIZE = DIAL_ICON_SIZE;
40
- export const DialIcon = ({
41
- index,
42
- icon,
43
- iconsProgress,
44
- onPress,
45
- totalIcons,
46
- active
47
- }) => {
48
- // Animation values - using interpolation for better performance
49
- const scale = useRef(new Animated.Value(1)).current;
50
- const {
51
- width: screenWidth
52
- } = useWindowDimensions();
53
- const layout = useMemo(() => getDialLayout({
54
- screenWidth
55
- }), [screenWidth]);
56
-
57
- // Hover animation on press in/out - using shared config
58
- // Fallback values in case dialAnimationConfig hasn't loaded yet
59
- const iconAnimConfig = dialAnimationConfig?.icons ?? {
60
- pressIn: {
61
- scale: 0.95,
62
- damping: 15,
63
- stiffness: 400
64
- },
65
- pressOut: {
66
- scale: 1,
67
- damping: 15,
68
- stiffness: 400
69
- }
70
- };
71
- const {
72
- pressIn,
73
- pressOut
74
- } = iconAnimConfig;
75
- const handlePressIn = () => {
76
- Animated.spring(scale, {
77
- toValue: pressIn.scale,
78
- damping: pressIn.damping,
79
- stiffness: pressIn.stiffness,
80
- useNativeDriver: true
81
- }).start();
82
- };
83
- const handlePressOut = () => {
84
- Animated.spring(scale, {
85
- toValue: pressOut.scale,
86
- damping: pressOut.damping,
87
- stiffness: pressOut.stiffness,
88
- useNativeDriver: true
89
- }).start();
90
- };
91
-
92
- // Position + spiral-entrance interpolations depend only on the (fixed) slot
93
- // index, so compute them once. This keeps re-renders — which happen on every
94
- // page change as `active` toggles — cheap.
95
- const motion = useMemo(() => {
96
- const iconPosition = getIconPosition(index, totalIcons, layout.iconRadius, DIAL_START_ANGLE);
97
- const {
98
- x: finalX,
99
- y: finalY,
100
- angle
101
- } = iconPosition;
102
- const radius = layout.iconRadius;
103
- const staggerInputRange = getIconStaggerInputRange(index, totalIcons);
104
-
105
- // Use interpolation for smooth animation that works both directions
106
- const staggeredProgress = iconsProgress.interpolate({
107
- inputRange: staggerInputRange,
108
- outputRange: [0, 0, 1, 1],
109
- extrapolate: "clamp"
110
- });
111
-
112
- // Spiral animation with interpolation
113
- const spiralRotation = staggeredProgress.interpolate({
114
- inputRange: [0, 1],
115
- outputRange: [Math.PI * 2, 0] // Spiral from 2π to 0
116
- });
117
-
118
- // Distance from center
119
- const distance = staggeredProgress.interpolate({
120
- inputRange: [0, 1],
121
- outputRange: [0, radius]
122
- });
123
-
124
- // Calculate X and Y positions using Animated operations
125
- const translateX = Animated.add(Animated.multiply(distance, spiralRotation.interpolate({
126
- inputRange: [0, Math.PI * 2],
127
- outputRange: [Math.cos(angle), Math.cos(angle + Math.PI * 2)]
128
- })), staggeredProgress.interpolate({
129
- inputRange: [0, 1],
130
- outputRange: [0, finalX - radius * Math.cos(angle + Math.PI * 2)]
131
- }));
132
- const translateY = Animated.add(Animated.multiply(distance, spiralRotation.interpolate({
133
- inputRange: [0, Math.PI * 2],
134
- outputRange: [Math.sin(angle), Math.sin(angle + Math.PI * 2)]
135
- })), staggeredProgress.interpolate({
136
- inputRange: [0, 1],
137
- outputRange: [0, finalY - radius * Math.sin(angle + Math.PI * 2)]
138
- }));
139
-
140
- // Opacity animation
141
- const itemOpacity = staggeredProgress.interpolate({
142
- inputRange: [0, 0.3, 1],
143
- outputRange: [0, 0.3, 1]
144
- });
145
- return {
146
- translateX,
147
- translateY,
148
- itemOpacity,
149
- progressScale: staggeredProgress
150
- };
151
- }, [index, totalIcons, iconsProgress, layout]);
152
-
153
- // Main animated style for position and appearance
154
- const animatedStyle = {
155
- position: "absolute",
156
- left: layout.circleRadius - VIEW_SIZE / 2,
157
- // Center position
158
- top: layout.circleRadius - VIEW_SIZE / 2,
159
- // Center position
160
- opacity: motion.itemOpacity,
161
- transform: [{
162
- translateX: motion.translateX
163
- },
164
- // Apply translation from center
165
- {
166
- translateY: motion.translateY
167
- },
168
- // Apply translation from center
169
- {
170
- scale: Animated.multiply(scale, motion.progressScale)
171
- }]
172
- };
173
-
174
- // Check if this is an empty spot (no icon and no iconComponent)
175
- const isEmpty = icon.icon === null && !icon.iconComponent;
176
- return /*#__PURE__*/_jsx(Animated.View, {
177
- style: [styles.view, animatedStyle, !active && styles.hidden],
178
- children: isEmpty ?
179
- /*#__PURE__*/
180
- // Empty spot - just show a subtle circle
181
- _jsx(View, {
182
- style: styles.emptySpot,
183
- children: /*#__PURE__*/_jsx(View, {
184
- style: styles.emptyDot
185
- })
186
- }) : /*#__PURE__*/_jsxs(Pressable, {
187
- onPress: () => onPress(icon),
188
- onPressIn: handlePressIn,
189
- onPressOut: handlePressOut,
190
- style: styles.pressable,
191
- testID: icon.id ? `buoy-dial-${icon.id}` : undefined,
192
- accessibilityLabel: dialAccessibilityLabel(icon.id, icon.name),
193
- accessibilityRole: "button",
194
- children: [/*#__PURE__*/_jsx(View, {
195
- style: [styles.iconGradientBg, {
196
- backgroundColor: "rgba(0, 0, 0, 0.2)"
197
- }]
198
- }), /*#__PURE__*/_jsx(View, {
199
- style: [styles.iconInnerGlow, {
200
- backgroundColor: "rgba(255, 255, 255, 0.02)"
201
- }]
202
- }), /*#__PURE__*/_jsx(View, {
203
- style: styles.iconWrapper,
204
- children: icon.iconComponent ? (() => {
205
- const IconComp = icon.iconComponent;
206
- return /*#__PURE__*/_jsx(IconComp, {
207
- slot: "dial",
208
- size: DIAL_ICON_GLYPH_SIZE
209
- });
210
- })() : /*#__PURE__*/_jsx(View, {
211
- style: styles.iconClamp,
212
- children: icon.icon
213
- })
214
- }), /*#__PURE__*/_jsx(Text, {
215
- style: styles.label,
216
- numberOfLines: 1,
217
- adjustsFontSizeToFit: true,
218
- minimumFontScale: 0.7,
219
- children: icon.name.toUpperCase()
220
- })]
221
- })
222
- });
223
- };
224
- const styles = StyleSheet.create({
225
- view: {
226
- width: VIEW_SIZE,
227
- height: VIEW_SIZE,
228
- justifyContent: "center",
229
- alignItems: "center"
230
- },
231
- hidden: {
232
- display: "none"
233
- },
234
- pressable: {
235
- width: "100%",
236
- height: "100%",
237
- justifyContent: "center",
238
- alignItems: "center",
239
- padding: 4,
240
- backgroundColor: "transparent"
241
- },
242
- iconGradientBg: {
243
- position: "absolute",
244
- width: "85%",
245
- height: "85%",
246
- borderRadius: 12,
247
- opacity: 0.3
248
- },
249
- iconInnerGlow: {
250
- position: "absolute",
251
- width: "70%",
252
- height: "70%",
253
- borderRadius: 10,
254
- opacity: 0.5
255
- },
256
- iconWrapper: {
257
- marginBottom: 4,
258
- alignItems: "center",
259
- justifyContent: "center"
260
- },
261
- /**
262
- * Hard clamp for PRE-RENDERED icon nodes (icon.icon) — the path where the
263
- * glyph's size is baked in by whoever created the node (consumer custom
264
- * tools) rather than controlled here. The
265
- * fixed overflow-hidden box guarantees an oversized node can never blow past
266
- * its slot and dwarf neighboring icons — worst case it center-crops. The
267
- * iconComponent path stays unclipped: we render it at DIAL_ICON_GLYPH_SIZE
268
- * ourselves, and clipping would shave off the icons' glow shadows.
269
- */
270
- iconClamp: {
271
- width: DIAL_ICON_GLYPH_SIZE,
272
- height: DIAL_ICON_GLYPH_SIZE,
273
- alignItems: "center",
274
- justifyContent: "center",
275
- overflow: "hidden"
276
- },
277
- label: {
278
- fontSize: dialStyles.icon.label.fontSize,
279
- fontWeight: dialStyles.icon.label.fontWeight,
280
- letterSpacing: dialStyles.icon.label.letterSpacing,
281
- fontFamily: dialStyles.icon.label.fontFamily,
282
- marginTop: dialStyles.icon.label.marginTop,
283
- color: dialColors.iconLabel
284
- },
285
- emptySpot: {
286
- width: "100%",
287
- height: "100%",
288
- justifyContent: "center",
289
- alignItems: "center"
290
- },
291
- emptyDot: {
292
- width: dialStyles.emptySlot.dotSize,
293
- height: dialStyles.emptySlot.dotSize,
294
- borderRadius: dialStyles.emptySlot.dotSize / 2,
295
- backgroundColor: dialColors.emptyDotBackground,
296
- borderWidth: dialStyles.emptySlot.borderWidth,
297
- borderColor: dialColors.emptyDotBorder
298
- }
299
- });
1
+ "use strict";import{useMemo as D,useRef as E}from"react";import{StyleSheet as G,Pressable as N,View as l,Text as V,useWindowDimensions as Y,Animated as n}from"react-native";import{getDialLayout as F,getIconPosition as X,getIconStaggerInputRange as Z,DIAL_START_ANGLE as H,DIAL_ICON_SIZE as J,DIAL_ICON_GLYPH_SIZE as b,dialColors as I,dialStyles as o,dialAnimationConfig as U}from"@buoy-gg/floating-tools-core";import{jsx as i,jsxs as q}from"react/jsx-runtime";const P={network:"Network",images:"Images","image-overlay":"Image Overlay",assets:"Assets",query:"React Query",storage:"Storage",env:"Env",console:"Console",events:"Events",redux:"Redux",zustand:"Zustand",jotai:"Jotai","route-events":"Routes","time-machine":"Time Machine",clock:"Clock","highlight-updates":"Highlight Updates","debug-borders":"Debug Borders","perf-monitor":"Bench HUD","js-top":"JS Top","js-top-modal":"JS Top",impersonate:"Impersonate","perf-monitor-modal":"Bench"};function Q(s,t){if(s&&P[s])return P[s];return t}const u=J;export const DialIcon=({index:s,icon:t,iconsProgress:R,onPress:M,totalIcons:d,active:v})=>{const g=E(new n.Value(1)).current;const{width:S}=Y();const c=D(()=>F({screenWidth:S}),[S]);const j=U?.icons??{pressIn:{scale:.95,damping:15,stiffness:400},pressOut:{scale:1,damping:15,stiffness:400}};const{pressIn:m,pressOut:h}=j;const A=()=>{n.spring(g,{toValue:m.scale,damping:m.damping,stiffness:m.stiffness,useNativeDriver:true}).start()};const L=()=>{n.spring(g,{toValue:h.scale,damping:h.damping,stiffness:h.stiffness,useNativeDriver:true}).start()};const p=D(()=>{const y=X(s,d,c.iconRadius,H);const{x:k,y:T,angle:a}=y;const f=c.iconRadius;const W=Z(s,d);const r=R.interpolate({inputRange:W,outputRange:[0,0,1,1],extrapolate:"clamp"});const C=r.interpolate({inputRange:[0,1],outputRange:[Math.PI*2,0]});const w=r.interpolate({inputRange:[0,1],outputRange:[0,f]});const x=n.add(n.multiply(w,C.interpolate({inputRange:[0,Math.PI*2],outputRange:[Math.cos(a),Math.cos(a+Math.PI*2)]})),r.interpolate({inputRange:[0,1],outputRange:[0,k-f*Math.cos(a+Math.PI*2)]}));const z=n.add(n.multiply(w,C.interpolate({inputRange:[0,Math.PI*2],outputRange:[Math.sin(a),Math.sin(a+Math.PI*2)]})),r.interpolate({inputRange:[0,1],outputRange:[0,T-f*Math.sin(a+Math.PI*2)]}));const B=r.interpolate({inputRange:[0,.3,1],outputRange:[0,.3,1]});return{translateX:x,translateY:z,itemOpacity:B,progressScale:r}},[s,d,R,c]);const _={position:"absolute",left:c.circleRadius-u/2,top:c.circleRadius-u/2,opacity:p.itemOpacity,transform:[{translateX:p.translateX},{translateY:p.translateY},{scale:n.multiply(g,p.progressScale)}]};const O=t.icon===null&&!t.iconComponent;return i(n.View,{style:[e.view,_,!v&&e.hidden],children:O?i(l,{style:e.emptySpot,children:i(l,{style:e.emptyDot})}):q(N,{onPress:()=>M(t),onPressIn:A,onPressOut:L,style:e.pressable,testID:t.id?`buoy-dial-${t.id}`:void 0,accessibilityLabel:Q(t.id,t.name),accessibilityRole:"button",children:[i(l,{style:[e.iconGradientBg,{backgroundColor:"rgba(0, 0, 0, 0.2)"}]}),i(l,{style:[e.iconInnerGlow,{backgroundColor:"rgba(255, 255, 255, 0.02)"}]}),i(l,{style:e.iconWrapper,children:t.iconComponent?(()=>{const y=t.iconComponent;return i(y,{slot:"dial",size:b})})():i(l,{style:e.iconClamp,children:t.icon})}),i(V,{style:e.label,numberOfLines:1,adjustsFontSizeToFit:true,minimumFontScale:.7,children:t.name.toUpperCase()})]})})};const e=G.create({view:{width:u,height:u,justifyContent:"center",alignItems:"center"},hidden:{display:"none"},pressable:{width:"100%",height:"100%",justifyContent:"center",alignItems:"center",padding:4,backgroundColor:"transparent"},iconGradientBg:{position:"absolute",width:"85%",height:"85%",borderRadius:12,opacity:.3},iconInnerGlow:{position:"absolute",width:"70%",height:"70%",borderRadius:10,opacity:.5},iconWrapper:{marginBottom:4,alignItems:"center",justifyContent:"center"},iconClamp:{width:b,height:b,alignItems:"center",justifyContent:"center",overflow:"hidden"},label:{fontSize:o.icon.label.fontSize,fontWeight:o.icon.label.fontWeight,letterSpacing:o.icon.label.letterSpacing,fontFamily:o.icon.label.fontFamily,marginTop:o.icon.label.marginTop,color:I.iconLabel},emptySpot:{width:"100%",height:"100%",justifyContent:"center",alignItems:"center"},emptyDot:{width:o.emptySlot.dotSize,height:o.emptySlot.dotSize,borderRadius:o.emptySlot.dotSize/2,backgroundColor:I.emptyDotBackground,borderWidth:o.emptySlot.borderWidth,borderColor:I.emptyDotBorder}});
@@ -1,160 +1 @@
1
- "use strict";
2
-
3
- import { useRef } from "react";
4
- import { Animated, Pressable, StyleSheet, Text, View } from "react-native";
5
- import { ChevronLeft, ChevronRight, monoFont } from "@buoy-gg/shared-ui";
6
- import { dialColors } from "@buoy-gg/floating-tools-core";
7
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
8
- /** Pad a 1-based page number to two digits, e.g. 3 -> "03". */
9
- const pad = n => String(n).padStart(2, "0");
10
- /**
11
- * A single pager button. Press feedback is driven by a native-driver
12
- * `Animated` value via `onPressIn`/`onPressOut` — so the scale reacts
13
- * instantly on the UI thread, with no JS re-render in the press path.
14
- */
15
- const PagerButton = ({
16
- side,
17
- label,
18
- disabled,
19
- onPress
20
- }) => {
21
- const scale = useRef(new Animated.Value(1)).current;
22
- const springTo = toValue => {
23
- Animated.spring(scale, {
24
- toValue,
25
- damping: 15,
26
- stiffness: 400,
27
- useNativeDriver: true
28
- }).start();
29
- };
30
- const accent = disabled ? dialColors.emptyDotBorder : dialColors.accent;
31
- return /*#__PURE__*/_jsx(Animated.View, {
32
- style: {
33
- transform: [{
34
- scale
35
- }]
36
- },
37
- children: /*#__PURE__*/_jsxs(Pressable, {
38
- testID: `buoy-dial-${side}`,
39
- accessibilityRole: "button",
40
- accessibilityLabel: `${side === "prev" ? "Previous" : "Next"} dial page`,
41
- accessibilityState: {
42
- disabled
43
- },
44
- disabled: disabled,
45
- onPress: onPress,
46
- onPressIn: () => !disabled && springTo(0.92),
47
- onPressOut: () => springTo(1),
48
- style: [styles.button, disabled && styles.buttonDisabled],
49
- children: [side === "prev" && /*#__PURE__*/_jsx(ChevronLeft, {
50
- size: 18,
51
- color: accent
52
- }), /*#__PURE__*/_jsx(Text, {
53
- style: [styles.buttonText, disabled && styles.buttonTextDisabled],
54
- children: label
55
- }), side === "next" && /*#__PURE__*/_jsx(ChevronRight, {
56
- size: 18,
57
- color: accent
58
- })]
59
- })
60
- });
61
- };
62
-
63
- /**
64
- * Prev/Next pager shown below the dial when there are more dial tools than
65
- * fit on a single page. Tools are ranked by usage, so paging walks from the
66
- * most-used tools toward the least-used.
67
- */
68
- export const DialPagination = ({
69
- page,
70
- pageCount,
71
- onPrev,
72
- onNext,
73
- animatedStyle
74
- }) => {
75
- return /*#__PURE__*/_jsxs(Animated.View, {
76
- style: [styles.container, animatedStyle],
77
- pointerEvents: "box-none",
78
- children: [/*#__PURE__*/_jsx(PagerButton, {
79
- side: "prev",
80
- label: "PREV",
81
- disabled: page <= 0,
82
- onPress: onPrev
83
- }), /*#__PURE__*/_jsx(View, {
84
- style: styles.indicator,
85
- children: /*#__PURE__*/_jsxs(Text, {
86
- style: styles.indicatorText,
87
- testID: "buoy-dial-page",
88
- children: [pad(page + 1), /*#__PURE__*/_jsxs(Text, {
89
- style: styles.indicatorTextDim,
90
- children: [" / ", pad(pageCount)]
91
- })]
92
- })
93
- }), /*#__PURE__*/_jsx(PagerButton, {
94
- side: "next",
95
- label: "NEXT",
96
- disabled: page >= pageCount - 1,
97
- onPress: onNext
98
- })]
99
- });
100
- };
101
- const styles = StyleSheet.create({
102
- container: {
103
- flexDirection: "row",
104
- alignItems: "center",
105
- justifyContent: "space-between"
106
- },
107
- button: {
108
- flexDirection: "row",
109
- alignItems: "center",
110
- gap: 4,
111
- paddingHorizontal: 16,
112
- paddingVertical: 10,
113
- borderRadius: 10,
114
- borderWidth: 1,
115
- borderColor: dialColors.dialBorder,
116
- backgroundColor: dialColors.dialBackground,
117
- shadowColor: dialColors.dialShadow,
118
- shadowOffset: {
119
- width: 0,
120
- height: 0
121
- },
122
- shadowOpacity: 0.4,
123
- shadowRadius: 8,
124
- elevation: 6
125
- },
126
- buttonDisabled: {
127
- opacity: 0.4
128
- },
129
- buttonText: {
130
- color: dialColors.centerText,
131
- fontSize: 12,
132
- fontWeight: "900",
133
- fontFamily: monoFont,
134
- letterSpacing: 1.5
135
- },
136
- buttonTextDisabled: {
137
- color: dialColors.iconLabelMuted
138
- },
139
- indicator: {
140
- paddingHorizontal: 12,
141
- paddingVertical: 6
142
- },
143
- indicatorText: {
144
- color: dialColors.centerText,
145
- fontSize: 13,
146
- fontWeight: "900",
147
- fontFamily: monoFont,
148
- letterSpacing: 2,
149
- textShadowColor: dialColors.centerTextGlow,
150
- textShadowOffset: {
151
- width: 0,
152
- height: 0
153
- },
154
- textShadowRadius: 6
155
- },
156
- indicatorTextDim: {
157
- color: dialColors.iconLabelMuted,
158
- textShadowRadius: 0
159
- }
160
- });
1
+ "use strict";import{useRef as g}from"react";import{Animated as s,Pressable as m,StyleSheet as y,Text as d,View as w}from"react-native";import{ChevronLeft as S,ChevronRight as T,monoFont as b}from"@buoy-gg/shared-ui";import{dialColors as e}from"@buoy-gg/floating-tools-core";import{jsx as r,jsxs as l}from"react/jsx-runtime";const x=t=>String(t).padStart(2,"0");const p=({side:t,label:n,disabled:o,onPress:c})=>{const a=g(new s.Value(1)).current;const u=f=>{s.spring(a,{toValue:f,damping:15,stiffness:400,useNativeDriver:true}).start()};const h=o?e.emptyDotBorder:e.accent;return r(s.View,{style:{transform:[{scale:a}]},children:l(m,{testID:`buoy-dial-${t}`,accessibilityRole:"button",accessibilityLabel:`${t==="prev"?"Previous":"Next"} dial page`,accessibilityState:{disabled:o},disabled:o,onPress:c,onPressIn:()=>!o&&u(.92),onPressOut:()=>u(1),style:[i.button,o&&i.buttonDisabled],children:[t==="prev"&&r(S,{size:18,color:h}),r(d,{style:[i.buttonText,o&&i.buttonTextDisabled],children:n}),t==="next"&&r(T,{size:18,color:h})]})})};export const DialPagination=({page:t,pageCount:n,onPrev:o,onNext:c,animatedStyle:a})=>{return l(s.View,{style:[i.container,a],pointerEvents:"box-none",children:[r(p,{side:"prev",label:"PREV",disabled:t<=0,onPress:o}),r(w,{style:i.indicator,children:l(d,{style:i.indicatorText,testID:"buoy-dial-page",children:[x(t+1),l(d,{style:i.indicatorTextDim,children:[" / ",x(n)]})]})}),r(p,{side:"next",label:"NEXT",disabled:t>=n-1,onPress:c})]})};const i=y.create({container:{flexDirection:"row",alignItems:"center",justifyContent:"space-between"},button:{flexDirection:"row",alignItems:"center",gap:4,paddingHorizontal:16,paddingVertical:10,borderRadius:10,borderWidth:1,borderColor:e.dialBorder,backgroundColor:e.dialBackground,shadowColor:e.dialShadow,shadowOffset:{width:0,height:0},shadowOpacity:.4,shadowRadius:8,elevation:6},buttonDisabled:{opacity:.4},buttonText:{color:e.centerText,fontSize:12,fontWeight:"900",fontFamily:b,letterSpacing:1.5},buttonTextDisabled:{color:e.iconLabelMuted},indicator:{paddingHorizontal:12,paddingVertical:6},indicatorText:{color:e.centerText,fontSize:13,fontWeight:"900",fontFamily:b,letterSpacing:2,textShadowColor:e.centerTextGlow,textShadowOffset:{width:0,height:0},textShadowRadius:6},indicatorTextDim:{color:e.iconLabelMuted,textShadowRadius:0}});