react-native-reanimated 3.18.0 → 3.18.2

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 (84) hide show
  1. package/Common/cpp/reanimated/Fabric/ReanimatedCommitHook.cpp +14 -2
  2. package/Common/cpp/reanimated/Fabric/ReanimatedCommitHook.h +6 -1
  3. package/Common/cpp/reanimated/Fabric/ReanimatedMountHook.cpp +6 -1
  4. package/Common/cpp/reanimated/Fabric/ReanimatedMountHook.h +6 -1
  5. package/Common/cpp/reanimated/Fabric/ShadowTreeCloner.cpp +3 -2
  6. package/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsProxy.cpp +86 -24
  7. package/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsProxy.h +29 -4
  8. package/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsUtils.h +4 -5
  9. package/Common/cpp/reanimated/NativeModules/ReanimatedModuleProxy.cpp +45 -15
  10. package/Common/cpp/reanimated/NativeModules/ReanimatedModuleProxy.h +4 -1
  11. package/Common/cpp/reanimated/Tools/ReanimatedSystraceSection.h +1 -1
  12. package/README.md +1 -13
  13. package/RNReanimated.podspec +1 -1
  14. package/android/src/main/cpp/reanimated/android/NativeProxy.cpp +25 -21
  15. package/android/src/main/cpp/reanimated/android/NativeProxy.h +5 -3
  16. package/apple/reanimated/apple/LayoutReanimation/REASharedTransitionManager.m +1 -2
  17. package/apple/reanimated/apple/LayoutReanimation/REASwizzledUIManager.mm +8 -7
  18. package/lib/module/PlatformChecker.js +6 -0
  19. package/lib/module/PlatformChecker.js.map +1 -1
  20. package/lib/module/animation/util.js +7 -4
  21. package/lib/module/animation/util.js.map +1 -1
  22. package/lib/module/component/FlatList.js +9 -3
  23. package/lib/module/component/FlatList.js.map +1 -1
  24. package/lib/module/core.js +0 -2
  25. package/lib/module/core.js.map +1 -1
  26. package/lib/module/createAnimatedComponent/NativeEventsManager.js +1 -1
  27. package/lib/module/createAnimatedComponent/NativeEventsManager.js.map +1 -1
  28. package/lib/module/createAnimatedComponent/createAnimatedComponent.js +24 -37
  29. package/lib/module/createAnimatedComponent/createAnimatedComponent.js.map +1 -1
  30. package/lib/module/hook/useAnimatedRef.js +70 -35
  31. package/lib/module/hook/useAnimatedRef.js.map +1 -1
  32. package/lib/module/hook/useHandler.js +7 -0
  33. package/lib/module/hook/useHandler.js.map +1 -1
  34. package/lib/module/hook/useScrollViewOffset.js +28 -26
  35. package/lib/module/hook/useScrollViewOffset.js.map +1 -1
  36. package/lib/module/hook/utils.js +20 -9
  37. package/lib/module/hook/utils.js.map +1 -1
  38. package/lib/module/index.js +3 -0
  39. package/lib/module/index.js.map +1 -1
  40. package/lib/module/platform-specific/jsVersion.js +1 -1
  41. package/lib/module/platformFunctions/setNativeProps.js +1 -1
  42. package/lib/module/platformFunctions/setNativeProps.js.map +1 -1
  43. package/lib/module/processBoxShadow.js.map +1 -1
  44. package/lib/typescript/PlatformChecker.d.ts +2 -0
  45. package/lib/typescript/PlatformChecker.d.ts.map +1 -1
  46. package/lib/typescript/animation/util.d.ts.map +1 -1
  47. package/lib/typescript/component/FlatList.d.ts +10 -2
  48. package/lib/typescript/component/FlatList.d.ts.map +1 -1
  49. package/lib/typescript/core.d.ts.map +1 -1
  50. package/lib/typescript/createAnimatedComponent/commonTypes.d.ts +1 -0
  51. package/lib/typescript/createAnimatedComponent/commonTypes.d.ts.map +1 -1
  52. package/lib/typescript/createAnimatedComponent/createAnimatedComponent.d.ts.map +1 -1
  53. package/lib/typescript/helperTypes.d.ts +1 -3
  54. package/lib/typescript/helperTypes.d.ts.map +1 -1
  55. package/lib/typescript/hook/commonTypes.d.ts +7 -4
  56. package/lib/typescript/hook/commonTypes.d.ts.map +1 -1
  57. package/lib/typescript/hook/useAnimatedRef.d.ts +3 -1
  58. package/lib/typescript/hook/useAnimatedRef.d.ts.map +1 -1
  59. package/lib/typescript/hook/useHandler.d.ts.map +1 -1
  60. package/lib/typescript/hook/useScrollViewOffset.d.ts.map +1 -1
  61. package/lib/typescript/hook/utils.d.ts.map +1 -1
  62. package/lib/typescript/index.d.ts +1 -1
  63. package/lib/typescript/index.d.ts.map +1 -1
  64. package/lib/typescript/platform-specific/jsVersion.d.ts +1 -1
  65. package/lib/typescript/processBoxShadow.d.ts +6 -3
  66. package/lib/typescript/processBoxShadow.d.ts.map +1 -1
  67. package/package.json +2 -2
  68. package/src/PlatformChecker.ts +8 -0
  69. package/src/animation/util.ts +7 -4
  70. package/src/component/FlatList.tsx +44 -6
  71. package/src/core.ts +0 -3
  72. package/src/createAnimatedComponent/NativeEventsManager.ts +1 -1
  73. package/src/createAnimatedComponent/commonTypes.ts +9 -0
  74. package/src/createAnimatedComponent/createAnimatedComponent.tsx +61 -73
  75. package/src/helperTypes.ts +1 -6
  76. package/src/hook/commonTypes.ts +9 -4
  77. package/src/hook/useAnimatedRef.ts +107 -48
  78. package/src/hook/useHandler.ts +10 -0
  79. package/src/hook/useScrollViewOffset.ts +34 -29
  80. package/src/hook/utils.ts +34 -9
  81. package/src/index.ts +4 -1
  82. package/src/platform-specific/jsVersion.ts +1 -1
  83. package/src/platformFunctions/setNativeProps.ts +1 -1
  84. package/src/processBoxShadow.ts +8 -4
package/src/index.ts CHANGED
@@ -3,6 +3,10 @@
3
3
  import './publicGlobals';
4
4
 
5
5
  import * as Animated from './Animated';
6
+ import { initializeUIRuntime } from './initializers';
7
+ import { ReanimatedModule } from './ReanimatedModule';
8
+
9
+ initializeUIRuntime(ReanimatedModule);
6
10
 
7
11
  export default Animated;
8
12
 
@@ -107,7 +111,6 @@ export type {
107
111
  Adaptable,
108
112
  AdaptTransforms,
109
113
  AnimatedProps,
110
- AnimatedStyleProp,
111
114
  AnimateProps,
112
115
  EntryOrExitLayoutType,
113
116
  TransformStyleTypes,
@@ -4,4 +4,4 @@
4
4
  * version used to build the native part of the library in runtime. Remember to
5
5
  * keep this in sync with the version declared in `package.json`
6
6
  */
7
- export const jsVersion = '3.18.0';
7
+ export const jsVersion = '3.18.2';
@@ -60,7 +60,7 @@ function setNativePropsPaper(
60
60
  return;
61
61
  }
62
62
  const tag = animatedRef() as number;
63
- const name = (animatedRef as AnimatedRefOnUI).viewName.value;
63
+ const name = (animatedRef as AnimatedRefOnUI).viewName?.value ?? null;
64
64
  processColorsInProps(updates);
65
65
  global._updatePropsPaper!([{ tag, name, updates }]);
66
66
  }
@@ -4,7 +4,7 @@
4
4
  'use strict';
5
5
 
6
6
  // @ts-ignore BoxShadowValue isn't available in RN 0.75
7
- import type { BoxShadowValue, OpaqueColorValue } from 'react-native';
7
+ import type { BoxShadowValue } from 'react-native';
8
8
 
9
9
  import type { StyleProps } from '.';
10
10
  import { ReanimatedError } from './errors';
@@ -114,13 +114,17 @@ function parseLength(length: string): number | null {
114
114
  type ParsedBoxShadow = {
115
115
  offsetX: number;
116
116
  offsetY: number;
117
- blurRadius?: number | OpaqueColorValue;
117
+ blurRadius?: number;
118
118
  spreadDistance?: number;
119
119
  inset?: boolean;
120
120
  color?: string;
121
121
  };
122
122
 
123
- export function processBoxShadow(props: StyleProps) {
123
+ type ExtendedStyleProps = StyleProps & {
124
+ boxShadow: string | readonly BoxShadowValue[] | ParsedBoxShadow[];
125
+ };
126
+
127
+ export function processBoxShadow(props: ExtendedStyleProps) {
124
128
  'worklet';
125
129
  const result: Array<ParsedBoxShadow> = [];
126
130
 
@@ -196,7 +200,7 @@ export function processBoxShadow(props: StyleProps) {
196
200
  parsedBoxShadow.blurRadius = value;
197
201
  break;
198
202
  case 'color':
199
- parsedBoxShadow.color = rawBoxShadow.color;
203
+ parsedBoxShadow.color = rawBoxShadow.color as string;
200
204
  break;
201
205
  case 'inset':
202
206
  parsedBoxShadow.inset = rawBoxShadow.inset;