framer-motion 6.1.0 → 6.2.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/dist/cjs/index.js +87 -58
- package/dist/es/context/MotionConfigContext.mjs +1 -0
- package/dist/es/motion/utils/use-visual-element.mjs +3 -0
- package/dist/es/projection/node/create-projection-node.mjs +6 -1
- package/dist/es/render/index.mjs +2 -2
- package/dist/es/render/utils/animation.mjs +9 -1
- package/dist/es/utils/use-reduced-motion.mjs +23 -10
- package/dist/framer-motion.dev.js +87 -58
- package/dist/framer-motion.js +1 -1
- package/dist/projection.dev.js +8 -3
- 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/dist/size-webpack-dom-animation.js +1 -1
- package/dist/size-webpack-dom-max.js +1 -1
- package/dist/size-webpack-m.js +1 -1
- package/package.json +8 -8
- package/types/context/MotionConfigContext.d.ts +7 -0
- package/types/render/html/visual-element.d.ts +1 -1
- package/types/render/index.d.ts +1 -1
- package/types/render/svg/visual-element.d.ts +1 -1
- package/types/render/types.d.ts +2 -0
- package/types/utils/use-reduced-motion.d.ts +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "framer-motion",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.2.0",
|
|
4
4
|
"description": "A simple and powerful React animation library",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/es/index.mjs",
|
|
@@ -71,32 +71,32 @@
|
|
|
71
71
|
"bundlesize": [
|
|
72
72
|
{
|
|
73
73
|
"path": "./dist/framer-motion.js",
|
|
74
|
-
"maxSize": "35.
|
|
74
|
+
"maxSize": "35.5 kB"
|
|
75
75
|
},
|
|
76
76
|
{
|
|
77
77
|
"path": "./dist/size-rollup-m.js",
|
|
78
|
-
"maxSize": "6.
|
|
78
|
+
"maxSize": "6.4 kB"
|
|
79
79
|
},
|
|
80
80
|
{
|
|
81
81
|
"path": "./dist/size-rollup-dom-animation.js",
|
|
82
|
-
"maxSize": "
|
|
82
|
+
"maxSize": "17 kB"
|
|
83
83
|
},
|
|
84
84
|
{
|
|
85
85
|
"path": "./dist/size-rollup-dom-max.js",
|
|
86
|
-
"maxSize": "28 kB"
|
|
86
|
+
"maxSize": "28.1 kB"
|
|
87
87
|
},
|
|
88
88
|
{
|
|
89
89
|
"path": "./dist/size-webpack-m.js",
|
|
90
|
-
"maxSize": "6.
|
|
90
|
+
"maxSize": "6.7 kB"
|
|
91
91
|
},
|
|
92
92
|
{
|
|
93
93
|
"path": "./dist/size-webpack-dom-animation.js",
|
|
94
|
-
"maxSize": "19.
|
|
94
|
+
"maxSize": "19.5 kB"
|
|
95
95
|
},
|
|
96
96
|
{
|
|
97
97
|
"path": "./dist/size-webpack-dom-max.js",
|
|
98
98
|
"maxSize": "31.5 kB"
|
|
99
99
|
}
|
|
100
100
|
],
|
|
101
|
-
"gitHead": "
|
|
101
|
+
"gitHead": "fef9ea7beab4157a29926cafa9399b99e12ba83b"
|
|
102
102
|
}
|
|
@@ -22,6 +22,13 @@ export interface MotionConfigContext {
|
|
|
22
22
|
* @public
|
|
23
23
|
*/
|
|
24
24
|
transition?: Transition;
|
|
25
|
+
/**
|
|
26
|
+
* If true, will respect the device prefersReducedMotion setting by switching
|
|
27
|
+
* transform animations off.
|
|
28
|
+
*
|
|
29
|
+
* @public
|
|
30
|
+
*/
|
|
31
|
+
reducedMotion?: "always" | "never" | "user";
|
|
25
32
|
}
|
|
26
33
|
/**
|
|
27
34
|
* @public
|
|
@@ -3,4 +3,4 @@ import { VisualElementConfig } from "../types";
|
|
|
3
3
|
import { DOMVisualElementOptions } from "../dom/types";
|
|
4
4
|
export declare function getComputedStyle(element: HTMLElement): CSSStyleDeclaration;
|
|
5
5
|
export declare const htmlConfig: VisualElementConfig<HTMLElement, HTMLRenderState, DOMVisualElementOptions>;
|
|
6
|
-
export declare const htmlVisualElement: ({ parent, props, presenceId, blockInitialAnimation, visualState, }: import("../types").VisualElementOptions<HTMLElement, any>, options?: DOMVisualElementOptions) => import("../types").VisualElement<HTMLElement, any>;
|
|
6
|
+
export declare const htmlVisualElement: ({ parent, props, presenceId, blockInitialAnimation, visualState, shouldReduceMotion, }: import("../types").VisualElementOptions<HTMLElement, any>, options?: DOMVisualElementOptions) => import("../types").VisualElement<HTMLElement, any>;
|
package/types/render/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { VisualElement, VisualElementConfig, VisualElementOptions } from "./types";
|
|
2
|
-
export declare const visualElement: <Instance, MutableState, Options>({ treeType, build, getBaseTarget, makeTargetAnimatable, measureViewportBox, render: renderInstance, readValueFromInstance, removeValueFromRenderState, sortNodePosition, scrapeMotionValuesFromProps, }: VisualElementConfig<Instance, MutableState, Options>) => ({ parent, props, presenceId, blockInitialAnimation, visualState, }: VisualElementOptions<Instance, any>, options?: Options) => VisualElement<Instance, any>;
|
|
2
|
+
export declare const visualElement: <Instance, MutableState, Options>({ treeType, build, getBaseTarget, makeTargetAnimatable, measureViewportBox, render: renderInstance, readValueFromInstance, removeValueFromRenderState, sortNodePosition, scrapeMotionValuesFromProps, }: VisualElementConfig<Instance, MutableState, Options>) => ({ parent, props, presenceId, blockInitialAnimation, visualState, shouldReduceMotion, }: VisualElementOptions<Instance, any>, options?: Options) => VisualElement<Instance, any>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { DOMVisualElementOptions } from "../dom/types";
|
|
2
|
-
export declare const svgVisualElement: ({ parent, props, presenceId, blockInitialAnimation, visualState, }: import("../types").VisualElementOptions<SVGElement, any>, options?: DOMVisualElementOptions) => import("../types").VisualElement<SVGElement, any>;
|
|
2
|
+
export declare const svgVisualElement: ({ parent, props, presenceId, blockInitialAnimation, visualState, shouldReduceMotion, }: import("../types").VisualElementOptions<SVGElement, any>, options?: DOMVisualElementOptions) => import("../types").VisualElement<SVGElement, any>;
|
package/types/render/types.d.ts
CHANGED
|
@@ -32,6 +32,7 @@ export interface VisualElement<Instance = any, RenderState = any> extends Lifecy
|
|
|
32
32
|
measureViewportBox(withTransform?: boolean): Box;
|
|
33
33
|
addVariantChild(child: VisualElement): undefined | (() => void);
|
|
34
34
|
getClosestVariantNode(): VisualElement | undefined;
|
|
35
|
+
shouldReduceMotion?: boolean | null;
|
|
35
36
|
animateMotionValue?: typeof startAnimation;
|
|
36
37
|
projection?: IProjectionNode;
|
|
37
38
|
/**
|
|
@@ -101,6 +102,7 @@ export declare type VisualElementOptions<Instance, RenderState = any> = {
|
|
|
101
102
|
presenceId?: number | undefined;
|
|
102
103
|
props: MotionProps;
|
|
103
104
|
blockInitialAnimation?: boolean;
|
|
105
|
+
shouldReduceMotion?: boolean | null;
|
|
104
106
|
};
|
|
105
107
|
export declare type CreateVisualElement<Instance> = (Component: string | React.ComponentType, options: VisualElementOptions<Instance>) => VisualElement<Instance>;
|
|
106
108
|
/**
|