framer-motion 12.0.0-alpha.1 → 12.0.0
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/README.md +58 -52
- package/client/README.md +1 -0
- package/client/package.json +6 -0
- package/dist/cjs/{client-entry.js → client.js} +4582 -4926
- package/dist/cjs/dom-mini.js +644 -0
- package/dist/cjs/{dom-entry.js → dom.js} +2848 -2713
- package/dist/cjs/index.js +7132 -7447
- package/dist/cjs/{m-entry.js → m.js} +427 -455
- package/dist/cjs/mini.js +273 -0
- package/dist/{client-entry.d.ts → client.d.ts} +464 -568
- package/dist/dom-mini.d.ts +230 -0
- package/dist/dom-mini.js +1 -0
- package/dist/dom.d.ts +579 -0
- package/dist/dom.js +1 -1
- package/dist/es/animation/animate/index.mjs +34 -0
- package/dist/es/animation/animate/resolve-subjects.mjs +19 -0
- package/dist/es/animation/animate/sequence.mjs +14 -0
- package/dist/es/animation/{interfaces → animate}/single-value.mjs +1 -1
- package/dist/es/animation/animate/subject.mjs +52 -0
- package/dist/es/animation/animators/AcceleratedAnimation.mjs +40 -17
- package/dist/es/animation/animators/BaseAnimation.mjs +7 -2
- package/dist/es/animation/animators/MainThreadAnimation.mjs +18 -10
- package/dist/es/animation/animators/utils/can-animate.mjs +4 -2
- package/dist/es/animation/animators/waapi/NativeAnimation.mjs +112 -0
- package/dist/es/animation/animators/waapi/animate-elements.mjs +34 -0
- package/dist/es/animation/animators/waapi/animate-sequence.mjs +13 -0
- package/dist/es/animation/animators/waapi/animate-style.mjs +12 -0
- package/dist/es/animation/animators/waapi/index.mjs +4 -4
- package/dist/es/animation/animators/waapi/utils/style.mjs +8 -0
- package/dist/es/animation/animators/waapi/utils/supports-partial-keyframes.mjs +13 -0
- package/dist/es/animation/animators/waapi/utils/supports-waapi.mjs +5 -0
- package/dist/es/animation/generators/spring/defaults.mjs +27 -0
- package/dist/es/animation/generators/spring/find.mjs +9 -13
- package/dist/es/animation/generators/spring/index.mjs +55 -18
- package/dist/es/animation/hooks/animation-controls.mjs +1 -1
- package/dist/es/animation/hooks/use-animate-style.mjs +17 -0
- package/dist/es/animation/hooks/use-animate.mjs +1 -1
- package/dist/es/animation/interfaces/motion-value.mjs +7 -16
- package/dist/es/animation/interfaces/visual-element-target.mjs +7 -6
- package/dist/es/animation/optimized-appear/handoff.mjs +2 -1
- package/dist/es/animation/optimized-appear/start.mjs +16 -9
- package/dist/es/animation/optimized-appear/store-id.mjs +1 -1
- package/dist/es/animation/optimized-appear/store.mjs +2 -2
- package/dist/es/animation/sequence/create.mjs +45 -22
- package/dist/es/animation/sequence/utils/calc-repeat-duration.mjs +5 -0
- package/dist/es/animation/sequence/utils/normalize-times.mjs +13 -0
- package/dist/es/animation/utils/create-visual-element.mjs +18 -2
- package/dist/es/animation/utils/default-transitions.mjs +1 -1
- package/dist/es/animation/utils/{transitions.mjs → is-transition-defined.mjs} +1 -6
- package/dist/es/components/AnimatePresence/PresenceChild.mjs +13 -10
- package/dist/es/components/AnimatePresence/index.mjs +10 -7
- package/dist/es/components/AnimatePresence/use-presence.mjs +6 -3
- package/dist/es/components/AnimateSharedLayout.mjs +1 -1
- package/dist/es/components/Reorder/Group.mjs +4 -4
- package/dist/es/components/Reorder/Item.mjs +4 -4
- package/dist/es/dom-mini.mjs +2 -0
- package/dist/es/{dom-entry.mjs → dom.mjs} +14 -8
- package/dist/es/easing/back.mjs +3 -3
- package/dist/es/easing/cubic-bezier.mjs +1 -1
- package/dist/es/easing/ease.mjs +3 -3
- package/dist/es/easing/steps.mjs +15 -0
- package/dist/es/easing/utils/map.mjs +6 -6
- package/dist/es/events/event-info.mjs +4 -4
- package/dist/es/frameloop/frame.mjs +3 -3
- package/dist/es/frameloop/render-step.mjs +3 -2
- package/dist/es/gestures/drag/VisualElementDragControls.mjs +15 -21
- package/dist/es/gestures/drag/index.mjs +1 -1
- package/dist/es/gestures/drag/utils/constraints.mjs +1 -1
- package/dist/es/gestures/hover.mjs +19 -22
- package/dist/es/gestures/pan/PanSession.mjs +5 -5
- package/dist/es/gestures/pan/index.mjs +1 -1
- package/dist/es/gestures/press.mjs +19 -119
- package/dist/es/index.mjs +43 -38
- package/dist/es/mini.mjs +1 -0
- package/dist/es/motion/index.mjs +11 -7
- package/dist/es/motion/utils/is-forced-motion-value.mjs +1 -1
- package/dist/es/motion/utils/use-motion-ref.mjs +3 -1
- package/dist/es/motion/utils/use-visual-element.mjs +21 -14
- package/dist/es/motion/utils/use-visual-state.mjs +36 -59
- package/dist/es/projection/animation/mix-values.mjs +3 -4
- package/dist/es/projection/node/create-projection-node.mjs +17 -17
- package/dist/es/render/VisualElement.mjs +19 -47
- package/dist/es/render/dom/DOMKeyframesResolver.mjs +4 -3
- package/dist/es/render/dom/DOMVisualElement.mjs +15 -0
- package/dist/es/render/dom/resize/handle-element.mjs +1 -1
- package/dist/es/render/dom/scroll/index.mjs +66 -15
- package/dist/es/render/dom/scroll/info.mjs +1 -1
- package/dist/es/render/dom/scroll/offsets/index.mjs +6 -5
- package/dist/es/render/dom/utils/css-variables-conversion.mjs +1 -1
- package/dist/es/render/dom/utils/is-css-variable.mjs +4 -2
- package/dist/es/render/dom/utils/unit-conversion.mjs +2 -14
- package/dist/es/render/dom/value-types/number-browser.mjs +41 -0
- package/dist/es/render/dom/value-types/number.mjs +7 -63
- package/dist/es/render/dom/value-types/transform.mjs +31 -0
- package/dist/es/render/dom/viewport/index.mjs +3 -3
- package/dist/es/render/html/HTMLVisualElement.mjs +6 -21
- package/dist/es/render/html/config-motion.mjs +0 -1
- package/dist/es/render/html/utils/build-styles.mjs +2 -2
- package/dist/es/render/html/utils/build-transform.mjs +1 -1
- package/dist/es/render/html/utils/keys-position.mjs +13 -0
- package/dist/es/render/html/utils/scrape-motion-values.mjs +0 -7
- package/dist/es/render/object/ObjectVisualElement.mjs +41 -0
- package/dist/es/render/svg/SVGVisualElement.mjs +6 -6
- package/dist/es/render/svg/config-motion.mjs +57 -24
- package/dist/es/render/svg/utils/build-attrs.mjs +1 -1
- package/dist/es/render/svg/utils/scrape-motion-values.mjs +1 -1
- package/dist/es/render/utils/animation-state.mjs +8 -4
- package/dist/es/render/utils/get-variant-context.mjs +28 -0
- package/dist/es/render/utils/motion-values.mjs +1 -1
- package/dist/es/utils/delay.mjs +5 -1
- package/dist/es/utils/get-context-window.mjs +1 -1
- package/dist/es/utils/interpolate.mjs +6 -5
- package/dist/es/utils/mix/color.mjs +2 -2
- package/dist/es/utils/mix/complex.mjs +1 -1
- package/dist/es/utils/offsets/fill.mjs +1 -1
- package/dist/es/utils/use-instant-transition.mjs +1 -1
- package/dist/es/value/index.mjs +2 -2
- package/dist/es/value/types/color/hex.mjs +1 -1
- package/dist/es/value/types/color/hsla.mjs +3 -3
- package/dist/es/value/types/color/index.mjs +1 -2
- package/dist/es/value/types/color/rgba.mjs +3 -3
- package/dist/es/value/types/color/utils.mjs +7 -3
- package/dist/es/value/types/complex/filter.mjs +1 -1
- package/dist/es/value/types/complex/index.mjs +4 -2
- package/dist/es/value/types/numbers/units.mjs +6 -8
- package/dist/es/value/types/utils/color-regex.mjs +3 -0
- package/dist/es/value/types/utils/float-regex.mjs +3 -0
- package/dist/es/value/types/utils/is-nullish.mjs +5 -0
- package/dist/es/value/types/utils/sanitize.mjs +5 -0
- package/dist/es/value/types/utils/single-color-regex.mjs +3 -0
- package/dist/es/value/use-inverted-scale.mjs +1 -1
- package/dist/es/value/use-scroll.mjs +3 -3
- package/dist/es/value/use-spring.mjs +3 -3
- package/dist/es/value/use-will-change/WillChangeMotionValue.mjs +5 -30
- package/dist/es/value/use-will-change/add-will-change.mjs +1 -13
- package/dist/es/value/use-will-change/get-will-change-name.mjs +1 -1
- package/dist/framer-motion.dev.js +8715 -8448
- package/dist/framer-motion.js +1 -1
- package/dist/index.d.ts +1794 -2232
- package/dist/{m-entry.d.ts → m.d.ts} +464 -568
- package/dist/mini.d.ts +6 -0
- package/dist/mini.js +1 -0
- package/dist/{three-entry.d.ts → three.d.ts} +391 -518
- package/dom/mini/package.json +6 -0
- package/dom/package.json +3 -3
- package/m/package.json +6 -0
- package/mini/package.json +6 -0
- package/package.json +54 -34
- package/dist/dom-entry.d.ts +0 -985
- package/dist/es/animation/GroupPlaybackControls.mjs +0 -83
- package/dist/es/animation/animate.mjs +0 -83
- package/dist/es/animation/animators/waapi/easing.mjs +0 -40
- package/dist/es/animation/generators/utils/calc-duration.mjs +0 -17
- package/dist/es/easing/utils/create-generator-easing.mjs +0 -18
- package/dist/es/easing/utils/is-bezier-definition.mjs +0 -3
- package/dist/es/events/utils/is-primary-pointer.mjs +0 -18
- package/dist/es/gestures/drag/utils/lock.mjs +0 -53
- package/dist/es/gestures/utils/is-node-or-child.mjs +0 -20
- package/dist/es/render/components/motion/namespace.mjs +0 -2
- package/dist/es/render/dom/scroll/supports.mjs +0 -5
- package/dist/es/render/dom/utils/resolve-element.mjs +0 -28
- package/dist/es/utils/errors.mjs +0 -18
- package/dist/es/utils/memo.mjs +0 -10
- package/dist/es/utils/noop.mjs +0 -3
- package/dist/es/utils/progress.mjs +0 -18
- package/dist/es/utils/time-conversion.mjs +0 -10
- package/dist/es/value/types/utils.mjs +0 -18
- /package/dist/es/{client-entry.mjs → client.mjs} +0 -0
- /package/dist/es/{m-entry.mjs → m.mjs} +0 -0
- /package/dist/es/{projection-entry.mjs → projection.mjs} +0 -0
- /package/dist/es/render/html/utils/{transform.mjs → keys-transform.mjs} +0 -0
package/README.md
CHANGED
|
@@ -1,25 +1,7 @@
|
|
|
1
1
|
<p align="center">
|
|
2
|
-
<img
|
|
3
|
-
</p>
|
|
4
|
-
<h1 align="center">Framer Motion</h1>
|
|
5
|
-
<h3 align="center">
|
|
6
|
-
An open source motion library for React, made by Framer.
|
|
7
|
-
</h3>
|
|
8
|
-
<h3 align="center">
|
|
9
|
-
Motion powers Framer, the web builder for creative pros. Design and ship your dream site. Zero code, maximum speed.
|
|
10
|
-
</h3>
|
|
11
|
-
<br/>
|
|
12
|
-
<p align="center">
|
|
13
|
-
<a href="https://www.framer.com?utm_source=motion-readme">
|
|
14
|
-
<img src="https://framerusercontent.com/images/atXqxn4JhKm4LXVncdNjkKV7yCU.png" width="140" alt="Start for free" />
|
|
15
|
-
</a>
|
|
16
|
-
</p>
|
|
17
|
-
<br/>
|
|
18
|
-
<p align="center">
|
|
19
|
-
<a href="https://www.framer.com?utm_source=motion-readme">
|
|
20
|
-
<img src="https://framerusercontent.com/images/pMSOmGP2V8sSaZRV2D7i4HTBTe4.png" width="1000" alt="Framer Banner" />
|
|
21
|
-
</a>
|
|
2
|
+
<img width="100" height="100" alt="Motion logo" src="https://user-images.githubusercontent.com/7850794/164965523-3eced4c4-6020-467e-acde-f11b7900ad62.png" />
|
|
22
3
|
</p>
|
|
4
|
+
<h1 align="center">Motion for React</h1>
|
|
23
5
|
|
|
24
6
|
<br>
|
|
25
7
|
|
|
@@ -30,19 +12,18 @@ Motion powers Framer, the web builder for creative pros. Design and ship your dr
|
|
|
30
12
|
<a href="https://www.npmjs.com/package/framer-motion" target="_blank">
|
|
31
13
|
<img src="https://img.shields.io/npm/dm/framer-motion.svg?style=flat-square" />
|
|
32
14
|
</a>
|
|
33
|
-
<a href="https://twitter.com/
|
|
15
|
+
<a href="https://twitter.com/motiondotdev" target="_blank">
|
|
34
16
|
<img src="https://img.shields.io/twitter/follow/framer.svg?style=social&label=Follow" />
|
|
35
17
|
</a>
|
|
36
|
-
<a href="https://discord.gg/DfkSpYe" target="_blank">
|
|
37
|
-
<img src="https://img.shields.io/discord/308323056592486420.svg?logo=discord&logoColor=white" alt="Chat on Discord">
|
|
38
|
-
</a>
|
|
39
18
|
</p>
|
|
40
19
|
|
|
41
20
|
<br>
|
|
42
21
|
<hr>
|
|
43
22
|
<br>
|
|
44
23
|
|
|
45
|
-
|
|
24
|
+
Motion for React is an open source, production-ready library that’s designed for all creative developers.
|
|
25
|
+
|
|
26
|
+
It's the only animation library with a hybrid engine, combining the power of JavaScript animations with the performance of native browser APIs.
|
|
46
27
|
|
|
47
28
|
It looks like this:
|
|
48
29
|
|
|
@@ -52,18 +33,18 @@ It looks like this:
|
|
|
52
33
|
|
|
53
34
|
It does all this:
|
|
54
35
|
|
|
55
|
-
- [Springs](https://
|
|
56
|
-
- [Keyframes](https://
|
|
57
|
-
- [Layout animations](https://
|
|
58
|
-
- [Shared layout animations](https://
|
|
59
|
-
- [Gestures (drag/tap/hover)](https://
|
|
60
|
-
- [Scroll animations](https://
|
|
61
|
-
- [SVG paths](https://
|
|
62
|
-
- [Exit animations](https://
|
|
63
|
-
- Server-side rendering
|
|
64
|
-
- [
|
|
65
|
-
- [Orchestrate animations across components](https://
|
|
66
|
-
- [CSS variables](https://
|
|
36
|
+
- [Springs](https://motion.dev/docs/react-transitions#spring)
|
|
37
|
+
- [Keyframes](https://motion.dev/docs/react-animation#keyframes)
|
|
38
|
+
- [Layout animations](https://motion.dev/docs/react-layout-animations)
|
|
39
|
+
- [Shared layout animations](https://motion.dev/docs/react-layout-animations#shared-layout-animations)
|
|
40
|
+
- [Gestures (drag/tap/hover)](https://motion.dev/docs/react-gestures)
|
|
41
|
+
- [Scroll animations](https://motion.dev/docs/react-scroll-animations)
|
|
42
|
+
- [SVG paths](https://motion.dev/docs/react-animation#svg-line-drawing)
|
|
43
|
+
- [Exit animations](https://motion.dev/docs/react-animation#exit-animations)
|
|
44
|
+
- [Server-side rendering](https://motion.dev/docs/react-motion-component#server-side-rendering)
|
|
45
|
+
- [Independent transforms](https://motion.dev/docs/react-motion-component#style)
|
|
46
|
+
- [Orchestrate animations across components](https://motion.dev/docs/react-animation#orchestration)
|
|
47
|
+
- [CSS variables](https://motion.dev/docs/react-animation#css-variables)
|
|
67
48
|
|
|
68
49
|
...and a whole lot more.
|
|
69
50
|
|
|
@@ -71,35 +52,60 @@ It does all this:
|
|
|
71
52
|
|
|
72
53
|
### 🐇 Quick start
|
|
73
54
|
|
|
74
|
-
Install `
|
|
55
|
+
Install `motion` via your package manager:
|
|
75
56
|
|
|
76
57
|
```
|
|
77
|
-
npm install
|
|
58
|
+
npm install motion
|
|
78
59
|
```
|
|
79
60
|
|
|
80
61
|
Then import the `motion` component:
|
|
81
62
|
|
|
82
63
|
```jsx
|
|
83
|
-
import { motion } from "
|
|
64
|
+
import { motion } from "motion/react"
|
|
84
65
|
|
|
85
|
-
export
|
|
86
|
-
<motion.div animate={{ opacity: isVisible ? 1 : 0 }} />
|
|
87
|
-
|
|
66
|
+
export function Component({ isVisible }) {
|
|
67
|
+
return <motion.div animate={{ opacity: isVisible ? 1 : 0 }} />
|
|
68
|
+
}
|
|
88
69
|
```
|
|
89
70
|
|
|
90
|
-
### 📚 Docs
|
|
91
|
-
|
|
92
|
-
- Check out [our documentation](https://www.framer.com/docs/?utm_source=motion-readme-docs) for guides and a full API reference.
|
|
93
|
-
- Or see [our examples](https://www.framer.com/docs/examples/?utm_source=motion-readme-docs) for inspiration.
|
|
94
|
-
|
|
95
71
|
### 💎 Contribute
|
|
96
72
|
|
|
97
|
-
- Want to contribute to
|
|
73
|
+
- Want to contribute to Motion? Our [contributing guide](https://github.com/motiondivision/motion/blob/master/CONTRIBUTING.md) has you covered.
|
|
98
74
|
|
|
99
75
|
### 👩🏻⚖️ License
|
|
100
76
|
|
|
101
|
-
-
|
|
77
|
+
- Motion for React is MIT licensed.
|
|
78
|
+
|
|
79
|
+
## ✨ Sponsors
|
|
80
|
+
|
|
81
|
+
Motion is sustainable thanks to the kind support of its sponsors.
|
|
82
|
+
|
|
83
|
+
### Partners
|
|
84
|
+
|
|
85
|
+
#### Framer
|
|
86
|
+
|
|
87
|
+
Motion powers Framer animations, the web builder for creative pros. Design and ship your dream site. Zero code, maximum speed.
|
|
88
|
+
|
|
89
|
+
<a href="https://www.framer.com?utm_source=motion-readme">
|
|
90
|
+
<img alt="Framer" src="https://github.com/user-attachments/assets/0404c7a1-c29d-4785-89ae-aae315f3c759" width="300px" height="200px">
|
|
91
|
+
</a>
|
|
92
|
+
|
|
93
|
+
### Platinum
|
|
94
|
+
|
|
95
|
+
<a href="https://syntax.fm"><img alt="Syntax.fm" src="https://github.com/user-attachments/assets/ab852bfe-b36c-490b-b98d-4061158c4863" width="300px" height="200px"></a> <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> <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> <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>
|
|
96
|
+
|
|
97
|
+
### Gold
|
|
98
|
+
|
|
99
|
+
<a href="https://vercel.com"><img alt="Vercel" src="https://github.com/user-attachments/assets/23cb1e37-fa67-49ad-8f77-7f4b8eaba325" width="225px" height="150px"></a> <a href="https://liveblocks.io"><img alt="Liveblocks" src="https://github.com/user-attachments/assets/31436a47-951e-4eab-9a68-bdd54ccf9444" width="225px" height="150px"></a> <a href="https://lu.ma"><img alt="Luma" src="https://github.com/user-attachments/assets/4fae0c9d-de0f-4042-9cd6-e07885d028a9" width="225px" height="150px"></a>
|
|
100
|
+
|
|
101
|
+
### Silver
|
|
102
|
+
|
|
103
|
+
<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> <a href="https://statamic.com"><img alt="Statamic" src="https://github.com/user-attachments/assets/5d28f090-bdd9-4b31-b134-fb2b94ca636f" width="150px" height="100px"></a> <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> <a href="https://puzzmo.com"><img alt="Puzzmo" src="https://github.com/user-attachments/assets/aa2d5586-e5e2-43b9-8446-db456e4b0758" width="150px" height="100px"></a> <a href="https://buildui.com"><img alt="Build UI" src="https://github.com/user-attachments/assets/024bfcd5-50e8-4b3d-a115-d5c6d6030d1c" width="150px" height="100px"></a> <a href="https://hover.dev"><img alt="Hover" src="https://github.com/user-attachments/assets/4715b555-d2ac-4cb7-9f35-d36d708827b3" width="150px" height="100px"></a>
|
|
102
104
|
|
|
103
|
-
###
|
|
105
|
+
### Personal
|
|
104
106
|
|
|
105
|
-
-
|
|
107
|
+
- [Nusu](https://x.com/nusualabuga)
|
|
108
|
+
- [OlegWock](https://sinja.io)
|
|
109
|
+
- [Lambert Weller](https://github.com/l-mbert)
|
|
110
|
+
- [Jake LeBoeuf](https://jklb.wf)
|
|
111
|
+
- [Han Lee](https://github.com/hahnlee)
|
package/client/README.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
This directory is a fallback for `exports["./client"]` in the root `framer-motion` `package.json`.
|