framer-motion 10.2.2 → 10.2.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/dom-entry.js +1 -1
- package/dist/cjs/index.js +2 -2
- package/dist/cjs/{wrap-b7ab39cb.js → wrap-27fda06a.js} +1 -2
- package/dist/dom-entry.d.ts +53 -53
- package/dist/es/animation/animate.mjs +0 -1
- package/dist/es/render/utils/motion-values.mjs +1 -1
- package/dist/es/value/index.mjs +1 -1
- package/dist/framer-motion.dev.js +2 -3
- package/dist/framer-motion.js +1 -1
- package/dist/index.d.ts +182 -183
- package/dist/projection.dev.js +2 -3
- package/dist/three-entry.d.ts +69 -66
- package/package.json +6 -2
package/dist/cjs/dom-entry.js
CHANGED
package/dist/cjs/index.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var React = require('react');
|
|
6
|
-
var wrap = require('./wrap-
|
|
6
|
+
var wrap = require('./wrap-27fda06a.js');
|
|
7
7
|
|
|
8
8
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
9
9
|
|
|
@@ -5516,7 +5516,7 @@ function updateMotionValuesFromProps(element, next, prev) {
|
|
|
5516
5516
|
* and warn against mismatches.
|
|
5517
5517
|
*/
|
|
5518
5518
|
if (process.env.NODE_ENV === "development") {
|
|
5519
|
-
wrap.warnOnce(nextValue.version === "10.2.
|
|
5519
|
+
wrap.warnOnce(nextValue.version === "10.2.3", `Attempting to mix Framer Motion versions ${nextValue.version} with 10.2.3 may not work as expected.`);
|
|
5520
5520
|
}
|
|
5521
5521
|
}
|
|
5522
5522
|
else if (wrap.isMotionValue(prevValue)) {
|
|
@@ -415,7 +415,7 @@ class MotionValue {
|
|
|
415
415
|
* This will be replaced by the build step with the latest version number.
|
|
416
416
|
* When MotionValues are provided to motion components, warn if versions are mixed.
|
|
417
417
|
*/
|
|
418
|
-
this.version = "10.2.
|
|
418
|
+
this.version = "10.2.3";
|
|
419
419
|
/**
|
|
420
420
|
* Duration, in milliseconds, since last updating frame.
|
|
421
421
|
*
|
|
@@ -2343,7 +2343,6 @@ function animate(from, to, transition = {}) {
|
|
|
2343
2343
|
value.start(createMotionValueAnimation("", value, to, transition));
|
|
2344
2344
|
return {
|
|
2345
2345
|
stop: () => value.stop(),
|
|
2346
|
-
isAnimating: () => value.isAnimating(),
|
|
2347
2346
|
};
|
|
2348
2347
|
}
|
|
2349
2348
|
|
package/dist/dom-entry.d.ts
CHANGED
|
@@ -28,59 +28,6 @@ declare type Sync = {
|
|
|
28
28
|
[key in StepId]: Schedule;
|
|
29
29
|
};
|
|
30
30
|
|
|
31
|
-
/**
|
|
32
|
-
* @public
|
|
33
|
-
*/
|
|
34
|
-
interface AnimationPlaybackControls {
|
|
35
|
-
stop: () => void;
|
|
36
|
-
isAnimating: () => boolean;
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* @public
|
|
40
|
-
*/
|
|
41
|
-
interface AnimationPlaybackLifecycles<V> {
|
|
42
|
-
onUpdate?: (latest: V) => void;
|
|
43
|
-
onPlay?: () => void;
|
|
44
|
-
onComplete?: () => void;
|
|
45
|
-
onRepeat?: () => void;
|
|
46
|
-
onStop?: () => void;
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* @public
|
|
50
|
-
*/
|
|
51
|
-
declare type AnimationOptions<V> = (Tween | Spring) & AnimationPlaybackLifecycles<V> & {
|
|
52
|
-
delay?: number;
|
|
53
|
-
type?: "tween" | "spring";
|
|
54
|
-
};
|
|
55
|
-
/**
|
|
56
|
-
* Animate a single value or a `MotionValue`.
|
|
57
|
-
*
|
|
58
|
-
* The first argument is either a `MotionValue` to animate, or an initial animation value.
|
|
59
|
-
*
|
|
60
|
-
* The second is either a value to animate to, or an array of keyframes to animate through.
|
|
61
|
-
*
|
|
62
|
-
* The third argument can be either tween or spring options, and optional lifecycle methods: `onUpdate`, `onPlay`, `onComplete`, `onRepeat` and `onStop`.
|
|
63
|
-
*
|
|
64
|
-
* Returns `AnimationPlaybackControls`, currently just a `stop` method.
|
|
65
|
-
*
|
|
66
|
-
* ```javascript
|
|
67
|
-
* const x = useMotionValue(0)
|
|
68
|
-
*
|
|
69
|
-
* useEffect(() => {
|
|
70
|
-
* const controls = animate(x, 100, {
|
|
71
|
-
* type: "spring",
|
|
72
|
-
* stiffness: 2000,
|
|
73
|
-
* onComplete: v => {}
|
|
74
|
-
* })
|
|
75
|
-
*
|
|
76
|
-
* return controls.stop
|
|
77
|
-
* })
|
|
78
|
-
* ```
|
|
79
|
-
*
|
|
80
|
-
* @public
|
|
81
|
-
*/
|
|
82
|
-
declare function animate<V>(from: MotionValue<V> | V, to: V | V[], transition?: AnimationOptions<V>): AnimationPlaybackControls;
|
|
83
|
-
|
|
84
31
|
interface Repeat {
|
|
85
32
|
/**
|
|
86
33
|
* The number of times to repeat the transition. Set to `Infinity` for perpetual repeating.
|
|
@@ -398,6 +345,59 @@ interface Spring extends Repeat {
|
|
|
398
345
|
velocity?: number;
|
|
399
346
|
}
|
|
400
347
|
|
|
348
|
+
/**
|
|
349
|
+
* @public
|
|
350
|
+
*/
|
|
351
|
+
interface AnimationPlaybackControls {
|
|
352
|
+
currentTime?: number | null;
|
|
353
|
+
stop: () => void;
|
|
354
|
+
}
|
|
355
|
+
/**
|
|
356
|
+
* @public
|
|
357
|
+
*/
|
|
358
|
+
interface AnimationPlaybackLifecycles<V> {
|
|
359
|
+
onUpdate?: (latest: V) => void;
|
|
360
|
+
onPlay?: () => void;
|
|
361
|
+
onComplete?: () => void;
|
|
362
|
+
onRepeat?: () => void;
|
|
363
|
+
onStop?: () => void;
|
|
364
|
+
}
|
|
365
|
+
/**
|
|
366
|
+
* @public
|
|
367
|
+
*/
|
|
368
|
+
declare type AnimationOptions<V> = (Tween | Spring) & AnimationPlaybackLifecycles<V> & {
|
|
369
|
+
delay?: number;
|
|
370
|
+
type?: "tween" | "spring";
|
|
371
|
+
};
|
|
372
|
+
/**
|
|
373
|
+
* Animate a single value or a `MotionValue`.
|
|
374
|
+
*
|
|
375
|
+
* The first argument is either a `MotionValue` to animate, or an initial animation value.
|
|
376
|
+
*
|
|
377
|
+
* The second is either a value to animate to, or an array of keyframes to animate through.
|
|
378
|
+
*
|
|
379
|
+
* The third argument can be either tween or spring options, and optional lifecycle methods: `onUpdate`, `onPlay`, `onComplete`, `onRepeat` and `onStop`.
|
|
380
|
+
*
|
|
381
|
+
* Returns `AnimationPlaybackControls`, currently just a `stop` method.
|
|
382
|
+
*
|
|
383
|
+
* ```javascript
|
|
384
|
+
* const x = useMotionValue(0)
|
|
385
|
+
*
|
|
386
|
+
* useEffect(() => {
|
|
387
|
+
* const controls = animate(x, 100, {
|
|
388
|
+
* type: "spring",
|
|
389
|
+
* stiffness: 2000,
|
|
390
|
+
* onComplete: v => {}
|
|
391
|
+
* })
|
|
392
|
+
*
|
|
393
|
+
* return controls.stop
|
|
394
|
+
* })
|
|
395
|
+
* ```
|
|
396
|
+
*
|
|
397
|
+
* @public
|
|
398
|
+
*/
|
|
399
|
+
declare function animate<V>(from: MotionValue<V> | V, to: V | V[], transition?: AnimationOptions<V>): AnimationPlaybackControls;
|
|
400
|
+
|
|
401
401
|
/**
|
|
402
402
|
* @public
|
|
403
403
|
*/
|
|
@@ -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 === "10.2.
|
|
25
|
+
warnOnce(nextValue.version === "10.2.3", `Attempting to mix Framer Motion versions ${nextValue.version} with 10.2.3 may not work as expected.`);
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
else if (isMotionValue(prevValue)) {
|
package/dist/es/value/index.mjs
CHANGED
|
@@ -26,7 +26,7 @@ class MotionValue {
|
|
|
26
26
|
* This will be replaced by the build step with the latest version number.
|
|
27
27
|
* When MotionValues are provided to motion components, warn if versions are mixed.
|
|
28
28
|
*/
|
|
29
|
-
this.version = "10.2.
|
|
29
|
+
this.version = "10.2.3";
|
|
30
30
|
/**
|
|
31
31
|
* Duration, in milliseconds, since last updating frame.
|
|
32
32
|
*
|
|
@@ -1995,7 +1995,7 @@
|
|
|
1995
1995
|
* This will be replaced by the build step with the latest version number.
|
|
1996
1996
|
* When MotionValues are provided to motion components, warn if versions are mixed.
|
|
1997
1997
|
*/
|
|
1998
|
-
this.version = "10.2.
|
|
1998
|
+
this.version = "10.2.3";
|
|
1999
1999
|
/**
|
|
2000
2000
|
* Duration, in milliseconds, since last updating frame.
|
|
2001
2001
|
*
|
|
@@ -5613,7 +5613,6 @@
|
|
|
5613
5613
|
value.start(createMotionValueAnimation("", value, to, transition));
|
|
5614
5614
|
return {
|
|
5615
5615
|
stop: () => value.stop(),
|
|
5616
|
-
isAnimating: () => value.isAnimating(),
|
|
5617
5616
|
};
|
|
5618
5617
|
}
|
|
5619
5618
|
|
|
@@ -7862,7 +7861,7 @@
|
|
|
7862
7861
|
* and warn against mismatches.
|
|
7863
7862
|
*/
|
|
7864
7863
|
{
|
|
7865
|
-
warnOnce(nextValue.version === "10.2.
|
|
7864
|
+
warnOnce(nextValue.version === "10.2.3", `Attempting to mix Framer Motion versions ${nextValue.version} with 10.2.3 may not work as expected.`);
|
|
7866
7865
|
}
|
|
7867
7866
|
}
|
|
7868
7867
|
else if (isMotionValue(prevValue)) {
|