react-native-reanimated 2.3.0-alpha.1 → 2.3.0-beta.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/LayoutAnimations/LayoutAnimationsProxy.cpp +15 -8
- package/Common/cpp/NativeModules/NativeReanimatedModule.cpp +170 -166
- package/Common/cpp/NativeModules/NativeReanimatedModuleSpec.cpp +36 -34
- package/Common/cpp/Registries/EventHandlerRegistry.cpp +13 -6
- package/Common/cpp/Registries/MapperRegistry.cpp +19 -15
- package/Common/cpp/Registries/WorkletsCache.cpp +19 -9
- package/Common/cpp/SharedItems/FrozenObject.cpp +19 -8
- package/Common/cpp/SharedItems/MutableValue.cpp +38 -25
- package/Common/cpp/SharedItems/MutableValueSetterProxy.cpp +11 -7
- package/Common/cpp/SharedItems/RemoteObject.cpp +9 -5
- package/Common/cpp/SharedItems/ShareableValue.cpp +216 -143
- package/Common/cpp/Tools/JSIStoreValueUser.cpp +36 -24
- package/Common/cpp/Tools/Mapper.cpp +41 -29
- package/Common/cpp/Tools/RuntimeDecorator.cpp +103 -84
- package/Common/cpp/Tools/Scheduler.cpp +14 -6
- package/Common/cpp/Tools/WorkletEventHandler.cpp +1 -1
- package/Common/cpp/headers/LayoutAnimations/LayoutAnimationsProxy.h +12 -11
- package/Common/cpp/headers/NativeModules/NativeReanimatedModule.h +45 -34
- package/Common/cpp/headers/NativeModules/NativeReanimatedModuleSpec.h +28 -16
- package/Common/cpp/headers/Registries/EventHandlerRegistry.h +14 -8
- package/Common/cpp/headers/Registries/MapperRegistry.h +4 -4
- package/Common/cpp/headers/Registries/WorkletsCache.h +9 -7
- package/Common/cpp/headers/SharedItems/FrozenObject.h +15 -11
- package/Common/cpp/headers/SharedItems/HostFunctionHandler.h +6 -4
- package/Common/cpp/headers/SharedItems/MutableValue.h +21 -12
- package/Common/cpp/headers/SharedItems/MutableValueSetterProxy.h +10 -7
- package/Common/cpp/headers/SharedItems/RemoteObject.h +16 -8
- package/Common/cpp/headers/SharedItems/RuntimeManager.h +39 -21
- package/Common/cpp/headers/SharedItems/ShareableValue.h +31 -27
- package/Common/cpp/headers/SharedItems/SharedParent.h +7 -4
- package/Common/cpp/headers/SharedItems/ValueWrapper.h +80 -61
- package/Common/cpp/headers/SpecTools/ErrorHandler.h +17 -19
- package/Common/cpp/headers/Tools/JSIStoreValueUser.h +18 -13
- package/Common/cpp/headers/Tools/Mapper.h +24 -18
- package/Common/cpp/headers/Tools/PlatformDepMethodsHolder.h +12 -7
- package/Common/cpp/headers/Tools/ReanimatedHiddenHeaders.h +7 -7
- package/Common/cpp/headers/Tools/RuntimeDecorator.h +29 -23
- package/Common/cpp/headers/Tools/Scheduler.h +28 -33
- package/Common/cpp/headers/Tools/WorkletEventHandler.h +9 -7
- package/Common/cpp/hidden_headers/Logger.h +14 -14
- package/Common/cpp/hidden_headers/LoggerInterface.h +8 -9
- package/Common/cpp/hidden_headers/SpeedChecker.h +7 -8
- package/README.md +1 -1
- package/RNReanimated.podspec +4 -4
- package/android/build.gradle +80 -3
- 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/ios/LayoutReanimation/REAAnimationsManager.h +19 -10
- package/ios/LayoutReanimation/REAAnimationsManager.m +195 -200
- package/ios/LayoutReanimation/REASnapshot.h +13 -0
- package/ios/LayoutReanimation/REASnapshot.m +29 -0
- package/ios/LayoutReanimation/REAUIManager.h +16 -0
- package/ios/LayoutReanimation/REAUIManager.mm +348 -0
- package/ios/Nodes/REAAlwaysNode.m +14 -15
- package/ios/Nodes/REABezierNode.m +8 -7
- package/ios/Nodes/REABlockNode.m +1 -1
- package/ios/Nodes/REACallFuncNode.h +0 -1
- package/ios/Nodes/REACallFuncNode.m +10 -8
- package/ios/Nodes/REAClockNodes.m +22 -20
- package/ios/Nodes/REAConcatNode.h +0 -1
- package/ios/Nodes/REAConcatNode.m +2 -2
- package/ios/Nodes/REACondNode.m +7 -5
- package/ios/Nodes/READebugNode.m +5 -4
- package/ios/Nodes/REAEventNode.m +1 -1
- package/ios/Nodes/REAFunctionNode.h +0 -1
- package/ios/Nodes/REAFunctionNode.m +2 -2
- package/ios/Nodes/REAJSCallNode.m +4 -5
- package/ios/Nodes/REANode.h +3 -4
- package/ios/Nodes/REANode.m +9 -11
- package/ios/Nodes/REAOperatorNode.m +68 -67
- package/ios/Nodes/REAParamNode.h +1 -3
- package/ios/Nodes/REAParamNode.m +15 -17
- package/ios/Nodes/REAPropsNode.h +1 -3
- package/ios/Nodes/REAPropsNode.m +19 -22
- package/ios/Nodes/REASetNode.h +0 -1
- package/ios/Nodes/REASetNode.m +7 -5
- package/ios/Nodes/REAStyleNode.h +0 -1
- package/ios/Nodes/REAStyleNode.m +2 -4
- package/ios/Nodes/REATransformNode.h +0 -1
- package/ios/Nodes/REATransformNode.m +3 -5
- package/ios/Nodes/REAValueNode.m +5 -7
- package/ios/REAEventDispatcher.m +3 -3
- package/ios/REAModule.h +0 -2
- package/ios/REAModule.m +29 -40
- package/ios/REANodesManager.h +11 -19
- package/ios/REANodesManager.m +105 -130
- package/ios/REAUtils.h +5 -3
- package/ios/Transitioning/RCTConvert+REATransition.m +45 -29
- package/ios/Transitioning/REAAllTransitions.h +2 -2
- package/ios/Transitioning/REAAllTransitions.m +14 -25
- package/ios/Transitioning/REATransition.h +8 -7
- package/ios/Transitioning/REATransition.m +19 -16
- package/ios/Transitioning/REATransitionAnimation.h +1 -1
- package/ios/Transitioning/REATransitionAnimation.m +2 -3
- package/ios/Transitioning/REATransitionManager.m +3 -3
- package/ios/native/NativeMethods.h +15 -5
- package/ios/native/NativeProxy.h +4 -3
- package/ios/native/NativeProxy.mm +19 -5
- package/ios/native/REAIOSErrorHandler.h +13 -10
- package/ios/native/REAIOSLogger.h +8 -8
- package/ios/native/REAIOSScheduler.h +5 -5
- package/ios/native/REAIOSScheduler.mm +7 -5
- package/ios/native/REAInitializer.h +37 -0
- package/ios/native/REAInitializer.mm +63 -0
- package/ios/native/UIResponder+Reanimated.mm +9 -48
- package/lib/ConfigHelper.js +1 -0
- package/lib/ReanimatedModule.native.js +10 -2
- package/lib/createAnimatedComponent.js +64 -30
- package/lib/reanimated1/core/AnimatedAlways.js +1 -1
- package/lib/reanimated1/core/AnimatedBezier.js +1 -1
- package/lib/reanimated1/core/AnimatedBlock.js +1 -1
- package/lib/reanimated1/core/AnimatedCall.js +1 -1
- package/lib/reanimated1/core/AnimatedCallFunc.js +1 -1
- package/lib/reanimated1/core/AnimatedConcat.js +1 -1
- package/lib/reanimated1/core/AnimatedCond.js +1 -1
- package/lib/reanimated1/core/AnimatedDebug.js +1 -1
- package/lib/reanimated1/core/AnimatedEvent.js +1 -1
- package/lib/reanimated1/core/AnimatedFunction.js +1 -1
- package/lib/reanimated1/core/AnimatedOperator.js +1 -1
- package/lib/reanimated1/core/AnimatedParam.js +1 -1
- package/lib/reanimated1/core/AnimatedProps.js +2 -2
- package/lib/reanimated1/core/AnimatedSet.js +1 -1
- package/lib/reanimated1/core/AnimatedStartClock.js +1 -1
- package/lib/reanimated1/core/AnimatedStopClock.js +1 -1
- package/lib/reanimated1/core/AnimatedStyle.js +1 -1
- package/lib/reanimated1/core/AnimatedTransform.js +1 -1
- package/lib/reanimated1/core/Core.test.js +30 -0
- package/lib/reanimated1/core/InternalAnimatedValue.js +1 -1
- package/lib/reanimated1/core/__mocks__/AnimatedProps.js +1 -1
- package/lib/reanimated1/derived/interpolate.js +1 -1
- package/lib/reanimated2/Colors.js +16 -12
- package/lib/reanimated2/NativeMethods.js +3 -14
- package/lib/reanimated2/{NativeReanimated.native.js → NativeReanimated/NativeReanimated.js} +19 -24
- package/lib/reanimated2/NativeReanimated/index.js +15 -0
- package/lib/reanimated2/PlatformChecker.js +16 -0
- package/lib/reanimated2/PropAdapters.js +14 -4
- package/lib/reanimated2/UpdateProps.js +14 -11
- package/lib/reanimated2/ViewDescriptorsSet.js +73 -0
- package/lib/reanimated2/WorkletEventHandler.js +15 -13
- package/lib/reanimated2/animation/commonTypes.js +1 -0
- package/lib/reanimated2/animation/decay.js +71 -0
- package/lib/reanimated2/animation/delay.js +64 -0
- package/lib/reanimated2/animation/index.js +8 -0
- package/lib/reanimated2/animation/repeat.js +69 -0
- package/lib/reanimated2/animation/sequence.js +72 -0
- package/lib/reanimated2/animation/spring.js +101 -0
- package/lib/reanimated2/animation/styleAnimation.js +166 -0
- package/lib/reanimated2/animation/timing.js +64 -0
- package/lib/reanimated2/animation/util.js +157 -0
- package/lib/reanimated2/commonTypes.js +1 -0
- package/lib/reanimated2/core.js +35 -39
- package/lib/reanimated2/globals.d.ts +47 -1
- package/lib/reanimated2/hook/Hooks.js +9 -0
- package/lib/reanimated2/hook/commonTypes.js +1 -0
- package/lib/reanimated2/hook/index.js +8 -0
- package/lib/reanimated2/hook/useAnimatedGestureHandler.js +50 -0
- package/lib/reanimated2/hook/useAnimatedReaction.js +37 -0
- package/lib/reanimated2/hook/useAnimatedRef.js +25 -0
- package/lib/reanimated2/hook/useAnimatedScrollHandler.js +41 -0
- package/lib/reanimated2/hook/useAnimatedStyle.js +376 -0
- package/lib/reanimated2/hook/useDerivedValue.js +36 -0
- package/lib/reanimated2/hook/useSharedValue.js +17 -0
- package/lib/reanimated2/hook/utils.js +175 -0
- package/lib/reanimated2/index.js +3 -2
- package/lib/reanimated2/interpolation.js +95 -86
- package/lib/reanimated2/jestUtils.js +0 -12
- package/lib/reanimated2/js-reanimated/JSReanimated.js +9 -10
- package/lib/reanimated2/js-reanimated/index.js +57 -1
- package/lib/reanimated2/layoutReanimation/LayoutAnimationRepository.js +58 -0
- package/lib/reanimated2/layoutReanimation/animationBuilder/BaseAnimationBuilder.js +69 -0
- package/lib/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.js +125 -0
- package/lib/reanimated2/layoutReanimation/animationBuilder/Keyframe.js +193 -0
- package/lib/reanimated2/layoutReanimation/animationBuilder/commonTypes.js +1 -0
- package/lib/reanimated2/layoutReanimation/animationBuilder/index.js +3 -0
- package/lib/reanimated2/layoutReanimation/defaultAnimations/Bounce.js +325 -207
- package/lib/reanimated2/layoutReanimation/defaultAnimations/Default.js +36 -0
- package/lib/reanimated2/layoutReanimation/defaultAnimations/Fade.js +235 -187
- package/lib/reanimated2/layoutReanimation/defaultAnimations/Flip.js +327 -269
- package/lib/reanimated2/layoutReanimation/defaultAnimations/Lightspeed.js +146 -0
- package/lib/reanimated2/layoutReanimation/defaultAnimations/Pinwheel.js +85 -0
- package/lib/reanimated2/layoutReanimation/defaultAnimations/Roll.js +119 -0
- package/lib/reanimated2/layoutReanimation/defaultAnimations/Rotate.js +289 -0
- package/lib/reanimated2/layoutReanimation/defaultAnimations/Slide.js +159 -121
- package/lib/reanimated2/layoutReanimation/defaultAnimations/Stretch.js +83 -65
- package/lib/reanimated2/layoutReanimation/defaultAnimations/Zoom.js +371 -277
- package/lib/reanimated2/layoutReanimation/defaultAnimations/index.js +4 -0
- package/lib/reanimated2/layoutReanimation/defaultTransitions/CurvedTransition.js +78 -0
- package/lib/reanimated2/layoutReanimation/defaultTransitions/EntryExitTransition.js +128 -0
- package/lib/reanimated2/layoutReanimation/defaultTransitions/FadingTransition.js +37 -0
- package/lib/reanimated2/layoutReanimation/defaultTransitions/JumpingTransition.js +41 -0
- package/lib/reanimated2/layoutReanimation/defaultTransitions/LinearTransition.js +34 -0
- package/lib/reanimated2/layoutReanimation/defaultTransitions/SequencedTransition.js +46 -0
- package/lib/reanimated2/layoutReanimation/defaultTransitions/index.js +6 -0
- package/lib/reanimated2/layoutReanimation/index.js +3 -2
- package/lib/reanimated2/platform-specific/RNRenderer.web.js +2 -0
- package/lib/reanimated2/utils.js +9 -0
- package/libSo/fbjni/jni/arm64-v8a/libfbjni.so +0 -0
- package/libSo/fbjni/jni/armeabi-v7a/libfbjni.so +0 -0
- package/libSo/fbjni/jni/x86/libfbjni.so +0 -0
- package/libSo/fbjni/jni/x86_64/libfbjni.so +0 -0
- package/package.json +21 -10
- package/plugin.js +244 -85
- package/react-native-reanimated.d.ts +531 -453
- package/src/ConfigHelper.js +1 -0
- package/src/ReanimatedModule.native.js +10 -2
- package/src/createAnimatedComponent.js +64 -30
- package/src/reanimated1/core/AnimatedAlways.js +1 -1
- package/src/reanimated1/core/AnimatedBezier.js +1 -1
- package/src/reanimated1/core/AnimatedBlock.js +1 -1
- package/src/reanimated1/core/AnimatedCall.js +1 -1
- package/src/reanimated1/core/AnimatedCallFunc.js +1 -1
- package/src/reanimated1/core/AnimatedConcat.js +1 -1
- package/src/reanimated1/core/AnimatedCond.js +1 -1
- package/src/reanimated1/core/AnimatedDebug.js +1 -1
- package/src/reanimated1/core/AnimatedEvent.js +1 -1
- package/src/reanimated1/core/AnimatedFunction.js +1 -1
- package/src/reanimated1/core/AnimatedOperator.js +1 -1
- package/src/reanimated1/core/AnimatedParam.js +1 -1
- package/src/reanimated1/core/AnimatedProps.js +2 -2
- package/src/reanimated1/core/AnimatedSet.js +1 -1
- package/src/reanimated1/core/AnimatedStartClock.js +1 -1
- package/src/reanimated1/core/AnimatedStopClock.js +1 -1
- package/src/reanimated1/core/AnimatedStyle.js +1 -1
- package/src/reanimated1/core/AnimatedTransform.js +1 -1
- package/src/reanimated1/core/Core.test.js +30 -0
- package/src/reanimated1/core/InternalAnimatedValue.js +1 -1
- package/src/reanimated1/core/__mocks__/AnimatedProps.js +1 -1
- package/src/reanimated1/derived/interpolate.js +1 -1
- package/src/reanimated2/Colors.ts +30 -27
- package/src/reanimated2/Easing.ts +3 -1
- package/src/reanimated2/NativeMethods.ts +26 -16
- package/src/reanimated2/NativeReanimated/NativeReanimated.ts +78 -0
- package/src/reanimated2/NativeReanimated/index.ts +18 -0
- package/src/reanimated2/PlatformChecker.ts +21 -0
- package/src/reanimated2/PropAdapters.ts +52 -34
- package/src/reanimated2/UpdateProps.ts +40 -20
- package/src/reanimated2/ViewDescriptorsSet.ts +108 -0
- package/src/reanimated2/WorkletEventHandler.ts +41 -23
- package/src/reanimated2/animation/commonTypes.ts +48 -0
- package/src/reanimated2/animation/decay.ts +141 -0
- package/src/reanimated2/animation/delay.ts +103 -0
- package/src/reanimated2/animation/index.ts +16 -0
- package/src/reanimated2/animation/repeat.ts +128 -0
- package/src/reanimated2/animation/sequence.ts +110 -0
- package/src/reanimated2/animation/spring.ts +165 -0
- package/src/reanimated2/animation/styleAnimation.ts +253 -0
- package/src/reanimated2/animation/timing.ts +109 -0
- package/src/reanimated2/animation/util.ts +242 -0
- package/src/reanimated2/commonTypes.ts +81 -0
- package/src/reanimated2/core.ts +128 -82
- package/src/reanimated2/globals.d.ts +47 -1
- package/src/reanimated2/hook/Hooks.ts +16 -0
- package/src/reanimated2/hook/commonTypes.ts +12 -0
- package/src/reanimated2/hook/index.ts +25 -0
- package/src/reanimated2/hook/useAnimatedGestureHandler.ts +110 -0
- package/src/reanimated2/hook/useAnimatedReaction.ts +49 -0
- package/src/reanimated2/hook/useAnimatedRef.ts +34 -0
- package/src/reanimated2/hook/useAnimatedScrollHandler.ts +83 -0
- package/src/reanimated2/hook/useAnimatedStyle.ts +538 -0
- package/src/reanimated2/hook/useDerivedValue.ts +48 -0
- package/src/reanimated2/hook/useSharedValue.ts +22 -0
- package/src/reanimated2/hook/utils.ts +259 -0
- package/src/reanimated2/index.ts +3 -2
- package/src/reanimated2/interpolation.ts +170 -101
- package/src/reanimated2/jestUtils.ts +0 -12
- package/src/reanimated2/js-reanimated/JSReanimated.ts +47 -22
- package/src/reanimated2/js-reanimated/Mapper.ts +1 -1
- package/src/reanimated2/js-reanimated/index.ts +71 -0
- package/src/reanimated2/layoutReanimation/LayoutAnimationRepository.tsx +62 -0
- package/src/reanimated2/layoutReanimation/animationBuilder/BaseAnimationBuilder.ts +91 -0
- package/src/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.ts +169 -0
- package/src/reanimated2/layoutReanimation/animationBuilder/Keyframe.ts +263 -0
- package/src/reanimated2/layoutReanimation/animationBuilder/commonTypes.ts +78 -0
- package/src/reanimated2/layoutReanimation/animationBuilder/index.ts +16 -0
- package/src/reanimated2/layoutReanimation/defaultAnimations/Bounce.ts +243 -121
- package/src/reanimated2/layoutReanimation/defaultAnimations/Default.ts +43 -0
- package/src/reanimated2/layoutReanimation/defaultAnimations/Fade.ts +95 -53
- package/src/reanimated2/layoutReanimation/defaultAnimations/Flip.ts +114 -64
- package/src/reanimated2/layoutReanimation/defaultAnimations/Lightspeed.ts +179 -0
- package/src/reanimated2/layoutReanimation/defaultAnimations/Pinwheel.ts +93 -0
- package/src/reanimated2/layoutReanimation/defaultAnimations/Roll.ts +132 -0
- package/src/reanimated2/layoutReanimation/defaultAnimations/Rotate.ts +333 -0
- package/src/reanimated2/layoutReanimation/defaultAnimations/Slide.ts +84 -50
- package/src/reanimated2/layoutReanimation/defaultAnimations/Stretch.ts +41 -23
- package/src/reanimated2/layoutReanimation/defaultAnimations/Zoom.ts +234 -154
- package/src/reanimated2/layoutReanimation/defaultAnimations/index.ts +4 -0
- package/src/reanimated2/layoutReanimation/defaultTransitions/CurvedTransition.ts +104 -0
- package/src/reanimated2/layoutReanimation/defaultTransitions/EntryExitTransition.ts +213 -0
- package/src/reanimated2/layoutReanimation/defaultTransitions/FadingTransition.ts +60 -0
- package/src/reanimated2/layoutReanimation/defaultTransitions/JumpingTransition.ts +58 -0
- package/src/reanimated2/layoutReanimation/defaultTransitions/LinearTransition.ts +41 -0
- package/src/reanimated2/layoutReanimation/defaultTransitions/SequencedTransition.ts +78 -0
- package/src/reanimated2/layoutReanimation/defaultTransitions/index.ts +6 -0
- package/src/reanimated2/layoutReanimation/index.ts +3 -2
- package/src/reanimated2/platform-specific/RNRenderer.web.ts +2 -0
- package/src/reanimated2/utils.ts +21 -0
- package/android/react-native-reanimated-62-hermes.aar +0 -0
- package/android/react-native-reanimated-62-jsc.aar +0 -0
- package/ios/LayoutReanimation/REAAnimationRootView.h +0 -12
- package/ios/LayoutReanimation/REAAnimationRootView.m +0 -16
- package/ios/LayoutReanimation/REAAnimationRootViewManager.h +0 -9
- package/ios/LayoutReanimation/REAAnimationRootViewManager.m +0 -49
- package/ios/LayoutReanimation/REAReactBatchObserver.h +0 -20
- package/ios/LayoutReanimation/REAReactBatchObserver.m +0 -125
- package/ios/LayoutReanimation/REASnapshooter.h +0 -19
- package/ios/LayoutReanimation/REASnapshooter.m +0 -64
- package/ios/LayoutReanimation/REAViewTraverser.h +0 -13
- package/ios/LayoutReanimation/REAViewTraverser.m +0 -40
- package/lib/reanimated2/Hooks.js +0 -732
- package/lib/reanimated2/NativeReanimated.js +0 -4
- package/lib/reanimated2/animations.js +0 -713
- package/lib/reanimated2/js-reanimated/index.web.js +0 -20
- package/lib/reanimated2/layoutReanimation/AnimatedRoot.js +0 -55
- package/lib/reanimated2/layoutReanimation/defaultAnimationsBuilder.js +0 -374
- package/src/reanimated2/Hooks.ts +0 -918
- package/src/reanimated2/NativeReanimated.native.ts +0 -61
- package/src/reanimated2/NativeReanimated.ts +0 -5
- package/src/reanimated2/animations.ts +0 -868
- package/src/reanimated2/js-reanimated/index.js +0 -0
- package/src/reanimated2/js-reanimated/index.web.ts +0 -29
- package/src/reanimated2/layoutReanimation/AnimatedRoot.tsx +0 -68
- package/src/reanimated2/layoutReanimation/defaultAnimationsBuilder.ts +0 -440
|
File without changes
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
2
|
-
// @ts-nocheck
|
|
3
|
-
import JSReanimated from './JSReanimated';
|
|
4
|
-
|
|
5
|
-
const reanimatedJS = new JSReanimated();
|
|
6
|
-
|
|
7
|
-
global._frameTimestamp = null;
|
|
8
|
-
|
|
9
|
-
export const _updatePropsJS = (_viewTag, _viewName, updates, viewRef) => {
|
|
10
|
-
if (viewRef.current && viewRef.current._component) {
|
|
11
|
-
const [rawStyles] = Object.keys(updates).reduce(
|
|
12
|
-
(acc, key) => {
|
|
13
|
-
const value = updates[key];
|
|
14
|
-
const index = typeof value === 'function' ? 1 : 0;
|
|
15
|
-
acc[index][key] = value;
|
|
16
|
-
return acc;
|
|
17
|
-
},
|
|
18
|
-
[{}, {}]
|
|
19
|
-
);
|
|
20
|
-
|
|
21
|
-
viewRef.current._component.setNativeProps({ style: rawStyles });
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
global._setGlobalConsole = (_val) => {
|
|
26
|
-
// noop
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
export default reanimatedJS;
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
/* global _stopObservingProgress, _startObservingProgress */
|
|
2
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
3
|
-
// @ts-nocheck
|
|
4
|
-
import { Platform, requireNativeComponent } from 'react-native';
|
|
5
|
-
import React from 'react';
|
|
6
|
-
import { runOnUI } from '../core';
|
|
7
|
-
import { withStyleAnimation } from '../animations';
|
|
8
|
-
|
|
9
|
-
let REALayoutView;
|
|
10
|
-
if (Platform.OS === 'web' && !requireNativeComponent) {
|
|
11
|
-
REALayoutView = React.Component;
|
|
12
|
-
} else {
|
|
13
|
-
REALayoutView = (requireNativeComponent(
|
|
14
|
-
'REALayoutView'
|
|
15
|
-
) as any) as React.Component;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export class AnimatedLayout extends React.Component<
|
|
19
|
-
Record<string, unknown>,
|
|
20
|
-
Record<string, unknown>
|
|
21
|
-
> {
|
|
22
|
-
render() {
|
|
23
|
-
return <REALayoutView collapsable={false} {...this.props} />;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
// Register LayoutAnimationRepository
|
|
28
|
-
|
|
29
|
-
runOnUI(() => {
|
|
30
|
-
'worklet';
|
|
31
|
-
|
|
32
|
-
const configs = {};
|
|
33
|
-
|
|
34
|
-
global.LayoutAnimationRepository = {
|
|
35
|
-
configs,
|
|
36
|
-
registerConfig(tag, config) {
|
|
37
|
-
configs[tag] = config;
|
|
38
|
-
},
|
|
39
|
-
removeConfig(tag) {
|
|
40
|
-
delete configs[tag];
|
|
41
|
-
},
|
|
42
|
-
startAnimationForTag(tag, type, yogaValues) {
|
|
43
|
-
if (configs[tag] == null) {
|
|
44
|
-
return; // :(
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
if (typeof configs[tag][type] !== 'function') {
|
|
48
|
-
console.error(`${type} animation for a tag: ${tag} it not a function!`);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
const style = configs[tag][type](yogaValues);
|
|
52
|
-
const sv = configs[tag].sv;
|
|
53
|
-
_stopObservingProgress(tag, false);
|
|
54
|
-
_startObservingProgress(tag, sv);
|
|
55
|
-
sv._value = Object.assign({}, sv._value, style.initialValues);
|
|
56
|
-
_stopObservingProgress(tag, false);
|
|
57
|
-
const animation = withStyleAnimation(style.animations);
|
|
58
|
-
|
|
59
|
-
animation.callback = (finished) => {
|
|
60
|
-
if (finished) {
|
|
61
|
-
_stopObservingProgress(tag, finished);
|
|
62
|
-
}
|
|
63
|
-
};
|
|
64
|
-
configs[tag].sv.value = animation;
|
|
65
|
-
_startObservingProgress(tag, sv);
|
|
66
|
-
},
|
|
67
|
-
};
|
|
68
|
-
})();
|
|
@@ -1,440 +0,0 @@
|
|
|
1
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
2
|
-
// @ts-nocheck
|
|
3
|
-
import { withDelay, withSpring, withTiming } from '../animations';
|
|
4
|
-
|
|
5
|
-
export const DefaultEntering = (targetValues) => {
|
|
6
|
-
'worklet';
|
|
7
|
-
return {
|
|
8
|
-
initialValues: {
|
|
9
|
-
originX: targetValues.originX,
|
|
10
|
-
originY: targetValues.originY,
|
|
11
|
-
width: targetValues.width,
|
|
12
|
-
height: targetValues.height,
|
|
13
|
-
},
|
|
14
|
-
animations: {},
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
export const DefaultLayout = (_) => {
|
|
19
|
-
'worklet';
|
|
20
|
-
return {
|
|
21
|
-
initialValues: {},
|
|
22
|
-
animations: {},
|
|
23
|
-
};
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
export const DefaultExiting = (startValues) => {
|
|
27
|
-
'worklet';
|
|
28
|
-
return {
|
|
29
|
-
initialValues: {
|
|
30
|
-
originX: startValues.originX,
|
|
31
|
-
originY: startValues.originY,
|
|
32
|
-
width: startValues.width,
|
|
33
|
-
height: startValues.height,
|
|
34
|
-
},
|
|
35
|
-
animations: {},
|
|
36
|
-
};
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
export class Layout {
|
|
40
|
-
static duration(r) {
|
|
41
|
-
const instance = new Layout();
|
|
42
|
-
return instance.duration(r);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
duration(t) {
|
|
46
|
-
this.durationV = t;
|
|
47
|
-
return this;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
static easing(r) {
|
|
51
|
-
const instance = new Layout();
|
|
52
|
-
return instance.easing(r);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
easing(e) {
|
|
56
|
-
this.easingV = e;
|
|
57
|
-
return this;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
static delay(r) {
|
|
61
|
-
const instance = new Layout();
|
|
62
|
-
return instance.delay(r);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
delay(d) {
|
|
66
|
-
this.delayV = d;
|
|
67
|
-
return this;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
static springify() {
|
|
71
|
-
const instance = new Layout();
|
|
72
|
-
return instance.springify();
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
springify() {
|
|
76
|
-
this.type = withSpring;
|
|
77
|
-
return this;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
static damping(r) {
|
|
81
|
-
const instance = new Layout();
|
|
82
|
-
return instance.damping(r);
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
damping(d) {
|
|
86
|
-
this.dampingV = d;
|
|
87
|
-
return this;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
static mass(r) {
|
|
91
|
-
const instance = new Layout();
|
|
92
|
-
return instance.mass(r);
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
mass(m) {
|
|
96
|
-
this.massV = m;
|
|
97
|
-
return this;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
static stiffness(r) {
|
|
101
|
-
const instance = new Layout();
|
|
102
|
-
return instance.stiffness(r);
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
stiffness(s) {
|
|
106
|
-
this.stiffnessV = s;
|
|
107
|
-
return this;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
static overshootClamping(r) {
|
|
111
|
-
const instance = new Layout();
|
|
112
|
-
return instance.overshootClamping(r);
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
overshootClamping(o) {
|
|
116
|
-
this.overshootClampingV = o;
|
|
117
|
-
return this;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
static restDisplacementThreshold(r) {
|
|
121
|
-
const instance = new Layout();
|
|
122
|
-
return instance.restDisplacementThreshold(r);
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
restDisplacementThreshold(r) {
|
|
126
|
-
this.restDisplacementThresholdV = r;
|
|
127
|
-
return this;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
static restSpeedThreshold(r) {
|
|
131
|
-
const instance = new Layout();
|
|
132
|
-
return instance.restSpeedThreshold(r);
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
restSpeedThreshold(r) {
|
|
136
|
-
this.restSpeedThresholdV = r;
|
|
137
|
-
return this;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
static build() {
|
|
141
|
-
const instance = new Layout();
|
|
142
|
-
return instance.build();
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
build() {
|
|
146
|
-
const duration = this.durationV;
|
|
147
|
-
const easing = this.easingV;
|
|
148
|
-
const delay = this.delayV;
|
|
149
|
-
const type = this.type ? this.type : withTiming;
|
|
150
|
-
const damping = this.dampingV;
|
|
151
|
-
const mass = this.massV;
|
|
152
|
-
const stiffness = this.stiffnessV;
|
|
153
|
-
const overshootClamping = this.overshootClampingV;
|
|
154
|
-
const restDisplacementThreshold = this.restDisplacementThresholdV;
|
|
155
|
-
const restSpeedThreshold = this.restSpeedThresholdV;
|
|
156
|
-
|
|
157
|
-
const delayFunction = delay
|
|
158
|
-
? withDelay
|
|
159
|
-
: (_, animation) => {
|
|
160
|
-
'worklet';
|
|
161
|
-
return animation;
|
|
162
|
-
};
|
|
163
|
-
|
|
164
|
-
const animation = type;
|
|
165
|
-
|
|
166
|
-
const config = {};
|
|
167
|
-
|
|
168
|
-
if (type === withTiming) {
|
|
169
|
-
if (easing) {
|
|
170
|
-
config.easing = easing;
|
|
171
|
-
}
|
|
172
|
-
if (duration) {
|
|
173
|
-
config.duration = duration;
|
|
174
|
-
}
|
|
175
|
-
} else {
|
|
176
|
-
if (damping) {
|
|
177
|
-
config.damping = damping;
|
|
178
|
-
}
|
|
179
|
-
if (mass) {
|
|
180
|
-
config.mass = mass;
|
|
181
|
-
}
|
|
182
|
-
if (stiffness) {
|
|
183
|
-
config.stiffness = stiffness;
|
|
184
|
-
}
|
|
185
|
-
if (overshootClamping) {
|
|
186
|
-
config.overshootClamping = overshootClamping;
|
|
187
|
-
}
|
|
188
|
-
if (restDisplacementThreshold) {
|
|
189
|
-
config.restDisplacementThreshold = restDisplacementThreshold;
|
|
190
|
-
}
|
|
191
|
-
if (restSpeedThreshold) {
|
|
192
|
-
config.restSpeedThreshold = restSpeedThreshold;
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
return (values) => {
|
|
197
|
-
'worklet';
|
|
198
|
-
return {
|
|
199
|
-
initialValues: {
|
|
200
|
-
originX: values.boriginX,
|
|
201
|
-
originY: values.boriginY,
|
|
202
|
-
width: values.bwidth,
|
|
203
|
-
height: values.bheight,
|
|
204
|
-
},
|
|
205
|
-
animations: {
|
|
206
|
-
originX: delayFunction(delay, animation(values.originX, config)),
|
|
207
|
-
originY: delayFunction(delay, animation(values.originY, config)),
|
|
208
|
-
width: delayFunction(delay, animation(values.width, config)),
|
|
209
|
-
height: delayFunction(delay, animation(values.height, config)),
|
|
210
|
-
},
|
|
211
|
-
};
|
|
212
|
-
};
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
export class BaseAnimationBuilder {
|
|
217
|
-
static duration(r) {
|
|
218
|
-
const instance = this.createInstance();
|
|
219
|
-
return instance.duration(r);
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
duration(t) {
|
|
223
|
-
this.durationV = t;
|
|
224
|
-
return this;
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
static easing(r) {
|
|
228
|
-
const instance = this.createInstance();
|
|
229
|
-
return instance.easing(r);
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
easing(e) {
|
|
233
|
-
this.easingV = e;
|
|
234
|
-
return this;
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
static delay(r) {
|
|
238
|
-
const instance = this.createInstance();
|
|
239
|
-
return instance.delay(r);
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
delay(d) {
|
|
243
|
-
this.delayV = d;
|
|
244
|
-
return this;
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
static rotate(r) {
|
|
248
|
-
const instance = this.createInstance();
|
|
249
|
-
return instance.rotate(r);
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
rotate(v) {
|
|
253
|
-
this.rotateV = v;
|
|
254
|
-
return this;
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
static springify() {
|
|
258
|
-
const instance = this.createInstance();
|
|
259
|
-
return instance.springify();
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
springify() {
|
|
263
|
-
this.type = withSpring;
|
|
264
|
-
return this;
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
static damping(r) {
|
|
268
|
-
const instance = this.createInstance();
|
|
269
|
-
return instance.damping(r);
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
damping(d) {
|
|
273
|
-
this.dampingV = d;
|
|
274
|
-
return this;
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
static mass(r) {
|
|
278
|
-
const instance = this.createInstance();
|
|
279
|
-
return instance.mass(r);
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
mass(m) {
|
|
283
|
-
this.massV = m;
|
|
284
|
-
return this;
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
static stiffness(r) {
|
|
288
|
-
const instance = this.createInstance();
|
|
289
|
-
return instance.stiffness(r);
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
stiffness(s) {
|
|
293
|
-
this.stiffnessV = s;
|
|
294
|
-
return this;
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
static overshootClamping(r) {
|
|
298
|
-
const instance = this.createInstance();
|
|
299
|
-
return instance.overshootClamping(r);
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
overshootClamping(o) {
|
|
303
|
-
this.overshootClampingV = o;
|
|
304
|
-
return this;
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
static restDisplacementThreshold(r) {
|
|
308
|
-
const instance = this.createInstance();
|
|
309
|
-
return instance.restDisplacementThreshold(r);
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
restDisplacementThreshold(r) {
|
|
313
|
-
this.restDisplacementThresholdV = r;
|
|
314
|
-
return this;
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
static restSpeedThreshold(r) {
|
|
318
|
-
const instance = this.createInstance();
|
|
319
|
-
return instance.restSpeedThreshold(r);
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
restSpeedThreshold(r) {
|
|
323
|
-
this.restSpeedThresholdV = r;
|
|
324
|
-
return this;
|
|
325
|
-
}
|
|
326
|
-
|
|
327
|
-
static build() {
|
|
328
|
-
const instance = this.createInstance();
|
|
329
|
-
return instance.build();
|
|
330
|
-
}
|
|
331
|
-
|
|
332
|
-
getDelayFunction() {
|
|
333
|
-
const delay = this.delayV;
|
|
334
|
-
return delay
|
|
335
|
-
? withDelay
|
|
336
|
-
: (_, animation) => {
|
|
337
|
-
'worklet';
|
|
338
|
-
return animation;
|
|
339
|
-
};
|
|
340
|
-
}
|
|
341
|
-
|
|
342
|
-
getAnimationAndConfig() {
|
|
343
|
-
const duration = this.durationV;
|
|
344
|
-
const easing = this.easingV;
|
|
345
|
-
const type = this.type ? this.type : withTiming;
|
|
346
|
-
const damping = this.dampingV;
|
|
347
|
-
const mass = this.massV;
|
|
348
|
-
const stiffness = this.stiffnessV;
|
|
349
|
-
const overshootClamping = this.overshootClampingV;
|
|
350
|
-
const restDisplacementThreshold = this.restDisplacementThresholdV;
|
|
351
|
-
const restSpeedThreshold = this.restSpeedThresholdV;
|
|
352
|
-
|
|
353
|
-
const animation = type;
|
|
354
|
-
|
|
355
|
-
const config = {};
|
|
356
|
-
|
|
357
|
-
if (type === withTiming) {
|
|
358
|
-
if (easing) {
|
|
359
|
-
config.easing = easing;
|
|
360
|
-
}
|
|
361
|
-
if (duration) {
|
|
362
|
-
config.duration = duration;
|
|
363
|
-
}
|
|
364
|
-
} else {
|
|
365
|
-
if (damping) {
|
|
366
|
-
config.damping = damping;
|
|
367
|
-
}
|
|
368
|
-
if (mass) {
|
|
369
|
-
config.mass = mass;
|
|
370
|
-
}
|
|
371
|
-
if (stiffness) {
|
|
372
|
-
config.stiffness = stiffness;
|
|
373
|
-
}
|
|
374
|
-
if (overshootClamping) {
|
|
375
|
-
config.overshootClamping = overshootClamping;
|
|
376
|
-
}
|
|
377
|
-
if (restDisplacementThreshold) {
|
|
378
|
-
config.restDisplacementThreshold = restDisplacementThreshold;
|
|
379
|
-
}
|
|
380
|
-
if (restSpeedThreshold) {
|
|
381
|
-
config.restSpeedThreshold = restSpeedThreshold;
|
|
382
|
-
}
|
|
383
|
-
}
|
|
384
|
-
return [animation, config];
|
|
385
|
-
}
|
|
386
|
-
}
|
|
387
|
-
|
|
388
|
-
export class BaseBounceAnimationBuilder {
|
|
389
|
-
static duration(r) {
|
|
390
|
-
const instance = this.createInstance();
|
|
391
|
-
return instance.duration(r);
|
|
392
|
-
}
|
|
393
|
-
|
|
394
|
-
duration(t) {
|
|
395
|
-
this.durationV = t;
|
|
396
|
-
return this;
|
|
397
|
-
}
|
|
398
|
-
|
|
399
|
-
static delay(r) {
|
|
400
|
-
const instance = this.createInstance();
|
|
401
|
-
return instance.delay(r);
|
|
402
|
-
}
|
|
403
|
-
|
|
404
|
-
delay(d) {
|
|
405
|
-
this.delayV = d;
|
|
406
|
-
return this;
|
|
407
|
-
}
|
|
408
|
-
|
|
409
|
-
getDelayFunction() {
|
|
410
|
-
const delay = this.delayV;
|
|
411
|
-
return delay
|
|
412
|
-
? withDelay
|
|
413
|
-
: (_, animation) => {
|
|
414
|
-
'worklet';
|
|
415
|
-
return animation;
|
|
416
|
-
};
|
|
417
|
-
}
|
|
418
|
-
|
|
419
|
-
getAnimationAndConfig() {
|
|
420
|
-
const duration = this.durationV;
|
|
421
|
-
const type = withTiming;
|
|
422
|
-
const animation = type;
|
|
423
|
-
|
|
424
|
-
const config = {};
|
|
425
|
-
|
|
426
|
-
if (easing) {
|
|
427
|
-
config.easing = easing;
|
|
428
|
-
}
|
|
429
|
-
if (duration) {
|
|
430
|
-
config.duration = duration;
|
|
431
|
-
}
|
|
432
|
-
|
|
433
|
-
return [animation, config];
|
|
434
|
-
}
|
|
435
|
-
|
|
436
|
-
static build() {
|
|
437
|
-
const instance = this.createInstance();
|
|
438
|
-
return instance.build();
|
|
439
|
-
}
|
|
440
|
-
}
|