react-native-reanimated 3.9.0-rc.0 → 3.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Common/cpp/Fabric/ShadowTreeCloner.cpp +2 -1
- package/Common/cpp/NativeModules/NativeReanimatedModule.cpp +11 -4
- package/android/src/main/java/com/swmansion/reanimated/NodesManager.java +5 -3
- package/apple/REAModule.mm +14 -29
- package/apple/REANodesManager.mm +7 -6
- package/lib/module/Animated.js.map +1 -1
- package/lib/module/ConfigHelper.js.map +1 -1
- package/lib/module/animationBuilder.js.map +1 -1
- package/lib/module/createAnimatedComponent/InlinePropManager.js +2 -2
- package/lib/module/createAnimatedComponent/InlinePropManager.js.map +1 -1
- package/lib/module/createAnimatedComponent/JSPropsUpdater.js +4 -4
- package/lib/module/createAnimatedComponent/JSPropsUpdater.js.map +1 -1
- package/lib/module/createAnimatedComponent/JSPropsUpdater.web.js.map +1 -1
- package/lib/module/createAnimatedComponent/PropsFilter.js +5 -5
- package/lib/module/createAnimatedComponent/PropsFilter.js.map +1 -1
- package/lib/module/createAnimatedComponent/commonTypes.js.map +1 -1
- package/lib/module/createAnimatedComponent/createAnimatedComponent.js +33 -33
- package/lib/module/createAnimatedComponent/createAnimatedComponent.js.map +1 -1
- package/lib/module/createAnimatedComponent/getViewInfo.js +2 -2
- package/lib/module/createAnimatedComponent/getViewInfo.js.map +1 -1
- package/lib/module/createAnimatedComponent/index.js.map +1 -1
- package/lib/module/createAnimatedComponent/setAndForwardRef.js +4 -5
- package/lib/module/createAnimatedComponent/setAndForwardRef.js.map +1 -1
- package/lib/module/createAnimatedComponent/utils.js.map +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/index.web.js +1 -2
- package/lib/module/index.web.js.map +1 -1
- package/lib/module/mock.js +3 -8
- package/lib/module/mock.js.map +1 -1
- package/lib/module/propsAllowlists.js.map +1 -1
- package/lib/module/reanimated2/Bezier.js.map +1 -1
- package/lib/module/reanimated2/Colors.js +4 -11
- package/lib/module/reanimated2/Colors.js.map +1 -1
- package/lib/module/reanimated2/Easing.js +3 -7
- package/lib/module/reanimated2/Easing.js.map +1 -1
- package/lib/module/reanimated2/NativeReanimated/NativeReanimated.js +3 -3
- 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 +1 -0
- 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.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.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.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.map +1 -1
- package/lib/module/reanimated2/commonTypes.js +2 -0
- 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 +3 -4
- package/lib/module/reanimated2/component/PerformanceMonitor.js.map +1 -1
- 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 +2 -4
- package/lib/module/reanimated2/core.js.map +1 -1
- package/lib/module/reanimated2/errors.js +7 -8
- package/lib/module/reanimated2/errors.js.map +1 -1
- package/lib/module/reanimated2/fabricUtils.js +4 -4
- 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 +1 -1
- 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 +14 -6
- 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.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 +4 -5
- 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 +8 -11
- package/lib/module/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/animationBuilder/Keyframe.js +8 -9
- 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 +1 -2
- 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 +4 -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 +4 -6
- package/lib/module/reanimated2/layoutReanimation/sharedTransitions/ProgressTransitionManager.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/sharedTransitions/SharedTransition.js +4 -6
- 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.map +1 -1
- package/lib/module/reanimated2/screenTransition/animationManager.js.map +1 -1
- package/lib/module/reanimated2/screenTransition/commonTypes.js.map +1 -1
- package/lib/module/reanimated2/screenTransition/index.js.map +1 -1
- package/lib/module/reanimated2/screenTransition/presets.js.map +1 -1
- package/lib/module/reanimated2/screenTransition/styleUpdater.js.map +1 -1
- package/lib/module/reanimated2/screenTransition/swipeSimulator.js +1 -1
- package/lib/module/reanimated2/screenTransition/swipeSimulator.js.map +1 -1
- package/lib/module/reanimated2/shareableMappingCache.js.map +1 -1
- package/lib/module/reanimated2/shareables.js +2 -4
- 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.map +1 -1
- package/lib/module/specs/NativeReanimatedModule.js.map +1 -1
- package/lib/typescript/reanimated2/WorkletEventHandler.d.ts +16 -9
- package/lib/typescript/reanimated2/component/LayoutAnimationConfig.d.ts +1 -1
- package/lib/typescript/reanimated2/component/PerformanceMonitor.d.ts +2 -1
- package/lib/typescript/reanimated2/hook/commonTypes.d.ts +5 -0
- package/lib/typescript/reanimated2/hook/useEvent.d.ts +2 -3
- package/lib/typescript/reanimated2/platform-specific/jsVersion.d.ts +1 -1
- package/package.json +18 -14
- package/plugin/build/plugin.js +7 -2
- package/src/createAnimatedComponent/PropsFilter.tsx +1 -1
- package/src/createAnimatedComponent/createAnimatedComponent.tsx +29 -33
- package/src/reanimated2/WorkletEventHandler.ts +98 -39
- package/src/reanimated2/animation/styleAnimation.ts +8 -6
- package/src/reanimated2/hook/commonTypes.ts +9 -0
- package/src/reanimated2/hook/useEvent.ts +4 -4
- package/src/reanimated2/hook/useScrollViewOffset.ts +21 -5
- package/src/reanimated2/js-reanimated/JSReanimated.ts +6 -3
- 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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","
|
|
1
|
+
{"version":3,"names":["_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","r","e","Symbol","toPrimitive","call","TypeError","String","Number","withSequence","withTiming","BaseAnimationBuilder","FadingTransition","constructor","args","delayFunction","getDelayFunction","callback","callbackV","delay","getDelay","duration","durationV","values","initialValues","opacity","originX","currentOriginX","originY","currentOriginY","width","currentWidth","height","currentHeight","animations","targetOriginX","targetOriginY","targetWidth","targetHeight","createInstance"],"sources":["FadingTransition.ts"],"sourcesContent":["'use strict';\nimport { withSequence, withTiming } from '../../animation';\nimport type {\n ILayoutAnimationBuilder,\n LayoutAnimationFunction,\n} from '../animationBuilder/commonTypes';\nimport { BaseAnimationBuilder } from '../animationBuilder';\n\n/**\n * Fades out components from one position and shows them in another. You can modify the behavior by chaining methods like `.duration(500)` or `.delay(500)`.\n *\n * You pass it to the `layout` prop on [an Animated component](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/glossary#animated-component).\n *\n * @see https://docs.swmansion.com/react-native-reanimated/docs/layout-animations/layout-transitions#fading-transition\n */\nexport class FadingTransition\n extends BaseAnimationBuilder\n implements ILayoutAnimationBuilder\n{\n static createInstance<T extends typeof BaseAnimationBuilder>(\n this: T\n ): InstanceType<T> {\n return new FadingTransition() as InstanceType<T>;\n }\n\n build = (): LayoutAnimationFunction => {\n const delayFunction = this.getDelayFunction();\n const callback = this.callbackV;\n const delay = this.getDelay();\n const duration = this.durationV ?? 500;\n\n return (values) => {\n 'worklet';\n return {\n initialValues: {\n opacity: 1,\n originX: values.currentOriginX,\n originY: values.currentOriginY,\n width: values.currentWidth,\n height: values.currentHeight,\n },\n animations: {\n opacity: delayFunction(\n delay,\n withSequence(\n withTiming(0, { duration }),\n withTiming(1, { duration })\n )\n ),\n originX: delayFunction(\n delay + duration,\n withTiming(values.targetOriginX, { duration: 50 })\n ),\n originY: delayFunction(\n delay + duration,\n withTiming(values.targetOriginY, { duration: 50 })\n ),\n width: delayFunction(\n delay + duration,\n withTiming(values.targetWidth, { duration: 50 })\n ),\n height: delayFunction(\n delay + duration,\n withTiming(values.targetHeight, { duration: 50 })\n ),\n },\n callback,\n };\n };\n };\n}\n"],"mappings":"AAAA,YAAY;;AAAC,SAAAA,gBAAAC,GAAA,EAAAC,GAAA,EAAAC,KAAA,IAAAD,GAAA,GAAAE,cAAA,CAAAF,GAAA,OAAAA,GAAA,IAAAD,GAAA,IAAAI,MAAA,CAAAC,cAAA,CAAAL,GAAA,EAAAC,GAAA,IAAAC,KAAA,EAAAA,KAAA,EAAAI,UAAA,QAAAC,YAAA,QAAAC,QAAA,oBAAAR,GAAA,CAAAC,GAAA,IAAAC,KAAA,WAAAF,GAAA;AAAA,SAAAG,eAAAM,CAAA,QAAAC,CAAA,GAAAC,YAAA,CAAAF,CAAA,uCAAAC,CAAA,GAAAA,CAAA,GAAAA,CAAA;AAAA,SAAAC,aAAAF,CAAA,EAAAG,CAAA,2BAAAH,CAAA,KAAAA,CAAA,SAAAA,CAAA,MAAAI,CAAA,GAAAJ,CAAA,CAAAK,MAAA,CAAAC,WAAA,kBAAAF,CAAA,QAAAH,CAAA,GAAAG,CAAA,CAAAG,IAAA,CAAAP,CAAA,EAAAG,CAAA,uCAAAF,CAAA,SAAAA,CAAA,YAAAO,SAAA,yEAAAL,CAAA,GAAAM,MAAA,GAAAC,MAAA,EAAAV,CAAA;AACb,SAASW,YAAY,EAAEC,UAAU,QAAQ,iBAAiB;AAK1D,SAASC,oBAAoB,QAAQ,qBAAqB;;AAE1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,gBAAgB,SACnBD,oBAAoB,CAE9B;E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,CAACa,MAAM,CAACe,YAAY,EAAE;cAAEjB,QAAQ,EAAE;YAAG,CAAC,CAClD;UACF,CAAC;UACDJ;QACF,CAAC;MACH,CAAC;IACH,CAAC;EAAA;EAlDD,OAAOsB,cAAcA,CAAA,EAEF;IACjB,OAAO,IAAI3B,gBAAgB,CAAC,CAAC;EAC/B;AA+CF","ignoreList":[]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
4
|
-
function _toPropertyKey(
|
|
5
|
-
function _toPrimitive(
|
|
4
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
5
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
6
6
|
import { withSequence, withTiming } from '../../animation';
|
|
7
7
|
import { Easing } from '../../Easing';
|
|
8
8
|
import { BaseAnimationBuilder } from '../animationBuilder';
|
|
@@ -15,8 +15,8 @@ import { BaseAnimationBuilder } from '../animationBuilder';
|
|
|
15
15
|
* @see https://docs.swmansion.com/react-native-reanimated/docs/layout-animations/layout-transitions#jumping-transition
|
|
16
16
|
*/
|
|
17
17
|
export class JumpingTransition extends BaseAnimationBuilder {
|
|
18
|
-
constructor() {
|
|
19
|
-
super(...
|
|
18
|
+
constructor(...args) {
|
|
19
|
+
super(...args);
|
|
20
20
|
_defineProperty(this, "build", () => {
|
|
21
21
|
const delayFunction = this.getDelayFunction();
|
|
22
22
|
const callback = this.callbackV;
|
package/lib/module/reanimated2/layoutReanimation/defaultTransitions/JumpingTransition.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","
|
|
1
|
+
{"version":3,"names":["_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","r","e","Symbol","toPrimitive","call","TypeError","String","Number","withSequence","withTiming","Easing","BaseAnimationBuilder","JumpingTransition","constructor","args","delayFunction","getDelayFunction","callback","callbackV","delay","getDelay","duration","durationV","config","values","d","Math","max","abs","targetOriginX","currentOriginX","targetOriginY","currentOriginY","initialValues","originX","originY","width","currentWidth","height","currentHeight","animations","min","easing","out","exp","bounce","targetWidth","targetHeight","createInstance"],"sources":["JumpingTransition.ts"],"sourcesContent":["'use strict';\nimport type {\n ILayoutAnimationBuilder,\n LayoutAnimationFunction,\n} from '../animationBuilder/commonTypes';\nimport { withSequence, withTiming } from '../../animation';\nimport { Easing } from '../../Easing';\nimport { BaseAnimationBuilder } from '../animationBuilder';\n\n/**\n * Layout jumps - quite literally - from one position to another. You can modify the behavior by chaining methods like `.springify()` or `.duration(500)`.\n *\n * You pass it to the `layout` prop on [an Animated component](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/glossary#animated-component).\n *\n * @see https://docs.swmansion.com/react-native-reanimated/docs/layout-animations/layout-transitions#jumping-transition\n */\nexport class JumpingTransition\n extends BaseAnimationBuilder\n implements ILayoutAnimationBuilder\n{\n static createInstance<T extends typeof BaseAnimationBuilder>(\n this: T\n ): InstanceType<T> {\n return new JumpingTransition() as InstanceType<T>;\n }\n\n build = (): LayoutAnimationFunction => {\n const delayFunction = this.getDelayFunction();\n const callback = this.callbackV;\n const delay = this.getDelay();\n const duration = (this.durationV ?? 300) / 2;\n const config = { duration: duration * 2 };\n\n return (values) => {\n 'worklet';\n const d = Math.max(\n Math.abs(values.targetOriginX - values.currentOriginX),\n Math.abs(values.targetOriginY - values.currentOriginY)\n );\n return {\n initialValues: {\n originX: values.currentOriginX,\n originY: values.currentOriginY,\n width: values.currentWidth,\n height: values.currentHeight,\n },\n animations: {\n originX: delayFunction(\n delay,\n withTiming(values.targetOriginX, config)\n ),\n originY: delayFunction(\n delay,\n withSequence(\n withTiming(\n Math.min(values.targetOriginY, values.currentOriginY) - d,\n {\n duration,\n easing: Easing.out(Easing.exp),\n }\n ),\n withTiming(values.targetOriginY, {\n ...config,\n duration,\n easing: Easing.bounce,\n })\n )\n ),\n width: delayFunction(delay, withTiming(values.targetWidth, config)),\n height: delayFunction(delay, withTiming(values.targetHeight, config)),\n },\n callback,\n };\n };\n };\n}\n"],"mappings":"AAAA,YAAY;;AAAC,SAAAA,gBAAAC,GAAA,EAAAC,GAAA,EAAAC,KAAA,IAAAD,GAAA,GAAAE,cAAA,CAAAF,GAAA,OAAAA,GAAA,IAAAD,GAAA,IAAAI,MAAA,CAAAC,cAAA,CAAAL,GAAA,EAAAC,GAAA,IAAAC,KAAA,EAAAA,KAAA,EAAAI,UAAA,QAAAC,YAAA,QAAAC,QAAA,oBAAAR,GAAA,CAAAC,GAAA,IAAAC,KAAA,WAAAF,GAAA;AAAA,SAAAG,eAAAM,CAAA,QAAAC,CAAA,GAAAC,YAAA,CAAAF,CAAA,uCAAAC,CAAA,GAAAA,CAAA,GAAAA,CAAA;AAAA,SAAAC,aAAAF,CAAA,EAAAG,CAAA,2BAAAH,CAAA,KAAAA,CAAA,SAAAA,CAAA,MAAAI,CAAA,GAAAJ,CAAA,CAAAK,MAAA,CAAAC,WAAA,kBAAAF,CAAA,QAAAH,CAAA,GAAAG,CAAA,CAAAG,IAAA,CAAAP,CAAA,EAAAG,CAAA,uCAAAF,CAAA,SAAAA,CAAA,YAAAO,SAAA,yEAAAL,CAAA,GAAAM,MAAA,GAAAC,MAAA,EAAAV,CAAA;AAKb,SAASW,YAAY,EAAEC,UAAU,QAAQ,iBAAiB;AAC1D,SAASC,MAAM,QAAQ,cAAc;AACrC,SAASC,oBAAoB,QAAQ,qBAAqB;;AAE1D;AACA;AACA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CAACiC,GAAG,CAACjC,MAAM,CAACkC,GAAG;YAC/B,CACF,CAAC,EACDnC,UAAU,CAACe,MAAM,CAACO,aAAa,EAAE;cAC/B,GAAGR,MAAM;cACTF,QAAQ;cACRqB,MAAM,EAAEhC,MAAM,CAACmC;YACjB,CAAC,CACH,CACF,CAAC;YACDT,KAAK,EAAErB,aAAa,CAACI,KAAK,EAAEV,UAAU,CAACe,MAAM,CAACsB,WAAW,EAAEvB,MAAM,CAAC,CAAC;YACnEe,MAAM,EAAEvB,aAAa,CAACI,KAAK,EAAEV,UAAU,CAACe,MAAM,CAACuB,YAAY,EAAExB,MAAM,CAAC;UACtE,CAAC;UACDN;QACF,CAAC;MACH,CAAC;IACH,CAAC;EAAA;EAtDD,OAAO+B,cAAcA,CAAA,EAEF;IACjB,OAAO,IAAIpC,iBAAiB,CAAC,CAAC;EAChC;AAmDF","ignoreList":[]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
4
|
-
function _toPropertyKey(
|
|
5
|
-
function _toPrimitive(
|
|
4
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
5
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
6
6
|
import { ComplexAnimationBuilder } from '../animationBuilder';
|
|
7
7
|
/**
|
|
8
8
|
* Linearly transforms the layout from one position to another. You can modify the behavior by chaining methods like `.springify()` or `.duration(500)`.
|
|
@@ -12,8 +12,8 @@ import { ComplexAnimationBuilder } from '../animationBuilder';
|
|
|
12
12
|
* @see https://docs.swmansion.com/react-native-reanimated/docs/layout-animations/layout-transitions#linear-transition
|
|
13
13
|
*/
|
|
14
14
|
export class LinearTransition extends ComplexAnimationBuilder {
|
|
15
|
-
constructor() {
|
|
16
|
-
super(...
|
|
15
|
+
constructor(...args) {
|
|
16
|
+
super(...args);
|
|
17
17
|
_defineProperty(this, "build", () => {
|
|
18
18
|
const delayFunction = this.getDelayFunction();
|
|
19
19
|
const [animation, config] = this.getAnimationAndConfig();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","
|
|
1
|
+
{"version":3,"names":["_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","r","e","Symbol","toPrimitive","call","TypeError","String","Number","ComplexAnimationBuilder","LinearTransition","constructor","args","delayFunction","getDelayFunction","animation","config","getAnimationAndConfig","callback","callbackV","delay","getDelay","values","initialValues","originX","currentOriginX","originY","currentOriginY","width","currentWidth","height","currentHeight","animations","targetOriginX","targetOriginY","targetWidth","targetHeight","createInstance","Layout"],"sources":["LinearTransition.ts"],"sourcesContent":["'use strict';\nimport type { BaseAnimationBuilder } from '../animationBuilder';\nimport { ComplexAnimationBuilder } from '../animationBuilder';\nimport type {\n ILayoutAnimationBuilder,\n LayoutAnimationFunction,\n} from '../animationBuilder/commonTypes';\n\n/**\n * Linearly transforms the layout from one position to another. You can modify the behavior by chaining methods like `.springify()` or `.duration(500)`.\n *\n * You pass it to the `layout` prop on [an Animated component](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/glossary#animated-component).\n *\n * @see https://docs.swmansion.com/react-native-reanimated/docs/layout-animations/layout-transitions#linear-transition\n */\nexport class LinearTransition\n extends ComplexAnimationBuilder\n implements ILayoutAnimationBuilder\n{\n static createInstance<T extends typeof BaseAnimationBuilder>(\n this: T\n ): InstanceType<T> {\n return new LinearTransition() as InstanceType<T>;\n }\n\n build = (): LayoutAnimationFunction => {\n const delayFunction = this.getDelayFunction();\n const [animation, config] = this.getAnimationAndConfig();\n const callback = this.callbackV;\n const delay = this.getDelay();\n\n return (values) => {\n 'worklet';\n return {\n initialValues: {\n originX: values.currentOriginX,\n originY: values.currentOriginY,\n width: values.currentWidth,\n height: values.currentHeight,\n },\n animations: {\n originX: delayFunction(\n delay,\n animation(values.targetOriginX, config)\n ),\n originY: delayFunction(\n delay,\n animation(values.targetOriginY, config)\n ),\n width: delayFunction(delay, animation(values.targetWidth, config)),\n height: delayFunction(delay, animation(values.targetHeight, config)),\n },\n callback,\n };\n };\n };\n}\n\n/**\n * @deprecated Please use {@link LinearTransition} instead.\n */\nexport const Layout = LinearTransition;\n"],"mappings":"AAAA,YAAY;;AAAC,SAAAA,gBAAAC,GAAA,EAAAC,GAAA,EAAAC,KAAA,IAAAD,GAAA,GAAAE,cAAA,CAAAF,GAAA,OAAAA,GAAA,IAAAD,GAAA,IAAAI,MAAA,CAAAC,cAAA,CAAAL,GAAA,EAAAC,GAAA,IAAAC,KAAA,EAAAA,KAAA,EAAAI,UAAA,QAAAC,YAAA,QAAAC,QAAA,oBAAAR,GAAA,CAAAC,GAAA,IAAAC,KAAA,WAAAF,GAAA;AAAA,SAAAG,eAAAM,CAAA,QAAAC,CAAA,GAAAC,YAAA,CAAAF,CAAA,uCAAAC,CAAA,GAAAA,CAAA,GAAAA,CAAA;AAAA,SAAAC,aAAAF,CAAA,EAAAG,CAAA,2BAAAH,CAAA,KAAAA,CAAA,SAAAA,CAAA,MAAAI,CAAA,GAAAJ,CAAA,CAAAK,MAAA,CAAAC,WAAA,kBAAAF,CAAA,QAAAH,CAAA,GAAAG,CAAA,CAAAG,IAAA,CAAAP,CAAA,EAAAG,CAAA,uCAAAF,CAAA,SAAAA,CAAA,YAAAO,SAAA,yEAAAL,CAAA,GAAAM,MAAA,GAAAC,MAAA,EAAAV,CAAA;AAEb,SAASW,uBAAuB,QAAQ,qBAAqB;AAM7D;AACA;AACA;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gBAAgB","ignoreList":[]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
4
|
-
function _toPropertyKey(
|
|
5
|
-
function _toPrimitive(
|
|
4
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
5
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
6
6
|
import { withSequence, withTiming } from '../../animation';
|
|
7
7
|
import { BaseAnimationBuilder } from '../animationBuilder';
|
|
8
8
|
|
|
@@ -14,8 +14,8 @@ import { BaseAnimationBuilder } from '../animationBuilder';
|
|
|
14
14
|
* @see https://docs.swmansion.com/react-native-reanimated/docs/layout-animations/layout-transitions#sequenced-transition
|
|
15
15
|
*/
|
|
16
16
|
export class SequencedTransition extends BaseAnimationBuilder {
|
|
17
|
-
constructor() {
|
|
18
|
-
super(...
|
|
17
|
+
constructor(...args) {
|
|
18
|
+
super(...args);
|
|
19
19
|
_defineProperty(this, "reversed", false);
|
|
20
20
|
_defineProperty(this, "build", () => {
|
|
21
21
|
const delayFunction = this.getDelayFunction();
|
package/lib/module/reanimated2/layoutReanimation/defaultTransitions/SequencedTransition.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","
|
|
1
|
+
{"version":3,"names":["_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","r","e","Symbol","toPrimitive","call","TypeError","String","Number","withSequence","withTiming","BaseAnimationBuilder","SequencedTransition","constructor","args","delayFunction","getDelayFunction","callback","callbackV","delay","getDelay","sequenceDuration","durationV","config","duration","reverse","reversed","values","initialValues","originX","currentOriginX","originY","currentOriginY","width","currentWidth","height","currentHeight","animations","targetOriginX","targetOriginY","targetWidth","targetHeight","createInstance","instance"],"sources":["SequencedTransition.ts"],"sourcesContent":["'use strict';\nimport { withSequence, withTiming } from '../../animation';\nimport type {\n ILayoutAnimationBuilder,\n LayoutAnimationFunction,\n} from '../animationBuilder/commonTypes';\nimport { BaseAnimationBuilder } from '../animationBuilder';\n\n/**\n * Transforms layout starting from the X-axis and width first, followed by the Y-axis and height. You can modify the behavior by chaining methods like `.springify()` or `.duration(500)`.\n *\n * You pass it to the `layout` prop on [an Animated component](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/glossary#animated-component).\n *\n * @see https://docs.swmansion.com/react-native-reanimated/docs/layout-animations/layout-transitions#sequenced-transition\n */\nexport class SequencedTransition\n extends BaseAnimationBuilder\n implements ILayoutAnimationBuilder\n{\n reversed = false;\n\n static createInstance<T extends typeof BaseAnimationBuilder>(\n this: T\n ): InstanceType<T> {\n return new SequencedTransition() as InstanceType<T>;\n }\n\n static reverse(): SequencedTransition {\n const instance = SequencedTransition.createInstance();\n return instance.reverse();\n }\n\n reverse(): SequencedTransition {\n this.reversed = !this.reversed;\n return this;\n }\n\n build = (): LayoutAnimationFunction => {\n const delayFunction = this.getDelayFunction();\n const callback = this.callbackV;\n const delay = this.getDelay();\n const sequenceDuration = (this.durationV ?? 500) / 2;\n const config = { duration: sequenceDuration };\n const reverse = this.reversed;\n\n return (values) => {\n 'worklet';\n return {\n initialValues: {\n originX: values.currentOriginX,\n originY: values.currentOriginY,\n width: values.currentWidth,\n height: values.currentHeight,\n },\n animations: {\n originX: delayFunction(\n delay,\n withSequence(\n withTiming(\n reverse ? values.currentOriginX : values.targetOriginX,\n config\n ),\n withTiming(values.targetOriginX, config)\n )\n ),\n originY: delayFunction(\n delay,\n withSequence(\n withTiming(\n reverse ? values.targetOriginY : values.currentOriginY,\n config\n ),\n withTiming(values.targetOriginY, config)\n )\n ),\n width: delayFunction(\n delay,\n withSequence(\n withTiming(\n reverse ? values.currentWidth : values.targetWidth,\n config\n ),\n withTiming(values.targetWidth, config)\n )\n ),\n height: delayFunction(\n delay,\n withSequence(\n withTiming(\n reverse ? values.targetHeight : values.currentHeight,\n config\n ),\n withTiming(values.targetHeight, config)\n )\n ),\n },\n callback,\n };\n };\n };\n}\n"],"mappings":"AAAA,YAAY;;AAAC,SAAAA,gBAAAC,GAAA,EAAAC,GAAA,EAAAC,KAAA,IAAAD,GAAA,GAAAE,cAAA,CAAAF,GAAA,OAAAA,GAAA,IAAAD,GAAA,IAAAI,MAAA,CAAAC,cAAA,CAAAL,GAAA,EAAAC,GAAA,IAAAC,KAAA,EAAAA,KAAA,EAAAI,UAAA,QAAAC,YAAA,QAAAC,QAAA,oBAAAR,GAAA,CAAAC,GAAA,IAAAC,KAAA,WAAAF,GAAA;AAAA,SAAAG,eAAAM,CAAA,QAAAC,CAAA,GAAAC,YAAA,CAAAF,CAAA,uCAAAC,CAAA,GAAAA,CAAA,GAAAA,CAAA;AAAA,SAAAC,aAAAF,CAAA,EAAAG,CAAA,2BAAAH,CAAA,KAAAA,CAAA,SAAAA,CAAA,MAAAI,CAAA,GAAAJ,CAAA,CAAAK,MAAA,CAAAC,WAAA,kBAAAF,CAAA,QAAAH,CAAA,GAAAG,CAAA,CAAAG,IAAA,CAAAP,CAAA,EAAAG,CAAA,uCAAAF,CAAA,SAAAA,CAAA,YAAAO,SAAA,yEAAAL,CAAA,GAAAM,MAAA,GAAAC,MAAA,EAAAV,CAAA;AACb,SAASW,YAAY,EAAEC,UAAU,QAAQ,iBAAiB;AAK1D,SAASC,oBAAoB,QAAQ,qBAAqB;;AAE1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,mBAAmB,SACtBD,oBAAoB,CAE9B;EAAAE,YAA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AW,EAClDjB,MACF,CAAC,EACDb,UAAU,CAACiB,MAAM,CAACa,WAAW,EAAEjB,MAAM,CACvC,CACF,CAAC;YACDY,MAAM,EAAEpB,aAAa,CACnBI,KAAK,EACLV,YAAY,CACVC,UAAU,CACRe,OAAO,GAAGE,MAAM,CAACc,YAAY,GAAGd,MAAM,CAACS,aAAa,EACpDb,MACF,CAAC,EACDb,UAAU,CAACiB,MAAM,CAACc,YAAY,EAAElB,MAAM,CACxC,CACF;UACF,CAAC;UACDN;QACF,CAAC;MACH,CAAC;IACH,CAAC;EAAA;EA9ED,OAAOyB,cAAcA,CAAA,EAEF;IACjB,OAAO,IAAI9B,mBAAmB,CAAC,CAAC;EAClC;EAEA,OAAOa,OAAOA,CAAA,EAAwB;IACpC,MAAMkB,QAAQ,GAAG/B,mBAAmB,CAAC8B,cAAc,CAAC,CAAC;IACrD,OAAOC,QAAQ,CAAClB,OAAO,CAAC,CAAC;EAC3B;EAEAA,OAAOA,CAAA,EAAwB;IAC7B,IAAI,CAACC,QAAQ,GAAG,CAAC,IAAI,CAACA,QAAQ;IAC9B,OAAO,IAAI;EACb;AAiEF","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["'use strict';\nexport * from './LinearTransition';\nexport * from './FadingTransition';\nexport * from './SequencedTransition';\nexport * from './JumpingTransition';\nexport * from './CurvedTransition';\nexport * from './EntryExitTransition';\n"],"mappings":"AAAA,YAAY;;AACZ,cAAc,oBAAoB;AAClC,cAAc,oBAAoB;AAClC,cAAc,uBAAuB;AACrC,cAAc,qBAAqB;AACnC,cAAc,oBAAoB;AAClC,cAAc,uBAAuB"}
|
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["'use strict';\nexport * from './LinearTransition';\nexport * from './FadingTransition';\nexport * from './SequencedTransition';\nexport * from './JumpingTransition';\nexport * from './CurvedTransition';\nexport * from './EntryExitTransition';\n"],"mappings":"AAAA,YAAY;;AACZ,cAAc,oBAAoB;AAClC,cAAc,oBAAoB;AAClC,cAAc,uBAAuB;AACrC,cAAc,qBAAqB;AACnC,cAAc,oBAAoB;AAClC,cAAc,uBAAuB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["'use strict';\nimport './animationsManager';\nexport * from './animationBuilder';\nexport * from './defaultAnimations';\nexport * from './defaultTransitions';\nexport * from './sharedTransitions';\nexport type { KeyframeProps } from './animationBuilder/commonTypes';\n"],"mappings":"AAAA,YAAY;;AACZ,OAAO,qBAAqB;AAC5B,cAAc,oBAAoB;AAClC,cAAc,qBAAqB;AACnC,cAAc,sBAAsB;AACpC,cAAc,qBAAqB"}
|
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["'use strict';\nimport './animationsManager';\nexport * from './animationBuilder';\nexport * from './defaultAnimations';\nexport * from './defaultTransitions';\nexport * from './sharedTransitions';\nexport type { KeyframeProps } from './animationBuilder/commonTypes';\n"],"mappings":"AAAA,YAAY;;AACZ,OAAO,qBAAqB;AAC5B,cAAc,oBAAoB;AAClC,cAAc,qBAAqB;AACnC,cAAc,sBAAsB;AACpC,cAAc,qBAAqB","ignoreList":[]}
|
package/lib/module/reanimated2/layoutReanimation/sharedTransitions/ProgressTransitionManager.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
4
|
-
function _toPropertyKey(
|
|
5
|
-
function _toPrimitive(
|
|
4
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
5
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
6
6
|
import { runOnUIImmediately } from '../../threads';
|
|
7
7
|
import { registerEventHandler, unregisterEventHandler } from '../../core';
|
|
8
8
|
import { Platform } from 'react-native';
|
|
@@ -27,8 +27,7 @@ export class ProgressTransitionManager {
|
|
|
27
27
|
})();
|
|
28
28
|
this.registerEventHandlers();
|
|
29
29
|
}
|
|
30
|
-
removeProgressAnimation(viewTag) {
|
|
31
|
-
let isUnmounting = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
30
|
+
removeProgressAnimation(viewTag, isUnmounting = true) {
|
|
32
31
|
this.unregisterEventHandlers();
|
|
33
32
|
runOnUIImmediately(() => {
|
|
34
33
|
'worklet';
|
|
@@ -161,8 +160,7 @@ function createProgressTransitionRegister() {
|
|
|
161
160
|
progressTransitionManager.onTransitionEnd();
|
|
162
161
|
}
|
|
163
162
|
},
|
|
164
|
-
onTransitionEnd:
|
|
165
|
-
let removeViews = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
163
|
+
onTransitionEnd: (removeViews = false) => {
|
|
166
164
|
if (currentTransitions.size === 0) {
|
|
167
165
|
toRemove.clear();
|
|
168
166
|
return;
|
package/lib/module/reanimated2/layoutReanimation/sharedTransitions/ProgressTransitionManager.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","arg","_toPrimitive","String","input","hint","prim","Symbol","toPrimitive","undefined","res","call","TypeError","Number","runOnUIImmediately","registerEventHandler","unregisterEventHandler","Platform","isJest","shouldBeUseWeb","IS_ANDROID","OS","ProgressTransitionManager","constructor","isRegistered","onTransitionProgress","onAppear","onDisappear","onSwipeDismiss","addProgressAnimation","viewTag","progressAnimation","global","ProgressTransitionRegister","registerEventHandlers","removeProgressAnimation","isUnmounting","arguments","length","unregisterEventHandlers","_sharedElementCount","eventHandler","_eventHandler","eventPrefix","lastProgressValue","event","progress","frame","onTransitionEnd","onAndroidFinishTransitioning","createProgressTransitionRegister","progressAnimations","Map","snapshots","currentTransitions","Set","toRemove","skipCleaning","isTransitionRestart","progressTransitionManager","size","has","set","add","delete","onTransitionStart","snapshot","get","removeViews","clear","_notifyAboutEnd","maybeThrowError","Error","Proxy"],"sources":["ProgressTransitionManager.ts"],"sourcesContent":["'use strict';\nimport { runOnUIImmediately } from '../../threads';\nimport type {\n ProgressAnimation,\n SharedTransitionAnimationsValues,\n} from '../animationBuilder/commonTypes';\nimport { registerEventHandler, unregisterEventHandler } from '../../core';\nimport { Platform } from 'react-native';\nimport { isJest, shouldBeUseWeb } from '../../PlatformChecker';\n\ntype TransitionProgressEvent = {\n closing: number;\n goingForward: number;\n eventName: string;\n progress: number;\n target: number;\n};\n\nconst IS_ANDROID = Platform.OS === 'android';\n\nexport class ProgressTransitionManager {\n private _sharedElementCount = 0;\n private _eventHandler = {\n isRegistered: false,\n onTransitionProgress: -1,\n onAppear: -1,\n onDisappear: -1,\n onSwipeDismiss: -1,\n };\n\n public addProgressAnimation(\n viewTag: number,\n progressAnimation: ProgressAnimation\n ) {\n runOnUIImmediately(() => {\n 'worklet';\n global.ProgressTransitionRegister.addProgressAnimation(\n viewTag,\n progressAnimation\n );\n })();\n\n this.registerEventHandlers();\n }\n\n public removeProgressAnimation(viewTag: number, isUnmounting = true) {\n this.unregisterEventHandlers();\n runOnUIImmediately(() => {\n 'worklet';\n global.ProgressTransitionRegister.removeProgressAnimation(\n viewTag,\n isUnmounting\n );\n })();\n }\n\n private registerEventHandlers() {\n this._sharedElementCount++;\n const eventHandler = this._eventHandler;\n if (!eventHandler.isRegistered) {\n eventHandler.isRegistered = true;\n const eventPrefix = IS_ANDROID ? 'on' : 'top';\n let lastProgressValue = -1;\n eventHandler.onTransitionProgress = registerEventHandler(\n (event: TransitionProgressEvent) => {\n 'worklet';\n const progress = event.progress;\n if (progress === lastProgressValue) {\n // During screen transition, handler receives two events with the same progress\n // value for both screens, but for modals, there is only one event. To optimize\n // performance and avoid unnecessary worklet calls, let's skip the second event.\n return;\n }\n lastProgressValue = progress;\n global.ProgressTransitionRegister.frame(progress);\n },\n eventPrefix + 'TransitionProgress'\n );\n eventHandler.onAppear = registerEventHandler(() => {\n 'worklet';\n global.ProgressTransitionRegister.onTransitionEnd();\n }, eventPrefix + 'Appear');\n\n if (IS_ANDROID) {\n // onFinishTransitioning event is available only on Android and\n // is used to handle closing modals\n eventHandler.onDisappear = registerEventHandler(() => {\n 'worklet';\n global.ProgressTransitionRegister.onAndroidFinishTransitioning();\n }, 'onFinishTransitioning');\n } else if (Platform.OS === 'ios') {\n // topDisappear event is required to handle closing modals on iOS\n eventHandler.onDisappear = registerEventHandler(() => {\n 'worklet';\n global.ProgressTransitionRegister.onTransitionEnd(true);\n }, 'topDisappear');\n eventHandler.onSwipeDismiss = registerEventHandler(() => {\n 'worklet';\n global.ProgressTransitionRegister.onTransitionEnd();\n }, 'topGestureCancel');\n }\n }\n }\n\n private unregisterEventHandlers(): void {\n this._sharedElementCount--;\n if (this._sharedElementCount === 0) {\n const eventHandler = this._eventHandler;\n eventHandler.isRegistered = false;\n if (eventHandler.onTransitionProgress !== -1) {\n unregisterEventHandler(eventHandler.onTransitionProgress);\n eventHandler.onTransitionProgress = -1;\n }\n if (eventHandler.onAppear !== -1) {\n unregisterEventHandler(eventHandler.onAppear);\n eventHandler.onAppear = -1;\n }\n if (eventHandler.onDisappear !== -1) {\n unregisterEventHandler(eventHandler.onDisappear);\n eventHandler.onDisappear = -1;\n }\n if (eventHandler.onSwipeDismiss !== -1) {\n unregisterEventHandler(eventHandler.onSwipeDismiss);\n eventHandler.onSwipeDismiss = -1;\n }\n }\n }\n}\n\nfunction createProgressTransitionRegister() {\n 'worklet';\n const progressAnimations = new Map<number, ProgressAnimation>();\n const snapshots = new Map<\n number,\n Partial<SharedTransitionAnimationsValues>\n >();\n const currentTransitions = new Set<number>();\n const toRemove = new Set<number>();\n\n let skipCleaning = false;\n let isTransitionRestart = false;\n\n const progressTransitionManager = {\n addProgressAnimation: (\n viewTag: number,\n progressAnimation: ProgressAnimation\n ) => {\n if (currentTransitions.size > 0 && !progressAnimations.has(viewTag)) {\n // there is no need to prevent cleaning on android\n isTransitionRestart = !IS_ANDROID;\n }\n progressAnimations.set(viewTag, progressAnimation);\n },\n removeProgressAnimation: (viewTag: number, isUnmounting: boolean) => {\n if (currentTransitions.size > 0) {\n // there is no need to prevent cleaning on android\n isTransitionRestart = !IS_ANDROID;\n }\n if (isUnmounting) {\n // Remove the animation config after the transition is finished\n toRemove.add(viewTag);\n } else {\n // if the animation is removed, without ever being started, it can be removed immediately\n progressAnimations.delete(viewTag);\n }\n },\n onTransitionStart: (\n viewTag: number,\n snapshot: Partial<SharedTransitionAnimationsValues>\n ) => {\n skipCleaning = isTransitionRestart;\n snapshots.set(viewTag, snapshot);\n currentTransitions.add(viewTag);\n // set initial style for re-parented components\n progressTransitionManager.frame(0);\n },\n frame: (progress: number) => {\n for (const viewTag of currentTransitions) {\n const progressAnimation = progressAnimations.get(viewTag);\n if (!progressAnimation) {\n continue;\n }\n const snapshot = snapshots.get(\n viewTag\n )! as SharedTransitionAnimationsValues;\n progressAnimation(viewTag, snapshot, progress);\n }\n },\n onAndroidFinishTransitioning: () => {\n if (toRemove.size > 0) {\n // it should be ran only on modal closing\n progressTransitionManager.onTransitionEnd();\n }\n },\n onTransitionEnd: (removeViews = false) => {\n if (currentTransitions.size === 0) {\n toRemove.clear();\n return;\n }\n if (skipCleaning) {\n skipCleaning = false;\n isTransitionRestart = false;\n return;\n }\n for (const viewTag of currentTransitions) {\n global._notifyAboutEnd(viewTag, removeViews);\n }\n currentTransitions.clear();\n if (isTransitionRestart) {\n // on transition restart, progressAnimations should be saved\n // because they potentially can be used in the next transition\n return;\n }\n snapshots.clear();\n if (toRemove.size > 0) {\n for (const viewTag of toRemove) {\n progressAnimations.delete(viewTag);\n global._notifyAboutEnd(viewTag, removeViews);\n }\n toRemove.clear();\n }\n },\n };\n return progressTransitionManager;\n}\n\nif (shouldBeUseWeb()) {\n const maybeThrowError = () => {\n // Jest attempts to access a property of this object to check if it is a Jest mock\n // so we can't throw an error in the getter.\n if (!isJest()) {\n throw new Error(\n '[Reanimated] `ProgressTransitionRegister` is not available on non-native platform.'\n );\n }\n };\n global.ProgressTransitionRegister = new Proxy(\n {} as ProgressTransitionRegister,\n {\n get: maybeThrowError,\n set: () => {\n maybeThrowError();\n return false;\n },\n }\n );\n} else {\n runOnUIImmediately(() => {\n 'worklet';\n global.ProgressTransitionRegister = createProgressTransitionRegister();\n })();\n}\n\nexport type ProgressTransitionRegister = ReturnType<\n typeof createProgressTransitionRegister\n>;\n"],"mappings":"AAAA,YAAY;;AAAC,SAAAA,gBAAAC,GAAA,EAAAC,GAAA,EAAAC,KAAA,IAAAD,GAAA,GAAAE,cAAA,CAAAF,GAAA,OAAAA,GAAA,IAAAD,GAAA,IAAAI,MAAA,CAAAC,cAAA,CAAAL,GAAA,EAAAC,GAAA,IAAAC,KAAA,EAAAA,KAAA,EAAAI,UAAA,QAAAC,YAAA,QAAAC,QAAA,oBAAAR,GAAA,CAAAC,GAAA,IAAAC,KAAA,WAAAF,GAAA;AAAA,SAAAG,eAAAM,GAAA,QAAAR,GAAA,GAAAS,YAAA,CAAAD,GAAA,2BAAAR,GAAA,gBAAAA,GAAA,GAAAU,MAAA,CAAAV,GAAA;AAAA,SAAAS,aAAAE,KAAA,EAAAC,IAAA,eAAAD,KAAA,iBAAAA,KAAA,kBAAAA,KAAA,MAAAE,IAAA,GAAAF,KAAA,CAAAG,MAAA,CAAAC,WAAA,OAAAF,IAAA,KAAAG,SAAA,QAAAC,GAAA,GAAAJ,IAAA,CAAAK,IAAA,CAAAP,KAAA,EAAAC,IAAA,2BAAAK,GAAA,sBAAAA,GAAA,YAAAE,SAAA,4DAAAP,IAAA,gBAAAF,MAAA,GAAAU,MAAA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AC,MAAM;IACvB,SAAS;;IACTkB,MAAM,CAACC,0BAA0B,GAAGiB,gCAAgC,EAAE;EACxE,CAAC,CAAC,EAAE;AACN"}
|
|
1
|
+
{"version":3,"names":["_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","r","e","Symbol","toPrimitive","call","TypeError","String","Number","runOnUIImmediately","registerEventHandler","unregisterEventHandler","Platform","isJest","shouldBeUseWeb","IS_ANDROID","OS","ProgressTransitionManager","constructor","isRegistered","onTransitionProgress","onAppear","onDisappear","onSwipeDismiss","addProgressAnimation","viewTag","progressAnimation","global","ProgressTransitionRegister","registerEventHandlers","removeProgressAnimation","isUnmounting","unregisterEventHandlers","_sharedElementCount","eventHandler","_eventHandler","eventPrefix","lastProgressValue","event","progress","frame","onTransitionEnd","onAndroidFinishTransitioning","createProgressTransitionRegister","progressAnimations","Map","snapshots","currentTransitions","Set","toRemove","skipCleaning","isTransitionRestart","progressTransitionManager","size","has","set","add","delete","onTransitionStart","snapshot","get","removeViews","clear","_notifyAboutEnd","maybeThrowError","Error","Proxy"],"sources":["ProgressTransitionManager.ts"],"sourcesContent":["'use strict';\nimport { runOnUIImmediately } from '../../threads';\nimport type {\n ProgressAnimation,\n SharedTransitionAnimationsValues,\n} from '../animationBuilder/commonTypes';\nimport { registerEventHandler, unregisterEventHandler } from '../../core';\nimport { Platform } from 'react-native';\nimport { isJest, shouldBeUseWeb } from '../../PlatformChecker';\n\ntype TransitionProgressEvent = {\n closing: number;\n goingForward: number;\n eventName: string;\n progress: number;\n target: number;\n};\n\nconst IS_ANDROID = Platform.OS === 'android';\n\nexport class ProgressTransitionManager {\n private _sharedElementCount = 0;\n private _eventHandler = {\n isRegistered: false,\n onTransitionProgress: -1,\n onAppear: -1,\n onDisappear: -1,\n onSwipeDismiss: -1,\n };\n\n public addProgressAnimation(\n viewTag: number,\n progressAnimation: ProgressAnimation\n ) {\n runOnUIImmediately(() => {\n 'worklet';\n global.ProgressTransitionRegister.addProgressAnimation(\n viewTag,\n progressAnimation\n );\n })();\n\n this.registerEventHandlers();\n }\n\n public removeProgressAnimation(viewTag: number, isUnmounting = true) {\n this.unregisterEventHandlers();\n runOnUIImmediately(() => {\n 'worklet';\n global.ProgressTransitionRegister.removeProgressAnimation(\n viewTag,\n isUnmounting\n );\n })();\n }\n\n private registerEventHandlers() {\n this._sharedElementCount++;\n const eventHandler = this._eventHandler;\n if (!eventHandler.isRegistered) {\n eventHandler.isRegistered = true;\n const eventPrefix = IS_ANDROID ? 'on' : 'top';\n let lastProgressValue = -1;\n eventHandler.onTransitionProgress = registerEventHandler(\n (event: TransitionProgressEvent) => {\n 'worklet';\n const progress = event.progress;\n if (progress === lastProgressValue) {\n // During screen transition, handler receives two events with the same progress\n // value for both screens, but for modals, there is only one event. To optimize\n // performance and avoid unnecessary worklet calls, let's skip the second event.\n return;\n }\n lastProgressValue = progress;\n global.ProgressTransitionRegister.frame(progress);\n },\n eventPrefix + 'TransitionProgress'\n );\n eventHandler.onAppear = registerEventHandler(() => {\n 'worklet';\n global.ProgressTransitionRegister.onTransitionEnd();\n }, eventPrefix + 'Appear');\n\n if (IS_ANDROID) {\n // onFinishTransitioning event is available only on Android and\n // is used to handle closing modals\n eventHandler.onDisappear = registerEventHandler(() => {\n 'worklet';\n global.ProgressTransitionRegister.onAndroidFinishTransitioning();\n }, 'onFinishTransitioning');\n } else if (Platform.OS === 'ios') {\n // topDisappear event is required to handle closing modals on iOS\n eventHandler.onDisappear = registerEventHandler(() => {\n 'worklet';\n global.ProgressTransitionRegister.onTransitionEnd(true);\n }, 'topDisappear');\n eventHandler.onSwipeDismiss = registerEventHandler(() => {\n 'worklet';\n global.ProgressTransitionRegister.onTransitionEnd();\n }, 'topGestureCancel');\n }\n }\n }\n\n private unregisterEventHandlers(): void {\n this._sharedElementCount--;\n if (this._sharedElementCount === 0) {\n const eventHandler = this._eventHandler;\n eventHandler.isRegistered = false;\n if (eventHandler.onTransitionProgress !== -1) {\n unregisterEventHandler(eventHandler.onTransitionProgress);\n eventHandler.onTransitionProgress = -1;\n }\n if (eventHandler.onAppear !== -1) {\n unregisterEventHandler(eventHandler.onAppear);\n eventHandler.onAppear = -1;\n }\n if (eventHandler.onDisappear !== -1) {\n unregisterEventHandler(eventHandler.onDisappear);\n eventHandler.onDisappear = -1;\n }\n if (eventHandler.onSwipeDismiss !== -1) {\n unregisterEventHandler(eventHandler.onSwipeDismiss);\n eventHandler.onSwipeDismiss = -1;\n }\n }\n }\n}\n\nfunction createProgressTransitionRegister() {\n 'worklet';\n const progressAnimations = new Map<number, ProgressAnimation>();\n const snapshots = new Map<\n number,\n Partial<SharedTransitionAnimationsValues>\n >();\n const currentTransitions = new Set<number>();\n const toRemove = new Set<number>();\n\n let skipCleaning = false;\n let isTransitionRestart = false;\n\n const progressTransitionManager = {\n addProgressAnimation: (\n viewTag: number,\n progressAnimation: ProgressAnimation\n ) => {\n if (currentTransitions.size > 0 && !progressAnimations.has(viewTag)) {\n // there is no need to prevent cleaning on android\n isTransitionRestart = !IS_ANDROID;\n }\n progressAnimations.set(viewTag, progressAnimation);\n },\n removeProgressAnimation: (viewTag: number, isUnmounting: boolean) => {\n if (currentTransitions.size > 0) {\n // there is no need to prevent cleaning on android\n isTransitionRestart = !IS_ANDROID;\n }\n if (isUnmounting) {\n // Remove the animation config after the transition is finished\n toRemove.add(viewTag);\n } else {\n // if the animation is removed, without ever being started, it can be removed immediately\n progressAnimations.delete(viewTag);\n }\n },\n onTransitionStart: (\n viewTag: number,\n snapshot: Partial<SharedTransitionAnimationsValues>\n ) => {\n skipCleaning = isTransitionRestart;\n snapshots.set(viewTag, snapshot);\n currentTransitions.add(viewTag);\n // set initial style for re-parented components\n progressTransitionManager.frame(0);\n },\n frame: (progress: number) => {\n for (const viewTag of currentTransitions) {\n const progressAnimation = progressAnimations.get(viewTag);\n if (!progressAnimation) {\n continue;\n }\n const snapshot = snapshots.get(\n viewTag\n )! as SharedTransitionAnimationsValues;\n progressAnimation(viewTag, snapshot, progress);\n }\n },\n onAndroidFinishTransitioning: () => {\n if (toRemove.size > 0) {\n // it should be ran only on modal closing\n progressTransitionManager.onTransitionEnd();\n }\n },\n onTransitionEnd: (removeViews = false) => {\n if (currentTransitions.size === 0) {\n toRemove.clear();\n return;\n }\n if (skipCleaning) {\n skipCleaning = false;\n isTransitionRestart = false;\n return;\n }\n for (const viewTag of currentTransitions) {\n global._notifyAboutEnd(viewTag, removeViews);\n }\n currentTransitions.clear();\n if (isTransitionRestart) {\n // on transition restart, progressAnimations should be saved\n // because they potentially can be used in the next transition\n return;\n }\n snapshots.clear();\n if (toRemove.size > 0) {\n for (const viewTag of toRemove) {\n progressAnimations.delete(viewTag);\n global._notifyAboutEnd(viewTag, removeViews);\n }\n toRemove.clear();\n }\n },\n };\n return progressTransitionManager;\n}\n\nif (shouldBeUseWeb()) {\n const maybeThrowError = () => {\n // Jest attempts to access a property of this object to check if it is a Jest mock\n // so we can't throw an error in the getter.\n if (!isJest()) {\n throw new Error(\n '[Reanimated] `ProgressTransitionRegister` is not available on non-native platform.'\n );\n }\n };\n global.ProgressTransitionRegister = new Proxy(\n {} as ProgressTransitionRegister,\n {\n get: maybeThrowError,\n set: () => {\n maybeThrowError();\n return false;\n },\n }\n );\n} else {\n runOnUIImmediately(() => {\n 'worklet';\n global.ProgressTransitionRegister = createProgressTransitionRegister();\n })();\n}\n\nexport type ProgressTransitionRegister = ReturnType<\n typeof createProgressTransitionRegister\n>;\n"],"mappings":"AAAA,YAAY;;AAAC,SAAAA,gBAAAC,GAAA,EAAAC,GAAA,EAAAC,KAAA,IAAAD,GAAA,GAAAE,cAAA,CAAAF,GAAA,OAAAA,GAAA,IAAAD,GAAA,IAAAI,MAAA,CAAAC,cAAA,CAAAL,GAAA,EAAAC,GAAA,IAAAC,KAAA,EAAAA,KAAA,EAAAI,UAAA,QAAAC,YAAA,QAAAC,QAAA,oBAAAR,GAAA,CAAAC,GAAA,IAAAC,KAAA,WAAAF,GAAA;AAA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ACA;IACA,IAAI,CAACnD,MAAM,CAAC,CAAC,EAAE;MACb,MAAM,IAAIoD,KAAK,CACb,oFACF,CAAC;IACH;EACF,CAAC;EACDtC,MAAM,CAACC,0BAA0B,GAAG,IAAIsC,KAAK,CAC3C,CAAC,CAAC,EACF;IACEN,GAAG,EAAEI,eAAe;IACpBT,GAAG,EAAEA,CAAA,KAAM;MACTS,eAAe,CAAC,CAAC;MACjB,OAAO,KAAK;IACd;EACF,CACF,CAAC;AACH,CAAC,MAAM;EACLvD,kBAAkB,CAAC,MAAM;IACvB,SAAS;;IACTkB,MAAM,CAACC,0BAA0B,GAAGe,gCAAgC,CAAC,CAAC;EACxE,CAAC,CAAC,CAAC,CAAC;AACN","ignoreList":[]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
4
|
-
function _toPropertyKey(
|
|
5
|
-
function _toPrimitive(
|
|
4
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
5
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
6
6
|
import { withTiming } from '../../animation';
|
|
7
7
|
import { LayoutAnimationType, SharedTransitionType } from '../animationBuilder/commonTypes';
|
|
8
8
|
import { ReduceMotion } from '../../commonTypes';
|
|
@@ -51,8 +51,7 @@ export class SharedTransition {
|
|
|
51
51
|
this._defaultTransitionType = transitionType;
|
|
52
52
|
return this;
|
|
53
53
|
}
|
|
54
|
-
registerTransition(viewTag, sharedTransitionTag) {
|
|
55
|
-
let isUnmounting = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
54
|
+
registerTransition(viewTag, sharedTransitionTag, isUnmounting = false) {
|
|
56
55
|
if (getReduceMotionFromConfig(this.getReduceMotion())) {
|
|
57
56
|
return;
|
|
58
57
|
}
|
|
@@ -69,8 +68,7 @@ export class SharedTransition {
|
|
|
69
68
|
updateLayoutAnimations(viewTag, layoutAnimationType, transitionAnimation, sharedTransitionTag, isUnmounting);
|
|
70
69
|
SharedTransition._progressTransitionManager.addProgressAnimation(viewTag, progressAnimation);
|
|
71
70
|
}
|
|
72
|
-
unregisterTransition(viewTag) {
|
|
73
|
-
let isUnmounting = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
71
|
+
unregisterTransition(viewTag, isUnmounting = false) {
|
|
74
72
|
const layoutAnimationType = this._defaultTransitionType === SharedTransitionType.ANIMATION ? LayoutAnimationType.SHARED_ELEMENT_TRANSITION : LayoutAnimationType.SHARED_ELEMENT_TRANSITION_PROGRESS;
|
|
75
73
|
updateLayoutAnimations(viewTag, layoutAnimationType, undefined, undefined, isUnmounting);
|
|
76
74
|
SharedTransition._progressTransitionManager.removeProgressAnimation(viewTag, isUnmounting);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","arg","_toPrimitive","String","input","hint","prim","Symbol","toPrimitive","undefined","res","call","TypeError","Number","withTiming","LayoutAnimationType","SharedTransitionType","ReduceMotion","ProgressTransitionManager","updateLayoutAnimations","getReduceMotionFromConfig","SUPPORTED_PROPS","SharedTransition","constructor","System","custom","customAnimationFactory","_customAnimationFactory","progressAnimation","progressAnimationCallback","_customProgressAnimation","viewTag","values","progress","newStyles","global","_notifyAboutProgress","duration","_transitionDuration","reduceMotion","_reduceMotion","defaultTransitionType","transitionType","_defaultTransitionType","registerTransition","sharedTransitionTag","isUnmounting","arguments","length","getReduceMotion","transitionAnimation","getTransitionAnimation","getProgressAnimation","ANIMATION","PROGRESS_ANIMATION","layoutAnimationType","SHARED_ELEMENT_TRANSITION","SHARED_ELEMENT_TRANSITION_PROGRESS","_progressTransitionManager","addProgressAnimation","unregisterTransition","removeProgressAnimation","_animation","buildAnimation","_progressAnimation","buildProgressAnimation","animationFactory","transitionDuration","animations","initialValues","includes","Error","propName","matrix","targetTransformMatrix","transformMatrix","capitalizedPropName","charAt","toUpperCase","slice","keyToTargetValue","currentTransformMatrix","keyToCurrentValue","propertyName","currentMatrix","targetMatrix","newMatrix","Array","i","PropertyName","currentPropertyName","targetPropertyName","currentValue","targetValue"],"sources":["SharedTransition.ts"],"sourcesContent":["'use strict';\nimport { withTiming } from '../../animation';\nimport type {\n SharedTransitionAnimationsFunction,\n SharedTransitionAnimationsValues,\n CustomProgressAnimation,\n ProgressAnimation,\n LayoutAnimationsOptions,\n} from '../animationBuilder/commonTypes';\nimport {\n LayoutAnimationType,\n SharedTransitionType,\n} from '../animationBuilder/commonTypes';\nimport type { StyleProps } from '../../commonTypes';\nimport { ReduceMotion } from '../../commonTypes';\nimport { ProgressTransitionManager } from './ProgressTransitionManager';\nimport { updateLayoutAnimations } from '../../UpdateLayoutAnimations';\nimport { getReduceMotionFromConfig } from '../../animation/util';\n\nconst SUPPORTED_PROPS = [\n 'width',\n 'height',\n 'originX',\n 'originY',\n 'transform',\n 'borderRadius',\n] as const;\n\ntype AnimationFactory = (\n values: SharedTransitionAnimationsValues\n) => StyleProps;\n\n/**\n * A SharedTransition builder class.\n *\n * @see https://docs.swmansion.com/react-native-reanimated/docs/shared-element-transitions/overview\n * @experimental\n */\nexport class SharedTransition {\n private _customAnimationFactory: AnimationFactory | null = null;\n private _animation: SharedTransitionAnimationsFunction | null = null;\n private _transitionDuration = 500;\n private _reduceMotion: ReduceMotion = ReduceMotion.System;\n private _customProgressAnimation?: ProgressAnimation = undefined;\n private _progressAnimation?: ProgressAnimation = undefined;\n private _defaultTransitionType?: SharedTransitionType = undefined;\n private static _progressTransitionManager = new ProgressTransitionManager();\n\n public custom(customAnimationFactory: AnimationFactory): SharedTransition {\n this._customAnimationFactory = customAnimationFactory;\n return this;\n }\n\n public progressAnimation(\n progressAnimationCallback: CustomProgressAnimation\n ): SharedTransition {\n this._customProgressAnimation = (viewTag, values, progress) => {\n 'worklet';\n const newStyles = progressAnimationCallback(values, progress);\n global._notifyAboutProgress(viewTag, newStyles, true);\n };\n return this;\n }\n\n public duration(duration: number): SharedTransition {\n this._transitionDuration = duration;\n return this;\n }\n\n public reduceMotion(_reduceMotion: ReduceMotion): this {\n this._reduceMotion = _reduceMotion;\n return this;\n }\n\n public defaultTransitionType(\n transitionType: SharedTransitionType\n ): SharedTransition {\n this._defaultTransitionType = transitionType;\n return this;\n }\n\n public registerTransition(\n viewTag: number,\n sharedTransitionTag: string,\n isUnmounting = false\n ) {\n if (getReduceMotionFromConfig(this.getReduceMotion())) {\n return;\n }\n\n const transitionAnimation = this.getTransitionAnimation();\n const progressAnimation = this.getProgressAnimation();\n if (!this._defaultTransitionType) {\n if (this._customAnimationFactory && !this._customProgressAnimation) {\n this._defaultTransitionType = SharedTransitionType.ANIMATION;\n } else {\n this._defaultTransitionType = SharedTransitionType.PROGRESS_ANIMATION;\n }\n }\n const layoutAnimationType =\n this._defaultTransitionType === SharedTransitionType.ANIMATION\n ? LayoutAnimationType.SHARED_ELEMENT_TRANSITION\n : LayoutAnimationType.SHARED_ELEMENT_TRANSITION_PROGRESS;\n updateLayoutAnimations(\n viewTag,\n layoutAnimationType,\n transitionAnimation,\n sharedTransitionTag,\n isUnmounting\n );\n SharedTransition._progressTransitionManager.addProgressAnimation(\n viewTag,\n progressAnimation\n );\n }\n\n public unregisterTransition(viewTag: number, isUnmounting = false): void {\n const layoutAnimationType =\n this._defaultTransitionType === SharedTransitionType.ANIMATION\n ? LayoutAnimationType.SHARED_ELEMENT_TRANSITION\n : LayoutAnimationType.SHARED_ELEMENT_TRANSITION_PROGRESS;\n updateLayoutAnimations(\n viewTag,\n layoutAnimationType,\n undefined,\n undefined,\n isUnmounting\n );\n SharedTransition._progressTransitionManager.removeProgressAnimation(\n viewTag,\n isUnmounting\n );\n }\n\n public getReduceMotion(): ReduceMotion {\n return this._reduceMotion;\n }\n\n private getTransitionAnimation(): SharedTransitionAnimationsFunction {\n if (!this._animation) {\n this.buildAnimation();\n }\n return this._animation!;\n }\n\n private getProgressAnimation(): ProgressAnimation {\n if (!this._progressAnimation) {\n this.buildProgressAnimation();\n }\n return this._progressAnimation!;\n }\n\n private buildAnimation() {\n const animationFactory = this._customAnimationFactory;\n const transitionDuration = this._transitionDuration;\n const reduceMotion = this._reduceMotion;\n this._animation = (values: SharedTransitionAnimationsValues) => {\n 'worklet';\n let animations: {\n [key: string]: unknown;\n } = {};\n const initialValues: {\n [key: string]: unknown;\n } = {};\n\n if (animationFactory) {\n animations = animationFactory(values);\n for (const key in animations) {\n if (!(SUPPORTED_PROPS as readonly string[]).includes(key)) {\n throw new Error(\n `[Reanimated] The prop '${key}' is not supported yet.`\n );\n }\n }\n } else {\n for (const propName of SUPPORTED_PROPS) {\n if (propName === 'transform') {\n const matrix = values.targetTransformMatrix;\n animations.transformMatrix = withTiming(matrix, {\n reduceMotion,\n duration: transitionDuration,\n });\n } else {\n const capitalizedPropName = `${propName\n .charAt(0)\n .toUpperCase()}${propName.slice(\n 1\n )}` as Capitalize<LayoutAnimationsOptions>;\n const keyToTargetValue = `target${capitalizedPropName}` as const;\n animations[propName] = withTiming(values[keyToTargetValue], {\n reduceMotion,\n duration: transitionDuration,\n });\n }\n }\n }\n\n for (const propName in animations) {\n if (propName === 'transform') {\n initialValues.transformMatrix = values.currentTransformMatrix;\n } else {\n const capitalizedPropName = (propName.charAt(0).toUpperCase() +\n propName.slice(1)) as Capitalize<LayoutAnimationsOptions>;\n const keyToCurrentValue = `current${capitalizedPropName}` as const;\n initialValues[propName] = values[keyToCurrentValue];\n }\n }\n\n return { initialValues, animations };\n };\n }\n\n private buildProgressAnimation() {\n if (this._customProgressAnimation) {\n this._progressAnimation = this._customProgressAnimation;\n return;\n }\n this._progressAnimation = (viewTag, values, progress) => {\n 'worklet';\n const newStyles: { [key: string]: number | number[] } = {};\n for (const propertyName of SUPPORTED_PROPS) {\n if (propertyName === 'transform') {\n // this is not the perfect solution, but at this moment it just interpolates the whole\n // matrix instead of interpolating scale, translate, rotate, etc. separately\n const currentMatrix = values.currentTransformMatrix;\n const targetMatrix = values.targetTransformMatrix;\n const newMatrix = new Array(9);\n for (let i = 0; i < 9; i++) {\n newMatrix[i] =\n progress * (targetMatrix[i] - currentMatrix[i]) +\n currentMatrix[i];\n }\n newStyles.transformMatrix = newMatrix;\n } else {\n // PropertyName == propertyName with capitalized fist letter, (width -> Width)\n const PropertyName = (propertyName.charAt(0).toUpperCase() +\n propertyName.slice(1)) as Capitalize<LayoutAnimationsOptions>;\n const currentPropertyName = `current${PropertyName}` as const;\n const targetPropertyName = `target${PropertyName}` as const;\n\n const currentValue = values[currentPropertyName];\n const targetValue = values[targetPropertyName];\n\n newStyles[propertyName] =\n progress * (targetValue - currentValue) + currentValue;\n }\n }\n global._notifyAboutProgress(viewTag, newStyles, true);\n };\n }\n\n // static builder methods i.e. shared transition modifiers\n\n /**\n * Lets you create a custom shared transition animation. Other shared transition modifiers can be chained alongside this modifier.\n *\n * @param customAnimationFactory - Callback function that have to return an object with styles for the custom shared transition.\n * @returns A {@link SharedTransition} object. Styles returned from this function need to be to the `sharedTransitionStyle` prop.\n * @see https://docs.swmansion.com/react-native-reanimated/docs/shared-element-transitions/overview\n * @experimental\n */\n public static custom(\n customAnimationFactory: AnimationFactory\n ): SharedTransition {\n return new SharedTransition().custom(customAnimationFactory);\n }\n\n /**\n * Lets you change the duration of the shared transition. Other shared transition modifiers can be chained alongside this modifier.\n *\n * @param duration - The duration of the shared transition animation in milliseconds.\n * @see https://docs.swmansion.com/react-native-reanimated/docs/shared-element-transitions/overview\n * @experimental\n */\n public static duration(duration: number): SharedTransition {\n return new SharedTransition().duration(duration);\n }\n\n /**\n * Lets you create a shared transition animation bound to the progress between navigation screens. Other shared transition modifiers can be chained alongside this modifier.\n *\n * @param progressAnimationCallback - A callback called with the current progress value on every animation frame. It should return an object with styles for the shared transition.\n * @see https://docs.swmansion.com/react-native-reanimated/docs/shared-element-transitions/overview\n * @experimental\n */\n public static progressAnimation(\n progressAnimationCallback: CustomProgressAnimation\n ): SharedTransition {\n return new SharedTransition().progressAnimation(progressAnimationCallback);\n }\n\n /**\n * Whether the transition is progress-bound or not. Other shared transition modifiers can be chained alongside this modifier.\n *\n * @param transitionType - Type of the transition. Configured with {@link SharedTransitionType} enum.\n * @see https://docs.swmansion.com/react-native-reanimated/docs/shared-element-transitions/overview\n * @experimental\n */\n public static defaultTransitionType(\n transitionType: SharedTransitionType\n ): SharedTransition {\n return new SharedTransition().defaultTransitionType(transitionType);\n }\n\n /**\n * Lets you adjust the behavior when the device's reduced motion accessibility setting is turned on. Other shared transition modifiers can be chained alongside this modifier.\n *\n * @param reduceMotion - Determines how the animation responds to the device's reduced motion accessibility setting. Default to `ReduceMotion.System` - {@link ReduceMotion}.\n * @see https://docs.swmansion.com/react-native-reanimated/docs/shared-element-transitions/overview\n * @experimental\n */\n public static reduceMotion(reduceMotion: ReduceMotion): SharedTransition {\n return new SharedTransition().reduceMotion(reduceMotion);\n }\n}\n"],"mappings":"AAAA,YAAY;;AAAC,SAAAA,gBAAAC,GAAA,EAAAC,GAAA,EAAAC,KAAA,IAAAD,GAAA,GAAAE,cAAA,CAAAF,GAAA,OAAAA,GAAA,IAAAD,GAAA,IAAAI,MAAA,CAAAC,cAAA,CAAAL,GAAA,EAAAC,GAAA,IAAAC,KAAA,EAAAA,KAAA,EAAAI,UAAA,QAAAC,YAAA,QAAAC,QAAA,oBAAAR,GAAA,CAAAC,GAAA,IAAAC,KAAA,WAAAF,GAAA;AAAA,SAAAG,eAAAM,GAAA,QAAAR,GAAA,GAAAS,YAAA,CAAAD,GAAA,2BAAAR,GAAA,gBAAAA,GAAA,GAAAU,MAAA,CAAAV,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AAY,GAAG5D,MAAM,CAAC0D,mBAAmB,CAAC;UAChD,MAAMG,WAAW,GAAG7D,MAAM,CAAC2D,kBAAkB,CAAC;UAE9CzD,SAAS,CAACiD,YAAY,CAAC,GACrBlD,QAAQ,IAAI4D,WAAW,GAAGD,YAAY,CAAC,GAAGA,YAAY;QAC1D;MACF;MACAzD,MAAM,CAACC,oBAAoB,CAACL,OAAO,EAAEG,SAAS,EAAE,IAAI,CAAC;IACvD,CAAC;EACH;;EAEA;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;EACE,OAAcT,MAAMA,CAClBC,sBAAwC,EACtB;IAClB,OAAO,IAAIJ,gBAAgB,EAAE,CAACG,MAAM,CAACC,sBAAsB,CAAC;EAC9D;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;EACE,OAAcW,QAAQA,CAACA,QAAgB,EAAoB;IACzD,OAAO,IAAIf,gBAAgB,EAAE,CAACe,QAAQ,CAACA,QAAQ,CAAC;EAClD;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;EACE,OAAcT,iBAAiBA,CAC7BC,yBAAkD,EAChC;IAClB,OAAO,IAAIP,gBAAgB,EAAE,CAACM,iBAAiB,CAACC,yBAAyB,CAAC;EAC5E;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;EACE,OAAcY,qBAAqBA,CACjCC,cAAoC,EAClB;IAClB,OAAO,IAAIpB,gBAAgB,EAAE,CAACmB,qBAAqB,CAACC,cAAc,CAAC;EACrE;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;EACE,OAAcH,YAAYA,CAACA,YAA0B,EAAoB;IACvE,OAAO,IAAIjB,gBAAgB,EAAE,CAACiB,YAAY,CAACA,YAAY,CAAC;EAC1D;AACF;AAAChD,eAAA,CApRY+B,gBAAgB,gCAQiB,IAAIJ,yBAAyB,EAAE"}
|
|
1
|
+
{"version":3,"names":["_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","r","e","Symbol","toPrimitive","call","TypeError","String","Number","withTiming","LayoutAnimationType","SharedTransitionType","ReduceMotion","ProgressTransitionManager","updateLayoutAnimations","getReduceMotionFromConfig","SUPPORTED_PROPS","SharedTransition","constructor","System","undefined","custom","customAnimationFactory","_customAnimationFactory","progressAnimation","progressAnimationCallback","_customProgressAnimation","viewTag","values","progress","newStyles","global","_notifyAboutProgress","duration","_transitionDuration","reduceMotion","_reduceMotion","defaultTransitionType","transitionType","_defaultTransitionType","registerTransition","sharedTransitionTag","isUnmounting","getReduceMotion","transitionAnimation","getTransitionAnimation","getProgressAnimation","ANIMATION","PROGRESS_ANIMATION","layoutAnimationType","SHARED_ELEMENT_TRANSITION","SHARED_ELEMENT_TRANSITION_PROGRESS","_progressTransitionManager","addProgressAnimation","unregisterTransition","removeProgressAnimation","_animation","buildAnimation","_progressAnimation","buildProgressAnimation","animationFactory","transitionDuration","animations","initialValues","includes","Error","propName","matrix","targetTransformMatrix","transformMatrix","capitalizedPropName","charAt","toUpperCase","slice","keyToTargetValue","currentTransformMatrix","keyToCurrentValue","propertyName","currentMatrix","targetMatrix","newMatrix","Array","PropertyName","currentPropertyName","targetPropertyName","currentValue","targetValue"],"sources":["SharedTransition.ts"],"sourcesContent":["'use strict';\nimport { withTiming } from '../../animation';\nimport type {\n SharedTransitionAnimationsFunction,\n SharedTransitionAnimationsValues,\n CustomProgressAnimation,\n ProgressAnimation,\n LayoutAnimationsOptions,\n} from '../animationBuilder/commonTypes';\nimport {\n LayoutAnimationType,\n SharedTransitionType,\n} from '../animationBuilder/commonTypes';\nimport type { StyleProps } from '../../commonTypes';\nimport { ReduceMotion } from '../../commonTypes';\nimport { ProgressTransitionManager } from './ProgressTransitionManager';\nimport { updateLayoutAnimations } from '../../UpdateLayoutAnimations';\nimport { getReduceMotionFromConfig } from '../../animation/util';\n\nconst SUPPORTED_PROPS = [\n 'width',\n 'height',\n 'originX',\n 'originY',\n 'transform',\n 'borderRadius',\n] as const;\n\ntype AnimationFactory = (\n values: SharedTransitionAnimationsValues\n) => StyleProps;\n\n/**\n * A SharedTransition builder class.\n *\n * @see https://docs.swmansion.com/react-native-reanimated/docs/shared-element-transitions/overview\n * @experimental\n */\nexport class SharedTransition {\n private _customAnimationFactory: AnimationFactory | null = null;\n private _animation: SharedTransitionAnimationsFunction | null = null;\n private _transitionDuration = 500;\n private _reduceMotion: ReduceMotion = ReduceMotion.System;\n private _customProgressAnimation?: ProgressAnimation = undefined;\n private _progressAnimation?: ProgressAnimation = undefined;\n private _defaultTransitionType?: SharedTransitionType = undefined;\n private static _progressTransitionManager = new ProgressTransitionManager();\n\n public custom(customAnimationFactory: AnimationFactory): SharedTransition {\n this._customAnimationFactory = customAnimationFactory;\n return this;\n }\n\n public progressAnimation(\n progressAnimationCallback: CustomProgressAnimation\n ): SharedTransition {\n this._customProgressAnimation = (viewTag, values, progress) => {\n 'worklet';\n const newStyles = progressAnimationCallback(values, progress);\n global._notifyAboutProgress(viewTag, newStyles, true);\n };\n return this;\n }\n\n public duration(duration: number): SharedTransition {\n this._transitionDuration = duration;\n return this;\n }\n\n public reduceMotion(_reduceMotion: ReduceMotion): this {\n this._reduceMotion = _reduceMotion;\n return this;\n }\n\n public defaultTransitionType(\n transitionType: SharedTransitionType\n ): SharedTransition {\n this._defaultTransitionType = transitionType;\n return this;\n }\n\n public registerTransition(\n viewTag: number,\n sharedTransitionTag: string,\n isUnmounting = false\n ) {\n if (getReduceMotionFromConfig(this.getReduceMotion())) {\n return;\n }\n\n const transitionAnimation = this.getTransitionAnimation();\n const progressAnimation = this.getProgressAnimation();\n if (!this._defaultTransitionType) {\n if (this._customAnimationFactory && !this._customProgressAnimation) {\n this._defaultTransitionType = SharedTransitionType.ANIMATION;\n } else {\n this._defaultTransitionType = SharedTransitionType.PROGRESS_ANIMATION;\n }\n }\n const layoutAnimationType =\n this._defaultTransitionType === SharedTransitionType.ANIMATION\n ? LayoutAnimationType.SHARED_ELEMENT_TRANSITION\n : LayoutAnimationType.SHARED_ELEMENT_TRANSITION_PROGRESS;\n updateLayoutAnimations(\n viewTag,\n layoutAnimationType,\n transitionAnimation,\n sharedTransitionTag,\n isUnmounting\n );\n SharedTransition._progressTransitionManager.addProgressAnimation(\n viewTag,\n progressAnimation\n );\n }\n\n public unregisterTransition(viewTag: number, isUnmounting = false): void {\n const layoutAnimationType =\n this._defaultTransitionType === SharedTransitionType.ANIMATION\n ? LayoutAnimationType.SHARED_ELEMENT_TRANSITION\n : LayoutAnimationType.SHARED_ELEMENT_TRANSITION_PROGRESS;\n updateLayoutAnimations(\n viewTag,\n layoutAnimationType,\n undefined,\n undefined,\n isUnmounting\n );\n SharedTransition._progressTransitionManager.removeProgressAnimation(\n viewTag,\n isUnmounting\n );\n }\n\n public getReduceMotion(): ReduceMotion {\n return this._reduceMotion;\n }\n\n private getTransitionAnimation(): SharedTransitionAnimationsFunction {\n if (!this._animation) {\n this.buildAnimation();\n }\n return this._animation!;\n }\n\n private getProgressAnimation(): ProgressAnimation {\n if (!this._progressAnimation) {\n this.buildProgressAnimation();\n }\n return this._progressAnimation!;\n }\n\n private buildAnimation() {\n const animationFactory = this._customAnimationFactory;\n const transitionDuration = this._transitionDuration;\n const reduceMotion = this._reduceMotion;\n this._animation = (values: SharedTransitionAnimationsValues) => {\n 'worklet';\n let animations: {\n [key: string]: unknown;\n } = {};\n const initialValues: {\n [key: string]: unknown;\n } = {};\n\n if (animationFactory) {\n animations = animationFactory(values);\n for (const key in animations) {\n if (!(SUPPORTED_PROPS as readonly string[]).includes(key)) {\n throw new Error(\n `[Reanimated] The prop '${key}' is not supported yet.`\n );\n }\n }\n } else {\n for (const propName of SUPPORTED_PROPS) {\n if (propName === 'transform') {\n const matrix = values.targetTransformMatrix;\n animations.transformMatrix = withTiming(matrix, {\n reduceMotion,\n duration: transitionDuration,\n });\n } else {\n const capitalizedPropName = `${propName\n .charAt(0)\n .toUpperCase()}${propName.slice(\n 1\n )}` as Capitalize<LayoutAnimationsOptions>;\n const keyToTargetValue = `target${capitalizedPropName}` as const;\n animations[propName] = withTiming(values[keyToTargetValue], {\n reduceMotion,\n duration: transitionDuration,\n });\n }\n }\n }\n\n for (const propName in animations) {\n if (propName === 'transform') {\n initialValues.transformMatrix = values.currentTransformMatrix;\n } else {\n const capitalizedPropName = (propName.charAt(0).toUpperCase() +\n propName.slice(1)) as Capitalize<LayoutAnimationsOptions>;\n const keyToCurrentValue = `current${capitalizedPropName}` as const;\n initialValues[propName] = values[keyToCurrentValue];\n }\n }\n\n return { initialValues, animations };\n };\n }\n\n private buildProgressAnimation() {\n if (this._customProgressAnimation) {\n this._progressAnimation = this._customProgressAnimation;\n return;\n }\n this._progressAnimation = (viewTag, values, progress) => {\n 'worklet';\n const newStyles: { [key: string]: number | number[] } = {};\n for (const propertyName of SUPPORTED_PROPS) {\n if (propertyName === 'transform') {\n // this is not the perfect solution, but at this moment it just interpolates the whole\n // matrix instead of interpolating scale, translate, rotate, etc. separately\n const currentMatrix = values.currentTransformMatrix;\n const targetMatrix = values.targetTransformMatrix;\n const newMatrix = new Array(9);\n for (let i = 0; i < 9; i++) {\n newMatrix[i] =\n progress * (targetMatrix[i] - currentMatrix[i]) +\n currentMatrix[i];\n }\n newStyles.transformMatrix = newMatrix;\n } else {\n // PropertyName == propertyName with capitalized fist letter, (width -> Width)\n const PropertyName = (propertyName.charAt(0).toUpperCase() +\n propertyName.slice(1)) as Capitalize<LayoutAnimationsOptions>;\n const currentPropertyName = `current${PropertyName}` as const;\n const targetPropertyName = `target${PropertyName}` as const;\n\n const currentValue = values[currentPropertyName];\n const targetValue = values[targetPropertyName];\n\n newStyles[propertyName] =\n progress * (targetValue - currentValue) + currentValue;\n }\n }\n global._notifyAboutProgress(viewTag, newStyles, true);\n };\n }\n\n // static builder methods i.e. shared transition modifiers\n\n /**\n * Lets you create a custom shared transition animation. Other shared transition modifiers can be chained alongside this modifier.\n *\n * @param customAnimationFactory - Callback function that have to return an object with styles for the custom shared transition.\n * @returns A {@link SharedTransition} object. Styles returned from this function need to be to the `sharedTransitionStyle` prop.\n * @see https://docs.swmansion.com/react-native-reanimated/docs/shared-element-transitions/overview\n * @experimental\n */\n public static custom(\n customAnimationFactory: AnimationFactory\n ): SharedTransition {\n return new SharedTransition().custom(customAnimationFactory);\n }\n\n /**\n * Lets you change the duration of the shared transition. Other shared transition modifiers can be chained alongside this modifier.\n *\n * @param duration - The duration of the shared transition animation in milliseconds.\n * @see https://docs.swmansion.com/react-native-reanimated/docs/shared-element-transitions/overview\n * @experimental\n */\n public static duration(duration: number): SharedTransition {\n return new SharedTransition().duration(duration);\n }\n\n /**\n * Lets you create a shared transition animation bound to the progress between navigation screens. Other shared transition modifiers can be chained alongside this modifier.\n *\n * @param progressAnimationCallback - A callback called with the current progress value on every animation frame. It should return an object with styles for the shared transition.\n * @see https://docs.swmansion.com/react-native-reanimated/docs/shared-element-transitions/overview\n * @experimental\n */\n public static progressAnimation(\n progressAnimationCallback: CustomProgressAnimation\n ): SharedTransition {\n return new SharedTransition().progressAnimation(progressAnimationCallback);\n }\n\n /**\n * Whether the transition is progress-bound or not. Other shared transition modifiers can be chained alongside this modifier.\n *\n * @param transitionType - Type of the transition. Configured with {@link SharedTransitionType} enum.\n * @see https://docs.swmansion.com/react-native-reanimated/docs/shared-element-transitions/overview\n * @experimental\n */\n public static defaultTransitionType(\n transitionType: SharedTransitionType\n ): SharedTransition {\n return new SharedTransition().defaultTransitionType(transitionType);\n }\n\n /**\n * Lets you adjust the behavior when the device's reduced motion accessibility setting is turned on. Other shared transition modifiers can be chained alongside this modifier.\n *\n * @param reduceMotion - Determines how the animation responds to the device's reduced motion accessibility setting. Default to `ReduceMotion.System` - {@link ReduceMotion}.\n * @see https://docs.swmansion.com/react-native-reanimated/docs/shared-element-transitions/overview\n * @experimental\n */\n public static reduceMotion(reduceMotion: ReduceMotion): SharedTransition {\n return new SharedTransition().reduceMotion(reduceMotion);\n }\n}\n"],"mappings":"AAAA,YAAY;;AAAC,SAAAA,gBAAAC,GAAA,EAAAC,GAAA,EA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ACA,YAA0B,EAAoB;IACvE,OAAO,IAAIlB,gBAAgB,CAAC,CAAC,CAACkB,YAAY,CAACA,YAAY,CAAC;EAC1D;AACF;AAAC/C,eAAA,CApRY6B,gBAAgB,gCAQiB,IAAIJ,yBAAyB,CAAC,CAAC","ignoreList":[]}
|
package/lib/module/reanimated2/layoutReanimation/sharedTransitions/SharedTransition.web.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ReduceMotion","SharedTransition","custom","progressAnimation","duration","reduceMotion","defaultTransitionType","registerTransition","unregisterTransition","getReduceMotion","System"],"sources":["SharedTransition.web.ts"],"sourcesContent":["'use strict';\nimport { ReduceMotion } from '../../commonTypes';\n\nexport class SharedTransition {\n public custom(): SharedTransition {\n return this;\n }\n\n public progressAnimation(): SharedTransition {\n return this;\n }\n\n public duration(): SharedTransition {\n return this;\n }\n\n public reduceMotion(): this {\n return this;\n }\n\n public defaultTransitionType(): SharedTransition {\n return this;\n }\n\n public registerTransition(): void {\n // no-op\n }\n\n public unregisterTransition(): void {\n // no-op\n }\n\n public getReduceMotion(): ReduceMotion {\n return ReduceMotion.System;\n }\n\n // static builder methods\n\n public static custom(): SharedTransition {\n return new SharedTransition();\n }\n\n public static duration(): SharedTransition {\n return new SharedTransition();\n }\n\n public static progressAnimation(): SharedTransition {\n return new SharedTransition();\n }\n\n public static defaultTransitionType(): SharedTransition {\n return new SharedTransition();\n }\n\n public static reduceMotion(): SharedTransition {\n return new SharedTransition();\n }\n}\n"],"mappings":"AAAA,YAAY;;AACZ,SAASA,YAAY,QAAQ,mBAAmB;AAEhD,OAAO,MAAMC,gBAAgB,CAAC;EACrBC,MAAMA,CAAA,EAAqB;IAChC,OAAO,IAAI;EACb;EAEOC,iBAAiBA,CAAA,EAAqB;IAC3C,OAAO,IAAI;EACb;EAEOC,QAAQA,CAAA,EAAqB;IAClC,OAAO,IAAI;EACb;EAEOC,YAAYA,CAAA,EAAS;IAC1B,OAAO,IAAI;EACb;EAEOC,qBAAqBA,CAAA,EAAqB;IAC/C,OAAO,IAAI;EACb;EAEOC,kBAAkBA,CAAA,EAAS;IAChC;EAAA;EAGKC,oBAAoBA,CAAA,EAAS;IAClC;EAAA;EAGKC,eAAeA,CAAA,EAAiB;IACrC,OAAOT,YAAY,CAACU,MAAM;EAC5B;;EAEA;;EAEA,OAAcR,MAAMA,CAAA,EAAqB;IACvC,OAAO,IAAID,gBAAgB,
|
|
1
|
+
{"version":3,"names":["ReduceMotion","SharedTransition","custom","progressAnimation","duration","reduceMotion","defaultTransitionType","registerTransition","unregisterTransition","getReduceMotion","System"],"sources":["SharedTransition.web.ts"],"sourcesContent":["'use strict';\nimport { ReduceMotion } from '../../commonTypes';\n\nexport class SharedTransition {\n public custom(): SharedTransition {\n return this;\n }\n\n public progressAnimation(): SharedTransition {\n return this;\n }\n\n public duration(): SharedTransition {\n return this;\n }\n\n public reduceMotion(): this {\n return this;\n }\n\n public defaultTransitionType(): SharedTransition {\n return this;\n }\n\n public registerTransition(): void {\n // no-op\n }\n\n public unregisterTransition(): void {\n // no-op\n }\n\n public getReduceMotion(): ReduceMotion {\n return ReduceMotion.System;\n }\n\n // static builder methods\n\n public static custom(): SharedTransition {\n return new SharedTransition();\n }\n\n public static duration(): SharedTransition {\n return new SharedTransition();\n }\n\n public static progressAnimation(): SharedTransition {\n return new SharedTransition();\n }\n\n public static defaultTransitionType(): SharedTransition {\n return new SharedTransition();\n }\n\n public static reduceMotion(): SharedTransition {\n return new SharedTransition();\n }\n}\n"],"mappings":"AAAA,YAAY;;AACZ,SAASA,YAAY,QAAQ,mBAAmB;AAEhD,OAAO,MAAMC,gBAAgB,CAAC;EACrBC,MAAMA,CAAA,EAAqB;IAChC,OAAO,IAAI;EACb;EAEOC,iBAAiBA,CAAA,EAAqB;IAC3C,OAAO,IAAI;EACb;EAEOC,QAAQA,CAAA,EAAqB;IAClC,OAAO,IAAI;EACb;EAEOC,YAAYA,CAAA,EAAS;IAC1B,OAAO,IAAI;EACb;EAEOC,qBAAqBA,CAAA,EAAqB;IAC/C,OAAO,IAAI;EACb;EAEOC,kBAAkBA,CAAA,EAAS;IAChC;EAAA;EAGKC,oBAAoBA,CAAA,EAAS;IAClC;EAAA;EAGKC,eAAeA,CAAA,EAAiB;IACrC,OAAOT,YAAY,CAACU,MAAM;EAC5B;;EAEA;;EAEA,OAAcR,MAAMA,CAAA,EAAqB;IACvC,OAAO,IAAID,gBAAgB,CAAC,CAAC;EAC/B;EAEA,OAAcG,QAAQA,CAAA,EAAqB;IACzC,OAAO,IAAIH,gBAAgB,CAAC,CAAC;EAC/B;EAEA,OAAcE,iBAAiBA,CAAA,EAAqB;IAClD,OAAO,IAAIF,gBAAgB,CAAC,CAAC;EAC/B;EAEA,OAAcK,qBAAqBA,CAAA,EAAqB;IACtD,OAAO,IAAIL,gBAAgB,CAAC,CAAC;EAC/B;EAEA,OAAcI,YAAYA,CAAA,EAAqB;IAC7C,OAAO,IAAIJ,gBAAgB,CAAC,CAAC;EAC/B;AACF","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["'use strict';\nexport * from './SharedTransition';\nexport * from './ProgressTransitionManager';\n"],"mappings":"AAAA,YAAY;;AACZ,cAAc,oBAAoB;AAClC,cAAc,6BAA6B"}
|
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["'use strict';\nexport * from './SharedTransition';\nexport * from './ProgressTransitionManager';\n"],"mappings":"AAAA,YAAY;;AACZ,cAAc,oBAAoB;AAClC,cAAc,6BAA6B","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["convertAnimationObjectToKeyframes","DEFAULT_BOUNCE_TIME","BounceInData","BounceIn","name","style","transform","scale","duration","BounceInRight","translateX","BounceInLeft","BounceInUp","translateY","BounceInDown","BounceOutData","BounceOut","BounceOutRight","BounceOutLeft","BounceOutUp","BounceOutDown"],"sources":["Bounce.web.ts"],"sourcesContent":["'use strict';\nimport { convertAnimationObjectToKeyframes } from '../animationParser';\n\nconst DEFAULT_BOUNCE_TIME = 0.6;\n\nexport const BounceInData = {\n BounceIn: {\n name: 'BounceIn',\n style: {\n 0: { transform: [{ scale: 0 }] },\n 55: { transform: [{ scale: 1.2 }] },\n 70: { transform: [{ scale: 0.9 }] },\n 85: { transform: [{ scale: 1.1 }] },\n 100: { transform: [{ scale: 1 }] },\n },\n duration: DEFAULT_BOUNCE_TIME,\n },\n\n BounceInRight: {\n name: 'BounceInRight',\n style: {\n 0: { transform: [{ translateX: '100vw' }] },\n 55: { transform: [{ translateX: '-20px' }] },\n 70: { transform: [{ translateX: '10px' }] },\n 85: { transform: [{ translateX: '-10px' }] },\n 100: { transform: [{ translateX: '0px' }] },\n },\n duration: DEFAULT_BOUNCE_TIME,\n },\n\n BounceInLeft: {\n name: 'BounceInLeft',\n style: {\n 0: { transform: [{ translateX: '-100vw' }] },\n 55: { transform: [{ translateX: '20px' }] },\n 70: { transform: [{ translateX: '-10px' }] },\n 85: { transform: [{ translateX: '10px' }] },\n 100: { transform: [{ translateX: '0px' }] },\n },\n duration: DEFAULT_BOUNCE_TIME,\n },\n\n BounceInUp: {\n name: 'BounceInUp',\n style: {\n 0: { transform: [{ translateY: '-100vh' }] },\n 55: { transform: [{ translateY: '20px' }] },\n 70: { transform: [{ translateY: '-10px' }] },\n 85: { transform: [{ translateY: '10px' }] },\n 100: { transform: [{ translateY: '0px' }] },\n },\n duration: DEFAULT_BOUNCE_TIME,\n },\n\n BounceInDown: {\n name: 'BounceInDown',\n style: {\n 0: { transform: [{ translateY: '100vh' }] },\n 55: { transform: [{ translateY: '-20px' }] },\n 70: { transform: [{ translateY: '10px' }] },\n 85: { transform: [{ translateY: '-10px' }] },\n 100: { transform: [{ translateY: '0px' }] },\n },\n duration: DEFAULT_BOUNCE_TIME,\n },\n};\n\nexport const BounceOutData = {\n BounceOut: {\n name: 'BounceOut',\n style: {\n 15: { transform: [{ scale: 1.1 }] },\n 30: { transform: [{ scale: 0.9 }] },\n 45: { transform: [{ scale: 1.2 }] },\n 100: { transform: [{ scale: 0.1 }] },\n },\n duration: DEFAULT_BOUNCE_TIME,\n },\n\n BounceOutRight: {\n name: 'BounceOutRight',\n style: {\n 15: { transform: [{ translateX: '-10px' }] },\n 30: { transform: [{ translateX: '10px' }] },\n 45: { transform: [{ translateX: '-20px' }] },\n 100: { transform: [{ translateX: '100vh' }] },\n },\n duration: DEFAULT_BOUNCE_TIME,\n },\n\n BounceOutLeft: {\n name: 'BounceOutLeft',\n style: {\n 15: { transform: [{ translateX: '10px' }] },\n 30: { transform: [{ translateX: '-10px' }] },\n 45: { transform: [{ translateX: '20px' }] },\n 100: { transform: [{ translateX: '-100vh' }] },\n },\n duration: DEFAULT_BOUNCE_TIME,\n },\n\n BounceOutUp: {\n name: 'BounceOutUp',\n style: {\n 15: { transform: [{ translateY: '10px' }] },\n 30: { transform: [{ translateY: '-10px' }] },\n 45: { transform: [{ translateY: '20px' }] },\n 100: { transform: [{ translateY: '-100vh' }] },\n },\n duration: DEFAULT_BOUNCE_TIME,\n },\n\n BounceOutDown: {\n name: 'BounceOutDown',\n style: {\n 15: { transform: [{ translateY: '-10px' }] },\n 30: { transform: [{ translateY: '10px' }] },\n 45: { transform: [{ translateY: '-20px' }] },\n 100: { transform: [{ translateY: '100vh' }] },\n },\n duration: DEFAULT_BOUNCE_TIME,\n },\n};\n\nexport const BounceIn = {\n BounceIn: {\n style: convertAnimationObjectToKeyframes(BounceInData.BounceIn),\n duration: BounceInData.BounceIn.duration,\n },\n BounceInRight: {\n style: convertAnimationObjectToKeyframes(BounceInData.BounceInRight),\n duration: BounceInData.BounceInRight.duration,\n },\n BounceInLeft: {\n style: convertAnimationObjectToKeyframes(BounceInData.BounceInLeft),\n duration: BounceInData.BounceInLeft.duration,\n },\n BounceInUp: {\n style: convertAnimationObjectToKeyframes(BounceInData.BounceInUp),\n duration: BounceInData.BounceInUp.duration,\n },\n BounceInDown: {\n style: convertAnimationObjectToKeyframes(BounceInData.BounceInDown),\n duration: BounceInData.BounceInDown.duration,\n },\n};\n\nexport const BounceOut = {\n BounceOut: {\n style: convertAnimationObjectToKeyframes(BounceOutData.BounceOut),\n duration: BounceOutData.BounceOut.duration,\n },\n BounceOutRight: {\n style: convertAnimationObjectToKeyframes(BounceOutData.BounceOutRight),\n duration: BounceOutData.BounceOutRight.duration,\n },\n BounceOutLeft: {\n style: convertAnimationObjectToKeyframes(BounceOutData.BounceOutLeft),\n duration: BounceOutData.BounceOutLeft.duration,\n },\n BounceOutUp: {\n style: convertAnimationObjectToKeyframes(BounceOutData.BounceOutUp),\n duration: BounceOutData.BounceOutUp.duration,\n },\n BounceOutDown: {\n style: convertAnimationObjectToKeyframes(BounceOutData.BounceOutDown),\n duration: BounceOutData.BounceOutDown.duration,\n },\n};\n"],"mappings":"AAAA,YAAY;;AACZ,SAASA,iCAAiC,QAAQ,oBAAoB;AAEtE,MAAMC,mBAAmB,GAAG,GAAG;AAE/B,OAAO,MAAMC,YAAY,GAAG;EAC1BC,QAAQ,EAAE;IACRC,IAAI,EAAE,UAAU;IAChBC,KAAK,EAAE;MACL,CAAC,EAAE;QAAEC,SAAS,EAAE,CAAC;UAAEC,KAAK,EAAE;QAAE,CAAC;MAAE,CAAC;MAChC,EAAE,EAAE;QAAED,SAAS,EAAE,CAAC;UAAEC,KAAK,EAAE;QAAI,CAAC;MAAE,CAAC;MACnC,EAAE,EAAE;QAAED,SAAS,EAAE,CAAC;UAAEC,KAAK,EAAE;QAAI,CAAC;MAAE,CAAC;MACnC,EAAE,EAAE;QAAED,SAAS,EAAE,CAAC;UAAEC,KAAK,EAAE;QAAI,CAAC;MAAE,CAAC;MACnC,GAAG,EAAE;QAAED,SAAS,EAAE,CAAC;UAAEC,KAAK,EAAE;QAAE,CAAC;MAAE;IACnC,CAAC;IACDC,QAAQ,EAAEP;EACZ,CAAC;EAEDQ,aAAa,EAAE;IACbL,IAAI,EAAE,eAAe;IACrBC,K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AAY,CAACU,UAAU,CAAC;IACjEJ,QAAQ,EAAEN,YAAY,CAACU,UAAU,CAACJ;EACpC,CAAC;EACDM,YAAY,EAAE;IACZT,KAAK,EAAEL,iCAAiC,CAACE,YAAY,CAACY,YAAY,CAAC;IACnEN,QAAQ,EAAEN,YAAY,CAACY,YAAY,CAACN;EACtC;AACF,CAAC;AAED,OAAO,MAAMQ,SAAS,GAAG;EACvBA,SAAS,EAAE;IACTX,KAAK,EAAEL,iCAAiC,CAACe,aAAa,CAACC,SAAS,CAAC;IACjER,QAAQ,EAAEO,aAAa,CAACC,SAAS,CAACR;EACpC,CAAC;EACDS,cAAc,EAAE;IACdZ,KAAK,EAAEL,iCAAiC,CAACe,aAAa,CAACE,cAAc,CAAC;IACtET,QAAQ,EAAEO,aAAa,CAACE,cAAc,CAACT;EACzC,CAAC;EACDU,aAAa,EAAE;IACbb,KAAK,EAAEL,iCAAiC,CAACe,aAAa,CAACG,aAAa,CAAC;IACrEV,QAAQ,EAAEO,aAAa,CAACG,aAAa,CAACV;EACxC,CAAC;EACDW,WAAW,EAAE;IACXd,KAAK,EAAEL,iCAAiC,CAACe,aAAa,CAACI,WAAW,CAAC;IACnEX,QAAQ,EAAEO,aAAa,CAACI,WAAW,CAACX;EACtC,CAAC;EACDY,aAAa,EAAE;IACbf,KAAK,EAAEL,iCAAiC,CAACe,aAAa,CAACK,aAAa,CAAC;IACrEZ,QAAQ,EAAEO,aAAa,CAACK,aAAa,CAACZ;EACxC;AACF,CAAC"}
|
|
1
|
+
{"version":3,"names":["convertAnimationObjectToKeyframes","DEFAULT_BOUNCE_TIME","BounceInData","BounceIn","name","style","transform","scale","duration","BounceInRight","translateX","BounceInLeft","BounceInUp","translateY","BounceInDown","BounceOutData","BounceOut","BounceOutRight","BounceOutLeft","BounceOutUp","BounceOutDown"],"sources":["Bounce.web.ts"],"sourcesContent":["'use strict';\nimport { convertAnimationObjectToKeyframes } from '../animationParser';\n\nconst DEFAULT_BOUNCE_TIME = 0.6;\n\nexport const BounceInData = {\n BounceIn: {\n name: 'BounceIn',\n style: {\n 0: { transform: [{ scale: 0 }] },\n 55: { transform: [{ scale: 1.2 }] },\n 70: { transform: [{ scale: 0.9 }] },\n 85: { transform: [{ scale: 1.1 }] },\n 100: { transform: [{ scale: 1 }] },\n },\n duration: DEFAULT_BOUNCE_TIME,\n },\n\n BounceInRight: {\n name: 'BounceInRight',\n style: {\n 0: { transform: [{ translateX: '100vw' }] },\n 55: { transform: [{ translateX: '-20px' }] },\n 70: { transform: [{ translateX: '10px' }] },\n 85: { transform: [{ translateX: '-10px' }] },\n 100: { transform: [{ translateX: '0px' }] },\n },\n duration: DEFAULT_BOUNCE_TIME,\n },\n\n BounceInLeft: {\n name: 'BounceInLeft',\n style: {\n 0: { transform: [{ translateX: '-100vw' }] },\n 55: { transform: [{ translateX: '20px' }] },\n 70: { transform: [{ translateX: '-10px' }] },\n 85: { transform: [{ translateX: '10px' }] },\n 100: { transform: [{ translateX: '0px' }] },\n },\n duration: DEFAULT_BOUNCE_TIME,\n },\n\n BounceInUp: {\n name: 'BounceInUp',\n style: {\n 0: { transform: [{ translateY: '-100vh' }] },\n 55: { transform: [{ translateY: '20px' }] },\n 70: { transform: [{ translateY: '-10px' }] },\n 85: { transform: [{ translateY: '10px' }] },\n 100: { transform: [{ translateY: '0px' }] },\n },\n duration: DEFAULT_BOUNCE_TIME,\n },\n\n BounceInDown: {\n name: 'BounceInDown',\n style: {\n 0: { transform: [{ translateY: '100vh' }] },\n 55: { transform: [{ translateY: '-20px' }] },\n 70: { transform: [{ translateY: '10px' }] },\n 85: { transform: [{ translateY: '-10px' }] },\n 100: { transform: [{ translateY: '0px' }] },\n },\n duration: DEFAULT_BOUNCE_TIME,\n },\n};\n\nexport const BounceOutData = {\n BounceOut: {\n name: 'BounceOut',\n style: {\n 15: { transform: [{ scale: 1.1 }] },\n 30: { transform: [{ scale: 0.9 }] },\n 45: { transform: [{ scale: 1.2 }] },\n 100: { transform: [{ scale: 0.1 }] },\n },\n duration: DEFAULT_BOUNCE_TIME,\n },\n\n BounceOutRight: {\n name: 'BounceOutRight',\n style: {\n 15: { transform: [{ translateX: '-10px' }] },\n 30: { transform: [{ translateX: '10px' }] },\n 45: { transform: [{ translateX: '-20px' }] },\n 100: { transform: [{ translateX: '100vh' }] },\n },\n duration: DEFAULT_BOUNCE_TIME,\n },\n\n BounceOutLeft: {\n name: 'BounceOutLeft',\n style: {\n 15: { transform: [{ translateX: '10px' }] },\n 30: { transform: [{ translateX: '-10px' }] },\n 45: { transform: [{ translateX: '20px' }] },\n 100: { transform: [{ translateX: '-100vh' }] },\n },\n duration: DEFAULT_BOUNCE_TIME,\n },\n\n BounceOutUp: {\n name: 'BounceOutUp',\n style: {\n 15: { transform: [{ translateY: '10px' }] },\n 30: { transform: [{ translateY: '-10px' }] },\n 45: { transform: [{ translateY: '20px' }] },\n 100: { transform: [{ translateY: '-100vh' }] },\n },\n duration: DEFAULT_BOUNCE_TIME,\n },\n\n BounceOutDown: {\n name: 'BounceOutDown',\n style: {\n 15: { transform: [{ translateY: '-10px' }] },\n 30: { transform: [{ translateY: '10px' }] },\n 45: { transform: [{ translateY: '-20px' }] },\n 100: { transform: [{ translateY: '100vh' }] },\n },\n duration: DEFAULT_BOUNCE_TIME,\n },\n};\n\nexport const BounceIn = {\n BounceIn: {\n style: convertAnimationObjectToKeyframes(BounceInData.BounceIn),\n duration: BounceInData.BounceIn.duration,\n },\n BounceInRight: {\n style: convertAnimationObjectToKeyframes(BounceInData.BounceInRight),\n duration: BounceInData.BounceInRight.duration,\n },\n BounceInLeft: {\n style: convertAnimationObjectToKeyframes(BounceInData.BounceInLeft),\n duration: BounceInData.BounceInLeft.duration,\n },\n BounceInUp: {\n style: convertAnimationObjectToKeyframes(BounceInData.BounceInUp),\n duration: BounceInData.BounceInUp.duration,\n },\n BounceInDown: {\n style: convertAnimationObjectToKeyframes(BounceInData.BounceInDown),\n duration: BounceInData.BounceInDown.duration,\n },\n};\n\nexport const BounceOut = {\n BounceOut: {\n style: convertAnimationObjectToKeyframes(BounceOutData.BounceOut),\n duration: BounceOutData.BounceOut.duration,\n },\n BounceOutRight: {\n style: convertAnimationObjectToKeyframes(BounceOutData.BounceOutRight),\n duration: BounceOutData.BounceOutRight.duration,\n },\n BounceOutLeft: {\n style: convertAnimationObjectToKeyframes(BounceOutData.BounceOutLeft),\n duration: BounceOutData.BounceOutLeft.duration,\n },\n BounceOutUp: {\n style: convertAnimationObjectToKeyframes(BounceOutData.BounceOutUp),\n duration: BounceOutData.BounceOutUp.duration,\n },\n BounceOutDown: {\n style: convertAnimationObjectToKeyframes(BounceOutData.BounceOutDown),\n duration: BounceOutData.BounceOutDown.duration,\n },\n};\n"],"mappings":"AAAA,YAAY;;AACZ,SAASA,iCAAiC,QAAQ,oBAAoB;AAEtE,MAAMC,mBAAmB,GAAG,GAAG;AAE/B,OAAO,MAAMC,YAAY,GAAG;EAC1BC,QAAQ,EAAE;IACRC,IAAI,EAAE,UAAU;IAChBC,KAAK,EAAE;MACL,CAAC,EAAE;QAAEC,SAAS,EAAE,CAAC;UAAEC,KAAK,EAAE;QAAE,CAAC;MAAE,CAAC;MAChC,EAAE,EAAE;QAAED,SAAS,EAAE,CAAC;UAAEC,KAAK,EAAE;QAAI,CAAC;MAAE,CAAC;MACnC,EAAE,EAAE;QAAED,SAAS,EAAE,CAAC;UAAEC,KAAK,EAAE;QAAI,CAAC;MAAE,CAAC;MACnC,EAAE,EAAE;QAAED,SAAS,EAAE,CAAC;UAAEC,KAAK,EAAE;QAAI,CAAC;MAAE,CAAC;MACnC,GAAG,EAAE;QAAED,SAAS,EAAE,CAAC;UAAEC,KAAK,EAAE;QAAE,CAAC;MAAE;IACnC,CAAC;IACDC,QAAQ,EAAEP;EACZ,CAAC;EAEDQ,aAAa,EAAE;IACbL,IAAI,EAAE,eAAe;IACrBC,KAAK,EAAE;MACL,CAAC,EAAE;QAAEC,SAAS,EAAE,CAAC;UAAEI,UAAU,EAAE;QAAQ,CAAC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