framer-motion 8.0.1 → 8.0.3

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
@@ -1382,18 +1382,15 @@ function extractEventInfo(event, pointType = "page") {
1382
1382
  },
1383
1383
  };
1384
1384
  }
1385
- const wrapHandler = (handler, shouldFilterPrimaryPointer = false) => {
1386
- const listener = (event) => handler(event, extractEventInfo(event));
1387
- return shouldFilterPrimaryPointer
1388
- ? (event) => isPrimaryPointer(event) && listener(event)
1389
- : listener;
1385
+ const addPointerInfo = (handler) => {
1386
+ return (event) => isPrimaryPointer(event) && handler(event, extractEventInfo(event));
1390
1387
  };
1391
1388
 
1392
1389
  function addPointerEvent(target, eventName, handler, options) {
1393
- return addDomEvent(target, eventName, wrapHandler(handler, eventName === "pointerdown"), options);
1390
+ return addDomEvent(target, eventName, addPointerInfo(handler), options);
1394
1391
  }
1395
1392
  function usePointerEvent(ref, eventName, handler, options) {
1396
- return useDomEvent(ref, eventName, handler && wrapHandler(handler, eventName === "pointerdown"), options);
1393
+ return useDomEvent(ref, eventName, handler && addPointerInfo(handler), options);
1397
1394
  }
1398
1395
 
1399
1396
  function createLock(name) {
@@ -2065,7 +2062,7 @@ class MotionValue {
2065
2062
  * This will be replaced by the build step with the latest version number.
2066
2063
  * When MotionValues are provided to motion components, warn if versions are mixed.
2067
2064
  */
2068
- this.version = "8.0.1";
2065
+ this.version = "8.0.3";
2069
2066
  /**
2070
2067
  * Duration, in milliseconds, since last updating frame.
2071
2068
  *
@@ -3590,7 +3587,7 @@ function animateStyle(element, valueName, keyframes, { delay = 0, duration, repe
3590
3587
  */
3591
3588
  const sampleDelta = 10; //ms
3592
3589
  function createAcceleratedAnimation(value, valueName, { onUpdate, onComplete, ...options }) {
3593
- let { keyframes, duration = 0.3, elapsed = 0, ease } = options;
3590
+ let { keyframes, duration = 300, elapsed = 0, ease } = options;
3594
3591
  /**
3595
3592
  * If this animation needs pre-generated keyframes then generate.
3596
3593
  */
@@ -3845,7 +3842,7 @@ const isAnimatable = (key, value) => {
3845
3842
  * This filters out orchestration options and returns true
3846
3843
  * if any options are left.
3847
3844
  */
3848
- function isTransitionDefined({ when, delay: _delay, delayChildren, staggerChildren, staggerDirection, repeat, repeatType, repeatDelay, from, ...transition }) {
3845
+ function isTransitionDefined({ when, delay: _delay, delayChildren, staggerChildren, staggerDirection, repeat, repeatType, repeatDelay, from, elapsed, ...transition }) {
3849
3846
  return !!Object.keys(transition).length;
3850
3847
  }
3851
3848
  function isZero(value) {
@@ -5868,7 +5865,7 @@ function updateMotionValuesFromProps(element, next, prev) {
5868
5865
  * and warn against mismatches.
5869
5866
  */
5870
5867
  if (process.env.NODE_ENV === "development") {
5871
- warnOnce(nextValue.version === "8.0.1", `Attempting to mix Framer Motion versions ${nextValue.version} with 8.0.1 may not work as expected.`);
5868
+ warnOnce(nextValue.version === "8.0.3", `Attempting to mix Framer Motion versions ${nextValue.version} with 8.0.3 may not work as expected.`);
5872
5869
  }
5873
5870
  }
5874
5871
  else if (isMotionValue(prevValue)) {
@@ -9827,6 +9824,7 @@ exports.Reorder = Reorder;
9827
9824
  exports.SwitchLayoutGroupContext = SwitchLayoutGroupContext;
9828
9825
  exports.VisualElement = VisualElement;
9829
9826
  exports.addPointerEvent = addPointerEvent;
9827
+ exports.addPointerInfo = addPointerInfo;
9830
9828
  exports.addScaleCorrector = addScaleCorrector;
9831
9829
  exports.animate = animate;
9832
9830
  exports.animateVisualElement = animateVisualElement;
@@ -9894,4 +9892,3 @@ exports.useViewportScroll = useViewportScroll;
9894
9892
  exports.useVisualElementContext = useVisualElementContext;
9895
9893
  exports.useWillChange = useWillChange;
9896
9894
  exports.wrap = wrap;
9897
- exports.wrapHandler = wrapHandler;
@@ -5,7 +5,7 @@ import { getAnimatableNone } from '../../render/dom/value-types/animatable-none.
5
5
  * This filters out orchestration options and returns true
6
6
  * if any options are left.
7
7
  */
8
- function isTransitionDefined({ when, delay: _delay, delayChildren, staggerChildren, staggerDirection, repeat, repeatType, repeatDelay, from, ...transition }) {
8
+ function isTransitionDefined({ when, delay: _delay, delayChildren, staggerChildren, staggerDirection, repeat, repeatType, repeatDelay, from, elapsed, ...transition }) {
9
9
  return !!Object.keys(transition).length;
10
10
  }
11
11
  function isZero(value) {
@@ -10,7 +10,7 @@ import { isWaapiSupportedEasing } from './easing.mjs';
10
10
  */
11
11
  const sampleDelta = 10; //ms
12
12
  function createAcceleratedAnimation(value, valueName, { onUpdate, onComplete, ...options }) {
13
- let { keyframes, duration = 0.3, elapsed = 0, ease } = options;
13
+ let { keyframes, duration = 300, elapsed = 0, ease } = options;
14
14
  /**
15
15
  * If this animation needs pre-generated keyframes then generate.
16
16
  */
@@ -8,11 +8,8 @@ function extractEventInfo(event, pointType = "page") {
8
8
  },
9
9
  };
10
10
  }
11
- const wrapHandler = (handler, shouldFilterPrimaryPointer = false) => {
12
- const listener = (event) => handler(event, extractEventInfo(event));
13
- return shouldFilterPrimaryPointer
14
- ? (event) => isPrimaryPointer(event) && listener(event)
15
- : listener;
11
+ const addPointerInfo = (handler) => {
12
+ return (event) => isPrimaryPointer(event) && handler(event, extractEventInfo(event));
16
13
  };
17
14
 
18
- export { extractEventInfo, wrapHandler };
15
+ export { addPointerInfo, extractEventInfo };
@@ -1,11 +1,11 @@
1
1
  import { addDomEvent, useDomEvent } from './use-dom-event.mjs';
2
- import { wrapHandler } from './event-info.mjs';
2
+ import { addPointerInfo } from './event-info.mjs';
3
3
 
4
4
  function addPointerEvent(target, eventName, handler, options) {
5
- return addDomEvent(target, eventName, wrapHandler(handler, eventName === "pointerdown"), options);
5
+ return addDomEvent(target, eventName, addPointerInfo(handler), options);
6
6
  }
7
7
  function usePointerEvent(ref, eventName, handler, options) {
8
- return useDomEvent(ref, eventName, handler && wrapHandler(handler, eventName === "pointerdown"), options);
8
+ return useDomEvent(ref, eventName, handler && addPointerInfo(handler), options);
9
9
  }
10
10
 
11
11
  export { addPointerEvent, usePointerEvent };
package/dist/es/index.mjs CHANGED
@@ -71,7 +71,7 @@ export { filterProps } from './render/dom/utils/filter-props.mjs';
71
71
  export { makeUseVisualState } from './motion/utils/use-visual-state.mjs';
72
72
  export { isDragActive } from './gestures/drag/utils/lock.mjs';
73
73
  export { addPointerEvent } from './events/use-pointer-event.mjs';
74
- export { wrapHandler } from './events/event-info.mjs';
74
+ export { addPointerInfo } from './events/event-info.mjs';
75
75
  export { isMotionValue } from './value/utils/is-motion-value.mjs';
76
76
  export { isBrowser } from './utils/is-browser.mjs';
77
77
  export { useUnmountEffect } from './utils/use-unmount-effect.mjs';
@@ -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.0.1", `Attempting to mix Framer Motion versions ${nextValue.version} with 8.0.1 may not work as expected.`);
25
+ warnOnce(nextValue.version === "8.0.3", `Attempting to mix Framer Motion versions ${nextValue.version} with 8.0.3 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.0.1";
28
+ this.version = "8.0.3";
29
29
  /**
30
30
  * Duration, in milliseconds, since last updating frame.
31
31
  *
@@ -1380,18 +1380,15 @@
1380
1380
  },
1381
1381
  };
1382
1382
  }
1383
- const wrapHandler = (handler, shouldFilterPrimaryPointer = false) => {
1384
- const listener = (event) => handler(event, extractEventInfo(event));
1385
- return shouldFilterPrimaryPointer
1386
- ? (event) => isPrimaryPointer(event) && listener(event)
1387
- : listener;
1383
+ const addPointerInfo = (handler) => {
1384
+ return (event) => isPrimaryPointer(event) && handler(event, extractEventInfo(event));
1388
1385
  };
1389
1386
 
1390
1387
  function addPointerEvent(target, eventName, handler, options) {
1391
- return addDomEvent(target, eventName, wrapHandler(handler, eventName === "pointerdown"), options);
1388
+ return addDomEvent(target, eventName, addPointerInfo(handler), options);
1392
1389
  }
1393
1390
  function usePointerEvent(ref, eventName, handler, options) {
1394
- return useDomEvent(ref, eventName, handler && wrapHandler(handler, eventName === "pointerdown"), options);
1391
+ return useDomEvent(ref, eventName, handler && addPointerInfo(handler), options);
1395
1392
  }
1396
1393
 
1397
1394
  function createLock(name) {
@@ -2063,7 +2060,7 @@
2063
2060
  * This will be replaced by the build step with the latest version number.
2064
2061
  * When MotionValues are provided to motion components, warn if versions are mixed.
2065
2062
  */
2066
- this.version = "8.0.1";
2063
+ this.version = "8.0.3";
2067
2064
  /**
2068
2065
  * Duration, in milliseconds, since last updating frame.
2069
2066
  *
@@ -3603,7 +3600,7 @@
3603
3600
  */
3604
3601
  const sampleDelta = 10; //ms
3605
3602
  function createAcceleratedAnimation(value, valueName, { onUpdate, onComplete, ...options }) {
3606
- let { keyframes, duration = 0.3, elapsed = 0, ease } = options;
3603
+ let { keyframes, duration = 300, elapsed = 0, ease } = options;
3607
3604
  /**
3608
3605
  * If this animation needs pre-generated keyframes then generate.
3609
3606
  */
@@ -3858,7 +3855,7 @@
3858
3855
  * This filters out orchestration options and returns true
3859
3856
  * if any options are left.
3860
3857
  */
3861
- function isTransitionDefined({ when, delay: _delay, delayChildren, staggerChildren, staggerDirection, repeat, repeatType, repeatDelay, from, ...transition }) {
3858
+ function isTransitionDefined({ when, delay: _delay, delayChildren, staggerChildren, staggerDirection, repeat, repeatType, repeatDelay, from, elapsed, ...transition }) {
3862
3859
  return !!Object.keys(transition).length;
3863
3860
  }
3864
3861
  function isZero(value) {
@@ -5881,7 +5878,7 @@
5881
5878
  * and warn against mismatches.
5882
5879
  */
5883
5880
  {
5884
- warnOnce(nextValue.version === "8.0.1", `Attempting to mix Framer Motion versions ${nextValue.version} with 8.0.1 may not work as expected.`);
5881
+ warnOnce(nextValue.version === "8.0.3", `Attempting to mix Framer Motion versions ${nextValue.version} with 8.0.3 may not work as expected.`);
5885
5882
  }
5886
5883
  }
5887
5884
  else if (isMotionValue(prevValue)) {
@@ -10448,6 +10445,7 @@
10448
10445
  exports.SwitchLayoutGroupContext = SwitchLayoutGroupContext;
10449
10446
  exports.VisualElement = VisualElement;
10450
10447
  exports.addPointerEvent = addPointerEvent;
10448
+ exports.addPointerInfo = addPointerInfo;
10451
10449
  exports.addScaleCorrector = addScaleCorrector;
10452
10450
  exports.animate = animate;
10453
10451
  exports.animateVisualElement = animateVisualElement;
@@ -10515,7 +10513,6 @@
10515
10513
  exports.useVisualElementContext = useVisualElementContext;
10516
10514
  exports.useWillChange = useWillChange;
10517
10515
  exports.wrap = wrap;
10518
- exports.wrapHandler = wrapHandler;
10519
10516
 
10520
10517
  Object.defineProperty(exports, '__esModule', { value: true });
10521
10518