framer-motion 12.10.2 → 12.10.4
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 +1 -1
- package/dist/cjs/{create-VyaVgJv2.js → create-CHfdhPin.js} +10 -8
- package/dist/cjs/dom.js +3 -1
- package/dist/cjs/index.js +1 -1
- package/dist/dom.js +1 -1
- package/dist/es/animation/interfaces/motion-value.mjs +4 -2
- package/dist/es/projection/node/create-projection-node.mjs +8 -8
- package/dist/framer-motion.dev.js +16 -12
- package/dist/framer-motion.js +1 -1
- package/dist/size-rollup-animate.js +1 -1
- package/dist/size-rollup-dom-animation.js +1 -1
- package/dist/size-rollup-dom-max.js +1 -1
- package/dist/size-rollup-motion.js +1 -1
- package/dist/types/client.d.ts +1 -1
- package/dist/types/index.d.ts +2 -2
- package/dist/{types.d-DSjX-LJB.d.ts → types.d-CQt5spQA.d.ts} +2 -2
- package/package.json +3 -3
|
@@ -2059,10 +2059,12 @@
|
|
|
2059
2059
|
* This method is bound to the instance to fix a pattern where
|
|
2060
2060
|
* animation.stop is returned as a reference from a useEffect.
|
|
2061
2061
|
*/
|
|
2062
|
-
this.stop = () => {
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2062
|
+
this.stop = (sync = true) => {
|
|
2063
|
+
if (sync) {
|
|
2064
|
+
const { motionValue } = this.options;
|
|
2065
|
+
if (motionValue && motionValue.updatedAt !== time.now()) {
|
|
2066
|
+
this.tick(time.now());
|
|
2067
|
+
}
|
|
2066
2068
|
}
|
|
2067
2069
|
this.isStopped = true;
|
|
2068
2070
|
if (this.state === "idle")
|
|
@@ -5290,7 +5292,9 @@
|
|
|
5290
5292
|
return;
|
|
5291
5293
|
}
|
|
5292
5294
|
}
|
|
5293
|
-
return
|
|
5295
|
+
return valueTransition.isSync
|
|
5296
|
+
? new JSAnimation(options)
|
|
5297
|
+
: new AsyncMotionValueAnimation(options);
|
|
5294
5298
|
};
|
|
5295
5299
|
|
|
5296
5300
|
function animateSingleValue(value, keyframes, options) {
|
|
@@ -6928,10 +6932,8 @@
|
|
|
6928
6932
|
}
|
|
6929
6933
|
startAnimation(options) {
|
|
6930
6934
|
this.notifyListeners("animationStart");
|
|
6931
|
-
this.currentAnimation
|
|
6932
|
-
|
|
6933
|
-
this.resumingFrom.currentAnimation.stop();
|
|
6934
|
-
}
|
|
6935
|
+
this.currentAnimation?.stop(false);
|
|
6936
|
+
this.resumingFrom?.currentAnimation?.stop(false);
|
|
6935
6937
|
if (this.pendingAnimation) {
|
|
6936
6938
|
cancelFrame(this.pendingAnimation);
|
|
6937
6939
|
this.pendingAnimation = undefined;
|
|
@@ -6944,8 +6946,10 @@
|
|
|
6944
6946
|
this.pendingAnimation = frame.update(() => {
|
|
6945
6947
|
globalProjectionState.hasAnimatedSinceResize = true;
|
|
6946
6948
|
activeAnimations.layout++;
|
|
6947
|
-
this.
|
|
6949
|
+
this.motionValue || (this.motionValue = motionValue(0));
|
|
6950
|
+
this.currentAnimation = animateSingleValue(this.motionValue, [0, 1000], {
|
|
6948
6951
|
...options,
|
|
6952
|
+
isSync: true,
|
|
6949
6953
|
onUpdate: (latest) => {
|
|
6950
6954
|
this.mixTargetDelta(latest);
|
|
6951
6955
|
options.onUpdate && options.onUpdate(latest);
|
|
@@ -6981,7 +6985,7 @@
|
|
|
6981
6985
|
finishAnimation() {
|
|
6982
6986
|
if (this.currentAnimation) {
|
|
6983
6987
|
this.mixTargetDelta && this.mixTargetDelta(animationTarget);
|
|
6984
|
-
this.currentAnimation.stop();
|
|
6988
|
+
this.currentAnimation.stop(false);
|
|
6985
6989
|
}
|
|
6986
6990
|
this.completeAnimation();
|
|
6987
6991
|
}
|
|
@@ -7246,7 +7250,7 @@
|
|
|
7246
7250
|
}
|
|
7247
7251
|
// Only run on root
|
|
7248
7252
|
resetTree() {
|
|
7249
|
-
this.root.nodes.forEach((node) => node.currentAnimation?.stop());
|
|
7253
|
+
this.root.nodes.forEach((node) => node.currentAnimation?.stop(false));
|
|
7250
7254
|
this.root.nodes.forEach(clearMeasurements);
|
|
7251
7255
|
this.root.sharedNodes.clear();
|
|
7252
7256
|
}
|