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