framer-motion 11.2.0 → 11.2.2

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/index.d.ts CHANGED
@@ -3824,7 +3824,7 @@ declare const Reorder: {
3824
3824
  tabIndex?: number | undefined;
3825
3825
  "aria-activedescendant"?: string | undefined;
3826
3826
  "aria-atomic"?: (boolean | "false" | "true") | undefined;
3827
- "aria-autocomplete"?: "none" | "inline" | "both" | "list" | undefined;
3827
+ "aria-autocomplete"?: "both" | "none" | "inline" | "list" | undefined;
3828
3828
  "aria-braillelabel"?: string | undefined;
3829
3829
  "aria-brailleroledescription"?: string | undefined;
3830
3830
  "aria-busy"?: (boolean | "false" | "true") | undefined;
@@ -5187,7 +5187,7 @@ interface NativeAnimationOptions {
5187
5187
  repeatType?: "loop" | "reverse" | "mirror";
5188
5188
  }
5189
5189
 
5190
- type HandoffFunction = (storeId: string, valueName: string, _value?: MotionValue, _frame?: Batcher) => null | number;
5190
+ type HandoffFunction = (storeId: string, valueName: string, value?: MotionValue, frame?: Batcher) => null | number;
5191
5191
  /**
5192
5192
  * The window global object acts as a bridge between our inline script
5193
5193
  * triggering the optimized appear animations, and Framer Motion.
@@ -1013,7 +1013,7 @@
1013
1013
  * This will be replaced by the build step with the latest version number.
1014
1014
  * When MotionValues are provided to motion components, warn if versions are mixed.
1015
1015
  */
1016
- this.version = "11.2.0";
1016
+ this.version = "11.2.2";
1017
1017
  /**
1018
1018
  * Tracks whether this value can output a velocity. Currently this is only true
1019
1019
  * if the value is numerical, but we might be able to widen the scope here and support
@@ -3900,12 +3900,21 @@
3900
3900
  return Boolean(isMotionValue(value) && value.add);
3901
3901
  }
3902
3902
 
3903
- function resolveVariantFromProps(props, definition, custom, currentValues = {}, currentVelocity = {}) {
3903
+ function getValueState(visualElement) {
3904
+ const state = [{}, {}];
3905
+ visualElement === null || visualElement === void 0 ? void 0 : visualElement.values.forEach((value, key) => {
3906
+ state[0][key] = value.get();
3907
+ state[1][key] = value.getVelocity();
3908
+ });
3909
+ return state;
3910
+ }
3911
+ function resolveVariantFromProps(props, definition, custom, visualElement) {
3904
3912
  /**
3905
3913
  * If the variant definition is a function, resolve.
3906
3914
  */
3907
3915
  if (typeof definition === "function") {
3908
- definition = definition(custom !== undefined ? custom : props.custom, currentValues, currentVelocity);
3916
+ const [current, velocity] = getValueState(visualElement);
3917
+ definition = definition(custom !== undefined ? custom : props.custom, current, velocity);
3909
3918
  }
3910
3919
  /**
3911
3920
  * If the variant definition is a variant label, or
@@ -3920,7 +3929,8 @@
3920
3929
  * If so, resolve. This can only have returned a valid target object.
3921
3930
  */
3922
3931
  if (typeof definition === "function") {
3923
- definition = definition(custom !== undefined ? custom : props.custom, currentValues, currentVelocity);
3932
+ const [current, velocity] = getValueState(visualElement);
3933
+ definition = definition(custom !== undefined ? custom : props.custom, current, velocity);
3924
3934
  }
3925
3935
  return definition;
3926
3936
  }
@@ -4030,7 +4040,7 @@
4030
4040
  * and warn against mismatches.
4031
4041
  */
4032
4042
  {
4033
- warnOnce(nextValue.version === "11.2.0", `Attempting to mix Framer Motion versions ${nextValue.version} with 11.2.0 may not work as expected.`);
4043
+ warnOnce(nextValue.version === "11.2.2", `Attempting to mix Framer Motion versions ${nextValue.version} with 11.2.2 may not work as expected.`);
4034
4044
  }
4035
4045
  }
4036
4046
  else if (isMotionValue(prevValue)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "framer-motion",
3
- "version": "11.2.0",
3
+ "version": "11.2.2",
4
4
  "description": "A simple and powerful JavaScript animation library",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/es/index.mjs",
@@ -91,7 +91,7 @@
91
91
  },
92
92
  {
93
93
  "path": "./dist/size-rollup-m.js",
94
- "maxSize": "5.45 kB"
94
+ "maxSize": "5.5 kB"
95
95
  },
96
96
  {
97
97
  "path": "./dist/size-rollup-dom-animation.js",
@@ -107,7 +107,7 @@
107
107
  },
108
108
  {
109
109
  "path": "./dist/size-webpack-m.js",
110
- "maxSize": "5.92 kB"
110
+ "maxSize": "5.99 kB"
111
111
  },
112
112
  {
113
113
  "path": "./dist/size-webpack-dom-animation.js",
@@ -118,5 +118,5 @@
118
118
  "maxSize": "34.1 kB"
119
119
  }
120
120
  ],
121
- "gitHead": "2eab78b4f365dff3009362a202a0e1be7ca24e4c"
121
+ "gitHead": "02af4f385a659f0485f07f19c278a11fe78bcffd"
122
122
  }