| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- /**
- * A list of all valid MotionProps.
- *
- * @privateRemarks
- * This doesn't throw if a `MotionProp` name is missing - it should.
- */
- const validMotionProps = new Set([
- "animate",
- "exit",
- "variants",
- "initial",
- "style",
- "values",
- "variants",
- "transition",
- "transformTemplate",
- "custom",
- "inherit",
- "onBeforeLayoutMeasure",
- "onAnimationStart",
- "onAnimationComplete",
- "onUpdate",
- "onDragStart",
- "onDrag",
- "onDragEnd",
- "onMeasureDragConstraints",
- "onDirectionLock",
- "onDragTransitionEnd",
- "_dragX",
- "_dragY",
- "onHoverStart",
- "onHoverEnd",
- "onViewportEnter",
- "onViewportLeave",
- "globalTapTarget",
- "ignoreStrict",
- "viewport",
- ]);
- /**
- * Check whether a prop name is a valid `MotionProp` key.
- *
- * @param key - Name of the property to check
- * @returns `true` is key is a valid `MotionProp`.
- *
- * @public
- */
- function isValidMotionProp(key) {
- return (key.startsWith("while") ||
- (key.startsWith("drag") && key !== "draggable") ||
- key.startsWith("layout") ||
- key.startsWith("onTap") ||
- key.startsWith("onPan") ||
- key.startsWith("onLayout") ||
- validMotionProps.has(key));
- }
- export { isValidMotionProp };
|