framer-motion 11.10.0 → 11.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/client.js +13 -14
- package/dist/cjs/dom.js +1222 -1150
- package/dist/cjs/index.js +647 -568
- package/dist/cjs/m.js +11 -12
- package/dist/client.d.ts +3 -1
- package/dist/dom.d.ts +27 -10
- package/dist/dom.js +1 -1
- package/dist/es/animation/animate/index.mjs +34 -0
- package/dist/es/animation/animate/resolve-subjects.mjs +19 -0
- package/dist/es/animation/animate/sequence.mjs +14 -0
- package/dist/es/animation/{interfaces → animate}/single-value.mjs +1 -1
- package/dist/es/animation/animate/subject.mjs +52 -0
- package/dist/es/animation/hooks/use-animate.mjs +1 -1
- package/dist/es/animation/optimized-appear/handoff.mjs +2 -1
- package/dist/es/animation/optimized-appear/start.mjs +12 -5
- package/dist/es/animation/optimized-appear/store.mjs +2 -2
- package/dist/es/animation/sequence/create.mjs +9 -13
- package/dist/es/animation/utils/create-visual-element.mjs +18 -2
- package/dist/es/dom.mjs +1 -1
- package/dist/es/index.mjs +1 -1
- package/dist/es/motion/utils/use-visual-element.mjs +11 -12
- package/dist/es/projection/node/create-projection-node.mjs +1 -1
- package/dist/es/render/object/ObjectVisualElement.mjs +41 -0
- package/dist/es/render/utils/motion-values.mjs +1 -1
- package/dist/es/value/index.mjs +1 -1
- package/dist/framer-motion.dev.js +647 -568
- package/dist/framer-motion.js +1 -1
- package/dist/index.d.ts +32 -14
- package/dist/m.d.ts +3 -1
- package/package.json +8 -4
- package/dist/es/animation/animate.mjs +0 -84
package/dist/cjs/client.js
CHANGED
|
@@ -3279,7 +3279,7 @@ class MotionValue {
|
|
|
3279
3279
|
* This will be replaced by the build step with the latest version number.
|
|
3280
3280
|
* When MotionValues are provided to motion components, warn if versions are mixed.
|
|
3281
3281
|
*/
|
|
3282
|
-
this.version = "11.
|
|
3282
|
+
this.version = "11.11.1";
|
|
3283
3283
|
/**
|
|
3284
3284
|
* Tracks whether this value can output a velocity. Currently this is only true
|
|
3285
3285
|
* if the value is numerical, but we might be able to widen the scope here and support
|
|
@@ -5877,7 +5877,7 @@ function updateMotionValuesFromProps(element, next, prev) {
|
|
|
5877
5877
|
* and warn against mismatches.
|
|
5878
5878
|
*/
|
|
5879
5879
|
if (process.env.NODE_ENV === "development") {
|
|
5880
|
-
warnOnce(nextValue.version === "11.
|
|
5880
|
+
warnOnce(nextValue.version === "11.11.1", `Attempting to mix Framer Motion versions ${nextValue.version} with 11.11.1 may not work as expected.`);
|
|
5881
5881
|
}
|
|
5882
5882
|
}
|
|
5883
5883
|
else if (isMotionValue(prevValue)) {
|
|
@@ -8971,9 +8971,8 @@ const useIsomorphicLayoutEffect = isBrowser ? react.useLayoutEffect : react.useE
|
|
|
8971
8971
|
|
|
8972
8972
|
const LazyContext = react.createContext({ strict: false });
|
|
8973
8973
|
|
|
8974
|
-
let scheduleHandoffComplete = false;
|
|
8975
8974
|
function useVisualElement(Component, visualState, props, createVisualElement, ProjectionNodeConstructor) {
|
|
8976
|
-
var _a;
|
|
8975
|
+
var _a, _b;
|
|
8977
8976
|
const { visualElement: parent } = react.useContext(MotionContext);
|
|
8978
8977
|
const lazyContext = react.useContext(LazyContext);
|
|
8979
8978
|
const presenceContext = react.useContext(PresenceContext);
|
|
@@ -9016,11 +9015,12 @@ function useVisualElement(Component, visualState, props, createVisualElement, Pr
|
|
|
9016
9015
|
*/
|
|
9017
9016
|
const optimisedAppearId = props[optimizedAppearDataAttribute];
|
|
9018
9017
|
const wantsHandoff = react.useRef(Boolean(optimisedAppearId) &&
|
|
9019
|
-
!window.MotionHandoffIsComplete &&
|
|
9020
|
-
((
|
|
9018
|
+
!((_a = window.MotionHandoffIsComplete) === null || _a === void 0 ? void 0 : _a.call(window, optimisedAppearId)) &&
|
|
9019
|
+
((_b = window.MotionHasOptimisedAnimation) === null || _b === void 0 ? void 0 : _b.call(window, optimisedAppearId)));
|
|
9021
9020
|
useIsomorphicLayoutEffect(() => {
|
|
9022
9021
|
if (!visualElement)
|
|
9023
9022
|
return;
|
|
9023
|
+
window.MotionIsMounted = true;
|
|
9024
9024
|
visualElement.updateFeatures();
|
|
9025
9025
|
microtask.render(visualElement.render);
|
|
9026
9026
|
/**
|
|
@@ -9043,18 +9043,17 @@ function useVisualElement(Component, visualState, props, createVisualElement, Pr
|
|
|
9043
9043
|
if (!wantsHandoff.current && visualElement.animationState) {
|
|
9044
9044
|
visualElement.animationState.animateChanges();
|
|
9045
9045
|
}
|
|
9046
|
-
wantsHandoff.current
|
|
9047
|
-
|
|
9048
|
-
|
|
9049
|
-
|
|
9050
|
-
|
|
9046
|
+
if (wantsHandoff.current) {
|
|
9047
|
+
// This ensures all future calls to animateChanges() in this component will run in useEffect
|
|
9048
|
+
queueMicrotask(() => {
|
|
9049
|
+
var _a;
|
|
9050
|
+
(_a = window.MotionHandoffMarkAsComplete) === null || _a === void 0 ? void 0 : _a.call(window, optimisedAppearId);
|
|
9051
|
+
});
|
|
9052
|
+
wantsHandoff.current = false;
|
|
9051
9053
|
}
|
|
9052
9054
|
});
|
|
9053
9055
|
return visualElement;
|
|
9054
9056
|
}
|
|
9055
|
-
function completeHandoff() {
|
|
9056
|
-
window.MotionHandoffIsComplete = true;
|
|
9057
|
-
}
|
|
9058
9057
|
function createProjectionNode(visualElement, props, ProjectionNodeConstructor, initialPromotionConfig) {
|
|
9059
9058
|
const { layoutId, layout, drag, dragConstraints, layoutScroll, layoutRoot, } = props;
|
|
9060
9059
|
visualElement.projection = new ProjectionNodeConstructor(visualElement.latestValues, props["data-framer-portal-id"]
|