framer-motion-3d
Advanced tools
Comparing version 6.0.0-alpha.3 to 6.0.0-beta.4
@@ -107,4 +107,24 @@ 'use strict'; | ||
var useRender = function (Component, props, _projectionId, ref, _state, isStatic, visualElement) { | ||
return React.createElement(Component, tslib.__assign(tslib.__assign(tslib.__assign(tslib.__assign({ ref: ref }, framerMotion.filterProps(props, false, false)), { onUpdate: props.onInstanceUpdate }), useHover(isStatic, props, visualElement)), useTap(isStatic, props, visualElement))); | ||
var visualProps = useVisualProps(props); | ||
/** | ||
* If isStatic, render motion values as props | ||
* If !isStatic, render motion values as props on initial render | ||
*/ | ||
return React.createElement(Component, tslib.__assign(tslib.__assign(tslib.__assign(tslib.__assign(tslib.__assign({ ref: ref }, framerMotion.filterProps(props, false, false)), visualProps), { onUpdate: props.onInstanceUpdate }), useHover(isStatic, props, visualElement)), useTap(isStatic, props, visualElement))); | ||
}; | ||
function useVisualProps(props) { | ||
return React.useMemo(function () { | ||
var visualProps = {}; | ||
for (var key in props) { | ||
var prop = props[key]; | ||
if (framerMotion.isMotionValue(prop)) { | ||
visualProps[key] = prop.get(); | ||
} | ||
else if (Array.isArray(prop)) { | ||
visualProps[key] = prop.map(framerMotion.resolveMotionValue); | ||
} | ||
} | ||
return visualProps; | ||
}, []); | ||
} | ||
@@ -111,0 +131,0 @@ var setVector = function (name, defaultValue) { |
{ | ||
"name": "framer-motion-3d", | ||
"version": "6.0.0-alpha.3", | ||
"version": "6.0.0-beta.4", | ||
"description": "A simple and powerful React animation library for @react-three/fiber", | ||
@@ -39,2 +39,3 @@ "main": "dist/cjs/index.js", | ||
"build": "yarn clean && tsc -p . && rollup -c", | ||
"dev": "yarn watch", | ||
"clean": "rm -rf types dist lib", | ||
@@ -47,3 +48,3 @@ "prettier": "prettier ./src/* --write", | ||
"dependencies": { | ||
"framer-motion": "^6.0.0-alpha.3", | ||
"framer-motion": "^6.0.0-beta.4", | ||
"react-merge-refs": "^1.1.0" | ||
@@ -102,3 +103,3 @@ }, | ||
}, | ||
"gitHead": "dd6ef95f267d471053d71e637639f510a161320a" | ||
"gitHead": "a2dbe9fbe3f4ee27b8759f0c6b43e4bfd43c4e30" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3229258
57564
Updatedframer-motion@^6.0.0-beta.4