react-native-reanimated 4.7.1 → 4.7.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.
- package/Common/cpp/reanimated/CSS/common/values/CSSNumber.cpp +5 -9
- package/Common/cpp/reanimated/CSS/common/values/CSSNumber.h +2 -6
- package/Common/cpp/reanimated/Fabric/updates/AnimatedPropsRegistry.cpp +135 -33
- package/Common/cpp/reanimated/Fabric/updates/AnimatedPropsRegistry.h +37 -3
- package/Common/cpp/reanimated/Fabric/updates/UpdatesRegistry.cpp +28 -0
- package/Common/cpp/reanimated/Fabric/updates/UpdatesRegistry.h +8 -0
- package/Common/cpp/reanimated/Fabric/updates/UpdatesRegistryManager.cpp +4 -1
- package/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsProxy.cpp +228 -87
- package/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsProxy.h +22 -5
- package/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsProxyCommon.cpp +9 -12
- package/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsProxy_Legacy.cpp +6 -5
- package/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsProxy_Legacy.h +5 -2
- package/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsUtils.h +22 -1
- package/Common/cpp/reanimated/NativeModules/ReanimatedModuleProxy.cpp +39 -9
- package/Common/cpp/reanimated/NativeModules/ReanimatedModuleProxy.h +1 -1
- package/Common/cpp/reanimated/Tools/PlatformDepMethodsHolder.h +13 -0
- package/Common/cpp/reanimated/Tools/TextMetrics.h +22 -0
- package/android/src/main/cpp/reanimated/android/NativeProxy.cpp +19 -0
- package/android/src/main/cpp/reanimated/android/NativeProxy.h +1 -0
- package/android/src/main/java/com/swmansion/reanimated/NativeProxy.kt +24 -0
- package/apple/reanimated/apple/REAReducedMotion.h +1 -3
- package/apple/reanimated/apple/native/PlatformDepMethodsHolderImpl.mm +28 -0
- package/jest/resolver.js +4 -1
- package/lib/module/PropsRegistryGarbageCollector.js +43 -25
- package/lib/module/PropsRegistryGarbageCollector.js.map +1 -1
- package/lib/module/ReanimatedModule/NativeReanimated.js +2 -2
- package/lib/module/ReanimatedModule/NativeReanimated.js.map +1 -1
- package/lib/module/commonTypes.js.map +1 -1
- package/lib/module/createAnimatedComponent/AnimatedComponent.js +1 -1
- package/lib/module/createAnimatedComponent/AnimatedComponent.js.map +1 -1
- package/lib/module/createAnimatedComponent/AnimatedComponent.native.js +10 -34
- package/lib/module/createAnimatedComponent/AnimatedComponent.native.js.map +1 -1
- package/lib/module/platform-specific/jsVersion.js +1 -1
- package/lib/module/platformFunctions/setNativeProps.native.js +2 -1
- package/lib/module/platformFunctions/setNativeProps.native.js.map +1 -1
- package/lib/module/updateProps/updateProps.native.js +5 -4
- package/lib/module/updateProps/updateProps.native.js.map +1 -1
- package/lib/typescript/PropsRegistryGarbageCollector.d.ts +2 -2
- package/lib/typescript/PropsRegistryGarbageCollector.d.ts.map +1 -1
- package/lib/typescript/ReanimatedModule/reanimatedModuleProxy.d.ts +1 -1
- package/lib/typescript/ReanimatedModule/reanimatedModuleProxy.d.ts.map +1 -1
- package/lib/typescript/commonTypes.d.ts +3 -1
- package/lib/typescript/commonTypes.d.ts.map +1 -1
- package/lib/typescript/createAnimatedComponent/AnimatedComponent.d.ts +1 -1
- package/lib/typescript/createAnimatedComponent/AnimatedComponent.d.ts.map +1 -1
- package/lib/typescript/createAnimatedComponent/AnimatedComponent.native.d.ts +1 -1
- package/lib/typescript/createAnimatedComponent/AnimatedComponent.native.d.ts.map +1 -1
- package/lib/typescript/createAnimatedComponent/commonTypes.d.ts +1 -1
- package/lib/typescript/createAnimatedComponent/commonTypes.d.ts.map +1 -1
- package/lib/typescript/platform-specific/jsVersion.d.ts +1 -1
- package/lib/typescript/updateProps/updateProps.native.d.ts.map +1 -1
- package/package.json +7 -7
- package/src/PropsRegistryGarbageCollector.ts +46 -25
- package/src/ReanimatedModule/NativeReanimated.ts +2 -2
- package/src/ReanimatedModule/reanimatedModuleProxy.ts +1 -1
- package/src/commonTypes.ts +3 -1
- package/src/createAnimatedComponent/AnimatedComponent.native.tsx +5 -30
- package/src/createAnimatedComponent/AnimatedComponent.tsx +1 -1
- package/src/createAnimatedComponent/commonTypes.ts +1 -1
- package/src/platform-specific/jsVersion.ts +1 -1
- package/src/platformFunctions/setNativeProps.native.ts +3 -1
- package/src/privateGlobals.d.ts +1 -0
- package/src/updateProps/updateProps.native.ts +10 -3
|
@@ -143,39 +143,14 @@ export default class AnimatedComponent
|
|
|
143
143
|
}
|
|
144
144
|
}
|
|
145
145
|
|
|
146
|
-
_syncStylePropsBackToReact(
|
|
146
|
+
_syncStylePropsBackToReact(props: StyleProps, style: StyleProps) {
|
|
147
147
|
if (!FORCE_REACT_RENDER_FOR_SETTLED_ANIMATIONS) {
|
|
148
148
|
return;
|
|
149
149
|
}
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
// style-only.
|
|
155
|
-
const animatedPropsKeys = new Set([
|
|
156
|
-
...this._animatedProps.flatMap((animatedProp) =>
|
|
157
|
-
Object.keys(animatedProp.initial?.value ?? {})
|
|
158
|
-
),
|
|
159
|
-
...Object.keys(this._InlinePropManager._inlineTopLevelProps),
|
|
160
|
-
]);
|
|
161
|
-
if (animatedPropsKeys.size === 0) {
|
|
162
|
-
this.setState((state) => ({
|
|
163
|
-
settledStyle: { ...state.settledStyle, ...settledUpdates },
|
|
164
|
-
}));
|
|
165
|
-
return;
|
|
166
|
-
}
|
|
167
|
-
this.setState((state) => {
|
|
168
|
-
const settledProps = { ...state.settledProps };
|
|
169
|
-
const settledStyle = { ...state.settledStyle };
|
|
170
|
-
for (const key in settledUpdates) {
|
|
171
|
-
if (animatedPropsKeys.has(key)) {
|
|
172
|
-
settledProps[key] = settledUpdates[key];
|
|
173
|
-
} else {
|
|
174
|
-
settledStyle[key] = settledUpdates[key];
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
return { settledProps, settledStyle };
|
|
178
|
-
});
|
|
150
|
+
this.setState((state) => ({
|
|
151
|
+
settledProps: { ...state.settledProps, ...props },
|
|
152
|
+
settledStyle: { ...state.settledStyle, ...style },
|
|
153
|
+
}));
|
|
179
154
|
// TODO(future): revert changes when animated styles are detached
|
|
180
155
|
}
|
|
181
156
|
|
|
@@ -152,7 +152,7 @@ export interface IAnimatedComponentInternal extends IAnimatedComponentInternalBa
|
|
|
152
152
|
_NativeEventsManager?: INativeEventsManager;
|
|
153
153
|
context: React.ContextType<typeof SkipEnteringContext>;
|
|
154
154
|
setNativeProps: (props: StyleProps) => void;
|
|
155
|
-
_syncStylePropsBackToReact: (props: StyleProps) => void;
|
|
155
|
+
_syncStylePropsBackToReact: (props: StyleProps, style: StyleProps) => void;
|
|
156
156
|
}
|
|
157
157
|
|
|
158
158
|
export type NestedArray<T> = T | NestedArray<T>[];
|
|
@@ -45,7 +45,9 @@ function setNativePropsNative(
|
|
|
45
45
|
const shadowNodeWrapper = (animatedRef as AnimatedRefOnUI)
|
|
46
46
|
.value as ShadowNodeWrapper;
|
|
47
47
|
processColorsInProps(updates);
|
|
48
|
-
global._updateProps!([
|
|
48
|
+
global._updateProps!([
|
|
49
|
+
{ shadowNodeWrapper, updates, isAnimatedProps: false },
|
|
50
|
+
]);
|
|
49
51
|
}
|
|
50
52
|
|
|
51
53
|
function setNativePropsJest() {
|
package/src/privateGlobals.d.ts
CHANGED
|
@@ -27,7 +27,7 @@ const updateProps: (
|
|
|
27
27
|
viewDescriptors: ViewDescriptorsWrapper,
|
|
28
28
|
updates: PropUpdates,
|
|
29
29
|
isAnimatedProps?: boolean
|
|
30
|
-
) => void = (viewDescriptors, updates, isAnimatedProps) => {
|
|
30
|
+
) => void = (viewDescriptors, updates, isAnimatedProps = false) => {
|
|
31
31
|
'worklet';
|
|
32
32
|
|
|
33
33
|
// TODO: Remove this if once we have SVG props builder implemented
|
|
@@ -53,7 +53,8 @@ const updateProps: (
|
|
|
53
53
|
// Use props builder only for style updaters, since animated props
|
|
54
54
|
// can contain any properties of different types, depending on the
|
|
55
55
|
// component, which we cannot process properly with the props builder.
|
|
56
|
-
isAnimatedProps ? updates : stylePropsBuilder.build(updates)
|
|
56
|
+
isAnimatedProps ? updates : stylePropsBuilder.build(updates),
|
|
57
|
+
isAnimatedProps
|
|
57
58
|
);
|
|
58
59
|
};
|
|
59
60
|
|
|
@@ -66,6 +67,7 @@ function updateJSProps(operations: JSPropsOperation[]) {
|
|
|
66
67
|
type NativePropsOperation = {
|
|
67
68
|
shadowNodeWrapper: ShadowNodeWrapper;
|
|
68
69
|
updates: StyleProps;
|
|
70
|
+
isAnimatedProps: boolean;
|
|
69
71
|
};
|
|
70
72
|
|
|
71
73
|
function createUpdatePropsManager() {
|
|
@@ -91,7 +93,11 @@ function createUpdatePropsManager() {
|
|
|
91
93
|
}, {});
|
|
92
94
|
|
|
93
95
|
return {
|
|
94
|
-
update(
|
|
96
|
+
update(
|
|
97
|
+
viewDescriptors: ViewDescriptorsWrapper,
|
|
98
|
+
updates: PropUpdates,
|
|
99
|
+
isAnimatedProps: boolean
|
|
100
|
+
) {
|
|
95
101
|
viewDescriptors.value.forEach(({ tag, shadowNodeWrapper }) => {
|
|
96
102
|
const viewTag = tag as number;
|
|
97
103
|
const { nativePropUpdates, jsPropUpdates } = processViewUpdates(
|
|
@@ -103,6 +109,7 @@ function createUpdatePropsManager() {
|
|
|
103
109
|
nativeOperations.push({
|
|
104
110
|
shadowNodeWrapper,
|
|
105
111
|
updates: nativePropUpdates,
|
|
112
|
+
isAnimatedProps,
|
|
106
113
|
});
|
|
107
114
|
}
|
|
108
115
|
if (jsPropUpdates) {
|