securityos/node_modules/framer-motion/dist/es/render/html/utils/scrape-motion-values.mjs

18 lines
588 B
JavaScript
Raw Normal View History

2024-09-06 15:32:35 +00:00
import { isForcedMotionValue } from '../../../motion/utils/is-forced-motion-value.mjs';
import { isMotionValue } from '../../../value/utils/is-motion-value.mjs';
function scrapeMotionValuesFromProps(props, prevProps) {
const { style } = props;
const newValues = {};
for (const key in style) {
if (isMotionValue(style[key]) ||
(prevProps.style && isMotionValue(prevProps.style[key])) ||
isForcedMotionValue(key, props)) {
newValues[key] = style[key];
}
}
return newValues;
}
export { scrapeMotionValuesFromProps };