react-native-windows 0.0.0-canary.992 → 0.0.0-canary.993
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/.flowconfig +3 -1
- package/Libraries/Animated/Animated.js +0 -1
- package/Libraries/Animated/Animated.js.flow +0 -1
- package/Libraries/Animated/AnimatedExports.js +0 -1
- package/Libraries/Animated/AnimatedExports.js.flow +1 -2
- package/Libraries/Animated/animations/Animation.js +5 -2
- package/Libraries/Animated/components/AnimatedScrollView.js +53 -52
- package/Libraries/Animated/createAnimatedComponent.js +37 -33
- package/Libraries/Animated/nodes/AnimatedObject.js +2 -3
- package/Libraries/Animated/nodes/AnimatedProps.js +1 -1
- package/Libraries/Animated/shouldUseTurboAnimatedModule.js +6 -1
- package/Libraries/AppState/AppState.js +6 -1
- package/Libraries/Components/ActivityIndicator/ActivityIndicator.js +19 -18
- package/Libraries/Components/Button.js +2 -2
- package/Libraries/Components/Button.windows.js +2 -3
- package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js +2 -3
- package/Libraries/Components/Keyboard/KeyboardAvoidingView.js +2 -1
- package/Libraries/Components/LayoutConformance/LayoutConformance.js +0 -1
- package/Libraries/Components/Pressable/Pressable.js +9 -6
- package/Libraries/Components/Pressable/Pressable.windows.js +9 -6
- package/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.android.js +14 -13
- package/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.js +13 -1
- package/Libraries/Components/ProgressBarAndroid/ProgressBarAndroidTypes.js +29 -20
- package/Libraries/Components/ScrollView/ScrollView.d.ts +9 -5
- package/Libraries/Components/ScrollView/ScrollView.js +18 -12
- package/Libraries/Components/ScrollView/ScrollView.windows.js +19 -12
- package/Libraries/Components/ScrollView/ScrollViewContext.js +2 -1
- package/Libraries/Components/ScrollView/ScrollViewNativeComponentType.js +1 -1
- package/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +19 -6
- package/Libraries/Components/Switch/Switch.js +8 -2
- package/Libraries/Components/Switch/Switch.windows.js +8 -2
- package/Libraries/Components/TextInput/AndroidTextInputNativeComponent.js +1 -5
- package/Libraries/Components/TextInput/TextInput.flow.js +1 -5
- package/Libraries/Components/TextInput/TextInput.flow.windows.js +1 -6
- package/Libraries/Components/TextInput/TextInput.js +26 -25
- package/Libraries/Components/TextInput/TextInput.windows.js +27 -25
- package/Libraries/Components/TextInput/WindowsTextInputNativeComponent.js +1 -5
- package/Libraries/Components/Touchable/TouchableBounce.js +9 -3
- package/Libraries/Components/Touchable/TouchableBounce.windows.js +9 -3
- package/Libraries/Components/Touchable/TouchableHighlight.js +9 -4
- package/Libraries/Components/Touchable/TouchableHighlight.windows.js +9 -4
- package/Libraries/Components/Touchable/TouchableNativeFeedback.js +2 -1
- package/Libraries/Components/Touchable/TouchableNativeFeedback.windows.js +2 -1
- package/Libraries/Components/Touchable/TouchableOpacity.js +7 -3
- package/Libraries/Components/Touchable/TouchableOpacity.windows.js +7 -3
- package/Libraries/Components/Touchable/TouchableWithoutFeedback.js +2 -2
- package/Libraries/Components/Touchable/TouchableWithoutFeedback.windows.js +2 -2
- package/Libraries/Components/View/View.js +111 -25
- package/Libraries/Components/View/View.windows.js +427 -227
- package/Libraries/Core/Devtools/loadBundleFromServer.js +49 -7
- package/Libraries/Core/Devtools/loadBundleFromServer.windows.js +49 -7
- package/Libraries/Core/InitializeCore.js +1 -22
- package/Libraries/Core/ReactNativeVersion.js +3 -2
- package/Libraries/Debugging/DebuggingOverlay.js +6 -8
- package/Libraries/Debugging/DebuggingOverlayRegistry.js +0 -1
- package/Libraries/Debugging/useSubscribeToDebuggingOverlayRegistry.js +0 -1
- package/Libraries/EventEmitter/NativeEventEmitter.js +1 -1
- package/Libraries/Image/AssetRegistry.js +4 -10
- package/Libraries/Image/AssetSourceResolver.js +17 -4
- package/Libraries/Image/AssetSourceResolver.windows.js +17 -4
- package/Libraries/Image/Image.android.js +112 -106
- package/Libraries/Image/Image.ios.js +10 -2
- package/Libraries/Image/Image.windows.js +30 -20
- package/Libraries/Image/ImageAnalyticsTagContext.js +2 -2
- package/Libraries/Image/RelativeImageStub.js +1 -0
- package/Libraries/Lists/FlatList.d.ts +9 -5
- package/Libraries/Lists/FlatList.js +1 -1
- package/Libraries/Lists/SectionListModern.js +9 -3
- package/Libraries/LogBox/UI/LogBoxButton.js +2 -1
- package/Libraries/LogBox/UI/LogBoxInspectorReactFrames.js +2 -1
- package/Libraries/LogBox/UI/LogBoxInspectorReactFrames.windows.js +2 -1
- package/Libraries/LogBox/UI/LogBoxInspectorSourceMapStatus.js +3 -2
- package/Libraries/LogBox/UI/LogBoxInspectorStackFrames.js +2 -1
- package/Libraries/ReactNative/AppContainer-dev.js +4 -4
- package/Libraries/ReactNative/AppContainer-prod.js +0 -1
- package/Libraries/ReactNative/RootTag.js +2 -2
- package/Libraries/ReactPrivate/ReactNativePrivateInterface.js +1 -0
- package/Libraries/Renderer/shims/ReactNativeTypes.js +21 -25
- package/Libraries/Renderer/shims/ReactNativeTypes.windows.js +270 -0
- package/Libraries/StyleSheet/StyleSheetExports.js.flow +3 -1
- package/Libraries/StyleSheet/StyleSheetTypes.js +4 -3
- package/Libraries/StyleSheet/private/_TransformStyle.js +49 -21
- package/Libraries/StyleSheet/processBoxShadow.js +0 -1
- package/Libraries/StyleSheet/processFilter.js +0 -1
- package/Libraries/Text/Text.d.ts +1 -2
- package/Libraries/Text/Text.js +255 -244
- package/Libraries/Text/Text.windows.js +281 -300
- package/Libraries/Text/TextAncestor.js +3 -2
- package/Libraries/Text/TextProps.js +2 -34
- package/Libraries/Text/TextProps.windows.js +2 -34
- package/Libraries/Types/ReactDevToolsTypes.js +0 -1
- package/Libraries/Utilities/PerformanceLoggerContext.js +2 -2
- package/Libraries/Utilities/PlatformTypes.js +1 -1
- package/Libraries/vendor/core/ErrorUtils.js +28 -4
- package/Microsoft.ReactNative/Fabric/AbiComponentDescriptor.cpp +1 -1
- package/Microsoft.ReactNative/Fabric/AbiComponentDescriptor.h +1 -1
- package/Microsoft.ReactNative/Fabric/AbiShadowNode.h +1 -1
- package/Microsoft.ReactNative/Fabric/AbiViewComponentDescriptor.h +1 -1
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentDescriptor.h +2 -2
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.cpp +10 -9
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputShadowNode.cpp +21 -17
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputShadowNode.h +4 -4
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputState.cpp +19 -0
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputState.h +76 -0
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/textlayoutmanager/WindowsTextLayoutManager.cpp +6 -0
- package/Microsoft.ReactNative/Modules/PaperUIManagerModule.cpp +19 -2
- package/Microsoft.ReactNative/Utils/ThemeUtils.cpp +49 -0
- package/Microsoft.ReactNative/Utils/ThemeUtils.h +31 -0
- package/Microsoft.ReactNative/Views/ShadowNodeBase.cpp +36 -8
- package/Microsoft.ReactNative/Views/ShadowNodeRegistry.cpp +6 -2
- package/Microsoft.ReactNative/Views/ViewManagerBase.cpp +9 -1
- package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/Base.h +45 -34
- package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/Bool.h +1 -1
- package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/Bridging.h +1 -0
- package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/Class.h +36 -33
- package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/Number.h +10 -10
- package/PropertySheets/External/Microsoft.ReactNative.Cpp.Dependencies.props +10 -0
- package/PropertySheets/Generated/PackageVersion.g.props +2 -2
- package/PropertySheets/React.Cpp.props +1 -1
- package/ReactCommon/ReactCommon.vcxproj +10 -19
- package/ReactCommon/ReactCommon.vcxproj.filters +36 -13
- package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/NativeToJsBridge.cpp +1 -1
- package/ReactCommon/TEMP_UntilReactCommonUpdate/jsi/jsi/test/testlib.cpp +110 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/bridging/Bridging.h +1 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/nativemodule/dom/NativeDOM.cpp +19 -3
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/nativemodule/dom/NativeDOM.h +9 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/text/ParagraphShadowNode.cpp +459 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/text/platform/android/react/renderer/components/text/ParagraphState.h +92 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/view/AccessibilityPrimitives.h +35 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/view/AccessibilityProps.cpp +28 -1
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/css/CSSTokenizer.h +1 -2
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/runtime/ReactInstance.cpp +2 -1
- package/Scripts/creaternwapp.cmd +11 -8
- package/Shared/HermesRuntimeHolder.cpp +3 -1
- package/Shared/Shared.vcxitems +5 -1
- package/Shared/Shared.vcxitems.filters +4 -0
- package/codegen/NativeDOMSpec.g.h +6 -0
- package/codegen/NativeIntersectionObserverSpec.g.h +19 -5
- package/codegen/NativeMutationObserverSpec.g.h +11 -5
- package/codegen/NativeReactNativeFeatureFlagsSpec.g.h +104 -92
- package/codegen/react/components/rnwcore/States.h +8 -8
- package/codegen/rnwcoreJSI-generated.cpp +48 -3
- package/codegen/rnwcoreJSI.h +73 -10
- package/index.js +0 -1
- package/jest/mockNativeComponent.js +2 -1
- package/jest/renderer.js +0 -1
- package/jest/resolver.js +31 -0
- package/package.json +13 -13
- package/src/private/animated/NativeAnimatedHelper.js +6 -1
- package/src/private/animated/createAnimatedPropsHook.js +11 -4
- package/src/private/animated/createAnimatedPropsMemoHook.js +0 -1
- package/src/private/components/safeareaview/SafeAreaView_INTERNAL_DO_NOT_USE.js +0 -1
- package/src/private/components/scrollview/HScrollViewNativeComponents.js +0 -1
- package/src/private/components/scrollview/VScrollViewNativeComponents.js +0 -1
- package/src/private/devsupport/rndevtools/FuseboxSessionObserver.js +0 -1
- package/src/private/devsupport/rndevtools/ReactDevToolsSettingsManager.android.js +8 -9
- package/src/private/devsupport/rndevtools/ReactDevToolsSettingsManager.ios.js +12 -15
- package/src/private/devsupport/rndevtools/ReactDevToolsSettingsManager.windows.js +8 -9
- package/src/private/devsupport/rndevtools/setUpFuseboxReactDevToolsDispatcher.js +0 -1
- package/src/private/devsupport/rndevtools/specs/NativeReactDevToolsRuntimeSettingsModule.js +0 -1
- package/src/private/featureflags/ReactNativeFeatureFlags.js +39 -4
- package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +5 -2
- package/src/private/setup/setUpDefaultReactNativeEnvironment.js +44 -0
- package/src/private/styles/composeStyles.js +12 -5
- package/src/private/webapis/dom/events/Event.js +3 -0
- package/src/private/webapis/dom/events/EventTarget.js +3 -0
- package/src/private/webapis/dom/nodes/ReactNativeElement.js +6 -23
- package/src/private/webapis/dom/nodes/ReadOnlyNode.js +3 -1
- package/src/private/webapis/dom/nodes/specs/NativeDOM.js +38 -0
- package/src/private/webapis/dom/oldstylecollections/HTMLCollection.js +3 -0
- package/src/private/webapis/dom/oldstylecollections/NodeList.js +3 -0
- package/src/private/webapis/errors/DOMException.js +166 -0
- package/src/private/webapis/geometry/DOMRect.js +5 -0
- package/src/private/webapis/geometry/DOMRectList.js +3 -0
- package/src/private/webapis/geometry/DOMRectReadOnly.js +6 -0
- package/src/private/webapis/intersectionobserver/IntersectionObserver.js +15 -7
- package/src/private/webapis/intersectionobserver/IntersectionObserverEntry.js +3 -0
- package/src/private/webapis/intersectionobserver/internals/IntersectionObserverManager.js +80 -18
- package/src/private/webapis/intersectionobserver/specs/NativeIntersectionObserver.js +12 -0
- package/src/private/webapis/mutationobserver/MutationObserver.js +23 -33
- package/src/private/webapis/mutationobserver/MutationRecord.js +3 -0
- package/src/private/webapis/mutationobserver/internals/MutationObserverManager.js +56 -24
- package/src/private/webapis/mutationobserver/specs/NativeMutationObserver.js +4 -1
- package/src/private/webapis/performance/MemoryInfo.js +4 -1
- package/src/private/webapis/performance/Performance.js +19 -8
- package/src/private/webapis/performance/PerformanceEntry.js +4 -0
- package/src/private/webapis/performance/ReactNativeStartupTiming.js +4 -1
- package/src/private/webapis/performance/internals/RawPerformanceEntry.js +2 -0
- package/src/private/webapis/structuredClone/structuredClone.js +233 -0
- package/src/private/webapis/webidl/PlatformObjects.js +59 -0
- package/src/types/globals.d.ts +42 -0
- package/templates/cpp-lib/windows/MyLib/MyLib.vcxproj +0 -1
- package/types/index.d.ts +1 -1
- package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/JSExecutor.cpp +0 -78
- package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/JSExecutor.h +0 -196
package/.flowconfig
CHANGED
|
@@ -31,6 +31,7 @@
|
|
|
31
31
|
<PROJECT_ROOT>/Libraries/Image/resolveAssetSource.js
|
|
32
32
|
<PROJECT_ROOT>/Libraries/Network/RCTNetworking.js
|
|
33
33
|
<PROJECT_ROOT>/Libraries/Pressability/Pressability.js
|
|
34
|
+
<PROJECT_ROOT>/Libraries/Renderer/shims/ReactNativeTypes.js
|
|
34
35
|
<PROJECT_ROOT>/Libraries/Text/TextProps.js
|
|
35
36
|
<PROJECT_ROOT>/Libraries/Types/CoreEventTypes.js
|
|
36
37
|
<PROJECT_ROOT>/Libraries/LogBox/UI/LogBoxInspectorCodeFrame.js
|
|
@@ -95,6 +96,7 @@
|
|
|
95
96
|
; Ignore rn-tester Pods
|
|
96
97
|
<PROJECT_ROOT>/packages/rn-tester/Pods/
|
|
97
98
|
|
|
99
|
+
|
|
98
100
|
[untyped]
|
|
99
101
|
.*/node_modules/@react-native-community/cli/.*/.*
|
|
100
102
|
|
|
@@ -169,4 +171,4 @@ untyped-import
|
|
|
169
171
|
untyped-type-import
|
|
170
172
|
|
|
171
173
|
[version]
|
|
172
|
-
^0.
|
|
174
|
+
^0.271.0
|
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @flow
|
|
8
8
|
* @format
|
|
9
|
-
* @oncall react_native
|
|
10
9
|
*/
|
|
11
10
|
|
|
12
11
|
import AnimatedImplementation from './AnimatedImplementation';
|
|
@@ -37,7 +36,7 @@ export type {default as AnimatedDivision} from './nodes/AnimatedDivision';
|
|
|
37
36
|
export type {default as AnimatedModulo} from './nodes/AnimatedModulo';
|
|
38
37
|
export type {default as AnimatedMultiplication} from './nodes/AnimatedMultiplication';
|
|
39
38
|
export type {default as AnimatedSubtraction} from './nodes/AnimatedSubtraction';
|
|
40
|
-
export type {WithAnimatedValue} from './createAnimatedComponent';
|
|
39
|
+
export type {WithAnimatedValue, AnimatedProps} from './createAnimatedComponent';
|
|
41
40
|
export type {AnimatedComponentType as AnimatedComponent} from './createAnimatedComponent';
|
|
42
41
|
|
|
43
42
|
/**
|
|
@@ -13,6 +13,7 @@ import type AnimatedNode from '../nodes/AnimatedNode';
|
|
|
13
13
|
import type AnimatedValue from '../nodes/AnimatedValue';
|
|
14
14
|
|
|
15
15
|
import NativeAnimatedHelper from '../../../src/private/animated/NativeAnimatedHelper';
|
|
16
|
+
import * as ReactNativeFeatureFlags from '../../../src/private/featureflags/ReactNativeFeatureFlags';
|
|
16
17
|
import AnimatedProps from '../nodes/AnimatedProps';
|
|
17
18
|
|
|
18
19
|
export type EndResult = {
|
|
@@ -149,8 +150,10 @@ export default class Animation {
|
|
|
149
150
|
if (value != null) {
|
|
150
151
|
animatedValue.__onAnimatedValueUpdateReceived(value, offset);
|
|
151
152
|
|
|
152
|
-
if (
|
|
153
|
-
|
|
153
|
+
if (!ReactNativeFeatureFlags.cxxNativeAnimatedEnabled()) {
|
|
154
|
+
if (this.__isLooping === true) {
|
|
155
|
+
return;
|
|
156
|
+
}
|
|
154
157
|
}
|
|
155
158
|
|
|
156
159
|
// Once the JS side node is synced with the updated values, trigger an
|
|
@@ -9,7 +9,10 @@
|
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
import type {____ViewStyle_Internal} from '../../StyleSheet/StyleSheetTypes';
|
|
12
|
-
import type {
|
|
12
|
+
import type {
|
|
13
|
+
AnimatedComponentType,
|
|
14
|
+
AnimatedProps,
|
|
15
|
+
} from '../createAnimatedComponent';
|
|
13
16
|
|
|
14
17
|
import RefreshControl from '../../Components/RefreshControl/RefreshControl';
|
|
15
18
|
import ScrollView from '../../Components/ScrollView/ScrollView';
|
|
@@ -21,7 +24,7 @@ import useMergeRefs from '../../Utilities/useMergeRefs';
|
|
|
21
24
|
import createAnimatedComponent from '../createAnimatedComponent';
|
|
22
25
|
import useAnimatedProps from '../useAnimatedProps';
|
|
23
26
|
import * as React from 'react';
|
|
24
|
-
import {useMemo} from 'react';
|
|
27
|
+
import {cloneElement, useMemo} from 'react';
|
|
25
28
|
|
|
26
29
|
type AnimatedScrollViewProps = React.ElementConfig<typeof ScrollView>;
|
|
27
30
|
type AnimatedScrollViewInstance = React.ElementRef<typeof ScrollView>;
|
|
@@ -32,55 +35,54 @@ type AnimatedScrollViewInstance = React.ElementRef<typeof ScrollView>;
|
|
|
32
35
|
const AnimatedScrollView: AnimatedComponentType<
|
|
33
36
|
AnimatedScrollViewProps,
|
|
34
37
|
AnimatedScrollViewInstance,
|
|
35
|
-
> =
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
38
|
+
> = function AnimatedScrollViewWithOrWithoutInvertedRefreshControl({
|
|
39
|
+
ref: forwardedRef,
|
|
40
|
+
...props
|
|
41
|
+
}: {
|
|
42
|
+
ref?: React.RefSetter<AnimatedScrollViewInstance>,
|
|
43
|
+
...AnimatedProps<AnimatedScrollViewProps>,
|
|
44
|
+
}) {
|
|
45
|
+
// (Android only) When a ScrollView has a RefreshControl and
|
|
46
|
+
// any `style` property set with an Animated.Value, the CSS
|
|
47
|
+
// gets incorrectly applied twice. This is because ScrollView
|
|
48
|
+
// swaps the parent/child relationship of itself and the
|
|
49
|
+
// RefreshControl component (see ScrollView.js for more details).
|
|
50
|
+
if (
|
|
51
|
+
Platform.OS === 'android' &&
|
|
52
|
+
props.refreshControl != null &&
|
|
53
|
+
props.style != null
|
|
39
54
|
) {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
)
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
} else {
|
|
61
|
-
return (
|
|
62
|
-
<AnimatedScrollViewWithoutInvertedRefreshControl
|
|
63
|
-
scrollEventThrottle={0.0001}
|
|
64
|
-
{...props}
|
|
65
|
-
ref={forwardedRef}
|
|
66
|
-
/>
|
|
67
|
-
);
|
|
68
|
-
}
|
|
69
|
-
},
|
|
70
|
-
);
|
|
55
|
+
return (
|
|
56
|
+
// $FlowFixMe - It should return an Animated ScrollView but it returns a ScrollView with Animated props applied.
|
|
57
|
+
<AnimatedScrollViewWithInvertedRefreshControl
|
|
58
|
+
scrollEventThrottle={0.0001}
|
|
59
|
+
{...props}
|
|
60
|
+
ref={forwardedRef}
|
|
61
|
+
// $FlowFixMe[incompatible-type]
|
|
62
|
+
refreshControl={props.refreshControl}
|
|
63
|
+
/>
|
|
64
|
+
);
|
|
65
|
+
} else {
|
|
66
|
+
return (
|
|
67
|
+
<AnimatedScrollViewWithoutInvertedRefreshControl
|
|
68
|
+
scrollEventThrottle={0.0001}
|
|
69
|
+
{...props}
|
|
70
|
+
ref={forwardedRef}
|
|
71
|
+
/>
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
};
|
|
71
75
|
|
|
72
|
-
const AnimatedScrollViewWithInvertedRefreshControl =
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
props
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
| ((AnimatedScrollViewInstance | null) => mixed),
|
|
83
|
-
) {
|
|
76
|
+
const AnimatedScrollViewWithInvertedRefreshControl =
|
|
77
|
+
function AnimatedScrollViewWithInvertedRefreshControl({
|
|
78
|
+
ref: forwardedRef,
|
|
79
|
+
...props
|
|
80
|
+
}: {
|
|
81
|
+
ref?: React.RefSetter<AnimatedScrollViewInstance>,
|
|
82
|
+
...React.ElementConfig<typeof ScrollView>,
|
|
83
|
+
// $FlowFixMe[unclear-type] Same Flow type as `refreshControl` in ScrollView
|
|
84
|
+
refreshControl: ExactReactElement_DEPRECATED<any>,
|
|
85
|
+
}) {
|
|
84
86
|
// Split `props` into the animate-able props for the parent (RefreshControl)
|
|
85
87
|
// and child (ScrollView).
|
|
86
88
|
const {intermediatePropsForRefreshControl, intermediatePropsForScrollView} =
|
|
@@ -102,7 +104,7 @@ const AnimatedScrollViewWithInvertedRefreshControl = React.forwardRef(
|
|
|
102
104
|
// NOTE: Assumes that refreshControl.ref` and `refreshControl.style` can be
|
|
103
105
|
// safely clobbered.
|
|
104
106
|
const refreshControl: ExactReactElement_DEPRECATED<typeof RefreshControl> =
|
|
105
|
-
|
|
107
|
+
cloneElement(props.refreshControl, {
|
|
106
108
|
...refreshControlAnimatedProps,
|
|
107
109
|
ref: refreshControlRef,
|
|
108
110
|
});
|
|
@@ -134,8 +136,7 @@ const AnimatedScrollViewWithInvertedRefreshControl = React.forwardRef(
|
|
|
134
136
|
)}
|
|
135
137
|
/>
|
|
136
138
|
);
|
|
137
|
-
}
|
|
138
|
-
);
|
|
139
|
+
};
|
|
139
140
|
|
|
140
141
|
const AnimatedScrollViewWithoutInvertedRefreshControl =
|
|
141
142
|
createAnimatedComponent(ScrollView);
|
|
@@ -105,41 +105,45 @@ export function unstable_createAnimatedComponentWithAllowlist<
|
|
|
105
105
|
const AnimatedComponent: AnimatedComponentType<
|
|
106
106
|
TProps,
|
|
107
107
|
React.ElementRef<TInstance>,
|
|
108
|
-
> =
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
108
|
+
> = ({
|
|
109
|
+
ref: forwardedRef,
|
|
110
|
+
...props
|
|
111
|
+
}: {
|
|
112
|
+
ref?: React.RefSetter<React.ElementRef<TInstance>>,
|
|
113
|
+
...AnimatedProps<TProps>,
|
|
114
|
+
}) => {
|
|
115
|
+
const [reducedProps, callbackRef] = useAnimatedProps<
|
|
116
|
+
TProps,
|
|
117
|
+
React.ElementRef<TInstance>,
|
|
118
|
+
>(props);
|
|
119
|
+
const ref = useMergeRefs<React.ElementRef<TInstance>>(
|
|
120
|
+
callbackRef,
|
|
121
|
+
forwardedRef,
|
|
122
|
+
);
|
|
118
123
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
124
|
+
// Some components require explicit passthrough values for animation
|
|
125
|
+
// to work properly. For example, if an animated component is
|
|
126
|
+
// transformed and Pressable, onPress will not work after transform
|
|
127
|
+
// without these passthrough values.
|
|
128
|
+
// $FlowFixMe[prop-missing]
|
|
129
|
+
const {passthroughAnimatedPropExplicitValues, style} = reducedProps;
|
|
130
|
+
const passthroughStyle = passthroughAnimatedPropExplicitValues?.style;
|
|
131
|
+
const mergedStyle = useMemo(
|
|
132
|
+
() => composeStyles(style, passthroughStyle),
|
|
133
|
+
[passthroughStyle, style],
|
|
134
|
+
);
|
|
130
135
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
);
|
|
136
|
+
// NOTE: It is important that `passthroughAnimatedPropExplicitValues` is
|
|
137
|
+
// spread after `reducedProps` but before `style`.
|
|
138
|
+
return (
|
|
139
|
+
<Component
|
|
140
|
+
{...reducedProps}
|
|
141
|
+
{...passthroughAnimatedPropExplicitValues}
|
|
142
|
+
style={mergedStyle}
|
|
143
|
+
ref={ref}
|
|
144
|
+
/>
|
|
145
|
+
);
|
|
146
|
+
};
|
|
143
147
|
|
|
144
148
|
AnimatedComponent.displayName = `Animated(${
|
|
145
149
|
Component.displayName || 'Anonymous'
|
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @flow
|
|
8
8
|
* @format
|
|
9
|
-
* @oncall react_native
|
|
10
9
|
*/
|
|
11
10
|
|
|
12
11
|
'use strict';
|
|
@@ -16,7 +15,7 @@ import type {AnimatedNodeConfig} from './AnimatedNode';
|
|
|
16
15
|
|
|
17
16
|
import AnimatedNode from './AnimatedNode';
|
|
18
17
|
import AnimatedWithChildren from './AnimatedWithChildren';
|
|
19
|
-
import
|
|
18
|
+
import {isValidElement} from 'react';
|
|
20
19
|
|
|
21
20
|
const MAX_DEPTH = 5;
|
|
22
21
|
|
|
@@ -30,7 +29,7 @@ export function isPlainObject(
|
|
|
30
29
|
value !== null &&
|
|
31
30
|
typeof value === 'object' &&
|
|
32
31
|
Object.getPrototypeOf(value).isPrototypeOf(Object) &&
|
|
33
|
-
!
|
|
32
|
+
!isValidElement(value)
|
|
34
33
|
);
|
|
35
34
|
}
|
|
36
35
|
|
|
@@ -8,10 +8,15 @@
|
|
|
8
8
|
* @format
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
+
import * as ReactNativeFeatureFlags from '../../src/private/featureflags/ReactNativeFeatureFlags';
|
|
11
12
|
import Platform from '../Utilities/Platform';
|
|
12
13
|
|
|
13
14
|
function shouldUseTurboAnimatedModule(): boolean {
|
|
14
|
-
|
|
15
|
+
if (ReactNativeFeatureFlags.cxxNativeAnimatedEnabled()) {
|
|
16
|
+
return false;
|
|
17
|
+
} else {
|
|
18
|
+
return Platform.OS === 'ios' && global.RN$Bridgeless === true;
|
|
19
|
+
}
|
|
15
20
|
}
|
|
16
21
|
|
|
17
22
|
export default shouldUseTurboAnimatedModule;
|
|
@@ -22,7 +22,12 @@ import NativeAppState from './NativeAppState';
|
|
|
22
22
|
* - @platform android - on another Activity (even if it was launched by your app)
|
|
23
23
|
* @platform ios - inactive - This is a state that occurs when transitioning between foreground & background, and during periods of inactivity such as entering the multitasking view, opening the Notification Center or in the event of an incoming call.
|
|
24
24
|
*/
|
|
25
|
-
export type AppStateStatus =
|
|
25
|
+
export type AppStateStatus =
|
|
26
|
+
| 'inactive'
|
|
27
|
+
| 'background'
|
|
28
|
+
| 'active'
|
|
29
|
+
| 'extension'
|
|
30
|
+
| 'unknown';
|
|
26
31
|
|
|
27
32
|
/**
|
|
28
33
|
* change - This even is received when the app state has changed.
|
|
@@ -60,18 +60,22 @@ export type ActivityIndicatorProps = $ReadOnly<{
|
|
|
60
60
|
size?: ?IndicatorSize,
|
|
61
61
|
}>;
|
|
62
62
|
|
|
63
|
-
const ActivityIndicator
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
63
|
+
const ActivityIndicator: component(
|
|
64
|
+
ref?: React.RefSetter<HostComponent<empty>>,
|
|
65
|
+
...props: ActivityIndicatorProps
|
|
66
|
+
) = ({
|
|
67
|
+
ref: forwardedRef,
|
|
68
|
+
animating = true,
|
|
69
|
+
color = Platform.OS === 'ios' ? GRAY : null,
|
|
70
|
+
hidesWhenStopped = true,
|
|
71
|
+
onLayout,
|
|
72
|
+
size = 'small',
|
|
73
|
+
style,
|
|
74
|
+
...restProps
|
|
75
|
+
}: {
|
|
76
|
+
ref?: any,
|
|
77
|
+
...ActivityIndicatorProps,
|
|
78
|
+
}) => {
|
|
75
79
|
let sizeStyle;
|
|
76
80
|
let sizeProp;
|
|
77
81
|
|
|
@@ -110,6 +114,7 @@ const ActivityIndicator = (
|
|
|
110
114
|
style={StyleSheet.compose(styles.container, style)}>
|
|
111
115
|
{Platform.OS === 'android' ? (
|
|
112
116
|
// $FlowFixMe[prop-missing] Flow doesn't know when this is the android component
|
|
117
|
+
// $FlowFixMe[incompatible-type]
|
|
113
118
|
<PlatformActivityIndicator {...nativeProps} {...androidProps} />
|
|
114
119
|
) : (
|
|
115
120
|
/* $FlowFixMe[incompatible-type] (>=0.106.0 site=react_native_android_fb) This comment
|
|
@@ -153,11 +158,7 @@ const ActivityIndicator = (
|
|
|
153
158
|
```
|
|
154
159
|
*/
|
|
155
160
|
|
|
156
|
-
|
|
157
|
-
ref?: React.RefSetter<HostComponent<empty>>,
|
|
158
|
-
...props: ActivityIndicatorProps
|
|
159
|
-
) = React.forwardRef(ActivityIndicator);
|
|
160
|
-
ActivityIndicatorWithRef.displayName = 'ActivityIndicator';
|
|
161
|
+
ActivityIndicator.displayName = 'ActivityIndicator';
|
|
161
162
|
|
|
162
163
|
const styles = StyleSheet.create({
|
|
163
164
|
container: {
|
|
@@ -174,4 +175,4 @@ const styles = StyleSheet.create({
|
|
|
174
175
|
},
|
|
175
176
|
});
|
|
176
177
|
|
|
177
|
-
export default
|
|
178
|
+
export default ActivityIndicator;
|
|
@@ -288,7 +288,7 @@ type ButtonRef = React.ElementRef<typeof Touchable>;
|
|
|
288
288
|
const Button: component(
|
|
289
289
|
ref?: React.RefSetter<ButtonRef>,
|
|
290
290
|
...props: ButtonProps
|
|
291
|
-
) =
|
|
291
|
+
) = ({ref, ...props}: {ref?: React.RefSetter<ButtonRef>, ...ButtonProps}) => {
|
|
292
292
|
const {
|
|
293
293
|
accessibilityLabel,
|
|
294
294
|
accessibilityState,
|
|
@@ -392,7 +392,7 @@ const Button: component(
|
|
|
392
392
|
</View>
|
|
393
393
|
</Touchable>
|
|
394
394
|
);
|
|
395
|
-
}
|
|
395
|
+
};
|
|
396
396
|
|
|
397
397
|
Button.displayName = 'Button';
|
|
398
398
|
|
|
@@ -310,8 +310,7 @@ type ButtonRef = React.ElementRef<typeof TouchableHighlight>;
|
|
|
310
310
|
const Button: component(
|
|
311
311
|
ref?: React.RefSetter<ButtonRef>,
|
|
312
312
|
...props: ButtonProps
|
|
313
|
-
) =
|
|
314
|
-
// Windows
|
|
313
|
+
) = ({ref, ...props}: {ref?: React.RefSetter<ButtonRef>, ...ButtonProps}) => {
|
|
315
314
|
// [Windows
|
|
316
315
|
const [hover, setHover] = React.useState(false);
|
|
317
316
|
const [pressed, setPressed] = React.useState(false);
|
|
@@ -545,7 +544,7 @@ const Button: component(
|
|
|
545
544
|
);
|
|
546
545
|
}
|
|
547
546
|
// Windows]
|
|
548
|
-
}
|
|
547
|
+
};
|
|
549
548
|
|
|
550
549
|
Button.displayName = 'Button';
|
|
551
550
|
|
|
@@ -28,6 +28,7 @@ import AndroidDrawerLayoutNativeComponent, {
|
|
|
28
28
|
} from './AndroidDrawerLayoutNativeComponent';
|
|
29
29
|
import nullthrows from 'nullthrows';
|
|
30
30
|
import * as React from 'react';
|
|
31
|
+
import {createRef} from 'react';
|
|
31
32
|
|
|
32
33
|
const DRAWER_STATES = ['Idle', 'Dragging', 'Settling'];
|
|
33
34
|
|
|
@@ -76,9 +77,7 @@ class DrawerLayoutAndroid
|
|
|
76
77
|
|
|
77
78
|
// $FlowFixMe[missing-local-annot]
|
|
78
79
|
_nativeRef =
|
|
79
|
-
React.
|
|
80
|
-
React.ElementRef<typeof AndroidDrawerLayoutNativeComponent>,
|
|
81
|
-
>();
|
|
80
|
+
createRef<React.ElementRef<typeof AndroidDrawerLayoutNativeComponent>>();
|
|
82
81
|
|
|
83
82
|
state: DrawerLayoutAndroidState = {
|
|
84
83
|
drawerOpened: false,
|
|
@@ -24,6 +24,7 @@ import AccessibilityInfo from '../AccessibilityInfo/AccessibilityInfo';
|
|
|
24
24
|
import View from '../View/View';
|
|
25
25
|
import Keyboard from './Keyboard';
|
|
26
26
|
import * as React from 'react';
|
|
27
|
+
import {createRef} from 'react';
|
|
27
28
|
|
|
28
29
|
export type KeyboardAvoidingViewProps = $ReadOnly<{
|
|
29
30
|
...ViewProps,
|
|
@@ -73,7 +74,7 @@ class KeyboardAvoidingView extends React.Component<
|
|
|
73
74
|
constructor(props: KeyboardAvoidingViewProps) {
|
|
74
75
|
super(props);
|
|
75
76
|
this.state = {bottom: 0};
|
|
76
|
-
this.viewRef =
|
|
77
|
+
this.viewRef = createRef();
|
|
77
78
|
}
|
|
78
79
|
|
|
79
80
|
async _relativeKeyboardHeight(
|
|
@@ -24,7 +24,7 @@ import useAndroidRippleForView, {
|
|
|
24
24
|
type PressableAndroidRippleConfig,
|
|
25
25
|
} from './useAndroidRippleForView';
|
|
26
26
|
import * as React from 'react';
|
|
27
|
-
import {useMemo, useRef, useState} from 'react';
|
|
27
|
+
import {memo, useMemo, useRef, useState} from 'react';
|
|
28
28
|
|
|
29
29
|
type ViewStyleProp = React.ElementConfig<typeof View>['style'];
|
|
30
30
|
|
|
@@ -165,10 +165,13 @@ type Instance = React.ElementRef<typeof View>;
|
|
|
165
165
|
* Component used to build display components that should respond to whether the
|
|
166
166
|
* component is currently pressed or not.
|
|
167
167
|
*/
|
|
168
|
-
function Pressable(
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
168
|
+
function Pressable({
|
|
169
|
+
ref: forwardedRef,
|
|
170
|
+
...props
|
|
171
|
+
}: {
|
|
172
|
+
ref?: React.RefSetter<Instance>,
|
|
173
|
+
...PressableProps,
|
|
174
|
+
}): React.Node {
|
|
172
175
|
const {
|
|
173
176
|
accessible,
|
|
174
177
|
accessibilityState,
|
|
@@ -331,7 +334,7 @@ function usePressState(forcePressed: boolean): [boolean, (boolean) => void] {
|
|
|
331
334
|
return [pressed || forcePressed, setPressed];
|
|
332
335
|
}
|
|
333
336
|
|
|
334
|
-
const MemoedPressable =
|
|
337
|
+
const MemoedPressable = memo(Pressable);
|
|
335
338
|
MemoedPressable.displayName = 'Pressable';
|
|
336
339
|
|
|
337
340
|
export default (MemoedPressable: component(
|
|
@@ -28,7 +28,7 @@ import useAndroidRippleForView, {
|
|
|
28
28
|
type PressableAndroidRippleConfig,
|
|
29
29
|
} from './useAndroidRippleForView';
|
|
30
30
|
import * as React from 'react';
|
|
31
|
-
import {useMemo, useRef, useState} from 'react';
|
|
31
|
+
import {memo, useMemo, useRef, useState} from 'react';
|
|
32
32
|
import type {HandledKeyboardEvent} from '../../Components/View/ViewPropTypes';
|
|
33
33
|
|
|
34
34
|
type ViewStyleProp = React.ElementConfig<typeof View>['style'];
|
|
@@ -210,10 +210,13 @@ type Instance = React.ElementRef<typeof View>;
|
|
|
210
210
|
* Component used to build display components that should respond to whether the
|
|
211
211
|
* component is currently pressed or not.
|
|
212
212
|
*/
|
|
213
|
-
function Pressable(
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
213
|
+
function Pressable({
|
|
214
|
+
ref: forwardedRef,
|
|
215
|
+
...props
|
|
216
|
+
}: {
|
|
217
|
+
ref?: React.RefSetter<Instance>,
|
|
218
|
+
...PressableProps,
|
|
219
|
+
}): React.Node {
|
|
217
220
|
const {
|
|
218
221
|
accessible,
|
|
219
222
|
accessibilityState,
|
|
@@ -400,7 +403,7 @@ function usePressState(forcePressed: boolean): [boolean, (boolean) => void] {
|
|
|
400
403
|
return [pressed || forcePressed, setPressed];
|
|
401
404
|
}
|
|
402
405
|
|
|
403
|
-
const MemoedPressable =
|
|
406
|
+
const MemoedPressable = memo(Pressable);
|
|
404
407
|
MemoedPressable.displayName = 'Pressable';
|
|
405
408
|
|
|
406
409
|
export default (MemoedPressable: component(
|
|
@@ -39,23 +39,24 @@ export type {ProgressBarAndroidProps};
|
|
|
39
39
|
* },
|
|
40
40
|
* ```
|
|
41
41
|
*/
|
|
42
|
-
const
|
|
42
|
+
const ProgressBarAndroid: component(
|
|
43
43
|
ref?: React.RefSetter<
|
|
44
44
|
React.ElementRef<typeof ProgressBarAndroidNativeComponent>,
|
|
45
45
|
>,
|
|
46
46
|
...props: ProgressBarAndroidProps
|
|
47
|
-
) =
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
47
|
+
) = function ProgressBarAndroid({
|
|
48
|
+
ref: forwardedRef,
|
|
49
|
+
// $FlowFixMe[incompatible-type]
|
|
50
|
+
styleAttr = 'Normal',
|
|
51
|
+
indeterminate = true,
|
|
52
|
+
animating = true,
|
|
53
|
+
...restProps
|
|
54
|
+
}: {
|
|
55
|
+
ref?: React.RefSetter<
|
|
56
56
|
React.ElementRef<typeof ProgressBarAndroidNativeComponent>,
|
|
57
57
|
>,
|
|
58
|
-
|
|
58
|
+
...ProgressBarAndroidProps,
|
|
59
|
+
}) {
|
|
59
60
|
return (
|
|
60
61
|
<ProgressBarAndroidNativeComponent
|
|
61
62
|
styleAttr={styleAttr}
|
|
@@ -65,6 +66,6 @@ const ProgressBarAndroidWithForwardedRef: component(
|
|
|
65
66
|
ref={forwardedRef}
|
|
66
67
|
/>
|
|
67
68
|
);
|
|
68
|
-
}
|
|
69
|
+
};
|
|
69
70
|
|
|
70
|
-
export default
|
|
71
|
+
export default ProgressBarAndroid;
|