skeletonlabs / floating-ui-svelte

A Floating UI wrapper for Svelte
https://floating-ui-svelte.vercel.app
MIT License
123 stars 4 forks source link

Add: useClientPoint #117

Open endigo9740 opened 1 month ago

endigo9740 commented 1 month ago

Reference

https://floating-ui.com/docs/useClientPoint

Description

Positions the floating element at a given client point (x, y), usually generated by a mouse event. By default, the client’s mouse position is automatically tracked.

Props

https://floating-ui.com/docs/useClientPoint#props

edwardnguyen225 commented 1 month ago

@endigo9740 May I tackle this issue for you guys? I'm happy to contribute to Svelte libraries.

endigo9740 commented 1 month ago

Hey @edwardnguyen225 as mentioned on Discord, this should be fine, but I'll let @Hugos68 confirm. I'll let him assign the ticket if he gives the thumbs up.

In the meantime, here's the React source to reference: https://github.com/floating-ui/floating-ui/blob/master/packages/react/src/hooks/useClientPoint.ts

And of course feel free to browse how the other hooks have been implemented. I'm planning to review the useFocus hook tomorrow, which introduces a number of utilities that might overlap.

Thanks!

Hugos68 commented 1 month ago

@edwardnguyen225 Feel free to go ahead and port this hook, like Chris said you can use other hooks as well as our contribution guide to guide you, thanks!

Hugos68 commented 1 month ago

@edwardnguyen225 Do you still want to take on this hook? We want to move forward with this, otherwise I'll be happy to take over.

edwardnguyen225 commented 1 month ago

@Hugos68 Apologies for the delay, I've been occupied with interviews. Please go ahead without me. I'll be sure to contribute to another feature soon.

Hugos68 commented 1 month ago

No worries, we're just trying to move fast since we've got another project waiting for this port 👍