@office-iss/react-native-win32 0.72.7 → 0.73.0-preview.1

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 (272) hide show
  1. package/.flowconfig +15 -4
  2. package/CHANGELOG.json +523 -94
  3. package/CHANGELOG.md +209 -52
  4. package/IntegrationTests/PromiseTest.js +1 -0
  5. package/IntegrationTests/websocket_integration_test_server.js +1 -1
  6. package/Libraries/Animated/Animated.js +1 -1
  7. package/Libraries/Animated/AnimatedImplementation.js +1 -1
  8. package/Libraries/Animated/NativeAnimatedHelper.js +14 -10
  9. package/Libraries/Animated/NativeAnimatedHelper.win32.js +16 -12
  10. package/Libraries/Animated/NativeAnimatedModule.js +6 -2
  11. package/Libraries/Animated/NativeAnimatedTurboModule.js +7 -4
  12. package/Libraries/Animated/animations/Animation.js +57 -3
  13. package/Libraries/Animated/animations/DecayAnimation.js +9 -0
  14. package/Libraries/Animated/animations/SpringAnimation.js +8 -0
  15. package/Libraries/Animated/animations/TimingAnimation.js +8 -0
  16. package/Libraries/Animated/components/AnimatedFlatList.js +2 -1
  17. package/Libraries/Animated/components/AnimatedScrollView.js +2 -0
  18. package/Libraries/Animated/components/AnimatedSectionList.js +2 -1
  19. package/Libraries/Animated/createAnimatedComponent.js +1 -0
  20. package/Libraries/Animated/nodes/AnimatedColor.js +1 -1
  21. package/Libraries/Animated/nodes/AnimatedObject.js +146 -0
  22. package/Libraries/Animated/nodes/AnimatedProps.js +19 -7
  23. package/Libraries/Animated/nodes/AnimatedStyle.js +29 -55
  24. package/Libraries/Animated/nodes/AnimatedValueXY.js +3 -17
  25. package/Libraries/Animated/shouldUseTurboAnimatedModule.js +17 -0
  26. package/Libraries/Animated/useAnimatedProps.js +9 -10
  27. package/Libraries/AppState/AppState.d.ts +1 -1
  28. package/Libraries/AppState/NativeAppState.js +8 -4
  29. package/Libraries/BatchedBridge/MessageQueue.js +45 -36
  30. package/Libraries/Blob/Blob.js +6 -2
  31. package/Libraries/Blob/BlobManager.js +9 -10
  32. package/Libraries/Blob/BlobRegistry.js +14 -9
  33. package/Libraries/Blob/File.js +1 -1
  34. package/Libraries/Blob/FileReader.js +1 -2
  35. package/Libraries/Components/Button/ButtonWin32.Props.d.ts +1 -1
  36. package/Libraries/Components/Button/ButtonWin32.Props.js.map +1 -1
  37. package/Libraries/Components/Button/ButtonWin32.d.ts +1 -1
  38. package/Libraries/Components/Button/ButtonWin32.js +1 -4
  39. package/Libraries/Components/Button/ButtonWin32.js.map +1 -1
  40. package/Libraries/Components/Clipboard/Clipboard.d.ts +4 -4
  41. package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js +3 -1
  42. package/Libraries/Components/EnterString.win32.d.ts +1 -1
  43. package/Libraries/Components/Keyboard/KeyboardAvoidingView.js +26 -6
  44. package/Libraries/Components/Pressable/Pressable.js +3 -2
  45. package/Libraries/Components/Pressable/Pressable.win32.js +4 -3
  46. package/Libraries/Components/Pressable/useAndroidRippleForView.js +1 -1
  47. package/Libraries/Components/SafeAreaView/SafeAreaView.js +7 -7
  48. package/Libraries/Components/SafeAreaView/SafeAreaView.win32.js +7 -8
  49. package/Libraries/Components/ScrollView/ScrollView.js +3 -1
  50. package/Libraries/Components/ScrollView/ScrollView.win32.js +3 -1
  51. package/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +39 -46
  52. package/Libraries/Components/Switch/Switch.js +1 -0
  53. package/Libraries/Components/Text/TextWin32.d.ts +1 -1
  54. package/Libraries/Components/TextInput/RCTTextInputViewConfig.js +1 -0
  55. package/Libraries/Components/TextInput/TextInput.d.ts +49 -7
  56. package/Libraries/Components/TextInput/TextInput.flow.js +43 -10
  57. package/Libraries/Components/TextInput/TextInput.js +62 -10
  58. package/Libraries/Components/TextInput/TextInput.win32.js +953 -206
  59. package/Libraries/Components/TextInput/Win32TextInputNativeComponent.js +23 -0
  60. package/Libraries/Components/ToastAndroid/{ToastAndroid.ios.js → ToastAndroid.js} +9 -1
  61. package/Libraries/Components/ToastAndroid/ToastAndroid.win32.js +9 -1
  62. package/Libraries/Components/Touchable/Tests/TouchableWin32Test.js +2 -2
  63. package/Libraries/Components/Touchable/Tests/TouchableWin32Test.js.map +1 -1
  64. package/Libraries/Components/Touchable/TouchableBounce.js +1 -1
  65. package/Libraries/Components/Touchable/TouchableHighlight.js +1 -1
  66. package/Libraries/Components/Touchable/TouchableNativeFeedback.js +1 -1
  67. package/Libraries/Components/Touchable/TouchableOpacity.js +4 -1
  68. package/Libraries/Components/Touchable/TouchableWin32.d.ts +1 -1
  69. package/Libraries/Components/Touchable/TouchableWin32.js.map +1 -1
  70. package/Libraries/Components/Touchable/TouchableWithoutFeedback.js +1 -0
  71. package/Libraries/Components/TraceUpdateOverlay/TraceUpdateOverlay.js +16 -6
  72. package/Libraries/Components/View/ReactNativeStyleAttributes.js +9 -0
  73. package/Libraries/Components/View/ReactNativeViewAttributes.js +1 -0
  74. package/Libraries/Components/View/ReactNativeViewAttributes.win32.js +1 -0
  75. package/Libraries/Components/View/View.js +46 -32
  76. package/Libraries/Components/View/View.win32.js +37 -6
  77. package/Libraries/Components/View/ViewAccessibility.d.ts +8 -2
  78. package/Libraries/Components/View/ViewNativeComponent.js +1 -0
  79. package/Libraries/Components/View/ViewPropTypes.js +18 -3
  80. package/Libraries/Components/View/ViewPropTypes.win32.js +30 -4
  81. package/Libraries/Components/View/ViewWin32.js +3 -2
  82. package/Libraries/Core/Devtools/loadBundleFromServer.js +152 -0
  83. package/Libraries/Core/Devtools/symbolicateStackTrace.js +2 -1
  84. package/Libraries/Core/ExceptionsManager.js +16 -7
  85. package/Libraries/Core/ExtendedError.js +12 -0
  86. package/Libraries/Core/ReactNativeVersion.js +3 -3
  87. package/Libraries/Core/ReactNativeVersionCheck.js +0 -2
  88. package/Libraries/Core/ReactNativeVersionCheck.win32.js +0 -2
  89. package/Libraries/Core/__mocks__/NativeExceptionsManager.js +20 -0
  90. package/Libraries/Core/setUpDeveloperTools.js +5 -1
  91. package/Libraries/Core/setUpIntersectionObserver.js +16 -0
  92. package/Libraries/{Components/ProgressBarAndroid/ProgressBarAndroid.ios.js → Core/setUpMutationObserver.js} +6 -2
  93. package/Libraries/Core/setUpPerformance.js +6 -13
  94. package/Libraries/Core/setUpPerformanceObserver.js +16 -0
  95. package/Libraries/Core/setUpRegeneratorRuntime.js +4 -2
  96. package/Libraries/DOM/Nodes/ReactNativeElement.js +135 -18
  97. package/Libraries/DOM/Nodes/ReadOnlyCharacterData.js +72 -0
  98. package/Libraries/DOM/Nodes/ReadOnlyElement.js +209 -21
  99. package/Libraries/DOM/Nodes/ReadOnlyNode.js +206 -17
  100. package/Libraries/DOM/Nodes/ReadOnlyText.js +30 -0
  101. package/Libraries/DOM/Nodes/Utilities/Traversal.js +54 -0
  102. package/Libraries/EventEmitter/NativeEventEmitter.d.ts +0 -6
  103. package/Libraries/EventEmitter/RCTDeviceEventEmitter.js +15 -4
  104. package/Libraries/Image/Image.android.js +8 -2
  105. package/Libraries/Image/Image.d.ts +1 -1
  106. package/Libraries/Image/Image.ios.js +4 -1
  107. package/Libraries/Image/Image.win32.js +6 -3
  108. package/Libraries/Image/ImageBackground.js +3 -0
  109. package/Libraries/Image/resolveAssetSource.win32.js +1 -1
  110. package/Libraries/Inspector/DevtoolsOverlay.js +6 -3
  111. package/Libraries/Inspector/NetworkOverlay.js +2 -2
  112. package/Libraries/Interaction/JSEventLoopWatchdog.js +1 -5
  113. package/Libraries/Interaction/PanResponder.js +1 -4
  114. package/Libraries/IntersectionObserver/IntersectionObserver.js +252 -0
  115. package/Libraries/IntersectionObserver/IntersectionObserverEntry.js +140 -0
  116. package/Libraries/IntersectionObserver/IntersectionObserverManager.js +221 -0
  117. package/Libraries/IntersectionObserver/NativeIntersectionObserver.js +41 -0
  118. package/Libraries/IntersectionObserver/__mocks__/NativeIntersectionObserver.js +162 -0
  119. package/Libraries/LayoutAnimation/LayoutAnimation.js +1 -1
  120. package/Libraries/Lists/FlatList.d.ts +2 -1
  121. package/Libraries/Lists/FlatList.js +15 -5
  122. package/Libraries/Lists/SectionList.js +4 -0
  123. package/Libraries/LogBox/Data/LogBoxLog.js +4 -1
  124. package/Libraries/LogBox/Data/LogBoxSymbolication.js +5 -2
  125. package/Libraries/LogBox/Data/parseLogBoxLog.js +57 -20
  126. package/Libraries/LogBox/UI/AnsiHighlight.js +1 -1
  127. package/Libraries/LogBox/UI/LogBoxInspectorFooter.js +24 -31
  128. package/Libraries/LogBox/UI/LogBoxInspectorHeader.js +1 -1
  129. package/Libraries/LogBox/UI/LogBoxMessage.js +4 -7
  130. package/Libraries/MutationObserver/MutationObserver.js +184 -0
  131. package/Libraries/MutationObserver/MutationObserverManager.js +218 -0
  132. package/Libraries/MutationObserver/MutationRecord.js +82 -0
  133. package/Libraries/MutationObserver/NativeMutationObserver.js +58 -0
  134. package/Libraries/MutationObserver/__mocks__/NativeMutationObserver.js +327 -0
  135. package/Libraries/NativeComponent/BaseViewConfig.android.js +18 -3
  136. package/Libraries/NativeComponent/BaseViewConfig.ios.js +33 -0
  137. package/Libraries/NativeComponent/BaseViewConfig.win32.js +33 -0
  138. package/Libraries/NativeComponent/NativeComponentRegistry.js +3 -5
  139. package/Libraries/NativeModules/specs/NativeSourceCode.js +6 -6
  140. package/Libraries/Network/RCTNetworking.android.js +2 -1
  141. package/Libraries/Network/XMLHttpRequest.js +1 -1
  142. package/Libraries/NewAppScreen/components/DebugInstructions.js +4 -4
  143. package/Libraries/NewAppScreen/components/LearnMoreLinks.js +9 -2
  144. package/Libraries/Performance/QuickPerformanceLogger.js +1 -1
  145. package/Libraries/PermissionsAndroid/NativePermissionsAndroid.js +1 -0
  146. package/Libraries/PermissionsAndroid/PermissionsAndroid.d.ts +1 -0
  147. package/Libraries/PermissionsAndroid/PermissionsAndroid.js +3 -1
  148. package/Libraries/Pressability/Pressability.js +28 -3
  149. package/Libraries/Pressability/Pressability.win32.js +30 -5
  150. package/Libraries/ReactNative/AppContainer.js +2 -3
  151. package/Libraries/ReactNative/AppRegistry.d.ts +0 -5
  152. package/Libraries/ReactNative/AppRegistry.js +66 -53
  153. package/Libraries/ReactNative/BridgelessUIManager.js +38 -9
  154. package/Libraries/ReactNative/FabricUIManager.js +143 -34
  155. package/Libraries/ReactNative/I18nManager.js +5 -11
  156. package/Libraries/ReactNative/NativeI18nManager.js +7 -5
  157. package/Libraries/ReactNative/PaperUIManager.win32.js +2 -2
  158. package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricHostComponent.js +151 -0
  159. package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstance.js +81 -0
  160. package/Libraries/ReactNative/ReactFabricPublicInstance/ReactNativeAttributePayload.js +492 -0
  161. package/Libraries/ReactNative/ReactFabricPublicInstance/warnForStyleProps.js +32 -0
  162. package/Libraries/ReactNative/ReactNativeFeatureFlags.js +19 -3
  163. package/Libraries/ReactNative/UIManager.js +8 -0
  164. package/Libraries/ReactNative/__mocks__/FabricUIManager.js +648 -0
  165. package/Libraries/ReactPrivate/ReactNativePrivateInterface.js +38 -2
  166. package/Libraries/Renderer/implementations/ReactFabric-dev.js +27 -27
  167. package/Libraries/Renderer/implementations/ReactFabric-prod.js +3 -3
  168. package/Libraries/Renderer/implementations/ReactFabric-profiling.js +3 -3
  169. package/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js +27 -27
  170. package/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js +3 -3
  171. package/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.js +3 -3
  172. package/Libraries/Renderer/shims/ReactFabric.js +5 -6
  173. package/Libraries/Renderer/shims/ReactFeatureFlags.js +2 -3
  174. package/Libraries/Renderer/shims/ReactNative.js +2 -3
  175. package/Libraries/Renderer/shims/ReactNativeTypes.js +35 -17
  176. package/Libraries/Renderer/shims/ReactNativeViewConfigRegistry.js +3 -3
  177. package/Libraries/Renderer/shims/createReactNativeComponentClass.js +2 -3
  178. package/Libraries/Settings/{Settings.android.js → Settings.js} +4 -4
  179. package/Libraries/Share/Share.d.ts +3 -9
  180. package/Libraries/StyleSheet/PlatformColorValueTypes.android.js +9 -4
  181. package/Libraries/StyleSheet/PlatformColorValueTypes.ios.js +28 -13
  182. package/Libraries/StyleSheet/PlatformColorValueTypes.win32.js +14 -4
  183. package/Libraries/StyleSheet/PlatformColorValueTypesIOS.ios.js +1 -1
  184. package/Libraries/StyleSheet/PlatformColorValueTypesWin32.d.ts +1 -1
  185. package/Libraries/StyleSheet/StyleSheet.d.ts +10 -1
  186. package/Libraries/StyleSheet/StyleSheet.js +3 -0
  187. package/Libraries/StyleSheet/StyleSheet.win32.js +3 -0
  188. package/Libraries/StyleSheet/StyleSheetTypes.d.ts +31 -17
  189. package/Libraries/StyleSheet/StyleSheetTypes.js +90 -6
  190. package/Libraries/StyleSheet/flattenStyle.js +4 -0
  191. package/Libraries/StyleSheet/private/_TransformStyle.js +16 -2
  192. package/Libraries/StyleSheet/processColor.js +1 -2
  193. package/Libraries/StyleSheet/processTransformOrigin.js +136 -0
  194. package/Libraries/StyleSheet/splitLayoutProps.js +1 -0
  195. package/Libraries/Text/Text.d.ts +5 -5
  196. package/Libraries/Text/Text.js +17 -10
  197. package/Libraries/Text/Text.win32.js +354 -0
  198. package/Libraries/Text/TextProps.win32.js +281 -0
  199. package/Libraries/TurboModule/TurboModuleRegistry.js +47 -7
  200. package/Libraries/TurboModule/samples/NativeSampleTurboModule.js +6 -0
  201. package/Libraries/Types/CoreEventTypes.d.ts +5 -2
  202. package/Libraries/Utilities/GlobalPerformanceLogger.js +2 -12
  203. package/Libraries/Utilities/NativeDeviceInfo.js +8 -9
  204. package/Libraries/Utilities/NativePlatformConstantsAndroid.js +23 -18
  205. package/Libraries/Utilities/NativePlatformConstantsIOS.js +16 -13
  206. package/Libraries/Utilities/NativePlatformConstantsWin.js +13 -10
  207. package/Libraries/Utilities/PerformanceLoggerContext.js +1 -1
  208. package/Libraries/Utilities/Platform.android.js +12 -8
  209. package/Libraries/Utilities/Platform.d.ts +1 -0
  210. package/Libraries/Utilities/Platform.flow.js +84 -0
  211. package/Libraries/Utilities/Platform.flow.win32.js +111 -0
  212. package/Libraries/Utilities/Platform.ios.js +12 -8
  213. package/Libraries/Utilities/Platform.win32.js +12 -8
  214. package/Libraries/Utilities/PolyfillFunctions.js +1 -1
  215. package/Libraries/Utilities/ReactNativeTestTools.js +1 -2
  216. package/Libraries/Utilities/SceneTracker.js +1 -1
  217. package/Libraries/Utilities/createPerformanceLogger.js +63 -32
  218. package/Libraries/Utilities/useColorScheme.js +7 -8
  219. package/Libraries/WebPerformance/MemoryInfo.js +1 -1
  220. package/Libraries/WebPerformance/NativePerformance.js +3 -8
  221. package/Libraries/WebPerformance/NativePerformanceObserver.js +4 -0
  222. package/Libraries/WebPerformance/Performance.js +42 -15
  223. package/Libraries/WebPerformance/PerformanceEntry.js +14 -6
  224. package/Libraries/WebPerformance/PerformanceEventTiming.js +18 -1
  225. package/Libraries/WebPerformance/ReactNativeStartupTiming.js +40 -14
  226. package/Libraries/WebPerformance/__mocks__/NativePerformance.js +4 -2
  227. package/Libraries/WebPerformance/__mocks__/NativePerformanceObserver.js +21 -3
  228. package/Libraries/promiseRejectionTrackingOptions.js +1 -3
  229. package/Libraries/vendor/emitter/EventEmitter.js +17 -17
  230. package/flow/global.js +1 -3
  231. package/flow/jest.js +5 -1
  232. package/{Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.ios.js → jest/ReactNativeInternalFeatureFlagsMock.js} +2 -1
  233. package/jest/__tests__/setup-test.js +18 -0
  234. package/jest/mockModal.js +6 -4
  235. package/jest/setup.js +61 -30
  236. package/jest.config.js +1 -1
  237. package/just-task.js +1 -0
  238. package/overrides.json +51 -46
  239. package/package.json +35 -33
  240. package/src/Libraries/Components/Button/ButtonWin32.Props.ts +1 -1
  241. package/src/Libraries/Components/Button/ButtonWin32.tsx +0 -2
  242. package/src/Libraries/Components/Touchable/Tests/TouchableWin32Test.tsx +2 -2
  243. package/src/Libraries/Components/Touchable/TouchableWin32.tsx +1 -1
  244. package/src/Libraries/Components/View/ViewAccessibility.d.ts +8 -2
  245. package/src/Libraries/StyleSheet/PlatformColorValueTypesWin32.d.ts +1 -1
  246. package/types/experimental.d.ts +44 -0
  247. package/types/index.d.ts +2 -1
  248. package/types/modules/Devtools.d.ts +1 -0
  249. package/types/modules/globals.d.ts +16 -1
  250. package/IntegrationTests/BUCK +0 -32
  251. package/IntegrationTests/PropertiesUpdateTest.js +0 -29
  252. package/IntegrationTests/RCTRootViewIntegrationTestApp.js +0 -86
  253. package/IntegrationTests/ReactContentSizeUpdateTest.js +0 -89
  254. package/IntegrationTests/SizeFlexibilityUpdateTest.js +0 -106
  255. package/Libraries/Components/TextInput/TextInput.Types.win32.d.ts +0 -51
  256. package/Libraries/Components/TextInput/TextInput.Types.win32.js +0 -3
  257. package/Libraries/Components/TextInput/TextInput.Types.win32.js.map +0 -1
  258. package/Libraries/Utilities/AcessibilityMapping.js +0 -154
  259. package/Libraries/Utilities/AcessibilityMapping.win32.js +0 -156
  260. package/Libraries/Utilities/NativeDevSplitBundleLoader.js +0 -19
  261. package/Libraries/Utilities/useColorScheme.win32.js +0 -26
  262. package/flow/use-sync-external-store.js +0 -20
  263. package/flow-typed/npm/base64-js_v1.x.x.js +0 -12
  264. package/flow-typed/npm/glob_v7.x.x.js +0 -79
  265. package/flow-typed/npm/pretty-format_v26.x.x.js +0 -49
  266. package/flow-typed/npm/promise_v8.x.x.js +0 -30
  267. package/flow-typed/npm/react-dom_v17.x.x.js +0 -139
  268. package/flow-typed/npm/react-test-renderer_v16.x.x.js +0 -79
  269. package/flow-typed/npm/stacktrace-parser_v0.1.x.js +0 -17
  270. package/flow-typed/npm/yargs_v17.x.x.js +0 -341
  271. package/src/Libraries/Components/TextInput/TextInput.Types.win32.ts +0 -68
  272. /package/Libraries/{Renderer/public → ReactNative/ReactFabricPublicInstance}/ReactFabricPublicInstanceUtils.js +0 -0
@@ -0,0 +1,281 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ * @flow strict-local
8
+ * @format
9
+ */
10
+
11
+ 'use strict';
12
+
13
+ import type {
14
+ AccessibilityActionEvent,
15
+ AccessibilityActionInfo,
16
+ AccessibilityRole,
17
+ AccessibilityState,
18
+ Role,
19
+ } from '../Components/View/ViewAccessibility';
20
+ import type {TextStyleProp} from '../StyleSheet/StyleSheet';
21
+ import type {
22
+ LayoutEvent,
23
+ PointerEvent,
24
+ PressEvent,
25
+ TextLayoutEvent,
26
+ } from '../Types/CoreEventTypes';
27
+ import type {Node} from 'react';
28
+
29
+ export type PressRetentionOffset = $ReadOnly<{|
30
+ top: number,
31
+ left: number,
32
+ bottom: number,
33
+ right: number,
34
+ |}>;
35
+
36
+ type PointerEventProps = $ReadOnly<{|
37
+ onPointerEnter?: (event: PointerEvent) => void,
38
+ onPointerLeave?: (event: PointerEvent) => void,
39
+ onPointerMove?: (event: PointerEvent) => void,
40
+ |}>;
41
+
42
+ /**
43
+ * @see https://reactnative.dev/docs/text#reference
44
+ */
45
+ export type TextProps = $ReadOnly<{|
46
+ ...PointerEventProps,
47
+
48
+ /**
49
+ * Indicates whether the view is an accessibility element.
50
+ *
51
+ * See https://reactnative.dev/docs/text#accessible
52
+ */
53
+ accessible?: ?boolean,
54
+ accessibilityActions?: ?$ReadOnlyArray<AccessibilityActionInfo>,
55
+ onAccessibilityAction?: ?(event: AccessibilityActionEvent) => mixed,
56
+ accessibilityHint?: ?Stringish,
57
+ accessibilityLanguage?: ?Stringish,
58
+ accessibilityLabel?: ?Stringish,
59
+ accessibilityRole?: ?AccessibilityRole,
60
+ accessibilityState?: ?AccessibilityState,
61
+ 'aria-label'?: ?string,
62
+ accessibilityControls?: ?Stringish, // Win32
63
+ accessibilityDescribedBy?: ?Stringish, // Win32
64
+ accessibilityDescription?: ?Stringish, // Win32
65
+ accessibilityLevel?: ?number, // Win32
66
+ accessibilityPositionInSet?: ?number, // Win32
67
+ accessibilitySetSize?: ?number, // Win32
68
+
69
+ /**
70
+ * Whether font should be scaled down automatically.
71
+ *
72
+ * See https://reactnative.dev/docs/text#adjustsfontsizetofit
73
+ */
74
+ adjustsFontSizeToFit?: ?boolean,
75
+
76
+ /**
77
+ * Whether fonts should scale to respect Text Size accessibility settings.
78
+ *
79
+ * See https://reactnative.dev/docs/text#allowfontscaling
80
+ */
81
+ allowFontScaling?: ?boolean,
82
+
83
+ /**
84
+ * Set hyphenation strategy on Android.
85
+ *
86
+ */
87
+ android_hyphenationFrequency?: ?('normal' | 'none' | 'full'),
88
+
89
+ /**
90
+ * alias for accessibilityState
91
+ *
92
+ * see https://reactnative.dev/docs/accessibility#accessibilitystate
93
+ */
94
+ 'aria-busy'?: ?boolean,
95
+ 'aria-checked'?: ?boolean | 'mixed',
96
+ 'aria-disabled'?: ?boolean,
97
+ 'aria-expanded'?: ?boolean,
98
+ 'aria-selected'?: ?boolean,
99
+ 'aria-multiselectable'?: ?boolean, // Win32
100
+ 'aria-required'?: ?boolean, // Win32
101
+ 'aria-controls'?: ?Stringish, // Win32
102
+ 'aria-describedby'?: ?Stringish, // Win32
103
+ 'aria-description'?: ?Stringish, // Win32
104
+ 'aria-level'?: ?number, // Win32
105
+ 'aria-posinset'?: ?number, // Win32
106
+ 'aria-setsize'?: ?number, // Win32
107
+ /**
108
+ * Represents the nativeID of the associated label text. When the assistive technology focuses on the component with this props, the text is read aloud.
109
+ * This prop is listed for cross-platform reasons and has no real effect on Android or iOS.
110
+ */
111
+ 'aria-labelledby'?: ?string,
112
+
113
+ children?: ?Node,
114
+
115
+ /**
116
+ * When `numberOfLines` is set, this prop defines how text will be
117
+ * truncated.
118
+ *
119
+ * See https://reactnative.dev/docs/text#ellipsizemode
120
+ */
121
+ ellipsizeMode?: ?('clip' | 'head' | 'middle' | 'tail'),
122
+
123
+ /**
124
+ * Used to locate this view from native code.
125
+ *
126
+ * See https://reactnative.dev/docs/text#nativeid
127
+ */
128
+ id?: string,
129
+
130
+ /**
131
+ * Specifies largest possible scale a font can reach when `allowFontScaling` is enabled.
132
+ * Possible values:
133
+ * `null/undefined` (default): inherit from the parent node or the global default (0)
134
+ * `0`: no max, ignore parent/global default
135
+ * `>= 1`: sets the maxFontSizeMultiplier of this node to this value
136
+ */
137
+ maxFontSizeMultiplier?: ?number,
138
+
139
+ /**
140
+ * Used to locate this view from native code.
141
+ *
142
+ * See https://reactnative.dev/docs/text#nativeid
143
+ */
144
+ nativeID?: ?string,
145
+
146
+ /**
147
+ * Used to truncate the text with an ellipsis.
148
+ *
149
+ * See https://reactnative.dev/docs/text#numberoflines
150
+ */
151
+ numberOfLines?: ?number,
152
+
153
+ /**
154
+ * Invoked on mount and layout changes.
155
+ *
156
+ * See https://reactnative.dev/docs/text#onlayout
157
+ */
158
+ onLayout?: ?(event: LayoutEvent) => mixed,
159
+
160
+ /**
161
+ * This function is called on long press.
162
+ *
163
+ * See https://reactnative.dev/docs/text#onlongpress
164
+ */
165
+ onLongPress?: ?(event: PressEvent) => mixed,
166
+
167
+ /**
168
+ * This function is called on press.
169
+ *
170
+ * See https://reactnative.dev/docs/text#onpress
171
+ */
172
+ onPress?: ?(event: PressEvent) => mixed,
173
+ onPressIn?: ?(event: PressEvent) => mixed,
174
+ onPressOut?: ?(event: PressEvent) => mixed,
175
+ onResponderGrant?: ?(event: PressEvent) => void,
176
+ onResponderMove?: ?(event: PressEvent) => void,
177
+ onResponderRelease?: ?(event: PressEvent) => void,
178
+ onResponderTerminate?: ?(event: PressEvent) => void,
179
+ onResponderTerminationRequest?: ?() => boolean,
180
+ onStartShouldSetResponder?: ?() => boolean,
181
+ onMoveShouldSetResponder?: ?() => boolean,
182
+ onTextLayout?: ?(event: TextLayoutEvent) => mixed,
183
+
184
+ /**
185
+ * Defines how far your touch may move off of the button, before
186
+ * deactivating the button.
187
+ *
188
+ * See https://reactnative.dev/docs/text#pressretentionoffset
189
+ */
190
+ pressRetentionOffset?: ?PressRetentionOffset,
191
+
192
+ /**
193
+ * Indicates to accessibility services to treat UI component like a specific role.
194
+ */
195
+ role?: ?Role,
196
+
197
+ /**
198
+ * Lets the user select text.
199
+ *
200
+ * See https://reactnative.dev/docs/text#selectable
201
+ */
202
+ selectable?: ?boolean,
203
+ style?: ?TextStyleProp,
204
+
205
+ /**
206
+ * Used to locate this view in end-to-end tests.
207
+ *
208
+ * See https://reactnative.dev/docs/text#testid
209
+ */
210
+ testID?: ?string,
211
+
212
+ /**
213
+ * Android Only
214
+ */
215
+
216
+ /**
217
+ * Specifies the disabled state of the text view for testing purposes.
218
+ *
219
+ * See https://reactnative.dev/docs/text#disabled
220
+ */
221
+ disabled?: ?boolean,
222
+
223
+ /**
224
+ * The highlight color of the text.
225
+ *
226
+ * See https://reactnative.dev/docs/text#selectioncolor
227
+ */
228
+ selectionColor?: ?string,
229
+
230
+ dataDetectorType?: ?('phoneNumber' | 'link' | 'email' | 'none' | 'all'),
231
+
232
+ /**
233
+ * Set text break strategy on Android.
234
+ *
235
+ * See https://reactnative.dev/docs/text#textbreakstrategy
236
+ */
237
+ textBreakStrategy?: ?('balanced' | 'highQuality' | 'simple'),
238
+
239
+ /**
240
+ * iOS Only
241
+ */
242
+ adjustsFontSizeToFit?: ?boolean,
243
+
244
+ /**
245
+ * The Dynamic Type scale ramp to apply to this element on iOS.
246
+ */
247
+ dynamicTypeRamp?: ?(
248
+ | 'caption2'
249
+ | 'caption1'
250
+ | 'footnote'
251
+ | 'subheadline'
252
+ | 'callout'
253
+ | 'body'
254
+ | 'headline'
255
+ | 'title3'
256
+ | 'title2'
257
+ | 'title1'
258
+ | 'largeTitle'
259
+ ),
260
+
261
+ /**
262
+ * Smallest possible scale a font can reach.
263
+ *
264
+ * See https://reactnative.dev/docs/text#minimumfontscale
265
+ */
266
+ minimumFontScale?: ?number,
267
+
268
+ /**
269
+ * When `true`, no visual change is made when text is pressed down.
270
+ *
271
+ * See https://reactnative.dev/docs/text#supperhighlighting
272
+ */
273
+ suppressHighlighting?: ?boolean,
274
+
275
+ /**
276
+ * Set line break strategy on iOS.
277
+ *
278
+ * See https://reactnative.dev/docs/text.html#linebreakstrategyios
279
+ */
280
+ lineBreakStrategyIOS?: ?('none' | 'standard' | 'hangul-word' | 'push-out'),
281
+ |}>;
@@ -16,21 +16,52 @@ const NativeModules = require('../BatchedBridge/NativeModules');
16
16
 
17
17
  const turboModuleProxy = global.__turboModuleProxy;
18
18
 
19
+ const moduleLoadHistory = {
20
+ NativeModules: ([]: Array<string>),
21
+ TurboModules: ([]: Array<string>),
22
+ NotFound: ([]: Array<string>),
23
+ };
24
+
25
+ function isBridgeless() {
26
+ return global.RN$Bridgeless === true;
27
+ }
28
+
29
+ function isTurboModuleInteropEnabled() {
30
+ return global.RN$TurboInterop === true;
31
+ }
32
+
33
+ // TODO(154308585): Remove "module not found" debug info logging
34
+ function shouldReportDebugInfo() {
35
+ return true;
36
+ }
37
+
38
+ // TODO(148943970): Consider reversing the lookup here:
39
+ // Lookup on __turboModuleProxy, then lookup on nativeModuleProxy
19
40
  function requireModule<T: TurboModule>(name: string): ?T {
20
- // Bridgeless mode requires TurboModules
21
- if (global.RN$Bridgeless !== true) {
41
+ if (!isBridgeless() || isTurboModuleInteropEnabled()) {
22
42
  // Backward compatibility layer during migration.
23
43
  const legacyModule = NativeModules[name];
24
44
  if (legacyModule != null) {
45
+ if (shouldReportDebugInfo()) {
46
+ moduleLoadHistory.NativeModules.push(name);
47
+ }
25
48
  return ((legacyModule: $FlowFixMe): T);
26
49
  }
27
50
  }
28
51
 
29
52
  if (turboModuleProxy != null) {
30
53
  const module: ?T = turboModuleProxy(name);
31
- return module;
54
+ if (module != null) {
55
+ if (shouldReportDebugInfo()) {
56
+ moduleLoadHistory.TurboModules.push(name);
57
+ }
58
+ return module;
59
+ }
32
60
  }
33
61
 
62
+ if (shouldReportDebugInfo() && !moduleLoadHistory.NotFound.includes(name)) {
63
+ moduleLoadHistory.NotFound.push(name);
64
+ }
34
65
  return null;
35
66
  }
36
67
 
@@ -40,10 +71,19 @@ export function get<T: TurboModule>(name: string): ?T {
40
71
 
41
72
  export function getEnforcing<T: TurboModule>(name: string): T {
42
73
  const module = requireModule<T>(name);
43
- invariant(
44
- module != null,
74
+ let message =
45
75
  `TurboModuleRegistry.getEnforcing(...): '${name}' could not be found. ` +
46
- 'Verify that a module by this name is registered in the native binary.',
47
- );
76
+ 'Verify that a module by this name is registered in the native binary.';
77
+
78
+ if (shouldReportDebugInfo()) {
79
+ message += 'Bridgeless mode: ' + (isBridgeless() ? 'true' : 'false') + '. ';
80
+ message +=
81
+ 'TurboModule interop: ' +
82
+ (isTurboModuleInteropEnabled() ? 'true' : 'false') +
83
+ '. ';
84
+ message += 'Modules loaded: ' + JSON.stringify(moduleLoadHistory);
85
+ }
86
+
87
+ invariant(module != null, message);
48
88
  return module;
49
89
  }
@@ -37,6 +37,12 @@ export interface Spec extends TurboModule {
37
37
  +getValue: (x: number, y: string, z: Object) => Object;
38
38
  +getValueWithCallback: (callback: (value: string) => void) => void;
39
39
  +getValueWithPromise: (error: boolean) => Promise<string>;
40
+ +voidFuncThrows?: () => void;
41
+ +getObjectThrows?: (arg: Object) => Object;
42
+ +promiseThrows?: () => Promise<void>;
43
+ +voidFuncAssert?: () => void;
44
+ +getObjectAssert?: (arg: Object) => Object;
45
+ +promiseAssert?: () => Promise<void>;
40
46
  }
41
47
 
42
48
  export default (TurboModuleRegistry.getEnforcing<Spec>(
@@ -8,7 +8,6 @@
8
8
  */
9
9
 
10
10
  import type * as React from 'react';
11
- import {NodeHandle} from '../ReactNative/RendererProxy';
12
11
  import {HostComponent} from '../../types/public/ReactNativeTypes';
13
12
 
14
13
  export interface LayoutRectangle {
@@ -42,7 +41,11 @@ export interface TextLayoutEventData extends TargetedEvent {
42
41
 
43
42
  // Similar to React.SyntheticEvent except for nativeEvent
44
43
  export interface NativeSyntheticEvent<T>
45
- extends React.BaseSyntheticEvent<T, NodeHandle, NodeHandle> {}
44
+ extends React.BaseSyntheticEvent<
45
+ T,
46
+ React.ElementRef<HostComponent<unknown>>,
47
+ React.ElementRef<HostComponent<unknown>>
48
+ > {}
46
49
 
47
50
  export interface NativeTouchEvent {
48
51
  /**
@@ -10,17 +10,8 @@
10
10
 
11
11
  import type {IPerformanceLogger} from './createPerformanceLogger';
12
12
 
13
- import ReactNativeFeatureFlags from '../ReactNative/ReactNativeFeatureFlags';
14
- import NativePerformance from '../WebPerformance/NativePerformance';
15
13
  import createPerformanceLogger from './createPerformanceLogger';
16
14
 
17
- function isLoggingForWebPerformance(): boolean {
18
- return (
19
- NativePerformance != null &&
20
- ReactNativeFeatureFlags.isGlobalWebPerformanceLoggerEnabled()
21
- );
22
- }
23
-
24
15
  /**
25
16
  * This is a global shared instance of IPerformanceLogger that is created with
26
17
  * createPerformanceLogger().
@@ -28,8 +19,7 @@ function isLoggingForWebPerformance(): boolean {
28
19
  * that are logged during loading bundle. If you want to log something from your
29
20
  * React component you should use PerformanceLoggerContext instead.
30
21
  */
31
- const GlobalPerformanceLogger: IPerformanceLogger = createPerformanceLogger(
32
- isLoggingForWebPerformance(),
33
- );
22
+ const GlobalPerformanceLogger: IPerformanceLogger =
23
+ createPerformanceLogger(true);
34
24
 
35
25
  module.exports = GlobalPerformanceLogger;
@@ -34,21 +34,20 @@ export type DimensionsPayload = {|
34
34
  screenPhysicalPixels?: DisplayMetricsAndroid,
35
35
  |};
36
36
 
37
+ export type DeviceInfoConstants = {|
38
+ +Dimensions: DimensionsPayload,
39
+ +isIPhoneX_deprecated?: boolean,
40
+ |};
41
+
37
42
  export interface Spec extends TurboModule {
38
- +getConstants: () => {|
39
- +Dimensions: DimensionsPayload,
40
- +isIPhoneX_deprecated?: boolean,
41
- |};
43
+ +getConstants: () => DeviceInfoConstants;
42
44
  }
43
45
 
44
46
  const NativeModule: Spec = TurboModuleRegistry.getEnforcing<Spec>('DeviceInfo');
45
- let constants = null;
47
+ let constants: ?DeviceInfoConstants = null;
46
48
 
47
49
  const NativeDeviceInfo = {
48
- getConstants(): {|
49
- +Dimensions: DimensionsPayload,
50
- +isIPhoneX_deprecated?: boolean,
51
- |} {
50
+ getConstants(): DeviceInfoConstants {
52
51
  if (constants == null) {
53
52
  constants = NativeModule.getConstants();
54
53
  }
@@ -12,25 +12,30 @@ import type {TurboModule} from '../TurboModule/RCTExport';
12
12
 
13
13
  import * as TurboModuleRegistry from '../TurboModule/TurboModuleRegistry';
14
14
 
15
+ export type ReactNativeVersionAndroid = {|
16
+ major: number,
17
+ minor: number,
18
+ patch: number,
19
+ prerelease: ?number,
20
+ |};
21
+
22
+ export type PlatformConstantsAndroid = {|
23
+ isTesting: boolean,
24
+ isDisableAnimations?: boolean,
25
+ reactNativeVersion: ReactNativeVersionAndroid,
26
+ Version: number,
27
+ Release: string,
28
+ Serial: string,
29
+ Fingerprint: string,
30
+ Model: string,
31
+ ServerHost?: string,
32
+ uiMode: string,
33
+ Brand: string,
34
+ Manufacturer: string,
35
+ |};
36
+
15
37
  export interface Spec extends TurboModule {
16
- +getConstants: () => {|
17
- isTesting: boolean,
18
- reactNativeVersion: {|
19
- major: number,
20
- minor: number,
21
- patch: number,
22
- prerelease: ?number,
23
- |},
24
- Version: number,
25
- Release: string,
26
- Serial: string,
27
- Fingerprint: string,
28
- Model: string,
29
- ServerHost?: string,
30
- uiMode: string,
31
- Brand: string,
32
- Manufacturer: string,
33
- |};
38
+ +getConstants: () => PlatformConstantsAndroid;
34
39
  +getAndroidID: () => string;
35
40
  }
36
41
 
@@ -12,20 +12,23 @@ import type {TurboModule} from '../TurboModule/RCTExport';
12
12
 
13
13
  import * as TurboModuleRegistry from '../TurboModule/TurboModuleRegistry';
14
14
 
15
+ export type PlatformConstantsIOS = {|
16
+ isTesting: boolean,
17
+ isDisableAnimations?: boolean,
18
+ reactNativeVersion: {|
19
+ major: number,
20
+ minor: number,
21
+ patch: number,
22
+ prerelease: ?number,
23
+ |},
24
+ forceTouchAvailable: boolean,
25
+ osVersion: string,
26
+ systemName: string,
27
+ interfaceIdiom: string,
28
+ |};
29
+
15
30
  export interface Spec extends TurboModule {
16
- +getConstants: () => {|
17
- isTesting: boolean,
18
- reactNativeVersion: {|
19
- major: number,
20
- minor: number,
21
- patch: number,
22
- prerelease: ?number,
23
- |},
24
- forceTouchAvailable: boolean,
25
- osVersion: string,
26
- systemName: string,
27
- interfaceIdiom: string,
28
- |};
31
+ +getConstants: () => PlatformConstantsIOS;
29
32
  }
30
33
 
31
34
  export default (TurboModuleRegistry.getEnforcing<Spec>(
@@ -10,17 +10,20 @@ import type {TurboModule} from '../TurboModule/RCTExport';
10
10
 
11
11
  import * as TurboModuleRegistry from '../TurboModule/TurboModuleRegistry';
12
12
 
13
+ export type PlatformConstantsWin32 = {|
14
+ isTesting: boolean,
15
+ isDisableAnimations?: boolean,
16
+ reactNativeVersion: {|
17
+ major: number,
18
+ minor: number,
19
+ patch: number,
20
+ prerelease: ?string | number,
21
+ |},
22
+ osVersion: number,
23
+ |};
24
+
13
25
  export interface Spec extends TurboModule {
14
- +getConstants: () => {|
15
- isTesting: boolean,
16
- reactNativeVersion: {|
17
- major: number,
18
- minor: number,
19
- patch: number,
20
- prerelease: ?string | number,
21
- |},
22
- osVersion: number,
23
- |};
26
+ +getConstants: () => PlatformConstantsWin32;
24
27
  }
25
28
 
26
29
  export default (TurboModuleRegistry.getEnforcing<Spec>(
@@ -18,7 +18,7 @@ import {useContext} from 'react';
18
18
  * This is a React Context that provides a scoped instance of IPerformanceLogger.
19
19
  * We wrap every <AppContainer /> with a Provider for this context so the logger
20
20
  * should be available in every component.
21
- * See React docs about using Context: https://reactjs.org/docs/context.html
21
+ * See React docs about using Context: https://react.dev/docs/context.html
22
22
  */
23
23
  const PerformanceLoggerContext: React.Context<IPerformanceLogger> =
24
24
  React.createContext(GlobalPerformanceLogger);
@@ -8,16 +8,14 @@
8
8
  * @flow strict
9
9
  */
10
10
 
11
- import NativePlatformConstantsAndroid from './NativePlatformConstantsAndroid';
11
+ import type {
12
+ Platform as PlatformType,
13
+ PlatformSelectSpec,
14
+ } from './Platform.flow';
12
15
 
13
- export type PlatformSelectSpec<T> = {
14
- android?: T,
15
- native?: T,
16
- default?: T,
17
- ...
18
- };
16
+ import NativePlatformConstantsAndroid from './NativePlatformConstantsAndroid';
19
17
 
20
- const Platform = {
18
+ const Platform: PlatformType = {
21
19
  __constants: null,
22
20
  OS: 'android',
23
21
  // $FlowFixMe[unsafe-getters-setters]
@@ -28,6 +26,7 @@ const Platform = {
28
26
  // $FlowFixMe[unsafe-getters-setters]
29
27
  get constants(): {|
30
28
  isTesting: boolean,
29
+ isDisableAnimations?: boolean,
31
30
  reactNativeVersion: {|
32
31
  major: number,
33
32
  minor: number,
@@ -61,6 +60,11 @@ const Platform = {
61
60
  return false;
62
61
  },
63
62
  // $FlowFixMe[unsafe-getters-setters]
63
+ get isDisableAnimations(): boolean {
64
+ // $FlowFixMe[object-this-reference]
65
+ return this.constants.isDisableAnimations ?? this.isTesting;
66
+ },
67
+ // $FlowFixMe[unsafe-getters-setters]
64
68
  get isTV(): boolean {
65
69
  // $FlowFixMe[object-this-reference]
66
70
  return this.constants.uiMode === 'tv';
@@ -19,6 +19,7 @@ export type PlatformOSType =
19
19
  | 'native';
20
20
  type PlatformConstants = {
21
21
  isTesting: boolean;
22
+ isDisableAnimations?: boolean | undefined;
22
23
  reactNativeVersion: {
23
24
  major: number;
24
25
  minor: number;