framer-motion 6.3.11 → 6.3.12
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 +2 -20
- package/dist/es/animation/use-animated-state.mjs +0 -1
- package/dist/es/animation/utils/transitions.mjs +0 -2
- package/dist/es/context/DeprecatedLayoutGroupContext.mjs +0 -1
- package/dist/es/context/LayoutGroupContext.mjs +0 -3
- package/dist/es/motion/index.mjs +0 -2
- package/dist/es/render/utils/animation.mjs +0 -3
- package/dist/es/render/utils/motion-values.mjs +1 -1
- package/dist/es/value/index.mjs +1 -4
- package/dist/es/value/use-inverted-scale.mjs +0 -1
- package/dist/es/value/utils/resolve-motion-value.mjs +0 -2
- package/dist/framer-motion.dev.js +2 -20
- package/dist/framer-motion.js +1 -1
- package/dist/index.d.ts +4118 -0
- package/dist/projection.dev.js +2 -9
- package/dist/size-rollup-dom-animation.js +1 -1
- package/dist/size-rollup-dom-max.js +1 -1
- package/dist/three-entry.d.ts +2428 -0
- package/package.json +4 -4
- package/types/animation/animate.d.ts +0 -54
- package/types/animation/animation-controls.d.ts +0 -5
- package/types/animation/types.d.ts +0 -79
- package/types/animation/use-animated-state.d.ts +0 -6
- package/types/animation/use-animation.d.ts +0 -31
- package/types/animation/utils/default-transitions.d.ts +0 -19
- package/types/animation/utils/easing.d.ts +0 -3
- package/types/animation/utils/is-animatable.d.ts +0 -11
- package/types/animation/utils/is-animation-controls.d.ts +0 -2
- package/types/animation/utils/is-keyframes-target.d.ts +0 -2
- package/types/animation/utils/transitions.d.ts +0 -29
- package/types/animation/utils/variant-resolvers.d.ts +0 -12
- package/types/components/AnimatePresence/PresenceChild.d.ts +0 -12
- package/types/components/AnimatePresence/index.d.ts +0 -36
- package/types/components/AnimatePresence/types.d.ts +0 -61
- package/types/components/AnimatePresence/use-presence.d.ts +0 -52
- package/types/components/AnimateSharedLayout.d.ts +0 -2
- package/types/components/LayoutGroup/index.d.ts +0 -12
- package/types/components/LazyMotion/index.d.ts +0 -38
- package/types/components/LazyMotion/types.d.ts +0 -54
- package/types/components/MotionConfig/index.d.ts +0 -25
- package/types/components/Reorder/Group.d.ts +0 -297
- package/types/components/Reorder/Item.d.ts +0 -278
- package/types/components/Reorder/index.d.ts +0 -509
- package/types/components/Reorder/types.d.ts +0 -10
- package/types/components/Reorder/utils/check-reorder.d.ts +0 -2
- package/types/context/DeprecatedLayoutGroupContext.d.ts +0 -6
- package/types/context/LayoutGroupContext.d.ts +0 -11
- package/types/context/LazyContext.d.ts +0 -7
- package/types/context/MotionConfigContext.d.ts +0 -36
- package/types/context/MotionContext/create.d.ts +0 -3
- package/types/context/MotionContext/index.d.ts +0 -9
- package/types/context/MotionContext/utils.d.ts +0 -3
- package/types/context/PresenceContext.d.ts +0 -17
- package/types/context/ReorderContext.d.ts +0 -3
- package/types/context/SwitchLayoutGroupContext.d.ts +0 -23
- package/types/events/event-info.d.ts +0 -5
- package/types/events/types.d.ts +0 -10
- package/types/events/use-dom-event.d.ts +0 -24
- package/types/events/use-pointer-event.d.ts +0 -4
- package/types/events/utils.d.ts +0 -3
- package/types/gestures/PanSession.d.ts +0 -127
- package/types/gestures/drag/VisualElementDragControls.d.ts +0 -56
- package/types/gestures/drag/types.d.ts +0 -294
- package/types/gestures/drag/use-drag-controls.d.ts +0 -74
- package/types/gestures/drag/use-drag.d.ts +0 -7
- package/types/gestures/drag/utils/constraints.d.ts +0 -77
- package/types/gestures/drag/utils/lock.d.ts +0 -4
- package/types/gestures/types.d.ts +0 -225
- package/types/gestures/use-focus-gesture.d.ts +0 -8
- package/types/gestures/use-hover-gesture.d.ts +0 -2
- package/types/gestures/use-pan-gesture.d.ts +0 -14
- package/types/gestures/use-tap-gesture.d.ts +0 -6
- package/types/gestures/utils/event-type.d.ts +0 -2
- package/types/gestures/utils/is-node-or-child.d.ts +0 -8
- package/types/index.d.ts +0 -96
- package/types/motion/features/animations.d.ts +0 -2
- package/types/motion/features/definitions.d.ts +0 -3
- package/types/motion/features/drag.d.ts +0 -2
- package/types/motion/features/gestures.d.ts +0 -2
- package/types/motion/features/layout/MeasureLayout.d.ts +0 -3
- package/types/motion/features/layout/index.d.ts +0 -2
- package/types/motion/features/layout/types.d.ts +0 -75
- package/types/motion/features/types.d.ts +0 -52
- package/types/motion/features/use-features.d.ts +0 -8
- package/types/motion/features/use-projection.d.ts +0 -3
- package/types/motion/features/viewport/observers.d.ts +0 -3
- package/types/motion/features/viewport/types.d.ts +0 -21
- package/types/motion/features/viewport/use-viewport.d.ts +0 -2
- package/types/motion/index.d.ts +0 -25
- package/types/motion/types.d.ts +0 -279
- package/types/motion/utils/VisualElementHandler.d.ts +0 -18
- package/types/motion/utils/is-forced-motion-value.d.ts +0 -2
- package/types/motion/utils/make-renderless-component.d.ts +0 -2
- package/types/motion/utils/should-inherit-variant.d.ts +0 -2
- package/types/motion/utils/use-motion-ref.d.ts +0 -8
- package/types/motion/utils/use-visual-element.d.ts +0 -6
- package/types/motion/utils/use-visual-state.d.ts +0 -14
- package/types/motion/utils/valid-prop.d.ts +0 -9
- package/types/projection/animation/mix-values.d.ts +0 -2
- package/types/projection/geometry/conversion.d.ts +0 -14
- package/types/projection/geometry/copy.d.ts +0 -13
- package/types/projection/geometry/delta-apply.d.ts +0 -37
- package/types/projection/geometry/delta-calc.d.ts +0 -10
- package/types/projection/geometry/delta-remove.d.ts +0 -20
- package/types/projection/geometry/models.d.ts +0 -5
- package/types/projection/geometry/types.d.ts +0 -29
- package/types/projection/geometry/utils.d.ts +0 -3
- package/types/projection/index.d.ts +0 -14
- package/types/projection/node/DocumentProjectionNode.d.ts +0 -108
- package/types/projection/node/HTMLProjectionNode.d.ts +0 -112
- package/types/projection/node/create-projection-node.d.ts +0 -301
- package/types/projection/node/group.d.ts +0 -7
- package/types/projection/node/id.d.ts +0 -1
- package/types/projection/node/types.d.ts +0 -136
- package/types/projection/shared/stack.d.ts +0 -17
- package/types/projection/styles/scale-border-radius.d.ts +0 -11
- package/types/projection/styles/scale-box-shadow.d.ts +0 -2
- package/types/projection/styles/scale-correction.d.ts +0 -3
- package/types/projection/styles/transform-origin.d.ts +0 -0
- package/types/projection/styles/transform.d.ts +0 -4
- package/types/projection/styles/types.d.ts +0 -9
- package/types/projection/use-instant-layout-transition.d.ts +0 -1
- package/types/projection/use-reset-projection.d.ts +0 -1
- package/types/projection/utils/each-axis.d.ts +0 -3
- package/types/projection/utils/has-transform.d.ts +0 -3
- package/types/projection/utils/measure.d.ts +0 -4
- package/types/render/dom/create-visual-element.d.ts +0 -2
- package/types/render/dom/features-animation.d.ts +0 -5
- package/types/render/dom/features-max.d.ts +0 -5
- package/types/render/dom/motion-minimal.d.ts +0 -5
- package/types/render/dom/motion-proxy.d.ts +0 -30
- package/types/render/dom/motion.d.ts +0 -25
- package/types/render/dom/types.d.ts +0 -28
- package/types/render/dom/use-render.d.ts +0 -4
- package/types/render/dom/utils/camel-to-dash.d.ts +0 -4
- package/types/render/dom/utils/create-config.d.ts +0 -8
- package/types/render/dom/utils/css-variables-conversion.d.ts +0 -22
- package/types/render/dom/utils/filter-props.d.ts +0 -4
- package/types/render/dom/utils/is-css-variable.d.ts +0 -4
- package/types/render/dom/utils/is-svg-component.d.ts +0 -2
- package/types/render/dom/utils/parse-dom-variant.d.ts +0 -6
- package/types/render/dom/utils/unit-conversion.d.ts +0 -27
- package/types/render/dom/value-types/animatable-none.d.ts +0 -1
- package/types/render/dom/value-types/defaults.d.ts +0 -9
- package/types/render/dom/value-types/dimensions.d.ts +0 -8
- package/types/render/dom/value-types/find.d.ts +0 -9
- package/types/render/dom/value-types/get-as-type.d.ts +0 -5
- package/types/render/dom/value-types/number.d.ts +0 -2
- package/types/render/dom/value-types/test.d.ts +0 -5
- package/types/render/dom/value-types/type-auto.d.ts +0 -5
- package/types/render/dom/value-types/type-int.d.ts +0 -8
- package/types/render/dom/value-types/types.d.ts +0 -4
- package/types/render/html/config-motion.d.ts +0 -3
- package/types/render/html/supported-elements.d.ts +0 -7
- package/types/render/html/types.d.ts +0 -61
- package/types/render/html/use-props.d.ts +0 -8
- package/types/render/html/utils/build-styles.d.ts +0 -5
- package/types/render/html/utils/build-transform.d.ts +0 -15
- package/types/render/html/utils/create-render-state.d.ts +0 -7
- package/types/render/html/utils/render.d.ts +0 -4
- package/types/render/html/utils/scrape-motion-values.d.ts +0 -2
- package/types/render/html/utils/transform.d.ts +0 -15
- package/types/render/html/visual-element.d.ts +0 -6
- package/types/render/index.d.ts +0 -2
- package/types/render/svg/config-motion.d.ts +0 -3
- package/types/render/svg/lowercase-elements.d.ts +0 -5
- package/types/render/svg/supported-elements.d.ts +0 -7
- package/types/render/svg/types.d.ts +0 -44
- package/types/render/svg/use-props.d.ts +0 -7
- package/types/render/svg/utils/build-attrs.d.ts +0 -8
- package/types/render/svg/utils/camel-case-attrs.d.ts +0 -4
- package/types/render/svg/utils/create-render-state.d.ts +0 -2
- package/types/render/svg/utils/path.d.ts +0 -9
- package/types/render/svg/utils/render.d.ts +0 -4
- package/types/render/svg/utils/scrape-motion-values.d.ts +0 -2
- package/types/render/svg/utils/transform-origin.d.ts +0 -6
- package/types/render/svg/visual-element.d.ts +0 -2
- package/types/render/types.d.ts +0 -113
- package/types/render/utils/animation-state.d.ts +0 -31
- package/types/render/utils/animation.d.ts +0 -21
- package/types/render/utils/compare-by-depth.d.ts +0 -5
- package/types/render/utils/flat-tree.d.ts +0 -8
- package/types/render/utils/is-draggable.d.ts +0 -2
- package/types/render/utils/lifecycles.d.ts +0 -114
- package/types/render/utils/motion-values.d.ts +0 -3
- package/types/render/utils/setters.d.ts +0 -792
- package/types/render/utils/types.d.ts +0 -9
- package/types/render/utils/variants.d.ts +0 -20
- package/types/three-entry.d.ts +0 -19
- package/types/types.d.ts +0 -981
- package/types/utils/array.d.ts +0 -3
- package/types/utils/each-axis.d.ts +0 -1
- package/types/utils/is-browser.d.ts +0 -1
- package/types/utils/is-numerical-string.d.ts +0 -4
- package/types/utils/is-ref-object.d.ts +0 -2
- package/types/utils/is-zero-value-string.d.ts +0 -4
- package/types/utils/noop.d.ts +0 -1
- package/types/utils/process.d.ts +0 -1
- package/types/utils/resolve-value.d.ts +0 -3
- package/types/utils/shallow-compare.d.ts +0 -1
- package/types/utils/subscription-manager.d.ts +0 -9
- package/types/utils/time-conversion.d.ts +0 -7
- package/types/utils/transform.d.ts +0 -91
- package/types/utils/use-animation-frame.d.ts +0 -2
- package/types/utils/use-constant.d.ts +0 -10
- package/types/utils/use-cycle.d.ts +0 -30
- package/types/utils/use-force-update.d.ts +0 -1
- package/types/utils/use-id.d.ts +0 -6
- package/types/utils/use-instant-transition-state.d.ts +0 -3
- package/types/utils/use-instant-transition.d.ts +0 -1
- package/types/utils/use-is-mounted.d.ts +0 -2
- package/types/utils/use-isomorphic-effect.d.ts +0 -2
- package/types/utils/use-reduced-motion.d.ts +0 -28
- package/types/utils/use-unmount-effect.d.ts +0 -1
- package/types/utils/warn-once.d.ts +0 -2
- package/types/value/index.d.ts +0 -260
- package/types/value/scroll/use-element-scroll.d.ts +0 -28
- package/types/value/scroll/use-viewport-scroll.d.ts +0 -22
- package/types/value/scroll/utils.d.ts +0 -19
- package/types/value/use-combine-values.d.ts +0 -2
- package/types/value/use-inverted-scale.d.ts +0 -28
- package/types/value/use-motion-template.d.ts +0 -24
- package/types/value/use-motion-value.d.ts +0 -19
- package/types/value/use-on-change.d.ts +0 -3
- package/types/value/use-spring.d.ts +0 -22
- package/types/value/use-time.d.ts +0 -1
- package/types/value/use-transform.d.ts +0 -93
- package/types/value/use-velocity.d.ts +0 -13
- package/types/value/utils/is-motion-value.d.ts +0 -2
- package/types/value/utils/resolve-motion-value.d.ts +0 -10
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "framer-motion",
|
|
3
|
-
"version": "6.3.
|
|
3
|
+
"version": "6.3.12",
|
|
4
4
|
"description": "A simple and powerful React animation library",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/es/index.mjs",
|
|
@@ -8,14 +8,14 @@
|
|
|
8
8
|
".": {
|
|
9
9
|
"require": "./dist/cjs/index.js",
|
|
10
10
|
"import": {
|
|
11
|
-
"types": "./
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
12
|
"default": "./dist/es/index.mjs"
|
|
13
13
|
},
|
|
14
14
|
"default": "./dist/cjs/index.js"
|
|
15
15
|
},
|
|
16
16
|
"./package.json": "./package.json"
|
|
17
17
|
},
|
|
18
|
-
"types": "
|
|
18
|
+
"types": "dist/index.d.ts",
|
|
19
19
|
"author": "Framer",
|
|
20
20
|
"license": "MIT",
|
|
21
21
|
"repository": "https://github.com/framer/motion/",
|
|
@@ -106,5 +106,5 @@
|
|
|
106
106
|
"maxSize": "31.6 kB"
|
|
107
107
|
}
|
|
108
108
|
],
|
|
109
|
-
"gitHead": "
|
|
109
|
+
"gitHead": "302ce6a81112c64a332080b87372a7a128f8379d"
|
|
110
110
|
}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { Spring, Tween } from "../types";
|
|
2
|
-
import { MotionValue } from "../value";
|
|
3
|
-
/**
|
|
4
|
-
* @public
|
|
5
|
-
*/
|
|
6
|
-
export interface AnimationPlaybackControls {
|
|
7
|
-
stop: () => void;
|
|
8
|
-
isAnimating: () => boolean;
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* @public
|
|
12
|
-
*/
|
|
13
|
-
export interface AnimationPlaybackLifecycles<V> {
|
|
14
|
-
onUpdate?: (latest: V) => void;
|
|
15
|
-
onPlay?: () => void;
|
|
16
|
-
onComplete?: () => void;
|
|
17
|
-
onRepeat?: () => void;
|
|
18
|
-
onStop?: () => void;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* @public
|
|
22
|
-
*/
|
|
23
|
-
export declare type AnimationOptions<V> = (Tween | Spring) & AnimationPlaybackLifecycles<V> & {
|
|
24
|
-
delay?: number;
|
|
25
|
-
type?: "tween" | "spring";
|
|
26
|
-
};
|
|
27
|
-
/**
|
|
28
|
-
* Animate a single value or a `MotionValue`.
|
|
29
|
-
*
|
|
30
|
-
* The first argument is either a `MotionValue` to animate, or an initial animation value.
|
|
31
|
-
*
|
|
32
|
-
* The second is either a value to animate to, or an array of keyframes to animate through.
|
|
33
|
-
*
|
|
34
|
-
* The third argument can be either tween or spring options, and optional lifecycle methods: `onUpdate`, `onPlay`, `onComplete`, `onRepeat` and `onStop`.
|
|
35
|
-
*
|
|
36
|
-
* Returns `AnimationPlaybackControls`, currently just a `stop` method.
|
|
37
|
-
*
|
|
38
|
-
* ```javascript
|
|
39
|
-
* const x = useMotionValue(0)
|
|
40
|
-
*
|
|
41
|
-
* useEffect(() => {
|
|
42
|
-
* const controls = animate(x, 100, {
|
|
43
|
-
* type: "spring",
|
|
44
|
-
* stiffness: 2000,
|
|
45
|
-
* onComplete: v => {}
|
|
46
|
-
* })
|
|
47
|
-
*
|
|
48
|
-
* return controls.stop
|
|
49
|
-
* })
|
|
50
|
-
* ```
|
|
51
|
-
*
|
|
52
|
-
* @public
|
|
53
|
-
*/
|
|
54
|
-
export declare function animate<V>(from: MotionValue<V> | V, to: V | V[], transition?: AnimationOptions<V>): AnimationPlaybackControls;
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import { TargetAndTransition, TargetResolver, Transition } from "../types";
|
|
2
|
-
import { VisualElement } from "../render/types";
|
|
3
|
-
/**
|
|
4
|
-
* @public
|
|
5
|
-
*/
|
|
6
|
-
export declare type ControlsAnimationDefinition = string | string[] | TargetAndTransition | TargetResolver;
|
|
7
|
-
/**
|
|
8
|
-
* @public
|
|
9
|
-
*/
|
|
10
|
-
export declare type PendingAnimations = {
|
|
11
|
-
animation: [ControlsAnimationDefinition, Transition | undefined];
|
|
12
|
-
resolve: () => void;
|
|
13
|
-
};
|
|
14
|
-
/**
|
|
15
|
-
* @public
|
|
16
|
-
*/
|
|
17
|
-
export interface AnimationControls {
|
|
18
|
-
/**
|
|
19
|
-
* Subscribes a component's animation controls to this.
|
|
20
|
-
*
|
|
21
|
-
* @param controls - The controls to subscribe
|
|
22
|
-
* @returns An unsubscribe function.
|
|
23
|
-
*
|
|
24
|
-
* @internal
|
|
25
|
-
*/
|
|
26
|
-
subscribe(visualElement: VisualElement): () => void;
|
|
27
|
-
/**
|
|
28
|
-
* Starts an animation on all linked components.
|
|
29
|
-
*
|
|
30
|
-
* @remarks
|
|
31
|
-
*
|
|
32
|
-
* ```jsx
|
|
33
|
-
* controls.start("variantLabel")
|
|
34
|
-
* controls.start({
|
|
35
|
-
* x: 0,
|
|
36
|
-
* transition: { duration: 1 }
|
|
37
|
-
* })
|
|
38
|
-
* ```
|
|
39
|
-
*
|
|
40
|
-
* @param definition - Properties or variant label to animate to
|
|
41
|
-
* @param transition - Optional `transtion` to apply to a variant
|
|
42
|
-
* @returns - A `Promise` that resolves when all animations have completed.
|
|
43
|
-
*
|
|
44
|
-
* @public
|
|
45
|
-
*/
|
|
46
|
-
start(definition: ControlsAnimationDefinition, transitionOverride?: Transition): Promise<any>;
|
|
47
|
-
/**
|
|
48
|
-
* Instantly set to a set of properties or a variant.
|
|
49
|
-
*
|
|
50
|
-
* ```jsx
|
|
51
|
-
* // With properties
|
|
52
|
-
* controls.set({ opacity: 0 })
|
|
53
|
-
*
|
|
54
|
-
* // With variants
|
|
55
|
-
* controls.set("hidden")
|
|
56
|
-
* ```
|
|
57
|
-
*
|
|
58
|
-
* @internalremarks
|
|
59
|
-
* We could perform a similar trick to `.start` where this can be called before mount
|
|
60
|
-
* and we maintain a list of of pending actions that get applied on mount. But the
|
|
61
|
-
* expectation of `set` is that it happens synchronously and this would be difficult
|
|
62
|
-
* to do before any children have even attached themselves. It's also poor practise
|
|
63
|
-
* and we should discourage render-synchronous `.start` calls rather than lean into this.
|
|
64
|
-
*
|
|
65
|
-
* @public
|
|
66
|
-
*/
|
|
67
|
-
set(definition: ControlsAnimationDefinition): void;
|
|
68
|
-
/**
|
|
69
|
-
* Stops animations on all linked components.
|
|
70
|
-
*
|
|
71
|
-
* ```jsx
|
|
72
|
-
* controls.stop()
|
|
73
|
-
* ```
|
|
74
|
-
*
|
|
75
|
-
* @public
|
|
76
|
-
*/
|
|
77
|
-
stop(): void;
|
|
78
|
-
mount(): () => void;
|
|
79
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { AnimationControls } from "./types";
|
|
2
|
-
/**
|
|
3
|
-
* Creates `AnimationControls`, which can be used to manually start, stop
|
|
4
|
-
* and sequence animations on one or more components.
|
|
5
|
-
*
|
|
6
|
-
* The returned `AnimationControls` should be passed to the `animate` property
|
|
7
|
-
* of the components you want to animate.
|
|
8
|
-
*
|
|
9
|
-
* These components can then be animated with the `start` method.
|
|
10
|
-
*
|
|
11
|
-
* ```jsx
|
|
12
|
-
* import * as React from 'react'
|
|
13
|
-
* import { motion, useAnimation } from 'framer-motion'
|
|
14
|
-
*
|
|
15
|
-
* export function MyComponent(props) {
|
|
16
|
-
* const controls = useAnimation()
|
|
17
|
-
*
|
|
18
|
-
* controls.start({
|
|
19
|
-
* x: 100,
|
|
20
|
-
* transition: { duration: 0.5 },
|
|
21
|
-
* })
|
|
22
|
-
*
|
|
23
|
-
* return <motion.div animate={controls} />
|
|
24
|
-
* }
|
|
25
|
-
* ```
|
|
26
|
-
*
|
|
27
|
-
* @returns Animation controller with `start` and `stop` methods
|
|
28
|
-
*
|
|
29
|
-
* @public
|
|
30
|
-
*/
|
|
31
|
-
export declare function useAnimation(): AnimationControls;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { PopmotionTransitionProps, ValueTarget, SingleTarget } from "../../types";
|
|
2
|
-
export declare const underDampedSpring: () => {
|
|
3
|
-
type: string;
|
|
4
|
-
stiffness: number;
|
|
5
|
-
damping: number;
|
|
6
|
-
restSpeed: number;
|
|
7
|
-
};
|
|
8
|
-
export declare const criticallyDampedSpring: (to: SingleTarget) => {
|
|
9
|
-
type: string;
|
|
10
|
-
stiffness: number;
|
|
11
|
-
damping: number;
|
|
12
|
-
restSpeed: number;
|
|
13
|
-
};
|
|
14
|
-
export declare const linearTween: () => {
|
|
15
|
-
type: string;
|
|
16
|
-
ease: string;
|
|
17
|
-
duration: number;
|
|
18
|
-
};
|
|
19
|
-
export declare const getDefaultTransition: (valueKey: string, to: ValueTarget) => PopmotionTransitionProps;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { ResolvedValueTarget } from "../../types";
|
|
2
|
-
/**
|
|
3
|
-
* Check if a value is animatable. Examples:
|
|
4
|
-
*
|
|
5
|
-
* ✅: 100, "100px", "#fff"
|
|
6
|
-
* ❌: "block", "url(2.jpg)"
|
|
7
|
-
* @param value
|
|
8
|
-
*
|
|
9
|
-
* @internal
|
|
10
|
-
*/
|
|
11
|
-
export declare const isAnimatable: (key: string, value: ResolvedValueTarget) => boolean;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { Transition, PermissiveTransitionDefinition, ResolvedValueTarget } from "../../types";
|
|
2
|
-
import { AnimationOptions } from "popmotion";
|
|
3
|
-
import { MotionValue } from "../../value";
|
|
4
|
-
/**
|
|
5
|
-
* Decide whether a transition is defined on a given Transition.
|
|
6
|
-
* This filters out orchestration options and returns true
|
|
7
|
-
* if any options are left.
|
|
8
|
-
*/
|
|
9
|
-
export declare function isTransitionDefined({ when, delay, delayChildren, staggerChildren, staggerDirection, repeat, repeatType, repeatDelay, from, ...transition }: Transition): boolean;
|
|
10
|
-
/**
|
|
11
|
-
* Convert Framer Motion's Transition type into Popmotion-compatible options.
|
|
12
|
-
*/
|
|
13
|
-
export declare function convertTransitionToAnimationOptions<T>({ ease, times, yoyo, flip, loop, ...transition }: PermissiveTransitionDefinition): AnimationOptions<T>;
|
|
14
|
-
/**
|
|
15
|
-
* Get the delay for a value by checking Transition with decreasing specificity.
|
|
16
|
-
*/
|
|
17
|
-
export declare function getDelayFromTransition(transition: Transition, key: string): any;
|
|
18
|
-
export declare function hydrateKeyframes(options: PermissiveTransitionDefinition): PermissiveTransitionDefinition;
|
|
19
|
-
export declare function getPopmotionAnimationOptions(transition: PermissiveTransitionDefinition, options: any, key: string): any;
|
|
20
|
-
export declare function isZero(value: string | number): boolean;
|
|
21
|
-
export declare function getZeroUnit(potentialUnitType: string | number): string | number;
|
|
22
|
-
export declare function getValueTransition(transition: Transition, key: string): any;
|
|
23
|
-
/**
|
|
24
|
-
* Start animation on a MotionValue. This function is an interface between
|
|
25
|
-
* Framer Motion and Popmotion
|
|
26
|
-
*
|
|
27
|
-
* @internal
|
|
28
|
-
*/
|
|
29
|
-
export declare function startAnimation(key: string, value: MotionValue, target: ResolvedValueTarget, transition?: Transition): Promise<void>;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { MotionValue } from "../../value";
|
|
2
|
-
declare type VariantNameList = string[];
|
|
3
|
-
declare type VariantName = string | VariantNameList;
|
|
4
|
-
declare type UnresolvedVariant = VariantName | MotionValue;
|
|
5
|
-
export declare const resolveVariantLabels: (variant?: UnresolvedVariant | undefined) => VariantNameList;
|
|
6
|
-
/**
|
|
7
|
-
* Hooks in React sometimes accept a dependency array as their final argument. (ie useEffect/useMemo)
|
|
8
|
-
* When values in this array change, React re-runs the dependency. However if the array
|
|
9
|
-
* contains a variable number of items, React throws an error.
|
|
10
|
-
*/
|
|
11
|
-
export declare const asDependencyList: (list: VariantNameList) => string[];
|
|
12
|
-
export {};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { VariantLabels } from "../../motion/types";
|
|
3
|
-
interface PresenceChildProps {
|
|
4
|
-
children: React.ReactElement<any>;
|
|
5
|
-
isPresent: boolean;
|
|
6
|
-
onExitComplete?: () => void;
|
|
7
|
-
initial?: false | VariantLabels;
|
|
8
|
-
custom?: any;
|
|
9
|
-
presenceAffectsLayout: boolean;
|
|
10
|
-
}
|
|
11
|
-
export declare const PresenceChild: ({ children, initial, isPresent, onExitComplete, custom, presenceAffectsLayout, }: PresenceChildProps) => JSX.Element;
|
|
12
|
-
export {};
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { AnimatePresenceProps } from "./types";
|
|
3
|
-
/**
|
|
4
|
-
* `AnimatePresence` enables the animation of components that have been removed from the tree.
|
|
5
|
-
*
|
|
6
|
-
* When adding/removing more than a single child, every child **must** be given a unique `key` prop.
|
|
7
|
-
*
|
|
8
|
-
* Any `motion` components that have an `exit` property defined will animate out when removed from
|
|
9
|
-
* the tree.
|
|
10
|
-
*
|
|
11
|
-
* ```jsx
|
|
12
|
-
* import { motion, AnimatePresence } from 'framer-motion'
|
|
13
|
-
*
|
|
14
|
-
* export const Items = ({ items }) => (
|
|
15
|
-
* <AnimatePresence>
|
|
16
|
-
* {items.map(item => (
|
|
17
|
-
* <motion.div
|
|
18
|
-
* key={item.id}
|
|
19
|
-
* initial={{ opacity: 0 }}
|
|
20
|
-
* animate={{ opacity: 1 }}
|
|
21
|
-
* exit={{ opacity: 0 }}
|
|
22
|
-
* />
|
|
23
|
-
* ))}
|
|
24
|
-
* </AnimatePresence>
|
|
25
|
-
* )
|
|
26
|
-
* ```
|
|
27
|
-
*
|
|
28
|
-
* You can sequence exit animations throughout a tree using variants.
|
|
29
|
-
*
|
|
30
|
-
* If a child contains multiple `motion` components with `exit` props, it will only unmount the child
|
|
31
|
-
* once all `motion` components have finished animating out. Likewise, any components using
|
|
32
|
-
* `usePresence` all need to call `safeToRemove`.
|
|
33
|
-
*
|
|
34
|
-
* @public
|
|
35
|
-
*/
|
|
36
|
-
export declare const AnimatePresence: React.FunctionComponent<React.PropsWithChildren<AnimatePresenceProps>>;
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @public
|
|
3
|
-
*/
|
|
4
|
-
export interface AnimatePresenceProps {
|
|
5
|
-
/**
|
|
6
|
-
* By passing `initial={false}`, `AnimatePresence` will disable any initial animations on children
|
|
7
|
-
* that are present when the component is first rendered.
|
|
8
|
-
*
|
|
9
|
-
* ```jsx
|
|
10
|
-
* <AnimatePresence initial={false}>
|
|
11
|
-
* {isVisible && (
|
|
12
|
-
* <motion.div
|
|
13
|
-
* key="modal"
|
|
14
|
-
* initial={{ opacity: 0 }}
|
|
15
|
-
* animate={{ opacity: 1 }}
|
|
16
|
-
* exit={{ opacity: 0 }}
|
|
17
|
-
* />
|
|
18
|
-
* )}
|
|
19
|
-
* </AnimatePresence>
|
|
20
|
-
* ```
|
|
21
|
-
*
|
|
22
|
-
* @public
|
|
23
|
-
*/
|
|
24
|
-
initial?: boolean;
|
|
25
|
-
/**
|
|
26
|
-
* When a component is removed, there's no longer a chance to update its props. So if a component's `exit`
|
|
27
|
-
* prop is defined as a dynamic variant and you want to pass a new `custom` prop, you can do so via `AnimatePresence`.
|
|
28
|
-
* This will ensure all leaving components animate using the latest data.
|
|
29
|
-
*
|
|
30
|
-
* @public
|
|
31
|
-
*/
|
|
32
|
-
custom?: any;
|
|
33
|
-
/**
|
|
34
|
-
* Fires when all exiting nodes have completed animating out.
|
|
35
|
-
*
|
|
36
|
-
* @public
|
|
37
|
-
*/
|
|
38
|
-
onExitComplete?: () => void;
|
|
39
|
-
/**
|
|
40
|
-
* If set to `true`, `AnimatePresence` will only render one component at a time. The exiting component
|
|
41
|
-
* will finish its exit animation before the entering component is rendered.
|
|
42
|
-
*
|
|
43
|
-
* ```jsx
|
|
44
|
-
* const MyComponent = ({ currentItem }) => (
|
|
45
|
-
* <AnimatePresence exitBeforeEnter>
|
|
46
|
-
* <motion.div key={currentItem} exit={{ opacity: 0 }} />
|
|
47
|
-
* </AnimatePresence>
|
|
48
|
-
* )
|
|
49
|
-
* ```
|
|
50
|
-
*
|
|
51
|
-
* @beta
|
|
52
|
-
*/
|
|
53
|
-
exitBeforeEnter?: boolean;
|
|
54
|
-
/**
|
|
55
|
-
* Used in Framer to flag that sibling children *shouldn't* re-render as a result of a
|
|
56
|
-
* child being removed.
|
|
57
|
-
*
|
|
58
|
-
* @internal
|
|
59
|
-
*/
|
|
60
|
-
presenceAffectsLayout?: boolean;
|
|
61
|
-
}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { PresenceContextProps } from "../../context/PresenceContext";
|
|
2
|
-
export declare type SafeToRemove = () => void;
|
|
3
|
-
declare type AlwaysPresent = [true, null];
|
|
4
|
-
declare type Present = [true];
|
|
5
|
-
declare type NotPresent = [false, SafeToRemove];
|
|
6
|
-
/**
|
|
7
|
-
* When a component is the child of `AnimatePresence`, it can use `usePresence`
|
|
8
|
-
* to access information about whether it's still present in the React tree.
|
|
9
|
-
*
|
|
10
|
-
* ```jsx
|
|
11
|
-
* import { usePresence } from "framer-motion"
|
|
12
|
-
*
|
|
13
|
-
* export const Component = () => {
|
|
14
|
-
* const [isPresent, safeToRemove] = usePresence()
|
|
15
|
-
*
|
|
16
|
-
* useEffect(() => {
|
|
17
|
-
* !isPresent && setTimeout(safeToRemove, 1000)
|
|
18
|
-
* }, [isPresent])
|
|
19
|
-
*
|
|
20
|
-
* return <div />
|
|
21
|
-
* }
|
|
22
|
-
* ```
|
|
23
|
-
*
|
|
24
|
-
* If `isPresent` is `false`, it means that a component has been removed the tree, but
|
|
25
|
-
* `AnimatePresence` won't really remove it until `safeToRemove` has been called.
|
|
26
|
-
*
|
|
27
|
-
* @public
|
|
28
|
-
*/
|
|
29
|
-
export declare function usePresence(): AlwaysPresent | Present | NotPresent;
|
|
30
|
-
/**
|
|
31
|
-
* Similar to `usePresence`, except `useIsPresent` simply returns whether or not the component is present.
|
|
32
|
-
* There is no `safeToRemove` function.
|
|
33
|
-
*
|
|
34
|
-
* ```jsx
|
|
35
|
-
* import { useIsPresent } from "framer-motion"
|
|
36
|
-
*
|
|
37
|
-
* export const Component = () => {
|
|
38
|
-
* const isPresent = useIsPresent()
|
|
39
|
-
*
|
|
40
|
-
* useEffect(() => {
|
|
41
|
-
* !isPresent && console.log("I've been removed!")
|
|
42
|
-
* }, [isPresent])
|
|
43
|
-
*
|
|
44
|
-
* return <div />
|
|
45
|
-
* }
|
|
46
|
-
* ```
|
|
47
|
-
*
|
|
48
|
-
* @public
|
|
49
|
-
*/
|
|
50
|
-
export declare function useIsPresent(): boolean;
|
|
51
|
-
export declare function isPresent(context: PresenceContextProps | null): boolean;
|
|
52
|
-
export {};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
declare type InheritOption = boolean | "id";
|
|
3
|
-
export interface Props {
|
|
4
|
-
id?: string;
|
|
5
|
-
inherit?: InheritOption;
|
|
6
|
-
/**
|
|
7
|
-
* @deprecated
|
|
8
|
-
*/
|
|
9
|
-
inheritId?: boolean;
|
|
10
|
-
}
|
|
11
|
-
export declare const LayoutGroup: React.FunctionComponent<React.PropsWithChildren<Props>>;
|
|
12
|
-
export {};
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { LazyProps } from "./types";
|
|
3
|
-
/**
|
|
4
|
-
* Used in conjunction with the `m` component to reduce bundle size.
|
|
5
|
-
*
|
|
6
|
-
* `m` is a version of the `motion` component that only loads functionality
|
|
7
|
-
* critical for the initial render.
|
|
8
|
-
*
|
|
9
|
-
* `LazyMotion` can then be used to either synchronously or asynchronously
|
|
10
|
-
* load animation and gesture support.
|
|
11
|
-
*
|
|
12
|
-
* ```jsx
|
|
13
|
-
* // Synchronous loading
|
|
14
|
-
* import { LazyMotion, m, domAnimations } from "framer-motion"
|
|
15
|
-
*
|
|
16
|
-
* function App() {
|
|
17
|
-
* return (
|
|
18
|
-
* <LazyMotion features={domAnimations}>
|
|
19
|
-
* <m.div animate={{ scale: 2 }} />
|
|
20
|
-
* </LazyMotion>
|
|
21
|
-
* )
|
|
22
|
-
* }
|
|
23
|
-
*
|
|
24
|
-
* // Asynchronous loading
|
|
25
|
-
* import { LazyMotion, m } from "framer-motion"
|
|
26
|
-
*
|
|
27
|
-
* function App() {
|
|
28
|
-
* return (
|
|
29
|
-
* <LazyMotion features={() => import('./path/to/domAnimations')}>
|
|
30
|
-
* <m.div animate={{ scale: 2 }} />
|
|
31
|
-
* </LazyMotion>
|
|
32
|
-
* )
|
|
33
|
-
* }
|
|
34
|
-
* ```
|
|
35
|
-
*
|
|
36
|
-
* @public
|
|
37
|
-
*/
|
|
38
|
-
export declare function LazyMotion({ children, features, strict }: LazyProps): JSX.Element;
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { FeatureBundle } from "../../motion/features/types";
|
|
3
|
-
export declare type LazyFeatureBundle = () => Promise<FeatureBundle>;
|
|
4
|
-
/**
|
|
5
|
-
* @public
|
|
6
|
-
*/
|
|
7
|
-
export interface LazyProps {
|
|
8
|
-
children?: React.ReactNode;
|
|
9
|
-
/**
|
|
10
|
-
* Can be used to provide a feature bundle synchronously or asynchronously.
|
|
11
|
-
*
|
|
12
|
-
* ```jsx
|
|
13
|
-
* // features.js
|
|
14
|
-
* import { domAnimations } from "framer-motion"
|
|
15
|
-
* export default domAnimations
|
|
16
|
-
*
|
|
17
|
-
* // index.js
|
|
18
|
-
* import { LazyMotion, m } from "framer-motion"
|
|
19
|
-
*
|
|
20
|
-
* const loadFeatures = import("./features.js")
|
|
21
|
-
* .then(res => res.default)
|
|
22
|
-
*
|
|
23
|
-
* function Component() {
|
|
24
|
-
* return (
|
|
25
|
-
* <LazyMotion features={loadFeatures}>
|
|
26
|
-
* <m.div animate={{ scale: 1.5 }} />
|
|
27
|
-
* </LazyMotion>
|
|
28
|
-
* )
|
|
29
|
-
* }
|
|
30
|
-
* ```
|
|
31
|
-
*
|
|
32
|
-
* @public
|
|
33
|
-
*/
|
|
34
|
-
features: FeatureBundle | LazyFeatureBundle;
|
|
35
|
-
/**
|
|
36
|
-
* If `true`, will throw an error if a `motion` component renders within
|
|
37
|
-
* a `LazyMotion` component.
|
|
38
|
-
*
|
|
39
|
-
* ```jsx
|
|
40
|
-
* // This component will throw an error that explains using a motion component
|
|
41
|
-
* // instead of the m component will break the benefits of code-splitting.
|
|
42
|
-
* function Component() {
|
|
43
|
-
* return (
|
|
44
|
-
* <LazyMotion features={domAnimation} strict>
|
|
45
|
-
* <motion.div />
|
|
46
|
-
* </LazyMotion>
|
|
47
|
-
* )
|
|
48
|
-
* }
|
|
49
|
-
* ```
|
|
50
|
-
*
|
|
51
|
-
* @public
|
|
52
|
-
*/
|
|
53
|
-
strict?: boolean;
|
|
54
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { MotionConfigContext } from "../../context/MotionConfigContext";
|
|
3
|
-
import { IsValidProp } from "../../render/dom/utils/filter-props";
|
|
4
|
-
export interface MotionConfigProps extends Partial<MotionConfigContext> {
|
|
5
|
-
children?: React.ReactNode;
|
|
6
|
-
isValidProp?: IsValidProp;
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* `MotionConfig` is used to set configuration options for all children `motion` components.
|
|
10
|
-
*
|
|
11
|
-
* ```jsx
|
|
12
|
-
* import { motion, MotionConfig } from "framer-motion"
|
|
13
|
-
*
|
|
14
|
-
* export function App() {
|
|
15
|
-
* return (
|
|
16
|
-
* <MotionConfig transition={{ type: "spring" }}>
|
|
17
|
-
* <motion.div animate={{ x: 100 }} />
|
|
18
|
-
* </MotionConfig>
|
|
19
|
-
* )
|
|
20
|
-
* }
|
|
21
|
-
* ```
|
|
22
|
-
*
|
|
23
|
-
* @public
|
|
24
|
-
*/
|
|
25
|
-
export declare function MotionConfig({ children, isValidProp, ...config }: MotionConfigProps): JSX.Element;
|