motion-v 0.2.2 → 0.2.3

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.
@@ -0,0 +1,91 @@
1
+ import { MotionValue } from 'framer-motion/dom';
2
+ import { Options } from './state';
3
+ import { AriaAttributes, Events, SVGAttributes } from 'vue';
4
+ type EventHandlers<E> = {
5
+ [K in keyof E]?: E[K] extends (...args: any) => any ? E[K] : (payload: E[K]) => void;
6
+ };
7
+ type EventKeys = keyof EventHandlers<Events>;
8
+ interface SVGAttributesWithoutMotionProps extends Pick<SVGAttributes, Exclude<keyof SVGAttributes, keyof Options | keyof AriaAttributes | EventKeys>> {
9
+ }
10
+ /**
11
+ * @public
12
+ */
13
+ export interface CustomValueType {
14
+ mix: (from: any, to: any) => (p: number) => number | string;
15
+ toValue: () => number | string;
16
+ }
17
+ export type MakeCustomValueType<T> = {
18
+ [K in keyof T]: T[K] | CustomValueType;
19
+ };
20
+ export type MakeMotion<T> = MakeCustomValueType<{
21
+ [K in keyof T]: T[K] | MotionValue<number> | MotionValue<string> | MotionValue<any>;
22
+ }>;
23
+ /**
24
+ * Blanket-accept any SVG attribute as a `MotionValue`
25
+ * @public
26
+ */
27
+ export type SVGAttributesAsMotionValues = MakeMotion<SVGAttributesWithoutMotionProps>;
28
+ export interface SVGAttributesWithMotionValues {
29
+ svg: SVGAttributesAsMotionValues;
30
+ animate: SVGAttributesAsMotionValues;
31
+ animateMotion: SVGAttributesAsMotionValues;
32
+ animateTransform: SVGAttributesAsMotionValues;
33
+ circle: SVGAttributesAsMotionValues;
34
+ clipPath: SVGAttributesAsMotionValues;
35
+ defs: SVGAttributesAsMotionValues;
36
+ desc: SVGAttributesAsMotionValues;
37
+ ellipse: SVGAttributesAsMotionValues;
38
+ feBlend: SVGAttributesAsMotionValues;
39
+ feColorMatrix: SVGAttributesAsMotionValues;
40
+ feComponentTransfer: SVGAttributesAsMotionValues;
41
+ feComposite: SVGAttributesAsMotionValues;
42
+ feConvolveMatrix: SVGAttributesAsMotionValues;
43
+ feDiffuseLighting: SVGAttributesAsMotionValues;
44
+ feDisplacementMap: SVGAttributesAsMotionValues;
45
+ feDistantLight: SVGAttributesAsMotionValues;
46
+ feDropShadow: SVGAttributesAsMotionValues;
47
+ feFlood: SVGAttributesAsMotionValues;
48
+ feFuncA: SVGAttributesAsMotionValues;
49
+ feFuncB: SVGAttributesAsMotionValues;
50
+ feFuncG: SVGAttributesAsMotionValues;
51
+ feFuncR: SVGAttributesAsMotionValues;
52
+ feGaussianBlur: SVGAttributesAsMotionValues;
53
+ feImage: SVGAttributesAsMotionValues;
54
+ feMerge: SVGAttributesAsMotionValues;
55
+ feMergeNode: SVGAttributesAsMotionValues;
56
+ feMorphology: SVGAttributesAsMotionValues;
57
+ feOffset: SVGAttributesAsMotionValues;
58
+ fePointLight: SVGAttributesAsMotionValues;
59
+ feSpecularLighting: SVGAttributesAsMotionValues;
60
+ feSpotLight: SVGAttributesAsMotionValues;
61
+ feTile: SVGAttributesAsMotionValues;
62
+ feTurbulence: SVGAttributesAsMotionValues;
63
+ filter: SVGAttributesAsMotionValues;
64
+ foreignObject: SVGAttributesAsMotionValues;
65
+ g: SVGAttributesAsMotionValues;
66
+ image: SVGAttributesAsMotionValues;
67
+ line: SVGAttributesAsMotionValues;
68
+ linearGradient: SVGAttributesAsMotionValues;
69
+ marker: SVGAttributesAsMotionValues;
70
+ mask: SVGAttributesAsMotionValues;
71
+ metadata: SVGAttributesAsMotionValues;
72
+ mpath: SVGAttributesAsMotionValues;
73
+ path: SVGAttributesAsMotionValues;
74
+ pattern: SVGAttributesAsMotionValues;
75
+ polygon: SVGAttributesAsMotionValues;
76
+ polyline: SVGAttributesAsMotionValues;
77
+ radialGradient: SVGAttributesAsMotionValues;
78
+ rect: SVGAttributesAsMotionValues;
79
+ stop: SVGAttributesAsMotionValues;
80
+ switch: SVGAttributesAsMotionValues;
81
+ symbol: SVGAttributesAsMotionValues;
82
+ text: SVGAttributesAsMotionValues;
83
+ textPath: SVGAttributesAsMotionValues;
84
+ tspan: SVGAttributesAsMotionValues;
85
+ use: SVGAttributesAsMotionValues;
86
+ view: SVGAttributesAsMotionValues;
87
+ }
88
+ export type SetMotionValueType<T, Keys extends keyof T> = {
89
+ [K in keyof T]: K extends Keys ? SVGAttributesAsMotionValues : T[K];
90
+ };
91
+ export {};
@@ -1,8 +1,8 @@
1
- import { TransformProperties } from '../types';
2
1
  import { DOMKeyframesDefinition, DynamicAnimationOptions } from 'framer-motion';
3
2
  import { MotionValue } from 'framer-motion/dom';
4
3
  import { animate } from '../../node_modules/framer-motion/dist/es/animation/animate/index.mjs';
5
4
  import { IntrinsicElementAttributes } from 'vue';
5
+ import { TransformProperties } from './transform';
6
6
  type AnimationPlaybackControls = ReturnType<typeof animate>;
7
7
  export interface Variant extends DOMKeyframesDefinition {
8
8
  transition?: DynamicAnimationOptions;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "motion-v",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "license": "MIT",
@@ -9,7 +9,11 @@
9
9
  "type": "git",
10
10
  "url": "https://github.com/rick-hup/motion-vue.git"
11
11
  },
12
- "keywords": [],
12
+ "keywords": [
13
+ "vue",
14
+ "motion",
15
+ "motionone"
16
+ ],
13
17
  "sideEffects": false,
14
18
  "exports": {
15
19
  ".": {