react-native-windows 0.77.0 → 0.78.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 (234) hide show
  1. package/.flowconfig +1 -1
  2. package/Chakra/ChakraTracing.cpp +1 -1
  3. package/Libraries/Animated/animations/Animation.js +22 -1
  4. package/Libraries/Animated/animations/DecayAnimation.js +1 -0
  5. package/Libraries/Animated/animations/SpringAnimation.js +1 -0
  6. package/Libraries/Animated/animations/TimingAnimation.js +1 -0
  7. package/Libraries/Animated/nodes/AnimatedAddition.js +9 -2
  8. package/Libraries/Animated/nodes/AnimatedColor.js +4 -1
  9. package/Libraries/Animated/nodes/AnimatedDiffClamp.js +10 -2
  10. package/Libraries/Animated/nodes/AnimatedDivision.js +9 -2
  11. package/Libraries/Animated/nodes/AnimatedInterpolation.js +5 -1
  12. package/Libraries/Animated/nodes/AnimatedModulo.js +5 -2
  13. package/Libraries/Animated/nodes/AnimatedMultiplication.js +9 -2
  14. package/Libraries/Animated/nodes/AnimatedNode.js +25 -46
  15. package/Libraries/Animated/nodes/AnimatedObject.js +9 -2
  16. package/Libraries/Animated/nodes/AnimatedProps.js +5 -1
  17. package/Libraries/Animated/nodes/AnimatedStyle.js +5 -1
  18. package/Libraries/Animated/nodes/AnimatedSubtraction.js +9 -2
  19. package/Libraries/Animated/nodes/AnimatedTracking.js +5 -1
  20. package/Libraries/Animated/nodes/AnimatedTransform.js +5 -1
  21. package/Libraries/Animated/nodes/AnimatedValue.js +49 -4
  22. package/Libraries/Animated/nodes/AnimatedValueXY.js +3 -1
  23. package/Libraries/Animated/useAnimatedProps.js +0 -43
  24. package/Libraries/Components/Button.windows.js +3 -0
  25. package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.d.ts +1 -1
  26. package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.js +3 -1
  27. package/Libraries/Components/LayoutConformance/LayoutConformance.d.ts +21 -0
  28. package/Libraries/Components/LayoutConformance/LayoutConformance.js +59 -0
  29. package/Libraries/Components/LayoutConformance/LayoutConformanceNativeComponent.js +29 -0
  30. package/Libraries/Components/Pressable/Pressable.windows.js +3 -0
  31. package/Libraries/Components/TextInput/RCTTextInputViewConfig.js +1 -0
  32. package/Libraries/Components/TextInput/TextInput.d.ts +5 -0
  33. package/Libraries/Components/TextInput/TextInput.flow.js +6 -0
  34. package/Libraries/Components/TextInput/TextInput.js +6 -0
  35. package/Libraries/Components/TextInput/TextInput.windows.js +9 -0
  36. package/Libraries/Components/Touchable/TouchableBounce.windows.js +2 -0
  37. package/Libraries/Components/Touchable/TouchableNativeFeedback.windows.js +2 -0
  38. package/Libraries/Components/Touchable/TouchableOpacity.windows.js +2 -0
  39. package/Libraries/Components/Touchable/TouchableWithoutFeedback.windows.js +2 -0
  40. package/Libraries/Components/View/View.windows.js +3 -0
  41. package/Libraries/Components/View/ViewAccessibility.d.ts +7 -2
  42. package/Libraries/Components/View/ViewAccessibility.windows.js +1 -0
  43. package/Libraries/Components/View/ViewPropTypes.d.ts +0 -7
  44. package/Libraries/Components/View/ViewPropTypes.js +0 -9
  45. package/Libraries/Components/View/ViewPropTypes.windows.js +1 -9
  46. package/Libraries/Core/ReactNativeVersion.js +2 -2
  47. package/Libraries/Core/setUpBatchedBridge.js +1 -16
  48. package/Libraries/EventEmitter/RCTEventEmitter.js +2 -6
  49. package/Libraries/Image/AssetSourceResolver.js +11 -0
  50. package/Libraries/Image/AssetSourceResolver.windows.js +11 -0
  51. package/Libraries/Image/Image.windows.js +2 -0
  52. package/Libraries/Inspector/BorderBox.js +26 -14
  53. package/Libraries/Inspector/BoxInspector.js +60 -42
  54. package/Libraries/Inspector/ElementBox.js +55 -48
  55. package/Libraries/Inspector/StyleInspector.js +36 -30
  56. package/Libraries/LayoutAnimation/LayoutAnimation.js +2 -2
  57. package/Libraries/Lists/FlatList.d.ts +1 -1
  58. package/Libraries/Modal/Modal.js +2 -0
  59. package/Libraries/Modal/Modal.windows.js +2 -0
  60. package/Libraries/NativeComponent/BaseViewConfig.android.js +0 -2
  61. package/Libraries/NativeComponent/BaseViewConfig.ios.js +0 -2
  62. package/Libraries/NativeComponent/BaseViewConfig.windows.js +0 -2
  63. package/Libraries/Network/RCTNetworking.android.js +24 -16
  64. package/Libraries/Network/RCTNetworking.ios.js +1 -46
  65. package/Libraries/Network/RCTNetworking.windows.js +1 -46
  66. package/Libraries/Network/RCTNetworkingEventDefinitions.flow.js +57 -0
  67. package/Libraries/ReactNative/UIManagerProperties.js +3 -1
  68. package/Libraries/Renderer/implementations/ReactFabric-dev.js +15828 -26461
  69. package/Libraries/Renderer/implementations/ReactFabric-prod.js +3907 -2560
  70. package/Libraries/Renderer/implementations/ReactFabric-profiling.js +4399 -2878
  71. package/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js +16102 -26908
  72. package/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js +4034 -2695
  73. package/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.js +4535 -3045
  74. package/Libraries/Renderer/shims/ReactNativeTypes.js +5 -6
  75. package/Libraries/StyleSheet/processTransform.js +6 -0
  76. package/Libraries/Text/Text.d.ts +6 -1
  77. package/Libraries/Text/Text.windows.js +4 -0
  78. package/Libraries/Text/TextProps.js +2 -2
  79. package/Libraries/Text/TextProps.windows.js +3 -2
  80. package/Libraries/Utilities/BackHandler.android.js +5 -4
  81. package/Libraries/Utilities/BackHandler.ios.js +4 -5
  82. package/Libraries/Utilities/BackHandler.windows.js +5 -4
  83. package/Microsoft.ReactNative/CompositionComponentView.idl +13 -1
  84. package/Microsoft.ReactNative/Fabric/ComponentView.cpp +0 -1
  85. package/Microsoft.ReactNative/Fabric/Composition/ComponentViewRegistry.cpp +0 -5
  86. package/Microsoft.ReactNative/Fabric/Composition/CompositionDynamicAutomationProvider.cpp +92 -17
  87. package/Microsoft.ReactNative/Fabric/Composition/CompositionDynamicAutomationProvider.h +9 -0
  88. package/Microsoft.ReactNative/Fabric/Composition/CompositionEventHandler.cpp +13 -33
  89. package/Microsoft.ReactNative/Fabric/Composition/CompositionEventHandler.h +1 -3
  90. package/Microsoft.ReactNative/Fabric/Composition/CompositionRootAutomationProvider.cpp +43 -5
  91. package/Microsoft.ReactNative/Fabric/Composition/CompositionRootAutomationProvider.h +2 -1
  92. package/Microsoft.ReactNative/Fabric/Composition/CompositionViewComponentView.cpp +12 -10
  93. package/Microsoft.ReactNative/Fabric/Composition/ContentIslandComponentView.cpp +11 -9
  94. package/Microsoft.ReactNative/Fabric/Composition/ContentIslandComponentView.h +1 -1
  95. package/Microsoft.ReactNative/Fabric/Composition/Modal/WindowsModalHostViewComponentView.cpp +191 -329
  96. package/Microsoft.ReactNative/Fabric/Composition/Modal/WindowsModalHostViewComponentView.h +3 -61
  97. package/Microsoft.ReactNative/Fabric/Composition/PortalComponentView.cpp +66 -0
  98. package/Microsoft.ReactNative/Fabric/Composition/PortalComponentView.h +52 -0
  99. package/Microsoft.ReactNative/Fabric/Composition/ReactCompositionViewComponentBuilder.cpp +21 -0
  100. package/Microsoft.ReactNative/Fabric/Composition/ReactCompositionViewComponentBuilder.h +7 -4
  101. package/Microsoft.ReactNative/Fabric/Composition/ReactNativeIsland.cpp +79 -19
  102. package/Microsoft.ReactNative/Fabric/Composition/ReactNativeIsland.h +12 -6
  103. package/Microsoft.ReactNative/Fabric/Composition/RootComponentView.cpp +71 -17
  104. package/Microsoft.ReactNative/Fabric/Composition/RootComponentView.h +16 -0
  105. package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentDescriptor.h +5 -10
  106. package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.cpp +4 -4
  107. package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputShadowNode.cpp +138 -110
  108. package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputShadowNode.h +27 -27
  109. package/Microsoft.ReactNative/Fabric/Composition/Theme.cpp +1 -1
  110. package/Microsoft.ReactNative/Fabric/Composition/UiaHelpers.cpp +38 -33
  111. package/Microsoft.ReactNative/Fabric/Composition/UiaHelpers.h +0 -2
  112. package/Microsoft.ReactNative/Fabric/FabricUIManagerModule.cpp +5 -16
  113. package/Microsoft.ReactNative/Fabric/FabricUIManagerModule.h +0 -3
  114. package/Microsoft.ReactNative/Fabric/ImageManager.cpp +9 -0
  115. package/Microsoft.ReactNative/Fabric/WindowsComponentDescriptorRegistry.cpp +0 -2
  116. package/Microsoft.ReactNative/Fabric/platform/react/renderer/graphics/PlatformColorUtils.cpp +1 -1
  117. package/Microsoft.ReactNative/IReactCompositionViewComponentBuilder.idl +5 -0
  118. package/Microsoft.ReactNative/IReactContext.cpp +2 -2
  119. package/Microsoft.ReactNative/IReactContext.h +1 -1
  120. package/Microsoft.ReactNative/IReactContext.idl +2 -2
  121. package/Microsoft.ReactNative/IReactPackageBuilder.idl +3 -3
  122. package/Microsoft.ReactNative/Microsoft.ReactNative.vcxproj +97 -87
  123. package/Microsoft.ReactNative/Modules/AccessibilityInfoModule.cpp +4 -0
  124. package/Microsoft.ReactNative/Modules/AlertModule.cpp +9 -4
  125. package/Microsoft.ReactNative/Modules/Animated/NativeAnimatedNodeManager.cpp +1 -1
  126. package/Microsoft.ReactNative/Modules/Animated/PropsAnimatedNode.cpp +32 -35
  127. package/Microsoft.ReactNative/Modules/Animated/PropsAnimatedNode.h +7 -4
  128. package/Microsoft.ReactNative/Modules/AppStateModule.cpp +1 -1
  129. package/Microsoft.ReactNative/Modules/AppThemeModuleUwp.cpp +2 -2
  130. package/Microsoft.ReactNative/Modules/AppearanceModule.cpp +2 -2
  131. package/Microsoft.ReactNative/Modules/DeviceInfoModule.cpp +3 -3
  132. package/Microsoft.ReactNative/Modules/I18nManagerModule.cpp +1 -1
  133. package/Microsoft.ReactNative/Modules/LogBoxModule.cpp +7 -5
  134. package/Microsoft.ReactNative/Modules/LogBoxModule.h +2 -1
  135. package/Microsoft.ReactNative/Modules/NativeUIManager.cpp +10 -10
  136. package/Microsoft.ReactNative/Modules/PaperUIManagerModule.cpp +24 -24
  137. package/Microsoft.ReactNative/Modules/Timing.cpp +2 -2
  138. package/Microsoft.ReactNative/ReactHost/IReactInstance.h +5 -0
  139. package/Microsoft.ReactNative/ReactHost/React.h +0 -3
  140. package/Microsoft.ReactNative/ReactHost/ReactInstanceWin.cpp +39 -16
  141. package/Microsoft.ReactNative/ReactHost/ReactInstanceWin.h +4 -2
  142. package/Microsoft.ReactNative/ReactNativeHost.cpp +9 -4
  143. package/Microsoft.ReactNative/ReactNativeIsland.idl +5 -1
  144. package/Microsoft.ReactNative/ReactPackageBuilder.cpp +3 -3
  145. package/Microsoft.ReactNative/ReactPackageBuilder.h +4 -4
  146. package/Microsoft.ReactNative/Utils/Helpers.cpp +0 -2
  147. package/Microsoft.ReactNative/Views/DebuggingOverlayViewManager.cpp +0 -1
  148. package/Microsoft.ReactNative/Views/DevMenu.cpp +6 -6
  149. package/Microsoft.ReactNative/Views/DevMenu.h +1 -1
  150. package/Microsoft.ReactNative/Views/ViewManagerBase.cpp +2 -2
  151. package/Microsoft.ReactNative/Views/ViewPanel.cpp +1 -1
  152. package/Microsoft.ReactNative/Views/ViewViewManager.cpp +2 -2
  153. package/Microsoft.ReactNative/XamlUIService.cpp +13 -7
  154. package/Microsoft.ReactNative/XamlUIService.h +4 -1
  155. package/Microsoft.ReactNative/XamlUIService.idl +2 -0
  156. package/Microsoft.ReactNative.Cxx/JSI/JsiAbiApi.h +6 -2
  157. package/Microsoft.ReactNative.Cxx/ReactContext.h +1 -1
  158. package/Microsoft.ReactNative.Cxx/XamlUtils.h +12 -0
  159. package/PropertySheets/Generated/PackageVersion.g.props +3 -3
  160. package/PropertySheets/React.Cpp.props +3 -0
  161. package/PropertySheets/WebView2.props +1 -1
  162. package/PropertySheets/WinUI.props +5 -4
  163. package/ReactCommon/ReactCommon.vcxproj +5 -1
  164. package/ReactCommon/ReactCommon.vcxproj.filters +1 -1
  165. package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/JSExecutor.cpp +3 -3
  166. package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/NativeToJsBridge.cpp +3 -3
  167. package/ReactCommon/TEMP_UntilReactCommonUpdate/jsi/jsi/test/testlib.cpp +91 -0
  168. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/componentregistry/ComponentDescriptorRegistry.cpp +1 -12
  169. package/{Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputState.h → ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/textinput/TextInputState.h} +37 -35
  170. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/view/AccessibilityPrimitives.h +1 -0
  171. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/view/accessibilityPropsConversions.h +4 -0
  172. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/imagemanager/ImageRequestParams.h +30 -0
  173. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/runtimescheduler/SchedulerPriorityUtils.h +4 -3
  174. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/uimanager/primitives.h +179 -0
  175. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/runtime/ReactInstance.cpp +43 -57
  176. package/Shared/HermesRuntimeHolder.cpp +2 -2
  177. package/Shared/Shared.vcxitems +8 -14
  178. package/Shared/Shared.vcxitems.filters +4 -16
  179. package/Shared/Threading/BatchingQueueThread.cpp +3 -3
  180. package/codegen/NativeCPUTimeSpec.g.h +41 -0
  181. package/codegen/NativeFantomSpec.g.h +78 -0
  182. package/codegen/NativePerformanceSpec.g.h +31 -43
  183. package/codegen/NativeReactNativeFeatureFlagsSpec.g.h +84 -84
  184. package/codegen/react/components/rnwcore/ActivityIndicatorView.g.h +212 -0
  185. package/codegen/react/components/rnwcore/AndroidDrawerLayout.g.h +295 -0
  186. package/codegen/react/components/rnwcore/AndroidHorizontalScrollContentView.g.h +200 -0
  187. package/codegen/react/components/rnwcore/AndroidProgressBar.g.h +224 -0
  188. package/codegen/react/components/rnwcore/AndroidSwipeRefreshLayout.g.h +250 -0
  189. package/codegen/react/components/rnwcore/AndroidSwitch.g.h +267 -0
  190. package/codegen/react/components/rnwcore/DebuggingOverlay.g.h +234 -0
  191. package/codegen/react/components/rnwcore/InputAccessory.g.h +200 -0
  192. package/codegen/react/components/rnwcore/ModalHostView.g.h +283 -0
  193. package/codegen/react/components/rnwcore/PullToRefreshView.g.h +246 -0
  194. package/codegen/react/components/rnwcore/SafeAreaView.g.h +197 -0
  195. package/codegen/react/components/rnwcore/Switch.g.h +263 -0
  196. package/codegen/react/components/rnwcore/UnimplementedNativeView.g.h +200 -0
  197. package/codegen/rnwcoreJSI-generated.cpp +90 -57
  198. package/codegen/rnwcoreJSI.h +241 -104
  199. package/index.js +5 -0
  200. package/index.windows.js +5 -0
  201. package/just-task.js +1 -1
  202. package/package.json +25 -26
  203. package/src/private/animated/NativeAnimatedValidation.js +1 -1
  204. package/src/private/featureflags/ReactNativeFeatureFlags.js +33 -27
  205. package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +5 -5
  206. package/src/private/renderer/errorhandling/ErrorHandlers.js +12 -55
  207. package/src/private/specs/modules/{NativeJSCSamplingProfiler.js → NativeCPUTime.js} +7 -2
  208. package/src/private/specs/modules/NativeFantom.js +37 -0
  209. package/src/private/utilities/ensureInstance.js +21 -0
  210. package/src/private/webapis/dom/nodes/ReactNativeElement.js +49 -6
  211. package/src/private/webapis/dom/nodes/ReadOnlyNode.js +17 -9
  212. package/src/private/webapis/intersectionobserver/IntersectionObserver.js +11 -11
  213. package/src/private/webapis/intersectionobserver/IntersectionObserverEntry.js +1 -1
  214. package/src/private/webapis/intersectionobserver/IntersectionObserverManager.js +1 -1
  215. package/src/private/webapis/intersectionobserver/specs/NativeIntersectionObserver.js +1 -0
  216. package/src/private/webapis/performance/Performance.js +0 -12
  217. package/src/private/webapis/performance/specs/NativePerformance.js +0 -11
  218. package/types/index.d.ts +1 -0
  219. package/Libraries/HeapCapture/HeapCapture.js +0 -29
  220. package/Libraries/HeapCapture/NativeJSCHeapCapture.js +0 -13
  221. package/Libraries/Performance/NativeJSCSamplingProfiler.js +0 -13
  222. package/Libraries/Performance/SamplingProfiler.js +0 -39
  223. package/Libraries/ReactNative/__mocks__/FabricUIManager.js +0 -334
  224. package/Microsoft.ReactNative/Fabric/Composition/Modal/WindowsModalHostViewComponentDescriptor.h +0 -39
  225. package/Microsoft.ReactNative/Fabric/Composition/Modal/WindowsModalHostViewShadowNode.cpp +0 -18
  226. package/Microsoft.ReactNative/Fabric/Composition/Modal/WindowsModalHostViewShadowNode.h +0 -39
  227. package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputState.cpp +0 -34
  228. package/Microsoft.ReactNative/Fabric/ReactNativeConfigProperties.cpp +0 -53
  229. package/Microsoft.ReactNative/Fabric/ReactNativeConfigProperties.h +0 -26
  230. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/core/LayoutableShadowNode.cpp +0 -363
  231. package/codegen/NativeJSCSamplingProfilerSpec.g.h +0 -35
  232. package/src/private/webapis/dom/nodes/specs/__mocks__/NativeDOMMock.js +0 -413
  233. package/src/private/webapis/intersectionobserver/specs/__mocks__/NativeIntersectionObserver.js +0 -181
  234. package/src/private/webapis/mutationobserver/specs/__mocks__/NativeMutationObserver.js +0 -327
@@ -620,6 +620,7 @@ export type ViewProps = $ReadOnly<{|
620
620
  'aria-disabled'?: ?boolean,
621
621
  'aria-expanded'?: ?boolean,
622
622
  'aria-selected'?: ?boolean,
623
+ 'aria-readonly'?: ?boolean, // Windows
623
624
  /** A value indicating whether the accessibility elements contained within
624
625
  * this accessibility element are hidden.
625
626
  *
@@ -646,15 +647,6 @@ export type ViewProps = $ReadOnly<{|
646
647
  */
647
648
  collapsableChildren?: ?boolean,
648
649
 
649
- /**
650
- * Contols whether this view, and its transitive children, are laid in a way
651
- * consistent with web browsers ('strict'), or consistent with existing
652
- * React Native code which may rely on incorrect behavior ('classic').
653
- *
654
- * This prop only works when using Fabric.
655
- */
656
- experimental_layoutConformance?: ?('strict' | 'classic'),
657
-
658
650
  /**
659
651
  * Used to locate this view from native classes. Has precedence over `nativeID` prop.
660
652
  *
@@ -15,9 +15,9 @@ const version: $ReadOnly<{
15
15
  prerelease: string | null,
16
16
  }> = {
17
17
  major: 0,
18
- minor: 77,
18
+ minor: 78,
19
19
  patch: 0,
20
- prerelease: null,
20
+ prerelease: 'rc.0',
21
21
  };
22
22
 
23
23
  module.exports = {version};
@@ -10,27 +10,12 @@
10
10
 
11
11
  'use strict';
12
12
 
13
- let registerModule;
14
- if (global.RN$Bridgeless === true && global.RN$registerCallableModule) {
15
- registerModule = global.RN$registerCallableModule;
16
- } else {
17
- const BatchedBridge = require('../BatchedBridge/BatchedBridge');
18
- registerModule = (
19
- moduleName: string,
20
- /* $FlowFixMe[missing-local-annot] The type annotation(s) required by
21
- * Flow's LTI update could not be added via codemod */
22
- factory,
23
- ) => BatchedBridge.registerLazyCallableModule(moduleName, factory);
24
- }
13
+ import registerModule from './registerCallableModule';
25
14
 
26
15
  registerModule('Systrace', () => require('../Performance/Systrace'));
27
16
  if (!(global.RN$Bridgeless === true)) {
28
17
  registerModule('JSTimers', () => require('./Timers/JSTimers'));
29
18
  }
30
- registerModule('HeapCapture', () => require('../HeapCapture/HeapCapture'));
31
- registerModule('SamplingProfiler', () =>
32
- require('../Performance/SamplingProfiler'),
33
- );
34
19
  registerModule('RCTLog', () => require('../Utilities/RCTLog'));
35
20
  registerModule(
36
21
  'RCTDeviceEventEmitter',
@@ -10,15 +10,11 @@
10
10
 
11
11
  'use strict';
12
12
 
13
- const BatchedBridge = require('../BatchedBridge/BatchedBridge');
13
+ import registerCallableModule from '../Core/registerCallableModule';
14
14
 
15
15
  const RCTEventEmitter = {
16
16
  register(eventEmitter: any) {
17
- if (global.RN$Bridgeless) {
18
- global.RN$registerCallableModule('RCTEventEmitter', () => eventEmitter);
19
- } else {
20
- BatchedBridge.registerCallableModule('RCTEventEmitter', eventEmitter);
21
- }
17
+ registerCallableModule('RCTEventEmitter', eventEmitter);
22
18
  },
23
19
  };
24
20
 
@@ -55,6 +55,17 @@ function getAssetPathInDrawableFolder(asset: PackagerAsset): string {
55
55
 
56
56
  /**
57
57
  * Returns true if the asset can be loaded over the network.
58
+ *
59
+ * This prevents an issue loading XML assets on Android. XML asset types like
60
+ * vector drawables can only be loaded from precompiled source. Android does
61
+ * not support loading these over the network, and AAPT precompiles data by
62
+ * breaking path data and resource information apart into multiple files,
63
+ * stuffing it all into the resource table. As a result, we should only attempt
64
+ * to load resources as we would in release builds: by the resource name.
65
+ *
66
+ * For more information, see:
67
+ * https://issuetracker.google.com/issues/62435069
68
+ * https://issuetracker.google.com/issues/68293189
58
69
  */
59
70
  function assetSupportsNetworkLoads(asset: PackagerAsset): boolean {
60
71
  return !(asset.type === 'xml' && Platform.OS === 'android');
@@ -77,6 +77,17 @@ function getAssetPathInDrawableFolder(asset: PackagerAsset): string {
77
77
 
78
78
  /**
79
79
  * Returns true if the asset can be loaded over the network.
80
+ *
81
+ * This prevents an issue loading XML assets on Android. XML asset types like
82
+ * vector drawables can only be loaded from precompiled source. Android does
83
+ * not support loading these over the network, and AAPT precompiles data by
84
+ * breaking path data and resource information apart into multiple files,
85
+ * stuffing it all into the resource table. As a result, we should only attempt
86
+ * to load resources as we would in release builds: by the resource name.
87
+ *
88
+ * For more information, see:
89
+ * https://issuetracker.google.com/issues/62435069
90
+ * https://issuetracker.google.com/issues/68293189
80
91
  */
81
92
  function assetSupportsNetworkLoads(asset: PackagerAsset): boolean {
82
93
  return !(asset.type === 'xml' && Platform.OS === 'android');
@@ -147,6 +147,7 @@ let BaseImage: AbstractImageIOS = React.forwardRef((props, forwardedRef) => {
147
147
  'aria-disabled': ariaDisabled,
148
148
  'aria-expanded': ariaExpanded,
149
149
  'aria-selected': ariaSelected,
150
+ 'aria-readonly': ariaReadOnly, // Windows
150
151
  'aria-multiselectable': ariaMultiselectable, // Windows
151
152
  'aria-required': ariaRequired, // Windows
152
153
  height,
@@ -160,6 +161,7 @@ let BaseImage: AbstractImageIOS = React.forwardRef((props, forwardedRef) => {
160
161
  disabled: ariaDisabled ?? props.accessibilityState?.disabled,
161
162
  expanded: ariaExpanded ?? props.accessibilityState?.expanded,
162
163
  selected: ariaSelected ?? props.accessibilityState?.selected,
164
+ readOnly: ariaReadOnly ?? props.accessibilityState?.readOnly, // Windows
163
165
  multiselectable:
164
166
  ariaMultiselectable ?? props.accessibilityState?.multiselectable, // Windows
165
167
  required: ariaRequired ?? props.accessibilityState?.required, // Windows
@@ -10,23 +10,35 @@
10
10
 
11
11
  'use strict';
12
12
 
13
+ import type {ViewStyleProp} from '../StyleSheet/StyleSheet';
14
+
15
+ import React from 'react';
16
+
13
17
  const View = require('../Components/View/View');
14
- const React = require('react');
15
18
 
16
- class BorderBox extends React.Component<$FlowFixMeProps> {
17
- render(): $FlowFixMe | React.Node {
18
- const box = this.props.box;
19
- if (!box) {
20
- return this.props.children;
21
- }
22
- const style = {
23
- borderTopWidth: box.top,
24
- borderBottomWidth: box.bottom,
25
- borderLeftWidth: box.left,
26
- borderRightWidth: box.right,
27
- };
28
- return <View style={[style, this.props.style]}>{this.props.children}</View>;
19
+ type Props = $ReadOnly<{
20
+ children: React.Node,
21
+ box?: ?$ReadOnly<{
22
+ top: number,
23
+ right: number,
24
+ bottom: number,
25
+ left: number,
26
+ ...
27
+ }>,
28
+ style?: ViewStyleProp,
29
+ }>;
30
+
31
+ function BorderBox({children, box, style}: Props): React.Node {
32
+ if (!box) {
33
+ return children;
29
34
  }
35
+ const borderStyle = {
36
+ borderTopWidth: box.top,
37
+ borderBottomWidth: box.bottom,
38
+ borderLeftWidth: box.left,
39
+ borderRightWidth: box.right,
40
+ };
41
+ return <View style={[borderStyle, style]}>{children}</View>;
30
42
  }
31
43
 
32
44
  module.exports = BorderBox;
@@ -10,11 +10,15 @@
10
10
 
11
11
  'use strict';
12
12
 
13
+ import type {TextStyleProp, ViewStyleProp} from '../StyleSheet/StyleSheet';
14
+ import type {InspectedElementFrame} from './Inspector';
15
+
16
+ import React from 'react';
17
+
13
18
  const View = require('../Components/View/View');
14
19
  const StyleSheet = require('../StyleSheet/StyleSheet');
15
20
  const Text = require('../Text/Text');
16
21
  const resolveBoxStyle = require('./resolveBoxStyle');
17
- const React = require('react');
18
22
 
19
23
  const blank = {
20
24
  top: 0,
@@ -23,51 +27,65 @@ const blank = {
23
27
  bottom: 0,
24
28
  };
25
29
 
26
- class BoxInspector extends React.Component<$FlowFixMeProps> {
27
- render(): React.Node {
28
- const frame = this.props.frame;
29
- const style = this.props.style;
30
- const margin = (style && resolveBoxStyle('margin', style)) || blank;
31
- const padding = (style && resolveBoxStyle('padding', style)) || blank;
32
- return (
33
- <BoxContainer title="margin" titleStyle={styles.marginLabel} box={margin}>
34
- <BoxContainer title="padding" box={padding}>
35
- <View>
36
- <Text style={styles.innerText}>
37
- ({(frame.left || 0).toFixed(1)}, {(frame.top || 0).toFixed(1)})
38
- </Text>
39
- <Text style={styles.innerText}>
40
- {(frame.width || 0).toFixed(1)} &times;{' '}
41
- {(frame.height || 0).toFixed(1)}
42
- </Text>
43
- </View>
44
- </BoxContainer>
45
- </BoxContainer>
46
- );
47
- }
48
- }
30
+ type BoxInspectorProps = $ReadOnly<{
31
+ style: ViewStyleProp,
32
+ frame: ?InspectedElementFrame,
33
+ }>;
34
+
35
+ function BoxInspector({style, frame}: BoxInspectorProps): React.Node {
36
+ const margin = (style && resolveBoxStyle('margin', style)) || blank;
37
+ const padding = (style && resolveBoxStyle('padding', style)) || blank;
49
38
 
50
- class BoxContainer extends React.Component<$FlowFixMeProps> {
51
- render(): React.Node {
52
- const box = this.props.box;
53
- return (
54
- <View style={styles.box}>
55
- <View style={styles.row}>
56
- {}
57
- <Text style={[this.props.titleStyle, styles.label]}>
58
- {this.props.title}
39
+ return (
40
+ <BoxContainer title="margin" titleStyle={styles.marginLabel} box={margin}>
41
+ <BoxContainer title="padding" box={padding}>
42
+ <View>
43
+ <Text style={styles.innerText}>
44
+ ({(frame?.left || 0).toFixed(1)}, {(frame?.top || 0).toFixed(1)})
45
+ </Text>
46
+ <Text style={styles.innerText}>
47
+ {(frame?.width || 0).toFixed(1)} &times;{' '}
48
+ {(frame?.height || 0).toFixed(1)}
59
49
  </Text>
60
- <Text style={styles.boxText}>{box.top}</Text>
61
- </View>
62
- <View style={styles.row}>
63
- <Text style={styles.boxText}>{box.left}</Text>
64
- {this.props.children}
65
- <Text style={styles.boxText}>{box.right}</Text>
66
50
  </View>
67
- <Text style={styles.boxText}>{box.bottom}</Text>
51
+ </BoxContainer>
52
+ </BoxContainer>
53
+ );
54
+ }
55
+
56
+ type BoxContainerProps = $ReadOnly<{
57
+ title: string,
58
+ titleStyle?: TextStyleProp,
59
+ box: $ReadOnly<{
60
+ top: number,
61
+ left: number,
62
+ right: number,
63
+ bottom: number,
64
+ }>,
65
+ children: React.Node,
66
+ }>;
67
+
68
+ function BoxContainer({
69
+ title,
70
+ titleStyle,
71
+ box,
72
+ children,
73
+ }: BoxContainerProps): React.Node {
74
+ return (
75
+ <View style={styles.box}>
76
+ <View style={styles.row}>
77
+ {}
78
+ <Text style={[titleStyle, styles.label]}>{title}</Text>
79
+ <Text style={styles.boxText}>{box.top}</Text>
80
+ </View>
81
+ <View style={styles.row}>
82
+ <Text style={styles.boxText}>{box.left}</Text>
83
+ {children}
84
+ <Text style={styles.boxText}>{box.right}</Text>
68
85
  </View>
69
- );
70
- }
86
+ <Text style={styles.boxText}>{box.bottom}</Text>
87
+ </View>
88
+ );
71
89
  }
72
90
 
73
91
  const styles = StyleSheet.create({
@@ -10,65 +10,72 @@
10
10
 
11
11
  'use strict';
12
12
 
13
+ import type {ViewStyleProp} from '../StyleSheet/StyleSheet';
14
+ import type {InspectedElementFrame} from './Inspector';
15
+
16
+ import React from 'react';
17
+
13
18
  const View = require('../Components/View/View');
14
19
  const flattenStyle = require('../StyleSheet/flattenStyle');
15
20
  const StyleSheet = require('../StyleSheet/StyleSheet');
16
21
  const Dimensions = require('../Utilities/Dimensions').default;
17
22
  const BorderBox = require('./BorderBox');
18
23
  const resolveBoxStyle = require('./resolveBoxStyle');
19
- const React = require('react');
20
-
21
- class ElementBox extends React.Component<$FlowFixMeProps> {
22
- render(): React.Node {
23
- const style = flattenStyle(this.props.style) || {};
24
- let margin: ?$ReadOnly<Style> = resolveBoxStyle('margin', style);
25
- let padding: ?$ReadOnly<Style> = resolveBoxStyle('padding', style);
26
-
27
- const frameStyle = {...this.props.frame};
28
- const contentStyle: {width: number, height: number} = {
29
- width: this.props.frame.width,
30
- height: this.props.frame.height,
31
- };
32
-
33
- if (margin != null) {
34
- margin = resolveRelativeSizes(margin);
35
-
36
- frameStyle.top -= margin.top;
37
- frameStyle.left -= margin.left;
38
- frameStyle.height += margin.top + margin.bottom;
39
- frameStyle.width += margin.left + margin.right;
40
-
41
- if (margin.top < 0) {
42
- contentStyle.height += margin.top;
43
- }
44
- if (margin.bottom < 0) {
45
- contentStyle.height += margin.bottom;
46
- }
47
- if (margin.left < 0) {
48
- contentStyle.width += margin.left;
49
- }
50
- if (margin.right < 0) {
51
- contentStyle.width += margin.right;
52
- }
53
- }
54
24
 
55
- if (padding != null) {
56
- padding = resolveRelativeSizes(padding);
25
+ type Props = $ReadOnly<{
26
+ frame: InspectedElementFrame,
27
+ style?: ?ViewStyleProp,
28
+ }>;
29
+
30
+ function ElementBox({frame, style}: Props): React.Node {
31
+ const flattenedStyle = flattenStyle(style) || {};
32
+ let margin: ?$ReadOnly<Style> = resolveBoxStyle('margin', flattenedStyle);
33
+ let padding: ?$ReadOnly<Style> = resolveBoxStyle('padding', flattenedStyle);
57
34
 
58
- contentStyle.width -= padding.left + padding.right;
59
- contentStyle.height -= padding.top + padding.bottom;
35
+ const frameStyle = {...frame};
36
+ const contentStyle: {width: number, height: number} = {
37
+ width: frame.width,
38
+ height: frame.height,
39
+ };
40
+
41
+ if (margin != null) {
42
+ margin = resolveRelativeSizes(margin);
43
+
44
+ frameStyle.top -= margin.top;
45
+ frameStyle.left -= margin.left;
46
+ frameStyle.height += margin.top + margin.bottom;
47
+ frameStyle.width += margin.left + margin.right;
48
+
49
+ if (margin.top < 0) {
50
+ contentStyle.height += margin.top;
51
+ }
52
+ if (margin.bottom < 0) {
53
+ contentStyle.height += margin.bottom;
60
54
  }
55
+ if (margin.left < 0) {
56
+ contentStyle.width += margin.left;
57
+ }
58
+ if (margin.right < 0) {
59
+ contentStyle.width += margin.right;
60
+ }
61
+ }
61
62
 
62
- return (
63
- <View style={[styles.frame, frameStyle]} pointerEvents="none">
64
- <BorderBox box={margin} style={styles.margin}>
65
- <BorderBox box={padding} style={styles.padding}>
66
- <View style={[styles.content, contentStyle]} />
67
- </BorderBox>
68
- </BorderBox>
69
- </View>
70
- );
63
+ if (padding != null) {
64
+ padding = resolveRelativeSizes(padding);
65
+
66
+ contentStyle.width -= padding.left + padding.right;
67
+ contentStyle.height -= padding.top + padding.bottom;
71
68
  }
69
+
70
+ return (
71
+ <View style={[styles.frame, frameStyle]} pointerEvents="none">
72
+ <BorderBox box={margin} style={styles.margin}>
73
+ <BorderBox box={padding} style={styles.padding}>
74
+ <View style={[styles.content, contentStyle]} />
75
+ </BorderBox>
76
+ </BorderBox>
77
+ </View>
78
+ );
72
79
  }
73
80
 
74
81
  const styles = StyleSheet.create({
@@ -10,42 +10,48 @@
10
10
 
11
11
  'use strict';
12
12
 
13
+ import type {ViewStyleProp} from '../StyleSheet/StyleSheet';
14
+ import type {____FlattenStyleProp_Internal} from '../StyleSheet/StyleSheetTypes';
15
+
16
+ import React from 'react';
17
+
13
18
  const View = require('../Components/View/View');
14
19
  const StyleSheet = require('../StyleSheet/StyleSheet');
15
20
  const Text = require('../Text/Text');
16
- const React = require('react');
17
21
 
18
- class StyleInspector extends React.Component<$FlowFixMeProps> {
19
- render(): React.Node {
20
- if (!this.props.style) {
21
- return <Text style={styles.noStyle}>No style</Text>;
22
- }
23
- const names = Object.keys(this.props.style);
24
- return (
25
- <View style={styles.container}>
26
- <View>
27
- {names.map(name => (
28
- <Text key={name} style={styles.attr}>
29
- {name}:
30
- </Text>
31
- ))}
32
- </View>
22
+ type Props = $ReadOnly<{
23
+ style?: ?____FlattenStyleProp_Internal<ViewStyleProp>,
24
+ }>;
33
25
 
34
- <View>
35
- {names.map(name => {
36
- const value = this.props.style[name];
37
- return (
38
- <Text key={name} style={styles.value}>
39
- {typeof value !== 'string' && typeof value !== 'number'
40
- ? JSON.stringify(value)
41
- : value}
42
- </Text>
43
- );
44
- })}
45
- </View>
46
- </View>
47
- );
26
+ function StyleInspector({style}: Props): React.Node {
27
+ if (!style) {
28
+ return <Text style={styles.noStyle}>No style</Text>;
48
29
  }
30
+ const names = Object.keys(style);
31
+ return (
32
+ <View style={styles.container}>
33
+ <View>
34
+ {names.map(name => (
35
+ <Text key={name} style={styles.attr}>
36
+ {name}:
37
+ </Text>
38
+ ))}
39
+ </View>
40
+
41
+ <View>
42
+ {names.map(name => {
43
+ const value = style?.[name];
44
+ return (
45
+ <Text key={name} style={styles.value}>
46
+ {typeof value !== 'string' && typeof value !== 'number'
47
+ ? JSON.stringify(value)
48
+ : value}
49
+ </Text>
50
+ );
51
+ })}
52
+ </View>
53
+ </View>
54
+ );
49
55
  }
50
56
 
51
57
  const styles = StyleSheet.create({
@@ -121,7 +121,7 @@ const Presets = {
121
121
  'opacity',
122
122
  ): LayoutAnimationConfig),
123
123
  linear: (create(500, 'linear', 'opacity'): LayoutAnimationConfig),
124
- spring: {
124
+ spring: ({
125
125
  duration: 700,
126
126
  create: {
127
127
  type: 'linear',
@@ -135,7 +135,7 @@ const Presets = {
135
135
  type: 'linear',
136
136
  property: 'opacity',
137
137
  },
138
- },
138
+ }: LayoutAnimationConfig),
139
139
  };
140
140
 
141
141
  /**
@@ -222,7 +222,7 @@ export abstract class FlatListComponent<
222
222
  /**
223
223
  * Provides a handle to the underlying scroll responder.
224
224
  */
225
- getScrollResponder: () => JSX.Element | null | undefined;
225
+ getScrollResponder: () => React.JSX.Element | null | undefined;
226
226
 
227
227
  /**
228
228
  * Provides a reference to the underlying host component
@@ -328,6 +328,7 @@ class Modal extends React.Component<Props, State> {
328
328
  <VirtualizedListContextResetter>
329
329
  <ScrollView.Context.Provider value={null}>
330
330
  <View
331
+ // $FlowFixMe[incompatible-type]
331
332
  style={[styles.container, containerStyles]}
332
333
  collapsable={false}>
333
334
  {innerChildren}
@@ -353,6 +354,7 @@ const styles = StyleSheet.create({
353
354
  /* $FlowFixMe[invalid-computed-prop] (>=0.111.0 site=react_native_fb) This
354
355
  * comment suppresses an error found when Flow v0.111 was deployed. To see
355
356
  * the error, delete this comment and run Flow. */
357
+ // $FlowFixMe[incompatible-call]
356
358
  [side]: 0,
357
359
  top: 0,
358
360
  flex: 1,
@@ -330,6 +330,7 @@ class Modal extends React.Component<Props, State> {
330
330
  <VirtualizedListContextResetter>
331
331
  <ScrollView.Context.Provider value={null}>
332
332
  <View
333
+ // $FlowFixMe[incompatible-type]
333
334
  style={[styles.container, containerStyles]}
334
335
  collapsable={false}>
335
336
  {innerChildren}
@@ -355,6 +356,7 @@ const styles = StyleSheet.create({
355
356
  /* $FlowFixMe[invalid-computed-prop] (>=0.111.0 site=react_native_fb) This
356
357
  * comment suppresses an error found when Flow v0.111 was deployed. To see
357
358
  * the error, delete this comment and run Flow. */
359
+ // $FlowFixMe[incompatible-call]
358
360
  [side]: 0,
359
361
  top: 0,
360
362
  flex: 1,
@@ -293,8 +293,6 @@ const validAttributesForNonEventProps = {
293
293
 
294
294
  style: ReactNativeStyleAttributes,
295
295
 
296
- experimental_layoutConformance: true,
297
-
298
296
  // ReactClippingViewManager @ReactProps
299
297
  removeClippedSubviews: true,
300
298
 
@@ -357,8 +357,6 @@ const validAttributesForNonEventProps = {
357
357
  direction: true,
358
358
 
359
359
  style: ReactNativeStyleAttributes,
360
-
361
- experimental_layoutConformance: true,
362
360
  };
363
361
 
364
362
  // Props for bubbling and direct events
@@ -381,8 +381,6 @@ const validAttributesForNonEventProps = {
381
381
  enableFocusRing: true, // [Windows]
382
382
 
383
383
  style: ReactNativeStyleAttributes,
384
-
385
- experimental_layoutConformance: true,
386
384
  };
387
385
 
388
386
  // Props for bubbling and direct events