@office-iss/react-native-win32 0.0.0-canary.258 → 0.0.0-canary.260

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (142) hide show
  1. package/.flowconfig +2 -4
  2. package/CHANGELOG.json +31 -1
  3. package/CHANGELOG.md +24 -8
  4. package/Libraries/Alert/Alert.js +3 -0
  5. package/Libraries/Animated/AnimatedImplementation.js +7 -7
  6. package/Libraries/Animated/animations/Animation.js +10 -0
  7. package/Libraries/Animated/animations/TimingAnimation.js +1 -0
  8. package/Libraries/Animated/components/AnimatedScrollView.js +2 -2
  9. package/Libraries/Animated/createAnimatedComponent.js +1 -1
  10. package/Libraries/Animated/nodes/AnimatedValue.js +1 -0
  11. package/Libraries/Animated/useAnimatedProps.js +138 -6
  12. package/Libraries/BatchedBridge/NativeModules.js +2 -0
  13. package/Libraries/Blob/FileReader.js +1 -1
  14. package/Libraries/Blob/URL.js +2 -62
  15. package/Libraries/Blob/URLSearchParams.js +71 -0
  16. package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js +1 -1
  17. package/Libraries/Components/RefreshControl/__mocks__/RefreshControlMock.js +1 -1
  18. package/Libraries/Components/ScrollView/AndroidHorizontalScrollViewNativeComponent.js +3 -0
  19. package/Libraries/Components/ScrollView/ScrollView.js +5 -5
  20. package/Libraries/Components/ScrollView/ScrollViewNativeComponent.js +3 -0
  21. package/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +1 -1
  22. package/Libraries/Components/StatusBar/StatusBar.js +3 -1
  23. package/Libraries/Components/TextInput/AndroidTextInputNativeComponent.js +3 -0
  24. package/Libraries/Components/TextInput/TextInput.d.ts +32 -2
  25. package/Libraries/Components/TextInput/TextInput.js +220 -80
  26. package/Libraries/Components/TextInput/TextInput.win32.js +220 -86
  27. package/Libraries/Components/View/ReactNativeStyleAttributes.js +22 -0
  28. package/Libraries/Components/View/ReactNativeViewAttributes.js +2 -0
  29. package/Libraries/Components/View/ReactNativeViewAttributes.win32.js +2 -0
  30. package/Libraries/Components/View/ViewAccessibility.d.ts +15 -0
  31. package/Libraries/Components/View/ViewNativeComponent.js +6 -0
  32. package/Libraries/Components/View/ViewPropTypes.js +14 -0
  33. package/Libraries/Components/View/ViewPropTypes.win32.js +14 -0
  34. package/Libraries/Core/ExceptionsManager.js +2 -0
  35. package/Libraries/Core/InitializeCore.js +1 -1
  36. package/Libraries/Core/ReactFiberErrorDialog.js +3 -0
  37. package/Libraries/Core/ReactNativeVersion.js +1 -1
  38. package/Libraries/Core/setUpErrorHandling.js +7 -1
  39. package/Libraries/Core/setUpReactRefresh.js +0 -4
  40. package/Libraries/Image/AssetSourceResolver.js +28 -1
  41. package/Libraries/Image/Image.android.js +9 -14
  42. package/Libraries/Image/Image.ios.js +11 -22
  43. package/Libraries/Image/Image.win32.js +10 -21
  44. package/Libraries/Image/ImageBackground.js +1 -8
  45. package/Libraries/Image/ImageUtils.js +9 -9
  46. package/Libraries/Image/ImageViewNativeComponent.js +4 -0
  47. package/Libraries/Inspector/NetworkOverlay.js +1 -1
  48. package/Libraries/Interaction/TaskQueue.js +1 -0
  49. package/Libraries/Lists/FlatList.js +1 -1
  50. package/Libraries/Lists/SectionList.js +2 -2
  51. package/Libraries/Lists/SectionListModern.js +1 -1
  52. package/Libraries/LogBox/Data/LogBoxData.js +31 -4
  53. package/Libraries/NativeComponent/BaseViewConfig.android.js +2 -0
  54. package/Libraries/NativeComponent/BaseViewConfig.ios.js +7 -0
  55. package/Libraries/NativeComponent/BaseViewConfig.win32.js +7 -0
  56. package/Libraries/NativeComponent/NativeComponentRegistry.js +9 -2
  57. package/Libraries/Network/XMLHttpRequest.js +4 -2
  58. package/Libraries/ReactNative/BridgelessUIManager.js +1 -0
  59. package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricHostComponent.js +1 -1
  60. package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstance.js +5 -5
  61. package/Libraries/ReactNative/RendererImplementation.js +24 -2
  62. package/Libraries/ReactNative/getNativeComponentAttributes.js +8 -0
  63. package/Libraries/Renderer/shims/ReactNativeTypes.js +3 -1
  64. package/Libraries/StyleSheet/StyleSheet.js +1 -1
  65. package/Libraries/StyleSheet/StyleSheet.win32.js +1 -1
  66. package/Libraries/StyleSheet/StyleSheetTypes.d.ts +57 -19
  67. package/Libraries/StyleSheet/StyleSheetTypes.js +60 -23
  68. package/Libraries/StyleSheet/processBackgroundImage.js +286 -0
  69. package/Libraries/StyleSheet/processBoxShadow.js +211 -0
  70. package/Libraries/StyleSheet/processFilter.js +24 -14
  71. package/Libraries/Text/Text.js +395 -212
  72. package/Libraries/Text/Text.win32.js +443 -245
  73. package/Libraries/Text/TextNativeComponent.js +7 -0
  74. package/Libraries/Text/TextNativeComponent.win32.js +7 -0
  75. package/Libraries/TurboModule/TurboModuleRegistry.js +13 -50
  76. package/Libraries/Types/CodegenTypes.js +3 -1
  77. package/Libraries/Utilities/HMRClient.js +1 -0
  78. package/Libraries/Utilities/Platform.android.js +1 -1
  79. package/Libraries/Utilities/Platform.d.ts +1 -1
  80. package/Libraries/Utilities/Platform.flow.js +2 -2
  81. package/Libraries/Utilities/Platform.flow.win32.js +3 -3
  82. package/Libraries/Utilities/Platform.ios.js +1 -1
  83. package/Libraries/Utilities/Platform.win32.js +1 -1
  84. package/Libraries/Utilities/ReactNativeTestTools.js +1 -1
  85. package/Libraries/WebSocket/WebSocket.js +1 -1
  86. package/Libraries/vendor/emitter/EventEmitter.js +1 -0
  87. package/flow/jest.js +2 -2
  88. package/index.js +1 -0
  89. package/index.win32.js +1 -0
  90. package/jest/mockModal.js +1 -3
  91. package/jest/mockScrollView.js +1 -1
  92. package/jest/renderer.js +2 -2
  93. package/jest/setup.js +16 -9
  94. package/overrides.json +16 -16
  95. package/package.json +15 -15
  96. package/src/private/{core/components → components}/HScrollViewNativeComponents.js +8 -8
  97. package/src/private/{core/components → components}/VScrollViewNativeComponents.js +7 -7
  98. package/src/private/{core/components → components}/useSyncOnScroll.js +2 -2
  99. package/src/private/featureflags/ReactNativeFeatureFlags.js +143 -19
  100. package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +25 -5
  101. package/src/private/hooks/DebouncedEffectImplementation.js +148 -0
  102. package/src/private/hooks/useDebouncedEffect.js +23 -0
  103. package/{Libraries/Core → src/private/renderer/errorhandling}/ErrorHandlers.js +14 -4
  104. package/src/private/setup/setUpDOM.js +28 -0
  105. package/src/private/setup/setUpIntersectionObserver.js +27 -0
  106. package/src/private/setup/setUpMutationObserver.js +26 -0
  107. package/src/private/setup/setUpPerformanceObserver.js +64 -0
  108. package/src/private/specs/modules/NativeDebuggerSessionObserver.js +23 -0
  109. package/src/private/specs/modules/NativeLinkingManager.js +1 -1
  110. package/src/private/specs/modules/NativePlatformConstantsAndroid.js +1 -1
  111. package/src/private/specs/modules/NativePlatformConstantsIOS.js +1 -1
  112. package/src/private/specs/modules/NativePlatformConstantsWin.js +8 -1
  113. package/src/private/webapis/dom/nodes/ReadOnlyNode.js +6 -4
  114. package/{Libraries/IntersectionObserver → src/private/webapis/intersectionobserver}/IntersectionObserver.js +1 -1
  115. package/{Libraries/IntersectionObserver → src/private/webapis/intersectionobserver}/IntersectionObserverEntry.js +3 -3
  116. package/{Libraries/IntersectionObserver → src/private/webapis/intersectionobserver}/IntersectionObserverManager.js +5 -8
  117. package/src/private/{specs/modules → webapis/intersectionobserver/specs}/NativeIntersectionObserver.js +2 -2
  118. package/{Libraries/IntersectionObserver → src/private/webapis/intersectionobserver/specs}/__mocks__/NativeIntersectionObserver.js +4 -4
  119. package/{Libraries/MutationObserver → src/private/webapis/mutationobserver}/MutationObserver.js +1 -1
  120. package/{Libraries/MutationObserver → src/private/webapis/mutationobserver}/MutationObserverManager.js +5 -5
  121. package/{Libraries/MutationObserver → src/private/webapis/mutationobserver}/MutationRecord.js +4 -6
  122. package/src/private/{specs/modules → webapis/mutationobserver/specs}/NativeMutationObserver.js +2 -2
  123. package/{Libraries/MutationObserver → src/private/webapis/mutationobserver/specs}/__mocks__/NativeMutationObserver.js +5 -5
  124. package/src/private/webapis/performance/{EventCounts.js → EventTiming.js} +65 -3
  125. package/src/private/webapis/performance/LongTasks.js +39 -0
  126. package/src/private/webapis/performance/Performance.js +22 -9
  127. package/src/private/webapis/performance/PerformanceEntry.js +36 -18
  128. package/src/private/webapis/performance/PerformanceObserver.js +29 -43
  129. package/src/private/webapis/performance/RawPerformanceEntry.js +24 -1
  130. package/src/private/webapis/performance/UserTiming.js +17 -12
  131. package/src/private/webapis/performance/specs/NativePerformanceObserver.js +1 -1
  132. package/src-win/Libraries/Components/View/ViewAccessibility.d.ts +15 -0
  133. package/types/experimental.d.ts +20 -1
  134. package/Libraries/Core/setUpIntersectionObserver.js +0 -16
  135. package/Libraries/Core/setUpMutationObserver.js +0 -16
  136. package/Libraries/Core/setUpPerformanceObserver.js +0 -18
  137. package/Libraries/IntersectionObserver/NativeIntersectionObserver.js +0 -13
  138. package/Libraries/MutationObserver/NativeMutationObserver.js +0 -13
  139. package/Libraries/Text/TextOptimized.js +0 -538
  140. package/src/private/core/setUpDOM.js +0 -18
  141. package/src/private/webapis/performance/PerformanceEventTiming.js +0 -55
  142. /package/src/private/{core → styles}/composeStyles.js +0 -0
@@ -9,6 +9,7 @@
9
9
  */
10
10
 
11
11
  import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes';
12
+ import type {____TextStyle_Internal as TextStyleInternal} from '../../StyleSheet/StyleSheetTypes';
12
13
  import type {
13
14
  PressEvent,
14
15
  ScrollEvent,
@@ -17,6 +18,7 @@ import type {
17
18
  import type {ViewProps} from '../View/ViewPropTypes';
18
19
  import type {TextInputType} from './TextInput.flow';
19
20
 
21
+ import * as ReactNativeFeatureFlags from '../../../src/private/featureflags/ReactNativeFeatureFlags';
20
22
  import usePressability from '../../Pressability/usePressability';
21
23
  import flattenStyle from '../../StyleSheet/flattenStyle';
22
24
  import StyleSheet, {
@@ -1000,8 +1002,188 @@ export type Props = $ReadOnly<{|
1000
1002
  value?: ?Stringish,
1001
1003
  |}>;
1002
1004
 
1005
+ type ViewCommands = $NonMaybeType<
1006
+ | typeof AndroidTextInputCommands
1007
+ | typeof RCTMultilineTextInputNativeCommands
1008
+ | typeof RCTSinglelineTextInputNativeCommands,
1009
+ >;
1010
+
1011
+ type LastNativeSelection = {|
1012
+ selection: Selection,
1013
+ mostRecentEventCount: number,
1014
+ |};
1015
+
1003
1016
  const emptyFunctionThatReturnsTrue = () => true;
1004
1017
 
1018
+ /**
1019
+ * This hook handles the synchronization between the state of the text input
1020
+ * in native and in JavaScript. This is necessary due to the asynchronous nature
1021
+ * of text input events.
1022
+ */
1023
+ function useTextInputStateSynchronization_STATE({
1024
+ props,
1025
+ mostRecentEventCount,
1026
+ selection,
1027
+ inputRef,
1028
+ text,
1029
+ viewCommands,
1030
+ }: {
1031
+ props: Props,
1032
+ mostRecentEventCount: number,
1033
+ selection: ?Selection,
1034
+ inputRef: React.RefObject<null | React.ElementRef<HostComponent<mixed>>>,
1035
+ text: string,
1036
+ viewCommands: ViewCommands,
1037
+ }): {
1038
+ setLastNativeText: string => void,
1039
+ setLastNativeSelection: LastNativeSelection => void,
1040
+ } {
1041
+ const [lastNativeText, setLastNativeText] = useState<?Stringish>(props.value);
1042
+ const [lastNativeSelectionState, setLastNativeSelection] =
1043
+ useState<LastNativeSelection>({
1044
+ selection: {start: -1, end: -1},
1045
+ mostRecentEventCount: mostRecentEventCount,
1046
+ });
1047
+
1048
+ const lastNativeSelection = lastNativeSelectionState.selection;
1049
+
1050
+ // This is necessary in case native updates the text and JS decides
1051
+ // that the update should be ignored and we should stick with the value
1052
+ // that we have in JS.
1053
+ useLayoutEffect(() => {
1054
+ const nativeUpdate: {text?: string, selection?: Selection} = {};
1055
+
1056
+ if (lastNativeText !== props.value && typeof props.value === 'string') {
1057
+ nativeUpdate.text = props.value;
1058
+ setLastNativeText(props.value);
1059
+ }
1060
+
1061
+ if (
1062
+ selection &&
1063
+ lastNativeSelection &&
1064
+ (lastNativeSelection.start !== selection.start ||
1065
+ lastNativeSelection.end !== selection.end)
1066
+ ) {
1067
+ nativeUpdate.selection = selection;
1068
+ setLastNativeSelection({selection, mostRecentEventCount});
1069
+ }
1070
+
1071
+ if (Object.keys(nativeUpdate).length === 0) {
1072
+ return;
1073
+ }
1074
+
1075
+ if (inputRef.current != null) {
1076
+ viewCommands.setTextAndSelection(
1077
+ inputRef.current,
1078
+ mostRecentEventCount,
1079
+ text,
1080
+ selection?.start ?? -1,
1081
+ selection?.end ?? -1,
1082
+ );
1083
+ }
1084
+ }, [
1085
+ mostRecentEventCount,
1086
+ inputRef,
1087
+ props.value,
1088
+ props.defaultValue,
1089
+ lastNativeText,
1090
+ selection,
1091
+ lastNativeSelection,
1092
+ text,
1093
+ viewCommands,
1094
+ ]);
1095
+
1096
+ return {setLastNativeText, setLastNativeSelection};
1097
+ }
1098
+
1099
+ /**
1100
+ * This hook handles the synchronization between the state of the text input
1101
+ * in native and in JavaScript. This is necessary due to the asynchronous nature
1102
+ * of text input events.
1103
+ */
1104
+ function useTextInputStateSynchronization_REFS({
1105
+ props,
1106
+ mostRecentEventCount,
1107
+ selection,
1108
+ inputRef,
1109
+ text,
1110
+ viewCommands,
1111
+ }: {
1112
+ props: Props,
1113
+ mostRecentEventCount: number,
1114
+ selection: ?Selection,
1115
+ inputRef: React.RefObject<null | React.ElementRef<HostComponent<mixed>>>,
1116
+ text: string,
1117
+ viewCommands: ViewCommands,
1118
+ }): {
1119
+ setLastNativeText: string => void,
1120
+ setLastNativeSelection: LastNativeSelection => void,
1121
+ } {
1122
+ const lastNativeTextRef = useRef<?Stringish>(props.value);
1123
+ const lastNativeSelectionRef = useRef<LastNativeSelection>({
1124
+ selection: {start: -1, end: -1},
1125
+ mostRecentEventCount: mostRecentEventCount,
1126
+ });
1127
+
1128
+ // This is necessary in case native updates the text and JS decides
1129
+ // that the update should be ignored and we should stick with the value
1130
+ // that we have in JS.
1131
+ useLayoutEffect(() => {
1132
+ const nativeUpdate: {text?: string, selection?: Selection} = {};
1133
+
1134
+ const lastNativeSelection = lastNativeSelectionRef.current.selection;
1135
+
1136
+ if (
1137
+ lastNativeTextRef.current !== props.value &&
1138
+ typeof props.value === 'string'
1139
+ ) {
1140
+ nativeUpdate.text = props.value;
1141
+ lastNativeTextRef.current = props.value;
1142
+ }
1143
+
1144
+ if (
1145
+ selection &&
1146
+ lastNativeSelection &&
1147
+ (lastNativeSelection.start !== selection.start ||
1148
+ lastNativeSelection.end !== selection.end)
1149
+ ) {
1150
+ nativeUpdate.selection = selection;
1151
+ lastNativeSelectionRef.current = {selection, mostRecentEventCount};
1152
+ }
1153
+
1154
+ if (Object.keys(nativeUpdate).length === 0) {
1155
+ return;
1156
+ }
1157
+
1158
+ if (inputRef.current != null) {
1159
+ viewCommands.setTextAndSelection(
1160
+ inputRef.current,
1161
+ mostRecentEventCount,
1162
+ text,
1163
+ selection?.start ?? -1,
1164
+ selection?.end ?? -1,
1165
+ );
1166
+ }
1167
+ }, [
1168
+ mostRecentEventCount,
1169
+ inputRef,
1170
+ props.value,
1171
+ props.defaultValue,
1172
+ selection,
1173
+ text,
1174
+ viewCommands,
1175
+ ]);
1176
+
1177
+ return {
1178
+ setLastNativeText: lastNativeText => {
1179
+ lastNativeTextRef.current = lastNativeText;
1180
+ },
1181
+ setLastNativeSelection: lastNativeSelection => {
1182
+ lastNativeSelectionRef.current = lastNativeSelection;
1183
+ },
1184
+ };
1185
+ }
1186
+
1005
1187
  /**
1006
1188
  * A foundational component for inputting text into the app via a
1007
1189
  * keyboard. Props provide configurability for several features, such as
@@ -1134,7 +1316,6 @@ function InternalTextInput(props: Props): React.Node {
1134
1316
 
1135
1317
  const inputRef = useRef<null | React.ElementRef<HostComponent<mixed>>>(null);
1136
1318
 
1137
- // eslint-disable-next-line react-hooks/exhaustive-deps
1138
1319
  const selection: ?Selection =
1139
1320
  propsSelection == null
1140
1321
  ? null
@@ -1143,34 +1324,6 @@ function InternalTextInput(props: Props): React.Node {
1143
1324
  end: propsSelection.end ?? propsSelection.start,
1144
1325
  };
1145
1326
 
1146
- const [mostRecentEventCount, setMostRecentEventCount] = useState<number>(0);
1147
- const [lastNativeText, setLastNativeText] = useState<?Stringish>(props.value);
1148
- const [lastNativeSelectionState, setLastNativeSelection] = useState<{|
1149
- selection: Selection,
1150
- mostRecentEventCount: number,
1151
- |}>({
1152
- selection: {start: -1, end: -1},
1153
- mostRecentEventCount: mostRecentEventCount,
1154
- });
1155
-
1156
- const lastNativeSelection = lastNativeSelectionState.selection;
1157
-
1158
- let viewCommands;
1159
- if (AndroidTextInputCommands) {
1160
- viewCommands = AndroidTextInputCommands;
1161
- }
1162
- // [Windows
1163
- else if (WindowsTextInputCommands) {
1164
- viewCommands = WindowsTextInputCommands;
1165
- }
1166
- // Windows]
1167
- else {
1168
- viewCommands =
1169
- props.multiline === true
1170
- ? RCTMultilineTextInputNativeCommands
1171
- : RCTSinglelineTextInputNativeCommands;
1172
- }
1173
-
1174
1327
  const text =
1175
1328
  typeof props.value === 'string'
1176
1329
  ? props.value
@@ -1178,51 +1331,26 @@ function InternalTextInput(props: Props): React.Node {
1178
1331
  ? props.defaultValue
1179
1332
  : '';
1180
1333
 
1181
- // This is necessary in case native updates the text and JS decides
1182
- // that the update should be ignored and we should stick with the value
1183
- // that we have in JS.
1184
- useLayoutEffect(() => {
1185
- const nativeUpdate: {text?: string, selection?: Selection} = {};
1334
+ const viewCommands =
1335
+ WindowsTextInputCommands || AndroidTextInputCommands || // [Windows]
1336
+ (props.multiline === true
1337
+ ? RCTMultilineTextInputNativeCommands
1338
+ : RCTSinglelineTextInputNativeCommands)
1186
1339
 
1187
- if (lastNativeText !== props.value && typeof props.value === 'string') {
1188
- nativeUpdate.text = props.value;
1189
- setLastNativeText(props.value);
1190
- }
1191
-
1192
- if (
1193
- selection &&
1194
- lastNativeSelection &&
1195
- (lastNativeSelection.start !== selection.start ||
1196
- lastNativeSelection.end !== selection.end)
1197
- ) {
1198
- nativeUpdate.selection = selection;
1199
- setLastNativeSelection({selection, mostRecentEventCount});
1200
- }
1201
-
1202
- if (Object.keys(nativeUpdate).length === 0) {
1203
- return;
1204
- }
1205
-
1206
- if (inputRef.current != null) {
1207
- viewCommands.setTextAndSelection(
1208
- inputRef.current,
1209
- mostRecentEventCount,
1210
- text,
1211
- selection?.start ?? -1,
1212
- selection?.end ?? -1,
1213
- );
1214
- }
1215
- }, [
1216
- mostRecentEventCount,
1217
- inputRef,
1218
- props.value,
1219
- props.defaultValue,
1220
- lastNativeText,
1221
- selection,
1222
- lastNativeSelection,
1223
- text,
1224
- viewCommands,
1225
- ]);
1340
+ const [mostRecentEventCount, setMostRecentEventCount] = useState<number>(0);
1341
+ const useTextInputStateSynchronization =
1342
+ ReactNativeFeatureFlags.useRefsForTextInputState()
1343
+ ? useTextInputStateSynchronization_REFS
1344
+ : useTextInputStateSynchronization_STATE;
1345
+ const {setLastNativeText, setLastNativeSelection} =
1346
+ useTextInputStateSynchronization({
1347
+ props,
1348
+ inputRef,
1349
+ mostRecentEventCount,
1350
+ selection,
1351
+ text,
1352
+ viewCommands,
1353
+ });
1226
1354
 
1227
1355
  useLayoutEffect(() => {
1228
1356
  const inputRefValue = inputRef.current;
@@ -1238,7 +1366,7 @@ function InternalTextInput(props: Props): React.Node {
1238
1366
  }
1239
1367
  };
1240
1368
  }
1241
- }, [inputRef]);
1369
+ }, []);
1242
1370
 
1243
1371
  const setLocalRef = useCallback(
1244
1372
  (instance: TextInputInstance | null) => {
@@ -1514,12 +1642,18 @@ function InternalTextInput(props: Props): React.Node {
1514
1642
  };
1515
1643
  }
1516
1644
 
1517
- const style = flattenStyle<TextStyleProp>(props.style);
1518
-
1519
- if (typeof style?.fontWeight === 'number') {
1520
- // $FlowFixMe[prop-missing]
1521
- // $FlowFixMe[cannot-write]
1522
- style.fontWeight = style?.fontWeight.toString();
1645
+ // Keep the original (potentially nested) style when possible, as React can diff these more efficiently
1646
+ let _style = props.style;
1647
+ const flattenedStyle = flattenStyle<TextStyleProp>(props.style);
1648
+ if (typeof flattenedStyle?.fontWeight === 'number') {
1649
+ _style = [
1650
+ _style,
1651
+ {
1652
+ fontWeight:
1653
+ // $FlowFixMe[incompatible-cast]
1654
+ (flattenedStyle.fontWeight.toString(): TextStyleInternal['fontWeight']),
1655
+ },
1656
+ ];
1523
1657
  }
1524
1658
 
1525
1659
  if (Platform.OS === 'ios') {
@@ -1530,10 +1664,10 @@ function InternalTextInput(props: Props): React.Node {
1530
1664
 
1531
1665
  const useMultilineDefaultStyle =
1532
1666
  props.multiline === true &&
1533
- (style == null ||
1534
- (style.padding == null &&
1535
- style.paddingVertical == null &&
1536
- style.paddingTop == null));
1667
+ (flattenedStyle == null ||
1668
+ (flattenedStyle.padding == null &&
1669
+ flattenedStyle.paddingVertical == null &&
1670
+ flattenedStyle.paddingTop == null));
1537
1671
 
1538
1672
  textInput = (
1539
1673
  <RCTTextInputView
@@ -1561,7 +1695,7 @@ function InternalTextInput(props: Props): React.Node {
1561
1695
  selectionColor={selectionColor}
1562
1696
  style={StyleSheet.compose(
1563
1697
  useMultilineDefaultStyle ? styles.multilineDefault : null,
1564
- style,
1698
+ _style,
1565
1699
  )}
1566
1700
  text={text}
1567
1701
  />
@@ -1629,7 +1763,7 @@ function InternalTextInput(props: Props): React.Node {
1629
1763
  onScroll={_onScroll}
1630
1764
  onSelectionChange={_onSelectionChange}
1631
1765
  placeholder={placeholder}
1632
- style={style}
1766
+ style={_style}
1633
1767
  text={text}
1634
1768
  textBreakStrategy={props.textBreakStrategy}
1635
1769
  />
@@ -11,6 +11,8 @@
11
11
  import type {AnyAttributeType} from '../../Renderer/shims/ReactNativeTypes';
12
12
 
13
13
  import processAspectRatio from '../../StyleSheet/processAspectRatio';
14
+ import processBackgroundImage from '../../StyleSheet/processBackgroundImage';
15
+ import processBoxShadow from '../../StyleSheet/processBoxShadow';
14
16
  import processColor from '../../StyleSheet/processColor';
15
17
  import processFilter from '../../StyleSheet/processFilter';
16
18
  import processFontVariant from '../../StyleSheet/processFontVariant';
@@ -120,6 +122,26 @@ const ReactNativeStyleAttributes: {[string]: AnyAttributeType, ...} = {
120
122
  */
121
123
  experimental_filter: {process: processFilter},
122
124
 
125
+ /**
126
+ * MixBlendMode
127
+ */
128
+ experimental_mixBlendMode: true,
129
+
130
+ /**
131
+ * Isolation
132
+ */
133
+ isolation: true,
134
+
135
+ /*
136
+ * BoxShadow
137
+ */
138
+ experimental_boxShadow: {process: processBoxShadow},
139
+
140
+ /**
141
+ * Linear Gradient
142
+ */
143
+ experimental_backgroundImage: {process: processBackgroundImage},
144
+
123
145
  /**
124
146
  * View
125
147
  */
@@ -22,6 +22,8 @@ const UIView = {
22
22
  accessibilityValue: true,
23
23
  accessibilityHint: true,
24
24
  accessibilityLanguage: true,
25
+ accessibilityShowsLargeContentViewer: true,
26
+ accessibilityLargeContentTitle: true,
25
27
  importantForAccessibility: true,
26
28
  nativeID: true,
27
29
  testID: true,
@@ -22,6 +22,8 @@ const UIView = {
22
22
  accessibilityValue: true,
23
23
  accessibilityHint: true,
24
24
  accessibilityLanguage: true,
25
+ accessibilityShowsLargeContentViewer: true,
26
+ accessibilityLargeContentTitle: true,
25
27
  importantForAccessibility: true,
26
28
  nativeID: true,
27
29
  testID: true,
@@ -366,6 +366,21 @@ export interface AccessibilityPropsIOS {
366
366
  * @platform ios
367
367
  */
368
368
  accessibilityLanguage?: string | undefined;
369
+
370
+ /**
371
+ * A Boolean value that indicates whether or not to show the item in the large content viewer.
372
+ * Available on iOS 13.0+
373
+ * https://reactnative.dev/docs/accessibility#accessibilityshowslargecontentviewer
374
+ * @platform ios
375
+ */
376
+ accessibilityShowsLargeContentViewer?: boolean | undefined;
377
+
378
+ /**
379
+ * When `accessibilityShowsLargeContentViewer` is set, this string will be used as title for the large content viewer.
380
+ * https://reactnative.dev/docs/accessibility#accessibilitylargecontenttitle
381
+ * @platform ios
382
+ */
383
+ accessibilityLargeContentTitle?: string | undefined;
369
384
  }
370
385
 
371
386
  // [Win32]
@@ -94,11 +94,17 @@ export const __INTERNAL_VIEW_CONFIG: PartialViewConfig =
94
94
  borderBlockStartColor: {
95
95
  process: require('../../StyleSheet/processColor').default,
96
96
  },
97
+ experimental_boxShadow: {
98
+ process: require('../../StyleSheet/processBoxShadow').default,
99
+ },
97
100
 
98
101
  focusable: true,
99
102
  overflow: true,
100
103
  backfaceVisibility: true,
101
104
  experimental_layoutConformance: true,
105
+ experimental_backgroundImage: {
106
+ process: require('../../StyleSheet/processBackgroundImage').default,
107
+ },
102
108
  },
103
109
  }
104
110
  : {
@@ -415,6 +415,20 @@ type IOSViewProps = $ReadOnly<{|
415
415
  */
416
416
  accessibilityViewIsModal?: ?boolean,
417
417
 
418
+ /**
419
+ * @platform ios
420
+ *
421
+ * See https://reactnative.dev/docs/view#accessibilityshowslargecontentviewer
422
+ */
423
+ accessibilityShowsLargeContentViewer?: ?boolean,
424
+
425
+ /**
426
+ * @platform ios
427
+ *
428
+ * See https://reactnative.dev/docs/view#accessibilitylargecontenttitle
429
+ */
430
+ accessibilityLargeContentTitle?: ?string,
431
+
418
432
  /**
419
433
  * The aria-modal attribute indicates content contained within a modal with aria-modal="true"
420
434
  * should be accessible to the user.
@@ -416,6 +416,20 @@ type IOSViewProps = $ReadOnly<{|
416
416
  */
417
417
  accessibilityViewIsModal?: ?boolean,
418
418
 
419
+ /**
420
+ * @platform ios
421
+ *
422
+ * See https://reactnative.dev/docs/view#accessibilityshowslargecontentviewer
423
+ */
424
+ accessibilityShowsLargeContentViewer?: ?boolean,
425
+
426
+ /**
427
+ * @platform ios
428
+ *
429
+ * See https://reactnative.dev/docs/view#accessibilitylargecontenttitle
430
+ */
431
+ accessibilityLargeContentTitle?: ?string,
432
+
419
433
  /**
420
434
  * The aria-modal attribute indicates content contained within a modal with aria-modal="true"
421
435
  * should be accessible to the user.
@@ -154,6 +154,7 @@ function handleException(e: mixed, isFatal: boolean) {
154
154
  inExceptionHandler = true;
155
155
  /* $FlowFixMe[class-object-subtyping] added when improving typing for this
156
156
  * parameters */
157
+ // $FlowFixMe[incompatible-call]
157
158
  reportException(error, isFatal, /*reportToConsole*/ true);
158
159
  } finally {
159
160
  inExceptionHandler = false;
@@ -225,6 +226,7 @@ function reactConsoleErrorHandler(...args) {
225
226
  reportException(
226
227
  /* $FlowFixMe[class-object-subtyping] added when improving typing for this
227
228
  * parameters */
229
+ // $FlowFixMe[incompatible-call]
228
230
  error,
229
231
  false, // isFatal
230
232
  false, // reportToConsole
@@ -29,7 +29,7 @@
29
29
  const start = Date.now();
30
30
 
31
31
  require('./setUpGlobals');
32
- require('../../src/private/core/setUpDOM');
32
+ require('../../src/private/setup/setUpDOM').default();
33
33
  require('./setUpPerformance');
34
34
  require('./setUpErrorHandling');
35
35
  require('./polyfillPromise');
@@ -32,14 +32,17 @@ const ReactFiberErrorDialog = {
32
32
  if (errorValue instanceof Error) {
33
33
  /* $FlowFixMe[class-object-subtyping] added when improving typing for
34
34
  * this parameters */
35
+ // $FlowFixMe[incompatible-cast]
35
36
  error = (errorValue: ExtendedError);
36
37
  } else if (typeof errorValue === 'string') {
37
38
  /* $FlowFixMe[class-object-subtyping] added when improving typing for
38
39
  * this parameters */
40
+ // $FlowFixMe[incompatible-cast]
39
41
  error = (new SyntheticError(errorValue): ExtendedError);
40
42
  } else {
41
43
  /* $FlowFixMe[class-object-subtyping] added when improving typing for
42
44
  * this parameters */
45
+ // $FlowFixMe[incompatible-cast]
43
46
  error = (new SyntheticError('Unspecified error'): ExtendedError);
44
47
  }
45
48
  try {
@@ -17,7 +17,7 @@ const version: $ReadOnly<{
17
17
  major: 0,
18
18
  minor: 76,
19
19
  patch: 0,
20
- prerelease: 'nightly-20240701-9f6cb21ed',
20
+ prerelease: 'nightly-20240816-17017d2b8',
21
21
  };
22
22
 
23
23
  module.exports = {version};
@@ -21,7 +21,13 @@ ExceptionsManager.installConsoleErrorReporter();
21
21
  if (!global.__fbDisableExceptionsManager) {
22
22
  const handleError = (e: mixed, isFatal: boolean) => {
23
23
  try {
24
- ExceptionsManager.handleException(e, isFatal);
24
+ // TODO(T196834299): We should really use a c++ turbomodule for this
25
+ if (
26
+ !global.RN$handleException ||
27
+ !global.RN$handleException(e, isFatal)
28
+ ) {
29
+ ExceptionsManager.handleException(e, isFatal);
30
+ }
25
31
  } catch (ee) {
26
32
  console.log('Failed to print error: ', ee.message);
27
33
  throw e;
@@ -36,10 +36,6 @@ if (__DEV__) {
36
36
  register: ReactRefreshRuntime.register,
37
37
 
38
38
  performReactRefresh() {
39
- if (ReactRefreshRuntime.hasUnrecoverableErrors()) {
40
- DevSettings.reload('Fast Refresh - Unrecoverable');
41
- return;
42
- }
43
39
  ReactRefreshRuntime.performReactRefresh();
44
40
  DevSettings.onFastRefresh();
45
41
  },
@@ -18,7 +18,10 @@ export type ResolvedAssetSource = {|
18
18
  +scale: number,
19
19
  |};
20
20
 
21
- import type {PackagerAsset} from '@react-native/assets-registry/registry';
21
+ import type {
22
+ AssetDestPathResolver,
23
+ PackagerAsset,
24
+ } from '@react-native/assets-registry/registry';
22
25
 
23
26
  const PixelRatio = require('../Utilities/PixelRatio').default;
24
27
  const Platform = require('../Utilities/Platform');
@@ -76,6 +79,10 @@ class AssetSourceResolver {
76
79
  return this.assetServerURL();
77
80
  }
78
81
 
82
+ if (this.asset.resolver != null) {
83
+ return this.getAssetUsingResolver(this.asset.resolver);
84
+ }
85
+
79
86
  if (Platform.OS === 'android') {
80
87
  return this.isLoadedFromFileSystem()
81
88
  ? this.drawableFolderInBundle()
@@ -85,6 +92,26 @@ class AssetSourceResolver {
85
92
  }
86
93
  }
87
94
 
95
+ getAssetUsingResolver(resolver: AssetDestPathResolver): ResolvedAssetSource {
96
+ switch (resolver) {
97
+ case 'android':
98
+ return this.isLoadedFromFileSystem()
99
+ ? this.drawableFolderInBundle()
100
+ : this.resourceIdentifierWithoutScale();
101
+ case 'generic':
102
+ return this.scaledAssetURLNearBundle();
103
+ default:
104
+ throw new Error(
105
+ "Don't know how to get asset via provided resolver: " +
106
+ resolver +
107
+ '\nAsset: ' +
108
+ JSON.stringify(this.asset, null, '\t') +
109
+ '\nPossible resolvers are:' +
110
+ JSON.stringify(['android', 'generic'], null, '\t'),
111
+ );
112
+ }
113
+ }
114
+
88
115
  /**
89
116
  * Returns an absolute URL which can be used to fetch the asset
90
117
  * from the devserver