@office-iss/react-native-win32 0.76.2 → 0.77.0-preview.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (249) hide show
  1. package/.eslintignore +1 -1
  2. package/.flowconfig +5 -1
  3. package/CHANGELOG.json +179 -53
  4. package/CHANGELOG.md +82 -28
  5. package/Libraries/ActionSheetIOS/ActionSheetIOS.d.ts +1 -0
  6. package/Libraries/ActionSheetIOS/ActionSheetIOS.js +13 -0
  7. package/Libraries/Animated/AnimatedEvent.js +1 -1
  8. package/Libraries/Animated/AnimatedImplementation.js +2 -2
  9. package/Libraries/Animated/NativeAnimatedAllowlist.js +20 -9
  10. package/Libraries/Animated/animations/Animation.js +60 -25
  11. package/Libraries/Animated/animations/DecayAnimation.js +26 -38
  12. package/Libraries/Animated/animations/SpringAnimation.js +33 -39
  13. package/Libraries/Animated/animations/TimingAnimation.js +34 -42
  14. package/Libraries/Animated/components/AnimatedFlatList.js +1 -1
  15. package/Libraries/Animated/components/AnimatedSectionList.js +3 -1
  16. package/Libraries/Animated/createAnimatedComponent.js +60 -33
  17. package/Libraries/Animated/nodes/AnimatedColor.js +1 -1
  18. package/Libraries/Animated/nodes/AnimatedInterpolation.js +1 -1
  19. package/Libraries/Animated/nodes/AnimatedNode.js +39 -45
  20. package/Libraries/Animated/nodes/AnimatedObject.js +13 -3
  21. package/Libraries/Animated/nodes/AnimatedProps.js +104 -46
  22. package/Libraries/Animated/nodes/AnimatedStyle.js +116 -39
  23. package/Libraries/Animated/nodes/AnimatedTransform.js +56 -23
  24. package/Libraries/Animated/nodes/AnimatedValue.js +1 -1
  25. package/Libraries/Animated/nodes/AnimatedWithChildren.js +1 -3
  26. package/Libraries/Animated/useAnimatedProps.js +41 -35
  27. package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.d.ts +19 -3
  28. package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js +77 -5
  29. package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.win32.js +82 -5
  30. package/Libraries/Components/ActivityIndicator/ActivityIndicator.js +4 -4
  31. package/Libraries/Components/Button.js +9 -4
  32. package/Libraries/Components/Button.win32.js +12 -4
  33. package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.js +3 -1
  34. package/Libraries/Components/Keyboard/KeyboardAvoidingView.js +7 -0
  35. package/Libraries/Components/Pressable/Pressable.js +4 -4
  36. package/Libraries/Components/Pressable/Pressable.win32.js +4 -4
  37. package/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.android.js +13 -7
  38. package/Libraries/Components/RefreshControl/__mocks__/RefreshControlMock.js +3 -2
  39. package/Libraries/Components/SafeAreaView/SafeAreaView.js +4 -4
  40. package/Libraries/Components/SafeAreaView/SafeAreaView.win32.js +4 -4
  41. package/Libraries/Components/ScrollView/AndroidHorizontalScrollViewNativeComponent.js +0 -1
  42. package/Libraries/Components/ScrollView/ScrollView.js +49 -88
  43. package/Libraries/Components/ScrollView/ScrollViewCommands.js +1 -1
  44. package/Libraries/Components/ScrollView/ScrollViewContext.js +2 -0
  45. package/Libraries/Components/ScrollView/ScrollViewNativeComponent.js +0 -2
  46. package/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +8 -9
  47. package/Libraries/Components/Switch/Switch.js +8 -6
  48. package/Libraries/Components/TextInput/InputAccessoryView.js +1 -1
  49. package/Libraries/Components/TextInput/RCTMultilineTextInputNativeComponent.js +4 -4
  50. package/Libraries/Components/TextInput/RCTSingelineTextInputNativeComponent.js +6 -4
  51. package/Libraries/Components/TextInput/RCTTextInputViewConfig.js +2 -1
  52. package/Libraries/Components/TextInput/TextInput.d.ts +27 -4
  53. package/Libraries/Components/TextInput/TextInput.flow.js +36 -19
  54. package/Libraries/Components/TextInput/TextInput.js +37 -13
  55. package/Libraries/Components/TextInput/TextInput.win32.js +40 -15
  56. package/Libraries/Components/TextInput/TextInputState.js +11 -13
  57. package/Libraries/Components/TextInput/TextInputState.win32.js +13 -16
  58. package/Libraries/Components/TextInput/Win32TextInputNativeComponent.js +3 -0
  59. package/Libraries/Components/Touchable/BoundingDimensions.js +11 -3
  60. package/Libraries/Components/Touchable/Position.js +7 -2
  61. package/Libraries/Components/Touchable/Touchable.js +4 -0
  62. package/Libraries/Components/Touchable/Touchable.win32.js +4 -0
  63. package/Libraries/Components/Touchable/TouchableBounce.js +6 -2
  64. package/Libraries/Components/Touchable/TouchableHighlight.js +5 -5
  65. package/Libraries/Components/Touchable/TouchableOpacity.js +6 -5
  66. package/Libraries/Components/Touchable/TouchableWithoutFeedback.js +1 -2
  67. package/Libraries/Components/View/ReactNativeStyleAttributes.js +6 -1
  68. package/Libraries/Components/View/View.js +4 -4
  69. package/Libraries/Components/View/View.win32.js +4 -4
  70. package/Libraries/Components/View/ViewNativeComponent.js +6 -98
  71. package/Libraries/Components/View/ViewPropTypes.d.ts +7 -0
  72. package/Libraries/Components/View/ViewPropTypes.js +0 -3
  73. package/Libraries/Components/View/ViewPropTypes.win32.js +0 -3
  74. package/Libraries/Components/View/ViewWin32.js +1 -0
  75. package/Libraries/Core/ExceptionsManager.js +50 -29
  76. package/Libraries/Core/ReactNativeVersion.js +3 -3
  77. package/Libraries/Core/__mocks__/NativeExceptionsManager.js +0 -1
  78. package/Libraries/Core/setUpBatchedBridge.js +1 -10
  79. package/Libraries/Core/setUpDeveloperTools.js +1 -5
  80. package/Libraries/Core/setUpErrorHandling.js +20 -18
  81. package/Libraries/Core/setUpReactDevTools.js +107 -8
  82. package/Libraries/Core/setUpSegmentFetcher.js +1 -0
  83. package/Libraries/Core/setUpTimers.js +21 -18
  84. package/Libraries/Debugging/DebuggingOverlay.js +4 -5
  85. package/Libraries/Image/AssetSourceResolver.js +12 -1
  86. package/Libraries/Image/Image.android.js +1 -5
  87. package/Libraries/Image/Image.d.ts +20 -29
  88. package/Libraries/Image/Image.ios.js +0 -2
  89. package/Libraries/Image/Image.win32.js +0 -2
  90. package/Libraries/Image/ImageBackground.js +2 -5
  91. package/Libraries/Image/ImageProps.js +7 -6
  92. package/Libraries/Image/ImageResizeMode.d.ts +8 -1
  93. package/Libraries/Image/ImageResizeMode.js +4 -1
  94. package/Libraries/Image/ImageSource.d.ts +0 -2
  95. package/Libraries/Image/ImageSource.js +0 -2
  96. package/Libraries/Image/ImageTypes.flow.js +11 -9
  97. package/Libraries/Image/ImageUtils.js +6 -3
  98. package/Libraries/Image/ImageViewNativeComponent.js +5 -3
  99. package/Libraries/Inspector/Inspector.js +1 -0
  100. package/Libraries/Inspector/Inspector.win32.js +2 -1
  101. package/Libraries/Inspector/NetworkOverlay.js +4 -0
  102. package/Libraries/Inspector/ReactDevToolsOverlay.js +8 -14
  103. package/Libraries/Inspector/getInspectorDataForViewAtPoint.js +3 -5
  104. package/Libraries/Interaction/InteractionManager.js +6 -1
  105. package/Libraries/Interaction/InteractionManagerStub.js +176 -0
  106. package/Libraries/Interaction/TouchHistoryMath.js +22 -19
  107. package/Libraries/JSInspector/NetworkAgent.js +1 -1
  108. package/Libraries/Lists/FlatList.d.ts +1 -2
  109. package/Libraries/Lists/FlatList.js +2 -2
  110. package/Libraries/Lists/SectionListModern.js +7 -7
  111. package/Libraries/Lists/__flowtests__/FlatList-flowtest.js +2 -2
  112. package/Libraries/Lists/__flowtests__/SectionList-flowtest.js +1 -1
  113. package/Libraries/LogBox/Data/LogBoxData.js +3 -3
  114. package/Libraries/LogBox/LogBox.js +18 -5
  115. package/Libraries/LogBox/LogBoxInspectorContainer.js +1 -1
  116. package/Libraries/LogBox/LogBoxNotificationContainer.js +2 -2
  117. package/Libraries/LogBox/UI/AnsiHighlight.js +26 -17
  118. package/Libraries/LogBox/UI/LogBoxInspectorCodeFrame.js +6 -1
  119. package/Libraries/LogBox/UI/LogBoxInspectorCodeFrame.win32.js +6 -1
  120. package/Libraries/LogBox/UI/LogBoxInspectorHeader.js +1 -1
  121. package/Libraries/LogBox/UI/LogBoxInspectorHeader.win32.js +1 -1
  122. package/Libraries/LogBox/UI/LogBoxInspectorStackFrames.js +1 -1
  123. package/Libraries/LogBox/UI/LogBoxMessage.js +2 -2
  124. package/Libraries/Modal/Modal.d.ts +12 -0
  125. package/Libraries/Modal/Modal.js +31 -4
  126. package/Libraries/NativeComponent/BaseViewConfig.android.js +72 -1
  127. package/Libraries/NativeComponent/BaseViewConfig.ios.js +2 -1
  128. package/Libraries/NativeComponent/BaseViewConfig.win32.js +3 -11
  129. package/Libraries/NativeComponent/NativeComponentRegistry.js +3 -3
  130. package/Libraries/NativeComponent/StaticViewConfigValidator.js +0 -1
  131. package/Libraries/Network/FormData.js +11 -3
  132. package/Libraries/Network/XHRInterceptor.js +63 -14
  133. package/Libraries/Network/XMLHttpRequest.js +26 -1
  134. package/Libraries/NewAppScreen/components/HermesBadge.js +1 -1
  135. package/Libraries/PermissionsAndroid/PermissionsAndroid.d.ts +49 -2
  136. package/Libraries/PermissionsAndroid/PermissionsAndroid.js +4 -4
  137. package/Libraries/Pressability/HoverState.js +2 -0
  138. package/Libraries/Pressability/HoverState.win32.js +2 -0
  139. package/Libraries/Pressability/Pressability.js +2 -3
  140. package/Libraries/Pressability/Pressability.win32.js +2 -3
  141. package/Libraries/Pressability/usePressability.js +4 -1
  142. package/Libraries/ReactNative/AppContainer.js +1 -1
  143. package/Libraries/ReactNative/AppRegistry.js +1 -11
  144. package/Libraries/ReactNative/DisplayMode.js +1 -1
  145. package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricHostComponent.js +2 -3
  146. package/Libraries/ReactNative/RendererImplementation.js +18 -17
  147. package/Libraries/ReactNative/getCachedComponentWithDebugName.js +1 -3
  148. package/Libraries/ReactNative/renderApplication.js +9 -8
  149. package/Libraries/ReactNative/requireNativeComponent.js +5 -2
  150. package/Libraries/Renderer/shims/ReactFabric.js +3 -3
  151. package/Libraries/Renderer/shims/ReactFeatureFlags.js +2 -2
  152. package/Libraries/Renderer/shims/ReactNative.js +3 -3
  153. package/Libraries/Renderer/shims/ReactNativeTypes.js +22 -35
  154. package/Libraries/Renderer/shims/ReactNativeViewConfigRegistry.js +5 -6
  155. package/Libraries/Renderer/shims/createReactNativeComponentClass.js +2 -2
  156. package/Libraries/StyleSheet/StyleSheet.js +7 -1
  157. package/Libraries/StyleSheet/StyleSheet.win32.js +7 -1
  158. package/Libraries/StyleSheet/StyleSheetTypes.d.ts +13 -2
  159. package/Libraries/StyleSheet/StyleSheetTypes.js +24 -6
  160. package/Libraries/StyleSheet/processBackgroundImage.js +87 -110
  161. package/Libraries/StyleSheet/processTransform.js +3 -34
  162. package/Libraries/Text/Text.js +248 -249
  163. package/Libraries/Text/Text.win32.js +282 -295
  164. package/Libraries/Text/TextNativeComponent.js +0 -1
  165. package/Libraries/TurboModule/TurboModuleRegistry.js +5 -5
  166. package/Libraries/Types/CoreEventTypes.d.ts +3 -10
  167. package/Libraries/Types/CoreEventTypes.js +4 -6
  168. package/Libraries/Types/CoreEventTypes.win32.js +4 -6
  169. package/Libraries/Utilities/Appearance.js +3 -1
  170. package/Libraries/Utilities/BackHandler.android.js +6 -18
  171. package/Libraries/Utilities/BackHandler.d.ts +0 -4
  172. package/Libraries/Utilities/BackHandler.ios.js +0 -7
  173. package/Libraries/Utilities/BackHandler.win32.js +6 -18
  174. package/Libraries/Utilities/FocusManager.win32.js +1 -1
  175. package/Libraries/Utilities/HMRClient.js +3 -4
  176. package/Libraries/Utilities/Platform.flow.js +2 -2
  177. package/Libraries/Utilities/Platform.flow.win32.js +3 -2
  178. package/Libraries/Utilities/__mocks__/BackHandler.js +3 -8
  179. package/Libraries/Utilities/codegenNativeComponent.js +1 -1
  180. package/Libraries/Utilities/useMergeRefs.js +26 -7
  181. package/Libraries/WebSocket/WebSocketEvent.js +4 -1
  182. package/Libraries/WebSocket/WebSocketInterceptor.js +31 -13
  183. package/Libraries/__flowtests__/ReactNativeTypes-flowtest.js +6 -5
  184. package/Libraries/promiseRejectionTrackingOptions.js +1 -1
  185. package/index.js +10 -3
  186. package/index.win32.js +10 -3
  187. package/jest/setup.js +36 -1
  188. package/overrides.json +37 -37
  189. package/package.json +20 -20
  190. package/src/private/animated/NativeAnimatedHelper.js +18 -16
  191. package/src/private/animated/NativeAnimatedHelper.win32.js +18 -15
  192. package/src/private/animated/useAnimatedPropsMemo.js +356 -0
  193. package/src/private/components/HScrollViewNativeComponents.js +1 -27
  194. package/src/private/components/SafeAreaView_INTERNAL_DO_NOT_USE.js +11 -8
  195. package/src/private/components/VScrollViewNativeComponents.js +2 -25
  196. package/src/private/debugging/ReactDevToolsSettingsManager.android.js +20 -0
  197. package/src/private/debugging/ReactDevToolsSettingsManager.ios.js +30 -0
  198. package/src/private/debugging/ReactDevToolsSettingsManager.win32.js +20 -0
  199. package/src/private/{fusebox → debugging}/setUpFuseboxReactDevToolsDispatcher.js +6 -0
  200. package/src/private/devmenu/DevMenu.d.ts +20 -0
  201. package/src/private/devmenu/DevMenu.js +31 -0
  202. package/src/private/featureflags/ReactNativeFeatureFlags.js +95 -86
  203. package/src/private/featureflags/ReactNativeFeatureFlagsBase.js +8 -2
  204. package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +17 -19
  205. package/src/private/fusebox/specs/NativeReactDevToolsRuntimeSettingsModule.js +34 -0
  206. package/src/private/setup/setUpDOM.js +14 -6
  207. package/src/private/setup/setUpMutationObserver.js +5 -0
  208. package/src/private/specs/components/AndroidHorizontalScrollContentViewNativeComponent.js +1 -0
  209. package/src/private/specs/components/RCTModalHostViewNativeComponent.js +8 -0
  210. package/src/private/specs/modules/NativeAccessibilityInfo.js +9 -0
  211. package/src/private/specs/modules/NativeAccessibilityInfoWin32.js +9 -0
  212. package/src/private/specs/modules/NativeAccessibilityManager.js +4 -0
  213. package/src/private/specs/modules/NativeActionSheetManager.js +2 -0
  214. package/src/private/specs/modules/NativeAppearance.js +4 -10
  215. package/src/private/specs/modules/NativeExceptionsManager.js +0 -12
  216. package/src/private/specs/modules/{NativeDevToolsSettingsManager.js → NativeReactDevToolsSettingsManager.js} +3 -5
  217. package/src/private/webapis/dom/geometry/DOMRect.js +2 -2
  218. package/src/private/webapis/dom/geometry/DOMRectReadOnly.js +2 -2
  219. package/src/private/webapis/dom/nodes/ReactNativeElement.js +2 -3
  220. package/src/private/webapis/intersectionobserver/IntersectionObserver.js +102 -11
  221. package/src/private/webapis/intersectionobserver/IntersectionObserverEntry.js +26 -0
  222. package/src/private/webapis/intersectionobserver/IntersectionObserverManager.js +1 -0
  223. package/src/private/webapis/intersectionobserver/specs/NativeIntersectionObserver.js +1 -0
  224. package/src/private/webapis/intersectionobserver/specs/__mocks__/NativeIntersectionObserver.js +9 -0
  225. package/src/private/webapis/performance/EventTiming.js +13 -8
  226. package/src/private/webapis/performance/Performance.js +66 -73
  227. package/src/private/webapis/performance/PerformanceEntry.js +2 -5
  228. package/src/private/webapis/performance/PerformanceObserver.js +65 -164
  229. package/src/private/webapis/performance/RawPerformanceEntry.js +1 -1
  230. package/src/private/webapis/performance/UserTiming.js +11 -7
  231. package/src/private/webapis/performance/Utilities.js +18 -0
  232. package/src/private/webapis/performance/specs/NativePerformance.js +71 -2
  233. package/src/private/webapis/performance/specs/__mocks__/NativePerformanceMock.js +267 -0
  234. package/src-win/Libraries/Components/AccessibilityInfo/AccessibilityInfo.d.ts +19 -3
  235. package/src-win/Libraries/Components/View/ViewPropTypes.d.ts +7 -0
  236. package/types/index.d.ts +1 -1
  237. package/types/public/ReactNativeTypes.d.ts +4 -8
  238. package/Libraries/DevToolsSettings/DevToolsSettingsManager.android.js +0 -35
  239. package/Libraries/DevToolsSettings/DevToolsSettingsManager.d.ts +0 -20
  240. package/Libraries/DevToolsSettings/DevToolsSettingsManager.ios.js +0 -49
  241. package/Libraries/DevToolsSettings/DevToolsSettingsManager.win32.js +0 -35
  242. package/Libraries/DevToolsSettings/NativeDevToolsSettingsManager.js +0 -13
  243. package/Libraries/ReactNative/ReactFabricInternals.js +0 -17
  244. package/src/private/components/useSyncOnScroll.js +0 -48
  245. package/src/private/webapis/performance/specs/NativePerformanceObserver.js +0 -61
  246. package/src/private/webapis/performance/specs/__mocks__/NativePerformance.js +0 -67
  247. package/src/private/webapis/performance/specs/__mocks__/NativePerformanceObserver.js +0 -127
  248. package/types/experimental.d.ts +0 -59
  249. /package/src/private/{fusebox → debugging}/FuseboxSessionObserver.js +0 -0
package/index.js CHANGED
@@ -71,7 +71,10 @@ import typeof I18nManager from './Libraries/ReactNative/I18nManager';
71
71
  import typeof {RootTagContext} from './Libraries/ReactNative/RootTag';
72
72
  import typeof UIManager from './Libraries/ReactNative/UIManager';
73
73
  import typeof ReactNative from './Libraries/Renderer/shims/ReactNative';
74
- import type {HostComponent as _HostComponentInternal} from './Libraries/Renderer/shims/ReactNativeTypes';
74
+ import type {
75
+ HostComponent,
76
+ HostInstance,
77
+ } from './Libraries/Renderer/shims/ReactNativeTypes';
75
78
  import typeof Settings from './Libraries/Settings/Settings';
76
79
  import typeof Share from './Libraries/Share/Share';
77
80
  import typeof {PlatformColor} from './Libraries/StyleSheet/PlatformColorValueTypes';
@@ -93,11 +96,12 @@ import typeof useColorScheme from './Libraries/Utilities/useColorScheme';
93
96
  import typeof useWindowDimensions from './Libraries/Utilities/useWindowDimensions';
94
97
  import typeof Vibration from './Libraries/Vibration/Vibration';
95
98
  import typeof YellowBox from './Libraries/YellowBox/YellowBoxDeprecated';
99
+ import typeof DevMenu from './src/private/devmenu/DevMenu';
96
100
 
97
101
  const warnOnce = require('./Libraries/Utilities/warnOnce');
98
102
  const invariant = require('invariant');
99
103
 
100
- export type HostComponent<T> = _HostComponentInternal<T>;
104
+ export type {HostComponent, HostInstance};
101
105
 
102
106
  module.exports = {
103
107
  get registerCallableModule(): RegisterCallableModule {
@@ -238,6 +242,9 @@ module.exports = {
238
242
  get DeviceInfo(): DeviceInfo {
239
243
  return require('./Libraries/Utilities/DeviceInfo');
240
244
  },
245
+ get DevMenu(): DevMenu {
246
+ return require('./src/private/devmenu/DevMenu');
247
+ },
241
248
  get DevSettings(): DevSettings {
242
249
  return require('./Libraries/Utilities/DevSettings');
243
250
  },
@@ -368,7 +375,7 @@ module.exports = {
368
375
  get processColor(): processColor {
369
376
  return require('./Libraries/StyleSheet/processColor').default;
370
377
  },
371
- get requireNativeComponent(): <T>(
378
+ get requireNativeComponent(): <T: {...}>(
372
379
  uiViewClassName: string,
373
380
  ) => HostComponent<T> {
374
381
  return require('./Libraries/ReactNative/requireNativeComponent').default;
package/index.win32.js CHANGED
@@ -71,7 +71,10 @@ import typeof I18nManager from './Libraries/ReactNative/I18nManager';
71
71
  import typeof {RootTagContext} from './Libraries/ReactNative/RootTag';
72
72
  import typeof UIManager from './Libraries/ReactNative/UIManager';
73
73
  import typeof ReactNative from './Libraries/Renderer/shims/ReactNative';
74
- import type {HostComponent as _HostComponentInternal} from './Libraries/Renderer/shims/ReactNativeTypes';
74
+ import type {
75
+ HostComponent,
76
+ HostInstance,
77
+ } from './Libraries/Renderer/shims/ReactNativeTypes';
75
78
  import typeof Settings from './Libraries/Settings/Settings';
76
79
  import typeof Share from './Libraries/Share/Share';
77
80
  import typeof {PlatformColor} from './Libraries/StyleSheet/PlatformColorValueTypes';
@@ -93,6 +96,7 @@ import typeof useColorScheme from './Libraries/Utilities/useColorScheme';
93
96
  import typeof useWindowDimensions from './Libraries/Utilities/useWindowDimensions';
94
97
  import typeof Vibration from './Libraries/Vibration/Vibration';
95
98
  import typeof YellowBox from './Libraries/YellowBox/YellowBoxDeprecated';
99
+ import typeof DevMenu from './src/private/devmenu/DevMenu';
96
100
 
97
101
  const warnOnce = require('./Libraries/Utilities/warnOnce');
98
102
  const invariant = require('invariant');
@@ -100,7 +104,7 @@ const invariant = require('invariant');
100
104
  // Windows types
101
105
  import typeof {ColorGradientWin32} from './Libraries/StyleSheet/PlatformColorValueTypesWin32';
102
106
 
103
- export type HostComponent<T> = _HostComponentInternal<T>;
107
+ export type {HostComponent, HostInstance};
104
108
 
105
109
  module.exports = {
106
110
  // Components
@@ -240,6 +244,9 @@ module.exports = {
240
244
  get DeviceInfo(): DeviceInfo {
241
245
  return require('./Libraries/Utilities/DeviceInfo');
242
246
  },
247
+ get DevMenu(): DevMenu {
248
+ return require('./src/private/devmenu/DevMenu');
249
+ },
243
250
  get DevSettings(): DevSettings {
244
251
  return require('./Libraries/Utilities/DevSettings');
245
252
  },
@@ -374,7 +381,7 @@ module.exports = {
374
381
  get processColor(): processColor {
375
382
  return require('./Libraries/StyleSheet/processColor').default;
376
383
  },
377
- get requireNativeComponent(): <T>(
384
+ get requireNativeComponent(): <T: {...}>(
378
385
  uiViewClassName: string,
379
386
  ) => HostComponent<T> {
380
387
  return require('./Libraries/ReactNative/requireNativeComponent').default;
package/jest/setup.js CHANGED
@@ -146,11 +146,14 @@ jest
146
146
  remove: jest.fn(),
147
147
  })),
148
148
  announceForAccessibility: jest.fn(),
149
+ announceForAccessibilityWithOptions: jest.fn(),
149
150
  isAccessibilityServiceEnabled: jest.fn(() => Promise.resolve(false)),
150
151
  isBoldTextEnabled: jest.fn(() => Promise.resolve(false)),
151
152
  isGrayscaleEnabled: jest.fn(() => Promise.resolve(false)),
152
153
  isInvertColorsEnabled: jest.fn(() => Promise.resolve(false)),
153
154
  isReduceMotionEnabled: jest.fn(() => Promise.resolve(false)),
155
+ isHighTextContrastEnabled: jest.fn(() => Promise.resolve(false)),
156
+ isDarkerSystemColorsEnabled: jest.fn(() => Promise.resolve(false)),
154
157
  prefersCrossFadeTransitions: jest.fn(() => Promise.resolve(false)),
155
158
  isReduceTransparencyEnabled: jest.fn(() => Promise.resolve(false)),
156
159
  isScreenReaderEnabled: jest.fn(() => Promise.resolve(false)),
@@ -279,6 +282,34 @@ jest
279
282
  addListener: jest.fn(),
280
283
  removeListeners: jest.fn(),
281
284
  },
285
+ NativeAnimatedModule: {
286
+ createAnimatedNode: jest.fn(),
287
+ updateAnimatedNodeConfig: jest.fn(),
288
+ getValue: jest.fn(),
289
+ startListeningToAnimatedNodeValue: jest.fn(),
290
+ stopListeningToAnimatedNodeValue: jest.fn(),
291
+ connectAnimatedNodes: jest.fn(),
292
+ disconnectAnimatedNodes: jest.fn(),
293
+ startAnimatingNode: jest.fn(
294
+ (animationId, nodeTag, config, endCallback) => {
295
+ setTimeout(() => endCallback({finished: true}), 16);
296
+ },
297
+ ),
298
+ stopAnimation: jest.fn(),
299
+ setAnimatedNodeValue: jest.fn(),
300
+ setAnimatedNodeOffset: jest.fn(),
301
+ flattenAnimatedNodeOffset: jest.fn(),
302
+ extractAnimatedNodeOffset: jest.fn(),
303
+ connectAnimatedNodeToView: jest.fn(),
304
+ disconnectAnimatedNodeFromView: jest.fn(),
305
+ restoreDefaultValues: jest.fn(),
306
+ dropAnimatedNode: jest.fn(),
307
+ addAnimatedEventToView: jest.fn(),
308
+ removeAnimatedEventFromView: jest.fn(),
309
+ addListener: jest.fn(),
310
+ removeListener: jest.fn(),
311
+ removeListeners: jest.fn(),
312
+ },
282
313
  Networking: {
283
314
  sendRequest: jest.fn(),
284
315
  abortRequest: jest.fn(),
@@ -417,4 +448,8 @@ jest
417
448
  return jest.requireActual(
418
449
  '../Libraries/ReactNative/RendererImplementation',
419
450
  );
420
- });
451
+ })
452
+ .mock('../Libraries/Utilities/useColorScheme', () => ({
453
+ __esModule: true,
454
+ default: jest.fn().mockReturnValue('light'),
455
+ }));
package/overrides.json CHANGED
@@ -7,19 +7,19 @@
7
7
  "**/__snapshots__/**",
8
8
  "src-win/rntypes/**"
9
9
  ],
10
- "baseVersion": "0.76.2",
10
+ "baseVersion": "0.77.0-rc.4",
11
11
  "overrides": [
12
12
  {
13
13
  "type": "derived",
14
14
  "file": ".flowconfig",
15
15
  "baseFile": ".flowconfig",
16
- "baseHash": "cc375839a102263f435205df68b79d3d74c4f20a"
16
+ "baseHash": "168a2b4bcf33aba4727eb608902b17b4eb74c95d"
17
17
  },
18
18
  {
19
19
  "type": "derived",
20
20
  "file": "src-win/index.win32.js",
21
21
  "baseFile": "packages/react-native/index.js",
22
- "baseHash": "da5d9e79c8c14c56ba00f73c8514c06e6fffe8ed"
22
+ "baseHash": "5f0532348ca7440731478ef5b119a3a569529a7f"
23
23
  },
24
24
  {
25
25
  "type": "platform",
@@ -35,13 +35,13 @@
35
35
  "type": "derived",
36
36
  "file": "src-win/Libraries/Components/AccessibilityInfo/AccessibilityInfo.d.ts",
37
37
  "baseFile": "packages/react-native/Libraries/Components/AccessibilityInfo/AccessibilityInfo.d.ts",
38
- "baseHash": "f55fda723b8dc0f9836f2fa4a4a766ed45c71c00"
38
+ "baseHash": "30a3c7351c6a466e2ed95e9b416907ac677d71ca"
39
39
  },
40
40
  {
41
41
  "type": "derived",
42
42
  "file": "src-win/Libraries/Components/AccessibilityInfo/AccessibilityInfo.win32.js",
43
43
  "baseFile": "packages/react-native/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js",
44
- "baseHash": "163927cc271b53109f06eaf5fc6d30a9af8cb27e"
44
+ "baseHash": "e91ae4454ae1301d97a60755ecc863bf738542e3"
45
45
  },
46
46
  {
47
47
  "type": "copy",
@@ -60,7 +60,7 @@
60
60
  "type": "derived",
61
61
  "file": "src-win/Libraries/Components/Button.win32.js",
62
62
  "baseFile": "packages/react-native/Libraries/Components/Button.js",
63
- "baseHash": "b59e0b119a7a930e835ff3eefa780e757a97b31f"
63
+ "baseHash": "e1464525e6950f773370855ccbe60217ef638613"
64
64
  },
65
65
  {
66
66
  "type": "platform",
@@ -74,7 +74,7 @@
74
74
  "type": "copy",
75
75
  "file": "src-win/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.js",
76
76
  "baseFile": "packages/react-native/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.js",
77
- "baseHash": "09f143fc3f2ee80463764e1c2b3f23107d501a4c",
77
+ "baseHash": "b9a6866d03ca389af38734ffed24199505b05402",
78
78
  "issue": 4378
79
79
  },
80
80
  {
@@ -85,7 +85,7 @@
85
85
  "type": "patch",
86
86
  "file": "src-win/Libraries/Components/Pressable/Pressable.win32.js",
87
87
  "baseFile": "packages/react-native/Libraries/Components/Pressable/Pressable.js",
88
- "baseHash": "77ec40a2f6a75280b170fe839813d8712c90fbfb",
88
+ "baseHash": "5f8baef36e1cbba73ff2c21b0ccbf310d125b334",
89
89
  "issue": 6240
90
90
  },
91
91
  {
@@ -99,7 +99,7 @@
99
99
  "type": "copy",
100
100
  "file": "src-win/Libraries/Components/SafeAreaView/SafeAreaView.win32.js",
101
101
  "baseFile": "packages/react-native/Libraries/Components/SafeAreaView/SafeAreaView.js",
102
- "baseHash": "ae5845b576484b3600e395d3b1ee03223530b8f7"
102
+ "baseHash": "e1372371cf14c8abd4fb5f2328513596f6553497"
103
103
  },
104
104
  {
105
105
  "type": "platform",
@@ -109,13 +109,13 @@
109
109
  "type": "derived",
110
110
  "file": "src-win/Libraries/Components/TextInput/TextInput.win32.js",
111
111
  "baseFile": "packages/react-native/Libraries/Components/TextInput/TextInput.js",
112
- "baseHash": "494c1159a38de1b57d3889a4dabdc3708204ad4d"
112
+ "baseHash": "1f9adcb7ca64fa536372ed28b7af5e03b05458ac"
113
113
  },
114
114
  {
115
115
  "type": "patch",
116
116
  "file": "src-win/Libraries/Components/TextInput/TextInputState.win32.js",
117
117
  "baseFile": "packages/react-native/Libraries/Components/TextInput/TextInputState.js",
118
- "baseHash": "60655baaca427e1c7c1b8884833b848335c4033b"
118
+ "baseHash": "7a12ca2e17da0a0f487af5a27c120ef59b2ab9ef"
119
119
  },
120
120
  {
121
121
  "type": "platform",
@@ -136,7 +136,7 @@
136
136
  "type": "patch",
137
137
  "file": "src-win/Libraries/Components/Touchable/Touchable.win32.js",
138
138
  "baseFile": "packages/react-native/Libraries/Components/Touchable/Touchable.js",
139
- "baseHash": "27e19d3bf49ff28629fdad544aad04939c2ce030",
139
+ "baseHash": "b06bb9da5282d7559f283a7d535797a0417808a6",
140
140
  "issue": 0
141
141
  },
142
142
  {
@@ -173,7 +173,7 @@
173
173
  "type": "patch",
174
174
  "file": "src-win/Libraries/Components/View/View.win32.js",
175
175
  "baseFile": "packages/react-native/Libraries/Components/View/View.js",
176
- "baseHash": "1905f72f4d202d466ea7d8ed4b36df0845f2c310"
176
+ "baseHash": "85d97fc0638ce73353898f67d0f891a86ee83f3f"
177
177
  },
178
178
  {
179
179
  "type": "derived",
@@ -191,13 +191,13 @@
191
191
  "type": "derived",
192
192
  "file": "src-win/Libraries/Components/View/ViewPropTypes.d.ts",
193
193
  "baseFile": "packages/react-native/Libraries/Components/View/ViewPropTypes.d.ts",
194
- "baseHash": "8e33800dfdd3b50e26c3331abb8b4682c091602f"
194
+ "baseHash": "050f28e7caeef2e52717a7c43c6964612eb75ee9"
195
195
  },
196
196
  {
197
197
  "type": "patch",
198
198
  "file": "src-win/Libraries/Components/View/ViewPropTypes.win32.js",
199
199
  "baseFile": "packages/react-native/Libraries/Components/View/ViewPropTypes.js",
200
- "baseHash": "a742b26e4c96fdefb07779e40bc58cd1cc872675",
200
+ "baseHash": "994aead3d5ab49e6bd34a497094a4bc131a8bdb1",
201
201
  "issue": 6240
202
202
  },
203
203
  {
@@ -224,12 +224,6 @@
224
224
  "baseHash": "453c4da8036736aefbd950bb7c90603859933f4e",
225
225
  "issue": 5170
226
226
  },
227
- {
228
- "type": "copy",
229
- "file": "src-win/Libraries/DevToolsSettings/DevToolsSettingsManager.win32.js",
230
- "baseFile": "packages/react-native/Libraries/DevToolsSettings/DevToolsSettingsManager.android.js",
231
- "baseHash": "1c9eb481e8ed077fa650e3ea34837e2a31310366"
232
- },
233
227
  {
234
228
  "type": "platform",
235
229
  "file": "src-win/Libraries/Image/assetPaths.js"
@@ -238,7 +232,7 @@
238
232
  "type": "derived",
239
233
  "file": "src-win/Libraries/Image/Image.win32.js",
240
234
  "baseFile": "packages/react-native/Libraries/Image/Image.ios.js",
241
- "baseHash": "e5cd104f5060ad354072889937ea92d508a32490",
235
+ "baseHash": "a5abee6de7dca3cb043b834925de3f6f0443c738",
242
236
  "issue": 4320
243
237
  },
244
238
  {
@@ -292,7 +286,7 @@
292
286
  "type": "patch",
293
287
  "file": "src-win/Libraries/Inspector/Inspector.win32.js",
294
288
  "baseFile": "packages/react-native/Libraries/Inspector/Inspector.js",
295
- "baseHash": "ac4d1824877906651f2d82ab7910dda3ecb2bd80"
289
+ "baseHash": "ad3ed5cb941f304f5751c6d12274ffe81753162c"
296
290
  },
297
291
  {
298
292
  "type": "patch",
@@ -304,13 +298,13 @@
304
298
  "type": "derived",
305
299
  "file": "src-win/Libraries/LogBox/UI/LogBoxInspectorCodeFrame.win32.js",
306
300
  "baseFile": "packages/react-native/Libraries/LogBox/UI/LogBoxInspectorCodeFrame.js",
307
- "baseHash": "dff994bb88b8c91090c381c871e6dc83d2511004"
301
+ "baseHash": "c4ffa785bf199918400e4f569849b73187f4b3cc"
308
302
  },
309
303
  {
310
304
  "type": "patch",
311
305
  "file": "src-win/Libraries/LogBox/UI/LogBoxInspectorHeader.win32.js",
312
306
  "baseFile": "packages/react-native/Libraries/LogBox/UI/LogBoxInspectorHeader.js",
313
- "baseHash": "9e394821ea51994288aa4626d0fdff7aae1aa0a1",
307
+ "baseHash": "c4a8a3591ffb65360237708c9fb919408835cb76",
314
308
  "issue": 7952
315
309
  },
316
310
  {
@@ -337,7 +331,7 @@
337
331
  "type": "derived",
338
332
  "file": "src-win/Libraries/NativeComponent/BaseViewConfig.win32.js",
339
333
  "baseFile": "packages/react-native/Libraries/NativeComponent/BaseViewConfig.ios.js",
340
- "baseHash": "0b4642542c2865c5cd3d542a82b295a1aca21c1a"
334
+ "baseHash": "51ae58fc739dc6c0679dc888550c2af41787b959"
341
335
  },
342
336
  {
343
337
  "type": "copy",
@@ -366,14 +360,14 @@
366
360
  "type": "patch",
367
361
  "file": "src-win/Libraries/Pressability/HoverState.win32.js",
368
362
  "baseFile": "packages/react-native/Libraries/Pressability/HoverState.js",
369
- "baseHash": "50800642b413cb469ced8d1d6b32ee0e249f4d1e",
363
+ "baseHash": "8a97880597ea72d61464d07d1a082582320e7234",
370
364
  "issue": 6240
371
365
  },
372
366
  {
373
367
  "type": "patch",
374
368
  "file": "src-win/Libraries/Pressability/Pressability.win32.js",
375
369
  "baseFile": "packages/react-native/Libraries/Pressability/Pressability.js",
376
- "baseHash": "8e70142f3acab570d188c617a1811da11b6e9da4",
370
+ "baseHash": "3be9533787a90b2fae462faee1bb8b692d025c31",
377
371
  "issue": 6240
378
372
  },
379
373
  {
@@ -420,7 +414,7 @@
420
414
  "type": "patch",
421
415
  "file": "src-win/Libraries/StyleSheet/StyleSheet.win32.js",
422
416
  "baseFile": "packages/react-native/Libraries/StyleSheet/StyleSheet.js",
423
- "baseHash": "acf84f21e80cce08afd0a56a2f79690641c7228e"
417
+ "baseHash": "46f00f057f504c71fa0feb5695307e3e3806211b"
424
418
  },
425
419
  {
426
420
  "type": "derived",
@@ -432,13 +426,13 @@
432
426
  "type": "derived",
433
427
  "file": "src-win/Libraries/Text/Text.win32.js",
434
428
  "baseFile": "packages/react-native/Libraries/Text/Text.js",
435
- "baseHash": "8ad2e56ba09c1b5428d50cfd71972c60502ed2e2"
429
+ "baseHash": "64cdf1c520112ead78e348bc306c208f212ac3c5"
436
430
  },
437
431
  {
438
432
  "type": "derived",
439
433
  "file": "src-win/Libraries/Text/TextNativeComponent.win32.js",
440
434
  "baseFile": "packages/react-native/Libraries/Text/TextNativeComponent.js",
441
- "baseHash": "642b6fc1c5b5802e3612f39c2ae0135b149a65f8",
435
+ "baseHash": "1b2e6301edc13f3a91e47b9befe8a47a12e6ad39",
442
436
  "issue": 7074
443
437
  },
444
438
  {
@@ -451,14 +445,14 @@
451
445
  "type": "patch",
452
446
  "file": "src-win/Libraries/Types/CoreEventTypes.win32.js",
453
447
  "baseFile": "packages/react-native/Libraries/Types/CoreEventTypes.js",
454
- "baseHash": "7fe2b87cf49f4674d731d07f0883bab2f5cfc356",
448
+ "baseHash": "87532a8f108dad9c3ae07b911dd7344e7c244c20",
455
449
  "issue": 6240
456
450
  },
457
451
  {
458
452
  "type": "copy",
459
453
  "file": "src-win/Libraries/Utilities/BackHandler.win32.js",
460
454
  "baseFile": "packages/react-native/Libraries/Utilities/BackHandler.android.js",
461
- "baseHash": "796868f6764037baf433afd88053bb51f3194ddc",
455
+ "baseHash": "b5972a6f2b9da718f57eb7dd9f20b4d67164c980",
462
456
  "issue": 4629
463
457
  },
464
458
  {
@@ -491,7 +485,7 @@
491
485
  "type": "derived",
492
486
  "file": "src-win/Libraries/Utilities/Platform.flow.win32.js",
493
487
  "baseFile": "packages/react-native/Libraries/Utilities/Platform.flow.js",
494
- "baseHash": "f38efa527b9426ae0178bb2336be2e93af0392ba"
488
+ "baseHash": "ae1dbc0afd40655cb18e00eecf21b7ca5db538f2"
495
489
  },
496
490
  {
497
491
  "type": "derived",
@@ -503,20 +497,26 @@
503
497
  "type": "copy",
504
498
  "file": "src-win/Libraries/Utilities/useMergeRefs.js",
505
499
  "baseFile": "packages/react-native/Libraries/Utilities/useMergeRefs.js",
506
- "baseHash": "1f1ca637132e6e0fe1549ba520d98508269ca2bd"
500
+ "baseHash": "4ba42e1b43ef55a1a9e3095336979fa712f4dc8d"
507
501
  },
508
502
  {
509
503
  "type": "patch",
510
504
  "file": "src-win/src/private/animated/NativeAnimatedHelper.win32.js",
511
505
  "baseFile": "packages/react-native/src/private/animated/NativeAnimatedHelper.js",
512
- "baseHash": "c91921c31ad267817d7a38859005149473ca6da5",
506
+ "baseHash": "8c67d57575cccb7281b15ca2591e4edf5c5c36dd",
513
507
  "issue": 11041
514
508
  },
509
+ {
510
+ "type": "copy",
511
+ "file": "src-win/src/private/debugging/ReactDevToolsSettingsManager.win32.js",
512
+ "baseFile": "packages/react-native/src/private/debugging/ReactDevToolsSettingsManager.android.js",
513
+ "baseHash": "df41b76dc3d2df9455fae588748261d7b0a22d01"
514
+ },
515
515
  {
516
516
  "type": "derived",
517
517
  "file": "src-win/src/private/specs/modules/NativeAccessibilityInfoWin32.js",
518
518
  "baseFile": "packages/react-native/src/private/specs/modules/NativeAccessibilityInfo.js",
519
- "baseHash": "3c15b48f632de6b939697ae114734cc54e003027"
519
+ "baseHash": "82fc086f675dec489e485c3aabaabe1225ef5f36"
520
520
  },
521
521
  {
522
522
  "type": "derived",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@office-iss/react-native-win32",
3
- "version": "0.76.2",
3
+ "version": "0.77.0-preview.2",
4
4
  "description": "Implementation of react native on top of Office's Win32 platform.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -30,19 +30,19 @@
30
30
  "@react-native-community/cli-platform-android": "15.0.0-alpha.2",
31
31
  "@react-native-community/cli-platform-ios": "15.0.0-alpha.2",
32
32
  "@react-native/assets": "1.0.0",
33
- "@react-native/assets-registry": "0.76.2",
34
- "@react-native/codegen": "0.76.2",
35
- "@react-native/community-cli-plugin": "0.76.2",
36
- "@react-native/gradle-plugin": "0.76.2",
37
- "@react-native/js-polyfills": "0.76.2",
38
- "@react-native/normalize-colors": "0.76.2",
39
- "@react-native/virtualized-lists": "0.76.2",
33
+ "@react-native/assets-registry": "0.77.0-rc.4",
34
+ "@react-native/codegen": "0.77.0-rc.4",
35
+ "@react-native/community-cli-plugin": "0.77.0-rc.4",
36
+ "@react-native/gradle-plugin": "0.77.0-rc.4",
37
+ "@react-native/js-polyfills": "0.77.0-rc.4",
38
+ "@react-native/normalize-colors": "0.77.0-rc.4",
39
+ "@react-native/virtualized-lists": "0.77.0-rc.4",
40
40
  "abort-controller": "^3.0.0",
41
41
  "anser": "^1.4.9",
42
42
  "ansi-regex": "^5.0.0",
43
43
  "art": "^0.10.0",
44
44
  "babel-jest": "^29.7.0",
45
- "babel-plugin-syntax-hermes-parser": "^0.23.1",
45
+ "babel-plugin-syntax-hermes-parser": "0.25.1",
46
46
  "base64-js": "^1.5.1",
47
47
  "chalk": "^4.0.0",
48
48
  "commander": "^12.0.0",
@@ -60,7 +60,7 @@
60
60
  "pretty-format": "^29.7.0",
61
61
  "promise": "^8.3.0",
62
62
  "react-clone-referenced-element": "^1.0.1",
63
- "react-devtools-core": "^5.3.1",
63
+ "react-devtools-core": "^6.0.1",
64
64
  "react-refresh": "^0.14.0",
65
65
  "react-shallow-renderer": "^16.15.0",
66
66
  "regenerator-runtime": "^0.13.2",
@@ -74,37 +74,37 @@
74
74
  "devDependencies": {
75
75
  "@babel/core": "^7.25.2",
76
76
  "@babel/eslint-parser": "^7.25.1",
77
- "@react-native/metro-config": "0.76.2",
77
+ "@react-native/metro-config": "0.77.0-nightly-20241001-223e98cc4",
78
78
  "@rnw-scripts/babel-react-native-config": "0.0.0",
79
- "@rnw-scripts/eslint-config": "1.2.27",
80
- "@rnw-scripts/jest-out-of-tree-snapshot-resolver": "^1.1.31",
81
- "@rnw-scripts/just-task": "2.3.44",
79
+ "@rnw-scripts/eslint-config": "1.2.30",
80
+ "@rnw-scripts/jest-out-of-tree-snapshot-resolver": "^1.1.34",
81
+ "@rnw-scripts/just-task": "2.3.47",
82
82
  "@rnw-scripts/metro-dev-config": "0.0.0",
83
83
  "@rnx-kit/jest-preset": "^0.1.17",
84
84
  "@types/node": "^18.0.0",
85
85
  "@types/prop-types": "15.7.1",
86
86
  "@types/react": "^18.2.6",
87
87
  "eslint": "^8.19.0",
88
- "flow-bin": "^0.245.2",
88
+ "flow-bin": "^0.250.0",
89
89
  "jscodeshift": "^0.14.0",
90
90
  "just-scripts": "^1.3.3",
91
91
  "prettier": "2.8.8",
92
92
  "react": "18.3.1",
93
- "react-native": "0.76.2",
94
- "react-native-platform-override": "^1.9.46",
93
+ "react-native": "0.77.0-rc.4",
94
+ "react-native-platform-override": "^1.9.49",
95
95
  "typescript": "5.0.4"
96
96
  },
97
97
  "peerDependencies": {
98
98
  "@types/react": "^18.2.6",
99
99
  "react": "^18.2.0",
100
- "react-native": "^0.76.2"
100
+ "react-native": "0.77.0-rc.4"
101
101
  },
102
102
  "beachball": {
103
- "defaultNpmTag": "latest",
103
+ "defaultNpmTag": "preview",
104
104
  "disallowedChangeTypes": [
105
105
  "major",
106
106
  "minor",
107
- "prerelease",
107
+ "patch",
108
108
  "premajor",
109
109
  "preminor",
110
110
  "prepatch"
@@ -8,7 +8,6 @@
8
8
  * @format
9
9
  */
10
10
 
11
- import type {EventSubscription} from '../../../Libraries/vendor/emitter/EventEmitter';
12
11
  import type {EventConfig} from '../../../Libraries/Animated/AnimatedEvent';
13
12
  import type {
14
13
  AnimationConfig,
@@ -18,13 +17,14 @@ import type {
18
17
  AnimatedNodeConfig,
19
18
  EventMapping,
20
19
  } from '../../../Libraries/Animated/NativeAnimatedModule';
20
+ import type {EventSubscription} from '../../../Libraries/vendor/emitter/EventEmitter';
21
21
 
22
- import * as ReactNativeFeatureFlags from '../featureflags/ReactNativeFeatureFlags';
22
+ import NativeAnimatedNonTurboModule from '../../../Libraries/Animated/NativeAnimatedModule';
23
+ import NativeAnimatedTurboModule from '../../../Libraries/Animated/NativeAnimatedTurboModule';
23
24
  import NativeEventEmitter from '../../../Libraries/EventEmitter/NativeEventEmitter';
24
25
  import RCTDeviceEventEmitter from '../../../Libraries/EventEmitter/RCTDeviceEventEmitter';
25
26
  import Platform from '../../../Libraries/Utilities/Platform';
26
- import NativeAnimatedNonTurboModule from '../../../Libraries/Animated/NativeAnimatedModule';
27
- import NativeAnimatedTurboModule from '../../../Libraries/Animated/NativeAnimatedTurboModule';
27
+ import * as ReactNativeFeatureFlags from '../featureflags/ReactNativeFeatureFlags';
28
28
  import invariant from 'invariant';
29
29
  import nullthrows from 'nullthrows';
30
30
 
@@ -46,7 +46,7 @@ const isSingleOpBatching =
46
46
  Platform.OS === 'android' &&
47
47
  NativeAnimatedModule?.queueAndExecuteBatchedOperations != null &&
48
48
  ReactNativeFeatureFlags.animatedShouldUseSingleOp();
49
- let flushQueueTimeout = null;
49
+ let flushQueueImmediate = null;
50
50
 
51
51
  const eventListenerGetValueCallbacks: {
52
52
  [number]: (value: number) => void,
@@ -142,9 +142,13 @@ const API = {
142
142
  queueOperations = true;
143
143
  if (
144
144
  ReactNativeFeatureFlags.animatedShouldDebounceQueueFlush() &&
145
- flushQueueTimeout
145
+ flushQueueImmediate
146
146
  ) {
147
- clearTimeout(flushQueueTimeout);
147
+ if (ReactNativeFeatureFlags.enableAnimatedClearImmediateFix()) {
148
+ clearImmediate(flushQueueImmediate);
149
+ } else {
150
+ clearTimeout(flushQueueImmediate);
151
+ }
148
152
  }
149
153
  },
150
154
 
@@ -161,9 +165,9 @@ const API = {
161
165
  invariant(NativeAnimatedModule, 'Native animated module is not available');
162
166
 
163
167
  if (ReactNativeFeatureFlags.animatedShouldDebounceQueueFlush()) {
164
- const prevTimeout = flushQueueTimeout;
165
- clearImmediate(prevTimeout);
166
- flushQueueTimeout = setImmediate(API.flushQueue);
168
+ const prevImmediate = flushQueueImmediate;
169
+ clearImmediate(prevImmediate);
170
+ flushQueueImmediate = setImmediate(API.flushQueue);
167
171
  } else {
168
172
  API.flushQueue();
169
173
  }
@@ -171,12 +175,11 @@ const API = {
171
175
 
172
176
  flushQueue: (isSingleOpBatching
173
177
  ? (): void => {
174
- // TODO: (T136971132)
175
178
  invariant(
176
- NativeAnimatedModule || process.env.NODE_ENV === 'test',
179
+ NativeAnimatedModule,
177
180
  'Native animated module is not available',
178
181
  );
179
- flushQueueTimeout = null;
182
+ flushQueueImmediate = null;
180
183
 
181
184
  if (singleOpQueue.length === 0) {
182
185
  return;
@@ -193,12 +196,11 @@ const API = {
193
196
  singleOpQueue.length = 0;
194
197
  }
195
198
  : (): void => {
196
- // TODO: (T136971132)
197
199
  invariant(
198
- NativeAnimatedModule || process.env.NODE_ENV === 'test',
200
+ NativeAnimatedModule,
199
201
  'Native animated module is not available',
200
202
  );
201
- flushQueueTimeout = null;
203
+ flushQueueImmediate = null;
202
204
 
203
205
  if (queue.length === 0) {
204
206
  return;