motion 11.11.14 → 11.11.16

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.
@@ -1,32 +1,47 @@
1
- (node:7983) ExperimentalWarning: Importing JSON modules is an experimental feature and might change at any time
1
+ (node:75899) ExperimentalWarning: Importing JSON modules is an experimental feature and might change at any time
2
2
  (Use `node --trace-warnings ...` to show where the warning was created)
3
3
  
4
4
  lib/index.js → dist/motion.dev.js...
5
- created dist/motion.dev.js in 545ms
5
+ created dist/motion.dev.js in 844ms
6
6
  
7
7
  lib/index.js → dist/motion.js...
8
- created dist/motion.js in 950ms
8
+ created dist/motion.js in 978ms
9
9
  
10
10
  lib/index.js → dist/cjs...
11
- created dist/cjs in 292ms
11
+ created dist/cjs in 306ms
12
12
  
13
13
  lib/react-client.js → dist/cjs...
14
- created dist/cjs in 288ms
14
+ created dist/cjs in 365ms
15
+ 
16
+ lib/react.js → dist/cjs...
17
+ created dist/cjs in 8ms
18
+ 
19
+ lib/mini.js → dist/cjs...
20
+ created dist/cjs in 37ms
21
+ 
22
+ lib/react-mini.js → dist/cjs...
23
+ created dist/cjs in 36ms
15
24
  
16
25
  lib/react-m.js → dist/cjs...
17
- created dist/cjs in 91ms
26
+ created dist/cjs in 63ms
18
27
  
19
- lib/index.js, lib/react.js, lib/react-client.js, lib/react-m.js → dist/es...
20
- created dist/es in 533ms
28
+ lib/index.js, lib/mini.js, lib/react.js, lib/react-mini.js, lib/react-client.js, lib/react-m.js → dist/es...
29
+ created dist/es in 772ms
21
30
  
22
31
  types/index.d.ts → dist/index.d.ts...
23
- created dist/index.d.ts in 10ms
32
+ created dist/index.d.ts in 23ms
24
33
  
25
34
  types/react.d.ts → dist/react.d.ts...
26
- created dist/react.d.ts in 5ms
35
+ created dist/react.d.ts in 9ms
36
+ 
37
+ types/react-mini.d.ts → dist/react-mini.d.ts...
38
+ created dist/react-mini.d.ts in 5ms
27
39
  
28
40
  types/react-m.d.ts → dist/react-m.d.ts...
29
- created dist/react-m.d.ts in 3ms
41
+ created dist/react-m.d.ts in 2ms
42
+ 
43
+ types/mini.d.ts → dist/mini.d.ts...
44
+ created dist/mini.d.ts in 4ms
30
45
  
31
46
  types/react-client.d.ts → dist/react-client.d.ts...
32
- created dist/react-client.d.ts in 2ms
47
+ created dist/react-client.d.ts in 3ms
package/README.md CHANGED
@@ -79,27 +79,37 @@ export function Component({ isVisible }) {
79
79
 
80
80
  - Motion for React is MIT licensed.
81
81
 
82
- ### ✨ Sponsors
82
+ ## ✨ Sponsors
83
83
 
84
84
  Motion is sustainable thanks to the kind support of its sponsors.
85
85
 
86
+ ### Partners
87
+
86
88
  #### Framer
87
89
 
88
90
  Motion powers Framer animations, the web builder for creative pros. Design and ship your dream site. Zero code, maximum speed.
89
- <br/>
90
91
 
91
- <p align="center">
92
- <a href="https://www.framer.com?utm_source=motion-readme">
93
- <img src="https://framerusercontent.com/images/atXqxn4JhKm4LXVncdNjkKV7yCU.png" width="140" alt="Start for free" />
94
- </a>
95
- </p>
96
- <br/>
97
- <p align="center">
98
- <a href="https://www.framer.com?utm_source=motion-readme">
99
- <img src="https://framerusercontent.com/images/pMSOmGP2V8sSaZRV2D7i4HTBTe4.png" width="1000" alt="Framer Banner" />
100
- </a>
101
- </p>
92
+ <a href="https://www.framer.com?utm_source=motion-readme">
93
+ <img alt="Framer" src="https://github.com/user-attachments/assets/0404c7a1-c29d-4785-89ae-aae315f3c759" width="300px" height="200px">
94
+ </a>
95
+
96
+ ### Platinum
97
+
98
+ <a href="https://tailwindcss.com"><img alt="Tailwind" src="https://github.com/user-attachments/assets/c0496f09-b8ee-4bc4-85ab-83a071bbbdec" width="300px" height="200px"></a>
99
+
100
+ <a href="https://emilkowal.ski"><img alt="Emil Kowalski" src="https://github.com/user-attachments/assets/29f56b1a-37fb-4695-a6a6-151f6c24864f" width="300px" height="200px"></a>
101
+
102
+ <a href="https://linear.app"><img alt="Linear" src="https://github.com/user-attachments/assets/a93710bb-d8ed-40e3-b0fb-1c5b3e2b16bb" width="300px" height="200px"></a>
102
103
 
103
104
  ### Silver
104
105
 
105
- - [Tailwind](https://tailwindcss.com)
106
+ <a href="https://www.frontend.fyi/?utm_source=motion"><img alt="Frontend.fyi" src="https://github.com/user-attachments/assets/07d23aa5-69db-44a0-849d-90177e6fc817" width="150px" height="100px"></a>
107
+
108
+ <a href="https://www.frontend.fyi/?utm_source=motion"><img alt="Statamic" src="https://github.com/user-attachments/assets/5d28f090-bdd9-4b31-b134-fb2b94ca636f" width="150px" height="100px"></a>
109
+
110
+ <a href="https://firecrawl.dev"><img alt="Firecrawl" src="https://github.com/user-attachments/assets/cba90e54-1329-4353-8fba-85beef4d2ee9" width="150px" height="100px"></a>
111
+
112
+ ### Personal
113
+
114
+ - [Nusu](https://x.com/nusualabuga)
115
+ - [OlegWock](https://sinja.io)
package/dist/cjs/index.js CHANGED
@@ -279,7 +279,7 @@ class MotionValue {
279
279
  * This will be replaced by the build step with the latest version number.
280
280
  * When MotionValues are provided to motion components, warn if versions are mixed.
281
281
  */
282
- this.version = "11.11.13";
282
+ this.version = "11.11.16";
283
283
  /**
284
284
  * Tracks whether this value can output a velocity. Currently this is only true
285
285
  * if the value is numerical, but we might be able to widen the scope here and support
@@ -630,6 +630,9 @@ class GroupPlaybackControls {
630
630
  runAll(methodName) {
631
631
  this.animations.forEach((controls) => controls[methodName]());
632
632
  }
633
+ flatten() {
634
+ this.runAll("flatten");
635
+ }
633
636
  play() {
634
637
  this.runAll("play");
635
638
  }
@@ -2479,6 +2482,10 @@ class BaseAnimation {
2479
2482
  then(resolve, reject) {
2480
2483
  return this.currentFinishedPromise.then(resolve, reject);
2481
2484
  }
2485
+ flatten() {
2486
+ this.options.type = "keyframes";
2487
+ this.options.ease = "linear";
2488
+ }
2482
2489
  updateFinishedPromise() {
2483
2490
  this.currentFinishedPromise = new Promise((resolve) => {
2484
2491
  this.resolveFinishedPromise = resolve;
@@ -2993,6 +3000,13 @@ class MainThreadAnimation extends BaseAnimation {
2993
3000
  this.resolver = new KeyframeResolver$1(keyframes, onResolved, name, motionValue, element);
2994
3001
  this.resolver.scheduleResolve();
2995
3002
  }
3003
+ flatten() {
3004
+ super.flatten();
3005
+ // If we've already resolved the animation, re-initialise it
3006
+ if (this._resolved) {
3007
+ Object.assign(this._resolved, this.initPlayback(this._resolved.keyframes));
3008
+ }
3009
+ }
2996
3010
  initPlayback(keyframes$1) {
2997
3011
  const { type = "keyframes", repeat = 0, repeatDelay = 0, repeatType, velocity = 0, } = this.options;
2998
3012
  const generatorFactory = isGenerator(type)
@@ -4089,7 +4103,7 @@ function updateMotionValuesFromProps(element, next, prev) {
4089
4103
  * and warn against mismatches.
4090
4104
  */
4091
4105
  if (process.env.NODE_ENV === "development") {
4092
- warnOnce(nextValue.version === "11.11.13", `Attempting to mix Motion versions ${nextValue.version} with 11.11.13 may not work as expected.`);
4106
+ warnOnce(nextValue.version === "11.11.16", `Attempting to mix Motion versions ${nextValue.version} with 11.11.16 may not work as expected.`);
4093
4107
  }
4094
4108
  }
4095
4109
  else if (isMotionValue(prevValue)) {
@@ -5298,6 +5312,12 @@ class NativeAnimation {
5298
5312
  get startTime() {
5299
5313
  return this.animation ? this.animation.startTime : null;
5300
5314
  }
5315
+ flatten() {
5316
+ var _a;
5317
+ if (!this.animation)
5318
+ return;
5319
+ (_a = this.animation.effect) === null || _a === void 0 ? void 0 : _a.updateTiming({ easing: "linear" });
5320
+ }
5301
5321
  play() {
5302
5322
  if (this.state === "finished") {
5303
5323
  this.updateFinishedPromise();
@@ -5914,6 +5934,7 @@ function scrollFunction(onScroll, options) {
5914
5934
  }
5915
5935
  }
5916
5936
  function scrollAnimation(animation, options) {
5937
+ animation.flatten();
5917
5938
  if (needsElementTracking(options)) {
5918
5939
  animation.pause();
5919
5940
  return scrollInfo((info) => {
@@ -5922,12 +5943,17 @@ function scrollAnimation(animation, options) {
5922
5943
  }
5923
5944
  else {
5924
5945
  const timeline = getTimeline(options);
5925
- return animation.attachTimeline(timeline, (valueAnimation) => {
5926
- valueAnimation.pause();
5927
- return observeTimeline((progress) => {
5928
- valueAnimation.time = valueAnimation.duration * progress;
5929
- }, timeline);
5930
- });
5946
+ if (animation.attachTimeline) {
5947
+ return animation.attachTimeline(timeline, (valueAnimation) => {
5948
+ valueAnimation.pause();
5949
+ return observeTimeline((progress) => {
5950
+ valueAnimation.time = valueAnimation.duration * progress;
5951
+ }, timeline);
5952
+ });
5953
+ }
5954
+ else {
5955
+ return noop;
5956
+ }
5931
5957
  }
5932
5958
  }
5933
5959
  function scroll(onScroll, { axis = "y", ...options } = {}) {