motion-v 0.13.0-beta.4 → 0.13.1-alpha.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 +69 -36
- package/dist/es/components/animate-presence/AnimatePresence.d.ts +0 -3
- package/dist/es/components/animate-presence/AnimatePresence.vue.mjs +27 -19
- package/dist/es/components/animate-presence/types.d.ts +0 -1
- package/dist/es/components/motion/Motion.d.ts +5 -4
- package/dist/es/components/motion/Motion.vue.mjs +19 -9
- package/dist/es/components/motion/NameSpace.d.ts +5 -4
- package/dist/es/components/motion/NameSpace.mjs +2 -1
- package/dist/es/components/motion/Primitive.d.ts +11 -2
- package/dist/es/components/motion/Primitive.mjs +9 -1
- package/dist/es/components/reorder/Group.d.ts +14 -32
- package/dist/es/components/reorder/Group.vue.mjs +5 -1
- package/dist/es/components/reorder/Item.vue.mjs +5 -1
- package/dist/es/components/reorder/index.d.ts +1697 -7445
- package/dist/es/features/layout/types.d.ts +4 -0
- package/dist/es/state/animate-updates.mjs +2 -1
- package/dist/es/state/motion-state.d.ts +7 -2
- package/dist/es/state/style.mjs +0 -3
- package/dist/es/types/common.d.ts +4 -0
- package/dist/es/types/index.d.ts +1 -0
- package/dist/es/types/motion-values.d.ts +2 -1
- package/dist/es/types/state.d.ts +3 -3
- package/package.json +1 -1
- package/dist/es/state/animation/index.d.ts +0 -0
- package/dist/es/state/animation/types.d.ts +0 -0
|
@@ -36,7 +36,8 @@ function animateUpdates({
|
|
|
36
36
|
});
|
|
37
37
|
}
|
|
38
38
|
function resolveDirectAnimation(directAnimate, directTransition) {
|
|
39
|
-
|
|
39
|
+
var _a;
|
|
40
|
+
const variant = resolveVariant(directAnimate, this.options.variants, this.options.custom || ((_a = this.options.animatePresenceContext) == null ? void 0 : _a.custom));
|
|
40
41
|
if (!variant)
|
|
41
42
|
return {};
|
|
42
43
|
const transition = variant.transition || directTransition || this.options.transition || {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { MotionStateContext, Options } from '../types';
|
|
2
2
|
import { DOMKeyframesDefinition, VisualElement } from 'framer-motion';
|
|
3
3
|
import { frame } from 'framer-motion/dom';
|
|
4
|
+
import { PresenceContext } from '../components/presence';
|
|
4
5
|
import { StateType, animateUpdates } from './animate-updates';
|
|
5
6
|
export declare const mountedStates: WeakMap<Element, MotionState>;
|
|
6
7
|
/**
|
|
@@ -11,7 +12,9 @@ export declare class MotionState {
|
|
|
11
12
|
readonly id: string;
|
|
12
13
|
element: HTMLElement | null;
|
|
13
14
|
private parent?;
|
|
14
|
-
options: Options
|
|
15
|
+
options: Options & {
|
|
16
|
+
animatePresenceContext?: PresenceContext;
|
|
17
|
+
};
|
|
15
18
|
isSafeToRemove: boolean;
|
|
16
19
|
isVShow: boolean;
|
|
17
20
|
private children?;
|
|
@@ -45,6 +48,8 @@ export declare class MotionState {
|
|
|
45
48
|
setActive(name: StateType, isActive: boolean, isAnimate?: boolean): void;
|
|
46
49
|
animateUpdates: typeof animateUpdates;
|
|
47
50
|
isMounted(): boolean;
|
|
48
|
-
getOptions(): Options<any
|
|
51
|
+
getOptions(): Options<any> & {
|
|
52
|
+
animatePresenceContext?: PresenceContext;
|
|
53
|
+
};
|
|
49
54
|
willUpdate(label: string): void;
|
|
50
55
|
}
|
package/dist/es/state/style.mjs
CHANGED
|
@@ -60,15 +60,12 @@ const SVG_STYLE_TO_ATTRIBUTES = {
|
|
|
60
60
|
cy: true,
|
|
61
61
|
r: true,
|
|
62
62
|
d: true,
|
|
63
|
-
x: true,
|
|
64
|
-
y: true,
|
|
65
63
|
x1: true,
|
|
66
64
|
y1: true,
|
|
67
65
|
x2: true,
|
|
68
66
|
y2: true,
|
|
69
67
|
points: true,
|
|
70
68
|
pathLength: true,
|
|
71
|
-
transform: true,
|
|
72
69
|
viewBox: true,
|
|
73
70
|
width: true,
|
|
74
71
|
height: true,
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Component, DefineComponent, ExtractPropTypes, ExtractPublicPropTypes, IntrinsicElementAttributes } from 'vue';
|
|
2
|
+
export type ComponentProps<T> = T extends DefineComponent<ExtractPropTypes<infer Props>, any, any> ? ExtractPublicPropTypes<Props> : never;
|
|
3
|
+
export type ElementType = keyof IntrinsicElementAttributes;
|
|
4
|
+
export type AsTag = keyof IntrinsicElementAttributes | (Component & string);
|
package/dist/es/types/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { MotionValue } from 'framer-motion/dom';
|
|
2
|
-
import {
|
|
2
|
+
import { Options } from './state';
|
|
3
3
|
import { AriaAttributes, Events, IntrinsicElementAttributes, SVGAttributes } from 'vue';
|
|
4
|
+
import { ElementType } from './common';
|
|
4
5
|
type EventHandlers<E> = {
|
|
5
6
|
[K in keyof E]?: E[K] extends (...args: any) => any ? E[K] : (payload: E[K]) => void;
|
|
6
7
|
};
|
package/dist/es/types/state.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { DOMKeyframesDefinition, ResolvedValues, Target, TargetAndTransition } from 'framer-motion';
|
|
2
2
|
import { MotionValue, TransformProperties, animate } from 'framer-motion/dom';
|
|
3
|
-
import { IntrinsicElementAttributes } from 'vue';
|
|
4
3
|
import { LayoutOptions } from '../features/layout/types';
|
|
5
4
|
import { DragProps } from '../features/gestures/drag/types';
|
|
6
5
|
import { PressProps } from '../features/gestures/press/types';
|
|
@@ -12,6 +11,7 @@ import { MotionConfigState } from '../components/motion-config/types';
|
|
|
12
11
|
import { $Transition } from './framer-motion';
|
|
13
12
|
import { FocusProps } from '../features/gestures/focus/types';
|
|
14
13
|
import { AnimationControls } from '../animation/types';
|
|
14
|
+
import { AsTag } from './common';
|
|
15
15
|
type AnimationPlaybackControls = ReturnType<typeof animate>;
|
|
16
16
|
export type TargetResolver = (custom: any, current: Target, velocity: Target) => TargetAndTransition | string;
|
|
17
17
|
export interface Variant extends DOMKeyframesDefinition {
|
|
@@ -39,16 +39,16 @@ type TransformPropertiesWithoutTransition = Omit<TransformProperties, 'transitio
|
|
|
39
39
|
export type MotionStyle = Partial<{
|
|
40
40
|
[K in keyof Omit<Variant & TransformPropertiesWithoutTransition, 'attrX' | 'attrY' | 'attrScale'>]: string | number | undefined | MotionValue;
|
|
41
41
|
}>;
|
|
42
|
-
export type ElementType = keyof IntrinsicElementAttributes;
|
|
43
42
|
export interface Options<T = any> extends LayoutOptions, PressProps, HoverProps, InViewProps, DragProps, PanProps, FocusProps {
|
|
44
43
|
custom?: T;
|
|
45
|
-
as?:
|
|
44
|
+
as?: AsTag;
|
|
46
45
|
initial?: VariantLabels | Variant | boolean;
|
|
47
46
|
animate?: VariantLabels | Variant | AnimationControls;
|
|
48
47
|
exit?: VariantLabels | Variant;
|
|
49
48
|
variants?: {
|
|
50
49
|
[k: string]: Variant | ((custom: T) => Variant);
|
|
51
50
|
};
|
|
51
|
+
inherit?: boolean;
|
|
52
52
|
style?: MotionStyle;
|
|
53
53
|
transformTemplate?: (transform: TransformProperties, generatedTransform: string) => string;
|
|
54
54
|
transition?: $Transition & {
|
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|