framer-motion 6.3.10 → 6.3.13
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 +18 -25
- 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/gestures/use-pan-gesture.mjs +1 -1
- package/dist/es/motion/index.mjs +0 -2
- package/dist/es/motion/utils/valid-prop.mjs +1 -1
- package/dist/es/projection/styles/transform.mjs +13 -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 +2 -5
- 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 +18 -25
- package/dist/framer-motion.js +1 -1
- package/dist/index.d.ts +4188 -0
- package/dist/projection.dev.js +16 -12
- package/dist/size-rollup-dom-animation.js +1 -1
- package/dist/size-rollup-dom-max.js +1 -1
- package/dist/size-webpack-dom-max.js +1 -1
- package/dist/three-entry.d.ts +2502 -0
- package/package.json +5 -5
- 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/types/render/types.d.ts
DELETED
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { startAnimation } from "../animation/utils/transitions";
|
|
3
|
-
import { MotionProps, MotionStyle } from "../motion/types";
|
|
4
|
-
import { VisualState } from "../motion/utils/use-visual-state";
|
|
5
|
-
import { TargetAndTransition, Transition, Variant } from "../types";
|
|
6
|
-
import { MotionValue } from "../value";
|
|
7
|
-
import { AnimationState } from "./utils/animation-state";
|
|
8
|
-
import { LifecycleManager } from "./utils/lifecycles";
|
|
9
|
-
import { Box, Point, TransformPoint } from "../projection/geometry/types";
|
|
10
|
-
import { IProjectionNode } from "../projection/node/types";
|
|
11
|
-
import { MotionConfigProps } from "../components/MotionConfig";
|
|
12
|
-
export interface MotionPoint {
|
|
13
|
-
x: MotionValue<number>;
|
|
14
|
-
y: MotionValue<number>;
|
|
15
|
-
}
|
|
16
|
-
export interface VisualElement<Instance = any, RenderState = any> extends LifecycleManager {
|
|
17
|
-
treeType: string;
|
|
18
|
-
depth: number;
|
|
19
|
-
parent?: VisualElement;
|
|
20
|
-
children: Set<VisualElement>;
|
|
21
|
-
variantChildren?: Set<VisualElement>;
|
|
22
|
-
current: Instance | null;
|
|
23
|
-
manuallyAnimateOnMount: boolean;
|
|
24
|
-
blockInitialAnimation?: boolean;
|
|
25
|
-
presenceId: number | undefined;
|
|
26
|
-
isMounted(): boolean;
|
|
27
|
-
mount(instance: Instance): void;
|
|
28
|
-
unmount(): void;
|
|
29
|
-
isStatic?: boolean;
|
|
30
|
-
getInstance(): Instance | null;
|
|
31
|
-
sortNodePosition(element: VisualElement): number;
|
|
32
|
-
measureViewportBox(withTransform?: boolean): Box;
|
|
33
|
-
addVariantChild(child: VisualElement): undefined | (() => void);
|
|
34
|
-
getClosestVariantNode(): VisualElement | undefined;
|
|
35
|
-
shouldReduceMotion?: boolean | null;
|
|
36
|
-
animateMotionValue?: typeof startAnimation;
|
|
37
|
-
projection?: IProjectionNode;
|
|
38
|
-
/**
|
|
39
|
-
* Visibility
|
|
40
|
-
*/
|
|
41
|
-
isVisible?: boolean;
|
|
42
|
-
setVisibility(visibility: boolean): void;
|
|
43
|
-
hasValue(key: string): boolean;
|
|
44
|
-
addValue(key: string, value: MotionValue<any>): void;
|
|
45
|
-
removeValue(key: string): void;
|
|
46
|
-
getValue(key: string): undefined | MotionValue;
|
|
47
|
-
getValue(key: string, defaultValue: string | number): MotionValue;
|
|
48
|
-
getValue(key: string, defaultValue?: string | number): undefined | MotionValue;
|
|
49
|
-
forEachValue(callback: (value: MotionValue, key: string) => void): void;
|
|
50
|
-
readValue(key: string): string | number | undefined | null;
|
|
51
|
-
setBaseTarget(key: string, value: string | number | null): void;
|
|
52
|
-
getBaseTarget(key: string): number | string | undefined | null;
|
|
53
|
-
getStaticValue(key: string): number | string | undefined;
|
|
54
|
-
setStaticValue(key: string, value: number | string): void;
|
|
55
|
-
getLatestValues(): ResolvedValues;
|
|
56
|
-
scheduleRender(): void;
|
|
57
|
-
makeTargetAnimatable(target: TargetAndTransition, isLive?: boolean): TargetAndTransition;
|
|
58
|
-
setProps(props: MotionProps): void;
|
|
59
|
-
getProps(): MotionProps;
|
|
60
|
-
getVariant(name: string): Variant | undefined;
|
|
61
|
-
getDefaultTransition(): Transition | undefined;
|
|
62
|
-
getVariantContext(startAtParent?: boolean): undefined | {
|
|
63
|
-
initial?: string | string[];
|
|
64
|
-
animate?: string | string[];
|
|
65
|
-
exit?: string | string[];
|
|
66
|
-
whileHover?: string | string[];
|
|
67
|
-
whileDrag?: string | string[];
|
|
68
|
-
whileFocus?: string | string[];
|
|
69
|
-
whileTap?: string | string[];
|
|
70
|
-
};
|
|
71
|
-
getTransformPagePoint: () => TransformPoint | undefined;
|
|
72
|
-
build(): RenderState;
|
|
73
|
-
syncRender(): void;
|
|
74
|
-
isPresenceRoot?: boolean;
|
|
75
|
-
isPresent?: boolean;
|
|
76
|
-
prevDragCursor?: Point;
|
|
77
|
-
getLayoutId(): string | undefined;
|
|
78
|
-
animationState?: AnimationState;
|
|
79
|
-
}
|
|
80
|
-
export interface VisualElementConfig<Instance, RenderState, Options> {
|
|
81
|
-
treeType?: string;
|
|
82
|
-
getBaseTarget?(props: MotionProps, key: string): string | number | undefined | MotionValue;
|
|
83
|
-
build(visualElement: VisualElement<Instance>, renderState: RenderState, latestValues: ResolvedValues, options: Options, props: MotionProps): void;
|
|
84
|
-
sortNodePosition?: (a: Instance, b: Instance) => number;
|
|
85
|
-
makeTargetAnimatable(element: VisualElement<Instance>, target: TargetAndTransition, props: MotionProps, isLive: boolean): TargetAndTransition;
|
|
86
|
-
measureViewportBox(instance: Instance, props: MotionProps & MotionConfigProps): Box;
|
|
87
|
-
readValueFromInstance(instance: Instance, key: string, options: Options): string | number | null | undefined;
|
|
88
|
-
resetTransform(element: VisualElement<Instance>, instance: Instance, props: MotionProps): void;
|
|
89
|
-
restoreTransform(instance: Instance, renderState: RenderState): void;
|
|
90
|
-
render(instance: Instance, renderState: RenderState, styleProp?: MotionStyle, projection?: IProjectionNode): void;
|
|
91
|
-
removeValueFromRenderState(key: string, renderState: RenderState): void;
|
|
92
|
-
scrapeMotionValuesFromProps: ScrapeMotionValuesFromProps;
|
|
93
|
-
}
|
|
94
|
-
export declare type ScrapeMotionValuesFromProps = (props: MotionProps) => {
|
|
95
|
-
[key: string]: MotionValue | string | number;
|
|
96
|
-
};
|
|
97
|
-
export declare type UseRenderState<RenderState = any> = () => RenderState;
|
|
98
|
-
export declare type VisualElementOptions<Instance, RenderState = any> = {
|
|
99
|
-
visualState: VisualState<Instance, RenderState>;
|
|
100
|
-
parent?: VisualElement<unknown>;
|
|
101
|
-
variantParent?: VisualElement<unknown>;
|
|
102
|
-
presenceId?: number | undefined;
|
|
103
|
-
props: MotionProps;
|
|
104
|
-
blockInitialAnimation?: boolean;
|
|
105
|
-
shouldReduceMotion?: boolean | null;
|
|
106
|
-
};
|
|
107
|
-
export declare type CreateVisualElement<Instance> = (Component: string | React.ComponentType, options: VisualElementOptions<Instance>) => VisualElement<Instance>;
|
|
108
|
-
/**
|
|
109
|
-
* A generic set of string/number values
|
|
110
|
-
*/
|
|
111
|
-
export interface ResolvedValues {
|
|
112
|
-
[key: string]: string | number;
|
|
113
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { VariantLabels } from "../../motion/types";
|
|
2
|
-
import { TargetAndTransition } from "../../types";
|
|
3
|
-
import { VisualElement } from "../types";
|
|
4
|
-
import { AnimationOptions } from "./animation";
|
|
5
|
-
import { AnimationType } from "./types";
|
|
6
|
-
export interface AnimationState {
|
|
7
|
-
animateChanges: (options?: AnimationOptions, type?: AnimationType) => Promise<any>;
|
|
8
|
-
setActive: (type: AnimationType, isActive: boolean, options?: AnimationOptions) => Promise<any>;
|
|
9
|
-
setAnimateFunction: (fn: any) => void;
|
|
10
|
-
isAnimated(key: string): boolean;
|
|
11
|
-
getState: () => {
|
|
12
|
-
[key: string]: AnimationTypeState;
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
export declare type AnimationList = string[] | TargetAndTransition[];
|
|
16
|
-
export declare const variantPriorityOrder: AnimationType[];
|
|
17
|
-
export declare function createAnimationState(visualElement: VisualElement): AnimationState;
|
|
18
|
-
export declare function checkVariantsDidChange(prev: any, next: any): boolean;
|
|
19
|
-
export interface AnimationTypeState {
|
|
20
|
-
isActive: boolean;
|
|
21
|
-
protectedKeys: {
|
|
22
|
-
[key: string]: true;
|
|
23
|
-
};
|
|
24
|
-
needsAnimating: {
|
|
25
|
-
[key: string]: boolean;
|
|
26
|
-
};
|
|
27
|
-
prevResolvedValues: {
|
|
28
|
-
[key: string]: any;
|
|
29
|
-
};
|
|
30
|
-
prevProp?: VariantLabels | TargetAndTransition;
|
|
31
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { VariantLabels } from "../../motion/types";
|
|
2
|
-
import { Target, TargetAndTransition, TargetResolver, TargetWithKeyframes, Transition } from "../../types";
|
|
3
|
-
import { VisualElement } from "../types";
|
|
4
|
-
import { AnimationType } from "./types";
|
|
5
|
-
export declare type AnimationDefinition = VariantLabels | TargetAndTransition | TargetResolver;
|
|
6
|
-
export declare type AnimationOptions = {
|
|
7
|
-
delay?: number;
|
|
8
|
-
transitionOverride?: Transition;
|
|
9
|
-
custom?: any;
|
|
10
|
-
type?: AnimationType;
|
|
11
|
-
};
|
|
12
|
-
export declare type MakeTargetAnimatable = (visualElement: VisualElement, target: TargetWithKeyframes, origin?: Target, transitionEnd?: Target) => {
|
|
13
|
-
target: TargetWithKeyframes;
|
|
14
|
-
transitionEnd?: Target;
|
|
15
|
-
};
|
|
16
|
-
/**
|
|
17
|
-
* @internal
|
|
18
|
-
*/
|
|
19
|
-
export declare function animateVisualElement(visualElement: VisualElement, definition: AnimationDefinition, options?: AnimationOptions): Promise<void>;
|
|
20
|
-
export declare function stopAnimation(visualElement: VisualElement): void;
|
|
21
|
-
export declare function sortByTreeOrder(a: VisualElement, b: VisualElement): number;
|
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
import { MotionProps } from "../../motion/types";
|
|
2
|
-
import { Axis, Box, Delta } from "../../projection/geometry/types";
|
|
3
|
-
import { ResolvedValues } from "../types";
|
|
4
|
-
import { AnimationDefinition } from "./animation";
|
|
5
|
-
export declare type LayoutMeasureListener = (layout: Box, prevLayout?: Box) => void;
|
|
6
|
-
export declare type BeforeLayoutMeasureListener = () => void;
|
|
7
|
-
export declare type LayoutUpdateListener = (layout: Axis, prevLayout: Axis) => void;
|
|
8
|
-
export declare type UpdateListener = (latest: ResolvedValues) => void;
|
|
9
|
-
export declare type AnimationStartListener = (definition: AnimationDefinition) => void;
|
|
10
|
-
export declare type AnimationCompleteListener = (definition: AnimationDefinition) => void;
|
|
11
|
-
export declare type LayoutAnimationStartListener = () => void;
|
|
12
|
-
export declare type LayoutAnimationCompleteListener = () => void;
|
|
13
|
-
export declare type SetAxisTargetListener = () => void;
|
|
14
|
-
export declare type RenderListener = () => void;
|
|
15
|
-
export declare type OnViewportBoxUpdate = (box: Axis, delta: Delta) => void;
|
|
16
|
-
export interface LayoutLifecycles {
|
|
17
|
-
onBeforeLayoutMeasure?(box: Box): void;
|
|
18
|
-
onLayoutMeasure?(box: Box, prevBox: Box): void;
|
|
19
|
-
/**
|
|
20
|
-
* @internal
|
|
21
|
-
*/
|
|
22
|
-
onLayoutAnimationStart?(): void;
|
|
23
|
-
/**
|
|
24
|
-
* @internal
|
|
25
|
-
*/
|
|
26
|
-
onLayoutAnimationComplete?(): void;
|
|
27
|
-
}
|
|
28
|
-
export interface AnimationLifecycles {
|
|
29
|
-
/**
|
|
30
|
-
* Callback with latest motion values, fired max once per frame.
|
|
31
|
-
*
|
|
32
|
-
* ```jsx
|
|
33
|
-
* function onUpdate(latest) {
|
|
34
|
-
* console.log(latest.x, latest.opacity)
|
|
35
|
-
* }
|
|
36
|
-
*
|
|
37
|
-
* <motion.div animate={{ x: 100, opacity: 0 }} onUpdate={onUpdate} />
|
|
38
|
-
* ```
|
|
39
|
-
*/
|
|
40
|
-
onUpdate?(latest: ResolvedValues): void;
|
|
41
|
-
/**
|
|
42
|
-
* Callback when animation defined in `animate` begins.
|
|
43
|
-
*
|
|
44
|
-
* The provided callback will be called with the triggering animation definition.
|
|
45
|
-
* If this is a variant, it'll be the variant name, and if a target object
|
|
46
|
-
* then it'll be the target object.
|
|
47
|
-
*
|
|
48
|
-
* This way, it's possible to figure out which animation has started.
|
|
49
|
-
*
|
|
50
|
-
* ```jsx
|
|
51
|
-
* function onStart() {
|
|
52
|
-
* console.log("Animation started")
|
|
53
|
-
* }
|
|
54
|
-
*
|
|
55
|
-
* <motion.div animate={{ x: 100 }} onAnimationStart={onStart} />
|
|
56
|
-
* ```
|
|
57
|
-
*/
|
|
58
|
-
onAnimationStart?(definition: AnimationDefinition): void;
|
|
59
|
-
/**
|
|
60
|
-
* Callback when animation defined in `animate` is complete.
|
|
61
|
-
*
|
|
62
|
-
* The provided callback will be called with the triggering animation definition.
|
|
63
|
-
* If this is a variant, it'll be the variant name, and if a target object
|
|
64
|
-
* then it'll be the target object.
|
|
65
|
-
*
|
|
66
|
-
* This way, it's possible to figure out which animation has completed.
|
|
67
|
-
*
|
|
68
|
-
* ```jsx
|
|
69
|
-
* function onComplete() {
|
|
70
|
-
* console.log("Animation completed")
|
|
71
|
-
* }
|
|
72
|
-
*
|
|
73
|
-
* <motion.div
|
|
74
|
-
* animate={{ x: 100 }}
|
|
75
|
-
* onAnimationComplete={definition => {
|
|
76
|
-
* console.log('Completed animating', definition)
|
|
77
|
-
* }}
|
|
78
|
-
* />
|
|
79
|
-
* ```
|
|
80
|
-
*/
|
|
81
|
-
onAnimationComplete?(definition: AnimationDefinition): void;
|
|
82
|
-
/**
|
|
83
|
-
* @internal
|
|
84
|
-
*/
|
|
85
|
-
onUnmount?(): void;
|
|
86
|
-
}
|
|
87
|
-
export declare type VisualElementLifecycles = LayoutLifecycles & AnimationLifecycles;
|
|
88
|
-
export interface LifecycleManager {
|
|
89
|
-
onLayoutMeasure: (callback: LayoutMeasureListener) => () => void;
|
|
90
|
-
notifyLayoutMeasure: LayoutMeasureListener;
|
|
91
|
-
onBeforeLayoutMeasure: (callback: BeforeLayoutMeasureListener) => () => void;
|
|
92
|
-
notifyBeforeLayoutMeasure: BeforeLayoutMeasureListener;
|
|
93
|
-
onLayoutUpdate: (callback: LayoutUpdateListener) => () => void;
|
|
94
|
-
notifyLayoutUpdate: LayoutUpdateListener;
|
|
95
|
-
onUpdate: (callback: UpdateListener) => () => void;
|
|
96
|
-
notifyUpdate: UpdateListener;
|
|
97
|
-
onAnimationStart: (callback: AnimationStartListener) => () => void;
|
|
98
|
-
notifyAnimationStart: AnimationStartListener;
|
|
99
|
-
onAnimationComplete: (callback: AnimationCompleteListener) => () => void;
|
|
100
|
-
notifyAnimationComplete: AnimationCompleteListener;
|
|
101
|
-
onLayoutAnimationStart: (callback: LayoutAnimationStartListener) => () => void;
|
|
102
|
-
notifyLayoutAnimationStart: LayoutAnimationStartListener;
|
|
103
|
-
onLayoutAnimationComplete: (callback: LayoutAnimationCompleteListener) => () => void;
|
|
104
|
-
notifyLayoutAnimationComplete: LayoutAnimationCompleteListener;
|
|
105
|
-
onSetAxisTarget: (callback: SetAxisTargetListener) => () => void;
|
|
106
|
-
notifySetAxisTarget: SetAxisTargetListener;
|
|
107
|
-
onRender: (callback: RenderListener) => () => void;
|
|
108
|
-
notifyRender: RenderListener;
|
|
109
|
-
onUnmount: (callback: () => void) => () => void;
|
|
110
|
-
notifyUnmount: () => void;
|
|
111
|
-
clearAllListeners: () => void;
|
|
112
|
-
updatePropListeners: (props: MotionProps) => void;
|
|
113
|
-
}
|
|
114
|
-
export declare function createLifecycles(): LifecycleManager;
|