react-native-reanimated 3.8.1 → 3.9.0-layout-animation-experimental
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/Fabric/ShadowTreeCloner.cpp +5 -2
- package/Common/cpp/LayoutAnimations/LayoutAnimationsManager.cpp +42 -32
- package/Common/cpp/LayoutAnimations/LayoutAnimationsManager.h +5 -7
- package/Common/cpp/LayoutAnimations/LayoutAnimationsProxy.cpp +565 -0
- package/Common/cpp/LayoutAnimations/LayoutAnimationsProxy.h +74 -0
- package/Common/cpp/LayoutAnimations/LayoutAnimationsUtils.h +140 -0
- package/Common/cpp/NativeModules/NativeReanimatedModule.cpp +216 -58
- package/Common/cpp/NativeModules/NativeReanimatedModule.h +32 -11
- package/Common/cpp/NativeModules/NativeReanimatedModuleSpec.cpp +2 -17
- package/Common/cpp/NativeModules/NativeReanimatedModuleSpec.h +6 -8
- package/Common/cpp/ReanimatedRuntime/RNRuntimeDecorator.cpp +3 -0
- package/Common/cpp/ReanimatedRuntime/WorkletRuntime.cpp +3 -4
- package/Common/cpp/ReanimatedRuntime/WorkletRuntimeDecorator.cpp +8 -3
- package/Common/cpp/SharedItems/Shareables.cpp +31 -5
- package/Common/cpp/SharedItems/Shareables.h +18 -2
- package/Common/cpp/Tools/JSScheduler.cpp +29 -5
- package/Common/cpp/Tools/JSScheduler.h +21 -4
- package/Common/cpp/Tools/PlatformDepMethodsHolder.h +6 -2
- package/Common/cpp/Tools/UIRuntimeDecorator.cpp +6 -0
- package/Common/cpp/Tools/UIRuntimeDecorator.h +1 -0
- package/android/CMakeLists.txt +3 -0
- package/android/build.gradle +17 -5
- package/android/src/main/cpp/NativeProxy.cpp +77 -12
- package/android/src/main/cpp/NativeProxy.h +35 -1
- package/android/src/main/java/com/swmansion/reanimated/NodesManager.java +58 -19
- package/android/src/main/java/com/swmansion/reanimated/ReanimatedPackage.java +7 -2
- package/android/src/{reactNativeVersionPatch/ReanimatedUIManager/latest → main/java}/com/swmansion/reanimated/ReanimatedUIManagerFactory.java +5 -5
- package/android/src/main/java/com/swmansion/reanimated/layoutReanimation/AnimationsManager.java +10 -6
- package/android/src/main/java/com/swmansion/reanimated/layoutReanimation/ReanimatedNativeHierarchyManager.java +18 -1
- package/android/src/main/java/com/swmansion/reanimated/layoutReanimation/SharedTransitionManager.java +105 -17
- package/android/src/main/java/com/swmansion/reanimated/sensor/ReanimatedSensor.java +2 -1
- package/android/src/paper/java/com/swmansion/reanimated/NativeReanimatedModuleSpec.java +37 -0
- package/android/src/{main/java/com/swmansion/reanimated → reactNativeVersionPatch/ReanimatedUIManager/73/com/swmansion}/ReanimatedModule.java +4 -3
- package/android/src/reactNativeVersionPatch/ReanimatedUIManager/{70 → 73}/com/swmansion/reanimated/layoutReanimation/ReanimatedUIManager.java +1 -22
- package/android/src/reactNativeVersionPatch/ReanimatedUIManager/latest/com/swmansion/reanimated/ReanimatedModule.java +176 -0
- package/android/src/reactNativeVersionPatch/ReanimatedUIManager/latest/com/swmansion/reanimated/layoutReanimation/ReanimatedUIManager.java +0 -26
- package/android/src/{fabric/java → reactNativeVersionPatch/RuntimeExecutor/73}/com/swmansion/reanimated/NativeProxy.java +16 -4
- package/android/src/reactNativeVersionPatch/RuntimeExecutor/latest/com/swmansion/reanimated/NativeProxy.java +143 -0
- package/apple/LayoutReanimation/REAAnimationsManager.h +3 -0
- package/apple/LayoutReanimation/REAAnimationsManager.m +11 -0
- package/apple/LayoutReanimation/REASharedTransitionManager.m +99 -23
- package/apple/LayoutReanimation/REASnapshot.h +1 -0
- package/apple/LayoutReanimation/REASnapshot.m +78 -37
- package/apple/REAModule.h +22 -2
- package/apple/REAModule.mm +97 -46
- package/apple/REANodesManager.h +3 -3
- package/apple/REANodesManager.mm +46 -22
- package/apple/native/NativeProxy.h +28 -2
- package/apple/native/NativeProxy.mm +65 -195
- package/apple/native/PlatformDepMethodsHolderImpl.h +59 -0
- package/apple/native/PlatformDepMethodsHolderImpl.mm +429 -0
- package/apple/sensor/ReanimatedSensor.m +5 -5
- package/lib/module/Animated.js.map +1 -1
- package/lib/module/ConfigHelper.js +1 -1
- package/lib/module/ConfigHelper.js.map +1 -1
- package/lib/module/animationBuilder.js.map +1 -1
- package/lib/module/createAnimatedComponent/InlinePropManager.js +4 -4
- package/lib/module/createAnimatedComponent/InlinePropManager.js.map +1 -1
- package/lib/module/createAnimatedComponent/JSPropsUpdater.js +9 -6
- package/lib/module/createAnimatedComponent/JSPropsUpdater.js.map +1 -1
- package/lib/module/createAnimatedComponent/JSPropsUpdater.web.js +11 -0
- package/lib/module/createAnimatedComponent/JSPropsUpdater.web.js.map +1 -0
- package/lib/module/createAnimatedComponent/PropsFilter.js +25 -9
- package/lib/module/createAnimatedComponent/PropsFilter.js.map +1 -1
- package/lib/module/createAnimatedComponent/commonTypes.js.map +1 -1
- package/lib/module/createAnimatedComponent/createAnimatedComponent.js +83 -52
- package/lib/module/createAnimatedComponent/createAnimatedComponent.js.map +1 -1
- package/lib/module/createAnimatedComponent/getViewInfo.js +37 -0
- package/lib/module/createAnimatedComponent/getViewInfo.js.map +1 -0
- package/lib/module/createAnimatedComponent/index.js.map +1 -1
- package/lib/module/createAnimatedComponent/setAndForwardRef.js +4 -5
- package/lib/module/createAnimatedComponent/setAndForwardRef.js.map +1 -1
- package/lib/module/createAnimatedComponent/utils.js.map +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/index.web.js +1 -2
- package/lib/module/index.web.js.map +1 -1
- package/lib/module/mock.js +3 -8
- package/lib/module/mock.js.map +1 -1
- package/lib/module/propsAllowlists.js.map +1 -1
- package/lib/module/reanimated2/Bezier.js.map +1 -1
- package/lib/module/reanimated2/Colors.js +4 -11
- package/lib/module/reanimated2/Colors.js.map +1 -1
- package/lib/module/reanimated2/Easing.js +3 -7
- package/lib/module/reanimated2/Easing.js.map +1 -1
- package/lib/module/reanimated2/NativeReanimated/NativeReanimated.js +16 -13
- package/lib/module/reanimated2/NativeReanimated/NativeReanimated.js.map +1 -1
- package/lib/module/reanimated2/NativeReanimated/index.js.map +1 -1
- package/lib/module/reanimated2/NativeReanimated/index.web.js.map +1 -1
- package/lib/module/reanimated2/PlatformChecker.js +2 -1
- package/lib/module/reanimated2/PlatformChecker.js.map +1 -1
- package/lib/module/reanimated2/PropAdapters.js +1 -1
- package/lib/module/reanimated2/PropAdapters.js.map +1 -1
- package/lib/module/reanimated2/PropsRegistry.js +1 -2
- package/lib/module/reanimated2/PropsRegistry.js.map +1 -1
- package/lib/module/reanimated2/Sensor.js +2 -2
- package/lib/module/reanimated2/Sensor.js.map +1 -1
- package/lib/module/reanimated2/SensorContainer.js +2 -2
- package/lib/module/reanimated2/SensorContainer.js.map +1 -1
- package/lib/module/reanimated2/UpdateLayoutAnimations.js +30 -8
- package/lib/module/reanimated2/UpdateLayoutAnimations.js.map +1 -1
- package/lib/module/reanimated2/UpdateProps.js.map +1 -1
- package/lib/module/reanimated2/ViewDescriptorsSet.js.map +1 -1
- package/lib/module/reanimated2/WorkletEventHandler.js +74 -31
- package/lib/module/reanimated2/WorkletEventHandler.js.map +1 -1
- package/lib/module/reanimated2/animation/clamp.js.map +1 -1
- package/lib/module/reanimated2/animation/commonTypes.js.map +1 -1
- package/lib/module/reanimated2/animation/decay/decay.js.map +1 -1
- package/lib/module/reanimated2/animation/decay/index.js.map +1 -1
- package/lib/module/reanimated2/animation/decay/rigidDecay.js.map +1 -1
- package/lib/module/reanimated2/animation/decay/rubberBandDecay.js.map +1 -1
- package/lib/module/reanimated2/animation/decay/utils.js.map +1 -1
- package/lib/module/reanimated2/animation/delay.js.map +1 -1
- package/lib/module/reanimated2/animation/index.js.map +1 -1
- package/lib/module/reanimated2/animation/repeat.js +1 -6
- package/lib/module/reanimated2/animation/repeat.js.map +1 -1
- package/lib/module/reanimated2/animation/sequence.js +1 -5
- package/lib/module/reanimated2/animation/sequence.js.map +1 -1
- package/lib/module/reanimated2/animation/spring.js.map +1 -1
- package/lib/module/reanimated2/animation/springUtils.js +8 -10
- package/lib/module/reanimated2/animation/springUtils.js.map +1 -1
- package/lib/module/reanimated2/animation/styleAnimation.js +5 -4
- package/lib/module/reanimated2/animation/styleAnimation.js.map +1 -1
- package/lib/module/reanimated2/animation/timing.js +4 -1
- package/lib/module/reanimated2/animation/timing.js.map +1 -1
- package/lib/module/reanimated2/animation/transformationMatrix/matrixUtils.js +1 -2
- package/lib/module/reanimated2/animation/transformationMatrix/matrixUtils.js.map +1 -1
- package/lib/module/reanimated2/animation/util.js +22 -2
- package/lib/module/reanimated2/animation/util.js.map +1 -1
- package/lib/module/reanimated2/commonTypes.js +3 -1
- package/lib/module/reanimated2/commonTypes.js.map +1 -1
- package/lib/module/reanimated2/component/FlatList.js +1 -0
- package/lib/module/reanimated2/component/FlatList.js.map +1 -1
- package/lib/module/reanimated2/component/Image.js +1 -0
- package/lib/module/reanimated2/component/Image.js.map +1 -1
- package/lib/module/reanimated2/component/LayoutAnimationConfig.js +1 -0
- package/lib/module/reanimated2/component/LayoutAnimationConfig.js.map +1 -1
- package/lib/module/reanimated2/component/PerformanceMonitor.js +169 -0
- package/lib/module/reanimated2/component/PerformanceMonitor.js.map +1 -0
- package/lib/module/reanimated2/component/ScrollView.js +1 -0
- package/lib/module/reanimated2/component/ScrollView.js.map +1 -1
- package/lib/module/reanimated2/component/Text.js +1 -0
- package/lib/module/reanimated2/component/Text.js.map +1 -1
- package/lib/module/reanimated2/component/View.js +1 -0
- package/lib/module/reanimated2/component/View.js.map +1 -1
- package/lib/module/reanimated2/core.js +6 -15
- package/lib/module/reanimated2/core.js.map +1 -1
- package/lib/module/reanimated2/errors.js +8 -8
- package/lib/module/reanimated2/errors.js.map +1 -1
- package/lib/module/reanimated2/fabricUtils.js +33 -8
- package/lib/module/reanimated2/fabricUtils.js.map +1 -1
- package/lib/module/reanimated2/fabricUtils.web.js.map +1 -1
- package/lib/module/reanimated2/frameCallback/FrameCallbackRegistryJS.js +2 -2
- package/lib/module/reanimated2/frameCallback/FrameCallbackRegistryJS.js.map +1 -1
- package/lib/module/reanimated2/frameCallback/FrameCallbackRegistryUI.js.map +1 -1
- package/lib/module/reanimated2/frameCallback/index.js.map +1 -1
- package/lib/module/reanimated2/globals.d.js.map +1 -1
- package/lib/module/reanimated2/helperTypes.js.map +1 -1
- package/lib/module/reanimated2/hook/commonTypes.js.map +1 -1
- package/lib/module/reanimated2/hook/index.js.map +1 -1
- package/lib/module/reanimated2/hook/useAnimatedGestureHandler.js +1 -0
- package/lib/module/reanimated2/hook/useAnimatedGestureHandler.js.map +1 -1
- package/lib/module/reanimated2/hook/useAnimatedKeyboard.js +3 -4
- package/lib/module/reanimated2/hook/useAnimatedKeyboard.js.map +1 -1
- package/lib/module/reanimated2/hook/useAnimatedProps.js.map +1 -1
- package/lib/module/reanimated2/hook/useAnimatedReaction.js +1 -0
- package/lib/module/reanimated2/hook/useAnimatedReaction.js.map +1 -1
- package/lib/module/reanimated2/hook/useAnimatedRef.js +12 -7
- package/lib/module/reanimated2/hook/useAnimatedRef.js.map +1 -1
- package/lib/module/reanimated2/hook/useAnimatedScrollHandler.js +3 -1
- package/lib/module/reanimated2/hook/useAnimatedScrollHandler.js.map +1 -1
- package/lib/module/reanimated2/hook/useAnimatedSensor.js.map +1 -1
- package/lib/module/reanimated2/hook/useAnimatedStyle.js +3 -6
- package/lib/module/reanimated2/hook/useAnimatedStyle.js.map +1 -1
- package/lib/module/reanimated2/hook/useDerivedValue.js +3 -1
- package/lib/module/reanimated2/hook/useDerivedValue.js.map +1 -1
- package/lib/module/reanimated2/hook/useEvent.js +4 -5
- package/lib/module/reanimated2/hook/useEvent.js.map +1 -1
- package/lib/module/reanimated2/hook/useFrameCallback.js +1 -2
- package/lib/module/reanimated2/hook/useFrameCallback.js.map +1 -1
- package/lib/module/reanimated2/hook/useHandler.js +3 -1
- package/lib/module/reanimated2/hook/useHandler.js.map +1 -1
- package/lib/module/reanimated2/hook/useReducedMotion.js.map +1 -1
- package/lib/module/reanimated2/hook/useScrollViewOffset.js +60 -16
- package/lib/module/reanimated2/hook/useScrollViewOffset.js.map +1 -1
- package/lib/module/reanimated2/hook/useSharedValue.js.map +1 -1
- package/lib/module/reanimated2/hook/useWorkletCallback.js.map +1 -1
- package/lib/module/reanimated2/hook/utils.js.map +1 -1
- package/lib/module/reanimated2/index.js +2 -0
- package/lib/module/reanimated2/index.js.map +1 -1
- package/lib/module/reanimated2/initializers.js +1 -5
- package/lib/module/reanimated2/initializers.js.map +1 -1
- package/lib/module/reanimated2/interpolateColor.js +2 -6
- package/lib/module/reanimated2/interpolateColor.js.map +1 -1
- package/lib/module/reanimated2/interpolation.js +1 -1
- package/lib/module/reanimated2/interpolation.js.map +1 -1
- package/lib/module/reanimated2/isSharedValue.js.map +1 -1
- package/lib/module/reanimated2/jestUtils.js +3 -6
- package/lib/module/reanimated2/jestUtils.js.map +1 -1
- package/lib/module/reanimated2/jestUtils.web.js.map +1 -1
- package/lib/module/reanimated2/js-reanimated/JSReanimated.js +5 -9
- package/lib/module/reanimated2/js-reanimated/JSReanimated.js.map +1 -1
- package/lib/module/reanimated2/js-reanimated/WebSensor.js.map +1 -1
- package/lib/module/reanimated2/js-reanimated/index.js +2 -2
- package/lib/module/reanimated2/js-reanimated/index.js.map +1 -1
- package/lib/module/reanimated2/js-reanimated/react-native-web.d.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/animationBuilder/BaseAnimationBuilder.js +4 -2
- package/lib/module/reanimated2/layoutReanimation/animationBuilder/BaseAnimationBuilder.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.js +12 -11
- package/lib/module/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/animationBuilder/Keyframe.js +12 -10
- package/lib/module/reanimated2/layoutReanimation/animationBuilder/Keyframe.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/animationBuilder/commonTypes.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/animationBuilder/index.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/animationsManager.js +11 -4
- package/lib/module/reanimated2/layoutReanimation/animationsManager.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Bounce.js +22 -22
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Bounce.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Fade.js +22 -22
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Fade.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Flip.js +26 -26
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Flip.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Lightspeed.js +10 -10
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Lightspeed.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Pinwheel.js +6 -6
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Pinwheel.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Roll.js +10 -10
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Roll.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Rotate.js +18 -18
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Rotate.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Slide.js +18 -18
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Slide.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Stretch.js +10 -10
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Stretch.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Zoom.js +34 -34
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Zoom.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/index.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/CurvedTransition.js +17 -4
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/CurvedTransition.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/EntryExitTransition.js +4 -4
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/EntryExitTransition.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/FadingTransition.js +4 -4
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/FadingTransition.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/JumpingTransition.js +4 -4
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/JumpingTransition.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/LinearTransition.js +4 -4
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/LinearTransition.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/SequencedTransition.js +4 -4
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/SequencedTransition.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/index.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/index.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/sharedTransitions/ProgressTransitionManager.js +16 -12
- package/lib/module/reanimated2/layoutReanimation/sharedTransitions/ProgressTransitionManager.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/sharedTransitions/SharedTransition.js +13 -7
- package/lib/module/reanimated2/layoutReanimation/sharedTransitions/SharedTransition.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/sharedTransitions/SharedTransition.web.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/sharedTransitions/index.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/web/animation/Bounce.web.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/web/animation/Fade.web.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/web/animation/Flip.web.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/web/animation/Lightspeed.web.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/web/animation/Pinwheel.web.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/web/animation/Roll.web.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/web/animation/Rotate.web.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/web/animation/Slide.web.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/web/animation/Stretch.web.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/web/animation/Zoom.web.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/web/animationParser.js +0 -2
- package/lib/module/reanimated2/layoutReanimation/web/animationParser.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/web/animationsManager.js +1 -2
- package/lib/module/reanimated2/layoutReanimation/web/animationsManager.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/web/componentStyle.js +3 -1
- package/lib/module/reanimated2/layoutReanimation/web/componentStyle.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/web/componentUtils.js +6 -7
- package/lib/module/reanimated2/layoutReanimation/web/componentUtils.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/web/config.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/web/createAnimation.js +2 -2
- package/lib/module/reanimated2/layoutReanimation/web/createAnimation.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/web/domUtils.js +4 -4
- package/lib/module/reanimated2/layoutReanimation/web/domUtils.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/web/index.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/web/transition/Fading.web.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/web/transition/Linear.web.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/web/transition/Sequenced.web.js.map +1 -1
- package/lib/module/reanimated2/mappers.js +2 -4
- package/lib/module/reanimated2/mappers.js.map +1 -1
- package/lib/module/reanimated2/mockedRequestAnimationFrame.js.map +1 -1
- package/lib/module/reanimated2/mutables.js +2 -4
- package/lib/module/reanimated2/mutables.js.map +1 -1
- package/lib/module/reanimated2/platform-specific/RNRenderer.js.map +1 -1
- package/lib/module/reanimated2/platform-specific/RNRenderer.web.js.map +1 -1
- package/lib/module/reanimated2/platform-specific/checkCppVersion.js.map +1 -1
- package/lib/module/reanimated2/platform-specific/jsVersion.js +1 -1
- package/lib/module/reanimated2/platform-specific/jsVersion.js.map +1 -1
- package/lib/module/reanimated2/platformFunctions/dispatchCommand.js +2 -4
- package/lib/module/reanimated2/platformFunctions/dispatchCommand.js.map +1 -1
- package/lib/module/reanimated2/platformFunctions/dispatchCommand.web.js.map +1 -1
- package/lib/module/reanimated2/platformFunctions/getRelativeCoords.js +2 -2
- package/lib/module/reanimated2/platformFunctions/getRelativeCoords.js.map +1 -1
- package/lib/module/reanimated2/platformFunctions/index.js.map +1 -1
- package/lib/module/reanimated2/platformFunctions/measure.js.map +1 -1
- package/lib/module/reanimated2/platformFunctions/measure.web.js.map +1 -1
- package/lib/module/reanimated2/platformFunctions/scrollTo.js.map +1 -1
- package/lib/module/reanimated2/platformFunctions/scrollTo.web.js +1 -1
- package/lib/module/reanimated2/platformFunctions/scrollTo.web.js.map +1 -1
- package/lib/module/reanimated2/platformFunctions/setGestureState.js.map +1 -1
- package/lib/module/reanimated2/platformFunctions/setGestureState.web.js.map +1 -1
- package/lib/module/reanimated2/platformFunctions/setNativeProps.js.map +1 -1
- package/lib/module/reanimated2/platformFunctions/setNativeProps.web.js.map +1 -1
- package/lib/module/reanimated2/pluginUtils.js.map +1 -1
- package/lib/module/reanimated2/publicGlobals.js.map +1 -1
- package/lib/module/reanimated2/runtimes.js +11 -19
- package/lib/module/reanimated2/runtimes.js.map +1 -1
- package/lib/module/reanimated2/screenTransition/RNScreensTurboModule.js +20 -0
- package/lib/module/reanimated2/screenTransition/RNScreensTurboModule.js.map +1 -0
- package/lib/module/reanimated2/screenTransition/animationManager.js +41 -0
- package/lib/module/reanimated2/screenTransition/animationManager.js.map +1 -0
- package/lib/module/reanimated2/screenTransition/commonTypes.js +4 -0
- package/lib/module/reanimated2/screenTransition/commonTypes.js.map +1 -0
- package/lib/module/reanimated2/screenTransition/index.js +5 -0
- package/lib/module/reanimated2/screenTransition/index.js.map +1 -0
- package/lib/module/reanimated2/screenTransition/presets.js +157 -0
- package/lib/module/reanimated2/screenTransition/presets.js.map +1 -0
- package/lib/module/reanimated2/screenTransition/styleUpdater.js +62 -0
- package/lib/module/reanimated2/screenTransition/styleUpdater.js.map +1 -0
- package/lib/module/reanimated2/screenTransition/swipeSimulator.js +190 -0
- package/lib/module/reanimated2/screenTransition/swipeSimulator.js.map +1 -0
- package/lib/module/reanimated2/shareableMappingCache.js.map +1 -1
- package/lib/module/reanimated2/shareables.js +27 -10
- package/lib/module/reanimated2/shareables.js.map +1 -1
- package/lib/module/reanimated2/threads.js +9 -34
- package/lib/module/reanimated2/threads.js.map +1 -1
- package/lib/module/reanimated2/valueSetter.js +1 -2
- package/lib/module/reanimated2/valueSetter.js.map +1 -1
- package/lib/module/reanimated2/valueUnpacker.js +4 -3
- package/lib/module/reanimated2/valueUnpacker.js.map +1 -1
- package/lib/module/specs/NativeReanimatedModule.js +5 -0
- package/lib/module/specs/NativeReanimatedModule.js.map +1 -0
- package/lib/typescript/ConfigHelper.d.ts +1 -0
- package/lib/typescript/createAnimatedComponent/InlinePropManager.d.ts +1 -1
- package/lib/typescript/createAnimatedComponent/JSPropsUpdater.web.d.ts +6 -0
- package/lib/typescript/createAnimatedComponent/PropsFilter.d.ts +3 -0
- package/lib/typescript/createAnimatedComponent/getViewInfo.d.ts +9 -0
- package/lib/typescript/reanimated2/NativeReanimated/NativeReanimated.d.ts +8 -13
- package/lib/typescript/reanimated2/UpdateLayoutAnimations.d.ts +12 -1
- package/lib/typescript/reanimated2/WorkletEventHandler.d.ts +16 -9
- package/lib/typescript/reanimated2/animation/util.d.ts +2 -0
- package/lib/typescript/reanimated2/component/LayoutAnimationConfig.d.ts +1 -1
- package/lib/typescript/reanimated2/component/PerformanceMonitor.d.ts +2 -0
- package/lib/typescript/reanimated2/core.d.ts +3 -4
- package/lib/typescript/reanimated2/hook/commonTypes.d.ts +6 -0
- package/lib/typescript/reanimated2/hook/useEvent.d.ts +2 -3
- package/lib/typescript/reanimated2/hook/useScrollViewOffset.d.ts +3 -1
- package/lib/typescript/reanimated2/index.d.ts +3 -0
- package/lib/typescript/reanimated2/js-reanimated/JSReanimated.d.ts +2 -2
- package/lib/typescript/reanimated2/layoutReanimation/animationBuilder/commonTypes.d.ts +2 -1
- package/lib/typescript/reanimated2/layoutReanimation/sharedTransitions/ProgressTransitionManager.d.ts +2 -2
- package/lib/typescript/reanimated2/layoutReanimation/sharedTransitions/SharedTransition.d.ts +2 -2
- package/lib/typescript/reanimated2/platform-specific/jsVersion.d.ts +1 -1
- package/lib/typescript/reanimated2/screenTransition/RNScreensTurboModule.d.ts +2 -0
- package/lib/typescript/reanimated2/screenTransition/animationManager.d.ts +3 -0
- package/lib/typescript/reanimated2/screenTransition/commonTypes.d.ts +38 -0
- package/lib/typescript/reanimated2/screenTransition/index.d.ts +3 -0
- package/lib/typescript/reanimated2/screenTransition/presets.d.ts +11 -0
- package/lib/typescript/reanimated2/screenTransition/styleUpdater.d.ts +3 -0
- package/lib/typescript/reanimated2/screenTransition/swipeSimulator.d.ts +2 -0
- package/lib/typescript/specs/NativeReanimatedModule.d.ts +6 -0
- package/package.json +29 -17
- package/plugin/build/plugin.js +7 -2
- package/src/ConfigHelper.ts +1 -1
- package/src/createAnimatedComponent/InlinePropManager.ts +2 -2
- package/src/createAnimatedComponent/JSPropsUpdater.ts +7 -6
- package/src/createAnimatedComponent/JSPropsUpdater.web.ts +26 -0
- package/src/createAnimatedComponent/PropsFilter.tsx +31 -6
- package/src/createAnimatedComponent/createAnimatedComponent.tsx +108 -60
- package/src/createAnimatedComponent/getViewInfo.ts +39 -0
- package/src/reanimated2/NativeReanimated/NativeReanimated.ts +33 -35
- package/src/reanimated2/PlatformChecker.ts +3 -2
- package/src/reanimated2/PropsRegistry.ts +1 -3
- package/src/reanimated2/UpdateLayoutAnimations.ts +53 -13
- package/src/reanimated2/WorkletEventHandler.ts +98 -39
- package/src/reanimated2/animation/styleAnimation.ts +8 -6
- package/src/reanimated2/animation/timing.ts +9 -1
- package/src/reanimated2/animation/util.ts +28 -3
- package/src/reanimated2/commonTypes.ts +4 -1
- package/src/reanimated2/component/PerformanceMonitor.tsx +216 -0
- package/src/reanimated2/core.ts +9 -31
- package/src/reanimated2/errors.ts +1 -0
- package/src/reanimated2/fabricUtils.ts +43 -18
- package/src/reanimated2/globals.d.ts +11 -1
- package/src/reanimated2/hook/commonTypes.ts +10 -0
- package/src/reanimated2/hook/useAnimatedRef.ts +20 -11
- package/src/reanimated2/hook/useEvent.ts +4 -4
- package/src/reanimated2/hook/useScrollViewOffset.ts +94 -23
- package/src/reanimated2/index.ts +11 -0
- package/src/reanimated2/js-reanimated/JSReanimated.ts +7 -7
- package/src/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.ts +4 -0
- package/src/reanimated2/layoutReanimation/animationBuilder/Keyframe.ts +9 -1
- package/src/reanimated2/layoutReanimation/animationBuilder/commonTypes.ts +9 -1
- package/src/reanimated2/layoutReanimation/animationsManager.ts +10 -2
- package/src/reanimated2/layoutReanimation/defaultTransitions/CurvedTransition.ts +13 -0
- package/src/reanimated2/layoutReanimation/sharedTransitions/ProgressTransitionManager.ts +17 -8
- package/src/reanimated2/layoutReanimation/sharedTransitions/SharedTransition.ts +26 -7
- package/src/reanimated2/layoutReanimation/web/animationsManager.ts +1 -1
- package/src/reanimated2/layoutReanimation/web/componentStyle.ts +3 -1
- package/src/reanimated2/layoutReanimation/web/componentUtils.ts +1 -1
- package/src/reanimated2/layoutReanimation/web/createAnimation.ts +2 -2
- package/src/reanimated2/platform-specific/jsVersion.ts +1 -1
- package/src/reanimated2/platformFunctions/getRelativeCoords.ts +2 -2
- package/src/reanimated2/screenTransition/RNScreensTurboModule.ts +29 -0
- package/src/reanimated2/screenTransition/animationManager.ts +45 -0
- package/src/reanimated2/screenTransition/commonTypes.ts +63 -0
- package/src/reanimated2/screenTransition/index.ts +12 -0
- package/src/reanimated2/screenTransition/presets.ts +137 -0
- package/src/reanimated2/screenTransition/styleUpdater.ts +73 -0
- package/src/reanimated2/screenTransition/swipeSimulator.ts +238 -0
- package/src/reanimated2/shareables.ts +29 -6
- package/src/reanimated2/valueUnpacker.ts +10 -3
- package/src/specs/NativeReanimatedModule.ts +9 -0
- package/android/src/reactNativeVersionPatch/ReanimatedUIManager/70/com/swmansion/reanimated/ReanimatedUIManagerFactory.java +0 -16
- package/android/src/reactNativeVersionPatch/messageQueueThread/67/com/swmansion/reanimated/ReanimatedMessageQueueThread.java +0 -12
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["isAffineMatrixFlat","x","Array","isArray","length","every","element","isNaN","isAffineMatrix","row","flatten","matrix","flat","unflatten","m","maybeFlattenMatrix","multiplyMatrices","a","b","subtractMatrices","maybeFlatA","maybeFlatB","isFlatOnStart","c","map","_","i","addMatrices","scaleMatrix","scalar","getRotationMatrix","angle","axis","arguments","undefined","cos","Math","sin","norm3d","y","z","sqrt","transposeMatrix","assertVectorsHaveEqualLengths","__DEV__","Error","toString","innerProduct","reduce","acc","projection","u","s","e","subtractVectors","scaleVector","gramSchmidtAlgorithm","a0","a1","a2","a3","u0","u1","u2","u3","e0","e1","e2","e3","rotationMatrix","skewMatrix","decomposeMatrix","unknownTypeMatrix","forEach","translationMatrix","sx","sy","sz","rotationAndSkewMatrix","decomposeMatrixIntoMatricesAndAngles","sinRy","ry","asin","rx","rz","atan2"],"sources":["matrixUtils.tsx"],"sourcesContent":["'use strict';\ntype FixedLengthArray<\n T,\n L extends number,\n PassedObject = [T, ...Array<T>]\n> = PassedObject & {\n readonly length: L;\n [I: number]: T;\n};\n\nexport type AffineMatrix = FixedLengthArray<FixedLengthArray<number, 4>, 4>;\n\nexport type AffineMatrixFlat = FixedLengthArray<number, 16>;\n\ntype TransformMatrixDecomposition = Record<\n 'translationMatrix' | 'scaleMatrix' | 'rotationMatrix' | 'skewMatrix',\n AffineMatrix\n>;\n\ntype Axis = 'x' | 'y' | 'z';\n\ninterface TansformMatrixDecompositionWithAngles\n extends TransformMatrixDecomposition {\n rx: number;\n ry: number;\n rz: number;\n}\n\nexport function isAffineMatrixFlat(x: unknown): x is AffineMatrixFlat {\n 'worklet';\n return (\n Array.isArray(x) &&\n x.length === 16 &&\n x.every((element) => typeof element === 'number' && !isNaN(element))\n );\n}\n\n// ts-prune-ignore-next This function is exported to be tested\nexport function isAffineMatrix(x: unknown): x is AffineMatrix {\n 'worklet';\n return (\n Array.isArray(x) &&\n x.length === 4 &&\n x.every(\n (row) =>\n Array.isArray(row) &&\n row.length === 4 &&\n row.every((element) => typeof element === 'number' && !isNaN(element))\n )\n );\n}\n\nexport function flatten(matrix: AffineMatrix): AffineMatrixFlat {\n 'worklet';\n return matrix.flat() as AffineMatrixFlat;\n}\n\n// ts-prune-ignore-next This function is exported to be tested\nexport function unflatten(m: AffineMatrixFlat): AffineMatrix {\n 'worklet';\n return [\n [m[0], m[1], m[2], m[3]],\n [m[4], m[5], m[6], m[7]],\n [m[8], m[9], m[10], m[11]],\n [m[12], m[13], m[14], m[15]],\n ] as AffineMatrix;\n}\n\nfunction maybeFlattenMatrix(\n matrix: AffineMatrix | AffineMatrixFlat\n): AffineMatrixFlat {\n 'worklet';\n return isAffineMatrix(matrix) ? flatten(matrix) : matrix;\n}\n\nexport function multiplyMatrices(\n a: AffineMatrix,\n b: AffineMatrix\n): AffineMatrix {\n 'worklet';\n return [\n [\n a[0][0] * b[0][0] +\n a[0][1] * b[1][0] +\n a[0][2] * b[2][0] +\n a[0][3] * b[3][0],\n\n a[0][0] * b[0][1] +\n a[0][1] * b[1][1] +\n a[0][2] * b[2][1] +\n a[0][3] * b[3][1],\n\n a[0][0] * b[0][2] +\n a[0][1] * b[1][2] +\n a[0][2] * b[2][2] +\n a[0][3] * b[3][2],\n\n a[0][0] * b[0][3] +\n a[0][1] * b[1][3] +\n a[0][2] * b[2][3] +\n a[0][3] * b[3][3],\n ],\n [\n a[1][0] * b[0][0] +\n a[1][1] * b[1][0] +\n a[1][2] * b[2][0] +\n a[1][3] * b[3][0],\n\n a[1][0] * b[0][1] +\n a[1][1] * b[1][1] +\n a[1][2] * b[2][1] +\n a[1][3] * b[3][1],\n\n a[1][0] * b[0][2] +\n a[1][1] * b[1][2] +\n a[1][2] * b[2][2] +\n a[1][3] * b[3][2],\n\n a[1][0] * b[0][3] +\n a[1][1] * b[1][3] +\n a[1][2] * b[2][3] +\n a[1][3] * b[3][3],\n ],\n [\n a[2][0] * b[0][0] +\n a[2][1] * b[1][0] +\n a[2][2] * b[2][0] +\n a[2][3] * b[3][0],\n\n a[2][0] * b[0][1] +\n a[2][1] * b[1][1] +\n a[2][2] * b[2][1] +\n a[2][3] * b[3][1],\n\n a[2][0] * b[0][2] +\n a[2][1] * b[1][2] +\n a[2][2] * b[2][2] +\n a[2][3] * b[3][2],\n\n a[2][0] * b[0][3] +\n a[2][1] * b[1][3] +\n a[2][2] * b[2][3] +\n a[2][3] * b[3][3],\n ],\n [\n a[3][0] * b[0][0] +\n a[3][1] * b[1][0] +\n a[3][2] * b[2][0] +\n a[3][3] * b[3][0],\n\n a[3][0] * b[0][1] +\n a[3][1] * b[1][1] +\n a[3][2] * b[2][1] +\n a[3][3] * b[3][1],\n\n a[3][0] * b[0][2] +\n a[3][1] * b[1][2] +\n a[3][2] * b[2][2] +\n a[3][3] * b[3][2],\n\n a[3][0] * b[0][3] +\n a[3][1] * b[1][3] +\n a[3][2] * b[2][3] +\n a[3][3] * b[3][3],\n ],\n ];\n}\n\nexport function subtractMatrices<T extends AffineMatrixFlat | AffineMatrix>(\n maybeFlatA: T,\n maybeFlatB: T\n): T {\n 'worklet';\n const isFlatOnStart = isAffineMatrixFlat(maybeFlatA);\n const a: AffineMatrixFlat = maybeFlattenMatrix(maybeFlatA);\n const b: AffineMatrixFlat = maybeFlattenMatrix(maybeFlatB);\n\n const c = a.map((_, i) => a[i] - b[i]) as AffineMatrixFlat;\n return isFlatOnStart ? (c as T) : (unflatten(c) as T);\n}\n\nexport function addMatrices<T extends AffineMatrixFlat | AffineMatrix>(\n maybeFlatA: T,\n maybeFlatB: T\n): T {\n 'worklet';\n const isFlatOnStart = isAffineMatrixFlat(maybeFlatA);\n const a = maybeFlattenMatrix(maybeFlatA);\n const b = maybeFlattenMatrix(maybeFlatB);\n\n const c = a.map((_, i) => a[i] + b[i]) as AffineMatrixFlat;\n return isFlatOnStart ? (c as T) : (unflatten(c) as T);\n}\n\nexport function scaleMatrix<T extends AffineMatrixFlat | AffineMatrix>(\n maybeFlatA: T,\n scalar: number\n): T {\n 'worklet';\n const isFlatOnStart = isAffineMatrixFlat(maybeFlatA);\n const a = maybeFlattenMatrix(maybeFlatA);\n\n const b = a.map((x) => x * scalar) as AffineMatrixFlat;\n return isFlatOnStart ? (b as T) : (unflatten(b) as T);\n}\n\nexport function getRotationMatrix(\n angle: number,\n axis: Axis = 'z'\n): AffineMatrix {\n 'worklet';\n const cos = Math.cos(angle);\n const sin = Math.sin(angle);\n switch (axis) {\n case 'z':\n return [\n [cos, sin, 0, 0],\n [-sin, cos, 0, 0],\n [0, 0, 1, 0],\n [0, 0, 0, 1],\n ];\n case 'y':\n return [\n [cos, 0, -sin, 0],\n [0, 1, 0, 0],\n [sin, 0, cos, 0],\n [0, 0, 0, 1],\n ];\n case 'x':\n return [\n [1, 0, 0, 0],\n [0, cos, sin, 0],\n [0, -sin, cos, 0],\n [0, 0, 0, 1],\n ];\n }\n}\n\nfunction norm3d(x: number, y: number, z: number) {\n 'worklet';\n return Math.sqrt(x * x + y * y + z * z);\n}\n\nfunction transposeMatrix(matrix: AffineMatrix): AffineMatrix {\n 'worklet';\n const m = flatten(matrix);\n return [\n [m[0], m[4], m[8], m[12]],\n [m[1], m[5], m[9], m[13]],\n [m[2], m[6], m[10], m[14]],\n [m[3], m[7], m[11], m[15]],\n ];\n}\n\nfunction assertVectorsHaveEqualLengths(a: number[], b: number[]) {\n 'worklet';\n if (__DEV__ && a.length !== b.length) {\n throw new Error(\n `[Reanimated] Cannot calculate inner product of two vectors of different lengths. Length of ${a.toString()} is ${\n a.length\n } and length of ${b.toString()} is ${b.length}.`\n );\n }\n}\n\nfunction innerProduct(a: number[], b: number[]) {\n 'worklet';\n assertVectorsHaveEqualLengths(a, b);\n return a.reduce((acc, _, i) => acc + a[i] * b[i], 0);\n}\n\nfunction projection(u: number[], a: number[]) {\n 'worklet';\n assertVectorsHaveEqualLengths(u, a);\n const s = innerProduct(u, a) / innerProduct(u, u);\n return u.map((e) => e * s);\n}\n\nfunction subtractVectors(a: number[], b: number[]) {\n 'worklet';\n assertVectorsHaveEqualLengths(a, b);\n return a.map((_, i) => a[i] - b[i]);\n}\n\nfunction scaleVector(u: number[], a: number) {\n 'worklet';\n return u.map((e) => e * a);\n}\n\nfunction gramSchmidtAlgorithm(matrix: AffineMatrix): {\n rotationMatrix: AffineMatrix;\n skewMatrix: AffineMatrix;\n} {\n // Gram-Schmidt orthogonalization decomposes any matrix with non-zero determinant into an orthogonal and a triangular matrix\n // These matrices are equal to rotation and skew matrices respectively, because we apply it to transformation matrix\n // That is expected to already have extracted the remaining transforms (scale & translation)\n 'worklet';\n const [a0, a1, a2, a3] = matrix;\n\n const u0 = a0;\n const u1 = subtractVectors(a1, projection(u0, a1));\n const u2 = subtractVectors(\n subtractVectors(a2, projection(u0, a2)),\n projection(u1, a2)\n );\n const u3 = subtractVectors(\n subtractVectors(\n subtractVectors(a3, projection(u0, a3)),\n projection(u1, a3)\n ),\n projection(u2, a3)\n );\n\n const [e0, e1, e2, e3] = [u0, u1, u2, u3].map((u) =>\n scaleVector(u, 1 / Math.sqrt(innerProduct(u, u)))\n );\n\n const rotationMatrix: AffineMatrix = [\n [e0[0], e1[0], e2[0], e3[0]],\n [e0[1], e1[1], e2[1], e3[1]],\n [e0[2], e1[2], e2[2], e3[2]],\n [e0[3], e1[3], e2[3], e3[3]],\n ];\n\n const skewMatrix: AffineMatrix = [\n [\n innerProduct(e0, a0),\n innerProduct(e0, a1),\n innerProduct(e0, a2),\n innerProduct(e0, a3),\n ],\n [0, innerProduct(e1, a1), innerProduct(e1, a2), innerProduct(e1, a3)],\n [0, 0, innerProduct(e2, a2), innerProduct(e2, a3)],\n [0, 0, 0, innerProduct(e3, a3)],\n ];\n return {\n rotationMatrix: transposeMatrix(rotationMatrix),\n skewMatrix: transposeMatrix(skewMatrix),\n };\n}\n\n// ts-prune-ignore-next This function is exported to be tested\nexport function decomposeMatrix(\n unknownTypeMatrix: AffineMatrixFlat | AffineMatrix\n): TransformMatrixDecomposition {\n 'worklet';\n const matrix = maybeFlattenMatrix(unknownTypeMatrix);\n\n // normalize matrix\n if (matrix[15] === 0) {\n throw new Error('[Reanimated] Invalid transform matrix.');\n }\n matrix.forEach((_, i) => (matrix[i] /= matrix[15]));\n\n const translationMatrix: AffineMatrix = [\n [1, 0, 0, 0],\n [0, 1, 0, 0],\n [0, 0, 1, 0],\n [matrix[12], matrix[13], matrix[14], 1],\n ];\n const sx = matrix[15] * norm3d(matrix[0], matrix[4], matrix[8]);\n const sy = matrix[15] * norm3d(matrix[1], matrix[5], matrix[9]);\n const sz = matrix[15] * norm3d(matrix[2], matrix[6], matrix[10]);\n\n // eslint-disable-next-line @typescript-eslint/no-shadow\n const scaleMatrix: AffineMatrix = [\n [sx, 0, 0, 0],\n [0, sy, 0, 0],\n [0, 0, sz, 0],\n [0, 0, 0, 1],\n ];\n\n const rotationAndSkewMatrix: AffineMatrix = [\n [matrix[0] / sx, matrix[1] / sx, matrix[2] / sx, 0],\n [matrix[4] / sy, matrix[5] / sy, matrix[6] / sy, 0],\n [matrix[8] / sz, matrix[9] / sz, matrix[10] / sz, 0],\n [0, 0, 0, 1],\n ];\n\n const { rotationMatrix, skewMatrix } = gramSchmidtAlgorithm(\n rotationAndSkewMatrix\n );\n\n return {\n translationMatrix,\n scaleMatrix,\n rotationMatrix,\n skewMatrix,\n };\n}\n\nexport function decomposeMatrixIntoMatricesAndAngles(\n matrix: AffineMatrixFlat | AffineMatrix\n): TansformMatrixDecompositionWithAngles {\n 'worklet';\n // eslint-disable-next-line @typescript-eslint/no-shadow\n const { scaleMatrix, rotationMatrix, translationMatrix, skewMatrix } =\n decomposeMatrix(matrix);\n\n const sinRy = -rotationMatrix[0][2];\n\n const ry = Math.asin(sinRy);\n let rx;\n let rz;\n if (sinRy === 1 || sinRy === -1) {\n rz = 0;\n rx = Math.atan2(sinRy * rotationMatrix[0][1], sinRy * rotationMatrix[0][2]);\n } else {\n rz = Math.atan2(rotationMatrix[0][1], rotationMatrix[0][0]);\n rx = Math.atan2(rotationMatrix[1][2], rotationMatrix[2][2]);\n }\n\n return {\n scaleMatrix,\n rotationMatrix,\n translationMatrix,\n skewMatrix,\n rx: rx || 0,\n ry: ry || 0,\n rz: rz || 0,\n };\n}\n"],"mappings":"AAAA,YAAY;;AA4BZ,OAAO,SAASA,kBAAkBA,CAACC,CAAU,EAAyB;EACpE,SAAS;;EACT,OACEC,KAAK,CAACC,OAAO,CAACF,CAAC,CAAC,IAChBA,CAAC,CAACG,MAAM,KAAK,EAAE,IACfH,CAAC,CAACI,KAAK,CAAEC,OAAO,IAAK,OAAOA,OAAO,KAAK,QAAQ,IAAI,CAACC,KAAK,CAACD,OAAO,CAAC,CAAC;AAExE;;AAEA;AACA,OAAO,SAASE,cAAcA,CAACP,CAAU,EAAqB;EAC5D,SAAS;;EACT,OACEC,KAAK,CAACC,OAAO,CAACF,CAAC,CAAC,IAChBA,CAAC,CAACG,MAAM,KAAK,CAAC,IACdH,CAAC,CAACI,KAAK,CACJI,GAAG,IACFP,KAAK,CAACC,OAAO,CAACM,GAAG,CAAC,IAClBA,GAAG,CAACL,MAAM,KAAK,CAAC,IAChBK,GAAG,CAACJ,KAAK,CAAEC,OAAO,IAAK,OAAOA,OAAO,KAAK,QAAQ,IAAI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CAAC,CAAC,CAAC;IAC3Dc,EAAE,GAAG/C,IAAI,CAACiD,KAAK,CAAChB,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAEA,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;EAC7D;EAEA,OAAO;IACLzC,WAAW;IACXyC,cAAc;IACdK,iBAAiB;IACjBJ,UAAU;IACVa,EAAE,EAAEA,EAAE,IAAI,CAAC;IACXF,EAAE,EAAEA,EAAE,IAAI,CAAC;IACXG,EAAE,EAAEA,EAAE,IAAI;EACZ,CAAC;AACH"}
|
|
1
|
+
{"version":3,"names":["isAffineMatrixFlat","x","Array","isArray","length","every","element","isNaN","isAffineMatrix","row","flatten","matrix","flat","unflatten","m","maybeFlattenMatrix","multiplyMatrices","a","b","subtractMatrices","maybeFlatA","maybeFlatB","isFlatOnStart","c","map","_","i","addMatrices","scaleMatrix","scalar","getRotationMatrix","angle","axis","cos","Math","sin","norm3d","y","z","sqrt","transposeMatrix","assertVectorsHaveEqualLengths","__DEV__","Error","toString","innerProduct","reduce","acc","projection","u","s","e","subtractVectors","scaleVector","gramSchmidtAlgorithm","a0","a1","a2","a3","u0","u1","u2","u3","e0","e1","e2","e3","rotationMatrix","skewMatrix","decomposeMatrix","unknownTypeMatrix","forEach","translationMatrix","sx","sy","sz","rotationAndSkewMatrix","decomposeMatrixIntoMatricesAndAngles","sinRy","ry","asin","rx","rz","atan2"],"sources":["matrixUtils.tsx"],"sourcesContent":["'use strict';\ntype FixedLengthArray<\n T,\n L extends number,\n PassedObject = [T, ...Array<T>]\n> = PassedObject & {\n readonly length: L;\n [I: number]: T;\n};\n\nexport type AffineMatrix = FixedLengthArray<FixedLengthArray<number, 4>, 4>;\n\nexport type AffineMatrixFlat = FixedLengthArray<number, 16>;\n\ntype TransformMatrixDecomposition = Record<\n 'translationMatrix' | 'scaleMatrix' | 'rotationMatrix' | 'skewMatrix',\n AffineMatrix\n>;\n\ntype Axis = 'x' | 'y' | 'z';\n\ninterface TansformMatrixDecompositionWithAngles\n extends TransformMatrixDecomposition {\n rx: number;\n ry: number;\n rz: number;\n}\n\nexport function isAffineMatrixFlat(x: unknown): x is AffineMatrixFlat {\n 'worklet';\n return (\n Array.isArray(x) &&\n x.length === 16 &&\n x.every((element) => typeof element === 'number' && !isNaN(element))\n );\n}\n\n// ts-prune-ignore-next This function is exported to be tested\nexport function isAffineMatrix(x: unknown): x is AffineMatrix {\n 'worklet';\n return (\n Array.isArray(x) &&\n x.length === 4 &&\n x.every(\n (row) =>\n Array.isArray(row) &&\n row.length === 4 &&\n row.every((element) => typeof element === 'number' && !isNaN(element))\n )\n );\n}\n\nexport function flatten(matrix: AffineMatrix): AffineMatrixFlat {\n 'worklet';\n return matrix.flat() as AffineMatrixFlat;\n}\n\n// ts-prune-ignore-next This function is exported to be tested\nexport function unflatten(m: AffineMatrixFlat): AffineMatrix {\n 'worklet';\n return [\n [m[0], m[1], m[2], m[3]],\n [m[4], m[5], m[6], m[7]],\n [m[8], m[9], m[10], m[11]],\n [m[12], m[13], m[14], m[15]],\n ] as AffineMatrix;\n}\n\nfunction maybeFlattenMatrix(\n matrix: AffineMatrix | AffineMatrixFlat\n): AffineMatrixFlat {\n 'worklet';\n return isAffineMatrix(matrix) ? flatten(matrix) : matrix;\n}\n\nexport function multiplyMatrices(\n a: AffineMatrix,\n b: AffineMatrix\n): AffineMatrix {\n 'worklet';\n return [\n [\n a[0][0] * b[0][0] +\n a[0][1] * b[1][0] +\n a[0][2] * b[2][0] +\n a[0][3] * b[3][0],\n\n a[0][0] * b[0][1] +\n a[0][1] * b[1][1] +\n a[0][2] * b[2][1] +\n a[0][3] * b[3][1],\n\n a[0][0] * b[0][2] +\n a[0][1] * b[1][2] +\n a[0][2] * b[2][2] +\n a[0][3] * b[3][2],\n\n a[0][0] * b[0][3] +\n a[0][1] * b[1][3] +\n a[0][2] * b[2][3] +\n a[0][3] * b[3][3],\n ],\n [\n a[1][0] * b[0][0] +\n a[1][1] * b[1][0] +\n a[1][2] * b[2][0] +\n a[1][3] * b[3][0],\n\n a[1][0] * b[0][1] +\n a[1][1] * b[1][1] +\n a[1][2] * b[2][1] +\n a[1][3] * b[3][1],\n\n a[1][0] * b[0][2] +\n a[1][1] * b[1][2] +\n a[1][2] * b[2][2] +\n a[1][3] * b[3][2],\n\n a[1][0] * b[0][3] +\n a[1][1] * b[1][3] +\n a[1][2] * b[2][3] +\n a[1][3] * b[3][3],\n ],\n [\n a[2][0] * b[0][0] +\n a[2][1] * b[1][0] +\n a[2][2] * b[2][0] +\n a[2][3] * b[3][0],\n\n a[2][0] * b[0][1] +\n a[2][1] * b[1][1] +\n a[2][2] * b[2][1] +\n a[2][3] * b[3][1],\n\n a[2][0] * b[0][2] +\n a[2][1] * b[1][2] +\n a[2][2] * b[2][2] +\n a[2][3] * b[3][2],\n\n a[2][0] * b[0][3] +\n a[2][1] * b[1][3] +\n a[2][2] * b[2][3] +\n a[2][3] * b[3][3],\n ],\n [\n a[3][0] * b[0][0] +\n a[3][1] * b[1][0] +\n a[3][2] * b[2][0] +\n a[3][3] * b[3][0],\n\n a[3][0] * b[0][1] +\n a[3][1] * b[1][1] +\n a[3][2] * b[2][1] +\n a[3][3] * b[3][1],\n\n a[3][0] * b[0][2] +\n a[3][1] * b[1][2] +\n a[3][2] * b[2][2] +\n a[3][3] * b[3][2],\n\n a[3][0] * b[0][3] +\n a[3][1] * b[1][3] +\n a[3][2] * b[2][3] +\n a[3][3] * b[3][3],\n ],\n ];\n}\n\nexport function subtractMatrices<T extends AffineMatrixFlat | AffineMatrix>(\n maybeFlatA: T,\n maybeFlatB: T\n): T {\n 'worklet';\n const isFlatOnStart = isAffineMatrixFlat(maybeFlatA);\n const a: AffineMatrixFlat = maybeFlattenMatrix(maybeFlatA);\n const b: AffineMatrixFlat = maybeFlattenMatrix(maybeFlatB);\n\n const c = a.map((_, i) => a[i] - b[i]) as AffineMatrixFlat;\n return isFlatOnStart ? (c as T) : (unflatten(c) as T);\n}\n\nexport function addMatrices<T extends AffineMatrixFlat | AffineMatrix>(\n maybeFlatA: T,\n maybeFlatB: T\n): T {\n 'worklet';\n const isFlatOnStart = isAffineMatrixFlat(maybeFlatA);\n const a = maybeFlattenMatrix(maybeFlatA);\n const b = maybeFlattenMatrix(maybeFlatB);\n\n const c = a.map((_, i) => a[i] + b[i]) as AffineMatrixFlat;\n return isFlatOnStart ? (c as T) : (unflatten(c) as T);\n}\n\nexport function scaleMatrix<T extends AffineMatrixFlat | AffineMatrix>(\n maybeFlatA: T,\n scalar: number\n): T {\n 'worklet';\n const isFlatOnStart = isAffineMatrixFlat(maybeFlatA);\n const a = maybeFlattenMatrix(maybeFlatA);\n\n const b = a.map((x) => x * scalar) as AffineMatrixFlat;\n return isFlatOnStart ? (b as T) : (unflatten(b) as T);\n}\n\nexport function getRotationMatrix(\n angle: number,\n axis: Axis = 'z'\n): AffineMatrix {\n 'worklet';\n const cos = Math.cos(angle);\n const sin = Math.sin(angle);\n switch (axis) {\n case 'z':\n return [\n [cos, sin, 0, 0],\n [-sin, cos, 0, 0],\n [0, 0, 1, 0],\n [0, 0, 0, 1],\n ];\n case 'y':\n return [\n [cos, 0, -sin, 0],\n [0, 1, 0, 0],\n [sin, 0, cos, 0],\n [0, 0, 0, 1],\n ];\n case 'x':\n return [\n [1, 0, 0, 0],\n [0, cos, sin, 0],\n [0, -sin, cos, 0],\n [0, 0, 0, 1],\n ];\n }\n}\n\nfunction norm3d(x: number, y: number, z: number) {\n 'worklet';\n return Math.sqrt(x * x + y * y + z * z);\n}\n\nfunction transposeMatrix(matrix: AffineMatrix): AffineMatrix {\n 'worklet';\n const m = flatten(matrix);\n return [\n [m[0], m[4], m[8], m[12]],\n [m[1], m[5], m[9], m[13]],\n [m[2], m[6], m[10], m[14]],\n [m[3], m[7], m[11], m[15]],\n ];\n}\n\nfunction assertVectorsHaveEqualLengths(a: number[], b: number[]) {\n 'worklet';\n if (__DEV__ && a.length !== b.length) {\n throw new Error(\n `[Reanimated] Cannot calculate inner product of two vectors of different lengths. Length of ${a.toString()} is ${\n a.length\n } and length of ${b.toString()} is ${b.length}.`\n );\n }\n}\n\nfunction innerProduct(a: number[], b: number[]) {\n 'worklet';\n assertVectorsHaveEqualLengths(a, b);\n return a.reduce((acc, _, i) => acc + a[i] * b[i], 0);\n}\n\nfunction projection(u: number[], a: number[]) {\n 'worklet';\n assertVectorsHaveEqualLengths(u, a);\n const s = innerProduct(u, a) / innerProduct(u, u);\n return u.map((e) => e * s);\n}\n\nfunction subtractVectors(a: number[], b: number[]) {\n 'worklet';\n assertVectorsHaveEqualLengths(a, b);\n return a.map((_, i) => a[i] - b[i]);\n}\n\nfunction scaleVector(u: number[], a: number) {\n 'worklet';\n return u.map((e) => e * a);\n}\n\nfunction gramSchmidtAlgorithm(matrix: AffineMatrix): {\n rotationMatrix: AffineMatrix;\n skewMatrix: AffineMatrix;\n} {\n // Gram-Schmidt orthogonalization decomposes any matrix with non-zero determinant into an orthogonal and a triangular matrix\n // These matrices are equal to rotation and skew matrices respectively, because we apply it to transformation matrix\n // That is expected to already have extracted the remaining transforms (scale & translation)\n 'worklet';\n const [a0, a1, a2, a3] = matrix;\n\n const u0 = a0;\n const u1 = subtractVectors(a1, projection(u0, a1));\n const u2 = subtractVectors(\n subtractVectors(a2, projection(u0, a2)),\n projection(u1, a2)\n );\n const u3 = subtractVectors(\n subtractVectors(\n subtractVectors(a3, projection(u0, a3)),\n projection(u1, a3)\n ),\n projection(u2, a3)\n );\n\n const [e0, e1, e2, e3] = [u0, u1, u2, u3].map((u) =>\n scaleVector(u, 1 / Math.sqrt(innerProduct(u, u)))\n );\n\n const rotationMatrix: AffineMatrix = [\n [e0[0], e1[0], e2[0], e3[0]],\n [e0[1], e1[1], e2[1], e3[1]],\n [e0[2], e1[2], e2[2], e3[2]],\n [e0[3], e1[3], e2[3], e3[3]],\n ];\n\n const skewMatrix: AffineMatrix = [\n [\n innerProduct(e0, a0),\n innerProduct(e0, a1),\n innerProduct(e0, a2),\n innerProduct(e0, a3),\n ],\n [0, innerProduct(e1, a1), innerProduct(e1, a2), innerProduct(e1, a3)],\n [0, 0, innerProduct(e2, a2), innerProduct(e2, a3)],\n [0, 0, 0, innerProduct(e3, a3)],\n ];\n return {\n rotationMatrix: transposeMatrix(rotationMatrix),\n skewMatrix: transposeMatrix(skewMatrix),\n };\n}\n\n// ts-prune-ignore-next This function is exported to be tested\nexport function decomposeMatrix(\n unknownTypeMatrix: AffineMatrixFlat | AffineMatrix\n): TransformMatrixDecomposition {\n 'worklet';\n const matrix = maybeFlattenMatrix(unknownTypeMatrix);\n\n // normalize matrix\n if (matrix[15] === 0) {\n throw new Error('[Reanimated] Invalid transform matrix.');\n }\n matrix.forEach((_, i) => (matrix[i] /= matrix[15]));\n\n const translationMatrix: AffineMatrix = [\n [1, 0, 0, 0],\n [0, 1, 0, 0],\n [0, 0, 1, 0],\n [matrix[12], matrix[13], matrix[14], 1],\n ];\n const sx = matrix[15] * norm3d(matrix[0], matrix[4], matrix[8]);\n const sy = matrix[15] * norm3d(matrix[1], matrix[5], matrix[9]);\n const sz = matrix[15] * norm3d(matrix[2], matrix[6], matrix[10]);\n\n // eslint-disable-next-line @typescript-eslint/no-shadow\n const scaleMatrix: AffineMatrix = [\n [sx, 0, 0, 0],\n [0, sy, 0, 0],\n [0, 0, sz, 0],\n [0, 0, 0, 1],\n ];\n\n const rotationAndSkewMatrix: AffineMatrix = [\n [matrix[0] / sx, matrix[1] / sx, matrix[2] / sx, 0],\n [matrix[4] / sy, matrix[5] / sy, matrix[6] / sy, 0],\n [matrix[8] / sz, matrix[9] / sz, matrix[10] / sz, 0],\n [0, 0, 0, 1],\n ];\n\n const { rotationMatrix, skewMatrix } = gramSchmidtAlgorithm(\n rotationAndSkewMatrix\n );\n\n return {\n translationMatrix,\n scaleMatrix,\n rotationMatrix,\n skewMatrix,\n };\n}\n\nexport function decomposeMatrixIntoMatricesAndAngles(\n matrix: AffineMatrixFlat | AffineMatrix\n): TansformMatrixDecompositionWithAngles {\n 'worklet';\n // eslint-disable-next-line @typescript-eslint/no-shadow\n const { scaleMatrix, rotationMatrix, translationMatrix, skewMatrix } =\n decomposeMatrix(matrix);\n\n const sinRy = -rotationMatrix[0][2];\n\n const ry = Math.asin(sinRy);\n let rx;\n let rz;\n if (sinRy === 1 || sinRy === -1) {\n rz = 0;\n rx = Math.atan2(sinRy * rotationMatrix[0][1], sinRy * rotationMatrix[0][2]);\n } else {\n rz = Math.atan2(rotationMatrix[0][1], rotationMatrix[0][0]);\n rx = Math.atan2(rotationMatrix[1][2], rotationMatrix[2][2]);\n }\n\n return {\n scaleMatrix,\n rotationMatrix,\n translationMatrix,\n skewMatrix,\n rx: rx || 0,\n ry: ry || 0,\n rz: rz || 0,\n };\n}\n"],"mappings":"AAAA,YAAY;;AA4BZ,OAAO,SAASA,kBAAkBA,CAACC,CAAU,EAAyB;EACpE,SAAS;;EACT,OACEC,KAAK,CAACC,OAAO,CAACF,CAAC,CAAC,IAChBA,CAAC,CAACG,MAAM,KAAK,EAAE,IACfH,CAAC,CAACI,KAAK,CAAEC,OAAO,IAAK,OAAOA,OAAO,KAAK,QAAQ,IAAI,CAACC,KAAK,CAACD,OAAO,CAAC,CAAC;AAExE;;AAEA;AACA,OAAO,SAASE,cAAcA,CAACP,CAAU,EAAqB;EAC5D,SAAS;;EACT,OACEC,KAAK,CAACC,OAAO,CAACF,CAAC,CAAC,IAChBA,CAAC,CAACG,MAAM,KAAK,CAAC,IACdH,CAAC,CAACI,KAAK,CACJI,GAAG,IACFP,KAAK,CAACC,OAAO,CAACM,GAAG,CAAC,IAClBA,GAAG,CAACL,MAAM,KAAK,CAAC,IAChBK,GAAG,CAACJ,KAAK,CAAEC,OAAO,IAAK,OAAOA,OAAO,KAAK,QAAQ,IAAI,CAACC,KAAK,CAACD,OAAO,CAAC,CACzE,CAAC;AAEL;AAEA,OAAO,SAASI,OAAOA,CAACC,MAAoB,EAAoB;EAC9D,SAAS;;EACT,OAAOA,MAAM,CAACC,IA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IACXuC,cAAc;IACdK,iBAAiB;IACjBJ,UAAU;IACVa,EAAE,EAAEA,EAAE,IAAI,CAAC;IACXF,EAAE,EAAEA,EAAE,IAAI,CAAC;IACXG,EAAE,EAAEA,EAAE,IAAI;EACZ,CAAC;AACH","ignoreList":[]}
|
|
@@ -2,14 +2,35 @@
|
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
import { isColor, convertToRGBA, rgbaArrayToRGBAColor, toGammaSpace, toLinearSpace } from '../Colors';
|
|
5
|
-
import { ReduceMotion } from '../commonTypes';
|
|
5
|
+
import { ReduceMotion, isWorkletFunction } from '../commonTypes';
|
|
6
6
|
import { flatten, multiplyMatrices, scaleMatrix, addMatrices, decomposeMatrixIntoMatricesAndAngles, isAffineMatrixFlat, subtractMatrices, getRotationMatrix } from './transformationMatrix/matrixUtils';
|
|
7
7
|
import { isReducedMotion, shouldBeUseWeb } from '../PlatformChecker';
|
|
8
8
|
let IN_STYLE_UPDATER = false;
|
|
9
9
|
const IS_REDUCED_MOTION = isReducedMotion();
|
|
10
|
+
const SHOULD_BE_USE_WEB = shouldBeUseWeb();
|
|
10
11
|
if (__DEV__ && IS_REDUCED_MOTION) {
|
|
11
12
|
console.warn(`[Reanimated] Reduced motion setting is enabled on this device. This warning is visible only in the development mode. Some animations will be disabled by default. You can override the behavior for individual animations, see https://docs.swmansion.com/react-native-reanimated/docs/guides/troubleshooting#reduced-motion-setting-is-enabled-on-this-device.`);
|
|
12
13
|
}
|
|
14
|
+
export function assertEasingIsWorklet(easing) {
|
|
15
|
+
'worklet';
|
|
16
|
+
|
|
17
|
+
if (_WORKLET) {
|
|
18
|
+
// If this is called on UI (for example from gesture handler with worklets), we don't get easing,
|
|
19
|
+
// but its bound copy, which is not a worklet. We don't want to throw any error then.
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
if (SHOULD_BE_USE_WEB) {
|
|
23
|
+
// It is possible to run reanimated on web without plugin, so let's skip this check on web
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
// @ts-ignore typescript wants us to use `in` instead, which doesn't work with host objects
|
|
27
|
+
if (easing !== null && easing !== void 0 && easing.factory) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
if (!isWorkletFunction(easing)) {
|
|
31
|
+
throw new Error('[Reanimated] The easing function is not a worklet. Please make sure you import `Easing` from react-native-reanimated.');
|
|
32
|
+
}
|
|
33
|
+
}
|
|
13
34
|
export function initialUpdaterRun(updater) {
|
|
14
35
|
IN_STYLE_UPDATER = true;
|
|
15
36
|
const result = updater();
|
|
@@ -285,7 +306,6 @@ function decorateAnimation(animation) {
|
|
|
285
306
|
baseOnStart(animation, value, timestamp, previousAnimation);
|
|
286
307
|
};
|
|
287
308
|
}
|
|
288
|
-
const SHOULD_BE_USE_WEB = shouldBeUseWeb();
|
|
289
309
|
export function defineAnimation(starting, factory) {
|
|
290
310
|
'worklet';
|
|
291
311
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["isColor","convertToRGBA","rgbaArrayToRGBAColor","toGammaSpace","toLinearSpace","ReduceMotion","flatten","multiplyMatrices","scaleMatrix","addMatrices","decomposeMatrixIntoMatricesAndAngles","isAffineMatrixFlat","subtractMatrices","getRotationMatrix","isReducedMotion","shouldBeUseWeb","IN_STYLE_UPDATER","IS_REDUCED_MOTION","__DEV__","console","warn","initialUpdaterRun","updater","result","recognizePrefixSuffix","value","match","Error","prefix","suffix","number","strippedValue","parseFloat","getReduceMotionFromConfig","config","System","Always","getReduceMotionForAnimation","undefined","applyProgressToMatrix","progress","a","b","applyProgressToNumber","decorateAnimation","animation","baseOnStart","onStart","baseOnFrame","onFrame","isHigherOrder","timestamp","previousAnimation","reduceMotion","animationCopy","Object","assign","callback","prefNumberSuffOnStart","__prefix","__suffix","strippedCurrent","strippedToValue","toValue","current","startValue","paPrefix","paSuffix","paStrippedValue","prefNumberSuffOnFrame","res","tab","colorOnStart","RGBAValue","RGBACurrent","RGBAToValue","forEach","i","index","push","colorOnFrame","finished","transformationMatrixOnStart","startMatrices","stopMatrices","transformationMatrixOnFrame","transforms","mappedTransforms","key","_","currentTranslation","currentScale","skewMatrix","rotations","mappedRotations","angle","rotationMatrixX","rotationMatrixY","rotationMatrixZ","rotationMatrix","updated","arrayOnStart","v","arrayOnFrame","objectOnStart","objectOnFrame","newObject","startTime","Array","isArray","SHOULD_BE_USE_WEB","defineAnimation","starting","factory","create","_WORKLET","cancelAnimation","sharedValue"],"sources":["util.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-shadow */\n'use strict';\nimport type { HigherOrderAnimation, StyleLayoutAnimation } from './commonTypes';\nimport type { ParsedColorArray } from '../Colors';\nimport {\n isColor,\n convertToRGBA,\n rgbaArrayToRGBAColor,\n toGammaSpace,\n toLinearSpace,\n} from '../Colors';\nimport { ReduceMotion } from '../commonTypes';\nimport type {\n SharedValue,\n AnimatableValue,\n Animation,\n AnimationObject,\n Timestamp,\n AnimatableValueObject,\n} from '../commonTypes';\nimport type {\n AffineMatrixFlat,\n AffineMatrix,\n} from './transformationMatrix/matrixUtils';\nimport {\n flatten,\n multiplyMatrices,\n scaleMatrix,\n addMatrices,\n decomposeMatrixIntoMatricesAndAngles,\n isAffineMatrixFlat,\n subtractMatrices,\n getRotationMatrix,\n} from './transformationMatrix/matrixUtils';\nimport { isReducedMotion, shouldBeUseWeb } from '../PlatformChecker';\n\nlet IN_STYLE_UPDATER = false;\nconst IS_REDUCED_MOTION = isReducedMotion();\n\nif (__DEV__ && IS_REDUCED_MOTION) {\n console.warn(\n `[Reanimated] Reduced motion setting is enabled on this device. This warning is visible only in the development mode. Some animations will be disabled by default. You can override the behavior for individual animations, see https://docs.swmansion.com/react-native-reanimated/docs/guides/troubleshooting#reduced-motion-setting-is-enabled-on-this-device.`\n );\n}\n\nexport function initialUpdaterRun<T>(updater: () => T) {\n IN_STYLE_UPDATER = true;\n const result = updater();\n IN_STYLE_UPDATER = false;\n return result;\n}\n\ninterface RecognizedPrefixSuffix {\n prefix?: string;\n suffix?: string;\n strippedValue: number;\n}\n\nexport function recognizePrefixSuffix(\n value: string | number\n): RecognizedPrefixSuffix {\n 'worklet';\n if (typeof value === 'string') {\n const match = value.match(\n /([A-Za-z]*)(-?\\d*\\.?\\d*)([eE][-+]?[0-9]+)?([A-Za-z%]*)/\n );\n if (!match) {\n throw new Error(\"[Reanimated] Couldn't parse animation value.\");\n }\n const prefix = match[1];\n const suffix = match[4];\n // number with scientific notation\n const number = match[2] + (match[3] ?? '');\n return { prefix, suffix, strippedValue: parseFloat(number) };\n } else {\n return { strippedValue: value };\n }\n}\n\n/**\n * Returns whether the motion should be reduced for a specified config.\n * By default returns the system setting.\n */\nexport function getReduceMotionFromConfig(config?: ReduceMotion) {\n 'worklet';\n return !config || config === ReduceMotion.System\n ? IS_REDUCED_MOTION\n : config === ReduceMotion.Always;\n}\n\n/**\n * Returns the value that should be assigned to `animation.reduceMotion`\n * for a given config. If the config is not defined, `undefined` is returned.\n */\nexport function getReduceMotionForAnimation(config?: ReduceMotion) {\n 'worklet';\n // if the config is not defined, we want `reduceMotion` to be undefined,\n // so the parent animation knows if it should overwrite it\n if (!config) {\n return undefined;\n }\n\n return getReduceMotionFromConfig(config);\n}\n\nfunction applyProgressToMatrix(\n progress: number,\n a: AffineMatrix,\n b: AffineMatrix\n) {\n 'worklet';\n return addMatrices(a, scaleMatrix(subtractMatrices(b, a), progress));\n}\n\nfunction applyProgressToNumber(progress: number, a: number, b: number) {\n 'worklet';\n return a + progress * (b - a);\n}\n\nfunction decorateAnimation<T extends AnimationObject | StyleLayoutAnimation>(\n animation: T\n): void {\n 'worklet';\n const baseOnStart = (animation as Animation<AnimationObject>).onStart;\n const baseOnFrame = (animation as Animation<AnimationObject>).onFrame;\n\n if ((animation as HigherOrderAnimation).isHigherOrder) {\n animation.onStart = (\n animation: Animation<AnimationObject>,\n value: number,\n timestamp: Timestamp,\n previousAnimation: Animation<AnimationObject>\n ) => {\n if (animation.reduceMotion === undefined) {\n animation.reduceMotion = getReduceMotionFromConfig();\n }\n return baseOnStart(animation, value, timestamp, previousAnimation);\n };\n return;\n }\n\n const animationCopy = Object.assign({}, animation);\n delete animationCopy.callback;\n\n const prefNumberSuffOnStart = (\n animation: Animation<AnimationObject>,\n value: string | number,\n timestamp: number,\n previousAnimation: Animation<AnimationObject>\n ) => {\n // recognize prefix, suffix, and updates stripped value on animation start\n const { prefix, suffix, strippedValue } = recognizePrefixSuffix(value);\n animation.__prefix = prefix;\n animation.__suffix = suffix;\n animation.strippedCurrent = strippedValue;\n const { strippedValue: strippedToValue } = recognizePrefixSuffix(\n animation.toValue as string | number\n );\n animation.current = strippedValue;\n animation.startValue = strippedValue;\n animation.toValue = strippedToValue;\n if (previousAnimation && previousAnimation !== animation) {\n const {\n prefix: paPrefix,\n suffix: paSuffix,\n strippedValue: paStrippedValue,\n } = recognizePrefixSuffix(previousAnimation.current as string | number);\n previousAnimation.current = paStrippedValue;\n previousAnimation.__prefix = paPrefix;\n previousAnimation.__suffix = paSuffix;\n }\n\n baseOnStart(animation, strippedValue, timestamp, previousAnimation);\n\n animation.current =\n (animation.__prefix ?? '') +\n animation.current +\n (animation.__suffix ?? '');\n\n if (previousAnimation && previousAnimation !== animation) {\n previousAnimation.current =\n (previousAnimation.__prefix ?? '') +\n // FIXME\n // eslint-disable-next-line @typescript-eslint/restrict-plus-operands\n previousAnimation.current +\n (previousAnimation.__suffix ?? '');\n }\n };\n const prefNumberSuffOnFrame = (\n animation: Animation<AnimationObject>,\n timestamp: number\n ) => {\n animation.current = animation.strippedCurrent;\n const res = baseOnFrame(animation, timestamp);\n animation.strippedCurrent = animation.current;\n animation.current =\n (animation.__prefix ?? '') +\n animation.current +\n (animation.__suffix ?? '');\n return res;\n };\n\n const tab = ['R', 'G', 'B', 'A'];\n const colorOnStart = (\n animation: Animation<AnimationObject>,\n value: string | number,\n timestamp: Timestamp,\n previousAnimation: Animation<AnimationObject>\n ): void => {\n let RGBAValue: ParsedColorArray;\n let RGBACurrent: ParsedColorArray;\n let RGBAToValue: ParsedColorArray;\n const res: Array<number> = [];\n if (isColor(value)) {\n RGBACurrent = toLinearSpace(convertToRGBA(animation.current));\n RGBAValue = toLinearSpace(convertToRGBA(value));\n if (animation.toValue) {\n RGBAToValue = toLinearSpace(convertToRGBA(animation.toValue));\n }\n }\n tab.forEach((i, index) => {\n animation[i] = Object.assign({}, animationCopy);\n animation[i].current = RGBACurrent[index];\n animation[i].toValue = RGBAToValue ? RGBAToValue[index] : undefined;\n animation[i].onStart(\n animation[i],\n RGBAValue[index],\n timestamp,\n previousAnimation ? previousAnimation[i] : undefined\n );\n res.push(animation[i].current);\n });\n\n animation.current = rgbaArrayToRGBAColor(\n toGammaSpace(res as ParsedColorArray)\n );\n };\n\n const colorOnFrame = (\n animation: Animation<AnimationObject>,\n timestamp: Timestamp\n ): boolean => {\n const RGBACurrent = toLinearSpace(convertToRGBA(animation.current));\n const res: Array<number> = [];\n let finished = true;\n tab.forEach((i, index) => {\n animation[i].current = RGBACurrent[index];\n const result = animation[i].onFrame(animation[i], timestamp);\n // We really need to assign this value to result, instead of passing it directly - otherwise once \"finished\" is false, onFrame won't be called\n finished = finished && result;\n res.push(animation[i].current);\n });\n\n animation.current = rgbaArrayToRGBAColor(\n toGammaSpace(res as ParsedColorArray)\n );\n return finished;\n };\n\n const transformationMatrixOnStart = (\n animation: Animation<AnimationObject>,\n value: AffineMatrixFlat,\n timestamp: Timestamp,\n previousAnimation: Animation<AnimationObject>\n ): void => {\n const toValue = animation.toValue as AffineMatrixFlat;\n\n animation.startMatrices = decomposeMatrixIntoMatricesAndAngles(value);\n animation.stopMatrices = decomposeMatrixIntoMatricesAndAngles(toValue);\n\n // We create an animation copy to animate single value between 0 and 100\n // We set limits from 0 to 100 (instead of 0-1) to make spring look good\n // with default thresholds.\n\n animation[0] = Object.assign({}, animationCopy);\n animation[0].current = 0;\n animation[0].toValue = 100;\n animation[0].onStart(\n animation[0],\n 0,\n timestamp,\n previousAnimation ? previousAnimation[0] : undefined\n );\n\n animation.current = value;\n };\n\n const transformationMatrixOnFrame = (\n animation: Animation<AnimationObject>,\n timestamp: Timestamp\n ): boolean => {\n let finished = true;\n const result = animation[0].onFrame(animation[0], timestamp);\n // We really need to assign this value to result, instead of passing it directly - otherwise once \"finished\" is false, onFrame won't be called\n finished = finished && result;\n\n const progress = animation[0].current / 100;\n\n const transforms = ['translationMatrix', 'scaleMatrix', 'skewMatrix'];\n const mappedTransforms: Array<AffineMatrix> = [];\n\n transforms.forEach((key, _) =>\n mappedTransforms.push(\n applyProgressToMatrix(\n progress,\n animation.startMatrices[key],\n animation.stopMatrices[key]\n )\n )\n );\n\n const [currentTranslation, currentScale, skewMatrix] = mappedTransforms;\n\n const rotations: Array<'x' | 'y' | 'z'> = ['x', 'y', 'z'];\n const mappedRotations: Array<AffineMatrix> = [];\n\n rotations.forEach((key, _) => {\n const angle = applyProgressToNumber(\n progress,\n animation.startMatrices['r' + key],\n animation.stopMatrices['r' + key]\n );\n mappedRotations.push(getRotationMatrix(angle, key));\n });\n\n const [rotationMatrixX, rotationMatrixY, rotationMatrixZ] = mappedRotations;\n\n const rotationMatrix = multiplyMatrices(\n rotationMatrixX,\n multiplyMatrices(rotationMatrixY, rotationMatrixZ)\n );\n\n const updated = flatten(\n multiplyMatrices(\n multiplyMatrices(\n currentScale,\n multiplyMatrices(skewMatrix, rotationMatrix)\n ),\n currentTranslation\n )\n );\n\n animation.current = updated;\n\n return finished;\n };\n\n const arrayOnStart = (\n animation: Animation<AnimationObject>,\n value: Array<number>,\n timestamp: Timestamp,\n previousAnimation: Animation<AnimationObject>\n ): void => {\n value.forEach((v, i) => {\n animation[i] = Object.assign({}, animationCopy);\n animation[i].current = v;\n animation[i].toValue = (animation.toValue as Array<number>)[i];\n animation[i].onStart(\n animation[i],\n v,\n timestamp,\n previousAnimation ? previousAnimation[i] : undefined\n );\n });\n\n animation.current = value;\n };\n\n const arrayOnFrame = (\n animation: Animation<AnimationObject>,\n timestamp: Timestamp\n ): boolean => {\n let finished = true;\n (animation.current as Array<number>).forEach((_, i) => {\n const result = animation[i].onFrame(animation[i], timestamp);\n // We really need to assign this value to result, instead of passing it directly - otherwise once \"finished\" is false, onFrame won't be called\n finished = finished && result;\n (animation.current as Array<number>)[i] = animation[i].current;\n });\n\n return finished;\n };\n\n const objectOnStart = (\n animation: Animation<AnimationObject>,\n value: AnimatableValueObject,\n timestamp: Timestamp,\n previousAnimation: Animation<AnimationObject>\n ): void => {\n for (const key in value) {\n animation[key] = Object.assign({}, animationCopy);\n animation[key].onStart = animation.onStart;\n\n animation[key].current = value[key];\n animation[key].toValue = (animation.toValue as AnimatableValueObject)[\n key\n ];\n animation[key].onStart(\n animation[key],\n value[key],\n timestamp,\n previousAnimation ? previousAnimation[key] : undefined\n );\n }\n animation.current = value;\n };\n\n const objectOnFrame = (\n animation: Animation<AnimationObject>,\n timestamp: Timestamp\n ): boolean => {\n let finished = true;\n const newObject: AnimatableValueObject = {};\n for (const key in animation.current as AnimatableValueObject) {\n const result = animation[key].onFrame(animation[key], timestamp);\n // We really need to assign this value to result, instead of passing it directly - otherwise once \"finished\" is false, onFrame won't be called\n finished = finished && result;\n newObject[key] = animation[key].current;\n }\n animation.current = newObject;\n return finished;\n };\n\n animation.onStart = (\n animation: Animation<AnimationObject>,\n value: number,\n timestamp: Timestamp,\n previousAnimation: Animation<AnimationObject>\n ) => {\n if (animation.reduceMotion === undefined) {\n animation.reduceMotion = getReduceMotionFromConfig();\n }\n if (animation.reduceMotion) {\n if (animation.toValue !== undefined) {\n animation.current = animation.toValue;\n } else {\n // if there is no `toValue`, then the base function is responsible for setting the current value\n baseOnStart(animation, value, timestamp, previousAnimation);\n }\n animation.startTime = 0;\n animation.onFrame = () => true;\n return;\n }\n if (isColor(value)) {\n colorOnStart(animation, value, timestamp, previousAnimation);\n animation.onFrame = colorOnFrame;\n return;\n } else if (isAffineMatrixFlat(value)) {\n transformationMatrixOnStart(\n animation,\n value,\n timestamp,\n previousAnimation\n );\n animation.onFrame = transformationMatrixOnFrame;\n return;\n } else if (Array.isArray(value)) {\n arrayOnStart(animation, value, timestamp, previousAnimation);\n animation.onFrame = arrayOnFrame;\n return;\n } else if (typeof value === 'string') {\n prefNumberSuffOnStart(animation, value, timestamp, previousAnimation);\n animation.onFrame = prefNumberSuffOnFrame;\n return;\n } else if (typeof value === 'object' && value !== null) {\n objectOnStart(animation, value, timestamp, previousAnimation);\n animation.onFrame = objectOnFrame;\n return;\n }\n baseOnStart(animation, value, timestamp, previousAnimation);\n };\n}\n\ntype AnimationToDecoration<\n T extends AnimationObject | StyleLayoutAnimation,\n U extends AnimationObject | StyleLayoutAnimation\n> = T extends StyleLayoutAnimation\n ? Record<string, unknown>\n : U | (() => U) | AnimatableValue;\n\nconst SHOULD_BE_USE_WEB = shouldBeUseWeb();\n\nexport function defineAnimation<\n T extends AnimationObject | StyleLayoutAnimation, // type that's supposed to be returned\n U extends AnimationObject | StyleLayoutAnimation = T // type that's received\n>(starting: AnimationToDecoration<T, U>, factory: () => T): T {\n 'worklet';\n if (IN_STYLE_UPDATER) {\n return starting as unknown as T;\n }\n const create = () => {\n 'worklet';\n const animation = factory();\n decorateAnimation<U>(animation as unknown as U);\n return animation;\n };\n\n if (_WORKLET || SHOULD_BE_USE_WEB) {\n return create();\n }\n // @ts-ignore: eslint-disable-line\n return create;\n}\n\n/**\n * Lets you cancel a running animation paired to a shared value.\n *\n * @param sharedValue - The shared value of a running animation that you want to cancel.\n * @see https://docs.swmansion.com/react-native-reanimated/docs/core/cancelAnimation\n */\nexport function cancelAnimation<T>(sharedValue: SharedValue<T>): void {\n 'worklet';\n // setting the current value cancels the animation if one is currently running\n sharedValue.value = sharedValue.value; // eslint-disable-line no-self-assign\n}\n"],"mappings":"AAAA;AACA,YAAY;;AAGZ,SACEA,OAAO,EACPC,aAAa,EACbC,oBAAoB,EACpBC,YAAY,EACZC,aAAa,QACR,WAAW;AAClB,SAASC,YAAY,QAAQ,gBAAgB;AAa7C,SACE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AAO,GAAGoB,qBAAqB;MACzC;IACF,CAAC,MAAM,IAAI,OAAO5C,KAAK,KAAK,QAAQ,IAAIA,KAAK,KAAK,IAAI,EAAE;MACtD+E,aAAa,CAAC3D,SAAS,EAAEpB,KAAK,EAAE0B,SAAS,EAAEC,iBAAiB,CAAC;MAC7DP,SAAS,CAACI,OAAO,GAAGwD,aAAa;MACjC;IACF;IACA3D,WAAW,CAACD,SAAS,EAAEpB,KAAK,EAAE0B,SAAS,EAAEC,iBAAiB,CAAC;EAC7D,CAAC;AACH;AASA,MAAM0D,iBAAiB,GAAG/F,cAAc,EAAE;AAE1C,OAAO,SAASgG,eAAeA,CAG7BC,QAAqC,EAAEC,OAAgB,EAAK;EAC5D,SAAS;;EACT,IAAIjG,gBAAgB,EAAE;IACpB,OAAOgG,QAAQ;EACjB;EACA,MAAME,MAAM,GAAGA,CAAA,KAAM;IACnB,SAAS;;IACT,MAAMrE,SAAS,GAAGoE,OAAO,EAAE;IAC3BrE,iBAAiB,CAAIC,SAAS,CAAiB;IAC/C,OAAOA,SAAS;EAClB,CAAC;EAED,IAAIsE,QAAQ,IAAIL,iBAAiB,EAAE;IACjC,OAAOI,MAAM,EAAE;EACjB;EACA;EACA,OAAOA,MAAM;AACf;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASE,eAAeA,CAAIC,WAA2B,EAAQ;EACpE,SAAS;;EACT;EACAA,WAAW,CAAC5F,KAAK,GAAG4F,WAAW,CAAC5F,KAAK,CAAC,CAAC;AACzC"}
|
|
1
|
+
{"version":3,"names":["isColor","convertToRGBA","rgbaArrayToRGBAColor","toGammaSpace","toLinearSpace","ReduceMotion","isWorkletFunction","flatten","multiplyMatrices","scaleMatrix","addMatrices","decomposeMatrixIntoMatricesAndAngles","isAffineMatrixFlat","subtractMatrices","getRotationMatrix","isReducedMotion","shouldBeUseWeb","IN_STYLE_UPDATER","IS_REDUCED_MOTION","SHOULD_BE_USE_WEB","__DEV__","console","warn","assertEasingIsWorklet","easing","_WORKLET","factory","Error","initialUpdaterRun","updater","result","recognizePrefixSuffix","value","match","prefix","suffix","number","strippedValue","parseFloat","getReduceMotionFromConfig","config","System","Always","getReduceMotionForAnimation","undefined","applyProgressToMatrix","progress","a","b","applyProgressToNumber","decorateAnimation","animation","baseOnStart","onStart","baseOnFrame","onFrame","isHigherOrder","timestamp","previousAnimation","reduceMotion","animationCopy","Object","assign","callback","prefNumberSuffOnStart","__prefix","__suffix","strippedCurrent","strippedToValue","toValue","current","startValue","paPrefix","paSuffix","paStrippedValue","prefNumberSuffOnFrame","res","tab","colorOnStart","RGBAValue","RGBACurrent","RGBAToValue","forEach","i","index","push","colorOnFrame","finished","transformationMatrixOnStart","startMatrices","stopMatrices","transformationMatrixOnFrame","transforms","mappedTransforms","key","_","currentTranslation","currentScale","skewMatrix","rotations","mappedRotations","angle","rotationMatrixX","rotationMatrixY","rotationMatrixZ","rotationMatrix","updated","arrayOnStart","v","arrayOnFrame","objectOnStart","objectOnFrame","newObject","startTime","Array","isArray","defineAnimation","starting","create","cancelAnimation","sharedValue"],"sources":["util.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-shadow */\n'use strict';\nimport type { HigherOrderAnimation, StyleLayoutAnimation } from './commonTypes';\nimport type { ParsedColorArray } from '../Colors';\nimport {\n isColor,\n convertToRGBA,\n rgbaArrayToRGBAColor,\n toGammaSpace,\n toLinearSpace,\n} from '../Colors';\nimport { ReduceMotion, isWorkletFunction } from '../commonTypes';\nimport type {\n SharedValue,\n AnimatableValue,\n Animation,\n AnimationObject,\n Timestamp,\n AnimatableValueObject,\n} from '../commonTypes';\nimport type {\n AffineMatrixFlat,\n AffineMatrix,\n} from './transformationMatrix/matrixUtils';\nimport {\n flatten,\n multiplyMatrices,\n scaleMatrix,\n addMatrices,\n decomposeMatrixIntoMatricesAndAngles,\n isAffineMatrixFlat,\n subtractMatrices,\n getRotationMatrix,\n} from './transformationMatrix/matrixUtils';\nimport { isReducedMotion, shouldBeUseWeb } from '../PlatformChecker';\nimport type { EasingFunction, EasingFunctionFactory } from '../Easing';\n\nlet IN_STYLE_UPDATER = false;\nconst IS_REDUCED_MOTION = isReducedMotion();\nconst SHOULD_BE_USE_WEB = shouldBeUseWeb();\n\nif (__DEV__ && IS_REDUCED_MOTION) {\n console.warn(\n `[Reanimated] Reduced motion setting is enabled on this device. This warning is visible only in the development mode. Some animations will be disabled by default. You can override the behavior for individual animations, see https://docs.swmansion.com/react-native-reanimated/docs/guides/troubleshooting#reduced-motion-setting-is-enabled-on-this-device.`\n );\n}\n\nexport function assertEasingIsWorklet(\n easing: EasingFunction | EasingFunctionFactory\n): void {\n 'worklet';\n if (_WORKLET) {\n // If this is called on UI (for example from gesture handler with worklets), we don't get easing,\n // but its bound copy, which is not a worklet. We don't want to throw any error then.\n return;\n }\n if (SHOULD_BE_USE_WEB) {\n // It is possible to run reanimated on web without plugin, so let's skip this check on web\n return;\n }\n // @ts-ignore typescript wants us to use `in` instead, which doesn't work with host objects\n if (easing?.factory) {\n return;\n }\n\n if (!isWorkletFunction(easing)) {\n throw new Error(\n '[Reanimated] The easing function is not a worklet. Please make sure you import `Easing` from react-native-reanimated.'\n );\n }\n}\n\nexport function initialUpdaterRun<T>(updater: () => T) {\n IN_STYLE_UPDATER = true;\n const result = updater();\n IN_STYLE_UPDATER = false;\n return result;\n}\n\ninterface RecognizedPrefixSuffix {\n prefix?: string;\n suffix?: string;\n strippedValue: number;\n}\n\nexport function recognizePrefixSuffix(\n value: string | number\n): RecognizedPrefixSuffix {\n 'worklet';\n if (typeof value === 'string') {\n const match = value.match(\n /([A-Za-z]*)(-?\\d*\\.?\\d*)([eE][-+]?[0-9]+)?([A-Za-z%]*)/\n );\n if (!match) {\n throw new Error(\"[Reanimated] Couldn't parse animation value.\");\n }\n const prefix = match[1];\n const suffix = match[4];\n // number with scientific notation\n const number = match[2] + (match[3] ?? '');\n return { prefix, suffix, strippedValue: parseFloat(number) };\n } else {\n return { strippedValue: value };\n }\n}\n\n/**\n * Returns whether the motion should be reduced for a specified config.\n * By default returns the system setting.\n */\nexport function getReduceMotionFromConfig(config?: ReduceMotion) {\n 'worklet';\n return !config || config === ReduceMotion.System\n ? IS_REDUCED_MOTION\n : config === ReduceMotion.Always;\n}\n\n/**\n * Returns the value that should be assigned to `animation.reduceMotion`\n * for a given config. If the config is not defined, `undefined` is returned.\n */\nexport function getReduceMotionForAnimation(config?: ReduceMotion) {\n 'worklet';\n // if the config is not defined, we want `reduceMotion` to be undefined,\n // so the parent animation knows if it should overwrite it\n if (!config) {\n return undefined;\n }\n\n return getReduceMotionFromConfig(config);\n}\n\nfunction applyProgressToMatrix(\n progress: number,\n a: AffineMatrix,\n b: AffineMatrix\n) {\n 'worklet';\n return addMatrices(a, scaleMatrix(subtractMatrices(b, a), progress));\n}\n\nfunction applyProgressToNumber(progress: number, a: number, b: number) {\n 'worklet';\n return a + progress * (b - a);\n}\n\nfunction decorateAnimation<T extends AnimationObject | StyleLayoutAnimation>(\n animation: T\n): void {\n 'worklet';\n const baseOnStart = (animation as Animation<AnimationObject>).onStart;\n const baseOnFrame = (animation as Animation<AnimationObject>).onFrame;\n\n if ((animation as HigherOrderAnimation).isHigherOrder) {\n animation.onStart = (\n animation: Animation<AnimationObject>,\n value: number,\n timestamp: Timestamp,\n previousAnimation: Animation<AnimationObject>\n ) => {\n if (animation.reduceMotion === undefined) {\n animation.reduceMotion = getReduceMotionFromConfig();\n }\n return baseOnStart(animation, value, timestamp, previousAnimation);\n };\n return;\n }\n\n const animationCopy = Object.assign({}, animation);\n delete animationCopy.callback;\n\n const prefNumberSuffOnStart = (\n animation: Animation<AnimationObject>,\n value: string | number,\n timestamp: number,\n previousAnimation: Animation<AnimationObject>\n ) => {\n // recognize prefix, suffix, and updates stripped value on animation start\n const { prefix, suffix, strippedValue } = recognizePrefixSuffix(value);\n animation.__prefix = prefix;\n animation.__suffix = suffix;\n animation.strippedCurrent = strippedValue;\n const { strippedValue: strippedToValue } = recognizePrefixSuffix(\n animation.toValue as string | number\n );\n animation.current = strippedValue;\n animation.startValue = strippedValue;\n animation.toValue = strippedToValue;\n if (previousAnimation && previousAnimation !== animation) {\n const {\n prefix: paPrefix,\n suffix: paSuffix,\n strippedValue: paStrippedValue,\n } = recognizePrefixSuffix(previousAnimation.current as string | number);\n previousAnimation.current = paStrippedValue;\n previousAnimation.__prefix = paPrefix;\n previousAnimation.__suffix = paSuffix;\n }\n\n baseOnStart(animation, strippedValue, timestamp, previousAnimation);\n\n animation.current =\n (animation.__prefix ?? '') +\n animation.current +\n (animation.__suffix ?? '');\n\n if (previousAnimation && previousAnimation !== animation) {\n previousAnimation.current =\n (previousAnimation.__prefix ?? '') +\n // FIXME\n // eslint-disable-next-line @typescript-eslint/restrict-plus-operands\n previousAnimation.current +\n (previousAnimation.__suffix ?? '');\n }\n };\n const prefNumberSuffOnFrame = (\n animation: Animation<AnimationObject>,\n timestamp: number\n ) => {\n animation.current = animation.strippedCurrent;\n const res = baseOnFrame(animation, timestamp);\n animation.strippedCurrent = animation.current;\n animation.current =\n (animation.__prefix ?? '') +\n animation.current +\n (animation.__suffix ?? '');\n return res;\n };\n\n const tab = ['R', 'G', 'B', 'A'];\n const colorOnStart = (\n animation: Animation<AnimationObject>,\n value: string | number,\n timestamp: Timestamp,\n previousAnimation: Animation<AnimationObject>\n ): void => {\n let RGBAValue: ParsedColorArray;\n let RGBACurrent: ParsedColorArray;\n let RGBAToValue: ParsedColorArray;\n const res: Array<number> = [];\n if (isColor(value)) {\n RGBACurrent = toLinearSpace(convertToRGBA(animation.current));\n RGBAValue = toLinearSpace(convertToRGBA(value));\n if (animation.toValue) {\n RGBAToValue = toLinearSpace(convertToRGBA(animation.toValue));\n }\n }\n tab.forEach((i, index) => {\n animation[i] = Object.assign({}, animationCopy);\n animation[i].current = RGBACurrent[index];\n animation[i].toValue = RGBAToValue ? RGBAToValue[index] : undefined;\n animation[i].onStart(\n animation[i],\n RGBAValue[index],\n timestamp,\n previousAnimation ? previousAnimation[i] : undefined\n );\n res.push(animation[i].current);\n });\n\n animation.current = rgbaArrayToRGBAColor(\n toGammaSpace(res as ParsedColorArray)\n );\n };\n\n const colorOnFrame = (\n animation: Animation<AnimationObject>,\n timestamp: Timestamp\n ): boolean => {\n const RGBACurrent = toLinearSpace(convertToRGBA(animation.current));\n const res: Array<number> = [];\n let finished = true;\n tab.forEach((i, index) => {\n animation[i].current = RGBACurrent[index];\n const result = animation[i].onFrame(animation[i], timestamp);\n // We really need to assign this value to result, instead of passing it directly - otherwise once \"finished\" is false, onFrame won't be called\n finished = finished && result;\n res.push(animation[i].current);\n });\n\n animation.current = rgbaArrayToRGBAColor(\n toGammaSpace(res as ParsedColorArray)\n );\n return finished;\n };\n\n const transformationMatrixOnStart = (\n animation: Animation<AnimationObject>,\n value: AffineMatrixFlat,\n timestamp: Timestamp,\n previousAnimation: Animation<AnimationObject>\n ): void => {\n const toValue = animation.toValue as AffineMatrixFlat;\n\n animation.startMatrices = decomposeMatrixIntoMatricesAndAngles(value);\n animation.stopMatrices = decomposeMatrixIntoMatricesAndAngles(toValue);\n\n // We create an animation copy to animate single value between 0 and 100\n // We set limits from 0 to 100 (instead of 0-1) to make spring look good\n // with default thresholds.\n\n animation[0] = Object.assign({}, animationCopy);\n animation[0].current = 0;\n animation[0].toValue = 100;\n animation[0].onStart(\n animation[0],\n 0,\n timestamp,\n previousAnimation ? previousAnimation[0] : undefined\n );\n\n animation.current = value;\n };\n\n const transformationMatrixOnFrame = (\n animation: Animation<AnimationObject>,\n timestamp: Timestamp\n ): boolean => {\n let finished = true;\n const result = animation[0].onFrame(animation[0], timestamp);\n // We really need to assign this value to result, instead of passing it directly - otherwise once \"finished\" is false, onFrame won't be called\n finished = finished && result;\n\n const progress = animation[0].current / 100;\n\n const transforms = ['translationMatrix', 'scaleMatrix', 'skewMatrix'];\n const mappedTransforms: Array<AffineMatrix> = [];\n\n transforms.forEach((key, _) =>\n mappedTransforms.push(\n applyProgressToMatrix(\n progress,\n animation.startMatrices[key],\n animation.stopMatrices[key]\n )\n )\n );\n\n const [currentTranslation, currentScale, skewMatrix] = mappedTransforms;\n\n const rotations: Array<'x' | 'y' | 'z'> = ['x', 'y', 'z'];\n const mappedRotations: Array<AffineMatrix> = [];\n\n rotations.forEach((key, _) => {\n const angle = applyProgressToNumber(\n progress,\n animation.startMatrices['r' + key],\n animation.stopMatrices['r' + key]\n );\n mappedRotations.push(getRotationMatrix(angle, key));\n });\n\n const [rotationMatrixX, rotationMatrixY, rotationMatrixZ] = mappedRotations;\n\n const rotationMatrix = multiplyMatrices(\n rotationMatrixX,\n multiplyMatrices(rotationMatrixY, rotationMatrixZ)\n );\n\n const updated = flatten(\n multiplyMatrices(\n multiplyMatrices(\n currentScale,\n multiplyMatrices(skewMatrix, rotationMatrix)\n ),\n currentTranslation\n )\n );\n\n animation.current = updated;\n\n return finished;\n };\n\n const arrayOnStart = (\n animation: Animation<AnimationObject>,\n value: Array<number>,\n timestamp: Timestamp,\n previousAnimation: Animation<AnimationObject>\n ): void => {\n value.forEach((v, i) => {\n animation[i] = Object.assign({}, animationCopy);\n animation[i].current = v;\n animation[i].toValue = (animation.toValue as Array<number>)[i];\n animation[i].onStart(\n animation[i],\n v,\n timestamp,\n previousAnimation ? previousAnimation[i] : undefined\n );\n });\n\n animation.current = value;\n };\n\n const arrayOnFrame = (\n animation: Animation<AnimationObject>,\n timestamp: Timestamp\n ): boolean => {\n let finished = true;\n (animation.current as Array<number>).forEach((_, i) => {\n const result = animation[i].onFrame(animation[i], timestamp);\n // We really need to assign this value to result, instead of passing it directly - otherwise once \"finished\" is false, onFrame won't be called\n finished = finished && result;\n (animation.current as Array<number>)[i] = animation[i].current;\n });\n\n return finished;\n };\n\n const objectOnStart = (\n animation: Animation<AnimationObject>,\n value: AnimatableValueObject,\n timestamp: Timestamp,\n previousAnimation: Animation<AnimationObject>\n ): void => {\n for (const key in value) {\n animation[key] = Object.assign({}, animationCopy);\n animation[key].onStart = animation.onStart;\n\n animation[key].current = value[key];\n animation[key].toValue = (animation.toValue as AnimatableValueObject)[\n key\n ];\n animation[key].onStart(\n animation[key],\n value[key],\n timestamp,\n previousAnimation ? previousAnimation[key] : undefined\n );\n }\n animation.current = value;\n };\n\n const objectOnFrame = (\n animation: Animation<AnimationObject>,\n timestamp: Timestamp\n ): boolean => {\n let finished = true;\n const newObject: AnimatableValueObject = {};\n for (const key in animation.current as AnimatableValueObject) {\n const result = animation[key].onFrame(animation[key], timestamp);\n // We really need to assign this value to result, instead of passing it directly - otherwise once \"finished\" is false, onFrame won't be called\n finished = finished && result;\n newObject[key] = animation[key].current;\n }\n animation.current = newObject;\n return finished;\n };\n\n animation.onStart = (\n animation: Animation<AnimationObject>,\n value: number,\n timestamp: Timestamp,\n previousAnimation: Animation<AnimationObject>\n ) => {\n if (animation.reduceMotion === undefined) {\n animation.reduceMotion = getReduceMotionFromConfig();\n }\n if (animation.reduceMotion) {\n if (animation.toValue !== undefined) {\n animation.current = animation.toValue;\n } else {\n // if there is no `toValue`, then the base function is responsible for setting the current value\n baseOnStart(animation, value, timestamp, previousAnimation);\n }\n animation.startTime = 0;\n animation.onFrame = () => true;\n return;\n }\n if (isColor(value)) {\n colorOnStart(animation, value, timestamp, previousAnimation);\n animation.onFrame = colorOnFrame;\n return;\n } else if (isAffineMatrixFlat(value)) {\n transformationMatrixOnStart(\n animation,\n value,\n timestamp,\n previousAnimation\n );\n animation.onFrame = transformationMatrixOnFrame;\n return;\n } else if (Array.isArray(value)) {\n arrayOnStart(animation, value, timestamp, previousAnimation);\n animation.onFrame = arrayOnFrame;\n return;\n } else if (typeof value === 'string') {\n prefNumberSuffOnStart(animation, value, timestamp, previousAnimation);\n animation.onFrame = prefNumberSuffOnFrame;\n return;\n } else if (typeof value === 'object' && value !== null) {\n objectOnStart(animation, value, timestamp, previousAnimation);\n animation.onFrame = objectOnFrame;\n return;\n }\n baseOnStart(animation, value, timestamp, previousAnimation);\n };\n}\n\ntype AnimationToDecoration<\n T extends AnimationObject | StyleLayoutAnimation,\n U extends AnimationObject | StyleLayoutAnimation\n> = T extends StyleLayoutAnimation\n ? Record<string, unknown>\n : U | (() => U) | AnimatableValue;\n\nexport function defineAnimation<\n T extends AnimationObject | StyleLayoutAnimation, // type that's supposed to be returned\n U extends AnimationObject | StyleLayoutAnimation = T // type that's received\n>(starting: AnimationToDecoration<T, U>, factory: () => T): T {\n 'worklet';\n if (IN_STYLE_UPDATER) {\n return starting as unknown as T;\n }\n const create = () => {\n 'worklet';\n const animation = factory();\n decorateAnimation<U>(animation as unknown as U);\n return animation;\n };\n\n if (_WORKLET || SHOULD_BE_USE_WEB) {\n return create();\n }\n // @ts-ignore: eslint-disable-line\n return create;\n}\n\n/**\n * Lets you cancel a running animation paired to a shared value.\n *\n * @param sharedValue - The shared value of a running animation that you want to cancel.\n * @see https://docs.swmansion.com/react-native-reanimated/docs/core/cancelAnimation\n */\nexport function cancelAnimation<T>(sharedValue: SharedValue<T>): void {\n 'worklet';\n // setting the current value cancels the animation if one is currently running\n sharedValue.value = sharedValue.value; // eslint-disable-line no-self-assign\n}\n"],"mappings":"AAAA;AACA,YAAY;;AAGZ,SACEA,OAAO,EACPC,aAAa,EACbC,oBAAoB,EACpBC,YAAY,EACZC,aAAa,QACR,WAAW;AAClB,SAASC,YAAY,EAAEC,iBAAiB,QAAQ,gBAAgB;AAahE,SACEC,OAAO,EACPC,gBAAgB,EAChBC,WAAW,EACXC,WAAW,EACXC,oCAAoC,EACpCC,kBAAkB,EAClBC,gBAAgB,EAChBC,iBAAiB,QACZ,oCAAoC;AAC3C,SAASC,eAAe,EAAEC,cAAc,QAAQ,oBAAoB;AAGpE,IAAIC,gBAAgB,GAAG,KAAK;AAC5B,MAAMC,iBAAiB,GAAGH,eAAe,CAAC,CAAC;AAC3C,MAAMI,iBAAiB,GAAGH,cAAc,CAAC,CAAC;AAE1C,IAAII,OAAO,IAAIF,iBAAiB,EAAE;EAChCG,OAAO,CAACC,IAAI,CACT,iWACH,CAAC;AACH;AAEA,OAAO,SAASC,q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qB;MACzC;IACF,CAAC,MAAM,IAAI,OAAO3C,KAAK,KAAK,QAAQ,IAAIA,KAAK,KAAK,IAAI,EAAE;MACtD8E,aAAa,CAAC3D,SAAS,EAAEnB,KAAK,EAAEyB,SAAS,EAAEC,iBAAiB,CAAC;MAC7DP,SAAS,CAACI,OAAO,GAAGwD,aAAa;MACjC;IACF;IACA3D,WAAW,CAACD,SAAS,EAAEnB,KAAK,EAAEyB,SAAS,EAAEC,iBAAiB,CAAC;EAC7D,CAAC;AACH;AASA,OAAO,SAAS0D,eAAeA,CAG7BC,QAAqC,EAAE3F,OAAgB,EAAK;EAC5D,SAAS;;EACT,IAAIT,gBAAgB,EAAE;IACpB,OAAOoG,QAAQ;EACjB;EACA,MAAMC,MAAM,GAAGA,CAAA,KAAM;IACnB,SAAS;;IACT,MAAMnE,SAAS,GAAGzB,OAAO,CAAC,CAAC;IAC3BwB,iBAAiB,CAAIC,SAAyB,CAAC;IAC/C,OAAOA,SAAS;EAClB,CAAC;EAED,IAAI1B,QAAQ,IAAIN,iBAAiB,EAAE;IACjC,OAAOmG,MAAM,CAAC,CAAC;EACjB;EACA;EACA,OAAOA,MAAM;AACf;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,eAAeA,CAAIC,WAA2B,EAAQ;EACpE,SAAS;;EACT;EACAA,WAAW,CAACxF,KAAK,GAAGwF,WAAW,CAACxF,KAAK,CAAC,CAAC;AACzC","ignoreList":[]}
|
|
@@ -13,8 +13,10 @@
|
|
|
13
13
|
// check other methods that may use them. However, this field is not actually defined
|
|
14
14
|
// nor should be used for anything else as assigning any data to those objects will
|
|
15
15
|
// throw an error.
|
|
16
|
+
|
|
16
17
|
// In case of objects with depth or arrays of objects or arrays of arrays etc.
|
|
17
18
|
// we add this utility type that makes it a SharaebleRef of the outermost type.
|
|
19
|
+
|
|
18
20
|
/**
|
|
19
21
|
* This function allows you to determine if a given function is a worklet. It only works
|
|
20
22
|
* with Reanimated Babel plugin enabled. Unless you are doing something with internals of
|
|
@@ -41,7 +43,7 @@ export function isWorkletFunction(value) {
|
|
|
41
43
|
|
|
42
44
|
// Since host objects always return true for `in` operator, we have to use dot notation to check if the property exists.
|
|
43
45
|
// See https://github.com/facebook/hermes/blob/340726ef8cf666a7cce75bc60b02fa56b3e54560/lib/VM/JSObject.cpp#L1276.
|
|
44
|
-
return !!value.__workletHash;
|
|
46
|
+
return typeof value === 'function' && !!value.__workletHash;
|
|
45
47
|
}
|
|
46
48
|
export let SensorType = /*#__PURE__*/function (SensorType) {
|
|
47
49
|
SensorType[SensorType["ACCELEROMETER"] = 1] = "ACCELEROMETER";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["isWorkletFunction","value","__workletHash","SensorType","IOSReferenceFrame","InterfaceOrientation","KeyboardState","ReduceMotion"],"sources":["commonTypes.ts"],"sourcesContent":["'use strict';\nimport type { ViewStyle, TextStyle } from 'react-native';\n\nexport type RequiredKeys<T, K extends keyof T> = T & Required<Pick<T, K>>;\nexport interface StyleProps extends ViewStyle, TextStyle {\n originX?: number;\n originY?: number;\n [key: string]: any;\n}\n\n/**\n * A value that can be used both on the [JavaScript thread](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/glossary#javascript-thread) and the [UI thread](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/glossary#ui-thread).\n *\n * Shared values are defined using [useSharedValue](https://docs.swmansion.com/react-native-reanimated/docs/core/useSharedValue) hook. You access and modify shared values by their `.value` property.\n */\nexport interface SharedValue<Value = unknown> {\n value: Value;\n addListener: (listenerID: number, listener: (value: Value) => void) => void;\n removeListener: (listenerID: number) => void;\n modify: (\n modifier?: <T extends Value>(value: T) => T,\n forceUpdate?: boolean\n ) => void;\n}\n\nexport interface Mutable<Value = unknown> extends SharedValue<Value> {\n _isReanimatedSharedValue: true;\n _animation?: AnimationObject<Value> | null; // only in Native\n _value: Value;\n}\n\n// The below type is used for HostObjects returned by the JSI API that don't have\n// any accessible fields or methods but can carry data that is accessed from the\n// c++ side. We add a field to the type to make it possible for typescript to recognize\n// which JSI methods accept those types as arguments and to be able to correctly type\n// check other methods that may use them. However, this field is not actually defined\n// nor should be used for anything else as assigning any data to those objects will\n// throw an error.\nexport type ShareableRef<T = unknown> = {\n __hostObjectShareableJSRef: T;\n};\n\n// In case of objects with depth or arrays of objects or arrays of arrays etc.\n// we add this utility type that makes it a SharaebleRef of the outermost type.\nexport type FlatShareableRef<T> = T extends ShareableRef<infer U>\n ? ShareableRef<U>\n : ShareableRef<T>;\n\nexport type MapperRawInputs = unknown[];\n\nexport type MapperOutputs = SharedValue[];\n\nexport type MapperRegistry = {\n start: (\n mapperID: number,\n worklet: () => void,\n inputs: MapperRawInputs,\n outputs?: MapperOutputs\n ) => void;\n stop: (mapperID: number) => void;\n};\n\nexport type WorkletStackDetails = [\n error: Error,\n lineOffset: number,\n columnOffset: number\n];\n\ntype WorkletClosure = Record<string, unknown>;\n\ninterface WorkletInitDataCommon {\n code: string;\n}\n\ntype WorkletInitDataRelease = WorkletInitDataCommon;\n\ninterface WorkletInitDataDev extends WorkletInitDataCommon {\n location: string;\n sourceMap: string;\n version: string;\n}\n\ninterface WorkletBaseCommon {\n __closure: WorkletClosure;\n __workletHash: number;\n}\n\ninterface WorkletBaseRelease extends WorkletBaseCommon {\n __initData: WorkletInitDataRelease;\n}\n\ninterface WorkletBaseDev extends WorkletBaseCommon {\n __initData: WorkletInitDataDev;\n /**\n * `__stackDetails` is removed after parsing.\n */\n __stackDetails?: WorkletStackDetails;\n}\n\nexport type WorkletFunction<\n Args extends unknown[] = unknown[],\n ReturnValue = unknown\n> = ((...args: Args) => ReturnValue) & (WorkletBaseRelease | WorkletBaseDev);\n\n/**\n * This function allows you to determine if a given function is a worklet. It only works\n * with Reanimated Babel plugin enabled. Unless you are doing something with internals of\n * Reanimated you shouldn't need to use this function.\n *\n * ### Note\n * Do not call it before the worklet is declared, as it will always return false then. E.g.:\n *\n * ```ts\n * isWorkletFunction(myWorklet); // Will always return false.\n *\n * function myWorklet() {\n * 'worklet';\n * };\n * ```\n *\n * ### Maintainer note\n * This function works well on the JS thread performance-wise, since the JIT can inline it.\n * However, on other threads it will not get optimized and we will get a function call overhead.\n * We want to change it in the future, but it's not feasible at the moment.\n */\nexport function isWorkletFunction<\n Args extends unknown[] = unknown[],\n ReturnValue = unknown,\n BuildType extends WorkletBaseDev | WorkletBaseRelease = WorkletBaseDev\n>(value: unknown): value is WorkletFunction<Args, ReturnValue> & BuildType {\n 'worklet';\n // Since host objects always return true for `in` operator, we have to use dot notation to check if the property exists.\n // See https://github.com/facebook/hermes/blob/340726ef8cf666a7cce75bc60b02fa56b3e54560/lib/VM/JSObject.cpp#L1276.\n return !!(value as Record<string, unknown>).__workletHash;\n}\n\nexport type AnimatedPropsAdapterFunction = (\n props: Record<string, unknown>\n) => void;\n\nexport type AnimatedPropsAdapterWorklet = WorkletFunction<\n [props: Record<string, unknown>],\n void\n>;\n\nexport interface NestedObject<T> {\n [key: string]: NestedObjectValues<T>;\n}\n\nexport type NestedObjectValues<T> =\n | T\n | Array<NestedObjectValues<T>>\n | NestedObject<T>;\n\ntype Animatable = number | string | Array<number>;\n\nexport type AnimatableValueObject = { [key: string]: Animatable };\n\nexport type AnimatableValue = Animatable | AnimatableValueObject;\n\nexport interface AnimationObject<T = AnimatableValue> {\n [key: string]: any;\n callback?: AnimationCallback;\n current?: T;\n toValue?: AnimationObject<T>['current'];\n startValue?: AnimationObject<T>['current'];\n finished?: boolean;\n strippedCurrent?: number;\n cancelled?: boolean;\n reduceMotion?: boolean;\n\n __prefix?: string;\n __suffix?: string;\n onFrame: (animation: any, timestamp: Timestamp) => boolean;\n onStart: (\n nextAnimation: any,\n current: any,\n timestamp: Timestamp,\n previousAnimation: any\n ) => void;\n}\n\nexport interface Animation<T extends AnimationObject> extends AnimationObject {\n onFrame: (animation: T, timestamp: Timestamp) => boolean;\n onStart: (\n nextAnimation: T,\n current: AnimatableValue,\n timestamp: Timestamp,\n previousAnimation: Animation<any> | null | T\n ) => void;\n}\n\nexport enum SensorType {\n ACCELEROMETER = 1,\n GYROSCOPE = 2,\n GRAVITY = 3,\n MAGNETIC_FIELD = 4,\n ROTATION = 5,\n}\nexport enum IOSReferenceFrame {\n XArbitraryZVertical,\n XArbitraryCorrectedZVertical,\n XMagneticNorthZVertical,\n XTrueNorthZVertical,\n Auto,\n}\n\nexport type SensorConfig = {\n interval: number | 'auto';\n adjustToInterfaceOrientation: boolean;\n iosReferenceFrame: IOSReferenceFrame;\n};\n\nexport type AnimatedSensor<T extends Value3D | ValueRotation> = {\n sensor: SharedValue<T>;\n unregister: () => void;\n isAvailable: boolean;\n config: SensorConfig;\n};\n\n/**\n * A function called upon animation completion. If the animation is cancelled, the callback will receive `false` as the argument; otherwise, it will receive `true`.\n */\nexport type AnimationCallback = (\n finished?: boolean,\n current?: AnimatableValue\n) => void;\n\nexport type Timestamp = number;\n\nexport type Value3D = {\n x: number;\n y: number;\n z: number;\n interfaceOrientation: InterfaceOrientation;\n};\n\nexport type ValueRotation = {\n qw: number;\n qx: number;\n qy: number;\n qz: number;\n yaw: number;\n pitch: number;\n roll: number;\n interfaceOrientation: InterfaceOrientation;\n};\n\nexport enum InterfaceOrientation {\n ROTATION_0 = 0,\n ROTATION_90 = 90,\n ROTATION_180 = 180,\n ROTATION_270 = 270,\n}\n\nexport type ShadowNodeWrapper = {\n __hostObjectShadowNodeWrapper: never;\n};\n\nexport enum KeyboardState {\n UNKNOWN = 0,\n OPENING = 1,\n OPEN = 2,\n CLOSING = 3,\n CLOSED = 4,\n}\n\nexport type AnimatedKeyboardInfo = {\n height: SharedValue<number>;\n state: SharedValue<KeyboardState>;\n};\n\n/**\n * @param x - A number representing X coordinate relative to the parent component.\n * @param y - A number representing Y coordinate relative to the parent component.\n * @param width - A number representing the width of the component.\n * @param height - A number representing the height of the component.\n * @param pageX - A number representing X coordinate relative to the screen.\n * @param pageY - A number representing Y coordinate relative to the screen.\n * @see https://docs.swmansion.com/react-native-reanimated/docs/advanced/measure#returns\n */\nexport interface MeasuredDimensions {\n x: number;\n y: number;\n width: number;\n height: number;\n pageX: number;\n pageY: number;\n}\n\nexport interface AnimatedKeyboardOptions {\n isStatusBarTranslucentAndroid?: boolean;\n}\n\n/**\n * @param System - If the `Reduce motion` accessibility setting is enabled on the device, disable the animation. Otherwise, enable the animation.\n * @param Always - Disable the animation.\n * @param Never - Enable the animation.\n * @see https://docs.swmansion.com/react-native-reanimated/docs/guides/accessibility\n */\nexport enum ReduceMotion {\n System = 'system',\n Always = 'always',\n Never = 'never',\n}\n"],"mappings":"AAAA,YAAY;;AAUZ;AACA;AACA;AACA;AACA;;AAiBA;AACA;AACA;AACA;AACA;AACA;AACA;AAKA;AACA;AA6DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,iBAAiBA,CAI/BC,KAAc,EAA2D;EACzE,SAAS;;EACT;EACA;EACA,OAAO,CAAC,CAAEA,KAAK,CAA6BC,aAAa;AAC3D;AA0DA,WAAYC,UAAU,0BAAVA,UAAU;EAAVA,UAAU,CAAVA,UAAU;EAAVA,UAAU,CAAVA,UAAU;EAAVA,UAAU,CAAVA,UAAU;EAAVA,UAAU,CAAVA,UAAU;EAAVA,UAAU,CAAVA,UAAU;EAAA,OAAVA,UAAU;AAAA;AAOtB,WAAYC,iBAAiB,0BAAjBA,iBAAiB;EAAjBA,iBAAiB,CAAjBA,iBAAiB;EAAjBA,iBAAiB,CAAjBA,iBAAiB;EAAjBA,iBAAiB,CAAjBA,iBAAiB;EAAjBA,iBAAiB,CAAjBA,iBAAiB;EAAjBA,iBAAiB,CAAjBA,iBAAiB;EAAA,OAAjBA,iBAAiB;AAAA;;AAqB7B;AACA;AACA;;AA0BA,WAAYC,oBAAoB,0BAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAAA,OAApBA,oBAAoB;AAAA;AAWhC,WAAYC,aAAa,0BAAbA,aAAa;EAAbA,aAAa,CAAbA,aAAa;EAAbA,aAAa,CAAbA,aAAa;EAAbA,aAAa,CAAbA,aAAa;EAAbA,aAAa,CAAbA,aAAa;EAAbA,aAAa,CAAbA,aAAa;EAAA,OAAbA,aAAa;AAAA;;AAazB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAcA;AACA;AACA;AACA;AACA;AACA;AACA,WAAYC,YAAY,0BAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAA,OAAZA,YAAY;AAAA"}
|
|
1
|
+
{"version":3,"names":["isWorkletFunction","value","__workletHash","SensorType","IOSReferenceFrame","InterfaceOrientation","KeyboardState","ReduceMotion"],"sources":["commonTypes.ts"],"sourcesContent":["'use strict';\nimport type { ViewStyle, TextStyle } from 'react-native';\n\nexport type RequiredKeys<T, K extends keyof T> = T & Required<Pick<T, K>>;\nexport interface StyleProps extends ViewStyle, TextStyle {\n originX?: number;\n originY?: number;\n [key: string]: any;\n}\n\n/**\n * A value that can be used both on the [JavaScript thread](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/glossary#javascript-thread) and the [UI thread](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/glossary#ui-thread).\n *\n * Shared values are defined using [useSharedValue](https://docs.swmansion.com/react-native-reanimated/docs/core/useSharedValue) hook. You access and modify shared values by their `.value` property.\n */\nexport interface SharedValue<Value = unknown> {\n value: Value;\n addListener: (listenerID: number, listener: (value: Value) => void) => void;\n removeListener: (listenerID: number) => void;\n modify: (\n modifier?: <T extends Value>(value: T) => T,\n forceUpdate?: boolean\n ) => void;\n}\n\nexport interface Mutable<Value = unknown> extends SharedValue<Value> {\n _isReanimatedSharedValue: true;\n _animation?: AnimationObject<Value> | null; // only in Native\n _value: Value;\n}\n\n// The below type is used for HostObjects returned by the JSI API that don't have\n// any accessible fields or methods but can carry data that is accessed from the\n// c++ side. We add a field to the type to make it possible for typescript to recognize\n// which JSI methods accept those types as arguments and to be able to correctly type\n// check other methods that may use them. However, this field is not actually defined\n// nor should be used for anything else as assigning any data to those objects will\n// throw an error.\nexport type ShareableRef<T = unknown> = {\n __hostObjectShareableJSRef: T;\n};\n\n// In case of objects with depth or arrays of objects or arrays of arrays etc.\n// we add this utility type that makes it a SharaebleRef of the outermost type.\nexport type FlatShareableRef<T> = T extends ShareableRef<infer U>\n ? ShareableRef<U>\n : ShareableRef<T>;\n\nexport type MapperRawInputs = unknown[];\n\nexport type MapperOutputs = SharedValue[];\n\nexport type MapperRegistry = {\n start: (\n mapperID: number,\n worklet: () => void,\n inputs: MapperRawInputs,\n outputs?: MapperOutputs\n ) => void;\n stop: (mapperID: number) => void;\n};\n\nexport type WorkletStackDetails = [\n error: Error,\n lineOffset: number,\n columnOffset: number\n];\n\ntype WorkletClosure = Record<string, unknown>;\n\ninterface WorkletInitDataCommon {\n code: string;\n}\n\ntype WorkletInitDataRelease = WorkletInitDataCommon;\n\ninterface WorkletInitDataDev extends WorkletInitDataCommon {\n location: string;\n sourceMap: string;\n version: string;\n}\n\ninterface WorkletBaseCommon {\n __closure: WorkletClosure;\n __workletHash: number;\n}\n\ninterface WorkletBaseRelease extends WorkletBaseCommon {\n __initData: WorkletInitDataRelease;\n}\n\ninterface WorkletBaseDev extends WorkletBaseCommon {\n __initData: WorkletInitDataDev;\n /**\n * `__stackDetails` is removed after parsing.\n */\n __stackDetails?: WorkletStackDetails;\n}\n\nexport type WorkletFunction<\n Args extends unknown[] = unknown[],\n ReturnValue = unknown\n> = ((...args: Args) => ReturnValue) & (WorkletBaseRelease | WorkletBaseDev);\n\n/**\n * This function allows you to determine if a given function is a worklet. It only works\n * with Reanimated Babel plugin enabled. Unless you are doing something with internals of\n * Reanimated you shouldn't need to use this function.\n *\n * ### Note\n * Do not call it before the worklet is declared, as it will always return false then. E.g.:\n *\n * ```ts\n * isWorkletFunction(myWorklet); // Will always return false.\n *\n * function myWorklet() {\n * 'worklet';\n * };\n * ```\n *\n * ### Maintainer note\n * This function works well on the JS thread performance-wise, since the JIT can inline it.\n * However, on other threads it will not get optimized and we will get a function call overhead.\n * We want to change it in the future, but it's not feasible at the moment.\n */\nexport function isWorkletFunction<\n Args extends unknown[] = unknown[],\n ReturnValue = unknown,\n BuildType extends WorkletBaseDev | WorkletBaseRelease = WorkletBaseDev\n>(value: unknown): value is WorkletFunction<Args, ReturnValue> & BuildType {\n 'worklet';\n // Since host objects always return true for `in` operator, we have to use dot notation to check if the property exists.\n // See https://github.com/facebook/hermes/blob/340726ef8cf666a7cce75bc60b02fa56b3e54560/lib/VM/JSObject.cpp#L1276.\n return (\n typeof value === 'function' &&\n !!(value as unknown as Record<string, unknown>).__workletHash\n );\n}\n\nexport type AnimatedPropsAdapterFunction = (\n props: Record<string, unknown>\n) => void;\n\nexport type AnimatedPropsAdapterWorklet = WorkletFunction<\n [props: Record<string, unknown>],\n void\n>;\n\nexport interface NestedObject<T> {\n [key: string]: NestedObjectValues<T>;\n}\n\nexport type NestedObjectValues<T> =\n | T\n | Array<NestedObjectValues<T>>\n | NestedObject<T>;\n\ntype Animatable = number | string | Array<number>;\n\nexport type AnimatableValueObject = { [key: string]: Animatable };\n\nexport type AnimatableValue = Animatable | AnimatableValueObject;\n\nexport interface AnimationObject<T = AnimatableValue> {\n [key: string]: any;\n callback?: AnimationCallback;\n current?: T;\n toValue?: AnimationObject<T>['current'];\n startValue?: AnimationObject<T>['current'];\n finished?: boolean;\n strippedCurrent?: number;\n cancelled?: boolean;\n reduceMotion?: boolean;\n\n __prefix?: string;\n __suffix?: string;\n onFrame: (animation: any, timestamp: Timestamp) => boolean;\n onStart: (\n nextAnimation: any,\n current: any,\n timestamp: Timestamp,\n previousAnimation: any\n ) => void;\n}\n\nexport interface Animation<T extends AnimationObject> extends AnimationObject {\n onFrame: (animation: T, timestamp: Timestamp) => boolean;\n onStart: (\n nextAnimation: T,\n current: AnimatableValue,\n timestamp: Timestamp,\n previousAnimation: Animation<any> | null | T\n ) => void;\n}\n\nexport enum SensorType {\n ACCELEROMETER = 1,\n GYROSCOPE = 2,\n GRAVITY = 3,\n MAGNETIC_FIELD = 4,\n ROTATION = 5,\n}\nexport enum IOSReferenceFrame {\n XArbitraryZVertical,\n XArbitraryCorrectedZVertical,\n XMagneticNorthZVertical,\n XTrueNorthZVertical,\n Auto,\n}\n\nexport type SensorConfig = {\n interval: number | 'auto';\n adjustToInterfaceOrientation: boolean;\n iosReferenceFrame: IOSReferenceFrame;\n};\n\nexport type AnimatedSensor<T extends Value3D | ValueRotation> = {\n sensor: SharedValue<T>;\n unregister: () => void;\n isAvailable: boolean;\n config: SensorConfig;\n};\n\n/**\n * A function called upon animation completion. If the animation is cancelled, the callback will receive `false` as the argument; otherwise, it will receive `true`.\n */\nexport type AnimationCallback = (\n finished?: boolean,\n current?: AnimatableValue\n) => void;\n\nexport type Timestamp = number;\n\nexport type Value3D = {\n x: number;\n y: number;\n z: number;\n interfaceOrientation: InterfaceOrientation;\n};\n\nexport type ValueRotation = {\n qw: number;\n qx: number;\n qy: number;\n qz: number;\n yaw: number;\n pitch: number;\n roll: number;\n interfaceOrientation: InterfaceOrientation;\n};\n\nexport enum InterfaceOrientation {\n ROTATION_0 = 0,\n ROTATION_90 = 90,\n ROTATION_180 = 180,\n ROTATION_270 = 270,\n}\n\nexport type ShadowNodeWrapper = {\n __hostObjectShadowNodeWrapper: never;\n};\n\nexport enum KeyboardState {\n UNKNOWN = 0,\n OPENING = 1,\n OPEN = 2,\n CLOSING = 3,\n CLOSED = 4,\n}\n\nexport type AnimatedKeyboardInfo = {\n height: SharedValue<number>;\n state: SharedValue<KeyboardState>;\n};\n\n/**\n * @param x - A number representing X coordinate relative to the parent component.\n * @param y - A number representing Y coordinate relative to the parent component.\n * @param width - A number representing the width of the component.\n * @param height - A number representing the height of the component.\n * @param pageX - A number representing X coordinate relative to the screen.\n * @param pageY - A number representing Y coordinate relative to the screen.\n * @see https://docs.swmansion.com/react-native-reanimated/docs/advanced/measure#returns\n */\nexport interface MeasuredDimensions {\n x: number;\n y: number;\n width: number;\n height: number;\n pageX: number;\n pageY: number;\n}\n\nexport interface AnimatedKeyboardOptions {\n isStatusBarTranslucentAndroid?: boolean;\n}\n\n/**\n * @param System - If the `Reduce motion` accessibility setting is enabled on the device, disable the animation. Otherwise, enable the animation.\n * @param Always - Disable the animation.\n * @param Never - Enable the animation.\n * @see https://docs.swmansion.com/react-native-reanimated/docs/guides/accessibility\n */\nexport enum ReduceMotion {\n System = 'system',\n Always = 'always',\n Never = 'never',\n}\n"],"mappings":"AAAA,YAAY;;AAUZ;AACA;AACA;AACA;AACA;;AAiBA;AACA;AACA;AACA;AACA;AACA;AACA;;AAKA;AACA;;AA6DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,iBAAiBA,CAI/BC,KAAc,EAA2D;EACzE,SAAS;;EACT;EACA;EACA,OACE,OAAOA,KAAK,KAAK,UAAU,IAC3B,CAAC,CAAEA,KAAK,CAAwCC,aAAa;AAEjE;AA0DA,WAAYC,UAAU,0BAAVA,UAAU;EAAVA,UAAU,CAAVA,UAAU;EAAVA,UAAU,CAAVA,UAAU;EAAVA,UAAU,CAAVA,UAAU;EAAVA,UAAU,CAAVA,UAAU;EAAVA,UAAU,CAAVA,UAAU;EAAA,OAAVA,UAAU;AAAA;AAOtB,WAAYC,iBAAiB,0BAAjBA,iBAAiB;EAAjBA,iBAAiB,CAAjBA,iBAAiB;EAAjBA,iBAAiB,CAAjBA,iBAAiB;EAAjBA,iBAAiB,CAAjBA,iBAAiB;EAAjBA,iBAAiB,CAAjBA,iBAAiB;EAAjBA,iBAAiB,CAAjBA,iBAAiB;EAAA,OAAjBA,iBAAiB;AAAA;;AAqB7B;AACA;AACA;;AA0BA,WAAYC,oBAAoB,0BAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAAA,OAApBA,oBAAoB;AAAA;AAWhC,WAAYC,aAAa,0BAAbA,aAAa;EAAbA,aAAa,CAAbA,aAAa;EAAbA,aAAa,CAAbA,aAAa;EAAbA,aAAa,CAAbA,aAAa;EAAbA,aAAa,CAAbA,aAAa;EAAbA,aAAa,CAAbA,aAAa;EAAA,OAAbA,aAAa;AAAA;;AAazB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAcA;AACA;AACA;AACA;AACA;AACA;AACA,WAAYC,YAAY,0BAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAA,OAAZA,YAAY;AAAA","ignoreList":[]}
|
|
@@ -22,6 +22,7 @@ const createCellRendererComponent = itemLayoutAnimationRef => {
|
|
|
22
22
|
|
|
23
23
|
// Since createAnimatedComponent return type is ComponentClass that has the props of the argument,
|
|
24
24
|
// but not things like NativeMethods, etc. we need to add them manually by extending the type.
|
|
25
|
+
|
|
25
26
|
// We need explicit any here, because this is the exact same type that is used in React Native types.
|
|
26
27
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
27
28
|
const FlatListForwardRefRender = function (props, ref) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_extends","Object","assign","bind","target","i","arguments","length","source","key","prototype","hasOwnProperty","call","apply","React","forwardRef","useRef","FlatList","AnimatedView","createAnimatedComponent","LayoutAnimationConfig","AnimatedFlatList","createCellRendererComponent","itemLayoutAnimationRef","CellRendererComponent","props","createElement","layout","current","onLayout","style","children","FlatListForwardRefRender","ref","itemLayoutAnimation","skipEnteringExitingAnimations","restProps","scrollEventThrottle","useMemo","animatedFlatList","undefined","skipEntering","skipExiting","ReanimatedFlatList"],"sources":["FlatList.tsx"],"sourcesContent":["'use strict';\nimport React, { forwardRef, useRef } from 'react';\nimport type {\n FlatListProps,\n LayoutChangeEvent,\n StyleProp,\n ViewStyle,\n} from 'react-native';\nimport { FlatList } from 'react-native';\nimport { AnimatedView } from './View';\nimport { createAnimatedComponent } from '../../createAnimatedComponent';\nimport type { ILayoutAnimationBuilder } from '../layoutReanimation/animationBuilder/commonTypes';\nimport { LayoutAnimationConfig } from './LayoutAnimationConfig';\nimport type { AnimatedProps, AnimatedStyle } from '../helperTypes';\n\nconst AnimatedFlatList = createAnimatedComponent(FlatList);\n\ninterface CellRendererComponentProps {\n onLayout?: ((event: LayoutChangeEvent) => void) | undefined;\n children: React.ReactNode;\n style?: StyleProp<AnimatedStyle<ViewStyle>>;\n}\n\nconst createCellRendererComponent = (\n itemLayoutAnimationRef?: React.MutableRefObject<\n ILayoutAnimationBuilder | undefined\n >\n) => {\n const CellRendererComponent = (props: CellRendererComponentProps) => {\n return (\n <AnimatedView\n // TODO TYPESCRIPT This is temporary cast is to get rid of .d.ts file.\n layout={itemLayoutAnimationRef?.current as any}\n onLayout={props.onLayout}\n style={props.style}>\n {props.children}\n </AnimatedView>\n );\n };\n\n return CellRendererComponent;\n};\n\ninterface ReanimatedFlatListPropsWithLayout<T>\n extends AnimatedProps<FlatListProps<T>> {\n /**\n * Lets you pass layout animation directly to the FlatList item.\n */\n itemLayoutAnimation?: ILayoutAnimationBuilder;\n /**\n * Lets you skip entering and exiting animations of FlatList items when on FlatList mount or unmount.\n */\n skipEnteringExitingAnimations?: boolean;\n}\n\nexport type FlatListPropsWithLayout<T> = ReanimatedFlatListPropsWithLayout<T>;\n\n// Since createAnimatedComponent return type is ComponentClass that has the props of the argument,\n// but not things like NativeMethods, etc. we need to add them manually by extending the type.\ninterface AnimatedFlatListComplement<T> extends FlatList<T> {\n getNode(): FlatList<T>;\n}\n\n// We need explicit any here, because this is the exact same type that is used in React Native types.\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst FlatListForwardRefRender = function <Item = any>(\n props: ReanimatedFlatListPropsWithLayout<Item>,\n ref: React.ForwardedRef<FlatList>\n) {\n const { itemLayoutAnimation, skipEnteringExitingAnimations, ...restProps } =\n props;\n\n // Set default scrollEventThrottle, because user expects\n // to have continuous scroll events and\n // react-native defaults it to 50 for FlatLists.\n // We set it to 1, so we have peace until\n // there are 960 fps screens.\n if (!('scrollEventThrottle' in restProps)) {\n restProps.scrollEventThrottle = 1;\n }\n\n const itemLayoutAnimationRef = useRef(itemLayoutAnimation);\n itemLayoutAnimationRef.current = itemLayoutAnimation;\n\n const CellRendererComponent = React.useMemo(\n () => createCellRendererComponent(itemLayoutAnimationRef),\n [itemLayoutAnimationRef]\n );\n\n const animatedFlatList = (\n // @ts-expect-error In its current type state, createAnimatedComponent cannot create generic components.\n <AnimatedFlatList\n ref={ref}\n {...restProps}\n CellRendererComponent={CellRendererComponent}\n />\n );\n\n if (skipEnteringExitingAnimations === undefined) {\n return animatedFlatList;\n }\n\n return (\n <LayoutAnimationConfig skipEntering skipExiting>\n {animatedFlatList}\n </LayoutAnimationConfig>\n );\n};\n\nexport const ReanimatedFlatList = forwardRef(FlatListForwardRefRender) as <\n // We need explicit any here, because this is the exact same type that is used in React Native types.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ItemT = any\n>(\n props: ReanimatedFlatListPropsWithLayout<ItemT> & {\n ref?: React.ForwardedRef<FlatList>;\n }\n) => React.ReactElement;\n\nexport type ReanimatedFlatList<T> = typeof AnimatedFlatList &\n AnimatedFlatListComplement<T>;\n"],"mappings":"AAAA,YAAY;;AAAC,SAAAA,SAAA,IAAAA,QAAA,GAAAC,MAAA,CAAAC,MAAA,GAAAD,MAAA,CAAAC,MAAA,CAAAC,IAAA,eAAAC,MAAA,aAAAC,CAAA,MAAAA,CAAA,GAAAC,SAAA,CAAAC,MAAA,EAAAF,CAAA,UAAAG,MAAA,GAAAF,SAAA,CAAAD,CAAA,YAAAI,GAAA,IAAAD,MAAA,QAAAP,MAAA,CAAAS,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAJ,MAAA,EAAAC,GAAA,KAAAL,MAAA,CAAAK,GAAA,IAAAD,MAAA,CAAAC,GAAA,gBAAAL,MAAA,YAAAJ,QAAA,CAAAa,KAAA,OAAAP,SAAA;AACb,OAAOQ,KAAK,IAAIC,UAAU,EAAEC,MAAM,QAAQ,OAAO;AAOjD,SAASC,QAAQ,QAAQ,cAAc;AACvC,SAASC,YAAY,QAAQ,QAAQ;AACrC,SAASC,uBAAuB,QAAQ,+BAA+B;AAEvE,SAASC,qBAAqB,QAAQ,yBAAyB;AAG/D,MAAMC,gBAAgB,GAAGF,uBAAuB,CAACF,QAAQ,CAAC;AAQ1D,MAAMK,2BAA2B,GAC/BC,sBAEC,IACE;EACH,MAAMC,qBAAqB,GAAIC,KAAiC,IAAK;IACnE,oBACEX,KAAA,CAAAY,aAAA,CAACR;IACC;IAAA;MACAS,MAAM,EAAEJ,sBAAsB,aAAtBA,sBAAsB,uBAAtBA,sBAAsB,CAAEK,OAAe;MAC/CC,QAAQ,EAAEJ,KAAK,CAACI,QAAS;MACzBC,KAAK,EAAEL,KAAK,CAACK;IAAM,GAClBL,KAAK,CAACM,
|
|
1
|
+
{"version":3,"names":["_extends","Object","assign","bind","target","i","arguments","length","source","key","prototype","hasOwnProperty","call","apply","React","forwardRef","useRef","FlatList","AnimatedView","createAnimatedComponent","LayoutAnimationConfig","AnimatedFlatList","createCellRendererComponent","itemLayoutAnimationRef","CellRendererComponent","props","createElement","layout","current","onLayout","style","children","FlatListForwardRefRender","ref","itemLayoutAnimation","skipEnteringExitingAnimations","restProps","scrollEventThrottle","useMemo","animatedFlatList","undefined","skipEntering","skipExiting","ReanimatedFlatList"],"sources":["FlatList.tsx"],"sourcesContent":["'use strict';\nimport React, { forwardRef, useRef } from 'react';\nimport type {\n FlatListProps,\n LayoutChangeEvent,\n StyleProp,\n ViewStyle,\n} from 'react-native';\nimport { FlatList } from 'react-native';\nimport { AnimatedView } from './View';\nimport { createAnimatedComponent } from '../../createAnimatedComponent';\nimport type { ILayoutAnimationBuilder } from '../layoutReanimation/animationBuilder/commonTypes';\nimport { LayoutAnimationConfig } from './LayoutAnimationConfig';\nimport type { AnimatedProps, AnimatedStyle } from '../helperTypes';\n\nconst AnimatedFlatList = createAnimatedComponent(FlatList);\n\ninterface CellRendererComponentProps {\n onLayout?: ((event: LayoutChangeEvent) => void) | undefined;\n children: React.ReactNode;\n style?: StyleProp<AnimatedStyle<ViewStyle>>;\n}\n\nconst createCellRendererComponent = (\n itemLayoutAnimationRef?: React.MutableRefObject<\n ILayoutAnimationBuilder | undefined\n >\n) => {\n const CellRendererComponent = (props: CellRendererComponentProps) => {\n return (\n <AnimatedView\n // TODO TYPESCRIPT This is temporary cast is to get rid of .d.ts file.\n layout={itemLayoutAnimationRef?.current as any}\n onLayout={props.onLayout}\n style={props.style}>\n {props.children}\n </AnimatedView>\n );\n };\n\n return CellRendererComponent;\n};\n\ninterface ReanimatedFlatListPropsWithLayout<T>\n extends AnimatedProps<FlatListProps<T>> {\n /**\n * Lets you pass layout animation directly to the FlatList item.\n */\n itemLayoutAnimation?: ILayoutAnimationBuilder;\n /**\n * Lets you skip entering and exiting animations of FlatList items when on FlatList mount or unmount.\n */\n skipEnteringExitingAnimations?: boolean;\n}\n\nexport type FlatListPropsWithLayout<T> = ReanimatedFlatListPropsWithLayout<T>;\n\n// Since createAnimatedComponent return type is ComponentClass that has the props of the argument,\n// but not things like NativeMethods, etc. we need to add them manually by extending the type.\ninterface AnimatedFlatListComplement<T> extends FlatList<T> {\n getNode(): FlatList<T>;\n}\n\n// We need explicit any here, because this is the exact same type that is used in React Native types.\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst FlatListForwardRefRender = function <Item = any>(\n props: ReanimatedFlatListPropsWithLayout<Item>,\n ref: React.ForwardedRef<FlatList>\n) {\n const { itemLayoutAnimation, skipEnteringExitingAnimations, ...restProps } =\n props;\n\n // Set default scrollEventThrottle, because user expects\n // to have continuous scroll events and\n // react-native defaults it to 50 for FlatLists.\n // We set it to 1, so we have peace until\n // there are 960 fps screens.\n if (!('scrollEventThrottle' in restProps)) {\n restProps.scrollEventThrottle = 1;\n }\n\n const itemLayoutAnimationRef = useRef(itemLayoutAnimation);\n itemLayoutAnimationRef.current = itemLayoutAnimation;\n\n const CellRendererComponent = React.useMemo(\n () => createCellRendererComponent(itemLayoutAnimationRef),\n [itemLayoutAnimationRef]\n );\n\n const animatedFlatList = (\n // @ts-expect-error In its current type state, createAnimatedComponent cannot create generic components.\n <AnimatedFlatList\n ref={ref}\n {...restProps}\n CellRendererComponent={CellRendererComponent}\n />\n );\n\n if (skipEnteringExitingAnimations === undefined) {\n return animatedFlatList;\n }\n\n return (\n <LayoutAnimationConfig skipEntering skipExiting>\n {animatedFlatList}\n </LayoutAnimationConfig>\n );\n};\n\nexport const ReanimatedFlatList = forwardRef(FlatListForwardRefRender) as <\n // We need explicit any here, because this is the exact same type that is used in React Native types.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ItemT = any\n>(\n props: ReanimatedFlatListPropsWithLayout<ItemT> & {\n ref?: React.ForwardedRef<FlatList>;\n }\n) => React.ReactElement;\n\nexport type ReanimatedFlatList<T> = typeof AnimatedFlatList &\n AnimatedFlatListComplement<T>;\n"],"mappings":"AAAA,YAAY;;AAAC,SAAAA,SAAA,IAAAA,QAAA,GAAAC,MAAA,CAAAC,MAAA,GAAAD,MAAA,CAAAC,MAAA,CAAAC,IAAA,eAAAC,MAAA,aAAAC,CAAA,MAAAA,CAAA,GAAAC,SAAA,CAAAC,MAAA,EAAAF,CAAA,UAAAG,MAAA,GAAAF,SAAA,CAAAD,CAAA,YAAAI,GAAA,IAAAD,MAAA,QAAAP,MAAA,CAAAS,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAJ,MAAA,EAAAC,GAAA,KAAAL,MAAA,CAAAK,GAAA,IAAAD,MAAA,CAAAC,GAAA,gBAAAL,MAAA,YAAAJ,QAAA,CAA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AAA,CAACL,gBAAgB,EAAArB,QAAA;IACfiC,GAAG,EAAEA;EAAI,GACLG,SAAS;IACbZ,qBAAqB,EAAEA;EAAsB,EAC9C,CACF;EAED,IAAIW,6BAA6B,KAAKK,SAAS,EAAE;IAC/C,OAAOD,gBAAgB;EACzB;EAEA,oBACEzB,KAAA,CAAAY,aAAA,CAACN,qBAAqB;IAACqB,YAAY;IAACC,WAAW;EAAA,GAC5CH,gBACoB,CAAC;AAE5B,CAAC;AAED,OAAO,MAAMI,kBAAkB,gBAAG5B,UAAU,CAACiB,wBAAwB,CAQ9C","ignoreList":[]}
|
|
@@ -5,5 +5,6 @@ import { createAnimatedComponent } from '../../createAnimatedComponent';
|
|
|
5
5
|
|
|
6
6
|
// Since createAnimatedComponent return type is ComponentClass that has the props of the argument,
|
|
7
7
|
// but not things like NativeMethods, etc. we need to add them manually by extending the type.
|
|
8
|
+
|
|
8
9
|
export const AnimatedImage = createAnimatedComponent(Image);
|
|
9
10
|
//# sourceMappingURL=Image.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Image","createAnimatedComponent","AnimatedImage"],"sources":["Image.ts"],"sourcesContent":["'use strict';\nimport { Image } from 'react-native';\nimport { createAnimatedComponent } from '../../createAnimatedComponent';\n\n// Since createAnimatedComponent return type is ComponentClass that has the props of the argument,\n// but not things like NativeMethods, etc. we need to add them manually by extending the type.\ninterface AnimatedImageComplement extends Image {\n getNode(): Image;\n}\n\nexport const AnimatedImage = createAnimatedComponent(Image);\n\nexport type AnimatedImage = typeof AnimatedImage & AnimatedImageComplement;\n"],"mappings":"AAAA,YAAY;;AACZ,SAASA,KAAK,QAAQ,cAAc;AACpC,SAASC,uBAAuB,QAAQ,+BAA+B;;AAEvE;AACA
|
|
1
|
+
{"version":3,"names":["Image","createAnimatedComponent","AnimatedImage"],"sources":["Image.ts"],"sourcesContent":["'use strict';\nimport { Image } from 'react-native';\nimport { createAnimatedComponent } from '../../createAnimatedComponent';\n\n// Since createAnimatedComponent return type is ComponentClass that has the props of the argument,\n// but not things like NativeMethods, etc. we need to add them manually by extending the type.\ninterface AnimatedImageComplement extends Image {\n getNode(): Image;\n}\n\nexport const AnimatedImage = createAnimatedComponent(Image);\n\nexport type AnimatedImage = typeof AnimatedImage & AnimatedImageComplement;\n"],"mappings":"AAAA,YAAY;;AACZ,SAASA,KAAK,QAAQ,cAAc;AACpC,SAASC,uBAAuB,QAAQ,+BAA+B;;AAEvE;AACA;;AAKA,OAAO,MAAMC,aAAa,GAAGD,uBAAuB,CAACD,KAAK,CAAC","ignoreList":[]}
|
|
@@ -7,6 +7,7 @@ export const SkipEnteringContext = /*#__PURE__*/createContext(null);
|
|
|
7
7
|
|
|
8
8
|
// skipEntering - don't animate entering of children on wrapper mount
|
|
9
9
|
// skipExiting - don't animate exiting of children on wrapper unmount
|
|
10
|
+
|
|
10
11
|
function SkipEntering(props) {
|
|
11
12
|
const skipValueRef = useRef(props.shouldSkip);
|
|
12
13
|
useEffect(() => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Children","Component","createContext","useEffect","useRef","setShouldAnimateExitingForTag","findNodeHandle","SkipEnteringContext","SkipEntering","props","skipValueRef","shouldSkip","current","createElement","Provider","value","children","LayoutAnimationConfig","getMaybeWrappedChildren","count","skipExiting","map","child","setShouldAnimateExiting","tag","componentWillUnmount","undefined","render","skipEntering"],"sources":["LayoutAnimationConfig.tsx"],"sourcesContent":["'use strict';\nimport React, {\n Children,\n Component,\n createContext,\n useEffect,\n useRef,\n} from 'react';\nimport type { ReactNode } from 'react';\nimport { setShouldAnimateExitingForTag } from '../core';\nimport { findNodeHandle } from 'react-native';\n\nexport const SkipEnteringContext =\n createContext<React.MutableRefObject<boolean> | null>(null);\n\n// skipEntering - don't animate entering of children on wrapper mount\n// skipExiting - don't animate exiting of children on wrapper unmount\ninterface LayoutAnimationConfigProps {\n skipEntering?: boolean;\n skipExiting?: boolean;\n children: ReactNode;\n}\n\nfunction SkipEntering(props: { shouldSkip: boolean; children: ReactNode }) {\n const skipValueRef = useRef(props.shouldSkip);\n\n useEffect(() => {\n skipValueRef.current = false;\n }, [skipValueRef]);\n\n return (\n <SkipEnteringContext.Provider value={skipValueRef}>\n {props.children}\n </SkipEnteringContext.Provider>\n );\n}\n\n// skipExiting (unlike skipEntering) cannot be done by conditionally\n// configuring the animation in `createAnimatedComponent`, since at this stage\n// we don't know if the wrapper is going to be unmounted or not.\n// That's why we need to pass the skipExiting flag to the native side\n// when the wrapper is unmounted to prevent the animation.\n// Since `ReactNode` can be a list of nodes, we wrap every child with our wrapper\n// so we are able to access its tag with `findNodeHandle`.\n/**\n * A component that lets you skip entering and exiting animations.\n *\n * @param skipEntering - A boolean indicating whether children's entering animations should be skipped when `LayoutAnimationConfig` is mounted.\n * @param skipExiting - A boolean indicating whether children's exiting animations should be skipped when LayoutAnimationConfig is unmounted.\n * @see https://docs.swmansion.com/react-native-reanimated/docs/layout-animations/layout-animation-config/\n */\nexport class LayoutAnimationConfig extends Component<LayoutAnimationConfigProps> {\n getMaybeWrappedChildren() {\n return Children.count(this.props.children) > 1 && this.props.skipExiting\n ? Children.map(this.props.children, (child) => (\n <LayoutAnimationConfig skipExiting>{child}</LayoutAnimationConfig>\n ))\n : this.props.children;\n }\n\n setShouldAnimateExiting() {\n if (Children.count(this.props.children) === 1) {\n const tag = findNodeHandle(this);\n if (tag) {\n setShouldAnimateExitingForTag(tag, !this.props.skipExiting);\n }\n }\n }\n\n componentWillUnmount(): void {\n if (this.props.skipExiting !== undefined) {\n this.setShouldAnimateExiting();\n }\n }\n\n render(): ReactNode {\n const children = this.getMaybeWrappedChildren();\n\n if (this.props.skipEntering === undefined) {\n return children;\n }\n\n return (\n <SkipEntering shouldSkip={this.props.skipEntering}>\n {children}\n </SkipEntering>\n );\n }\n}\n"],"mappings":"AAAA,YAAY;;AACZ,OAAOA,KAAK,IACVC,QAAQ,EACRC,SAAS,EACTC,aAAa,EACbC,SAAS,EACTC,MAAM,QACD,OAAO;AAEd,SAASC,6BAA6B,QAAQ,SAAS;AACvD,SAASC,cAAc,QAAQ,cAAc;AAE7C,OAAO,MAAMC,mBAAmB,gBAC9BL,aAAa,CAAyC,IAAI,CAAC;;AAE7D;AACA
|
|
1
|
+
{"version":3,"names":["React","Children","Component","createContext","useEffect","useRef","setShouldAnimateExitingForTag","findNodeHandle","SkipEnteringContext","SkipEntering","props","skipValueRef","shouldSkip","current","createElement","Provider","value","children","LayoutAnimationConfig","getMaybeWrappedChildren","count","skipExiting","map","child","setShouldAnimateExiting","tag","componentWillUnmount","undefined","render","skipEntering"],"sources":["LayoutAnimationConfig.tsx"],"sourcesContent":["'use strict';\nimport React, {\n Children,\n Component,\n createContext,\n useEffect,\n useRef,\n} from 'react';\nimport type { ReactNode } from 'react';\nimport { setShouldAnimateExitingForTag } from '../core';\nimport { findNodeHandle } from 'react-native';\n\nexport const SkipEnteringContext =\n createContext<React.MutableRefObject<boolean> | null>(null);\n\n// skipEntering - don't animate entering of children on wrapper mount\n// skipExiting - don't animate exiting of children on wrapper unmount\ninterface LayoutAnimationConfigProps {\n skipEntering?: boolean;\n skipExiting?: boolean;\n children: ReactNode;\n}\n\nfunction SkipEntering(props: { shouldSkip: boolean; children: ReactNode }) {\n const skipValueRef = useRef(props.shouldSkip);\n\n useEffect(() => {\n skipValueRef.current = false;\n }, [skipValueRef]);\n\n return (\n <SkipEnteringContext.Provider value={skipValueRef}>\n {props.children}\n </SkipEnteringContext.Provider>\n );\n}\n\n// skipExiting (unlike skipEntering) cannot be done by conditionally\n// configuring the animation in `createAnimatedComponent`, since at this stage\n// we don't know if the wrapper is going to be unmounted or not.\n// That's why we need to pass the skipExiting flag to the native side\n// when the wrapper is unmounted to prevent the animation.\n// Since `ReactNode` can be a list of nodes, we wrap every child with our wrapper\n// so we are able to access its tag with `findNodeHandle`.\n/**\n * A component that lets you skip entering and exiting animations.\n *\n * @param skipEntering - A boolean indicating whether children's entering animations should be skipped when `LayoutAnimationConfig` is mounted.\n * @param skipExiting - A boolean indicating whether children's exiting animations should be skipped when LayoutAnimationConfig is unmounted.\n * @see https://docs.swmansion.com/react-native-reanimated/docs/layout-animations/layout-animation-config/\n */\nexport class LayoutAnimationConfig extends Component<LayoutAnimationConfigProps> {\n getMaybeWrappedChildren() {\n return Children.count(this.props.children) > 1 && this.props.skipExiting\n ? Children.map(this.props.children, (child) => (\n <LayoutAnimationConfig skipExiting>{child}</LayoutAnimationConfig>\n ))\n : this.props.children;\n }\n\n setShouldAnimateExiting() {\n if (Children.count(this.props.children) === 1) {\n const tag = findNodeHandle(this);\n if (tag) {\n setShouldAnimateExitingForTag(tag, !this.props.skipExiting);\n }\n }\n }\n\n componentWillUnmount(): void {\n if (this.props.skipExiting !== undefined) {\n this.setShouldAnimateExiting();\n }\n }\n\n render(): ReactNode {\n const children = this.getMaybeWrappedChildren();\n\n if (this.props.skipEntering === undefined) {\n return children;\n }\n\n return (\n <SkipEntering shouldSkip={this.props.skipEntering}>\n {children}\n </SkipEntering>\n );\n }\n}\n"],"mappings":"AAAA,YAAY;;AACZ,OAAOA,KAAK,IACVC,QAAQ,EACRC,SAAS,EACTC,aAAa,EACbC,SAAS,EACTC,MAAM,QACD,OAAO;AAEd,SAASC,6BAA6B,QAAQ,SAAS;AACvD,SAASC,cAAc,QAAQ,cAAc;AAE7C,OAAO,MAAMC,mBAAmB,gBAC9BL,aAAa,CAAyC,IAAI,CAAC;;AAE7D;AACA;;AAOA,SAASM,YAAYA,CAACC,KAAmD,EAAE;EACzE,MAAMC,YAAY,GAAGN,MAAM,CAACK,KAAK,CAACE,UAAU,CAAC;EAE7CR,SAAS,CAAC,MAAM;IACdO,YAAY,CAACE,OAAO,GAAG,KAAK;EAC9B,CAAC,EAAE,CAACF,YAAY,CAAC,CAAC;EAElB,oBACEX,KAAA,CAAAc,aAAA,CAACN,mBAAmB,CAACO,QAAQ;IAACC,KAAK,EAAEL;EAAa,GAC/CD,KAAK,CAACO,QACqB,CAAC;AAEnC;;AAEA;A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