@buoy-gg/floating-tools-core 7.0.41 → 7.0.43
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/floating.js +1 -1
- package/lib/commonjs/FloatingToolsStore.js +1 -512
- package/lib/commonjs/colors.js +1 -54
- package/lib/commonjs/constants.js +1 -31
- package/lib/commonjs/devToolsState.js +1 -325
- package/lib/commonjs/dial.js +11 -633
- package/lib/commonjs/dialUsage.js +1 -130
- package/lib/commonjs/easing.js +1 -69
- package/lib/commonjs/floating.js +1 -75
- package/lib/commonjs/fonts.js +1 -31
- package/lib/commonjs/fonts.web.js +1 -8
- package/lib/commonjs/icons/ask-buoy-icon.js +1 -17
- package/lib/commonjs/icons/ask-buoy-icon.native.js +1 -33
- package/lib/commonjs/icons/assets-icon.js +1 -19
- package/lib/commonjs/icons/assets-icon.native.js +1 -17
- package/lib/commonjs/icons/benchmark-icon.js +1 -19
- package/lib/commonjs/icons/benchmark-icon.native.js +1 -17
- package/lib/commonjs/icons/bif-raster-icon.js +1 -49
- package/lib/commonjs/icons/bif-raster-icon.native.js +1 -48
- package/lib/commonjs/icons/camera-icon.js +1 -19
- package/lib/commonjs/icons/camera-icon.native.js +1 -17
- package/lib/commonjs/icons/clock-tool-icon.js +1 -0
- package/lib/commonjs/icons/console-icon.js +1 -17
- package/lib/commonjs/icons/console-icon.native.js +1 -33
- package/lib/commonjs/icons/env-icon.js +1 -19
- package/lib/commonjs/icons/env-icon.native.js +1 -17
- package/lib/commonjs/icons/events-icon.js +1 -19
- package/lib/commonjs/icons/events-icon.native.js +1 -17
- package/lib/commonjs/icons/generated/assets-raster.g.js +1 -8
- package/lib/commonjs/icons/generated/benchmark-raster.g.js +1 -8
- package/lib/commonjs/icons/generated/camera-raster.g.js +1 -8
- package/lib/commonjs/icons/generated/env-raster.g.js +1 -8
- package/lib/commonjs/icons/generated/events-raster.g.js +1 -8
- package/lib/commonjs/icons/generated/glyph-icons.g.js +1 -299
- package/lib/commonjs/icons/generated/highlight-raster.g.js +1 -8
- package/lib/commonjs/icons/generated/highlighter-raster.g.js +1 -8
- package/lib/commonjs/icons/generated/icon-data.g.js +1 -33922
- package/lib/commonjs/icons/generated/image-overlay-raster.g.js +1 -8
- package/lib/commonjs/icons/generated/images-raster.g.js +1 -8
- package/lib/commonjs/icons/generated/network-raster.g.js +1 -8
- package/lib/commonjs/icons/generated/raster-icons.g.js +1 -19
- package/lib/commonjs/icons/generated/riverpod-raster.g.js +1 -8
- package/lib/commonjs/icons/generated/routes-raster.g.js +1 -8
- package/lib/commonjs/icons/generated/settings-raster.g.js +1 -8
- package/lib/commonjs/icons/generated/storage-raster.g.js +1 -8
- package/lib/commonjs/icons/generated/wifi-raster.g.js +1 -8
- package/lib/commonjs/icons/highlight-icon.js +1 -19
- package/lib/commonjs/icons/highlight-icon.native.js +1 -17
- package/lib/commonjs/icons/highlighter-icon.js +1 -27
- package/lib/commonjs/icons/highlighter-icon.native.js +1 -25
- package/lib/commonjs/icons/icon-factories.js +1 -173
- package/lib/commonjs/icons/icon-primitives.js +1 -676
- package/lib/commonjs/icons/icon-primitives.native.js +1 -904
- package/lib/commonjs/icons/icon-renderer.js +1 -307
- package/lib/commonjs/icons/iconGlow.js +1 -32
- package/lib/commonjs/icons/image-overlay-icon.js +1 -19
- package/lib/commonjs/icons/image-overlay-icon.native.js +1 -17
- package/lib/commonjs/icons/images-icon.js +1 -19
- package/lib/commonjs/icons/images-icon.native.js +1 -17
- package/lib/commonjs/icons/impersonate-icon.js +1 -17
- package/lib/commonjs/icons/impersonate-icon.native.js +1 -33
- package/lib/commonjs/icons/jotai-icon.js +1 -17
- package/lib/commonjs/icons/jotai-icon.native.js +1 -35
- package/lib/commonjs/icons/network-icon.js +1 -19
- package/lib/commonjs/icons/network-icon.native.js +1 -17
- package/lib/commonjs/icons/notifications-icon.js +1 -15
- package/lib/commonjs/icons/query-icon.js +1 -17
- package/lib/commonjs/icons/query-icon.native.js +1 -35
- package/lib/commonjs/icons/raster-icon.js +1 -51
- package/lib/commonjs/icons/redux-icon.js +1 -17
- package/lib/commonjs/icons/redux-icon.native.js +1 -36
- package/lib/commonjs/icons/renders-icon.js +1 -30
- package/lib/commonjs/icons/renders-icon.native.js +1 -30
- package/lib/commonjs/icons/riverpod-icon.js +1 -19
- package/lib/commonjs/icons/riverpod-icon.native.js +1 -17
- package/lib/commonjs/icons/routes-icon.js +1 -35
- package/lib/commonjs/icons/routes-icon.native.js +1 -33
- package/lib/commonjs/icons/routes-parts.js +1 -47
- package/lib/commonjs/icons/scenarios-icon.js +1 -17
- package/lib/commonjs/icons/scenarios-icon.native.js +1 -33
- package/lib/commonjs/icons/sentry-icon.js +1 -17
- package/lib/commonjs/icons/sentry-icon.native.js +1 -37
- package/lib/commonjs/icons/settings-icon.js +1 -13
- package/lib/commonjs/icons/settings-icon.native.js +1 -11
- package/lib/commonjs/icons/storage-icon.js +1 -19
- package/lib/commonjs/icons/storage-icon.native.js +1 -17
- package/lib/commonjs/icons/time-machine-icon.js +1 -17
- package/lib/commonjs/icons/time-machine-icon.native.js +1 -33
- package/lib/commonjs/icons/wifi-icon.js +1 -19
- package/lib/commonjs/icons/wifi-icon.native.js +1 -17
- package/lib/commonjs/icons/zustand-icon.js +1 -17
- package/lib/commonjs/icons/zustand-icon.native.js +1 -35
- package/lib/commonjs/index.js +1 -1114
- package/lib/commonjs/settings.js +1 -601
- package/lib/commonjs/types.js +1 -1
- package/lib/commonjs/utils.js +1 -72
- package/lib/module/FloatingToolsStore.js +1 -507
- package/lib/module/colors.js +1 -49
- package/lib/module/constants.js +1 -27
- package/lib/module/devToolsState.js +1 -318
- package/lib/module/dial.js +11 -618
- package/lib/module/dialUsage.js +1 -122
- package/lib/module/easing.js +1 -62
- package/lib/module/floating.js +1 -9
- package/lib/module/fonts.js +1 -28
- package/lib/module/fonts.web.js +1 -4
- package/lib/module/icons/ask-buoy-icon.js +1 -6
- package/lib/module/icons/ask-buoy-icon.native.js +1 -24
- package/lib/module/icons/assets-icon.js +1 -8
- package/lib/module/icons/assets-icon.native.js +1 -7
- package/lib/module/icons/benchmark-icon.js +1 -8
- package/lib/module/icons/benchmark-icon.native.js +1 -7
- package/lib/module/icons/bif-raster-icon.js +1 -46
- package/lib/module/icons/bif-raster-icon.native.js +1 -45
- package/lib/module/icons/camera-icon.js +1 -8
- package/lib/module/icons/camera-icon.native.js +1 -7
- package/lib/module/icons/clock-tool-icon.js +1 -0
- package/lib/module/icons/console-icon.js +1 -6
- package/lib/module/icons/console-icon.native.js +1 -24
- package/lib/module/icons/env-icon.js +1 -8
- package/lib/module/icons/env-icon.native.js +1 -7
- package/lib/module/icons/events-icon.js +1 -8
- package/lib/module/icons/events-icon.native.js +1 -7
- package/lib/module/icons/generated/assets-raster.g.js +1 -4
- package/lib/module/icons/generated/benchmark-raster.g.js +1 -4
- package/lib/module/icons/generated/camera-raster.g.js +1 -4
- package/lib/module/icons/generated/env-raster.g.js +1 -4
- package/lib/module/icons/generated/events-raster.g.js +1 -4
- package/lib/module/icons/generated/glyph-icons.g.js +1 -296
- package/lib/module/icons/generated/highlight-raster.g.js +1 -4
- package/lib/module/icons/generated/highlighter-raster.g.js +1 -4
- package/lib/module/icons/generated/icon-data.g.js +1 -33917
- package/lib/module/icons/generated/image-overlay-raster.g.js +1 -4
- package/lib/module/icons/generated/images-raster.g.js +1 -4
- package/lib/module/icons/generated/network-raster.g.js +1 -4
- package/lib/module/icons/generated/raster-icons.g.js +1 -15
- package/lib/module/icons/generated/riverpod-raster.g.js +1 -4
- package/lib/module/icons/generated/routes-raster.g.js +1 -4
- package/lib/module/icons/generated/settings-raster.g.js +1 -4
- package/lib/module/icons/generated/storage-raster.g.js +1 -4
- package/lib/module/icons/generated/wifi-raster.g.js +1 -4
- package/lib/module/icons/highlight-icon.js +1 -8
- package/lib/module/icons/highlight-icon.native.js +1 -7
- package/lib/module/icons/highlighter-icon.js +1 -10
- package/lib/module/icons/highlighter-icon.native.js +1 -9
- package/lib/module/icons/icon-factories.js +1 -163
- package/lib/module/icons/icon-primitives.js +1 -673
- package/lib/module/icons/icon-primitives.native.js +1 -899
- package/lib/module/icons/icon-renderer.js +1 -302
- package/lib/module/icons/iconGlow.js +1 -28
- package/lib/module/icons/image-overlay-icon.js +1 -8
- package/lib/module/icons/image-overlay-icon.native.js +1 -7
- package/lib/module/icons/images-icon.js +1 -8
- package/lib/module/icons/images-icon.native.js +1 -7
- package/lib/module/icons/impersonate-icon.js +1 -6
- package/lib/module/icons/impersonate-icon.native.js +1 -24
- package/lib/module/icons/jotai-icon.js +1 -6
- package/lib/module/icons/jotai-icon.native.js +1 -26
- package/lib/module/icons/network-icon.js +1 -8
- package/lib/module/icons/network-icon.native.js +1 -7
- package/lib/module/icons/notifications-icon.js +1 -6
- package/lib/module/icons/query-icon.js +1 -6
- package/lib/module/icons/query-icon.native.js +1 -26
- package/lib/module/icons/raster-icon.js +1 -48
- package/lib/module/icons/redux-icon.js +1 -6
- package/lib/module/icons/redux-icon.native.js +1 -27
- package/lib/module/icons/renders-icon.js +1 -3
- package/lib/module/icons/renders-icon.native.js +1 -3
- package/lib/module/icons/riverpod-icon.js +1 -8
- package/lib/module/icons/riverpod-icon.native.js +1 -7
- package/lib/module/icons/routes-icon.js +1 -9
- package/lib/module/icons/routes-icon.native.js +1 -8
- package/lib/module/icons/routes-parts.js +1 -40
- package/lib/module/icons/scenarios-icon.js +1 -6
- package/lib/module/icons/scenarios-icon.native.js +1 -24
- package/lib/module/icons/sentry-icon.js +1 -6
- package/lib/module/icons/sentry-icon.native.js +1 -28
- package/lib/module/icons/settings-icon.js +1 -7
- package/lib/module/icons/settings-icon.native.js +1 -6
- package/lib/module/icons/storage-icon.js +1 -8
- package/lib/module/icons/storage-icon.native.js +1 -7
- package/lib/module/icons/time-machine-icon.js +1 -6
- package/lib/module/icons/time-machine-icon.native.js +1 -24
- package/lib/module/icons/wifi-icon.js +1 -8
- package/lib/module/icons/wifi-icon.native.js +1 -7
- package/lib/module/icons/zustand-icon.js +1 -6
- package/lib/module/icons/zustand-icon.native.js +1 -26
- package/lib/module/index.js +1 -129
- package/lib/module/settings.js +1 -589
- package/lib/module/types.js +1 -1
- package/lib/module/utils.js +1 -66
- package/lib/typescript/commonjs/icons/clock-tool-icon.d.ts +3 -0
- package/lib/typescript/commonjs/icons/generated/icon-data.g.d.ts +2 -0
- package/lib/typescript/commonjs/index.d.ts +1 -0
- package/lib/typescript/module/icons/clock-tool-icon.d.ts +3 -0
- package/lib/typescript/module/icons/generated/icon-data.g.d.ts +2 -0
- package/lib/typescript/module/index.d.ts +1 -0
- package/lib/web/chunks/chunk-PUCCT3HF.mjs +1 -2
- package/lib/web/floating.mjs +1 -2
- package/lib/web/index.mjs +9 -10
- package/package.json +2 -5
- package/lib/typescript/commonjs/FloatingToolsStore.d.ts.map +0 -1
- package/lib/typescript/commonjs/colors.d.ts.map +0 -1
- package/lib/typescript/commonjs/constants.d.ts.map +0 -1
- package/lib/typescript/commonjs/devToolsState.d.ts.map +0 -1
- package/lib/typescript/commonjs/dial.d.ts.map +0 -1
- package/lib/typescript/commonjs/dialUsage.d.ts.map +0 -1
- package/lib/typescript/commonjs/easing.d.ts.map +0 -1
- package/lib/typescript/commonjs/floating.d.ts.map +0 -1
- package/lib/typescript/commonjs/fonts.d.ts.map +0 -1
- package/lib/typescript/commonjs/fonts.web.d.ts.map +0 -1
- package/lib/typescript/commonjs/icons/ask-buoy-icon.d.ts.map +0 -1
- package/lib/typescript/commonjs/icons/ask-buoy-icon.native.d.ts.map +0 -1
- package/lib/typescript/commonjs/icons/assets-icon.d.ts.map +0 -1
- package/lib/typescript/commonjs/icons/assets-icon.native.d.ts.map +0 -1
- package/lib/typescript/commonjs/icons/benchmark-icon.d.ts.map +0 -1
- package/lib/typescript/commonjs/icons/benchmark-icon.native.d.ts.map +0 -1
- package/lib/typescript/commonjs/icons/bif-raster-icon.d.ts.map +0 -1
- package/lib/typescript/commonjs/icons/bif-raster-icon.native.d.ts.map +0 -1
- package/lib/typescript/commonjs/icons/camera-icon.d.ts.map +0 -1
- package/lib/typescript/commonjs/icons/camera-icon.native.d.ts.map +0 -1
- package/lib/typescript/commonjs/icons/console-icon.d.ts.map +0 -1
- package/lib/typescript/commonjs/icons/console-icon.native.d.ts.map +0 -1
- package/lib/typescript/commonjs/icons/env-icon.d.ts.map +0 -1
- package/lib/typescript/commonjs/icons/env-icon.native.d.ts.map +0 -1
- package/lib/typescript/commonjs/icons/events-icon.d.ts.map +0 -1
- package/lib/typescript/commonjs/icons/events-icon.native.d.ts.map +0 -1
- package/lib/typescript/commonjs/icons/generated/assets-raster.g.d.ts.map +0 -1
- package/lib/typescript/commonjs/icons/generated/benchmark-raster.g.d.ts.map +0 -1
- package/lib/typescript/commonjs/icons/generated/camera-raster.g.d.ts.map +0 -1
- package/lib/typescript/commonjs/icons/generated/env-raster.g.d.ts.map +0 -1
- package/lib/typescript/commonjs/icons/generated/events-raster.g.d.ts.map +0 -1
- package/lib/typescript/commonjs/icons/generated/glyph-icons.g.d.ts.map +0 -1
- package/lib/typescript/commonjs/icons/generated/highlight-raster.g.d.ts.map +0 -1
- package/lib/typescript/commonjs/icons/generated/highlighter-raster.g.d.ts.map +0 -1
- package/lib/typescript/commonjs/icons/generated/icon-data.g.d.ts.map +0 -1
- package/lib/typescript/commonjs/icons/generated/image-overlay-raster.g.d.ts.map +0 -1
- package/lib/typescript/commonjs/icons/generated/images-raster.g.d.ts.map +0 -1
- package/lib/typescript/commonjs/icons/generated/network-raster.g.d.ts.map +0 -1
- package/lib/typescript/commonjs/icons/generated/raster-icons.g.d.ts.map +0 -1
- package/lib/typescript/commonjs/icons/generated/riverpod-raster.g.d.ts.map +0 -1
- package/lib/typescript/commonjs/icons/generated/routes-raster.g.d.ts.map +0 -1
- package/lib/typescript/commonjs/icons/generated/settings-raster.g.d.ts.map +0 -1
- package/lib/typescript/commonjs/icons/generated/storage-raster.g.d.ts.map +0 -1
- package/lib/typescript/commonjs/icons/generated/wifi-raster.g.d.ts.map +0 -1
- package/lib/typescript/commonjs/icons/highlight-icon.d.ts.map +0 -1
- package/lib/typescript/commonjs/icons/highlight-icon.native.d.ts.map +0 -1
- package/lib/typescript/commonjs/icons/highlighter-icon.d.ts.map +0 -1
- package/lib/typescript/commonjs/icons/highlighter-icon.native.d.ts.map +0 -1
- package/lib/typescript/commonjs/icons/icon-factories.d.ts.map +0 -1
- package/lib/typescript/commonjs/icons/icon-primitives.d.ts.map +0 -1
- package/lib/typescript/commonjs/icons/icon-primitives.native.d.ts.map +0 -1
- package/lib/typescript/commonjs/icons/icon-renderer.d.ts.map +0 -1
- package/lib/typescript/commonjs/icons/iconGlow.d.ts.map +0 -1
- package/lib/typescript/commonjs/icons/image-overlay-icon.d.ts.map +0 -1
- package/lib/typescript/commonjs/icons/image-overlay-icon.native.d.ts.map +0 -1
- package/lib/typescript/commonjs/icons/images-icon.d.ts.map +0 -1
- package/lib/typescript/commonjs/icons/images-icon.native.d.ts.map +0 -1
- package/lib/typescript/commonjs/icons/impersonate-icon.d.ts.map +0 -1
- package/lib/typescript/commonjs/icons/impersonate-icon.native.d.ts.map +0 -1
- package/lib/typescript/commonjs/icons/jotai-icon.d.ts.map +0 -1
- package/lib/typescript/commonjs/icons/jotai-icon.native.d.ts.map +0 -1
- package/lib/typescript/commonjs/icons/network-icon.d.ts.map +0 -1
- package/lib/typescript/commonjs/icons/network-icon.native.d.ts.map +0 -1
- package/lib/typescript/commonjs/icons/notifications-icon.d.ts.map +0 -1
- package/lib/typescript/commonjs/icons/query-icon.d.ts.map +0 -1
- package/lib/typescript/commonjs/icons/query-icon.native.d.ts.map +0 -1
- package/lib/typescript/commonjs/icons/raster-icon.d.ts.map +0 -1
- package/lib/typescript/commonjs/icons/redux-icon.d.ts.map +0 -1
- package/lib/typescript/commonjs/icons/redux-icon.native.d.ts.map +0 -1
- package/lib/typescript/commonjs/icons/renders-icon.d.ts.map +0 -1
- package/lib/typescript/commonjs/icons/renders-icon.native.d.ts.map +0 -1
- package/lib/typescript/commonjs/icons/riverpod-icon.d.ts.map +0 -1
- package/lib/typescript/commonjs/icons/riverpod-icon.native.d.ts.map +0 -1
- package/lib/typescript/commonjs/icons/routes-icon.d.ts.map +0 -1
- package/lib/typescript/commonjs/icons/routes-icon.native.d.ts.map +0 -1
- package/lib/typescript/commonjs/icons/routes-parts.d.ts.map +0 -1
- package/lib/typescript/commonjs/icons/scenarios-icon.d.ts.map +0 -1
- package/lib/typescript/commonjs/icons/scenarios-icon.native.d.ts.map +0 -1
- package/lib/typescript/commonjs/icons/sentry-icon.d.ts.map +0 -1
- package/lib/typescript/commonjs/icons/sentry-icon.native.d.ts.map +0 -1
- package/lib/typescript/commonjs/icons/settings-icon.d.ts.map +0 -1
- package/lib/typescript/commonjs/icons/settings-icon.native.d.ts.map +0 -1
- package/lib/typescript/commonjs/icons/storage-icon.d.ts.map +0 -1
- package/lib/typescript/commonjs/icons/storage-icon.native.d.ts.map +0 -1
- package/lib/typescript/commonjs/icons/time-machine-icon.d.ts.map +0 -1
- package/lib/typescript/commonjs/icons/time-machine-icon.native.d.ts.map +0 -1
- package/lib/typescript/commonjs/icons/wifi-icon.d.ts.map +0 -1
- package/lib/typescript/commonjs/icons/wifi-icon.native.d.ts.map +0 -1
- package/lib/typescript/commonjs/icons/zustand-icon.d.ts.map +0 -1
- package/lib/typescript/commonjs/icons/zustand-icon.native.d.ts.map +0 -1
- package/lib/typescript/commonjs/index.d.ts.map +0 -1
- package/lib/typescript/commonjs/settings.d.ts.map +0 -1
- package/lib/typescript/commonjs/types.d.ts.map +0 -1
- package/lib/typescript/commonjs/utils.d.ts.map +0 -1
- package/lib/typescript/module/FloatingToolsStore.d.ts.map +0 -1
- package/lib/typescript/module/colors.d.ts.map +0 -1
- package/lib/typescript/module/constants.d.ts.map +0 -1
- package/lib/typescript/module/devToolsState.d.ts.map +0 -1
- package/lib/typescript/module/dial.d.ts.map +0 -1
- package/lib/typescript/module/dialUsage.d.ts.map +0 -1
- package/lib/typescript/module/easing.d.ts.map +0 -1
- package/lib/typescript/module/floating.d.ts.map +0 -1
- package/lib/typescript/module/fonts.d.ts.map +0 -1
- package/lib/typescript/module/fonts.web.d.ts.map +0 -1
- package/lib/typescript/module/icons/ask-buoy-icon.d.ts.map +0 -1
- package/lib/typescript/module/icons/ask-buoy-icon.native.d.ts.map +0 -1
- package/lib/typescript/module/icons/assets-icon.d.ts.map +0 -1
- package/lib/typescript/module/icons/assets-icon.native.d.ts.map +0 -1
- package/lib/typescript/module/icons/benchmark-icon.d.ts.map +0 -1
- package/lib/typescript/module/icons/benchmark-icon.native.d.ts.map +0 -1
- package/lib/typescript/module/icons/bif-raster-icon.d.ts.map +0 -1
- package/lib/typescript/module/icons/bif-raster-icon.native.d.ts.map +0 -1
- package/lib/typescript/module/icons/camera-icon.d.ts.map +0 -1
- package/lib/typescript/module/icons/camera-icon.native.d.ts.map +0 -1
- package/lib/typescript/module/icons/console-icon.d.ts.map +0 -1
- package/lib/typescript/module/icons/console-icon.native.d.ts.map +0 -1
- package/lib/typescript/module/icons/env-icon.d.ts.map +0 -1
- package/lib/typescript/module/icons/env-icon.native.d.ts.map +0 -1
- package/lib/typescript/module/icons/events-icon.d.ts.map +0 -1
- package/lib/typescript/module/icons/events-icon.native.d.ts.map +0 -1
- package/lib/typescript/module/icons/generated/assets-raster.g.d.ts.map +0 -1
- package/lib/typescript/module/icons/generated/benchmark-raster.g.d.ts.map +0 -1
- package/lib/typescript/module/icons/generated/camera-raster.g.d.ts.map +0 -1
- package/lib/typescript/module/icons/generated/env-raster.g.d.ts.map +0 -1
- package/lib/typescript/module/icons/generated/events-raster.g.d.ts.map +0 -1
- package/lib/typescript/module/icons/generated/glyph-icons.g.d.ts.map +0 -1
- package/lib/typescript/module/icons/generated/highlight-raster.g.d.ts.map +0 -1
- package/lib/typescript/module/icons/generated/highlighter-raster.g.d.ts.map +0 -1
- package/lib/typescript/module/icons/generated/icon-data.g.d.ts.map +0 -1
- package/lib/typescript/module/icons/generated/image-overlay-raster.g.d.ts.map +0 -1
- package/lib/typescript/module/icons/generated/images-raster.g.d.ts.map +0 -1
- package/lib/typescript/module/icons/generated/network-raster.g.d.ts.map +0 -1
- package/lib/typescript/module/icons/generated/raster-icons.g.d.ts.map +0 -1
- package/lib/typescript/module/icons/generated/riverpod-raster.g.d.ts.map +0 -1
- package/lib/typescript/module/icons/generated/routes-raster.g.d.ts.map +0 -1
- package/lib/typescript/module/icons/generated/settings-raster.g.d.ts.map +0 -1
- package/lib/typescript/module/icons/generated/storage-raster.g.d.ts.map +0 -1
- package/lib/typescript/module/icons/generated/wifi-raster.g.d.ts.map +0 -1
- package/lib/typescript/module/icons/highlight-icon.d.ts.map +0 -1
- package/lib/typescript/module/icons/highlight-icon.native.d.ts.map +0 -1
- package/lib/typescript/module/icons/highlighter-icon.d.ts.map +0 -1
- package/lib/typescript/module/icons/highlighter-icon.native.d.ts.map +0 -1
- package/lib/typescript/module/icons/icon-factories.d.ts.map +0 -1
- package/lib/typescript/module/icons/icon-primitives.d.ts.map +0 -1
- package/lib/typescript/module/icons/icon-primitives.native.d.ts.map +0 -1
- package/lib/typescript/module/icons/icon-renderer.d.ts.map +0 -1
- package/lib/typescript/module/icons/iconGlow.d.ts.map +0 -1
- package/lib/typescript/module/icons/image-overlay-icon.d.ts.map +0 -1
- package/lib/typescript/module/icons/image-overlay-icon.native.d.ts.map +0 -1
- package/lib/typescript/module/icons/images-icon.d.ts.map +0 -1
- package/lib/typescript/module/icons/images-icon.native.d.ts.map +0 -1
- package/lib/typescript/module/icons/impersonate-icon.d.ts.map +0 -1
- package/lib/typescript/module/icons/impersonate-icon.native.d.ts.map +0 -1
- package/lib/typescript/module/icons/jotai-icon.d.ts.map +0 -1
- package/lib/typescript/module/icons/jotai-icon.native.d.ts.map +0 -1
- package/lib/typescript/module/icons/network-icon.d.ts.map +0 -1
- package/lib/typescript/module/icons/network-icon.native.d.ts.map +0 -1
- package/lib/typescript/module/icons/notifications-icon.d.ts.map +0 -1
- package/lib/typescript/module/icons/query-icon.d.ts.map +0 -1
- package/lib/typescript/module/icons/query-icon.native.d.ts.map +0 -1
- package/lib/typescript/module/icons/raster-icon.d.ts.map +0 -1
- package/lib/typescript/module/icons/redux-icon.d.ts.map +0 -1
- package/lib/typescript/module/icons/redux-icon.native.d.ts.map +0 -1
- package/lib/typescript/module/icons/renders-icon.d.ts.map +0 -1
- package/lib/typescript/module/icons/renders-icon.native.d.ts.map +0 -1
- package/lib/typescript/module/icons/riverpod-icon.d.ts.map +0 -1
- package/lib/typescript/module/icons/riverpod-icon.native.d.ts.map +0 -1
- package/lib/typescript/module/icons/routes-icon.d.ts.map +0 -1
- package/lib/typescript/module/icons/routes-icon.native.d.ts.map +0 -1
- package/lib/typescript/module/icons/routes-parts.d.ts.map +0 -1
- package/lib/typescript/module/icons/scenarios-icon.d.ts.map +0 -1
- package/lib/typescript/module/icons/scenarios-icon.native.d.ts.map +0 -1
- package/lib/typescript/module/icons/sentry-icon.d.ts.map +0 -1
- package/lib/typescript/module/icons/sentry-icon.native.d.ts.map +0 -1
- package/lib/typescript/module/icons/settings-icon.d.ts.map +0 -1
- package/lib/typescript/module/icons/settings-icon.native.d.ts.map +0 -1
- package/lib/typescript/module/icons/storage-icon.d.ts.map +0 -1
- package/lib/typescript/module/icons/storage-icon.native.d.ts.map +0 -1
- package/lib/typescript/module/icons/time-machine-icon.d.ts.map +0 -1
- package/lib/typescript/module/icons/time-machine-icon.native.d.ts.map +0 -1
- package/lib/typescript/module/icons/wifi-icon.d.ts.map +0 -1
- package/lib/typescript/module/icons/wifi-icon.native.d.ts.map +0 -1
- package/lib/typescript/module/icons/zustand-icon.d.ts.map +0 -1
- package/lib/typescript/module/icons/zustand-icon.native.d.ts.map +0 -1
- package/lib/typescript/module/index.d.ts.map +0 -1
- package/lib/typescript/module/settings.d.ts.map +0 -1
- package/lib/typescript/module/types.d.ts.map +0 -1
- package/lib/typescript/module/utils.d.ts.map +0 -1
- package/lib/web/chunks/chunk-2K2AYORW.mjs +0 -493
- package/lib/web/chunks/chunk-G4F6TBFE.mjs +0 -488
package/floating.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
module.exports
|
|
1
|
+
module.exports=require("./lib/module/floating.js");
|
|
@@ -1,512 +1 @@
|
|
|
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;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.FloatingToolsStore=void 0;var _constants=require("./constants.js");class FloatingToolsStore{isDragging=false;isHidden=false;dragStartPos={x:0,y:0};dragStartMouse={x:0,y:0};hasMoved=false;savedPosition=null;saveTimeout=null;isInitialized=false;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:_constants.EDGE_PADDING,y:_constants.EDGE_PADDING};this.visibleHandleWidth=i.visibleHandleWidth??_constants.VISIBLE_HANDLE_WIDTH;this.dragThreshold=i.dragThreshold??_constants.DRAG_THRESHOLD;this.edgePadding=i.edgePadding??_constants.EDGE_PADDING;this.enablePositionPersistence=i.enablePositionPersistence??true;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);return()=>this.listeners.delete(i)};getSnapshot=()=>{return 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){this.isInitialized=true;return}try{const[i,t]=await Promise.all([this.storage.getItem(_constants.STORAGE_KEYS.POSITION_X),this.storage.getItem(_constants.STORAGE_KEYS.POSITION_Y)]);if(i!==null&&t!==null){const s=parseFloat(i);const a=parseFloat(t);if(!Number.isNaN(s)&&!Number.isNaN(a)){const n={x:s,y:a};const e=this.validatePosition(n);if(Math.abs(n.x-e.x)>5||Math.abs(n.y-e.y)>5){this.savePosition(e.x,e.y)}this.position=e;if(e.x>=this.screenWidth-this.visibleHandleWidth-5){this.isHidden=true}this.notify()}}}catch{}this.isInitialized=true}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){if(this.bubbleSize.width===i.width&&this.bubbleSize.height===i.height){return}this.bubbleSize=i;if(!this.isDragging)this.reconcileBounds();this.notify()}setScreenSize(i,t){this.screenWidth=i;this.screenHeight=t;this.reconcileBounds();this.notify()}reconcileBounds(){const i=s=>({x:Math.max(this.minPosition.x,Math.min(s.x,this.screenWidth-this.bubbleSize.width-this.edgePadding)),y:Math.max(this.minPosition.y,Math.min(s.y,this.screenHeight-this.bubbleSize.height-this.edgePadding))});const t=i(this.position);this.position=this.isHidden?{...t,x:this.screenWidth-this.visibleHandleWidth}:t;if(this.savedPosition)this.savedPosition=i(this.savedPosition)}setMinPosition(i){this.minPosition=i}async savePosition(i,t){if(!this.enablePositionPersistence||!this.storage)return;try{await Promise.all([this.storage.setItem(_constants.STORAGE_KEYS.POSITION_X,i.toString()),this.storage.setItem(_constants.STORAGE_KEYS.POSITION_Y,t.toString())])}catch{}}debouncedSavePosition(i,t){if(this.saveTimeout)clearTimeout(this.saveTimeout);this.saveTimeout=setTimeout(()=>this.savePosition(i,t),_constants.SAVE_DEBOUNCE_MS)}toggleHideShow(){const i=this.position.x>this.screenWidth-this.bubbleSize.width/2;if(this.isHidden||i){let t;let s;if(this.savedPosition&&this.savedPosition.x<this.screenWidth-this.bubbleSize.width/2){t=this.savedPosition.x;s=this.savedPosition.y}else{t=this.screenWidth-this.bubbleSize.width-20;s=this.position.y}this.isHidden=false;this.onHiddenChange?.(false);this.notify();return{targetPosition:{x:t,y:s},isHiding:false}}else{this.savedPosition={...this.position};const t=this.screenWidth-this.visibleHandleWidth;this.isHidden=true;this.onHiddenChange?.(true);this.notify();return{targetPosition:{x:t,y:this.position.y},isHiding:true}}}forceHide(){if(this.isHidden){return{targetPosition:this.position}}this.savedPosition={...this.position};const i=this.screenWidth-this.visibleHandleWidth;this.isHidden=true;this.onHiddenChange?.(true);this.notify();return{targetPosition:{x:i,y:this.position.y}}}forceShow(){if(!this.isHidden){return{targetPosition:this.position}}let i;let t;if(this.savedPosition){i=this.savedPosition.x;t=this.savedPosition.y}else{i=this.screenWidth-this.bubbleSize.width-20;t=this.position.y}this.isHidden=false;this.onHiddenChange?.(false);this.notify();return{targetPosition:{x:i,y:t}}}handleDragStart(i){this.hasMoved=false;this.dragStartPos={...this.position};this.dragStartMouse={x:i.clientX,y:i.clientY}}handleDragMove(i){const t=i.clientX-this.dragStartMouse.x;const s=i.clientY-this.dragStartMouse.y;const a=Math.abs(t)+Math.abs(s);if(!this.hasMoved&&a>this.dragThreshold){this.hasMoved=true;this.isDragging=true;this.onDraggingChange?.(true);this.notify()}if(this.hasMoved){const n=this.dragStartPos.x+t;const e=this.dragStartPos.y+s;const r=this.getBounds();const l=Math.max(r.minX,Math.min(n,this.screenWidth-this.visibleHandleWidth+this.bubbleSize.width));const h=Math.max(r.minY,Math.min(e,r.maxY));this.position={x:l,y:h};this.onPositionChange?.(this.position);this.notify();return{position:this.position,isDragging:true}}return{position:this.position,isDragging:false}}handleDragEnd(i){const t=!this.hasMoved;if(t){this.isDragging=false;this.onDraggingChange?.(false);this.notify();return{position:this.position,shouldHide:false,wasTap:true}}const s=i.clientX-this.dragStartMouse.x;const a=i.clientY-this.dragStartMouse.y;const n=this.dragStartPos.x+s;const e=this.dragStartPos.y+a;const r=n+this.bubbleSize.width/2;const l=r>this.screenWidth;const h=this.getBounds();if(l){const o=this.screenWidth-this.visibleHandleWidth;const d=Math.max(h.minY,Math.min(e,h.maxY));this.isHidden=true;this.onHiddenChange?.(true);this.isDragging=false;this.onDraggingChange?.(false);this.notify();return{position:{x:o,y:d},shouldHide:true,wasTap:false}}else{if(this.isHidden&&n<this.screenWidth-this.visibleHandleWidth-10){this.isHidden=false;this.onHiddenChange?.(false)}const o=Math.max(h.minX,Math.min(n,this.screenWidth-this.bubbleSize.width-this.edgePadding));const d=Math.max(h.minY,Math.min(e,h.maxY));if(o<this.screenWidth-this.bubbleSize.width/2){this.savedPosition={x:o,y:d}}this.position={x:o,y:d};this.isDragging=false;this.onDraggingChange?.(false);this.debouncedSavePosition(o,d);this.notify();return{position:{x:o,y:d},shouldHide:false,wasTap:false}}}commitPosition(i){this.position=i;this.savePosition(i.x,i.y);this.notify()}destroy(){if(this.saveTimeout){clearTimeout(this.saveTimeout);this.saveTimeout=null}this.listeners.clear()}}exports.FloatingToolsStore=FloatingToolsStore;
|
package/lib/commonjs/colors.js
CHANGED
|
@@ -1,54 +1 @@
|
|
|
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
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.floatingToolsColors=void 0;exports.withAlpha=withAlpha;const floatingToolsColors=exports.floatingToolsColors={panel:"#1A1A1A",muted:"#888888",secondary:"#E0E0E0",info:"#20C997",success:"#20C997",optional:"#FFA94D",error:"#EF4444",primary:"#20C997",dragActive:"#20C997"};function withAlpha(t,o){if(typeof o==="number"){const r=Math.round(o*255).toString(16).padStart(2,"0");return`${t}${r}`}return`${t}${o}`}
|
|
@@ -1,31 +1 @@
|
|
|
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
|
-
};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.VISIBLE_HANDLE_WIDTH=exports.STORAGE_KEYS=exports.SAVE_DEBOUNCE_MS=exports.EDGE_PADDING=exports.DRAG_THRESHOLD=exports.ANIMATION_DURATION=void 0;const VISIBLE_HANDLE_WIDTH=exports.VISIBLE_HANDLE_WIDTH=32;const DRAG_THRESHOLD=exports.DRAG_THRESHOLD=5;const ANIMATION_DURATION=exports.ANIMATION_DURATION=200;const EDGE_PADDING=exports.EDGE_PADDING=10;const SAVE_DEBOUNCE_MS=exports.SAVE_DEBOUNCE_MS=500;const STORAGE_KEYS=exports.STORAGE_KEYS={POSITION_X:"@react_buoy_bubble_position_x",POSITION_Y:"@react_buoy_bubble_position_y"};
|