| 12345678910111213141516171819202122232425262728 |
- const featureProps = {
- animation: [
- "animate",
- "variants",
- "whileHover",
- "whileTap",
- "exit",
- "whileInView",
- "whileFocus",
- "whileDrag",
- ],
- exit: ["exit"],
- drag: ["drag", "dragControls"],
- focus: ["whileFocus"],
- hover: ["whileHover", "onHoverStart", "onHoverEnd"],
- tap: ["whileTap", "onTap", "onTapStart", "onTapCancel"],
- pan: ["onPan", "onPanStart", "onPanSessionStart", "onPanEnd"],
- inView: ["whileInView", "onViewportEnter", "onViewportLeave"],
- layout: ["layout", "layoutId"],
- };
- const featureDefinitions = {};
- for (const key in featureProps) {
- featureDefinitions[key] = {
- isEnabled: (props) => featureProps[key].some((name) => !!props[name]),
- };
- }
- export { featureDefinitions };
|