import { onScopeDispose, readonly, ref } from "vue";
import { createSharedComposable } from "@veno-ui/utils";
const useSharedClick = createSharedComposable(() => {
  const clickedEl = ref();
  const clickedPosition = ref();
  const onClick = (e) => {
    clickedEl.value = e.target;
    clickedPosition.value = { left: e.clientX, top: e.clientY };
  };
  document.addEventListener("click", onClick);
  onScopeDispose(() => {
    document.removeEventListener("click", onClick);
  });
  return {
    clickedEl,
    clickedPosition: readonly(clickedPosition)
  };
});
export {
  useSharedClick
};
//# sourceMappingURL=index.mjs.map
