react-native-reanimated 3.8.0 → 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 +1 -0
- 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 +12 -12
- 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/animationBuilder.tsx +2 -0
- 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/mock.ts +13 -1
- 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":["convertAnimationObjectToKeyframes","DEFAULT_ZOOM_TIME","ZoomInData","ZoomIn","name","style","transform","scale","duration","ZoomInRotate","rotate","ZoomInRight","translateX","ZoomInLeft","ZoomInUp","translateY","ZoomInDown","ZoomInEasyUp","ZoomInEasyDown","ZoomOutData","ZoomOut","ZoomOutRotate","ZoomOutRight","ZoomOutLeft","ZoomOutUp","ZoomOutDown","ZoomOutEasyUp","ZoomOutEasyDown"],"sources":["Zoom.web.ts"],"sourcesContent":["'use strict';\nimport { convertAnimationObjectToKeyframes } from '../animationParser';\n\nconst DEFAULT_ZOOM_TIME = 0.3;\n\nexport const ZoomInData = {\n ZoomIn: {\n name: 'ZoomIn',\n style: {\n 0: { transform: [{ scale: 0 }] },\n 100: { transform: [{ scale: 1 }] },\n },\n duration: DEFAULT_ZOOM_TIME,\n },\n\n ZoomInRotate: {\n name: 'ZoomInRotate',\n style: {\n 0: { transform: [{ scale: 0, rotate: '0.3rad' }] },\n 100: { transform: [{ scale: 1, rotate: '0deg' }] },\n },\n duration: DEFAULT_ZOOM_TIME,\n },\n\n ZoomInRight: {\n name: 'ZoomInRight',\n style: {\n 0: { transform: [{ translateX: '100vw', scale: 0 }] },\n 100: { transform: [{ translateX: '0%', scale: 1 }] },\n },\n duration: DEFAULT_ZOOM_TIME,\n },\n\n ZoomInLeft: {\n name: 'ZoomInLeft',\n style: {\n 0: { transform: [{ translateX: '-100vw', scale: 0 }] },\n 100: { transform: [{ translateX: '0%', scale: 1 }] },\n },\n duration: DEFAULT_ZOOM_TIME,\n },\n\n ZoomInUp: {\n name: 'ZoomInUp',\n style: {\n 0: { transform: [{ translateY: '-100vh', scale: 0 }] },\n 100: { transform: [{ translateY: '0%', scale: 1 }] },\n },\n duration: DEFAULT_ZOOM_TIME,\n },\n\n ZoomInDown: {\n name: 'ZoomInDown',\n style: {\n 0: { transform: [{ translateY: '100vh', scale: 0 }] },\n 100: { transform: [{ translateY: '0%', scale: 1 }] },\n },\n duration: DEFAULT_ZOOM_TIME,\n },\n\n ZoomInEasyUp: {\n name: 'ZoomInEasyUp',\n style: {\n 0: { transform: [{ translateY: '-100%', scale: 0 }] },\n 100: { transform: [{ translateY: '0%', scale: 1 }] },\n },\n duration: DEFAULT_ZOOM_TIME,\n },\n\n ZoomInEasyDown: {\n name: 'ZoomInEasyDown',\n style: {\n 0: { transform: [{ translateY: '100%', scale: 0 }] },\n 100: { transform: [{ translateY: '0%', scale: 1 }] },\n },\n duration: DEFAULT_ZOOM_TIME,\n },\n};\n\nexport const ZoomOutData = {\n ZoomOut: {\n name: 'ZoomOut',\n style: {\n 100: { transform: [{ scale: 0 }] },\n },\n duration: DEFAULT_ZOOM_TIME,\n },\n\n ZoomOutRotate: {\n name: 'ZoomOutRotate',\n style: {\n 100: { transform: [{ scale: 0, rotate: '0.3rad' }] },\n },\n duration: DEFAULT_ZOOM_TIME,\n },\n\n ZoomOutRight: {\n name: 'ZoomOutRight',\n style: {\n 100: { transform: [{ translateX: '100vw', scale: 0 }] },\n },\n duration: DEFAULT_ZOOM_TIME,\n },\n\n ZoomOutLeft: {\n name: 'ZoomOutLeft',\n style: {\n 100: { transform: [{ translateX: '-100vw', scale: 1 }] },\n },\n duration: DEFAULT_ZOOM_TIME,\n },\n\n ZoomOutUp: {\n name: 'ZoomOutUp',\n style: {\n 100: { transform: [{ translateY: '-100vh', scale: 0 }] },\n },\n duration: DEFAULT_ZOOM_TIME,\n },\n\n ZoomOutDown: {\n name: 'ZoomOutDown',\n style: {\n 100: { transform: [{ translateY: '100vh', scale: 0 }] },\n },\n duration: DEFAULT_ZOOM_TIME,\n },\n\n ZoomOutEasyUp: {\n name: 'ZoomOutEasyUp',\n style: {\n 100: { transform: [{ translateY: '-100%', scale: 0 }] },\n },\n duration: DEFAULT_ZOOM_TIME,\n },\n\n ZoomOutEasyDown: {\n name: 'ZoomOutEasyDown',\n style: {\n 100: { transform: [{ translateY: '100%', scale: 0 }] },\n },\n duration: DEFAULT_ZOOM_TIME,\n },\n};\n\nexport const ZoomIn = {\n ZoomIn: {\n style: convertAnimationObjectToKeyframes(ZoomInData.ZoomIn),\n duration: ZoomInData.ZoomIn.duration,\n },\n ZoomInRotate: {\n style: convertAnimationObjectToKeyframes(ZoomInData.ZoomInRotate),\n duration: ZoomInData.ZoomInRotate.duration,\n },\n ZoomInRight: {\n style: convertAnimationObjectToKeyframes(ZoomInData.ZoomInRight),\n duration: ZoomInData.ZoomInRight.duration,\n },\n ZoomInLeft: {\n style: convertAnimationObjectToKeyframes(ZoomInData.ZoomInLeft),\n duration: ZoomInData.ZoomInLeft.duration,\n },\n ZoomInUp: {\n style: convertAnimationObjectToKeyframes(ZoomInData.ZoomInUp),\n duration: ZoomInData.ZoomInUp.duration,\n },\n ZoomInDown: {\n style: convertAnimationObjectToKeyframes(ZoomInData.ZoomInDown),\n duration: ZoomInData.ZoomInDown.duration,\n },\n ZoomInEasyUp: {\n style: convertAnimationObjectToKeyframes(ZoomInData.ZoomInEasyUp),\n duration: ZoomInData.ZoomInEasyUp.duration,\n },\n ZoomInEasyDown: {\n style: convertAnimationObjectToKeyframes(ZoomInData.ZoomInEasyDown),\n duration: ZoomInData.ZoomInEasyDown.duration,\n },\n};\n\nexport const ZoomOut = {\n ZoomOut: {\n style: convertAnimationObjectToKeyframes(ZoomOutData.ZoomOut),\n duration: ZoomOutData.ZoomOut.duration,\n },\n ZoomOutRotate: {\n style: convertAnimationObjectToKeyframes(ZoomOutData.ZoomOutRotate),\n duration: ZoomOutData.ZoomOutRotate.duration,\n },\n ZoomOutRight: {\n style: convertAnimationObjectToKeyframes(ZoomOutData.ZoomOutRight),\n duration: ZoomOutData.ZoomOutRight.duration,\n },\n ZoomOutLeft: {\n style: convertAnimationObjectToKeyframes(ZoomOutData.ZoomOutLeft),\n duration: ZoomOutData.ZoomOutLeft.duration,\n },\n ZoomOutUp: {\n style: convertAnimationObjectToKeyframes(ZoomOutData.ZoomOutUp),\n duration: ZoomOutData.ZoomOutUp.duration,\n },\n ZoomOutDown: {\n style: convertAnimationObjectToKeyframes(ZoomOutData.ZoomOutDown),\n duration: ZoomOutData.ZoomOutDown.duration,\n },\n ZoomOutEasyUp: {\n style: convertAnimationObjectToKeyframes(ZoomOutData.ZoomOutEasyUp),\n duration: ZoomOutData.ZoomOutEasyUp.duration,\n },\n ZoomOutEasyDown: {\n style: convertAnimationObjectToKeyframes(ZoomOutData.ZoomOutEasyDown),\n duration: ZoomOutData.ZoomOutEasyDown.duration,\n },\n};\n"],"mappings":"AAAA,YAAY;;AACZ,SAASA,iCAAiC,QAAQ,oBAAoB;AAEtE,MAAMC,iBAAiB,GAAG,GAAG;AAE7B,OAAO,MAAMC,UAAU,GAAG;EACxBC,MAAM,EAAE;IACNC,IAAI,EAAE,QAAQ;IACdC,KAAK,EAAE;MACL,CAAC,EAAE;QAAEC,SAAS,EAAE,CAAC;UAAEC,KAAK,EAAE;QAAE,CAAC;MAAE,CAAC;MAChC,GAAG,EAAE;QAAED,SAAS,EAAE,CAAC;UAAEC,KAAK,EAAE;QAAE,CAAC;MAAE;IACnC,CA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CAAiC,CAACmB,WAAW,CAACQ,eAAe,CAAC;IACrEnB,QAAQ,EAAEW,WAAW,CAACQ,eAAe,CAACnB;EACxC;AACF,CAAC"}
|
|
1
|
+
{"version":3,"names":["convertAnimationObjectToKeyframes","DEFAULT_ZOOM_TIME","ZoomInData","ZoomIn","name","style","transform","scale","duration","ZoomInRotate","rotate","ZoomInRight","translateX","ZoomInLeft","ZoomInUp","translateY","ZoomInDown","ZoomInEasyUp","ZoomInEasyDown","ZoomOutData","ZoomOut","ZoomOutRotate","ZoomOutRight","ZoomOutLeft","ZoomOutUp","ZoomOutDown","ZoomOutEasyUp","ZoomOutEasyDown"],"sources":["Zoom.web.ts"],"sourcesContent":["'use strict';\nimport { convertAnimationObjectToKeyframes } from '../animationParser';\n\nconst DEFAULT_ZOOM_TIME = 0.3;\n\nexport const ZoomInData = {\n ZoomIn: {\n name: 'ZoomIn',\n style: {\n 0: { transform: [{ scale: 0 }] },\n 100: { transform: [{ scale: 1 }] },\n },\n duration: DEFAULT_ZOOM_TIME,\n },\n\n ZoomInRotate: {\n name: 'ZoomInRotate',\n style: {\n 0: { transform: [{ scale: 0, rotate: '0.3rad' }] },\n 100: { transform: [{ scale: 1, rotate: '0deg' }] },\n },\n duration: DEFAULT_ZOOM_TIME,\n },\n\n ZoomInRight: {\n name: 'ZoomInRight',\n style: {\n 0: { transform: [{ translateX: '100vw', scale: 0 }] },\n 100: { transform: [{ translateX: '0%', scale: 1 }] },\n },\n duration: DEFAULT_ZOOM_TIME,\n },\n\n ZoomInLeft: {\n name: 'ZoomInLeft',\n style: {\n 0: { transform: [{ translateX: '-100vw', scale: 0 }] },\n 100: { transform: [{ translateX: '0%', scale: 1 }] },\n },\n duration: DEFAULT_ZOOM_TIME,\n },\n\n ZoomInUp: {\n name: 'ZoomInUp',\n style: {\n 0: { transform: [{ translateY: '-100vh', scale: 0 }] },\n 100: { transform: [{ translateY: '0%', scale: 1 }] },\n },\n duration: DEFAULT_ZOOM_TIME,\n },\n\n ZoomInDown: {\n name: 'ZoomInDown',\n style: {\n 0: { transform: [{ translateY: '100vh', scale: 0 }] },\n 100: { transform: [{ translateY: '0%', scale: 1 }] },\n },\n duration: DEFAULT_ZOOM_TIME,\n },\n\n ZoomInEasyUp: {\n name: 'ZoomInEasyUp',\n style: {\n 0: { transform: [{ translateY: '-100%', scale: 0 }] },\n 100: { transform: [{ translateY: '0%', scale: 1 }] },\n },\n duration: DEFAULT_ZOOM_TIME,\n },\n\n ZoomInEasyDown: {\n name: 'ZoomInEasyDown',\n style: {\n 0: { transform: [{ translateY: '100%', scale: 0 }] },\n 100: { transform: [{ translateY: '0%', scale: 1 }] },\n },\n duration: DEFAULT_ZOOM_TIME,\n },\n};\n\nexport const ZoomOutData = {\n ZoomOut: {\n name: 'ZoomOut',\n style: {\n 100: { transform: [{ scale: 0 }] },\n },\n duration: DEFAULT_ZOOM_TIME,\n },\n\n ZoomOutRotate: {\n name: 'ZoomOutRotate',\n style: {\n 100: { transform: [{ scale: 0, rotate: '0.3rad' }] },\n },\n duration: DEFAULT_ZOOM_TIME,\n },\n\n ZoomOutRight: {\n name: 'ZoomOutRight',\n style: {\n 100: { transform: [{ translateX: '100vw', scale: 0 }] },\n },\n duration: DEFAULT_ZOOM_TIME,\n },\n\n ZoomOutLeft: {\n name: 'ZoomOutLeft',\n style: {\n 100: { transform: [{ translateX: '-100vw', scale: 1 }] },\n },\n duration: DEFAULT_ZOOM_TIME,\n },\n\n ZoomOutUp: {\n name: 'ZoomOutUp',\n style: {\n 100: { transform: [{ translateY: '-100vh', scale: 0 }] },\n },\n duration: DEFAULT_ZOOM_TIME,\n },\n\n ZoomOutDown: {\n name: 'ZoomOutDown',\n style: {\n 100: { transform: [{ translateY: '100vh', scale: 0 }] },\n },\n duration: DEFAULT_ZOOM_TIME,\n },\n\n ZoomOutEasyUp: {\n name: 'ZoomOutEasyUp',\n style: {\n 100: { transform: [{ translateY: '-100%', scale: 0 }] },\n },\n duration: DEFAULT_ZOOM_TIME,\n },\n\n ZoomOutEasyDown: {\n name: 'ZoomOutEasyDown',\n style: {\n 100: { transform: [{ translateY: '100%', scale: 0 }] },\n },\n duration: DEFAULT_ZOOM_TIME,\n },\n};\n\nexport const ZoomIn = {\n ZoomIn: {\n style: convertAnimationObjectToKeyframes(ZoomInData.ZoomIn),\n duration: ZoomInData.ZoomIn.duration,\n },\n ZoomInRotate: {\n style: convertAnimationObjectToKeyframes(ZoomInData.ZoomInRotate),\n duration: ZoomInData.ZoomInRotate.duration,\n },\n ZoomInRight: {\n style: convertAnimationObjectToKeyframes(ZoomInData.ZoomInRight),\n duration: ZoomInData.ZoomInRight.duration,\n },\n ZoomInLeft: {\n style: convertAnimationObjectToKeyframes(ZoomInData.ZoomInLeft),\n duration: ZoomInData.ZoomInLeft.duration,\n },\n ZoomInUp: {\n style: convertAnimationObjectToKeyframes(ZoomInData.ZoomInUp),\n duration: ZoomInData.ZoomInUp.duration,\n },\n ZoomInDown: {\n style: convertAnimationObjectToKeyframes(ZoomInData.ZoomInDown),\n duration: ZoomInData.ZoomInDown.duration,\n },\n ZoomInEasyUp: {\n style: convertAnimationObjectToKeyframes(ZoomInData.ZoomInEasyUp),\n duration: ZoomInData.ZoomInEasyUp.duration,\n },\n ZoomInEasyDown: {\n style: convertAnimationObjectToKeyframes(ZoomInData.ZoomInEasyDown),\n duration: ZoomInData.ZoomInEasyDown.duration,\n },\n};\n\nexport const ZoomOut = {\n ZoomOut: {\n style: convertAnimationObjectToKeyframes(ZoomOutData.ZoomOut),\n duration: ZoomOutData.ZoomOut.duration,\n },\n ZoomOutRotate: {\n style: convertAnimationObjectToKeyframes(ZoomOutData.ZoomOutRotate),\n duration: ZoomOutData.ZoomOutRotate.duration,\n },\n ZoomOutRight: {\n style: convertAnimationObjectToKeyframes(ZoomOutData.ZoomOutRight),\n duration: ZoomOutData.ZoomOutRight.duration,\n },\n ZoomOutLeft: {\n style: convertAnimationObjectToKeyframes(ZoomOutData.ZoomOutLeft),\n duration: ZoomOutData.ZoomOutLeft.duration,\n },\n ZoomOutUp: {\n style: convertAnimationObjectToKeyframes(ZoomOutData.ZoomOutUp),\n duration: ZoomOutData.ZoomOutUp.duration,\n },\n ZoomOutDown: {\n style: convertAnimationObjectToKeyframes(ZoomOutData.ZoomOutDown),\n duration: ZoomOutData.ZoomOutDown.duration,\n },\n ZoomOutEasyUp: {\n style: convertAnimationObjectToKeyframes(ZoomOutData.ZoomOutEasyUp),\n duration: ZoomOutData.ZoomOutEasyUp.duration,\n },\n ZoomOutEasyDown: {\n style: convertAnimationObjectToKeyframes(ZoomOutData.ZoomOutEasyDown),\n duration: ZoomOutData.ZoomOutEasyDown.duration,\n },\n};\n"],"mappings":"AAAA,YAAY;;AACZ,SAASA,iCAAiC,QAAQ,oBAAoB;AAEtE,MAAMC,iBAAiB,GAAG,GAAG;AAE7B,OAAO,MAAMC,UAAU,GAAG;EACxBC,MAAM,EAAE;IACNC,IAAI,EAAE,QAAQ;IACdC,KAAK,EAAE;MACL,CAAC,EAAE;QAAEC,SAAS,EAAE,CAAC;UAAEC,KAAK,EAAE;QAAE,CAAC;MAAE,CAAC;MAChC,GAAG,EAAE;QAAED,SAAS,EAAE,CAAC;UAAEC,KAAK,EAAE;QAAE,CAAC;MAAE;IACnC,CAAC;IACDC,QAAQ,EAAEP;EACZ,CAAC;EAEDQ,YAAY,EAAE;IACZL,IAAI,EAAE,cAAc;IACpBC,KAAK,EAAE;MACL,CAAC,EAAE;QAAEC,SAAS,EAAE,CAAC;UAAEC,KAAK,EAAE,CAAC;UAAEG,MAAM,EAAE;QAAS,CAAC;MAAE,CAAC;MAClD,GAAG,EAAE;QAAEJ,SAAS,EAAE,CAAC;UAAEC,KAAK,EAAE,CAAC;UAAEG,MAAM,EAAE;QAAO,CAAC;MAAE;IACnD,CAAC;IACDF,QAAQ,EAAEP;EACZ,CAAC;EAEDU,WAAW,EAAE;IACXP,IAAI,EAAE,aAAa;IACnBC,KAAK,EAAE;MACL,CAAC,EAAE;QAAEC,SAAS,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Q,EAAEW,WAAW,CAACE,aAAa,CAACb;EACtC,CAAC;EACDc,YAAY,EAAE;IACZjB,KAAK,EAAEL,iCAAiC,CAACmB,WAAW,CAACG,YAAY,CAAC;IAClEd,QAAQ,EAAEW,WAAW,CAACG,YAAY,CAACd;EACrC,CAAC;EACDe,WAAW,EAAE;IACXlB,KAAK,EAAEL,iCAAiC,CAACmB,WAAW,CAACI,WAAW,CAAC;IACjEf,QAAQ,EAAEW,WAAW,CAACI,WAAW,CAACf;EACpC,CAAC;EACDgB,SAAS,EAAE;IACTnB,KAAK,EAAEL,iCAAiC,CAACmB,WAAW,CAACK,SAAS,CAAC;IAC/DhB,QAAQ,EAAEW,WAAW,CAACK,SAAS,CAAChB;EAClC,CAAC;EACDiB,WAAW,EAAE;IACXpB,KAAK,EAAEL,iCAAiC,CAACmB,WAAW,CAACM,WAAW,CAAC;IACjEjB,QAAQ,EAAEW,WAAW,CAACM,WAAW,CAACjB;EACpC,CAAC;EACDkB,aAAa,EAAE;IACbrB,KAAK,EAAEL,iCAAiC,CAACmB,WAAW,CAACO,aAAa,CAAC;IACnElB,QAAQ,EAAEW,WAAW,CAACO,aAAa,CAAClB;EACtC,CAAC;EACDmB,eAAe,EAAE;IACftB,KAAK,EAAEL,iCAAiC,CAACmB,WAAW,CAACQ,eAAe,CAAC;IACrEnB,QAAQ,EAAEW,WAAW,CAACQ,eAAe,CAACnB;EACxC;AACF,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["convertAnimationObjectToKeyframes","animationObject","keyframe","name","timestamp","style","Object","entries","property","values","forEach","value","transformProperty","transformPropertyValue","convertTransformToString","transform","transformString","transformObject","key","indexOf"],"sources":["animationParser.ts"],"sourcesContent":["'use strict';\n\nimport type { TransformsStyle } from 'react-native';\n\nexport interface ReanimatedWebTransformProperties {\n translateX?: string;\n translateY?: string;\n rotate?: string;\n rotateX?: string;\n rotateY?: string;\n scale?: number | string;\n scaleX?: number;\n scaleY?: number;\n perspective?: string;\n skew?: string;\n skewX?: string;\n}\n\ninterface AnimationStyle {\n opacity?: number;\n transform?: ReanimatedWebTransformProperties[];\n}\n\nexport interface AnimationData {\n name: string;\n style: Record<number, AnimationStyle>;\n duration: number;\n}\n\nexport interface TransitionData {\n translateX: number;\n translateY: number;\n scaleX: number;\n scaleY: number;\n reversed?: boolean;\n}\n\nexport function convertAnimationObjectToKeyframes(\n animationObject: AnimationData\n) {\n let keyframe = `@keyframes ${animationObject.name} { `;\n\n for (const [timestamp, style] of Object.entries(animationObject.style)) {\n keyframe += `${timestamp}% { `;\n\n for (const [property, values] of Object.entries(style)) {\n if (property !== 'transform') {\n keyframe += `${property}: ${values}; `;\n continue;\n }\n\n keyframe += `transform:`;\n\n values.forEach((value: ReanimatedWebTransformProperties) => {\n for (const [\n transformProperty,\n transformPropertyValue,\n ] of Object.entries(value)) {\n keyframe += ` ${transformProperty}(${transformPropertyValue})`;\n }\n });\n keyframe += `; `; // Property end\n }\n keyframe += `} `; // Timestamp end\n }\n keyframe += `} `; // Keyframe end\n\n return keyframe;\n}\n\nexport function convertTransformToString(\n transform: NonNullable<TransformsStyle['transform']> | undefined\n) {\n if (!transform) {\n return '';\n }\n\n type RNTransformProp = (typeof transform)[number];\n\n let transformString = '';\n\n // @ts-ignore `transform` cannot be string because in that case\n // we throw error in `extractTransformFromStyle`\n transform.forEach((transformObject: RNTransformProp) => {\n for (const [key, value] of Object.entries(transformObject)) {\n if (key === 'reversed') {\n continue;\n }\n\n if (key.indexOf('translate') < 0) {\n transformString += `${key}(${value}) `;\n } else {\n transformString += `${key}(${value}px) `;\n }\n }\n });\n\n return transformString;\n}\n"],"mappings":"AAAA,YAAY;;AAqCZ,OAAO,SAASA,iCAAiCA,CAC/CC,eAA8B,EAC9B;EACA,IAAIC,QAAQ,GAAI,cAAaD,eAAe,CAACE,IAAK,KAAI;EAEtD,KAAK,MAAM,CAACC,SAAS,EAAEC,KAAK,CAAC,IAAIC,MAAM,CAACC,OAAO,CAACN,eAAe,CAACI,KAAK,CAAC,EAAE;IACtEH,QAAQ,IAAK,GAAEE,SAAU,MAAK;IAE9B,KAAK,MAAM,CAACI,QAAQ,EAAEC,MAAM,CAAC,IAAIH,MAAM,CAACC,OAAO,CAACF,KAAK,CAAC,EAAE;MACtD,IAAIG,QAAQ,KAAK,WAAW,EAAE;QAC5BN,QAAQ,IAAK,GAAEM,QAAS,KAAIC,MAAO,IAAG;QACtC;MACF;MAEAP,QAAQ,IAAK,YAAW;MAExBO,MAAM,CAACC,OAAO,CAAEC,KAAuC,IAAK;QAC1D,KAAK,MAAM,CACTC,iBAAiB,EACjBC,sBAAsB,CACvB,IAAIP,MAAM,CAACC,OAAO,CAACI,KAAK,CAAC,EAAE;UAC1BT,QAAQ,IAAK,IAAGU,iBAAkB,IAAGC,sBAAuB,GAAE;QAChE;MACF,CAAC,CAAC;MACFX,QAAQ,IAAK,IAAG,CAAC,CAAC;IACpB
|
|
1
|
+
{"version":3,"names":["convertAnimationObjectToKeyframes","animationObject","keyframe","name","timestamp","style","Object","entries","property","values","forEach","value","transformProperty","transformPropertyValue","convertTransformToString","transform","transformString","transformObject","key","indexOf"],"sources":["animationParser.ts"],"sourcesContent":["'use strict';\n\nimport type { TransformsStyle } from 'react-native';\n\nexport interface ReanimatedWebTransformProperties {\n translateX?: string;\n translateY?: string;\n rotate?: string;\n rotateX?: string;\n rotateY?: string;\n scale?: number | string;\n scaleX?: number;\n scaleY?: number;\n perspective?: string;\n skew?: string;\n skewX?: string;\n}\n\ninterface AnimationStyle {\n opacity?: number;\n transform?: ReanimatedWebTransformProperties[];\n}\n\nexport interface AnimationData {\n name: string;\n style: Record<number, AnimationStyle>;\n duration: number;\n}\n\nexport interface TransitionData {\n translateX: number;\n translateY: number;\n scaleX: number;\n scaleY: number;\n reversed?: boolean;\n}\n\nexport function convertAnimationObjectToKeyframes(\n animationObject: AnimationData\n) {\n let keyframe = `@keyframes ${animationObject.name} { `;\n\n for (const [timestamp, style] of Object.entries(animationObject.style)) {\n keyframe += `${timestamp}% { `;\n\n for (const [property, values] of Object.entries(style)) {\n if (property !== 'transform') {\n keyframe += `${property}: ${values}; `;\n continue;\n }\n\n keyframe += `transform:`;\n\n values.forEach((value: ReanimatedWebTransformProperties) => {\n for (const [\n transformProperty,\n transformPropertyValue,\n ] of Object.entries(value)) {\n keyframe += ` ${transformProperty}(${transformPropertyValue})`;\n }\n });\n keyframe += `; `; // Property end\n }\n keyframe += `} `; // Timestamp end\n }\n keyframe += `} `; // Keyframe end\n\n return keyframe;\n}\n\nexport function convertTransformToString(\n transform: NonNullable<TransformsStyle['transform']> | undefined\n) {\n if (!transform) {\n return '';\n }\n\n type RNTransformProp = (typeof transform)[number];\n\n let transformString = '';\n\n // @ts-ignore `transform` cannot be string because in that case\n // we throw error in `extractTransformFromStyle`\n transform.forEach((transformObject: RNTransformProp) => {\n for (const [key, value] of Object.entries(transformObject)) {\n if (key === 'reversed') {\n continue;\n }\n\n if (key.indexOf('translate') < 0) {\n transformString += `${key}(${value}) `;\n } else {\n transformString += `${key}(${value}px) `;\n }\n }\n });\n\n return transformString;\n}\n"],"mappings":"AAAA,YAAY;;AAqCZ,OAAO,SAASA,iCAAiCA,CAC/CC,eAA8B,EAC9B;EACA,IAAIC,QAAQ,GAAI,cAAaD,eAAe,CAACE,IAAK,KAAI;EAEtD,KAAK,MAAM,CAACC,SAAS,EAAEC,KAAK,CAAC,IAAIC,MAAM,CAACC,OAAO,CAACN,eAAe,CAACI,KAAK,CAAC,EAAE;IACtEH,QAAQ,IAAK,GAAEE,SAAU,MAAK;IAE9B,KAAK,MAAM,CAACI,QAAQ,EAAEC,MAAM,CAAC,IAAIH,MAAM,CAACC,OAAO,CAACF,KAAK,CAAC,EAAE;MACtD,IAAIG,QAAQ,KAAK,WAAW,EAAE;QAC5BN,QAAQ,IAAK,GAAEM,QAAS,KAAIC,MAAO,IAAG;QACtC;MACF;MAEAP,QAAQ,IAAK,YAAW;MAExBO,MAAM,CAACC,OAAO,CAAEC,KAAuC,IAAK;QAC1D,KAAK,MAAM,CACTC,iBAAiB,EACjBC,sBAAsB,CACvB,IAAIP,MAAM,CAACC,OAAO,CAACI,KAAK,CAAC,EAAE;UAC1BT,QAAQ,IAAK,IAAGU,iBAAkB,IAAGC,sBAAuB,GAAE;QAChE;MACF,CAAC,CAAC;MACFX,QAAQ,IAAK,IAAG,CAAC,CAAC;IACpB;IACAA,QAAQ,IAAK,IAAG,CAAC,CAAC;EACpB;EACAA,QAAQ,IAAK,IAAG,CAAC,CAAC;;EAElB,OAAOA,QAAQ;AACjB;AAEA,OAAO,SAASY,wBAAwBA,CACtCC,SAAgE,EAChE;EACA,IAAI,CAACA,SAAS,EAAE;IACd,OAAO,EAAE;EACX;EAIA,IAAIC,eAAe,GAAG,EAAE;;EAExB;EACA;EACAD,SAAS,CAACL,OAAO,CAAEO,eAAgC,IAAK;IACtD,KAAK,MAAM,CAACC,GAAG,EAAEP,KAAK,CAAC,IAAIL,MAAM,CAACC,OAAO,CAACU,eAAe,CAAC,EAAE;MAC1D,IAAIC,GAAG,KAAK,UAAU,EAAE;QACtB;MACF;MAEA,IAAIA,GAAG,CAACC,OAAO,CAAC,WAAW,CAAC,GAAG,CAAC,EAAE;QAChCH,eAAe,IAAK,GAAEE,GAAI,IAAGP,KAAM,IAAG;MACxC,CAAC,MAAM;QACLK,eAAe,IAAK,GAAEE,GAAI,IAAGP,KAAM,MAAK;MAC1C;IACF;EACF,CAAC,CAAC;EAEF,OAAOK,eAAe;AACxB","ignoreList":[]}
|
|
@@ -16,7 +16,7 @@ function checkUndefinedAnimationFail(initialAnimationName, isLayoutTransition) {
|
|
|
16
16
|
if (initialAnimationName in Animations || isLayoutTransition) {
|
|
17
17
|
return false;
|
|
18
18
|
}
|
|
19
|
-
console.warn("[Reanimated] Couldn't load entering/exiting animation. Current version supports only predefined animations with modifiers: duration, delay, easing, randomizeDelay,
|
|
19
|
+
console.warn("[Reanimated] Couldn't load entering/exiting animation. Current version supports only predefined animations with modifiers: duration, delay, easing, randomizeDelay, withCallback, reducedMotion.");
|
|
20
20
|
return true;
|
|
21
21
|
}
|
|
22
22
|
function chooseAction(animationType, animationConfig, element, transitionData, transform) {
|
|
@@ -79,7 +79,6 @@ export function tryActivateLayoutTransition(props, element, snapshot) {
|
|
|
79
79
|
scaleY: snapshot.height / rect.height,
|
|
80
80
|
reversed: false // This field is used only in `SequencedTransition`, so by default it will be false
|
|
81
81
|
};
|
|
82
|
-
|
|
83
82
|
startWebLayoutAnimation(props, element, LayoutAnimationType.LAYOUT, transitionData);
|
|
84
83
|
}
|
|
85
84
|
//# sourceMappingURL=animationsManager.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Animations","LayoutAnimationType","createAnimationWithExistingTransform","extractTransformFromStyle","getProcessedConfig","handleExitingAnimation","handleLayoutTransition","setElementAnimation","areDOMRectsEqual","makeElementVisible","chooseConfig","animationType","props","config","ENTERING","entering","EXITING","exiting","LAYOUT","layout","checkUndefinedAnimationFail","initialAnimationName","isLayoutTransition","console","warn","chooseAction","animationConfig","element","transitionData","transform","reversed","tryGetAnimationConfigWithTransform","presetName","constructor","shouldFail","style","animationName","startWebLayoutAnimation","maybeAnimationConfigWithTransform","tryActivateLayoutTransition","snapshot","rect","getBoundingClientRect","translateX","x","translateY","y","scaleX","width","scaleY","height"],"sources":["animationsManager.ts"],"sourcesContent":["'use strict';\n\nimport type { AnimationConfig, AnimationNames, CustomConfig } from './config';\nimport { Animations } from './config';\nimport type {\n AnimatedComponentProps,\n LayoutAnimationStaticContext,\n} from '../../../createAnimatedComponent/commonTypes';\nimport { LayoutAnimationType } from '../animationBuilder/commonTypes';\nimport type { StyleProps } from '../../commonTypes';\nimport { createAnimationWithExistingTransform } from './createAnimation';\nimport {\n extractTransformFromStyle,\n getProcessedConfig,\n handleExitingAnimation,\n handleLayoutTransition,\n setElementAnimation,\n} from './componentUtils';\nimport { areDOMRectsEqual } from './domUtils';\nimport type { TransformsStyle } from 'react-native';\nimport type { TransitionData } from './animationParser';\nimport { makeElementVisible } from './componentStyle';\n\nfunction chooseConfig<ComponentProps extends Record<string, unknown>>(\n animationType: LayoutAnimationType,\n props: Readonly<AnimatedComponentProps<ComponentProps>>\n) {\n const config =\n animationType === LayoutAnimationType.ENTERING\n ? props.entering\n : animationType === LayoutAnimationType.EXITING\n ? props.exiting\n : animationType === LayoutAnimationType.LAYOUT\n ? props.layout\n : null;\n\n return config;\n}\n\nfunction checkUndefinedAnimationFail(\n initialAnimationName: string,\n isLayoutTransition: boolean\n) {\n // This prevents crashes if we try to set animations that are not defined.\n // We don't care about layout transitions since they're created dynamically\n if (initialAnimationName in Animations || isLayoutTransition) {\n return false;\n }\n\n console.warn(\n \"[Reanimated] Couldn't load entering/exiting animation. Current version supports only predefined animations with modifiers: duration, delay, easing, randomizeDelay,
|
|
1
|
+
{"version":3,"names":["Animations","LayoutAnimationType","createAnimationWithExistingTransform","extractTransformFromStyle","getProcessedConfig","handleExitingAnimation","handleLayoutTransition","setElementAnimation","areDOMRectsEqual","makeElementVisible","chooseConfig","animationType","props","config","ENTERING","entering","EXITING","exiting","LAYOUT","layout","checkUndefinedAnimationFail","initialAnimationName","isLayoutTransition","console","warn","chooseAction","animationConfig","element","transitionData","transform","reversed","tryGetAnimationConfigWithTransform","presetName","constructor","shouldFail","style","animationName","startWebLayoutAnimation","maybeAnimationConfigWithTransform","tryActivateLayoutTransition","snapshot","rect","getBoundingClientRect","translateX","x","translateY","y","scaleX","width","scaleY","height"],"sources":["animationsManager.ts"],"sourcesContent":["'use strict';\n\nimport type { AnimationConfig, AnimationNames, CustomConfig } from './config';\nimport { Animations } from './config';\nimport type {\n AnimatedComponentProps,\n LayoutAnimationStaticContext,\n} from '../../../createAnimatedComponent/commonTypes';\nimport { LayoutAnimationType } from '../animationBuilder/commonTypes';\nimport type { StyleProps } from '../../commonTypes';\nimport { createAnimationWithExistingTransform } from './createAnimation';\nimport {\n extractTransformFromStyle,\n getProcessedConfig,\n handleExitingAnimation,\n handleLayoutTransition,\n setElementAnimation,\n} from './componentUtils';\nimport { areDOMRectsEqual } from './domUtils';\nimport type { TransformsStyle } from 'react-native';\nimport type { TransitionData } from './animationParser';\nimport { makeElementVisible } from './componentStyle';\n\nfunction chooseConfig<ComponentProps extends Record<string, unknown>>(\n animationType: LayoutAnimationType,\n props: Readonly<AnimatedComponentProps<ComponentProps>>\n) {\n const config =\n animationType === LayoutAnimationType.ENTERING\n ? props.entering\n : animationType === LayoutAnimationType.EXITING\n ? props.exiting\n : animationType === LayoutAnimationType.LAYOUT\n ? props.layout\n : null;\n\n return config;\n}\n\nfunction checkUndefinedAnimationFail(\n initialAnimationName: string,\n isLayoutTransition: boolean\n) {\n // This prevents crashes if we try to set animations that are not defined.\n // We don't care about layout transitions since they're created dynamically\n if (initialAnimationName in Animations || isLayoutTransition) {\n return false;\n }\n\n console.warn(\n \"[Reanimated] Couldn't load entering/exiting animation. Current version supports only predefined animations with modifiers: duration, delay, easing, randomizeDelay, withCallback, reducedMotion.\"\n );\n\n return true;\n}\n\nfunction chooseAction(\n animationType: LayoutAnimationType,\n animationConfig: AnimationConfig,\n element: HTMLElement,\n transitionData: TransitionData,\n transform: TransformsStyle['transform'] | undefined\n) {\n switch (animationType) {\n case LayoutAnimationType.ENTERING:\n setElementAnimation(element, animationConfig, transform);\n break;\n case LayoutAnimationType.LAYOUT:\n transitionData.reversed = animationConfig.reversed;\n\n handleLayoutTransition(\n element,\n animationConfig,\n transitionData,\n transform\n );\n break;\n case LayoutAnimationType.EXITING:\n handleExitingAnimation(element, animationConfig);\n break;\n }\n}\n\nfunction tryGetAnimationConfigWithTransform<\n ComponentProps extends Record<string, unknown>\n>(\n props: Readonly<AnimatedComponentProps<ComponentProps>>,\n animationType: LayoutAnimationType\n) {\n const config = chooseConfig(animationType, props);\n if (!config) {\n return null;\n }\n\n type ConstructorWithStaticContext = LayoutAnimationStaticContext &\n typeof config.constructor;\n\n const isLayoutTransition = animationType === LayoutAnimationType.LAYOUT;\n const initialAnimationName =\n typeof config === 'function'\n ? config.presetName\n : (config.constructor as ConstructorWithStaticContext).presetName;\n\n const shouldFail = checkUndefinedAnimationFail(\n initialAnimationName,\n isLayoutTransition\n );\n\n if (shouldFail) {\n return null;\n }\n\n const transform = extractTransformFromStyle(props.style as StyleProps);\n\n const animationName =\n transform && animationType !== LayoutAnimationType.EXITING\n ? createAnimationWithExistingTransform(initialAnimationName, transform)\n : initialAnimationName;\n\n const animationConfig = getProcessedConfig(\n animationName,\n animationType,\n config as CustomConfig,\n initialAnimationName as AnimationNames\n );\n\n return { animationConfig, transform };\n}\n\nexport function startWebLayoutAnimation<\n ComponentProps extends Record<string, unknown>\n>(\n props: Readonly<AnimatedComponentProps<ComponentProps>>,\n element: HTMLElement,\n animationType: LayoutAnimationType,\n transitionData?: TransitionData\n) {\n const maybeAnimationConfigWithTransform = tryGetAnimationConfigWithTransform(\n props,\n animationType\n );\n\n if (maybeAnimationConfigWithTransform) {\n const { animationConfig, transform } = maybeAnimationConfigWithTransform;\n\n chooseAction(\n animationType,\n animationConfig,\n element,\n transitionData as TransitionData,\n transform\n );\n } else {\n makeElementVisible(element, 0);\n }\n}\n\nexport function tryActivateLayoutTransition<\n ComponentProps extends Record<string, unknown>\n>(\n props: Readonly<AnimatedComponentProps<ComponentProps>>,\n element: HTMLElement,\n snapshot: DOMRect\n) {\n if (!props.layout) {\n return;\n }\n\n const rect = element.getBoundingClientRect();\n\n if (areDOMRectsEqual(rect, snapshot)) {\n return;\n }\n\n const transitionData: TransitionData = {\n translateX: snapshot.x - rect.x,\n translateY: snapshot.y - rect.y,\n scaleX: snapshot.width / rect.width,\n scaleY: snapshot.height / rect.height,\n reversed: false, // This field is used only in `SequencedTransition`, so by default it will be false\n };\n\n startWebLayoutAnimation(\n props,\n element,\n LayoutAnimationType.LAYOUT,\n transitionData\n );\n}\n"],"mappings":"AAAA,YAAY;;AAGZ,SAASA,UAAU,QAAQ,UAAU;AAKrC,SAASC,mBAAmB,Q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ACF;AAEA,OAAO,SAASY,2BAA2BA,CAGzC3B,KAAuD,EACvDe,OAAoB,EACpBa,QAAiB,EACjB;EACA,IAAI,CAAC5B,KAAK,CAACO,MAAM,EAAE;IACjB;EACF;EAEA,MAAMsB,IAAI,GAAGd,OAAO,CAACe,qBAAqB,CAAC,CAAC;EAE5C,IAAIlC,gBAAgB,CAACiC,IAAI,EAAED,QAAQ,CAAC,EAAE;IACpC;EACF;EAEA,MAAMZ,cAA8B,GAAG;IACrCe,UAAU,EAAEH,QAAQ,CAACI,CAAC,GAAGH,IAAI,CAACG,CAAC;IAC/BC,UAAU,EAAEL,QAAQ,CAACM,CAAC,GAAGL,IAAI,CAACK,CAAC;IAC/BC,MAAM,EAAEP,QAAQ,CAACQ,KAAK,GAAGP,IAAI,CAACO,KAAK;IACnCC,MAAM,EAAET,QAAQ,CAACU,MAAM,GAAGT,IAAI,CAACS,MAAM;IACrCpB,QAAQ,EAAE,KAAK,CAAE;EACnB,CAAC;EAEDO,uBAAuB,CACrBzB,KAAK,EACLe,OAAO,EACP1B,mBAAmB,CAACiB,MAAM,EAC1BU,cACF,CAAC;AACH","ignoreList":[]}
|
|
@@ -43,6 +43,8 @@ export function setDummyPosition(dummy, snapshot) {
|
|
|
43
43
|
dummy.style.height = `${snapshot.height}px`;
|
|
44
44
|
dummy.style.margin = '0px'; // tmpElement has absolute position, so margin is not necessary
|
|
45
45
|
|
|
46
|
-
|
|
46
|
+
if (dummy.parentElement) {
|
|
47
|
+
fixElementPosition(dummy, dummy.parentElement, snapshot);
|
|
48
|
+
}
|
|
47
49
|
}
|
|
48
50
|
//# sourceMappingURL=componentStyle.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_updatePropsJS","snapshots","WeakMap","makeElementVisible","element","delay","visibility","_component","setTimeout","fixElementPosition","parent","snapshot","parentRect","getBoundingClientRect","parentBorderTopValue","parseInt","getComputedStyle","borderTopWidth","parentBorderLeftValue","borderLeftWidth","dummyRect","top","style","left","setDummyPosition","dummy","transform","position","width","height","margin","parentElement"],"sources":["componentStyle.ts"],"sourcesContent":["'use strict';\n\nimport { _updatePropsJS } from '../../js-reanimated';\nimport type { ReanimatedHTMLElement } from '../../js-reanimated';\n\nexport interface ReanimatedSnapshot {\n top: number;\n left: number;\n width: number;\n height: number;\n scrollOffsets: ScrollOffsets;\n}\n\nexport interface ScrollOffsets {\n scrollTopOffset: number;\n scrollLeftOffset: number;\n}\n\nexport const snapshots = new WeakMap<HTMLElement, ReanimatedSnapshot>();\n\nexport function makeElementVisible(element: HTMLElement, delay: number) {\n if (delay === 0) {\n _updatePropsJS(\n { visibility: 'initial' },\n { _component: element as ReanimatedHTMLElement }\n );\n } else {\n setTimeout(() => {\n _updatePropsJS(\n { visibility: 'initial' },\n { _component: element as ReanimatedHTMLElement }\n );\n }, delay * 1000);\n }\n}\n\nfunction fixElementPosition(\n element: HTMLElement,\n parent: HTMLElement,\n snapshot: ReanimatedSnapshot\n) {\n const parentRect = parent.getBoundingClientRect();\n\n const parentBorderTopValue = parseInt(\n getComputedStyle(parent).borderTopWidth\n );\n\n const parentBorderLeftValue = parseInt(\n getComputedStyle(parent).borderLeftWidth\n );\n\n const dummyRect = element.getBoundingClientRect();\n // getBoundingClientRect returns DOMRect with position of the element with respect to document body.\n // However, using position `absolute` doesn't guarantee, that the dummy will be placed relative to body element.\n // The trick below allows us to once again get position relative to body, by comparing snapshot with new position of the dummy.\n if (dummyRect.top !== snapshot.top) {\n element.style.top = `${\n snapshot.top - parentRect.top - parentBorderTopValue\n }px`;\n }\n\n if (dummyRect.left !== snapshot.left) {\n element.style.left = `${\n snapshot.left - parentRect.left - parentBorderLeftValue\n }px`;\n }\n}\n\nexport function setDummyPosition(\n dummy: HTMLElement,\n snapshot: ReanimatedSnapshot\n) {\n dummy.style.transform = '';\n dummy.style.position = 'absolute';\n dummy.style.top = `${snapshot.top}px`;\n dummy.style.left = `${snapshot.left}px`;\n dummy.style.width = `${snapshot.width}px`;\n dummy.style.height = `${snapshot.height}px`;\n dummy.style.margin = '0px'; // tmpElement has absolute position, so margin is not necessary\n\n fixElementPosition(dummy, dummy.parentElement
|
|
1
|
+
{"version":3,"names":["_updatePropsJS","snapshots","WeakMap","makeElementVisible","element","delay","visibility","_component","setTimeout","fixElementPosition","parent","snapshot","parentRect","getBoundingClientRect","parentBorderTopValue","parseInt","getComputedStyle","borderTopWidth","parentBorderLeftValue","borderLeftWidth","dummyRect","top","style","left","setDummyPosition","dummy","transform","position","width","height","margin","parentElement"],"sources":["componentStyle.ts"],"sourcesContent":["'use strict';\n\nimport { _updatePropsJS } from '../../js-reanimated';\nimport type { ReanimatedHTMLElement } from '../../js-reanimated';\n\nexport interface ReanimatedSnapshot {\n top: number;\n left: number;\n width: number;\n height: number;\n scrollOffsets: ScrollOffsets;\n}\n\nexport interface ScrollOffsets {\n scrollTopOffset: number;\n scrollLeftOffset: number;\n}\n\nexport const snapshots = new WeakMap<HTMLElement, ReanimatedSnapshot>();\n\nexport function makeElementVisible(element: HTMLElement, delay: number) {\n if (delay === 0) {\n _updatePropsJS(\n { visibility: 'initial' },\n { _component: element as ReanimatedHTMLElement }\n );\n } else {\n setTimeout(() => {\n _updatePropsJS(\n { visibility: 'initial' },\n { _component: element as ReanimatedHTMLElement }\n );\n }, delay * 1000);\n }\n}\n\nfunction fixElementPosition(\n element: HTMLElement,\n parent: HTMLElement,\n snapshot: ReanimatedSnapshot\n) {\n const parentRect = parent.getBoundingClientRect();\n\n const parentBorderTopValue = parseInt(\n getComputedStyle(parent).borderTopWidth\n );\n\n const parentBorderLeftValue = parseInt(\n getComputedStyle(parent).borderLeftWidth\n );\n\n const dummyRect = element.getBoundingClientRect();\n // getBoundingClientRect returns DOMRect with position of the element with respect to document body.\n // However, using position `absolute` doesn't guarantee, that the dummy will be placed relative to body element.\n // The trick below allows us to once again get position relative to body, by comparing snapshot with new position of the dummy.\n if (dummyRect.top !== snapshot.top) {\n element.style.top = `${\n snapshot.top - parentRect.top - parentBorderTopValue\n }px`;\n }\n\n if (dummyRect.left !== snapshot.left) {\n element.style.left = `${\n snapshot.left - parentRect.left - parentBorderLeftValue\n }px`;\n }\n}\n\nexport function setDummyPosition(\n dummy: HTMLElement,\n snapshot: ReanimatedSnapshot\n) {\n dummy.style.transform = '';\n dummy.style.position = 'absolute';\n dummy.style.top = `${snapshot.top}px`;\n dummy.style.left = `${snapshot.left}px`;\n dummy.style.width = `${snapshot.width}px`;\n dummy.style.height = `${snapshot.height}px`;\n dummy.style.margin = '0px'; // tmpElement has absolute position, so margin is not necessary\n\n if (dummy.parentElement) {\n fixElementPosition(dummy, dummy.parentElement, snapshot);\n }\n}\n"],"mappings":"AAAA,YAAY;;AAEZ,SAASA,cAAc,QAAQ,qBAAqB;AAgBpD,OAAO,MAAMC,SAAS,GAAG,IAAIC,OAAO,CAAkC,CAAC;AAEvE,OAAO,SAASC,kBAAkBA,CAACC,OAAoB,EAAEC,KAAa,EAAE;EACtE,IAAIA,KAAK,KAAK,CAAC,EAAE;IACfL,cAAc,CACZ;MAAEM,UAAU,EAAE;IAAU,CAAC,EACzB;MAAEC,UAAU,EAAEH;IAAiC,CACjD,CAAC;EACH,CAAC,MAAM;IACLI,UAAU,CAAC,MAAM;MACfR,cAAc,CACZ;QAAEM,UAAU,EAAE;MAAU,CAAC,EACzB;QAAEC,UAAU,EAAEH;MAAiC,CACjD,CAAC;IACH,CAAC,EAAEC,KAAK,GAAG,IAAI,CAAC;EAClB;AACF;AAEA,SAASI,kBAAkBA,CACzBL,OAAoB,EACpBM,MAAmB,EACnBC,QAA4B,EAC5B;EACA,MAAMC,UAAU,GAAGF,MAAM,CAACG,qBAAqB,CAAC,CAAC;EAEjD,MAAMC,oBAAoB,GAAGC,QAAQ,CACnCC,gBAAgB,CAACN,MAAM,CAAC,CAACO,cAC3B,CAAC;EAED,MAAMC,qBAAqB,GAAGH,QAAQ,CACpCC,gBAAgB,CAACN,MAAM,CAAC,CAACS,eAC3B,CAAC;EAED,MAAMC,SAAS,GAAGhB,OAAO,CAACS,qBAAqB,CAAC,CAAC;EACjD;EACA;EACA;EACA,IAAIO,SAAS,CAACC,GAAG,KAAKV,QAAQ,CAACU,GAAG,EAAE;IAClCjB,OAAO,CAACkB,KAAK,CAACD,GAAG,GAAI,GACnBV,QAAQ,CAACU,GAAG,GAAGT,UAAU,CAACS,GAAG,GAAGP,oBACjC,IAAG;EACN;EAEA,IAAIM,SAAS,CAACG,IAAI,KAAKZ,QAAQ,CAACY,IAAI,EAAE;IACpCnB,OAAO,CAACkB,KAAK,CAACC,IAAI,GAAI,GACpBZ,QAAQ,CAACY,IAAI,GAAGX,UAAU,CAACW,IAAI,GAAGL,qBACnC,IAAG;EACN;AACF;AAEA,OAAO,SAASM,gBAAgBA,CAC9BC,KAAkB,EAClBd,QAA4B,EAC5B;EACAc,KAAK,CAACH,KAAK,CAACI,SAAS,GAAG,EAAE;EAC1BD,KAAK,CAACH,KAAK,CAACK,QAAQ,GAAG,UAAU;EACjCF,KAAK,CAACH,KAAK,CAACD,GAAG,GAAI,GAAEV,QAAQ,CAACU,GAAI,IAAG;EACrCI,KAAK,CAACH,KAAK,CAACC,IAAI,GAAI,GAAEZ,QAAQ,CAACY,IAAK,IAAG;EACvCE,KAAK,CAACH,KAAK,CAACM,KAAK,GAAI,GAAEjB,QAAQ,CAACiB,KAAM,IAAG;EACzCH,KAAK,CAACH,KAAK,CAACO,MAAM,GAAI,GAAElB,QAAQ,CAACkB,MAAO,IAAG;EAC3CJ,KAAK,CAACH,KAAK,CAACQ,MAAM,GAAG,KAAK,CAAC,CAAC;;EAE5B,IAAIL,KAAK,CAACM,aAAa,EAAE;IACvBtB,kBAAkB,CAACgB,KAAK,EAAEA,KAAK,CAACM,aAAa,EAAEpB,QAAQ,CAAC;EAC1D;AACF","ignoreList":[]}
|
|
@@ -13,8 +13,7 @@ function getEasingFromConfig(config) {
|
|
|
13
13
|
const easingName = config.easingV && config.easingV.name in WebEasings ? config.easingV.name : 'linear';
|
|
14
14
|
return `cubic-bezier(${WebEasings[easingName].toString()})`;
|
|
15
15
|
}
|
|
16
|
-
function getRandomDelay() {
|
|
17
|
-
let maxDelay = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1000;
|
|
16
|
+
function getRandomDelay(maxDelay = 1000) {
|
|
18
17
|
return Math.floor(Math.random() * (maxDelay + 1)) / 1000;
|
|
19
18
|
}
|
|
20
19
|
function getDelayFromConfig(config) {
|
|
@@ -102,12 +101,12 @@ export function setElementAnimation(element, animationConfig, existingTransform)
|
|
|
102
101
|
element.style.animationTimingFunction = easing;
|
|
103
102
|
element.onanimationend = () => {
|
|
104
103
|
var _animationConfig$call;
|
|
105
|
-
(_animationConfig$call = animationConfig.callback) === null || _animationConfig$call === void 0
|
|
104
|
+
(_animationConfig$call = animationConfig.callback) === null || _animationConfig$call === void 0 || _animationConfig$call.call(animationConfig, true);
|
|
106
105
|
element.removeEventListener('animationcancel', animationCancelHandler);
|
|
107
106
|
};
|
|
108
107
|
const animationCancelHandler = () => {
|
|
109
108
|
var _animationConfig$call2;
|
|
110
|
-
(_animationConfig$call2 = animationConfig.callback) === null || _animationConfig$call2 === void 0
|
|
109
|
+
(_animationConfig$call2 = animationConfig.callback) === null || _animationConfig$call2 === void 0 || _animationConfig$call2.call(animationConfig, false);
|
|
111
110
|
element.removeEventListener('animationcancel', animationCancelHandler);
|
|
112
111
|
};
|
|
113
112
|
|
|
@@ -189,11 +188,11 @@ export function handleExitingAnimation(element, animationConfig) {
|
|
|
189
188
|
dummy.appendChild(element.firstChild);
|
|
190
189
|
}
|
|
191
190
|
setElementAnimation(dummy, animationConfig);
|
|
192
|
-
parent === null || parent === void 0
|
|
191
|
+
parent === null || parent === void 0 || parent.appendChild(dummy);
|
|
193
192
|
const snapshot = snapshots.get(element);
|
|
194
193
|
const scrollOffsets = getElementScrollValue(element);
|
|
195
194
|
|
|
196
|
-
// Scroll does not trigger
|
|
195
|
+
// Scroll does not trigger snapshotting, therefore if we start exiting animation after
|
|
197
196
|
// scrolling through parent component, dummy will end up in wrong place. In order to fix that
|
|
198
197
|
// we keep last known scroll position in snapshot and then adjust dummy position based on
|
|
199
198
|
// last known scroll offset and current scroll offset
|
|
@@ -218,7 +217,7 @@ export function handleExitingAnimation(element, animationConfig) {
|
|
|
218
217
|
}
|
|
219
218
|
|
|
220
219
|
// Given that this function overrides onAnimationEnd, it won't be null
|
|
221
|
-
originalOnAnimationEnd === null || originalOnAnimationEnd === void 0
|
|
220
|
+
originalOnAnimationEnd === null || originalOnAnimationEnd === void 0 || originalOnAnimationEnd.call(this, event);
|
|
222
221
|
};
|
|
223
222
|
dummy.addEventListener('animationcancel', () => {
|
|
224
223
|
if (parent !== null && parent !== void 0 && parent.contains(dummy)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Animations","TransitionType","WebEasings","convertTransformToString","TransitionGenerator","scheduleAnimationCleanup","_updatePropsJS","ReduceMotion","isReducedMotion","LayoutAnimationType","setDummyPosition","snapshots","getEasingFromConfig","config","easingName","easingV","name","toString","getRandomDelay","maxDelay","arguments","length","undefined","Math","floor","random","getDelayFromConfig","shouldRandomizeDelay","randomizeDelay","delay","delayV","getReducedMotionFromConfig","reduceMotionV","Never","Always","getDurationFromConfig","isLayoutTransition","animationName","defaultDuration","duration","durationV","getCallbackFromConfig","callbackV","getReversedFromConfig","reversed","extractTransformFromStyle","style","transform","Error","Array","isArray","i","_style$i","getProcessedConfig","animationType","initialAnimationName","LAYOUT","easing","callback","saveSnapshot","element","rect","getBoundingClientRect","snapshot","top","left","width","height","scrollOffsets","getElementScrollValue","set","setElementAnimation","animationConfig","existingTransform","animationDuration","animationDelay","animationTimingFunction","onanimationend","_animationConfig$call","call","removeEventListener","animationCancelHandler","_animationConfig$call2","onanimationstart","ENTERING","visibility","_component","addEventListener","handleLayoutTransition","transitionData","LINEAR","SEQUENCED","FADING","transformCopy","structuredClone","push","current","scrollTopOffset","scrollLeftOffset","scrollTop","scrollLeft","parentElement","handleExitingAnimation","parent","offsetParent","dummy","cloneNode","reanimatedDummy","firstChild","appendChild","get","currentScrollTopOffset","lastScrollTopOffset","currentScrollLeftOffset","lastScrollLeftOffset","originalOnAnimationEnd","event","contains","removedAfterAnimation","removeChild"],"sources":["componentUtils.ts"],"sourcesContent":["'use strict';\n\nimport type { TransformsStyle } from 'react-native';\nimport { Animations, TransitionType, WebEasings } from './config';\nimport type {\n AnimationCallback,\n AnimationConfig,\n AnimationNames,\n CustomConfig,\n WebEasingsNames,\n} from './config';\nimport { convertTransformToString } from './animationParser';\nimport type { TransitionData } from './animationParser';\nimport { TransitionGenerator } from './createAnimation';\nimport { scheduleAnimationCleanup } from './domUtils';\nimport { _updatePropsJS } from '../../js-reanimated';\nimport type { ReanimatedHTMLElement } from '../../js-reanimated';\nimport { ReduceMotion } from '../../commonTypes';\nimport type { StyleProps } from '../../commonTypes';\nimport { isReducedMotion } from '../../PlatformChecker';\nimport { LayoutAnimationType } from '../animationBuilder/commonTypes';\nimport type { ReanimatedSnapshot, ScrollOffsets } from './componentStyle';\nimport { setDummyPosition, snapshots } from './componentStyle';\n\nfunction getEasingFromConfig(config: CustomConfig): string {\n const easingName =\n config.easingV && config.easingV.name in WebEasings\n ? (config.easingV.name as WebEasingsNames)\n : 'linear';\n\n return `cubic-bezier(${WebEasings[easingName].toString()})`;\n}\n\nfunction getRandomDelay(maxDelay = 1000) {\n return Math.floor(Math.random() * (maxDelay + 1)) / 1000;\n}\n\nfunction getDelayFromConfig(config: CustomConfig): number {\n const shouldRandomizeDelay = config.randomizeDelay;\n\n const delay = shouldRandomizeDelay ? getRandomDelay() : 0;\n\n if (!config.delayV) {\n return delay;\n }\n\n return shouldRandomizeDelay\n ? getRandomDelay(config.delayV)\n : config.delayV / 1000;\n}\n\nexport function getReducedMotionFromConfig(config: CustomConfig) {\n if (!config.reduceMotionV) {\n return isReducedMotion();\n }\n\n switch (config.reduceMotionV) {\n case ReduceMotion.Never:\n return false;\n case ReduceMotion.Always:\n return true;\n default:\n return isReducedMotion();\n }\n}\n\nfunction getDurationFromConfig(\n config: CustomConfig,\n isLayoutTransition: boolean,\n animationName: AnimationNames\n): number {\n const defaultDuration = isLayoutTransition\n ? 0.3\n : Animations[animationName].duration;\n\n return config.durationV !== undefined\n ? config.durationV / 1000\n : defaultDuration;\n}\n\nfunction getCallbackFromConfig(config: CustomConfig): AnimationCallback {\n return config.callbackV !== undefined ? config.callbackV : null;\n}\n\nfunction getReversedFromConfig(config: CustomConfig) {\n return !!config.reversed;\n}\n\nexport function extractTransformFromStyle(style: StyleProps) {\n if (!style) {\n return;\n }\n\n if (typeof style.transform === 'string') {\n throw new Error('[Reanimated] String transform is currently unsupported.');\n }\n\n if (!Array.isArray(style)) {\n return style.transform;\n }\n\n // Only last transform should be considered\n for (let i = style.length - 1; i >= 0; --i) {\n if (style[i]?.transform) {\n return style[i].transform;\n }\n }\n}\n\nexport function getProcessedConfig(\n animationName: string,\n animationType: LayoutAnimationType,\n config: CustomConfig,\n initialAnimationName: AnimationNames\n): AnimationConfig {\n return {\n animationName,\n animationType,\n duration: getDurationFromConfig(\n config,\n animationType === LayoutAnimationType.LAYOUT,\n initialAnimationName\n ),\n delay: getDelayFromConfig(config),\n easing: getEasingFromConfig(config),\n callback: getCallbackFromConfig(config),\n reversed: getReversedFromConfig(config),\n };\n}\n\nexport function saveSnapshot(element: HTMLElement) {\n const rect = element.getBoundingClientRect();\n\n const snapshot: ReanimatedSnapshot = {\n top: rect.top,\n left: rect.left,\n width: rect.width,\n height: rect.height,\n scrollOffsets: getElementScrollValue(element),\n };\n\n snapshots.set(element, snapshot);\n}\n\nexport function setElementAnimation(\n element: HTMLElement,\n animationConfig: AnimationConfig,\n existingTransform?: TransformsStyle['transform']\n) {\n const { animationName, duration, delay, easing } = animationConfig;\n\n element.style.animationName = animationName;\n element.style.animationDuration = `${duration}s`;\n element.style.animationDelay = `${delay}s`;\n element.style.animationTimingFunction = easing;\n\n element.onanimationend = () => {\n animationConfig.callback?.(true);\n element.removeEventListener('animationcancel', animationCancelHandler);\n };\n\n const animationCancelHandler = () => {\n animationConfig.callback?.(false);\n element.removeEventListener('animationcancel', animationCancelHandler);\n };\n\n // Here we have to use `addEventListener` since element.onanimationcancel doesn't work on chrome\n element.onanimationstart = () => {\n if (animationConfig.animationType === LayoutAnimationType.ENTERING) {\n _updatePropsJS(\n { visibility: 'initial' },\n { _component: element as ReanimatedHTMLElement }\n );\n }\n\n element.addEventListener('animationcancel', animationCancelHandler);\n element.style.transform = convertTransformToString(existingTransform);\n };\n\n if (!(animationName in Animations)) {\n scheduleAnimationCleanup(animationName, duration + delay);\n }\n}\n\nexport function handleLayoutTransition(\n element: HTMLElement,\n animationConfig: AnimationConfig,\n transitionData: TransitionData,\n existingTransform: TransformsStyle['transform'] | undefined\n) {\n const { animationName } = animationConfig;\n\n let animationType;\n\n switch (animationName) {\n case 'LinearTransition':\n animationType = TransitionType.LINEAR;\n break;\n case 'SequencedTransition':\n animationType = TransitionType.SEQUENCED;\n break;\n case 'FadingTransition':\n animationType = TransitionType.FADING;\n break;\n default:\n animationType = TransitionType.LINEAR;\n break;\n }\n\n animationConfig.animationName = TransitionGenerator(\n animationType,\n transitionData,\n existingTransform\n );\n\n const transformCopy = existingTransform\n ? structuredClone(existingTransform)\n : [];\n\n // @ts-ignore `existingTransform` cannot be string because in that case\n // we throw error in `extractTransformFromStyle`\n transformCopy.push(transitionData);\n element.style.transform = convertTransformToString(transformCopy);\n\n setElementAnimation(element, animationConfig, existingTransform);\n}\n\nfunction getElementScrollValue(element: HTMLElement): ScrollOffsets {\n let current: HTMLElement | null = element;\n\n const scrollOffsets: ScrollOffsets = {\n scrollTopOffset: 0,\n scrollLeftOffset: 0,\n };\n\n while (current) {\n if (current.scrollTop !== 0 && scrollOffsets.scrollTopOffset === 0) {\n scrollOffsets.scrollTopOffset = current.scrollTop;\n }\n\n if (current.scrollLeft !== 0 && scrollOffsets.scrollLeftOffset === 0) {\n scrollOffsets.scrollLeftOffset = current.scrollLeft;\n }\n\n current = current.parentElement;\n }\n\n return scrollOffsets;\n}\n\nexport function handleExitingAnimation(\n element: HTMLElement,\n animationConfig: AnimationConfig\n) {\n const parent = element.offsetParent;\n const dummy = element.cloneNode() as ReanimatedHTMLElement;\n dummy.reanimatedDummy = true;\n\n element.style.animationName = '';\n // We hide current element so only its copy with proper animation will be displayed\n element.style.visibility = 'hidden';\n\n // After cloning the element, we want to move all children from original element to its clone. This is because original element\n // will be unmounted, therefore when this code executes in child component, parent will be either empty or removed soon.\n // Using element.cloneNode(true) doesn't solve the problem, because it creates copy of children and we won't be able to set their animations\n //\n // This loop works because appendChild() moves element into its new parent instead of copying it\n while (element.firstChild) {\n dummy.appendChild(element.firstChild);\n }\n\n setElementAnimation(dummy, animationConfig);\n parent?.appendChild(dummy);\n\n const snapshot = snapshots.get(element)!;\n\n const scrollOffsets = getElementScrollValue(element);\n\n // Scroll does not trigger snapshoting, therefore if we start exiting animation after\n // scrolling through parent component, dummy will end up in wrong place. In order to fix that\n // we keep last known scroll position in snapshot and then adjust dummy position based on\n // last known scroll offset and current scroll offset\n\n const currentScrollTopOffset = scrollOffsets.scrollTopOffset;\n const lastScrollTopOffset = snapshot.scrollOffsets.scrollTopOffset;\n\n if (currentScrollTopOffset !== lastScrollTopOffset) {\n snapshot.top += lastScrollTopOffset - currentScrollTopOffset;\n }\n\n const currentScrollLeftOffset = scrollOffsets.scrollLeftOffset;\n const lastScrollLeftOffset = snapshot.scrollOffsets.scrollLeftOffset;\n\n if (currentScrollLeftOffset !== lastScrollLeftOffset) {\n snapshot.left += lastScrollLeftOffset - currentScrollLeftOffset;\n }\n\n snapshots.set(dummy, snapshot);\n\n setDummyPosition(dummy, snapshot);\n\n const originalOnAnimationEnd = dummy.onanimationend;\n\n dummy.onanimationend = function (event: AnimationEvent) {\n if (parent?.contains(dummy)) {\n dummy.removedAfterAnimation = true;\n parent.removeChild(dummy);\n }\n\n // Given that this function overrides onAnimationEnd, it won't be null\n originalOnAnimationEnd?.call(this, event);\n };\n\n dummy.addEventListener('animationcancel', () => {\n if (parent?.contains(dummy)) {\n dummy.removedAfterAnimation = true;\n parent.removeChild(dummy);\n }\n });\n}\n"],"mappings":"AAAA,YAAY;;AAGZ,SAASA,UAAU,EAAEC,cAAc,EAAEC,UAAU,QAAQ,UAAU;AAQjE,SAASC,wBAAwB,QAAQ,mBAAmB;AAE5D,SAASC,mBAAmB,QAAQ,mBAAmB;AACvD,SAASC,wBAAwB,QAAQ,YAAY;AACrD,SAASC,cAAc,QAAQ,qBAAqB;AAEpD,SAASC,YAAY,QAAQ,mBAAmB;AAEhD,SAASC,eAAe,QAAQ,uBAAuB;AACvD,SAASC,mBAAmB,QAAQ,iCAAiC;AAErE,SAASC,gBAAgB,EAAEC,SAAS,QAAQ,kBAAkB;AAE9D,SAASC,mBAAmBA,CAACC,MAAoB,EAAU;EACzD,MAAMC,UAAU,GACdD,MAAM,CAACE,OAAO,IAAIF,MAAM,CAACE,OAAO,CAACC,IAAI,IAAId,UAAU,GAC9CW,MAAM,CAACE,OAAO,CAACC,IAAI,GACpB,QAAQ;EAEd,OAAQ,gBAAed,UAAU,CAACY,UAAU,CAAC,CAACG,QAAQ,EAAG,GAAE;AAC7D;AAEA,SAASC,cAAcA,CAAA,EAAkB;EAAA,IAAjBC,QAAQ,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,IAAI;EACrC,OAAOG,IAAI,CAACC,KAAK,CAACD,IAAI,CAACE,MAAM,EAAE,IAAIN,QAAQ,GAAG,CAAC,CAAC,CAAC,GAAG,IAAI;AAC1D;AAEA,SAASO,kBAAkBA,CAACb,MAAoB,EAAU;EACxD,MAAMc,oBAAoB,GAAGd,MAAM,CAACe,cAAc;EAElD,MAAMC,KAAK,GAAGF,oBAAoB,GAAGT,cAAc,EAAE,GAAG,CAAC;EAEzD,IAAI,CAACL,MAAM,CAACiB,MAAM,EAAE;IAClB,OAAOD,KAAK;EACd;EAEA,OAAOF,oBA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sB;EAC9D;EAEA,MAAME,uBAAuB,GAAG7C,aAAa,CAAC8B,gBAAgB;EAC9D,MAAMgB,oBAAoB,GAAGnD,QAAQ,CAACK,aAAa,CAAC8B,gBAAgB;EAEpE,IAAIe,uBAAuB,KAAKC,oBAAoB,EAAE;IACpDnD,QAAQ,CAACE,IAAI,IAAIiD,oBAAoB,GAAGD,uBAAuB;EACjE;EAEAtG,SAAS,CAAC2D,GAAG,CAACmC,KAAK,EAAE1C,QAAQ,CAAC;EAE9BrD,gBAAgB,CAAC+F,KAAK,EAAE1C,QAAQ,CAAC;EAEjC,MAAMoD,sBAAsB,GAAGV,KAAK,CAAC5B,cAAc;EAEnD4B,KAAK,CAAC5B,cAAc,GAAG,UAAUuC,KAAqB,EAAE;IACtD,IAAIb,MAAM,aAANA,MAAM,eAANA,MAAM,CAAEc,QAAQ,CAACZ,KAAK,CAAC,EAAE;MAC3BA,KAAK,CAACa,qBAAqB,GAAG,IAAI;MAClCf,MAAM,CAACgB,WAAW,CAACd,KAAK,CAAC;IAC3B;;IAEA;IACAU,sBAAsB,aAAtBA,sBAAsB,uBAAtBA,sBAAsB,CAAEpC,IAAI,CAAC,IAAI,EAAEqC,KAAK,CAAC;EAC3C,CAAC;EAEDX,KAAK,CAAClB,gBAAgB,CAAC,iBAAiB,EAAE,MAAM;IAC9C,IAAIgB,MAAM,aAANA,MAAM,eAANA,MAAM,CAAEc,QAAQ,CAACZ,KAAK,CAAC,EAAE;MAC3BA,KAAK,CAACa,qBAAqB,GAAG,IAAI;MAClCf,MAAM,CAACgB,WAAW,CAACd,KAAK,CAAC;IAC3B;EACF,CAAC,CAAC;AACJ"}
|
|
1
|
+
{"version":3,"names":["Animations","TransitionType","WebEasings","convertTransformToString","TransitionGenerator","scheduleAnimationCleanup","_updatePropsJS","ReduceMotion","isReducedMotion","LayoutAnimationType","setDummyPosition","snapshots","getEasingFromConfig","config","easingName","easingV","name","toString","getRandomDelay","maxDelay","Math","floor","random","getDelayFromConfig","shouldRandomizeDelay","randomizeDelay","delay","delayV","getReducedMotionFromConfig","reduceMotionV","Never","Always","getDurationFromConfig","isLayoutTransition","animationName","defaultDuration","duration","durationV","undefined","getCallbackFromConfig","callbackV","getReversedFromConfig","reversed","extractTransformFromStyle","style","transform","Error","Array","isArray","i","length","_style$i","getProcessedConfig","animationType","initialAnimationName","LAYOUT","easing","callback","saveSnapshot","element","rect","getBoundingClientRect","snapshot","top","left","width","height","scrollOffsets","getElementScrollValue","set","setElementAnimation","animationConfig","existingTransform","animationDuration","animationDelay","animationTimingFunction","onanimationend","_animationConfig$call","call","removeEventListener","animationCancelHandler","_animationConfig$call2","onanimationstart","ENTERING","visibility","_component","addEventListener","handleLayoutTransition","transitionData","LINEAR","SEQUENCED","FADING","transformCopy","structuredClone","push","current","scrollTopOffset","scrollLeftOffset","scrollTop","scrollLeft","parentElement","handleExitingAnimation","parent","offsetParent","dummy","cloneNode","reanimatedDummy","firstChild","appendChild","get","currentScrollTopOffset","lastScrollTopOffset","currentScrollLeftOffset","lastScrollLeftOffset","originalOnAnimationEnd","event","contains","removedAfterAnimation","removeChild"],"sources":["componentUtils.ts"],"sourcesContent":["'use strict';\n\nimport type { TransformsStyle } from 'react-native';\nimport { Animations, TransitionType, WebEasings } from './config';\nimport type {\n AnimationCallback,\n AnimationConfig,\n AnimationNames,\n CustomConfig,\n WebEasingsNames,\n} from './config';\nimport { convertTransformToString } from './animationParser';\nimport type { TransitionData } from './animationParser';\nimport { TransitionGenerator } from './createAnimation';\nimport { scheduleAnimationCleanup } from './domUtils';\nimport { _updatePropsJS } from '../../js-reanimated';\nimport type { ReanimatedHTMLElement } from '../../js-reanimated';\nimport { ReduceMotion } from '../../commonTypes';\nimport type { StyleProps } from '../../commonTypes';\nimport { isReducedMotion } from '../../PlatformChecker';\nimport { LayoutAnimationType } from '../animationBuilder/commonTypes';\nimport type { ReanimatedSnapshot, ScrollOffsets } from './componentStyle';\nimport { setDummyPosition, snapshots } from './componentStyle';\n\nfunction getEasingFromConfig(config: CustomConfig): string {\n const easingName =\n config.easingV && config.easingV.name in WebEasings\n ? (config.easingV.name as WebEasingsNames)\n : 'linear';\n\n return `cubic-bezier(${WebEasings[easingName].toString()})`;\n}\n\nfunction getRandomDelay(maxDelay = 1000) {\n return Math.floor(Math.random() * (maxDelay + 1)) / 1000;\n}\n\nfunction getDelayFromConfig(config: CustomConfig): number {\n const shouldRandomizeDelay = config.randomizeDelay;\n\n const delay = shouldRandomizeDelay ? getRandomDelay() : 0;\n\n if (!config.delayV) {\n return delay;\n }\n\n return shouldRandomizeDelay\n ? getRandomDelay(config.delayV)\n : config.delayV / 1000;\n}\n\nexport function getReducedMotionFromConfig(config: CustomConfig) {\n if (!config.reduceMotionV) {\n return isReducedMotion();\n }\n\n switch (config.reduceMotionV) {\n case ReduceMotion.Never:\n return false;\n case ReduceMotion.Always:\n return true;\n default:\n return isReducedMotion();\n }\n}\n\nfunction getDurationFromConfig(\n config: CustomConfig,\n isLayoutTransition: boolean,\n animationName: AnimationNames\n): number {\n const defaultDuration = isLayoutTransition\n ? 0.3\n : Animations[animationName].duration;\n\n return config.durationV !== undefined\n ? config.durationV / 1000\n : defaultDuration;\n}\n\nfunction getCallbackFromConfig(config: CustomConfig): AnimationCallback {\n return config.callbackV !== undefined ? config.callbackV : null;\n}\n\nfunction getReversedFromConfig(config: CustomConfig) {\n return !!config.reversed;\n}\n\nexport function extractTransformFromStyle(style: StyleProps) {\n if (!style) {\n return;\n }\n\n if (typeof style.transform === 'string') {\n throw new Error('[Reanimated] String transform is currently unsupported.');\n }\n\n if (!Array.isArray(style)) {\n return style.transform;\n }\n\n // Only last transform should be considered\n for (let i = style.length - 1; i >= 0; --i) {\n if (style[i]?.transform) {\n return style[i].transform;\n }\n }\n}\n\nexport function getProcessedConfig(\n animationName: string,\n animationType: LayoutAnimationType,\n config: CustomConfig,\n initialAnimationName: AnimationNames\n): AnimationConfig {\n return {\n animationName,\n animationType,\n duration: getDurationFromConfig(\n config,\n animationType === LayoutAnimationType.LAYOUT,\n initialAnimationName\n ),\n delay: getDelayFromConfig(config),\n easing: getEasingFromConfig(config),\n callback: getCallbackFromConfig(config),\n reversed: getReversedFromConfig(config),\n };\n}\n\nexport function saveSnapshot(element: HTMLElement) {\n const rect = element.getBoundingClientRect();\n\n const snapshot: ReanimatedSnapshot = {\n top: rect.top,\n left: rect.left,\n width: rect.width,\n height: rect.height,\n scrollOffsets: getElementScrollValue(element),\n };\n\n snapshots.set(element, snapshot);\n}\n\nexport function setElementAnimation(\n element: HTMLElement,\n animationConfig: AnimationConfig,\n existingTransform?: TransformsStyle['transform']\n) {\n const { animationName, duration, delay, easing } = animationConfig;\n\n element.style.animationName = animationName;\n element.style.animationDuration = `${duration}s`;\n element.style.animationDelay = `${delay}s`;\n element.style.animationTimingFunction = easing;\n\n element.onanimationend = () => {\n animationConfig.callback?.(true);\n element.removeEventListener('animationcancel', animationCancelHandler);\n };\n\n const animationCancelHandler = () => {\n animationConfig.callback?.(false);\n element.removeEventListener('animationcancel', animationCancelHandler);\n };\n\n // Here we have to use `addEventListener` since element.onanimationcancel doesn't work on chrome\n element.onanimationstart = () => {\n if (animationConfig.animationType === LayoutAnimationType.ENTERING) {\n _updatePropsJS(\n { visibility: 'initial' },\n { _component: element as ReanimatedHTMLElement }\n );\n }\n\n element.addEventListener('animationcancel', animationCancelHandler);\n element.style.transform = convertTransformToString(existingTransform);\n };\n\n if (!(animationName in Animations)) {\n scheduleAnimationCleanup(animationName, duration + delay);\n }\n}\n\nexport function handleLayoutTransition(\n element: HTMLElement,\n animationConfig: AnimationConfig,\n transitionData: TransitionData,\n existingTransform: TransformsStyle['transform'] | undefined\n) {\n const { animationName } = animationConfig;\n\n let animationType;\n\n switch (animationName) {\n case 'LinearTransition':\n animationType = TransitionType.LINEAR;\n break;\n case 'SequencedTransition':\n animationType = TransitionType.SEQUENCED;\n break;\n case 'FadingTransition':\n animationType = TransitionType.FADING;\n break;\n default:\n animationType = TransitionType.LINEAR;\n break;\n }\n\n animationConfig.animationName = TransitionGenerator(\n animationType,\n transitionData,\n existingTransform\n );\n\n const transformCopy = existingTransform\n ? structuredClone(existingTransform)\n : [];\n\n // @ts-ignore `existingTransform` cannot be string because in that case\n // we throw error in `extractTransformFromStyle`\n transformCopy.push(transitionData);\n element.style.transform = convertTransformToString(transformCopy);\n\n setElementAnimation(element, animationConfig, existingTransform);\n}\n\nfunction getElementScrollValue(element: HTMLElement): ScrollOffsets {\n let current: HTMLElement | null = element;\n\n const scrollOffsets: ScrollOffsets = {\n scrollTopOffset: 0,\n scrollLeftOffset: 0,\n };\n\n while (current) {\n if (current.scrollTop !== 0 && scrollOffsets.scrollTopOffset === 0) {\n scrollOffsets.scrollTopOffset = current.scrollTop;\n }\n\n if (current.scrollLeft !== 0 && scrollOffsets.scrollLeftOffset === 0) {\n scrollOffsets.scrollLeftOffset = current.scrollLeft;\n }\n\n current = current.parentElement;\n }\n\n return scrollOffsets;\n}\n\nexport function handleExitingAnimation(\n element: HTMLElement,\n animationConfig: AnimationConfig\n) {\n const parent = element.offsetParent;\n const dummy = element.cloneNode() as ReanimatedHTMLElement;\n dummy.reanimatedDummy = true;\n\n element.style.animationName = '';\n // We hide current element so only its copy with proper animation will be displayed\n element.style.visibility = 'hidden';\n\n // After cloning the element, we want to move all children from original element to its clone. This is because original element\n // will be unmounted, therefore when this code executes in child component, parent will be either empty or removed soon.\n // Using element.cloneNode(true) doesn't solve the problem, because it creates copy of children and we won't be able to set their animations\n //\n // This loop works because appendChild() moves element into its new parent instead of copying it\n while (element.firstChild) {\n dummy.appendChild(element.firstChild);\n }\n\n setElementAnimation(dummy, animationConfig);\n parent?.appendChild(dummy);\n\n const snapshot = snapshots.get(element)!;\n\n const scrollOffsets = getElementScrollValue(element);\n\n // Scroll does not trigger snapshotting, therefore if we start exiting animation after\n // scrolling through parent component, dummy will end up in wrong place. In order to fix that\n // we keep last known scroll position in snapshot and then adjust dummy position based on\n // last known scroll offset and current scroll offset\n\n const currentScrollTopOffset = scrollOffsets.scrollTopOffset;\n const lastScrollTopOffset = snapshot.scrollOffsets.scrollTopOffset;\n\n if (currentScrollTopOffset !== lastScrollTopOffset) {\n snapshot.top += lastScrollTopOffset - currentScrollTopOffset;\n }\n\n const currentScrollLeftOffset = scrollOffsets.scrollLeftOffset;\n const lastScrollLeftOffset = snapshot.scrollOffsets.scrollLeftOffset;\n\n if (currentScrollLeftOffset !== lastScrollLeftOffset) {\n snapshot.left += lastScrollLeftOffset - currentScrollLeftOffset;\n }\n\n snapshots.set(dummy, snapshot);\n\n setDummyPosition(dummy, snapshot);\n\n const originalOnAnimationEnd = dummy.onanimationend;\n\n dummy.onanimationend = function (event: AnimationEvent) {\n if (parent?.contains(dummy)) {\n dummy.removedAfterAnimation = true;\n parent.removeChild(dummy);\n }\n\n // Given that this function overrides onAnimationEnd, it won't be null\n originalOnAnimationEnd?.call(this, event);\n };\n\n dummy.addEventListener('animationcancel', () => {\n if (parent?.contains(dummy)) {\n dummy.removedAfterAnimation = true;\n parent.removeChild(dummy);\n }\n });\n}\n"],"mappings":"AAAA,YAAY;;AAGZ,SAASA,UAAU,EAAEC,cAAc,EAAEC,UAAU,QAAQ,UAAU;AAQjE,SAASC,wBAAwB,QAAQ,mBAAmB;AAE5D,SAASC,mBAAmB,QAAQ,mBAAmB;AACvD,SAASC,wBAAwB,QAAQ,YAAY;AACrD,SAASC,cAAc,QAAQ,qBAAqB;AAEpD,SAASC,YAAY,QAAQ,mBAAmB;AAEhD,SAASC,eAAe,QAAQ,uBAAuB;AACvD,SAASC,mBAAmB,QAAQ,iCAAiC;AAErE,SAASC,gBAAgB,EAAEC,SAAS,QAAQ,kBAAkB;AAE9D,SAASC,mBAAmBA,CAACC,MAAoB,EAAU;EACzD,MAAMC,UAAU,GACdD,MAAM,CAACE,OAAO,IAAIF,MAAM,CAACE,OAAO,CAACC,IAAI,IAAId,UAAU,GAC9CW,MAAM,CAACE,OAAO,CAACC,IAAI,GACpB,QAAQ;EAEd,OAAQ,gBAAed,UAA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AC;EAEDX,KAAK,CAAClB,gBAAgB,CAAC,iBAAiB,EAAE,MAAM;IAC9C,IAAIgB,MAAM,aAANA,MAAM,eAANA,MAAM,CAAEc,QAAQ,CAACZ,KAAK,CAAC,EAAE;MAC3BA,KAAK,CAACa,qBAAqB,GAAG,IAAI;MAClCf,MAAM,CAACgB,WAAW,CAACd,KAAK,CAAC;IAC3B;EACF,CAAC,CAAC;AACJ","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["BounceIn","BounceInData","BounceOut","BounceOutData","FadeIn","FadeInData","FadeOut","FadeOutData","FlipIn","FlipInData","FlipOut","FlipOutData","LightSpeedIn","LightSpeedInData","LightSpeedOut","LightSpeedOutData","Pinwheel","PinwheelData","RollIn","RollInData","RollOut","RollOutData","RotateIn","RotateInData","RotateOut","RotateOutData","SlideIn","SlideInData","SlideOut","SlideOutData","StretchIn","StretchInData","StretchOut","StretchOutData","ZoomIn","ZoomInData","ZoomOut","ZoomOutData","TransitionType","AnimationsData","Animations","WebEasings","linear","ease","quad","cubic","sin","circle","exp"],"sources":["config.ts"],"sourcesContent":["'use strict';\nimport type { ReduceMotion } from '../../commonTypes';\nimport type { LayoutAnimationType } from '../animationBuilder/commonTypes';\nimport {\n BounceIn,\n BounceInData,\n BounceOut,\n BounceOutData,\n} from './animation/Bounce.web';\nimport { FadeIn, FadeInData, FadeOut, FadeOutData } from './animation/Fade.web';\nimport { FlipIn, FlipInData, FlipOut, FlipOutData } from './animation/Flip.web';\nimport {\n LightSpeedIn,\n LightSpeedInData,\n LightSpeedOut,\n LightSpeedOutData,\n} from './animation/Lightspeed.web';\nimport { Pinwheel, PinwheelData } from './animation/Pinwheel.web';\nimport { RollIn, RollInData, RollOut, RollOutData } from './animation/Roll.web';\nimport {\n RotateIn,\n RotateInData,\n RotateOut,\n RotateOutData,\n} from './animation/Rotate.web';\nimport {\n SlideIn,\n SlideInData,\n SlideOut,\n SlideOutData,\n} from './animation/Slide.web';\nimport {\n StretchIn,\n StretchInData,\n StretchOut,\n StretchOutData,\n} from './animation/Stretch.web';\nimport { ZoomIn, ZoomInData, ZoomOut, ZoomOutData } from './animation/Zoom.web';\n\nimport type { AnimationData } from './animationParser';\n\nexport type AnimationCallback = ((finished: boolean) => void) | null;\n\nexport interface AnimationConfig {\n animationName: string;\n animationType: LayoutAnimationType;\n duration: number;\n delay: number;\n easing: string;\n callback: AnimationCallback;\n reversed: boolean;\n}\n\nexport interface CustomConfig {\n easingV?: () => number;\n durationV?: number;\n delayV?: number;\n randomizeDelay?: boolean;\n reduceMotionV?: ReduceMotion;\n callbackV?: AnimationCallback;\n reversed?: boolean;\n}\n\nexport enum TransitionType {\n LINEAR,\n SEQUENCED,\n FADING,\n}\n\nexport const AnimationsData: Record<string, AnimationData> = {\n ...FadeInData,\n ...FadeOutData,\n ...BounceInData,\n ...BounceOutData,\n ...FlipInData,\n ...FlipOutData,\n ...StretchInData,\n ...StretchOutData,\n ...ZoomInData,\n ...ZoomOutData,\n ...SlideInData,\n ...SlideOutData,\n ...LightSpeedInData,\n ...LightSpeedOutData,\n ...PinwheelData,\n ...RotateInData,\n ...RotateOutData,\n ...RollInData,\n ...RollOutData,\n};\n\nexport const Animations = {\n ...FadeIn,\n ...FadeOut,\n ...BounceIn,\n ...BounceOut,\n ...FlipIn,\n ...FlipOut,\n ...StretchIn,\n ...StretchOut,\n ...ZoomIn,\n ...ZoomOut,\n ...SlideIn,\n ...SlideOut,\n ...LightSpeedIn,\n ...LightSpeedOut,\n ...Pinwheel,\n ...RotateIn,\n ...RotateOut,\n ...RollIn,\n ...RollOut,\n};\n\n// Those are the easings that can be implemented using Bezier curves.\n// Others should be done as CSS animations\nexport const WebEasings = {\n linear: [0, 0, 1, 1],\n ease: [0.42, 0, 1, 1],\n quad: [0.11, 0, 0.5, 0],\n cubic: [0.32, 0, 0.67, 0],\n sin: [0.12, 0, 0.39, 0],\n circle: [0.55, 0, 1, 0.45],\n exp: [0.7, 0, 0.84, 0],\n};\n\nexport type AnimationNames = keyof typeof Animations;\nexport type LayoutTransitionsNames = keyof typeof AnimationsData;\nexport type WebEasingsNames = keyof typeof WebEasings;\n"],"mappings":"AAAA,YAAY;;AAGZ,SACEA,QAAQ,EACRC,YAAY,EACZC,SAAS,EACTC,aAAa,QACR,wBAAwB;AAC/B,SAASC,MAAM,EAAEC,UAAU,EAAEC,OAAO,EAAEC,WAAW,QAAQ,sBAAsB;AAC/E,SAASC,MAAM,EAAEC,UAAU,EAAEC,OAAO,EAAEC,WAAW,QAAQ,sBAAsB;AAC/E,SACEC,YAAY,EACZC,gBAAgB,EAChBC,aAAa,EACbC,iBAAiB,QACZ,4BAA4B;AACnC,SAASC,QAAQ,EAAEC,YAAY,QAAQ,0BAA0B;AACjE,SAASC,MAAM,EAAEC,UAAU,EAAEC,OAAO,EAAEC,WAAW,QAAQ,sBAAsB;AAC/E,SACEC,QAAQ,EACRC,YAAY,EACZC,SAAS,EACTC,aAAa,QACR,wBAAwB;AAC/B,SACEC,OAAO,EACPC,WAAW,EACXC,QAAQ,EACRC,YAAY,QACP,uBAAuB;AAC9B,SACEC,SAAS,EACTC,aAAa,EACbC,UAAU,EACVC,cAAc,QACT,yBAAyB;AAChC,SAASC,MAAM,EAAEC,UAAU,EAAEC,OAAO,EAAEC,WAAW,QAAQ,sBAAsB;AA0B/E,WAAYC,cAAc,0BAAdA,cAAc;EAAdA,cAAc,CAAdA,cAAc;EAAdA,cAAc,CAAdA,cAAc;EAAdA,cAAc,CAAdA,cAAc;EAAA,OAAdA,cAAc;AAAA;AAM1B,OAAO,MAAMC,cAA6C,GAAG;EAC3D,GAAGlC,UAAU;EACb,GAAGE,WAAW;EACd,GAAGN,YAAY;EACf,GAAGE,aAAa;EAChB,GAAGM,UAAU;EACb,GAAGE,WAAW;EACd,GAAGoB,aAAa;EAChB,GAAGE,cAAc;EACjB,GAAGE,UAAU;EACb,GAAGE,WAAW;EACd,GAAGV,WAAW;EACd,GAAGE,YAAY;EACf,GAAGhB,gBAAgB;EACnB,GAAGE,iBAAiB;EACpB,GAAGE,YAAY;EACf,GAAGM,YAAY;EACf,GAAGE,aAAa;EAChB,GAAGN,UAAU;EACb,GAAGE;AACL,CAAC;AAED,OAAO,MAAMmB,UAAU,GAAG;EACxB,GAAGpC,MAAM;EACT,GAAGE,OAAO;EACV,GAAGN,QAAQ;EACX,GAAGE,SAAS;EACZ,GAAGM,MAAM;EACT,GAAGE,OAAO;EACV,GAAGoB,SAAS;EACZ,GAAGE,UAAU;EACb,GAAGE,MAAM;EACT,GAAGE,OAAO;EACV,GAAGV,OAAO;EACV,GAAGE,QAAQ;EACX,GAAGhB,YAAY;EACf,GAAGE,aAAa;EAChB,GAAGE,QAAQ;EACX,GAAGM,QAAQ;EACX,GAAGE,SAAS;EACZ,GAAGN,MAAM;EACT,GAAGE;AACL,CAAC;;AAED;AACA;AACA,OAAO,MAAMqB,UAAU,GAAG;EACxBC,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;EACpBC,IAAI,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;EACrBC,IAAI,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC;EACvBC,KAAK,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC;EACzBC,GAAG,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC;EACvBC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC;EAC1BC,GAAG,EAAE,CAAC,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC;AACvB,CAAC"}
|
|
1
|
+
{"version":3,"names":["BounceIn","BounceInData","BounceOut","BounceOutData","FadeIn","FadeInData","FadeOut","FadeOutData","FlipIn","FlipInData","FlipOut","FlipOutData","LightSpeedIn","LightSpeedInData","LightSpeedOut","LightSpeedOutData","Pinwheel","PinwheelData","RollIn","RollInData","RollOut","RollOutData","RotateIn","RotateInData","RotateOut","RotateOutData","SlideIn","SlideInData","SlideOut","SlideOutData","StretchIn","StretchInData","StretchOut","StretchOutData","ZoomIn","ZoomInData","ZoomOut","ZoomOutData","TransitionType","AnimationsData","Animations","WebEasings","linear","ease","quad","cubic","sin","circle","exp"],"sources":["config.ts"],"sourcesContent":["'use strict';\nimport type { ReduceMotion } from '../../commonTypes';\nimport type { LayoutAnimationType } from '../animationBuilder/commonTypes';\nimport {\n BounceIn,\n BounceInData,\n BounceOut,\n BounceOutData,\n} from './animation/Bounce.web';\nimport { FadeIn, FadeInData, FadeOut, FadeOutData } from './animation/Fade.web';\nimport { FlipIn, FlipInData, FlipOut, FlipOutData } from './animation/Flip.web';\nimport {\n LightSpeedIn,\n LightSpeedInData,\n LightSpeedOut,\n LightSpeedOutData,\n} from './animation/Lightspeed.web';\nimport { Pinwheel, PinwheelData } from './animation/Pinwheel.web';\nimport { RollIn, RollInData, RollOut, RollOutData } from './animation/Roll.web';\nimport {\n RotateIn,\n RotateInData,\n RotateOut,\n RotateOutData,\n} from './animation/Rotate.web';\nimport {\n SlideIn,\n SlideInData,\n SlideOut,\n SlideOutData,\n} from './animation/Slide.web';\nimport {\n StretchIn,\n StretchInData,\n StretchOut,\n StretchOutData,\n} from './animation/Stretch.web';\nimport { ZoomIn, ZoomInData, ZoomOut, ZoomOutData } from './animation/Zoom.web';\n\nimport type { AnimationData } from './animationParser';\n\nexport type AnimationCallback = ((finished: boolean) => void) | null;\n\nexport interface AnimationConfig {\n animationName: string;\n animationType: LayoutAnimationType;\n duration: number;\n delay: number;\n easing: string;\n callback: AnimationCallback;\n reversed: boolean;\n}\n\nexport interface CustomConfig {\n easingV?: () => number;\n durationV?: number;\n delayV?: number;\n randomizeDelay?: boolean;\n reduceMotionV?: ReduceMotion;\n callbackV?: AnimationCallback;\n reversed?: boolean;\n}\n\nexport enum TransitionType {\n LINEAR,\n SEQUENCED,\n FADING,\n}\n\nexport const AnimationsData: Record<string, AnimationData> = {\n ...FadeInData,\n ...FadeOutData,\n ...BounceInData,\n ...BounceOutData,\n ...FlipInData,\n ...FlipOutData,\n ...StretchInData,\n ...StretchOutData,\n ...ZoomInData,\n ...ZoomOutData,\n ...SlideInData,\n ...SlideOutData,\n ...LightSpeedInData,\n ...LightSpeedOutData,\n ...PinwheelData,\n ...RotateInData,\n ...RotateOutData,\n ...RollInData,\n ...RollOutData,\n};\n\nexport const Animations = {\n ...FadeIn,\n ...FadeOut,\n ...BounceIn,\n ...BounceOut,\n ...FlipIn,\n ...FlipOut,\n ...StretchIn,\n ...StretchOut,\n ...ZoomIn,\n ...ZoomOut,\n ...SlideIn,\n ...SlideOut,\n ...LightSpeedIn,\n ...LightSpeedOut,\n ...Pinwheel,\n ...RotateIn,\n ...RotateOut,\n ...RollIn,\n ...RollOut,\n};\n\n// Those are the easings that can be implemented using Bezier curves.\n// Others should be done as CSS animations\nexport const WebEasings = {\n linear: [0, 0, 1, 1],\n ease: [0.42, 0, 1, 1],\n quad: [0.11, 0, 0.5, 0],\n cubic: [0.32, 0, 0.67, 0],\n sin: [0.12, 0, 0.39, 0],\n circle: [0.55, 0, 1, 0.45],\n exp: [0.7, 0, 0.84, 0],\n};\n\nexport type AnimationNames = keyof typeof Animations;\nexport type LayoutTransitionsNames = keyof typeof AnimationsData;\nexport type WebEasingsNames = keyof typeof WebEasings;\n"],"mappings":"AAAA,YAAY;;AAGZ,SACEA,QAAQ,EACRC,YAAY,EACZC,SAAS,EACTC,aAAa,QACR,wBAAwB;AAC/B,SAASC,MAAM,EAAEC,UAAU,EAAEC,OAAO,EAAEC,WAAW,QAAQ,sBAAsB;AAC/E,SAASC,MAAM,EAAEC,UAAU,EAAEC,OAAO,EAAEC,WAAW,QAAQ,sBAAsB;AAC/E,SACEC,YAAY,EACZC,gBAAgB,EAChBC,aAAa,EACbC,iBAAiB,QACZ,4BAA4B;AACnC,SAASC,QAAQ,E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AQ;EACX,GAAGM,QAAQ;EACX,GAAGE,SAAS;EACZ,GAAGN,MAAM;EACT,GAAGE;AACL,CAAC;;AAED;AACA;AACA,OAAO,MAAMqB,UAAU,GAAG;EACxBC,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;EACpBC,IAAI,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;EACrBC,IAAI,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC;EACvBC,KAAK,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC;EACzBC,GAAG,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC;EACvBC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC;EAC1BC,GAAG,EAAE,CAAC,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC;AACvB,CAAC","ignoreList":[]}
|
|
@@ -8,7 +8,7 @@ import { FadingTransition } from './transition/Fading.web';
|
|
|
8
8
|
import { insertWebAnimation } from './domUtils';
|
|
9
9
|
|
|
10
10
|
// Translate values are passed as numbers. However, if `translate` property receives number, it will not automatically
|
|
11
|
-
// convert it to `px`. Therefore if we want to keep
|
|
11
|
+
// convert it to `px`. Therefore if we want to keep existing transform we have to add 'px' suffix to each of translate values
|
|
12
12
|
// that are present inside transform.
|
|
13
13
|
function addPxToTranslate(existingTransform) {
|
|
14
14
|
// @ts-ignore `existingTransform` cannot be string because in that case
|
|
@@ -30,7 +30,7 @@ function addPxToTranslate(existingTransform) {
|
|
|
30
30
|
return newTransform;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
// In order to keep
|
|
33
|
+
// In order to keep existing transform throughout animation, we have to add it to each of keyframe step.
|
|
34
34
|
function addExistingTransform(newAnimationData, newTransform) {
|
|
35
35
|
for (const keyframeStepProperties of Object.values(newAnimationData.style)) {
|
|
36
36
|
if (!keyframeStepProperties.transform) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Animations","AnimationsData","TransitionType","convertAnimationObjectToKeyframes","LinearTransition","SequencedTransition","FadingTransition","insertWebAnimation","addPxToTranslate","existingTransform","newTransform","map","transformProp","newTransformProp","key","value","Object","entries","includes","addExistingTransform","newAnimationData","keyframeStepProperties","values","style","transform","Array","prototype","unshift","apply","createAnimationWithExistingTransform","animationName","layoutTransition","structuredClone","keyframeName","generateNextCustomKeyframeName","name","keyframe","customKeyframeCounter","TransitionGenerator","transitionType","transitionData","transitionKeyframeName","transitionObject","LINEAR","SEQUENCED","FADING","transitionKeyframe"],"sources":["createAnimation.ts"],"sourcesContent":["'use strict';\n\nimport { Animations, AnimationsData, TransitionType } from './config';\nimport { convertAnimationObjectToKeyframes } from './animationParser';\nimport type {\n AnimationData,\n ReanimatedWebTransformProperties,\n TransitionData,\n} from './animationParser';\nimport type { TransformsStyle } from 'react-native';\nimport { LinearTransition } from './transition/Linear.web';\nimport { SequencedTransition } from './transition/Sequenced.web';\nimport { FadingTransition } from './transition/Fading.web';\nimport { insertWebAnimation } from './domUtils';\n\n// Translate values are passed as numbers. However, if `translate` property receives number, it will not automatically\n// convert it to `px`. Therefore if we want to keep
|
|
1
|
+
{"version":3,"names":["Animations","AnimationsData","TransitionType","convertAnimationObjectToKeyframes","LinearTransition","SequencedTransition","FadingTransition","insertWebAnimation","addPxToTranslate","existingTransform","newTransform","map","transformProp","newTransformProp","key","value","Object","entries","includes","addExistingTransform","newAnimationData","keyframeStepProperties","values","style","transform","Array","prototype","unshift","apply","createAnimationWithExistingTransform","animationName","layoutTransition","structuredClone","keyframeName","generateNextCustomKeyframeName","name","keyframe","customKeyframeCounter","TransitionGenerator","transitionType","transitionData","transitionKeyframeName","transitionObject","LINEAR","SEQUENCED","FADING","transitionKeyframe"],"sources":["createAnimation.ts"],"sourcesContent":["'use strict';\n\nimport { Animations, AnimationsData, TransitionType } from './config';\nimport { convertAnimationObjectToKeyframes } from './animationParser';\nimport type {\n AnimationData,\n ReanimatedWebTransformProperties,\n TransitionData,\n} from './animationParser';\nimport type { TransformsStyle } from 'react-native';\nimport { LinearTransition } from './transition/Linear.web';\nimport { SequencedTransition } from './transition/Sequenced.web';\nimport { FadingTransition } from './transition/Fading.web';\nimport { insertWebAnimation } from './domUtils';\n\n// Translate values are passed as numbers. However, if `translate` property receives number, it will not automatically\n// convert it to `px`. Therefore if we want to keep existing transform we have to add 'px' suffix to each of translate values\n// that are present inside transform.\nfunction addPxToTranslate(\n existingTransform: NonNullable<TransformsStyle['transform']>\n) {\n type RNTransformProp = (typeof existingTransform)[number];\n\n // @ts-ignore `existingTransform` cannot be string because in that case\n // we throw error in `extractTransformFromStyle`\n const newTransform = existingTransform.map(\n (transformProp: RNTransformProp) => {\n const newTransformProp: ReanimatedWebTransformProperties = {};\n for (const [key, value] of Object.entries(transformProp)) {\n if (key.includes('translate')) {\n // @ts-ignore After many trials we decided to ignore this error - it says that we cannot use 'key' to index this object.\n // Sadly it doesn't go away after using cast `key as keyof TransformProperties`.\n newTransformProp[key] = `${value}px`;\n } else {\n // @ts-ignore same as above.\n newTransformProp[key] = value;\n }\n }\n return newTransformProp;\n }\n );\n\n return newTransform;\n}\n\n// In order to keep existing transform throughout animation, we have to add it to each of keyframe step.\nfunction addExistingTransform(\n newAnimationData: AnimationData,\n newTransform: ReanimatedWebTransformProperties[]\n) {\n for (const keyframeStepProperties of Object.values(newAnimationData.style)) {\n if (!keyframeStepProperties.transform) {\n // If transform doesn't exist, we add only transform that already exists\n keyframeStepProperties.transform = newTransform;\n } else {\n // We insert existing transformations before ours.\n Array.prototype.unshift.apply(\n keyframeStepProperties.transform,\n newTransform\n );\n }\n }\n}\n\n/**\n * Modifies default animation by preserving transformations that given element already contains.\n *\n * @param animationName - Name of the animation to be modified (e.g. `FadeIn`).\n * @param existingTransform - Transform values that element already contains.\n * @returns Animation parsed to keyframe string.\n */\nexport function createAnimationWithExistingTransform(\n animationName: string,\n existingTransform: NonNullable<TransformsStyle['transform']>,\n layoutTransition?: AnimationData\n) {\n let newAnimationData;\n\n if (layoutTransition) {\n newAnimationData = layoutTransition;\n } else {\n if (!(animationName in Animations)) {\n return '';\n }\n newAnimationData = structuredClone(AnimationsData[animationName]);\n }\n\n const keyframeName = generateNextCustomKeyframeName();\n\n newAnimationData.name = keyframeName;\n\n const newTransform = addPxToTranslate(existingTransform);\n\n addExistingTransform(newAnimationData, newTransform);\n\n const keyframe = convertAnimationObjectToKeyframes(newAnimationData);\n\n insertWebAnimation(keyframeName, keyframe);\n\n return keyframeName;\n}\n\nlet customKeyframeCounter = 0;\n\nfunction generateNextCustomKeyframeName() {\n return `REA${customKeyframeCounter++}`;\n}\n\n/**\n * Creates transition of given type, appends it to stylesheet and returns keyframe name.\n *\n * @param transitionType - Type of transition (e.g. LINEAR).\n * @param transitionData - Object containing data for transforms (translateX, scaleX,...).\n * @returns Keyframe name that represents transition.\n */\nexport function TransitionGenerator(\n transitionType: TransitionType,\n transitionData: TransitionData,\n existingTransform: TransformsStyle['transform'] | undefined\n) {\n const transitionKeyframeName = generateNextCustomKeyframeName();\n let transitionObject;\n\n switch (transitionType) {\n case TransitionType.LINEAR:\n transitionObject = LinearTransition(\n transitionKeyframeName,\n transitionData\n );\n break;\n case TransitionType.SEQUENCED:\n transitionObject = SequencedTransition(\n transitionKeyframeName,\n transitionData\n );\n break;\n case TransitionType.FADING:\n transitionObject = FadingTransition(\n transitionKeyframeName,\n transitionData\n );\n break;\n }\n\n if (existingTransform) {\n return createAnimationWithExistingTransform(\n '',\n existingTransform,\n transitionObject\n );\n }\n\n const transitionKeyframe =\n convertAnimationObjectToKeyframes(transitionObject);\n\n insertWebAnimation(transitionKeyframeName, transitionKeyframe);\n\n return transitionKeyframeName;\n}\n"],"mappings":"AAAA,YAAY;;AAEZ,SAASA,UAAU,EAAEC,cAAc,EAAEC,cAAc,QAAQ,UAA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EA,IAAI/B,iBAAiB,EAAE;IACrB,OAAOoB,oCAAoC,CACzC,EAAE,EACFpB,iBAAiB,EACjBiC,gBACF,CAAC;EACH;EAEA,MAAMI,kBAAkB,GACtB3C,iCAAiC,CAACuC,gBAAgB,CAAC;EAErDnC,kBAAkB,CAACkC,sBAAsB,EAAEK,kBAAkB,CAAC;EAE9D,OAAOL,sBAAsB;AAC/B","ignoreList":[]}
|
|
@@ -70,7 +70,7 @@ function removeWebAnimation(animationName) {
|
|
|
70
70
|
if (currentAnimationIndex === undefined) {
|
|
71
71
|
throw new Error('[Reanimated] Failed to obtain animation index.');
|
|
72
72
|
}
|
|
73
|
-
(_styleTag$sheet = styleTag.sheet) === null || _styleTag$sheet === void 0
|
|
73
|
+
(_styleTag$sheet = styleTag.sheet) === null || _styleTag$sheet === void 0 || _styleTag$sheet.deleteRule(currentAnimationIndex);
|
|
74
74
|
animationNameList.splice(currentAnimationIndex, 1);
|
|
75
75
|
animationNameToIndex.delete(animationName);
|
|
76
76
|
for (let i = currentAnimationIndex; i < animationNameList.length; ++i) {
|
|
@@ -107,7 +107,7 @@ function reattachElementToAncestor(child, parent) {
|
|
|
107
107
|
parent.removeChild(child);
|
|
108
108
|
|
|
109
109
|
// Given that this function overrides onAnimationEnd, it won't be null
|
|
110
|
-
originalOnAnimationEnd === null || originalOnAnimationEnd === void 0
|
|
110
|
+
originalOnAnimationEnd === null || originalOnAnimationEnd === void 0 || originalOnAnimationEnd.call(this, event);
|
|
111
111
|
};
|
|
112
112
|
}
|
|
113
113
|
function findDescendantWithExitingAnimation(node, root) {
|
|
@@ -125,7 +125,7 @@ function findDescendantWithExitingAnimation(node, root) {
|
|
|
125
125
|
}
|
|
126
126
|
}
|
|
127
127
|
function checkIfScreenWasChanged(mutationTarget) {
|
|
128
|
-
var _mutationTarget$react
|
|
128
|
+
var _mutationTarget$react;
|
|
129
129
|
let reactFiberKey = '__reactFiber';
|
|
130
130
|
for (const key of Object.keys(mutationTarget)) {
|
|
131
131
|
if (key.startsWith('__reactFiber')) {
|
|
@@ -133,7 +133,7 @@ function checkIfScreenWasChanged(mutationTarget) {
|
|
|
133
133
|
break;
|
|
134
134
|
}
|
|
135
135
|
}
|
|
136
|
-
return ((_mutationTarget$react = mutationTarget[reactFiberKey]) === null || _mutationTarget$react === void 0
|
|
136
|
+
return ((_mutationTarget$react = mutationTarget[reactFiberKey]) === null || _mutationTarget$react === void 0 || (_mutationTarget$react = _mutationTarget$react.child) === null || _mutationTarget$react === void 0 || (_mutationTarget$react = _mutationTarget$react.memoizedProps) === null || _mutationTarget$react === void 0 ? void 0 : _mutationTarget$react.navigation) !== undefined;
|
|
137
137
|
}
|
|
138
138
|
export function addHTMLMutationObserver() {
|
|
139
139
|
if (isObserverSet || !isWindowAvailable()) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["isWindowAvailable","setDummyPosition","snapshots","Animations","PREDEFINED_WEB_ANIMATIONS_ID","CUSTOM_WEB_ANIMATIONS_ID","animationNameToIndex","Map","animationNameList","isObserverSet","configureWebLayoutAnimations","document","getElementById","predefinedAnimationsStyleTag","createElement","id","onload","sheet","console","error","animationName","insertRule","style","customAnimationsStyleTag","head","appendChild","insertWebAnimation","keyframe","styleTag","unshift","set","i","length","nextAnimationName","nextAnimationIndex","get","undefined","Error","removeWebAnimation","_styleTag$sheet","currentAnimationIndex","deleteRule","splice","delete","timeoutScale","frameDurationMs","minimumFrames","scheduleAnimationCleanup","animationDuration","timeoutValue","Math","max","setTimeout","reattachElementToAncestor","child","parent","childSnapshot","removedAfterAnimation","originalOnAnimationEnd","onanimationend","event","removeChild","call","findDescendantWithExitingAnimation","node","root","HTMLElement","reanimatedDummy","children","Array","from","checkIfScreenWasChanged","mutationTarget","_mutationTarget$react","_mutationTarget$react2","_mutationTarget$react3","reactFiberKey","key","Object","keys","startsWith","memoizedProps","navigation","addHTMLMutationObserver","observer","MutationObserver","mutationsList","rootMutation","target","removedNodes","observe","body","childList","subtree","areDOMRectsEqual","r1","r2","x","y","width","height"],"sources":["domUtils.ts"],"sourcesContent":["'use strict';\n\nimport type { ReanimatedHTMLElement } from '../../js-reanimated';\nimport { isWindowAvailable } from '../../PlatformChecker';\nimport { setDummyPosition, snapshots } from './componentStyle';\nimport { Animations } from './config';\nimport type { AnimationNames } from './config';\n\nconst PREDEFINED_WEB_ANIMATIONS_ID = 'ReanimatedPredefinedWebAnimationsStyle';\nconst CUSTOM_WEB_ANIMATIONS_ID = 'ReanimatedCustomWebAnimationsStyle';\n\n// Since we cannot remove keyframe from DOM by its name, we have to store its id\nconst animationNameToIndex = new Map<string, number>();\nconst animationNameList: string[] = [];\n\nlet isObserverSet = false;\n\n/**\n * Creates `HTMLStyleElement`, inserts it into DOM and then inserts CSS rules into the stylesheet.\n * If style element already exists, nothing happens.\n */\nexport function configureWebLayoutAnimations() {\n if (\n !isWindowAvailable() || // Without this check SSR crashes because document is undefined (NextExample on CI)\n document.getElementById(PREDEFINED_WEB_ANIMATIONS_ID) !== null\n ) {\n return;\n }\n\n const predefinedAnimationsStyleTag = document.createElement('style');\n predefinedAnimationsStyleTag.id = PREDEFINED_WEB_ANIMATIONS_ID;\n\n predefinedAnimationsStyleTag.onload = () => {\n if (!predefinedAnimationsStyleTag.sheet) {\n console.error(\n '[Reanimated] Failed to create layout animations stylesheet.'\n );\n return;\n }\n\n for (const animationName in Animations) {\n predefinedAnimationsStyleTag.sheet.insertRule(\n Animations[animationName as AnimationNames].style\n );\n }\n };\n\n const customAnimationsStyleTag = document.createElement('style');\n customAnimationsStyleTag.id = CUSTOM_WEB_ANIMATIONS_ID;\n\n document.head.appendChild(predefinedAnimationsStyleTag);\n document.head.appendChild(customAnimationsStyleTag);\n}\n\nexport function insertWebAnimation(animationName: string, keyframe: string) {\n // Without this check SSR crashes because document is undefined (NextExample on CI)\n if (!isWindowAvailable()) {\n return;\n }\n\n const styleTag = document.getElementById(\n CUSTOM_WEB_ANIMATIONS_ID\n ) as HTMLStyleElement;\n\n if (!styleTag.sheet) {\n console.error(\n '[Reanimated] Failed to create layout animations stylesheet.'\n );\n return;\n }\n\n styleTag.sheet.insertRule(keyframe, 0);\n animationNameList.unshift(animationName);\n animationNameToIndex.set(animationName, 0);\n\n for (let i = 1; i < animationNameList.length; ++i) {\n const nextAnimationName = animationNameList[i];\n const nextAnimationIndex = animationNameToIndex.get(nextAnimationName);\n\n if (nextAnimationIndex === undefined) {\n throw new Error('[Reanimated] Failed to obtain animation index.');\n }\n\n animationNameToIndex.set(animationNameList[i], nextAnimationIndex + 1);\n }\n}\n\nfunction removeWebAnimation(animationName: string) {\n // Without this check SSR crashes because document is undefined (NextExample on CI)\n if (!isWindowAvailable()) {\n return;\n }\n\n const styleTag = document.getElementById(\n CUSTOM_WEB_ANIMATIONS_ID\n ) as HTMLStyleElement;\n\n const currentAnimationIndex = animationNameToIndex.get(animationName);\n\n if (currentAnimationIndex === undefined) {\n throw new Error('[Reanimated] Failed to obtain animation index.');\n }\n\n styleTag.sheet?.deleteRule(currentAnimationIndex);\n animationNameList.splice(currentAnimationIndex, 1);\n animationNameToIndex.delete(animationName);\n\n for (let i = currentAnimationIndex; i < animationNameList.length; ++i) {\n const nextAnimationName = animationNameList[i];\n const nextAnimationIndex = animationNameToIndex.get(nextAnimationName);\n\n if (nextAnimationIndex === undefined) {\n throw new Error('[Reanimated] Failed to obtain animation index.');\n }\n\n animationNameToIndex.set(animationNameList[i], nextAnimationIndex - 1);\n }\n}\n\nconst timeoutScale = 1.25; // We use this value to enlarge timeout duration. It can prove useful if animation lags.\nconst frameDurationMs = 16; // Just an approximation.\nconst minimumFrames = 10;\n\nexport function scheduleAnimationCleanup(\n animationName: string,\n animationDuration: number\n) {\n // If duration is very short, we want to keep remove delay to at least 10 frames\n // In our case it is exactly 160/1099 s, which is approximately 0.15s\n const timeoutValue = Math.max(\n animationDuration * timeoutScale * 1000,\n animationDuration + frameDurationMs * minimumFrames\n );\n\n setTimeout(() => removeWebAnimation(animationName), timeoutValue);\n}\n\nfunction reattachElementToAncestor(child: ReanimatedHTMLElement, parent: Node) {\n const childSnapshot = snapshots.get(child);\n\n if (!childSnapshot) {\n console.error('[Reanimated] Failed to obtain snapshot.');\n return;\n }\n\n // We use that so we don't end up in infinite loop\n child.removedAfterAnimation = true;\n parent.appendChild(child);\n\n setDummyPosition(child, childSnapshot);\n\n const originalOnAnimationEnd = child.onanimationend;\n\n child.onanimationend = function (event: AnimationEvent) {\n parent.removeChild(child);\n\n // Given that this function overrides onAnimationEnd, it won't be null\n originalOnAnimationEnd?.call(this, event);\n };\n}\n\nfunction findDescendantWithExitingAnimation(\n node: ReanimatedHTMLElement,\n root: Node\n) {\n // Node could be something else than HTMLElement, for example TextNode (treated as plain text, not as HTML object),\n // therefore it won't have children prop and calling Array.from(node.children) will cause error.\n if (!(node instanceof HTMLElement)) {\n return;\n }\n\n if (node.reanimatedDummy && node.removedAfterAnimation === undefined) {\n reattachElementToAncestor(node, root);\n }\n\n const children = Array.from(node.children);\n\n for (let i = 0; i < children.length; ++i) {\n findDescendantWithExitingAnimation(\n children[i] as ReanimatedHTMLElement,\n root\n );\n }\n}\n\ntype FiberNodeKey = `__reactFiber${string}`;\n\ninterface FiberNode {\n memoizedProps?: {\n navigation?: unknown;\n };\n\n child?: FiberNode;\n}\n\ntype WithFiberNode = {\n [key: FiberNodeKey]: FiberNode;\n};\n\ntype MaybeWithFiberNode = Partial<WithFiberNode>;\n\nfunction checkIfScreenWasChanged(\n mutationTarget: ReanimatedHTMLElement & MaybeWithFiberNode\n) {\n let reactFiberKey: FiberNodeKey = '__reactFiber';\n\n for (const key of Object.keys(mutationTarget)) {\n if (key.startsWith('__reactFiber')) {\n reactFiberKey = key as FiberNodeKey;\n break;\n }\n }\n\n return (\n mutationTarget[reactFiberKey]?.child?.memoizedProps?.navigation !==\n undefined\n );\n}\n\nexport function addHTMLMutationObserver() {\n if (isObserverSet || !isWindowAvailable()) {\n return;\n }\n\n isObserverSet = true;\n\n const observer = new MutationObserver((mutationsList) => {\n const rootMutation = mutationsList[mutationsList.length - 1];\n\n if (\n checkIfScreenWasChanged(\n rootMutation.target as ReanimatedHTMLElement & MaybeWithFiberNode\n )\n ) {\n return;\n }\n\n for (let i = 0; i < rootMutation.removedNodes.length; ++i) {\n findDescendantWithExitingAnimation(\n rootMutation.removedNodes[i] as ReanimatedHTMLElement,\n rootMutation.target\n );\n }\n });\n\n observer.observe(document.body, { childList: true, subtree: true });\n}\n\nexport function areDOMRectsEqual(r1: DOMRect, r2: DOMRect) {\n // There are 4 more fields, but checking these should suffice\n return (\n r1.x === r2.x &&\n r1.y === r2.y &&\n r1.width === r2.width &&\n r1.height === r2.height\n );\n}\n"],"mappings":"AAAA,YAAY;;AAGZ,SAASA,iBAAiB,QAAQ,uBAAuB;AACzD,SAASC,gBAAgB,EAAEC,SAAS,QAAQ,kBAAkB;AAC9D,SAASC,UAAU,QAAQ,UAAU;AAGrC,MAAMC,4BAA4B,GAAG,wCAAwC;AAC7E,MAAMC,wBAAwB,GAAG,oCAAoC;;AAErE;AACA,MAAMC,oBAAoB,GAAG,IAAIC,GAAG,EAAkB;AACtD,MAAMC,iBAA2B,GAAG,EAAE;AAEtC,IAAIC,aAAa,GAAG,KAAK;;AAEzB;AACA;AACA;AACA;AACA,OAAO,SAASC,4BAA4BA,CAAA,EAAG;EAC7C,IACE,CAACV,iBAAiB,EAAE;EAAI;EACxBW,QAAQ,CAACC,cAAc,CAACR,4BAA4B,CAAC,KAAK,IAAI,EAC9D;IACA;EACF;EAEA,MAAMS,4BAA4B,GAAGF,QAAQ,CAACG,aAAa,CAAC,OAAO,CAAC;EACpED,4BAA4B,CAACE,EAAE,GAAGX,4BAA4B;EAE9DS,4BAA4B,CAACG,MAAM,GAAG,MAAM;IAC1C,IAAI,CAACH,4BAA4B,CAACI,KAAK,EAAE;MACvCC,OAAO,CAACC,KAAK,CACX,6DAA6D,CAC9D;MACD;IACF;IAEA,KAAK,MAAMC,aAAa,IAAIjB,UAAU,EAAE;MACtCU,4BAA4B,CA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AEFJ,QAAQ,CAACM,OAAO,CAAC/E,QAAQ,CAACgF,IAAI,EAAE;IAAEC,SAAS,EAAE,IAAI;IAAEC,OAAO,EAAE;EAAK,CAAC,CAAC;AACrE;AAEA,OAAO,SAASC,gBAAgBA,CAACC,EAAW,EAAEC,EAAW,EAAE;EACzD;EACA,OACED,EAAE,CAACE,CAAC,KAAKD,EAAE,CAACC,CAAC,IACbF,EAAE,CAACG,CAAC,KAAKF,EAAE,CAACE,CAAC,IACbH,EAAE,CAACI,KAAK,KAAKH,EAAE,CAACG,KAAK,IACrBJ,EAAE,CAACK,MAAM,KAAKJ,EAAE,CAACI,MAAM;AAE3B"}
|
|
1
|
+
{"version":3,"names":["isWindowAvailable","setDummyPosition","snapshots","Animations","PREDEFINED_WEB_ANIMATIONS_ID","CUSTOM_WEB_ANIMATIONS_ID","animationNameToIndex","Map","animationNameList","isObserverSet","configureWebLayoutAnimations","document","getElementById","predefinedAnimationsStyleTag","createElement","id","onload","sheet","console","error","animationName","insertRule","style","customAnimationsStyleTag","head","appendChild","insertWebAnimation","keyframe","styleTag","unshift","set","i","length","nextAnimationName","nextAnimationIndex","get","undefined","Error","removeWebAnimation","_styleTag$sheet","currentAnimationIndex","deleteRule","splice","delete","timeoutScale","frameDurationMs","minimumFrames","scheduleAnimationCleanup","animationDuration","timeoutValue","Math","max","setTimeout","reattachElementToAncestor","child","parent","childSnapshot","removedAfterAnimation","originalOnAnimationEnd","onanimationend","event","removeChild","call","findDescendantWithExitingAnimation","node","root","HTMLElement","reanimatedDummy","children","Array","from","checkIfScreenWasChanged","mutationTarget","_mutationTarget$react","reactFiberKey","key","Object","keys","startsWith","memoizedProps","navigation","addHTMLMutationObserver","observer","MutationObserver","mutationsList","rootMutation","target","removedNodes","observe","body","childList","subtree","areDOMRectsEqual","r1","r2","x","y","width","height"],"sources":["domUtils.ts"],"sourcesContent":["'use strict';\n\nimport type { ReanimatedHTMLElement } from '../../js-reanimated';\nimport { isWindowAvailable } from '../../PlatformChecker';\nimport { setDummyPosition, snapshots } from './componentStyle';\nimport { Animations } from './config';\nimport type { AnimationNames } from './config';\n\nconst PREDEFINED_WEB_ANIMATIONS_ID = 'ReanimatedPredefinedWebAnimationsStyle';\nconst CUSTOM_WEB_ANIMATIONS_ID = 'ReanimatedCustomWebAnimationsStyle';\n\n// Since we cannot remove keyframe from DOM by its name, we have to store its id\nconst animationNameToIndex = new Map<string, number>();\nconst animationNameList: string[] = [];\n\nlet isObserverSet = false;\n\n/**\n * Creates `HTMLStyleElement`, inserts it into DOM and then inserts CSS rules into the stylesheet.\n * If style element already exists, nothing happens.\n */\nexport function configureWebLayoutAnimations() {\n if (\n !isWindowAvailable() || // Without this check SSR crashes because document is undefined (NextExample on CI)\n document.getElementById(PREDEFINED_WEB_ANIMATIONS_ID) !== null\n ) {\n return;\n }\n\n const predefinedAnimationsStyleTag = document.createElement('style');\n predefinedAnimationsStyleTag.id = PREDEFINED_WEB_ANIMATIONS_ID;\n\n predefinedAnimationsStyleTag.onload = () => {\n if (!predefinedAnimationsStyleTag.sheet) {\n console.error(\n '[Reanimated] Failed to create layout animations stylesheet.'\n );\n return;\n }\n\n for (const animationName in Animations) {\n predefinedAnimationsStyleTag.sheet.insertRule(\n Animations[animationName as AnimationNames].style\n );\n }\n };\n\n const customAnimationsStyleTag = document.createElement('style');\n customAnimationsStyleTag.id = CUSTOM_WEB_ANIMATIONS_ID;\n\n document.head.appendChild(predefinedAnimationsStyleTag);\n document.head.appendChild(customAnimationsStyleTag);\n}\n\nexport function insertWebAnimation(animationName: string, keyframe: string) {\n // Without this check SSR crashes because document is undefined (NextExample on CI)\n if (!isWindowAvailable()) {\n return;\n }\n\n const styleTag = document.getElementById(\n CUSTOM_WEB_ANIMATIONS_ID\n ) as HTMLStyleElement;\n\n if (!styleTag.sheet) {\n console.error(\n '[Reanimated] Failed to create layout animations stylesheet.'\n );\n return;\n }\n\n styleTag.sheet.insertRule(keyframe, 0);\n animationNameList.unshift(animationName);\n animationNameToIndex.set(animationName, 0);\n\n for (let i = 1; i < animationNameList.length; ++i) {\n const nextAnimationName = animationNameList[i];\n const nextAnimationIndex = animationNameToIndex.get(nextAnimationName);\n\n if (nextAnimationIndex === undefined) {\n throw new Error('[Reanimated] Failed to obtain animation index.');\n }\n\n animationNameToIndex.set(animationNameList[i], nextAnimationIndex + 1);\n }\n}\n\nfunction removeWebAnimation(animationName: string) {\n // Without this check SSR crashes because document is undefined (NextExample on CI)\n if (!isWindowAvailable()) {\n return;\n }\n\n const styleTag = document.getElementById(\n CUSTOM_WEB_ANIMATIONS_ID\n ) as HTMLStyleElement;\n\n const currentAnimationIndex = animationNameToIndex.get(animationName);\n\n if (currentAnimationIndex === undefined) {\n throw new Error('[Reanimated] Failed to obtain animation index.');\n }\n\n styleTag.sheet?.deleteRule(currentAnimationIndex);\n animationNameList.splice(currentAnimationIndex, 1);\n animationNameToIndex.delete(animationName);\n\n for (let i = currentAnimationIndex; i < animationNameList.length; ++i) {\n const nextAnimationName = animationNameList[i];\n const nextAnimationIndex = animationNameToIndex.get(nextAnimationName);\n\n if (nextAnimationIndex === undefined) {\n throw new Error('[Reanimated] Failed to obtain animation index.');\n }\n\n animationNameToIndex.set(animationNameList[i], nextAnimationIndex - 1);\n }\n}\n\nconst timeoutScale = 1.25; // We use this value to enlarge timeout duration. It can prove useful if animation lags.\nconst frameDurationMs = 16; // Just an approximation.\nconst minimumFrames = 10;\n\nexport function scheduleAnimationCleanup(\n animationName: string,\n animationDuration: number\n) {\n // If duration is very short, we want to keep remove delay to at least 10 frames\n // In our case it is exactly 160/1099 s, which is approximately 0.15s\n const timeoutValue = Math.max(\n animationDuration * timeoutScale * 1000,\n animationDuration + frameDurationMs * minimumFrames\n );\n\n setTimeout(() => removeWebAnimation(animationName), timeoutValue);\n}\n\nfunction reattachElementToAncestor(child: ReanimatedHTMLElement, parent: Node) {\n const childSnapshot = snapshots.get(child);\n\n if (!childSnapshot) {\n console.error('[Reanimated] Failed to obtain snapshot.');\n return;\n }\n\n // We use that so we don't end up in infinite loop\n child.removedAfterAnimation = true;\n parent.appendChild(child);\n\n setDummyPosition(child, childSnapshot);\n\n const originalOnAnimationEnd = child.onanimationend;\n\n child.onanimationend = function (event: AnimationEvent) {\n parent.removeChild(child);\n\n // Given that this function overrides onAnimationEnd, it won't be null\n originalOnAnimationEnd?.call(this, event);\n };\n}\n\nfunction findDescendantWithExitingAnimation(\n node: ReanimatedHTMLElement,\n root: Node\n) {\n // Node could be something else than HTMLElement, for example TextNode (treated as plain text, not as HTML object),\n // therefore it won't have children prop and calling Array.from(node.children) will cause error.\n if (!(node instanceof HTMLElement)) {\n return;\n }\n\n if (node.reanimatedDummy && node.removedAfterAnimation === undefined) {\n reattachElementToAncestor(node, root);\n }\n\n const children = Array.from(node.children);\n\n for (let i = 0; i < children.length; ++i) {\n findDescendantWithExitingAnimation(\n children[i] as ReanimatedHTMLElement,\n root\n );\n }\n}\n\ntype FiberNodeKey = `__reactFiber${string}`;\n\ninterface FiberNode {\n memoizedProps?: {\n navigation?: unknown;\n };\n\n child?: FiberNode;\n}\n\ntype WithFiberNode = {\n [key: FiberNodeKey]: FiberNode;\n};\n\ntype MaybeWithFiberNode = Partial<WithFiberNode>;\n\nfunction checkIfScreenWasChanged(\n mutationTarget: ReanimatedHTMLElement & MaybeWithFiberNode\n) {\n let reactFiberKey: FiberNodeKey = '__reactFiber';\n\n for (const key of Object.keys(mutationTarget)) {\n if (key.startsWith('__reactFiber')) {\n reactFiberKey = key as FiberNodeKey;\n break;\n }\n }\n\n return (\n mutationTarget[reactFiberKey]?.child?.memoizedProps?.navigation !==\n undefined\n );\n}\n\nexport function addHTMLMutationObserver() {\n if (isObserverSet || !isWindowAvailable()) {\n return;\n }\n\n isObserverSet = true;\n\n const observer = new MutationObserver((mutationsList) => {\n const rootMutation = mutationsList[mutationsList.length - 1];\n\n if (\n checkIfScreenWasChanged(\n rootMutation.target as ReanimatedHTMLElement & MaybeWithFiberNode\n )\n ) {\n return;\n }\n\n for (let i = 0; i < rootMutation.removedNodes.length; ++i) {\n findDescendantWithExitingAnimation(\n rootMutation.removedNodes[i] as ReanimatedHTMLElement,\n rootMutation.target\n );\n }\n });\n\n observer.observe(document.body, { childList: true, subtree: true });\n}\n\nexport function areDOMRectsEqual(r1: DOMRect, r2: DOMRect) {\n // There are 4 more fields, but checking these should suffice\n return (\n r1.x === r2.x &&\n r1.y === r2.y &&\n r1.width === r2.width &&\n r1.height === r2.height\n );\n}\n"],"mappings":"AAAA,YAAY;;AAGZ,SAASA,iBAAiB,QAAQ,uBAAuB;AACzD,SAASC,gBAAgB,EAAEC,SAAS,QAAQ,kBAAkB;AAC9D,SAASC,UAAU,QAAQ,UAAU;AAGrC,MAAMC,4BAA4B,GAAG,wCAAwC;AAC7E,MAAMC,wBAAwB,GAAG,oCAAoC;;AAErE;AACA,MAAMC,oBAAoB,GAAG,IAAIC,GAAG,CAAiB,CAAC;AACtD,MAAMC,iBAA2B,GAAG,EAAE;AAEtC,IAAIC,aAAa,GAAG,KAAK;;AAEzB;AACA;AACA;AACA;AACA,OAAO,SAASC,4BAA4BA,CAAA,EAAG;EAC7C,IACE,CAACV,iBAAiB,CAAC,CAAC;EAAI;EACxBW,QAAQ,CAACC,cAAc,CAACR,4BAA4B,CAAC,KAAK,IAAI,EAC9D;IACA;EACF;EAEA,MAAMS,4BAA4B,GAAGF,QAAQ,CAACG,aAAa,CAAC,OAAO,CAAC;EACpED,4BAA4B,CAACE,EAAE,GAAGX,4BAA4B;EAE9DS,4BAA4B,CAACG,MAAM,GAAG,MAAM;IAC1C,IAAI,CAACH,4BAA4B,CAACI,KAAK,EAAE;MACvCC,OAAO,CAACC,KAAK,CACX,6DACF,CAAC;MACD;IACF;IAEA,KAAK,MAAMC,aAAa,IAAIjB,UAAU,EAAE;MACtCU,4BAA4B,CAACI,KAAK,CAACI,UAAU,CAC3ClB,UAAU,CAACiB,aAAa,CAAmB,CAACE,KAC9C,CAAC;IACH;EACF,CAAC;EAED,MAAMC,wBAAwB,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A,OAAO,SAASC,gBAAgBA,CAACC,EAAW,EAAEC,EAAW,EAAE;EACzD;EACA,OACED,EAAE,CAACE,CAAC,KAAKD,EAAE,CAACC,CAAC,IACbF,EAAE,CAACG,CAAC,KAAKF,EAAE,CAACE,CAAC,IACbH,EAAE,CAACI,KAAK,KAAKH,EAAE,CAACG,KAAK,IACrBJ,EAAE,CAACK,MAAM,KAAKJ,EAAE,CAACI,MAAM;AAE3B","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["startWebLayoutAnimation","tryActivateLayoutTransition","getReducedMotionFromConfig","saveSnapshot","configureWebLayoutAnimations"],"sources":["index.ts"],"sourcesContent":["'use strict';\n\nexport {\n startWebLayoutAnimation,\n tryActivateLayoutTransition,\n} from './animationsManager';\n\nexport { getReducedMotionFromConfig, saveSnapshot } from './componentUtils';\n\nexport { configureWebLayoutAnimations } from './domUtils';\n"],"mappings":"AAAA,YAAY;;AAEZ,SACEA,uBAAuB,EACvBC,2BAA2B,QACtB,qBAAqB;AAE5B,SAASC,0BAA0B,EAAEC,YAAY,QAAQ,kBAAkB;AAE3E,SAASC,4BAA4B,QAAQ,YAAY"}
|
|
1
|
+
{"version":3,"names":["startWebLayoutAnimation","tryActivateLayoutTransition","getReducedMotionFromConfig","saveSnapshot","configureWebLayoutAnimations"],"sources":["index.ts"],"sourcesContent":["'use strict';\n\nexport {\n startWebLayoutAnimation,\n tryActivateLayoutTransition,\n} from './animationsManager';\n\nexport { getReducedMotionFromConfig, saveSnapshot } from './componentUtils';\n\nexport { configureWebLayoutAnimations } from './domUtils';\n"],"mappings":"AAAA,YAAY;;AAEZ,SACEA,uBAAuB,EACvBC,2BAA2B,QACtB,qBAAqB;AAE5B,SAASC,0BAA0B,EAAEC,YAAY,QAAQ,kBAAkB;AAE3E,SAASC,4BAA4B,QAAQ,YAAY","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["FadingTransition","name","transitionData","translateX","translateY","scaleX","scaleY","fadingTransition","style","opacity","transform","scale","duration"],"sources":["Fading.web.ts"],"sourcesContent":["'use strict';\nimport type { TransitionData } from '../animationParser';\n\nexport function FadingTransition(name: string, transitionData: TransitionData) {\n const { translateX, translateY, scaleX, scaleY } = transitionData;\n\n const fadingTransition = {\n name,\n style: {\n 0: {\n opacity: 1,\n transform: [\n {\n translateX: `${translateX}px`,\n translateY: `${translateY}px`,\n scale: `${scaleX},${scaleY}`,\n },\n ],\n },\n 20: {\n opacity: 0,\n transform: [\n {\n translateX: `${translateX}px`,\n translateY: `${translateY}px`,\n scale: `${scaleX},${scaleY}`,\n },\n ],\n },\n 60: {\n opacity: 0,\n transform: [\n {\n translateX: '0px',\n translateY: '0px',\n scale: `1,1`,\n },\n ],\n },\n 100: {\n opacity: 1,\n transform: [\n {\n translateX: '0px',\n translateY: '0px',\n scale: `1,1`,\n },\n ],\n },\n },\n duration: 300,\n };\n\n return fadingTransition;\n}\n"],"mappings":"AAAA,YAAY;;AAGZ,OAAO,SAASA,gBAAgBA,CAACC,IAAY,EAAEC,cAA8B,EAAE;EAC7E,MAAM;IAAEC,UAAU;IAAEC,UAAU;IAAEC,MAAM;IAAEC;EAAO,CAAC,GAAGJ,cAAc;EAEjE,MAAMK,gBAAgB,GAAG;IACvBN,IAAI;IACJO,KAAK,EAAE;MACL,CAAC,EAAE;QACDC,OAAO,EAAE,CAAC;QACVC,SAAS,EAAE,CACT;UACEP,UAAU,EAAG,GAAEA,UAAW,IAAG;UAC7BC,UAAU,EAAG,GAAEA,UAAW,IAAG;UAC7BO,KAAK,EAAG,GAAEN,MAAO,IAAGC,MAAO;QAC7B,CAAC;MAEL,CAAC;MACD,EAAE,EAAE;QACFG,OAAO,EAAE,CAAC;QACVC,SAAS,EAAE,CACT;UACEP,UAAU,EAAG,GAAEA,UAAW,IAAG;UAC7BC,UAAU,EAAG,GAAEA,UAAW,IAAG;UAC7BO,KAAK,EAAG,GAAEN,MAAO,IAAGC,MAAO;QAC7B,CAAC;MAEL,CAAC;MACD,EAAE,EAAE;QACFG,OAAO,EAAE,CAAC;QACVC,SAAS,EAAE,CACT;UACEP,UAAU,EAAE,KAAK;UACjBC,UAAU,EAAE,KAAK;UACjBO,KAAK,EAAG;QACV,CAAC;MAEL,CAAC;MACD,GAAG,EAAE;QACHF,OAAO,EAAE,CAAC;QACVC,SAAS,EAAE,CACT;UACEP,UAAU,EAAE,KAAK;UACjBC,UAAU,EAAE,KAAK;UACjBO,KAAK,EAAG;QACV,CAAC;MAEL;IACF,CAAC;IACDC,QAAQ,EAAE;EACZ,CAAC;EAED,OAAOL,gBAAgB;AACzB"}
|
|
1
|
+
{"version":3,"names":["FadingTransition","name","transitionData","translateX","translateY","scaleX","scaleY","fadingTransition","style","opacity","transform","scale","duration"],"sources":["Fading.web.ts"],"sourcesContent":["'use strict';\nimport type { TransitionData } from '../animationParser';\n\nexport function FadingTransition(name: string, transitionData: TransitionData) {\n const { translateX, translateY, scaleX, scaleY } = transitionData;\n\n const fadingTransition = {\n name,\n style: {\n 0: {\n opacity: 1,\n transform: [\n {\n translateX: `${translateX}px`,\n translateY: `${translateY}px`,\n scale: `${scaleX},${scaleY}`,\n },\n ],\n },\n 20: {\n opacity: 0,\n transform: [\n {\n translateX: `${translateX}px`,\n translateY: `${translateY}px`,\n scale: `${scaleX},${scaleY}`,\n },\n ],\n },\n 60: {\n opacity: 0,\n transform: [\n {\n translateX: '0px',\n translateY: '0px',\n scale: `1,1`,\n },\n ],\n },\n 100: {\n opacity: 1,\n transform: [\n {\n translateX: '0px',\n translateY: '0px',\n scale: `1,1`,\n },\n ],\n },\n },\n duration: 300,\n };\n\n return fadingTransition;\n}\n"],"mappings":"AAAA,YAAY;;AAGZ,OAAO,SAASA,gBAAgBA,CAACC,IAAY,EAAEC,cAA8B,EAAE;EAC7E,MAAM;IAAEC,UAAU;IAAEC,UAAU;IAAEC,MAAM;IAAEC;EAAO,CAAC,GAAGJ,cAAc;EAEjE,MAAMK,gBAAgB,GAAG;IACvBN,IAAI;IACJO,KAAK,EAAE;MACL,CAAC,EAAE;QACDC,OAAO,EAAE,CAAC;QACVC,SAAS,EAAE,CACT;UACEP,UAAU,EAAG,GAAEA,UAAW,IAAG;UAC7BC,UAAU,EAAG,GAAEA,UAAW,IAAG;UAC7BO,KAAK,EAAG,GAAEN,MAAO,IAAGC,MAAO;QAC7B,CAAC;MAEL,CAAC;MACD,EAAE,EAAE;QACFG,OAAO,EAAE,CAAC;QACVC,SAAS,EAAE,CACT;UACEP,UAAU,EAAG,GAAEA,UAAW,IAAG;UAC7BC,UAAU,EAAG,GAAEA,UAAW,IAAG;UAC7BO,KAAK,EAAG,GAAEN,MAAO,IAAGC,MAAO;QAC7B,CAAC;MAEL,CAAC;MACD,EAAE,EAAE;QACFG,OAAO,EAAE,CAAC;QACVC,SAAS,EAAE,CACT;UACEP,UAAU,EAAE,KAAK;UACjBC,UAAU,EAAE,KAAK;UACjBO,KAAK,EAAG;QACV,CAAC;MAEL,CAAC;MACD,GAAG,EAAE;QACHF,OAAO,EAAE,CAAC;QACVC,SAAS,EAAE,CACT;UACEP,UAAU,EAAE,KAAK;UACjBC,UAAU,EAAE,KAAK;UACjBO,KAAK,EAAG;QACV,CAAC;MAEL;IACF,CAAC;IACDC,QAAQ,EAAE;EACZ,CAAC;EAED,OAAOL,gBAAgB;AACzB","ignoreList":[]}
|