@motify/core
Advanced tools
Comparing version 0.17.0-alpha.12 to 0.17.0-alpha.16
@@ -276,10 +276,15 @@ "use strict"; | ||
transition = Object.assign({}, transition, exitTransition); | ||
} | ||
} // const transformKeys = Object.keys(mergedStyles).filter((key) => | ||
// isTransform(key) | ||
// ) | ||
// | ||
// if (transformKeys.length > 1) { | ||
// console.error( | ||
// `[${PackageName}] Multiple inline transforms found. This won't animate properly. Instead, pass these to a transform array: ${transformKeys.join( | ||
// ', ' | ||
// )}` | ||
// ) | ||
// } | ||
const transformKeys = Object.keys(mergedStyles).filter(key => isTransform(key)); | ||
if (transformKeys.length > 1) { | ||
console.error("[".concat(_packageName.PackageName, "] Multiple inline transforms found. This won't animate properly. Instead, pass these to a transform array: ").concat(transformKeys.join(', '))); | ||
} | ||
Object.keys(mergedStyles).forEach(key => { | ||
@@ -286,0 +291,0 @@ const value = mergedStyles[key]; |
@@ -266,10 +266,15 @@ import { PresenceContext, usePresence } from 'framer-motion'; | ||
transition = Object.assign({}, transition, exitTransition); | ||
} | ||
} // const transformKeys = Object.keys(mergedStyles).filter((key) => | ||
// isTransform(key) | ||
// ) | ||
// | ||
// if (transformKeys.length > 1) { | ||
// console.error( | ||
// `[${PackageName}] Multiple inline transforms found. This won't animate properly. Instead, pass these to a transform array: ${transformKeys.join( | ||
// ', ' | ||
// )}` | ||
// ) | ||
// } | ||
const transformKeys = Object.keys(mergedStyles).filter(key => isTransform(key)); | ||
if (transformKeys.length > 1) { | ||
console.error("[".concat(PackageName, "] Multiple inline transforms found. This won't animate properly. Instead, pass these to a transform array: ").concat(transformKeys.join(', '))); | ||
} | ||
Object.keys(mergedStyles).forEach(key => { | ||
@@ -276,0 +281,0 @@ const value = mergedStyles[key]; |
@@ -1,2 +0,2 @@ | ||
import type Animated from 'react-native-reanimated'; | ||
import type { SharedValue, WithDecayConfig, WithSpringConfig, WithTimingConfig, DerivedValue } from 'react-native-reanimated'; | ||
import type { PerpectiveTransform, RotateTransform, RotateXTransform, RotateYTransform, RotateZTransform, ScaleTransform, ScaleXTransform, ScaleYTransform, TranslateXTransform, TranslateYTransform, SkewXTransform, SkewYTransform, ImageStyle, TextStyle, ViewStyle } from 'react-native'; | ||
@@ -7,7 +7,7 @@ export declare type Transforms = PerpectiveTransform & RotateTransform & RotateXTransform & RotateYTransform & RotateZTransform & ScaleTransform & ScaleXTransform & ScaleYTransform & TranslateXTransform & TranslateYTransform & SkewXTransform & SkewYTransform; | ||
type?: 'spring'; | ||
} & Animated.WithSpringConfig) | ({ | ||
} & WithSpringConfig) | ({ | ||
type: 'timing'; | ||
} & Animated.WithTimingConfig) | ({ | ||
} & WithTimingConfig) | ({ | ||
type: 'decay'; | ||
} & Animated.DecayConfig)) & { | ||
} & WithDecayConfig)) & { | ||
delay?: number; | ||
@@ -107,3 +107,3 @@ }; | ||
export declare type MotiExitProp<Animate> = MotiProps<Animate>['exit']; | ||
declare type OrSharedValue<T> = T | Animated.SharedValue<T>; | ||
declare type OrSharedValue<T> = T | SharedValue<T>; | ||
declare type FallbackAnimateProp = StyleValueWithReplacedTransforms<ImageStyle & TextStyle & ViewStyle>; | ||
@@ -255,3 +255,3 @@ export declare type MotiTransition<Animate = FallbackAnimateProp> = TransitionConfig & Partial<Record<keyof Animate, TransitionConfig>>; | ||
*/ | ||
__state: Animated.SharedValue<any> | Animated.DerivedValue<any>; | ||
__state: SharedValue<any> | DerivedValue<any>; | ||
/** | ||
@@ -306,3 +306,3 @@ * Transition to another state, as defined by this hook. | ||
*/ | ||
__state: Animated.SharedValue<any>; | ||
__state: SharedValue<any>; | ||
/** | ||
@@ -309,0 +309,0 @@ * Read the current "state" (i.e. style object) |
{ | ||
"name": "@motify/core", | ||
"version": "0.17.0-alpha.12+dab7a4f", | ||
"version": "0.17.0-alpha.16+97841e6", | ||
"private": false, | ||
@@ -35,3 +35,3 @@ "license": "MIT", | ||
"sideEffects": false, | ||
"gitHead": "dab7a4f8f05d206a3cafb640023965830973c792", | ||
"gitHead": "97841e6074eddb38f70f3a27fd5bfb07f894dfd4", | ||
"scripts": { | ||
@@ -58,12 +58,11 @@ "prepare": "bob build", | ||
"@testing-library/react-native": "^7.1.0", | ||
"@types/react": "^16.9.53", | ||
"@types/react": "17.0.1", | ||
"@types/react-dom": "^16.9.8", | ||
"@types/react-native": "^0.63.30", | ||
"expo": "^40.0.0-beta.5", | ||
"react": "~16.13.1", | ||
"react-dom": "^16.13.1", | ||
"react-native": "0.63.4", | ||
"react": "17.0.1", | ||
"react-dom": "17.0.1", | ||
"react-native-builder-bob": "^0.17.0", | ||
"react-native-gesture-handler": "~1.8.0", | ||
"react-native-reanimated": "~2.2.0", | ||
"react-native-gesture-handler": "~2.1.0", | ||
"react-native-reanimated": "~2.3.0", | ||
"react-native-web": "0.15.3", | ||
@@ -70,0 +69,0 @@ "typescript": "^4.0.3" |
@@ -1,3 +0,8 @@ | ||
// import type { UseAnimationState } from './use-animator/types' | ||
import type Animated from 'react-native-reanimated' | ||
import type { | ||
SharedValue, | ||
WithDecayConfig, | ||
WithSpringConfig, | ||
WithTimingConfig, | ||
DerivedValue, | ||
} from 'react-native-reanimated' | ||
@@ -39,5 +44,5 @@ import type { | ||
export type TransitionConfigWithoutRepeats = ( | ||
| ({ type?: 'spring' } & Animated.WithSpringConfig) | ||
| ({ type: 'timing' } & Animated.WithTimingConfig) | ||
| ({ type: 'decay' } & Animated.DecayConfig) | ||
| ({ type?: 'spring' } & WithSpringConfig) | ||
| ({ type: 'timing' } & WithTimingConfig) | ||
| ({ type: 'decay' } & WithDecayConfig) | ||
) & { | ||
@@ -174,3 +179,3 @@ delay?: number | ||
type OrSharedValue<T> = T | Animated.SharedValue<T> | ||
type OrSharedValue<T> = T | SharedValue<T> | ||
@@ -359,3 +364,3 @@ type FallbackAnimateProp = StyleValueWithReplacedTransforms< | ||
*/ | ||
__state: Animated.SharedValue<any> | Animated.DerivedValue<any> | ||
__state: SharedValue<any> | DerivedValue<any> | ||
/** | ||
@@ -426,3 +431,3 @@ * Transition to another state, as defined by this hook. | ||
*/ | ||
__state: Animated.SharedValue<any> | ||
__state: SharedValue<any> | ||
/** | ||
@@ -429,0 +434,0 @@ * Read the current "state" (i.e. style object) |
import { PresenceContext, usePresence } from 'framer-motion' | ||
import { useCallback, useContext, useEffect } from 'react' | ||
import type { TransformsStyle } from 'react-native' | ||
import Animated, { | ||
import { | ||
useAnimatedStyle, | ||
@@ -15,2 +15,7 @@ useSharedValue, | ||
} from 'react-native-reanimated' | ||
import type { | ||
WithDecayConfig, | ||
WithSpringConfig, | ||
WithTimingConfig, | ||
} from 'react-native-reanimated' | ||
import { PackageName } from './constants/package-name' | ||
@@ -135,8 +140,8 @@ import type { | ||
const duration = | ||
((transition as any)?.[key as keyof Animate] as Animated.WithTimingConfig) | ||
?.duration ?? (transition as Animated.WithTimingConfig)?.duration | ||
((transition as any)?.[key as keyof Animate] as WithTimingConfig) | ||
?.duration ?? (transition as WithTimingConfig)?.duration | ||
const easing = | ||
((transition as any)?.[key as keyof Animate] as Animated.WithTimingConfig) | ||
?.easing ?? (transition as Animated.WithTimingConfig)?.easing | ||
((transition as any)?.[key as keyof Animate] as WithTimingConfig) | ||
?.easing ?? (transition as WithTimingConfig)?.easing | ||
@@ -155,4 +160,4 @@ if (easing) { | ||
// velocity: 2, | ||
} as Animated.WithSpringConfig | ||
const configKeys: (keyof Animated.WithSpringConfig)[] = [ | ||
} as WithSpringConfig | ||
const configKeys: (keyof WithSpringConfig)[] = [ | ||
'damping', | ||
@@ -183,3 +188,3 @@ 'mass', | ||
} | ||
const configKeys: (keyof Animated.WithDecayConfig)[] = [ | ||
const configKeys: (keyof WithDecayConfig)[] = [ | ||
'clamp', | ||
@@ -329,14 +334,14 @@ 'velocity', | ||
const transformKeys = Object.keys(mergedStyles).filter((key) => | ||
isTransform(key) | ||
) | ||
// const transformKeys = Object.keys(mergedStyles).filter((key) => | ||
// isTransform(key) | ||
// ) | ||
// | ||
// if (transformKeys.length > 1) { | ||
// console.error( | ||
// `[${PackageName}] Multiple inline transforms found. This won't animate properly. Instead, pass these to a transform array: ${transformKeys.join( | ||
// ', ' | ||
// )}` | ||
// ) | ||
// } | ||
if (transformKeys.length > 1) { | ||
console.error( | ||
`[${PackageName}] Multiple inline transforms found. This won't animate properly. Instead, pass these to a transform array: ${transformKeys.join( | ||
', ' | ||
)}` | ||
) | ||
} | ||
Object.keys(mergedStyles).forEach((key) => { | ||
@@ -343,0 +348,0 @@ const value = mergedStyles[key] |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
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
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
13
3413
248849