securityos/node_modules/framer-motion/dist/es/events/event-info.mjs

16 lines
428 B
JavaScript
Raw Normal View History

2024-09-06 15:32:35 +00:00
import { isPrimaryPointer } from './utils/is-primary-pointer.mjs';
function extractEventInfo(event, pointType = "page") {
return {
point: {
x: event[pointType + "X"],
y: event[pointType + "Y"],
},
};
}
const addPointerInfo = (handler) => {
return (event) => isPrimaryPointer(event) && handler(event, extractEventInfo(event));
};
export { addPointerInfo, extractEventInfo };