react-native-reanimated 2.12.0 → 2.14.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 (176) hide show
  1. package/Common/cpp/NativeModules/NativeReanimatedModule.cpp +1 -0
  2. package/Common/cpp/Tools/ReanimatedVersion.cpp +17 -0
  3. package/Common/cpp/Tools/ReanimatedVersion.h +11 -0
  4. package/RNReanimated.podspec +2 -1
  5. package/android/.gradle/7.5.1/checksums/checksums.lock +0 -0
  6. package/android/.gradle/7.5.1/checksums/md5-checksums.bin +0 -0
  7. package/android/.gradle/7.5.1/checksums/sha1-checksums.bin +0 -0
  8. package/android/.gradle/7.5.1/dependencies-accessors/dependencies-accessors.lock +0 -0
  9. package/android/.gradle/7.5.1/executionHistory/executionHistory.bin +0 -0
  10. package/android/.gradle/7.5.1/executionHistory/executionHistory.lock +0 -0
  11. package/android/.gradle/7.5.1/fileHashes/fileHashes.bin +0 -0
  12. package/android/.gradle/7.5.1/fileHashes/fileHashes.lock +0 -0
  13. package/android/.gradle/7.5.1/fileHashes/resourceHashesCache.bin +0 -0
  14. package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  15. package/android/.gradle/buildOutputCleanup/cache.properties +1 -1
  16. package/android/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
  17. package/android/.gradle/file-system.probe +0 -0
  18. package/android/CMakeLists.txt +192 -189
  19. package/android/build.gradle +395 -317
  20. package/android/react-native-reanimated-67-hermes.aar +0 -0
  21. package/android/react-native-reanimated-67-jsc.aar +0 -0
  22. package/android/react-native-reanimated-68-hermes.aar +0 -0
  23. package/android/react-native-reanimated-68-jsc.aar +0 -0
  24. package/android/react-native-reanimated-69-hermes.aar +0 -0
  25. package/android/react-native-reanimated-69-jsc.aar +0 -0
  26. package/android/react-native-reanimated-70-hermes.aar +0 -0
  27. package/android/react-native-reanimated-70-jsc.aar +0 -0
  28. package/android/react-native-reanimated-71-hermes.aar +0 -0
  29. package/android/react-native-reanimated-71-jsc.aar +0 -0
  30. package/android/src/main/cpp/NativeProxy.cpp +8 -0
  31. package/android/src/main/java/com/swmansion/reanimated/ReanimatedPackage.java +5 -4
  32. package/android/src/main/java/com/swmansion/reanimated/sensor/ReanimatedSensorContainer.java +1 -1
  33. package/android/src/reactNativeVersionPatch/ReanimatedUIManager/70/com/swmansion/reanimated/ReanimatedUIManagerFactory.java +16 -0
  34. package/android/src/{main/java → reactNativeVersionPatch/ReanimatedUIManager/70}/com/swmansion/reanimated/layoutReanimation/ReanimatedUIManager.java +0 -0
  35. package/android/src/reactNativeVersionPatch/ReanimatedUIManager/latest/com/swmansion/reanimated/ReanimatedUIManagerFactory.java +63 -0
  36. package/android/src/reactNativeVersionPatch/ReanimatedUIManager/latest/com/swmansion/reanimated/layoutReanimation/ReanimatedUIManager.java +271 -0
  37. package/android/src/reactNativeVersionPatch/nativeHierarchyManager/latest/com/swmansion/reanimated/layoutReanimation/ReanimatedNativeHierarchyManager.java +3 -30
  38. package/ios/REAModule.mm +11 -7
  39. package/ios/native/REAInitializer.mm +4 -0
  40. package/lib/createAnimatedComponent.js +5 -0
  41. package/lib/reanimated2/Colors.js +27 -11
  42. package/lib/reanimated2/NativeReanimated/NativeReanimated.js +4 -0
  43. package/lib/reanimated2/animation/util.js +15 -15
  44. package/lib/reanimated2/globals.d.ts +2 -0
  45. package/lib/reanimated2/interpolateColor.js +79 -20
  46. package/lib/reanimated2/jestUtils.js +14 -7
  47. package/lib/reanimated2/layoutReanimation/defaultAnimations/Bounce.js +16 -18
  48. package/lib/reanimated2/layoutReanimation/defaultAnimations/Lightspeed.js +8 -10
  49. package/lib/reanimated2/layoutReanimation/defaultAnimations/Roll.js +15 -10
  50. package/lib/reanimated2/layoutReanimation/defaultAnimations/Slide.js +8 -10
  51. package/lib/reanimated2/layoutReanimation/defaultAnimations/Zoom.js +24 -18
  52. package/lib/reanimated2/platform-specific/checkVersion.js +24 -0
  53. package/lib/reanimated2/platform-specific/checkVersion.web.js +6 -0
  54. package/lib/types/{Animated.d.ts → lib/Animated.d.ts} +0 -0
  55. package/lib/types/{ConfigHelper.d.ts → lib/ConfigHelper.d.ts} +0 -0
  56. package/lib/types/{ReanimatedEventEmitter.d.ts → lib/ReanimatedEventEmitter.d.ts} +0 -0
  57. package/lib/types/{ReanimatedModule.d.ts → lib/ReanimatedModule.d.ts} +0 -0
  58. package/lib/types/{ReanimatedModule.macos.d.ts → lib/ReanimatedModule.macos.d.ts} +0 -0
  59. package/lib/types/{ReanimatedModule.native.d.ts → lib/ReanimatedModule.native.d.ts} +0 -0
  60. package/lib/types/{ReanimatedModule.windows.d.ts → lib/ReanimatedModule.windows.d.ts} +0 -0
  61. package/lib/types/{ReanimatedModuleCompat.d.ts → lib/ReanimatedModuleCompat.d.ts} +0 -0
  62. package/lib/types/{createAnimatedComponent.d.ts → lib/createAnimatedComponent.d.ts} +0 -0
  63. package/lib/types/{index.d.ts → lib/index.d.ts} +0 -0
  64. package/lib/types/{index.web.d.ts → lib/index.web.d.ts} +0 -0
  65. package/lib/types/{reanimated2 → lib/reanimated2}/Bezier.d.ts +0 -0
  66. package/lib/types/{reanimated2 → lib/reanimated2}/Colors.d.ts +5 -3
  67. package/lib/types/{reanimated2 → lib/reanimated2}/Easing.d.ts +0 -0
  68. package/lib/types/{reanimated2 → lib/reanimated2}/NativeMethods.d.ts +0 -0
  69. package/lib/types/{reanimated2 → lib/reanimated2}/NativeReanimated/NativeReanimated.d.ts +0 -0
  70. package/lib/types/{reanimated2 → lib/reanimated2}/NativeReanimated/index.d.ts +0 -0
  71. package/lib/types/{reanimated2 → lib/reanimated2}/PlatformChecker.d.ts +0 -0
  72. package/lib/types/{reanimated2 → lib/reanimated2}/PropAdapters.d.ts +0 -0
  73. package/lib/types/{reanimated2 → lib/reanimated2}/UpdateProps.d.ts +0 -0
  74. package/lib/types/{reanimated2 → lib/reanimated2}/ViewDescriptorsSet.d.ts +0 -0
  75. package/lib/types/{reanimated2 → lib/reanimated2}/WorkletEventHandler.d.ts +0 -0
  76. package/lib/types/{reanimated2 → lib/reanimated2}/__mocks__/MutableValue.d.ts +0 -0
  77. package/lib/types/{reanimated2 → lib/reanimated2}/__mocks__/NativeReanimated.d.ts +0 -0
  78. package/lib/types/{reanimated2 → lib/reanimated2}/animation/commonTypes.d.ts +0 -0
  79. package/lib/types/{reanimated2 → lib/reanimated2}/animation/decay.d.ts +0 -0
  80. package/lib/types/{reanimated2 → lib/reanimated2}/animation/delay.d.ts +0 -0
  81. package/lib/types/{reanimated2 → lib/reanimated2}/animation/index.d.ts +0 -0
  82. package/lib/types/{reanimated2 → lib/reanimated2}/animation/repeat.d.ts +0 -0
  83. package/lib/types/{reanimated2 → lib/reanimated2}/animation/sequence.d.ts +0 -0
  84. package/lib/types/{reanimated2 → lib/reanimated2}/animation/spring.d.ts +0 -0
  85. package/lib/types/{reanimated2 → lib/reanimated2}/animation/styleAnimation.d.ts +0 -0
  86. package/lib/types/{reanimated2 → lib/reanimated2}/animation/timing.d.ts +0 -0
  87. package/lib/types/{reanimated2 → lib/reanimated2}/animation/util.d.ts +0 -0
  88. package/lib/types/{reanimated2 → lib/reanimated2}/commonTypes.d.ts +0 -0
  89. package/lib/types/{reanimated2 → lib/reanimated2}/component/FlatList.d.ts +0 -0
  90. package/lib/types/{reanimated2 → lib/reanimated2}/component/Image.d.ts +0 -0
  91. package/lib/types/{reanimated2 → lib/reanimated2}/component/ScrollView.d.ts +0 -0
  92. package/lib/types/{reanimated2 → lib/reanimated2}/component/Text.d.ts +0 -0
  93. package/lib/types/{reanimated2 → lib/reanimated2}/component/View.d.ts +0 -0
  94. package/lib/types/{reanimated2 → lib/reanimated2}/core.d.ts +0 -0
  95. package/lib/types/{reanimated2 → lib/reanimated2}/frameCallback/FrameCallbackRegistryJS.d.ts +0 -0
  96. package/lib/types/{reanimated2 → lib/reanimated2}/frameCallback/FrameCallbackRegistryUI.d.ts +0 -0
  97. package/lib/types/{reanimated2 → lib/reanimated2}/hook/Hooks.d.ts +0 -0
  98. package/lib/types/{reanimated2 → lib/reanimated2}/hook/commonTypes.d.ts +0 -0
  99. package/lib/types/{reanimated2 → lib/reanimated2}/hook/index.d.ts +0 -0
  100. package/lib/types/{reanimated2 → lib/reanimated2}/hook/useAnimatedGestureHandler.d.ts +0 -0
  101. package/lib/types/{reanimated2 → lib/reanimated2}/hook/useAnimatedKeyboard.d.ts +0 -0
  102. package/lib/types/{reanimated2 → lib/reanimated2}/hook/useAnimatedReaction.d.ts +0 -0
  103. package/lib/types/{reanimated2 → lib/reanimated2}/hook/useAnimatedRef.d.ts +0 -0
  104. package/lib/types/{reanimated2 → lib/reanimated2}/hook/useAnimatedScrollHandler.d.ts +0 -0
  105. package/lib/types/{reanimated2 → lib/reanimated2}/hook/useAnimatedSensor.d.ts +0 -0
  106. package/lib/types/{reanimated2 → lib/reanimated2}/hook/useAnimatedStyle.d.ts +0 -0
  107. package/lib/types/{reanimated2 → lib/reanimated2}/hook/useDerivedValue.d.ts +0 -0
  108. package/lib/types/{reanimated2 → lib/reanimated2}/hook/useFrameCallback.d.ts +0 -0
  109. package/lib/types/{reanimated2 → lib/reanimated2}/hook/useScrollViewOffset.d.ts +0 -0
  110. package/lib/types/{reanimated2 → lib/reanimated2}/hook/useSharedValue.d.ts +0 -0
  111. package/lib/types/{reanimated2 → lib/reanimated2}/hook/utils.d.ts +0 -0
  112. package/lib/types/{reanimated2 → lib/reanimated2}/index.d.ts +0 -0
  113. package/lib/types/{reanimated2 → lib/reanimated2}/interpolateColor.d.ts +8 -2
  114. package/lib/types/{reanimated2 → lib/reanimated2}/interpolation.d.ts +0 -0
  115. package/lib/types/{reanimated2 → lib/reanimated2}/jestUtils.d.ts +0 -0
  116. package/lib/types/{reanimated2 → lib/reanimated2}/js-reanimated/JSReanimated.d.ts +0 -0
  117. package/lib/types/{reanimated2 → lib/reanimated2}/js-reanimated/Mapper.d.ts +0 -0
  118. package/lib/types/{reanimated2 → lib/reanimated2}/js-reanimated/MapperRegistry.d.ts +0 -0
  119. package/lib/types/{reanimated2 → lib/reanimated2}/js-reanimated/MutableValue.d.ts +0 -0
  120. package/lib/types/{reanimated2 → lib/reanimated2}/js-reanimated/commonTypes.d.ts +0 -0
  121. package/lib/types/{reanimated2 → lib/reanimated2}/js-reanimated/global.d.ts +0 -0
  122. package/lib/types/{reanimated2 → lib/reanimated2}/js-reanimated/index.d.ts +0 -0
  123. package/lib/types/{reanimated2 → lib/reanimated2}/layoutReanimation/LayoutAnimationRepository.d.ts +0 -0
  124. package/lib/types/{reanimated2 → lib/reanimated2}/layoutReanimation/animationBuilder/BaseAnimationBuilder.d.ts +0 -0
  125. package/lib/types/{reanimated2 → lib/reanimated2}/layoutReanimation/animationBuilder/ComplexAnimationBuilder.d.ts +0 -0
  126. package/lib/types/{reanimated2 → lib/reanimated2}/layoutReanimation/animationBuilder/Keyframe.d.ts +0 -0
  127. package/lib/types/{reanimated2 → lib/reanimated2}/layoutReanimation/animationBuilder/commonTypes.d.ts +4 -0
  128. package/lib/types/{reanimated2 → lib/reanimated2}/layoutReanimation/animationBuilder/index.d.ts +0 -0
  129. package/lib/types/{reanimated2 → lib/reanimated2}/layoutReanimation/defaultAnimations/Bounce.d.ts +0 -0
  130. package/lib/types/{reanimated2 → lib/reanimated2}/layoutReanimation/defaultAnimations/Default.d.ts +0 -0
  131. package/lib/types/{reanimated2 → lib/reanimated2}/layoutReanimation/defaultAnimations/Fade.d.ts +0 -0
  132. package/lib/types/{reanimated2 → lib/reanimated2}/layoutReanimation/defaultAnimations/Flip.d.ts +0 -0
  133. package/lib/types/{reanimated2 → lib/reanimated2}/layoutReanimation/defaultAnimations/Lightspeed.d.ts +0 -0
  134. package/lib/types/{reanimated2 → lib/reanimated2}/layoutReanimation/defaultAnimations/Pinwheel.d.ts +0 -0
  135. package/lib/types/{reanimated2 → lib/reanimated2}/layoutReanimation/defaultAnimations/Roll.d.ts +0 -0
  136. package/lib/types/{reanimated2 → lib/reanimated2}/layoutReanimation/defaultAnimations/Rotate.d.ts +0 -0
  137. package/lib/types/{reanimated2 → lib/reanimated2}/layoutReanimation/defaultAnimations/Slide.d.ts +0 -0
  138. package/lib/types/{reanimated2 → lib/reanimated2}/layoutReanimation/defaultAnimations/Stretch.d.ts +0 -0
  139. package/lib/types/{reanimated2 → lib/reanimated2}/layoutReanimation/defaultAnimations/Zoom.d.ts +0 -0
  140. package/lib/types/{reanimated2 → lib/reanimated2}/layoutReanimation/defaultAnimations/index.d.ts +0 -0
  141. package/lib/types/{reanimated2 → lib/reanimated2}/layoutReanimation/defaultTransitions/CurvedTransition.d.ts +0 -0
  142. package/lib/types/{reanimated2 → lib/reanimated2}/layoutReanimation/defaultTransitions/EntryExitTransition.d.ts +0 -0
  143. package/lib/types/{reanimated2 → lib/reanimated2}/layoutReanimation/defaultTransitions/FadingTransition.d.ts +0 -0
  144. package/lib/types/{reanimated2 → lib/reanimated2}/layoutReanimation/defaultTransitions/JumpingTransition.d.ts +0 -0
  145. package/lib/types/{reanimated2 → lib/reanimated2}/layoutReanimation/defaultTransitions/LinearTransition.d.ts +0 -0
  146. package/lib/types/{reanimated2 → lib/reanimated2}/layoutReanimation/defaultTransitions/SequencedTransition.d.ts +0 -0
  147. package/lib/types/{reanimated2 → lib/reanimated2}/layoutReanimation/defaultTransitions/index.d.ts +0 -0
  148. package/lib/types/{reanimated2 → lib/reanimated2}/layoutReanimation/index.d.ts +0 -0
  149. package/lib/types/{reanimated2 → lib/reanimated2}/mock.d.ts +0 -0
  150. package/lib/types/{reanimated2 → lib/reanimated2}/platform-specific/RNRenderer.d.ts +0 -0
  151. package/lib/types/{reanimated2 → lib/reanimated2}/platform-specific/RNRenderer.web.d.ts +0 -0
  152. package/lib/types/lib/reanimated2/platform-specific/checkVersion.d.ts +4 -0
  153. package/lib/types/lib/reanimated2/platform-specific/checkVersion.web.d.ts +5 -0
  154. package/lib/types/{reanimated2 → lib/reanimated2}/utils.d.ts +0 -0
  155. package/lib/types/{setAndForwardRef.d.ts → lib/setAndForwardRef.d.ts} +0 -0
  156. package/package.json +8 -8
  157. package/plugin.js +7 -3
  158. package/react-native-reanimated.d.ts +11 -2
  159. package/scripts/reanimated_utils.rb +7 -3
  160. package/src/createAnimatedComponent.tsx +7 -0
  161. package/src/reanimated2/Colors.ts +38 -11
  162. package/src/reanimated2/NativeReanimated/NativeReanimated.ts +4 -0
  163. package/src/reanimated2/animation/util.ts +26 -15
  164. package/src/reanimated2/globals.d.ts +2 -0
  165. package/src/reanimated2/interpolateColor.ts +105 -21
  166. package/src/reanimated2/jestUtils.ts +14 -6
  167. package/src/reanimated2/layoutReanimation/animationBuilder/commonTypes.ts +4 -0
  168. package/src/reanimated2/layoutReanimation/defaultAnimations/Bounce.ts +16 -19
  169. package/src/reanimated2/layoutReanimation/defaultAnimations/Lightspeed.ts +14 -11
  170. package/src/reanimated2/layoutReanimation/defaultAnimations/Roll.ts +21 -11
  171. package/src/reanimated2/layoutReanimation/defaultAnimations/Slide.ts +32 -11
  172. package/src/reanimated2/layoutReanimation/defaultAnimations/Zoom.ts +36 -19
  173. package/src/reanimated2/platform-specific/checkVersion.ts +28 -0
  174. package/src/reanimated2/platform-specific/checkVersion.web.ts +6 -0
  175. package/android/react-native-reanimated-66-hermes.aar +0 -0
  176. package/android/react-native-reanimated-66-jsc.aar +0 -0
@@ -1,5 +1,5 @@
1
1
  /* global _WORKLET */
2
- import { convertToHSVA, isColor, toRGBA } from '../Colors';
2
+ import { isColor, convertToRGBA, rgbaArrayToRGBAColor, toGammaSpace, toLinearSpace, } from '../Colors';
3
3
  import NativeReanimatedModule from '../NativeReanimated';
4
4
  let IN_STYLE_UPDATER = false;
5
5
  export function initialUpdaterRun(updater) {
@@ -75,39 +75,39 @@ function decorateAnimation(animation) {
75
75
  ((_b = animation.__suffix) !== null && _b !== void 0 ? _b : '');
76
76
  return res;
77
77
  };
78
- const tab = ['H', 'S', 'V', 'A'];
78
+ const tab = ['R', 'G', 'B', 'A'];
79
79
  const colorOnStart = (animation, value, timestamp, previousAnimation) => {
80
- let HSVAValue;
81
- let HSVACurrent;
82
- let HSVAToValue;
80
+ let RGBAValue;
81
+ let RGBACurrent;
82
+ let RGBAToValue;
83
83
  const res = [];
84
84
  if (isColor(value)) {
85
- HSVACurrent = convertToHSVA(animation.current);
86
- HSVAValue = convertToHSVA(value);
85
+ RGBACurrent = toLinearSpace(convertToRGBA(animation.current));
86
+ RGBAValue = toLinearSpace(convertToRGBA(value));
87
87
  if (animation.toValue) {
88
- HSVAToValue = convertToHSVA(animation.toValue);
88
+ RGBAToValue = toLinearSpace(convertToRGBA(animation.toValue));
89
89
  }
90
90
  }
91
91
  tab.forEach((i, index) => {
92
92
  animation[i] = Object.assign({}, animationCopy);
93
- animation[i].current = HSVACurrent[index];
94
- animation[i].toValue = HSVAToValue ? HSVAToValue[index] : undefined;
95
- animation[i].onStart(animation[i], HSVAValue[index], timestamp, previousAnimation ? previousAnimation[i] : undefined);
93
+ animation[i].current = RGBACurrent[index];
94
+ animation[i].toValue = RGBAToValue ? RGBAToValue[index] : undefined;
95
+ animation[i].onStart(animation[i], RGBAValue[index], timestamp, previousAnimation ? previousAnimation[i] : undefined);
96
96
  res.push(animation[i].current);
97
97
  });
98
- animation.current = toRGBA(res);
98
+ animation.current = rgbaArrayToRGBAColor(toGammaSpace(res));
99
99
  };
100
100
  const colorOnFrame = (animation, timestamp) => {
101
- const HSVACurrent = convertToHSVA(animation.current);
101
+ const RGBACurrent = toLinearSpace(convertToRGBA(animation.current));
102
102
  const res = [];
103
103
  let finished = true;
104
104
  tab.forEach((i, index) => {
105
- animation[i].current = HSVACurrent[index];
105
+ animation[i].current = RGBACurrent[index];
106
106
  // @ts-ignore: disable-next-line
107
107
  finished &= animation[i].onFrame(animation[i], timestamp);
108
108
  res.push(animation[i].current);
109
109
  });
110
- animation.current = toRGBA(res);
110
+ animation.current = rgbaArrayToRGBAColor(toGammaSpace(res));
111
111
  return finished;
112
112
  };
113
113
  const arrayOnStart = (animation, value, timestamp, previousAnimation) => {
@@ -9,6 +9,7 @@ import type { FrameCallbackRegistryUI } from './frameCallback/FrameCallbackRegis
9
9
 
10
10
  declare global {
11
11
  const _WORKLET: boolean;
12
+ const _REANIMATED_VERSION_CPP: string;
12
13
  const _frameTimestamp: number | null;
13
14
  const _eventTimestamp: number;
14
15
  const __reanimatedModuleProxy: NativeReanimated;
@@ -49,6 +50,7 @@ declare global {
49
50
  interface Global {
50
51
  _WORKLET: boolean;
51
52
  _IS_FABRIC: boolean;
53
+ _REANIMATED_VERSION_CPP: string;
52
54
  _frameTimestamp: number | null;
53
55
  _eventTimestamp: number;
54
56
  __reanimatedModuleProxy: NativeReanimated;
@@ -4,20 +4,75 @@ import { interpolate } from './interpolation';
4
4
  // @ts-ignore JS file
5
5
  import { Extrapolate } from '../reanimated1/derived';
6
6
  import { useSharedValue } from './hook/useSharedValue';
7
- const interpolateColorsHSV = (value, inputRange, colors) => {
7
+ const interpolateColorsHSV = (value, inputRange, colors, options) => {
8
8
  'worklet';
9
- const h = interpolate(value, inputRange, colors.h, Extrapolate.CLAMP);
9
+ let h = 0;
10
+ const { useCorrectedHSVInterpolation = true } = options;
11
+ if (useCorrectedHSVInterpolation) {
12
+ // if the difference between hues in a range is > 180 deg
13
+ // then move the hue at the right end of the range +/- 360 deg
14
+ // and add the next point in the original place + 0.00001 with original hue
15
+ // to not break the next range
16
+ const correctedInputRange = [inputRange[0]];
17
+ const originalH = colors.h;
18
+ const correctedH = [originalH[0]];
19
+ for (let i = 1; i < originalH.length; ++i) {
20
+ const d = originalH[i] - originalH[i - 1];
21
+ if (originalH[i] > originalH[i - 1] && d > 0.5) {
22
+ correctedInputRange.push(inputRange[i]);
23
+ correctedInputRange.push(inputRange[i] + 0.00001);
24
+ correctedH.push(originalH[i] - 1);
25
+ correctedH.push(originalH[i]);
26
+ }
27
+ else if (originalH[i] < originalH[i - 1] && d < -0.5) {
28
+ correctedInputRange.push(inputRange[i]);
29
+ correctedInputRange.push(inputRange[i] + 0.00001);
30
+ correctedH.push(originalH[i] + 1);
31
+ correctedH.push(originalH[i]);
32
+ }
33
+ else {
34
+ correctedInputRange.push(inputRange[i]);
35
+ correctedH.push(originalH[i]);
36
+ }
37
+ }
38
+ h =
39
+ (interpolate(value, correctedInputRange, correctedH, Extrapolate.CLAMP) +
40
+ 1) %
41
+ 1;
42
+ }
43
+ else {
44
+ h = interpolate(value, inputRange, colors.h, Extrapolate.CLAMP);
45
+ }
10
46
  const s = interpolate(value, inputRange, colors.s, Extrapolate.CLAMP);
11
47
  const v = interpolate(value, inputRange, colors.v, Extrapolate.CLAMP);
12
- return hsvToColor(h, s, v);
48
+ const a = interpolate(value, inputRange, colors.a, Extrapolate.CLAMP);
49
+ return hsvToColor(h, s, v, a);
13
50
  };
14
- const interpolateColorsRGB = (value, inputRange, colors) => {
51
+ const toLinearSpace = (x, gamma) => {
15
52
  'worklet';
16
- const r = interpolate(value, inputRange, colors.r, Extrapolate.CLAMP);
17
- const g = interpolate(value, inputRange, colors.g, Extrapolate.CLAMP);
18
- const b = interpolate(value, inputRange, colors.b, Extrapolate.CLAMP);
53
+ return x.map((v) => Math.pow(v / 255, gamma));
54
+ };
55
+ const toGammaSpace = (x, gamma) => {
56
+ 'worklet';
57
+ return Math.round(Math.pow(x, 1 / gamma) * 255);
58
+ };
59
+ const interpolateColorsRGB = (value, inputRange, colors, options) => {
60
+ 'worklet';
61
+ const { gamma = 2.2 } = options;
62
+ let { r: outputR, g: outputG, b: outputB } = colors;
63
+ if (gamma !== 1) {
64
+ outputR = toLinearSpace(outputR, gamma);
65
+ outputG = toLinearSpace(outputG, gamma);
66
+ outputB = toLinearSpace(outputB, gamma);
67
+ }
68
+ const r = interpolate(value, inputRange, outputR, Extrapolate.CLAMP);
69
+ const g = interpolate(value, inputRange, outputG, Extrapolate.CLAMP);
70
+ const b = interpolate(value, inputRange, outputB, Extrapolate.CLAMP);
19
71
  const a = interpolate(value, inputRange, colors.a, Extrapolate.CLAMP);
20
- return rgbaColor(r, g, b, a);
72
+ if (gamma === 1) {
73
+ return rgbaColor(r, g, b, a);
74
+ }
75
+ return rgbaColor(toGammaSpace(r, gamma), toGammaSpace(g, gamma), toGammaSpace(b, gamma), a);
21
76
  };
22
77
  const getInterpolateRGB = (colors) => {
23
78
  'worklet';
@@ -43,24 +98,27 @@ const getInterpolateHSV = (colors) => {
43
98
  const h = [];
44
99
  const s = [];
45
100
  const v = [];
101
+ const a = [];
46
102
  for (let i = 0; i < colors.length; ++i) {
47
103
  const color = colors[i];
48
- const processedColor = RGBtoHSV(processColor(color));
49
- if (processedColor) {
50
- h.push(processedColor.h);
51
- s.push(processedColor.s);
52
- v.push(processedColor.v);
104
+ const processedColor = processColor(color);
105
+ if (typeof processedColor === 'number') {
106
+ const processedHSVColor = RGBtoHSV(red(processedColor), green(processedColor), blue(processedColor));
107
+ h.push(processedHSVColor.h);
108
+ s.push(processedHSVColor.s);
109
+ v.push(processedHSVColor.v);
110
+ a.push(opacity(processedColor));
53
111
  }
54
112
  }
55
- return { h, s, v };
113
+ return { h, s, v, a };
56
114
  };
57
- export const interpolateColor = (value, inputRange, outputRange, colorSpace = 'RGB') => {
115
+ export const interpolateColor = (value, inputRange, outputRange, colorSpace = 'RGB', options = {}) => {
58
116
  'worklet';
59
117
  if (colorSpace === 'HSV') {
60
- return interpolateColorsHSV(value, inputRange, getInterpolateHSV(outputRange));
118
+ return interpolateColorsHSV(value, inputRange, getInterpolateHSV(outputRange), options);
61
119
  }
62
120
  else if (colorSpace === 'RGB') {
63
- return interpolateColorsRGB(value, inputRange, getInterpolateRGB(outputRange));
121
+ return interpolateColorsRGB(value, inputRange, getInterpolateRGB(outputRange), options);
64
122
  }
65
123
  throw new Error(`Invalid color space provided: ${colorSpace}. Supported values are: ['RGB', 'HSV']`);
66
124
  };
@@ -69,12 +127,13 @@ export var ColorSpace;
69
127
  ColorSpace[ColorSpace["RGB"] = 0] = "RGB";
70
128
  ColorSpace[ColorSpace["HSV"] = 1] = "HSV";
71
129
  })(ColorSpace || (ColorSpace = {}));
72
- export function useInterpolateConfig(inputRange, outputRange, colorSpace = ColorSpace.RGB) {
130
+ export function useInterpolateConfig(inputRange, outputRange, colorSpace = ColorSpace.RGB, options = {}) {
73
131
  return useSharedValue({
74
132
  inputRange,
75
133
  outputRange,
76
134
  colorSpace,
77
135
  cache: makeMutable(null),
136
+ options,
78
137
  });
79
138
  }
80
139
  export const interpolateSharableColor = (value, interpolateConfig) => {
@@ -85,14 +144,14 @@ export const interpolateSharableColor = (value, interpolateConfig) => {
85
144
  colors = getInterpolateRGB(interpolateConfig.value.outputRange);
86
145
  interpolateConfig.value.cache.value = colors;
87
146
  }
88
- return interpolateColorsRGB(value, interpolateConfig.value.inputRange, colors);
147
+ return interpolateColorsRGB(value, interpolateConfig.value.inputRange, colors, interpolateConfig.value.options);
89
148
  }
90
149
  else if (interpolateConfig.value.colorSpace === ColorSpace.HSV) {
91
150
  if (!colors) {
92
151
  colors = getInterpolateHSV(interpolateConfig.value.outputRange);
93
152
  interpolateConfig.value.cache.value = colors;
94
153
  }
95
- return interpolateColorsHSV(value, interpolateConfig.value.inputRange, colors);
154
+ return interpolateColorsHSV(value, interpolateConfig.value.inputRange, colors, interpolateConfig.value.options);
96
155
  }
97
156
  throw new Error(`Invalid color space provided: ${interpolateConfig.value.colorSpace}. Supported values are: ['RGB', 'HSV']`);
98
157
  };
@@ -145,14 +145,21 @@ export const advanceAnimationByFrame = (count) => {
145
145
  jest.advanceTimersByTime(frameTime);
146
146
  };
147
147
  export const setUpTests = (userConfig = {}) => {
148
- let expect;
149
- try {
150
- expect = require('expect');
151
- }
152
- catch (_) {
153
- // for Jest in version 28+
154
- const { expect: expectModule } = require('@jest/globals');
148
+ let expect = global.expect;
149
+ if (expect === undefined) {
150
+ const expectModule = require('expect');
155
151
  expect = expectModule;
152
+ // Starting from Jest 28, "expect" package uses named exports instead of default export.
153
+ // So, requiring "expect" package doesn't give direct access to "expect" function anymore.
154
+ // It gives access to the module object instead.
155
+ // We use this info to detect if the project uses Jest 28 or higher.
156
+ if (typeof expect === 'object') {
157
+ const jestGlobals = require('@jest/globals');
158
+ expect = jestGlobals.expect;
159
+ }
160
+ if (expect === undefined || expect.extend === undefined) {
161
+ expect = expectModule.default;
162
+ }
156
163
  }
157
164
  require('setimmediate');
158
165
  frameTime = Math.round(1000 / config.fps);
@@ -1,7 +1,5 @@
1
1
  import { withSequence, withTiming } from '../../animation';
2
- import { Dimensions } from 'react-native';
3
2
  import { ComplexAnimationBuilder } from '../animationBuilder/ComplexAnimationBuilder';
4
- const { width, height } = Dimensions.get('window');
5
3
  export class BounceIn extends ComplexAnimationBuilder {
6
4
  constructor() {
7
5
  super(...arguments);
@@ -47,7 +45,7 @@ export class BounceInDown extends ComplexAnimationBuilder {
47
45
  const duration = this.getDuration();
48
46
  const callback = this.callbackV;
49
47
  const initialValues = this.initialValues;
50
- return () => {
48
+ return (values) => {
51
49
  'worklet';
52
50
  return {
53
51
  animations: {
@@ -59,7 +57,7 @@ export class BounceInDown extends ComplexAnimationBuilder {
59
57
  },
60
58
  initialValues: Object.assign({ transform: [
61
59
  {
62
- translateY: height,
60
+ translateY: values.windowHeight,
63
61
  },
64
62
  ] }, initialValues),
65
63
  callback: callback,
@@ -87,7 +85,7 @@ export class BounceInUp extends ComplexAnimationBuilder {
87
85
  const duration = this.getDuration();
88
86
  const callback = this.callbackV;
89
87
  const initialValues = this.initialValues;
90
- return () => {
88
+ return (values) => {
91
89
  'worklet';
92
90
  return {
93
91
  animations: {
@@ -97,7 +95,7 @@ export class BounceInUp extends ComplexAnimationBuilder {
97
95
  },
98
96
  ],
99
97
  },
100
- initialValues: Object.assign({ transform: [{ translateY: -height }] }, initialValues),
98
+ initialValues: Object.assign({ transform: [{ translateY: -values.windowHeight }] }, initialValues),
101
99
  callback: callback,
102
100
  };
103
101
  };
@@ -123,7 +121,7 @@ export class BounceInLeft extends ComplexAnimationBuilder {
123
121
  const duration = this.getDuration();
124
122
  const callback = this.callbackV;
125
123
  const initialValues = this.initialValues;
126
- return () => {
124
+ return (values) => {
127
125
  'worklet';
128
126
  return {
129
127
  animations: {
@@ -133,7 +131,7 @@ export class BounceInLeft extends ComplexAnimationBuilder {
133
131
  },
134
132
  ],
135
133
  },
136
- initialValues: Object.assign({ transform: [{ translateX: -width }] }, initialValues),
134
+ initialValues: Object.assign({ transform: [{ translateX: -values.windowWidth }] }, initialValues),
137
135
  callback: callback,
138
136
  };
139
137
  };
@@ -159,7 +157,7 @@ export class BounceInRight extends ComplexAnimationBuilder {
159
157
  const duration = this.getDuration();
160
158
  const callback = this.callbackV;
161
159
  const initialValues = this.initialValues;
162
- return () => {
160
+ return (values) => {
163
161
  'worklet';
164
162
  return {
165
163
  animations: {
@@ -169,7 +167,7 @@ export class BounceInRight extends ComplexAnimationBuilder {
169
167
  },
170
168
  ],
171
169
  },
172
- initialValues: Object.assign({ transform: [{ translateX: width }] }, initialValues),
170
+ initialValues: Object.assign({ transform: [{ translateX: values.windowWidth }] }, initialValues),
173
171
  callback: callback,
174
172
  };
175
173
  };
@@ -231,13 +229,13 @@ export class BounceOutDown extends ComplexAnimationBuilder {
231
229
  const duration = this.getDuration();
232
230
  const callback = this.callbackV;
233
231
  const initialValues = this.initialValues;
234
- return () => {
232
+ return (values) => {
235
233
  'worklet';
236
234
  return {
237
235
  animations: {
238
236
  transform: [
239
237
  {
240
- translateY: delayFunction(delay, withSequence(withTiming(-10, { duration: duration * 0.15 }), withTiming(10, { duration: duration * 0.15 }), withTiming(-20, { duration: duration * 0.15 }), withTiming(height, {
238
+ translateY: delayFunction(delay, withSequence(withTiming(-10, { duration: duration * 0.15 }), withTiming(10, { duration: duration * 0.15 }), withTiming(-20, { duration: duration * 0.15 }), withTiming(values.windowHeight, {
241
239
  duration: duration * 0.55,
242
240
  }))),
243
241
  },
@@ -269,13 +267,13 @@ export class BounceOutUp extends ComplexAnimationBuilder {
269
267
  const duration = this.getDuration();
270
268
  const callback = this.callbackV;
271
269
  const initialValues = this.initialValues;
272
- return () => {
270
+ return (values) => {
273
271
  'worklet';
274
272
  return {
275
273
  animations: {
276
274
  transform: [
277
275
  {
278
- translateY: delayFunction(delay, withSequence(withTiming(10, { duration: duration * 0.15 }), withTiming(-10, { duration: duration * 0.15 }), withTiming(20, { duration: duration * 0.15 }), withTiming(-height, {
276
+ translateY: delayFunction(delay, withSequence(withTiming(10, { duration: duration * 0.15 }), withTiming(-10, { duration: duration * 0.15 }), withTiming(20, { duration: duration * 0.15 }), withTiming(-values.windowHeight, {
279
277
  duration: duration * 0.55,
280
278
  }))),
281
279
  },
@@ -307,13 +305,13 @@ export class BounceOutLeft extends ComplexAnimationBuilder {
307
305
  const duration = this.getDuration();
308
306
  const callback = this.callbackV;
309
307
  const initialValues = this.initialValues;
310
- return () => {
308
+ return (values) => {
311
309
  'worklet';
312
310
  return {
313
311
  animations: {
314
312
  transform: [
315
313
  {
316
- translateX: delayFunction(delay, withSequence(withTiming(10, { duration: duration * 0.15 }), withTiming(-10, { duration: duration * 0.15 }), withTiming(20, { duration: duration * 0.15 }), withTiming(-width, {
314
+ translateX: delayFunction(delay, withSequence(withTiming(10, { duration: duration * 0.15 }), withTiming(-10, { duration: duration * 0.15 }), withTiming(20, { duration: duration * 0.15 }), withTiming(-values.windowWidth, {
317
315
  duration: duration * 0.55,
318
316
  }))),
319
317
  },
@@ -345,13 +343,13 @@ export class BounceOutRight extends ComplexAnimationBuilder {
345
343
  const duration = this.getDuration();
346
344
  const callback = this.callbackV;
347
345
  const initialValues = this.initialValues;
348
- return () => {
346
+ return (values) => {
349
347
  'worklet';
350
348
  return {
351
349
  animations: {
352
350
  transform: [
353
351
  {
354
- translateX: delayFunction(delay, withSequence(withTiming(-10, { duration: duration * 0.15 }), withTiming(10, { duration: duration * 0.15 }), withTiming(-20, { duration: duration * 0.15 }), withTiming(width, {
352
+ translateX: delayFunction(delay, withSequence(withTiming(-10, { duration: duration * 0.15 }), withTiming(10, { duration: duration * 0.15 }), withTiming(-20, { duration: duration * 0.15 }), withTiming(values.windowWidth, {
355
353
  duration: duration * 0.55,
356
354
  }))),
357
355
  },
@@ -1,7 +1,5 @@
1
- import { Dimensions } from 'react-native';
2
1
  import { withSequence, withTiming } from '../../animation';
3
2
  import { ComplexAnimationBuilder } from '../animationBuilder';
4
- const { width } = Dimensions.get('window');
5
3
  export class LightSpeedInRight extends ComplexAnimationBuilder {
6
4
  constructor() {
7
5
  super(...arguments);
@@ -12,7 +10,7 @@ export class LightSpeedInRight extends ComplexAnimationBuilder {
12
10
  const duration = this.getDuration();
13
11
  const callback = this.callbackV;
14
12
  const initialValues = this.initialValues;
15
- return () => {
13
+ return (values) => {
16
14
  'worklet';
17
15
  return {
18
16
  animations: {
@@ -26,7 +24,7 @@ export class LightSpeedInRight extends ComplexAnimationBuilder {
26
24
  },
27
25
  ],
28
26
  },
29
- initialValues: Object.assign({ opacity: 0, transform: [{ translateX: width }, { skewX: '-45deg' }] }, initialValues),
27
+ initialValues: Object.assign({ opacity: 0, transform: [{ translateX: values.windowWidth }, { skewX: '-45deg' }] }, initialValues),
30
28
  callback: callback,
31
29
  };
32
30
  };
@@ -46,7 +44,7 @@ export class LightSpeedInLeft extends ComplexAnimationBuilder {
46
44
  const duration = this.getDuration();
47
45
  const callback = this.callbackV;
48
46
  const initialValues = this.initialValues;
49
- return () => {
47
+ return (values) => {
50
48
  'worklet';
51
49
  return {
52
50
  animations: {
@@ -60,7 +58,7 @@ export class LightSpeedInLeft extends ComplexAnimationBuilder {
60
58
  },
61
59
  ],
62
60
  },
63
- initialValues: Object.assign({ opacity: 0, transform: [{ translateX: -width }, { skewX: '45deg' }] }, initialValues),
61
+ initialValues: Object.assign({ opacity: 0, transform: [{ translateX: -values.windowWidth }, { skewX: '45deg' }] }, initialValues),
64
62
  callback: callback,
65
63
  };
66
64
  };
@@ -79,14 +77,14 @@ export class LightSpeedOutRight extends ComplexAnimationBuilder {
79
77
  const delay = this.getDelay();
80
78
  const callback = this.callbackV;
81
79
  const initialValues = this.initialValues;
82
- return () => {
80
+ return (values) => {
83
81
  'worklet';
84
82
  return {
85
83
  animations: {
86
84
  opacity: delayFunction(delay, animation(0, config)),
87
85
  transform: [
88
86
  {
89
- translateX: delayFunction(delay, animation(width, config)),
87
+ translateX: delayFunction(delay, animation(values.windowWidth, config)),
90
88
  },
91
89
  {
92
90
  skewX: delayFunction(delay, animation('-45deg', config)),
@@ -112,14 +110,14 @@ export class LightSpeedOutLeft extends ComplexAnimationBuilder {
112
110
  const delay = this.getDelay();
113
111
  const callback = this.callbackV;
114
112
  const initialValues = this.initialValues;
115
- return () => {
113
+ return (values) => {
116
114
  'worklet';
117
115
  return {
118
116
  animations: {
119
117
  opacity: delayFunction(delay, animation(0, config)),
120
118
  transform: [
121
119
  {
122
- translateX: delayFunction(delay, animation(-width, config)),
120
+ translateX: delayFunction(delay, animation(-values.windowWidth, config)),
123
121
  },
124
122
  {
125
123
  skewX: delayFunction(delay, animation('45deg', config)),
@@ -1,6 +1,4 @@
1
- import { Dimensions } from 'react-native';
2
1
  import { ComplexAnimationBuilder } from '../animationBuilder';
3
- const { width } = Dimensions.get('window');
4
2
  export class RollInLeft extends ComplexAnimationBuilder {
5
3
  constructor() {
6
4
  super(...arguments);
@@ -10,7 +8,7 @@ export class RollInLeft extends ComplexAnimationBuilder {
10
8
  const delay = this.getDelay();
11
9
  const callback = this.callbackV;
12
10
  const initialValues = this.initialValues;
13
- return () => {
11
+ return (values) => {
14
12
  'worklet';
15
13
  return {
16
14
  animations: {
@@ -19,7 +17,10 @@ export class RollInLeft extends ComplexAnimationBuilder {
19
17
  { rotate: delayFunction(delay, animation('0deg', config)) },
20
18
  ],
21
19
  },
22
- initialValues: Object.assign({ transform: [{ translateX: -width }, { rotate: '-180deg' }] }, initialValues),
20
+ initialValues: Object.assign({ transform: [
21
+ { translateX: -values.windowWidth },
22
+ { rotate: '-180deg' },
23
+ ] }, initialValues),
23
24
  callback: callback,
24
25
  };
25
26
  };
@@ -38,7 +39,7 @@ export class RollInRight extends ComplexAnimationBuilder {
38
39
  const delay = this.getDelay();
39
40
  const callback = this.callbackV;
40
41
  const initialValues = this.initialValues;
41
- return () => {
42
+ return (values) => {
42
43
  'worklet';
43
44
  return {
44
45
  animations: {
@@ -47,7 +48,7 @@ export class RollInRight extends ComplexAnimationBuilder {
47
48
  { rotate: delayFunction(delay, animation('0deg', config)) },
48
49
  ],
49
50
  },
50
- initialValues: Object.assign({ transform: [{ translateX: width }, { rotate: '180deg' }] }, initialValues),
51
+ initialValues: Object.assign({ transform: [{ translateX: values.windowWidth }, { rotate: '180deg' }] }, initialValues),
51
52
  callback: callback,
52
53
  };
53
54
  };
@@ -66,12 +67,14 @@ export class RollOutLeft extends ComplexAnimationBuilder {
66
67
  const delay = this.getDelay();
67
68
  const callback = this.callbackV;
68
69
  const initialValues = this.initialValues;
69
- return () => {
70
+ return (values) => {
70
71
  'worklet';
71
72
  return {
72
73
  animations: {
73
74
  transform: [
74
- { translateX: delayFunction(delay, animation(-width, config)) },
75
+ {
76
+ translateX: delayFunction(delay, animation(-values.windowWidth, config)),
77
+ },
75
78
  { rotate: delayFunction(delay, animation('-180deg', config)) },
76
79
  ],
77
80
  },
@@ -94,12 +97,14 @@ export class RollOutRight extends ComplexAnimationBuilder {
94
97
  const delay = this.getDelay();
95
98
  const callback = this.callbackV;
96
99
  const initialValues = this.initialValues;
97
- return () => {
100
+ return (values) => {
98
101
  'worklet';
99
102
  return {
100
103
  animations: {
101
104
  transform: [
102
- { translateX: delayFunction(delay, animation(width, config)) },
105
+ {
106
+ translateX: delayFunction(delay, animation(values.windowWidth, config)),
107
+ },
103
108
  { rotate: delayFunction(delay, animation('180deg', config)) },
104
109
  ],
105
110
  },
@@ -1,6 +1,4 @@
1
- import { Dimensions } from 'react-native';
2
1
  import { ComplexAnimationBuilder } from '../animationBuilder';
3
- const { width, height } = Dimensions.get('window');
4
2
  export class SlideInRight extends ComplexAnimationBuilder {
5
3
  constructor() {
6
4
  super(...arguments);
@@ -16,7 +14,7 @@ export class SlideInRight extends ComplexAnimationBuilder {
16
14
  animations: {
17
15
  originX: delayFunction(delay, animation(values.targetOriginX, config)),
18
16
  },
19
- initialValues: Object.assign({ originX: values.targetOriginX + width }, initialValues),
17
+ initialValues: Object.assign({ originX: values.targetOriginX + values.windowWidth }, initialValues),
20
18
  callback: callback,
21
19
  };
22
20
  };
@@ -41,7 +39,7 @@ export class SlideInLeft extends ComplexAnimationBuilder {
41
39
  animations: {
42
40
  originX: delayFunction(delay, animation(values.targetOriginX, config)),
43
41
  },
44
- initialValues: Object.assign({ originX: values.targetOriginX - width }, initialValues),
42
+ initialValues: Object.assign({ originX: values.targetOriginX - values.windowWidth }, initialValues),
45
43
  callback: callback,
46
44
  };
47
45
  };
@@ -64,7 +62,7 @@ export class SlideOutRight extends ComplexAnimationBuilder {
64
62
  'worklet';
65
63
  return {
66
64
  animations: {
67
- originX: delayFunction(delay, animation(Math.max(values.currentOriginX + width, width), config)),
65
+ originX: delayFunction(delay, animation(Math.max(values.currentOriginX + values.windowWidth, values.windowWidth), config)),
68
66
  },
69
67
  initialValues: Object.assign({ originX: values.currentOriginX }, initialValues),
70
68
  callback: callback,
@@ -89,7 +87,7 @@ export class SlideOutLeft extends ComplexAnimationBuilder {
89
87
  'worklet';
90
88
  return {
91
89
  animations: {
92
- originX: delayFunction(delay, animation(Math.min(values.currentOriginX - width, -width), config)),
90
+ originX: delayFunction(delay, animation(Math.min(values.currentOriginX - values.windowWidth, -values.windowWidth), config)),
93
91
  },
94
92
  initialValues: Object.assign({ originX: values.currentOriginX }, initialValues),
95
93
  callback: callback,
@@ -116,7 +114,7 @@ export class SlideInUp extends ComplexAnimationBuilder {
116
114
  animations: {
117
115
  originY: delayFunction(delay, animation(values.targetOriginY, config)),
118
116
  },
119
- initialValues: Object.assign({ originY: -height }, initialValues),
117
+ initialValues: Object.assign({ originY: -values.windowHeight }, initialValues),
120
118
  callback: callback,
121
119
  };
122
120
  };
@@ -141,7 +139,7 @@ export class SlideInDown extends ComplexAnimationBuilder {
141
139
  animations: {
142
140
  originY: delayFunction(delay, animation(values.targetOriginY, config)),
143
141
  },
144
- initialValues: Object.assign({ originY: values.targetOriginY + height }, initialValues),
142
+ initialValues: Object.assign({ originY: values.targetOriginY + values.windowHeight }, initialValues),
145
143
  callback: callback,
146
144
  };
147
145
  };
@@ -164,7 +162,7 @@ export class SlideOutUp extends ComplexAnimationBuilder {
164
162
  'worklet';
165
163
  return {
166
164
  animations: {
167
- originY: delayFunction(delay, animation(Math.min(values.currentOriginY - height, -height), config)),
165
+ originY: delayFunction(delay, animation(Math.min(values.currentOriginY - values.windowHeight, -values.windowHeight), config)),
168
166
  },
169
167
  initialValues: Object.assign({ originY: values.currentOriginY }, initialValues),
170
168
  callback: callback,
@@ -189,7 +187,7 @@ export class SlideOutDown extends ComplexAnimationBuilder {
189
187
  'worklet';
190
188
  return {
191
189
  animations: {
192
- originY: delayFunction(delay, animation(Math.max(values.currentOriginY + height, height), config)),
190
+ originY: delayFunction(delay, animation(Math.max(values.currentOriginY + values.windowHeight, values.windowHeight), config)),
193
191
  },
194
192
  initialValues: Object.assign({ originY: values.currentOriginY }, initialValues),
195
193
  callback: callback,