framer-motion 12.23.7 → 12.23.9

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.
@@ -2687,6 +2687,11 @@
2687
2687
  ((type === "spring" || isGenerator(type)) && velocity));
2688
2688
  }
2689
2689
 
2690
+ function makeAnimationInstant(options) {
2691
+ options.duration = 0;
2692
+ options.type === "keyframes";
2693
+ }
2694
+
2690
2695
  /**
2691
2696
  * A list of values that can be hardware-accelerated.
2692
2697
  */
@@ -2779,7 +2784,7 @@
2779
2784
  onUpdate?.(getFinalKeyframe$1(keyframes, options, finalKeyframe));
2780
2785
  }
2781
2786
  keyframes[0] = keyframes[keyframes.length - 1];
2782
- options.duration = 0;
2787
+ makeAnimationInstant(options);
2783
2788
  options.repeat = 0;
2784
2789
  }
2785
2790
  /**
@@ -3625,7 +3630,7 @@
3625
3630
  * An object containing a SubscriptionManager for each active event.
3626
3631
  */
3627
3632
  this.events = {};
3628
- this.updateAndNotify = (v, render = true) => {
3633
+ this.updateAndNotify = (v) => {
3629
3634
  const currentTime = time.now();
3630
3635
  /**
3631
3636
  * If we're updating the value during another frame or eventloop
@@ -3646,10 +3651,6 @@
3646
3651
  }
3647
3652
  }
3648
3653
  }
3649
- // Update render subscribers
3650
- if (render) {
3651
- this.events.renderRequest?.notify(this.current);
3652
- }
3653
3654
  };
3654
3655
  this.hasAnimated = false;
3655
3656
  this.setCurrent(init);
@@ -3760,9 +3761,9 @@
3760
3761
  *
3761
3762
  * @public
3762
3763
  */
3763
- set(v, render = true) {
3764
- if (!render || !this.passiveEffect) {
3765
- this.updateAndNotify(v, render);
3764
+ set(v) {
3765
+ if (!this.passiveEffect) {
3766
+ this.updateAndNotify(v);
3766
3767
  }
3767
3768
  else {
3768
3769
  this.passiveEffect(v, this.updateAndNotify);
@@ -5593,7 +5594,7 @@
5593
5594
  let shouldSkip = false;
5594
5595
  if (options.type === false ||
5595
5596
  (options.duration === 0 && !options.repeatDelay)) {
5596
- options.duration = 0;
5597
+ makeAnimationInstant(options);
5597
5598
  if (options.delay === 0) {
5598
5599
  shouldSkip = true;
5599
5600
  }
@@ -5601,7 +5602,7 @@
5601
5602
  if (MotionGlobalConfig.instantAnimations ||
5602
5603
  MotionGlobalConfig.skipAnimations) {
5603
5604
  shouldSkip = true;
5604
- options.duration = 0;
5605
+ makeAnimationInstant(options);
5605
5606
  options.delay = 0;
5606
5607
  }
5607
5608
  /**
@@ -8259,7 +8260,7 @@
8259
8260
  for (const key in initialMotionValues) {
8260
8261
  const value = initialMotionValues[key];
8261
8262
  if (latestValues[key] !== undefined && isMotionValue(value)) {
8262
- value.set(latestValues[key], false);
8263
+ value.set(latestValues[key]);
8263
8264
  }
8264
8265
  }
8265
8266
  }
@@ -8323,15 +8324,14 @@
8323
8324
  if (valueIsTransform && this.projection) {
8324
8325
  this.projection.isTransformDirty = true;
8325
8326
  }
8327
+ this.scheduleRender();
8326
8328
  });
8327
- const removeOnRenderRequest = value.on("renderRequest", this.scheduleRender);
8328
8329
  let removeSyncCheck;
8329
8330
  if (window.MotionCheckAppearSync) {
8330
8331
  removeSyncCheck = window.MotionCheckAppearSync(this, key, value);
8331
8332
  }
8332
8333
  this.valueSubscriptions.set(key, () => {
8333
8334
  removeOnChange();
8334
- removeOnRenderRequest();
8335
8335
  if (removeSyncCheck)
8336
8336
  removeSyncCheck();
8337
8337
  if (value.owner)
@@ -14165,6 +14165,7 @@
14165
14165
  exports.isZeroValueString = isZeroValueString;
14166
14166
  exports.keyframes = keyframes;
14167
14167
  exports.m = m;
14168
+ exports.makeAnimationInstant = makeAnimationInstant;
14168
14169
  exports.makeUseVisualState = makeUseVisualState;
14169
14170
  exports.mapEasingToNativeEasing = mapEasingToNativeEasing;
14170
14171
  exports.mapValue = mapValue;