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","arg","_toPrimitive","String","input","hint","prim","Symbol","toPrimitive","undefined","res","call","TypeError","Number","isChromeDebugger","isJest","isWeb","isWindowAvailable","SensorType","mockedRequestAnimationFrame","requestAnimationFrameImpl","globalThis","requestAnimationFrame","JSReanimated","constructor","Map","sensor","sensorType","eventHandler","ACCELEROMETER","GRAVITY","x","y","z","platform","Platform","WEB_ANDROID","interfaceOrientation","GYROSCOPE","MAGNETIC_FIELD","ROTATION","qw","qx","qy","qz","quaternion","yaw","Math","atan2","pitch","sin","roll","makeShareableClone","Error","scheduleOnUI","worklet","createWorkletRuntime","_name","_initializer","scheduleOnRuntime","registerEventHandler","_eventHandler","_eventName","_emitterReactTag","unregisterEventHandler","_","enableLayoutAnimations","console","warn","configureLayoutAnimationBatch","setShouldAnimateExitingForTag","registerSensor","interval","_iosReferenceFrame","detectPlatform","getSensorName","window","location","protocol","WEB_IOS","initializeSensor","addEventListener","getSensorCallback","start","sensors","set","nextSensorId","unregisterSensor","id","get","stop","delete","subscribeForKeyboardEvents","unsubscribeFromKeyboardEvents","config","referenceFrame","frequency","Accelerometer","Gyroscope","GravitySensor","Magnetometer","AbsoluteOrientationSensor","userAgent","navigator","vendor","opera","UNKNOWN","test","WEB","getViewProp","_viewTag","_propName","_component","_callback","configureProps","executeOnUIRuntimeSync","_shareable"],"sources":["JSReanimated.ts"],"sourcesContent":["'use strict';\nimport {\n isChromeDebugger,\n isJest,\n isWeb,\n isWindowAvailable,\n} from '../PlatformChecker';\nimport type { ShareableRef, Value3D, ValueRotation } from '../commonTypes';\nimport { SensorType } from '../commonTypes';\nimport type { WebSensor } from './WebSensor';\nimport { mockedRequestAnimationFrame } from '../mockedRequestAnimationFrame';\nimport type { WorkletRuntime } from '../runtimes';\n\n// In Node.js environments (like when static rendering with Expo Router)\n// requestAnimationFrame is unavailable, so we use our mock.\n// It also has to be mocked for Jest purposes (see `initializeUIRuntime`).\nconst requestAnimationFrameImpl =\n isJest() || !globalThis.requestAnimationFrame\n ? mockedRequestAnimationFrame\n : globalThis.requestAnimationFrame;\n\nexport default class JSReanimated {\n nextSensorId = 0;\n sensors = new Map<number, WebSensor>();\n platform?: Platform = undefined;\n\n makeShareableClone<T>(): ShareableRef<T> {\n throw new Error(\n '[Reanimated] makeShareableClone should never be called in JSReanimated.'\n );\n }\n\n scheduleOnUI<T>(worklet: ShareableRef<T>) {\n // @ts-ignore web implementation has still not been updated after the rewrite, this will be addressed once the web implementation updates are ready\n requestAnimationFrameImpl(worklet);\n }\n\n createWorkletRuntime(\n _name: string,\n _initializer: ShareableRef<() => void>\n ): WorkletRuntime {\n throw new Error(\n '[Reanimated] createWorkletRuntime is not available in JSReanimated.'\n );\n }\n\n scheduleOnRuntime() {\n throw new Error(\n '[Reanimated] scheduleOnRuntime is not available in JSReanimated.'\n );\n }\n\n registerEventHandler<T>(\n _eventHandler: ShareableRef<T>,\n _eventName: string,\n _emitterReactTag: number\n ): number {\n // noop\n return -1;\n }\n\n unregisterEventHandler(_: number): void {\n // noop\n }\n\n enableLayoutAnimations() {\n if (isWeb()) {\n console.warn(\n '[Reanimated] Layout Animations are not supported on web yet.'\n );\n } else if (isJest()) {\n console.warn(\n '[Reanimated] Layout Animations are no-ops when using Jest.'\n );\n } else if (isChromeDebugger()) {\n console.warn(\n '[Reanimated] Layout Animations are no-ops when using Chrome Debugger.'\n );\n } else {\n console.warn(\n '[Reanimated] Layout Animations are not supported on this configuration.'\n );\n }\n }\n\n configureLayoutAnimationBatch() {\n // no-op\n }\n\n setShouldAnimateExitingForTag() {\n // no-op\n }\n\n registerSensor(\n sensorType: SensorType,\n interval: number,\n _iosReferenceFrame: number,\n eventHandler: ShareableRef<(data: Value3D | ValueRotation) => void>\n ): number {\n if (!isWindowAvailable()) {\n // the window object is unavailable when building the server portion of a site that uses SSG\n // this check is here to ensure that the server build won't fail\n return -1;\n }\n\n if (this.platform === undefined) {\n this.detectPlatform();\n }\n\n if (!(this.getSensorName(sensorType) in window)) {\n // https://w3c.github.io/sensors/#secure-context\n console.warn(\n '[Reanimated] Sensor is not available.' +\n (isWeb() && location.protocol !== 'https:'\n ? ' Make sure you use secure origin with `npx expo start --web --https`.'\n : '') +\n (this.platform === Platform.WEB_IOS\n ? ' For iOS web, you will also have to also grant permission in the browser: https://dev.to/li/how-to-requestpermission-for-devicemotion-and-deviceorientation-events-in-ios-13-46g2.'\n : '')\n );\n return -1;\n }\n\n if (this.platform === undefined) {\n this.detectPlatform();\n }\n\n const sensor: WebSensor = this.initializeSensor(sensorType, interval);\n sensor.addEventListener(\n 'reading',\n this.getSensorCallback(sensor, sensorType, eventHandler)\n );\n sensor.start();\n\n this.sensors.set(this.nextSensorId, sensor);\n return this.nextSensorId++;\n }\n\n getSensorCallback = (\n sensor: WebSensor,\n sensorType: SensorType,\n eventHandler: ShareableRef<(data: Value3D | ValueRotation) => void>\n ) => {\n switch (sensorType) {\n case SensorType.ACCELEROMETER:\n case SensorType.GRAVITY:\n return () => {\n let { x, y, z } = sensor;\n\n // Web Android sensors have a different coordinate system than iOS\n if (this.platform === Platform.WEB_ANDROID) {\n [x, y, z] = [-x, -y, -z];\n }\n // TODO TYPESCRIPT on web ShareableRef is the value itself so we call it directly\n (eventHandler as any)({ x, y, z, interfaceOrientation: 0 });\n };\n case SensorType.GYROSCOPE:\n case SensorType.MAGNETIC_FIELD:\n return () => {\n const { x, y, z } = sensor;\n // TODO TYPESCRIPT on web ShareableRef is the value itself so we call it directly\n (eventHandler as any)({ x, y, z, interfaceOrientation: 0 });\n };\n case SensorType.ROTATION:\n return () => {\n let [qw, qx, qy, qz] = sensor.quaternion;\n\n // Android sensors have a different coordinate system than iOS\n if (this.platform === Platform.WEB_ANDROID) {\n [qy, qz] = [qz, -qy];\n }\n\n // reference: https://stackoverflow.com/questions/5782658/extracting-yaw-from-a-quaternion\n const yaw = -Math.atan2(\n 2.0 * (qy * qz + qw * qx),\n qw * qw - qx * qx - qy * qy + qz * qz\n );\n const pitch = Math.sin(-2.0 * (qx * qz - qw * qy));\n const roll = -Math.atan2(\n 2.0 * (qx * qy + qw * qz),\n qw * qw + qx * qx - qy * qy - qz * qz\n );\n // TODO TYPESCRIPT on web ShareableRef is the value itself so we call it directly\n (eventHandler as any)({\n qw,\n qx,\n qy,\n qz,\n yaw,\n pitch,\n roll,\n interfaceOrientation: 0,\n });\n };\n }\n };\n\n unregisterSensor(id: number): void {\n const sensor: WebSensor | undefined = this.sensors.get(id);\n if (sensor !== undefined) {\n sensor.stop();\n this.sensors.delete(id);\n }\n }\n\n subscribeForKeyboardEvents(_: ShareableRef<number>): number {\n if (isWeb()) {\n console.warn(\n '[Reanimated] useAnimatedKeyboard is not available on web yet.'\n );\n } else if (isJest()) {\n console.warn(\n '[Reanimated] useAnimatedKeyboard is not available when using Jest.'\n );\n } else if (isChromeDebugger()) {\n console.warn(\n '[Reanimated] useAnimatedKeyboard is not available when using Chrome Debugger.'\n );\n } else {\n console.warn(\n '[Reanimated] useAnimatedKeyboard is not available on this configuration.'\n );\n }\n return -1;\n }\n\n unsubscribeFromKeyboardEvents(_: number): void {\n // noop\n }\n\n initializeSensor(sensorType: SensorType, interval: number): WebSensor {\n const config =\n interval <= 0\n ? { referenceFrame: 'device' }\n : { frequency: 1000 / interval };\n switch (sensorType) {\n case SensorType.ACCELEROMETER:\n return new window.Accelerometer(config);\n case SensorType.GYROSCOPE:\n return new window.Gyroscope(config);\n case SensorType.GRAVITY:\n return new window.GravitySensor(config);\n case SensorType.MAGNETIC_FIELD:\n return new window.Magnetometer(config);\n case SensorType.ROTATION:\n return new window.AbsoluteOrientationSensor(config);\n }\n }\n\n getSensorName(sensorType: SensorType): string {\n switch (sensorType) {\n case SensorType.ACCELEROMETER:\n return 'Accelerometer';\n case SensorType.GRAVITY:\n return 'GravitySensor';\n case SensorType.GYROSCOPE:\n return 'Gyroscope';\n case SensorType.MAGNETIC_FIELD:\n return 'Magnetometer';\n case SensorType.ROTATION:\n return 'AbsoluteOrientationSensor';\n }\n }\n\n detectPlatform() {\n const userAgent = navigator.userAgent || navigator.vendor || window.opera;\n if (userAgent === undefined) {\n this.platform = Platform.UNKNOWN;\n } else if (/iPad|iPhone|iPod/.test(userAgent)) {\n this.platform = Platform.WEB_IOS;\n } else if (/android/i.test(userAgent)) {\n this.platform = Platform.WEB_ANDROID;\n } else {\n this.platform = Platform.WEB;\n }\n }\n\n getViewProp<T>(\n _viewTag: number,\n _propName: string,\n _component?: React.Component,\n _callback?: (result: T) => void\n ): Promise<T> {\n throw new Error(\n '[Reanimated] getViewProp is not available in JSReanimated.'\n );\n }\n\n configureProps() {\n throw new Error(\n '[Reanimated] configureProps is not available in JSReanimated.'\n );\n }\n\n executeOnUIRuntimeSync<T, R>(_shareable: ShareableRef<T>): R {\n throw new Error(\n '[Reanimated] `executeOnUIRuntimeSync` is not available in JSReanimated.'\n );\n }\n}\n\nenum Platform {\n WEB_IOS = 'web iOS',\n WEB_ANDROID = 'web Android',\n WEB = 'web',\n UNKNOWN = 'unknown',\n}\n\ndeclare global {\n interface Navigator {\n userAgent?: string;\n vendor?: string;\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,G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|
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","isChromeDebugger","isJest","isWeb","isWindowAvailable","SensorType","mockedRequestAnimationFrame","requestAnimationFrameImpl","globalThis","requestAnimationFrame","JSReanimated","constructor","Map","undefined","sensor","sensorType","eventHandler","ACCELEROMETER","GRAVITY","x","y","z","platform","Platform","WEB_ANDROID","interfaceOrientation","GYROSCOPE","MAGNETIC_FIELD","ROTATION","qw","qx","qy","qz","quaternion","yaw","Math","atan2","pitch","sin","roll","makeShareableClone","Error","scheduleOnUI","worklet","createWorkletRuntime","_name","_initializer","scheduleOnRuntime","registerEventHandler","_eventHandler","_eventName","_emitterReactTag","unregisterEventHandler","_","enableLayoutAnimations","console","warn","configureLayoutAnimationBatch","setShouldAnimateExitingForTag","registerSensor","interval","_iosReferenceFrame","detectPlatform","getSensorName","window","location","protocol","WEB_IOS","initializeSensor","addEventListener","getSensorCallback","start","sensors","set","nextSensorId","unregisterSensor","id","get","stop","delete","subscribeForKeyboardEvents","unsubscribeFromKeyboardEvents","config","referenceFrame","frequency","Accelerometer","Gyroscope","GravitySensor","Magnetometer","AbsoluteOrientationSensor","userAgent","navigator","vendor","opera","UNKNOWN","test","WEB","getViewProp","_viewTag","_propName","_component","_callback","configureProps","executeOnUIRuntimeSync","_shareable"],"sources":["JSReanimated.ts"],"sourcesContent":["'use strict';\nimport {\n isChromeDebugger,\n isJest,\n isWeb,\n isWindowAvailable,\n} from '../PlatformChecker';\nimport type { ShareableRef, Value3D, ValueRotation } from '../commonTypes';\nimport { SensorType } from '../commonTypes';\nimport type { WebSensor } from './WebSensor';\nimport { mockedRequestAnimationFrame } from '../mockedRequestAnimationFrame';\nimport type { WorkletRuntime } from '../runtimes';\n\n// In Node.js environments (like when static rendering with Expo Router)\n// requestAnimationFrame is unavailable, so we use our mock.\n// It also has to be mocked for Jest purposes (see `initializeUIRuntime`).\nconst requestAnimationFrameImpl =\n isJest() || !globalThis.requestAnimationFrame\n ? mockedRequestAnimationFrame\n : globalThis.requestAnimationFrame;\n\nexport default class JSReanimated {\n nextSensorId = 0;\n sensors = new Map<number, WebSensor>();\n platform?: Platform = undefined;\n\n makeShareableClone<T>(): ShareableRef<T> {\n throw new Error(\n '[Reanimated] makeShareableClone should never be called in JSReanimated.'\n );\n }\n\n scheduleOnUI<T>(worklet: ShareableRef<T>) {\n // @ts-ignore web implementation has still not been updated after the rewrite, this will be addressed once the web implementation updates are ready\n requestAnimationFrameImpl(worklet);\n }\n\n createWorkletRuntime(\n _name: string,\n _initializer: ShareableRef<() => void>\n ): WorkletRuntime {\n throw new Error(\n '[Reanimated] createWorkletRuntime is not available in JSReanimated.'\n );\n }\n\n scheduleOnRuntime() {\n throw new Error(\n '[Reanimated] scheduleOnRuntime is not available in JSReanimated.'\n );\n }\n\n registerEventHandler<T>(\n _eventHandler: ShareableRef<T>,\n _eventName: string,\n _emitterReactTag: number\n ): number {\n throw new Error(\n '[Reanimated] registerEventHandler is not available in JSReanimated.'\n );\n }\n\n unregisterEventHandler(_: number): void {\n throw new Error(\n '[Reanimated] unregisterEventHandler is not available in JSReanimated.'\n );\n }\n\n enableLayoutAnimations() {\n if (isWeb()) {\n console.warn(\n '[Reanimated] Layout Animations are not supported on web yet.'\n );\n } else if (isJest()) {\n console.warn(\n '[Reanimated] Layout Animations are no-ops when using Jest.'\n );\n } else if (isChromeDebugger()) {\n console.warn(\n '[Reanimated] Layout Animations are no-ops when using Chrome Debugger.'\n );\n } else {\n console.warn(\n '[Reanimated] Layout Animations are not supported on this configuration.'\n );\n }\n }\n\n configureLayoutAnimationBatch() {\n // no-op\n }\n\n setShouldAnimateExitingForTag() {\n // no-op\n }\n\n registerSensor(\n sensorType: SensorType,\n interval: number,\n _iosReferenceFrame: number,\n eventHandler: ShareableRef<(data: Value3D | ValueRotation) => void>\n ): number {\n if (!isWindowAvailable()) {\n // the window object is unavailable when building the server portion of a site that uses SSG\n // this check is here to ensure that the server build won't fail\n return -1;\n }\n\n if (this.platform === undefined) {\n this.detectPlatform();\n }\n\n if (!(this.getSensorName(sensorType) in window)) {\n // https://w3c.github.io/sensors/#secure-context\n console.warn(\n '[Reanimated] Sensor is not available.' +\n (isWeb() && location.protocol !== 'https:'\n ? ' Make sure you use secure origin with `npx expo start --web --https`.'\n : '') +\n (this.platform === Platform.WEB_IOS\n ? ' For iOS web, you will also have to also grant permission in the browser: https://dev.to/li/how-to-requestpermission-for-devicemotion-and-deviceorientation-events-in-ios-13-46g2.'\n : '')\n );\n return -1;\n }\n\n if (this.platform === undefined) {\n this.detectPlatform();\n }\n\n const sensor: WebSensor = this.initializeSensor(sensorType, interval);\n sensor.addEventListener(\n 'reading',\n this.getSensorCallback(sensor, sensorType, eventHandler)\n );\n sensor.start();\n\n this.sensors.set(this.nextSensorId, sensor);\n return this.nextSensorId++;\n }\n\n getSensorCallback = (\n sensor: WebSensor,\n sensorType: SensorType,\n eventHandler: ShareableRef<(data: Value3D | ValueRotation) => void>\n ) => {\n switch (sensorType) {\n case SensorType.ACCELEROMETER:\n case SensorType.GRAVITY:\n return () => {\n let { x, y, z } = sensor;\n\n // Web Android sensors have a different coordinate system than iOS\n if (this.platform === Platform.WEB_ANDROID) {\n [x, y, z] = [-x, -y, -z];\n }\n // TODO TYPESCRIPT on web ShareableRef is the value itself so we call it directly\n (eventHandler as any)({ x, y, z, interfaceOrientation: 0 });\n };\n case SensorType.GYROSCOPE:\n case SensorType.MAGNETIC_FIELD:\n return () => {\n const { x, y, z } = sensor;\n // TODO TYPESCRIPT on web ShareableRef is the value itself so we call it directly\n (eventHandler as any)({ x, y, z, interfaceOrientation: 0 });\n };\n case SensorType.ROTATION:\n return () => {\n let [qw, qx, qy, qz] = sensor.quaternion;\n\n // Android sensors have a different coordinate system than iOS\n if (this.platform === Platform.WEB_ANDROID) {\n [qy, qz] = [qz, -qy];\n }\n\n // reference: https://stackoverflow.com/questions/5782658/extracting-yaw-from-a-quaternion\n const yaw = -Math.atan2(\n 2.0 * (qy * qz + qw * qx),\n qw * qw - qx * qx - qy * qy + qz * qz\n );\n const pitch = Math.sin(-2.0 * (qx * qz - qw * qy));\n const roll = -Math.atan2(\n 2.0 * (qx * qy + qw * qz),\n qw * qw + qx * qx - qy * qy - qz * qz\n );\n // TODO TYPESCRIPT on web ShareableRef is the value itself so we call it directly\n (eventHandler as any)({\n qw,\n qx,\n qy,\n qz,\n yaw,\n pitch,\n roll,\n interfaceOrientation: 0,\n });\n };\n }\n };\n\n unregisterSensor(id: number): void {\n const sensor: WebSensor | undefined = this.sensors.get(id);\n if (sensor !== undefined) {\n sensor.stop();\n this.sensors.delete(id);\n }\n }\n\n subscribeForKeyboardEvents(_: ShareableRef<number>): number {\n if (isWeb()) {\n console.warn(\n '[Reanimated] useAnimatedKeyboard is not available on web yet.'\n );\n } else if (isJest()) {\n console.warn(\n '[Reanimated] useAnimatedKeyboard is not available when using Jest.'\n );\n } else if (isChromeDebugger()) {\n console.warn(\n '[Reanimated] useAnimatedKeyboard is not available when using Chrome Debugger.'\n );\n } else {\n console.warn(\n '[Reanimated] useAnimatedKeyboard is not available on this configuration.'\n );\n }\n return -1;\n }\n\n unsubscribeFromKeyboardEvents(_: number): void {\n // noop\n }\n\n initializeSensor(sensorType: SensorType, interval: number): WebSensor {\n const config =\n interval <= 0\n ? { referenceFrame: 'device' }\n : { frequency: 1000 / interval };\n switch (sensorType) {\n case SensorType.ACCELEROMETER:\n return new window.Accelerometer(config);\n case SensorType.GYROSCOPE:\n return new window.Gyroscope(config);\n case SensorType.GRAVITY:\n return new window.GravitySensor(config);\n case SensorType.MAGNETIC_FIELD:\n return new window.Magnetometer(config);\n case SensorType.ROTATION:\n return new window.AbsoluteOrientationSensor(config);\n }\n }\n\n getSensorName(sensorType: SensorType): string {\n switch (sensorType) {\n case SensorType.ACCELEROMETER:\n return 'Accelerometer';\n case SensorType.GRAVITY:\n return 'GravitySensor';\n case SensorType.GYROSCOPE:\n return 'Gyroscope';\n case SensorType.MAGNETIC_FIELD:\n return 'Magnetometer';\n case SensorType.ROTATION:\n return 'AbsoluteOrientationSensor';\n }\n }\n\n detectPlatform() {\n const userAgent = navigator.userAgent || navigator.vendor || window.opera;\n if (userAgent === undefined) {\n this.platform = Platform.UNKNOWN;\n } else if (/iPad|iPhone|iPod/.test(userAgent)) {\n this.platform = Platform.WEB_IOS;\n } else if (/android/i.test(userAgent)) {\n this.platform = Platform.WEB_ANDROID;\n } else {\n this.platform = Platform.WEB;\n }\n }\n\n getViewProp<T>(\n _viewTag: number,\n _propName: string,\n _component?: React.Component,\n _callback?: (result: T) => void\n ): Promise<T> {\n throw new Error(\n '[Reanimated] getViewProp is not available in JSReanimated.'\n );\n }\n\n configureProps() {\n throw new Error(\n '[Reanimated] configureProps is not available in JSReanimated.'\n );\n }\n\n executeOnUIRuntimeSync<T, R>(_shareable: ShareableRef<T>): R {\n throw new Error(\n '[Reanimated] `executeOnUIRuntimeSync` is not available in JSReanimated.'\n );\n }\n}\n\nenum Platform {\n WEB_IOS = 'web iOS',\n WEB_ANDROID = 'web Android',\n WEB = 'web',\n UNKNOWN = 'unknown',\n}\n\ndeclare global {\n interface Navigator {\n userAgent?: string;\n vendor?: string;\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,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[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["WebSensor.ts"],"sourcesContent":["'use strict';\nexport declare class WebSensor {\n start: () => void;\n stop: () => void;\n addEventListener: (eventType: string, eventHandler: () => void) => void;\n quaternion: [number, number, number, number];\n x: number;\n y: number;\n z: number;\n}\n\ntype configOptions =\n | {\n referenceFrame: string;\n frequency?: undefined;\n }\n | {\n frequency: number;\n referenceFrame?: undefined;\n };\n\ninterface Constructable<T> {\n new (config: configOptions): T;\n}\n\ndeclare global {\n interface Window {\n Accelerometer: Constructable<WebSensor>;\n GravitySensor: Constructable<WebSensor>;\n Gyroscope: Constructable<WebSensor>;\n Magnetometer: Constructable<WebSensor>;\n AbsoluteOrientationSensor: Constructable<WebSensor>;\n Sensor: Constructable<WebSensor>;\n opera?: string;\n }\n}\n"],"mappings":"AAAA,YAAY"}
|
|
1
|
+
{"version":3,"names":[],"sources":["WebSensor.ts"],"sourcesContent":["'use strict';\nexport declare class WebSensor {\n start: () => void;\n stop: () => void;\n addEventListener: (eventType: string, eventHandler: () => void) => void;\n quaternion: [number, number, number, number];\n x: number;\n y: number;\n z: number;\n}\n\ntype configOptions =\n | {\n referenceFrame: string;\n frequency?: undefined;\n }\n | {\n frequency: number;\n referenceFrame?: undefined;\n };\n\ninterface Constructable<T> {\n new (config: configOptions): T;\n}\n\ndeclare global {\n interface Window {\n Accelerometer: Constructable<WebSensor>;\n GravitySensor: Constructable<WebSensor>;\n Gyroscope: Constructable<WebSensor>;\n Magnetometer: Constructable<WebSensor>;\n AbsoluteOrientationSensor: Constructable<WebSensor>;\n Sensor: Constructable<WebSensor>;\n opera?: string;\n }\n}\n"],"mappings":"AAAA,YAAY","ignoreList":[]}
|
|
@@ -82,7 +82,7 @@ const setNativeProps = (component, newProps, isAnimatedProps) => {
|
|
|
82
82
|
}
|
|
83
83
|
// Only update UI props directly on the component,
|
|
84
84
|
// other props can be updated as standard style props.
|
|
85
|
-
(_component$setNativeP = component.setNativeProps) === null || _component$setNativeP === void 0
|
|
85
|
+
(_component$setNativeP = component.setNativeProps) === null || _component$setNativeP === void 0 || _component$setNativeP.call(component, uiProps);
|
|
86
86
|
}
|
|
87
87
|
const previousStyle = component.previousStyle ? component.previousStyle : {};
|
|
88
88
|
const currentStyle = {
|
|
@@ -90,7 +90,7 @@ const setNativeProps = (component, newProps, isAnimatedProps) => {
|
|
|
90
90
|
...newProps
|
|
91
91
|
};
|
|
92
92
|
component.previousStyle = currentStyle;
|
|
93
|
-
(_component$setNativeP2 = component.setNativeProps) === null || _component$setNativeP2 === void 0
|
|
93
|
+
(_component$setNativeP2 = component.setNativeProps) === null || _component$setNativeP2 === void 0 || _component$setNativeP2.call(component, {
|
|
94
94
|
style: currentStyle
|
|
95
95
|
});
|
|
96
96
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["JSReanimated","isWeb","PropsAllowlists","createReactDOMStyle","createTransformValue","createTextShadowValue","require","default","e","reanimatedJS","global","_makeShareableClone","Error","_scheduleOnJS","_scheduleOnRuntime","_updatePropsJS","updates","viewRef","isAnimatedProps","_component","component","rawStyles","Object","keys","reduce","acc","key","value","index","setNativeProps","undefined","style","updatePropsDOM","props","length","forEach","dashedKey","replace","m","toLowerCase","_touchableNode","setAttribute","componentName","className","console","warn","newProps","_component$setNativeP2","_component$setNativeP","uiProps","isNativeProp","call","previousStyle","currentStyle","domStyle","Array","isArray","transform","textShadowColor","textShadowRadius","textShadowOffset","textShadow","propName","NATIVE_THREAD_PROPS_WHITELIST"],"sources":["index.ts"],"sourcesContent":["'use strict';\nimport JSReanimated from './JSReanimated';\nimport type { StyleProps } from '../commonTypes';\nimport type { AnimatedStyle } from '../helperTypes';\nimport { isWeb } from '../PlatformChecker';\nimport { PropsAllowlists } from '../../propsAllowlists';\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nlet createReactDOMStyle: (style: any) => any;\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nlet createTransformValue: (transform: any) => any;\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nlet createTextShadowValue: (style: any) => void | string;\n\nif (isWeb()) {\n try {\n createReactDOMStyle =\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n require('react-native-web/dist/exports/StyleSheet/compiler/createReactDOMStyle').default;\n } catch (e) {}\n\n try {\n // React Native Web 0.19+\n createTransformValue =\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n require('react-native-web/dist/exports/StyleSheet/preprocess').createTransformValue;\n } catch (e) {}\n\n try {\n createTextShadowValue =\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n require('react-native-web/dist/exports/StyleSheet/preprocess').createTextShadowValue;\n } catch (e) {}\n}\n\nconst reanimatedJS = new JSReanimated();\n\nglobal._makeShareableClone = () => {\n throw new Error(\n '[Reanimated] _makeShareableClone should never be called in JSReanimated.'\n );\n};\n\nglobal._scheduleOnJS = () => {\n throw new Error(\n '[Reanimated] _scheduleOnJS should never be called in JSReanimated.'\n );\n};\n\nglobal._scheduleOnRuntime = () => {\n throw new Error(\n '[Reanimated] _scheduleOnRuntime should never be called in JSReanimated.'\n );\n};\n\ninterface JSReanimatedComponent {\n previousStyle: StyleProps;\n setNativeProps?: (style: StyleProps) => void;\n style?: StyleProps;\n props: Record<string, string | number>;\n _touchableNode: {\n setAttribute: (key: string, props: unknown) => void;\n };\n}\n\nexport interface ReanimatedHTMLElement extends HTMLElement {\n previousStyle: StyleProps;\n setNativeProps?: (style: StyleProps) => void;\n props: Record<string, string | number>;\n _touchableNode: {\n setAttribute: (key: string, props: unknown) => void;\n };\n reanimatedDummy?: boolean;\n removedAfterAnimation?: boolean;\n}\n\nexport const _updatePropsJS = (\n // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents\n updates: StyleProps | AnimatedStyle<any>,\n viewRef: { _component?: JSReanimatedComponent | ReanimatedHTMLElement },\n isAnimatedProps?: boolean\n): void => {\n if (viewRef._component) {\n const component = viewRef._component;\n const [rawStyles] = Object.keys(updates).reduce(\n (acc: [StyleProps, AnimatedStyle<any>], key) => {\n const value = updates[key];\n const index = typeof value === 'function' ? 1 : 0;\n acc[index][key] = value;\n return acc;\n },\n [{}, {}]\n );\n\n if (typeof component.setNativeProps === 'function') {\n // This is the legacy way to update props on React Native Web <= 0.18.\n // Also, some components (e.g. from react-native-svg) don't have styles\n // and always provide setNativeProps function instead (even on React Native Web 0.19+).\n setNativeProps(component, rawStyles, isAnimatedProps);\n } else if (\n createReactDOMStyle !== undefined &&\n component.style !== undefined\n ) {\n // React Native Web 0.19+ no longer provides setNativeProps function,\n // so we need to update DOM nodes directly.\n updatePropsDOM(component, rawStyles, isAnimatedProps);\n } else if (Object.keys(component.props).length > 0) {\n Object.keys(component.props).forEach((key) => {\n if (!rawStyles[key]) {\n return;\n }\n const dashedKey = key.replace(/[A-Z]/g, (m) => '-' + m.toLowerCase());\n component._touchableNode.setAttribute(dashedKey, rawStyles[key]);\n });\n } else {\n const componentName =\n 'className' in component ? component?.className : '';\n console.warn(\n `[Reanimated] It's not possible to manipulate the component ${componentName}`\n );\n }\n }\n};\n\nconst setNativeProps = (\n component: JSReanimatedComponent | ReanimatedHTMLElement,\n newProps: StyleProps,\n isAnimatedProps?: boolean\n): void => {\n if (isAnimatedProps) {\n const uiProps: Record<string, unknown> = {};\n for (const key in newProps) {\n if (isNativeProp(key)) {\n uiProps[key] = newProps[key];\n }\n }\n // Only update UI props directly on the component,\n // other props can be updated as standard style props.\n component.setNativeProps?.(uiProps);\n }\n\n const previousStyle = component.previousStyle ? component.previousStyle : {};\n const currentStyle = { ...previousStyle, ...newProps };\n component.previousStyle = currentStyle;\n\n component.setNativeProps?.({ style: currentStyle });\n};\n\nconst updatePropsDOM = (\n component: JSReanimatedComponent | HTMLElement,\n style: StyleProps,\n isAnimatedProps?: boolean\n): void => {\n const previousStyle = (component as JSReanimatedComponent).previousStyle\n ? (component as JSReanimatedComponent).previousStyle\n : {};\n const currentStyle = { ...previousStyle, ...style };\n (component as JSReanimatedComponent).previousStyle = currentStyle;\n\n const domStyle = createReactDOMStyle(currentStyle);\n if (Array.isArray(domStyle.transform) && createTransformValue !== undefined) {\n domStyle.transform = createTransformValue(domStyle.transform);\n }\n\n if (\n createTextShadowValue !== undefined &&\n (domStyle.textShadowColor ||\n domStyle.textShadowRadius ||\n domStyle.textShadowOffset)\n ) {\n domStyle.textShadow = createTextShadowValue({\n textShadowColor: domStyle.textShadowColor,\n textShadowOffset: domStyle.textShadowOffset,\n textShadowRadius: domStyle.textShadowRadius,\n });\n }\n\n for (const key in domStyle) {\n if (isAnimatedProps) {\n (component as HTMLElement).setAttribute(key, domStyle[key]);\n } else {\n (component.style as StyleProps)[key] = domStyle[key];\n }\n }\n};\n\nfunction isNativeProp(propName: string): boolean {\n return !!PropsAllowlists.NATIVE_THREAD_PROPS_WHITELIST[propName];\n}\n\nexport default reanimatedJS;\n"],"mappings":"AAAA,YAAY;;AACZ,OAAOA,YAAY,MAAM,gBAAgB;AAGzC,SAASC,KAAK,QAAQ,oBAAoB;AAC1C,SAASC,eAAe,QAAQ,uBAAuB;;AAEvD;AACA,IAAIC,mBAAwC;AAC5C;AACA,IAAIC,oBAA6C;AACjD;AACA,IAAIC,qBAAoD;AAExD,IAAIJ,KAAK,EAAE,EAAE;EACX,IAAI;IACFE,mBAAmB;IACjB;IACAG,OAAO,CAAC,uEAAuE,CAAC,CAACC,OAAO;EAC5F,CAAC,CAAC,OAAOC,CAAC,EAAE,CAAC;EAEb,IAAI;IACF;IACAJ,oBAAoB;IAClB;IACAE,OAAO,CAAC,qDAAqD,CAAC,CAACF,oBAAoB;EACvF,CAAC,CAAC,OAAOI,CAAC,EAAE,CAAC;EAEb,IAAI;IACFH,qBAAqB;IACnB;IACAC,OAAO,CAAC,qDAAqD,CAAC,CAACD,qBAAqB;EACxF,CAAC,CAAC,OAAOG,CAAC,EAAE,CAAC;AACf;AAEA,MAAMC,YAAY,GAAG,IAAIT,YAAY,EAAE;AAEvCU,MAAM,CAACC,mBAAmB,GAA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MAAM;MACJN,SAAS,CAACW,KAAK,CAAgBL,GAAG,CAAC,GAAG4B,QAAQ,CAAC5B,GAAG,CAAC;IACtD;EACF;AACF,CAAC;AAED,SAASwB,YAAYA,CAACY,QAAgB,EAAW;EAC/C,OAAO,CAAC,CAAC5D,eAAe,CAAC6D,6BAA6B,CAACD,QAAQ,CAAC;AAClE;AAEA,eAAerD,YAAY"}
|
|
1
|
+
{"version":3,"names":["JSReanimated","isWeb","PropsAllowlists","createReactDOMStyle","createTransformValue","createTextShadowValue","require","default","e","reanimatedJS","global","_makeShareableClone","Error","_scheduleOnJS","_scheduleOnRuntime","_updatePropsJS","updates","viewRef","isAnimatedProps","_component","component","rawStyles","Object","keys","reduce","acc","key","value","index","setNativeProps","undefined","style","updatePropsDOM","props","length","forEach","dashedKey","replace","m","toLowerCase","_touchableNode","setAttribute","componentName","className","console","warn","newProps","_component$setNativeP2","_component$setNativeP","uiProps","isNativeProp","call","previousStyle","currentStyle","domStyle","Array","isArray","transform","textShadowColor","textShadowRadius","textShadowOffset","textShadow","propName","NATIVE_THREAD_PROPS_WHITELIST"],"sources":["index.ts"],"sourcesContent":["'use strict';\nimport JSReanimated from './JSReanimated';\nimport type { StyleProps } from '../commonTypes';\nimport type { AnimatedStyle } from '../helperTypes';\nimport { isWeb } from '../PlatformChecker';\nimport { PropsAllowlists } from '../../propsAllowlists';\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nlet createReactDOMStyle: (style: any) => any;\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nlet createTransformValue: (transform: any) => any;\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nlet createTextShadowValue: (style: any) => void | string;\n\nif (isWeb()) {\n try {\n createReactDOMStyle =\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n require('react-native-web/dist/exports/StyleSheet/compiler/createReactDOMStyle').default;\n } catch (e) {}\n\n try {\n // React Native Web 0.19+\n createTransformValue =\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n require('react-native-web/dist/exports/StyleSheet/preprocess').createTransformValue;\n } catch (e) {}\n\n try {\n createTextShadowValue =\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n require('react-native-web/dist/exports/StyleSheet/preprocess').createTextShadowValue;\n } catch (e) {}\n}\n\nconst reanimatedJS = new JSReanimated();\n\nglobal._makeShareableClone = () => {\n throw new Error(\n '[Reanimated] _makeShareableClone should never be called in JSReanimated.'\n );\n};\n\nglobal._scheduleOnJS = () => {\n throw new Error(\n '[Reanimated] _scheduleOnJS should never be called in JSReanimated.'\n );\n};\n\nglobal._scheduleOnRuntime = () => {\n throw new Error(\n '[Reanimated] _scheduleOnRuntime should never be called in JSReanimated.'\n );\n};\n\ninterface JSReanimatedComponent {\n previousStyle: StyleProps;\n setNativeProps?: (style: StyleProps) => void;\n style?: StyleProps;\n props: Record<string, string | number>;\n _touchableNode: {\n setAttribute: (key: string, props: unknown) => void;\n };\n}\n\nexport interface ReanimatedHTMLElement extends HTMLElement {\n previousStyle: StyleProps;\n setNativeProps?: (style: StyleProps) => void;\n props: Record<string, string | number>;\n _touchableNode: {\n setAttribute: (key: string, props: unknown) => void;\n };\n reanimatedDummy?: boolean;\n removedAfterAnimation?: boolean;\n}\n\nexport const _updatePropsJS = (\n // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents\n updates: StyleProps | AnimatedStyle<any>,\n viewRef: { _component?: JSReanimatedComponent | ReanimatedHTMLElement },\n isAnimatedProps?: boolean\n): void => {\n if (viewRef._component) {\n const component = viewRef._component;\n const [rawStyles] = Object.keys(updates).reduce(\n (acc: [StyleProps, AnimatedStyle<any>], key) => {\n const value = updates[key];\n const index = typeof value === 'function' ? 1 : 0;\n acc[index][key] = value;\n return acc;\n },\n [{}, {}]\n );\n\n if (typeof component.setNativeProps === 'function') {\n // This is the legacy way to update props on React Native Web <= 0.18.\n // Also, some components (e.g. from react-native-svg) don't have styles\n // and always provide setNativeProps function instead (even on React Native Web 0.19+).\n setNativeProps(component, rawStyles, isAnimatedProps);\n } else if (\n createReactDOMStyle !== undefined &&\n component.style !== undefined\n ) {\n // React Native Web 0.19+ no longer provides setNativeProps function,\n // so we need to update DOM nodes directly.\n updatePropsDOM(component, rawStyles, isAnimatedProps);\n } else if (Object.keys(component.props).length > 0) {\n Object.keys(component.props).forEach((key) => {\n if (!rawStyles[key]) {\n return;\n }\n const dashedKey = key.replace(/[A-Z]/g, (m) => '-' + m.toLowerCase());\n component._touchableNode.setAttribute(dashedKey, rawStyles[key]);\n });\n } else {\n const componentName =\n 'className' in component ? component?.className : '';\n console.warn(\n `[Reanimated] It's not possible to manipulate the component ${componentName}`\n );\n }\n }\n};\n\nconst setNativeProps = (\n component: JSReanimatedComponent | ReanimatedHTMLElement,\n newProps: StyleProps,\n isAnimatedProps?: boolean\n): void => {\n if (isAnimatedProps) {\n const uiProps: Record<string, unknown> = {};\n for (const key in newProps) {\n if (isNativeProp(key)) {\n uiProps[key] = newProps[key];\n }\n }\n // Only update UI props directly on the component,\n // other props can be updated as standard style props.\n component.setNativeProps?.(uiProps);\n }\n\n const previousStyle = component.previousStyle ? component.previousStyle : {};\n const currentStyle = { ...previousStyle, ...newProps };\n component.previousStyle = currentStyle;\n\n component.setNativeProps?.({ style: currentStyle });\n};\n\nconst updatePropsDOM = (\n component: JSReanimatedComponent | HTMLElement,\n style: StyleProps,\n isAnimatedProps?: boolean\n): void => {\n const previousStyle = (component as JSReanimatedComponent).previousStyle\n ? (component as JSReanimatedComponent).previousStyle\n : {};\n const currentStyle = { ...previousStyle, ...style };\n (component as JSReanimatedComponent).previousStyle = currentStyle;\n\n const domStyle = createReactDOMStyle(currentStyle);\n if (Array.isArray(domStyle.transform) && createTransformValue !== undefined) {\n domStyle.transform = createTransformValue(domStyle.transform);\n }\n\n if (\n createTextShadowValue !== undefined &&\n (domStyle.textShadowColor ||\n domStyle.textShadowRadius ||\n domStyle.textShadowOffset)\n ) {\n domStyle.textShadow = createTextShadowValue({\n textShadowColor: domStyle.textShadowColor,\n textShadowOffset: domStyle.textShadowOffset,\n textShadowRadius: domStyle.textShadowRadius,\n });\n }\n\n for (const key in domStyle) {\n if (isAnimatedProps) {\n (component as HTMLElement).setAttribute(key, domStyle[key]);\n } else {\n (component.style as StyleProps)[key] = domStyle[key];\n }\n }\n};\n\nfunction isNativeProp(propName: string): boolean {\n return !!PropsAllowlists.NATIVE_THREAD_PROPS_WHITELIST[propName];\n}\n\nexport default reanimatedJS;\n"],"mappings":"AAAA,YAAY;;AACZ,OAAOA,YAAY,MAAM,gBAAgB;AAGzC,SAASC,KAAK,QAAQ,oBAAoB;AAC1C,SAASC,eAAe,QAAQ,uBAAuB;;AAEvD;AACA,IAAIC,mBAAwC;AAC5C;AACA,IAAIC,oBAA6C;AACjD;AACA,IAAIC,qBAAoD;AAExD,IAAIJ,KAAK,CAAC,CAAC,EAAE;EACX,IAAI;IACFE,mBAAmB;IACjB;IACAG,OAAO,CAAC,uEAAuE,CAAC,CAACC,OAAO;EAC5F,CAAC,CAAC,OAAOC,CAAC,EAAE,CAAC;EAEb,IAAI;IACF;IACAJ,oBAAoB;IAClB;IACAE,OAAO,CAAC,qDAAqD,CAAC,CAACF,oBAAoB;EACvF,CAAC,CAAC,OAAOI,CAAC,EAAE,CAAC;EAEb,IAAI;IACFH,qBAAqB;IACnB;IACAC,OAAO,CAAC,qDAAqD,CAAC,CAACD,qBAAqB;EACxF,CAAC,CAAC,OAAOG,CAAC,EAAE,CAAC;AACf;AAEA,MAAMC,YAAY,GAAG,IAAIT,YAAY,CAAC,CAAC;AAEvCU,MAAM,CAACC,mBAAmB,GAAG,MAAM;EACjC,MAAM,IAAIC,KAAK,CACb,0EACF,CAAC;AACH,CAAC;AAEDF,MAAM,CAACG,aAAa,GAAG,MAAM;EAC3B,MAAM,IAAID,KAAK,CACb,oEACF,CAAC;AACH,CAAC;AAEDF,MAAM,CAACI,kBAAkB,GAAG,MAAM;EAChC,MAAM,IAAIF,KAAK,CACb,yEACF,CAAC;AACH,CAAC;AAuBD,OAAO,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1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["react-native-web.d.ts"],"sourcesContent":["'use strict';\ndeclare module 'react-native-web/dist/exports/StyleSheet/compiler/createReactDOMStyle';\ndeclare module 'react-native-web/dist/exports/StyleSheet/preprocess';\n"],"mappings":"AAAA,YAAY"}
|
|
1
|
+
{"version":3,"names":[],"sources":["react-native-web.d.ts"],"sourcesContent":["'use strict';\ndeclare module 'react-native-web/dist/exports/StyleSheet/compiler/createReactDOMStyle';\ndeclare module 'react-native-web/dist/exports/StyleSheet/preprocess';\n"],"mappings":"AAAA,YAAY","ignoreList":[]}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var _BaseAnimationBuilder;
|
|
3
4
|
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(
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
6
|
+
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
7
|
import { withDelay } from '../../animation';
|
|
7
8
|
import { ReduceMotion } from '../../commonTypes';
|
|
8
9
|
import { getReduceMotionFromConfig } from '../../animation/util';
|
|
@@ -119,5 +120,6 @@ export class BaseAnimationBuilder {
|
|
|
119
120
|
return instance.build();
|
|
120
121
|
}
|
|
121
122
|
}
|
|
123
|
+
_BaseAnimationBuilder = BaseAnimationBuilder;
|
|
122
124
|
_defineProperty(BaseAnimationBuilder, "createInstance", void 0);
|
|
123
125
|
//# sourceMappingURL=BaseAnimationBuilder.js.map
|
package/lib/module/reanimated2/layoutReanimation/animationBuilder/BaseAnimationBuilder.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","
|
|
1
|
+
{"version":3,"names":["_BaseAnimationBuilder","_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","r","e","Symbol","toPrimitive","call","TypeError","String","Number","withDelay","ReduceMotion","getReduceMotionFromConfig","BaseAnimationBuilder","constructor","System","Error","duration","durationMs","instance","createInstance","durationV","delay","delayMs","delayV","withCallback","callback","callbackV","reduceMotion","reduceMotionV","getDuration","randomDelay","randomizeDelay","getDelay","Math","random","getReduceMotion","getDelayFunction","isDelayProvided","animation","_","build"],"sources":["BaseAnimationBuilder.ts"],"sourcesContent":["'use strict';\nimport { withDelay } from '../../animation';\nimport type {\n EntryExitAnimationFunction,\n AnimationFunction,\n LayoutAnimationFunction,\n} from './commonTypes';\n\nimport { ReduceMotion } from '../../commonTypes';\nimport { getReduceMotionFromConfig } from '../../animation/util';\n\nexport class BaseAnimationBuilder {\n durationV?: number;\n delayV?: number;\n reduceMotionV: ReduceMotion = ReduceMotion.System;\n randomizeDelay = false;\n callbackV?: (finished: boolean) => void;\n\n static createInstance: <T extends typeof BaseAnimationBuilder>(\n this: T\n ) => InstanceType<T>;\n\n build = (): EntryExitAnimationFunction | LayoutAnimationFunction => {\n throw new Error('[Reanimated] Unimplemented method in child class.');\n };\n\n /**\n * Lets you adjust the animation duration. Can be chained alongside other [layout animation modifiers](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/glossary#layout-animation-modifier).\n *\n * @param durationMs - Length of the animation (in milliseconds).\n */\n static duration<T extends typeof BaseAnimationBuilder>(\n this: T,\n durationMs: number\n ): InstanceType<T> {\n const instance = this.createInstance();\n return instance.duration(durationMs);\n }\n\n duration(durationMs: number): this {\n this.durationV = durationMs;\n return this;\n }\n\n /**\n * Lets you adjust the delay before the animation starts (in milliseconds). Can be chained alongside other [layout animation modifiers](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/glossary#layout-animation-modifier).\n *\n * @param delayMs - Delay before the animation starts (in milliseconds).\n */\n static delay<T extends typeof BaseAnimationBuilder>(\n this: T,\n delayMs: number\n ): InstanceType<T> {\n const instance = this.createInstance();\n return instance.delay(delayMs);\n }\n\n delay(delayMs: number): this {\n this.delayV = delayMs;\n return this;\n }\n\n /**\n * The callback that will fire after the animation ends. Can be chained alongside other [layout animation modifiers](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/glossary#layout-animation-modifier).\n *\n * @param callback - Callback that will fire after the animation ends.\n */\n static withCallback<T extends typeof BaseAnimationBuilder>(\n this: T,\n callback: (finished: boolean) => void\n ): InstanceType<T> {\n const instance = this.createInstance();\n return instance.withCallback(callback);\n }\n\n withCallback(callback: (finished: boolean) => void): this {\n this.callbackV = callback;\n return this;\n }\n\n /**\n * Lets you adjust the behavior when the device's reduced motion accessibility setting is turned on. Can be chained alongside other [layout animation modifiers](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/glossary#layout-animation-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 */\n static reduceMotion<T extends typeof BaseAnimationBuilder>(\n this: T,\n reduceMotion: ReduceMotion\n ): InstanceType<T> {\n const instance = this.createInstance();\n return instance.reduceMotion(reduceMotion);\n }\n\n reduceMotion(reduceMotionV: ReduceMotion): this {\n this.reduceMotionV = reduceMotionV;\n return this;\n }\n\n // 300ms is the default animation duration. If any animation has different default has to override this method.\n static getDuration(): number {\n return 300;\n }\n\n getDuration(): number {\n return this.durationV ?? 300;\n }\n\n /**\n * @deprecated Use `.delay()` with `Math.random()` instead\n */\n static randomDelay<T extends typeof BaseAnimationBuilder>(\n this: T\n ): InstanceType<T> {\n const instance = this.createInstance();\n return instance.randomDelay();\n }\n\n randomDelay(): this {\n this.randomizeDelay = true;\n return this;\n }\n\n // when randomizeDelay is set to true, randomize delay between 0 and provided value (or 1000ms if delay is not provided)\n getDelay(): number {\n return this.randomizeDelay\n ? Math.random() * (this.delayV ?? 1000)\n : this.delayV ?? 0;\n }\n\n getReduceMotion(): ReduceMotion {\n return this.reduceMotionV;\n }\n\n getDelayFunction(): AnimationFunction {\n const isDelayProvided = this.randomizeDelay || this.delayV;\n const reduceMotion = this.getReduceMotion();\n return isDelayProvided\n ? (delay, animation) => {\n 'worklet';\n return withDelay(delay, animation, reduceMotion);\n }\n : (_, animation) => {\n 'worklet';\n animation.reduceMotion = getReduceMotionFromConfig(reduceMotion);\n return animation;\n };\n }\n\n static build<T extends typeof BaseAnimationBuilder>(\n this: T\n ): EntryExitAnimationFunction | LayoutAnimationFunction {\n const instance = this.createInstance();\n return instance.build();\n }\n}\n"],"mappings":"AAAA,YAAY;;AAAC,IAAAA,qBAAA;AAAA,SAAAC,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,y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,EAAED,SAAS,KAAK;MAChB,SAAS;;MACTA,SAAS,CAACX,YAAY,GAAGhB,yBAAyB,CAACgB,YAAY,CAAC;MAChE,OAAOW,SAAS;IAClB,CAAC;EACP;EAEA,OAAOE,KAAKA,CAAA,EAE4C;IACtD,MAAMtB,QAAQ,GAAG,IAAI,CAACC,cAAc,CAAC,CAAC;IACtC,OAAOD,QAAQ,CAACsB,KAAK,CAAC,CAAC;EACzB;AACF;AAACrD,qBAAA,GA/IYyB,oBAAoB;AAAAxB,eAAA,CAApBwB,oBAAoB","ignoreList":[]}
|
package/lib/module/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
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, withSpring } from '../../animation';
|
|
7
7
|
import { BaseAnimationBuilder } from './BaseAnimationBuilder';
|
|
8
8
|
import { assertEasingIsWorklet } from '../../animation/util';
|
|
9
9
|
export class ComplexAnimationBuilder extends BaseAnimationBuilder {
|
|
10
|
-
constructor() {
|
|
11
|
-
super(...
|
|
10
|
+
constructor(...args) {
|
|
11
|
+
super(...args);
|
|
12
12
|
_defineProperty(this, "easingV", void 0);
|
|
13
13
|
_defineProperty(this, "rotateV", void 0);
|
|
14
14
|
_defineProperty(this, "type", void 0);
|
|
@@ -227,13 +227,10 @@ export class ComplexAnimationBuilder extends BaseAnimationBuilder {
|
|
|
227
227
|
}, {
|
|
228
228
|
variableName: 'rotate',
|
|
229
229
|
value: rotate
|
|
230
|
-
}].forEach(
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
} = _ref;
|
|
235
|
-
return maybeSetConfigValue(value, variableName);
|
|
236
|
-
});
|
|
230
|
+
}].forEach(({
|
|
231
|
+
value,
|
|
232
|
+
variableName
|
|
233
|
+
}) => maybeSetConfigValue(value, variableName));
|
|
237
234
|
return [animation, config];
|
|
238
235
|
}
|
|
239
236
|
}
|
package/lib/module/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.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","withTiming","withSpring","BaseAnimationBuilder","assertEasingIsWorklet","ComplexAnimationBuilder","constructor","arguments","easing","easingFunction","instance","createInstance","__DEV__","easingV","rotate","degree","rotateV","springify","duration","durationV","type","dampingRatio","dampingRatioV","damping","dampingV","mass","massV","stiffness","stiffnessV","overshootClamping","overshootClampingV","restDisplacementThreshold","restDisplacementThresholdV","restSpeedThreshold","restSpeedThresholdV","withInitialValues","values","initialValues","getAnimationAndConfig","animation","config","maybeSetConfigValue","variableName","forEach","_ref"],"sources":["ComplexAnimationBuilder.ts"],"sourcesContent":["'use strict';\nimport { withTiming, withSpring } from '../../animation';\nimport type {\n AnimationFunction,\n BaseBuilderAnimationConfig,\n LayoutAnimationAndConfig,\n} from './commonTypes';\nimport type { EasingFunction } from '../../Easing';\nimport { BaseAnimationBuilder } from './BaseAnimationBuilder';\nimport type { StyleProps } from '../../commonTypes';\nimport { assertEasingIsWorklet } from '../../animation/util';\n\nexport class ComplexAnimationBuilder extends BaseAnimationBuilder {\n easingV?: EasingFunction;\n rotateV?: string;\n type?: AnimationFunction;\n dampingV?: number;\n dampingRatioV?: number;\n massV?: number;\n stiffnessV?: number;\n overshootClampingV?: number;\n restDisplacementThresholdV?: number;\n restSpeedThresholdV?: number;\n initialValues?: StyleProps;\n\n static createInstance: <T extends typeof BaseAnimationBuilder>(\n this: T\n ) => InstanceType<T>;\n\n /**\n * Lets you change the easing curve of the animation. Can be chained alongside other [layout animation modifiers](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/glossary#layout-animation-modifier).\n *\n * @param easingFunction - An easing function which defines the animation curve.\n */\n static easing<T extends typeof ComplexAnimationBuilder>(\n this: T,\n easingFunction: EasingFunction\n ) {\n const instance = this.createInstance();\n return instance.easing(easingFunction);\n }\n\n easing(easingFunction: EasingFunction): this {\n if (__DEV__) {\n assertEasingIsWorklet(easingFunction);\n }\n this.easingV = easingFunction;\n return this;\n }\n\n /**\n * Lets you rotate the element. Can be chained alongside other [layout animation modifiers](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/glossary#layout-animation-modifier).\n *\n * @param degree - The rotation degree.\n */\n static rotate<T extends typeof ComplexAnimationBuilder>(\n this: T,\n degree: string\n ) {\n const instance = this.createInstance();\n return instance.rotate(degree);\n }\n\n rotate(degree: string): this {\n this.rotateV = degree;\n return this;\n }\n\n /**\n * Enables the spring-based animation configuration. Can be chained alongside other [layout animation modifiers](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/glossary#layout-animation-modifier).\n *\n * @param duration - An optional duration of the spring animation (in milliseconds).\n */\n static springify<T extends typeof ComplexAnimationBuilder>(\n this: T,\n duration?: number\n ): ComplexAnimationBuilder {\n const instance = this.createInstance();\n return instance.springify(duration);\n }\n\n springify(duration?: number): this {\n this.durationV = duration;\n this.type = withSpring as AnimationFunction;\n return this;\n }\n\n /**\n * Lets you adjust the spring animation damping ratio. Can be chained alongside other [layout animation modifiers](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/glossary#layout-animation-modifier).\n *\n * @param dampingRatio - How damped the spring is.\n */\n static dampingRatio<T extends typeof ComplexAnimationBuilder>(\n this: T,\n dampingRatio: number\n ) {\n const instance = this.createInstance();\n return instance.dampingRatio(dampingRatio);\n }\n\n dampingRatio(value: number): this {\n this.dampingRatioV = value;\n return this;\n }\n\n /**\n * Lets you adjust the spring animation damping. Can be chained alongside other [layout animation modifiers](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/glossary#layout-animation-modifier).\n *\n * @param value - Decides how quickly a spring stops moving. Higher damping means the spring will come to rest faster.\n */\n static damping<T extends typeof ComplexAnimationBuilder>(\n this: T,\n damping: number\n ) {\n const instance = this.createInstance();\n return instance.damping(damping);\n }\n\n damping(damping: number): this {\n this.dampingV = damping;\n return this;\n }\n\n /**\n * Lets you adjust the spring animation mass. Can be chained alongside other [layout animation modifiers](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/glossary#layout-animation-modifier).\n *\n * @param mass - The weight of the spring. Reducing this value makes the animation faster.\n */\n static mass<T extends typeof ComplexAnimationBuilder>(this: T, mass: number) {\n const instance = this.createInstance();\n return instance.mass(mass);\n }\n\n mass(mass: number): this {\n this.massV = mass;\n return this;\n }\n\n /**\n * Lets you adjust the stiffness of the spring animation. Can be chained alongside other [layout animation modifiers](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/glossary#layout-animation-modifier).\n *\n * @param stiffness - How bouncy the spring is.\n */\n static stiffness<T extends typeof ComplexAnimationBuilder>(\n this: T,\n stiffness: number\n ) {\n const instance = this.createInstance();\n return instance.stiffness(stiffness);\n }\n\n stiffness(stiffness: number): this {\n this.stiffnessV = stiffness;\n return this;\n }\n\n /**\n * Lets you adjust overshoot clamping of the spring. Can be chained alongside other [layout animation modifiers](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/glossary#layout-animation-modifier).\n *\n * @param overshootClamping - Whether a spring can bounce over the final position.\n */\n static overshootClamping<T extends typeof ComplexAnimationBuilder>(\n this: T,\n overshootClamping: number\n ) {\n const instance = this.createInstance();\n return instance.overshootClamping(overshootClamping);\n }\n\n overshootClamping(overshootClamping: number): this {\n this.overshootClampingV = overshootClamping;\n return this;\n }\n\n /**\n * Lets you adjust the rest displacement threshold of the spring animation. Can be chained alongside other [layout animation modifiers](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/glossary#layout-animation-modifier).\n *\n * @param restDisplacementThreshold - The displacement below which the spring will snap to the designated position without further oscillations.\n */\n static restDisplacementThreshold<T extends typeof ComplexAnimationBuilder>(\n this: T,\n restDisplacementThreshold: number\n ) {\n const instance = this.createInstance();\n return instance.restDisplacementThreshold(restDisplacementThreshold);\n }\n\n restDisplacementThreshold(restDisplacementThreshold: number) {\n this.restDisplacementThresholdV = restDisplacementThreshold;\n return this;\n }\n\n /**\n * Lets you adjust the rest speed threshold of the spring animation. Can be chained alongside other [layout animation modifiers](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/glossary#layout-animation-modifier).\n *\n * @param restSpeedThreshold - The speed in pixels per second from which the spring will snap to the designated position without further oscillations.\n */\n static restSpeedThreshold<T extends typeof ComplexAnimationBuilder>(\n this: T,\n restSpeedThreshold: number\n ) {\n const instance = this.createInstance();\n return instance.restSpeedThreshold(restSpeedThreshold);\n }\n\n restSpeedThreshold(restSpeedThreshold: number): this {\n this.restSpeedThresholdV = restSpeedThreshold;\n return this;\n }\n\n /**\n * Lets you override the initial config of the animation\n *\n * @param values - An object containing the styles to override.\n */\n static withInitialValues<T extends typeof ComplexAnimationBuilder>(\n this: T,\n values: StyleProps\n ) {\n const instance = this.createInstance();\n return instance.withInitialValues(values);\n }\n\n withInitialValues(values: StyleProps): this {\n this.initialValues = values;\n return this;\n }\n\n getAnimationAndConfig(): LayoutAnimationAndConfig {\n const duration = this.durationV;\n const easing = this.easingV;\n const rotate = this.rotateV;\n const type = this.type ? this.type : (withTiming as AnimationFunction);\n const damping = this.dampingV;\n const dampingRatio = this.dampingRatioV;\n const mass = this.massV;\n const stiffness = this.stiffnessV;\n const overshootClamping = this.overshootClampingV;\n const restDisplacementThreshold = this.restDisplacementThresholdV;\n const restSpeedThreshold = this.restSpeedThresholdV;\n\n const animation = type;\n\n const config: BaseBuilderAnimationConfig = {};\n\n function maybeSetConfigValue<Key extends keyof BaseBuilderAnimationConfig>(\n value: BaseBuilderAnimationConfig[Key],\n variableName: Key\n ) {\n if (value) {\n config[variableName] = value;\n }\n }\n\n if (type === withTiming) {\n maybeSetConfigValue(easing, 'easing');\n }\n\n (\n [\n { variableName: 'damping', value: damping },\n { variableName: 'dampingRatio', value: dampingRatio },\n { variableName: 'mass', value: mass },\n { variableName: 'stiffness', value: stiffness },\n { variableName: 'overshootClamping', value: overshootClamping },\n {\n variableName: 'restDisplacementThreshold',\n value: restDisplacementThreshold,\n },\n { variableName: 'restSpeedThreshold', value: restSpeedThreshold },\n { variableName: 'duration', value: duration },\n { variableName: 'rotate', value: rotate },\n ] as const\n ).forEach(({ value, variableName }) =>\n maybeSetConfigValue(value, variableName)\n );\n\n return [animation, config];\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,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,Q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7D,KAAK,EAAEkD;IACT,CAAC,EACD;MAAEW,YAAY,EAAE,oBAAoB;MAAE7D,KAAK,EAAEoD;IAAmB,CAAC,EACjE;MAAES,YAAY,EAAE,UAAU;MAAE7D,KAAK,EAAEqC;IAAS,CAAC,EAC7C;MAAEwB,YAAY,EAAE,QAAQ;MAAE7D,KAAK,EAAEiC;IAAO,CAAC,CAC1C,CACD6B,OAAO,CAACC,IAAA;MAAA,IAAC;QAAE/D,KAAK;QAAE6D;MAAa,CAAC,GAAAE,IAAA;MAAA,OAChCH,mBAAmB,CAAC5D,KAAK,EAAE6D,YAAY,CAAC;IAAA,EACzC;IAED,OAAO,CAACH,SAAS,EAAEC,MAAM,CAAC;EAC5B;AACF;AAAC9D,eAAA,CA3QY2B,uBAAuB"}
|
|
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","withSpring","BaseAnimationBuilder","assertEasingIsWorklet","ComplexAnimationBuilder","constructor","args","easing","easingFunction","instance","createInstance","__DEV__","easingV","rotate","degree","rotateV","springify","duration","durationV","type","dampingRatio","dampingRatioV","damping","dampingV","mass","massV","stiffness","stiffnessV","overshootClamping","overshootClampingV","restDisplacementThreshold","restDisplacementThresholdV","restSpeedThreshold","restSpeedThresholdV","withInitialValues","values","initialValues","getAnimationAndConfig","animation","config","maybeSetConfigValue","variableName","forEach"],"sources":["ComplexAnimationBuilder.ts"],"sourcesContent":["'use strict';\nimport { withTiming, withSpring } from '../../animation';\nimport type {\n AnimationFunction,\n BaseBuilderAnimationConfig,\n LayoutAnimationAndConfig,\n} from './commonTypes';\nimport type { EasingFunction } from '../../Easing';\nimport { BaseAnimationBuilder } from './BaseAnimationBuilder';\nimport type { StyleProps } from '../../commonTypes';\nimport { assertEasingIsWorklet } from '../../animation/util';\n\nexport class ComplexAnimationBuilder extends BaseAnimationBuilder {\n easingV?: EasingFunction;\n rotateV?: string;\n type?: AnimationFunction;\n dampingV?: number;\n dampingRatioV?: number;\n massV?: number;\n stiffnessV?: number;\n overshootClampingV?: number;\n restDisplacementThresholdV?: number;\n restSpeedThresholdV?: number;\n initialValues?: StyleProps;\n\n static createInstance: <T extends typeof BaseAnimationBuilder>(\n this: T\n ) => InstanceType<T>;\n\n /**\n * Lets you change the easing curve of the animation. Can be chained alongside other [layout animation modifiers](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/glossary#layout-animation-modifier).\n *\n * @param easingFunction - An easing function which defines the animation curve.\n */\n static easing<T extends typeof ComplexAnimationBuilder>(\n this: T,\n easingFunction: EasingFunction\n ) {\n const instance = this.createInstance();\n return instance.easing(easingFunction);\n }\n\n easing(easingFunction: EasingFunction): this {\n if (__DEV__) {\n assertEasingIsWorklet(easingFunction);\n }\n this.easingV = easingFunction;\n return this;\n }\n\n /**\n * Lets you rotate the element. Can be chained alongside other [layout animation modifiers](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/glossary#layout-animation-modifier).\n *\n * @param degree - The rotation degree.\n */\n static rotate<T extends typeof ComplexAnimationBuilder>(\n this: T,\n degree: string\n ) {\n const instance = this.createInstance();\n return instance.rotate(degree);\n }\n\n rotate(degree: string): this {\n this.rotateV = degree;\n return this;\n }\n\n /**\n * Enables the spring-based animation configuration. Can be chained alongside other [layout animation modifiers](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/glossary#layout-animation-modifier).\n *\n * @param duration - An optional duration of the spring animation (in milliseconds).\n */\n static springify<T extends typeof ComplexAnimationBuilder>(\n this: T,\n duration?: number\n ): ComplexAnimationBuilder {\n const instance = this.createInstance();\n return instance.springify(duration);\n }\n\n springify(duration?: number): this {\n this.durationV = duration;\n this.type = withSpring as AnimationFunction;\n return this;\n }\n\n /**\n * Lets you adjust the spring animation damping ratio. Can be chained alongside other [layout animation modifiers](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/glossary#layout-animation-modifier).\n *\n * @param dampingRatio - How damped the spring is.\n */\n static dampingRatio<T extends typeof ComplexAnimationBuilder>(\n this: T,\n dampingRatio: number\n ) {\n const instance = this.createInstance();\n return instance.dampingRatio(dampingRatio);\n }\n\n dampingRatio(value: number): this {\n this.dampingRatioV = value;\n return this;\n }\n\n /**\n * Lets you adjust the spring animation damping. Can be chained alongside other [layout animation modifiers](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/glossary#layout-animation-modifier).\n *\n * @param value - Decides how quickly a spring stops moving. Higher damping means the spring will come to rest faster.\n */\n static damping<T extends typeof ComplexAnimationBuilder>(\n this: T,\n damping: number\n ) {\n const instance = this.createInstance();\n return instance.damping(damping);\n }\n\n damping(damping: number): this {\n this.dampingV = damping;\n return this;\n }\n\n /**\n * Lets you adjust the spring animation mass. Can be chained alongside other [layout animation modifiers](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/glossary#layout-animation-modifier).\n *\n * @param mass - The weight of the spring. Reducing this value makes the animation faster.\n */\n static mass<T extends typeof ComplexAnimationBuilder>(this: T, mass: number) {\n const instance = this.createInstance();\n return instance.mass(mass);\n }\n\n mass(mass: number): this {\n this.massV = mass;\n return this;\n }\n\n /**\n * Lets you adjust the stiffness of the spring animation. Can be chained alongside other [layout animation modifiers](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/glossary#layout-animation-modifier).\n *\n * @param stiffness - How bouncy the spring is.\n */\n static stiffness<T extends typeof ComplexAnimationBuilder>(\n this: T,\n stiffness: number\n ) {\n const instance = this.createInstance();\n return instance.stiffness(stiffness);\n }\n\n stiffness(stiffness: number): this {\n this.stiffnessV = stiffness;\n return this;\n }\n\n /**\n * Lets you adjust overshoot clamping of the spring. Can be chained alongside other [layout animation modifiers](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/glossary#layout-animation-modifier).\n *\n * @param overshootClamping - Whether a spring can bounce over the final position.\n */\n static overshootClamping<T extends typeof ComplexAnimationBuilder>(\n this: T,\n overshootClamping: number\n ) {\n const instance = this.createInstance();\n return instance.overshootClamping(overshootClamping);\n }\n\n overshootClamping(overshootClamping: number): this {\n this.overshootClampingV = overshootClamping;\n return this;\n }\n\n /**\n * Lets you adjust the rest displacement threshold of the spring animation. Can be chained alongside other [layout animation modifiers](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/glossary#layout-animation-modifier).\n *\n * @param restDisplacementThreshold - The displacement below which the spring will snap to the designated position without further oscillations.\n */\n static restDisplacementThreshold<T extends typeof ComplexAnimationBuilder>(\n this: T,\n restDisplacementThreshold: number\n ) {\n const instance = this.createInstance();\n return instance.restDisplacementThreshold(restDisplacementThreshold);\n }\n\n restDisplacementThreshold(restDisplacementThreshold: number) {\n this.restDisplacementThresholdV = restDisplacementThreshold;\n return this;\n }\n\n /**\n * Lets you adjust the rest speed threshold of the spring animation. Can be chained alongside other [layout animation modifiers](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/glossary#layout-animation-modifier).\n *\n * @param restSpeedThreshold - The speed in pixels per second from which the spring will snap to the designated position without further oscillations.\n */\n static restSpeedThreshold<T extends typeof ComplexAnimationBuilder>(\n this: T,\n restSpeedThreshold: number\n ) {\n const instance = this.createInstance();\n return instance.restSpeedThreshold(restSpeedThreshold);\n }\n\n restSpeedThreshold(restSpeedThreshold: number): this {\n this.restSpeedThresholdV = restSpeedThreshold;\n return this;\n }\n\n /**\n * Lets you override the initial config of the animation\n *\n * @param values - An object containing the styles to override.\n */\n static withInitialValues<T extends typeof ComplexAnimationBuilder>(\n this: T,\n values: StyleProps\n ) {\n const instance = this.createInstance();\n return instance.withInitialValues(values);\n }\n\n withInitialValues(values: StyleProps): this {\n this.initialValues = values;\n return this;\n }\n\n getAnimationAndConfig(): LayoutAnimationAndConfig {\n const duration = this.durationV;\n const easing = this.easingV;\n const rotate = this.rotateV;\n const type = this.type ? this.type : (withTiming as AnimationFunction);\n const damping = this.dampingV;\n const dampingRatio = this.dampingRatioV;\n const mass = this.massV;\n const stiffness = this.stiffnessV;\n const overshootClamping = this.overshootClampingV;\n const restDisplacementThreshold = this.restDisplacementThresholdV;\n const restSpeedThreshold = this.restSpeedThresholdV;\n\n const animation = type;\n\n const config: BaseBuilderAnimationConfig = {};\n\n function maybeSetConfigValue<Key extends keyof BaseBuilderAnimationConfig>(\n value: BaseBuilderAnimationConfig[Key],\n variableName: Key\n ) {\n if (value) {\n config[variableName] = value;\n }\n }\n\n if (type === withTiming) {\n maybeSetConfigValue(easing, 'easing');\n }\n\n (\n [\n { variableName: 'damping', value: damping },\n { variableName: 'dampingRatio', value: dampingRatio },\n { variableName: 'mass', value: mass },\n { variableName: 'stiffness', value: stiffness },\n { variableName: 'overshootClamping', value: overshootClamping },\n {\n variableName: 'restDisplacementThreshold',\n value: restDisplacementThreshold,\n },\n { variableName: 'restSpeedThreshold', value: restSpeedThreshold },\n { variableName: 'duration', value: duration },\n { variableName: 'rotate', value: rotate },\n ] as const\n ).forEach(({ value, variableName }) =>\n maybeSetConfigValue(value, variableName)\n );\n\n return [animation, config];\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,C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Ea,YAAY,EAAE,2BAA2B;MACzC3D,KAAK,EAAEgD;IACT,CAAC,EACD;MAAEW,YAAY,EAAE,oBAAoB;MAAE3D,KAAK,EAAEkD;IAAmB,CAAC,EACjE;MAAES,YAAY,EAAE,UAAU;MAAE3D,KAAK,EAAEmC;IAAS,CAAC,EAC7C;MAAEwB,YAAY,EAAE,QAAQ;MAAE3D,KAAK,EAAE+B;IAAO,CAAC,CAC1C,CACD6B,OAAO,CAAC,CAAC;MAAE5D,KAAK;MAAE2D;IAAa,CAAC,KAChCD,mBAAmB,CAAC1D,KAAK,EAAE2D,YAAY,CACzC,CAAC;IAED,OAAO,CAACH,SAAS,EAAEC,MAAM,CAAC;EAC5B;AACF;AAAC5D,eAAA,CA3QYyB,uBAAuB","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 { Easing } from '../../Easing';
|
|
7
7
|
import { withDelay, withSequence, withTiming } from '../../animation';
|
|
8
8
|
import { ReduceMotion } from '../../commonTypes';
|
|
@@ -138,13 +138,12 @@ class InnerKeyframe {
|
|
|
138
138
|
/*
|
|
139
139
|
Other keyframes can't contain properties that were not specified in initial keyframe.
|
|
140
140
|
*/
|
|
141
|
-
const addKeyPoint =
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
} = _ref;
|
|
141
|
+
const addKeyPoint = ({
|
|
142
|
+
key,
|
|
143
|
+
value,
|
|
144
|
+
currentKeyPoint,
|
|
145
|
+
easing
|
|
146
|
+
}) => {
|
|
148
147
|
if (!(key in parsedKeyframes)) {
|
|
149
148
|
throw new Error("[Reanimated] Keyframe can contain only that set of properties that were provide with initial values (keyframe 0 or 'from')");
|
|
150
149
|
}
|
|
@@ -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","Easing","withDelay","withSequence","withTiming","ReduceMotion","assertEasingIsWorklet","getReduceMotionFromConfig","InnerKeyframe","constructor","definitions","System","delay","delayV","delayFunction","getDelayFunction","keyframes","initialValues","parseDefinitions","callback","callbackV","animations","addAnimation","keyframePoints","length","animation","duration","easing","linear","map","keyframePoint","includes","transform","push","split","keys","forEach","transformProp","index","transformPropKey","makeKeyframeKey","parsedKeyframes","from","Error","to","styleProp","Array","isArray","transformStyle","durationV","animationKeyPoints","getAnimationDuration","currentKeyPoint","maxDuration","currentDuration","reduce","acc","addKeyPoint","_ref","__DEV__","filter","parseInt","sort","a","b","keyPoint","keyframe","addKeyPointWith","durationMs","delayMs","withCallback","reduceMotion","reduceMotionV","_","Keyframe"],"sources":["Keyframe.ts"],"sourcesContent":["'use strict';\nimport type { EasingFunction } from '../../Easing';\nimport { Easing } from '../../Easing';\nimport { withDelay, withSequence, withTiming } from '../../animation';\nimport type {\n AnimationFunction,\n EntryExitAnimationFunction,\n IEntryExitAnimationBuilder,\n KeyframeProps,\n StylePropsWithArrayTransform,\n} from './commonTypes';\nimport type { StyleProps } from '../../commonTypes';\nimport type { TransformArrayItem } from '../../helperTypes';\nimport { ReduceMotion } from '../../commonTypes';\nimport {\n assertEasingIsWorklet,\n getReduceMotionFromConfig,\n} from '../../animation/util';\n\ninterface KeyframePoint {\n duration: number;\n value: number | string;\n easing?: EasingFunction;\n}\ninterface ParsedKeyframesDefinition {\n initialValues: StyleProps;\n keyframes: Record<string, KeyframePoint[]>;\n}\nclass InnerKeyframe implements IEntryExitAnimationBuilder {\n durationV?: number;\n delayV?: number;\n reduceMotionV: ReduceMotion = ReduceMotion.System;\n callbackV?: (finished: boolean) => void;\n definitions: Record<string, KeyframeProps>;\n\n /*\n Keyframe definition should be passed in the constructor as the map\n which keys are between range 0 - 100 (%) and correspond to the point in the animation progress.\n */\n constructor(definitions: Record<string, KeyframeProps>) {\n this.definitions = definitions;\n }\n\n private parseDefinitions(): ParsedKeyframesDefinition {\n /* \n Each style property contain an array with all their key points: \n value, duration of transition to that value, and optional easing function (defaults to Linear)\n */\n const parsedKeyframes: Record<string, KeyframePoint[]> = {};\n /*\n Parsing keyframes 'from' and 'to'.\n */\n if (this.definitions.from) {\n if (this.definitions['0']) {\n throw new Error(\n \"[Reanimated] You cannot provide both keyframe 0 and 'from' as they both specified initial values.\"\n );\n }\n this.definitions['0'] = this.definitions.from;\n delete this.definitions.from;\n }\n if (this.definitions.to) {\n if (this.definitions['100']) {\n throw new Error(\n \"[Reanimated] You cannot provide both keyframe 100 and 'to' as they both specified values at the end of the animation.\"\n );\n }\n this.definitions['100'] = this.definitions.to;\n delete this.definitions.to;\n }\n /* \n One of the assumptions is that keyframe 0 is required to properly set initial values.\n Every other keyframe should contain properties from the set provided as initial values.\n */\n if (!this.definitions['0']) {\n throw new Error(\n \"[Reanimated] Please provide 0 or 'from' keyframe with initial state of your object.\"\n );\n }\n const initialValues: StyleProps = this.definitions['0'] as StyleProps;\n /*\n Initialize parsedKeyframes for properties provided in initial keyframe\n */\n Object.keys(initialValues).forEach((styleProp: string) => {\n if (styleProp === 'transform') {\n if (!Array.isArray(initialValues.transform)) {\n return;\n }\n initialValues.transform.forEach((transformStyle, index) => {\n Object.keys(transformStyle).forEach((transformProp: string) => {\n parsedKeyframes[makeKeyframeKey(index, transformProp)] = [];\n });\n });\n } else {\n parsedKeyframes[styleProp] = [];\n }\n });\n\n const duration: number = this.durationV ? this.durationV : 500;\n const animationKeyPoints: Array<string> = Array.from(\n Object.keys(this.definitions)\n );\n\n const getAnimationDuration = (\n key: string,\n currentKeyPoint: number\n ): number => {\n const maxDuration = (currentKeyPoint / 100) * duration;\n const currentDuration = parsedKeyframes[key].reduce(\n (acc: number, value: KeyframePoint) => acc + value.duration,\n 0\n );\n return maxDuration - currentDuration;\n };\n\n /* \n Other keyframes can't contain properties that were not specified in initial keyframe.\n */\n const addKeyPoint = ({\n key,\n value,\n currentKeyPoint,\n easing,\n }: {\n key: string;\n value: string | number;\n currentKeyPoint: number;\n easing?: EasingFunction;\n }): void => {\n if (!(key in parsedKeyframes)) {\n throw new Error(\n \"[Reanimated] Keyframe can contain only that set of properties that were provide with initial values (keyframe 0 or 'from')\"\n );\n }\n\n if (__DEV__ && easing) {\n assertEasingIsWorklet(easing);\n }\n\n parsedKeyframes[key].push({\n duration: getAnimationDuration(key, currentKeyPoint),\n value,\n easing,\n });\n };\n animationKeyPoints\n .filter((value: string) => parseInt(value) !== 0)\n .sort((a: string, b: string) => parseInt(a) - parseInt(b))\n .forEach((keyPoint: string) => {\n if (parseInt(keyPoint) < 0 || parseInt(keyPoint) > 100) {\n throw new Error(\n '[Reanimated] Keyframe should be in between range 0 - 100.'\n );\n }\n const keyframe: KeyframeProps = this.definitions[keyPoint];\n const easing = keyframe.easing;\n delete keyframe.easing;\n const addKeyPointWith = (key: string, value: string | number) =>\n addKeyPoint({\n key,\n value,\n currentKeyPoint: parseInt(keyPoint),\n easing,\n });\n Object.keys(keyframe).forEach((key: string) => {\n if (key === 'transform') {\n if (!Array.isArray(keyframe.transform)) {\n return;\n }\n keyframe.transform.forEach((transformStyle, index) => {\n Object.keys(transformStyle).forEach((transformProp: string) => {\n addKeyPointWith(\n makeKeyframeKey(index, transformProp),\n transformStyle[\n transformProp as keyof typeof transformStyle\n ] as number | string // Here we assume that user has passed props of proper type.\n // I don't think it's worthwhile to check if he passed i.e. `Animated.Node`.\n );\n });\n });\n } else {\n addKeyPointWith(key, keyframe[key]);\n }\n });\n });\n return { initialValues, keyframes: parsedKeyframes };\n }\n\n duration(durationMs: number): InnerKeyframe {\n this.durationV = durationMs;\n return this;\n }\n\n delay(delayMs: number): InnerKeyframe {\n this.delayV = delayMs;\n return this;\n }\n\n withCallback(callback: (finsihed: boolean) => void): InnerKeyframe {\n this.callbackV = callback;\n return this;\n }\n\n reduceMotion(reduceMotionV: ReduceMotion): this {\n this.reduceMotionV = reduceMotionV;\n return this;\n }\n\n private getDelayFunction(): AnimationFunction {\n const delay = this.delayV;\n const reduceMotion = this.reduceMotionV;\n return delay\n ? // eslint-disable-next-line @typescript-eslint/no-shadow\n (delay, animation) => {\n 'worklet';\n return withDelay(delay, animation, reduceMotion);\n }\n : (_, animation) => {\n 'worklet';\n animation.reduceMotion = getReduceMotionFromConfig(reduceMotion);\n return animation;\n };\n }\n\n build = (): EntryExitAnimationFunction => {\n const delay = this.delayV;\n const delayFunction = this.getDelayFunction();\n const { keyframes, initialValues } = this.parseDefinitions();\n const callback = this.callbackV;\n\n return () => {\n 'worklet';\n const animations: StylePropsWithArrayTransform = {};\n\n /* \n For each style property, an animations sequence is created that corresponds with its key points.\n Transform style properties require special handling because of their nested structure.\n */\n const addAnimation = (key: string) => {\n const keyframePoints = keyframes[key];\n // in case if property was only passed as initial value\n if (keyframePoints.length === 0) {\n return;\n }\n const animation = delayFunction(\n delay,\n keyframePoints.length === 1\n ? withTiming(keyframePoints[0].value, {\n duration: keyframePoints[0].duration,\n easing: keyframePoints[0].easing\n ? keyframePoints[0].easing\n : Easing.linear,\n })\n : withSequence(\n ...keyframePoints.map((keyframePoint: KeyframePoint) =>\n withTiming(keyframePoint.value, {\n duration: keyframePoint.duration,\n easing: keyframePoint.easing\n ? keyframePoint.easing\n : Easing.linear,\n })\n )\n )\n );\n if (key.includes('transform')) {\n if (!('transform' in animations)) {\n animations.transform = [];\n }\n animations.transform!.push(<TransformArrayItem>{\n [key.split(':')[1]]: animation,\n });\n } else {\n animations[key] = animation;\n }\n };\n Object.keys(initialValues).forEach((key: string) => {\n if (key.includes('transform')) {\n initialValues[key].forEach(\n (transformProp: Record<string, number | string>, index: number) => {\n Object.keys(transformProp).forEach((transformPropKey: string) => {\n addAnimation(makeKeyframeKey(index, transformPropKey));\n });\n }\n );\n } else {\n addAnimation(key);\n }\n });\n return {\n animations,\n initialValues,\n callback,\n };\n };\n };\n}\n\nfunction makeKeyframeKey(index: number, transformProp: string) {\n 'worklet';\n return `${index}_transform:${transformProp}`;\n}\n\n// TODO TYPESCRIPT This is a temporary type to get rid of .d.ts file.\nexport declare class ReanimatedKeyframe {\n constructor(definitions: Record<string, KeyframeProps>);\n duration(durationMs: number): ReanimatedKeyframe;\n delay(delayMs: number): ReanimatedKeyframe;\n reduceMotion(reduceMotionV: ReduceMotion): ReanimatedKeyframe;\n withCallback(callback: (finished: boolean) => void): ReanimatedKeyframe;\n}\n\n// TODO TYPESCRIPT This temporary cast is to get rid of .d.ts file.\nexport const Keyframe = InnerKeyframe as unknown as typeof ReanimatedKeyframe;\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,e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YAAY,GAAGhE,yBAAyB,CAACgE,YAAY,CAAC;MAChE,OAAO9C,SAAS;IAClB,CAAC;EACP;AAyEF;AAEA,SAASe,eAAeA,CAACF,KAAa,EAAED,aAAqB,EAAE;EAC7D,SAAS;;EACT,OAAQ,GAAEC,KAAM,cAAaD,aAAc,EAAC;AAC9C;;AAEA;;AASA;AACA,OAAO,MAAMqC,QAAQ,GAAGlE,aAAqD"}
|
|
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","Easing","withDelay","withSequence","withTiming","ReduceMotion","assertEasingIsWorklet","getReduceMotionFromConfig","InnerKeyframe","constructor","definitions","System","delay","delayV","delayFunction","getDelayFunction","keyframes","initialValues","parseDefinitions","callback","callbackV","animations","addAnimation","keyframePoints","length","animation","duration","easing","linear","map","keyframePoint","includes","transform","push","split","keys","forEach","transformProp","index","transformPropKey","makeKeyframeKey","parsedKeyframes","from","Error","to","styleProp","Array","isArray","transformStyle","durationV","animationKeyPoints","getAnimationDuration","currentKeyPoint","maxDuration","currentDuration","reduce","acc","addKeyPoint","__DEV__","filter","parseInt","sort","a","b","keyPoint","keyframe","addKeyPointWith","durationMs","delayMs","withCallback","reduceMotion","reduceMotionV","_","Keyframe"],"sources":["Keyframe.ts"],"sourcesContent":["'use strict';\nimport type { EasingFunction } from '../../Easing';\nimport { Easing } from '../../Easing';\nimport { withDelay, withSequence, withTiming } from '../../animation';\nimport type {\n AnimationFunction,\n EntryExitAnimationFunction,\n IEntryExitAnimationBuilder,\n KeyframeProps,\n StylePropsWithArrayTransform,\n} from './commonTypes';\nimport type { StyleProps } from '../../commonTypes';\nimport type { TransformArrayItem } from '../../helperTypes';\nimport { ReduceMotion } from '../../commonTypes';\nimport {\n assertEasingIsWorklet,\n getReduceMotionFromConfig,\n} from '../../animation/util';\n\ninterface KeyframePoint {\n duration: number;\n value: number | string;\n easing?: EasingFunction;\n}\ninterface ParsedKeyframesDefinition {\n initialValues: StyleProps;\n keyframes: Record<string, KeyframePoint[]>;\n}\nclass InnerKeyframe implements IEntryExitAnimationBuilder {\n durationV?: number;\n delayV?: number;\n reduceMotionV: ReduceMotion = ReduceMotion.System;\n callbackV?: (finished: boolean) => void;\n definitions: Record<string, KeyframeProps>;\n\n /*\n Keyframe definition should be passed in the constructor as the map\n which keys are between range 0 - 100 (%) and correspond to the point in the animation progress.\n */\n constructor(definitions: Record<string, KeyframeProps>) {\n this.definitions = definitions;\n }\n\n private parseDefinitions(): ParsedKeyframesDefinition {\n /* \n Each style property contain an array with all their key points: \n value, duration of transition to that value, and optional easing function (defaults to Linear)\n */\n const parsedKeyframes: Record<string, KeyframePoint[]> = {};\n /*\n Parsing keyframes 'from' and 'to'.\n */\n if (this.definitions.from) {\n if (this.definitions['0']) {\n throw new Error(\n \"[Reanimated] You cannot provide both keyframe 0 and 'from' as they both specified initial values.\"\n );\n }\n this.definitions['0'] = this.definitions.from;\n delete this.definitions.from;\n }\n if (this.definitions.to) {\n if (this.definitions['100']) {\n throw new Error(\n \"[Reanimated] You cannot provide both keyframe 100 and 'to' as they both specified values at the end of the animation.\"\n );\n }\n this.definitions['100'] = this.definitions.to;\n delete this.definitions.to;\n }\n /* \n One of the assumptions is that keyframe 0 is required to properly set initial values.\n Every other keyframe should contain properties from the set provided as initial values.\n */\n if (!this.definitions['0']) {\n throw new Error(\n \"[Reanimated] Please provide 0 or 'from' keyframe with initial state of your object.\"\n );\n }\n const initialValues: StyleProps = this.definitions['0'] as StyleProps;\n /*\n Initialize parsedKeyframes for properties provided in initial keyframe\n */\n Object.keys(initialValues).forEach((styleProp: string) => {\n if (styleProp === 'transform') {\n if (!Array.isArray(initialValues.transform)) {\n return;\n }\n initialValues.transform.forEach((transformStyle, index) => {\n Object.keys(transformStyle).forEach((transformProp: string) => {\n parsedKeyframes[makeKeyframeKey(index, transformProp)] = [];\n });\n });\n } else {\n parsedKeyframes[styleProp] = [];\n }\n });\n\n const duration: number = this.durationV ? this.durationV : 500;\n const animationKeyPoints: Array<string> = Array.from(\n Object.keys(this.definitions)\n );\n\n const getAnimationDuration = (\n key: string,\n currentKeyPoint: number\n ): number => {\n const maxDuration = (currentKeyPoint / 100) * duration;\n const currentDuration = parsedKeyframes[key].reduce(\n (acc: number, value: KeyframePoint) => acc + value.duration,\n 0\n );\n return maxDuration - currentDuration;\n };\n\n /* \n Other keyframes can't contain properties that were not specified in initial keyframe.\n */\n const addKeyPoint = ({\n key,\n value,\n currentKeyPoint,\n easing,\n }: {\n key: string;\n value: string | number;\n currentKeyPoint: number;\n easing?: EasingFunction;\n }): void => {\n if (!(key in parsedKeyframes)) {\n throw new Error(\n \"[Reanimated] Keyframe can contain only that set of properties that were provide with initial values (keyframe 0 or 'from')\"\n );\n }\n\n if (__DEV__ && easing) {\n assertEasingIsWorklet(easing);\n }\n\n parsedKeyframes[key].push({\n duration: getAnimationDuration(key, currentKeyPoint),\n value,\n easing,\n });\n };\n animationKeyPoints\n .filter((value: string) => parseInt(value) !== 0)\n .sort((a: string, b: string) => parseInt(a) - parseInt(b))\n .forEach((keyPoint: string) => {\n if (parseInt(keyPoint) < 0 || parseInt(keyPoint) > 100) {\n throw new Error(\n '[Reanimated] Keyframe should be in between range 0 - 100.'\n );\n }\n const keyframe: KeyframeProps = this.definitions[keyPoint];\n const easing = keyframe.easing;\n delete keyframe.easing;\n const addKeyPointWith = (key: string, value: string | number) =>\n addKeyPoint({\n key,\n value,\n currentKeyPoint: parseInt(keyPoint),\n easing,\n });\n Object.keys(keyframe).forEach((key: string) => {\n if (key === 'transform') {\n if (!Array.isArray(keyframe.transform)) {\n return;\n }\n keyframe.transform.forEach((transformStyle, index) => {\n Object.keys(transformStyle).forEach((transformProp: string) => {\n addKeyPointWith(\n makeKeyframeKey(index, transformProp),\n transformStyle[\n transformProp as keyof typeof transformStyle\n ] as number | string // Here we assume that user has passed props of proper type.\n // I don't think it's worthwhile to check if he passed i.e. `Animated.Node`.\n );\n });\n });\n } else {\n addKeyPointWith(key, keyframe[key]);\n }\n });\n });\n return { initialValues, keyframes: parsedKeyframes };\n }\n\n duration(durationMs: number): InnerKeyframe {\n this.durationV = durationMs;\n return this;\n }\n\n delay(delayMs: number): InnerKeyframe {\n this.delayV = delayMs;\n return this;\n }\n\n withCallback(callback: (finsihed: boolean) => void): InnerKeyframe {\n this.callbackV = callback;\n return this;\n }\n\n reduceMotion(reduceMotionV: ReduceMotion): this {\n this.reduceMotionV = reduceMotionV;\n return this;\n }\n\n private getDelayFunction(): AnimationFunction {\n const delay = this.delayV;\n const reduceMotion = this.reduceMotionV;\n return delay\n ? // eslint-disable-next-line @typescript-eslint/no-shadow\n (delay, animation) => {\n 'worklet';\n return withDelay(delay, animation, reduceMotion);\n }\n : (_, animation) => {\n 'worklet';\n animation.reduceMotion = getReduceMotionFromConfig(reduceMotion);\n return animation;\n };\n }\n\n build = (): EntryExitAnimationFunction => {\n const delay = this.delayV;\n const delayFunction = this.getDelayFunction();\n const { keyframes, initialValues } = this.parseDefinitions();\n const callback = this.callbackV;\n\n return () => {\n 'worklet';\n const animations: StylePropsWithArrayTransform = {};\n\n /* \n For each style property, an animations sequence is created that corresponds with its key points.\n Transform style properties require special handling because of their nested structure.\n */\n const addAnimation = (key: string) => {\n const keyframePoints = keyframes[key];\n // in case if property was only passed as initial value\n if (keyframePoints.length === 0) {\n return;\n }\n const animation = delayFunction(\n delay,\n keyframePoints.length === 1\n ? withTiming(keyframePoints[0].value, {\n duration: keyframePoints[0].duration,\n easing: keyframePoints[0].easing\n ? keyframePoints[0].easing\n : Easing.linear,\n })\n : withSequence(\n ...keyframePoints.map((keyframePoint: KeyframePoint) =>\n withTiming(keyframePoint.value, {\n duration: keyframePoint.duration,\n easing: keyframePoint.easing\n ? keyframePoint.easing\n : Easing.linear,\n })\n )\n )\n );\n if (key.includes('transform')) {\n if (!('transform' in animations)) {\n animations.transform = [];\n }\n animations.transform!.push(<TransformArrayItem>{\n [key.split(':')[1]]: animation,\n });\n } else {\n animations[key] = animation;\n }\n };\n Object.keys(initialValues).forEach((key: string) => {\n if (key.includes('transform')) {\n initialValues[key].forEach(\n (transformProp: Record<string, number | string>, index: number) => {\n Object.keys(transformProp).forEach((transformPropKey: string) => {\n addAnimation(makeKeyframeKey(index, transformPropKey));\n });\n }\n );\n } else {\n addAnimation(key);\n }\n });\n return {\n animations,\n initialValues,\n callback,\n };\n };\n };\n}\n\nfunction makeKeyframeKey(index: number, transformProp: string) {\n 'worklet';\n return `${index}_transform:${transformProp}`;\n}\n\n// TODO TYPESCRIPT This is a temporary type to get rid of .d.ts file.\nexport declare class ReanimatedKeyframe {\n constructor(definitions: Record<string, KeyframeProps>);\n duration(durationMs: number): ReanimatedKeyframe;\n delay(delayMs: number): ReanimatedKeyframe;\n reduceMotion(reduceMotionV: ReduceMotion): ReanimatedKeyframe;\n withCallback(callback: (finished: boolean) => void): ReanimatedKeyframe;\n}\n\n// TODO TYPESCRIPT This temporary cast is to get rid of .d.ts file.\nexport const Keyframe = InnerKeyframe as unknown as typeof ReanimatedKeyframe;\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,CAAA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qB,EAAE;EAC7D,SAAS;;EACT,OAAQ,GAAEC,KAAM,cAAaD,aAAc,EAAC;AAC9C;;AAEA;;AASA;AACA,OAAO,MAAMoC,QAAQ,GAAGjE,aAAqD","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["LayoutAnimationType","SharedTransitionType"],"sources":["commonTypes.ts"],"sourcesContent":["'use strict';\nimport type { TransformArrayItem } from '../../helperTypes';\nimport type { EasingFunction } from '../../Easing';\nimport type { ShareableRef, StyleProps } from '../../commonTypes';\n\nexport type LayoutAnimationsOptions =\n | 'originX'\n | 'originY'\n | 'width'\n | 'height'\n | 'borderRadius'\n | 'globalOriginX'\n | 'globalOriginY';\n\ntype CurrentLayoutAnimationsValues = {\n [K in LayoutAnimationsOptions as `current${Capitalize<string & K>}`]: number;\n};\n\ntype TargetLayoutAnimationsValues = {\n [K in LayoutAnimationsOptions as `target${Capitalize<string & K>}`]: number;\n};\n\ninterface WindowDimensions {\n windowWidth: number;\n windowHeight: number;\n}\n\nexport interface KeyframeProps extends StyleProps {\n easing?: EasingFunction;\n}\n\nexport type LayoutAnimation = {\n initialValues: StyleProps;\n animations: StyleProps;\n callback?: (finished: boolean) => void;\n};\n\nexport type AnimationFunction = (a?: any, b?: any, c?: any) => any; // this is just a temporary mock\n\nexport type EntryAnimationsValues = TargetLayoutAnimationsValues &\n WindowDimensions;\n\nexport type ExitAnimationsValues = CurrentLayoutAnimationsValues &\n WindowDimensions;\n\nexport type EntryExitAnimationFunction =\n | ((targetValues: EntryAnimationsValues) => LayoutAnimation)\n | ((targetValues: ExitAnimationsValues) => LayoutAnimation)\n | (() => LayoutAnimation);\n\nexport type AnimationConfigFunction<T> = (targetValues: T) => LayoutAnimation;\n\nexport type LayoutAnimationsValues = CurrentLayoutAnimationsValues &\n TargetLayoutAnimationsValues &\n WindowDimensions;\n\nexport interface SharedTransitionAnimationsValues\n extends LayoutAnimationsValues {\n currentTransformMatrix: number[];\n targetTransformMatrix: number[];\n}\n\nexport type SharedTransitionAnimationsFunction = (\n values: SharedTransitionAnimationsValues\n) => LayoutAnimation;\n\nexport enum LayoutAnimationType {\n ENTERING = 1,\n EXITING = 2,\n LAYOUT = 3,\n SHARED_ELEMENT_TRANSITION = 4,\n SHARED_ELEMENT_TRANSITION_PROGRESS = 5,\n}\n\nexport type LayoutAnimationFunction = (\n targetValues: LayoutAnimationsValues\n) => LayoutAnimation;\n\nexport type LayoutAnimationStartFunction = (\n tag: number,\n type: LayoutAnimationType,\n yogaValues: Partial<SharedTransitionAnimationsValues>,\n config: LayoutAnimationFunction\n) => void;\n\nexport interface ILayoutAnimationBuilder {\n build: () => LayoutAnimationFunction;\n}\n\nexport interface BaseLayoutAnimationConfig {\n duration?: number;\n easing?: EasingFunction;\n type?: AnimationFunction;\n damping?: number;\n dampingRatio?: number;\n mass?: number;\n stiffness?: number;\n overshootClamping?: number;\n restDisplacementThreshold?: number;\n restSpeedThreshold?: number;\n}\n\nexport interface BaseBuilderAnimationConfig extends BaseLayoutAnimationConfig {\n rotate?: number | string;\n}\n\nexport type LayoutAnimationAndConfig = [\n AnimationFunction,\n BaseBuilderAnimationConfig\n];\n\nexport interface IEntryExitAnimationBuilder {\n build: () => EntryExitAnimationFunction;\n}\n\nexport interface IEntryAnimationBuilder {\n build: () => AnimationConfigFunction<EntryAnimationsValues>;\n}\n\nexport interface IExitAnimationBuilder {\n build: () => AnimationConfigFunction<ExitAnimationsValues>;\n}\n\nexport type ProgressAnimationCallback = (\n viewTag: number,\n progress: number\n) => void;\n\nexport type ProgressAnimation = (\n viewTag: number,\n values: SharedTransitionAnimationsValues,\n progress: number\n) => void;\n\nexport type CustomProgressAnimation = (\n values: SharedTransitionAnimationsValues,\n progress: number\n) => StyleProps;\n\n/**\n * Used to configure the `.defaultTransitionType()` shared transition modifier.\n * @experimental\n */\nexport enum SharedTransitionType {\n ANIMATION = 'animation',\n PROGRESS_ANIMATION = 'progressAnimation',\n}\n\nexport type EntryExitAnimationsValues =\n | EntryAnimationsValues\n | ExitAnimationsValues;\n\nexport type StylePropsWithArrayTransform = StyleProps & {\n transform?: TransformArrayItem[];\n};\n\nexport interface LayoutAnimationBatchItem {\n viewTag: number;\n type: LayoutAnimationType;\n config:\n | ShareableRef<\n | Keyframe\n | LayoutAnimationFunction\n | SharedTransitionAnimationsFunction\n | ProgressAnimationCallback\n >\n | undefined;\n sharedTransitionTag?: string;\n}\n"],"mappings":"AAAA,YAAY;;AAqCwD;;AA6BpE,WAAYA,mBAAmB,0BAAnBA,mBAAmB;EAAnBA,mBAAmB,CAAnBA,mBAAmB;EAAnBA,mBAAmB,CAAnBA,mBAAmB;EAAnBA,mBAAmB,CAAnBA,mBAAmB;EAAnBA,mBAAmB,CAAnBA,mBAAmB;EAAnBA,mBAAmB,CAAnBA,mBAAmB;EAAA,OAAnBA,mBAAmB;AAAA;AAyE/B;AACA;AACA;AACA;AACA,WAAYC,oBAAoB,0BAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAAA,OAApBA,oBAAoB;AAAA"}
|
|
1
|
+
{"version":3,"names":["LayoutAnimationType","SharedTransitionType"],"sources":["commonTypes.ts"],"sourcesContent":["'use strict';\nimport type { TransformArrayItem } from '../../helperTypes';\nimport type { EasingFunction } from '../../Easing';\nimport type { ShareableRef, StyleProps } from '../../commonTypes';\n\nexport type LayoutAnimationsOptions =\n | 'originX'\n | 'originY'\n | 'width'\n | 'height'\n | 'borderRadius'\n | 'globalOriginX'\n | 'globalOriginY';\n\ntype CurrentLayoutAnimationsValues = {\n [K in LayoutAnimationsOptions as `current${Capitalize<string & K>}`]: number;\n};\n\ntype TargetLayoutAnimationsValues = {\n [K in LayoutAnimationsOptions as `target${Capitalize<string & K>}`]: number;\n};\n\ninterface WindowDimensions {\n windowWidth: number;\n windowHeight: number;\n}\n\nexport interface KeyframeProps extends StyleProps {\n easing?: EasingFunction;\n}\n\nexport type LayoutAnimation = {\n initialValues: StyleProps;\n animations: StyleProps;\n callback?: (finished: boolean) => void;\n};\n\nexport type AnimationFunction = (a?: any, b?: any, c?: any) => any; // this is just a temporary mock\n\nexport type EntryAnimationsValues = TargetLayoutAnimationsValues &\n WindowDimensions;\n\nexport type ExitAnimationsValues = CurrentLayoutAnimationsValues &\n WindowDimensions;\n\nexport type EntryExitAnimationFunction =\n | ((targetValues: EntryAnimationsValues) => LayoutAnimation)\n | ((targetValues: ExitAnimationsValues) => LayoutAnimation)\n | (() => LayoutAnimation);\n\nexport type AnimationConfigFunction<T> = (targetValues: T) => LayoutAnimation;\n\nexport type LayoutAnimationsValues = CurrentLayoutAnimationsValues &\n TargetLayoutAnimationsValues &\n WindowDimensions;\n\nexport interface SharedTransitionAnimationsValues\n extends LayoutAnimationsValues {\n currentTransformMatrix: number[];\n targetTransformMatrix: number[];\n}\n\nexport type SharedTransitionAnimationsFunction = (\n values: SharedTransitionAnimationsValues\n) => LayoutAnimation;\n\nexport enum LayoutAnimationType {\n ENTERING = 1,\n EXITING = 2,\n LAYOUT = 3,\n SHARED_ELEMENT_TRANSITION = 4,\n SHARED_ELEMENT_TRANSITION_PROGRESS = 5,\n}\n\nexport type LayoutAnimationFunction = (\n targetValues: LayoutAnimationsValues\n) => LayoutAnimation;\n\nexport type LayoutAnimationStartFunction = (\n tag: number,\n type: LayoutAnimationType,\n yogaValues: Partial<SharedTransitionAnimationsValues>,\n config: LayoutAnimationFunction\n) => void;\n\nexport interface ILayoutAnimationBuilder {\n build: () => LayoutAnimationFunction;\n}\n\nexport interface BaseLayoutAnimationConfig {\n duration?: number;\n easing?: EasingFunction;\n type?: AnimationFunction;\n damping?: number;\n dampingRatio?: number;\n mass?: number;\n stiffness?: number;\n overshootClamping?: number;\n restDisplacementThreshold?: number;\n restSpeedThreshold?: number;\n}\n\nexport interface BaseBuilderAnimationConfig extends BaseLayoutAnimationConfig {\n rotate?: number | string;\n}\n\nexport type LayoutAnimationAndConfig = [\n AnimationFunction,\n BaseBuilderAnimationConfig\n];\n\nexport interface IEntryExitAnimationBuilder {\n build: () => EntryExitAnimationFunction;\n}\n\nexport interface IEntryAnimationBuilder {\n build: () => AnimationConfigFunction<EntryAnimationsValues>;\n}\n\nexport interface IExitAnimationBuilder {\n build: () => AnimationConfigFunction<ExitAnimationsValues>;\n}\n\nexport type ProgressAnimationCallback = (\n viewTag: number,\n progress: number\n) => void;\n\nexport type ProgressAnimation = (\n viewTag: number,\n values: SharedTransitionAnimationsValues,\n progress: number\n) => void;\n\nexport type CustomProgressAnimation = (\n values: SharedTransitionAnimationsValues,\n progress: number\n) => StyleProps;\n\n/**\n * Used to configure the `.defaultTransitionType()` shared transition modifier.\n * @experimental\n */\nexport enum SharedTransitionType {\n ANIMATION = 'animation',\n PROGRESS_ANIMATION = 'progressAnimation',\n}\n\nexport type EntryExitAnimationsValues =\n | EntryAnimationsValues\n | ExitAnimationsValues;\n\nexport type StylePropsWithArrayTransform = StyleProps & {\n transform?: TransformArrayItem[];\n};\n\nexport interface LayoutAnimationBatchItem {\n viewTag: number;\n type: LayoutAnimationType;\n config:\n | ShareableRef<\n | Keyframe\n | LayoutAnimationFunction\n | SharedTransitionAnimationsFunction\n | ProgressAnimationCallback\n >\n | undefined;\n sharedTransitionTag?: string;\n}\n"],"mappings":"AAAA,YAAY;;AAqCwD;;AA6BpE,WAAYA,mBAAmB,0BAAnBA,mBAAmB;EAAnBA,mBAAmB,CAAnBA,mBAAmB;EAAnBA,mBAAmB,CAAnBA,mBAAmB;EAAnBA,mBAAmB,CAAnBA,mBAAmB;EAAnBA,mBAAmB,CAAnBA,mBAAmB;EAAnBA,mBAAmB,CAAnBA,mBAAmB;EAAA,OAAnBA,mBAAmB;AAAA;AAyE/B;AACA;AACA;AACA;AACA,WAAYC,oBAAoB,0BAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAAA,OAApBA,oBAAoB;AAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["BaseAnimationBuilder","ComplexAnimationBuilder","Keyframe","LayoutAnimationType","SharedTransitionType"],"sources":["index.ts"],"sourcesContent":["'use strict';\nexport { BaseAnimationBuilder } from './BaseAnimationBuilder';\nexport { ComplexAnimationBuilder } from './ComplexAnimationBuilder';\nexport { Keyframe } from './Keyframe';\nexport { LayoutAnimationType, SharedTransitionType } from './commonTypes';\nexport type {\n LayoutAnimation,\n AnimationFunction,\n EntryAnimationsValues,\n ExitAnimationsValues,\n EntryExitAnimationFunction,\n AnimationConfigFunction,\n IEntryAnimationBuilder,\n IExitAnimationBuilder,\n LayoutAnimationsValues,\n LayoutAnimationFunction,\n LayoutAnimationStartFunction,\n ILayoutAnimationBuilder,\n BaseLayoutAnimationConfig,\n BaseBuilderAnimationConfig,\n LayoutAnimationAndConfig,\n IEntryExitAnimationBuilder,\n} from './commonTypes';\n"],"mappings":"AAAA,YAAY;;AACZ,SAASA,oBAAoB,QAAQ,wBAAwB;AAC7D,SAASC,uBAAuB,QAAQ,2BAA2B;AACnE,SAASC,QAAQ,QAAQ,YAAY;AACrC,SAASC,mBAAmB,EAAEC,oBAAoB,QAAQ,eAAe"}
|
|
1
|
+
{"version":3,"names":["BaseAnimationBuilder","ComplexAnimationBuilder","Keyframe","LayoutAnimationType","SharedTransitionType"],"sources":["index.ts"],"sourcesContent":["'use strict';\nexport { BaseAnimationBuilder } from './BaseAnimationBuilder';\nexport { ComplexAnimationBuilder } from './ComplexAnimationBuilder';\nexport { Keyframe } from './Keyframe';\nexport { LayoutAnimationType, SharedTransitionType } from './commonTypes';\nexport type {\n LayoutAnimation,\n AnimationFunction,\n EntryAnimationsValues,\n ExitAnimationsValues,\n EntryExitAnimationFunction,\n AnimationConfigFunction,\n IEntryAnimationBuilder,\n IExitAnimationBuilder,\n LayoutAnimationsValues,\n LayoutAnimationFunction,\n LayoutAnimationStartFunction,\n ILayoutAnimationBuilder,\n BaseLayoutAnimationConfig,\n BaseBuilderAnimationConfig,\n LayoutAnimationAndConfig,\n IEntryExitAnimationBuilder,\n} from './commonTypes';\n"],"mappings":"AAAA,YAAY;;AACZ,SAASA,oBAAoB,QAAQ,wBAAwB;AAC7D,SAASC,uBAAuB,QAAQ,2BAA2B;AACnE,SAASC,QAAQ,QAAQ,YAAY;AACrC,SAASC,mBAAmB,EAAEC,oBAAoB,QAAQ,eAAe","ignoreList":[]}
|
|
@@ -13,10 +13,9 @@ function startObservingProgress(tag, sharedValue, animationType) {
|
|
|
13
13
|
global._notifyAboutProgress(tag, sharedValue.value, isSharedTransition);
|
|
14
14
|
});
|
|
15
15
|
}
|
|
16
|
-
function stopObservingProgress(tag, sharedValue) {
|
|
16
|
+
function stopObservingProgress(tag, sharedValue, removeView = false) {
|
|
17
17
|
'worklet';
|
|
18
18
|
|
|
19
|
-
let removeView = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
20
19
|
sharedValue.removeListener(tag + TAG_OFFSET);
|
|
21
20
|
global._notifyAboutEnd(tag, removeView);
|
|
22
21
|
}
|