framer-motion 5.3.0 → 5.3.1
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/es/animation/utils/transitions.mjs +8 -2
- package/dist/es/components/Reorder/Item.mjs +4 -3
- package/dist/es/gestures/use-hover-gesture.mjs +4 -1
- package/dist/es/gestures/use-tap-gesture.mjs +4 -1
- package/dist/es/index.mjs +1 -0
- package/dist/es/motion/utils/use-visual-state.mjs +29 -10
- package/dist/es/motion/utils/valid-prop.mjs +1 -0
- package/dist/es/render/utils/animation-state.mjs +5 -4
- package/dist/es/render/utils/setters.mjs +1 -3
- package/dist/es/utils/use-instant-transition-state.mjs +5 -0
- package/dist/es/utils/use-instant-transition.mjs +28 -0
- package/dist/framer-motion.cjs.js +86 -31
- package/dist/framer-motion.dev.js +86 -31
- package/dist/framer-motion.js +1 -1
- package/dist/projection.dev.js +18 -6
- package/dist/size-rollup-dom-animation.js +1 -1
- package/dist/size-rollup-dom-max.js +1 -1
- package/dist/size-rollup-m.js +1 -1
- package/package.json +158 -158
- package/types/components/Reorder/Item.d.ts +1 -1
- package/types/index.d.ts +1 -0
- package/types/render/utils/animation-state.d.ts +1 -1
- package/types/utils/use-instant-transition-state.d.ts +3 -0
- package/types/utils/use-instant-transition.d.ts +1 -0
- package/CHANGELOG.md +0 -1953
package/package.json
CHANGED
|
@@ -1,166 +1,166 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
2
|
+
"name": "framer-motion",
|
|
3
|
+
"version": "5.3.1",
|
|
4
|
+
"description": "A simple and powerful React animation library",
|
|
5
|
+
"main": "dist/framer-motion.cjs.js",
|
|
6
|
+
"module": "dist/es/index.mjs",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"require": "./dist/framer-motion.cjs.js",
|
|
10
|
+
"import": "./dist/es/index.mjs",
|
|
11
|
+
"default": "./dist/framer-motion.cjs.js"
|
|
12
|
+
},
|
|
13
|
+
"./package.json": "./package.json"
|
|
12
14
|
},
|
|
13
|
-
"
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
"
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
"measure": "webpack --config webpack.size.config.js && bundlesize",
|
|
54
|
-
"start-dev-server": "webpack serve --config dev/webpack/config.js --hot"
|
|
55
|
-
},
|
|
56
|
-
"peerDependencies": {
|
|
57
|
-
"react": ">=16.8 || ^17.0.0",
|
|
58
|
-
"react-dom": ">=16.8 || ^17.0.0"
|
|
59
|
-
},
|
|
60
|
-
"devDependencies": {
|
|
61
|
-
"@cypress/webpack-preprocessor": "^4.1.0",
|
|
62
|
-
"@pmmmwh/react-refresh-webpack-plugin": "^0.4.3",
|
|
63
|
-
"@rollup/plugin-node-resolve": "^8.0.0",
|
|
64
|
-
"@rollup/plugin-replace": "^2.3.2",
|
|
65
|
-
"@testing-library/dom": "^6.10.1",
|
|
66
|
-
"@testing-library/react": "^9.3.2",
|
|
67
|
-
"@testing-library/react-hooks": "^5.1.0",
|
|
68
|
-
"@types/jest": "^23.3.9",
|
|
69
|
-
"@types/node": "12.7.4",
|
|
70
|
-
"@types/react": "17.0.9",
|
|
71
|
-
"@types/react-dom": "17.0.6",
|
|
72
|
-
"@types/styled-components": "^4.1.0",
|
|
73
|
-
"@typescript-eslint/eslint-plugin": "^1.5.0",
|
|
74
|
-
"@typescript-eslint/parser": "^1.5.0",
|
|
75
|
-
"bundlesize": "^0.18.0",
|
|
76
|
-
"cache-loader": "^1.2.5",
|
|
77
|
-
"concurrently": "^5.2.0",
|
|
78
|
-
"convert-tsconfig-paths-to-webpack-aliases": "^0.9.2",
|
|
79
|
-
"cypress": "^3.4.0",
|
|
80
|
-
"eslint": "^5.16.0",
|
|
81
|
-
"eslint-config-prettier": "^4.1.0",
|
|
82
|
-
"eslint-plugin-import": "^2.16.0",
|
|
83
|
-
"eslint-plugin-react": "^7.12.4",
|
|
84
|
-
"eslint-plugin-react-hooks": "^1.6.0",
|
|
85
|
-
"fork-ts-checker-webpack-plugin": "^6.2.0",
|
|
86
|
-
"husky": "1.1.4",
|
|
87
|
-
"jest": "^24.8.0",
|
|
88
|
-
"jest-dom": "^3.5.0",
|
|
89
|
-
"jest-junit": "^6.4.0",
|
|
90
|
-
"jest-watch-typeahead": "^0.4.2",
|
|
91
|
-
"lint-staged": "^8.0.4",
|
|
92
|
-
"lodash": "^4.17.13",
|
|
93
|
-
"path-browserify": "^1.0.1",
|
|
94
|
-
"prettier": "^2.1.0",
|
|
95
|
-
"react": "^17.0.0-rc.0",
|
|
96
|
-
"react-dev-utils": "^11.0.4",
|
|
97
|
-
"react-dom": "^17.0.0-rc.0",
|
|
98
|
-
"react-refresh": "^0.9.0",
|
|
99
|
-
"rollup": "^2.10.5",
|
|
100
|
-
"rollup-plugin-terser": "^5.3.0",
|
|
101
|
-
"rollup-plugin-visualizer": "^2.4.3",
|
|
102
|
-
"start-server-and-test": "^1.9.1",
|
|
103
|
-
"styled-components": "^4.1.1",
|
|
104
|
-
"ts-jest": "^24.0.2",
|
|
105
|
-
"ts-loader": "^5.3.0",
|
|
106
|
-
"type-fest": "^1.0.1",
|
|
107
|
-
"typescript": "^4.2.3",
|
|
108
|
-
"webpack": "^5.27.2",
|
|
109
|
-
"webpack-cli": "^4.5.0",
|
|
110
|
-
"webpack-dev-server": "^3.11.2",
|
|
111
|
-
"yarn-deduplicate": "^1.1.1"
|
|
112
|
-
},
|
|
113
|
-
"dependencies": {
|
|
114
|
-
"framesync": "6.0.1",
|
|
115
|
-
"hey-listen": "^1.0.8",
|
|
116
|
-
"popmotion": "11.0.0",
|
|
117
|
-
"style-value-types": "5.0.0",
|
|
118
|
-
"tslib": "^2.1.0"
|
|
119
|
-
},
|
|
120
|
-
"optionalDependencies": {
|
|
121
|
-
"@emotion/is-prop-valid": "^0.8.2"
|
|
122
|
-
},
|
|
123
|
-
"husky": {
|
|
124
|
-
"hooks": {
|
|
125
|
-
"pre-commit": "lint-staged"
|
|
126
|
-
}
|
|
127
|
-
},
|
|
128
|
-
"lint-staged": {
|
|
129
|
-
"linters": {
|
|
130
|
-
"*.{ts,tsx}": [
|
|
131
|
-
"prettier --write",
|
|
132
|
-
"git add"
|
|
133
|
-
]
|
|
134
|
-
}
|
|
135
|
-
},
|
|
136
|
-
"bundlesize": [
|
|
137
|
-
{
|
|
138
|
-
"path": "./dist/framer-motion.js",
|
|
139
|
-
"maxSize": "34.7 kB"
|
|
15
|
+
"types": "types/index.d.ts",
|
|
16
|
+
"author": "Framer",
|
|
17
|
+
"license": "MIT",
|
|
18
|
+
"repository": "https://github.com/framer/motion/",
|
|
19
|
+
"sideEffects": false,
|
|
20
|
+
"keywords": [
|
|
21
|
+
"react animation",
|
|
22
|
+
"react",
|
|
23
|
+
"pose",
|
|
24
|
+
"react pose",
|
|
25
|
+
"animation",
|
|
26
|
+
"gestures",
|
|
27
|
+
"drag",
|
|
28
|
+
"spring",
|
|
29
|
+
"popmotion",
|
|
30
|
+
"framer"
|
|
31
|
+
],
|
|
32
|
+
"scripts": {
|
|
33
|
+
"lint": "yarn eslint src/**/*.ts",
|
|
34
|
+
"test": "yarn build && yarn test-server && yarn test-client && yarn test-projection && yarn test-e2e && yarn measure",
|
|
35
|
+
"build": "yarn clean && tsc -p . && rollup -c",
|
|
36
|
+
"clean": "rm -rf types dist lib",
|
|
37
|
+
"test-ci": "yarn test-client && yarn test-server",
|
|
38
|
+
"test-client": "jest --coverage --config jest.config.json --max-workers=2",
|
|
39
|
+
"test-server": "jest --config jest.config.ssr.json",
|
|
40
|
+
"test-projection": "yarn run collect-projection-tests && start-server-and-test 'python -m SimpleHTTPServer' http://0.0.0.0:8000 'yarn run cypress run -s cypress/integration/projection.chrome.ts --config baseUrl=http://localhost:8000/'",
|
|
41
|
+
"test-e2e-chrome": "start-server-and-test start-dev-server http://localhost:9990 'cypress run --headless --browser chrome --spec \"cypress/integration/layout-relative.chrome.ts\"'",
|
|
42
|
+
"test-e2e-electron": "start-server-and-test start-dev-server http://localhost:9990 'cypress run --headless --config ignoreTestFiles=*.chrome.ts'",
|
|
43
|
+
"test-e2e": "yarn test-e2e-electron",
|
|
44
|
+
"test-e2e-file": "start-server-and-test start-dev-server http://localhost:9990 'cypress run --headless --spec \"cypress/integration/while-in-view.ts\"'",
|
|
45
|
+
"test-watch": "jest --watch --coverage --coverageReporters=lcov --config jest.config.json",
|
|
46
|
+
"projection-dev": "python -m SimpleHTTPServer",
|
|
47
|
+
"collect-projection-tests": "node ./dev/projection/collect-projection-tests.js",
|
|
48
|
+
"prettier": "prettier ./src/* --write",
|
|
49
|
+
"watch": "concurrently -c blue,red -n tsc,rollup --kill-others \"tsc --watch -p . --preserveWatchOutput\" \"rollup --config --watch --no-watch.clearScreen\"",
|
|
50
|
+
"prepack": "yarn build",
|
|
51
|
+
"prepublishOnly": "yarn test",
|
|
52
|
+
"postpublish": "git push --tags",
|
|
53
|
+
"measure": "webpack --config webpack.size.config.js && bundlesize",
|
|
54
|
+
"start-dev-server": "webpack serve --config dev/webpack/config.js --hot"
|
|
140
55
|
},
|
|
141
|
-
{
|
|
142
|
-
|
|
143
|
-
|
|
56
|
+
"peerDependencies": {
|
|
57
|
+
"react": ">=16.8 || ^17.0.0",
|
|
58
|
+
"react-dom": ">=16.8 || ^17.0.0"
|
|
144
59
|
},
|
|
145
|
-
{
|
|
146
|
-
|
|
147
|
-
|
|
60
|
+
"devDependencies": {
|
|
61
|
+
"@cypress/webpack-preprocessor": "^4.1.0",
|
|
62
|
+
"@pmmmwh/react-refresh-webpack-plugin": "^0.4.3",
|
|
63
|
+
"@rollup/plugin-node-resolve": "^8.0.0",
|
|
64
|
+
"@rollup/plugin-replace": "^2.3.2",
|
|
65
|
+
"@testing-library/dom": "^6.10.1",
|
|
66
|
+
"@testing-library/react": "^9.3.2",
|
|
67
|
+
"@testing-library/react-hooks": "^5.1.0",
|
|
68
|
+
"@types/jest": "^23.3.9",
|
|
69
|
+
"@types/node": "12.7.4",
|
|
70
|
+
"@types/react": "17.0.9",
|
|
71
|
+
"@types/react-dom": "17.0.6",
|
|
72
|
+
"@types/styled-components": "^4.1.0",
|
|
73
|
+
"@typescript-eslint/eslint-plugin": "^1.5.0",
|
|
74
|
+
"@typescript-eslint/parser": "^1.5.0",
|
|
75
|
+
"bundlesize": "^0.18.0",
|
|
76
|
+
"cache-loader": "^1.2.5",
|
|
77
|
+
"concurrently": "^5.2.0",
|
|
78
|
+
"convert-tsconfig-paths-to-webpack-aliases": "^0.9.2",
|
|
79
|
+
"cypress": "^3.4.0",
|
|
80
|
+
"eslint": "^5.16.0",
|
|
81
|
+
"eslint-config-prettier": "^4.1.0",
|
|
82
|
+
"eslint-plugin-import": "^2.16.0",
|
|
83
|
+
"eslint-plugin-react": "^7.12.4",
|
|
84
|
+
"eslint-plugin-react-hooks": "^1.6.0",
|
|
85
|
+
"fork-ts-checker-webpack-plugin": "^6.2.0",
|
|
86
|
+
"husky": "1.1.4",
|
|
87
|
+
"jest": "^24.8.0",
|
|
88
|
+
"jest-dom": "^3.5.0",
|
|
89
|
+
"jest-junit": "^6.4.0",
|
|
90
|
+
"jest-watch-typeahead": "^0.4.2",
|
|
91
|
+
"lint-staged": "^8.0.4",
|
|
92
|
+
"lodash": "^4.17.13",
|
|
93
|
+
"path-browserify": "^1.0.1",
|
|
94
|
+
"prettier": "^2.1.0",
|
|
95
|
+
"react": "^17.0.0-rc.0",
|
|
96
|
+
"react-dev-utils": "^11.0.4",
|
|
97
|
+
"react-dom": "^17.0.0-rc.0",
|
|
98
|
+
"react-refresh": "^0.9.0",
|
|
99
|
+
"rollup": "^2.10.5",
|
|
100
|
+
"rollup-plugin-terser": "^5.3.0",
|
|
101
|
+
"rollup-plugin-visualizer": "^2.4.3",
|
|
102
|
+
"start-server-and-test": "^1.9.1",
|
|
103
|
+
"styled-components": "^4.1.1",
|
|
104
|
+
"ts-jest": "^24.0.2",
|
|
105
|
+
"ts-loader": "^5.3.0",
|
|
106
|
+
"type-fest": "^1.0.1",
|
|
107
|
+
"typescript": "^4.2.3",
|
|
108
|
+
"webpack": "^5.27.2",
|
|
109
|
+
"webpack-cli": "^4.5.0",
|
|
110
|
+
"webpack-dev-server": "^3.11.2",
|
|
111
|
+
"yarn-deduplicate": "^1.1.1"
|
|
148
112
|
},
|
|
149
|
-
{
|
|
150
|
-
|
|
151
|
-
|
|
113
|
+
"dependencies": {
|
|
114
|
+
"framesync": "6.0.1",
|
|
115
|
+
"hey-listen": "^1.0.8",
|
|
116
|
+
"popmotion": "11.0.0",
|
|
117
|
+
"style-value-types": "5.0.0",
|
|
118
|
+
"tslib": "^2.1.0"
|
|
152
119
|
},
|
|
153
|
-
{
|
|
154
|
-
|
|
155
|
-
"maxSize": "6.3 kB"
|
|
120
|
+
"optionalDependencies": {
|
|
121
|
+
"@emotion/is-prop-valid": "^0.8.2"
|
|
156
122
|
},
|
|
157
|
-
{
|
|
158
|
-
|
|
159
|
-
|
|
123
|
+
"husky": {
|
|
124
|
+
"hooks": {
|
|
125
|
+
"pre-commit": "lint-staged"
|
|
126
|
+
}
|
|
160
127
|
},
|
|
161
|
-
{
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
128
|
+
"lint-staged": {
|
|
129
|
+
"linters": {
|
|
130
|
+
"*.{ts,tsx}": [
|
|
131
|
+
"prettier --write",
|
|
132
|
+
"git add"
|
|
133
|
+
]
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
"bundlesize": [
|
|
137
|
+
{
|
|
138
|
+
"path": "./dist/framer-motion.js",
|
|
139
|
+
"maxSize": "34.8 kB"
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
"path": "./dist/size-rollup-m.js",
|
|
143
|
+
"maxSize": "6.0 kB"
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
"path": "./dist/size-rollup-dom-animation.js",
|
|
147
|
+
"maxSize": "16.9 kB"
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
"path": "./dist/size-rollup-dom-max.js",
|
|
151
|
+
"maxSize": "27.9 kB"
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
"path": "./dist/size-webpack-m.js",
|
|
155
|
+
"maxSize": "6.3 kB"
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
"path": "./dist/size-webpack-dom-animation.js",
|
|
159
|
+
"maxSize": "19.4 kB"
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
"path": "./dist/size-webpack-dom-max.js",
|
|
163
|
+
"maxSize": "31 kB"
|
|
164
|
+
}
|
|
165
|
+
]
|
|
166
|
+
}
|
|
@@ -15,7 +15,7 @@ export interface Props<V> {
|
|
|
15
15
|
*/
|
|
16
16
|
value: V;
|
|
17
17
|
}
|
|
18
|
-
export declare function ReorderItem<V>({ children, style, value, as, ...props }: Props<V> & HTMLMotionProps<any> & React.PropsWithChildren<{}>, externalRef?: React.Ref<any>): JSX.Element;
|
|
18
|
+
export declare function ReorderItem<V>({ children, style, value, as, onDrag, ...props }: Props<V> & HTMLMotionProps<any> & React.PropsWithChildren<{}>, externalRef?: React.Ref<any>): JSX.Element;
|
|
19
19
|
export declare const Item: React.ForwardRefExoticComponent<Props<unknown> & {
|
|
20
20
|
color?: string | undefined;
|
|
21
21
|
translate?: "no" | "yes" | undefined;
|
package/types/index.d.ts
CHANGED
|
@@ -50,6 +50,7 @@ export { createMotionComponent } from "./motion";
|
|
|
50
50
|
export { visualElement } from "./render";
|
|
51
51
|
export { VisualElement } from "./render/types";
|
|
52
52
|
export { addScaleCorrector } from "./projection/styles/scale-correction";
|
|
53
|
+
export { useInstantTransition } from "./utils/use-instant-transition";
|
|
53
54
|
export { useInstantLayoutTransition } from "./projection/use-instant-layout-transition";
|
|
54
55
|
export { useResetProjection } from "./projection/use-reset-projection";
|
|
55
56
|
/**
|
|
@@ -15,7 +15,7 @@ export interface AnimationState {
|
|
|
15
15
|
export declare type AnimationList = string[] | TargetAndTransition[];
|
|
16
16
|
export declare const variantPriorityOrder: AnimationType[];
|
|
17
17
|
export declare function createAnimationState(visualElement: VisualElement): AnimationState;
|
|
18
|
-
export declare function
|
|
18
|
+
export declare function checkVariantsDidChange(prev: any, next: any): boolean;
|
|
19
19
|
export interface AnimationTypeState {
|
|
20
20
|
isActive: boolean;
|
|
21
21
|
protectedKeys: {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useInstantTransition(): (callback: () => void) => void;
|