@buoy-gg/floating-tools-core 7.0.38 → 7.0.40

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 (371) hide show
  1. package/lib/commonjs/FloatingToolsStore.js +512 -1
  2. package/lib/commonjs/colors.js +54 -1
  3. package/lib/commonjs/constants.js +31 -1
  4. package/lib/commonjs/devToolsState.js +325 -1
  5. package/lib/commonjs/dial.js +639 -1
  6. package/lib/commonjs/dialUsage.js +130 -1
  7. package/lib/commonjs/easing.js +69 -1
  8. package/lib/commonjs/floating.js +75 -1
  9. package/lib/commonjs/fonts.js +31 -1
  10. package/lib/commonjs/fonts.web.js +8 -1
  11. package/lib/commonjs/icons/ask-buoy-icon.js +17 -1
  12. package/lib/commonjs/icons/ask-buoy-icon.native.js +32 -1
  13. package/lib/commonjs/icons/assets-icon.js +19 -1
  14. package/lib/commonjs/icons/assets-icon.native.js +17 -1
  15. package/lib/commonjs/icons/benchmark-icon.js +19 -1
  16. package/lib/commonjs/icons/benchmark-icon.native.js +17 -1
  17. package/lib/commonjs/icons/bif-raster-icon.js +49 -1
  18. package/lib/commonjs/icons/bif-raster-icon.native.js +47 -1
  19. package/lib/commonjs/icons/camera-icon.js +19 -1
  20. package/lib/commonjs/icons/camera-icon.native.js +17 -1
  21. package/lib/commonjs/icons/console-icon.js +17 -1
  22. package/lib/commonjs/icons/console-icon.native.js +32 -1
  23. package/lib/commonjs/icons/env-icon.js +19 -1
  24. package/lib/commonjs/icons/env-icon.native.js +17 -1
  25. package/lib/commonjs/icons/events-icon.js +19 -1
  26. package/lib/commonjs/icons/events-icon.native.js +17 -1
  27. package/lib/commonjs/icons/generated/assets-raster.g.js +8 -1
  28. package/lib/commonjs/icons/generated/benchmark-raster.g.js +8 -1
  29. package/lib/commonjs/icons/generated/camera-raster.g.js +8 -1
  30. package/lib/commonjs/icons/generated/env-raster.g.js +8 -1
  31. package/lib/commonjs/icons/generated/events-raster.g.js +8 -1
  32. package/lib/commonjs/icons/generated/glyph-icons.g.js +299 -1
  33. package/lib/commonjs/icons/generated/highlight-raster.g.js +8 -1
  34. package/lib/commonjs/icons/generated/highlighter-raster.g.js +8 -1
  35. package/lib/commonjs/icons/generated/icon-data.g.js +33855 -1
  36. package/lib/commonjs/icons/generated/image-overlay-raster.g.js +8 -1
  37. package/lib/commonjs/icons/generated/images-raster.g.js +8 -1
  38. package/lib/commonjs/icons/generated/network-raster.g.js +8 -1
  39. package/lib/commonjs/icons/generated/raster-icons.g.js +19 -1
  40. package/lib/commonjs/icons/generated/riverpod-raster.g.js +8 -1
  41. package/lib/commonjs/icons/generated/routes-raster.g.js +8 -1
  42. package/lib/commonjs/icons/generated/settings-raster.g.js +8 -1
  43. package/lib/commonjs/icons/generated/storage-raster.g.js +8 -1
  44. package/lib/commonjs/icons/generated/wifi-raster.g.js +8 -1
  45. package/lib/commonjs/icons/highlight-icon.js +19 -1
  46. package/lib/commonjs/icons/highlight-icon.native.js +17 -1
  47. package/lib/commonjs/icons/highlighter-icon.js +27 -1
  48. package/lib/commonjs/icons/highlighter-icon.native.js +25 -1
  49. package/lib/commonjs/icons/icon-factories.js +173 -1
  50. package/lib/commonjs/icons/icon-primitives.js +676 -1
  51. package/lib/commonjs/icons/icon-primitives.native.js +904 -1
  52. package/lib/commonjs/icons/icon-renderer.js +307 -1
  53. package/lib/commonjs/icons/iconGlow.js +32 -1
  54. package/lib/commonjs/icons/image-overlay-icon.js +19 -1
  55. package/lib/commonjs/icons/image-overlay-icon.native.js +17 -1
  56. package/lib/commonjs/icons/images-icon.js +19 -1
  57. package/lib/commonjs/icons/images-icon.native.js +17 -1
  58. package/lib/commonjs/icons/impersonate-icon.js +17 -1
  59. package/lib/commonjs/icons/impersonate-icon.native.js +32 -1
  60. package/lib/commonjs/icons/jotai-icon.js +17 -1
  61. package/lib/commonjs/icons/jotai-icon.native.js +34 -1
  62. package/lib/commonjs/icons/network-icon.js +19 -1
  63. package/lib/commonjs/icons/network-icon.native.js +17 -1
  64. package/lib/commonjs/icons/query-icon.js +17 -1
  65. package/lib/commonjs/icons/query-icon.native.js +34 -1
  66. package/lib/commonjs/icons/raster-icon.js +51 -1
  67. package/lib/commonjs/icons/redux-icon.js +17 -1
  68. package/lib/commonjs/icons/redux-icon.native.js +35 -1
  69. package/lib/commonjs/icons/renders-icon.js +30 -1
  70. package/lib/commonjs/icons/renders-icon.native.js +30 -1
  71. package/lib/commonjs/icons/riverpod-icon.js +19 -1
  72. package/lib/commonjs/icons/riverpod-icon.native.js +17 -1
  73. package/lib/commonjs/icons/routes-icon.js +35 -1
  74. package/lib/commonjs/icons/routes-icon.native.js +33 -1
  75. package/lib/commonjs/icons/routes-parts.js +47 -1
  76. package/lib/commonjs/icons/scenarios-icon.js +17 -1
  77. package/lib/commonjs/icons/scenarios-icon.native.js +32 -1
  78. package/lib/commonjs/icons/sentry-icon.js +17 -1
  79. package/lib/commonjs/icons/sentry-icon.native.js +36 -1
  80. package/lib/commonjs/icons/settings-icon.js +13 -1
  81. package/lib/commonjs/icons/settings-icon.native.js +11 -1
  82. package/lib/commonjs/icons/storage-icon.js +19 -1
  83. package/lib/commonjs/icons/storage-icon.native.js +17 -1
  84. package/lib/commonjs/icons/time-machine-icon.js +17 -1
  85. package/lib/commonjs/icons/time-machine-icon.native.js +32 -1
  86. package/lib/commonjs/icons/wifi-icon.js +19 -1
  87. package/lib/commonjs/icons/wifi-icon.native.js +17 -1
  88. package/lib/commonjs/icons/zustand-icon.js +17 -1
  89. package/lib/commonjs/icons/zustand-icon.native.js +34 -1
  90. package/lib/commonjs/index.js +1099 -1
  91. package/lib/commonjs/settings.js +601 -1
  92. package/lib/commonjs/utils.js +72 -1
  93. package/lib/module/FloatingToolsStore.js +507 -1
  94. package/lib/module/colors.js +49 -1
  95. package/lib/module/constants.js +27 -1
  96. package/lib/module/devToolsState.js +318 -1
  97. package/lib/module/dial.js +624 -1
  98. package/lib/module/dialUsage.js +122 -1
  99. package/lib/module/easing.js +62 -1
  100. package/lib/module/floating.js +9 -1
  101. package/lib/module/fonts.js +28 -1
  102. package/lib/module/fonts.web.js +4 -1
  103. package/lib/module/icons/ask-buoy-icon.js +6 -1
  104. package/lib/module/icons/ask-buoy-icon.native.js +23 -1
  105. package/lib/module/icons/assets-icon.js +8 -1
  106. package/lib/module/icons/assets-icon.native.js +7 -1
  107. package/lib/module/icons/benchmark-icon.js +8 -1
  108. package/lib/module/icons/benchmark-icon.native.js +7 -1
  109. package/lib/module/icons/bif-raster-icon.js +46 -1
  110. package/lib/module/icons/bif-raster-icon.native.js +44 -1
  111. package/lib/module/icons/camera-icon.js +8 -1
  112. package/lib/module/icons/camera-icon.native.js +7 -1
  113. package/lib/module/icons/console-icon.js +6 -1
  114. package/lib/module/icons/console-icon.native.js +23 -1
  115. package/lib/module/icons/env-icon.js +8 -1
  116. package/lib/module/icons/env-icon.native.js +7 -1
  117. package/lib/module/icons/events-icon.js +8 -1
  118. package/lib/module/icons/events-icon.native.js +7 -1
  119. package/lib/module/icons/generated/assets-raster.g.js +4 -1
  120. package/lib/module/icons/generated/benchmark-raster.g.js +4 -1
  121. package/lib/module/icons/generated/camera-raster.g.js +4 -1
  122. package/lib/module/icons/generated/env-raster.g.js +4 -1
  123. package/lib/module/icons/generated/events-raster.g.js +4 -1
  124. package/lib/module/icons/generated/glyph-icons.g.js +296 -1
  125. package/lib/module/icons/generated/highlight-raster.g.js +4 -1
  126. package/lib/module/icons/generated/highlighter-raster.g.js +4 -1
  127. package/lib/module/icons/generated/icon-data.g.js +33850 -1
  128. package/lib/module/icons/generated/image-overlay-raster.g.js +4 -1
  129. package/lib/module/icons/generated/images-raster.g.js +4 -1
  130. package/lib/module/icons/generated/network-raster.g.js +4 -1
  131. package/lib/module/icons/generated/raster-icons.g.js +15 -1
  132. package/lib/module/icons/generated/riverpod-raster.g.js +4 -1
  133. package/lib/module/icons/generated/routes-raster.g.js +4 -1
  134. package/lib/module/icons/generated/settings-raster.g.js +4 -1
  135. package/lib/module/icons/generated/storage-raster.g.js +4 -1
  136. package/lib/module/icons/generated/wifi-raster.g.js +4 -1
  137. package/lib/module/icons/highlight-icon.js +8 -1
  138. package/lib/module/icons/highlight-icon.native.js +7 -1
  139. package/lib/module/icons/highlighter-icon.js +10 -1
  140. package/lib/module/icons/highlighter-icon.native.js +9 -1
  141. package/lib/module/icons/icon-factories.js +163 -1
  142. package/lib/module/icons/icon-primitives.js +673 -1
  143. package/lib/module/icons/icon-primitives.native.js +899 -1
  144. package/lib/module/icons/icon-renderer.js +302 -1
  145. package/lib/module/icons/iconGlow.js +28 -1
  146. package/lib/module/icons/image-overlay-icon.js +8 -1
  147. package/lib/module/icons/image-overlay-icon.native.js +7 -1
  148. package/lib/module/icons/images-icon.js +8 -1
  149. package/lib/module/icons/images-icon.native.js +7 -1
  150. package/lib/module/icons/impersonate-icon.js +6 -1
  151. package/lib/module/icons/impersonate-icon.native.js +23 -1
  152. package/lib/module/icons/jotai-icon.js +6 -1
  153. package/lib/module/icons/jotai-icon.native.js +25 -1
  154. package/lib/module/icons/network-icon.js +8 -1
  155. package/lib/module/icons/network-icon.native.js +7 -1
  156. package/lib/module/icons/query-icon.js +6 -1
  157. package/lib/module/icons/query-icon.native.js +25 -1
  158. package/lib/module/icons/raster-icon.js +48 -1
  159. package/lib/module/icons/redux-icon.js +6 -1
  160. package/lib/module/icons/redux-icon.native.js +26 -1
  161. package/lib/module/icons/renders-icon.js +3 -1
  162. package/lib/module/icons/renders-icon.native.js +3 -1
  163. package/lib/module/icons/riverpod-icon.js +8 -1
  164. package/lib/module/icons/riverpod-icon.native.js +7 -1
  165. package/lib/module/icons/routes-icon.js +9 -1
  166. package/lib/module/icons/routes-icon.native.js +8 -1
  167. package/lib/module/icons/routes-parts.js +40 -1
  168. package/lib/module/icons/scenarios-icon.js +6 -1
  169. package/lib/module/icons/scenarios-icon.native.js +23 -1
  170. package/lib/module/icons/sentry-icon.js +6 -1
  171. package/lib/module/icons/sentry-icon.native.js +27 -1
  172. package/lib/module/icons/settings-icon.js +7 -1
  173. package/lib/module/icons/settings-icon.native.js +6 -1
  174. package/lib/module/icons/storage-icon.js +8 -1
  175. package/lib/module/icons/storage-icon.native.js +7 -1
  176. package/lib/module/icons/time-machine-icon.js +6 -1
  177. package/lib/module/icons/time-machine-icon.native.js +23 -1
  178. package/lib/module/icons/wifi-icon.js +8 -1
  179. package/lib/module/icons/wifi-icon.native.js +7 -1
  180. package/lib/module/icons/zustand-icon.js +6 -1
  181. package/lib/module/icons/zustand-icon.native.js +25 -1
  182. package/lib/module/index.js +128 -1
  183. package/lib/module/settings.js +589 -1
  184. package/lib/module/utils.js +66 -1
  185. package/lib/typescript/commonjs/FloatingToolsStore.d.ts.map +1 -0
  186. package/lib/typescript/commonjs/colors.d.ts.map +1 -0
  187. package/lib/typescript/commonjs/constants.d.ts.map +1 -0
  188. package/lib/typescript/commonjs/devToolsState.d.ts.map +1 -0
  189. package/lib/typescript/commonjs/dial.d.ts.map +1 -0
  190. package/lib/typescript/commonjs/dialUsage.d.ts.map +1 -0
  191. package/lib/typescript/commonjs/easing.d.ts.map +1 -0
  192. package/lib/typescript/commonjs/floating.d.ts.map +1 -0
  193. package/lib/typescript/commonjs/fonts.d.ts.map +1 -0
  194. package/lib/typescript/commonjs/fonts.web.d.ts.map +1 -0
  195. package/lib/typescript/commonjs/icons/ask-buoy-icon.d.ts.map +1 -0
  196. package/lib/typescript/commonjs/icons/ask-buoy-icon.native.d.ts.map +1 -0
  197. package/lib/typescript/commonjs/icons/assets-icon.d.ts.map +1 -0
  198. package/lib/typescript/commonjs/icons/assets-icon.native.d.ts.map +1 -0
  199. package/lib/typescript/commonjs/icons/benchmark-icon.d.ts.map +1 -0
  200. package/lib/typescript/commonjs/icons/benchmark-icon.native.d.ts.map +1 -0
  201. package/lib/typescript/commonjs/icons/bif-raster-icon.d.ts.map +1 -0
  202. package/lib/typescript/commonjs/icons/bif-raster-icon.native.d.ts.map +1 -0
  203. package/lib/typescript/commonjs/icons/camera-icon.d.ts.map +1 -0
  204. package/lib/typescript/commonjs/icons/camera-icon.native.d.ts.map +1 -0
  205. package/lib/typescript/commonjs/icons/console-icon.d.ts.map +1 -0
  206. package/lib/typescript/commonjs/icons/console-icon.native.d.ts.map +1 -0
  207. package/lib/typescript/commonjs/icons/env-icon.d.ts.map +1 -0
  208. package/lib/typescript/commonjs/icons/env-icon.native.d.ts.map +1 -0
  209. package/lib/typescript/commonjs/icons/events-icon.d.ts.map +1 -0
  210. package/lib/typescript/commonjs/icons/events-icon.native.d.ts.map +1 -0
  211. package/lib/typescript/commonjs/icons/generated/assets-raster.g.d.ts.map +1 -0
  212. package/lib/typescript/commonjs/icons/generated/benchmark-raster.g.d.ts.map +1 -0
  213. package/lib/typescript/commonjs/icons/generated/camera-raster.g.d.ts.map +1 -0
  214. package/lib/typescript/commonjs/icons/generated/env-raster.g.d.ts.map +1 -0
  215. package/lib/typescript/commonjs/icons/generated/events-raster.g.d.ts.map +1 -0
  216. package/lib/typescript/commonjs/icons/generated/glyph-icons.g.d.ts.map +1 -0
  217. package/lib/typescript/commonjs/icons/generated/highlight-raster.g.d.ts.map +1 -0
  218. package/lib/typescript/commonjs/icons/generated/highlighter-raster.g.d.ts.map +1 -0
  219. package/lib/typescript/commonjs/icons/generated/icon-data.g.d.ts.map +1 -0
  220. package/lib/typescript/commonjs/icons/generated/image-overlay-raster.g.d.ts.map +1 -0
  221. package/lib/typescript/commonjs/icons/generated/images-raster.g.d.ts.map +1 -0
  222. package/lib/typescript/commonjs/icons/generated/network-raster.g.d.ts.map +1 -0
  223. package/lib/typescript/commonjs/icons/generated/raster-icons.g.d.ts.map +1 -0
  224. package/lib/typescript/commonjs/icons/generated/riverpod-raster.g.d.ts.map +1 -0
  225. package/lib/typescript/commonjs/icons/generated/routes-raster.g.d.ts.map +1 -0
  226. package/lib/typescript/commonjs/icons/generated/settings-raster.g.d.ts.map +1 -0
  227. package/lib/typescript/commonjs/icons/generated/storage-raster.g.d.ts.map +1 -0
  228. package/lib/typescript/commonjs/icons/generated/wifi-raster.g.d.ts.map +1 -0
  229. package/lib/typescript/commonjs/icons/highlight-icon.d.ts.map +1 -0
  230. package/lib/typescript/commonjs/icons/highlight-icon.native.d.ts.map +1 -0
  231. package/lib/typescript/commonjs/icons/highlighter-icon.d.ts.map +1 -0
  232. package/lib/typescript/commonjs/icons/highlighter-icon.native.d.ts.map +1 -0
  233. package/lib/typescript/commonjs/icons/icon-factories.d.ts.map +1 -0
  234. package/lib/typescript/commonjs/icons/icon-primitives.d.ts.map +1 -0
  235. package/lib/typescript/commonjs/icons/icon-primitives.native.d.ts.map +1 -0
  236. package/lib/typescript/commonjs/icons/icon-renderer.d.ts.map +1 -0
  237. package/lib/typescript/commonjs/icons/iconGlow.d.ts.map +1 -0
  238. package/lib/typescript/commonjs/icons/image-overlay-icon.d.ts.map +1 -0
  239. package/lib/typescript/commonjs/icons/image-overlay-icon.native.d.ts.map +1 -0
  240. package/lib/typescript/commonjs/icons/images-icon.d.ts.map +1 -0
  241. package/lib/typescript/commonjs/icons/images-icon.native.d.ts.map +1 -0
  242. package/lib/typescript/commonjs/icons/impersonate-icon.d.ts.map +1 -0
  243. package/lib/typescript/commonjs/icons/impersonate-icon.native.d.ts.map +1 -0
  244. package/lib/typescript/commonjs/icons/jotai-icon.d.ts.map +1 -0
  245. package/lib/typescript/commonjs/icons/jotai-icon.native.d.ts.map +1 -0
  246. package/lib/typescript/commonjs/icons/network-icon.d.ts.map +1 -0
  247. package/lib/typescript/commonjs/icons/network-icon.native.d.ts.map +1 -0
  248. package/lib/typescript/commonjs/icons/query-icon.d.ts.map +1 -0
  249. package/lib/typescript/commonjs/icons/query-icon.native.d.ts.map +1 -0
  250. package/lib/typescript/commonjs/icons/raster-icon.d.ts.map +1 -0
  251. package/lib/typescript/commonjs/icons/redux-icon.d.ts.map +1 -0
  252. package/lib/typescript/commonjs/icons/redux-icon.native.d.ts.map +1 -0
  253. package/lib/typescript/commonjs/icons/renders-icon.d.ts.map +1 -0
  254. package/lib/typescript/commonjs/icons/renders-icon.native.d.ts.map +1 -0
  255. package/lib/typescript/commonjs/icons/riverpod-icon.d.ts.map +1 -0
  256. package/lib/typescript/commonjs/icons/riverpod-icon.native.d.ts.map +1 -0
  257. package/lib/typescript/commonjs/icons/routes-icon.d.ts.map +1 -0
  258. package/lib/typescript/commonjs/icons/routes-icon.native.d.ts.map +1 -0
  259. package/lib/typescript/commonjs/icons/routes-parts.d.ts.map +1 -0
  260. package/lib/typescript/commonjs/icons/scenarios-icon.d.ts.map +1 -0
  261. package/lib/typescript/commonjs/icons/scenarios-icon.native.d.ts.map +1 -0
  262. package/lib/typescript/commonjs/icons/sentry-icon.d.ts.map +1 -0
  263. package/lib/typescript/commonjs/icons/sentry-icon.native.d.ts.map +1 -0
  264. package/lib/typescript/commonjs/icons/settings-icon.d.ts.map +1 -0
  265. package/lib/typescript/commonjs/icons/settings-icon.native.d.ts.map +1 -0
  266. package/lib/typescript/commonjs/icons/storage-icon.d.ts.map +1 -0
  267. package/lib/typescript/commonjs/icons/storage-icon.native.d.ts.map +1 -0
  268. package/lib/typescript/commonjs/icons/time-machine-icon.d.ts.map +1 -0
  269. package/lib/typescript/commonjs/icons/time-machine-icon.native.d.ts.map +1 -0
  270. package/lib/typescript/commonjs/icons/wifi-icon.d.ts.map +1 -0
  271. package/lib/typescript/commonjs/icons/wifi-icon.native.d.ts.map +1 -0
  272. package/lib/typescript/commonjs/icons/zustand-icon.d.ts.map +1 -0
  273. package/lib/typescript/commonjs/icons/zustand-icon.native.d.ts.map +1 -0
  274. package/lib/typescript/commonjs/index.d.ts.map +1 -0
  275. package/lib/typescript/commonjs/settings.d.ts.map +1 -0
  276. package/lib/typescript/commonjs/types.d.ts.map +1 -0
  277. package/lib/typescript/commonjs/utils.d.ts.map +1 -0
  278. package/lib/typescript/module/FloatingToolsStore.d.ts.map +1 -0
  279. package/lib/typescript/module/colors.d.ts.map +1 -0
  280. package/lib/typescript/module/constants.d.ts.map +1 -0
  281. package/lib/typescript/module/devToolsState.d.ts.map +1 -0
  282. package/lib/typescript/module/dial.d.ts.map +1 -0
  283. package/lib/typescript/module/dialUsage.d.ts.map +1 -0
  284. package/lib/typescript/module/easing.d.ts.map +1 -0
  285. package/lib/typescript/module/floating.d.ts.map +1 -0
  286. package/lib/typescript/module/fonts.d.ts.map +1 -0
  287. package/lib/typescript/module/fonts.web.d.ts.map +1 -0
  288. package/lib/typescript/module/icons/ask-buoy-icon.d.ts.map +1 -0
  289. package/lib/typescript/module/icons/ask-buoy-icon.native.d.ts.map +1 -0
  290. package/lib/typescript/module/icons/assets-icon.d.ts.map +1 -0
  291. package/lib/typescript/module/icons/assets-icon.native.d.ts.map +1 -0
  292. package/lib/typescript/module/icons/benchmark-icon.d.ts.map +1 -0
  293. package/lib/typescript/module/icons/benchmark-icon.native.d.ts.map +1 -0
  294. package/lib/typescript/module/icons/bif-raster-icon.d.ts.map +1 -0
  295. package/lib/typescript/module/icons/bif-raster-icon.native.d.ts.map +1 -0
  296. package/lib/typescript/module/icons/camera-icon.d.ts.map +1 -0
  297. package/lib/typescript/module/icons/camera-icon.native.d.ts.map +1 -0
  298. package/lib/typescript/module/icons/console-icon.d.ts.map +1 -0
  299. package/lib/typescript/module/icons/console-icon.native.d.ts.map +1 -0
  300. package/lib/typescript/module/icons/env-icon.d.ts.map +1 -0
  301. package/lib/typescript/module/icons/env-icon.native.d.ts.map +1 -0
  302. package/lib/typescript/module/icons/events-icon.d.ts.map +1 -0
  303. package/lib/typescript/module/icons/events-icon.native.d.ts.map +1 -0
  304. package/lib/typescript/module/icons/generated/assets-raster.g.d.ts.map +1 -0
  305. package/lib/typescript/module/icons/generated/benchmark-raster.g.d.ts.map +1 -0
  306. package/lib/typescript/module/icons/generated/camera-raster.g.d.ts.map +1 -0
  307. package/lib/typescript/module/icons/generated/env-raster.g.d.ts.map +1 -0
  308. package/lib/typescript/module/icons/generated/events-raster.g.d.ts.map +1 -0
  309. package/lib/typescript/module/icons/generated/glyph-icons.g.d.ts.map +1 -0
  310. package/lib/typescript/module/icons/generated/highlight-raster.g.d.ts.map +1 -0
  311. package/lib/typescript/module/icons/generated/highlighter-raster.g.d.ts.map +1 -0
  312. package/lib/typescript/module/icons/generated/icon-data.g.d.ts.map +1 -0
  313. package/lib/typescript/module/icons/generated/image-overlay-raster.g.d.ts.map +1 -0
  314. package/lib/typescript/module/icons/generated/images-raster.g.d.ts.map +1 -0
  315. package/lib/typescript/module/icons/generated/network-raster.g.d.ts.map +1 -0
  316. package/lib/typescript/module/icons/generated/raster-icons.g.d.ts.map +1 -0
  317. package/lib/typescript/module/icons/generated/riverpod-raster.g.d.ts.map +1 -0
  318. package/lib/typescript/module/icons/generated/routes-raster.g.d.ts.map +1 -0
  319. package/lib/typescript/module/icons/generated/settings-raster.g.d.ts.map +1 -0
  320. package/lib/typescript/module/icons/generated/storage-raster.g.d.ts.map +1 -0
  321. package/lib/typescript/module/icons/generated/wifi-raster.g.d.ts.map +1 -0
  322. package/lib/typescript/module/icons/highlight-icon.d.ts.map +1 -0
  323. package/lib/typescript/module/icons/highlight-icon.native.d.ts.map +1 -0
  324. package/lib/typescript/module/icons/highlighter-icon.d.ts.map +1 -0
  325. package/lib/typescript/module/icons/highlighter-icon.native.d.ts.map +1 -0
  326. package/lib/typescript/module/icons/icon-factories.d.ts.map +1 -0
  327. package/lib/typescript/module/icons/icon-primitives.d.ts.map +1 -0
  328. package/lib/typescript/module/icons/icon-primitives.native.d.ts.map +1 -0
  329. package/lib/typescript/module/icons/icon-renderer.d.ts.map +1 -0
  330. package/lib/typescript/module/icons/iconGlow.d.ts.map +1 -0
  331. package/lib/typescript/module/icons/image-overlay-icon.d.ts.map +1 -0
  332. package/lib/typescript/module/icons/image-overlay-icon.native.d.ts.map +1 -0
  333. package/lib/typescript/module/icons/images-icon.d.ts.map +1 -0
  334. package/lib/typescript/module/icons/images-icon.native.d.ts.map +1 -0
  335. package/lib/typescript/module/icons/impersonate-icon.d.ts.map +1 -0
  336. package/lib/typescript/module/icons/impersonate-icon.native.d.ts.map +1 -0
  337. package/lib/typescript/module/icons/jotai-icon.d.ts.map +1 -0
  338. package/lib/typescript/module/icons/jotai-icon.native.d.ts.map +1 -0
  339. package/lib/typescript/module/icons/network-icon.d.ts.map +1 -0
  340. package/lib/typescript/module/icons/network-icon.native.d.ts.map +1 -0
  341. package/lib/typescript/module/icons/query-icon.d.ts.map +1 -0
  342. package/lib/typescript/module/icons/query-icon.native.d.ts.map +1 -0
  343. package/lib/typescript/module/icons/raster-icon.d.ts.map +1 -0
  344. package/lib/typescript/module/icons/redux-icon.d.ts.map +1 -0
  345. package/lib/typescript/module/icons/redux-icon.native.d.ts.map +1 -0
  346. package/lib/typescript/module/icons/renders-icon.d.ts.map +1 -0
  347. package/lib/typescript/module/icons/renders-icon.native.d.ts.map +1 -0
  348. package/lib/typescript/module/icons/riverpod-icon.d.ts.map +1 -0
  349. package/lib/typescript/module/icons/riverpod-icon.native.d.ts.map +1 -0
  350. package/lib/typescript/module/icons/routes-icon.d.ts.map +1 -0
  351. package/lib/typescript/module/icons/routes-icon.native.d.ts.map +1 -0
  352. package/lib/typescript/module/icons/routes-parts.d.ts.map +1 -0
  353. package/lib/typescript/module/icons/scenarios-icon.d.ts.map +1 -0
  354. package/lib/typescript/module/icons/scenarios-icon.native.d.ts.map +1 -0
  355. package/lib/typescript/module/icons/sentry-icon.d.ts.map +1 -0
  356. package/lib/typescript/module/icons/sentry-icon.native.d.ts.map +1 -0
  357. package/lib/typescript/module/icons/settings-icon.d.ts.map +1 -0
  358. package/lib/typescript/module/icons/settings-icon.native.d.ts.map +1 -0
  359. package/lib/typescript/module/icons/storage-icon.d.ts.map +1 -0
  360. package/lib/typescript/module/icons/storage-icon.native.d.ts.map +1 -0
  361. package/lib/typescript/module/icons/time-machine-icon.d.ts.map +1 -0
  362. package/lib/typescript/module/icons/time-machine-icon.native.d.ts.map +1 -0
  363. package/lib/typescript/module/icons/wifi-icon.d.ts.map +1 -0
  364. package/lib/typescript/module/icons/wifi-icon.native.d.ts.map +1 -0
  365. package/lib/typescript/module/icons/zustand-icon.d.ts.map +1 -0
  366. package/lib/typescript/module/icons/zustand-icon.native.d.ts.map +1 -0
  367. package/lib/typescript/module/index.d.ts.map +1 -0
  368. package/lib/typescript/module/settings.d.ts.map +1 -0
  369. package/lib/typescript/module/types.d.ts.map +1 -0
  370. package/lib/typescript/module/utils.d.ts.map +1 -0
  371. package/package.json +1 -1
@@ -1 +1,507 @@
1
- "use strict";import{VISIBLE_HANDLE_WIDTH,DRAG_THRESHOLD,EDGE_PADDING,SAVE_DEBOUNCE_MS,STORAGE_KEYS}from"./constants.js";export class FloatingToolsStore{isDragging=!1;isHidden=!1;dragStartPos={x:0,y:0};dragStartMouse={x:0,y:0};hasMoved=!1;savedPosition=null;saveTimeout=null;isInitialized=!1;listeners=new Set;constructor(i){this.screenWidth=i.screenWidth,this.screenHeight=i.screenHeight,this.bubbleSize=i.initialBubbleSize??{width:100,height:32},this.minPosition=i.minPosition??{x:EDGE_PADDING,y:EDGE_PADDING},this.visibleHandleWidth=i.visibleHandleWidth??VISIBLE_HANDLE_WIDTH,this.dragThreshold=i.dragThreshold??DRAG_THRESHOLD,this.edgePadding=i.edgePadding??EDGE_PADDING,this.enablePositionPersistence=i.enablePositionPersistence??!0,this.storage=i.storage,this.onPositionChange=i.onPositionChange,this.onHiddenChange=i.onHiddenChange,this.onDraggingChange=i.onDraggingChange,this.position=i.initialPosition??{x:this.screenWidth-this.bubbleSize.width-20,y:Math.max(this.minPosition.y,Math.min(100,this.screenHeight-this.bubbleSize.height-this.edgePadding))},this.stateSnapshot=this.createSnapshot()}subscribe=i=>(this.listeners.add(i),()=>this.listeners.delete(i));getSnapshot=()=>this.stateSnapshot;createSnapshot(){return{position:{...this.position},isDragging:this.isDragging,isHidden:this.isHidden,bubbleSize:{...this.bubbleSize}}}notify(){this.stateSnapshot=this.createSnapshot(),this.listeners.forEach(i=>i())}async initialize(){if(!this.isInitialized&&this.enablePositionPersistence&&this.storage){try{const[i,t]=await Promise.all([this.storage.getItem(STORAGE_KEYS.POSITION_X),this.storage.getItem(STORAGE_KEYS.POSITION_Y)]);if(null!==i&&null!==t){const s=parseFloat(i),e=parseFloat(t);if(!Number.isNaN(s)&&!Number.isNaN(e)){const i={x:s,y:e},t=this.validatePosition(i);(Math.abs(i.x-t.x)>5||Math.abs(i.y-t.y)>5)&&this.savePosition(t.x,t.y),this.position=t,t.x>=this.screenWidth-this.visibleHandleWidth-5&&(this.isHidden=!0),this.notify()}}}catch{}this.isInitialized=!0}else this.isInitialized=!0}getBounds(){return{minX:this.minPosition.x,maxX:this.screenWidth-this.visibleHandleWidth,minY:this.minPosition.y,maxY:this.screenHeight-this.bubbleSize.height-this.edgePadding}}validatePosition(i){const t=this.getBounds();return{x:Math.max(t.minX,Math.min(i.x,t.maxX)),y:Math.max(t.minY,Math.min(i.y,t.maxY))}}setPosition(i){this.position=i,this.onPositionChange?.(i),this.notify()}setBubbleSize(i){this.bubbleSize.width===i.width&&this.bubbleSize.height===i.height||(this.bubbleSize=i,this.isDragging||this.reconcileBounds(),this.notify())}setScreenSize(i,t){this.screenWidth=i,this.screenHeight=t,this.reconcileBounds(),this.notify()}reconcileBounds(){const i=i=>({x:Math.max(this.minPosition.x,Math.min(i.x,this.screenWidth-this.bubbleSize.width-this.edgePadding)),y:Math.max(this.minPosition.y,Math.min(i.y,this.screenHeight-this.bubbleSize.height-this.edgePadding))}),t=i(this.position);this.position=this.isHidden?{...t,x:this.screenWidth-this.visibleHandleWidth}:t,this.savedPosition&&(this.savedPosition=i(this.savedPosition))}setMinPosition(i){this.minPosition=i}async savePosition(i,t){if(this.enablePositionPersistence&&this.storage)try{await Promise.all([this.storage.setItem(STORAGE_KEYS.POSITION_X,i.toString()),this.storage.setItem(STORAGE_KEYS.POSITION_Y,t.toString())])}catch{}}debouncedSavePosition(i,t){this.saveTimeout&&clearTimeout(this.saveTimeout),this.saveTimeout=setTimeout(()=>this.savePosition(i,t),SAVE_DEBOUNCE_MS)}toggleHideShow(){const i=this.position.x>this.screenWidth-this.bubbleSize.width/2;if(this.isHidden||i){let i,t;return this.savedPosition&&this.savedPosition.x<this.screenWidth-this.bubbleSize.width/2?(i=this.savedPosition.x,t=this.savedPosition.y):(i=this.screenWidth-this.bubbleSize.width-20,t=this.position.y),this.isHidden=!1,this.onHiddenChange?.(!1),this.notify(),{targetPosition:{x:i,y:t},isHiding:!1}}{this.savedPosition={...this.position};const i=this.screenWidth-this.visibleHandleWidth;return this.isHidden=!0,this.onHiddenChange?.(!0),this.notify(),{targetPosition:{x:i,y:this.position.y},isHiding:!0}}}forceHide(){if(this.isHidden)return{targetPosition:this.position};this.savedPosition={...this.position};const i=this.screenWidth-this.visibleHandleWidth;return this.isHidden=!0,this.onHiddenChange?.(!0),this.notify(),{targetPosition:{x:i,y:this.position.y}}}forceShow(){if(!this.isHidden)return{targetPosition:this.position};let i,t;return this.savedPosition?(i=this.savedPosition.x,t=this.savedPosition.y):(i=this.screenWidth-this.bubbleSize.width-20,t=this.position.y),this.isHidden=!1,this.onHiddenChange?.(!1),this.notify(),{targetPosition:{x:i,y:t}}}handleDragStart(i){this.hasMoved=!1,this.dragStartPos={...this.position},this.dragStartMouse={x:i.clientX,y:i.clientY}}handleDragMove(i){const t=i.clientX-this.dragStartMouse.x,s=i.clientY-this.dragStartMouse.y,e=Math.abs(t)+Math.abs(s);if(!this.hasMoved&&e>this.dragThreshold&&(this.hasMoved=!0,this.isDragging=!0,this.onDraggingChange?.(!0),this.notify()),this.hasMoved){const i=this.dragStartPos.x+t,e=this.dragStartPos.y+s,h=this.getBounds(),n=Math.max(h.minX,Math.min(i,this.screenWidth-this.visibleHandleWidth+this.bubbleSize.width)),o=Math.max(h.minY,Math.min(e,h.maxY));return this.position={x:n,y:o},this.onPositionChange?.(this.position),this.notify(),{position:this.position,isDragging:!0}}return{position:this.position,isDragging:!1}}handleDragEnd(i){if(!this.hasMoved)return this.isDragging=!1,this.onDraggingChange?.(!1),this.notify(),{position:this.position,shouldHide:!1,wasTap:!0};const t=i.clientX-this.dragStartMouse.x,s=i.clientY-this.dragStartMouse.y,e=this.dragStartPos.x+t,h=this.dragStartPos.y+s,n=e+this.bubbleSize.width/2>this.screenWidth,o=this.getBounds();if(n){const i=this.screenWidth-this.visibleHandleWidth,t=Math.max(o.minY,Math.min(h,o.maxY));return this.isHidden=!0,this.onHiddenChange?.(!0),this.isDragging=!1,this.onDraggingChange?.(!1),this.notify(),{position:{x:i,y:t},shouldHide:!0,wasTap:!1}}{this.isHidden&&e<this.screenWidth-this.visibleHandleWidth-10&&(this.isHidden=!1,this.onHiddenChange?.(!1));const i=Math.max(o.minX,Math.min(e,this.screenWidth-this.bubbleSize.width-this.edgePadding)),t=Math.max(o.minY,Math.min(h,o.maxY));return i<this.screenWidth-this.bubbleSize.width/2&&(this.savedPosition={x:i,y:t}),this.position={x:i,y:t},this.isDragging=!1,this.onDraggingChange?.(!1),this.debouncedSavePosition(i,t),this.notify(),{position:{x:i,y:t},shouldHide:!1,wasTap:!1}}}commitPosition(i){this.position=i,this.savePosition(i.x,i.y),this.notify()}destroy(){this.saveTimeout&&(clearTimeout(this.saveTimeout),this.saveTimeout=null),this.listeners.clear()}}
1
+ "use strict";
2
+
3
+ /**
4
+ * FloatingToolsStore - Headless state management for floating tools.
5
+ *
6
+ * This class manages all the business logic for the floating tools bubble:
7
+ * - Position state and validation
8
+ * - Drag detection (tap vs drag)
9
+ * - Hide/show toggle
10
+ * - Auto-hide when dragged past edge
11
+ * - Position persistence
12
+ *
13
+ * Platform-specific code (animation, event handling) is NOT included here.
14
+ * Use this with platform-specific hooks/bindings.
15
+ */
16
+
17
+ import { VISIBLE_HANDLE_WIDTH, DRAG_THRESHOLD, EDGE_PADDING, SAVE_DEBOUNCE_MS, STORAGE_KEYS } from "./constants.js";
18
+ export class FloatingToolsStore {
19
+ // State
20
+
21
+ isDragging = false;
22
+ isHidden = false;
23
+
24
+ // Configuration
25
+
26
+ // Callbacks
27
+
28
+ // Drag tracking
29
+ dragStartPos = {
30
+ x: 0,
31
+ y: 0
32
+ };
33
+ dragStartMouse = {
34
+ x: 0,
35
+ y: 0
36
+ };
37
+ hasMoved = false;
38
+ savedPosition = null;
39
+
40
+ // Persistence
41
+ saveTimeout = null;
42
+ isInitialized = false;
43
+
44
+ // Subscribers (for useSyncExternalStore)
45
+ listeners = new Set();
46
+ constructor(options) {
47
+ this.screenWidth = options.screenWidth;
48
+ this.screenHeight = options.screenHeight;
49
+ this.bubbleSize = options.initialBubbleSize ?? {
50
+ width: 100,
51
+ height: 32
52
+ };
53
+ this.minPosition = options.minPosition ?? {
54
+ x: EDGE_PADDING,
55
+ y: EDGE_PADDING
56
+ };
57
+ this.visibleHandleWidth = options.visibleHandleWidth ?? VISIBLE_HANDLE_WIDTH;
58
+ this.dragThreshold = options.dragThreshold ?? DRAG_THRESHOLD;
59
+ this.edgePadding = options.edgePadding ?? EDGE_PADDING;
60
+ this.enablePositionPersistence = options.enablePositionPersistence ?? true;
61
+ this.storage = options.storage;
62
+ this.onPositionChange = options.onPositionChange;
63
+ this.onHiddenChange = options.onHiddenChange;
64
+ this.onDraggingChange = options.onDraggingChange;
65
+
66
+ // Default position
67
+ this.position = options.initialPosition ?? {
68
+ x: this.screenWidth - this.bubbleSize.width - 20,
69
+ y: Math.max(this.minPosition.y, Math.min(100, this.screenHeight - this.bubbleSize.height - this.edgePadding))
70
+ };
71
+
72
+ // Initialize snapshot
73
+ this.stateSnapshot = this.createSnapshot();
74
+ }
75
+
76
+ // =============================
77
+ // Subscription (for React hooks)
78
+ // =============================
79
+
80
+ subscribe = listener => {
81
+ this.listeners.add(listener);
82
+ return () => this.listeners.delete(listener);
83
+ };
84
+ getSnapshot = () => {
85
+ return this.stateSnapshot;
86
+ };
87
+ createSnapshot() {
88
+ return {
89
+ position: {
90
+ ...this.position
91
+ },
92
+ isDragging: this.isDragging,
93
+ isHidden: this.isHidden,
94
+ bubbleSize: {
95
+ ...this.bubbleSize
96
+ }
97
+ };
98
+ }
99
+ notify() {
100
+ this.stateSnapshot = this.createSnapshot();
101
+ this.listeners.forEach(listener => listener());
102
+ }
103
+
104
+ // =============================
105
+ // Initialization
106
+ // =============================
107
+
108
+ /**
109
+ * Initialize the store by loading persisted position.
110
+ * Call this after setting up storage adapter.
111
+ */
112
+ async initialize() {
113
+ if (this.isInitialized || !this.enablePositionPersistence || !this.storage) {
114
+ this.isInitialized = true;
115
+ return;
116
+ }
117
+ try {
118
+ const [xStr, yStr] = await Promise.all([this.storage.getItem(STORAGE_KEYS.POSITION_X), this.storage.getItem(STORAGE_KEYS.POSITION_Y)]);
119
+ if (xStr !== null && yStr !== null) {
120
+ const x = parseFloat(xStr);
121
+ const y = parseFloat(yStr);
122
+ if (!Number.isNaN(x) && !Number.isNaN(y)) {
123
+ const saved = {
124
+ x,
125
+ y
126
+ };
127
+ const validated = this.validatePosition(saved);
128
+
129
+ // Save corrected position if out of bounds
130
+ if (Math.abs(saved.x - validated.x) > 5 || Math.abs(saved.y - validated.y) > 5) {
131
+ this.savePosition(validated.x, validated.y);
132
+ }
133
+ this.position = validated;
134
+
135
+ // Check if loaded in hidden state
136
+ if (validated.x >= this.screenWidth - this.visibleHandleWidth - 5) {
137
+ this.isHidden = true;
138
+ }
139
+ this.notify();
140
+ }
141
+ }
142
+ } catch {
143
+ // Failed to load - use default position
144
+ }
145
+ this.isInitialized = true;
146
+ }
147
+
148
+ // =============================
149
+ // Position Management
150
+ // =============================
151
+
152
+ /**
153
+ * Get current bounds for position validation.
154
+ */
155
+ getBounds() {
156
+ return {
157
+ minX: this.minPosition.x,
158
+ maxX: this.screenWidth - this.visibleHandleWidth,
159
+ minY: this.minPosition.y,
160
+ maxY: this.screenHeight - this.bubbleSize.height - this.edgePadding
161
+ };
162
+ }
163
+
164
+ /**
165
+ * Validate and clamp a position to screen boundaries.
166
+ */
167
+ validatePosition(pos) {
168
+ const bounds = this.getBounds();
169
+ return {
170
+ x: Math.max(bounds.minX, Math.min(pos.x, bounds.maxX)),
171
+ y: Math.max(bounds.minY, Math.min(pos.y, bounds.maxY))
172
+ };
173
+ }
174
+
175
+ /**
176
+ * Set position directly (for animation callbacks).
177
+ */
178
+ setPosition(pos) {
179
+ this.position = pos;
180
+ this.onPositionChange?.(pos);
181
+ this.notify();
182
+ }
183
+
184
+ /**
185
+ * Update bubble size (call on layout).
186
+ * Only notifies if size actually changed.
187
+ */
188
+ setBubbleSize(size) {
189
+ if (this.bubbleSize.width === size.width && this.bubbleSize.height === size.height) {
190
+ return;
191
+ }
192
+ this.bubbleSize = size;
193
+ if (!this.isDragging) this.reconcileBounds();
194
+ this.notify();
195
+ }
196
+
197
+ /**
198
+ * Update screen dimensions (call on resize).
199
+ */
200
+ setScreenSize(width, height) {
201
+ this.screenWidth = width;
202
+ this.screenHeight = height;
203
+ this.reconcileBounds();
204
+ this.notify();
205
+ }
206
+
207
+ /** Keep the whole visible tool reachable after its content or viewport changes. */
208
+ reconcileBounds() {
209
+ const clampVisible = position => ({
210
+ x: Math.max(this.minPosition.x, Math.min(position.x, this.screenWidth - this.bubbleSize.width - this.edgePadding)),
211
+ y: Math.max(this.minPosition.y, Math.min(position.y, this.screenHeight - this.bubbleSize.height - this.edgePadding))
212
+ });
213
+ const visible = clampVisible(this.position);
214
+ this.position = this.isHidden ? {
215
+ ...visible,
216
+ x: this.screenWidth - this.visibleHandleWidth
217
+ } : visible;
218
+ if (this.savedPosition) this.savedPosition = clampVisible(this.savedPosition);
219
+ }
220
+
221
+ /**
222
+ * Update min position (e.g., for safe area insets).
223
+ */
224
+ setMinPosition(minPos) {
225
+ this.minPosition = minPos;
226
+ }
227
+
228
+ // =============================
229
+ // Persistence
230
+ // =============================
231
+
232
+ async savePosition(x, y) {
233
+ if (!this.enablePositionPersistence || !this.storage) return;
234
+ try {
235
+ await Promise.all([this.storage.setItem(STORAGE_KEYS.POSITION_X, x.toString()), this.storage.setItem(STORAGE_KEYS.POSITION_Y, y.toString())]);
236
+ } catch {
237
+ // Failed to save - continue without persistence
238
+ }
239
+ }
240
+ debouncedSavePosition(x, y) {
241
+ if (this.saveTimeout) clearTimeout(this.saveTimeout);
242
+ this.saveTimeout = setTimeout(() => this.savePosition(x, y), SAVE_DEBOUNCE_MS);
243
+ }
244
+
245
+ // =============================
246
+ // Hide/Show Toggle
247
+ // =============================
248
+
249
+ /**
250
+ * Toggle between hidden and visible states.
251
+ * Returns the target position for animation.
252
+ */
253
+ toggleHideShow() {
254
+ const isVisuallyOffScreen = this.position.x > this.screenWidth - this.bubbleSize.width / 2;
255
+ if (this.isHidden || isVisuallyOffScreen) {
256
+ // Show the bubble
257
+ let targetX;
258
+ let targetY;
259
+ if (this.savedPosition && this.savedPosition.x < this.screenWidth - this.bubbleSize.width / 2) {
260
+ targetX = this.savedPosition.x;
261
+ targetY = this.savedPosition.y;
262
+ } else {
263
+ targetX = this.screenWidth - this.bubbleSize.width - 20;
264
+ targetY = this.position.y;
265
+ }
266
+ this.isHidden = false;
267
+ this.onHiddenChange?.(false);
268
+ this.notify();
269
+ return {
270
+ targetPosition: {
271
+ x: targetX,
272
+ y: targetY
273
+ },
274
+ isHiding: false
275
+ };
276
+ } else {
277
+ // Hide the bubble
278
+ this.savedPosition = {
279
+ ...this.position
280
+ };
281
+ const hiddenX = this.screenWidth - this.visibleHandleWidth;
282
+ this.isHidden = true;
283
+ this.onHiddenChange?.(true);
284
+ this.notify();
285
+ return {
286
+ targetPosition: {
287
+ x: hiddenX,
288
+ y: this.position.y
289
+ },
290
+ isHiding: true
291
+ };
292
+ }
293
+ }
294
+
295
+ /**
296
+ * Force hide (for pushToSide behavior).
297
+ */
298
+ forceHide() {
299
+ if (this.isHidden) {
300
+ return {
301
+ targetPosition: this.position
302
+ };
303
+ }
304
+ this.savedPosition = {
305
+ ...this.position
306
+ };
307
+ const hiddenX = this.screenWidth - this.visibleHandleWidth;
308
+ this.isHidden = true;
309
+ this.onHiddenChange?.(true);
310
+ this.notify();
311
+ return {
312
+ targetPosition: {
313
+ x: hiddenX,
314
+ y: this.position.y
315
+ }
316
+ };
317
+ }
318
+
319
+ /**
320
+ * Force show (restore from pushToSide).
321
+ */
322
+ forceShow() {
323
+ if (!this.isHidden) {
324
+ return {
325
+ targetPosition: this.position
326
+ };
327
+ }
328
+ let targetX;
329
+ let targetY;
330
+ if (this.savedPosition) {
331
+ targetX = this.savedPosition.x;
332
+ targetY = this.savedPosition.y;
333
+ } else {
334
+ targetX = this.screenWidth - this.bubbleSize.width - 20;
335
+ targetY = this.position.y;
336
+ }
337
+ this.isHidden = false;
338
+ this.onHiddenChange?.(false);
339
+ this.notify();
340
+ return {
341
+ targetPosition: {
342
+ x: targetX,
343
+ y: targetY
344
+ }
345
+ };
346
+ }
347
+
348
+ // =============================
349
+ // Drag Handling
350
+ // =============================
351
+
352
+ /**
353
+ * Start a drag operation.
354
+ */
355
+ handleDragStart(event) {
356
+ this.hasMoved = false;
357
+ this.dragStartPos = {
358
+ ...this.position
359
+ };
360
+ this.dragStartMouse = {
361
+ x: event.clientX,
362
+ y: event.clientY
363
+ };
364
+ }
365
+
366
+ /**
367
+ * Process drag movement.
368
+ * Returns the new position (for animation) and whether drag threshold was exceeded.
369
+ */
370
+ handleDragMove(event) {
371
+ const dx = event.clientX - this.dragStartMouse.x;
372
+ const dy = event.clientY - this.dragStartMouse.y;
373
+ const totalDistance = Math.abs(dx) + Math.abs(dy);
374
+
375
+ // Check if moved enough to be considered a drag
376
+ if (!this.hasMoved && totalDistance > this.dragThreshold) {
377
+ this.hasMoved = true;
378
+ this.isDragging = true;
379
+ this.onDraggingChange?.(true);
380
+ this.notify();
381
+ }
382
+ if (this.hasMoved) {
383
+ const newX = this.dragStartPos.x + dx;
384
+ const newY = this.dragStartPos.y + dy;
385
+
386
+ // Allow overflow to right for hide detection, but clamp Y
387
+ const bounds = this.getBounds();
388
+ const clampedX = Math.max(bounds.minX, Math.min(newX, this.screenWidth - this.visibleHandleWidth + this.bubbleSize.width));
389
+ const clampedY = Math.max(bounds.minY, Math.min(newY, bounds.maxY));
390
+ this.position = {
391
+ x: clampedX,
392
+ y: clampedY
393
+ };
394
+ this.onPositionChange?.(this.position);
395
+ this.notify();
396
+ return {
397
+ position: this.position,
398
+ isDragging: true
399
+ };
400
+ }
401
+ return {
402
+ position: this.position,
403
+ isDragging: false
404
+ };
405
+ }
406
+
407
+ /**
408
+ * End a drag operation.
409
+ * Returns the result including whether to animate to hidden state.
410
+ */
411
+ handleDragEnd(event) {
412
+ const wasTap = !this.hasMoved;
413
+ if (wasTap) {
414
+ this.isDragging = false;
415
+ this.onDraggingChange?.(false);
416
+ this.notify();
417
+ return {
418
+ position: this.position,
419
+ shouldHide: false,
420
+ wasTap: true
421
+ };
422
+ }
423
+
424
+ // Calculate final position
425
+ const dx = event.clientX - this.dragStartMouse.x;
426
+ const dy = event.clientY - this.dragStartMouse.y;
427
+ const currentX = this.dragStartPos.x + dx;
428
+ const currentY = this.dragStartPos.y + dy;
429
+
430
+ // Check if should auto-hide (bubble midpoint past right edge)
431
+ const bubbleMidpoint = currentX + this.bubbleSize.width / 2;
432
+ const shouldHide = bubbleMidpoint > this.screenWidth;
433
+ const bounds = this.getBounds();
434
+ if (shouldHide) {
435
+ const hiddenX = this.screenWidth - this.visibleHandleWidth;
436
+ const clampedY = Math.max(bounds.minY, Math.min(currentY, bounds.maxY));
437
+ this.isHidden = true;
438
+ this.onHiddenChange?.(true);
439
+ this.isDragging = false;
440
+ this.onDraggingChange?.(false);
441
+ this.notify();
442
+ return {
443
+ position: {
444
+ x: hiddenX,
445
+ y: clampedY
446
+ },
447
+ shouldHide: true,
448
+ wasTap: false
449
+ };
450
+ } else {
451
+ // Check if pulling back from hidden
452
+ if (this.isHidden && currentX < this.screenWidth - this.visibleHandleWidth - 10) {
453
+ this.isHidden = false;
454
+ this.onHiddenChange?.(false);
455
+ }
456
+
457
+ // Clamp to visible area
458
+ const clampedX = Math.max(bounds.minX, Math.min(currentX, this.screenWidth - this.bubbleSize.width - this.edgePadding));
459
+ const clampedY = Math.max(bounds.minY, Math.min(currentY, bounds.maxY));
460
+
461
+ // Save position if visible
462
+ if (clampedX < this.screenWidth - this.bubbleSize.width / 2) {
463
+ this.savedPosition = {
464
+ x: clampedX,
465
+ y: clampedY
466
+ };
467
+ }
468
+ this.position = {
469
+ x: clampedX,
470
+ y: clampedY
471
+ };
472
+ this.isDragging = false;
473
+ this.onDraggingChange?.(false);
474
+ this.debouncedSavePosition(clampedX, clampedY);
475
+ this.notify();
476
+ return {
477
+ position: {
478
+ x: clampedX,
479
+ y: clampedY
480
+ },
481
+ shouldHide: false,
482
+ wasTap: false
483
+ };
484
+ }
485
+ }
486
+
487
+ /**
488
+ * Commit position after animation completes.
489
+ */
490
+ commitPosition(pos) {
491
+ this.position = pos;
492
+ this.savePosition(pos.x, pos.y);
493
+ this.notify();
494
+ }
495
+
496
+ // =============================
497
+ // Cleanup
498
+ // =============================
499
+
500
+ destroy() {
501
+ if (this.saveTimeout) {
502
+ clearTimeout(this.saveTimeout);
503
+ this.saveTimeout = null;
504
+ }
505
+ this.listeners.clear();
506
+ }
507
+ }
@@ -1 +1,49 @@
1
- "use strict";export const floatingToolsColors={panel:"#1A1A1A",muted:"#888888",secondary:"#E0E0E0",info:"#20C997",success:"#20C997",optional:"#FFA94D",error:"#EF4444",primary:"#20C997",dragActive:"#20C997"};export function withAlpha(t,o){return"number"==typeof o?`${t}${Math.round(255*o).toString(16).padStart(2,"0")}`:`${t}${o}`}
1
+ "use strict";
2
+
3
+ /**
4
+ * Shared color palette for floating tools.
5
+ * Matches the gameUIColors from @buoy-gg/shared-ui.
6
+ *
7
+ * These are duplicated here to avoid requiring @buoy-gg/shared-ui
8
+ * as a dependency (which has React Native dependencies).
9
+ *
10
+ * TODO: Consider extracting colors to a truly platform-agnostic package
11
+ * that both shared-ui and floating-tools-core can depend on.
12
+ */
13
+
14
+ /**
15
+ * Buoy brand colors - EXACT values from web docs site dark theme
16
+ */
17
+ export const floatingToolsColors = {
18
+ /** Dark panel background */
19
+ panel: '#1A1A1A',
20
+ /** Muted gray for secondary elements */
21
+ muted: '#888888',
22
+ /** Primary text color */
23
+ secondary: '#E0E0E0',
24
+ /** Info/active state color (Buoy teal) */
25
+ info: '#20C997',
26
+ /** Success/admin color (Buoy teal) */
27
+ success: '#20C997',
28
+ /** Warning/optional color (Buoy orange) */
29
+ optional: '#FFA94D',
30
+ /** Error color (Buoy red) */
31
+ error: '#EF4444',
32
+ /** Primary accent color (Buoy teal) */
33
+ primary: '#20C997',
34
+ /** Color used when dragging the floating tools (Buoy teal) */
35
+ dragActive: '#20C997'
36
+ };
37
+ /**
38
+ * Get a color with optional alpha.
39
+ * @param color - The base color (hex)
40
+ * @param alpha - Alpha value as hex string (00-FF) or number (0-1)
41
+ */
42
+ export function withAlpha(color, alpha) {
43
+ if (typeof alpha === 'number') {
44
+ // Convert 0-1 to hex
45
+ const hex = Math.round(alpha * 255).toString(16).padStart(2, '0');
46
+ return `${color}${hex}`;
47
+ }
48
+ return `${color}${alpha}`;
49
+ }
@@ -1 +1,27 @@
1
- "use strict";export const VISIBLE_HANDLE_WIDTH=32;export const DRAG_THRESHOLD=5;export const ANIMATION_DURATION=200;export const EDGE_PADDING=10;export const SAVE_DEBOUNCE_MS=500;export const STORAGE_KEYS={POSITION_X:"@react_buoy_bubble_position_x",POSITION_Y:"@react_buoy_bubble_position_y"};
1
+ "use strict";
2
+
3
+ /**
4
+ * Shared constants for floating tools behavior.
5
+ * These values ensure consistent behavior across platforms.
6
+ */
7
+
8
+ /** Width of the visible grip handle when bubble is hidden (pixels) */
9
+ export const VISIBLE_HANDLE_WIDTH = 32;
10
+
11
+ /** Minimum movement to distinguish drag from tap (pixels) */
12
+ export const DRAG_THRESHOLD = 5;
13
+
14
+ /** Animation duration for hide/show transitions (milliseconds) */
15
+ export const ANIMATION_DURATION = 200;
16
+
17
+ /** Padding from screen edges (pixels) */
18
+ export const EDGE_PADDING = 10;
19
+
20
+ /** Debounce delay for position persistence (milliseconds) */
21
+ export const SAVE_DEBOUNCE_MS = 500;
22
+
23
+ /** Storage keys for position persistence */
24
+ export const STORAGE_KEYS = {
25
+ POSITION_X: '@react_buoy_bubble_position_x',
26
+ POSITION_Y: '@react_buoy_bubble_position_y'
27
+ };