framer-motion
Advanced tools
Comparing version 0.8.2 to 0.8.3
@@ -5,2 +5,8 @@ # Changelog | ||
## [0.8.3] 2019-03-14 | ||
### Update | ||
- Adding support for custom values. | ||
## [0.8.2] 2019-03-14 | ||
@@ -7,0 +13,0 @@ |
@@ -176,2 +176,7 @@ /// <reference types="react" /> | ||
declare interface CustomValueType { | ||
mix: (from: any, to: any) => (p: number) => number | string; | ||
toValue: () => number | string; | ||
} | ||
declare type Cycle = (i?: number) => void; | ||
@@ -187,7 +192,5 @@ | ||
* Enable dragging for this element. Set to `false` by default. | ||
* Set `"x"` or `"y"` to only drag in a specific direction. | ||
* Set `"lockDirection"` to lock dragging into the initial direction. | ||
* | ||
* @remarks | ||
* Set "x" or "y" to only drag in a specific direction | ||
* Set "lockDirection" to lock dragging into the initial direction | ||
* | ||
* ```jsx | ||
@@ -250,2 +253,13 @@ * <motion.div dragEnabled="x" /> | ||
dragMomentum?: boolean; | ||
/** | ||
* Allows you to change dragging inertia params. | ||
* | ||
* ```jsx | ||
* <motion.div | ||
* dragEnabled | ||
* dragTransition={{ bounceStiffness: 600, bounceDamping: 10 }} | ||
* /> | ||
* ``` | ||
*/ | ||
dragTransition?: Partial<Omit_2<Inertia, "velocity" | "type">>; | ||
} | ||
@@ -751,4 +765,8 @@ | ||
declare type KeyframesTarget = [null, ...number[]] | number[] | [null, ...string[]] | string[]; | ||
declare type KeyframesTarget = ResolvedKeyframesTarget | [null, ...CustomValueType[]] | CustomValueType[]; | ||
declare type MakeCustomValueType<T> = { | ||
[K in keyof T]: T[K] | CustomValueType; | ||
}; | ||
declare type MakeKeyframes<T> = { | ||
@@ -758,5 +776,5 @@ [K in keyof T]: T[K] | T[K][] | [null, ...T[K][]]; | ||
declare type MakeMotion<T> = { | ||
declare type MakeMotion<T> = MakeCustomValueType<{ | ||
[K in keyof T]: T[K] | MotionValue<T[K]>; | ||
}; | ||
}>; | ||
@@ -935,3 +953,3 @@ declare type MapOptions = { | ||
*/ | ||
export declare type MotionStyle = MotionCSS & MotionTransform & CustomStyles; | ||
export declare type MotionStyle = MotionCSS & MotionTransform & MakeCustomValueType<CustomStyles>; | ||
@@ -1220,5 +1238,5 @@ declare type MotionTransform = MakeMotion<TransformProperties>; | ||
* @param event - The originating pointer event. | ||
* @param info - An {@link PanInfo} object containing `x`/`y` values for: | ||
* @param info - An {@link PanInfo} object containing `x` and `y` values for: | ||
* | ||
* - `point`: Relative to the document. | ||
* - `point`: Relative to the device or page. | ||
* - `delta`: Distance moved since the last event. | ||
@@ -1243,3 +1261,3 @@ * - `offset`: Offset from the original pan event. | ||
* | ||
* - `point`: Relative to the document. | ||
* - `point`: Relative to the device or page. | ||
* - `delta`: Distance moved since the last event. | ||
@@ -1264,3 +1282,3 @@ * - `offset`: Offset from the original pan event. | ||
* | ||
* - `point`: Relative to the document. | ||
* - `point`: Relative to the device or page. | ||
* - `delta`: Distance moved since the last event. | ||
@@ -1404,2 +1422,4 @@ * - `offset`: Offset from the original pan event. | ||
declare type ResolvedKeyframesTarget = [null, ...number[]] | number[] | [null, ...string[]] | string[]; | ||
/** | ||
@@ -1632,5 +1652,3 @@ * Creates a server-safe reference to `window`, returning a mock if none is available. | ||
* @param event - The originating pointer event. | ||
* @param info - An {@link TapInfo} object containing `x`/`y` values for: | ||
* | ||
* - `point` relative to the document. | ||
* @param info - An {@link TapInfo} object containing `x` and `y` values for the `point` relative to the device or page. | ||
*/ | ||
@@ -1650,5 +1668,3 @@ onTap?(event: MouseEvent | TouchEvent, info: TapInfo): void; | ||
* @param event - The originating pointer event. | ||
* @param info - An {@link TapInfo} object containing `x`/`y` values for: | ||
* | ||
* - `point` relative to the document. | ||
* @param info - An {@link TapInfo} object containing `x` and `y` values for the `point` relative to the device or page. | ||
*/ | ||
@@ -1668,5 +1684,3 @@ onTapStart?(event: MouseEvent | TouchEvent, info: TapInfo): void; | ||
* @param event - The originating pointer event. | ||
* @param info - An {@link TapInfo} object containing `x`/`y` values for: | ||
* | ||
* - `point` relative to the document. | ||
* @param info - An {@link TapInfo} object containing `x` and `y` values for the `point` relative to the device or page. | ||
*/ | ||
@@ -1688,6 +1702,3 @@ onTapCancel?(event: MouseEvent | TouchEvent, info: TapInfo): void; | ||
declare type Target = CSSPropertiesWithoutTransition & TransformProperties & CustomStyles & { | ||
pathLength?: number; | ||
pathSpacing?: number; | ||
}; | ||
declare type Target = MakeCustomValueType<TargetProperties>; | ||
@@ -1699,2 +1710,7 @@ declare type TargetAndTransition = TargetWithKeyframes & { | ||
declare type TargetProperties = CSSPropertiesWithoutTransition & TransformProperties & CustomStyles & { | ||
pathLength?: number; | ||
pathSpacing?: number; | ||
}; | ||
declare type TargetResolver = (props: any, current: Target, velocity: Target) => TargetAndTransition; | ||
@@ -1701,0 +1717,0 @@ |
{ | ||
"name": "framer-motion", | ||
"version": "0.8.2", | ||
"version": "0.8.3", | ||
"main": "dist/framer-motion.cjs.js", | ||
@@ -13,3 +13,3 @@ "module": "dist/framer-motion.es.js", | ||
"test-server": "jest --config jest.config.ssr.json", | ||
"watch": "jest --watch --coverage --coverageReporters=lcov", | ||
"watch": "jest --watch --coverage --coverageReporters=lcov --config jest.config.json", | ||
"prettier": "prettier ./src/* --write", | ||
@@ -64,3 +64,3 @@ "build": "rollup -c && make api && yarn measure", | ||
"@emotion/is-prop-valid": "^0.7.3", | ||
"@popmotion/popcorn": "^0.3.2", | ||
"@popmotion/popcorn": "^0.3.3", | ||
"framesync": "^4.0.2", | ||
@@ -67,0 +67,0 @@ "hey-listen": "^1.0.5", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
783087
19107
Updated@popmotion/popcorn@^0.3.3