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.
Files changed (153) hide show
  1. package/Common/cpp/LayoutAnimations/LayoutAnimationsManager.cpp +8 -2
  2. package/Common/cpp/LayoutAnimations/LayoutAnimationsManager.h +3 -1
  3. package/Common/cpp/LayoutAnimations/LayoutAnimationsProxy.cpp +58 -33
  4. package/Common/cpp/LayoutAnimations/LayoutAnimationsProxy.h +19 -9
  5. package/Common/cpp/LayoutAnimations/LayoutAnimationsUtils.cpp +11 -7
  6. package/Common/cpp/LayoutAnimations/LayoutAnimationsUtils.h +14 -6
  7. package/Common/cpp/NativeModules/NativeReanimatedModule.cpp +1 -1
  8. package/Common/cpp/NativeModules/NativeReanimatedModule.h +1 -1
  9. package/Common/cpp/ReanimatedRuntime/WorkletRuntime.cpp +1 -1
  10. package/Common/cpp/ReanimatedRuntime/WorkletRuntime.h +1 -1
  11. package/Common/cpp/ReanimatedRuntime/WorkletRuntimeDecorator.cpp +6 -6
  12. package/Common/cpp/SharedItems/Shareables.cpp +25 -8
  13. package/Common/cpp/SharedItems/Shareables.h +12 -7
  14. package/android/CMakeLists.txt +1 -1
  15. package/android/src/main/cpp/LayoutAnimations.cpp +14 -0
  16. package/android/src/main/cpp/LayoutAnimations.h +5 -0
  17. package/android/src/main/cpp/NativeProxy.cpp +10 -0
  18. package/android/src/main/java/com/swmansion/reanimated/layoutReanimation/AnimationsManager.java +10 -2
  19. package/android/src/main/java/com/swmansion/reanimated/layoutReanimation/LayoutAnimations.java +2 -0
  20. package/android/src/main/java/com/swmansion/reanimated/layoutReanimation/NativeMethodsHolder.java +2 -0
  21. package/android/src/main/java/com/swmansion/reanimated/layoutReanimation/ReanimatedNativeHierarchyManager.java +10 -0
  22. package/android/src/main/java/com/swmansion/reanimated/layoutReanimation/ScreensHelper.java +83 -0
  23. package/android/src/main/java/com/swmansion/reanimated/layoutReanimation/SharedTransitionManager.java +130 -31
  24. package/android/src/main/java/com/swmansion/reanimated/layoutReanimation/Snapshot.java +36 -0
  25. package/android/src/main/java/com/swmansion/reanimated/layoutReanimation/TabNavigatorObserver.java +128 -0
  26. package/android/src/paper/java/com/swmansion/reanimated/NativeProxy.java +8 -0
  27. package/android/src/reactNativeVersionPatch/RuntimeExecutor/73/com/swmansion/reanimated/NativeProxy.java +6 -0
  28. package/android/src/reactNativeVersionPatch/RuntimeExecutor/latest/com/swmansion/reanimated/NativeProxy.java +6 -0
  29. package/apple/LayoutReanimation/REAAnimationsManager.h +2 -0
  30. package/apple/LayoutReanimation/REAAnimationsManager.m +5 -0
  31. package/apple/LayoutReanimation/REAScreensHelper.h +6 -0
  32. package/apple/LayoutReanimation/REAScreensHelper.m +92 -4
  33. package/apple/LayoutReanimation/REASharedTransitionManager.h +1 -0
  34. package/apple/LayoutReanimation/REASharedTransitionManager.m +254 -55
  35. package/apple/native/NativeProxy.mm +12 -0
  36. package/lib/module/Colors.js +5 -2
  37. package/lib/module/Colors.js.map +1 -1
  38. package/lib/module/UpdateProps.js +8 -8
  39. package/lib/module/UpdateProps.js.map +1 -1
  40. package/lib/module/ViewDescriptorsSet.js +0 -27
  41. package/lib/module/ViewDescriptorsSet.js.map +1 -1
  42. package/lib/module/createAnimatedComponent/InlinePropManager.js +1 -7
  43. package/lib/module/createAnimatedComponent/InlinePropManager.js.map +1 -1
  44. package/lib/module/createAnimatedComponent/PropsFilter.js +1 -6
  45. package/lib/module/createAnimatedComponent/PropsFilter.js.map +1 -1
  46. package/lib/module/createAnimatedComponent/commonTypes.js.map +1 -1
  47. package/lib/module/createAnimatedComponent/createAnimatedComponent.js +1 -5
  48. package/lib/module/createAnimatedComponent/createAnimatedComponent.js.map +1 -1
  49. package/lib/module/hook/commonTypes.js.map +1 -1
  50. package/lib/module/hook/useAnimatedStyle.js +12 -15
  51. package/lib/module/hook/useAnimatedStyle.js.map +1 -1
  52. package/lib/module/hook/useFrameCallback.js +2 -2
  53. package/lib/module/hook/useFrameCallback.js.map +1 -1
  54. package/lib/module/hook/useWorkletCallback.js +1 -1
  55. package/lib/module/hook/useWorkletCallback.js.map +1 -1
  56. package/lib/module/js-reanimated/index.js +3 -28
  57. package/lib/module/js-reanimated/index.js.map +1 -1
  58. package/lib/module/js-reanimated/webUtils.js +9 -0
  59. package/lib/module/js-reanimated/webUtils.js.map +1 -0
  60. package/lib/module/js-reanimated/webUtils.web.js +25 -0
  61. package/lib/module/js-reanimated/webUtils.web.js.map +1 -0
  62. package/lib/module/layoutReanimation/defaultTransitions/CurvedTransition.js +1 -0
  63. package/lib/module/layoutReanimation/defaultTransitions/CurvedTransition.js.map +1 -1
  64. package/lib/module/layoutReanimation/defaultTransitions/EntryExitTransition.js +1 -0
  65. package/lib/module/layoutReanimation/defaultTransitions/EntryExitTransition.js.map +1 -1
  66. package/lib/module/layoutReanimation/defaultTransitions/FadingTransition.js +11 -10
  67. package/lib/module/layoutReanimation/defaultTransitions/FadingTransition.js.map +1 -1
  68. package/lib/module/layoutReanimation/defaultTransitions/JumpingTransition.js +1 -0
  69. package/lib/module/layoutReanimation/defaultTransitions/JumpingTransition.js.map +1 -1
  70. package/lib/module/layoutReanimation/defaultTransitions/LinearTransition.js +1 -0
  71. package/lib/module/layoutReanimation/defaultTransitions/LinearTransition.js.map +1 -1
  72. package/lib/module/layoutReanimation/defaultTransitions/SequencedTransition.js +1 -0
  73. package/lib/module/layoutReanimation/defaultTransitions/SequencedTransition.js.map +1 -1
  74. package/lib/module/layoutReanimation/web/Easing.web.js +14 -0
  75. package/lib/module/layoutReanimation/web/Easing.web.js.map +1 -0
  76. package/lib/module/layoutReanimation/web/animationParser.js +16 -1
  77. package/lib/module/layoutReanimation/web/animationParser.js.map +1 -1
  78. package/lib/module/layoutReanimation/web/animationsManager.js +25 -8
  79. package/lib/module/layoutReanimation/web/animationsManager.js.map +1 -1
  80. package/lib/module/layoutReanimation/web/componentStyle.js +12 -16
  81. package/lib/module/layoutReanimation/web/componentStyle.js.map +1 -1
  82. package/lib/module/layoutReanimation/web/componentUtils.js +53 -18
  83. package/lib/module/layoutReanimation/web/componentUtils.js.map +1 -1
  84. package/lib/module/layoutReanimation/web/config.js +1 -12
  85. package/lib/module/layoutReanimation/web/config.js.map +1 -1
  86. package/lib/module/layoutReanimation/web/createAnimation.js +21 -2
  87. package/lib/module/layoutReanimation/web/createAnimation.js.map +1 -1
  88. package/lib/module/layoutReanimation/web/domUtils.js +6 -5
  89. package/lib/module/layoutReanimation/web/domUtils.js.map +1 -1
  90. package/lib/module/layoutReanimation/web/transition/Jumping.web.js +43 -0
  91. package/lib/module/layoutReanimation/web/transition/Jumping.web.js.map +1 -0
  92. package/lib/module/platform-specific/RNRenderer.web.js +1 -1
  93. package/lib/module/platform-specific/RNRenderer.web.js.map +1 -1
  94. package/lib/module/platform-specific/jsVersion.js +1 -1
  95. package/lib/module/platform-specific/jsVersion.js.map +1 -1
  96. package/lib/module/platformFunctions/setNativeProps.web.js +1 -3
  97. package/lib/module/platformFunctions/setNativeProps.web.js.map +1 -1
  98. package/lib/typescript/UpdateProps.d.ts +2 -3
  99. package/lib/typescript/ViewDescriptorsSet.d.ts +0 -9
  100. package/lib/typescript/createAnimatedComponent/commonTypes.d.ts +1 -2
  101. package/lib/typescript/hook/commonTypes.d.ts +3 -6
  102. package/lib/typescript/hook/useWorkletCallback.d.ts +1 -1
  103. package/lib/typescript/js-reanimated/index.d.ts +2 -4
  104. package/lib/typescript/js-reanimated/webUtils.d.ts +3 -0
  105. package/lib/typescript/js-reanimated/webUtils.web.d.ts +3 -0
  106. package/lib/typescript/layoutReanimation/defaultTransitions/CurvedTransition.d.ts +1 -0
  107. package/lib/typescript/layoutReanimation/defaultTransitions/EntryExitTransition.d.ts +1 -0
  108. package/lib/typescript/layoutReanimation/defaultTransitions/FadingTransition.d.ts +1 -0
  109. package/lib/typescript/layoutReanimation/defaultTransitions/JumpingTransition.d.ts +1 -0
  110. package/lib/typescript/layoutReanimation/defaultTransitions/LinearTransition.d.ts +1 -0
  111. package/lib/typescript/layoutReanimation/defaultTransitions/SequencedTransition.d.ts +1 -0
  112. package/lib/typescript/layoutReanimation/web/Easing.web.d.ts +10 -0
  113. package/lib/typescript/layoutReanimation/web/animationParser.d.ts +1 -2
  114. package/lib/typescript/layoutReanimation/web/componentStyle.d.ts +1 -1
  115. package/lib/typescript/layoutReanimation/web/componentUtils.d.ts +4 -3
  116. package/lib/typescript/layoutReanimation/web/config.d.ts +5 -12
  117. package/lib/typescript/layoutReanimation/web/createAnimation.d.ts +2 -0
  118. package/lib/typescript/layoutReanimation/web/domUtils.d.ts +1 -1
  119. package/lib/typescript/layoutReanimation/web/transition/Jumping.web.d.ts +29 -0
  120. package/lib/typescript/platform-specific/jsVersion.d.ts +1 -1
  121. package/package.json +4 -3
  122. package/src/Colors.ts +5 -2
  123. package/src/UpdateProps.ts +8 -11
  124. package/src/ViewDescriptorsSet.ts +0 -42
  125. package/src/createAnimatedComponent/InlinePropManager.ts +2 -8
  126. package/src/createAnimatedComponent/PropsFilter.tsx +0 -4
  127. package/src/createAnimatedComponent/commonTypes.ts +1 -2
  128. package/src/createAnimatedComponent/createAnimatedComponent.tsx +1 -5
  129. package/src/hook/commonTypes.ts +3 -6
  130. package/src/hook/useAnimatedStyle.ts +9 -26
  131. package/src/hook/useFrameCallback.ts +2 -2
  132. package/src/hook/useWorkletCallback.ts +1 -1
  133. package/src/js-reanimated/index.ts +11 -37
  134. package/src/js-reanimated/webUtils.ts +8 -0
  135. package/src/js-reanimated/webUtils.web.ts +27 -0
  136. package/src/layoutReanimation/defaultTransitions/CurvedTransition.ts +2 -0
  137. package/src/layoutReanimation/defaultTransitions/EntryExitTransition.ts +2 -0
  138. package/src/layoutReanimation/defaultTransitions/FadingTransition.ts +12 -10
  139. package/src/layoutReanimation/defaultTransitions/JumpingTransition.ts +2 -0
  140. package/src/layoutReanimation/defaultTransitions/LinearTransition.ts +2 -0
  141. package/src/layoutReanimation/defaultTransitions/SequencedTransition.ts +2 -0
  142. package/src/layoutReanimation/web/Easing.web.ts +15 -0
  143. package/src/layoutReanimation/web/animationParser.ts +30 -2
  144. package/src/layoutReanimation/web/animationsManager.ts +45 -12
  145. package/src/layoutReanimation/web/componentStyle.ts +13 -16
  146. package/src/layoutReanimation/web/componentUtils.ts +68 -25
  147. package/src/layoutReanimation/web/config.ts +5 -14
  148. package/src/layoutReanimation/web/createAnimation.ts +38 -4
  149. package/src/layoutReanimation/web/domUtils.ts +15 -5
  150. package/src/layoutReanimation/web/transition/Jumping.web.ts +44 -0
  151. package/src/platform-specific/RNRenderer.web.ts +1 -1
  152. package/src/platform-specific/jsVersion.ts +1 -1
  153. package/src/platformFunctions/setNativeProps.web.ts +1 -1
@@ -1 +1 @@
1
- {"version":3,"names":["JSReanimated","isWeb","PropsAllowlists","createReactDOMStyle","createTransformValue","createTextShadowValue","require","default","e","reanimatedJS","global","_makeShareableClone","Error","_scheduleOnJS","_scheduleOnRuntime","_updatePropsJS","updates","viewRef","isAnimatedProps","_component","component","getAnimatableRef","rawStyles","Object","keys","reduce","acc","key","value","index","setNativeProps","undefined","style","updatePropsDOM","props","length","forEach","dashedKey","replace","m","toLowerCase","_touchableNode","setAttribute","componentName","className","console","warn","newProps","_component$setNativeP2","_component$setNativeP","uiProps","isNativeProp","call","previousStyle","currentStyle","domStyle","Array","isArray","transform","textShadowColor","textShadowRadius","textShadowOffset","textShadow","propName","NATIVE_THREAD_PROPS_WHITELIST"],"sources":["index.ts"],"sourcesContent":["'use strict';\nimport JSReanimated from './JSReanimated';\nimport type { StyleProps } from '../commonTypes';\nimport type { AnimatedStyle } from '../helperTypes';\nimport { isWeb } from '../PlatformChecker';\nimport { PropsAllowlists } from '../propsAllowlists';\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nlet createReactDOMStyle: (style: any) => any;\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nlet createTransformValue: (transform: any) => any;\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nlet createTextShadowValue: (style: any) => void | string;\n\nif (isWeb()) {\n try {\n createReactDOMStyle =\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n require('react-native-web/dist/exports/StyleSheet/compiler/createReactDOMStyle').default;\n } catch (e) {}\n\n try {\n // React Native Web 0.19+\n createTransformValue =\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n require('react-native-web/dist/exports/StyleSheet/preprocess').createTransformValue;\n } catch (e) {}\n\n try {\n createTextShadowValue =\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n require('react-native-web/dist/exports/StyleSheet/preprocess').createTextShadowValue;\n } catch (e) {}\n}\n\nconst reanimatedJS = new JSReanimated();\n\nglobal._makeShareableClone = () => {\n throw new Error(\n '[Reanimated] _makeShareableClone should never be called in JSReanimated.'\n );\n};\n\nglobal._scheduleOnJS = () => {\n throw new Error(\n '[Reanimated] _scheduleOnJS should never be called in JSReanimated.'\n );\n};\n\nglobal._scheduleOnRuntime = () => {\n throw new Error(\n '[Reanimated] _scheduleOnRuntime should never be called in JSReanimated.'\n );\n};\n\ninterface JSReanimatedComponent {\n previousStyle: StyleProps;\n setNativeProps?: (style: StyleProps) => void;\n style?: StyleProps;\n props: Record<string, string | number>;\n _touchableNode: {\n setAttribute: (key: string, props: unknown) => void;\n };\n}\n\nexport interface ReanimatedHTMLElement extends HTMLElement {\n previousStyle: StyleProps;\n setNativeProps?: (style: StyleProps) => void;\n props: Record<string, string | number>;\n _touchableNode: {\n setAttribute: (key: string, props: unknown) => void;\n };\n reanimatedDummy?: boolean;\n removedAfterAnimation?: boolean;\n}\n\nexport const _updatePropsJS = (\n // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents\n updates: StyleProps | AnimatedStyle<any>,\n viewRef: {\n _component?: (JSReanimatedComponent | ReanimatedHTMLElement) & {\n getAnimatableRef?: () => JSReanimatedComponent | ReanimatedHTMLElement;\n };\n },\n isAnimatedProps?: boolean\n): void => {\n if (viewRef._component) {\n const component = viewRef._component.getAnimatableRef\n ? viewRef._component.getAnimatableRef()\n : viewRef._component;\n const [rawStyles] = Object.keys(updates).reduce(\n (acc: [StyleProps, AnimatedStyle<any>], key) => {\n const value = updates[key];\n const index = typeof value === 'function' ? 1 : 0;\n acc[index][key] = value;\n return acc;\n },\n [{}, {}]\n );\n\n if (typeof component.setNativeProps === 'function') {\n // This is the legacy way to update props on React Native Web <= 0.18.\n // Also, some components (e.g. from react-native-svg) don't have styles\n // and always provide setNativeProps function instead (even on React Native Web 0.19+).\n setNativeProps(component, rawStyles, isAnimatedProps);\n } else if (\n createReactDOMStyle !== undefined &&\n component.style !== undefined\n ) {\n // React Native Web 0.19+ no longer provides setNativeProps function,\n // so we need to update DOM nodes directly.\n updatePropsDOM(component, rawStyles, isAnimatedProps);\n } else if (Object.keys(component.props).length > 0) {\n Object.keys(component.props).forEach((key) => {\n if (!rawStyles[key]) {\n return;\n }\n const dashedKey = key.replace(/[A-Z]/g, (m) => '-' + m.toLowerCase());\n component._touchableNode.setAttribute(dashedKey, rawStyles[key]);\n });\n } else {\n const componentName =\n 'className' in component ? component?.className : '';\n console.warn(\n `[Reanimated] It's not possible to manipulate the component ${componentName}`\n );\n }\n }\n};\n\nconst setNativeProps = (\n component: JSReanimatedComponent | ReanimatedHTMLElement,\n newProps: StyleProps,\n isAnimatedProps?: boolean\n): void => {\n if (isAnimatedProps) {\n const uiProps: Record<string, unknown> = {};\n for (const key in newProps) {\n if (isNativeProp(key)) {\n uiProps[key] = newProps[key];\n }\n }\n // Only update UI props directly on the component,\n // other props can be updated as standard style props.\n component.setNativeProps?.(uiProps);\n }\n\n const previousStyle = component.previousStyle ? component.previousStyle : {};\n const currentStyle = { ...previousStyle, ...newProps };\n component.previousStyle = currentStyle;\n\n component.setNativeProps?.({ style: currentStyle });\n};\n\nconst updatePropsDOM = (\n component: JSReanimatedComponent | HTMLElement,\n style: StyleProps,\n isAnimatedProps?: boolean\n): void => {\n const previousStyle = (component as JSReanimatedComponent).previousStyle\n ? (component as JSReanimatedComponent).previousStyle\n : {};\n const currentStyle = { ...previousStyle, ...style };\n (component as JSReanimatedComponent).previousStyle = currentStyle;\n\n const domStyle = createReactDOMStyle(currentStyle);\n if (Array.isArray(domStyle.transform) && createTransformValue !== undefined) {\n domStyle.transform = createTransformValue(domStyle.transform);\n }\n\n if (\n createTextShadowValue !== undefined &&\n (domStyle.textShadowColor ||\n domStyle.textShadowRadius ||\n domStyle.textShadowOffset)\n ) {\n domStyle.textShadow = createTextShadowValue({\n textShadowColor: domStyle.textShadowColor,\n textShadowOffset: domStyle.textShadowOffset,\n textShadowRadius: domStyle.textShadowRadius,\n });\n }\n\n for (const key in domStyle) {\n if (isAnimatedProps) {\n (component as HTMLElement).setAttribute(key, domStyle[key]);\n } else {\n (component.style as StyleProps)[key] = domStyle[key];\n }\n }\n};\n\nfunction isNativeProp(propName: string): boolean {\n return !!PropsAllowlists.NATIVE_THREAD_PROPS_WHITELIST[propName];\n}\n\nexport default reanimatedJS;\n"],"mappings":"AAAA,YAAY;;AACZ,OAAOA,YAAY,MAAM,gBAAgB;AAGzC,SAASC,KAAK,QAAQ,oBAAoB;AAC1C,SAASC,eAAe,QAAQ,oBAAoB;;AAEpD;AACA,IAAIC,mBAAwC;AAC5C;AACA,IAAIC,oBAA6C;AACjD;AACA,IAAIC,qBAAoD;AAExD,IAAIJ,KAAK,CAAC,CAAC,EAAE;EACX,IAAI;IACFE,mBAAmB;IACjB;IACAG,OAAO,CAAC,uEAAuE,CAAC,CAACC,OAAO;EAC5F,CAAC,CAAC,OAAOC,CAAC,EAAE,CAAC;EAEb,IAAI;IACF;IACAJ,oBAAoB;IAClB;IACAE,OAAO,CAAC,qDAAqD,CAAC,CAACF,oBAAoB;EACvF,CAAC,CAAC,OAAOI,CAAC,EAAE,CAAC;EAEb,IAAI;IACFH,qBAAqB;IACnB;IACAC,OAAO,CAAC,qDAAqD,CAAC,CAACD,qBAAqB;EACxF,CAAC,CAAC,OAAOG,CAAC,EAAE,CAAC;AACf;AAEA,MAA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,MAAMjC,GAAG,IAAI4B,QAAQ,EAAE;IAC1B,IAAIrC,eAAe,EAAE;MAClBE,SAAS,CAAiBsB,YAAY,CAACf,GAAG,EAAE4B,QAAQ,CAAC5B,GAAG,CAAC,CAAC;IAC7D,CAAC,MAAM;MACJP,SAAS,CAACY,KAAK,CAAgBL,GAAG,CAAC,GAAG4B,QAAQ,CAAC5B,GAAG,CAAC;IACtD;EACF;AACF,CAAC;AAED,SAASwB,YAAYA,CAACY,QAAgB,EAAW;EAC/C,OAAO,CAAC,CAAC7D,eAAe,CAAC8D,6BAA6B,CAACD,QAAQ,CAAC;AAClE;AAEA,eAAetD,YAAY","ignoreList":[]}
1
+ {"version":3,"names":["JSReanimated","createReactDOMStyle","createTransformValue","createTextShadowValue","PropsAllowlists","reanimatedJS","global","_makeShareableClone","Error","_scheduleOnJS","_scheduleOnRuntime","_updatePropsJS","updates","viewRef","isAnimatedProps","component","getAnimatableRef","rawStyles","Object","keys","reduce","acc","key","value","index","setNativeProps","undefined","style","updatePropsDOM","props","length","forEach","dashedKey","replace","m","toLowerCase","_touchableNode","setAttribute","componentName","className","console","warn","newProps","_component$setNativeP2","_component$setNativeP","uiProps","isNativeProp","call","previousStyle","currentStyle","domStyle","Array","isArray","transform","textShadowColor","textShadowRadius","textShadowOffset","textShadow","propName","NATIVE_THREAD_PROPS_WHITELIST"],"sources":["index.ts"],"sourcesContent":["'use strict';\nimport JSReanimated from './JSReanimated';\nimport type { StyleProps } from '../commonTypes';\nimport type { AnimatedStyle } from '../helperTypes';\nimport {\n createReactDOMStyle,\n createTransformValue,\n createTextShadowValue,\n} from './webUtils';\nimport { PropsAllowlists } from '../propsAllowlists';\n\nconst reanimatedJS = new JSReanimated();\n\nglobal._makeShareableClone = () => {\n throw new Error(\n '[Reanimated] _makeShareableClone should never be called in JSReanimated.'\n );\n};\n\nglobal._scheduleOnJS = () => {\n throw new Error(\n '[Reanimated] _scheduleOnJS should never be called in JSReanimated.'\n );\n};\n\nglobal._scheduleOnRuntime = () => {\n throw new Error(\n '[Reanimated] _scheduleOnRuntime should never be called in JSReanimated.'\n );\n};\n\ninterface JSReanimatedComponent {\n previousStyle: StyleProps;\n setNativeProps?: (style: StyleProps) => void;\n style?: StyleProps;\n props: Record<string, string | number>;\n _touchableNode: {\n setAttribute: (key: string, props: unknown) => void;\n };\n}\n\nexport interface ReanimatedHTMLElement extends HTMLElement {\n previousStyle: StyleProps;\n setNativeProps?: (style: StyleProps) => void;\n props: Record<string, string | number>;\n _touchableNode: {\n setAttribute: (key: string, props: unknown) => void;\n };\n reanimatedDummy?: boolean;\n removedAfterAnimation?: boolean;\n}\n\nexport const _updatePropsJS = (\n // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents\n updates: StyleProps | AnimatedStyle<any>,\n viewRef: (JSReanimatedComponent | ReanimatedHTMLElement) & {\n getAnimatableRef?: () => JSReanimatedComponent | ReanimatedHTMLElement;\n },\n isAnimatedProps?: boolean\n): void => {\n if (viewRef) {\n const component = viewRef.getAnimatableRef\n ? viewRef.getAnimatableRef()\n : viewRef;\n const [rawStyles] = Object.keys(updates).reduce(\n (acc: [StyleProps, AnimatedStyle<any>], key) => {\n const value = updates[key];\n const index = typeof value === 'function' ? 1 : 0;\n acc[index][key] = value;\n return acc;\n },\n [{}, {}]\n );\n\n if (typeof component.setNativeProps === 'function') {\n // This is the legacy way to update props on React Native Web <= 0.18.\n // Also, some components (e.g. from react-native-svg) don't have styles\n // and always provide setNativeProps function instead (even on React Native Web 0.19+).\n setNativeProps(component, rawStyles, isAnimatedProps);\n } else if (\n createReactDOMStyle !== undefined &&\n component.style !== undefined\n ) {\n // React Native Web 0.19+ no longer provides setNativeProps function,\n // so we need to update DOM nodes directly.\n updatePropsDOM(component, rawStyles, isAnimatedProps);\n } else if (Object.keys(component.props).length > 0) {\n Object.keys(component.props).forEach((key) => {\n if (!rawStyles[key]) {\n return;\n }\n const dashedKey = key.replace(/[A-Z]/g, (m) => '-' + m.toLowerCase());\n component._touchableNode.setAttribute(dashedKey, rawStyles[key]);\n });\n } else {\n const componentName =\n 'className' in component ? component?.className : '';\n console.warn(\n `[Reanimated] It's not possible to manipulate the component ${componentName}`\n );\n }\n }\n};\n\nconst setNativeProps = (\n component: JSReanimatedComponent | ReanimatedHTMLElement,\n newProps: StyleProps,\n isAnimatedProps?: boolean\n): void => {\n if (isAnimatedProps) {\n const uiProps: Record<string, unknown> = {};\n for (const key in newProps) {\n if (isNativeProp(key)) {\n uiProps[key] = newProps[key];\n }\n }\n // Only update UI props directly on the component,\n // other props can be updated as standard style props.\n component.setNativeProps?.(uiProps);\n }\n\n const previousStyle = component.previousStyle ? component.previousStyle : {};\n const currentStyle = { ...previousStyle, ...newProps };\n component.previousStyle = currentStyle;\n\n component.setNativeProps?.({ style: currentStyle });\n};\n\nconst updatePropsDOM = (\n component: JSReanimatedComponent | HTMLElement,\n style: StyleProps,\n isAnimatedProps?: boolean\n): void => {\n const previousStyle = (component as JSReanimatedComponent).previousStyle\n ? (component as JSReanimatedComponent).previousStyle\n : {};\n const currentStyle = { ...previousStyle, ...style };\n (component as JSReanimatedComponent).previousStyle = currentStyle;\n\n const domStyle = createReactDOMStyle(currentStyle);\n if (Array.isArray(domStyle.transform) && createTransformValue !== undefined) {\n domStyle.transform = createTransformValue(domStyle.transform);\n }\n\n if (\n createTextShadowValue !== undefined &&\n (domStyle.textShadowColor ||\n domStyle.textShadowRadius ||\n domStyle.textShadowOffset)\n ) {\n domStyle.textShadow = createTextShadowValue({\n textShadowColor: domStyle.textShadowColor,\n textShadowOffset: domStyle.textShadowOffset,\n textShadowRadius: domStyle.textShadowRadius,\n });\n }\n\n for (const key in domStyle) {\n if (isAnimatedProps) {\n (component as HTMLElement).setAttribute(key, domStyle[key]);\n } else {\n (component.style as StyleProps)[key] = domStyle[key];\n }\n }\n};\n\nfunction isNativeProp(propName: string): boolean {\n return !!PropsAllowlists.NATIVE_THREAD_PROPS_WHITELIST[propName];\n}\n\nexport default reanimatedJS;\n"],"mappings":"A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EN,QAAQ,CAACM,gBAAgB;MAC3CD,gBAAgB,EAAEL,QAAQ,CAACK;IAC7B,CAAC,CAAC;EACJ;EAEA,KAAK,MAAMjC,GAAG,IAAI4B,QAAQ,EAAE;IAC1B,IAAIpC,eAAe,EAAE;MAClBC,SAAS,CAAiBsB,YAAY,CAACf,GAAG,EAAE4B,QAAQ,CAAC5B,GAAG,CAAC,CAAC;IAC7D,CAAC,MAAM;MACJP,SAAS,CAACY,KAAK,CAAgBL,GAAG,CAAC,GAAG4B,QAAQ,CAAC5B,GAAG,CAAC;IACtD;EACF;AACF,CAAC;AAED,SAASwB,YAAYA,CAACY,QAAgB,EAAW;EAC/C,OAAO,CAAC,CAACtD,eAAe,CAACuD,6BAA6B,CAACD,QAAQ,CAAC;AAClE;AAEA,eAAerD,YAAY","ignoreList":[]}
@@ -0,0 +1,9 @@
1
+ 'use strict';
2
+
3
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
4
+ export let createReactDOMStyle;
5
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
6
+ export let createTransformValue;
7
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
8
+ export let createTextShadowValue;
9
+ //# sourceMappingURL=webUtils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["createReactDOMStyle","createTransformValue","createTextShadowValue"],"sources":["webUtils.ts"],"sourcesContent":["'use strict';\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport let createReactDOMStyle: (style: any) => any;\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport let createTransformValue: (transform: any) => any;\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport let createTextShadowValue: (style: any) => void | string;\n"],"mappings":"AAAA,YAAY;;AAEZ;AACA,OAAO,IAAIA,mBAAwC;AACnD;AACA,OAAO,IAAIC,oBAA6C;AACxD;AACA,OAAO,IAAIC,qBAAoD","ignoreList":[]}
@@ -0,0 +1,25 @@
1
+ 'use strict';
2
+
3
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
4
+ export let createReactDOMStyle;
5
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
6
+ export let createTransformValue;
7
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
8
+ export let createTextShadowValue;
9
+ try {
10
+ createReactDOMStyle =
11
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
12
+ require('react-native-web/dist/exports/StyleSheet/compiler/createReactDOMStyle').default;
13
+ } catch (e) {}
14
+ try {
15
+ // React Native Web 0.19+
16
+ createTransformValue =
17
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
18
+ require('react-native-web/dist/exports/StyleSheet/preprocess').createTransformValue;
19
+ } catch (e) {}
20
+ try {
21
+ createTextShadowValue =
22
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
23
+ require('react-native-web/dist/exports/StyleSheet/preprocess').createTextShadowValue;
24
+ } catch (e) {}
25
+ //# sourceMappingURL=webUtils.web.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["createReactDOMStyle","createTransformValue","createTextShadowValue","require","default","e"],"sources":["webUtils.web.ts"],"sourcesContent":["'use strict';\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport let createReactDOMStyle: (style: any) => any;\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport let createTransformValue: (transform: any) => any;\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport let createTextShadowValue: (style: any) => void | string;\n\ntry {\n createReactDOMStyle =\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n require('react-native-web/dist/exports/StyleSheet/compiler/createReactDOMStyle').default;\n} catch (e) {}\n\ntry {\n // React Native Web 0.19+\n createTransformValue =\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n require('react-native-web/dist/exports/StyleSheet/preprocess').createTransformValue;\n} catch (e) {}\n\ntry {\n createTextShadowValue =\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n require('react-native-web/dist/exports/StyleSheet/preprocess').createTextShadowValue;\n} catch (e) {}\n"],"mappings":"AAAA,YAAY;;AAEZ;AACA,OAAO,IAAIA,mBAAwC;AACnD;AACA,OAAO,IAAIC,oBAA6C;AACxD;AACA,OAAO,IAAIC,qBAAoD;AAE/D,IAAI;EACFF,mBAAmB;EACjB;EACAG,OAAO,CAAC,uEAAuE,CAAC,CAACC,OAAO;AAC5F,CAAC,CAAC,OAAOC,CAAC,EAAE,CAAC;AAEb,IAAI;EACF;EACAJ,oBAAoB;EAClB;EACAE,OAAO,CAAC,qDAAqD,CAAC,CAACF,oBAAoB;AACvF,CAAC,CAAC,OAAOI,CAAC,EAAE,CAAC;AAEb,IAAI;EACFH,qBAAqB;EACnB;EACAC,OAAO,CAAC,qDAAqD,CAAC,CAACD,qBAAqB;AACxF,CAAC,CAAC,OAAOG,CAAC,EAAE,CAAC","ignoreList":[]}
@@ -114,4 +114,5 @@ export class CurvedTransition extends BaseAnimationBuilder {
114
114
  return this;
115
115
  }
116
116
  }
117
+ _defineProperty(CurvedTransition, "presetName", 'CurvedTransition');
117
118
  //# sourceMappingURL=CurvedTransition.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","r","e","Symbol","toPrimitive","call","TypeError","String","Number","BaseAnimationBuilder","Easing","withTiming","assertEasingIsWorklet","CurvedTransition","constructor","args","in","ease","out","exp","delayFunction","getDelayFunction","callback","callbackV","delay","getDelay","duration","durationV","easing","easingX","easingXV","easingY","easingYV","easingWidth","easingWidthV","easingHeight","easingHeightV","values","initialValues","originX","currentOriginX","originY","currentOriginY","width","currentWidth","height","currentHeight","animations","targetOriginX","targetOriginY","targetWidth","targetHeight","createInstance","instance","__DEV__"],"sources":["CurvedTransition.ts"],"sourcesContent":["'use strict';\nimport type {\n ILayoutAnimationBuilder,\n LayoutAnimationFunction,\n} from '../animationBuilder/commonTypes';\nimport { BaseAnimationBuilder } from '../animationBuilder';\nimport type { EasingFunction } from '../../Easing';\nimport { Easing } from '../../Easing';\nimport { withTiming } from '../../animation';\nimport { assertEasingIsWorklet } from '../../animation/util';\n\n/**\n * Layout transitions with a curved animation. You can modify the behavior by chaining methods like `.duration(500)` or `.delay(500)`.\n *\n * You pass it to the `layout` prop on [an Animated component](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/glossary#animated-component).\n *\n * @see https://docs.swmansion.com/react-native-reanimated/docs/layout-animations/layout-transitions#fading-transition\n */\nexport class CurvedTransition\n extends BaseAnimationBuilder\n implements ILayoutAnimationBuilder\n{\n easingXV: EasingFunction = Easing.in(Easing.ease);\n easingYV: EasingFunction = Easing.out(Easing.ease);\n easingWidthV: EasingFunction = Easing.in(Easing.exp);\n easingHeightV: EasingFunction = Easing.out(Easing.exp);\n\n static createInstance<T extends typeof BaseAnimationBuilder>(\n this: T\n ): InstanceType<T> {\n return new CurvedTransition() as InstanceType<T>;\n }\n\n static easingX(easing: EasingFunction): CurvedTransition {\n const instance = this.createInstance();\n return instance.easingX(easing);\n }\n\n easingX(easing: EasingFunction): CurvedTransition {\n if (__DEV__) {\n assertEasingIsWorklet(easing);\n }\n this.easingXV = easing;\n return this;\n }\n\n static easingY(easing: EasingFunction): CurvedTransition {\n const instance = this.createInstance();\n return instance.easingY(easing);\n }\n\n easingY(easing: EasingFunction): CurvedTransition {\n if (__DEV__) {\n assertEasingIsWorklet(easing);\n }\n this.easingYV = easing;\n return this;\n }\n\n static easingWidth(easing: EasingFunction): CurvedTransition {\n const instance = this.createInstance();\n return instance.easingWidth(easing);\n }\n\n easingWidth(easing: EasingFunction): CurvedTransition {\n if (__DEV__) {\n assertEasingIsWorklet(easing);\n }\n this.easingWidthV = easing;\n return this;\n }\n\n static easingHeight(easing: EasingFunction): CurvedTransition {\n const instance = this.createInstance();\n return instance.easingHeight(easing);\n }\n\n easingHeight(easing: EasingFunction): CurvedTransition {\n if (__DEV__) {\n assertEasingIsWorklet(easing);\n }\n this.easingHeightV = easing;\n return this;\n }\n\n build = (): LayoutAnimationFunction => {\n const delayFunction = this.getDelayFunction();\n const callback = this.callbackV;\n const delay = this.getDelay();\n const duration = this.durationV ?? 300;\n const easing = {\n easingX: this.easingXV,\n easingY: this.easingYV,\n easingWidth: this.easingWidthV,\n easingHeight: this.easingHeightV,\n };\n\n return (values) => {\n 'worklet';\n\n return {\n initialValues: {\n originX: values.currentOriginX,\n originY: values.currentOriginY,\n width: values.currentWidth,\n height: values.currentHeight,\n },\n animations: {\n originX: delayFunction(\n delay,\n withTiming(values.targetOriginX, {\n duration,\n easing: easing.easingX,\n })\n ),\n originY: delayFunction(\n delay,\n withTiming(values.targetOriginY, {\n duration,\n easing: easing.easingY,\n })\n ),\n width: delayFunction(\n delay,\n withTiming(values.targetWidth, {\n duration,\n easing: easing.easingWidth,\n })\n ),\n height: delayFunction(\n delay,\n withTiming(values.targetHeight, {\n duration,\n easing: easing.easingHeight,\n })\n ),\n },\n callback,\n };\n };\n };\n}\n"],"mappings":"AAAA,YAAY;;AAAC,SAAAA,gBAAAC,GAAA,EAAAC,GAAA,EAAAC,KAAA,IAAAD,GAAA,GAAAE,cAAA,CAAAF,GAAA,OAAAA,GAAA,IAAAD,GAAA,IAAAI,MAAA,CAAAC,cAAA,CAAAL,GAAA,EAAAC,GAAA,IAAAC,KAAA,EAAAA,KAAA,EAAAI,UAAA,QAAAC,YAAA,QAAAC,QAAA,oBAAAR,GAAA,CAAAC,GAAA,IAAAC,KAAA,WAAAF,GAAA;AAAA,SAAAG,eAAAM,CAAA,QAAAC,CAAA,GAAAC,YAAA,CAAAF,CAAA,uCAAAC,CAAA,GAAAA,CAAA,GAAAA,CAAA;AAAA,SAAAC,aAAAF,CAAA,EAAAG,CAAA,2BAAAH,CAAA,KAAAA,CAAA,SAAAA,CAAA,MAAAI,CAAA,GAAAJ,CAAA,CAAAK,MAAA,CAAAC,WAAA,kBAAAF,CAAA,QAAAH,CAAA,GAAAG,CAAA,CAAAG,IAAA,CAAAP,CAAA,EAAAG,CAAA,uCAAAF,CAAA,SAA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,IAAI,CAACD,cAAc,CAAC,CAAC;IACtC,OAAOC,QAAQ,CAACtB,OAAO,CAACH,MAAM,CAAC;EACjC;EAEAG,OAAOA,CAACH,MAAsB,EAAoB;IAChD,IAAI0B,OAAO,EAAE;MACX1C,qBAAqB,CAACgB,MAAM,CAAC;IAC/B;IACA,IAAI,CAACI,QAAQ,GAAGJ,MAAM;IACtB,OAAO,IAAI;EACb;EAEA,OAAOK,WAAWA,CAACL,MAAsB,EAAoB;IAC3D,MAAMyB,QAAQ,GAAG,IAAI,CAACD,cAAc,CAAC,CAAC;IACtC,OAAOC,QAAQ,CAACpB,WAAW,CAACL,MAAM,CAAC;EACrC;EAEAK,WAAWA,CAACL,MAAsB,EAAoB;IACpD,IAAI0B,OAAO,EAAE;MACX1C,qBAAqB,CAACgB,MAAM,CAAC;IAC/B;IACA,IAAI,CAACM,YAAY,GAAGN,MAAM;IAC1B,OAAO,IAAI;EACb;EAEA,OAAOO,YAAYA,CAACP,MAAsB,EAAoB;IAC5D,MAAMyB,QAAQ,GAAG,IAAI,CAACD,cAAc,CAAC,CAAC;IACtC,OAAOC,QAAQ,CAAClB,YAAY,CAACP,MAAM,CAAC;EACtC;EAEAO,YAAYA,CAACP,MAAsB,EAAoB;IACrD,IAAI0B,OAAO,EAAE;MACX1C,qBAAqB,CAACgB,MAAM,CAAC;IAC/B;IACA,IAAI,CAACQ,aAAa,GAAGR,MAAM;IAC3B,OAAO,IAAI;EACb;AA0DF","ignoreList":[]}
1
+ {"version":3,"names":["_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","r","e","Symbol","toPrimitive","call","TypeError","String","Number","BaseAnimationBuilder","Easing","withTiming","assertEasingIsWorklet","CurvedTransition","constructor","args","in","ease","out","exp","delayFunction","getDelayFunction","callback","callbackV","delay","getDelay","duration","durationV","easing","easingX","easingXV","easingY","easingYV","easingWidth","easingWidthV","easingHeight","easingHeightV","values","initialValues","originX","currentOriginX","originY","currentOriginY","width","currentWidth","height","currentHeight","animations","targetOriginX","targetOriginY","targetWidth","targetHeight","createInstance","instance","__DEV__"],"sources":["CurvedTransition.ts"],"sourcesContent":["'use strict';\nimport type {\n ILayoutAnimationBuilder,\n LayoutAnimationFunction,\n} from '../animationBuilder/commonTypes';\nimport { BaseAnimationBuilder } from '../animationBuilder';\nimport type { EasingFunction } from '../../Easing';\nimport { Easing } from '../../Easing';\nimport { withTiming } from '../../animation';\nimport { assertEasingIsWorklet } from '../../animation/util';\n\n/**\n * Layout transitions with a curved animation. You can modify the behavior by chaining methods like `.duration(500)` or `.delay(500)`.\n *\n * You pass it to the `layout` prop on [an Animated component](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/glossary#animated-component).\n *\n * @see https://docs.swmansion.com/react-native-reanimated/docs/layout-animations/layout-transitions#fading-transition\n */\nexport class CurvedTransition\n extends BaseAnimationBuilder\n implements ILayoutAnimationBuilder\n{\n static presetName = 'CurvedTransition';\n\n easingXV: EasingFunction = Easing.in(Easing.ease);\n easingYV: EasingFunction = Easing.out(Easing.ease);\n easingWidthV: EasingFunction = Easing.in(Easing.exp);\n easingHeightV: EasingFunction = Easing.out(Easing.exp);\n\n static createInstance<T extends typeof BaseAnimationBuilder>(\n this: T\n ): InstanceType<T> {\n return new CurvedTransition() as InstanceType<T>;\n }\n\n static easingX(easing: EasingFunction): CurvedTransition {\n const instance = this.createInstance();\n return instance.easingX(easing);\n }\n\n easingX(easing: EasingFunction): CurvedTransition {\n if (__DEV__) {\n assertEasingIsWorklet(easing);\n }\n this.easingXV = easing;\n return this;\n }\n\n static easingY(easing: EasingFunction): CurvedTransition {\n const instance = this.createInstance();\n return instance.easingY(easing);\n }\n\n easingY(easing: EasingFunction): CurvedTransition {\n if (__DEV__) {\n assertEasingIsWorklet(easing);\n }\n this.easingYV = easing;\n return this;\n }\n\n static easingWidth(easing: EasingFunction): CurvedTransition {\n const instance = this.createInstance();\n return instance.easingWidth(easing);\n }\n\n easingWidth(easing: EasingFunction): CurvedTransition {\n if (__DEV__) {\n assertEasingIsWorklet(easing);\n }\n this.easingWidthV = easing;\n return this;\n }\n\n static easingHeight(easing: EasingFunction): CurvedTransition {\n const instance = this.createInstance();\n return instance.easingHeight(easing);\n }\n\n easingHeight(easing: EasingFunction): CurvedTransition {\n if (__DEV__) {\n assertEasingIsWorklet(easing);\n }\n this.easingHeightV = easing;\n return this;\n }\n\n build = (): LayoutAnimationFunction => {\n const delayFunction = this.getDelayFunction();\n const callback = this.callbackV;\n const delay = this.getDelay();\n const duration = this.durationV ?? 300;\n const easing = {\n easingX: this.easingXV,\n easingY: this.easingYV,\n easingWidth: this.easingWidthV,\n easingHeight: this.easingHeightV,\n };\n\n return (values) => {\n 'worklet';\n\n return {\n initialValues: {\n originX: values.currentOriginX,\n originY: values.currentOriginY,\n width: values.currentWidth,\n height: values.currentHeight,\n },\n animations: {\n originX: delayFunction(\n delay,\n withTiming(values.targetOriginX, {\n duration,\n easing: easing.easingX,\n })\n ),\n originY: delayFunction(\n delay,\n withTiming(values.targetOriginY, {\n duration,\n easing: easing.easingY,\n })\n ),\n width: delayFunction(\n delay,\n withTiming(values.targetWidth, {\n duration,\n easing: easing.easingWidth,\n })\n ),\n height: delayFunction(\n delay,\n withTiming(values.targetHeight, {\n duration,\n easing: easing.easingHeight,\n })\n ),\n },\n callback,\n };\n };\n };\n}\n"],"mappings":"AAAA,YAAY;;AAAC,SAAAA,gBAAAC,GAAA,EAAAC,GAAA,EAAAC,KAAA,IAAAD,GAAA,GAAAE,cAAA,CAAAF,GAAA,OAAAA,GAAA,IAAAD,GAAA,IAAAI,MAAA,CAAAC,cAAA,CAAAL,GAAA,EAAAC,GAAA,IAAAC,KAAA,EAAAA,KAAA,EAAAI,UAAA,QAAAC,YAAA,QAAAC,QAAA,oBAAAR,GAAA,CAAAC,GAAA,IAAAC,KAAA,WAAAF,GAAA;AAAA,SAAAG,eAAAM,CAAA,QAAAC,CAAA,GAAAC,YAAA,CAAAF,CAAA,uCAAA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@@ -172,6 +172,7 @@ export class EntryExitTransition extends BaseAnimationBuilder {
172
172
  * @returns A custom layout transition. You pass it to the `layout` prop on [an Animated component](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/glossary#animated-component).
173
173
  * @see https://docs.swmansion.com/react-native-reanimated/docs/layout-animations/layout-transitions#combine-transition
174
174
  */
175
+ _defineProperty(EntryExitTransition, "presetName", 'EntryExitTransition');
175
176
  export function combineTransition(exiting, entering) {
176
177
  return EntryExitTransition.entering(entering).exiting(exiting);
177
178
  }
@@ -1 +1 @@
1
- {"version":3,"names":["_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","r","e","Symbol","toPrimitive","call","TypeError","String","Number","BaseAnimationBuilder","withSequence","withTiming","FadeIn","FadeOut","EntryExitTransition","constructor","args","delayFunction","getDelayFunction","callback","callbackV","delay","getDelay","enteringAnimation","enteringV","build","exitingAnimation","exitingV","exitingDuration","getDuration","values","enteringValues","exitingValues","animations","transform","prop","keys","Array","isArray","forEach","index","transformProp","push","initialValues","duration","sequence","undefined","includes","mergedTransform","concat","map","objectKeys","length","console","error","current","originX","currentOriginX","originY","currentOriginY","width","currentWidth","height","currentHeight","targetOriginX","targetOriginY","targetWidth","targetHeight","createInstance","entering","animation","instance","exiting","combineTransition"],"sources":["EntryExitTransition.ts"],"sourcesContent":["'use strict';\nimport type {\n ILayoutAnimationBuilder,\n LayoutAnimationsValues,\n LayoutAnimationFunction,\n StylePropsWithArrayTransform,\n} from '../animationBuilder/commonTypes';\nimport { BaseAnimationBuilder } from '../animationBuilder';\nimport { withSequence, withTiming } from '../../animation';\nimport { FadeIn, FadeOut } from '../defaultAnimations/Fade';\nimport type { AnimatableValue, AnimationObject } from '../../commonTypes';\nimport type { TransformArrayItem } from '../../helperTypes';\n\nexport class EntryExitTransition\n extends BaseAnimationBuilder\n implements ILayoutAnimationBuilder\n{\n enteringV: BaseAnimationBuilder | typeof BaseAnimationBuilder = FadeIn;\n\n exitingV: BaseAnimationBuilder | typeof BaseAnimationBuilder = FadeOut;\n\n static createInstance<T extends typeof BaseAnimationBuilder>(\n this: T\n ): InstanceType<T> {\n return new EntryExitTransition() as InstanceType<T>;\n }\n\n static entering(\n animation: BaseAnimationBuilder | typeof BaseAnimationBuilder\n ): EntryExitTransition {\n const instance = this.createInstance();\n return instance.entering(animation);\n }\n\n entering(\n animation: BaseAnimationBuilder | typeof BaseAnimationBuilder\n ): EntryExitTransition {\n this.enteringV = animation;\n return this;\n }\n\n static exiting(\n animation: BaseAnimationBuilder | typeof BaseAnimationBuilder\n ): EntryExitTransition {\n const instance = this.createInstance();\n return instance.exiting(animation);\n }\n\n exiting(\n animation: BaseAnimationBuilder | typeof BaseAnimationBuilder\n ): EntryExitTransition {\n this.exitingV = animation;\n return this;\n }\n\n build = (): LayoutAnimationFunction => {\n const delayFunction = this.getDelayFunction();\n const callback = this.callbackV;\n const delay = this.getDelay();\n // @ts-ignore Calling `.build()` both static and instance methods works fine here, but `this` types are incompatible. They are not used though, so it's fine.\n const enteringAnimation = this.enteringV.build();\n // @ts-ignore Calling `.build()` both static and instance methods works fine here, but `this` types are incompatible. They are not used though, so it's fine.\n const exitingAnimation = this.exitingV.build();\n const exitingDuration = this.exitingV.getDuration();\n\n return (values) => {\n 'worklet';\n const enteringValues = enteringAnimation(values);\n const exitingValues = exitingAnimation(values);\n const animations: StylePropsWithArrayTransform = {\n transform: [],\n };\n\n for (const prop of Object.keys(exitingValues.animations)) {\n if (prop === 'transform') {\n if (!Array.isArray(exitingValues.animations.transform)) {\n continue;\n }\n exitingValues.animations.transform.forEach((value, index) => {\n for (const transformProp of Object.keys(value)) {\n animations.transform!.push({\n [transformProp]: delayFunction(\n delay,\n withSequence(\n value[transformProp as keyof TransformArrayItem],\n withTiming(\n exitingValues.initialValues.transform\n ? // TODO TYPESCRIPT\n // @ts-ignore This line of code fails tragically\n // in newer versions of React Native, where they have\n // narrowed down the type of `transform` even further.\n // Since this piece of code improperly typed anyway\n // (e.g. it assumes types from RN Animated here) I'd rather\n // fix it in the future when types for animations\n // are properly defined.\n exitingValues.initialValues.transform[index][\n transformProp\n ]\n : 0,\n { duration: 0 }\n )\n )\n ),\n } as TransformArrayItem);\n }\n });\n } else {\n const sequence =\n enteringValues.animations[prop] !== undefined\n ? [\n exitingValues.animations[prop],\n withTiming(enteringValues.initialValues[prop], {\n duration: 0,\n }),\n enteringValues.animations[prop],\n ]\n : [\n exitingValues.animations[prop],\n withTiming(\n Object.keys(values).includes(prop)\n ? values[prop as keyof LayoutAnimationsValues]\n : exitingValues.initialValues[prop],\n { duration: 0 }\n ),\n ];\n\n animations[prop] = delayFunction(delay, withSequence(...sequence));\n }\n }\n for (const prop of Object.keys(enteringValues.animations)) {\n if (prop === 'transform') {\n if (!Array.isArray(enteringValues.animations.transform)) {\n continue;\n }\n enteringValues.animations.transform.forEach((value, index) => {\n for (const transformProp of Object.keys(value)) {\n animations.transform!.push({\n [transformProp]: delayFunction(\n delay + exitingDuration,\n withSequence(\n withTiming(\n enteringValues.initialValues.transform\n ? ((\n enteringValues.initialValues\n .transform as TransformArrayItem[]\n )[index][\n transformProp as keyof TransformArrayItem\n ] as AnimatableValue)\n : 0,\n { duration: exitingDuration }\n ),\n value[\n transformProp as keyof TransformArrayItem\n ] as AnimatableValue\n )\n ),\n } as TransformArrayItem);\n }\n });\n } else if (animations[prop] !== undefined) {\n // it was already added in the previous loop\n continue;\n } else {\n animations[prop] = delayFunction(\n delay,\n withSequence(\n withTiming(enteringValues.initialValues[prop], { duration: 0 }),\n enteringValues.animations[prop]\n )\n );\n }\n }\n\n const mergedTransform = (\n Array.isArray(exitingValues.initialValues.transform)\n ? exitingValues.initialValues.transform\n : []\n ).concat(\n (Array.isArray(enteringValues.animations.transform)\n ? enteringValues.animations.transform\n : []\n ).map((value) => {\n const objectKeys = Object.keys(value);\n if (objectKeys?.length < 1) {\n console.error(\n `[Reanimated]: \\${value} is not a valid Transform object`\n );\n return value;\n }\n\n const transformProp = objectKeys[0];\n const current =\n // TODO TYPESCRIPT\n // @ts-ignore Read similar comment above.\n (value[transformProp] as AnimationObject).current;\n if (typeof current === 'string') {\n if (current.includes('deg')) {\n return {\n [transformProp]: '0deg',\n } as unknown as TransformArrayItem;\n } else {\n return {\n [transformProp]: '0',\n } as unknown as TransformArrayItem;\n }\n } else if (transformProp.includes('translate')) {\n return { [transformProp]: 0 } as unknown as TransformArrayItem;\n } else {\n return { [transformProp]: 1 } as unknown as TransformArrayItem;\n }\n })\n );\n\n return {\n initialValues: {\n ...exitingValues.initialValues,\n originX: values.currentOriginX,\n originY: values.currentOriginY,\n width: values.currentWidth,\n height: values.currentHeight,\n transform: mergedTransform,\n },\n animations: {\n originX: delayFunction(\n delay + exitingDuration,\n withTiming(values.targetOriginX, { duration: exitingDuration })\n ),\n originY: delayFunction(\n delay + exitingDuration,\n withTiming(values.targetOriginY, { duration: exitingDuration })\n ),\n width: delayFunction(\n delay + exitingDuration,\n withTiming(values.targetWidth, { duration: exitingDuration })\n ),\n height: delayFunction(\n delay + exitingDuration,\n withTiming(values.targetHeight, { duration: exitingDuration })\n ),\n ...animations,\n },\n callback,\n };\n };\n };\n}\n\n/**\n * Lets you combine two layout animations into a layout transition. You can modify the behavior by chaining methods like `.delay(500)`.\n *\n * @param exiting - Layout animation used when components are removed from layout (eg. `FadeOut`).\n * @param entering - Layout animation used when components are added to layout (eg. `FadeIn`).\n * @returns A custom layout transition. You pass it to the `layout` prop on [an Animated component](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/glossary#animated-component).\n * @see https://docs.swmansion.com/react-native-reanimated/docs/layout-animations/layout-transitions#combine-transition\n */\nexport function combineTransition(\n exiting: BaseAnimationBuilder | typeof BaseAnimationBuilder,\n entering: BaseAnimationBuilder | typeof BaseAnimationBuilder\n): EntryExitTransition {\n return EntryExitTransition.entering(entering).exiting(exiting);\n}\n"],"mappings":"AAAA,YAAY;;AAAC,SAAAA,gBAAAC,GAAA,EAAAC,GAAA,EAAA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GAAGK;UACL,CAAC;UACDd;QACF,CAAC;MACH,CAAC;IACH,CAAC;EAAA;EA/ND,OAAOiD,cAAcA,CAAA,EAEF;IACjB,OAAO,IAAItD,mBAAmB,CAAC,CAAC;EAClC;EAEA,OAAOuD,QAAQA,CACbC,SAA6D,EACxC;IACrB,MAAMC,QAAQ,GAAG,IAAI,CAACH,cAAc,CAAC,CAAC;IACtC,OAAOG,QAAQ,CAACF,QAAQ,CAACC,SAAS,CAAC;EACrC;EAEAD,QAAQA,CACNC,SAA6D,EACxC;IACrB,IAAI,CAAC9C,SAAS,GAAG8C,SAAS;IAC1B,OAAO,IAAI;EACb;EAEA,OAAOE,OAAOA,CACZF,SAA6D,EACxC;IACrB,MAAMC,QAAQ,GAAG,IAAI,CAACH,cAAc,CAAC,CAAC;IACtC,OAAOG,QAAQ,CAACC,OAAO,CAACF,SAAS,CAAC;EACpC;EAEAE,OAAOA,CACLF,SAA6D,EACxC;IACrB,IAAI,CAAC3C,QAAQ,GAAG2C,SAAS;IACzB,OAAO,IAAI;EACb;AAgMF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASG,iBAAiBA,CAC/BD,OAA2D,EAC3DH,QAA4D,EACvC;EACrB,OAAOvD,mBAAmB,CAACuD,QAAQ,CAACA,QAAQ,CAAC,CAACG,OAAO,CAACA,OAAO,CAAC;AAChE","ignoreList":[]}
1
+ {"version":3,"names":["_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","r","e","Symbol","toPrimitive","call","TypeError","String","Number","BaseAnimationBuilder","withSequence","withTiming","FadeIn","FadeOut","EntryExitTransition","constructor","args","delayFunction","getDelayFunction","callback","callbackV","delay","getDelay","enteringAnimation","enteringV","build","exitingAnimation","exitingV","exitingDuration","getDuration","values","enteringValues","exitingValues","animations","transform","prop","keys","Array","isArray","forEach","index","transformProp","push","initialValues","duration","sequence","undefined","includes","mergedTransform","concat","map","objectKeys","length","console","error","current","originX","currentOriginX","originY","currentOriginY","width","currentWidth","height","currentHeight","targetOriginX","targetOriginY","targetWidth","targetHeight","createInstance","entering","animation","instance","exiting","combineTransition"],"sources":["EntryExitTransition.ts"],"sourcesContent":["'use strict';\nimport type {\n ILayoutAnimationBuilder,\n LayoutAnimationsValues,\n LayoutAnimationFunction,\n StylePropsWithArrayTransform,\n} from '../animationBuilder/commonTypes';\nimport { BaseAnimationBuilder } from '../animationBuilder';\nimport { withSequence, withTiming } from '../../animation';\nimport { FadeIn, FadeOut } from '../defaultAnimations/Fade';\nimport type { AnimatableValue, AnimationObject } from '../../commonTypes';\nimport type { TransformArrayItem } from '../../helperTypes';\n\nexport class EntryExitTransition\n extends BaseAnimationBuilder\n implements ILayoutAnimationBuilder\n{\n static presetName = 'EntryExitTransition';\n\n enteringV: BaseAnimationBuilder | typeof BaseAnimationBuilder = FadeIn;\n\n exitingV: BaseAnimationBuilder | typeof BaseAnimationBuilder = FadeOut;\n\n static createInstance<T extends typeof BaseAnimationBuilder>(\n this: T\n ): InstanceType<T> {\n return new EntryExitTransition() as InstanceType<T>;\n }\n\n static entering(\n animation: BaseAnimationBuilder | typeof BaseAnimationBuilder\n ): EntryExitTransition {\n const instance = this.createInstance();\n return instance.entering(animation);\n }\n\n entering(\n animation: BaseAnimationBuilder | typeof BaseAnimationBuilder\n ): EntryExitTransition {\n this.enteringV = animation;\n return this;\n }\n\n static exiting(\n animation: BaseAnimationBuilder | typeof BaseAnimationBuilder\n ): EntryExitTransition {\n const instance = this.createInstance();\n return instance.exiting(animation);\n }\n\n exiting(\n animation: BaseAnimationBuilder | typeof BaseAnimationBuilder\n ): EntryExitTransition {\n this.exitingV = animation;\n return this;\n }\n\n build = (): LayoutAnimationFunction => {\n const delayFunction = this.getDelayFunction();\n const callback = this.callbackV;\n const delay = this.getDelay();\n // @ts-ignore Calling `.build()` both static and instance methods works fine here, but `this` types are incompatible. They are not used though, so it's fine.\n const enteringAnimation = this.enteringV.build();\n // @ts-ignore Calling `.build()` both static and instance methods works fine here, but `this` types are incompatible. They are not used though, so it's fine.\n const exitingAnimation = this.exitingV.build();\n const exitingDuration = this.exitingV.getDuration();\n\n return (values) => {\n 'worklet';\n const enteringValues = enteringAnimation(values);\n const exitingValues = exitingAnimation(values);\n const animations: StylePropsWithArrayTransform = {\n transform: [],\n };\n\n for (const prop of Object.keys(exitingValues.animations)) {\n if (prop === 'transform') {\n if (!Array.isArray(exitingValues.animations.transform)) {\n continue;\n }\n exitingValues.animations.transform.forEach((value, index) => {\n for (const transformProp of Object.keys(value)) {\n animations.transform!.push({\n [transformProp]: delayFunction(\n delay,\n withSequence(\n value[transformProp as keyof TransformArrayItem],\n withTiming(\n exitingValues.initialValues.transform\n ? // TODO TYPESCRIPT\n // @ts-ignore This line of code fails tragically\n // in newer versions of React Native, where they have\n // narrowed down the type of `transform` even further.\n // Since this piece of code improperly typed anyway\n // (e.g. it assumes types from RN Animated here) I'd rather\n // fix it in the future when types for animations\n // are properly defined.\n exitingValues.initialValues.transform[index][\n transformProp\n ]\n : 0,\n { duration: 0 }\n )\n )\n ),\n } as TransformArrayItem);\n }\n });\n } else {\n const sequence =\n enteringValues.animations[prop] !== undefined\n ? [\n exitingValues.animations[prop],\n withTiming(enteringValues.initialValues[prop], {\n duration: 0,\n }),\n enteringValues.animations[prop],\n ]\n : [\n exitingValues.animations[prop],\n withTiming(\n Object.keys(values).includes(prop)\n ? values[prop as keyof LayoutAnimationsValues]\n : exitingValues.initialValues[prop],\n { duration: 0 }\n ),\n ];\n\n animations[prop] = delayFunction(delay, withSequence(...sequence));\n }\n }\n for (const prop of Object.keys(enteringValues.animations)) {\n if (prop === 'transform') {\n if (!Array.isArray(enteringValues.animations.transform)) {\n continue;\n }\n enteringValues.animations.transform.forEach((value, index) => {\n for (const transformProp of Object.keys(value)) {\n animations.transform!.push({\n [transformProp]: delayFunction(\n delay + exitingDuration,\n withSequence(\n withTiming(\n enteringValues.initialValues.transform\n ? ((\n enteringValues.initialValues\n .transform as TransformArrayItem[]\n )[index][\n transformProp as keyof TransformArrayItem\n ] as AnimatableValue)\n : 0,\n { duration: exitingDuration }\n ),\n value[\n transformProp as keyof TransformArrayItem\n ] as AnimatableValue\n )\n ),\n } as TransformArrayItem);\n }\n });\n } else if (animations[prop] !== undefined) {\n // it was already added in the previous loop\n continue;\n } else {\n animations[prop] = delayFunction(\n delay,\n withSequence(\n withTiming(enteringValues.initialValues[prop], { duration: 0 }),\n enteringValues.animations[prop]\n )\n );\n }\n }\n\n const mergedTransform = (\n Array.isArray(exitingValues.initialValues.transform)\n ? exitingValues.initialValues.transform\n : []\n ).concat(\n (Array.isArray(enteringValues.animations.transform)\n ? enteringValues.animations.transform\n : []\n ).map((value) => {\n const objectKeys = Object.keys(value);\n if (objectKeys?.length < 1) {\n console.error(\n `[Reanimated]: \\${value} is not a valid Transform object`\n );\n return value;\n }\n\n const transformProp = objectKeys[0];\n const current =\n // TODO TYPESCRIPT\n // @ts-ignore Read similar comment above.\n (value[transformProp] as AnimationObject).current;\n if (typeof current === 'string') {\n if (current.includes('deg')) {\n return {\n [transformProp]: '0deg',\n } as unknown as TransformArrayItem;\n } else {\n return {\n [transformProp]: '0',\n } as unknown as TransformArrayItem;\n }\n } else if (transformProp.includes('translate')) {\n return { [transformProp]: 0 } as unknown as TransformArrayItem;\n } else {\n return { [transformProp]: 1 } as unknown as TransformArrayItem;\n }\n })\n );\n\n return {\n initialValues: {\n ...exitingValues.initialValues,\n originX: values.currentOriginX,\n originY: values.currentOriginY,\n width: values.currentWidth,\n height: values.currentHeight,\n transform: mergedTransform,\n },\n animations: {\n originX: delayFunction(\n delay + exitingDuration,\n withTiming(values.targetOriginX, { duration: exitingDuration })\n ),\n originY: delayFunction(\n delay + exitingDuration,\n withTiming(values.targetOriginY, { duration: exitingDuration })\n ),\n width: delayFunction(\n delay + exitingDuration,\n withTiming(values.targetWidth, { duration: exitingDuration })\n ),\n height: delayFunction(\n delay + exitingDuration,\n withTiming(values.targetHeight, { duration: exitingDuration })\n ),\n ...animations,\n },\n callback,\n };\n };\n };\n}\n\n/**\n * Lets you combine two layout animations into a layout transition. You can modify the behavior by chaining methods like `.delay(500)`.\n *\n * @param exiting - Layout animation used when components are removed from layout (eg. `FadeOut`).\n * @param entering - Layout animation used when components are added to layout (eg. `FadeIn`).\n * @returns A custom layout transition. You pass it to the `layout` prop on [an Animated component](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/glossary#animated-component).\n * @see https://docs.swmansion.com/react-native-reanimated/docs/layout-animations/layout-transitions#combine-transition\n */\nexport function combineTransition(\n exiting: BaseAnimationBuilder | typeof BaseAnimationBuilder,\n entering: BaseAnimationBuilder | typeof BaseAnimationBuilder\n): EntryExitTransition {\n return EntryExitTransition.entering(entering).exiting(exiting);\n}\n"],"mappings":"AAAA,YAAY;;AAAC,SAAAA,gBAAAC,GAAA,EAAAC,GAAA,EAAAC,KAAA,IAAAD,GAAA,GAAAE,cAAA,CAAAF,GAAA,OAAAA,GAAA,IAAAD,GAAA,IAAAI,MAAA,CAAAC,cAAA,CAAAL,GAAA,EAAAC,GAAA,IAAAC,KAAA,EAAAA,KAAA,EAAAI,UAAA,QAAAC,YAAA,QAAAC,QAAA,oBAAAR,GAAA,CAAAC,GAAA,IAAAC,KAAA,WAAAF,GAAA;AAAA,SAAAG,eAAAM,CAAA,QAAAC,CAAA,GAAAC,YAAA,CAAAF,CAAA,uCAAAC,CAAA,GAAAA,CAAA,GAAAA,CAAA;AAAA,SAAAC,aAAAF,CAAA,EAAAG,CAAA,2BAAAH,CAAA,KAAAA,CAAA,SAAAA,CAAA,MAAAI,CAAA,GAAAJ,CAAA,CAAAK,MAAA,CAAAC,WAAA,kBAAAF,CAAA,QAAAH,CAAA,GAAAG,CAAA,CAAAG,IAAA,CAAAP,CAAA,EAAAG,CAAA,uCAAAF,CAAA,SAAAA,CAAA,YAAAO,SAAA,yEAAAL,CAAA,GAAAM,MAAA,GAAAC,MAAA,EAAAV,CAAA;AAOb,SAASW,oBAAo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AACA;AACA;AACA;AAPAlF,eAAA,CA5Oa0B,mBAAmB,gBAIV,qBAAqB;AAgP3C,OAAO,SAAS2D,iBAAiBA,CAC/BD,OAA2D,EAC3DH,QAA4D,EACvC;EACrB,OAAOvD,mBAAmB,CAACuD,QAAQ,CAACA,QAAQ,CAAC,CAACG,OAAO,CAACA,OAAO,CAAC;AAChE","ignoreList":[]}
@@ -3,7 +3,7 @@
3
3
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
4
4
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
5
5
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
6
- import { withSequence, withTiming } from '../../animation';
6
+ import { withDelay, withSequence, withTiming } from '../../animation';
7
7
  import { BaseAnimationBuilder } from '../animationBuilder';
8
8
 
9
9
  /**
@@ -20,7 +20,7 @@ export class FadingTransition extends BaseAnimationBuilder {
20
20
  const delayFunction = this.getDelayFunction();
21
21
  const callback = this.callbackV;
22
22
  const delay = this.getDelay();
23
- const duration = this.durationV ?? 500;
23
+ const duration = (this.durationV ?? 500) / 2;
24
24
  return values => {
25
25
  'worklet';
26
26
 
@@ -38,17 +38,17 @@ export class FadingTransition extends BaseAnimationBuilder {
38
38
  }), withTiming(1, {
39
39
  duration
40
40
  }))),
41
- originX: delayFunction(delay + duration, withTiming(values.targetOriginX, {
42
- duration: 50
41
+ originX: withDelay(delay + duration, withTiming(values.targetOriginX, {
42
+ duration: 0
43
43
  })),
44
- originY: delayFunction(delay + duration, withTiming(values.targetOriginY, {
45
- duration: 50
44
+ originY: withDelay(delay + duration, withTiming(values.targetOriginY, {
45
+ duration: 0
46
46
  })),
47
- width: delayFunction(delay + duration, withTiming(values.targetWidth, {
48
- duration: 50
47
+ width: withDelay(delay + duration, withTiming(values.targetWidth, {
48
+ duration: 0
49
49
  })),
50
- height: delayFunction(delay + duration, withTiming(values.targetHeight, {
51
- duration: 50
50
+ height: withDelay(delay + duration, withTiming(values.targetHeight, {
51
+ duration: 0
52
52
  }))
53
53
  },
54
54
  callback
@@ -60,4 +60,5 @@ export class FadingTransition extends BaseAnimationBuilder {
60
60
  return new FadingTransition();
61
61
  }
62
62
  }
63
+ _defineProperty(FadingTransition, "presetName", 'FadingTransition');
63
64
  //# sourceMappingURL=FadingTransition.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","r","e","Symbol","toPrimitive","call","TypeError","String","Number","withSequence","withTiming","BaseAnimationBuilder","FadingTransition","constructor","args","delayFunction","getDelayFunction","callback","callbackV","delay","getDelay","duration","durationV","values","initialValues","opacity","originX","currentOriginX","originY","currentOriginY","width","currentWidth","height","currentHeight","animations","targetOriginX","targetOriginY","targetWidth","targetHeight","createInstance"],"sources":["FadingTransition.ts"],"sourcesContent":["'use strict';\nimport { withSequence, withTiming } from '../../animation';\nimport type {\n ILayoutAnimationBuilder,\n LayoutAnimationFunction,\n} from '../animationBuilder/commonTypes';\nimport { BaseAnimationBuilder } from '../animationBuilder';\n\n/**\n * Fades out components from one position and shows them in another. You can modify the behavior by chaining methods like `.duration(500)` or `.delay(500)`.\n *\n * You pass it to the `layout` prop on [an Animated component](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/glossary#animated-component).\n *\n * @see https://docs.swmansion.com/react-native-reanimated/docs/layout-animations/layout-transitions#fading-transition\n */\nexport class FadingTransition\n extends BaseAnimationBuilder\n implements ILayoutAnimationBuilder\n{\n static createInstance<T extends typeof BaseAnimationBuilder>(\n this: T\n ): InstanceType<T> {\n return new FadingTransition() as InstanceType<T>;\n }\n\n build = (): LayoutAnimationFunction => {\n const delayFunction = this.getDelayFunction();\n const callback = this.callbackV;\n const delay = this.getDelay();\n const duration = this.durationV ?? 500;\n\n return (values) => {\n 'worklet';\n return {\n initialValues: {\n opacity: 1,\n originX: values.currentOriginX,\n originY: values.currentOriginY,\n width: values.currentWidth,\n height: values.currentHeight,\n },\n animations: {\n opacity: delayFunction(\n delay,\n withSequence(\n withTiming(0, { duration }),\n withTiming(1, { duration })\n )\n ),\n originX: delayFunction(\n delay + duration,\n withTiming(values.targetOriginX, { duration: 50 })\n ),\n originY: delayFunction(\n delay + duration,\n withTiming(values.targetOriginY, { duration: 50 })\n ),\n width: delayFunction(\n delay + duration,\n withTiming(values.targetWidth, { duration: 50 })\n ),\n height: delayFunction(\n delay + duration,\n withTiming(values.targetHeight, { duration: 50 })\n ),\n },\n callback,\n };\n };\n };\n}\n"],"mappings":"AAAA,YAAY;;AAAC,SAAAA,gBAAAC,GAAA,EAAAC,GAAA,EAAAC,KAAA,IAAAD,GAAA,GAAAE,cAAA,CAAAF,GAAA,OAAAA,GAAA,IAAAD,GAAA,IAAAI,MAAA,CAAAC,cAAA,CAAAL,GAAA,EAAAC,GAAA,IAAAC,KAAA,EAAAA,KAAA,EAAAI,UAAA,QAAAC,YAAA,QAAAC,QAAA,oBAAAR,GAAA,CAAAC,GAAA,IAAAC,KAAA,WAAAF,GAAA;AAAA,SAAAG,eAAAM,CAAA,QAAAC,CAAA,GAAAC,YAAA,CAAAF,CAAA,uCAAAC,CAAA,GAAAA,CAAA,GAAAA,CAAA;AAAA,SAAAC,aAAAF,CAAA,EAAAG,CAAA,2BAAAH,CAAA,KAAAA,CAAA,SAAAA,CAAA,MAAAI,CAAA,GAAAJ,CAAA,CAAAK,MAAA,CAAAC,WAAA,kBAAAF,CAAA,QAAAH,CAAA,GAAAG,CAAA,CAAAG,IAAA,CAAAP,CAAA,EAAAG,CAAA,uCAAAF,CAAA,SAAAA,CAAA,YAAAO,SAAA,yEAAAL,CAAA,GAA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ACDS,KAAK,EAAEf,aAAa,CAClBI,KAAK,GAAGE,QAAQ,EAChBX,UAAU,CAACa,MAAM,CAACc,WAAW,EAAE;cAAEhB,QAAQ,EAAE;YAAG,CAAC,CACjD,CAAC;YACDW,MAAM,EAAEjB,aAAa,CACnBI,KAAK,GAAGE,QAAQ,EAChBX,UAAU,CAACa,MAAM,CAACe,YAAY,EAAE;cAAEjB,QAAQ,EAAE;YAAG,CAAC,CAClD;UACF,CAAC;UACDJ;QACF,CAAC;MACH,CAAC;IACH,CAAC;EAAA;EAlDD,OAAOsB,cAAcA,CAAA,EAEF;IACjB,OAAO,IAAI3B,gBAAgB,CAAC,CAAC;EAC/B;AA+CF","ignoreList":[]}
1
+ {"version":3,"names":["_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","r","e","Symbol","toPrimitive","call","TypeError","String","Number","withDelay","withSequence","withTiming","BaseAnimationBuilder","FadingTransition","constructor","args","delayFunction","getDelayFunction","callback","callbackV","delay","getDelay","duration","durationV","values","initialValues","opacity","originX","currentOriginX","originY","currentOriginY","width","currentWidth","height","currentHeight","animations","targetOriginX","targetOriginY","targetWidth","targetHeight","createInstance"],"sources":["FadingTransition.ts"],"sourcesContent":["'use strict';\nimport { withDelay, withSequence, withTiming } from '../../animation';\nimport type {\n ILayoutAnimationBuilder,\n LayoutAnimationFunction,\n} from '../animationBuilder/commonTypes';\nimport { BaseAnimationBuilder } from '../animationBuilder';\n\n/**\n * Fades out components from one position and shows them in another. You can modify the behavior by chaining methods like `.duration(500)` or `.delay(500)`.\n *\n * You pass it to the `layout` prop on [an Animated component](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/glossary#animated-component).\n *\n * @see https://docs.swmansion.com/react-native-reanimated/docs/layout-animations/layout-transitions#fading-transition\n */\nexport class FadingTransition\n extends BaseAnimationBuilder\n implements ILayoutAnimationBuilder\n{\n static presetName = 'FadingTransition';\n\n static createInstance<T extends typeof BaseAnimationBuilder>(\n this: T\n ): InstanceType<T> {\n return new FadingTransition() as InstanceType<T>;\n }\n\n build = (): LayoutAnimationFunction => {\n const delayFunction = this.getDelayFunction();\n const callback = this.callbackV;\n const delay = this.getDelay();\n const duration = (this.durationV ?? 500) / 2;\n\n return (values) => {\n 'worklet';\n return {\n initialValues: {\n opacity: 1,\n originX: values.currentOriginX,\n originY: values.currentOriginY,\n width: values.currentWidth,\n height: values.currentHeight,\n },\n animations: {\n opacity: delayFunction(\n delay,\n withSequence(\n withTiming(0, { duration }),\n withTiming(1, { duration })\n )\n ),\n originX: withDelay(\n delay + duration,\n withTiming(values.targetOriginX, { duration: 0 })\n ),\n originY: withDelay(\n delay + duration,\n withTiming(values.targetOriginY, { duration: 0 })\n ),\n width: withDelay(\n delay + duration,\n withTiming(values.targetWidth, { duration: 0 })\n ),\n height: withDelay(\n delay + duration,\n withTiming(values.targetHeight, { duration: 0 })\n ),\n },\n callback,\n };\n };\n };\n}\n"],"mappings":"AAAA,YAAY;;AAAC,SAAAA,gBAAAC,GAAA,EAAAC,GAAA,EAAAC,KAAA,IAAAD,GAAA,GAAAE,cAAA,CAAAF,GAAA,OAAAA,GAAA,IAAAD,GAAA,IAAAI,MAAA,CAAAC,cAAA,CAAAL,GAAA,EAAAC,GAAA,IAAAC,KAAA,EAAAA,KAAA,EAAAI,UAAA,QAAAC,YAAA,QAAAC,QAAA,oBAAAR,GAAA,CAAAC,GAAA,IAAAC,KAAA,WAAAF,GAAA;AAAA,SAAAG,eAAAM,CAAA,QAAAC,CAAA,GAAAC,YAAA,CAAAF,CAAA,uCAAAC,CAAA,GAAAA,CAAA,GAAAA,CAAA;AAAA,SAAAC,aAAAF,CAAA,EAAAG,CAAA,2BAAAH,CAAA,KAAAA,CAAA,SAAAA,CAAA,MAAAI,CAAA,GAAAJ,CAAA,CAAAK,MAAA,CAAAC,WAAA,kBAAAF,CAAA,QAAAH,CAAA,GAAAG,CAAA,CAAAG,IAAA,CAAAP,CAAA,EAAAG,CAAA,uC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AChBX,UAAU,CAACa,MAAM,CAACa,aAAa,EAAE;cAAEf,QAAQ,EAAE;YAAE,CAAC,CAClD,CAAC;YACDS,KAAK,EAAEtB,SAAS,CACdW,KAAK,GAAGE,QAAQ,EAChBX,UAAU,CAACa,MAAM,CAACc,WAAW,EAAE;cAAEhB,QAAQ,EAAE;YAAE,CAAC,CAChD,CAAC;YACDW,MAAM,EAAExB,SAAS,CACfW,KAAK,GAAGE,QAAQ,EAChBX,UAAU,CAACa,MAAM,CAACe,YAAY,EAAE;cAAEjB,QAAQ,EAAE;YAAE,CAAC,CACjD;UACF,CAAC;UACDJ;QACF,CAAC;MACH,CAAC;IACH,CAAC;EAAA;EAlDD,OAAOsB,cAAcA,CAAA,EAEF;IACjB,OAAO,IAAI3B,gBAAgB,CAAC,CAAC;EAC/B;AA+CF;AAACzB,eAAA,CAzDYyB,gBAAgB,gBAIP,kBAAkB","ignoreList":[]}
@@ -58,4 +58,5 @@ export class JumpingTransition extends BaseAnimationBuilder {
58
58
  return new JumpingTransition();
59
59
  }
60
60
  }
61
+ _defineProperty(JumpingTransition, "presetName", 'JumpingTransition');
61
62
  //# sourceMappingURL=JumpingTransition.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","r","e","Symbol","toPrimitive","call","TypeError","String","Number","withSequence","withTiming","Easing","BaseAnimationBuilder","JumpingTransition","constructor","args","delayFunction","getDelayFunction","callback","callbackV","delay","getDelay","duration","durationV","config","values","d","Math","max","abs","targetOriginX","currentOriginX","targetOriginY","currentOriginY","initialValues","originX","originY","width","currentWidth","height","currentHeight","animations","min","easing","out","exp","bounce","targetWidth","targetHeight","createInstance"],"sources":["JumpingTransition.ts"],"sourcesContent":["'use strict';\nimport type {\n ILayoutAnimationBuilder,\n LayoutAnimationFunction,\n} from '../animationBuilder/commonTypes';\nimport { withSequence, withTiming } from '../../animation';\nimport { Easing } from '../../Easing';\nimport { BaseAnimationBuilder } from '../animationBuilder';\n\n/**\n * Layout jumps - quite literally - from one position to another. You can modify the behavior by chaining methods like `.springify()` or `.duration(500)`.\n *\n * You pass it to the `layout` prop on [an Animated component](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/glossary#animated-component).\n *\n * @see https://docs.swmansion.com/react-native-reanimated/docs/layout-animations/layout-transitions#jumping-transition\n */\nexport class JumpingTransition\n extends BaseAnimationBuilder\n implements ILayoutAnimationBuilder\n{\n static createInstance<T extends typeof BaseAnimationBuilder>(\n this: T\n ): InstanceType<T> {\n return new JumpingTransition() as InstanceType<T>;\n }\n\n build = (): LayoutAnimationFunction => {\n const delayFunction = this.getDelayFunction();\n const callback = this.callbackV;\n const delay = this.getDelay();\n const duration = (this.durationV ?? 300) / 2;\n const config = { duration: duration * 2 };\n\n return (values) => {\n 'worklet';\n const d = Math.max(\n Math.abs(values.targetOriginX - values.currentOriginX),\n Math.abs(values.targetOriginY - values.currentOriginY)\n );\n return {\n initialValues: {\n originX: values.currentOriginX,\n originY: values.currentOriginY,\n width: values.currentWidth,\n height: values.currentHeight,\n },\n animations: {\n originX: delayFunction(\n delay,\n withTiming(values.targetOriginX, config)\n ),\n originY: delayFunction(\n delay,\n withSequence(\n withTiming(\n Math.min(values.targetOriginY, values.currentOriginY) - d,\n {\n duration,\n easing: Easing.out(Easing.exp),\n }\n ),\n withTiming(values.targetOriginY, {\n ...config,\n duration,\n easing: Easing.bounce,\n })\n )\n ),\n width: delayFunction(delay, withTiming(values.targetWidth, config)),\n height: delayFunction(delay, withTiming(values.targetHeight, config)),\n },\n callback,\n };\n };\n };\n}\n"],"mappings":"AAAA,YAAY;;AAAC,SAAAA,gBAAAC,GAAA,EAAAC,GAAA,EAAAC,KAAA,IAAAD,GAAA,GAAAE,cAAA,CAAAF,GAAA,OAAAA,GAAA,IAAAD,GAAA,IAAAI,MAAA,CAAAC,cAAA,CAAAL,GAAA,EAAAC,GAAA,IAAAC,KAAA,EAAAA,KAAA,E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toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","r","e","Symbol","toPrimitive","call","TypeError","String","Number","withSequence","withTiming","Easing","BaseAnimationBuilder","JumpingTransition","constructor","args","delayFunction","getDelayFunction","callback","callbackV","delay","getDelay","duration","durationV","config","values","d","Math","max","abs","targetOriginX","currentOriginX","targetOriginY","currentOriginY","initialValues","originX","originY","width","currentWidth","height","currentHeight","animations","min","easing","out","exp","bounce","targetWidth","targetHeight","createInstance"],"sources":["JumpingTransition.ts"],"sourcesContent":["'use strict';\nimport type {\n ILayoutAnimationBuilder,\n LayoutAnimationFunction,\n} from '../animationBuilder/commonTypes';\nimport { withSequence, withTiming } from '../../animation';\nimport { Easing } from '../../Easing';\nimport { BaseAnimationBuilder } from '../animationBuilder';\n\n/**\n * Layout jumps - quite literally - from one position to another. You can modify the behavior by chaining methods like `.springify()` or `.duration(500)`.\n *\n * You pass it to the `layout` prop on [an Animated component](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/glossary#animated-component).\n *\n * @see https://docs.swmansion.com/react-native-reanimated/docs/layout-animations/layout-transitions#jumping-transition\n */\nexport class JumpingTransition\n extends BaseAnimationBuilder\n implements ILayoutAnimationBuilder\n{\n static presetName = 'JumpingTransition';\n\n static createInstance<T extends typeof BaseAnimationBuilder>(\n this: T\n ): InstanceType<T> {\n return new JumpingTransition() as InstanceType<T>;\n }\n\n build = (): LayoutAnimationFunction => {\n const delayFunction = this.getDelayFunction();\n const callback = this.callbackV;\n const delay = this.getDelay();\n const duration = (this.durationV ?? 300) / 2;\n const config = { duration: duration * 2 };\n\n return (values) => {\n 'worklet';\n const d = Math.max(\n Math.abs(values.targetOriginX - values.currentOriginX),\n Math.abs(values.targetOriginY - values.currentOriginY)\n );\n return {\n initialValues: {\n originX: values.currentOriginX,\n originY: values.currentOriginY,\n width: values.currentWidth,\n height: values.currentHeight,\n },\n animations: {\n originX: delayFunction(\n delay,\n withTiming(values.targetOriginX, config)\n ),\n originY: delayFunction(\n delay,\n withSequence(\n withTiming(\n Math.min(values.targetOriginY, values.currentOriginY) - d,\n {\n duration,\n easing: Easing.out(Easing.exp),\n }\n ),\n withTiming(values.targetOriginY, {\n ...config,\n duration,\n easing: Easing.bounce,\n })\n )\n ),\n width: delayFunction(delay, withTiming(values.targetWidth, config)),\n height: delayFunction(delay, withTiming(values.targetHeight, config)),\n },\n callback,\n };\n };\n };\n}\n"],"mappings":"AAAA,YAAY;;AAAC,SAAAA,gBAAAC,GAAA,EAAAC,GAAA,EAAAC,KAAA,IAAAD,GAAA,GAAAE,cAAA,CAAAF,GAAA,OAAAA,GAAA,IAAAD,GAAA,IAAAI,MAAA,CAAAC,cAAA,CAAAL,GAAA,EAAAC,GAAA,IAAAC,KAAA,EAAAA,KAAA,EAAAI,UAAA,QAAAC,YAAA,QAAAC,QAAA,oBAAAR,GAAA,CAAAC,GAAA,IAAAC,KAAA,WAAAF,GAAA;AAAA,SAAAG,eAAAM,CAAA,QAAAC,CAAA,GAAAC,YAAA,CAAAF,CAAA,uCAAAC,CAAA,GAAAA,CAAA,GAAAA,CAAA;AAAA,SAAAC,aAAAF,CAAA,EAAAG,CAAA,2BAAAH,CAAA,KAAAA,CAAA,SAAAA,CAAA,MAAAI,CAAA,GAAAJ,CAAA,CAAAK,MAAA,CAAAC,WAAA,kBAAAF,CAAA,QAAAH,CAAA,GAAAG,CAAA,CAAAG,IAAA,CAAAP,CAAA,EAAAG,CAAA,uCAAAF,CAAA,SAAAA,CAAA,YAAAO,SAAA,yEAAAL,CAAA,GAAAM,MAAA,GAAAC,MAAA,EAAAV,CAAA;AAKb,SAASW,YAAY,EAAEC,UAAU,QAAQ,iBAAiB;AAC1D,SAASC,MAAM,QAAQ,cAAc;AACrC,SAASC,oBAAoB,QAAQ,qBAAqB;;AAE1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,iBAAiB,SACpBD,oBAAoB,CAE9B;EAAAE,YAAA,GAAAC,IAAA;IAAA,SAAAA,IA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R,MAAM;cACTF,QAAQ;cACRqB,MAAM,EAAEhC,MAAM,CAACmC;YACjB,CAAC,CACH,CACF,CAAC;YACDT,KAAK,EAAErB,aAAa,CAACI,KAAK,EAAEV,UAAU,CAACe,MAAM,CAACsB,WAAW,EAAEvB,MAAM,CAAC,CAAC;YACnEe,MAAM,EAAEvB,aAAa,CAACI,KAAK,EAAEV,UAAU,CAACe,MAAM,CAACuB,YAAY,EAAExB,MAAM,CAAC;UACtE,CAAC;UACDN;QACF,CAAC;MACH,CAAC;IACH,CAAC;EAAA;EAtDD,OAAO+B,cAAcA,CAAA,EAEF;IACjB,OAAO,IAAIpC,iBAAiB,CAAC,CAAC;EAChC;AAmDF;AAACzB,eAAA,CA7DYyB,iBAAiB,gBAIR,mBAAmB","ignoreList":[]}
@@ -48,5 +48,6 @@ export class LinearTransition extends ComplexAnimationBuilder {
48
48
  /**
49
49
  * @deprecated Please use {@link LinearTransition} instead.
50
50
  */
51
+ _defineProperty(LinearTransition, "presetName", 'LinearTransition');
51
52
  export const Layout = LinearTransition;
52
53
  //# sourceMappingURL=LinearTransition.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","r","e","Symbol","toPrimitive","call","TypeError","String","Number","ComplexAnimationBuilder","LinearTransition","constructor","args","delayFunction","getDelayFunction","animation","config","getAnimationAndConfig","callback","callbackV","delay","getDelay","values","initialValues","originX","currentOriginX","originY","currentOriginY","width","currentWidth","height","currentHeight","animations","targetOriginX","targetOriginY","targetWidth","targetHeight","createInstance","Layout"],"sources":["LinearTransition.ts"],"sourcesContent":["'use strict';\nimport type { BaseAnimationBuilder } from '../animationBuilder';\nimport { ComplexAnimationBuilder } from '../animationBuilder';\nimport type {\n ILayoutAnimationBuilder,\n LayoutAnimationFunction,\n} from '../animationBuilder/commonTypes';\n\n/**\n * Linearly transforms the layout from one position to another. You can modify the behavior by chaining methods like `.springify()` or `.duration(500)`.\n *\n * You pass it to the `layout` prop on [an Animated component](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/glossary#animated-component).\n *\n * @see https://docs.swmansion.com/react-native-reanimated/docs/layout-animations/layout-transitions#linear-transition\n */\nexport class LinearTransition\n extends ComplexAnimationBuilder\n implements ILayoutAnimationBuilder\n{\n static createInstance<T extends typeof BaseAnimationBuilder>(\n this: T\n ): InstanceType<T> {\n return new LinearTransition() as InstanceType<T>;\n }\n\n build = (): LayoutAnimationFunction => {\n const delayFunction = this.getDelayFunction();\n const [animation, config] = this.getAnimationAndConfig();\n const callback = this.callbackV;\n const delay = this.getDelay();\n\n return (values) => {\n 'worklet';\n return {\n initialValues: {\n originX: values.currentOriginX,\n originY: values.currentOriginY,\n width: values.currentWidth,\n height: values.currentHeight,\n },\n animations: {\n originX: delayFunction(\n delay,\n animation(values.targetOriginX, config)\n ),\n originY: delayFunction(\n delay,\n animation(values.targetOriginY, config)\n ),\n width: delayFunction(delay, animation(values.targetWidth, config)),\n height: delayFunction(delay, animation(values.targetHeight, config)),\n },\n callback,\n };\n };\n };\n}\n\n/**\n * @deprecated Please use {@link LinearTransition} instead.\n */\nexport const Layout = LinearTransition;\n"],"mappings":"AAAA,YAAY;;AAAC,SAAAA,gBAAAC,GAAA,EAAAC,GAAA,EAAAC,KAAA,IAAAD,GAAA,GAAAE,cAAA,CAAAF,GAAA,OAAAA,GAAA,IAAAD,GAAA,IAAAI,MAAA,CAAAC,cAAA,CAAAL,GAAA,EAAAC,GAAA,IAAAC,KAAA,EAAAA,KAAA,EAAAI,UAAA,QAAAC,YAAA,QAAAC,QAAA,oBAAAR,GAAA,CAAAC,GAAA,IAAAC,KAAA,WAAAF,GAAA;AAAA,SAAAG,eAAAM,CAAA,QAAAC,CAAA,GAAAC,YAAA,CAAAF,CAAA,uCAAAC,CAAA,GAAAA,CAAA,GAAAA,CAAA;AAAA,SAAAC,aAAAF,CAAA,EAAAG,CAAA,2BAAAH,CAAA,KAAAA,CAAA,S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;YAClEc,MAAM,EAAEjB,aAAa,CAACO,KAAK,EAAEL,SAAS,CAACO,MAAM,CAACc,YAAY,EAAEpB,MAAM,CAAC;UACrE,CAAC;UACDE;QACF,CAAC;MACH,CAAC;IACH,CAAC;EAAA;EApCD,OAAOmB,cAAcA,CAAA,EAEF;IACjB,OAAO,IAAI3B,gBAAgB,CAAC,CAAC;EAC/B;AAiCF;;AAEA;AACA;AACA;AACA,OAAO,MAAM4B,MAAM,GAAG5B,gBAAgB","ignoreList":[]}
1
+ {"version":3,"names":["_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","r","e","Symbol","toPrimitive","call","TypeError","String","Number","ComplexAnimationBuilder","LinearTransition","constructor","args","delayFunction","getDelayFunction","animation","config","getAnimationAndConfig","callback","callbackV","delay","getDelay","values","initialValues","originX","currentOriginX","originY","currentOriginY","width","currentWidth","height","currentHeight","animations","targetOriginX","targetOriginY","targetWidth","targetHeight","createInstance","Layout"],"sources":["LinearTransition.ts"],"sourcesContent":["'use strict';\nimport type { BaseAnimationBuilder } from '../animationBuilder';\nimport { ComplexAnimationBuilder } from '../animationBuilder';\nimport type {\n ILayoutAnimationBuilder,\n LayoutAnimationFunction,\n} from '../animationBuilder/commonTypes';\n\n/**\n * Linearly transforms the layout from one position to another. You can modify the behavior by chaining methods like `.springify()` or `.duration(500)`.\n *\n * You pass it to the `layout` prop on [an Animated component](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/glossary#animated-component).\n *\n * @see https://docs.swmansion.com/react-native-reanimated/docs/layout-animations/layout-transitions#linear-transition\n */\nexport class LinearTransition\n extends ComplexAnimationBuilder\n implements ILayoutAnimationBuilder\n{\n static presetName = 'LinearTransition';\n\n static createInstance<T extends typeof BaseAnimationBuilder>(\n this: T\n ): InstanceType<T> {\n return new LinearTransition() as InstanceType<T>;\n }\n\n build = (): LayoutAnimationFunction => {\n const delayFunction = this.getDelayFunction();\n const [animation, config] = this.getAnimationAndConfig();\n const callback = this.callbackV;\n const delay = this.getDelay();\n\n return (values) => {\n 'worklet';\n return {\n initialValues: {\n originX: values.currentOriginX,\n originY: values.currentOriginY,\n width: values.currentWidth,\n height: values.currentHeight,\n },\n animations: {\n originX: delayFunction(\n delay,\n animation(values.targetOriginX, config)\n ),\n originY: delayFunction(\n delay,\n animation(values.targetOriginY, config)\n ),\n width: delayFunction(delay, animation(values.targetWidth, config)),\n height: delayFunction(delay, animation(values.targetHeight, config)),\n },\n callback,\n };\n };\n };\n}\n\n/**\n * @deprecated Please use {@link LinearTransition} instead.\n */\nexport const Layout = LinearTransition;\n"],"mappings":"AAAA,YAAY;;AAAC,SAAAA,gBAAAC,GAAA,EAAAC,GAAA,EAAAC,KAAA,IAAAD,GAAA,GAAAE,cAAA,CAAAF,GAAA,OAAAA,GAAA,IAAAD,GAAA,IAAAI,MAAA,CAAAC,cAAA,CAAAL,GAAA,EAAAC,GAAA,IAAAC,KAAA,EAAAA,KAAA,EAAAI,UAAA,QAAAC,YAAA,QAAAC,QAAA,oBAAAR,GAAA,CAAAC,GAAA,IAAAC,KAAA,WAAAF,GAAA;AAAA,SAAAG,eAAAM,CAAA,QAAAC,CAAA,GAAAC,YAAA,CAAAF,CAAA,uCAAAC,CAAA,GAAAA,CAAA,GAAAA,CAAA;AAAA,SAAAC,aAAAF,CAAA,EAAAG,CAAA,2BAAAH,CAAA,KAAAA,CAAA,SAAAA,CAAA,MAAAI,CAAA,GAAAJ,CAAA,CAAAK,MAAA,CAAAC,WAAA,kBAAAF,CAAA,QAAAH,CAAA,GAAAG,CAAA,CAAAG,IAAA,CAAAP,CAAA,EAAAG,CAAA,uCAAAF,CAAA,SAAAA,CAAA,YAAAO,SAAA,yEAAAL,CAAA,GAAAM,MAAA,GAAAC,MAAA,EAAAV,CAAA;AAEb,SAASW,uBAAuB,QAAQ,qBAAqB;AAM7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,gBAAgB,SACnBD,uBAAuB,CAE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[]}
@@ -59,4 +59,5 @@ export class SequencedTransition extends BaseAnimationBuilder {
59
59
  return this;
60
60
  }
61
61
  }
62
+ _defineProperty(SequencedTransition, "presetName", 'SequencedTransition');
62
63
  //# sourceMappingURL=SequencedTransition.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","r","e","Symbol","toPrimitive","call","TypeError","String","Number","withSequence","withTiming","BaseAnimationBuilder","SequencedTransition","constructor","args","delayFunction","getDelayFunction","callback","callbackV","delay","getDelay","sequenceDuration","durationV","config","duration","reverse","reversed","values","initialValues","originX","currentOriginX","originY","currentOriginY","width","currentWidth","height","currentHeight","animations","targetOriginX","targetOriginY","targetWidth","targetHeight","createInstance","instance"],"sources":["SequencedTransition.ts"],"sourcesContent":["'use strict';\nimport { withSequence, withTiming } from '../../animation';\nimport type {\n ILayoutAnimationBuilder,\n LayoutAnimationFunction,\n} from '../animationBuilder/commonTypes';\nimport { BaseAnimationBuilder } from '../animationBuilder';\n\n/**\n * Transforms layout starting from the X-axis and width first, followed by the Y-axis and height. You can modify the behavior by chaining methods like `.springify()` or `.duration(500)`.\n *\n * You pass it to the `layout` prop on [an Animated component](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/glossary#animated-component).\n *\n * @see https://docs.swmansion.com/react-native-reanimated/docs/layout-animations/layout-transitions#sequenced-transition\n */\nexport class SequencedTransition\n extends BaseAnimationBuilder\n implements ILayoutAnimationBuilder\n{\n reversed = false;\n\n static createInstance<T extends typeof BaseAnimationBuilder>(\n this: T\n ): InstanceType<T> {\n return new SequencedTransition() as InstanceType<T>;\n }\n\n static reverse(): SequencedTransition {\n const instance = SequencedTransition.createInstance();\n return instance.reverse();\n }\n\n reverse(): SequencedTransition {\n this.reversed = !this.reversed;\n return this;\n }\n\n build = (): LayoutAnimationFunction => {\n const delayFunction = this.getDelayFunction();\n const callback = this.callbackV;\n const delay = this.getDelay();\n const sequenceDuration = (this.durationV ?? 500) / 2;\n const config = { duration: sequenceDuration };\n const reverse = this.reversed;\n\n return (values) => {\n 'worklet';\n return {\n initialValues: {\n originX: values.currentOriginX,\n originY: values.currentOriginY,\n width: values.currentWidth,\n height: values.currentHeight,\n },\n animations: {\n originX: delayFunction(\n delay,\n withSequence(\n withTiming(\n reverse ? values.currentOriginX : values.targetOriginX,\n config\n ),\n withTiming(values.targetOriginX, config)\n )\n ),\n originY: delayFunction(\n delay,\n withSequence(\n withTiming(\n reverse ? values.targetOriginY : values.currentOriginY,\n config\n ),\n withTiming(values.targetOriginY, config)\n )\n ),\n width: delayFunction(\n delay,\n withSequence(\n withTiming(\n reverse ? values.currentWidth : values.targetWidth,\n config\n ),\n withTiming(values.targetWidth, config)\n )\n ),\n height: delayFunction(\n delay,\n withSequence(\n withTiming(\n reverse ? values.targetHeight : values.currentHeight,\n config\n ),\n withTiming(values.targetHeight, config)\n )\n ),\n },\n callback,\n };\n };\n };\n}\n"],"mappings":"AAAA,YAAY;;AAAC,SAAAA,gBAAAC,GAAA,EAAAC,GAAA,EAAAC,KAAA,IAAAD,GAAA,GAAAE,cAAA,CAAAF,GAAA,OAAAA,GAAA,IAAAD,GAAA,IAAAI,MAAA,CAAAC,cAAA,CAAAL,GAAA,EAAAC,GAAA,IAAAC,KAAA,EAAAA,KAAA,EAAAI,UAAA,QAAAC,YAAA,QAAAC,QAAA,oBAAAR,GAAA,CAAAC,GAAA,IAAAC,KAAA,WAAAF,GAAA;AAAA,SAAAG,eAAAM,CAAA,QAAAC,CAAA,GAAAC,YAAA,CAAAF,CAAA,uCAAAC,CAAA,GAAAA,CAAA,GAAAA,CAAA;AAAA,SAAAC,aAAAF,CAAA,EAAAG,CAAA,2BAAAH,CAAA,KAAAA,CAAA,SAAAA,CAAA,MAAAI,CAAA,GAAAJ,CAAA,CAAAK,MAAA,CAAAC,WAAA,kBAAAF,CAAA,QAAAH,CAAA,GAAAG,CAAA,CAAAG,IAAA,CAAAP,CAAA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YAAY,CACVC,UAAU,CACRe,OAAO,GAAGE,MAAM,CAACY,aAAa,GAAGZ,MAAM,CAACK,cAAc,EACtDT,MACF,CAAC,EACDb,UAAU,CAACiB,MAAM,CAACY,aAAa,EAAEhB,MAAM,CACzC,CACF,CAAC;YACDU,KAAK,EAAElB,aAAa,CAClBI,KAAK,EACLV,YAAY,CACVC,UAAU,CACRe,OAAO,GAAGE,MAAM,CAACO,YAAY,GAAGP,MAAM,CAACa,WAAW,EAClDjB,MACF,CAAC,EACDb,UAAU,CAACiB,MAAM,CAACa,WAAW,EAAEjB,MAAM,CACvC,CACF,CAAC;YACDY,MAAM,EAAEpB,aAAa,CACnBI,KAAK,EACLV,YAAY,CACVC,UAAU,CACRe,OAAO,GAAGE,MAAM,CAACc,YAAY,GAAGd,MAAM,CAACS,aAAa,EACpDb,MACF,CAAC,EACDb,UAAU,CAACiB,MAAM,CAACc,YAAY,EAAElB,MAAM,CACxC,CACF;UACF,CAAC;UACDN;QACF,CAAC;MACH,CAAC;IACH,CAAC;EAAA;EA9ED,OAAOyB,cAAcA,CAAA,EAEF;IACjB,OAAO,IAAI9B,mBAAmB,CAAC,CAAC;EAClC;EAEA,OAAOa,OAAOA,CAAA,EAAwB;IACpC,MAAMkB,QAAQ,GAAG/B,mBAAmB,CAAC8B,cAAc,CAAC,CAAC;IACrD,OAAOC,QAAQ,CAAClB,OAAO,CAAC,CAAC;EAC3B;EAEAA,OAAOA,CAAA,EAAwB;IAC7B,IAAI,CAACC,QAAQ,GAAG,CAAC,IAAI,CAACA,QAAQ;IAC9B,OAAO,IAAI;EACb;AAiEF","ignoreList":[]}
1
+ {"version":3,"names":["_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","r","e","Symbol","toPrimitive","call","TypeError","String","Number","withSequence","withTiming","BaseAnimationBuilder","SequencedTransition","constructor","args","delayFunction","getDelayFunction","callback","callbackV","delay","getDelay","sequenceDuration","durationV","config","duration","reverse","reversed","values","initialValues","originX","currentOriginX","originY","currentOriginY","width","currentWidth","height","currentHeight","animations","targetOriginX","targetOriginY","targetWidth","targetHeight","createInstance","instance"],"sources":["SequencedTransition.ts"],"sourcesContent":["'use strict';\nimport { withSequence, withTiming } from '../../animation';\nimport type {\n ILayoutAnimationBuilder,\n LayoutAnimationFunction,\n} from '../animationBuilder/commonTypes';\nimport { BaseAnimationBuilder } from '../animationBuilder';\n\n/**\n * Transforms layout starting from the X-axis and width first, followed by the Y-axis and height. You can modify the behavior by chaining methods like `.springify()` or `.duration(500)`.\n *\n * You pass it to the `layout` prop on [an Animated component](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/glossary#animated-component).\n *\n * @see https://docs.swmansion.com/react-native-reanimated/docs/layout-animations/layout-transitions#sequenced-transition\n */\nexport class SequencedTransition\n extends BaseAnimationBuilder\n implements ILayoutAnimationBuilder\n{\n static presetName = 'SequencedTransition';\n\n reversed = false;\n\n static createInstance<T extends typeof BaseAnimationBuilder>(\n this: T\n ): InstanceType<T> {\n return new SequencedTransition() as InstanceType<T>;\n }\n\n static reverse(): SequencedTransition {\n const instance = SequencedTransition.createInstance();\n return instance.reverse();\n }\n\n reverse(): SequencedTransition {\n this.reversed = !this.reversed;\n return this;\n }\n\n build = (): LayoutAnimationFunction => {\n const delayFunction = this.getDelayFunction();\n const callback = this.callbackV;\n const delay = this.getDelay();\n const sequenceDuration = (this.durationV ?? 500) / 2;\n const config = { duration: sequenceDuration };\n const reverse = this.reversed;\n\n return (values) => {\n 'worklet';\n return {\n initialValues: {\n originX: values.currentOriginX,\n originY: values.currentOriginY,\n width: values.currentWidth,\n height: values.currentHeight,\n },\n animations: {\n originX: delayFunction(\n delay,\n withSequence(\n withTiming(\n reverse ? values.currentOriginX : values.targetOriginX,\n config\n ),\n withTiming(values.targetOriginX, config)\n )\n ),\n originY: delayFunction(\n delay,\n withSequence(\n withTiming(\n reverse ? values.targetOriginY : values.currentOriginY,\n config\n ),\n withTiming(values.targetOriginY, config)\n )\n ),\n width: delayFunction(\n delay,\n withSequence(\n withTiming(\n reverse ? values.currentWidth : values.targetWidth,\n config\n ),\n withTiming(values.targetWidth, config)\n )\n ),\n height: delayFunction(\n delay,\n withSequence(\n withTiming(\n reverse ? values.targetHeight : values.currentHeight,\n config\n ),\n withTiming(values.targetHeight, config)\n )\n ),\n },\n callback,\n };\n };\n };\n}\n"],"mappings":"AAAA,YAAY;;AAAC,SAAAA,gBAAAC,GAAA,EAAAC,GAAA,EAAAC,KAAA,IAAAD,GAAA,GAAAE,cAAA,CAAAF,GAAA,OAAAA,GAAA,IAAAD,GAAA,IAAAI,MAAA,CAAAC,cAAA,CAAAL,GAAA,EAAAC,GAAA,IAAAC,KAAA,EAAAA,KAAA,EAAAI,UAAA,QAAAC,YAAA,QAAAC,QAAA,oBAAAR,GAAA,CAAAC,GAAA,IAAAC,KAAA,WAAAF,GAAA;AAAA,SAAAG,eAAAM,CAAA,QAAAC,CAAA,GAAAC,YAAA,CAAAF,CAAA,uCAAAC,CAAA,GAAAA,CAAA,GAAAA,CAAA;AAAA,SAAAC,aAAAF,CAAA,EAAAG,CAAA,2BAAAH,CAAA,KAAAA,CAAA,SAAAA,CAAA,MAAAI,CAAA,GAAAJ,CAAA,CAAAK,MAAA,CAAAC,WAAA,kBAAAF,CAAA,QAAAH,CAAA,GAAAG,CAAA,CAAAG,IAAA,CAAAP,CAAA,EAAAG,CAAA,uCAAAF,CAAA,SAAAA,CAAA,YAAAO,SAAA,yEAAAL,CAAA,GAAAM,MAAA,GAAAC,MAAA,EAAAV,CAAA;AACb,SAASW,YAAY,EAAEC,UAAU,QAAQ,iBAAiB;AAK1D,SAASC,oBAAoB,QAAQ,qBAAqB;;AAE1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,mBAAmB,SACtBD,oBAAoB,CAE9B;EAAAE,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAA1B,eAAA,mBAGa,KAAK;IAAAA,eAAA,gBAkBR,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F,CAAC;YACDY,MAAM,EAAEpB,aAAa,CACnBI,KAAK,EACLV,YAAY,CACVC,UAAU,CACRe,OAAO,GAAGE,MAAM,CAACc,YAAY,GAAGd,MAAM,CAACS,aAAa,EACpDb,MACF,CAAC,EACDb,UAAU,CAACiB,MAAM,CAACc,YAAY,EAAElB,MAAM,CACxC,CACF;UACF,CAAC;UACDN;QACF,CAAC;MACH,CAAC;IACH,CAAC;EAAA;EA9ED,OAAOyB,cAAcA,CAAA,EAEF;IACjB,OAAO,IAAI9B,mBAAmB,CAAC,CAAC;EAClC;EAEA,OAAOa,OAAOA,CAAA,EAAwB;IACpC,MAAMkB,QAAQ,GAAG/B,mBAAmB,CAAC8B,cAAc,CAAC,CAAC;IACrD,OAAOC,QAAQ,CAAClB,OAAO,CAAC,CAAC;EAC3B;EAEAA,OAAOA,CAAA,EAAwB;IAC7B,IAAI,CAACC,QAAQ,GAAG,CAAC,IAAI,CAACA,QAAQ;IAC9B,OAAO,IAAI;EACb;AAiEF;AAACtC,eAAA,CAvFYwB,mBAAmB,gBAIV,qBAAqB","ignoreList":[]}
@@ -0,0 +1,14 @@
1
+ 'use strict';
2
+
3
+ // Those are the easings that can be implemented using Bezier curves.
4
+ // Others should be done as CSS animations
5
+ export const WebEasings = {
6
+ linear: [0, 0, 1, 1],
7
+ ease: [0.42, 0, 1, 1],
8
+ quad: [0.11, 0, 0.5, 0],
9
+ cubic: [0.32, 0, 0.67, 0],
10
+ sin: [0.12, 0, 0.39, 0],
11
+ circle: [0.55, 0, 1, 0.45],
12
+ exp: [0.7, 0, 0.84, 0]
13
+ };
14
+ //# sourceMappingURL=Easing.web.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["WebEasings","linear","ease","quad","cubic","sin","circle","exp"],"sources":["Easing.web.ts"],"sourcesContent":["'use strict';\n\n// Those are the easings that can be implemented using Bezier curves.\n// Others should be done as CSS animations\nexport const WebEasings = {\n linear: [0, 0, 1, 1],\n ease: [0.42, 0, 1, 1],\n quad: [0.11, 0, 0.5, 0],\n cubic: [0.32, 0, 0.67, 0],\n sin: [0.12, 0, 0.39, 0],\n circle: [0.55, 0, 1, 0.45],\n exp: [0.7, 0, 0.84, 0],\n};\n\nexport type WebEasingsNames = keyof typeof WebEasings;\n"],"mappings":"AAAA,YAAY;;AAEZ;AACA;AACA,OAAO,MAAMA,UAAU,GAAG;EACxBC,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;EACpBC,IAAI,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;EACrBC,IAAI,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC;EACvBC,KAAK,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC;EACzBC,GAAG,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC;EACvBC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC;EAC1BC,GAAG,EAAE,CAAC,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC;AACvB,CAAC","ignoreList":[]}
@@ -1,10 +1,25 @@
1
1
  'use strict';
2
2
 
3
+ import { WebEasings } from './Easing.web';
3
4
  export function convertAnimationObjectToKeyframes(animationObject) {
4
5
  let keyframe = `@keyframes ${animationObject.name} { `;
5
6
  for (const [timestamp, style] of Object.entries(animationObject.style)) {
6
- keyframe += `${timestamp}% { `;
7
+ const step = timestamp === 'from' ? 0 : timestamp === 'to' ? 100 : timestamp;
8
+ keyframe += `${step}% { `;
7
9
  for (const [property, values] of Object.entries(style)) {
10
+ if (property === 'easing') {
11
+ const easingName = values.name in WebEasings ? values.name : 'linear';
12
+ keyframe += `animation-timing-function: cubic-bezier(${WebEasings[easingName].toString()});`;
13
+ continue;
14
+ }
15
+ if (property === 'originX') {
16
+ keyframe += `left: ${values}px; `;
17
+ continue;
18
+ }
19
+ if (property === 'originY') {
20
+ keyframe += `top: ${values}px; `;
21
+ continue;
22
+ }
8
23
  if (property !== 'transform') {
9
24
  keyframe += `${property}: ${values}; `;
10
25
  continue;
@@ -1 +1 @@
1
- {"version":3,"names":["convertAnimationObjectToKeyframes","animationObject","keyframe","name","timestamp","style","Object","entries","property","values","forEach","value","transformProperty","transformPropertyValue"],"sources":["animationParser.ts"],"sourcesContent":["'use strict';\n\nexport interface ReanimatedWebTransformProperties {\n translateX?: string;\n translateY?: string;\n rotate?: string;\n rotateX?: string;\n rotateY?: string;\n scale?: number | string;\n scaleX?: number;\n scaleY?: number;\n perspective?: string;\n skew?: string;\n skewX?: string;\n}\n\ninterface AnimationStyle {\n opacity?: number;\n transform?: ReanimatedWebTransformProperties[];\n}\n\nexport interface AnimationData {\n name: string;\n style: Record<number, AnimationStyle>;\n duration: number;\n}\n\nexport interface TransitionData {\n translateX: number;\n translateY: number;\n scaleX: number;\n scaleY: number;\n reversed?: boolean;\n}\n\nexport function convertAnimationObjectToKeyframes(\n animationObject: AnimationData\n) {\n let keyframe = `@keyframes ${animationObject.name} { `;\n\n for (const [timestamp, style] of Object.entries(animationObject.style)) {\n keyframe += `${timestamp}% { `;\n\n for (const [property, values] of Object.entries(style)) {\n if (property !== 'transform') {\n keyframe += `${property}: ${values}; `;\n continue;\n }\n\n keyframe += `transform:`;\n\n values.forEach((value: ReanimatedWebTransformProperties) => {\n for (const [\n transformProperty,\n transformPropertyValue,\n ] of Object.entries(value)) {\n keyframe += ` ${transformProperty}(${transformPropertyValue})`;\n }\n });\n keyframe += `; `; // Property end\n }\n keyframe += `} `; // Timestamp end\n }\n keyframe += `} `; // Keyframe end\n\n return keyframe;\n}\n"],"mappings":"AAAA,YAAY;;AAmCZ,OAAO,SAASA,iCAAiCA,CAC/CC,eAA8B,EAC9B;EACA,IAAIC,QAAQ,GAAI,cAAaD,eAAe,CAACE,IAAK,KAAI;EAEtD,KAAK,MAAM,CAACC,SAAS,EAAEC,KAAK,CAAC,IAAIC,MAAM,CAACC,OAAO,CAACN,eAAe,CAACI,KAAK,CAAC,EAAE;IACtEH,QAAQ,IAAK,GAAEE,SAAU,MAAK;IAE9B,KAAK,MAAM,CAACI,QAAQ,EAAEC,MAAM,CAAC,IAAIH,MAAM,CAACC,OAAO,CAACF,KAAK,CAAC,EAAE;MACtD,IAAIG,QAAQ,KAAK,WAAW,EAAE;QAC5BN,QAAQ,IAAK,GAAEM,QAAS,KAAIC,MAAO,IAAG;QACtC;MACF;MAEAP,QAAQ,IAAK,YAAW;MAExBO,MAAM,CAACC,OAAO,CAAEC,KAAuC,IAAK;QAC1D,KAAK,MAAM,CACTC,iBAAiB,EACjBC,sBAAsB,CACvB,IAAIP,MAAM,CAACC,OAAO,CAACI,KAAK,CAAC,EAAE;UAC1BT,QAAQ,IAAK,IAAGU,iBAAkB,IAAGC,sBAAuB,GAAE;QAChE;MACF,CAAC,CAAC;MACFX,QAAQ,IAAK,IAAG,CAAC,CAAC;IACpB;IACAA,QAAQ,IAAK,IAAG,CAAC,CAAC;EACpB;EACAA,QAAQ,IAAK,IAAG,CAAC,CAAC;;EAElB,OAAOA,QAAQ;AACjB","ignoreList":[]}
1
+ {"version":3,"names":["WebEasings","convertAnimationObjectToKeyframes","animationObject","keyframe","name","timestamp","style","Object","entries","step","property","values","easingName","toString","forEach","value","transformProperty","transformPropertyValue"],"sources":["animationParser.ts"],"sourcesContent":["'use strict';\n\nimport { WebEasings } from './Easing.web';\nimport type { WebEasingsNames } from './Easing.web';\n\nexport interface ReanimatedWebTransformProperties {\n translateX?: string;\n translateY?: string;\n rotate?: string;\n rotateX?: string;\n rotateY?: string;\n scale?: number | string;\n scaleX?: number;\n scaleY?: number;\n perspective?: string;\n skew?: string;\n skewX?: string;\n}\n\nexport interface AnimationStyle {\n opacity?: number;\n transform?: ReanimatedWebTransformProperties[];\n}\n\nexport interface AnimationData {\n name: string;\n style: Record<number, AnimationStyle>;\n duration: number;\n}\n\nexport interface TransitionData {\n translateX: number;\n translateY: number;\n scaleX: number;\n scaleY: number;\n reversed?: boolean;\n}\n\nexport function convertAnimationObjectToKeyframes(\n animationObject: AnimationData\n) {\n let keyframe = `@keyframes ${animationObject.name} { `;\n\n for (const [timestamp, style] of Object.entries(animationObject.style)) {\n const step =\n timestamp === 'from' ? 0 : timestamp === 'to' ? 100 : timestamp;\n\n keyframe += `${step}% { `;\n\n for (const [property, values] of Object.entries(style)) {\n if (property === 'easing') {\n const easingName = (\n values.name in WebEasings ? values.name : 'linear'\n ) as WebEasingsNames;\n\n keyframe += `animation-timing-function: cubic-bezier(${WebEasings[\n easingName\n ].toString()});`;\n\n continue;\n }\n\n if (property === 'originX') {\n keyframe += `left: ${values}px; `;\n continue;\n }\n\n if (property === 'originY') {\n keyframe += `top: ${values}px; `;\n continue;\n }\n\n if (property !== 'transform') {\n keyframe += `${property}: ${values}; `;\n continue;\n }\n\n keyframe += `transform:`;\n\n values.forEach((value: ReanimatedWebTransformProperties) => {\n for (const [\n transformProperty,\n transformPropertyValue,\n ] of Object.entries(value)) {\n keyframe += ` ${transformProperty}(${transformPropertyValue})`;\n }\n });\n keyframe += `; `; // Property end\n }\n keyframe += `} `; // Timestamp end\n }\n keyframe += `} `; // Keyframe end\n\n return keyframe;\n}\n"],"mappings":"AAAA,YAAY;;AAEZ,SAASA,UAAU,QAAQ,cAAc;AAoCzC,OAAO,SAASC,iCAAiCA,CAC/CC,eAA8B,EAC9B;EACA,IAAIC,QAAQ,GAAI,cAAaD,eAAe,CAACE,IAAK,KAAI;EAEtD,KAAK,MAAM,CAACC,SAAS,EAAEC,KAAK,CAAC,IAAIC,MAAM,CAACC,OAAO,CAACN,eAAe,CAACI,KAAK,CAAC,EAAE;IACtE,MAAMG,IAAI,GACRJ,SAAS,KAAK,MAAM,GAAG,CAAC,GAAGA,SAAS,KAAK,IAAI,GAAG,GAAG,GAAGA,SAAS;IAEjEF,QAAQ,IAAK,GAAEM,IAAK,MAAK;IAEzB,KAAK,MAAM,CAACC,QAAQ,EAAEC,MAAM,CAAC,IAAIJ,MAAM,CAACC,OAAO,CAACF,KAAK,CAAC,EAAE;MACtD,IAAII,QAAQ,KAAK,QAAQ,EAAE;QACzB,MAAME,UAAU,GACdD,MAAM,CAACP,IAAI,IAAIJ,UAAU,GAAGW,MAAM,CAACP,IAAI,GAAG,QACxB;QAEpBD,QAAQ,IAAK,2CAA0CH,UAAU,CAC/DY,UAAU,CACX,CAACC,QAAQ,CAAC,CAAE,IAAG;QAEhB;MACF;MAEA,IAAIH,QAAQ,KAAK,SAAS,EAAE;QAC1BP,QAAQ,IAAK,SAAQQ,MAAO,MAAK;QACjC;MACF;MAEA,IAAID,QAAQ,KAAK,SAAS,EAAE;QAC1BP,QAAQ,IAAK,QAAOQ,MAAO,MAAK;QAChC;MACF;MAEA,IAAID,QAAQ,KAAK,WAAW,EAAE;QAC5BP,QAAQ,IAAK,GAAEO,QAAS,KAAIC,MAAO,IAAG;QACtC;MACF;MAEAR,QAAQ,IAAK,YAAW;MAExBQ,MAAM,CAACG,OAAO,CAAEC,KAAuC,IAAK;QAC1D,KAAK,MAAM,CACTC,iBAAiB,EACjBC,sBAAsB,CACvB,IAAIV,MAAM,CAACC,OAAO,CAACO,KAAK,CAAC,EAAE;UAC1BZ,QAAQ,IAAK,IAAGa,iBAAkB,IAAGC,sBAAuB,GAAE;QAChE;MACF,CAAC,CAAC;MACFd,QAAQ,IAAK,IAAG,CAAC,CAAC;IACpB;IACAA,QAAQ,IAAK,IAAG,CAAC,CAAC;EACpB;EACAA,QAAQ,IAAK,IAAG,CAAC,CAAC;;EAElB,OAAOA,QAAQ;AACjB","ignoreList":[]}
@@ -2,17 +2,19 @@
2
2
 
3
3
  import { Animations } from './config';
4
4
  import { LayoutAnimationType } from '../animationBuilder/commonTypes';
5
- import { getProcessedConfig, handleExitingAnimation, handleLayoutTransition, setElementAnimation } from './componentUtils';
5
+ import { createCustomKeyFrameAnimation } from './createAnimation';
6
+ import { getProcessedConfig, handleExitingAnimation, handleLayoutTransition, maybeModifyStyleForKeyframe, setElementAnimation } from './componentUtils';
6
7
  import { areDOMRectsEqual } from './domUtils';
8
+ import { Keyframe } from '../animationBuilder';
7
9
  import { makeElementVisible } from './componentStyle';
8
10
  function chooseConfig(animationType, props) {
9
11
  const config = animationType === LayoutAnimationType.ENTERING ? props.entering : animationType === LayoutAnimationType.EXITING ? props.exiting : animationType === LayoutAnimationType.LAYOUT ? props.layout : null;
10
12
  return config;
11
13
  }
12
- function checkUndefinedAnimationFail(initialAnimationName, isLayoutTransition) {
14
+ function checkUndefinedAnimationFail(initialAnimationName, needsCustomization) {
13
15
  // This prevents crashes if we try to set animations that are not defined.
14
- // We don't care about layout transitions since they're created dynamically
15
- if (initialAnimationName in Animations || isLayoutTransition) {
16
+ // We don't care about layout transitions or custom keyframes since they're created dynamically
17
+ if (initialAnimationName in Animations || needsCustomization) {
16
18
  return false;
17
19
  }
18
20
  console.warn("[Reanimated] Couldn't load entering/exiting animation. Current version supports only predefined animations with modifiers: duration, delay, easing, randomizeDelay, withCallback, reducedMotion.");
@@ -33,7 +35,7 @@ function maybeReportOverwrittenProperties(keyframe, styles) {
33
35
  function chooseAction(animationType, animationConfig, element, transitionData) {
34
36
  switch (animationType) {
35
37
  case LayoutAnimationType.ENTERING:
36
- setElementAnimation(element, animationConfig);
38
+ setElementAnimation(element, animationConfig, true);
37
39
  break;
38
40
  case LayoutAnimationType.LAYOUT:
39
41
  transitionData.reversed = animationConfig.reversed;
@@ -50,16 +52,31 @@ function tryGetAnimationConfig(props, animationType) {
50
52
  return null;
51
53
  }
52
54
  const isLayoutTransition = animationType === LayoutAnimationType.LAYOUT;
53
- const animationName = typeof config === 'function' ? config.presetName : config.constructor.presetName;
54
- const shouldFail = checkUndefinedAnimationFail(animationName, isLayoutTransition);
55
+ const isCustomKeyframe = config instanceof Keyframe;
56
+ let animationName;
57
+ if (isCustomKeyframe) {
58
+ animationName = createCustomKeyFrameAnimation(config.definitions);
59
+ } else if (typeof config === 'function') {
60
+ animationName = config.presetName;
61
+ } else {
62
+ animationName = config.constructor.presetName;
63
+ }
64
+ const shouldFail = checkUndefinedAnimationFail(animationName, isLayoutTransition || isCustomKeyframe);
55
65
  if (shouldFail) {
56
66
  return null;
57
67
  }
58
- const animationConfig = getProcessedConfig(animationName, animationType, config, animationName);
68
+ if (isCustomKeyframe) {
69
+ const keyframeTimestamps = Object.keys(config.definitions);
70
+ if (!(keyframeTimestamps.includes('100') || keyframeTimestamps.includes('to'))) {
71
+ console.warn(`[Reanimated] Neither '100' nor 'to' was specified in Keyframe definition. This may result in wrong final position of your component. One possible solution is to duplicate last timestamp in definition as '100' (or 'to')`);
72
+ }
73
+ }
74
+ const animationConfig = getProcessedConfig(animationName, animationType, config);
59
75
  return animationConfig;
60
76
  }
61
77
  export function startWebLayoutAnimation(props, element, animationType, transitionData) {
62
78
  const animationConfig = tryGetAnimationConfig(props, animationType);
79
+ maybeModifyStyleForKeyframe(element, props.entering);
63
80
  if ((animationConfig === null || animationConfig === void 0 ? void 0 : animationConfig.animationName) in Animations) {
64
81
  maybeReportOverwrittenProperties(Animations[animationConfig === null || animationConfig === void 0 ? void 0 : animationConfig.animationName].style, element.style);
65
82
  }