framer-motion 8.4.6 → 8.4.7

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/index.js CHANGED
@@ -1396,11 +1396,22 @@ function useFocusGesture({ whileFocus, visualElement, }) {
1396
1396
  useDomEvent(visualElement, "blur", whileFocus ? onBlur : undefined);
1397
1397
  }
1398
1398
 
1399
- /**
1400
- * Specifically match against false here as incomplete versions of
1401
- * PointerEvents in very old browser might have it set as undefined.
1402
- */
1403
- const isPrimaryPointer = (event) => event.isPrimary !== false;
1399
+ const isPrimaryPointer = (event) => {
1400
+ if (event.pointerType === "mouse") {
1401
+ return typeof event.button !== "number" || event.button <= 0;
1402
+ }
1403
+ else {
1404
+ /**
1405
+ * isPrimary is true for all mice buttons, whereas every touch point
1406
+ * is regarded as its own input. So subsequent concurrent touch points
1407
+ * will be false.
1408
+ *
1409
+ * Specifically match against false here as incomplete versions of
1410
+ * PointerEvents in very old browser might have it set as undefined.
1411
+ */
1412
+ return event.isPrimary !== false;
1413
+ }
1414
+ };
1404
1415
 
1405
1416
  function extractEventInfo(event, pointType = "page") {
1406
1417
  return {
@@ -2093,7 +2104,7 @@ class MotionValue {
2093
2104
  * This will be replaced by the build step with the latest version number.
2094
2105
  * When MotionValues are provided to motion components, warn if versions are mixed.
2095
2106
  */
2096
- this.version = "8.4.6";
2107
+ this.version = "8.4.7";
2097
2108
  /**
2098
2109
  * Duration, in milliseconds, since last updating frame.
2099
2110
  *
@@ -5986,7 +5997,7 @@ function updateMotionValuesFromProps(element, next, prev) {
5986
5997
  * and warn against mismatches.
5987
5998
  */
5988
5999
  if (process.env.NODE_ENV === "development") {
5989
- warnOnce(nextValue.version === "8.4.6", `Attempting to mix Framer Motion versions ${nextValue.version} with 8.4.6 may not work as expected.`);
6000
+ warnOnce(nextValue.version === "8.4.7", `Attempting to mix Framer Motion versions ${nextValue.version} with 8.4.7 may not work as expected.`);
5990
6001
  }
5991
6002
  }
5992
6003
  else if (isMotionValue(prevValue)) {
@@ -1,7 +1,18 @@
1
- /**
2
- * Specifically match against false here as incomplete versions of
3
- * PointerEvents in very old browser might have it set as undefined.
4
- */
5
- const isPrimaryPointer = (event) => event.isPrimary !== false;
1
+ const isPrimaryPointer = (event) => {
2
+ if (event.pointerType === "mouse") {
3
+ return typeof event.button !== "number" || event.button <= 0;
4
+ }
5
+ else {
6
+ /**
7
+ * isPrimary is true for all mice buttons, whereas every touch point
8
+ * is regarded as its own input. So subsequent concurrent touch points
9
+ * will be false.
10
+ *
11
+ * Specifically match against false here as incomplete versions of
12
+ * PointerEvents in very old browser might have it set as undefined.
13
+ */
14
+ return event.isPrimary !== false;
15
+ }
16
+ };
6
17
 
7
18
  export { isPrimaryPointer };
@@ -22,7 +22,7 @@ function updateMotionValuesFromProps(element, next, prev) {
22
22
  * and warn against mismatches.
23
23
  */
24
24
  if (process.env.NODE_ENV === "development") {
25
- warnOnce(nextValue.version === "8.4.6", `Attempting to mix Framer Motion versions ${nextValue.version} with 8.4.6 may not work as expected.`);
25
+ warnOnce(nextValue.version === "8.4.7", `Attempting to mix Framer Motion versions ${nextValue.version} with 8.4.7 may not work as expected.`);
26
26
  }
27
27
  }
28
28
  else if (isMotionValue(prevValue)) {
@@ -25,7 +25,7 @@ class MotionValue {
25
25
  * This will be replaced by the build step with the latest version number.
26
26
  * When MotionValues are provided to motion components, warn if versions are mixed.
27
27
  */
28
- this.version = "8.4.6";
28
+ this.version = "8.4.7";
29
29
  /**
30
30
  * Duration, in milliseconds, since last updating frame.
31
31
  *
@@ -1394,11 +1394,22 @@
1394
1394
  useDomEvent(visualElement, "blur", whileFocus ? onBlur : undefined);
1395
1395
  }
1396
1396
 
1397
- /**
1398
- * Specifically match against false here as incomplete versions of
1399
- * PointerEvents in very old browser might have it set as undefined.
1400
- */
1401
- const isPrimaryPointer = (event) => event.isPrimary !== false;
1397
+ const isPrimaryPointer = (event) => {
1398
+ if (event.pointerType === "mouse") {
1399
+ return typeof event.button !== "number" || event.button <= 0;
1400
+ }
1401
+ else {
1402
+ /**
1403
+ * isPrimary is true for all mice buttons, whereas every touch point
1404
+ * is regarded as its own input. So subsequent concurrent touch points
1405
+ * will be false.
1406
+ *
1407
+ * Specifically match against false here as incomplete versions of
1408
+ * PointerEvents in very old browser might have it set as undefined.
1409
+ */
1410
+ return event.isPrimary !== false;
1411
+ }
1412
+ };
1402
1413
 
1403
1414
  function extractEventInfo(event, pointType = "page") {
1404
1415
  return {
@@ -2091,7 +2102,7 @@
2091
2102
  * This will be replaced by the build step with the latest version number.
2092
2103
  * When MotionValues are provided to motion components, warn if versions are mixed.
2093
2104
  */
2094
- this.version = "8.4.6";
2105
+ this.version = "8.4.7";
2095
2106
  /**
2096
2107
  * Duration, in milliseconds, since last updating frame.
2097
2108
  *
@@ -5999,7 +6010,7 @@
5999
6010
  * and warn against mismatches.
6000
6011
  */
6001
6012
  {
6002
- warnOnce(nextValue.version === "8.4.6", `Attempting to mix Framer Motion versions ${nextValue.version} with 8.4.6 may not work as expected.`);
6013
+ warnOnce(nextValue.version === "8.4.7", `Attempting to mix Framer Motion versions ${nextValue.version} with 8.4.7 may not work as expected.`);
6003
6014
  }
6004
6015
  }
6005
6016
  else if (isMotionValue(prevValue)) {