react-native-reanimated 2.9.1 → 2.10.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/Common/cpp/AnimatedSensor/AnimatedSensorModule.cpp +4 -4
- package/Common/cpp/NativeModules/NativeReanimatedModule.cpp +38 -0
- package/Common/cpp/NativeModules/NativeReanimatedModuleSpec.cpp +23 -0
- package/Common/cpp/headers/NativeModules/NativeReanimatedModule.h +8 -0
- package/Common/cpp/headers/NativeModules/NativeReanimatedModuleSpec.h +8 -0
- package/Common/cpp/headers/Tools/PlatformDepMethodsHolder.h +5 -0
- package/RNReanimated.podspec +22 -3
- package/android/.gradle/7.2/dependencies-accessors/dependencies-accessors.lock +0 -0
- package/android/.gradle/7.2/executionHistory/executionHistory.bin +0 -0
- package/android/.gradle/7.2/executionHistory/executionHistory.lock +0 -0
- package/android/.gradle/7.2/fileHashes/fileHashes.bin +0 -0
- package/android/.gradle/7.2/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/7.2/fileHashes/resourceHashesCache.bin +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +1 -1
- package/android/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
- package/android/.gradle/checksums/checksums.lock +0 -0
- package/android/.gradle/checksums/md5-checksums.bin +0 -0
- package/android/.gradle/checksums/sha1-checksums.bin +0 -0
- package/android/CMakeLists.txt +214 -95
- package/android/build.gradle +247 -236
- 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/android/react-native-reanimated-68-hermes.aar +0 -0
- package/android/react-native-reanimated-68-jsc.aar +0 -0
- package/android/react-native-reanimated-69-hermes.aar +0 -0
- package/android/react-native-reanimated-69-jsc.aar +0 -0
- package/android/react-native-reanimated-70-hermes.aar +0 -0
- package/android/react-native-reanimated-70-jsc.aar +0 -0
- package/{lib/types/lib/reanimated2/platform-specific/RNRenderer.web.d.ts → android/rnVersionPatch/70/.gitkeep} +0 -0
- package/android/src/main/cpp/NativeProxy.cpp +54 -20
- package/android/src/main/cpp/OnLoad.cpp +1 -0
- package/android/src/main/cpp/headers/NativeProxy.h +29 -0
- package/android/src/main/java/com/swmansion/reanimated/NativeProxy.java +25 -0
- package/android/src/main/java/com/swmansion/reanimated/NodesManager.java +3 -1
- package/android/src/main/java/com/swmansion/reanimated/keyboardObserver/ReanimatedKeyboardEventListener.java +165 -0
- package/android/src/main/java/com/swmansion/reanimated/layoutReanimation/AnimationsManager.java +19 -16
- package/android/src/main/java/com/swmansion/reanimated/sensor/ReanimatedSensor.java +5 -1
- package/android/src/main/java/com/swmansion/reanimated/sensor/ReanimatedSensorType.java +1 -1
- package/ios/REANodesManager.m +31 -8
- package/ios/keyboardObserver/REAKeyboardEventObserver.h +17 -0
- package/ios/keyboardObserver/REAKeyboardEventObserver.m +198 -0
- package/ios/native/NativeProxy.mm +20 -1
- package/ios/native/REAInitializer.mm +8 -12
- package/ios/sensor/ReanimatedSensor.m +26 -17
- package/lib/index.js +11 -3
- package/lib/index.web.js +4 -0
- package/lib/reanimated2/Colors.js +1 -1
- package/lib/reanimated2/NativeMethods.js +3 -0
- package/lib/reanimated2/NativeReanimated/NativeReanimated.js +6 -0
- package/lib/reanimated2/animation/util.js +4 -1
- package/lib/reanimated2/commonTypes.js +8 -1
- package/lib/reanimated2/component/FlatList.js +5 -5
- package/lib/reanimated2/core.js +5 -4
- package/lib/reanimated2/frameCallback/FrameCallbackRegistryJS.js +32 -0
- package/lib/reanimated2/frameCallback/FrameCallbackRegistryUI.js +47 -0
- package/lib/reanimated2/globals.d.ts +3 -0
- package/lib/reanimated2/hook/index.js +2 -0
- package/lib/reanimated2/hook/useAnimatedKeyboard.js +31 -0
- package/lib/reanimated2/hook/useAnimatedSensor.js +3 -3
- package/lib/reanimated2/hook/useFrameCallback.js +23 -0
- package/lib/reanimated2/jestUtils.js +11 -3
- package/lib/reanimated2/js-reanimated/JSReanimated.js +7 -0
- package/lib/reanimated2/js-reanimated/global.js +33 -22
- package/lib/reanimated2/layoutReanimation/LayoutAnimationRepository.js +1 -1
- package/lib/types/{lib/Animated.d.ts → Animated.d.ts} +0 -0
- package/lib/types/{lib/ConfigHelper.d.ts → ConfigHelper.d.ts} +0 -0
- package/lib/types/{lib/ReanimatedEventEmitter.d.ts → ReanimatedEventEmitter.d.ts} +0 -0
- package/lib/types/{lib/ReanimatedModule.d.ts → ReanimatedModule.d.ts} +0 -0
- package/lib/types/{lib/ReanimatedModule.macos.d.ts → ReanimatedModule.macos.d.ts} +0 -0
- package/lib/types/{lib/ReanimatedModule.native.d.ts → ReanimatedModule.native.d.ts} +0 -0
- package/lib/types/{lib/ReanimatedModule.windows.d.ts → ReanimatedModule.windows.d.ts} +0 -0
- package/lib/types/{lib/ReanimatedModuleCompat.d.ts → ReanimatedModuleCompat.d.ts} +0 -0
- package/lib/types/{lib/createAnimatedComponent.d.ts → createAnimatedComponent.d.ts} +0 -0
- package/lib/types/index.d.ts +4 -0
- package/lib/types/{lib/index.d.ts → index.web.d.ts} +0 -1
- package/lib/types/{lib/reanimated2 → reanimated2}/Bezier.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/Colors.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/Easing.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/NativeMethods.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/NativeReanimated/NativeReanimated.d.ts +3 -1
- package/lib/types/{lib/reanimated2 → reanimated2}/NativeReanimated/index.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/PlatformChecker.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/PropAdapters.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/UpdateProps.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/ViewDescriptorsSet.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/WorkletEventHandler.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/__mocks__/MutableValue.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/__mocks__/NativeReanimated.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/__mocks__/NativeReanimated.native.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/animation/commonTypes.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/animation/decay.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/animation/delay.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/animation/index.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/animation/repeat.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/animation/sequence.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/animation/spring.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/animation/styleAnimation.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/animation/timing.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/animation/util.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/commonTypes.d.ts +12 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/component/FlatList.d.ts +2 -2
- package/lib/types/{lib/reanimated2 → reanimated2}/component/Image.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/component/ScrollView.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/component/Text.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/component/View.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/core.d.ts +0 -0
- package/lib/types/reanimated2/frameCallback/FrameCallbackRegistryJS.d.ts +7 -0
- package/lib/types/reanimated2/frameCallback/FrameCallbackRegistryUI.d.ts +10 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/hook/Hooks.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/hook/commonTypes.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/hook/index.d.ts +3 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/hook/useAnimatedGestureHandler.d.ts +0 -0
- package/lib/types/reanimated2/hook/useAnimatedKeyboard.d.ts +2 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/hook/useAnimatedReaction.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/hook/useAnimatedRef.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/hook/useAnimatedScrollHandler.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/hook/useAnimatedSensor.d.ts +1 -1
- package/lib/types/{lib/reanimated2 → reanimated2}/hook/useAnimatedStyle.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/hook/useDerivedValue.d.ts +0 -0
- package/lib/types/reanimated2/hook/useFrameCallback.d.ts +6 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/hook/useSharedValue.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/hook/utils.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/index.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/interpolateColor.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/interpolation.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/jestUtils.d.ts +1 -1
- package/lib/types/{lib/reanimated2 → reanimated2}/js-reanimated/JSReanimated.d.ts +3 -1
- package/lib/types/{lib/reanimated2 → reanimated2}/js-reanimated/Mapper.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/js-reanimated/MapperRegistry.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/js-reanimated/MutableValue.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/js-reanimated/commonTypes.d.ts +0 -0
- package/lib/types/reanimated2/js-reanimated/global.d.ts +2 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/js-reanimated/index.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/LayoutAnimationRepository.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/animationBuilder/BaseAnimationBuilder.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/animationBuilder/ComplexAnimationBuilder.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/animationBuilder/Keyframe.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/animationBuilder/commonTypes.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/animationBuilder/index.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/defaultAnimations/Bounce.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/defaultAnimations/Default.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/defaultAnimations/Fade.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/defaultAnimations/Flip.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/defaultAnimations/Lightspeed.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/defaultAnimations/Pinwheel.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/defaultAnimations/Roll.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/defaultAnimations/Rotate.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/defaultAnimations/Slide.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/defaultAnimations/Stretch.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/defaultAnimations/Zoom.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/defaultAnimations/index.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/defaultTransitions/CurvedTransition.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/defaultTransitions/EntryExitTransition.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/defaultTransitions/FadingTransition.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/defaultTransitions/JumpingTransition.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/defaultTransitions/LinearTransition.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/defaultTransitions/SequencedTransition.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/defaultTransitions/index.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/index.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/mock.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/platform-specific/RNRenderer.d.ts +0 -0
- package/lib/types/reanimated2/platform-specific/RNRenderer.web.d.ts +0 -0
- package/lib/types/{lib/reanimated2 → reanimated2}/utils.d.ts +0 -0
- package/lib/types/{lib/setAndForwardRef.d.ts → setAndForwardRef.d.ts} +0 -0
- package/mock.js +1 -0
- package/package.json +5 -6
- package/plugin.js +7 -16
- package/react-native-reanimated.d.ts +55 -4
- package/src/index.ts +11 -3
- package/src/index.web.ts +5 -0
- package/src/reanimated2/Colors.ts +1 -1
- package/src/reanimated2/NativeMethods.ts +5 -0
- package/src/reanimated2/NativeReanimated/NativeReanimated.ts +9 -0
- package/src/reanimated2/animation/util.ts +8 -1
- package/src/reanimated2/commonTypes.ts +15 -0
- package/src/reanimated2/component/FlatList.tsx +29 -19
- package/src/reanimated2/core.ts +8 -8
- package/src/reanimated2/frameCallback/FrameCallbackRegistryJS.ts +43 -0
- package/src/reanimated2/frameCallback/FrameCallbackRegistryUI.ts +64 -0
- package/src/reanimated2/globals.d.ts +3 -0
- package/src/reanimated2/hook/index.ts +3 -0
- package/src/reanimated2/hook/useAnimatedKeyboard.ts +35 -0
- package/src/reanimated2/hook/useAnimatedSensor.ts +5 -5
- package/src/reanimated2/hook/useFrameCallback.ts +39 -0
- package/src/reanimated2/jestUtils.ts +11 -3
- package/src/reanimated2/js-reanimated/JSReanimated.ts +16 -1
- package/src/reanimated2/js-reanimated/global.ts +41 -29
- package/src/reanimated2/layoutReanimation/LayoutAnimationRepository.ts +1 -1
- package/android/react-native-reanimated-65-hermes.aar +0 -0
- package/android/react-native-reanimated-65-jsc.aar +0 -0
- package/lib/types/lib/reanimated2/js-reanimated/global.d.ts +0 -1
- package/lib/types/react-native-reanimated-tests.d.ts +0 -1
|
@@ -127,9 +127,9 @@ const tickTravel = () => {
|
|
|
127
127
|
currentTimestamp += frameTime;
|
|
128
128
|
jest.advanceTimersByTime(frameTime);
|
|
129
129
|
};
|
|
130
|
-
export const withReanimatedTimer = (
|
|
130
|
+
export const withReanimatedTimer = (animationTest) => {
|
|
131
131
|
beforeTest();
|
|
132
|
-
|
|
132
|
+
animationTest();
|
|
133
133
|
afterTest();
|
|
134
134
|
};
|
|
135
135
|
export const advanceAnimationByTime = (time = frameTime) => {
|
|
@@ -145,7 +145,15 @@ export const advanceAnimationByFrame = (count) => {
|
|
|
145
145
|
jest.advanceTimersByTime(frameTime);
|
|
146
146
|
};
|
|
147
147
|
export const setUpTests = (userConfig = {}) => {
|
|
148
|
-
|
|
148
|
+
let expect;
|
|
149
|
+
try {
|
|
150
|
+
expect = require('expect');
|
|
151
|
+
}
|
|
152
|
+
catch (_) {
|
|
153
|
+
// for Jest in version 28+
|
|
154
|
+
const { expect: expectModule } = require('@jest/globals');
|
|
155
|
+
expect = expectModule;
|
|
156
|
+
}
|
|
149
157
|
require('setimmediate');
|
|
150
158
|
frameTime = Math.round(1000 / config.fps);
|
|
151
159
|
config = Object.assign(Object.assign({}, config), userConfig);
|
|
@@ -96,4 +96,11 @@ export default class JSReanimated extends NativeReanimated {
|
|
|
96
96
|
throw Error('This method can be only use in Jest testing.');
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
|
+
subscribeForKeyboardEvents(_) {
|
|
100
|
+
console.warn('[Reanimated] useAnimatedKeyboard is not available on web yet.');
|
|
101
|
+
return -1;
|
|
102
|
+
}
|
|
103
|
+
unsubscribeFromKeyboardEvents(_) {
|
|
104
|
+
// noop
|
|
105
|
+
}
|
|
99
106
|
}
|
|
@@ -1,25 +1,36 @@
|
|
|
1
1
|
// In order to keep bundle size down, we treat this file as a polyfill for Web.
|
|
2
2
|
import { shouldBeUseWeb } from '../PlatformChecker';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
global._measure = () => {
|
|
9
|
-
console.warn("[Reanimated] You can't use `measure` with Chrome Debugger or with web version");
|
|
10
|
-
return {
|
|
11
|
-
x: 0,
|
|
12
|
-
y: 0,
|
|
13
|
-
width: 0,
|
|
14
|
-
height: 0,
|
|
15
|
-
pageX: 0,
|
|
16
|
-
pageY: 0,
|
|
3
|
+
const initializeGlobalsForWeb = () => {
|
|
4
|
+
if (shouldBeUseWeb()) {
|
|
5
|
+
global._frameTimestamp = null;
|
|
6
|
+
global._setGlobalConsole = (_val) => {
|
|
7
|
+
// noop
|
|
17
8
|
};
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
9
|
+
global._measure = () => {
|
|
10
|
+
console.warn("[Reanimated] You can't use `measure` with Chrome Debugger or with web version");
|
|
11
|
+
return {
|
|
12
|
+
x: 0,
|
|
13
|
+
y: 0,
|
|
14
|
+
width: 0,
|
|
15
|
+
height: 0,
|
|
16
|
+
pageX: 0,
|
|
17
|
+
pageY: 0,
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
global._scrollTo = () => {
|
|
21
|
+
console.warn("[Reanimated] You can't use `scrollTo` with Chrome Debugger or with web version");
|
|
22
|
+
};
|
|
23
|
+
global._setGestureState = () => {
|
|
24
|
+
console.warn("[Reanimated] You can't use `setGestureState` with Chrome Debugger or with web version");
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
return true;
|
|
28
|
+
};
|
|
29
|
+
/*
|
|
30
|
+
If a file doesn't export anything, tree shaking doesn't pack
|
|
31
|
+
it into the JS bundle. In effect, the code inside of this file
|
|
32
|
+
will never execute. That is why we wrapped initialization code
|
|
33
|
+
into a function, and we call this one during creating
|
|
34
|
+
the module export object.
|
|
35
|
+
*/
|
|
36
|
+
export default initializeGlobalsForWeb();
|
|
@@ -5,7 +5,7 @@ import { ColorProperties } from '../UpdateProps';
|
|
|
5
5
|
import { processColor } from '../Colors';
|
|
6
6
|
runOnUI(() => {
|
|
7
7
|
'worklet';
|
|
8
|
-
const configs =
|
|
8
|
+
const configs = Object.create(null);
|
|
9
9
|
const enteringAnimationForTag = {};
|
|
10
10
|
global.LayoutAnimationRepository = {
|
|
11
11
|
configs,
|
|
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
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SharedValue, SensorValue3D, SensorValueRotation } from '../commonTypes';
|
|
1
|
+
import { SharedValue, SensorValue3D, SensorValueRotation, AnimatedKeyboardInfo } from '../commonTypes';
|
|
2
2
|
import { Descriptor } from '../hook/commonTypes';
|
|
3
3
|
export declare class NativeReanimated {
|
|
4
4
|
native: boolean;
|
|
@@ -17,4 +17,6 @@ export declare class NativeReanimated {
|
|
|
17
17
|
getViewProp<T>(viewTag: string, propName: string, callback?: (result: T) => void): Promise<T>;
|
|
18
18
|
enableLayoutAnimations(flag: boolean): void;
|
|
19
19
|
configureProps(uiProps: string[], nativeProps: string[]): void;
|
|
20
|
+
subscribeForKeyboardEvents(keyboardEventData: AnimatedKeyboardInfo): number;
|
|
21
|
+
unsubscribeFromKeyboardEvents(listenerId: number): void;
|
|
20
22
|
}
|
|
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
|
|
@@ -77,3 +77,15 @@ export declare type ValueRotation = {
|
|
|
77
77
|
roll: number;
|
|
78
78
|
};
|
|
79
79
|
export declare type SensorValueRotation = SharedValue<ValueRotation>;
|
|
80
|
+
export declare type ShadowNodeWrapper = object;
|
|
81
|
+
export declare enum KeyboardState {
|
|
82
|
+
UNKNOWN = 0,
|
|
83
|
+
OPENING = 1,
|
|
84
|
+
OPEN = 2,
|
|
85
|
+
CLOSING = 3,
|
|
86
|
+
CLOSED = 4
|
|
87
|
+
}
|
|
88
|
+
export declare type AnimatedKeyboardInfo = {
|
|
89
|
+
height: SharedValue<number>;
|
|
90
|
+
state: SharedValue<KeyboardState>;
|
|
91
|
+
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { FlatListProps } from 'react-native';
|
|
3
3
|
import { ILayoutAnimationBuilder } from '../layoutReanimation/animationBuilder/commonTypes';
|
|
4
|
-
export interface
|
|
4
|
+
export interface ReanimatedFlatListProps<ItemT> extends FlatListProps<ItemT> {
|
|
5
5
|
itemLayoutAnimation?: ILayoutAnimationBuilder;
|
|
6
6
|
}
|
|
7
|
-
declare type ReanimatedFlatListFC<T = any> = React.FC<
|
|
7
|
+
declare type ReanimatedFlatListFC<T = any> = React.FC<ReanimatedFlatListProps<T>>;
|
|
8
8
|
declare const ReanimatedFlatlist: ReanimatedFlatListFC;
|
|
9
9
|
export default ReanimatedFlatlist;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export default class FrameCallbackRegistryJS {
|
|
2
|
+
private nextCallbackId;
|
|
3
|
+
constructor();
|
|
4
|
+
registerFrameCallback(callback: () => void): number;
|
|
5
|
+
unregisterFrameCallback(frameCallbackId: number): void;
|
|
6
|
+
manageStateFrameCallback(frameCallbackId: number, state: boolean): void;
|
|
7
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export default interface FrameCallbackRegistryUI {
|
|
2
|
+
frameCallbackRegistry: Map<number, () => void>;
|
|
3
|
+
frameCallbackActive: Set<number>;
|
|
4
|
+
isFrameCallbackRunning: boolean;
|
|
5
|
+
runCallbacks: () => void;
|
|
6
|
+
registerFrameCallback: (callback: () => void, callbackId: number) => void;
|
|
7
|
+
unregisterFrameCallback: (frameCallbackId: number) => void;
|
|
8
|
+
manageStateFrameCallback: (frameCallbackId: number, state: boolean) => void;
|
|
9
|
+
}
|
|
10
|
+
export declare const prepareUIRegistry: () => void;
|
|
File without changes
|
|
File without changes
|
|
@@ -8,3 +8,6 @@ export { useAnimatedRef } from './useAnimatedRef';
|
|
|
8
8
|
export { useAnimatedScrollHandler, ScrollHandler, ScrollHandlers, } from './useAnimatedScrollHandler';
|
|
9
9
|
export { useDerivedValue, DerivedValue } from './useDerivedValue';
|
|
10
10
|
export { useAnimatedSensor, SensorType } from './useAnimatedSensor';
|
|
11
|
+
export { useFrameCallback } from './useFrameCallback';
|
|
12
|
+
export type { FrameCallback } from './useFrameCallback';
|
|
13
|
+
export { useAnimatedKeyboard } from './useAnimatedKeyboard';
|
|
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
|
|
@@ -5,7 +5,7 @@ declare global {
|
|
|
5
5
|
}
|
|
6
6
|
}
|
|
7
7
|
}
|
|
8
|
-
export declare const withReanimatedTimer: (
|
|
8
|
+
export declare const withReanimatedTimer: (animationTest: any) => void;
|
|
9
9
|
export declare const advanceAnimationByTime: (time?: number) => void;
|
|
10
10
|
export declare const advanceAnimationByFrame: (count: any) => void;
|
|
11
11
|
export declare const setUpTests: (userConfig?: {}) => void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import MapperRegistry from './MapperRegistry';
|
|
2
2
|
import MutableValue from './MutableValue';
|
|
3
3
|
import { NativeReanimated } from '../NativeReanimated/NativeReanimated';
|
|
4
|
-
import { Timestamp, NestedObjectValues } from '../commonTypes';
|
|
4
|
+
import { Timestamp, NestedObjectValues, AnimatedKeyboardInfo } from '../commonTypes';
|
|
5
5
|
export default class JSReanimated extends NativeReanimated {
|
|
6
6
|
_valueSetter?: <T>(value: T) => void;
|
|
7
7
|
_renderRequested: boolean;
|
|
@@ -27,4 +27,6 @@ export default class JSReanimated extends NativeReanimated {
|
|
|
27
27
|
registerSensor(): number;
|
|
28
28
|
unregisterSensor(): void;
|
|
29
29
|
jestResetModule(): void;
|
|
30
|
+
subscribeForKeyboardEvents(_: AnimatedKeyboardInfo): number;
|
|
31
|
+
unsubscribeFromKeyboardEvents(_: number): void;
|
|
30
32
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/LayoutAnimationRepository.d.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/animationBuilder/Keyframe.d.ts
RENAMED
|
File without changes
|
|
File without changes
|
package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/animationBuilder/index.d.ts
RENAMED
|
File without changes
|
package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/defaultAnimations/Bounce.d.ts
RENAMED
|
File without changes
|
package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/defaultAnimations/Default.d.ts
RENAMED
|
File without changes
|
package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/defaultAnimations/Fade.d.ts
RENAMED
|
File without changes
|
package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/defaultAnimations/Flip.d.ts
RENAMED
|
File without changes
|
|
File without changes
|
package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/defaultAnimations/Pinwheel.d.ts
RENAMED
|
File without changes
|
package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/defaultAnimations/Roll.d.ts
RENAMED
|
File without changes
|
package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/defaultAnimations/Rotate.d.ts
RENAMED
|
File without changes
|
package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/defaultAnimations/Slide.d.ts
RENAMED
|
File without changes
|
package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/defaultAnimations/Stretch.d.ts
RENAMED
|
File without changes
|
package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/defaultAnimations/Zoom.d.ts
RENAMED
|
File without changes
|
package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/defaultAnimations/index.d.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/lib/types/{lib/reanimated2 → reanimated2}/layoutReanimation/defaultTransitions/index.d.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/mock.js
CHANGED
package/package.json
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-reanimated",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.10.0",
|
|
4
4
|
"description": "More powerful alternative to Animated library for React Native.",
|
|
5
5
|
"scripts": {
|
|
6
|
-
"start": "node node_modules/react-native/local-cli/cli.js start",
|
|
7
6
|
"test": "yarn run format:js && yarn run lint:js && yarn run test:unit",
|
|
8
7
|
"test:unit": "jest",
|
|
9
8
|
"lint": "yarn lint:js && yarn lint:cpp && yarn lint:java",
|
|
@@ -74,7 +73,6 @@
|
|
|
74
73
|
},
|
|
75
74
|
"homepage": "https://github.com/software-mansion/react-native-reanimated#readme",
|
|
76
75
|
"dependencies": {
|
|
77
|
-
"@babel/plugin-proposal-export-namespace-from": "^7.17.12",
|
|
78
76
|
"@babel/plugin-transform-object-assign": "^7.16.7",
|
|
79
77
|
"@babel/preset-typescript": "^7.16.7",
|
|
80
78
|
"@types/invariant": "^2.2.35",
|
|
@@ -102,7 +100,7 @@
|
|
|
102
100
|
"@types/babel__generator": "^7.6.4",
|
|
103
101
|
"@types/babel__traverse": "^7.14.2",
|
|
104
102
|
"@types/jest": "^27.4.0",
|
|
105
|
-
"@types/react-native": "^0.
|
|
103
|
+
"@types/react-native": "^0.69.5",
|
|
106
104
|
"@typescript-eslint/eslint-plugin": "^5.11.0",
|
|
107
105
|
"@typescript-eslint/parser": "^5.11.0",
|
|
108
106
|
"babel-eslint": "^10.1.0",
|
|
@@ -122,8 +120,9 @@
|
|
|
122
120
|
"lint-staged": "^11.2.0",
|
|
123
121
|
"madge": "^5.0.1",
|
|
124
122
|
"prettier": "^2.5.1",
|
|
125
|
-
"react": "
|
|
126
|
-
"react-native": "0.
|
|
123
|
+
"react": "17.0.2",
|
|
124
|
+
"react-native": "0.70.0-rc.3",
|
|
125
|
+
"react-native-builder-bob": "^0.18.3",
|
|
127
126
|
"react-native-codegen": "^0.0.7",
|
|
128
127
|
"react-native-gesture-handler": "^1.6.1",
|
|
129
128
|
"react-test-renderer": "18.0.0",
|
package/plugin.js
CHANGED
|
@@ -7,6 +7,7 @@ const { transformSync } = require('@babel/core');
|
|
|
7
7
|
* holds a map of function names as keys and array of argument indexes as values which should be automatically workletized(they have to be functions)(starting from 0)
|
|
8
8
|
*/
|
|
9
9
|
const functionArgsToWorkletize = new Map([
|
|
10
|
+
['useFrameCallback', [0]],
|
|
10
11
|
['useAnimatedStyle', [0]],
|
|
11
12
|
['useAnimatedProps', [0]],
|
|
12
13
|
['createAnimatedPropAdapter', [0]],
|
|
@@ -305,13 +306,14 @@ function buildWorkletString(t, fun, closureVariables, name) {
|
|
|
305
306
|
},
|
|
306
307
|
});
|
|
307
308
|
|
|
309
|
+
const expression = fun.program.body.find(
|
|
310
|
+
({ type }) => type === 'ExpressionStatement'
|
|
311
|
+
).expression;
|
|
312
|
+
|
|
308
313
|
const workletFunction = t.functionExpression(
|
|
309
314
|
t.identifier(name),
|
|
310
|
-
|
|
311
|
-
prependClosureVariablesIfNecessary(
|
|
312
|
-
closureVariables,
|
|
313
|
-
fun.program.body[0].expression.body
|
|
314
|
-
)
|
|
315
|
+
expression.params,
|
|
316
|
+
prependClosureVariablesIfNecessary(closureVariables, expression.body)
|
|
315
317
|
);
|
|
316
318
|
|
|
317
319
|
return generate(workletFunction, { compact: true }).code;
|
|
@@ -756,16 +758,6 @@ function isPossibleOptimization(fun) {
|
|
|
756
758
|
return flags;
|
|
757
759
|
}
|
|
758
760
|
|
|
759
|
-
const pluginProposalExportNamespaceFrom =
|
|
760
|
-
require('@babel/plugin-proposal-export-namespace-from').default;
|
|
761
|
-
const apiMock = {
|
|
762
|
-
assertVersion: () => {
|
|
763
|
-
// do nothing.
|
|
764
|
-
},
|
|
765
|
-
};
|
|
766
|
-
const ExportNamedDeclarationFn =
|
|
767
|
-
pluginProposalExportNamespaceFrom(apiMock).visitor.ExportNamedDeclaration;
|
|
768
|
-
|
|
769
761
|
module.exports = function ({ types: t }) {
|
|
770
762
|
return {
|
|
771
763
|
pre() {
|
|
@@ -788,7 +780,6 @@ module.exports = function ({ types: t }) {
|
|
|
788
780
|
processIfGestureHandlerEventCallbackFunctionNode(t, path, state);
|
|
789
781
|
},
|
|
790
782
|
},
|
|
791
|
-
ExportNamedDeclaration: ExportNamedDeclarationFn,
|
|
792
783
|
},
|
|
793
784
|
};
|
|
794
785
|
};
|