motion-v 0.13.1 → 1.0.0-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 +1000 -961
- package/dist/es/components/index.d.ts +2 -0
- package/dist/es/components/lazy-motion/context.d.ts +7 -0
- package/dist/es/components/lazy-motion/context.mjs +6 -0
- package/dist/es/components/lazy-motion/index.d.ts +26 -0
- package/dist/es/components/lazy-motion/index.mjs +36 -0
- package/dist/es/components/motion/index.d.ts +179 -2
- package/dist/es/components/motion/index.mjs +8 -0
- package/dist/es/components/motion/m.d.ts +178 -0
- package/dist/es/components/motion/m.mjs +7 -0
- package/dist/es/components/motion/props.d.ts +227 -0
- package/dist/es/components/motion/props.mjs +93 -0
- package/dist/es/components/motion/{Motion.d.ts → types.d.ts} +12 -9
- package/dist/es/components/motion/use-motion-state.d.ts +790 -0
- package/dist/es/components/motion/use-motion-state.mjs +115 -0
- package/dist/es/components/motion/utils.d.ts +20 -5
- package/dist/es/components/motion/utils.mjs +122 -1
- package/dist/es/components/reorder/Group.vue.mjs +5 -2
- package/dist/es/components/reorder/Item.vue.mjs +5 -2
- package/dist/es/components/reorder/index.d.ts +12 -0
- package/dist/es/features/animation/animation.d.ts +32 -0
- package/dist/es/features/animation/animation.mjs +152 -5
- package/dist/es/features/animation/types.d.ts +17 -0
- package/dist/es/features/dom-animation.d.ts +2 -0
- package/dist/es/features/dom-animation.mjs +19 -0
- package/dist/es/features/dom-max.d.ts +2 -0
- package/dist/es/features/dom-max.mjs +23 -0
- package/dist/es/features/feature-manager.mjs +20 -20
- package/dist/es/features/gestures/drag/VisualElementDragControls.d.ts +1 -1
- package/dist/es/features/gestures/hover/index.d.ts +2 -0
- package/dist/es/features/gestures/hover/index.mjs +13 -2
- package/dist/es/features/gestures/in-view/index.mjs +3 -3
- package/dist/es/features/gestures/index.d.ts +0 -1
- package/dist/es/features/gestures/press/index.mjs +17 -19
- package/dist/es/features/index.d.ts +2 -0
- package/dist/es/index.d.ts +1 -0
- package/dist/es/index.mjs +17 -9
- package/dist/es/state/motion-state.d.ts +6 -5
- package/dist/es/state/motion-state.mjs +7 -12
- package/dist/es/state/style.mjs +2 -2
- package/dist/es/state/transform.d.ts +0 -1
- package/dist/es/state/transform.mjs +0 -1
- package/dist/es/types/state.d.ts +1 -0
- package/dist/nuxt/index.cjs +3 -1
- package/dist/nuxt/index.mjs +3 -1
- package/dist/resolver/index.cjs +3 -1
- package/dist/resolver/index.mjs +3 -1
- package/package.json +1 -1
- package/dist/es/components/motion/Motion.vue.mjs +0 -241
- package/dist/es/components/motion/Motion.vue2.mjs +0 -4
- package/dist/es/components/motion/NameSpace.d.ts +0 -15
- package/dist/es/components/motion/NameSpace.mjs +0 -48
- package/dist/es/components/motion/Primitive.d.ts +0 -57
- package/dist/es/components/motion/Primitive.mjs +0 -45
- package/dist/es/components/motion/Slot.d.ts +0 -5
- package/dist/es/components/motion/Slot.mjs +0 -36
- package/dist/es/components/motion/renderSlotFragments.mjs +0 -13
- package/dist/es/features/gestures/base.d.ts +0 -8
- package/dist/es/state/animate-updates.d.ts +0 -20
- package/dist/es/state/animate-updates.mjs +0 -147
- package/dist/es/utils/noop.d.ts +0 -1
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
export declare const MotionComponentProps: {
|
|
2
|
+
ignoreStrict: {
|
|
3
|
+
type: BooleanConstructor;
|
|
4
|
+
};
|
|
5
|
+
forwardMotionProps: {
|
|
6
|
+
type: BooleanConstructor;
|
|
7
|
+
default: boolean;
|
|
8
|
+
};
|
|
9
|
+
asChild: {
|
|
10
|
+
type: BooleanConstructor;
|
|
11
|
+
default: boolean;
|
|
12
|
+
};
|
|
13
|
+
hover: {
|
|
14
|
+
type: (ArrayConstructor | ObjectConstructor | StringConstructor)[];
|
|
15
|
+
};
|
|
16
|
+
press: {
|
|
17
|
+
type: (ArrayConstructor | ObjectConstructor | StringConstructor)[];
|
|
18
|
+
};
|
|
19
|
+
inView: {
|
|
20
|
+
type: (ArrayConstructor | ObjectConstructor | StringConstructor)[];
|
|
21
|
+
};
|
|
22
|
+
focus: {
|
|
23
|
+
type: (ArrayConstructor | ObjectConstructor | StringConstructor)[];
|
|
24
|
+
};
|
|
25
|
+
whileDrag: {
|
|
26
|
+
type: (ArrayConstructor | ObjectConstructor | StringConstructor)[];
|
|
27
|
+
};
|
|
28
|
+
whileHover: {
|
|
29
|
+
type: (ArrayConstructor | ObjectConstructor | StringConstructor)[];
|
|
30
|
+
default: ({ hover }: {
|
|
31
|
+
hover: any;
|
|
32
|
+
}) => any;
|
|
33
|
+
};
|
|
34
|
+
whilePress: {
|
|
35
|
+
type: (ArrayConstructor | ObjectConstructor | StringConstructor)[];
|
|
36
|
+
default: ({ press }: {
|
|
37
|
+
press: any;
|
|
38
|
+
}) => any;
|
|
39
|
+
};
|
|
40
|
+
whileInView: {
|
|
41
|
+
type: (ArrayConstructor | ObjectConstructor | StringConstructor)[];
|
|
42
|
+
default: ({ inView }: {
|
|
43
|
+
inView: any;
|
|
44
|
+
}) => any;
|
|
45
|
+
};
|
|
46
|
+
whileFocus: {
|
|
47
|
+
type: (ArrayConstructor | ObjectConstructor | StringConstructor)[];
|
|
48
|
+
default: ({ focus }: {
|
|
49
|
+
focus: any;
|
|
50
|
+
}) => any;
|
|
51
|
+
};
|
|
52
|
+
custom: {
|
|
53
|
+
type: (ArrayConstructor | ObjectConstructor | StringConstructor | NumberConstructor)[];
|
|
54
|
+
};
|
|
55
|
+
initial: {
|
|
56
|
+
type: (ArrayConstructor | BooleanConstructor | ObjectConstructor | StringConstructor)[];
|
|
57
|
+
default: any;
|
|
58
|
+
};
|
|
59
|
+
animate: {
|
|
60
|
+
type: (ArrayConstructor | ObjectConstructor | StringConstructor)[];
|
|
61
|
+
default: any;
|
|
62
|
+
};
|
|
63
|
+
exit: {
|
|
64
|
+
type: (ArrayConstructor | ObjectConstructor | StringConstructor)[];
|
|
65
|
+
};
|
|
66
|
+
variants: {
|
|
67
|
+
type: ObjectConstructor;
|
|
68
|
+
};
|
|
69
|
+
inherit: {
|
|
70
|
+
type: BooleanConstructor;
|
|
71
|
+
};
|
|
72
|
+
style: {
|
|
73
|
+
type: ObjectConstructor;
|
|
74
|
+
};
|
|
75
|
+
transformTemplate: {
|
|
76
|
+
type: FunctionConstructor;
|
|
77
|
+
};
|
|
78
|
+
transition: {
|
|
79
|
+
type: ObjectConstructor;
|
|
80
|
+
};
|
|
81
|
+
layoutGroup: {
|
|
82
|
+
type: ObjectConstructor;
|
|
83
|
+
};
|
|
84
|
+
motionConfig: {
|
|
85
|
+
type: ObjectConstructor;
|
|
86
|
+
};
|
|
87
|
+
onAnimationComplete: {
|
|
88
|
+
type: FunctionConstructor;
|
|
89
|
+
};
|
|
90
|
+
onUpdate: {
|
|
91
|
+
type: FunctionConstructor;
|
|
92
|
+
};
|
|
93
|
+
layout: {
|
|
94
|
+
type: (BooleanConstructor | StringConstructor)[];
|
|
95
|
+
default: boolean;
|
|
96
|
+
};
|
|
97
|
+
layoutId: {
|
|
98
|
+
type: StringConstructor;
|
|
99
|
+
default: any;
|
|
100
|
+
};
|
|
101
|
+
layoutScroll: {
|
|
102
|
+
type: BooleanConstructor;
|
|
103
|
+
default: boolean;
|
|
104
|
+
};
|
|
105
|
+
layoutRoot: {
|
|
106
|
+
type: BooleanConstructor;
|
|
107
|
+
default: boolean;
|
|
108
|
+
};
|
|
109
|
+
'data-framer-portal-id': {
|
|
110
|
+
type: StringConstructor;
|
|
111
|
+
};
|
|
112
|
+
crossfade: {
|
|
113
|
+
type: BooleanConstructor;
|
|
114
|
+
default: boolean;
|
|
115
|
+
};
|
|
116
|
+
layoutDependency: {
|
|
117
|
+
type: (ArrayConstructor | ObjectConstructor | StringConstructor | NumberConstructor)[];
|
|
118
|
+
};
|
|
119
|
+
onBeforeLayoutMeasure: {
|
|
120
|
+
type: FunctionConstructor;
|
|
121
|
+
};
|
|
122
|
+
onLayoutMeasure: {
|
|
123
|
+
type: FunctionConstructor;
|
|
124
|
+
};
|
|
125
|
+
onLayoutAnimationStart: {
|
|
126
|
+
type: FunctionConstructor;
|
|
127
|
+
};
|
|
128
|
+
onLayoutAnimationComplete: {
|
|
129
|
+
type: FunctionConstructor;
|
|
130
|
+
};
|
|
131
|
+
globalPressTarget: {
|
|
132
|
+
type: BooleanConstructor;
|
|
133
|
+
};
|
|
134
|
+
onPressStart: {
|
|
135
|
+
type: FunctionConstructor;
|
|
136
|
+
};
|
|
137
|
+
onPress: {
|
|
138
|
+
type: FunctionConstructor;
|
|
139
|
+
};
|
|
140
|
+
onPressCancel: {
|
|
141
|
+
type: FunctionConstructor;
|
|
142
|
+
};
|
|
143
|
+
onHoverStart: {
|
|
144
|
+
type: FunctionConstructor;
|
|
145
|
+
};
|
|
146
|
+
onHoverEnd: {
|
|
147
|
+
type: FunctionConstructor;
|
|
148
|
+
};
|
|
149
|
+
inViewOptions: {
|
|
150
|
+
type: ObjectConstructor;
|
|
151
|
+
};
|
|
152
|
+
onViewportEnter: {
|
|
153
|
+
type: FunctionConstructor;
|
|
154
|
+
};
|
|
155
|
+
onViewportLeave: {
|
|
156
|
+
type: FunctionConstructor;
|
|
157
|
+
};
|
|
158
|
+
drag: {
|
|
159
|
+
type: (BooleanConstructor | StringConstructor)[];
|
|
160
|
+
};
|
|
161
|
+
dragSnapToOrigin: {
|
|
162
|
+
type: BooleanConstructor;
|
|
163
|
+
};
|
|
164
|
+
dragDirectionLock: {
|
|
165
|
+
type: BooleanConstructor;
|
|
166
|
+
};
|
|
167
|
+
dragPropagation: {
|
|
168
|
+
type: BooleanConstructor;
|
|
169
|
+
};
|
|
170
|
+
dragConstraints: {
|
|
171
|
+
type: (BooleanConstructor | ObjectConstructor)[];
|
|
172
|
+
};
|
|
173
|
+
dragElastic: {
|
|
174
|
+
type: (BooleanConstructor | ObjectConstructor | NumberConstructor)[];
|
|
175
|
+
default: number;
|
|
176
|
+
};
|
|
177
|
+
dragMomentum: {
|
|
178
|
+
type: BooleanConstructor;
|
|
179
|
+
default: boolean;
|
|
180
|
+
};
|
|
181
|
+
dragTransition: {
|
|
182
|
+
type: ObjectConstructor;
|
|
183
|
+
};
|
|
184
|
+
dragListener: {
|
|
185
|
+
type: BooleanConstructor;
|
|
186
|
+
default: boolean;
|
|
187
|
+
};
|
|
188
|
+
dragControls: {
|
|
189
|
+
type: ObjectConstructor;
|
|
190
|
+
};
|
|
191
|
+
onDragStart: {
|
|
192
|
+
type: FunctionConstructor;
|
|
193
|
+
};
|
|
194
|
+
onDragEnd: {
|
|
195
|
+
type: FunctionConstructor;
|
|
196
|
+
};
|
|
197
|
+
onDrag: {
|
|
198
|
+
type: FunctionConstructor;
|
|
199
|
+
};
|
|
200
|
+
onDirectionLock: {
|
|
201
|
+
type: FunctionConstructor;
|
|
202
|
+
};
|
|
203
|
+
onDragTransitionEnd: {
|
|
204
|
+
type: FunctionConstructor;
|
|
205
|
+
};
|
|
206
|
+
onMeasureDragConstraints: {
|
|
207
|
+
type: FunctionConstructor;
|
|
208
|
+
};
|
|
209
|
+
onPanSessionStart: {
|
|
210
|
+
type: FunctionConstructor;
|
|
211
|
+
};
|
|
212
|
+
onPanStart: {
|
|
213
|
+
type: FunctionConstructor;
|
|
214
|
+
};
|
|
215
|
+
onPan: {
|
|
216
|
+
type: FunctionConstructor;
|
|
217
|
+
};
|
|
218
|
+
onPanEnd: {
|
|
219
|
+
type: FunctionConstructor;
|
|
220
|
+
};
|
|
221
|
+
onFocus: {
|
|
222
|
+
type: FunctionConstructor;
|
|
223
|
+
};
|
|
224
|
+
onBlur: {
|
|
225
|
+
type: FunctionConstructor;
|
|
226
|
+
};
|
|
227
|
+
};
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { warning } from "hey-listen";
|
|
2
|
+
const MotionComponentProps = {
|
|
3
|
+
"ignoreStrict": { type: Boolean },
|
|
4
|
+
"forwardMotionProps": { type: Boolean, default: false },
|
|
5
|
+
"asChild": { type: Boolean, default: false },
|
|
6
|
+
"hover": { type: [String, Array, Object] },
|
|
7
|
+
"press": { type: [String, Array, Object] },
|
|
8
|
+
"inView": { type: [String, Array, Object] },
|
|
9
|
+
"focus": { type: [String, Array, Object] },
|
|
10
|
+
"whileDrag": { type: [String, Array, Object] },
|
|
11
|
+
"whileHover": { type: [String, Array, Object], default: ({ hover }) => {
|
|
12
|
+
if (process.env.NODE_ENV === "development" && hover) {
|
|
13
|
+
warning(true, "hover is deprecated. Use whileHover instead.");
|
|
14
|
+
}
|
|
15
|
+
return hover;
|
|
16
|
+
} },
|
|
17
|
+
"whilePress": { type: [String, Array, Object], default: ({ press }) => {
|
|
18
|
+
if (process.env.NODE_ENV === "development" && press) {
|
|
19
|
+
warning(true, "press is deprecated. Use whilePress instead.");
|
|
20
|
+
}
|
|
21
|
+
return press;
|
|
22
|
+
} },
|
|
23
|
+
"whileInView": { type: [String, Array, Object], default: ({ inView }) => {
|
|
24
|
+
if (process.env.NODE_ENV === "development" && inView) {
|
|
25
|
+
warning(true, "inView is deprecated. Use whileInView instead.");
|
|
26
|
+
}
|
|
27
|
+
return inView;
|
|
28
|
+
} },
|
|
29
|
+
"whileFocus": { type: [String, Array, Object], default: ({ focus }) => {
|
|
30
|
+
if (process.env.NODE_ENV === "development" && focus) {
|
|
31
|
+
warning(true, "focus is deprecated. Use whileFocus instead.");
|
|
32
|
+
}
|
|
33
|
+
return focus;
|
|
34
|
+
} },
|
|
35
|
+
"custom": { type: [String, Number, Object, Array] },
|
|
36
|
+
"initial": { type: [String, Array, Object, Boolean], default: void 0 },
|
|
37
|
+
"animate": { type: [String, Array, Object], default: void 0 },
|
|
38
|
+
"exit": { type: [String, Array, Object] },
|
|
39
|
+
"variants": { type: Object },
|
|
40
|
+
"inherit": { type: Boolean },
|
|
41
|
+
"style": { type: Object },
|
|
42
|
+
"transformTemplate": { type: Function },
|
|
43
|
+
"transition": { type: Object },
|
|
44
|
+
"layoutGroup": { type: Object },
|
|
45
|
+
"motionConfig": { type: Object },
|
|
46
|
+
"onAnimationComplete": { type: Function },
|
|
47
|
+
"onUpdate": { type: Function },
|
|
48
|
+
"layout": { type: [Boolean, String], default: false },
|
|
49
|
+
"layoutId": { type: String, default: void 0 },
|
|
50
|
+
"layoutScroll": { type: Boolean, default: false },
|
|
51
|
+
"layoutRoot": { type: Boolean, default: false },
|
|
52
|
+
"data-framer-portal-id": { type: String },
|
|
53
|
+
"crossfade": { type: Boolean, default: true },
|
|
54
|
+
"layoutDependency": { type: [String, Number, Object, Array] },
|
|
55
|
+
"onBeforeLayoutMeasure": { type: Function },
|
|
56
|
+
"onLayoutMeasure": { type: Function },
|
|
57
|
+
"onLayoutAnimationStart": { type: Function },
|
|
58
|
+
"onLayoutAnimationComplete": { type: Function },
|
|
59
|
+
"globalPressTarget": { type: Boolean },
|
|
60
|
+
"onPressStart": { type: Function },
|
|
61
|
+
"onPress": { type: Function },
|
|
62
|
+
"onPressCancel": { type: Function },
|
|
63
|
+
"onHoverStart": { type: Function },
|
|
64
|
+
"onHoverEnd": { type: Function },
|
|
65
|
+
"inViewOptions": { type: Object },
|
|
66
|
+
"onViewportEnter": { type: Function },
|
|
67
|
+
"onViewportLeave": { type: Function },
|
|
68
|
+
"drag": { type: [Boolean, String] },
|
|
69
|
+
"dragSnapToOrigin": { type: Boolean },
|
|
70
|
+
"dragDirectionLock": { type: Boolean },
|
|
71
|
+
"dragPropagation": { type: Boolean },
|
|
72
|
+
"dragConstraints": { type: [Boolean, Object] },
|
|
73
|
+
"dragElastic": { type: [Boolean, Number, Object], default: 0.5 },
|
|
74
|
+
"dragMomentum": { type: Boolean, default: true },
|
|
75
|
+
"dragTransition": { type: Object },
|
|
76
|
+
"dragListener": { type: Boolean, default: true },
|
|
77
|
+
"dragControls": { type: Object },
|
|
78
|
+
"onDragStart": { type: Function },
|
|
79
|
+
"onDragEnd": { type: Function },
|
|
80
|
+
"onDrag": { type: Function },
|
|
81
|
+
"onDirectionLock": { type: Function },
|
|
82
|
+
"onDragTransitionEnd": { type: Function },
|
|
83
|
+
"onMeasureDragConstraints": { type: Function },
|
|
84
|
+
"onPanSessionStart": { type: Function },
|
|
85
|
+
"onPanStart": { type: Function },
|
|
86
|
+
"onPan": { type: Function },
|
|
87
|
+
"onPanEnd": { type: Function },
|
|
88
|
+
"onFocus": { type: Function },
|
|
89
|
+
"onBlur": { type: Function }
|
|
90
|
+
};
|
|
91
|
+
export {
|
|
92
|
+
MotionComponentProps
|
|
93
|
+
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Feature } from '../../features';
|
|
2
2
|
import { AsTag, ComponentProps, Options, SVGAttributesWithMotionValues, SetMotionValueType } from '../../types';
|
|
3
|
+
import { IntrinsicElementAttributes } from 'vue';
|
|
3
4
|
export interface MotionProps<T extends AsTag = 'div', K = unknown> extends Options<K> {
|
|
4
5
|
as?: T;
|
|
5
6
|
asChild?: boolean;
|
|
@@ -13,13 +14,18 @@ export interface MotionProps<T extends AsTag = 'div', K = unknown> extends Optio
|
|
|
13
14
|
whileInView?: Options['whileInView'];
|
|
14
15
|
whileFocus?: Options['whileFocus'];
|
|
15
16
|
forwardMotionProps?: boolean;
|
|
17
|
+
features?: Feature[];
|
|
18
|
+
ignoreStrict?: boolean;
|
|
16
19
|
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
+
type __VLS_PrettifyLocal<T> = {
|
|
21
|
+
[K in keyof T]: T[K];
|
|
22
|
+
} & {};
|
|
23
|
+
export type MotionComponent = <T extends AsTag = 'div', K = any>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>['props'], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, 'attrs' | 'emit' | 'slots'>>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>['expose'], __VLS_setup?: Promise<{
|
|
24
|
+
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & Readonly<import('vue').ExtractPropTypes<{}>>, never>, never> & (Omit<T extends keyof IntrinsicElementAttributes ? SetMotionValueType<IntrinsicElementAttributes, keyof SVGAttributesWithMotionValues>[T] : ComponentProps<T>, keyof Options<any> | 'asChild'> & MotionProps<T, K>)> & import('vue').PublicProps;
|
|
25
|
+
expose: (exposed: import('vue').ShallowUnwrapRef<{}>) => void;
|
|
20
26
|
attrs: any;
|
|
21
27
|
slots: {
|
|
22
|
-
default
|
|
28
|
+
default?: (_: {}) => any;
|
|
23
29
|
};
|
|
24
30
|
emit: {};
|
|
25
31
|
}>) => import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
|
|
@@ -27,7 +33,4 @@ declare const _default: <T extends AsTag = "div", K = unknown>(__VLS_props: NonN
|
|
|
27
33
|
}> & {
|
|
28
34
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
29
35
|
};
|
|
30
|
-
export
|
|
31
|
-
type __VLS_PrettifyLocal<T> = {
|
|
32
|
-
[K in keyof T]: T[K];
|
|
33
|
-
} & {};
|
|
36
|
+
export {};
|