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.
@@ -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.10.0";
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.10.0", `Attempting to mix Framer Motion versions ${nextValue.version} with 11.10.0 may not work as expected.`);
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
- ((_a = window.MotionHasOptimisedAnimation) === null || _a === void 0 ? void 0 : _a.call(window, optimisedAppearId)));
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 = false;
9047
- // This ensures all future calls to animateChanges() will run in useEffect
9048
- if (!scheduleHandoffComplete) {
9049
- scheduleHandoffComplete = true;
9050
- queueMicrotask(completeHandoff);
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"]