react-native-reanimated 2.3.0-beta.3 → 2.3.2
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/Common/cpp/NativeModules/NativeReanimatedModule.cpp +9 -0
- package/Common/cpp/NativeModules/NativeReanimatedModuleSpec.cpp +13 -0
- package/Common/cpp/Tools/FeaturesConfig.cpp +5 -0
- package/Common/cpp/Tools/RuntimeDecorator.cpp +38 -2
- package/Common/cpp/headers/NativeModules/NativeReanimatedModule.h +3 -0
- package/Common/cpp/headers/NativeModules/NativeReanimatedModuleSpec.h +5 -0
- package/Common/cpp/headers/Tools/FeaturesConfig.h +19 -0
- package/Common/cpp/headers/Tools/PlatformDepMethodsHolder.h +2 -0
- package/Common/cpp/headers/Tools/RuntimeDecorator.h +8 -7
- package/README.md +1 -1
- package/RNReanimated.podspec +20 -3
- package/android/build.gradle +31 -5
- package/android/expo/linking.gradle +46 -0
- package/android/expo/src/main/java/com/swmansion/reanimated/EXReanimatedAdapter.java +12 -0
- package/android/expo/src/main/java/expo/modules/adapters/reanimated/EXReanimatedPackage.java +26 -0
- package/android/react-native-reanimated-63-hermes.aar +0 -0
- package/android/react-native-reanimated-63-jsc.aar +0 -0
- package/android/react-native-reanimated-64-hermes.aar +0 -0
- package/android/react-native-reanimated-64-jsc.aar +0 -0
- package/android/react-native-reanimated-65-hermes.aar +0 -0
- package/android/react-native-reanimated-65-jsc.aar +0 -0
- package/android/react-native-reanimated-66-hermes.aar +0 -0
- package/android/react-native-reanimated-66-jsc.aar +0 -0
- package/android/react-native-reanimated-67-hermes.aar +0 -0
- package/android/react-native-reanimated-67-jsc.aar +0 -0
- package/expo-module.config.json +3 -0
- package/ios/LayoutReanimation/REAAnimationsManager.m +64 -19
- package/ios/LayoutReanimation/REAUIManager.mm +63 -18
- package/ios/Nodes/REAPropsNode.m +1 -1
- package/ios/REAEventDispatcher.m +1 -1
- package/ios/REAModule.h +0 -2
- package/ios/REAModule.m +0 -3
- package/ios/REANodesManager.m +1 -0
- package/ios/RNGestureHandlerStateManager.h +5 -0
- package/ios/native/NativeMethods.h +5 -0
- package/ios/native/NativeMethods.mm +8 -1
- package/ios/native/NativeProxy.h +1 -0
- package/ios/native/NativeProxy.mm +10 -2
- package/ios/native/REAInitializer.mm +7 -3
- package/lib/src/Animated.js +31 -0
- package/lib/{ConfigHelper.js → src/ConfigHelper.js} +0 -0
- package/lib/{ReanimatedEventEmitter.js → src/ReanimatedEventEmitter.js} +0 -0
- package/lib/{ReanimatedModule.js → src/ReanimatedModule.js} +0 -0
- package/lib/{ReanimatedModule.macos.js → src/ReanimatedModule.macos.js} +0 -0
- package/lib/{ReanimatedModule.native.js → src/ReanimatedModule.native.js} +0 -0
- package/lib/{ReanimatedModule.windows.js → src/ReanimatedModule.windows.js} +0 -0
- package/lib/{ReanimatedModuleCompat.js → src/ReanimatedModuleCompat.js} +0 -0
- package/lib/{__mocks__ → src/__mocks__}/ReanimatedEventEmitter.js +0 -0
- package/lib/{__mocks__ → src/__mocks__}/ReanimatedModule.native.js +0 -0
- package/lib/{createAnimatedComponent.js → src/createAnimatedComponent.js} +55 -37
- package/lib/src/index.js +31 -0
- package/lib/{reanimated1 → src/reanimated1}/Easing.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/SpringConfig.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/Transitioning.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/animations/Animation.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/animations/SpringUtils.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/animations/backwardCompatibleAnimWrapper.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/animations/decay.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/animations/spring.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/animations/timing.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/base.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/core/AnimatedAlways.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/core/AnimatedBezier.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/core/AnimatedBlock.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/core/AnimatedCall.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/core/AnimatedCallFunc.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/core/AnimatedClock.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/core/AnimatedClockTest.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/core/AnimatedCode.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/core/AnimatedConcat.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/core/AnimatedCond.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/core/AnimatedDebug.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/core/AnimatedEvent.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/core/AnimatedFunction.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/core/AnimatedNode.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/core/AnimatedOperator.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/core/AnimatedParam.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/core/AnimatedProps.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/core/AnimatedSet.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/core/AnimatedStartClock.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/core/AnimatedStopClock.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/core/AnimatedStyle.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/core/AnimatedTransform.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/core/AnimatedValue.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/core/Core.test.js +1 -1
- package/lib/{reanimated1 → src/reanimated1}/core/InternalAnimatedValue.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/core/__mocks__/AnimatedProps.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/core/createEventObjectProxyPolyfill.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/derived/__mocks__/evaluateOnce.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/derived/acc.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/derived/color.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/derived/diff.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/derived/diffClamp.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/derived/evaluateOnce.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/derived/index.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/derived/interpolate.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/derived/interpolateColors.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/derived/onChange.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/derived/useCode.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/index.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/operators.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/useValue.js +0 -0
- package/lib/{reanimated1 → src/reanimated1}/val.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/Bezier.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/Colors.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/Easing.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/NativeMethods.js +7 -0
- package/lib/{reanimated2 → src/reanimated2}/NativeReanimated/NativeReanimated.js +3 -0
- package/lib/{reanimated2 → src/reanimated2}/NativeReanimated/index.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/PlatformChecker.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/PropAdapters.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/UpdateProps.js +1 -1
- package/lib/{reanimated2 → src/reanimated2}/ViewDescriptorsSet.js +4 -2
- package/lib/{reanimated2 → src/reanimated2}/WorkletEventHandler.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/__mocks__/MutableValue.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/__mocks__/NativeReanimated.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/__mocks__/NativeReanimated.native.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/animation/commonTypes.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/animation/decay.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/animation/delay.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/animation/index.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/animation/repeat.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/animation/sequence.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/animation/spring.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/animation/styleAnimation.js +5 -0
- package/lib/{reanimated2 → src/reanimated2}/animation/timing.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/animation/util.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/commonTypes.js +0 -0
- package/lib/src/reanimated2/component/FlatList.js +30 -0
- package/lib/src/reanimated2/component/WrappedComponents.js +9 -0
- package/lib/src/reanimated2/component/index.js +4 -0
- package/lib/{reanimated2 → src/reanimated2}/core.js +27 -3
- package/lib/{reanimated2 → src/reanimated2}/globals.d.ts +5 -0
- package/lib/{reanimated2 → src/reanimated2}/hook/Hooks.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/hook/commonTypes.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/hook/index.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/hook/useAnimatedGestureHandler.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/hook/useAnimatedReaction.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/hook/useAnimatedRef.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/hook/useAnimatedScrollHandler.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/hook/useAnimatedStyle.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/hook/useDerivedValue.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/hook/useSharedValue.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/hook/utils.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/index.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/interpolation.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/jestUtils.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/js-reanimated/JSReanimated.js +3 -0
- package/lib/{reanimated2 → src/reanimated2}/js-reanimated/Mapper.js +4 -1
- package/lib/{reanimated2 → src/reanimated2}/js-reanimated/MapperRegistry.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/js-reanimated/MutableValue.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/js-reanimated/index.js +3 -0
- package/lib/{reanimated2 → src/reanimated2}/layoutReanimation/LayoutAnimationRepository.js +14 -5
- package/lib/{reanimated2 → src/reanimated2}/layoutReanimation/animationBuilder/BaseAnimationBuilder.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/layoutReanimation/animationBuilder/ComplexAnimationBuilder.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/layoutReanimation/animationBuilder/Keyframe.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/layoutReanimation/animationBuilder/commonTypes.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/layoutReanimation/animationBuilder/index.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/layoutReanimation/defaultAnimations/Bounce.js +0 -0
- package/lib/src/reanimated2/layoutReanimation/defaultAnimations/Default.js +36 -0
- package/lib/{reanimated2 → src/reanimated2}/layoutReanimation/defaultAnimations/Fade.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/layoutReanimation/defaultAnimations/Flip.js +8 -8
- package/lib/{reanimated2 → src/reanimated2}/layoutReanimation/defaultAnimations/Lightspeed.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/layoutReanimation/defaultAnimations/Pinwheel.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/layoutReanimation/defaultAnimations/Roll.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/layoutReanimation/defaultAnimations/Rotate.js +16 -16
- package/lib/{reanimated2 → src/reanimated2}/layoutReanimation/defaultAnimations/Slide.js +16 -16
- package/lib/{reanimated2 → src/reanimated2}/layoutReanimation/defaultAnimations/Stretch.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/layoutReanimation/defaultAnimations/Zoom.js +4 -4
- package/lib/{reanimated2 → src/reanimated2}/layoutReanimation/defaultAnimations/index.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/layoutReanimation/defaultTransitions/CurvedTransition.js +20 -8
- package/lib/{reanimated2 → src/reanimated2}/layoutReanimation/defaultTransitions/EntryExitTransition.js +3 -3
- package/lib/{reanimated2 → src/reanimated2}/layoutReanimation/defaultTransitions/FadingTransition.js +8 -8
- package/lib/{reanimated2 → src/reanimated2}/layoutReanimation/defaultTransitions/JumpingTransition.js +10 -10
- package/lib/{reanimated2 → src/reanimated2}/layoutReanimation/defaultTransitions/LinearTransition.js +8 -8
- package/lib/{reanimated2 → src/reanimated2}/layoutReanimation/defaultTransitions/SequencedTransition.js +8 -8
- package/lib/{reanimated2 → src/reanimated2}/layoutReanimation/defaultTransitions/index.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/layoutReanimation/index.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/mock.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/platform-specific/RNRenderer.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/platform-specific/RNRenderer.web.js +0 -0
- package/lib/{reanimated2 → src/reanimated2}/utils.js +0 -0
- package/lib/{setAndForwardRef.js → src/setAndForwardRef.js} +0 -0
- package/mock.js +1 -1
- package/package.json +4 -3
- package/plugin.js +10 -3
- package/react-native-reanimated.d.ts +40 -23
- package/src/Animated.js +11 -5
- package/src/createAnimatedComponent.tsx +86 -43
- package/src/reanimated1/core/Core.test.js +1 -1
- package/src/reanimated2/NativeMethods.ts +13 -1
- package/src/reanimated2/NativeReanimated/NativeReanimated.ts +4 -0
- package/src/reanimated2/UpdateProps.ts +1 -1
- package/src/reanimated2/ViewDescriptorsSet.ts +6 -2
- package/src/reanimated2/animation/styleAnimation.ts +9 -0
- package/src/reanimated2/component/FlatList.tsx +44 -0
- package/src/reanimated2/component/WrappedComponents.ts +11 -0
- package/src/reanimated2/component/index.ts +9 -0
- package/src/reanimated2/core.ts +38 -3
- package/src/reanimated2/globals.d.ts +5 -0
- package/src/reanimated2/js-reanimated/JSReanimated.ts +6 -0
- package/src/reanimated2/js-reanimated/Mapper.ts +3 -1
- package/src/reanimated2/js-reanimated/index.ts +5 -0
- package/src/reanimated2/layoutReanimation/LayoutAnimationRepository.ts +18 -5
- package/src/reanimated2/layoutReanimation/animationBuilder/commonTypes.ts +39 -20
- package/src/reanimated2/layoutReanimation/animationBuilder/index.ts +5 -1
- package/src/reanimated2/layoutReanimation/defaultAnimations/Default.ts +21 -15
- package/src/reanimated2/layoutReanimation/defaultAnimations/Flip.ts +29 -24
- package/src/reanimated2/layoutReanimation/defaultAnimations/Rotate.ts +61 -34
- package/src/reanimated2/layoutReanimation/defaultAnimations/Slide.ts +49 -34
- package/src/reanimated2/layoutReanimation/defaultAnimations/Zoom.ts +17 -12
- package/src/reanimated2/layoutReanimation/defaultTransitions/CurvedTransition.ts +20 -8
- package/src/reanimated2/layoutReanimation/defaultTransitions/EntryExitTransition.ts +9 -9
- package/src/reanimated2/layoutReanimation/defaultTransitions/FadingTransition.ts +8 -8
- package/src/reanimated2/layoutReanimation/defaultTransitions/JumpingTransition.ts +20 -14
- package/src/reanimated2/layoutReanimation/defaultTransitions/LinearTransition.ts +14 -8
- package/src/reanimated2/layoutReanimation/defaultTransitions/SequencedTransition.ts +24 -12
- package/lib/Animated.js +0 -25
- package/lib/index.js +0 -25
- package/lib/reanimated2/layoutReanimation/defaultAnimations/Default.js +0 -36
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -5,7 +5,7 @@ import renderer from 'react-test-renderer';
|
|
|
5
5
|
|
|
6
6
|
jest.mock('../../ReanimatedEventEmitter');
|
|
7
7
|
jest.mock('../../ReanimatedModule');
|
|
8
|
-
jest.mock('../../reanimated2/NativeReanimated');
|
|
8
|
+
jest.mock('../../reanimated2/NativeReanimated/NativeReanimated');
|
|
9
9
|
|
|
10
10
|
describe('Core Animated components', () => {
|
|
11
11
|
xit('fails if something other then a node or function that returns a node is passed to Animated.Code exec prop', () => {
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -23,3 +23,10 @@ export function scrollTo(animatedRef, x, y, animated) {
|
|
|
23
23
|
const viewTag = animatedRef();
|
|
24
24
|
_scrollTo(viewTag, x, y, animated);
|
|
25
25
|
}
|
|
26
|
+
export function setGestureState(handlerTag, newState) {
|
|
27
|
+
'worklet';
|
|
28
|
+
if (!_WORKLET && !isChromeDebugger()) {
|
|
29
|
+
console.warn('[Reanimated] You can not use setGestureState in non-worklet function.');
|
|
30
|
+
}
|
|
31
|
+
_setGestureState(handlerTag, newState);
|
|
32
|
+
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -19,7 +19,7 @@ export const colorProps = [
|
|
|
19
19
|
'textShadowColor',
|
|
20
20
|
'overlayColor',
|
|
21
21
|
];
|
|
22
|
-
const ColorProperties = !isConfigured() ? [] : makeShareable(colorProps);
|
|
22
|
+
export const ColorProperties = !isConfigured() ? [] : makeShareable(colorProps);
|
|
23
23
|
let updatePropsByPlatform;
|
|
24
24
|
if (shouldBeUseWeb()) {
|
|
25
25
|
updatePropsByPlatform = (_, updates, maybeViewRef) => {
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { useRef } from 'react';
|
|
2
2
|
import { makeMutable } from './core';
|
|
3
|
+
import { Platform } from 'react-native';
|
|
4
|
+
const scheduleUpdates = Platform.OS === 'web' ? requestAnimationFrame : setImmediate;
|
|
3
5
|
export function makeViewDescriptorsSet() {
|
|
4
6
|
const ref = useRef(null);
|
|
5
7
|
if (ref.current === null) {
|
|
@@ -18,7 +20,7 @@ export function makeViewDescriptorsSet() {
|
|
|
18
20
|
data.items.push(item);
|
|
19
21
|
if (!data.waitForInsertSync) {
|
|
20
22
|
data.waitForInsertSync = true;
|
|
21
|
-
|
|
23
|
+
scheduleUpdates(() => {
|
|
22
24
|
data.sharableViewDescriptors.value = data.items;
|
|
23
25
|
data.waitForInsertSync = false;
|
|
24
26
|
});
|
|
@@ -28,7 +30,7 @@ export function makeViewDescriptorsSet() {
|
|
|
28
30
|
data.batchToRemove.add(viewTag);
|
|
29
31
|
if (!data.waitForRemoveSync) {
|
|
30
32
|
data.waitForRemoveSync = true;
|
|
31
|
-
|
|
33
|
+
scheduleUpdates(() => {
|
|
32
34
|
const items = [];
|
|
33
35
|
for (const item of data.items) {
|
|
34
36
|
if (data.batchToRemove.has(item.tag)) {
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { defineAnimation } from './util';
|
|
2
2
|
import { withTiming } from './timing';
|
|
3
|
+
import { ColorProperties } from '../UpdateProps';
|
|
4
|
+
import { processColor } from '../Colors';
|
|
3
5
|
// resolves path to value for nested objects
|
|
4
6
|
// if path cannot be resolved returns undefined
|
|
5
7
|
export function resolvePath(obj, path) {
|
|
@@ -79,6 +81,9 @@ export function withStyleAnimation(styleAnimations) {
|
|
|
79
81
|
else {
|
|
80
82
|
stillGoing = true;
|
|
81
83
|
}
|
|
84
|
+
if (ColorProperties.includes(currentEntry.path[0])) {
|
|
85
|
+
currentStyleAnimation.current = processColor(currentStyleAnimation.current);
|
|
86
|
+
}
|
|
82
87
|
setPath(animation.current, currentEntry.path, currentStyleAnimation.current);
|
|
83
88
|
}
|
|
84
89
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import React from 'react';
|
|
13
|
+
import { FlatList } from 'react-native';
|
|
14
|
+
import WrappedComponents from './WrappedComponents';
|
|
15
|
+
import createAnimatedComponent from '../../createAnimatedComponent';
|
|
16
|
+
const AnimatedFlatList = createAnimatedComponent(FlatList);
|
|
17
|
+
const createCellRenderer = (itemLayoutAnimation) => {
|
|
18
|
+
const cellRenderer = (props) => {
|
|
19
|
+
return (<WrappedComponents.View layout={itemLayoutAnimation} onLayout={props.onLayout}>
|
|
20
|
+
{props.children}
|
|
21
|
+
</WrappedComponents.View>);
|
|
22
|
+
};
|
|
23
|
+
return cellRenderer;
|
|
24
|
+
};
|
|
25
|
+
const ReanimatedFlatlist = (_a) => {
|
|
26
|
+
var { itemLayoutAnimation } = _a, restProps = __rest(_a, ["itemLayoutAnimation"]);
|
|
27
|
+
const cellRenderer = React.useMemo(() => createCellRenderer(itemLayoutAnimation), []);
|
|
28
|
+
return (<AnimatedFlatList {...restProps} CellRendererComponent={cellRenderer}/>);
|
|
29
|
+
};
|
|
30
|
+
export default ReanimatedFlatlist;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Image, ScrollView, Text, View } from 'react-native';
|
|
2
|
+
import createAnimatedComponent from '../../createAnimatedComponent';
|
|
3
|
+
const WrappedComponents = {
|
|
4
|
+
View: createAnimatedComponent(View),
|
|
5
|
+
Text: createAnimatedComponent(Text),
|
|
6
|
+
Image: createAnimatedComponent(Image),
|
|
7
|
+
ScrollView: createAnimatedComponent(ScrollView),
|
|
8
|
+
};
|
|
9
|
+
export default WrappedComponents;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* global _WORKLET _getCurrentTime _frameTimestamp _eventTimestamp, _setGlobalConsole */
|
|
2
2
|
import NativeReanimatedModule from './NativeReanimated';
|
|
3
3
|
import { Platform } from 'react-native';
|
|
4
|
-
import { nativeShouldBeMock, shouldBeUseWeb } from './PlatformChecker';
|
|
4
|
+
import { nativeShouldBeMock, shouldBeUseWeb, isWeb } from './PlatformChecker';
|
|
5
5
|
global.__reanimatedWorkletInit = function (worklet) {
|
|
6
6
|
worklet.__worklet = true;
|
|
7
7
|
};
|
|
@@ -263,8 +263,8 @@ if (!NativeReanimatedModule.useOnlyV1) {
|
|
|
263
263
|
NativeReanimatedModule.installCoreFunctions(NativeReanimatedModule.native
|
|
264
264
|
? workletValueSetter
|
|
265
265
|
: workletValueSetterJS);
|
|
266
|
-
|
|
267
|
-
|
|
266
|
+
if (!isWeb() && isConfigured()) {
|
|
267
|
+
const capturableConsole = console;
|
|
268
268
|
runOnUI(() => {
|
|
269
269
|
'worklet';
|
|
270
270
|
const console = {
|
|
@@ -275,5 +275,29 @@ if (!NativeReanimatedModule.useOnlyV1) {
|
|
|
275
275
|
info: runOnJS(capturableConsole.info),
|
|
276
276
|
};
|
|
277
277
|
_setGlobalConsole(console);
|
|
278
|
+
if (global.performance == null) {
|
|
279
|
+
global.performance = {
|
|
280
|
+
now: global._chronoNow,
|
|
281
|
+
};
|
|
282
|
+
}
|
|
278
283
|
})();
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
let featuresConfig = {
|
|
287
|
+
enableLayoutAnimations: false,
|
|
288
|
+
setByUser: false,
|
|
289
|
+
};
|
|
290
|
+
export function enableLayoutAnimations(flag, isCallByUser = true) {
|
|
291
|
+
if (isCallByUser) {
|
|
292
|
+
featuresConfig = {
|
|
293
|
+
enableLayoutAnimations: flag,
|
|
294
|
+
setByUser: true,
|
|
295
|
+
};
|
|
296
|
+
NativeReanimatedModule.enableLayoutAnimations(flag);
|
|
297
|
+
}
|
|
298
|
+
else if (!featuresConfig.setByUser &&
|
|
299
|
+
featuresConfig.enableLayoutAnimations !== flag) {
|
|
300
|
+
featuresConfig.enableLayoutAnimations = flag;
|
|
301
|
+
NativeReanimatedModule.enableLayoutAnimations(flag);
|
|
302
|
+
}
|
|
279
303
|
}
|
|
@@ -13,6 +13,7 @@ declare global {
|
|
|
13
13
|
tag: number,
|
|
14
14
|
flag: { value: boolean; _value: boolean }
|
|
15
15
|
) => void;
|
|
16
|
+
const _setGestureState: (handlerTag: number, newState: number) => void;
|
|
16
17
|
const _updateProps: (
|
|
17
18
|
tag: number,
|
|
18
19
|
name: string,
|
|
@@ -25,16 +26,20 @@ declare global {
|
|
|
25
26
|
y: number,
|
|
26
27
|
animated: boolean
|
|
27
28
|
) => void;
|
|
29
|
+
const _chronoNow: () => number;
|
|
28
30
|
namespace NodeJS {
|
|
29
31
|
interface Global {
|
|
30
32
|
__reanimatedWorkletInit: (worklet: WorkletFunction) => void;
|
|
31
33
|
_setGlobalConsole: (console?: ReanimatedConsole) => void;
|
|
32
34
|
_log: (s: string) => void;
|
|
35
|
+
_setGestureState: () => void;
|
|
33
36
|
_WORKLET: boolean;
|
|
34
37
|
__reanimatedModuleProxy: NativeReanimated;
|
|
35
38
|
_frameTimestamp: number | null;
|
|
36
39
|
_measure: () => MeasuredDimensions;
|
|
37
40
|
_scrollTo: () => void;
|
|
41
|
+
_chronoNow: () => number;
|
|
42
|
+
performance: { now: () => number };
|
|
38
43
|
LayoutAnimationRepository: {
|
|
39
44
|
configs: Record<string, unknown>;
|
|
40
45
|
registerConfig(tag: number, config: Record<string, unknown>): void;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -21,7 +21,10 @@ export default class Mapper {
|
|
|
21
21
|
extractMutablesFromArray(array) {
|
|
22
22
|
const res = [];
|
|
23
23
|
function extractMutables(value) {
|
|
24
|
-
if (value
|
|
24
|
+
if (value == null) {
|
|
25
|
+
// return;
|
|
26
|
+
}
|
|
27
|
+
else if (value instanceof MutableValue) {
|
|
25
28
|
res.push(value);
|
|
26
29
|
}
|
|
27
30
|
else if (Array.isArray(value)) {
|
|
File without changes
|
|
File without changes
|
|
@@ -20,6 +20,9 @@ if (shouldBeUseWeb()) {
|
|
|
20
20
|
global._scrollTo = () => {
|
|
21
21
|
console.warn("[Reanimated] You can't use 'scrollTo' method with Chrome Debugger or with web version");
|
|
22
22
|
};
|
|
23
|
+
global._setGestureState = () => {
|
|
24
|
+
console.warn("[Reanimated] You can't use 'setGestureState' method with Chrome Debugger or with web version");
|
|
25
|
+
};
|
|
23
26
|
}
|
|
24
27
|
export const _updatePropsJS = (updates, viewRef) => {
|
|
25
28
|
if (viewRef._component) {
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
/* global _stopObservingProgress, _startObservingProgress */
|
|
2
2
|
import { runOnUI } from '../core';
|
|
3
3
|
import { withStyleAnimation } from '../animation/styleAnimation';
|
|
4
|
+
import { ColorProperties } from '../UpdateProps';
|
|
5
|
+
import { processColor } from '../Colors';
|
|
4
6
|
runOnUI(() => {
|
|
5
7
|
'worklet';
|
|
6
8
|
const configs = {};
|
|
@@ -34,12 +36,19 @@ runOnUI(() => {
|
|
|
34
36
|
for (const key in layoutAnimation) {
|
|
35
37
|
currentAnimation[key] = layoutAnimation[key];
|
|
36
38
|
}
|
|
37
|
-
enteringAnimationForTag[tag] = null;
|
|
38
39
|
}
|
|
39
40
|
const sv = configs[tag].sv;
|
|
40
41
|
_stopObservingProgress(tag, false);
|
|
41
42
|
_startObservingProgress(tag, sv);
|
|
42
|
-
|
|
43
|
+
const backupColor = {};
|
|
44
|
+
for (const key in style.initialValues) {
|
|
45
|
+
if (ColorProperties.includes(key)) {
|
|
46
|
+
const value = style.initialValues[key];
|
|
47
|
+
backupColor[key] = value;
|
|
48
|
+
style.initialValues[key] = processColor(value);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
sv.value = Object.assign({}, sv._value, style.initialValues);
|
|
43
52
|
_stopObservingProgress(tag, false);
|
|
44
53
|
const animation = withStyleAnimation(currentAnimation);
|
|
45
54
|
animation.callback = (finished) => {
|
|
@@ -47,10 +56,10 @@ runOnUI(() => {
|
|
|
47
56
|
_stopObservingProgress(tag, finished);
|
|
48
57
|
}
|
|
49
58
|
style.callback && style.callback(finished);
|
|
50
|
-
if (type === 'entering') {
|
|
51
|
-
enteringAnimationForTag[tag] = null;
|
|
52
|
-
}
|
|
53
59
|
};
|
|
60
|
+
if (backupColor) {
|
|
61
|
+
configs[tag].sv._value = Object.assign(Object.assign({}, configs[tag].sv.value), backupColor);
|
|
62
|
+
}
|
|
54
63
|
configs[tag].sv.value = animation;
|
|
55
64
|
_startObservingProgress(tag, sv);
|
|
56
65
|
},
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/lib/{reanimated2 → src/reanimated2}/layoutReanimation/animationBuilder/commonTypes.js
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export const DefaultLayout = (values) => {
|
|
2
|
+
'worklet';
|
|
3
|
+
return {
|
|
4
|
+
initialValues: {
|
|
5
|
+
originX: values.targetOriginX,
|
|
6
|
+
originY: values.targetOriginY,
|
|
7
|
+
width: values.targetWidth,
|
|
8
|
+
height: values.targetHeight,
|
|
9
|
+
},
|
|
10
|
+
animations: {},
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
export const DefaultEntering = (values) => {
|
|
14
|
+
'worklet';
|
|
15
|
+
return {
|
|
16
|
+
initialValues: {
|
|
17
|
+
originX: values.targetOriginX,
|
|
18
|
+
originY: values.targetOriginY,
|
|
19
|
+
width: values.targetWidth,
|
|
20
|
+
height: values.targetHeight,
|
|
21
|
+
},
|
|
22
|
+
animations: {},
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
export const DefaultExiting = (values) => {
|
|
26
|
+
'worklet';
|
|
27
|
+
return {
|
|
28
|
+
initialValues: {
|
|
29
|
+
originX: values.currentOriginX,
|
|
30
|
+
originY: values.currentOriginY,
|
|
31
|
+
width: values.currentWidth,
|
|
32
|
+
height: values.currentHeight,
|
|
33
|
+
},
|
|
34
|
+
animations: {},
|
|
35
|
+
};
|
|
36
|
+
};
|
|
File without changes
|
|
@@ -14,7 +14,7 @@ export class FlipInXUp extends ComplexAnimationBuilder {
|
|
|
14
14
|
transform: [
|
|
15
15
|
{ perspective: 500 },
|
|
16
16
|
{ rotateX: '90deg' },
|
|
17
|
-
{ translateY: -targetValues.
|
|
17
|
+
{ translateY: -targetValues.targetHeight },
|
|
18
18
|
],
|
|
19
19
|
},
|
|
20
20
|
animations: {
|
|
@@ -48,7 +48,7 @@ export class FlipInYLeft extends ComplexAnimationBuilder {
|
|
|
48
48
|
transform: [
|
|
49
49
|
{ perspective: 500 },
|
|
50
50
|
{ rotateY: '-90deg' },
|
|
51
|
-
{ translateX: -targetValues.
|
|
51
|
+
{ translateX: -targetValues.targetWidth },
|
|
52
52
|
],
|
|
53
53
|
},
|
|
54
54
|
animations: {
|
|
@@ -82,7 +82,7 @@ export class FlipInXDown extends ComplexAnimationBuilder {
|
|
|
82
82
|
transform: [
|
|
83
83
|
{ perspective: 500 },
|
|
84
84
|
{ rotateX: '-90deg' },
|
|
85
|
-
{ translateY: targetValues.
|
|
85
|
+
{ translateY: targetValues.targetHeight },
|
|
86
86
|
],
|
|
87
87
|
},
|
|
88
88
|
animations: {
|
|
@@ -116,7 +116,7 @@ export class FlipInYRight extends ComplexAnimationBuilder {
|
|
|
116
116
|
transform: [
|
|
117
117
|
{ perspective: 500 },
|
|
118
118
|
{ rotateY: '90deg' },
|
|
119
|
-
{ translateX: targetValues.
|
|
119
|
+
{ translateX: targetValues.targetWidth },
|
|
120
120
|
],
|
|
121
121
|
},
|
|
122
122
|
animations: {
|
|
@@ -216,7 +216,7 @@ export class FlipOutXUp extends ComplexAnimationBuilder {
|
|
|
216
216
|
{ perspective: delayFunction(delay, animation(500, config)) },
|
|
217
217
|
{ rotateX: delayFunction(delay, animation('90deg', config)) },
|
|
218
218
|
{
|
|
219
|
-
translateY: delayFunction(delay, animation(-targetValues.
|
|
219
|
+
translateY: delayFunction(delay, animation(-targetValues.currentHeight, config)),
|
|
220
220
|
},
|
|
221
221
|
],
|
|
222
222
|
},
|
|
@@ -252,7 +252,7 @@ export class FlipOutYLeft extends ComplexAnimationBuilder {
|
|
|
252
252
|
{ perspective: delayFunction(delay, animation(500, config)) },
|
|
253
253
|
{ rotateY: delayFunction(delay, animation('-90deg', config)) },
|
|
254
254
|
{
|
|
255
|
-
translateX: delayFunction(delay, animation(-targetValues.
|
|
255
|
+
translateX: delayFunction(delay, animation(-targetValues.currentWidth, config)),
|
|
256
256
|
},
|
|
257
257
|
],
|
|
258
258
|
},
|
|
@@ -288,7 +288,7 @@ export class FlipOutXDown extends ComplexAnimationBuilder {
|
|
|
288
288
|
{ perspective: delayFunction(delay, animation(500, config)) },
|
|
289
289
|
{ rotateX: delayFunction(delay, animation('-90deg', config)) },
|
|
290
290
|
{
|
|
291
|
-
translateY: delayFunction(delay, animation(targetValues.
|
|
291
|
+
translateY: delayFunction(delay, animation(targetValues.currentHeight, config)),
|
|
292
292
|
},
|
|
293
293
|
],
|
|
294
294
|
},
|
|
@@ -324,7 +324,7 @@ export class FlipOutYRight extends ComplexAnimationBuilder {
|
|
|
324
324
|
{ perspective: delayFunction(delay, animation(500, config)) },
|
|
325
325
|
{ rotateY: delayFunction(delay, animation('90deg', config)) },
|
|
326
326
|
{
|
|
327
|
-
translateX: delayFunction(delay, animation(targetValues.
|
|
327
|
+
translateX: delayFunction(delay, animation(targetValues.currentWidth, config)),
|
|
328
328
|
},
|
|
329
329
|
],
|
|
330
330
|
},
|
package/lib/{reanimated2 → src/reanimated2}/layoutReanimation/defaultAnimations/Lightspeed.js
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|