diff --git a/change/@office-iss-react-native-win32-d9d51616-e863-4814-9731-b55e765d0ded.json b/change/@office-iss-react-native-win32-d9d51616-e863-4814-9731-b55e765d0ded.json new file mode 100644 index 00000000000..e752519ecc4 --- /dev/null +++ b/change/@office-iss-react-native-win32-d9d51616-e863-4814-9731-b55e765d0ded.json @@ -0,0 +1,7 @@ +{ + "type": "prerelease", + "comment": "integraye nightly", + "packageName": "@office-iss/react-native-win32", + "email": "74712637+iamAbhi-916@users.noreply.github.com", + "dependentChangeType": "patch" +} diff --git a/change/@react-native-windows-automation-channel-dbc77308-3e6b-4bb5-8d82-e224137795f9.json b/change/@react-native-windows-automation-channel-dbc77308-3e6b-4bb5-8d82-e224137795f9.json new file mode 100644 index 00000000000..ea50b4c5391 --- /dev/null +++ b/change/@react-native-windows-automation-channel-dbc77308-3e6b-4bb5-8d82-e224137795f9.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "fix", + "packageName": "@react-native-windows/automation-channel", + "email": "74712637+iamAbhi-916@users.noreply.github.com", + "dependentChangeType": "patch" +} diff --git a/change/react-native-platform-override-782dbef9-4234-4204-aa7a-599b6c4e7809.json b/change/react-native-platform-override-782dbef9-4234-4204-aa7a-599b6c4e7809.json new file mode 100644 index 00000000000..7a46ce408c2 --- /dev/null +++ b/change/react-native-platform-override-782dbef9-4234-4204-aa7a-599b6c4e7809.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "fix", + "packageName": "react-native-platform-override", + "email": "74712637+iamAbhi-916@users.noreply.github.com", + "dependentChangeType": "patch" +} diff --git a/change/react-native-windows-f2a1b3c0-2bed-48e4-9fc6-bd09cec743bf.json b/change/react-native-windows-f2a1b3c0-2bed-48e4-9fc6-bd09cec743bf.json new file mode 100644 index 00000000000..15b21420d7f --- /dev/null +++ b/change/react-native-windows-f2a1b3c0-2bed-48e4-9fc6-bd09cec743bf.json @@ -0,0 +1,7 @@ +{ + "type": "prerelease", + "comment": "fix", + "packageName": "react-native-windows", + "email": "74712637+iamAbhi-916@users.noreply.github.com", + "dependentChangeType": "patch" +} diff --git a/packages/@office-iss/react-native-win32-tester/overrides.json b/packages/@office-iss/react-native-win32-tester/overrides.json index c88646b2f7e..112fa8c4495 100644 --- a/packages/@office-iss/react-native-win32-tester/overrides.json +++ b/packages/@office-iss/react-native-win32-tester/overrides.json @@ -5,13 +5,13 @@ "excludePatterns": [ "src/js/examples-win32/**" ], - "baseVersion": "0.80.0-nightly-20250506-3ac16dd6a", + "baseVersion": "0.81.0-nightly-20250521-3cb70bb6a", "overrides": [ { "type": "patch", "file": "src/js/components/ListExampleShared.win32.js", "baseFile": "packages/rn-tester/js/components/ListExampleShared.js", - "baseHash": "d39ad505e22d525b00b8f63165ce2c2bbcc86152" + "baseHash": "eb604f3c06468e8aaa2671985a772b26f666e5de" }, { "type": "patch", diff --git a/packages/@office-iss/react-native-win32-tester/package.json b/packages/@office-iss/react-native-win32-tester/package.json index 424f704fcb1..52c51022b90 100644 --- a/packages/@office-iss/react-native-win32-tester/package.json +++ b/packages/@office-iss/react-native-win32-tester/package.json @@ -30,7 +30,7 @@ "@types/node": "^18.0.0", "eslint": "^8.19.0", "just-scripts": "^1.3.3", - "react-native": "0.80.0-nightly-20250506-3ac16dd6a", + "react-native": "0.81.0-nightly-20250521-3cb70bb6a", "react-native-platform-override": "^1.9.56", "typescript": "5.0.4" }, diff --git a/packages/@office-iss/react-native-win32-tester/src/js/components/ListExampleShared.win32.js b/packages/@office-iss/react-native-win32-tester/src/js/components/ListExampleShared.win32.js index 6c0d7732b43..ca1d28b09e0 100644 --- a/packages/@office-iss/react-native-win32-tester/src/js/components/ListExampleShared.win32.js +++ b/packages/@office-iss/react-native-win32-tester/src/js/components/ListExampleShared.win32.js @@ -12,6 +12,7 @@ import RNTesterText from './RNTesterText'; import React from 'react'; +import {memo} from 'react'; import { ActivityIndicator, Animated, @@ -164,7 +165,7 @@ class SeparatorComponent extends React.PureComponent<{...}> { } } -const LoadingComponent: React.ComponentType<{}> = React.memo(() => ( +const LoadingComponent: React.ComponentType<{}> = memo(() => ( diff --git a/packages/@office-iss/react-native-win32/.flowconfig b/packages/@office-iss/react-native-win32/.flowconfig index d7e5a6eb497..a80fb2da7b5 100644 --- a/packages/@office-iss/react-native-win32/.flowconfig +++ b/packages/@office-iss/react-native-win32/.flowconfig @@ -174,4 +174,4 @@ untyped-import untyped-type-import [version] -^0.269.1 +^0.271.0 diff --git a/packages/@office-iss/react-native-win32/overrides.json b/packages/@office-iss/react-native-win32/overrides.json index 794ea150210..4f64971ef6f 100644 --- a/packages/@office-iss/react-native-win32/overrides.json +++ b/packages/@office-iss/react-native-win32/overrides.json @@ -7,19 +7,19 @@ "**/__snapshots__/**", "src-win/rntypes/**" ], - "baseVersion": "0.80.0-nightly-20250506-3ac16dd6a", + "baseVersion": "0.81.0-nightly-20250521-3cb70bb6a", "overrides": [ { "type": "derived", "file": ".flowconfig", "baseFile": ".flowconfig", - "baseHash": "70ed729d5f52c241530e8459cc40263d4e9fa9c0" + "baseHash": "dbea35126905a8314fa0a64ed2912896bc6d307b" }, { "type": "derived", "file": "src-win/index.win32.js", "baseFile": "packages/react-native/index.js", - "baseHash": "96361b83bfc122f1d78cc7d87ea0d7c3bfac138f" + "baseHash": "b447e699186ab3e95da9dc4520b9c2517776e723" }, { "type": "platform", @@ -60,7 +60,7 @@ "type": "derived", "file": "src-win/Libraries/Components/Button.win32.js", "baseFile": "packages/react-native/Libraries/Components/Button.js", - "baseHash": "4e77e13aa5774e813fbd874a13a920ea12e3ed91" + "baseHash": "6063d726e6255d1c55e07587f9ce09f1b7284301" }, { "type": "platform", @@ -85,14 +85,14 @@ "type": "patch", "file": "src-win/Libraries/Components/Pressable/Pressable.win32.js", "baseFile": "packages/react-native/Libraries/Components/Pressable/Pressable.js", - "baseHash": "96bdd4aebf4133fd2fe6d1b448f9d7b4cd3e8982", + "baseHash": "eff51d201199c68c6f7ca268e315e538dcc01ab9", "issue": 6240 }, { "type": "patch", "file": "src-win/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.js", "baseFile": "packages/react-native/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.js", - "baseHash": "c96925930d9664306a8aef8b4102c43055ea03be" + "baseHash": "d1cc663442d184b62799b748c475a5a2c5c558c7" }, { "type": "copy", @@ -108,13 +108,13 @@ "type": "derived", "file": "src-win/Libraries/Components/TextInput/TextInput.flow.win32.js", "baseFile": "packages/react-native/Libraries/Components/TextInput/TextInput.flow.js", - "baseHash": "f407548782cade71af32a52ecb440f72a403f06e" + "baseHash": "b611f4e98e9c7818dfac087e4f14384d3cc16b6a" }, { "type": "derived", "file": "src-win/Libraries/Components/TextInput/TextInput.win32.js", "baseFile": "packages/react-native/Libraries/Components/TextInput/TextInput.js", - "baseHash": "9965c0079652083ab549bc2799eb9528b56a1b2d" + "baseHash": "2a5835c5cbdb36bd110e26f9be737aaaeb1fd97c" }, { "type": "patch", @@ -153,7 +153,7 @@ "type": "derived", "file": "src-win/Libraries/Components/Touchable/TouchableNativeFeedback.win32.js", "baseFile": "packages/react-native/Libraries/Components/Touchable/TouchableNativeFeedback.js", - "baseHash": "8706705c1f8d3dd5390ea631ce5ae60e300ae50d" + "baseHash": "1cad0522ba348d657e7857bf84628d88e776170b" }, { "type": "platform", @@ -177,7 +177,7 @@ "type": "patch", "file": "src-win/Libraries/Components/View/View.win32.js", "baseFile": "packages/react-native/Libraries/Components/View/View.js", - "baseHash": "2dd3e58cf6c4bc0882550eedd8150435972365eb" + "baseHash": "121c2126d26c94c8e508e3fb19ffe33f7be814b1" }, { "type": "derived", @@ -218,7 +218,7 @@ "type": "patch", "file": "src-win/Libraries/Core/Devtools/loadBundleFromServer.win32.js", "baseFile": "packages/react-native/Libraries/Core/Devtools/loadBundleFromServer.js", - "baseHash": "e0158fd16d4a787e5a94d69e2b7a721e81b7c3da", + "baseHash": "ac08c96a4bebd677597a40ea1525a2d5d1ee8742", "issue": 12704 }, { @@ -236,7 +236,7 @@ "type": "derived", "file": "src-win/Libraries/Image/Image.win32.js", "baseFile": "packages/react-native/Libraries/Image/Image.ios.js", - "baseHash": "c0bc913aa95b6d1309ba44ef7968ba58fc488427", + "baseHash": "5d62f4a6c4edfe3007eb3b80704a1dfb68e5ff8a", "issue": 4320 }, { @@ -303,13 +303,13 @@ "type": "derived", "file": "src-win/Libraries/LogBox/UI/LogBoxInspectorReactFrames.win32.js", "baseFile": "packages/react-native/Libraries/LogBox/UI/LogBoxInspectorReactFrames.js", - "baseHash": "3a3d7da499937cce35c9bd17a11f10b2eeac04cc" + "baseHash": "cdf958aebabbe9067d34a2df3e6f2fe7ce09f51e" }, { "type": "derived", "file": "src-win/Libraries/LogBox/UI/LogBoxInspectorSourceMapStatus.win32.js", "baseFile": "packages/react-native/Libraries/LogBox/UI/LogBoxInspectorSourceMapStatus.js", - "baseHash": "b355418205aa52cf33fb7e4d521b26083eada49d" + "baseHash": "987653809d7838bb80d3a975abc9f0fd3bc13d93" }, { "type": "derived", @@ -412,13 +412,13 @@ "type": "derived", "file": "src-win/Libraries/Text/Text.d.ts", "baseFile": "packages/react-native/Libraries/Text/Text.d.ts", - "baseHash": "b5f44957bc61497fcb7203934bdbc6ca9725cf42" + "baseHash": "d3807571f477ef8ba4bb20c1ee899b1a5814941d" }, { "type": "derived", "file": "src-win/Libraries/Text/Text.win32.js", "baseFile": "packages/react-native/Libraries/Text/Text.js", - "baseHash": "1f802db19830e468b84640fc5c7740a11e154250" + "baseHash": "108e59816ed3b3c8183d0687a66088755580c00d" }, { "type": "derived", @@ -431,7 +431,7 @@ "type": "derived", "file": "src-win/Libraries/Text/TextProps.win32.js", "baseFile": "packages/react-native/Libraries/Text/TextProps.js", - "baseHash": "d31f973c14140792d9d28d208fca15d092a8a4e2" + "baseHash": "6ee62a1b3a4384c2b5bd1dd10a13664c72e5dc88" }, { "type": "patch", @@ -477,7 +477,7 @@ "type": "patch", "file": "src-win/Libraries/Utilities/PlatformTypes.js", "baseFile": "packages/react-native/Libraries/Utilities/PlatformTypes.js", - "baseHash": "0bd36210528f74f9081d858c9ab64ead92c54950", + "baseHash": "8beb4d8d786f33f9eeb6edcff939c38765e19055", "issue": 14686 }, { @@ -490,14 +490,14 @@ "type": "patch", "file": "src-win/src/private/animated/NativeAnimatedHelper.win32.js", "baseFile": "packages/react-native/src/private/animated/NativeAnimatedHelper.js", - "baseHash": "3247a8e436a7beeda45ce7d77343229b5204cbfc", + "baseHash": "e897f1bd33ed982044b97a01d9f606b9ebcd4505", "issue": 11041 }, { "type": "copy", "file": "src-win/src/private/devsupport/rndevtools/ReactDevToolsSettingsManager.win32.js", "baseFile": "packages/react-native/src/private/devsupport/rndevtools/ReactDevToolsSettingsManager.android.js", - "baseHash": "2d33789b0c7a45996dc23f26c4b09fb2026a9285" + "baseHash": "f2cc01b07b779b75002daec9c2761616ad01f4ca" }, { "type": "derived", diff --git a/packages/@office-iss/react-native-win32/package.json b/packages/@office-iss/react-native-win32/package.json index 834c75b132f..e78348e6e32 100644 --- a/packages/@office-iss/react-native-win32/package.json +++ b/packages/@office-iss/react-native-win32/package.json @@ -88,7 +88,7 @@ "just-scripts": "^1.3.3", "prettier": "2.8.8", "react": "19.1.0", - "react-native": "0.80.0-nightly-20250506-3ac16dd6a", + "react-native": "0.81.0-nightly-20250521-3cb70bb6a", "react-native-platform-override": "^1.9.56", "typescript": "5.0.4" }, diff --git a/packages/@office-iss/react-native-win32/src-win/Libraries/Components/Button.win32.js b/packages/@office-iss/react-native-win32/src-win/Libraries/Components/Button.win32.js index e718aa16cdd..4f8811e43ec 100644 --- a/packages/@office-iss/react-native-win32/src-win/Libraries/Components/Button.win32.js +++ b/packages/@office-iss/react-native-win32/src-win/Libraries/Components/Button.win32.js @@ -288,10 +288,10 @@ const Touchable: typeof TouchableNativeFeedback | typeof TouchableOpacity = type ButtonRef = React.ElementRef; -const Button: component( - ref?: React.RefSetter, - ...props: ButtonProps -) = React.forwardRef((props: ButtonProps, ref: React.RefSetter) => { +const Button = React.forwardRef(function Button( + props: ButtonProps, + ref: React.RefSetter, +) { // Win32 const { accessibilityLabel, diff --git a/packages/@office-iss/react-native-win32/src-win/Libraries/Components/Pressable/Pressable.win32.js b/packages/@office-iss/react-native-win32/src-win/Libraries/Components/Pressable/Pressable.win32.js index 8b9456a8003..332a40c70f0 100644 --- a/packages/@office-iss/react-native-win32/src-win/Libraries/Components/Pressable/Pressable.win32.js +++ b/packages/@office-iss/react-native-win32/src-win/Libraries/Components/Pressable/Pressable.win32.js @@ -28,7 +28,7 @@ import useAndroidRippleForView, { type PressableAndroidRippleConfig, } from './useAndroidRippleForView'; import * as React from 'react'; -import {useMemo, useRef, useState} from 'react'; +import {memo, useMemo, useRef, useState} from 'react'; import type {HandledKeyboardEvent} from '../../Components/View/ViewPropTypes'; import View from '../View/View'; @@ -211,10 +211,13 @@ type Instance = React.ElementRef; * Component used to build display components that should respond to whether the * component is currently pressed or not. */ -function Pressable( - props: PressableProps, - forwardedRef: React.RefSetter, -): React.Node { +function Pressable({ + ref: forwardedRef, + ...props +}: { + ref?: React.RefSetter, + ...PressableProps, +}): React.Node { const { accessible, accessibilityState, @@ -398,7 +401,7 @@ function usePressState(forcePressed: boolean): [boolean, (boolean) => void] { return [pressed || forcePressed, setPressed]; } -const MemoedPressable = React.memo(React.forwardRef(Pressable)); +const MemoedPressable = memo(Pressable); MemoedPressable.displayName = 'Pressable'; export default (MemoedPressable: component( diff --git a/packages/@office-iss/react-native-win32/src-win/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.js b/packages/@office-iss/react-native-win32/src-win/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.js index 5691ce0e156..707b4ee7965 100644 --- a/packages/@office-iss/react-native-win32/src-win/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.js +++ b/packages/@office-iss/react-native-win32/src-win/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.js @@ -17,11 +17,23 @@ import Platform from '../../Utilities/Platform'; export type {ProgressBarAndroidProps}; +// A utility type to preserve the semantics of the union uses in the definition +// of ProgressBarAndroidProps. TS's Omit does not distribute over unions, so +// we define our own version which does. This does not affect Flow. +// $FlowExpectedError[unclear-type] +type Omit = T extends any ? Pick, K>> : T; + +/** + * ProgressBarAndroid has been extracted from react-native core and will be removed in a future release. + * It can now be installed and imported from `@react-native-community/progress-bar-android` instead of 'react-native'. + * @see https://github.com/react-native-community/progress-bar-android + * @deprecated + */ let ProgressBarAndroid: component( ref?: React.RefSetter< React.ElementRef, >, - ...props: ProgressBarAndroidProps + ...props: Omit ); if (Platform.OS === 'android') { diff --git a/packages/@office-iss/react-native-win32/src-win/Libraries/Components/TextInput/TextInput.flow.win32.js b/packages/@office-iss/react-native-win32/src-win/Libraries/Components/TextInput/TextInput.flow.win32.js index 3ece820ac7e..ca1a29b6053 100644 --- a/packages/@office-iss/react-native-win32/src-win/Libraries/Components/TextInput/TextInput.flow.win32.js +++ b/packages/@office-iss/react-native-win32/src-win/Libraries/Components/TextInput/TextInput.flow.win32.js @@ -16,11 +16,7 @@ import type { } from '../../Types/CoreEventTypes'; import type {ViewProps} from '../View/ViewPropTypes'; -import { - type ColorValue, - type TextStyleProp, - type ViewStyleProp, -} from '../../StyleSheet/StyleSheet'; +import {type ColorValue, type TextStyleProp} from '../../StyleSheet/StyleSheet'; import * as React from 'react'; /** diff --git a/packages/@office-iss/react-native-win32/src-win/Libraries/Components/TextInput/TextInput.win32.js b/packages/@office-iss/react-native-win32/src-win/Libraries/Components/TextInput/TextInput.win32.js index 7772ec4db88..866b84445aa 100644 --- a/packages/@office-iss/react-native-win32/src-win/Libraries/Components/TextInput/TextInput.win32.js +++ b/packages/@office-iss/react-native-win32/src-win/Libraries/Components/TextInput/TextInput.win32.js @@ -61,7 +61,7 @@ import TextInputState from './TextInputState'; import invariant from 'invariant'; import nullthrows from 'nullthrows'; import * as React from 'react'; -import {useCallback, useLayoutEffect, useRef, useState} from 'react'; +import {useCallback, useLayoutEffect, useMemo, useRef, useState} from 'react'; let AndroidTextInput; let AndroidTextInputCommands; @@ -604,7 +604,7 @@ function InternalTextInput(props: TextInputProps): React.Node { rejectResponderTermination, } = props; - const config = React.useMemo( + const config = useMemo( () => ({ hitSlop, onPress: (event: GestureResponderEvent) => { @@ -981,27 +981,28 @@ const autoCompleteWebToTextContentTypeMap = { username: 'username', }; -const ExportedForwardRef: component( +const TextInput: component( ref?: React.RefSetter, ...props: React.ElementConfig -) = React.forwardRef(function TextInput( - { - allowFontScaling = true, - rejectResponderTermination = true, - underlineColorAndroid = 'transparent', - autoComplete, - textContentType, - readOnly, - editable, - enterKeyHint, - returnKeyType, - inputMode, - showSoftInputOnFocus, - keyboardType, - ...restProps - }, - forwardedRef: React.RefSetter, -) { +) = function TextInput({ + ref: forwardedRef, + allowFontScaling = true, + rejectResponderTermination = true, + underlineColorAndroid = 'transparent', + autoComplete, + textContentType, + readOnly, + editable, + enterKeyHint, + returnKeyType, + inputMode, + showSoftInputOnFocus, + keyboardType, + ...restProps +}: { + ref?: React.RefSetter, + ...React.ElementConfig, +}) { return ( ); -}); +}; -ExportedForwardRef.displayName = 'TextInput'; +TextInput.displayName = 'TextInput'; // $FlowFixMe[prop-missing] -ExportedForwardRef.State = { +TextInput.State = { currentlyFocusedInput: TextInputState.currentlyFocusedInput, currentlyFocusedField: TextInputState.currentlyFocusedField, @@ -1073,4 +1074,4 @@ const verticalAlignToTextAlignVerticalMap = { }; // $FlowFixMe[unclear-type] Unclear type. Using `any` type is not safe. -export default ExportedForwardRef as any as TextInputType; +export default TextInput as any as TextInputType; diff --git a/packages/@office-iss/react-native-win32/src-win/Libraries/Components/Touchable/TouchableNativeFeedback.win32.js b/packages/@office-iss/react-native-win32/src-win/Libraries/Components/Touchable/TouchableNativeFeedback.win32.js index 9da6da38a00..0f1ebd44b21 100644 --- a/packages/@office-iss/react-native-win32/src-win/Libraries/Components/Touchable/TouchableNativeFeedback.win32.js +++ b/packages/@office-iss/react-native-win32/src-win/Libraries/Components/Touchable/TouchableNativeFeedback.win32.js @@ -13,12 +13,14 @@ import type {TouchableWithoutFeedbackProps} from './TouchableWithoutFeedback'; import Pressability, { type PressabilityConfig, } from '../../Pressability/Pressability'; +import {PressabilityDebugView} from '../../Pressability/PressabilityDebug'; import {findHostInstance_DEPRECATED} from '../../ReactNative/RendererProxy'; import processColor from '../../StyleSheet/processColor'; import Platform from '../../Utilities/Platform'; import {Commands} from '../View/ViewNativeComponent'; import invariant from 'invariant'; import * as React from 'react'; +import {cloneElement} from 'react'; type TVProps = { /** @@ -283,6 +285,103 @@ class TouchableNativeFeedback extends React.Component< } } + render(): React.Node { + const element = React.Children.only<$FlowFixMe>(this.props.children); + const children: Array = [element.props.children]; + if (__DEV__) { + if (element.type === View) { + children.push( + , + ); + } + } + + // BACKWARD-COMPATIBILITY: Focus and blur events were never supported before + // adopting `Pressability`, so preserve that behavior. + const {onBlur, onFocus, ...eventHandlersWithoutBlurAndFocus} = + this.state.pressability.getEventHandlers(); + + let _accessibilityState = { + busy: this.props['aria-busy'] ?? this.props.accessibilityState?.busy, + checked: + this.props['aria-checked'] ?? this.props.accessibilityState?.checked, + disabled: + this.props['aria-disabled'] ?? this.props.accessibilityState?.disabled, + expanded: + this.props['aria-expanded'] ?? this.props.accessibilityState?.expanded, + selected: + this.props['aria-selected'] ?? this.props.accessibilityState?.selected, + }; + + _accessibilityState = + this.props.disabled != null + ? { + ..._accessibilityState, + disabled: this.props.disabled, + } + : _accessibilityState; + + const accessibilityValue = { + max: this.props['aria-valuemax'] ?? this.props.accessibilityValue?.max, + min: this.props['aria-valuemin'] ?? this.props.accessibilityValue?.min, + now: this.props['aria-valuenow'] ?? this.props.accessibilityValue?.now, + text: this.props['aria-valuetext'] ?? this.props.accessibilityValue?.text, + }; + + const accessibilityLiveRegion = + this.props['aria-live'] === 'off' + ? 'none' + : this.props['aria-live'] ?? this.props.accessibilityLiveRegion; + + const accessibilityLabel = + this.props['aria-label'] ?? this.props.accessibilityLabel; + return cloneElement( + element, + { + ...eventHandlersWithoutBlurAndFocus, + ...getBackgroundProp( + this.props.background === undefined + ? TouchableNativeFeedback.SelectableBackground() + : this.props.background, + this.props.useForeground === true, + ), + accessible: this.props.accessible !== false, + accessibilityHint: this.props.accessibilityHint, + accessibilityLanguage: this.props.accessibilityLanguage, + accessibilityLabel: accessibilityLabel, + accessibilityRole: this.props.accessibilityRole, + accessibilityState: _accessibilityState, + accessibilityActions: this.props.accessibilityActions, + onAccessibilityAction: this.props.onAccessibilityAction, + accessibilityValue: accessibilityValue, + importantForAccessibility: + this.props['aria-hidden'] === true + ? 'no-hide-descendants' + : this.props.importantForAccessibility, + accessibilityViewIsModal: + this.props['aria-modal'] ?? this.props.accessibilityViewIsModal, + accessibilityLiveRegion: accessibilityLiveRegion, + accessibilityElementsHidden: + this.props['aria-hidden'] ?? this.props.accessibilityElementsHidden, + hasTVPreferredFocus: this.props.hasTVPreferredFocus, + hitSlop: this.props.hitSlop, + focusable: + this.props.focusable !== false && + this.props.onPress !== undefined && + !this.props.disabled, + nativeID: this.props.id ?? this.props.nativeID, + nextFocusDown: this.props.nextFocusDown, + nextFocusForward: this.props.nextFocusForward, + nextFocusLeft: this.props.nextFocusLeft, + nextFocusRight: this.props.nextFocusRight, + nextFocusUp: this.props.nextFocusUp, + onLayout: this.props.onLayout, + testID: this.props.testID, + }, + ...children, + ); + } + componentDidUpdate( prevProps: TouchableNativeFeedbackProps, prevState: TouchableNativeFeedbackState, diff --git a/packages/@office-iss/react-native-win32/src-win/Libraries/Core/Devtools/loadBundleFromServer.win32.js b/packages/@office-iss/react-native-win32/src-win/Libraries/Core/Devtools/loadBundleFromServer.win32.js index 42db8dea250..4c8e5e57006 100644 --- a/packages/@office-iss/react-native-win32/src-win/Libraries/Core/Devtools/loadBundleFromServer.win32.js +++ b/packages/@office-iss/react-native-win32/src-win/Libraries/Core/Devtools/loadBundleFromServer.win32.js @@ -6,7 +6,6 @@ * * @flow strict-local * @format - * @oncall react_native */ import Networking from '../../Network/RCTNetworking'; @@ -20,6 +19,34 @@ let pendingRequests = 0; const cachedPromisesByUrl = new Map>(); +export class LoadBundleFromServerError extends Error { + url: string; + isTimeout: boolean; + constructor( + message: string, + url: string, + isTimeout: boolean, + options?: {cause: mixed, ...}, + ): void { + super(message, options); + this.url = url; + this.isTimeout = isTimeout; + this.name = 'LoadBundleFromServerError'; + } +} + +export class LoadBundleFromServerRequestError extends LoadBundleFromServerError { + constructor( + message: string, + url: string, + isTimeout: boolean, + options?: {cause: mixed, ...}, + ): void { + super(message, url, isTimeout, options); + this.name = 'LoadBundleFromServerRequestError'; + } +} + function asyncRequest( url: string, ): Promise<{body: string, headers: {[string]: string}}> { @@ -62,10 +89,19 @@ function asyncRequest( ); completeListener = Networking.addListener( 'didCompleteNetworkResponse', - ([requestId, error]) => { + ([requestId, errorMessage, isTimeout]) => { if (requestId === id) { - if (error) { - reject(error); + if (errorMessage) { + reject( + new LoadBundleFromServerRequestError( + 'Could not load bundle', + url, + isTimeout, + { + cause: errorMessage, + }, + ), + ); } else { //$FlowFixMe[incompatible-call] resolve({body: responseText, headers}); @@ -122,9 +158,15 @@ export default function loadBundleFromServer( headers['Content-Type'].indexOf('application/json') >= 0 ) { // Errors are returned as JSON. - throw new Error( - JSON.parse(body).message || - `Unknown error fetching '${bundlePathAndQuery}'`, + throw new LoadBundleFromServerError( + 'Could not load bundle', + bundlePathAndQuery, + false, // isTimeout + { + cause: + JSON.parse(body).message || + `Unknown error fetching '${bundlePathAndQuery}'`, + }, ); } diff --git a/packages/@office-iss/react-native-win32/src-win/Libraries/Image/Image.win32.js b/packages/@office-iss/react-native-win32/src-win/Libraries/Image/Image.win32.js index c82ba212f20..1b7b4273de6 100644 --- a/packages/@office-iss/react-native-win32/src-win/Libraries/Image/Image.win32.js +++ b/packages/@office-iss/react-native-win32/src-win/Libraries/Image/Image.win32.js @@ -8,12 +8,14 @@ * @format */ +import type {HostInstance} from '../../src/private/types/HostInstance'; +import type {ImageStyleProp} from '../StyleSheet/StyleSheet'; import type {RootTag} from '../Types/RootTagTypes'; +import type {ImageProps} from './ImageProps'; import type {AbstractImageIOS, ImageIOS} from './ImageTypes.flow'; import TextAncestor from '../Text/TextAncestor'; // [Windows] import invariant from 'invariant'; // [Windows] -import type {ImageStyleProp} from '../StyleSheet/StyleSheet'; import NativeImageLoaderWin32 from './NativeImageLoaderWin32'; // [Win32] Replace iOS import {createRootTag} from '../ReactNative/RootTag'; @@ -122,7 +124,13 @@ async function queryCache( * * See https://reactnative.dev/docs/image */ -let BaseImage: AbstractImageIOS = React.forwardRef((props, forwardedRef) => { +let BaseImage: AbstractImageIOS = ({ + ref: forwardedRef, + ...props +}: { + ref?: React.RefSetter, + ...ImageProps, +}) => { const source = getImageSourcesFromImageProps(props) || { uri: undefined, width: undefined, @@ -215,7 +223,7 @@ let BaseImage: AbstractImageIOS = React.forwardRef((props, forwardedRef) => { }} ); -}); +}; const imageComponentDecorator = unstable_getImageComponentDecorator(); if (imageComponentDecorator != null) { diff --git a/packages/@office-iss/react-native-win32/src-win/Libraries/LogBox/UI/LogBoxInspectorReactFrames.win32.js b/packages/@office-iss/react-native-win32/src-win/Libraries/LogBox/UI/LogBoxInspectorReactFrames.win32.js index 4ed214cfaa3..4ca5c3138ea 100644 --- a/packages/@office-iss/react-native-win32/src-win/Libraries/LogBox/UI/LogBoxInspectorReactFrames.win32.js +++ b/packages/@office-iss/react-native-win32/src-win/Libraries/LogBox/UI/LogBoxInspectorReactFrames.win32.js @@ -19,6 +19,7 @@ import LogBoxButton from './LogBoxButton'; import LogBoxInspectorSection from './LogBoxInspectorSection'; import * as LogBoxStyle from './LogBoxStyle'; import * as React from 'react'; +import {useState} from 'react'; type Props = $ReadOnly<{ log: LogBoxLog, @@ -49,7 +50,7 @@ function getPrettyFileName(path: string) { return fileName; } function LogBoxInspectorReactFrames(props: Props): React.Node { - const [collapsed, setCollapsed] = React.useState(true); + const [collapsed, setCollapsed] = useState(true); if ( props.log.getAvailableComponentStack() == null || props.log.getAvailableComponentStack().length < 1 diff --git a/packages/@office-iss/react-native-win32/src-win/Libraries/LogBox/UI/LogBoxInspectorSourceMapStatus.win32.js b/packages/@office-iss/react-native-win32/src-win/Libraries/LogBox/UI/LogBoxInspectorSourceMapStatus.win32.js index 217f2e5fefe..adf33ec9bc6 100644 --- a/packages/@office-iss/react-native-win32/src-win/Libraries/LogBox/UI/LogBoxInspectorSourceMapStatus.win32.js +++ b/packages/@office-iss/react-native-win32/src-win/Libraries/LogBox/UI/LogBoxInspectorSourceMapStatus.win32.js @@ -17,6 +17,7 @@ import Text from '../../Text/Text'; import LogBoxButton from './LogBoxButton'; import * as LogBoxStyle from './LogBoxStyle'; import * as React from 'react'; +import {useEffect, useState} from 'react'; type Props = $ReadOnly<{ onPress?: ?(event: GestureResponderEvent) => void, @@ -26,12 +27,12 @@ type Props = $ReadOnly<{ function LogBoxInspectorSourceMapStatus(props: Props): React.Node { // [Win32] Dont use Animated /* - const [state, setState] = React.useState({ + const [state, setState] = useState({ animation: null, rotate: null, }); - React.useEffect(() => { + useEffect(() => { if (props.status === 'PENDING') { if (state.animation == null) { const animated = new Animated.Value(0); diff --git a/packages/@office-iss/react-native-win32/src-win/Libraries/Text/Text.d.ts b/packages/@office-iss/react-native-win32/src-win/Libraries/Text/Text.d.ts index 274062abe7a..ff3ceec9358 100644 --- a/packages/@office-iss/react-native-win32/src-win/Libraries/Text/Text.d.ts +++ b/packages/@office-iss/react-native-win32/src-win/Libraries/Text/Text.d.ts @@ -296,6 +296,13 @@ export interface TextProps * Controls how touch events are handled. Similar to `View`'s `pointerEvents`. */ pointerEvents?: ViewStyle['pointerEvents'] | undefined; + + /** + * Defines how far your touch may move off of the button, before deactivating the button. + */ + pressRetentionOffset?: + | {top: number; left: number; bottom: number; right: number} + | undefined; } /** diff --git a/packages/@office-iss/react-native-win32/src-win/Libraries/Text/Text.win32.js b/packages/@office-iss/react-native-win32/src-win/Libraries/Text/Text.win32.js index 5190c7fb53d..4311277c706 100644 --- a/packages/@office-iss/react-native-win32/src-win/Libraries/Text/Text.win32.js +++ b/packages/@office-iss/react-native-win32/src-win/Libraries/Text/Text.win32.js @@ -38,268 +38,185 @@ type TextForwardRef = React.ElementRef< const TextImpl: component( ref?: React.RefSetter, ...props: TextProps -) = React.forwardRef( - ( - { - accessible, - accessibilityControls, // Win32 - accessibilityDescribedBy, // Win32 - accessibilityDescription, // Win32 - accessibilityLabel, - accessibilityLevel, // Win32 - accessibilityPositionInSet, // Win32 - accessibilitySetSize, // Win32 - accessibilityState, - allowFontScaling, - 'aria-busy': ariaBusy, - 'aria-checked': ariaChecked, - 'aria-controls': ariaControls, // Win32 - 'aria-describedby': ariaDescribedBy, // Win32 - 'aria-description': ariaDescription, // Win32 - 'aria-disabled': ariaDisabled, - 'aria-expanded': ariaExpanded, - 'aria-label': ariaLabel, - 'aria-level': ariaLevel, // Win32 - 'aria-multiselectable': ariaMultiselectable, // Win32 - 'aria-posinset': ariaPosinset, // Win32 - 'aria-required': ariaRequired, // Win32 - 'aria-selected': ariaSelected, - 'aria-setsize': ariaSetsize, // Win32 - children, - ellipsizeMode, - disabled, - id, - nativeID, - numberOfLines, - onLongPress, - onPress, - onPressIn, - onPressOut, - onResponderGrant, - onResponderMove, - onResponderRelease, - onResponderTerminate, - onResponderTerminationRequest, - onStartShouldSetResponder, - pressRetentionOffset, - selectable, - selectionColor, - suppressHighlighting, - style, - ...restProps - }: TextProps, - forwardedRef, - ) => { - const _accessibilityLabel = ariaLabel ?? accessibilityLabel; - const _accessibilityControls = ariaControls ?? accessibilityControls; // Win32 - const _accessibilityDescribedBy = - ariaDescribedBy ?? accessibilityDescribedBy; // Win32 - const _accessibilityDescription = - ariaDescription ?? accessibilityDescription; // Win32 - const _accessibilityLevel = ariaLevel ?? accessibilityLevel; // Win32 - const _accessibilityPositionInSet = - ariaPosinset ?? accessibilityPositionInSet; // Win32 - const _accessibilitySetSize = ariaSetsize ?? accessibilitySetSize; // Win32 - - let _accessibilityState: ?TextProps['accessibilityState'] = - accessibilityState; - if ( - ariaBusy != null || - ariaChecked != null || - ariaDisabled != null || - ariaExpanded != null || - ariaSelected != null - ) { - if (_accessibilityState != null) { - _accessibilityState = { - busy: ariaBusy ?? _accessibilityState.busy, - checked: ariaChecked ?? _accessibilityState.checked, - disabled: ariaDisabled ?? _accessibilityState.disabled, - expanded: ariaExpanded ?? _accessibilityState.expanded, - multiselectable: - ariaMultiselectable ?? accessibilityState?.multiselectable, // Win32 - required: ariaRequired ?? accessibilityState?.required, // Win32 - selected: ariaSelected ?? _accessibilityState.selected, - }; - } else { - _accessibilityState = { - busy: ariaBusy, - checked: ariaChecked, - disabled: ariaDisabled, - expanded: ariaExpanded, - multiselectable: ariaMultiselectable, // Win32, - required: ariaRequired, // Win32 - selected: ariaSelected, - }; - } +) = ({ + ref: forwardedRef, + accessible, + accessibilityControls, // Win32 + accessibilityDescribedBy, // Win32 + accessibilityDescription, // Win32 + accessibilityLabel, + accessibilityLevel, // Win32 + accessibilityPositionInSet, // Win32 + accessibilitySetSize, // Win32 + accessibilityState, + allowFontScaling, + 'aria-busy': ariaBusy, + 'aria-checked': ariaChecked, + 'aria-controls': ariaControls, // Win32 + 'aria-describedby': ariaDescribedBy, // Win32 + 'aria-description': ariaDescription, // Win32 + 'aria-disabled': ariaDisabled, + 'aria-expanded': ariaExpanded, + 'aria-label': ariaLabel, + 'aria-level': ariaLevel, // Win32 + 'aria-multiselectable': ariaMultiselectable, // Win32 + 'aria-posinset': ariaPosinset, // Win32 + 'aria-required': ariaRequired, // Win32 + 'aria-selected': ariaSelected, + 'aria-setsize': ariaSetsize, // Win32 + children, + ellipsizeMode, + disabled, + id, + nativeID, + numberOfLines, + onLongPress, + onPress, + onPressIn, + onPressOut, + onResponderGrant, + onResponderMove, + onResponderRelease, + onResponderTerminate, + onResponderTerminationRequest, + onStartShouldSetResponder, + pressRetentionOffset, + selectable, + selectionColor, + suppressHighlighting, + style, + ...restProps +}: { + ref?: React.RefSetter, + ...TextProps, +}) => { + const _accessibilityLabel = ariaLabel ?? accessibilityLabel; + const _accessibilityControls = ariaControls ?? accessibilityControls; // Win32 + const _accessibilityDescribedBy = ariaDescribedBy ?? accessibilityDescribedBy; // Win32 + const _accessibilityDescription = ariaDescription ?? accessibilityDescription; // Win32 + const _accessibilityLevel = ariaLevel ?? accessibilityLevel; // Win32 + const _accessibilityPositionInSet = + ariaPosinset ?? accessibilityPositionInSet; // Win32 + const _accessibilitySetSize = ariaSetsize ?? accessibilitySetSize; // Win32 + + let _accessibilityState: ?TextProps['accessibilityState'] = + accessibilityState; + if ( + ariaBusy != null || + ariaChecked != null || + ariaDisabled != null || + ariaExpanded != null || + ariaSelected != null + ) { + if (_accessibilityState != null) { + _accessibilityState = { + busy: ariaBusy ?? _accessibilityState.busy, + checked: ariaChecked ?? _accessibilityState.checked, + disabled: ariaDisabled ?? _accessibilityState.disabled, + expanded: ariaExpanded ?? _accessibilityState.expanded, + multiselectable: + ariaMultiselectable ?? accessibilityState?.multiselectable, // Win32 + required: ariaRequired ?? accessibilityState?.required, // Win32 + selected: ariaSelected ?? _accessibilityState.selected, + }; + } else { + _accessibilityState = { + busy: ariaBusy, + checked: ariaChecked, + disabled: ariaDisabled, + expanded: ariaExpanded, + multiselectable: ariaMultiselectable, // Win32, + required: ariaRequired, // Win32 + selected: ariaSelected, + }; } + } - const _accessibilityStateDisabled = _accessibilityState?.disabled; - const _disabled = disabled ?? _accessibilityStateDisabled; + const _accessibilityStateDisabled = _accessibilityState?.disabled; + const _disabled = disabled ?? _accessibilityStateDisabled; - const isPressable = - (onPress != null || - onLongPress != null || - onStartShouldSetResponder != null) && - _disabled !== true; + const isPressable = + (onPress != null || + onLongPress != null || + onStartShouldSetResponder != null) && + _disabled !== true; - // TODO: Move this processing to the view configuration. - const _selectionColor = - selectionColor != null ? processColor(selectionColor) : undefined; + // TODO: Move this processing to the view configuration. + const _selectionColor = + selectionColor != null ? processColor(selectionColor) : undefined; - let _style = style; - if (__DEV__) { - if (PressabilityDebug.isEnabled() && onPress != null) { - _style = [style, {color: 'magenta'}]; - } + let _style = style; + if (__DEV__) { + if (PressabilityDebug.isEnabled() && onPress != null) { + _style = [style, {color: 'magenta'}]; } + } - let _numberOfLines = numberOfLines; - if (_numberOfLines != null && !(_numberOfLines >= 0)) { - if (__DEV__) { - console.error( - `'numberOfLines' in must be a non-negative number, received: ${_numberOfLines}. The value will be set to 0.`, - ); - } - _numberOfLines = 0; + let _numberOfLines = numberOfLines; + if (_numberOfLines != null && !(_numberOfLines >= 0)) { + if (__DEV__) { + console.error( + `'numberOfLines' in must be a non-negative number, received: ${_numberOfLines}. The value will be set to 0.`, + ); } - - let _selectable = selectable; - - let processedStyle = flattenStyle(_style); - if (processedStyle != null) { - let overrides: ?{...TextStyleInternal} = null; - if (typeof processedStyle.fontWeight === 'number') { - overrides = overrides || ({}: {...TextStyleInternal}); - overrides.fontWeight = - // $FlowFixMe[incompatible-cast] - (processedStyle.fontWeight.toString(): TextStyleInternal['fontWeight']); - } - - if (processedStyle.userSelect != null) { - _selectable = userSelectToSelectableMap[processedStyle.userSelect]; - overrides = overrides || ({}: {...TextStyleInternal}); - overrides.userSelect = undefined; - } - - if (processedStyle.verticalAlign != null) { - overrides = overrides || ({}: {...TextStyleInternal}); - overrides.textAlignVertical = - verticalAlignToTextAlignVerticalMap[processedStyle.verticalAlign]; - overrides.verticalAlign = undefined; - } - - if (overrides != null) { - // $FlowFixMe[incompatible-type] - _style = [_style, overrides]; - } + _numberOfLines = 0; + } + + let _selectable = selectable; + + let processedStyle = flattenStyle(_style); + if (processedStyle != null) { + let overrides: ?{...TextStyleInternal} = null; + if (typeof processedStyle.fontWeight === 'number') { + overrides = overrides || ({}: {...TextStyleInternal}); + overrides.fontWeight = + // $FlowFixMe[incompatible-cast] + (processedStyle.fontWeight.toString(): TextStyleInternal['fontWeight']); } - const _nativeID = id ?? nativeID; - - const hasTextAncestor = useContext(TextAncestor); - if (hasTextAncestor) { - if (isPressable) { - return ( - - ); - } + if (processedStyle.userSelect != null) { + _selectable = userSelectToSelectableMap[processedStyle.userSelect]; + overrides = overrides || ({}: {...TextStyleInternal}); + overrides.userSelect = undefined; + } - return ( - - {children} - - ); + if (processedStyle.verticalAlign != null) { + overrides = overrides || ({}: {...TextStyleInternal}); + overrides.textAlignVertical = + verticalAlignToTextAlignVerticalMap[processedStyle.verticalAlign]; + overrides.verticalAlign = undefined; } - // If the disabled prop and accessibilityState.disabled are out of sync but not both in - // falsy states we need to update the accessibilityState object to use the disabled prop. - if ( - _disabled !== _accessibilityStateDisabled && - ((_disabled != null && _disabled !== false) || - (_accessibilityStateDisabled != null && - _accessibilityStateDisabled !== false)) - ) { - _accessibilityState = {..._accessibilityState, disabled: _disabled}; + if (overrides != null) { + // $FlowFixMe[incompatible-type] + _style = [_style, overrides]; } + } - const _accessible = Platform.select({ - ios: accessible !== false, - android: - accessible == null - ? onPress != null || onLongPress != null - : accessible, - default: accessible !== false, // [Windows #13996 - default value is accessible !== false] - }); + const _nativeID = id ?? nativeID; - let nativeText = null; + const hasTextAncestor = useContext(TextAncestor); + if (hasTextAncestor) { if (isPressable) { - nativeText = ( - ); - } else { - nativeText = ( - - {children} - - ); } - if (children == null) { - return nativeText; - } - - // If the children do not contain a JSX element it would not be possible to have a - // nested `Text` component so we can skip adding the `TextAncestor` context wrapper - // which has a performance overhead. Since we do this for performance reasons we need - // to keep the check simple to avoid regressing overall perf. For this reason the - // `children.length` constant is set to `3`, this should be a reasonable tradeoff - // to capture the majority of `Text` uses but also not make this check too expensive. - if (Array.isArray(children) && children.length <= 3) { - let hasNonTextChild = false; - for (let child of children) { - if (child != null && typeof child === 'object') { - hasNonTextChild = true; - break; - } - } - if (!hasNonTextChild) { - return nativeText; + return ( + + {children} + + ); + } + + // If the disabled prop and accessibilityState.disabled are out of sync but not both in + // falsy states we need to update the accessibilityState object to use the disabled prop. + if ( + _disabled !== _accessibilityStateDisabled && + ((_disabled != null && _disabled !== false) || + (_accessibilityStateDisabled != null && + _accessibilityStateDisabled !== false)) + ) { + _accessibilityState = {..._accessibilityState, disabled: _disabled}; + } + + const _accessible = Platform.select({ + ios: accessible !== false, + android: + accessible == null ? onPress != null || onLongPress != null : accessible, + default: accessible !== false, // [Windows #13996 - default value is accessible !== false] + }); + + let nativeText = null; + if (isPressable) { + nativeText = ( + + ); + } else { + nativeText = ( + + {children} + + ); + } + + if (children == null) { + return nativeText; + } + + // If the children do not contain a JSX element it would not be possible to have a + // nested `Text` component so we can skip adding the `TextAncestor` context wrapper + // which has a performance overhead. Since we do this for performance reasons we need + // to keep the check simple to avoid regressing overall perf. For this reason the + // `children.length` constant is set to `3`, this should be a reasonable tradeoff + // to capture the majority of `Text` uses but also not make this check too expensive. + if (Array.isArray(children) && children.length <= 3) { + let hasNonTextChild = false; + for (let child of children) { + if (child != null && typeof child === 'object') { + hasNonTextChild = true; + break; } - } else if (typeof children !== 'object') { + } + if (!hasNonTextChild) { return nativeText; } + } else if (typeof children !== 'object') { + return nativeText; + } - return ( - {nativeText} - ); - }, -); + return ( + {nativeText} + ); +}; TextImpl.displayName = 'Text'; @@ -520,7 +515,14 @@ type NativePressableTextProps = $ReadOnly<{ const NativePressableVirtualText: component( ref: React.RefSetter, ...props: NativePressableTextProps -) = React.forwardRef(({textProps, textPressabilityProps}, forwardedRef) => { +) = ({ + ref: forwardedRef, + textProps, + textPressabilityProps, +}: { + ref?: React.RefSetter, + ...NativePressableTextProps, +}) => { const [isHighlighted, eventHandlersForText] = useTextPressability( textPressabilityProps, ); @@ -534,7 +536,7 @@ const NativePressableVirtualText: component( ref={forwardedRef} /> ); -}); +}; /** * Wrap the NativeText component and initialize pressability. @@ -545,7 +547,14 @@ const NativePressableVirtualText: component( const NativePressableText: component( ref: React.RefSetter, ...props: NativePressableTextProps -) = React.forwardRef(({textProps, textPressabilityProps}, forwardedRef) => { +) = ({ + ref: forwardedRef, + textProps, + textPressabilityProps, +}: { + ref?: React.RefSetter, + ...NativePressableTextProps, +}) => { const [isHighlighted, eventHandlersForText] = useTextPressability( textPressabilityProps, ); @@ -559,7 +568,7 @@ const NativePressableText: component( ref={forwardedRef} /> ); -}); +}; const userSelectToSelectableMap = { auto: true, diff --git a/packages/@office-iss/react-native-win32/src-win/Libraries/Text/TextProps.win32.js b/packages/@office-iss/react-native-win32/src-win/Libraries/Text/TextProps.win32.js index cbdb789cf9a..7f4c1aead1d 100644 --- a/packages/@office-iss/react-native-win32/src-win/Libraries/Text/TextProps.win32.js +++ b/packages/@office-iss/react-native-win32/src-win/Libraries/Text/TextProps.win32.js @@ -12,9 +12,7 @@ import type { AccessibilityActionEvent, - AccessibilityActionInfo, - AccessibilityRole, - AccessibilityState, + AccessibilityProps, Role, } from '../Components/View/ViewAccessibility'; import type {ColorValue, TextStyleProp} from '../StyleSheet/StyleSheet'; @@ -124,27 +122,13 @@ export type TextPropsAndroid = { }; type TextBaseProps = $ReadOnly<{ - /** - * Indicates whether the view is an accessibility element. - * - * See https://reactnative.dev/docs/text#accessible - */ - accessible?: ?boolean, - accessibilityActions?: ?$ReadOnlyArray, onAccessibilityAction?: ?(event: AccessibilityActionEvent) => mixed, - accessibilityHint?: ?Stringish, - accessibilityLanguage?: ?Stringish, - accessibilityLabel?: ?Stringish, - accessibilityRole?: ?AccessibilityRole, - accessibilityState?: ?AccessibilityState, - 'aria-label'?: ?string, accessibilityControls?: ?Stringish, // Win32 accessibilityDescribedBy?: ?Stringish, // Win32 accessibilityDescription?: ?Stringish, // Win32 accessibilityLevel?: ?number, // Win32 accessibilityPositionInSet?: ?number, // Win32 accessibilitySetSize?: ?number, // Win32 - /** * Whether fonts should scale to respect Text Size accessibility settings. * The default is `true`. @@ -158,17 +142,6 @@ type TextBaseProps = $ReadOnly<{ * */ android_hyphenationFrequency?: ?('normal' | 'none' | 'full'), - - /** - * alias for accessibilityState - * - * see https://reactnative.dev/docs/accessibility#accessibilitystate - */ - 'aria-busy'?: ?boolean, - 'aria-checked'?: ?boolean | 'mixed', - 'aria-disabled'?: ?boolean, - 'aria-expanded'?: ?boolean, - 'aria-selected'?: ?boolean, 'aria-multiselectable'?: ?boolean, // Win32 'aria-required'?: ?boolean, // Win32 'aria-controls'?: ?Stringish, // Win32 @@ -177,11 +150,6 @@ type TextBaseProps = $ReadOnly<{ 'aria-level'?: ?number, // Win32 'aria-posinset'?: ?number, // Win32 'aria-setsize'?: ?number, // Win32 - /** - * Represents the nativeID of the associated label text. When the assistive technology focuses on the component with this props, the text is read aloud. - * This prop is listed for cross-platform reasons and has no real effect on Android or iOS. - */ - 'aria-labelledby'?: ?string, children?: ?React.Node, @@ -319,4 +287,5 @@ export type TextProps = $ReadOnly<{ ...TextPropsIOS, ...TextPropsAndroid, ...TextBaseProps, + ...AccessibilityProps, }>; diff --git a/packages/@office-iss/react-native-win32/src-win/Libraries/Utilities/PlatformTypes.js b/packages/@office-iss/react-native-win32/src-win/Libraries/Utilities/PlatformTypes.js index ebe2c4a623a..5c06cec88cb 100644 --- a/packages/@office-iss/react-native-win32/src-win/Libraries/Utilities/PlatformTypes.js +++ b/packages/@office-iss/react-native-win32/src-win/Libraries/Utilities/PlatformTypes.js @@ -18,7 +18,7 @@ export type PlatformOSType = | 'native'; type OptionalPlatformSelectSpec = { - [_key in PlatformOSType]?: T, + [key in PlatformOSType]?: T, // eslint-disable-line no-unused-vars }; export type PlatformSelectSpec = diff --git a/packages/@office-iss/react-native-win32/src-win/src/private/animated/NativeAnimatedHelper.win32.js b/packages/@office-iss/react-native-win32/src-win/src/private/animated/NativeAnimatedHelper.win32.js index 1ec85f7916e..7b06ecdee2a 100644 --- a/packages/@office-iss/react-native-win32/src-win/src/private/animated/NativeAnimatedHelper.win32.js +++ b/packages/@office-iss/react-native-win32/src-win/src/private/animated/NativeAnimatedHelper.win32.js @@ -57,7 +57,7 @@ const eventListenerAnimationFinishedCallbacks: { let globalEventEmitterGetValueListener: ?EventSubscription = null; let globalEventEmitterAnimationFinishedListener: ?EventSubscription = null; -const shouldSignalBatch = +const shouldSignalBatch: boolean = ReactNativeFeatureFlags.animatedShouldSignalBatch() || ReactNativeFeatureFlags.cxxNativeAnimatedEnabled(); @@ -97,6 +97,10 @@ function createNativeOperations(): $NonMaybeType { // is possible because # arguments is fixed for each operation. For more // details, see `NativeAnimatedModule.queueAndExecuteBatchedOperations`. singleOpQueue.push(operationID, ...args); + if (shouldSignalBatch) { + clearImmediate(flushQueueImmediate); + flushQueueImmediate = setImmediate(API.flushQueue); + } }; } } else { @@ -439,6 +443,7 @@ export default { generateNewAnimationId, assertNativeAnimatedModule, shouldUseNativeDriver, + shouldSignalBatch, transformDataType, // $FlowExpectedError[unsafe-getters-setters] - unsafe getter lint suppression // $FlowExpectedError[missing-type-arg] - unsafe getter lint suppression diff --git a/packages/@office-iss/react-native-win32/src-win/src/private/devsupport/rndevtools/ReactDevToolsSettingsManager.win32.js b/packages/@office-iss/react-native-win32/src-win/src/private/devsupport/rndevtools/ReactDevToolsSettingsManager.win32.js index 96d6f94b6af..bc95304aa0e 100644 --- a/packages/@office-iss/react-native-win32/src-win/src/private/devsupport/rndevtools/ReactDevToolsSettingsManager.win32.js +++ b/packages/@office-iss/react-native-win32/src-win/src/private/devsupport/rndevtools/ReactDevToolsSettingsManager.win32.js @@ -4,17 +4,16 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @flow strict-local + * @flow strict * @format */ import NativeReactDevToolsSettingsManager from './specs/NativeReactDevToolsSettingsManager'; -module.exports = { - setGlobalHookSettings(settings: string) { - NativeReactDevToolsSettingsManager?.setGlobalHookSettings(settings); - }, - getGlobalHookSettings(): ?string { - return NativeReactDevToolsSettingsManager?.getGlobalHookSettings(); - }, -}; +export function setGlobalHookSettings(settings: string) { + NativeReactDevToolsSettingsManager?.setGlobalHookSettings(settings); +} + +export function getGlobalHookSettings(): ?string { + return NativeReactDevToolsSettingsManager?.getGlobalHookSettings(); +} diff --git a/packages/@react-native-windows/automation-channel/package.json b/packages/@react-native-windows/automation-channel/package.json index 1932d807f2f..869ebd550b8 100644 --- a/packages/@react-native-windows/automation-channel/package.json +++ b/packages/@react-native-windows/automation-channel/package.json @@ -32,7 +32,7 @@ "just-scripts": "^1.3.2", "prettier": "2.8.8", "react": "19.1.0", - "react-native": "0.80.0-nightly-20250506-3ac16dd6a", + "react-native": "0.81.0-nightly-20250521-3cb70bb6a", "react-native-windows": "^0.0.0-canary.984", "typescript": "5.0.4" }, diff --git a/packages/@react-native-windows/tester/overrides.json b/packages/@react-native-windows/tester/overrides.json index a7ccc92ac6d..574eba35ca0 100644 --- a/packages/@react-native-windows/tester/overrides.json +++ b/packages/@react-native-windows/tester/overrides.json @@ -5,13 +5,13 @@ "excludePatterns": [ "src/js/examples-win/**" ], - "baseVersion": "0.80.0-nightly-20250506-3ac16dd6a", + "baseVersion": "0.81.0-nightly-20250521-3cb70bb6a", "overrides": [ { "type": "copy", "file": "js/examples/ContentURLAndroid/ContentURLAndroid.js", "baseFile": "packages/rn-tester/js/examples/ContentURLAndroid/ContentURLAndroid.js", - "baseHash": "f54f9e74fbe883c58a5ea6a6425b5ad548134940", + "baseHash": "8c8ae861aa6984218efc0f127bf6aba4b7960040", "issue": 14844 }, { @@ -43,7 +43,7 @@ "type": "patch", "file": "src/js/examples/FlatList/BaseFlatListExample.windows.js", "baseFile": "packages/rn-tester/js/examples/FlatList/BaseFlatListExample.js", - "baseHash": "44b784dbde64d0ca1616f0e31a07f232939d8dd7", + "baseHash": "533b9b1c2889c22af9ba923e17a8951ffbbfe3d7", "issue": 12869 }, { @@ -57,7 +57,7 @@ "type": "copy", "file": "src/js/examples/FlatList/FlatList-multiColumn.windows.js", "baseFile": "packages/rn-tester/js/examples/FlatList/FlatList-multiColumn.js", - "baseHash": "51da04f9ee49f1a5fd857db17361443636d73bca", + "baseHash": "5b2487a526ee0e4dd0e01f87f334fef99822d682", "issue": 12869 }, { @@ -85,7 +85,7 @@ "type": "patch", "file": "src/js/examples/Image/ImageExample.windows.js", "baseFile": "packages/rn-tester/js/examples/Image/ImageExample.js", - "baseHash": "20dec87a4f2c4c098adf9e3becc0969fb2b3036c", + "baseHash": "a3931ef84647705af55804b29eadb845d5185e87", "issue": 12869 }, { @@ -111,19 +111,13 @@ "type": "derived", "file": "src/js/examples/Text/TextExample.windows.js", "baseFile": "packages/rn-tester/js/examples/Text/TextExample.android.js", - "baseHash": "b40001649bf2c261009213ba56c7bc0bf2998419" - }, - { - "type": "derived", - "file": "src/js/examples/Text/TextInlineViewsExample.windows.js", - "baseFile": "packages/rn-tester/js/examples/Text/TextInlineViewsExample.js", - "baseHash": "63088038921558214c480b323dd2099698911f3f" + "baseHash": "b821fd7ae82ed4470ea3f06baafb87ac99c953f1" }, { "type": "patch", "file": "src/js/examples/TextInput/TextInputExample.windows.js", "baseFile": "packages/rn-tester/js/examples/TextInput/TextInputExample.android.js", - "baseHash": "8cc115a30795ee2fcf174e91f9cdbf56f4513a93", + "baseHash": "ed91ff793aa3c1305d75f795be74adcffe540edb", "issue": 5688 }, { diff --git a/packages/@react-native-windows/tester/package.json b/packages/@react-native-windows/tester/package.json index f1e2249c2c4..6d82d71d46d 100644 --- a/packages/@react-native-windows/tester/package.json +++ b/packages/@react-native-windows/tester/package.json @@ -33,7 +33,7 @@ "@types/node": "^18.0.0", "eslint": "^8.19.0", "just-scripts": "^1.3.3", - "react-native": "0.80.0-nightly-20250506-3ac16dd6a", + "react-native": "0.81.0-nightly-20250521-3cb70bb6a", "react-native-platform-override": "^1.9.56", "react-native-windows": "^0.0.0-canary.984", "typescript": "5.0.4" diff --git a/packages/@react-native-windows/tester/src/js/examples/FlatList/BaseFlatListExample.windows.js b/packages/@react-native-windows/tester/src/js/examples/FlatList/BaseFlatListExample.windows.js index d5548c7e503..7f202bdd541 100644 --- a/packages/@react-native-windows/tester/src/js/examples/FlatList/BaseFlatListExample.windows.js +++ b/packages/@react-native-windows/tester/src/js/examples/FlatList/BaseFlatListExample.windows.js @@ -67,48 +67,42 @@ type Props = { children?: ?React.Node, }; -const BaseFlatListExample = React.forwardRef( - // $FlowFixMe[incompatible-call] - ( - props: Props, - ref: - | ((null | FlatList) => mixed) - | {current: null | FlatList, ...}, - ) => { - return ( - - {props.testOutput != null ? ( - - - {props.testOutput} - - {props.onTest != null ? ( -