react-native-reanimated 2.6.0 → 2.9.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/SharedItems/ShareableValue.cpp +2 -2
- package/Common/cpp/Tools/RuntimeDecorator.cpp +17 -25
- 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 +19 -8
- package/android/build.gradle +22 -8
- 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/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/rnVersionPatch/69/.gitkeep +0 -0
- package/android/src/main/cpp/NativeProxy.cpp +35 -14
- package/android/src/main/cpp/headers/NativeProxy.h +2 -0
- package/android/src/main/java/com/swmansion/reanimated/NativeProxy.java +11 -8
- package/android/src/main/java/com/swmansion/reanimated/layoutReanimation/AnimationsManager.java +13 -6
- package/android/src/main/java/com/swmansion/reanimated/sensor/ReanimatedSensorListener.java +24 -1
- package/android/src/main/java/com/swmansion/reanimated/sensor/ReanimatedSensorType.java +7 -5
- package/ios/LayoutReanimation/REAAnimationsManager.h +1 -1
- package/ios/LayoutReanimation/REAAnimationsManager.m +2 -2
- package/ios/LayoutReanimation/REASnapshot.m +1 -1
- package/ios/LayoutReanimation/REAUIManager.h +1 -1
- package/ios/LayoutReanimation/REAUIManager.mm +4 -5
- package/ios/Nodes/REAAlwaysNode.h +1 -1
- package/ios/Nodes/REAAlwaysNode.m +5 -5
- package/ios/Nodes/REABezierNode.h +1 -1
- package/ios/Nodes/REABezierNode.m +4 -5
- package/ios/Nodes/REABlockNode.h +1 -1
- package/ios/Nodes/REABlockNode.m +2 -2
- package/ios/Nodes/REACallFuncNode.h +1 -1
- package/ios/Nodes/REACallFuncNode.m +5 -5
- package/ios/Nodes/REAClockNodes.h +1 -1
- package/ios/Nodes/REAClockNodes.m +4 -4
- package/ios/Nodes/REAConcatNode.h +1 -1
- package/ios/Nodes/REAConcatNode.m +3 -3
- package/ios/Nodes/REACondNode.h +1 -1
- package/ios/Nodes/REACondNode.m +3 -3
- package/ios/Nodes/READebugNode.h +1 -1
- package/ios/Nodes/READebugNode.m +3 -3
- package/ios/Nodes/REAEventNode.h +1 -2
- package/ios/Nodes/REAEventNode.m +3 -3
- package/ios/Nodes/REAFunctionNode.h +1 -1
- package/ios/Nodes/REAFunctionNode.m +3 -3
- package/ios/Nodes/REAJSCallNode.h +1 -1
- package/ios/Nodes/REAJSCallNode.m +3 -3
- package/ios/Nodes/REANode.m +2 -2
- package/ios/Nodes/REAOperatorNode.h +1 -1
- package/ios/Nodes/REAOperatorNode.m +2 -3
- package/ios/Nodes/REAParamNode.h +1 -1
- package/ios/Nodes/REAParamNode.m +4 -4
- package/ios/Nodes/REAPropsNode.h +1 -1
- package/ios/Nodes/REAPropsNode.m +4 -6
- package/ios/Nodes/REASetNode.h +1 -1
- package/ios/Nodes/REASetNode.m +4 -4
- package/ios/Nodes/REAStyleNode.h +1 -1
- package/ios/Nodes/REAStyleNode.m +2 -3
- package/ios/Nodes/REATransformNode.h +1 -1
- package/ios/Nodes/REATransformNode.m +2 -2
- package/ios/Nodes/REAValueNode.h +1 -3
- package/ios/Nodes/REAValueNode.m +1 -1
- package/ios/REAEventDispatcher.m +1 -1
- package/ios/REAModule.h +1 -1
- package/ios/REAModule.m +4 -5
- package/ios/REANodesManager.h +1 -2
- package/ios/REANodesManager.m +21 -23
- package/ios/Transitioning/RCTConvert+REATransition.h +1 -2
- package/ios/Transitioning/RCTConvert+REATransition.m +1 -1
- package/ios/Transitioning/REAAllTransitions.h +1 -1
- package/ios/Transitioning/REAAllTransitions.m +2 -3
- package/ios/Transitioning/REATransition.h +2 -3
- package/ios/Transitioning/REATransition.m +3 -4
- package/ios/Transitioning/REATransitionAnimation.m +1 -2
- package/ios/Transitioning/REATransitionManager.m +2 -4
- package/ios/Transitioning/REATransitionValues.m +2 -3
- package/ios/native/NativeMethods.h +1 -3
- package/ios/native/NativeMethods.mm +1 -1
- package/ios/native/NativeProxy.h +2 -2
- package/ios/native/NativeProxy.mm +20 -17
- package/ios/native/REAIOSErrorHandler.h +2 -4
- package/ios/native/REAIOSErrorHandler.mm +1 -1
- package/ios/native/REAIOSLogger.h +1 -3
- package/ios/native/REAIOSLogger.mm +1 -1
- package/ios/native/REAIOSScheduler.h +1 -3
- package/ios/native/REAIOSScheduler.mm +2 -2
- package/ios/native/REAInitializer.h +0 -7
- package/ios/native/REAInitializer.mm +13 -3
- package/ios/native/UIResponder+Reanimated.mm +3 -3
- package/ios/sensor/ReanimatedSensor.h +1 -1
- package/ios/sensor/ReanimatedSensor.m +3 -3
- package/ios/sensor/ReanimatedSensorContainer.h +1 -1
- package/ios/sensor/ReanimatedSensorContainer.m +2 -2
- package/lib/Animated.js +8 -30
- package/lib/ConfigHelper.js +0 -1
- package/lib/index.js +5 -30
- package/lib/reanimated2/Easing.js +9 -3
- package/lib/reanimated2/NativeReanimated/NativeReanimated.js +1 -1
- package/lib/reanimated2/animation/sequence.js +0 -3
- package/lib/reanimated2/component/FlatList.js +3 -3
- package/lib/reanimated2/component/Image.js +4 -0
- package/lib/reanimated2/component/ScrollView.js +4 -0
- package/lib/reanimated2/component/Text.js +4 -0
- package/lib/reanimated2/component/View.js +4 -0
- package/lib/reanimated2/core.js +0 -41
- package/lib/reanimated2/globals.d.ts +1 -2
- package/lib/reanimated2/hook/utils.js +0 -5
- package/lib/reanimated2/js-reanimated/global.js +25 -0
- package/lib/reanimated2/js-reanimated/index.js +0 -24
- package/lib/reanimated2/mock.js +6 -0
- package/lib/types/lib/Animated.d.ts +8 -0
- package/lib/types/lib/index.d.ts +4 -0
- package/lib/types/lib/reanimated2/commonTypes.d.ts +0 -1
- package/lib/types/lib/reanimated2/component/Image.d.ts +3 -0
- package/lib/types/lib/reanimated2/component/ScrollView.d.ts +3 -0
- package/lib/types/lib/reanimated2/component/Text.d.ts +3 -0
- package/lib/types/lib/reanimated2/component/View.d.ts +3 -0
- package/lib/types/lib/reanimated2/hook/useAnimatedSensor.d.ts +1 -3
- package/lib/types/lib/reanimated2/js-reanimated/global.d.ts +1 -0
- package/lib/types/lib/reanimated2/mock.d.ts +6 -0
- package/package.json +18 -14
- package/plugin.js +36 -33
- package/react-native-reanimated.d.ts +16 -7
- package/src/Animated.ts +13 -0
- package/src/ConfigHelper.ts +0 -1
- package/src/index.ts +7 -0
- package/src/reanimated2/Easing.ts +9 -3
- package/src/reanimated2/NativeReanimated/NativeReanimated.ts +1 -1
- package/src/reanimated2/animation/sequence.ts +0 -5
- package/src/reanimated2/commonTypes.ts +0 -1
- package/src/reanimated2/component/FlatList.tsx +3 -6
- package/src/reanimated2/component/Image.ts +6 -0
- package/src/reanimated2/component/ScrollView.ts +6 -0
- package/src/reanimated2/component/Text.ts +6 -0
- package/src/reanimated2/component/View.ts +6 -0
- package/src/reanimated2/core.ts +0 -52
- package/src/reanimated2/globals.d.ts +1 -2
- package/src/reanimated2/hook/useAnimatedSensor.ts +1 -3
- package/src/reanimated2/hook/utils.ts +0 -6
- package/src/reanimated2/js-reanimated/global.ts +33 -0
- package/src/reanimated2/js-reanimated/index.ts +0 -31
- package/src/reanimated2/mock.ts +6 -0
- package/android/react-native-reanimated-64-hermes.aar +0 -0
- package/android/react-native-reanimated-64-jsc.aar +0 -0
- package/lib/reanimated2/component/WrappedComponents.js +0 -9
- package/lib/reanimated2/component/index.js +0 -4
- package/lib/types/lib/reanimated2/component/WrappedComponents.d.ts +0 -8
- package/lib/types/lib/reanimated2/component/index.d.ts +0 -9
- package/src/Animated.js +0 -31
- package/src/reanimated2/component/WrappedComponents.ts +0 -11
- package/src/reanimated2/component/index.ts +0 -9
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
#import
|
|
2
|
-
#import
|
|
3
|
-
#import
|
|
1
|
+
#import <RNReanimated/REAInitializer.h>
|
|
2
|
+
#import <RNReanimated/REAUIManager.h>
|
|
3
|
+
#import <RNReanimated/UIResponder+Reanimated.h>
|
|
4
4
|
|
|
5
5
|
#if __has_include(<reacthermes/HermesExecutorFactory.h>)
|
|
6
6
|
#import <reacthermes/HermesExecutorFactory.h>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#import
|
|
1
|
+
#import <RNReanimated/ReanimatedSensor.h>
|
|
2
2
|
|
|
3
3
|
#if __has_include(<CoreMotion/CoreMotion.h>)
|
|
4
4
|
@implementation ReanimatedSensor
|
|
@@ -141,9 +141,9 @@
|
|
|
141
141
|
attitude.quaternion.y,
|
|
142
142
|
attitude.quaternion.z,
|
|
143
143
|
attitude.quaternion.w,
|
|
144
|
-
attitude.pitch,
|
|
145
|
-
attitude.roll,
|
|
146
144
|
attitude.yaw,
|
|
145
|
+
attitude.pitch,
|
|
146
|
+
attitude.roll
|
|
147
147
|
};
|
|
148
148
|
self->_setter(data);
|
|
149
149
|
self->_lastTimestamp = currentTime;
|
package/lib/Animated.js
CHANGED
|
@@ -1,31 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
} from './
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const Animated = {
|
|
11
|
-
// components
|
|
12
|
-
...ReanimatedComponents,
|
|
13
|
-
createAnimatedComponent,
|
|
14
|
-
// configuration
|
|
15
|
-
addWhitelistedNativeProps,
|
|
16
|
-
addWhitelistedUIProps,
|
|
17
|
-
// reanimated 1
|
|
18
|
-
...reanimated1,
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
export * from './reanimated2';
|
|
1
|
+
export { default as createAnimatedComponent } from './createAnimatedComponent';
|
|
2
|
+
export { addWhitelistedNativeProps, addWhitelistedUIProps, } from './ConfigHelper';
|
|
3
|
+
export { default as Text } from './reanimated2/component/Text';
|
|
4
|
+
export { default as View } from './reanimated2/component/View';
|
|
5
|
+
export { default as ScrollView } from './reanimated2/component/ScrollView';
|
|
6
|
+
export { default as Image } from './reanimated2/component/Image';
|
|
7
|
+
export { default as FlatList } from './reanimated2/component/FlatList';
|
|
8
|
+
// @ts-ignore backward compatibility with treeshaking
|
|
22
9
|
export * from './reanimated1';
|
|
23
|
-
export default Animated;
|
|
24
|
-
|
|
25
|
-
// I think we can ignore this message as long as Gesture Handler doesn't
|
|
26
|
-
// try to load the Reanimated module. I figured it should be here instead of
|
|
27
|
-
// RNGH because this prevents the message from being displayed for all
|
|
28
|
-
// versions of RNGH.
|
|
29
|
-
LogBox.ignoreLogs([
|
|
30
|
-
'RCTBridge required dispatch_sync to load RNGestureHandlerModule. This may lead to deadlocks',
|
|
31
|
-
]);
|
package/lib/ConfigHelper.js
CHANGED
package/lib/index.js
CHANGED
|
@@ -1,31 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
addWhitelistedNativeProps,
|
|
5
|
-
addWhitelistedUIProps,
|
|
6
|
-
} from './ConfigHelper';
|
|
7
|
-
import * as reanimated1 from './reanimated1';
|
|
8
|
-
import ReanimatedComponents from './reanimated2/component';
|
|
9
|
-
|
|
10
|
-
const Animated = {
|
|
11
|
-
// components
|
|
12
|
-
...ReanimatedComponents,
|
|
13
|
-
createAnimatedComponent,
|
|
14
|
-
// configuration
|
|
15
|
-
addWhitelistedNativeProps,
|
|
16
|
-
addWhitelistedUIProps,
|
|
17
|
-
// reanimated 1
|
|
18
|
-
...reanimated1,
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
export * from './reanimated2';
|
|
1
|
+
// tree-shaken side effects
|
|
2
|
+
import './reanimated2/js-reanimated/global';
|
|
3
|
+
// @ts-ignore backward compatibility with treeshaking
|
|
22
4
|
export * from './reanimated1';
|
|
23
|
-
export
|
|
24
|
-
|
|
25
|
-
// I think we can ignore this message as long as Gesture Handler doesn't
|
|
26
|
-
// try to load the Reanimated module. I figured it should be here instead of
|
|
27
|
-
// RNGH because this prevents the message from being displayed for all
|
|
28
|
-
// versions of RNGH.
|
|
29
|
-
LogBox.ignoreLogs([
|
|
30
|
-
'RCTBridge required dispatch_sync to load RNGestureHandlerModule. This may lead to deadlocks',
|
|
31
|
-
]);
|
|
5
|
+
export * from './reanimated2';
|
|
6
|
+
export * as default from './Animated';
|
|
@@ -53,7 +53,10 @@ function cubic(t) {
|
|
|
53
53
|
*/
|
|
54
54
|
function poly(n) {
|
|
55
55
|
'worklet';
|
|
56
|
-
return (t) =>
|
|
56
|
+
return (t) => {
|
|
57
|
+
'worklet';
|
|
58
|
+
return Math.pow(t, n);
|
|
59
|
+
};
|
|
57
60
|
}
|
|
58
61
|
/**
|
|
59
62
|
* A sinusoidal function.
|
|
@@ -110,7 +113,10 @@ function elastic(bounciness = 1) {
|
|
|
110
113
|
*/
|
|
111
114
|
function back(s = 1.70158) {
|
|
112
115
|
'worklet';
|
|
113
|
-
return (t) =>
|
|
116
|
+
return (t) => {
|
|
117
|
+
'worklet';
|
|
118
|
+
return t * t * ((s + 1) * t - s);
|
|
119
|
+
};
|
|
114
120
|
}
|
|
115
121
|
/**
|
|
116
122
|
* Provides a simple bouncing effect.
|
|
@@ -224,7 +230,7 @@ function createChecker(worklet, workletName, prevArgs) {
|
|
|
224
230
|
}
|
|
225
231
|
// @ts-ignore this is implicitly any - TODO
|
|
226
232
|
const res = worklet.apply(this, arguments);
|
|
227
|
-
if (!_WORKLET && res && typeof res === 'function' && res.
|
|
233
|
+
if (!_WORKLET && res && typeof res === 'function' && res.__workletHash) {
|
|
228
234
|
return createChecker(res, workletName, arguments);
|
|
229
235
|
}
|
|
230
236
|
return res;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { NativeModules } from 'react-native';
|
|
2
2
|
export class NativeReanimated {
|
|
3
3
|
constructor(native = true) {
|
|
4
|
-
if (global.__reanimatedModuleProxy === undefined) {
|
|
4
|
+
if (global.__reanimatedModuleProxy === undefined && native) {
|
|
5
5
|
const { ReanimatedModule } = NativeModules;
|
|
6
6
|
ReanimatedModule === null || ReanimatedModule === void 0 ? void 0 : ReanimatedModule.installTurboModule();
|
|
7
7
|
}
|
|
@@ -43,9 +43,6 @@ export function withSequence(..._animations) {
|
|
|
43
43
|
return false;
|
|
44
44
|
}
|
|
45
45
|
function onStart(animation, value, now, previousAnimation) {
|
|
46
|
-
if (animations.length === 1) {
|
|
47
|
-
throw Error('withSequence() animation require more than one animation as argument');
|
|
48
|
-
}
|
|
49
46
|
animation.animationIndex = 0;
|
|
50
47
|
if (previousAnimation === undefined) {
|
|
51
48
|
previousAnimation = animations[animations.length - 1];
|
|
@@ -11,14 +11,14 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
11
11
|
};
|
|
12
12
|
import React from 'react';
|
|
13
13
|
import { FlatList } from 'react-native';
|
|
14
|
-
import
|
|
14
|
+
import ReanimatedView from './View';
|
|
15
15
|
import createAnimatedComponent from '../../createAnimatedComponent';
|
|
16
16
|
const AnimatedFlatList = createAnimatedComponent(FlatList);
|
|
17
17
|
const createCellRenderer = (itemLayoutAnimation) => {
|
|
18
18
|
const cellRenderer = (props) => {
|
|
19
|
-
return (<
|
|
19
|
+
return (<ReanimatedView layout={itemLayoutAnimation} onLayout={props.onLayout}>
|
|
20
20
|
{props.children}
|
|
21
|
-
</
|
|
21
|
+
</ReanimatedView>);
|
|
22
22
|
};
|
|
23
23
|
return cellRenderer;
|
|
24
24
|
};
|
package/lib/reanimated2/core.js
CHANGED
|
@@ -2,9 +2,6 @@
|
|
|
2
2
|
import NativeReanimatedModule from './NativeReanimated';
|
|
3
3
|
import { Platform } from 'react-native';
|
|
4
4
|
import { nativeShouldBeMock, shouldBeUseWeb, isWeb } from './PlatformChecker';
|
|
5
|
-
global.__reanimatedWorkletInit = function (worklet) {
|
|
6
|
-
worklet.__worklet = true;
|
|
7
|
-
};
|
|
8
5
|
if (global._setGlobalConsole === undefined) {
|
|
9
6
|
// it can happen when Reanimated plugin wasn't added, but the user uses the only API from version 1
|
|
10
7
|
global._setGlobalConsole = () => {
|
|
@@ -31,39 +28,6 @@ export const isConfiguredCheck = () => {
|
|
|
31
28
|
throw new Error('If you want to use Reanimated 2 then go through our installation steps https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/installation');
|
|
32
29
|
}
|
|
33
30
|
};
|
|
34
|
-
function _toArrayReanimated(object) {
|
|
35
|
-
'worklet';
|
|
36
|
-
if (Array.isArray(object)) {
|
|
37
|
-
return object;
|
|
38
|
-
}
|
|
39
|
-
if (typeof Symbol !== 'undefined' &&
|
|
40
|
-
(typeof Symbol === 'function' ? Symbol.iterator : '@@iterator') in
|
|
41
|
-
Object(object)) {
|
|
42
|
-
return Array.from(object);
|
|
43
|
-
}
|
|
44
|
-
throw new Error('Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.');
|
|
45
|
-
}
|
|
46
|
-
function _mergeObjectsReanimated() {
|
|
47
|
-
'worklet';
|
|
48
|
-
// we can't use rest parameters in worklets at the moment
|
|
49
|
-
// eslint-disable-next-line prefer-rest-params
|
|
50
|
-
const arr = Array.from(arguments);
|
|
51
|
-
return Object.assign.apply(null, [arr[0], ...arr.slice(1)]);
|
|
52
|
-
}
|
|
53
|
-
global.__reanimatedWorkletInit = function (worklet) {
|
|
54
|
-
worklet.__worklet = true;
|
|
55
|
-
if (worklet._closure) {
|
|
56
|
-
const closure = worklet._closure;
|
|
57
|
-
Object.keys(closure).forEach((key) => {
|
|
58
|
-
if (key === '_toConsumableArray') {
|
|
59
|
-
closure[key] = _toArrayReanimated;
|
|
60
|
-
}
|
|
61
|
-
if (key === '_objectSpread') {
|
|
62
|
-
closure[key] = _mergeObjectsReanimated;
|
|
63
|
-
}
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
};
|
|
67
31
|
function pushFrame(frame) {
|
|
68
32
|
NativeReanimatedModule.pushFrame(frame);
|
|
69
33
|
}
|
|
@@ -274,11 +238,6 @@ if (!isWeb() && isConfigured()) {
|
|
|
274
238
|
info: runOnJS(capturableConsole.info),
|
|
275
239
|
};
|
|
276
240
|
_setGlobalConsole(console);
|
|
277
|
-
if (global.performance == null) {
|
|
278
|
-
global.performance = {
|
|
279
|
-
now: global._chronoNow,
|
|
280
|
-
}; // due to conflict with lib.dom.d.ts -> Performance
|
|
281
|
-
}
|
|
282
241
|
})();
|
|
283
242
|
}
|
|
284
243
|
let featuresConfig = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AnimatedStyle, StyleProps
|
|
1
|
+
import { AnimatedStyle, StyleProps } from './commonTypes';
|
|
2
2
|
import { ReanimatedConsole } from './core';
|
|
3
3
|
import { MeasuredDimensions } from './NativeMethods';
|
|
4
4
|
import { NativeReanimated } from './NativeReanimated/NativeReanimated';
|
|
@@ -32,7 +32,6 @@ declare global {
|
|
|
32
32
|
};
|
|
33
33
|
namespace NodeJS {
|
|
34
34
|
interface Global {
|
|
35
|
-
__reanimatedWorkletInit: (worklet: WorkletFunction) => void;
|
|
36
35
|
_setGlobalConsole: (console?: ReanimatedConsole) => void;
|
|
37
36
|
_log: (s: string) => void;
|
|
38
37
|
_setGestureState: () => void;
|
|
@@ -12,11 +12,6 @@ export function useEvent(handler, eventNames = [], rebuild = false) {
|
|
|
12
12
|
else if (rebuild) {
|
|
13
13
|
initRef.current.updateWorklet(handler);
|
|
14
14
|
}
|
|
15
|
-
useEffect(() => {
|
|
16
|
-
return () => {
|
|
17
|
-
initRef.current = null;
|
|
18
|
-
};
|
|
19
|
-
}, []);
|
|
20
15
|
return initRef;
|
|
21
16
|
}
|
|
22
17
|
export function useHandler(handlers, dependencies) {
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// In order to keep bundle size down, we treat this file as a polyfill for Web.
|
|
2
|
+
import { shouldBeUseWeb } from '../PlatformChecker';
|
|
3
|
+
if (shouldBeUseWeb()) {
|
|
4
|
+
global._frameTimestamp = null;
|
|
5
|
+
global._setGlobalConsole = (_val) => {
|
|
6
|
+
// noop
|
|
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,
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
global._scrollTo = () => {
|
|
20
|
+
console.warn("[Reanimated] You can't use `scrollTo` with Chrome Debugger or with web version");
|
|
21
|
+
};
|
|
22
|
+
global._setGestureState = () => {
|
|
23
|
+
console.warn("[Reanimated] You can't use `setGestureState` with Chrome Debugger or with web version");
|
|
24
|
+
};
|
|
25
|
+
}
|
|
@@ -1,29 +1,5 @@
|
|
|
1
1
|
import JSReanimated from './JSReanimated';
|
|
2
|
-
import { shouldBeUseWeb } from '../PlatformChecker';
|
|
3
2
|
const reanimatedJS = new JSReanimated();
|
|
4
|
-
if (shouldBeUseWeb()) {
|
|
5
|
-
global._frameTimestamp = null;
|
|
6
|
-
global._setGlobalConsole = (_val) => {
|
|
7
|
-
// noop
|
|
8
|
-
};
|
|
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
3
|
export const _updatePropsJS = (updates, viewRef) => {
|
|
28
4
|
if (viewRef._component) {
|
|
29
5
|
const component = viewRef._component;
|
package/lib/reanimated2/mock.js
CHANGED
|
@@ -64,6 +64,12 @@ const ReanimatedV2 = {
|
|
|
64
64
|
out: ID,
|
|
65
65
|
inOut: ID,
|
|
66
66
|
},
|
|
67
|
+
Extrapolation: {
|
|
68
|
+
EXTEND: 'extend',
|
|
69
|
+
CLAMP: 'clamp',
|
|
70
|
+
IDENTITY: 'identity',
|
|
71
|
+
},
|
|
67
72
|
runOnJS: (fn) => fn,
|
|
73
|
+
runOnUI: (fn) => fn,
|
|
68
74
|
};
|
|
69
75
|
module.exports = Object.assign({}, ReanimatedV2);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { default as createAnimatedComponent } from './createAnimatedComponent';
|
|
2
|
+
export { addWhitelistedNativeProps, addWhitelistedUIProps, } from './ConfigHelper';
|
|
3
|
+
export { default as Text } from './reanimated2/component/Text';
|
|
4
|
+
export { default as View } from './reanimated2/component/View';
|
|
5
|
+
export { default as ScrollView } from './reanimated2/component/ScrollView';
|
|
6
|
+
export { default as Image } from './reanimated2/component/Image';
|
|
7
|
+
export { default as FlatList } from './reanimated2/component/FlatList';
|
|
8
|
+
export * from './reanimated1';
|
|
@@ -13,8 +13,6 @@ export declare type AnimatedSensor = {
|
|
|
13
13
|
sensor: SensorValue3D | SensorValueRotation | null;
|
|
14
14
|
unregister: () => void;
|
|
15
15
|
isAvailable: boolean;
|
|
16
|
-
config:
|
|
17
|
-
interval: number;
|
|
18
|
-
};
|
|
16
|
+
config: SensorConfig;
|
|
19
17
|
};
|
|
20
18
|
export declare function useAnimatedSensor(sensorType: SensorType, userConfig?: SensorConfig): AnimatedSensor;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-reanimated",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.9.0",
|
|
4
4
|
"description": "More powerful alternative to Animated library for React Native.",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"start": "node node_modules/react-native/local-cli/cli.js start",
|
|
@@ -34,10 +34,10 @@
|
|
|
34
34
|
"clean:deep": "cd android && rm -rf .cxx .gradle build && cd ../Example/android && rm -rf .gradle build app/build && cd ../.. && yarn clean",
|
|
35
35
|
"reset:deep": "yarn clean:deep && yarn setup"
|
|
36
36
|
},
|
|
37
|
-
"main": "lib/
|
|
38
|
-
"module": "lib/
|
|
39
|
-
"react-native": "src/
|
|
40
|
-
"source": "src/
|
|
37
|
+
"main": "lib/index.js",
|
|
38
|
+
"module": "lib/index",
|
|
39
|
+
"react-native": "src/index",
|
|
40
|
+
"source": "src/index",
|
|
41
41
|
"types": "react-native-reanimated.d.ts",
|
|
42
42
|
"files": [
|
|
43
43
|
"Common/",
|
|
@@ -74,25 +74,24 @@
|
|
|
74
74
|
},
|
|
75
75
|
"homepage": "https://github.com/software-mansion/react-native-reanimated#readme",
|
|
76
76
|
"dependencies": {
|
|
77
|
+
"@babel/plugin-proposal-export-namespace-from": "^7.17.12",
|
|
77
78
|
"@babel/plugin-transform-object-assign": "^7.16.7",
|
|
79
|
+
"@babel/preset-typescript": "^7.16.7",
|
|
78
80
|
"@types/invariant": "^2.2.35",
|
|
79
81
|
"invariant": "^2.2.4",
|
|
80
82
|
"lodash.isequal": "^4.5.0",
|
|
81
|
-
"react-native-screens": "^3.11.1",
|
|
82
83
|
"setimmediate": "^1.0.5",
|
|
83
84
|
"string-hash-64": "^1.0.3"
|
|
84
85
|
},
|
|
85
86
|
"peerDependencies": {
|
|
86
|
-
"@babel/
|
|
87
|
+
"@babel/core": "^7.0.0-0",
|
|
87
88
|
"react": "*",
|
|
88
|
-
"react-native": "*"
|
|
89
|
-
"react-native-gesture-handler": "*"
|
|
89
|
+
"react-native": "*"
|
|
90
90
|
},
|
|
91
91
|
"devDependencies": {
|
|
92
92
|
"@babel/core": "^7.17.2",
|
|
93
93
|
"@babel/plugin-proposal-class-properties": "^7.16.7",
|
|
94
94
|
"@babel/preset-env": "^7.16.11",
|
|
95
|
-
"@babel/preset-typescript": "^7.16.7",
|
|
96
95
|
"@react-native-community/bob": "^0.17.1",
|
|
97
96
|
"@react-native-community/eslint-config": "^0.0.5",
|
|
98
97
|
"@testing-library/jest-native": "^4.0.4",
|
|
@@ -123,11 +122,11 @@
|
|
|
123
122
|
"lint-staged": "^11.2.0",
|
|
124
123
|
"madge": "^5.0.1",
|
|
125
124
|
"prettier": "^2.5.1",
|
|
126
|
-
"react": "
|
|
127
|
-
"react-native": "0.
|
|
125
|
+
"react": "18.0.0",
|
|
126
|
+
"react-native": "0.69.1",
|
|
128
127
|
"react-native-codegen": "^0.0.7",
|
|
129
128
|
"react-native-gesture-handler": "^1.6.1",
|
|
130
|
-
"react-test-renderer": "
|
|
129
|
+
"react-test-renderer": "18.0.0",
|
|
131
130
|
"release-it": "^13.7.2",
|
|
132
131
|
"typescript": "^4.1.3"
|
|
133
132
|
},
|
|
@@ -156,5 +155,10 @@
|
|
|
156
155
|
"commonjs",
|
|
157
156
|
"module"
|
|
158
157
|
]
|
|
159
|
-
}
|
|
158
|
+
},
|
|
159
|
+
"sideEffects": [
|
|
160
|
+
"./lib/reanimated2/core",
|
|
161
|
+
"./lib/reanimated2/js-reanimated/global",
|
|
162
|
+
"./lib/index"
|
|
163
|
+
]
|
|
160
164
|
}
|