react-native-reanimated 3.13.0-rc.2 → 3.13.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/LayoutAnimations/LayoutAnimationsManager.cpp +8 -2
- package/Common/cpp/LayoutAnimations/LayoutAnimationsManager.h +3 -1
- package/Common/cpp/LayoutAnimations/LayoutAnimationsProxy.cpp +58 -33
- package/Common/cpp/LayoutAnimations/LayoutAnimationsProxy.h +19 -9
- package/Common/cpp/LayoutAnimations/LayoutAnimationsUtils.cpp +11 -7
- package/Common/cpp/LayoutAnimations/LayoutAnimationsUtils.h +14 -6
- package/Common/cpp/NativeModules/NativeReanimatedModule.cpp +1 -1
- package/Common/cpp/NativeModules/NativeReanimatedModule.h +1 -1
- package/Common/cpp/ReanimatedRuntime/WorkletRuntime.cpp +1 -1
- package/Common/cpp/ReanimatedRuntime/WorkletRuntime.h +1 -1
- package/Common/cpp/ReanimatedRuntime/WorkletRuntimeDecorator.cpp +6 -6
- package/Common/cpp/SharedItems/Shareables.cpp +25 -8
- package/Common/cpp/SharedItems/Shareables.h +12 -7
- package/android/CMakeLists.txt +1 -1
- package/android/src/main/cpp/LayoutAnimations.cpp +14 -0
- package/android/src/main/cpp/LayoutAnimations.h +5 -0
- package/android/src/main/cpp/NativeProxy.cpp +10 -0
- package/android/src/main/java/com/swmansion/reanimated/layoutReanimation/AnimationsManager.java +10 -2
- package/android/src/main/java/com/swmansion/reanimated/layoutReanimation/LayoutAnimations.java +2 -0
- package/android/src/main/java/com/swmansion/reanimated/layoutReanimation/NativeMethodsHolder.java +2 -0
- package/android/src/main/java/com/swmansion/reanimated/layoutReanimation/ReanimatedNativeHierarchyManager.java +10 -0
- package/android/src/main/java/com/swmansion/reanimated/layoutReanimation/ScreensHelper.java +83 -0
- package/android/src/main/java/com/swmansion/reanimated/layoutReanimation/SharedTransitionManager.java +130 -31
- package/android/src/main/java/com/swmansion/reanimated/layoutReanimation/Snapshot.java +36 -0
- package/android/src/main/java/com/swmansion/reanimated/layoutReanimation/TabNavigatorObserver.java +128 -0
- package/android/src/paper/java/com/swmansion/reanimated/NativeProxy.java +8 -0
- package/android/src/reactNativeVersionPatch/RuntimeExecutor/73/com/swmansion/reanimated/NativeProxy.java +6 -0
- package/android/src/reactNativeVersionPatch/RuntimeExecutor/latest/com/swmansion/reanimated/NativeProxy.java +6 -0
- package/apple/LayoutReanimation/REAAnimationsManager.h +2 -0
- package/apple/LayoutReanimation/REAAnimationsManager.m +5 -0
- package/apple/LayoutReanimation/REAScreensHelper.h +6 -0
- package/apple/LayoutReanimation/REAScreensHelper.m +92 -4
- package/apple/LayoutReanimation/REASharedTransitionManager.h +1 -0
- package/apple/LayoutReanimation/REASharedTransitionManager.m +254 -55
- package/apple/native/NativeProxy.mm +12 -0
- package/lib/module/Colors.js +5 -2
- package/lib/module/Colors.js.map +1 -1
- package/lib/module/UpdateProps.js +8 -8
- package/lib/module/UpdateProps.js.map +1 -1
- package/lib/module/ViewDescriptorsSet.js +0 -27
- package/lib/module/ViewDescriptorsSet.js.map +1 -1
- package/lib/module/createAnimatedComponent/InlinePropManager.js +1 -7
- package/lib/module/createAnimatedComponent/InlinePropManager.js.map +1 -1
- package/lib/module/createAnimatedComponent/PropsFilter.js +1 -6
- package/lib/module/createAnimatedComponent/PropsFilter.js.map +1 -1
- package/lib/module/createAnimatedComponent/commonTypes.js.map +1 -1
- package/lib/module/createAnimatedComponent/createAnimatedComponent.js +1 -5
- package/lib/module/createAnimatedComponent/createAnimatedComponent.js.map +1 -1
- package/lib/module/hook/commonTypes.js.map +1 -1
- package/lib/module/hook/useAnimatedStyle.js +12 -15
- package/lib/module/hook/useAnimatedStyle.js.map +1 -1
- package/lib/module/hook/useFrameCallback.js +2 -2
- package/lib/module/hook/useFrameCallback.js.map +1 -1
- package/lib/module/hook/useWorkletCallback.js +1 -1
- package/lib/module/hook/useWorkletCallback.js.map +1 -1
- package/lib/module/js-reanimated/index.js +3 -28
- package/lib/module/js-reanimated/index.js.map +1 -1
- package/lib/module/js-reanimated/webUtils.js +9 -0
- package/lib/module/js-reanimated/webUtils.js.map +1 -0
- package/lib/module/js-reanimated/webUtils.web.js +25 -0
- package/lib/module/js-reanimated/webUtils.web.js.map +1 -0
- package/lib/module/layoutReanimation/defaultTransitions/CurvedTransition.js +1 -0
- package/lib/module/layoutReanimation/defaultTransitions/CurvedTransition.js.map +1 -1
- package/lib/module/layoutReanimation/defaultTransitions/EntryExitTransition.js +1 -0
- package/lib/module/layoutReanimation/defaultTransitions/EntryExitTransition.js.map +1 -1
- package/lib/module/layoutReanimation/defaultTransitions/FadingTransition.js +11 -10
- package/lib/module/layoutReanimation/defaultTransitions/FadingTransition.js.map +1 -1
- package/lib/module/layoutReanimation/defaultTransitions/JumpingTransition.js +1 -0
- package/lib/module/layoutReanimation/defaultTransitions/JumpingTransition.js.map +1 -1
- package/lib/module/layoutReanimation/defaultTransitions/LinearTransition.js +1 -0
- package/lib/module/layoutReanimation/defaultTransitions/LinearTransition.js.map +1 -1
- package/lib/module/layoutReanimation/defaultTransitions/SequencedTransition.js +1 -0
- package/lib/module/layoutReanimation/defaultTransitions/SequencedTransition.js.map +1 -1
- package/lib/module/layoutReanimation/web/Easing.web.js +14 -0
- package/lib/module/layoutReanimation/web/Easing.web.js.map +1 -0
- package/lib/module/layoutReanimation/web/animationParser.js +16 -1
- package/lib/module/layoutReanimation/web/animationParser.js.map +1 -1
- package/lib/module/layoutReanimation/web/animationsManager.js +25 -8
- package/lib/module/layoutReanimation/web/animationsManager.js.map +1 -1
- package/lib/module/layoutReanimation/web/componentStyle.js +12 -16
- package/lib/module/layoutReanimation/web/componentStyle.js.map +1 -1
- package/lib/module/layoutReanimation/web/componentUtils.js +53 -18
- package/lib/module/layoutReanimation/web/componentUtils.js.map +1 -1
- package/lib/module/layoutReanimation/web/config.js +1 -12
- package/lib/module/layoutReanimation/web/config.js.map +1 -1
- package/lib/module/layoutReanimation/web/createAnimation.js +21 -2
- package/lib/module/layoutReanimation/web/createAnimation.js.map +1 -1
- package/lib/module/layoutReanimation/web/domUtils.js +6 -5
- package/lib/module/layoutReanimation/web/domUtils.js.map +1 -1
- package/lib/module/layoutReanimation/web/transition/Jumping.web.js +43 -0
- package/lib/module/layoutReanimation/web/transition/Jumping.web.js.map +1 -0
- package/lib/module/platform-specific/RNRenderer.web.js +1 -1
- package/lib/module/platform-specific/RNRenderer.web.js.map +1 -1
- package/lib/module/platform-specific/jsVersion.js +1 -1
- package/lib/module/platform-specific/jsVersion.js.map +1 -1
- package/lib/module/platformFunctions/setNativeProps.web.js +1 -3
- package/lib/module/platformFunctions/setNativeProps.web.js.map +1 -1
- package/lib/typescript/UpdateProps.d.ts +2 -3
- package/lib/typescript/ViewDescriptorsSet.d.ts +0 -9
- package/lib/typescript/createAnimatedComponent/commonTypes.d.ts +1 -2
- package/lib/typescript/hook/commonTypes.d.ts +3 -6
- package/lib/typescript/hook/useWorkletCallback.d.ts +1 -1
- package/lib/typescript/js-reanimated/index.d.ts +2 -4
- package/lib/typescript/js-reanimated/webUtils.d.ts +3 -0
- package/lib/typescript/js-reanimated/webUtils.web.d.ts +3 -0
- package/lib/typescript/layoutReanimation/defaultTransitions/CurvedTransition.d.ts +1 -0
- package/lib/typescript/layoutReanimation/defaultTransitions/EntryExitTransition.d.ts +1 -0
- package/lib/typescript/layoutReanimation/defaultTransitions/FadingTransition.d.ts +1 -0
- package/lib/typescript/layoutReanimation/defaultTransitions/JumpingTransition.d.ts +1 -0
- package/lib/typescript/layoutReanimation/defaultTransitions/LinearTransition.d.ts +1 -0
- package/lib/typescript/layoutReanimation/defaultTransitions/SequencedTransition.d.ts +1 -0
- package/lib/typescript/layoutReanimation/web/Easing.web.d.ts +10 -0
- package/lib/typescript/layoutReanimation/web/animationParser.d.ts +1 -2
- package/lib/typescript/layoutReanimation/web/componentStyle.d.ts +1 -1
- package/lib/typescript/layoutReanimation/web/componentUtils.d.ts +4 -3
- package/lib/typescript/layoutReanimation/web/config.d.ts +5 -12
- package/lib/typescript/layoutReanimation/web/createAnimation.d.ts +2 -0
- package/lib/typescript/layoutReanimation/web/domUtils.d.ts +1 -1
- package/lib/typescript/layoutReanimation/web/transition/Jumping.web.d.ts +29 -0
- package/lib/typescript/platform-specific/jsVersion.d.ts +1 -1
- package/package.json +4 -3
- package/src/Colors.ts +5 -2
- package/src/UpdateProps.ts +8 -11
- package/src/ViewDescriptorsSet.ts +0 -42
- package/src/createAnimatedComponent/InlinePropManager.ts +2 -8
- package/src/createAnimatedComponent/PropsFilter.tsx +0 -4
- package/src/createAnimatedComponent/commonTypes.ts +1 -2
- package/src/createAnimatedComponent/createAnimatedComponent.tsx +1 -5
- package/src/hook/commonTypes.ts +3 -6
- package/src/hook/useAnimatedStyle.ts +9 -26
- package/src/hook/useFrameCallback.ts +2 -2
- package/src/hook/useWorkletCallback.ts +1 -1
- package/src/js-reanimated/index.ts +11 -37
- package/src/js-reanimated/webUtils.ts +8 -0
- package/src/js-reanimated/webUtils.web.ts +27 -0
- package/src/layoutReanimation/defaultTransitions/CurvedTransition.ts +2 -0
- package/src/layoutReanimation/defaultTransitions/EntryExitTransition.ts +2 -0
- package/src/layoutReanimation/defaultTransitions/FadingTransition.ts +12 -10
- package/src/layoutReanimation/defaultTransitions/JumpingTransition.ts +2 -0
- package/src/layoutReanimation/defaultTransitions/LinearTransition.ts +2 -0
- package/src/layoutReanimation/defaultTransitions/SequencedTransition.ts +2 -0
- package/src/layoutReanimation/web/Easing.web.ts +15 -0
- package/src/layoutReanimation/web/animationParser.ts +30 -2
- package/src/layoutReanimation/web/animationsManager.ts +45 -12
- package/src/layoutReanimation/web/componentStyle.ts +13 -16
- package/src/layoutReanimation/web/componentUtils.ts +68 -25
- package/src/layoutReanimation/web/config.ts +5 -14
- package/src/layoutReanimation/web/createAnimation.ts +38 -4
- package/src/layoutReanimation/web/domUtils.ts +15 -5
- package/src/layoutReanimation/web/transition/Jumping.web.ts +44 -0
- package/src/platform-specific/RNRenderer.web.ts +1 -1
- package/src/platform-specific/jsVersion.ts +1 -1
- package/src/platformFunctions/setNativeProps.web.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_extends","Object","assign","bind","target","i","arguments","length","source","key","prototype","hasOwnProperty","call","apply","_defineProperty","obj","value","_toPropertyKey","defineProperty","enumerable","configurable","writable","t","_toPrimitive","r","e","Symbol","toPrimitive","TypeError","String","Number","React","findNodeHandle","Platform","invariant","adaptViewConfig","RNRenderer","enableLayoutAnimations","SharedTransition","LayoutAnimationType","getShadowNodeWrapperFromRef","removeFromPropsRegistry","getReduceMotionFromConfig","maybeBuild","SkipEnteringContext","JSPropsUpdater","flattenArray","setAndForwardRef","isFabric","isJest","isWeb","shouldBeUseWeb","InlinePropManager","PropsFilter","startWebLayoutAnimation","tryActivateLayoutTransition","configureWebLayoutAnimations","getReducedMotionFromConfig","saveSnapshot","updateLayoutAnimations","addHTMLMutationObserver","getViewInfo","NativeEventsManager","IS_WEB","onlyAnimatedStyles","styles","filter","style","viewDescriptors","id","createAnimatedComponent","Component","options","isReactComponent","name","AnimatedComponent","constructor","props","getForwardedRef","forwardedRef","setLocalRef","ref","tag","_componentViewTag","layout","entering","exiting","sharedTransitionTag","_this$context","_configureSharedTransition","reduceMotionInExiting","getReduceMotion","_this$props","EXITING","displayName","skipEntering","context","current","_this$props2","ENTERING","_component","jestAnimatedStyle","_this$props3","reanimatedID","componentDidMount","_this$_NativeEventsMa","_getComponentViewTag","_NativeEventsManager","attachEvents","_jsPropsUpdater","addOnJSPropsChangeListener","_attachAnimatedStyles","_InlinePropManager","attachInlineProps","_getViewInfo","_configureLayoutTransition","_isFirstRender","componentWillUnmount","_this$_NativeEventsMa2","_this$_sharedElementT","detachEvents","removeOnJSPropsChangeListener","_detachStyles","detachInlineProps","_sharedElementTransition","unregisterTransition","_this$props4","viewTag","_styles","viewsRef","remove","_this$props$animatedP","animatedProps","_updateFromNative","setNativeProps","_this$_component","_this$_component$setN","_this$_component2","_getAnimatableRef","_ref","_viewInfo","undefined","viewName","shadowNodeWrapper","viewConfig","component","getAnimatableRef","hostInstance","findHostInstance_DEPRECATED","Error","viewInfo","_this$props$animatedP2","_this$props$animatedP3","prevStyles","prevAnimatedProps","_animatedProps","hasReanimated2Props","hasOneSameStyle","prevStyle","isPresent","some","forEach","add","initial","componentDidUpdate","prevProps","_prevState","snapshot","_this$_NativeEventsMa3","oldLayout","updateEvents","LAYOUT","isUnmounting","_this$_sharedElementT2","sharedElementTransition","sharedTransitionStyle","registerTransition","getSnapshotBeforeUpdate","_this$_component3","getBoundingClientRect","render","_this$context2","filteredProps","_PropsFilter","filterNonAnimatedProps","visibility","platformProps","select","web","default","collapsable","nativeID","createElement","_setComponentRef","forwardRef"],"sources":["createAnimatedComponent.tsx"],"sourcesContent":["'use strict';\nimport type {\n Component,\n ComponentClass,\n ComponentType,\n FunctionComponent,\n MutableRefObject,\n} from 'react';\nimport React from 'react';\nimport { findNodeHandle, Platform } from 'react-native';\nimport '../layoutReanimation/animationsManager';\nimport invariant from 'invariant';\nimport { adaptViewConfig } from '../ConfigHelper';\nimport { RNRenderer } from '../platform-specific/RNRenderer';\nimport { enableLayoutAnimations } from '../core';\nimport { SharedTransition, LayoutAnimationType } from '../layoutReanimation';\nimport type { StyleProps, ShadowNodeWrapper } from '../commonTypes';\nimport { getShadowNodeWrapperFromRef } from '../fabricUtils';\nimport { removeFromPropsRegistry } from '../PropsRegistry';\nimport { getReduceMotionFromConfig } from '../animation/util';\nimport { maybeBuild } from '../animationBuilder';\nimport { SkipEnteringContext } from '../component/LayoutAnimationConfig';\nimport type { AnimateProps } from '../helperTypes';\nimport JSPropsUpdater from './JSPropsUpdater';\nimport type {\n AnimatedComponentProps,\n AnimatedProps,\n InitialComponentProps,\n AnimatedComponentRef,\n IAnimatedComponentInternal,\n ViewInfo,\n INativeEventsManager,\n} from './commonTypes';\nimport { flattenArray } from './utils';\nimport setAndForwardRef from './setAndForwardRef';\nimport { isFabric, isJest, isWeb, shouldBeUseWeb } from '../PlatformChecker';\nimport { InlinePropManager } from './InlinePropManager';\nimport { PropsFilter } from './PropsFilter';\nimport {\n startWebLayoutAnimation,\n tryActivateLayoutTransition,\n configureWebLayoutAnimations,\n getReducedMotionFromConfig,\n saveSnapshot,\n} from '../layoutReanimation/web';\nimport { updateLayoutAnimations } from '../UpdateLayoutAnimations';\nimport type { CustomConfig } from '../layoutReanimation/web/config';\nimport type { FlatList, FlatListProps } from 'react-native';\nimport { addHTMLMutationObserver } from '../layoutReanimation/web/domUtils';\nimport { getViewInfo } from './getViewInfo';\nimport { NativeEventsManager } from './NativeEventsManager';\n\nconst IS_WEB = isWeb();\n\nif (IS_WEB) {\n configureWebLayoutAnimations();\n}\n\nfunction onlyAnimatedStyles(styles: StyleProps[]): StyleProps[] {\n return styles.filter((style) => style?.viewDescriptors);\n}\n\ntype Options<P> = {\n setNativeProps: (ref: AnimatedComponentRef, props: P) => void;\n};\n\n/**\n * Lets you create an Animated version of any React Native component.\n *\n * @param component - The component you want to make animatable.\n * @returns A component that Reanimated is capable of animating.\n * @see https://docs.swmansion.com/react-native-reanimated/docs/core/createAnimatedComponent\n */\n\n// Don't change the order of overloads, since such a change breaks current behavior\nexport function createAnimatedComponent<P extends object>(\n component: FunctionComponent<P>,\n options?: Options<P>\n): FunctionComponent<AnimateProps<P>>;\n\nexport function createAnimatedComponent<P extends object>(\n component: ComponentClass<P>,\n options?: Options<P>\n): ComponentClass<AnimateProps<P>>;\n\nexport function createAnimatedComponent<P extends object>(\n // Actually ComponentType<P = {}> = ComponentClass<P> | FunctionComponent<P> but we need this overload too\n // since some external components (like FastImage) are typed just as ComponentType\n component: ComponentType<P>,\n options?: Options<P>\n): FunctionComponent<AnimateProps<P>> | ComponentClass<AnimateProps<P>>;\n\n/**\n * @deprecated Please use `Animated.FlatList` component instead of calling `Animated.createAnimatedComponent(FlatList)` manually.\n */\n// @ts-ignore This is required to create this overload, since type of createAnimatedComponent is incorrect and doesn't include typeof FlatList\nexport function createAnimatedComponent(\n component: typeof FlatList<unknown>,\n options?: Options<any>\n): ComponentClass<AnimateProps<FlatListProps<unknown>>>;\n\nlet id = 0;\n\nexport function createAnimatedComponent(\n Component: ComponentType<InitialComponentProps>,\n options?: Options<InitialComponentProps>\n): any {\n invariant(\n typeof Component !== 'function' ||\n (Component.prototype && Component.prototype.isReactComponent),\n `Looks like you're passing a function component \\`${Component.name}\\` to \\`createAnimatedComponent\\` function which supports only class components. Please wrap your function component with \\`React.forwardRef()\\` or use a class component instead.`\n );\n\n class AnimatedComponent\n extends React.Component<AnimatedComponentProps<InitialComponentProps>>\n implements IAnimatedComponentInternal\n {\n _styles: StyleProps[] | null = null;\n _animatedProps?: Partial<AnimatedComponentProps<AnimatedProps>>;\n _componentViewTag = -1;\n _isFirstRender = true;\n jestAnimatedStyle: { value: StyleProps } = { value: {} };\n _component: AnimatedComponentRef | HTMLElement | null = null;\n _sharedElementTransition: SharedTransition | null = null;\n _jsPropsUpdater = new JSPropsUpdater();\n _InlinePropManager = new InlinePropManager();\n _PropsFilter = new PropsFilter();\n _NativeEventsManager?: INativeEventsManager;\n _viewInfo?: ViewInfo;\n static displayName: string;\n static contextType = SkipEnteringContext;\n context!: React.ContextType<typeof SkipEnteringContext>;\n reanimatedID = id++;\n\n constructor(props: AnimatedComponentProps<InitialComponentProps>) {\n super(props);\n if (isJest()) {\n this.jestAnimatedStyle = { value: {} };\n }\n const entering = this.props.entering;\n if (entering && isFabric()) {\n updateLayoutAnimations(\n this.reanimatedID,\n LayoutAnimationType.ENTERING,\n maybeBuild(entering, this.props?.style, AnimatedComponent.displayName)\n );\n }\n }\n\n componentDidMount() {\n this._componentViewTag = this._getComponentViewTag();\n if (!IS_WEB) {\n // It exists only on native platforms. We initialize it here because the ref to the animated component is available only post-mount\n this._NativeEventsManager = new NativeEventsManager(this, options);\n }\n this._NativeEventsManager?.attachEvents();\n this._jsPropsUpdater.addOnJSPropsChangeListener(this);\n this._attachAnimatedStyles();\n this._InlinePropManager.attachInlineProps(this, this._getViewInfo());\n\n const layout = this.props.layout;\n if (layout) {\n this._configureLayoutTransition();\n }\n\n if (IS_WEB) {\n if (this.props.exiting) {\n saveSnapshot(this._component as HTMLElement);\n }\n\n if (\n !this.props.entering ||\n getReducedMotionFromConfig(this.props.entering as CustomConfig)\n ) {\n this._isFirstRender = false;\n return;\n }\n\n startWebLayoutAnimation(\n this.props,\n this._component as HTMLElement,\n LayoutAnimationType.ENTERING\n );\n }\n\n this._isFirstRender = false;\n }\n\n componentWillUnmount() {\n this._NativeEventsManager?.detachEvents();\n this._jsPropsUpdater.removeOnJSPropsChangeListener(this);\n this._detachStyles();\n this._InlinePropManager.detachInlineProps();\n if (this.props.sharedTransitionTag) {\n this._configureSharedTransition(true);\n }\n this._sharedElementTransition?.unregisterTransition(\n this._componentViewTag,\n true\n );\n\n const exiting = this.props.exiting;\n\n if (\n IS_WEB &&\n this._component &&\n exiting &&\n !getReducedMotionFromConfig(exiting as CustomConfig)\n ) {\n addHTMLMutationObserver();\n\n startWebLayoutAnimation(\n this.props,\n this._component as HTMLElement,\n LayoutAnimationType.EXITING\n );\n } else if (exiting && !IS_WEB && !isFabric()) {\n const reduceMotionInExiting =\n 'getReduceMotion' in exiting &&\n typeof exiting.getReduceMotion === 'function'\n ? getReduceMotionFromConfig(exiting.getReduceMotion())\n : getReduceMotionFromConfig();\n if (!reduceMotionInExiting) {\n updateLayoutAnimations(\n this._componentViewTag,\n LayoutAnimationType.EXITING,\n maybeBuild(\n exiting,\n this.props?.style,\n AnimatedComponent.displayName\n )\n );\n }\n }\n }\n\n _getComponentViewTag() {\n return this._getViewInfo().viewTag as number;\n }\n\n _detachStyles() {\n if (IS_WEB && this._styles !== null) {\n for (const style of this._styles) {\n style.viewsRef.remove(this);\n }\n } else if (this._componentViewTag !== -1 && this._styles !== null) {\n for (const style of this._styles) {\n style.viewDescriptors.remove(this._componentViewTag);\n }\n if (this.props.animatedProps?.viewDescriptors) {\n this.props.animatedProps.viewDescriptors.remove(\n this._componentViewTag\n );\n }\n if (isFabric()) {\n removeFromPropsRegistry(this._componentViewTag);\n }\n }\n }\n\n _updateFromNative(props: StyleProps) {\n if (options?.setNativeProps) {\n options.setNativeProps(this._component as AnimatedComponentRef, props);\n } else {\n (this._component as AnimatedComponentRef)?.setNativeProps?.(props);\n }\n }\n\n _getViewInfo(): ViewInfo {\n if (this._viewInfo !== undefined) {\n return this._viewInfo;\n }\n\n let viewTag: number | HTMLElement | null;\n let viewName: string | null;\n let shadowNodeWrapper: ShadowNodeWrapper | null = null;\n let viewConfig;\n // Component can specify ref which should be animated when animated version of the component is created.\n // Otherwise, we animate the component itself.\n const component = (this._component as AnimatedComponentRef)\n ?.getAnimatableRef\n ? (this._component as AnimatedComponentRef).getAnimatableRef?.()\n : this;\n\n if (IS_WEB) {\n // At this point I assume that `_setComponentRef` was already called and `_component` is set.\n // `this._component` on web represents HTMLElement of our component, that's why we use casting\n viewTag = this._component as HTMLElement;\n viewName = null;\n shadowNodeWrapper = null;\n viewConfig = null;\n } else {\n // hostInstance can be null for a component that doesn't render anything (render function returns null). Example: svg Stop: https://github.com/react-native-svg/react-native-svg/blob/develop/src/elements/Stop.tsx\n const hostInstance = RNRenderer.findHostInstance_DEPRECATED(component);\n if (!hostInstance) {\n throw new Error(\n '[Reanimated] Cannot find host instance for this component. Maybe it renders nothing?'\n );\n }\n\n const viewInfo = getViewInfo(hostInstance);\n viewTag = viewInfo.viewTag;\n viewName = viewInfo.viewName;\n viewConfig = viewInfo.viewConfig;\n shadowNodeWrapper = isFabric()\n ? getShadowNodeWrapperFromRef(this)\n : null;\n }\n this._viewInfo = { viewTag, viewName, shadowNodeWrapper, viewConfig };\n return this._viewInfo;\n }\n\n _attachAnimatedStyles() {\n const styles = this.props.style\n ? onlyAnimatedStyles(flattenArray<StyleProps>(this.props.style))\n : [];\n const prevStyles = this._styles;\n this._styles = styles;\n\n const prevAnimatedProps = this._animatedProps;\n this._animatedProps = this.props.animatedProps;\n\n const { viewTag, viewName, shadowNodeWrapper, viewConfig } =\n this._getViewInfo();\n\n // update UI props whitelist for this view\n const hasReanimated2Props =\n this.props.animatedProps?.viewDescriptors || styles.length;\n if (hasReanimated2Props && viewConfig) {\n adaptViewConfig(viewConfig);\n }\n\n this._componentViewTag = viewTag as number;\n\n // remove old styles\n if (prevStyles) {\n // in most of the cases, views have only a single animated style and it remains unchanged\n const hasOneSameStyle =\n styles.length === 1 &&\n prevStyles.length === 1 &&\n styles[0] === prevStyles[0];\n\n if (!hasOneSameStyle) {\n // otherwise, remove each style that is not present in new styles\n for (const prevStyle of prevStyles) {\n const isPresent = styles.some((style) => style === prevStyle);\n if (!isPresent) {\n prevStyle.viewDescriptors.remove(viewTag);\n }\n }\n }\n }\n\n styles.forEach((style) => {\n style.viewDescriptors.add({\n tag: viewTag,\n name: viewName,\n shadowNodeWrapper,\n });\n if (isJest()) {\n /**\n * We need to connect Jest's TestObject instance whose contains just props object\n * with the updateProps() function where we update the properties of the component.\n * We can't update props object directly because TestObject contains a copy of props - look at render function:\n * const props = this._filterNonAnimatedProps(this.props);\n */\n this.jestAnimatedStyle.value = {\n ...this.jestAnimatedStyle.value,\n ...style.initial.value,\n };\n style.jestAnimatedStyle.current = this.jestAnimatedStyle;\n }\n });\n\n // detach old animatedProps\n if (prevAnimatedProps && prevAnimatedProps !== this.props.animatedProps) {\n prevAnimatedProps.viewDescriptors!.remove(viewTag as number);\n }\n\n // attach animatedProps property\n if (this.props.animatedProps?.viewDescriptors) {\n this.props.animatedProps.viewDescriptors.add({\n tag: viewTag as number,\n name: viewName!,\n shadowNodeWrapper: shadowNodeWrapper!,\n });\n }\n }\n\n componentDidUpdate(\n prevProps: AnimatedComponentProps<InitialComponentProps>,\n _prevState: Readonly<unknown>,\n // This type comes straight from React\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n snapshot: DOMRect | null\n ) {\n const layout = this.props.layout;\n const oldLayout = prevProps.layout;\n if (layout !== oldLayout) {\n this._configureLayoutTransition();\n }\n if (\n this.props.sharedTransitionTag !== undefined ||\n prevProps.sharedTransitionTag !== undefined\n ) {\n this._configureSharedTransition();\n }\n this._NativeEventsManager?.updateEvents(prevProps);\n this._attachAnimatedStyles();\n this._InlinePropManager.attachInlineProps(this, this._getViewInfo());\n\n if (IS_WEB && this.props.exiting) {\n saveSnapshot(this._component as HTMLElement);\n }\n\n // Snapshot won't be undefined because it comes from getSnapshotBeforeUpdate method\n if (\n IS_WEB &&\n snapshot !== null &&\n this.props.layout &&\n !getReducedMotionFromConfig(this.props.layout as CustomConfig)\n ) {\n tryActivateLayoutTransition(\n this.props,\n this._component as HTMLElement,\n snapshot\n );\n }\n }\n\n _configureLayoutTransition() {\n if (IS_WEB) {\n return;\n }\n\n const layout = this.props.layout\n ? maybeBuild(\n this.props.layout,\n undefined /* We don't have to warn user if style has common properties with animation for LAYOUT */,\n AnimatedComponent.displayName\n )\n : undefined;\n updateLayoutAnimations(\n this._componentViewTag,\n LayoutAnimationType.LAYOUT,\n layout\n );\n }\n\n _configureSharedTransition(isUnmounting = false) {\n if (IS_WEB) {\n return;\n }\n\n const { sharedTransitionTag } = this.props;\n if (!sharedTransitionTag) {\n this._sharedElementTransition?.unregisterTransition(\n this._componentViewTag,\n isUnmounting\n );\n this._sharedElementTransition = null;\n return;\n }\n const sharedElementTransition =\n this.props.sharedTransitionStyle ??\n this._sharedElementTransition ??\n new SharedTransition();\n sharedElementTransition.registerTransition(\n this._componentViewTag,\n sharedTransitionTag,\n isUnmounting\n );\n this._sharedElementTransition = sharedElementTransition;\n }\n\n _setComponentRef = setAndForwardRef<Component | HTMLElement>({\n getForwardedRef: () =>\n this.props.forwardedRef as MutableRefObject<\n Component<Record<string, unknown>, Record<string, unknown>, unknown>\n >,\n setLocalRef: (ref) => {\n // TODO update config\n\n const tag = IS_WEB\n ? (ref as HTMLElement)\n : findNodeHandle(ref as Component);\n\n this._componentViewTag = tag as number;\n\n const { layout, entering, exiting, sharedTransitionTag } = this.props;\n if (\n (layout || entering || exiting || sharedTransitionTag) &&\n tag != null\n ) {\n if (!shouldBeUseWeb()) {\n enableLayoutAnimations(true, false);\n }\n\n if (sharedTransitionTag) {\n this._configureSharedTransition();\n }\n if (exiting && isFabric()) {\n const reduceMotionInExiting =\n 'getReduceMotion' in exiting &&\n typeof exiting.getReduceMotion === 'function'\n ? getReduceMotionFromConfig(exiting.getReduceMotion())\n : getReduceMotionFromConfig();\n if (!reduceMotionInExiting) {\n updateLayoutAnimations(\n tag as number,\n LayoutAnimationType.EXITING,\n maybeBuild(\n exiting,\n this.props?.style,\n AnimatedComponent.displayName\n )\n );\n }\n }\n\n const skipEntering = this.context?.current;\n if (entering && !skipEntering && !IS_WEB) {\n updateLayoutAnimations(\n tag as number,\n LayoutAnimationType.ENTERING,\n maybeBuild(\n entering,\n this.props?.style,\n AnimatedComponent.displayName\n )\n );\n }\n }\n\n if (ref !== this._component) {\n this._component = ref;\n }\n },\n });\n\n // This is a component lifecycle method from React, therefore we are not calling it directly.\n // It is called before the component gets rerendered. This way we can access components' position before it changed\n // and later on, in componentDidUpdate, calculate translation for layout transition.\n getSnapshotBeforeUpdate() {\n if (\n IS_WEB &&\n (this._component as HTMLElement)?.getBoundingClientRect !== undefined\n ) {\n return (this._component as HTMLElement).getBoundingClientRect();\n }\n\n return null;\n }\n\n render() {\n const filteredProps = this._PropsFilter.filterNonAnimatedProps(this);\n\n if (isJest()) {\n filteredProps.jestAnimatedStyle = this.jestAnimatedStyle;\n }\n\n // Layout animations on web are set inside `componentDidMount` method, which is called after first render.\n // Because of that we can encounter a situation in which component is visible for a short amount of time, and later on animation triggers.\n // I've tested that on various browsers and devices and it did not happen to me. To be sure that it won't happen to someone else,\n // I've decided to hide component at first render. Its visibility is reset in `componentDidMount`.\n if (\n this._isFirstRender &&\n IS_WEB &&\n filteredProps.entering &&\n !getReducedMotionFromConfig(filteredProps.entering as CustomConfig)\n ) {\n filteredProps.style = {\n ...(filteredProps.style ?? {}),\n visibility: 'hidden', // Hide component until `componentDidMount` triggers\n };\n }\n\n const platformProps = Platform.select({\n web: {},\n default: { collapsable: false },\n });\n\n const skipEntering = this.context?.current;\n const nativeID =\n skipEntering || !isFabric() ? undefined : `${this.reanimatedID}`;\n\n return (\n <Component\n nativeID={nativeID}\n {...filteredProps}\n // Casting is used here, because ref can be null - in that case it cannot be assigned to HTMLElement.\n // After spending some time trying to figure out what to do with this problem, we decided to leave it this way\n ref={this._setComponentRef as (ref: Component) => void}\n {...platformProps}\n />\n );\n }\n }\n\n AnimatedComponent.displayName = `AnimatedComponent(${\n Component.displayName || Component.name || 'Component'\n })`;\n\n return React.forwardRef<Component>((props, ref) => {\n return (\n <AnimatedComponent\n {...props}\n {...(ref === null ? null : { forwardedRef: ref })}\n />\n );\n });\n}\n"],"mappings":"AAAA,YAAY;;AAAC,SAAAA,SAAA,IAAAA,QAAA,GAAAC,MAAA,CAAAC,MAAA,GAAAD,MAAA,CAAAC,MAAA,CAAAC,IAAA,eAAAC,MAAA,aAAAC,CAAA,MAAAA,CAAA,GAAAC,SAAA,CAAAC,MAAA,EAAAF,CAAA,UAAAG,MAAA,GAAAF,SAAA,CAAAD,CAAA,YAAAI,GAAA,IAAAD,MAAA,QAAAP,MAAA,CAAAS,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAJ,MAAA,EAAAC,GAAA,KAAAL,MAAA,CAAAK,GAAA,IAAAD,MAAA,CAAAC,GAAA,gBAAAL,MAAA,YAAAJ,QAAA,CAAAa,KAAA,OAAAP,SAAA;AAAA,SAAAQ,gBAAAC,GAAA,EAAAN,GAAA,EAAAO,KAAA,IAAAP,GAAA,GAAAQ,cAAA,CAAAR,GAAA,OAAAA,GAAA,IAAAM,GAAA,IAAAd,MAAA,CAAAiB,cAAA,CAAAH,GAAA,EAAAN,GAAA,IAAAO,KAAA,EAAAA,KAAA,EAAAG,UAAA,QAAAC,YAAA,QAAAC,QAAA,oBAAAN,GAAA,CAAAN,GAAA,IAAAO,KAAA,WAAAD,GAAA;AAAA,SAAAE,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Aa,CAACnH,KAAK,GAAG;UACpB,IAAImH,aAAa,CAACnH,KAAK,IAAI,CAAC,CAAC,CAAC;UAC9BsH,UAAU,EAAE,QAAQ,CAAE;QACxB,CAAC;MACH;MAEA,MAAMC,aAAa,GAAGzJ,QAAQ,CAAC0J,MAAM,CAAC;QACpCC,GAAG,EAAE,CAAC,CAAC;QACPC,OAAO,EAAE;UAAEC,WAAW,EAAE;QAAM;MAChC,CAAC,CAAC;MAEF,MAAM/F,YAAY,IAAAsF,cAAA,GAAG,IAAI,CAACrF,OAAO,cAAAqF,cAAA,uBAAZA,cAAA,CAAcpF,OAAO;MAC1C,MAAM8F,QAAQ,GACZhG,YAAY,IAAI,CAAC/C,QAAQ,CAAC,CAAC,GAAG6F,SAAS,GAAI,GAAE,IAAI,CAACtC,YAAa,EAAC;MAElE,oBACExE,KAAA,CAAAiK,aAAA,CAACzH,SAAS,EAAAvE,QAAA;QACR+L,QAAQ,EAAEA;MAAS,GACfT,aAAa;QACjB;QACA;QACArG,GAAG,EAAE,IAAI,CAACgH;MAA6C,GACnDP,aAAa,CAClB,CAAC;IAEN;EACF;EAAC5K,eAAA,CApeK6D,iBAAiB;EAAA7D,eAAA,CAAjB6D,iBAAiB,iBAiBA/B,mBAAmB;EAqd1C+B,iBAAiB,CAACmB,WAAW,GAAI,qBAC/BvB,SAAS,CAACuB,WAAW,IAAIvB,SAAS,CAACG,IAAI,IAAI,WAC5C,GAAE;EAEH,oBAAO3C,KAAK,CAACmK,UAAU,CAAY,CAACrH,KAAK,EAAEI,GAAG,KAAK;IACjD,oBACElD,KAAA,CAAAiK,aAAA,CAACrH,iBAAiB,EAAA3E,QAAA,KACZ6E,KAAK,EACJI,GAAG,KAAK,IAAI,GAAG,IAAI,GAAG;MAAEF,YAAY,EAAEE;IAAI,CAAC,CACjD,CAAC;EAEN,CAAC,CAAC;AACJ","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_extends","Object","assign","bind","target","i","arguments","length","source","key","prototype","hasOwnProperty","call","apply","_defineProperty","obj","value","_toPropertyKey","defineProperty","enumerable","configurable","writable","t","_toPrimitive","r","e","Symbol","toPrimitive","TypeError","String","Number","React","findNodeHandle","Platform","invariant","adaptViewConfig","RNRenderer","enableLayoutAnimations","SharedTransition","LayoutAnimationType","getShadowNodeWrapperFromRef","removeFromPropsRegistry","getReduceMotionFromConfig","maybeBuild","SkipEnteringContext","JSPropsUpdater","flattenArray","setAndForwardRef","isFabric","isJest","isWeb","shouldBeUseWeb","InlinePropManager","PropsFilter","startWebLayoutAnimation","tryActivateLayoutTransition","configureWebLayoutAnimations","getReducedMotionFromConfig","saveSnapshot","updateLayoutAnimations","addHTMLMutationObserver","getViewInfo","NativeEventsManager","IS_WEB","onlyAnimatedStyles","styles","filter","style","viewDescriptors","id","createAnimatedComponent","Component","options","isReactComponent","name","AnimatedComponent","constructor","props","getForwardedRef","forwardedRef","setLocalRef","ref","tag","_componentViewTag","layout","entering","exiting","sharedTransitionTag","_this$context","_configureSharedTransition","reduceMotionInExiting","getReduceMotion","_this$props","EXITING","displayName","skipEntering","context","current","_this$props2","ENTERING","_component","jestAnimatedStyle","_this$props3","reanimatedID","componentDidMount","_this$_NativeEventsMa","_getComponentViewTag","_NativeEventsManager","attachEvents","_jsPropsUpdater","addOnJSPropsChangeListener","_attachAnimatedStyles","_InlinePropManager","attachInlineProps","_getViewInfo","_configureLayoutTransition","_isFirstRender","componentWillUnmount","_this$_NativeEventsMa2","_this$_sharedElementT","detachEvents","removeOnJSPropsChangeListener","_detachStyles","detachInlineProps","_sharedElementTransition","unregisterTransition","_this$props4","viewTag","_styles","_this$props$animatedP","remove","animatedProps","_updateFromNative","setNativeProps","_this$_component","_this$_component$setN","_this$_component2","_getAnimatableRef","_ref","_viewInfo","undefined","viewName","shadowNodeWrapper","viewConfig","component","getAnimatableRef","hostInstance","findHostInstance_DEPRECATED","Error","viewInfo","_this$props$animatedP2","_this$props$animatedP3","prevStyles","prevAnimatedProps","_animatedProps","hasReanimated2Props","hasOneSameStyle","prevStyle","isPresent","some","forEach","add","initial","componentDidUpdate","prevProps","_prevState","snapshot","_this$_NativeEventsMa3","oldLayout","updateEvents","LAYOUT","isUnmounting","_this$_sharedElementT2","sharedElementTransition","sharedTransitionStyle","registerTransition","getSnapshotBeforeUpdate","_this$_component3","getBoundingClientRect","render","_this$context2","filteredProps","_PropsFilter","filterNonAnimatedProps","visibility","platformProps","select","web","default","collapsable","nativeID","createElement","_setComponentRef","forwardRef"],"sources":["createAnimatedComponent.tsx"],"sourcesContent":["'use strict';\nimport type {\n Component,\n ComponentClass,\n ComponentType,\n FunctionComponent,\n MutableRefObject,\n} from 'react';\nimport React from 'react';\nimport { findNodeHandle, Platform } from 'react-native';\nimport '../layoutReanimation/animationsManager';\nimport invariant from 'invariant';\nimport { adaptViewConfig } from '../ConfigHelper';\nimport { RNRenderer } from '../platform-specific/RNRenderer';\nimport { enableLayoutAnimations } from '../core';\nimport { SharedTransition, LayoutAnimationType } from '../layoutReanimation';\nimport type { StyleProps, ShadowNodeWrapper } from '../commonTypes';\nimport { getShadowNodeWrapperFromRef } from '../fabricUtils';\nimport { removeFromPropsRegistry } from '../PropsRegistry';\nimport { getReduceMotionFromConfig } from '../animation/util';\nimport { maybeBuild } from '../animationBuilder';\nimport { SkipEnteringContext } from '../component/LayoutAnimationConfig';\nimport type { AnimateProps } from '../helperTypes';\nimport JSPropsUpdater from './JSPropsUpdater';\nimport type {\n AnimatedComponentProps,\n AnimatedProps,\n InitialComponentProps,\n AnimatedComponentRef,\n IAnimatedComponentInternal,\n ViewInfo,\n INativeEventsManager,\n} from './commonTypes';\nimport { flattenArray } from './utils';\nimport setAndForwardRef from './setAndForwardRef';\nimport { isFabric, isJest, isWeb, shouldBeUseWeb } from '../PlatformChecker';\nimport { InlinePropManager } from './InlinePropManager';\nimport { PropsFilter } from './PropsFilter';\nimport {\n startWebLayoutAnimation,\n tryActivateLayoutTransition,\n configureWebLayoutAnimations,\n getReducedMotionFromConfig,\n saveSnapshot,\n} from '../layoutReanimation/web';\nimport { updateLayoutAnimations } from '../UpdateLayoutAnimations';\nimport type { CustomConfig } from '../layoutReanimation/web/config';\nimport type { FlatList, FlatListProps } from 'react-native';\nimport { addHTMLMutationObserver } from '../layoutReanimation/web/domUtils';\nimport { getViewInfo } from './getViewInfo';\nimport { NativeEventsManager } from './NativeEventsManager';\n\nconst IS_WEB = isWeb();\n\nif (IS_WEB) {\n configureWebLayoutAnimations();\n}\n\nfunction onlyAnimatedStyles(styles: StyleProps[]): StyleProps[] {\n return styles.filter((style) => style?.viewDescriptors);\n}\n\ntype Options<P> = {\n setNativeProps: (ref: AnimatedComponentRef, props: P) => void;\n};\n\n/**\n * Lets you create an Animated version of any React Native component.\n *\n * @param component - The component you want to make animatable.\n * @returns A component that Reanimated is capable of animating.\n * @see https://docs.swmansion.com/react-native-reanimated/docs/core/createAnimatedComponent\n */\n\n// Don't change the order of overloads, since such a change breaks current behavior\nexport function createAnimatedComponent<P extends object>(\n component: FunctionComponent<P>,\n options?: Options<P>\n): FunctionComponent<AnimateProps<P>>;\n\nexport function createAnimatedComponent<P extends object>(\n component: ComponentClass<P>,\n options?: Options<P>\n): ComponentClass<AnimateProps<P>>;\n\nexport function createAnimatedComponent<P extends object>(\n // Actually ComponentType<P = {}> = ComponentClass<P> | FunctionComponent<P> but we need this overload too\n // since some external components (like FastImage) are typed just as ComponentType\n component: ComponentType<P>,\n options?: Options<P>\n): FunctionComponent<AnimateProps<P>> | ComponentClass<AnimateProps<P>>;\n\n/**\n * @deprecated Please use `Animated.FlatList` component instead of calling `Animated.createAnimatedComponent(FlatList)` manually.\n */\n// @ts-ignore This is required to create this overload, since type of createAnimatedComponent is incorrect and doesn't include typeof FlatList\nexport function createAnimatedComponent(\n component: typeof FlatList<unknown>,\n options?: Options<any>\n): ComponentClass<AnimateProps<FlatListProps<unknown>>>;\n\nlet id = 0;\n\nexport function createAnimatedComponent(\n Component: ComponentType<InitialComponentProps>,\n options?: Options<InitialComponentProps>\n): any {\n invariant(\n typeof Component !== 'function' ||\n (Component.prototype && Component.prototype.isReactComponent),\n `Looks like you're passing a function component \\`${Component.name}\\` to \\`createAnimatedComponent\\` function which supports only class components. Please wrap your function component with \\`React.forwardRef()\\` or use a class component instead.`\n );\n\n class AnimatedComponent\n extends React.Component<AnimatedComponentProps<InitialComponentProps>>\n implements IAnimatedComponentInternal\n {\n _styles: StyleProps[] | null = null;\n _animatedProps?: Partial<AnimatedComponentProps<AnimatedProps>>;\n _componentViewTag = -1;\n _isFirstRender = true;\n jestAnimatedStyle: { value: StyleProps } = { value: {} };\n _component: AnimatedComponentRef | HTMLElement | null = null;\n _sharedElementTransition: SharedTransition | null = null;\n _jsPropsUpdater = new JSPropsUpdater();\n _InlinePropManager = new InlinePropManager();\n _PropsFilter = new PropsFilter();\n _NativeEventsManager?: INativeEventsManager;\n _viewInfo?: ViewInfo;\n static displayName: string;\n static contextType = SkipEnteringContext;\n context!: React.ContextType<typeof SkipEnteringContext>;\n reanimatedID = id++;\n\n constructor(props: AnimatedComponentProps<InitialComponentProps>) {\n super(props);\n if (isJest()) {\n this.jestAnimatedStyle = { value: {} };\n }\n const entering = this.props.entering;\n if (entering && isFabric()) {\n updateLayoutAnimations(\n this.reanimatedID,\n LayoutAnimationType.ENTERING,\n maybeBuild(entering, this.props?.style, AnimatedComponent.displayName)\n );\n }\n }\n\n componentDidMount() {\n this._componentViewTag = this._getComponentViewTag();\n if (!IS_WEB) {\n // It exists only on native platforms. We initialize it here because the ref to the animated component is available only post-mount\n this._NativeEventsManager = new NativeEventsManager(this, options);\n }\n this._NativeEventsManager?.attachEvents();\n this._jsPropsUpdater.addOnJSPropsChangeListener(this);\n this._attachAnimatedStyles();\n this._InlinePropManager.attachInlineProps(this, this._getViewInfo());\n\n const layout = this.props.layout;\n if (layout) {\n this._configureLayoutTransition();\n }\n\n if (IS_WEB) {\n if (this.props.exiting) {\n saveSnapshot(this._component as HTMLElement);\n }\n\n if (\n !this.props.entering ||\n getReducedMotionFromConfig(this.props.entering as CustomConfig)\n ) {\n this._isFirstRender = false;\n return;\n }\n\n startWebLayoutAnimation(\n this.props,\n this._component as HTMLElement,\n LayoutAnimationType.ENTERING\n );\n }\n\n this._isFirstRender = false;\n }\n\n componentWillUnmount() {\n this._NativeEventsManager?.detachEvents();\n this._jsPropsUpdater.removeOnJSPropsChangeListener(this);\n this._detachStyles();\n this._InlinePropManager.detachInlineProps();\n if (this.props.sharedTransitionTag) {\n this._configureSharedTransition(true);\n }\n this._sharedElementTransition?.unregisterTransition(\n this._componentViewTag,\n true\n );\n\n const exiting = this.props.exiting;\n\n if (\n IS_WEB &&\n this._component &&\n exiting &&\n !getReducedMotionFromConfig(exiting as CustomConfig)\n ) {\n addHTMLMutationObserver();\n\n startWebLayoutAnimation(\n this.props,\n this._component as HTMLElement,\n LayoutAnimationType.EXITING\n );\n } else if (exiting && !IS_WEB && !isFabric()) {\n const reduceMotionInExiting =\n 'getReduceMotion' in exiting &&\n typeof exiting.getReduceMotion === 'function'\n ? getReduceMotionFromConfig(exiting.getReduceMotion())\n : getReduceMotionFromConfig();\n if (!reduceMotionInExiting) {\n updateLayoutAnimations(\n this._componentViewTag,\n LayoutAnimationType.EXITING,\n maybeBuild(\n exiting,\n this.props?.style,\n AnimatedComponent.displayName\n )\n );\n }\n }\n }\n\n _getComponentViewTag() {\n return this._getViewInfo().viewTag as number;\n }\n\n _detachStyles() {\n if (this._componentViewTag !== -1 && this._styles !== null) {\n for (const style of this._styles) {\n style.viewDescriptors.remove(this._componentViewTag);\n }\n if (this.props.animatedProps?.viewDescriptors) {\n this.props.animatedProps.viewDescriptors.remove(\n this._componentViewTag\n );\n }\n if (isFabric()) {\n removeFromPropsRegistry(this._componentViewTag);\n }\n }\n }\n\n _updateFromNative(props: StyleProps) {\n if (options?.setNativeProps) {\n options.setNativeProps(this._component as AnimatedComponentRef, props);\n } else {\n (this._component as AnimatedComponentRef)?.setNativeProps?.(props);\n }\n }\n\n _getViewInfo(): ViewInfo {\n if (this._viewInfo !== undefined) {\n return this._viewInfo;\n }\n\n let viewTag: number | HTMLElement | null;\n let viewName: string | null;\n let shadowNodeWrapper: ShadowNodeWrapper | null = null;\n let viewConfig;\n // Component can specify ref which should be animated when animated version of the component is created.\n // Otherwise, we animate the component itself.\n const component = (this._component as AnimatedComponentRef)\n ?.getAnimatableRef\n ? (this._component as AnimatedComponentRef).getAnimatableRef?.()\n : this;\n\n if (IS_WEB) {\n // At this point I assume that `_setComponentRef` was already called and `_component` is set.\n // `this._component` on web represents HTMLElement of our component, that's why we use casting\n viewTag = this._component as HTMLElement;\n viewName = null;\n shadowNodeWrapper = null;\n viewConfig = null;\n } else {\n // hostInstance can be null for a component that doesn't render anything (render function returns null). Example: svg Stop: https://github.com/react-native-svg/react-native-svg/blob/develop/src/elements/Stop.tsx\n const hostInstance = RNRenderer.findHostInstance_DEPRECATED(component);\n if (!hostInstance) {\n throw new Error(\n '[Reanimated] Cannot find host instance for this component. Maybe it renders nothing?'\n );\n }\n\n const viewInfo = getViewInfo(hostInstance);\n viewTag = viewInfo.viewTag;\n viewName = viewInfo.viewName;\n viewConfig = viewInfo.viewConfig;\n shadowNodeWrapper = isFabric()\n ? getShadowNodeWrapperFromRef(this)\n : null;\n }\n this._viewInfo = { viewTag, viewName, shadowNodeWrapper, viewConfig };\n return this._viewInfo;\n }\n\n _attachAnimatedStyles() {\n const styles = this.props.style\n ? onlyAnimatedStyles(flattenArray<StyleProps>(this.props.style))\n : [];\n const prevStyles = this._styles;\n this._styles = styles;\n\n const prevAnimatedProps = this._animatedProps;\n this._animatedProps = this.props.animatedProps;\n\n const { viewTag, viewName, shadowNodeWrapper, viewConfig } =\n this._getViewInfo();\n\n // update UI props whitelist for this view\n const hasReanimated2Props =\n this.props.animatedProps?.viewDescriptors || styles.length;\n if (hasReanimated2Props && viewConfig) {\n adaptViewConfig(viewConfig);\n }\n\n this._componentViewTag = viewTag as number;\n\n // remove old styles\n if (prevStyles) {\n // in most of the cases, views have only a single animated style and it remains unchanged\n const hasOneSameStyle =\n styles.length === 1 &&\n prevStyles.length === 1 &&\n styles[0] === prevStyles[0];\n\n if (!hasOneSameStyle) {\n // otherwise, remove each style that is not present in new styles\n for (const prevStyle of prevStyles) {\n const isPresent = styles.some((style) => style === prevStyle);\n if (!isPresent) {\n prevStyle.viewDescriptors.remove(viewTag);\n }\n }\n }\n }\n\n styles.forEach((style) => {\n style.viewDescriptors.add({\n tag: viewTag,\n name: viewName,\n shadowNodeWrapper,\n });\n if (isJest()) {\n /**\n * We need to connect Jest's TestObject instance whose contains just props object\n * with the updateProps() function where we update the properties of the component.\n * We can't update props object directly because TestObject contains a copy of props - look at render function:\n * const props = this._filterNonAnimatedProps(this.props);\n */\n this.jestAnimatedStyle.value = {\n ...this.jestAnimatedStyle.value,\n ...style.initial.value,\n };\n style.jestAnimatedStyle.current = this.jestAnimatedStyle;\n }\n });\n\n // detach old animatedProps\n if (prevAnimatedProps && prevAnimatedProps !== this.props.animatedProps) {\n prevAnimatedProps.viewDescriptors!.remove(viewTag as number);\n }\n\n // attach animatedProps property\n if (this.props.animatedProps?.viewDescriptors) {\n this.props.animatedProps.viewDescriptors.add({\n tag: viewTag as number,\n name: viewName!,\n shadowNodeWrapper: shadowNodeWrapper!,\n });\n }\n }\n\n componentDidUpdate(\n prevProps: AnimatedComponentProps<InitialComponentProps>,\n _prevState: Readonly<unknown>,\n // This type comes straight from React\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n snapshot: DOMRect | null\n ) {\n const layout = this.props.layout;\n const oldLayout = prevProps.layout;\n if (layout !== oldLayout) {\n this._configureLayoutTransition();\n }\n if (\n this.props.sharedTransitionTag !== undefined ||\n prevProps.sharedTransitionTag !== undefined\n ) {\n this._configureSharedTransition();\n }\n this._NativeEventsManager?.updateEvents(prevProps);\n this._attachAnimatedStyles();\n this._InlinePropManager.attachInlineProps(this, this._getViewInfo());\n\n if (IS_WEB && this.props.exiting) {\n saveSnapshot(this._component as HTMLElement);\n }\n\n // Snapshot won't be undefined because it comes from getSnapshotBeforeUpdate method\n if (\n IS_WEB &&\n snapshot !== null &&\n this.props.layout &&\n !getReducedMotionFromConfig(this.props.layout as CustomConfig)\n ) {\n tryActivateLayoutTransition(\n this.props,\n this._component as HTMLElement,\n snapshot\n );\n }\n }\n\n _configureLayoutTransition() {\n if (IS_WEB) {\n return;\n }\n\n const layout = this.props.layout\n ? maybeBuild(\n this.props.layout,\n undefined /* We don't have to warn user if style has common properties with animation for LAYOUT */,\n AnimatedComponent.displayName\n )\n : undefined;\n updateLayoutAnimations(\n this._componentViewTag,\n LayoutAnimationType.LAYOUT,\n layout\n );\n }\n\n _configureSharedTransition(isUnmounting = false) {\n if (IS_WEB) {\n return;\n }\n\n const { sharedTransitionTag } = this.props;\n if (!sharedTransitionTag) {\n this._sharedElementTransition?.unregisterTransition(\n this._componentViewTag,\n isUnmounting\n );\n this._sharedElementTransition = null;\n return;\n }\n const sharedElementTransition =\n this.props.sharedTransitionStyle ??\n this._sharedElementTransition ??\n new SharedTransition();\n sharedElementTransition.registerTransition(\n this._componentViewTag,\n sharedTransitionTag,\n isUnmounting\n );\n this._sharedElementTransition = sharedElementTransition;\n }\n\n _setComponentRef = setAndForwardRef<Component | HTMLElement>({\n getForwardedRef: () =>\n this.props.forwardedRef as MutableRefObject<\n Component<Record<string, unknown>, Record<string, unknown>, unknown>\n >,\n setLocalRef: (ref) => {\n // TODO update config\n\n const tag = IS_WEB\n ? (ref as HTMLElement)\n : findNodeHandle(ref as Component);\n\n this._componentViewTag = tag as number;\n\n const { layout, entering, exiting, sharedTransitionTag } = this.props;\n if (\n (layout || entering || exiting || sharedTransitionTag) &&\n tag != null\n ) {\n if (!shouldBeUseWeb()) {\n enableLayoutAnimations(true, false);\n }\n\n if (sharedTransitionTag) {\n this._configureSharedTransition();\n }\n if (exiting && isFabric()) {\n const reduceMotionInExiting =\n 'getReduceMotion' in exiting &&\n typeof exiting.getReduceMotion === 'function'\n ? getReduceMotionFromConfig(exiting.getReduceMotion())\n : getReduceMotionFromConfig();\n if (!reduceMotionInExiting) {\n updateLayoutAnimations(\n tag as number,\n LayoutAnimationType.EXITING,\n maybeBuild(\n exiting,\n this.props?.style,\n AnimatedComponent.displayName\n )\n );\n }\n }\n\n const skipEntering = this.context?.current;\n if (entering && !skipEntering && !IS_WEB) {\n updateLayoutAnimations(\n tag as number,\n LayoutAnimationType.ENTERING,\n maybeBuild(\n entering,\n this.props?.style,\n AnimatedComponent.displayName\n )\n );\n }\n }\n\n if (ref !== this._component) {\n this._component = ref;\n }\n },\n });\n\n // This is a component lifecycle method from React, therefore we are not calling it directly.\n // It is called before the component gets rerendered. This way we can access components' position before it changed\n // and later on, in componentDidUpdate, calculate translation for layout transition.\n getSnapshotBeforeUpdate() {\n if (\n IS_WEB &&\n (this._component as HTMLElement)?.getBoundingClientRect !== undefined\n ) {\n return (this._component as HTMLElement).getBoundingClientRect();\n }\n\n return null;\n }\n\n render() {\n const filteredProps = this._PropsFilter.filterNonAnimatedProps(this);\n\n if (isJest()) {\n filteredProps.jestAnimatedStyle = this.jestAnimatedStyle;\n }\n\n // Layout animations on web are set inside `componentDidMount` method, which is called after first render.\n // Because of that we can encounter a situation in which component is visible for a short amount of time, and later on animation triggers.\n // I've tested that on various browsers and devices and it did not happen to me. To be sure that it won't happen to someone else,\n // I've decided to hide component at first render. Its visibility is reset in `componentDidMount`.\n if (\n this._isFirstRender &&\n IS_WEB &&\n filteredProps.entering &&\n !getReducedMotionFromConfig(filteredProps.entering as CustomConfig)\n ) {\n filteredProps.style = {\n ...(filteredProps.style ?? {}),\n visibility: 'hidden', // Hide component until `componentDidMount` triggers\n };\n }\n\n const platformProps = Platform.select({\n web: {},\n default: { collapsable: false },\n });\n\n const skipEntering = this.context?.current;\n const nativeID =\n skipEntering || !isFabric() ? undefined : `${this.reanimatedID}`;\n\n return (\n <Component\n nativeID={nativeID}\n {...filteredProps}\n // Casting is used here, because ref can be null - in that case it cannot be assigned to HTMLElement.\n // After spending some time trying to figure out what to do with this problem, we decided to leave it this way\n ref={this._setComponentRef as (ref: Component) => void}\n {...platformProps}\n />\n );\n }\n }\n\n AnimatedComponent.displayName = `AnimatedComponent(${\n Component.displayName || Component.name || 'Component'\n })`;\n\n return React.forwardRef<Component>((props, ref) => {\n return (\n <AnimatedComponent\n {...props}\n {...(ref === null ? null : { forwardedRef: ref })}\n />\n );\n });\n}\n"],"mappings":"AAAA,YAAY;;AAAC,SAAAA,SAAA,IAAAA,QAAA,GAAAC,MAAA,CAAAC,MAAA,GAAAD,MAAA,CAAAC,MAAA,CAAAC,IAAA,eAAAC,MAAA,aAAAC,CAAA,MAAAA,CAAA,GAAAC,SAAA,CAAAC,MAAA,EAAAF,CAAA,UAAAG,MAAA,GAAAF,SAAA,CAAAD,CAAA,YAAAI,GAAA,IAAAD,MAAA,QAAAP,MAAA,CAAAS,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAJ,MAAA,EAAAC,GAAA,KAAAL,MAAA,CAAAK,GAAA,IAAAD,MAAA,CAAAC,GAAA,gBAAAL,MAAA,YAAAJ,QAAA,CAAAa,KAAA,OAAAP,SAAA;AAAA,SAAAQ,gBAAAC,GAAA,EAAAN,GAAA,EAAAO,KAAA,IAAAP,GAAA,GAAAQ,cAAA,CAAAR,GAAA,OAAAA,GAAA,IAAAM,GAAA,IAAAd,MAAA,CAAAiB,cAAA,CAAAH,GAAA,EAAAN,GAAA,IAAAO,KAAA,EAAAA,KAAA,EAAAG,UAAA,QAAAC,YAAA,QAAAC,QAAA,oBAAAN,GAAA,CAAAN,GAAA,IAAAO,KAAA,WAAAD,GAAA;AAAA,SAAAE,eAAAK,CAAA,QAAAjB,CAAA,GAAAkB,YAAA,CAAAD,CAAA,uCAAAjB,CAAA,GAAAA,CAAA,GAAAA,CAAA;AAAA,SAAAkB,aAAAD,CAAA,EAAAE,CAAA,2BAAAF,CAAA,KAAAA,CAAA,SAAAA,CAAA,MAAAG,CAAA,GAAAH,CAAA,CAAAI,MAAA,CAAAC,WAAA,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,IAAI,CAAC/C,QAAQ,CAAC,CAAC,GAAG4F,SAAS,GAAI,GAAE,IAAI,CAACrC,YAAa,EAAC;MAElE,oBACExE,KAAA,CAAAgK,aAAA,CAACxH,SAAS,EAAAvE,QAAA;QACR8L,QAAQ,EAAEA;MAAS,GACfT,aAAa;QACjB;QACA;QACApG,GAAG,EAAE,IAAI,CAAC+G;MAA6C,GACnDP,aAAa,CAClB,CAAC;IAEN;EACF;EAAC3K,eAAA,CAheK6D,iBAAiB;EAAA7D,eAAA,CAAjB6D,iBAAiB,iBAiBA/B,mBAAmB;EAid1C+B,iBAAiB,CAACmB,WAAW,GAAI,qBAC/BvB,SAAS,CAACuB,WAAW,IAAIvB,SAAS,CAACG,IAAI,IAAI,WAC5C,GAAE;EAEH,oBAAO3C,KAAK,CAACkK,UAAU,CAAY,CAACpH,KAAK,EAAEI,GAAG,KAAK;IACjD,oBACElD,KAAA,CAAAgK,aAAA,CAACpH,iBAAiB,EAAA3E,QAAA,KACZ6E,KAAK,EACJI,GAAG,KAAK,IAAI,GAAG,IAAI,GAAG;MAAEF,YAAY,EAAEE;IAAI,CAAC,CACjD,CAAC;EAEN,CAAC,CAAC;AACJ","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["commonTypes.ts"],"sourcesContent":["'use strict';\nimport type { Component, MutableRefObject } from 'react';\nimport type {\n AnimatedPropsAdapterFunction,\n ShadowNodeWrapper,\n SharedValue,\n WorkletFunction,\n} from '../commonTypes';\nimport type {\n ImageStyle,\n NativeSyntheticEvent,\n TextStyle,\n ViewStyle,\n NativeScrollEvent,\n} from 'react-native';\nimport type { ViewDescriptorsSet
|
|
1
|
+
{"version":3,"names":[],"sources":["commonTypes.ts"],"sourcesContent":["'use strict';\nimport type { Component, MutableRefObject } from 'react';\nimport type {\n AnimatedPropsAdapterFunction,\n ShadowNodeWrapper,\n SharedValue,\n WorkletFunction,\n} from '../commonTypes';\nimport type {\n ImageStyle,\n NativeSyntheticEvent,\n TextStyle,\n ViewStyle,\n NativeScrollEvent,\n} from 'react-native';\nimport type { ViewDescriptorsSet } from '../ViewDescriptorsSet';\nimport type { AnimatedStyle } from '../helperTypes';\nimport type { ReanimatedHTMLElement } from '../js-reanimated';\n\nexport type DependencyList = Array<unknown> | undefined;\n\nexport interface Descriptor {\n tag: number | ReanimatedHTMLElement;\n name: string;\n shadowNodeWrapper: ShadowNodeWrapper;\n}\n\nexport interface AnimatedRef<T extends Component> {\n (component?: T):\n | number // Paper\n | ShadowNodeWrapper // Fabric\n | HTMLElement; // web\n current: T | null;\n getTag: () => number;\n}\n\n// Might make that type generic if it's ever needed.\nexport type AnimatedRefOnJS = AnimatedRef<Component>;\n\n/**\n * `AnimatedRef` is mapped to this type on the UI thread via a shareable handle.\n */\nexport type AnimatedRefOnUI = {\n (): number | ShadowNodeWrapper | null;\n /**\n * @remarks `viewName` is required only on iOS with Paper and it's value is null on other platforms.\n */\n viewName: SharedValue<string | null>;\n};\n\ntype ReanimatedPayload = {\n eventName: string;\n};\n\n/**\n * This utility type is to convert type of events that would normally be\n * sent by React Native (they have `nativeEvent` field) to the type\n * that is sent by Reanimated.\n */\nexport type ReanimatedEvent<Event extends object> = ReanimatedPayload &\n (Event extends {\n nativeEvent: infer NativeEvent extends object;\n }\n ? NativeEvent\n : Event);\n\nexport type EventPayload<Event extends object> = Event extends {\n nativeEvent: infer NativeEvent extends object;\n}\n ? NativeEvent\n : Omit<Event, 'eventName'>;\n\nexport type NativeEventWrapper<Event extends object> = {\n nativeEvent: Event;\n};\n\nexport type DefaultStyle = ViewStyle | ImageStyle | TextStyle;\n\nexport type RNNativeScrollEvent = NativeSyntheticEvent<NativeScrollEvent>;\n\nexport type ReanimatedScrollEvent = ReanimatedEvent<RNNativeScrollEvent>;\n\nexport interface IWorkletEventHandler<Event extends object> {\n updateEventHandler: (\n newWorklet: (event: ReanimatedEvent<Event>) => void,\n newEvents: string[]\n ) => void;\n registerForEvents: (viewTag: number, fallbackEventName?: string) => void;\n unregisterFromEvents: (viewTag: number) => void;\n}\n\nexport interface AnimatedStyleHandle<\n Style extends DefaultStyle = DefaultStyle\n> {\n viewDescriptors: ViewDescriptorsSet;\n initial: {\n value: AnimatedStyle<Style>;\n updater: () => AnimatedStyle<Style>;\n };\n}\n\nexport interface JestAnimatedStyleHandle<\n Style extends DefaultStyle = DefaultStyle\n> extends AnimatedStyleHandle<Style> {\n jestAnimatedStyle: MutableRefObject<AnimatedStyle<Style>>;\n}\n\nexport type UseAnimatedStyleInternal<Style extends DefaultStyle> = (\n updater: WorkletFunction<[], Style> | (() => Style),\n dependencies?: DependencyList | null,\n adapters?:\n | AnimatedPropsAdapterFunction\n | AnimatedPropsAdapterFunction[]\n | null,\n isAnimatedProps?: boolean\n) => AnimatedStyleHandle<Style> | JestAnimatedStyleHandle<Style>;\n"],"mappings":"AAAA,YAAY;;AAAC","ignoreList":[]}
|
|
@@ -6,7 +6,7 @@ import updateProps, { updatePropsJestWrapper } from '../UpdateProps';
|
|
|
6
6
|
import { initialUpdaterRun } from '../animation';
|
|
7
7
|
import { useSharedValue } from './useSharedValue';
|
|
8
8
|
import { buildWorkletsHash, isAnimated, shallowEqual, validateAnimatedStyles } from './utils';
|
|
9
|
-
import { makeViewDescriptorsSet
|
|
9
|
+
import { makeViewDescriptorsSet } from '../ViewDescriptorsSet';
|
|
10
10
|
import { isJest, shouldBeUseWeb } from '../PlatformChecker';
|
|
11
11
|
import { isWorkletFunction } from '../commonTypes';
|
|
12
12
|
const SHOULD_BE_USE_WEB = shouldBeUseWeb();
|
|
@@ -96,7 +96,7 @@ function runAnimations(animation, timestamp, key, result, animationsActive) {
|
|
|
96
96
|
return true;
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
|
-
function styleUpdater(viewDescriptors, updater, state,
|
|
99
|
+
function styleUpdater(viewDescriptors, updater, state, animationsActive, isAnimatedProps = false) {
|
|
100
100
|
'worklet';
|
|
101
101
|
|
|
102
102
|
const animations = state.animations ?? {};
|
|
@@ -143,7 +143,7 @@ function styleUpdater(viewDescriptors, updater, state, maybeViewRef, animationsA
|
|
|
143
143
|
}
|
|
144
144
|
}
|
|
145
145
|
if (updates) {
|
|
146
|
-
updateProps(viewDescriptors, updates
|
|
146
|
+
updateProps(viewDescriptors, updates);
|
|
147
147
|
}
|
|
148
148
|
if (!allFinished) {
|
|
149
149
|
requestAnimationFrame(frame);
|
|
@@ -158,18 +158,18 @@ function styleUpdater(viewDescriptors, updater, state, maybeViewRef, animationsA
|
|
|
158
158
|
frame(frameTimestamp);
|
|
159
159
|
}
|
|
160
160
|
if (hasNonAnimatedValues) {
|
|
161
|
-
updateProps(viewDescriptors, nonAnimatedNewValues
|
|
161
|
+
updateProps(viewDescriptors, nonAnimatedNewValues);
|
|
162
162
|
}
|
|
163
163
|
} else {
|
|
164
164
|
state.isAnimationCancelled = true;
|
|
165
165
|
state.animations = [];
|
|
166
166
|
if (!shallowEqual(oldValues, newValues)) {
|
|
167
|
-
updateProps(viewDescriptors, newValues,
|
|
167
|
+
updateProps(viewDescriptors, newValues, isAnimatedProps);
|
|
168
168
|
}
|
|
169
169
|
}
|
|
170
170
|
state.last = newValues;
|
|
171
171
|
}
|
|
172
|
-
function jestStyleUpdater(viewDescriptors, updater, state,
|
|
172
|
+
function jestStyleUpdater(viewDescriptors, updater, state, animationsActive, animatedStyle, adapters) {
|
|
173
173
|
'worklet';
|
|
174
174
|
|
|
175
175
|
const animations = state.animations ?? {};
|
|
@@ -217,7 +217,7 @@ function jestStyleUpdater(viewDescriptors, updater, state, maybeViewRef, animati
|
|
|
217
217
|
}
|
|
218
218
|
});
|
|
219
219
|
if (Object.keys(updates).length) {
|
|
220
|
-
updatePropsJestWrapper(viewDescriptors, updates,
|
|
220
|
+
updatePropsJestWrapper(viewDescriptors, updates, animatedStyle, adapters);
|
|
221
221
|
}
|
|
222
222
|
if (!allFinished) {
|
|
223
223
|
requestAnimationFrame(frame);
|
|
@@ -240,7 +240,7 @@ function jestStyleUpdater(viewDescriptors, updater, state, maybeViewRef, animati
|
|
|
240
240
|
// calculate diff
|
|
241
241
|
state.last = newValues;
|
|
242
242
|
if (!shallowEqual(oldValues, newValues)) {
|
|
243
|
-
updatePropsJestWrapper(viewDescriptors, newValues,
|
|
243
|
+
updatePropsJestWrapper(viewDescriptors, newValues, animatedStyle, adapters);
|
|
244
244
|
}
|
|
245
245
|
}
|
|
246
246
|
|
|
@@ -274,7 +274,6 @@ function checkSharedValueUsage(prop, currentKey) {
|
|
|
274
274
|
// @ts-expect-error This overload is required by our API.
|
|
275
275
|
|
|
276
276
|
export function useAnimatedStyle(updater, dependencies, adapters, isAnimatedProps = false) {
|
|
277
|
-
const viewsRef = useViewRefSet();
|
|
278
277
|
const animatedUpdaterData = useRef();
|
|
279
278
|
let inputs = Object.values(updater.__closure ?? {});
|
|
280
279
|
if (SHOULD_BE_USE_WEB) {
|
|
@@ -344,13 +343,13 @@ For more, see the docs: \`https://docs.swmansion.com/react-native-reanimated/doc
|
|
|
344
343
|
fun = () => {
|
|
345
344
|
'worklet';
|
|
346
345
|
|
|
347
|
-
jestStyleUpdater(shareableViewDescriptors, updater, remoteState,
|
|
346
|
+
jestStyleUpdater(shareableViewDescriptors, updater, remoteState, areAnimationsActive, jestAnimatedStyle, adaptersArray);
|
|
348
347
|
};
|
|
349
348
|
} else {
|
|
350
349
|
fun = () => {
|
|
351
350
|
'worklet';
|
|
352
351
|
|
|
353
|
-
styleUpdater(shareableViewDescriptors, updaterFn, remoteState,
|
|
352
|
+
styleUpdater(shareableViewDescriptors, updaterFn, remoteState, areAnimationsActive, isAnimatedProps);
|
|
354
353
|
};
|
|
355
354
|
}
|
|
356
355
|
const mapperId = startMapper(fun, inputs);
|
|
@@ -371,12 +370,10 @@ For more, see the docs: \`https://docs.swmansion.com/react-native-reanimated/doc
|
|
|
371
370
|
animatedStyleHandle.current = isJest() ? {
|
|
372
371
|
viewDescriptors,
|
|
373
372
|
initial,
|
|
374
|
-
viewsRef,
|
|
375
373
|
jestAnimatedStyle
|
|
376
374
|
} : {
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
viewDescriptors
|
|
375
|
+
viewDescriptors,
|
|
376
|
+
initial
|
|
380
377
|
};
|
|
381
378
|
}
|
|
382
379
|
return animatedStyleHandle.current;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useEffect","useRef","makeShareable","startMapper","stopMapper","updateProps","updatePropsJestWrapper","initialUpdaterRun","useSharedValue","buildWorkletsHash","isAnimated","shallowEqual","validateAnimatedStyles","makeViewDescriptorsSet","useViewRefSet","isJest","shouldBeUseWeb","isWorkletFunction","SHOULD_BE_USE_WEB","prepareAnimation","frameTimestamp","animatedProp","lastAnimation","lastValue","Array","isArray","forEach","prop","index","onFrame","animation","value","current","undefined","callStart","timestamp","onStart","Object","keys","key","runAnimations","result","animationsActive","allFinished","entry","finished","callback","k","styleUpdater","viewDescriptors","updater","state","maybeViewRef","isAnimatedProps","animations","newValues","oldValues","last","nonAnimatedNewValues","hasAnimations","hasNonAnimatedValues","global","__frameTimestamp","_getAnimationTimestamp","frame","isAnimationCancelled","isAnimationRunning","updates","propName","requestAnimationFrame","jestStyleUpdater","animatedStyle","adapters","length","checkSharedValueUsage","currentKey","element","Error","useAnimatedStyle","dependencies","viewsRef","animatedUpdaterData","inputs","values","__closure","_dependencies","__DEV__","adaptersArray","adaptersHash","areAnimationsActive","jestAnimatedStyle","__workletHash","push","initialStyle","initial","remoteState","shareableViewDescriptors","fun","updaterFn","adapter","mapperId","animatedStyleHandle"],"sources":["useAnimatedStyle.ts"],"sourcesContent":["'use strict';\nimport type { MutableRefObject } from 'react';\nimport { useEffect, useRef } from 'react';\n\nimport { makeShareable, startMapper, stopMapper } from '../core';\nimport updateProps, { updatePropsJestWrapper } from '../UpdateProps';\nimport { initialUpdaterRun } from '../animation';\nimport { useSharedValue } from './useSharedValue';\nimport {\n buildWorkletsHash,\n isAnimated,\n shallowEqual,\n validateAnimatedStyles,\n} from './utils';\nimport type {\n AnimatedStyleHandle,\n DefaultStyle,\n DependencyList,\n Descriptor,\n JestAnimatedStyleHandle,\n} from './commonTypes';\nimport type { ViewDescriptorsSet, ViewRefSet } from '../ViewDescriptorsSet';\nimport { makeViewDescriptorsSet, useViewRefSet } from '../ViewDescriptorsSet';\nimport { isJest, shouldBeUseWeb } from '../PlatformChecker';\nimport type {\n AnimationObject,\n Timestamp,\n NestedObjectValues,\n SharedValue,\n StyleProps,\n WorkletFunction,\n AnimatedPropsAdapterFunction,\n AnimatedPropsAdapterWorklet,\n} from '../commonTypes';\nimport type { AnimatedStyle } from '../helperTypes';\nimport { isWorkletFunction } from '../commonTypes';\n\nconst SHOULD_BE_USE_WEB = shouldBeUseWeb();\n\ninterface AnimatedState {\n last: AnimatedStyle<any>;\n animations: AnimatedStyle<any>;\n isAnimationRunning: boolean;\n isAnimationCancelled: boolean;\n}\n\ninterface AnimatedUpdaterData {\n initial: {\n value: AnimatedStyle<any>;\n updater: () => AnimatedStyle<any>;\n };\n remoteState: AnimatedState;\n viewDescriptors: ViewDescriptorsSet;\n}\n\nfunction prepareAnimation(\n frameTimestamp: number,\n animatedProp: AnimatedStyle<any>,\n lastAnimation: AnimatedStyle<any>,\n lastValue: AnimatedStyle<any>\n): void {\n 'worklet';\n if (Array.isArray(animatedProp)) {\n animatedProp.forEach((prop, index) => {\n prepareAnimation(\n frameTimestamp,\n prop,\n lastAnimation && lastAnimation[index],\n lastValue && lastValue[index]\n );\n });\n // return animatedProp;\n }\n if (typeof animatedProp === 'object' && animatedProp.onFrame) {\n const animation = animatedProp;\n\n let value = animation.current;\n if (lastValue !== undefined && lastValue !== null) {\n if (typeof lastValue === 'object') {\n if (lastValue.value !== undefined) {\n // previously it was a shared value\n value = lastValue.value;\n } else if (lastValue.onFrame !== undefined) {\n if (lastAnimation?.current !== undefined) {\n // it was an animation before, copy its state\n value = lastAnimation.current;\n } else if (lastValue?.current !== undefined) {\n // it was initialized\n value = lastValue.current;\n }\n }\n } else {\n // previously it was a plain value, just set it as starting point\n value = lastValue;\n }\n }\n\n animation.callStart = (timestamp: Timestamp) => {\n animation.onStart(animation, value, timestamp, lastAnimation);\n };\n animation.callStart(frameTimestamp);\n animation.callStart = null;\n } else if (typeof animatedProp === 'object') {\n // it is an object\n Object.keys(animatedProp).forEach((key) =>\n prepareAnimation(\n frameTimestamp,\n animatedProp[key],\n lastAnimation && lastAnimation[key],\n lastValue && lastValue[key]\n )\n );\n }\n}\n\nfunction runAnimations(\n animation: AnimatedStyle<any>,\n timestamp: Timestamp,\n key: number | string,\n result: AnimatedStyle<any>,\n animationsActive: SharedValue<boolean>\n): boolean {\n 'worklet';\n if (!animationsActive.value) {\n return true;\n }\n if (Array.isArray(animation)) {\n result[key] = [];\n let allFinished = true;\n animation.forEach((entry, index) => {\n if (\n !runAnimations(entry, timestamp, index, result[key], animationsActive)\n ) {\n allFinished = false;\n }\n });\n return allFinished;\n } else if (typeof animation === 'object' && animation.onFrame) {\n let finished = true;\n if (!animation.finished) {\n if (animation.callStart) {\n animation.callStart(timestamp);\n animation.callStart = null;\n }\n finished = animation.onFrame(animation, timestamp);\n animation.timestamp = timestamp;\n if (finished) {\n animation.finished = true;\n animation.callback && animation.callback(true /* finished */);\n }\n }\n result[key] = animation.current;\n return finished;\n } else if (typeof animation === 'object') {\n result[key] = {};\n let allFinished = true;\n Object.keys(animation).forEach((k) => {\n if (\n !runAnimations(\n animation[k],\n timestamp,\n k,\n result[key],\n animationsActive\n )\n ) {\n allFinished = false;\n }\n });\n return allFinished;\n } else {\n result[key] = animation;\n return true;\n }\n}\n\nfunction styleUpdater(\n viewDescriptors: SharedValue<Descriptor[]>,\n updater: WorkletFunction<[], AnimatedStyle<any>> | (() => AnimatedStyle<any>),\n state: AnimatedState,\n maybeViewRef: ViewRefSet<any> | undefined,\n animationsActive: SharedValue<boolean>,\n isAnimatedProps = false\n): void {\n 'worklet';\n const animations = state.animations ?? {};\n const newValues = updater() ?? {};\n const oldValues = state.last;\n const nonAnimatedNewValues: StyleProps = {};\n\n let hasAnimations = false;\n let frameTimestamp: number | undefined;\n let hasNonAnimatedValues = false;\n for (const key in newValues) {\n const value = newValues[key];\n if (isAnimated(value)) {\n frameTimestamp =\n global.__frameTimestamp || global._getAnimationTimestamp();\n prepareAnimation(frameTimestamp, value, animations[key], oldValues[key]);\n animations[key] = value;\n hasAnimations = true;\n } else {\n hasNonAnimatedValues = true;\n nonAnimatedNewValues[key] = value;\n delete animations[key];\n }\n }\n\n if (hasAnimations) {\n const frame = (timestamp: Timestamp) => {\n // eslint-disable-next-line @typescript-eslint/no-shadow\n const { animations, last, isAnimationCancelled } = state;\n if (isAnimationCancelled) {\n state.isAnimationRunning = false;\n return;\n }\n\n const updates: AnimatedStyle<any> = {};\n let allFinished = true;\n for (const propName in animations) {\n const finished = runAnimations(\n animations[propName],\n timestamp,\n propName,\n updates,\n animationsActive\n );\n if (finished) {\n last[propName] = updates[propName];\n delete animations[propName];\n } else {\n allFinished = false;\n }\n }\n\n if (updates) {\n updateProps(viewDescriptors, updates, maybeViewRef);\n }\n\n if (!allFinished) {\n requestAnimationFrame(frame);\n } else {\n state.isAnimationRunning = false;\n }\n };\n\n state.animations = animations;\n if (!state.isAnimationRunning) {\n state.isAnimationCancelled = false;\n state.isAnimationRunning = true;\n frame(frameTimestamp!);\n }\n\n if (hasNonAnimatedValues) {\n updateProps(viewDescriptors, nonAnimatedNewValues, maybeViewRef);\n }\n } else {\n state.isAnimationCancelled = true;\n state.animations = [];\n\n if (!shallowEqual(oldValues, newValues)) {\n updateProps(viewDescriptors, newValues, maybeViewRef, isAnimatedProps);\n }\n }\n state.last = newValues;\n}\n\nfunction jestStyleUpdater(\n viewDescriptors: SharedValue<Descriptor[]>,\n updater: WorkletFunction<[], AnimatedStyle<any>> | (() => AnimatedStyle<any>),\n state: AnimatedState,\n maybeViewRef: ViewRefSet<any> | undefined,\n animationsActive: SharedValue<boolean>,\n animatedStyle: MutableRefObject<AnimatedStyle<any>>,\n adapters: AnimatedPropsAdapterFunction[]\n): void {\n 'worklet';\n const animations: AnimatedStyle<any> = state.animations ?? {};\n const newValues = updater() ?? {};\n const oldValues = state.last;\n\n // extract animated props\n let hasAnimations = false;\n let frameTimestamp: number | undefined;\n Object.keys(animations).forEach((key) => {\n const value = newValues[key];\n if (!isAnimated(value)) {\n delete animations[key];\n }\n });\n Object.keys(newValues).forEach((key) => {\n const value = newValues[key];\n if (isAnimated(value)) {\n frameTimestamp =\n global.__frameTimestamp || global._getAnimationTimestamp();\n prepareAnimation(frameTimestamp, value, animations[key], oldValues[key]);\n animations[key] = value;\n hasAnimations = true;\n }\n });\n\n function frame(timestamp: Timestamp) {\n // eslint-disable-next-line @typescript-eslint/no-shadow\n const { animations, last, isAnimationCancelled } = state;\n if (isAnimationCancelled) {\n state.isAnimationRunning = false;\n return;\n }\n\n const updates: AnimatedStyle<any> = {};\n let allFinished = true;\n Object.keys(animations).forEach((propName) => {\n const finished = runAnimations(\n animations[propName],\n timestamp,\n propName,\n updates,\n animationsActive\n );\n if (finished) {\n last[propName] = updates[propName];\n delete animations[propName];\n } else {\n allFinished = false;\n }\n });\n\n if (Object.keys(updates).length) {\n updatePropsJestWrapper(\n viewDescriptors,\n updates,\n maybeViewRef,\n animatedStyle,\n adapters\n );\n }\n\n if (!allFinished) {\n requestAnimationFrame(frame);\n } else {\n state.isAnimationRunning = false;\n }\n }\n\n if (hasAnimations) {\n state.animations = animations;\n if (!state.isAnimationRunning) {\n state.isAnimationCancelled = false;\n state.isAnimationRunning = true;\n frame(frameTimestamp!);\n }\n } else {\n state.isAnimationCancelled = true;\n state.animations = [];\n }\n\n // calculate diff\n state.last = newValues;\n\n if (!shallowEqual(oldValues, newValues)) {\n updatePropsJestWrapper(\n viewDescriptors,\n newValues,\n maybeViewRef,\n animatedStyle,\n adapters\n );\n }\n}\n\n// check for invalid usage of shared values in returned object\nfunction checkSharedValueUsage(\n prop: NestedObjectValues<AnimationObject>,\n currentKey?: string\n): void {\n if (Array.isArray(prop)) {\n // if it's an array (i.ex. transform) validate all its elements\n for (const element of prop) {\n checkSharedValueUsage(element, currentKey);\n }\n } else if (\n typeof prop === 'object' &&\n prop !== null &&\n prop.value === undefined\n ) {\n // if it's a nested object, run validation for all its props\n for (const key of Object.keys(prop)) {\n checkSharedValueUsage(prop[key], key);\n }\n } else if (\n currentKey !== undefined &&\n typeof prop === 'object' &&\n prop !== null &&\n prop.value !== undefined\n ) {\n // if shared value is passed insted of its value, throw an error\n throw new Error(\n `[Reanimated] Invalid value passed to \\`${currentKey}\\`, maybe you forgot to use \\`.value\\`?`\n );\n }\n}\n\n/**\n * Lets you create a styles object, similar to StyleSheet styles, which can be animated using shared values.\n *\n * @param updater - A function returning an object with style properties you want to animate.\n * @param dependencies - An optional array of dependencies. Only relevant when using Reanimated without the Babel plugin on the Web.\n * @returns An animated style object which has to be passed to the `style` property of an Animated component you want to animate.\n * @see https://docs.swmansion.com/react-native-reanimated/docs/core/useAnimatedStyle\n */\n// You cannot pass Shared Values to `useAnimatedStyle` directly.\n// @ts-expect-error This overload is required by our API.\nexport function useAnimatedStyle<Style extends DefaultStyle>(\n updater: () => Style,\n dependencies?: DependencyList | null\n): Style;\n\nexport function useAnimatedStyle<Style extends DefaultStyle>(\n updater:\n | WorkletFunction<[], Style>\n | ((() => Style) & Record<string, unknown>),\n dependencies?: DependencyList | null,\n adapters?: AnimatedPropsAdapterWorklet | AnimatedPropsAdapterWorklet[] | null,\n isAnimatedProps = false\n): AnimatedStyleHandle<Style> | JestAnimatedStyleHandle<Style> {\n const viewsRef: ViewRefSet<unknown> | undefined = useViewRefSet();\n const animatedUpdaterData = useRef<AnimatedUpdaterData>();\n let inputs = Object.values(updater.__closure ?? {});\n if (SHOULD_BE_USE_WEB) {\n if (!inputs.length && dependencies?.length) {\n // let web work without a Babel plugin\n inputs = dependencies;\n }\n if (\n __DEV__ &&\n !inputs.length &&\n !dependencies &&\n !isWorkletFunction(updater)\n ) {\n throw new Error(\n `[Reanimated] \\`useAnimatedStyle\\` was used without a dependency array or Babel plugin. Please explicitly pass a dependency array, or enable the Babel plugin.\nFor more, see the docs: \\`https://docs.swmansion.com/react-native-reanimated/docs/guides/web-support#web-without-the-babel-plugin\\`.`\n );\n }\n }\n const adaptersArray = adapters\n ? Array.isArray(adapters)\n ? adapters\n : [adapters]\n : [];\n const adaptersHash = adapters ? buildWorkletsHash(adaptersArray) : null;\n const areAnimationsActive = useSharedValue<boolean>(true);\n const jestAnimatedStyle = useRef<Style>({} as Style);\n\n // build dependencies\n if (!dependencies) {\n dependencies = [...inputs, updater.__workletHash];\n } else {\n dependencies.push(updater.__workletHash);\n }\n adaptersHash && dependencies.push(adaptersHash);\n\n if (!animatedUpdaterData.current) {\n const initialStyle = initialUpdaterRun(updater);\n if (__DEV__) {\n validateAnimatedStyles(initialStyle);\n }\n animatedUpdaterData.current = {\n initial: {\n value: initialStyle,\n updater,\n },\n remoteState: makeShareable({\n last: initialStyle,\n animations: {},\n isAnimationCancelled: false,\n isAnimationRunning: false,\n }),\n viewDescriptors: makeViewDescriptorsSet(),\n };\n }\n\n const { initial, remoteState, viewDescriptors } = animatedUpdaterData.current;\n const shareableViewDescriptors = viewDescriptors.shareableViewDescriptors;\n\n dependencies.push(shareableViewDescriptors);\n\n useEffect(() => {\n let fun;\n let updaterFn = updater;\n if (adapters) {\n updaterFn = (() => {\n 'worklet';\n const newValues = updater();\n adaptersArray.forEach((adapter) => {\n adapter(newValues as Record<string, unknown>);\n });\n return newValues;\n }) as WorkletFunction<[], Style>;\n }\n\n if (isJest()) {\n fun = () => {\n 'worklet';\n jestStyleUpdater(\n shareableViewDescriptors,\n updater,\n remoteState,\n viewsRef,\n areAnimationsActive,\n jestAnimatedStyle,\n adaptersArray\n );\n };\n } else {\n fun = () => {\n 'worklet';\n styleUpdater(\n shareableViewDescriptors,\n updaterFn,\n remoteState,\n viewsRef,\n areAnimationsActive,\n isAnimatedProps\n );\n };\n }\n const mapperId = startMapper(fun, inputs);\n return () => {\n stopMapper(mapperId);\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, dependencies);\n\n useEffect(() => {\n areAnimationsActive.value = true;\n return () => {\n areAnimationsActive.value = false;\n };\n }, [areAnimationsActive]);\n\n checkSharedValueUsage(initial.value);\n\n const animatedStyleHandle = useRef<\n AnimatedStyleHandle<Style> | JestAnimatedStyleHandle<Style> | null\n >(null);\n\n if (!animatedStyleHandle.current) {\n animatedStyleHandle.current = isJest()\n ? { viewDescriptors, initial, viewsRef, jestAnimatedStyle }\n : { initial, viewsRef, viewDescriptors };\n }\n\n return animatedStyleHandle.current;\n}\n"],"mappings":"AAAA,YAAY;;AAEZ,SAASA,SAAS,EAAEC,MAAM,QAAQ,OAAO;AAEzC,SAASC,aAAa,EAAEC,WAAW,EAAEC,UAAU,QAAQ,SAAS;AAChE,OAAOC,WAAW,IAAIC,sBAAsB,QAAQ,gBAAgB;AACpE,SAASC,iBAAiB,QAAQ,cAAc;AAChD,SAASC,cAAc,QAAQ,kBAAkB;AACjD,SACEC,iBAAiB,EACjBC,UAAU,EACVC,YAAY,EACZC,sBAAsB,QACjB,SAAS;AAShB,SAASC,sBAAsB,EAAEC,aAAa,QAAQ,uBAAuB;AAC7E,SAASC,MAAM,EAAEC,cAAc,QAAQ,oBAAoB;AAY3D,SAASC,iBAAiB,QAAQ,gBAAgB;AAElD,MAAMC,iBAAiB,GAAGF,cAAc,CAAC,CAAC;AAkB1C,SAASG,gBAAgBA,CACvBC,cAAsB,EACtBC,YAAgC,EAChCC,aAAiC,EACjCC,SAA6B,EACvB;EACN,SAAS;;EACT,IAAIC,KAAK,CAACC,OAAO,CAACJ,YAAY,CAAC,EAAE;IAC/BA,YAAY,CAACK,OAAO,CAAC,CAACC,IAAI,EAAEC,KAAK,KAAK;MACpCT,gBAAgB,CACdC,cAAc,EACdO,IAAI,EACJL,aAAa,IAAIA,aAAa,CAACM,KAAK,CAAC,EACrCL,SAAS,IAAIA,SAAS,CAACK,KAAK,CAC9B,CAAC;IACH,CAAC,CA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Mapper","stopMapper","updateProps","updatePropsJestWrapper","initialUpdaterRun","useSharedValue","buildWorkletsHash","isAnimated","shallowEqual","validateAnimatedStyles","makeViewDescriptorsSet","isJest","shouldBeUseWeb","isWorkletFunction","SHOULD_BE_USE_WEB","prepareAnimation","frameTimestamp","animatedProp","lastAnimation","lastValue","Array","isArray","forEach","prop","index","onFrame","animation","value","current","undefined","callStart","timestamp","onStart","Object","keys","key","runAnimations","result","animationsActive","allFinished","entry","finished","callback","k","styleUpdater","viewDescriptors","updater","state","isAnimatedProps","animations","newValues","oldValues","last","nonAnimatedNewValues","hasAnimations","hasNonAnimatedValues","global","__frameTimestamp","_getAnimationTimestamp","frame","isAnimationCancelled","isAnimationRunning","updates","propName","requestAnimationFrame","jestStyleUpdater","animatedStyle","adapters","length","checkSharedValueUsage","currentKey","element","Error","useAnimatedStyle","dependencies","animatedUpdaterData","inputs","values","__closure","_dependencies","__DEV__","adaptersArray","adaptersHash","areAnimationsActive","jestAnimatedStyle","__workletHash","push","initialStyle","initial","remoteState","shareableViewDescriptors","fun","updaterFn","adapter","mapperId","animatedStyleHandle"],"sources":["useAnimatedStyle.ts"],"sourcesContent":["'use strict';\nimport type { MutableRefObject } from 'react';\nimport { useEffect, useRef } from 'react';\n\nimport { makeShareable, startMapper, stopMapper } from '../core';\nimport updateProps, { updatePropsJestWrapper } from '../UpdateProps';\nimport { initialUpdaterRun } from '../animation';\nimport { useSharedValue } from './useSharedValue';\nimport {\n buildWorkletsHash,\n isAnimated,\n shallowEqual,\n validateAnimatedStyles,\n} from './utils';\nimport type {\n AnimatedStyleHandle,\n DefaultStyle,\n DependencyList,\n Descriptor,\n JestAnimatedStyleHandle,\n} from './commonTypes';\nimport type { ViewDescriptorsSet } from '../ViewDescriptorsSet';\nimport { makeViewDescriptorsSet } from '../ViewDescriptorsSet';\nimport { isJest, shouldBeUseWeb } from '../PlatformChecker';\nimport type {\n AnimationObject,\n Timestamp,\n NestedObjectValues,\n SharedValue,\n StyleProps,\n WorkletFunction,\n AnimatedPropsAdapterFunction,\n AnimatedPropsAdapterWorklet,\n} from '../commonTypes';\nimport type { AnimatedStyle } from '../helperTypes';\nimport { isWorkletFunction } from '../commonTypes';\n\nconst SHOULD_BE_USE_WEB = shouldBeUseWeb();\n\ninterface AnimatedState {\n last: AnimatedStyle<any>;\n animations: AnimatedStyle<any>;\n isAnimationRunning: boolean;\n isAnimationCancelled: boolean;\n}\n\ninterface AnimatedUpdaterData {\n initial: {\n value: AnimatedStyle<any>;\n updater: () => AnimatedStyle<any>;\n };\n remoteState: AnimatedState;\n viewDescriptors: ViewDescriptorsSet;\n}\n\nfunction prepareAnimation(\n frameTimestamp: number,\n animatedProp: AnimatedStyle<any>,\n lastAnimation: AnimatedStyle<any>,\n lastValue: AnimatedStyle<any>\n): void {\n 'worklet';\n if (Array.isArray(animatedProp)) {\n animatedProp.forEach((prop, index) => {\n prepareAnimation(\n frameTimestamp,\n prop,\n lastAnimation && lastAnimation[index],\n lastValue && lastValue[index]\n );\n });\n // return animatedProp;\n }\n if (typeof animatedProp === 'object' && animatedProp.onFrame) {\n const animation = animatedProp;\n\n let value = animation.current;\n if (lastValue !== undefined && lastValue !== null) {\n if (typeof lastValue === 'object') {\n if (lastValue.value !== undefined) {\n // previously it was a shared value\n value = lastValue.value;\n } else if (lastValue.onFrame !== undefined) {\n if (lastAnimation?.current !== undefined) {\n // it was an animation before, copy its state\n value = lastAnimation.current;\n } else if (lastValue?.current !== undefined) {\n // it was initialized\n value = lastValue.current;\n }\n }\n } else {\n // previously it was a plain value, just set it as starting point\n value = lastValue;\n }\n }\n\n animation.callStart = (timestamp: Timestamp) => {\n animation.onStart(animation, value, timestamp, lastAnimation);\n };\n animation.callStart(frameTimestamp);\n animation.callStart = null;\n } else if (typeof animatedProp === 'object') {\n // it is an object\n Object.keys(animatedProp).forEach((key) =>\n prepareAnimation(\n frameTimestamp,\n animatedProp[key],\n lastAnimation && lastAnimation[key],\n lastValue && lastValue[key]\n )\n );\n }\n}\n\nfunction runAnimations(\n animation: AnimatedStyle<any>,\n timestamp: Timestamp,\n key: number | string,\n result: AnimatedStyle<any>,\n animationsActive: SharedValue<boolean>\n): boolean {\n 'worklet';\n if (!animationsActive.value) {\n return true;\n }\n if (Array.isArray(animation)) {\n result[key] = [];\n let allFinished = true;\n animation.forEach((entry, index) => {\n if (\n !runAnimations(entry, timestamp, index, result[key], animationsActive)\n ) {\n allFinished = false;\n }\n });\n return allFinished;\n } else if (typeof animation === 'object' && animation.onFrame) {\n let finished = true;\n if (!animation.finished) {\n if (animation.callStart) {\n animation.callStart(timestamp);\n animation.callStart = null;\n }\n finished = animation.onFrame(animation, timestamp);\n animation.timestamp = timestamp;\n if (finished) {\n animation.finished = true;\n animation.callback && animation.callback(true /* finished */);\n }\n }\n result[key] = animation.current;\n return finished;\n } else if (typeof animation === 'object') {\n result[key] = {};\n let allFinished = true;\n Object.keys(animation).forEach((k) => {\n if (\n !runAnimations(\n animation[k],\n timestamp,\n k,\n result[key],\n animationsActive\n )\n ) {\n allFinished = false;\n }\n });\n return allFinished;\n } else {\n result[key] = animation;\n return true;\n }\n}\n\nfunction styleUpdater(\n viewDescriptors: SharedValue<Descriptor[]>,\n updater: WorkletFunction<[], AnimatedStyle<any>> | (() => AnimatedStyle<any>),\n state: AnimatedState,\n animationsActive: SharedValue<boolean>,\n isAnimatedProps = false\n): void {\n 'worklet';\n const animations = state.animations ?? {};\n const newValues = updater() ?? {};\n const oldValues = state.last;\n const nonAnimatedNewValues: StyleProps = {};\n\n let hasAnimations = false;\n let frameTimestamp: number | undefined;\n let hasNonAnimatedValues = false;\n for (const key in newValues) {\n const value = newValues[key];\n if (isAnimated(value)) {\n frameTimestamp =\n global.__frameTimestamp || global._getAnimationTimestamp();\n prepareAnimation(frameTimestamp, value, animations[key], oldValues[key]);\n animations[key] = value;\n hasAnimations = true;\n } else {\n hasNonAnimatedValues = true;\n nonAnimatedNewValues[key] = value;\n delete animations[key];\n }\n }\n\n if (hasAnimations) {\n const frame = (timestamp: Timestamp) => {\n // eslint-disable-next-line @typescript-eslint/no-shadow\n const { animations, last, isAnimationCancelled } = state;\n if (isAnimationCancelled) {\n state.isAnimationRunning = false;\n return;\n }\n\n const updates: AnimatedStyle<any> = {};\n let allFinished = true;\n for (const propName in animations) {\n const finished = runAnimations(\n animations[propName],\n timestamp,\n propName,\n updates,\n animationsActive\n );\n if (finished) {\n last[propName] = updates[propName];\n delete animations[propName];\n } else {\n allFinished = false;\n }\n }\n\n if (updates) {\n updateProps(viewDescriptors, updates);\n }\n\n if (!allFinished) {\n requestAnimationFrame(frame);\n } else {\n state.isAnimationRunning = false;\n }\n };\n\n state.animations = animations;\n if (!state.isAnimationRunning) {\n state.isAnimationCancelled = false;\n state.isAnimationRunning = true;\n frame(frameTimestamp!);\n }\n\n if (hasNonAnimatedValues) {\n updateProps(viewDescriptors, nonAnimatedNewValues);\n }\n } else {\n state.isAnimationCancelled = true;\n state.animations = [];\n\n if (!shallowEqual(oldValues, newValues)) {\n updateProps(viewDescriptors, newValues, isAnimatedProps);\n }\n }\n state.last = newValues;\n}\n\nfunction jestStyleUpdater(\n viewDescriptors: SharedValue<Descriptor[]>,\n updater: WorkletFunction<[], AnimatedStyle<any>> | (() => AnimatedStyle<any>),\n state: AnimatedState,\n animationsActive: SharedValue<boolean>,\n animatedStyle: MutableRefObject<AnimatedStyle<any>>,\n adapters: AnimatedPropsAdapterFunction[]\n): void {\n 'worklet';\n const animations: AnimatedStyle<any> = state.animations ?? {};\n const newValues = updater() ?? {};\n const oldValues = state.last;\n\n // extract animated props\n let hasAnimations = false;\n let frameTimestamp: number | undefined;\n Object.keys(animations).forEach((key) => {\n const value = newValues[key];\n if (!isAnimated(value)) {\n delete animations[key];\n }\n });\n Object.keys(newValues).forEach((key) => {\n const value = newValues[key];\n if (isAnimated(value)) {\n frameTimestamp =\n global.__frameTimestamp || global._getAnimationTimestamp();\n prepareAnimation(frameTimestamp, value, animations[key], oldValues[key]);\n animations[key] = value;\n hasAnimations = true;\n }\n });\n\n function frame(timestamp: Timestamp) {\n // eslint-disable-next-line @typescript-eslint/no-shadow\n const { animations, last, isAnimationCancelled } = state;\n if (isAnimationCancelled) {\n state.isAnimationRunning = false;\n return;\n }\n\n const updates: AnimatedStyle<any> = {};\n let allFinished = true;\n Object.keys(animations).forEach((propName) => {\n const finished = runAnimations(\n animations[propName],\n timestamp,\n propName,\n updates,\n animationsActive\n );\n if (finished) {\n last[propName] = updates[propName];\n delete animations[propName];\n } else {\n allFinished = false;\n }\n });\n\n if (Object.keys(updates).length) {\n updatePropsJestWrapper(viewDescriptors, updates, animatedStyle, adapters);\n }\n\n if (!allFinished) {\n requestAnimationFrame(frame);\n } else {\n state.isAnimationRunning = false;\n }\n }\n\n if (hasAnimations) {\n state.animations = animations;\n if (!state.isAnimationRunning) {\n state.isAnimationCancelled = false;\n state.isAnimationRunning = true;\n frame(frameTimestamp!);\n }\n } else {\n state.isAnimationCancelled = true;\n state.animations = [];\n }\n\n // calculate diff\n state.last = newValues;\n\n if (!shallowEqual(oldValues, newValues)) {\n updatePropsJestWrapper(viewDescriptors, newValues, animatedStyle, adapters);\n }\n}\n\n// check for invalid usage of shared values in returned object\nfunction checkSharedValueUsage(\n prop: NestedObjectValues<AnimationObject>,\n currentKey?: string\n): void {\n if (Array.isArray(prop)) {\n // if it's an array (i.ex. transform) validate all its elements\n for (const element of prop) {\n checkSharedValueUsage(element, currentKey);\n }\n } else if (\n typeof prop === 'object' &&\n prop !== null &&\n prop.value === undefined\n ) {\n // if it's a nested object, run validation for all its props\n for (const key of Object.keys(prop)) {\n checkSharedValueUsage(prop[key], key);\n }\n } else if (\n currentKey !== undefined &&\n typeof prop === 'object' &&\n prop !== null &&\n prop.value !== undefined\n ) {\n // if shared value is passed insted of its value, throw an error\n throw new Error(\n `[Reanimated] Invalid value passed to \\`${currentKey}\\`, maybe you forgot to use \\`.value\\`?`\n );\n }\n}\n\n/**\n * Lets you create a styles object, similar to StyleSheet styles, which can be animated using shared values.\n *\n * @param updater - A function returning an object with style properties you want to animate.\n * @param dependencies - An optional array of dependencies. Only relevant when using Reanimated without the Babel plugin on the Web.\n * @returns An animated style object which has to be passed to the `style` property of an Animated component you want to animate.\n * @see https://docs.swmansion.com/react-native-reanimated/docs/core/useAnimatedStyle\n */\n// You cannot pass Shared Values to `useAnimatedStyle` directly.\n// @ts-expect-error This overload is required by our API.\nexport function useAnimatedStyle<Style extends DefaultStyle>(\n updater: () => Style,\n dependencies?: DependencyList | null\n): Style;\n\nexport function useAnimatedStyle<Style extends DefaultStyle>(\n updater:\n | WorkletFunction<[], Style>\n | ((() => Style) & Record<string, unknown>),\n dependencies?: DependencyList | null,\n adapters?: AnimatedPropsAdapterWorklet | AnimatedPropsAdapterWorklet[] | null,\n isAnimatedProps = false\n): AnimatedStyleHandle<Style> | JestAnimatedStyleHandle<Style> {\n const animatedUpdaterData = useRef<AnimatedUpdaterData>();\n let inputs = Object.values(updater.__closure ?? {});\n if (SHOULD_BE_USE_WEB) {\n if (!inputs.length && dependencies?.length) {\n // let web work without a Babel plugin\n inputs = dependencies;\n }\n if (\n __DEV__ &&\n !inputs.length &&\n !dependencies &&\n !isWorkletFunction(updater)\n ) {\n throw new Error(\n `[Reanimated] \\`useAnimatedStyle\\` was used without a dependency array or Babel plugin. Please explicitly pass a dependency array, or enable the Babel plugin.\nFor more, see the docs: \\`https://docs.swmansion.com/react-native-reanimated/docs/guides/web-support#web-without-the-babel-plugin\\`.`\n );\n }\n }\n const adaptersArray = adapters\n ? Array.isArray(adapters)\n ? adapters\n : [adapters]\n : [];\n const adaptersHash = adapters ? buildWorkletsHash(adaptersArray) : null;\n const areAnimationsActive = useSharedValue<boolean>(true);\n const jestAnimatedStyle = useRef<Style>({} as Style);\n\n // build dependencies\n if (!dependencies) {\n dependencies = [...inputs, updater.__workletHash];\n } else {\n dependencies.push(updater.__workletHash);\n }\n adaptersHash && dependencies.push(adaptersHash);\n\n if (!animatedUpdaterData.current) {\n const initialStyle = initialUpdaterRun(updater);\n if (__DEV__) {\n validateAnimatedStyles(initialStyle);\n }\n animatedUpdaterData.current = {\n initial: {\n value: initialStyle,\n updater,\n },\n remoteState: makeShareable({\n last: initialStyle,\n animations: {},\n isAnimationCancelled: false,\n isAnimationRunning: false,\n }),\n viewDescriptors: makeViewDescriptorsSet(),\n };\n }\n\n const { initial, remoteState, viewDescriptors } = animatedUpdaterData.current;\n const shareableViewDescriptors = viewDescriptors.shareableViewDescriptors;\n\n dependencies.push(shareableViewDescriptors);\n\n useEffect(() => {\n let fun;\n let updaterFn = updater;\n if (adapters) {\n updaterFn = (() => {\n 'worklet';\n const newValues = updater();\n adaptersArray.forEach((adapter) => {\n adapter(newValues as Record<string, unknown>);\n });\n return newValues;\n }) as WorkletFunction<[], Style>;\n }\n\n if (isJest()) {\n fun = () => {\n 'worklet';\n jestStyleUpdater(\n shareableViewDescriptors,\n updater,\n remoteState,\n areAnimationsActive,\n jestAnimatedStyle,\n adaptersArray\n );\n };\n } else {\n fun = () => {\n 'worklet';\n styleUpdater(\n shareableViewDescriptors,\n updaterFn,\n remoteState,\n areAnimationsActive,\n isAnimatedProps\n );\n };\n }\n const mapperId = startMapper(fun, inputs);\n return () => {\n stopMapper(mapperId);\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, dependencies);\n\n useEffect(() => {\n areAnimationsActive.value = true;\n return () => {\n areAnimationsActive.value = false;\n };\n }, [areAnimationsActive]);\n\n checkSharedValueUsage(initial.value);\n\n const animatedStyleHandle = useRef<\n AnimatedStyleHandle<Style> | JestAnimatedStyleHandle<Style> | null\n >(null);\n\n if (!animatedStyleHandle.current) {\n animatedStyleHandle.current = isJest()\n ? { viewDescriptors, initial, jestAnimatedStyle }\n : { viewDescriptors, initial };\n }\n\n return animatedStyleHandle.current;\n}\n"],"mappings":"AAAA,YAAY;;AAEZ,SAASA,SAAS,EAAEC,MAAM,QAAQ,OAAO;AAEzC,SAASC,aAAa,EAAEC,WAAW,EAAEC,UAAU,QAAQ,SAAS;AA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,GAAG,IAAI;IAChC,OAAO,MAAM;MACXwD,mBAAmB,CAACxD,KAAK,GAAG,KAAK;IACnC,CAAC;EACH,CAAC,EAAE,CAACwD,mBAAmB,CAAC,CAAC;EAEzBd,qBAAqB,CAACmB,OAAO,CAAC7D,KAAK,CAAC;EAEpC,MAAMoE,mBAAmB,GAAGjG,MAAM,CAEhC,IAAI,CAAC;EAEP,IAAI,CAACiG,mBAAmB,CAACnE,OAAO,EAAE;IAChCmE,mBAAmB,CAACnE,OAAO,GAAGjB,MAAM,CAAC,CAAC,GAClC;MAAEkC,eAAe;MAAE2C,OAAO;MAAEJ;IAAkB,CAAC,GAC/C;MAAEvC,eAAe;MAAE2C;IAAQ,CAAC;EAClC;EAEA,OAAOO,mBAAmB,CAACnE,OAAO;AACpC","ignoreList":[]}
|
|
@@ -31,10 +31,10 @@ export function useFrameCallback(callback, autostart = true) {
|
|
|
31
31
|
});
|
|
32
32
|
useEffect(() => {
|
|
33
33
|
ref.current.callbackId = frameCallbackRegistry.registerFrameCallback(callback);
|
|
34
|
+
const memoizedId = ref.current.callbackId;
|
|
34
35
|
ref.current.setActive(ref.current.isActive);
|
|
35
36
|
return () => {
|
|
36
|
-
frameCallbackRegistry.unregisterFrameCallback(
|
|
37
|
-
ref.current.callbackId = -1;
|
|
37
|
+
frameCallbackRegistry.unregisterFrameCallback(memoizedId);
|
|
38
38
|
};
|
|
39
39
|
}, [callback, autostart]);
|
|
40
40
|
return ref.current;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useEffect","useRef","FrameCallbackRegistryJS","frameCallbackRegistry","useFrameCallback","callback","autostart","ref","setActive","isActive","manageStateFrameCallback","current","callbackId","registerFrameCallback","unregisterFrameCallback"],"sources":["useFrameCallback.ts"],"sourcesContent":["'use strict';\nimport { useEffect, useRef } from 'react';\nimport FrameCallbackRegistryJS from '../frameCallback/FrameCallbackRegistryJS';\nimport type { FrameInfo } from '../frameCallback/FrameCallbackRegistryUI';\n\n/**\n * @param setActive - A function that lets you start the frame callback or stop it from running.\n * @param isActive - A boolean indicating whether a callback is running.\n * @param callbackId - A number indicating a unique identifier of the frame callback.\n * @see https://docs.swmansion.com/react-native-reanimated/docs/advanced/useFrameCallback#returns\n */\nexport type FrameCallback = {\n setActive: (isActive: boolean) => void;\n isActive: boolean;\n callbackId: number;\n};\nconst frameCallbackRegistry = new FrameCallbackRegistryJS();\n\n/**\n * Lets you run a function on every frame update.\n *\n * @param callback - A function executed on every frame update.\n * @param autostart - Whether the callback should start automatically. Defaults to `true`.\n * @returns A frame callback object - {@link FrameCallback}.\n * @see https://docs.swmansion.com/react-native-reanimated/docs/advanced/useFrameCallback\n */\nexport function useFrameCallback(\n callback: (frameInfo: FrameInfo) => void,\n autostart = true\n): FrameCallback {\n const ref = useRef<FrameCallback>({\n setActive: (isActive: boolean) => {\n frameCallbackRegistry.manageStateFrameCallback(\n ref.current.callbackId,\n isActive\n );\n ref.current.isActive = isActive;\n },\n isActive: autostart,\n callbackId: -1,\n });\n\n useEffect(() => {\n ref.current.callbackId =\n frameCallbackRegistry.registerFrameCallback(callback);\n ref.current.setActive(ref.current.isActive);\n\n return () => {\n frameCallbackRegistry.unregisterFrameCallback(
|
|
1
|
+
{"version":3,"names":["useEffect","useRef","FrameCallbackRegistryJS","frameCallbackRegistry","useFrameCallback","callback","autostart","ref","setActive","isActive","manageStateFrameCallback","current","callbackId","registerFrameCallback","memoizedId","unregisterFrameCallback"],"sources":["useFrameCallback.ts"],"sourcesContent":["'use strict';\nimport { useEffect, useRef } from 'react';\nimport FrameCallbackRegistryJS from '../frameCallback/FrameCallbackRegistryJS';\nimport type { FrameInfo } from '../frameCallback/FrameCallbackRegistryUI';\n\n/**\n * @param setActive - A function that lets you start the frame callback or stop it from running.\n * @param isActive - A boolean indicating whether a callback is running.\n * @param callbackId - A number indicating a unique identifier of the frame callback.\n * @see https://docs.swmansion.com/react-native-reanimated/docs/advanced/useFrameCallback#returns\n */\nexport type FrameCallback = {\n setActive: (isActive: boolean) => void;\n isActive: boolean;\n callbackId: number;\n};\nconst frameCallbackRegistry = new FrameCallbackRegistryJS();\n\n/**\n * Lets you run a function on every frame update.\n *\n * @param callback - A function executed on every frame update.\n * @param autostart - Whether the callback should start automatically. Defaults to `true`.\n * @returns A frame callback object - {@link FrameCallback}.\n * @see https://docs.swmansion.com/react-native-reanimated/docs/advanced/useFrameCallback\n */\nexport function useFrameCallback(\n callback: (frameInfo: FrameInfo) => void,\n autostart = true\n): FrameCallback {\n const ref = useRef<FrameCallback>({\n setActive: (isActive: boolean) => {\n frameCallbackRegistry.manageStateFrameCallback(\n ref.current.callbackId,\n isActive\n );\n ref.current.isActive = isActive;\n },\n isActive: autostart,\n callbackId: -1,\n });\n\n useEffect(() => {\n ref.current.callbackId =\n frameCallbackRegistry.registerFrameCallback(callback);\n const memoizedId = ref.current.callbackId;\n ref.current.setActive(ref.current.isActive);\n\n return () => {\n frameCallbackRegistry.unregisterFrameCallback(memoizedId);\n };\n }, [callback, autostart]);\n\n return ref.current;\n}\n"],"mappings":"AAAA,YAAY;;AACZ,SAASA,SAAS,EAAEC,MAAM,QAAQ,OAAO;AACzC,OAAOC,uBAAuB,MAAM,0CAA0C;;AAG9E;AACA;AACA;AACA;AACA;AACA;;AAMA,MAAMC,qBAAqB,GAAG,IAAID,uBAAuB,CAAC,CAAC;;AAE3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASE,gBAAgBA,CAC9BC,QAAwC,EACxCC,SAAS,GAAG,IAAI,EACD;EACf,MAAMC,GAAG,GAAGN,MAAM,CAAgB;IAChCO,SAAS,EAAGC,QAAiB,IAAK;MAChCN,qBAAqB,CAACO,wBAAwB,CAC5CH,GAAG,CAACI,OAAO,CAACC,UAAU,EACtBH,QACF,CAAC;MACDF,GAAG,CAACI,OAAO,CAACF,QAAQ,GAAGA,QAAQ;IACjC,CAAC;IACDA,QAAQ,EAAEH,SAAS;IACnBM,UAAU,EAAE,CAAC;EACf,CAAC,CAAC;EAEFZ,SAAS,CAAC,MAAM;IACdO,GAAG,CAACI,OAAO,CAACC,UAAU,GACpBT,qBAAqB,CAACU,qBAAqB,CAACR,QAAQ,CAAC;IACvD,MAAMS,UAAU,GAAGP,GAAG,CAACI,OAAO,CAACC,UAAU;IACzCL,GAAG,CAACI,OAAO,CAACH,SAAS,CAACD,GAAG,CAACI,OAAO,CAACF,QAAQ,CAAC;IAE3C,OAAO,MAAM;MACXN,qBAAqB,CAACY,uBAAuB,CAACD,UAAU,CAAC;IAC3D,CAAC;EACH,CAAC,EAAE,CAACT,QAAQ,EAAEC,SAAS,CAAC,CAAC;EAEzB,OAAOC,GAAG,CAACI,OAAO;AACpB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useCallback","useWorkletCallback","worklet","deps"],"sources":["useWorkletCallback.ts"],"sourcesContent":["'use strict';\nimport { useCallback } from 'react';\nimport type { DependencyList } from './commonTypes';\n\n/**\n * @deprecated
|
|
1
|
+
{"version":3,"names":["useCallback","useWorkletCallback","worklet","deps"],"sources":["useWorkletCallback.ts"],"sourcesContent":["'use strict';\nimport { useCallback } from 'react';\nimport type { DependencyList } from './commonTypes';\n\n/**\n * @deprecated use React.useCallback instead\n */\nexport function useWorkletCallback<Args extends unknown[], ReturnValue>(\n worklet: (...args: Args) => ReturnValue,\n deps?: DependencyList\n) {\n return useCallback(worklet, deps ?? []);\n}\n"],"mappings":"AAAA,YAAY;;AACZ,SAASA,WAAW,QAAQ,OAAO;AAGnC;AACA;AACA;AACA,OAAO,SAASC,kBAAkBA,CAChCC,OAAuC,EACvCC,IAAqB,EACrB;EACA,OAAOH,WAAW,CAACE,OAAO,EAAEC,IAAI,IAAI,EAAE,CAAC;AACzC","ignoreList":[]}
|
|
@@ -1,33 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
import JSReanimated from './JSReanimated';
|
|
4
|
-
import {
|
|
4
|
+
import { createReactDOMStyle, createTransformValue, createTextShadowValue } from './webUtils';
|
|
5
5
|
import { PropsAllowlists } from '../propsAllowlists';
|
|
6
|
-
|
|
7
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
8
|
-
let createReactDOMStyle;
|
|
9
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10
|
-
let createTransformValue;
|
|
11
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
12
|
-
let createTextShadowValue;
|
|
13
|
-
if (isWeb()) {
|
|
14
|
-
try {
|
|
15
|
-
createReactDOMStyle =
|
|
16
|
-
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
17
|
-
require('react-native-web/dist/exports/StyleSheet/compiler/createReactDOMStyle').default;
|
|
18
|
-
} catch (e) {}
|
|
19
|
-
try {
|
|
20
|
-
// React Native Web 0.19+
|
|
21
|
-
createTransformValue =
|
|
22
|
-
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
23
|
-
require('react-native-web/dist/exports/StyleSheet/preprocess').createTransformValue;
|
|
24
|
-
} catch (e) {}
|
|
25
|
-
try {
|
|
26
|
-
createTextShadowValue =
|
|
27
|
-
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
28
|
-
require('react-native-web/dist/exports/StyleSheet/preprocess').createTextShadowValue;
|
|
29
|
-
} catch (e) {}
|
|
30
|
-
}
|
|
31
6
|
const reanimatedJS = new JSReanimated();
|
|
32
7
|
global._makeShareableClone = () => {
|
|
33
8
|
throw new Error('[Reanimated] _makeShareableClone should never be called in JSReanimated.');
|
|
@@ -39,8 +14,8 @@ global._scheduleOnRuntime = () => {
|
|
|
39
14
|
throw new Error('[Reanimated] _scheduleOnRuntime should never be called in JSReanimated.');
|
|
40
15
|
};
|
|
41
16
|
export const _updatePropsJS = (updates, viewRef, isAnimatedProps) => {
|
|
42
|
-
if (viewRef
|
|
43
|
-
const component = viewRef.
|
|
17
|
+
if (viewRef) {
|
|
18
|
+
const component = viewRef.getAnimatableRef ? viewRef.getAnimatableRef() : viewRef;
|
|
44
19
|
const [rawStyles] = Object.keys(updates).reduce((acc, key) => {
|
|
45
20
|
const value = updates[key];
|
|
46
21
|
const index = typeof value === 'function' ? 1 : 0;
|