@office-iss/react-native-win32 0.79.1 → 0.80.0

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 (294) hide show
  1. package/.flowconfig +10 -3
  2. package/CHANGELOG.json +117 -24
  3. package/CHANGELOG.md +49 -14
  4. package/IntegrationTests/ImageCachePolicyTest.js +1 -1
  5. package/IntegrationTests/LayoutEventsTest.js +1 -4
  6. package/Libraries/Alert/Alert.d.ts +4 -1
  7. package/Libraries/Alert/Alert.js +3 -0
  8. package/Libraries/Alert/RCTAlertManager.js +17 -0
  9. package/Libraries/Animated/Animated.js.flow +1 -3
  10. package/Libraries/Animated/AnimatedEvent.js +4 -3
  11. package/Libraries/Animated/AnimatedExports.js +2 -2
  12. package/Libraries/Animated/AnimatedExports.js.flow +140 -0
  13. package/Libraries/Animated/AnimatedImplementation.js +2 -123
  14. package/Libraries/Animated/Easing.js +13 -15
  15. package/Libraries/Animated/animations/Animation.js +8 -4
  16. package/Libraries/Animated/components/AnimatedFlatList.js +7 -6
  17. package/Libraries/Animated/components/AnimatedScrollView.js +48 -42
  18. package/Libraries/Animated/components/AnimatedSectionList.js +11 -7
  19. package/Libraries/Animated/createAnimatedComponent.js +105 -57
  20. package/Libraries/Animated/nodes/AnimatedNode.js +4 -3
  21. package/Libraries/Animated/nodes/AnimatedProps.js +46 -26
  22. package/Libraries/Animated/nodes/AnimatedValue.js +16 -7
  23. package/Libraries/Animated/nodes/AnimatedValueXY.js +3 -1
  24. package/Libraries/AppState/AppState.js +7 -2
  25. package/Libraries/BatchedBridge/MessageQueue.js +2 -2
  26. package/Libraries/BatchedBridge/NativeModules.js +2 -0
  27. package/Libraries/Blob/BlobManager.js +1 -0
  28. package/Libraries/Blob/FileReader.js +219 -8
  29. package/Libraries/Blob/URL.js +37 -12
  30. package/Libraries/Blob/URLSearchParams.js +106 -31
  31. package/Libraries/Blob/URLSearchParams.js.flow +12 -7
  32. package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js +1 -1
  33. package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.win32.js +1 -1
  34. package/Libraries/Components/AccessibilityInfo/legacySendAccessibilityEvent.js +17 -0
  35. package/Libraries/Components/ActivityIndicator/ActivityIndicator.js +1 -0
  36. package/Libraries/Components/Button.js +1 -1
  37. package/Libraries/Components/Button.win32.js +1 -1
  38. package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js +1 -3
  39. package/Libraries/{NewAppScreen/components/Colors.js → Components/DrawerAndroid/DrawerLayoutAndroid.ios.js} +6 -10
  40. package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.js +6 -66
  41. package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.js.flow +18 -0
  42. package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroidFallback.js +71 -0
  43. package/Libraries/Components/Keyboard/Keyboard.js +5 -3
  44. package/Libraries/Components/Keyboard/KeyboardAvoidingView.js +6 -3
  45. package/Libraries/Components/Pressable/Pressable.js +20 -4
  46. package/Libraries/Components/Pressable/Pressable.win32.js +20 -4
  47. package/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.js +25 -3
  48. package/Libraries/Components/ProgressBarAndroid/ProgressBarAndroidTypes.js +29 -20
  49. package/Libraries/Components/RefreshControl/RefreshControl.js +1 -1
  50. package/Libraries/Components/ScrollView/ScrollView.d.ts +3 -3
  51. package/Libraries/Components/ScrollView/ScrollView.js +132 -122
  52. package/Libraries/Components/StaticRenderer.js +1 -1
  53. package/Libraries/Components/Switch/Switch.d.ts +3 -0
  54. package/Libraries/Components/Switch/Switch.js +8 -4
  55. package/Libraries/Components/TextInput/AndroidTextInputNativeComponent.js +2 -1
  56. package/Libraries/Components/TextInput/RCTTextInputViewConfig.js +2 -4
  57. package/Libraries/Components/TextInput/Tests/TextInputTest.d.ts +2 -1
  58. package/Libraries/Components/TextInput/Tests/TextInputTest.js.map +1 -1
  59. package/Libraries/Components/TextInput/TextInput.d.ts +70 -33
  60. package/Libraries/Components/TextInput/TextInput.flow.js +100 -51
  61. package/Libraries/Components/TextInput/TextInput.flow.win32.js +1208 -0
  62. package/Libraries/Components/TextInput/TextInput.js +88 -1027
  63. package/Libraries/Components/TextInput/TextInput.win32.js +89 -1059
  64. package/Libraries/Components/TextInput/TextInputState.js +1 -1
  65. package/Libraries/Components/TextInput/TextInputState.win32.js +1 -1
  66. package/Libraries/{Modal/ModalInjection.js → Components/ToastAndroid/ToastAndroid.ios.js} +3 -5
  67. package/Libraries/Components/ToastAndroid/ToastAndroid.js +4 -32
  68. package/Libraries/Components/ToastAndroid/ToastAndroid.js.flow +109 -0
  69. package/Libraries/Components/ToastAndroid/ToastAndroid.win32.js +4 -32
  70. package/Libraries/Components/ToastAndroid/ToastAndroidFallback.js +45 -0
  71. package/Libraries/Components/Touchable/Tests/TouchableWin32Test.d.ts +2 -1
  72. package/Libraries/Components/Touchable/Tests/TouchableWin32Test.js.map +1 -1
  73. package/Libraries/Components/Touchable/Touchable.js +5 -5
  74. package/Libraries/Components/Touchable/Touchable.win32.js +5 -5
  75. package/Libraries/Components/Touchable/TouchableBounce.js +14 -7
  76. package/Libraries/Components/Touchable/TouchableHighlight.js +10 -7
  77. package/Libraries/Components/Touchable/TouchableNativeFeedback.js +6 -6
  78. package/Libraries/Components/Touchable/TouchableNativeFeedback.win32.js +6 -6
  79. package/Libraries/Components/Touchable/TouchableOpacity.js +13 -6
  80. package/Libraries/Components/View/View.js +18 -21
  81. package/Libraries/Components/View/View.win32.js +21 -24
  82. package/Libraries/Components/View/ViewAccessibility.js +25 -1
  83. package/Libraries/Components/View/ViewAccessibility.win32.js +9 -1
  84. package/Libraries/Components/View/ViewPropTypes.js +49 -3
  85. package/Libraries/Components/View/ViewPropTypes.win32.js +49 -3
  86. package/Libraries/Core/ReactNativeVersion.js +1 -1
  87. package/Libraries/Core/setUpReactDevTools.js +5 -5
  88. package/Libraries/Debugging/DebuggingOverlayRegistry.js +3 -3
  89. package/Libraries/EventEmitter/NativeEventEmitter.js +9 -4
  90. package/Libraries/Image/AssetSourceResolver.js +17 -4
  91. package/Libraries/Image/Image.d.ts +26 -10
  92. package/Libraries/Image/Image.js +17 -0
  93. package/Libraries/Image/Image.js.flow +5 -5
  94. package/Libraries/Image/ImageBackground.js +2 -0
  95. package/Libraries/Image/ImageInjection.js +1 -1
  96. package/Libraries/Image/ImageProps.js +22 -17
  97. package/Libraries/Image/ImageSource.js +3 -1
  98. package/Libraries/Image/ImageSourceUtils.js +4 -2
  99. package/Libraries/Image/ImageTypes.flow.js +1 -1
  100. package/Libraries/Image/Tests/ImageWin32Test.d.ts +2 -1
  101. package/Libraries/Image/Tests/ImageWin32Test.js.map +1 -1
  102. package/Libraries/Interaction/InteractionManager.d.ts +13 -0
  103. package/Libraries/Interaction/InteractionManager.js +1 -1
  104. package/Libraries/Interaction/PanResponder.js +3 -3
  105. package/Libraries/Interaction/TaskQueue.js +1 -0
  106. package/Libraries/LayoutAnimation/LayoutAnimation.js +2 -2
  107. package/Libraries/Linking/Linking.js +1 -1
  108. package/Libraries/Lists/FlatList.d.ts +2 -2
  109. package/Libraries/Lists/FlatList.js +8 -11
  110. package/Libraries/Lists/SectionList.js +39 -42
  111. package/Libraries/Lists/SectionListModern.js +25 -34
  112. package/Libraries/Lists/VirtualizedList.js +1 -0
  113. package/Libraries/Lists/VirtualizedSectionList.js +1 -0
  114. package/Libraries/LogBox/Data/LogBoxData.js +1 -1
  115. package/Libraries/LogBox/LogBoxNotificationContainer.js +1 -1
  116. package/Libraries/LogBox/UI/LogBoxInspectorSourceMapStatus.win32.js +140 -0
  117. package/Libraries/Modal/Modal.js +33 -7
  118. package/Libraries/NativeComponent/BaseViewConfig.android.js +2 -0
  119. package/Libraries/NativeComponent/BaseViewConfig.ios.js +2 -0
  120. package/Libraries/NativeComponent/BaseViewConfig.js +17 -0
  121. package/Libraries/NativeComponent/BaseViewConfig.win32.js +1 -0
  122. package/Libraries/NativeComponent/PlatformBaseViewConfig.js +2 -2
  123. package/Libraries/NativeModules/specs/NativeDevMenu.js +2 -2
  124. package/Libraries/Network/RCTNetworking.android.js +1 -1
  125. package/Libraries/Network/RCTNetworking.ios.js +1 -1
  126. package/Libraries/Network/RCTNetworking.js +17 -0
  127. package/Libraries/Network/RCTNetworking.js.flow +1 -1
  128. package/Libraries/Network/RCTNetworking.win32.js +1 -1
  129. package/Libraries/Network/XMLHttpRequest.js +781 -10
  130. package/Libraries/Performance/Systrace.js +7 -7
  131. package/Libraries/Pressability/Pressability.js +1 -1
  132. package/Libraries/Pressability/Pressability.win32.js +1 -1
  133. package/Libraries/ReactNative/AppContainer-dev.js +5 -4
  134. package/Libraries/ReactNative/AppRegistry.flow.js +49 -0
  135. package/Libraries/ReactNative/AppRegistry.js +2 -322
  136. package/Libraries/ReactNative/AppRegistry.js.flow +23 -0
  137. package/Libraries/ReactNative/AppRegistryImpl.js +316 -0
  138. package/Libraries/ReactNative/FabricUIManager.js +10 -0
  139. package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricHostComponent.js +2 -4
  140. package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstance.js +1 -4
  141. package/Libraries/ReactNative/RendererImplementation.js +10 -5
  142. package/Libraries/ReactNative/getNativeComponentAttributes.js +1 -0
  143. package/Libraries/ReactNative/renderApplication.js +9 -0
  144. package/Libraries/ReactPrivate/ReactNativePrivateInterface.js +3 -3
  145. package/Libraries/ReactPrivate/ReactNativePrivateInterface.js.flow +51 -0
  146. package/Libraries/Renderer/implementations/ReactFabric-dev.js +4840 -4748
  147. package/Libraries/Renderer/implementations/ReactFabric-prod.js +4947 -4829
  148. package/Libraries/Renderer/implementations/ReactFabric-profiling.js +3998 -3888
  149. package/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js +5005 -4948
  150. package/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js +2744 -2652
  151. package/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.js +5020 -4933
  152. package/Libraries/Renderer/shims/ReactNativeTypes.js +3 -3
  153. package/Libraries/Settings/Settings.ios.js +1 -0
  154. package/Libraries/Settings/Settings.js +13 -19
  155. package/Libraries/Settings/Settings.win32.js +19 -20
  156. package/Libraries/Settings/SettingsFallback.js +33 -0
  157. package/Libraries/StyleSheet/PlatformColorValueTypes.js +15 -0
  158. package/Libraries/StyleSheet/PlatformColorValueTypesIOS.js +6 -0
  159. package/Libraries/StyleSheet/Rect.js +1 -0
  160. package/Libraries/StyleSheet/StyleSheet.js +31 -200
  161. package/Libraries/StyleSheet/StyleSheet.js.flow +188 -0
  162. package/Libraries/StyleSheet/{StyleSheet.win32.js → StyleSheetExports.js} +2 -151
  163. package/Libraries/StyleSheet/StyleSheetExports.js.flow +112 -0
  164. package/Libraries/StyleSheet/StyleSheetTypes.d.ts +1 -1
  165. package/Libraries/StyleSheet/StyleSheetTypes.js +130 -52
  166. package/Libraries/StyleSheet/flattenStyle.js +14 -4
  167. package/Libraries/StyleSheet/private/_TransformStyle.js +49 -21
  168. package/Libraries/StyleSheet/processBackgroundImage.js +670 -214
  169. package/Libraries/Text/Text.d.ts +2 -5
  170. package/Libraries/Text/Text.js +3 -3
  171. package/Libraries/Text/Text.win32.js +3 -3
  172. package/Libraries/Text/TextNativeComponent.js +0 -4
  173. package/Libraries/Text/TextNativeComponent.win32.js +0 -4
  174. package/Libraries/Text/TextProps.js +5 -33
  175. package/Libraries/Text/TextProps.win32.js +5 -30
  176. package/Libraries/Types/CodegenTypesNamespace.d.ts +45 -0
  177. package/Libraries/{Blob/__mocks__/BlobModule.js → Types/CodegenTypesNamespace.js} +4 -6
  178. package/Libraries/Types/CoreEventTypes.d.ts +6 -1
  179. package/Libraries/Types/CoreEventTypes.js +1 -1
  180. package/Libraries/Types/CoreEventTypes.win32.js +1 -1
  181. package/Libraries/Utilities/Appearance.js +2 -0
  182. package/Libraries/Utilities/BackHandler.js +17 -0
  183. package/Libraries/Utilities/DeviceInfo.js +2 -0
  184. package/Libraries/Utilities/Dimensions.js +1 -1
  185. package/Libraries/Utilities/Dimensions.win32.js +1 -1
  186. package/Libraries/Utilities/Platform.js +17 -0
  187. package/Libraries/Utilities/PlatformTypes.js +11 -3
  188. package/Libraries/Utilities/ReactNativeTestTools.js +2 -2
  189. package/Libraries/Utilities/codegenNativeCommands.d.ts +18 -0
  190. package/Libraries/Utilities/codegenNativeComponent.d.ts +26 -0
  191. package/Libraries/WebSocket/WebSocket.js +313 -8
  192. package/Libraries/vendor/core/ErrorUtils.js +28 -2
  193. package/Libraries/vendor/emitter/EventEmitter.js +6 -2
  194. package/flow/global.js +1 -0
  195. package/index.js +51 -331
  196. package/index.win32.js +71 -352
  197. package/interface.js +0 -4
  198. package/jest/resolver.js +31 -0
  199. package/overrides.json +45 -47
  200. package/package.json +25 -25
  201. package/src/private/animated/NativeAnimatedHelper.js +21 -8
  202. package/src/private/animated/NativeAnimatedHelper.win32.js +21 -8
  203. package/src/private/animated/createAnimatedPropsHook.js +11 -16
  204. package/src/private/animated/createAnimatedPropsMemoHook.js +1 -2
  205. package/src/private/components/{SafeAreaView_INTERNAL_DO_NOT_USE.js → safeareaview/SafeAreaView_INTERNAL_DO_NOT_USE.js} +6 -6
  206. package/src/private/components/{HScrollViewNativeComponents.js → scrollview/HScrollViewNativeComponents.js} +8 -8
  207. package/src/private/components/scrollview/VScrollViewNativeComponents.js +25 -0
  208. package/src/private/{devmenu → devsupport/devmenu}/DevMenu.js +1 -1
  209. package/src/private/{inspector → devsupport/devmenu/elementinspector}/BorderBox.js +3 -3
  210. package/src/private/{inspector → devsupport/devmenu/elementinspector}/BoxInspector.js +6 -5
  211. package/src/private/{inspector → devsupport/devmenu/elementinspector}/ElementBox.js +8 -6
  212. package/src/private/{inspector → devsupport/devmenu/elementinspector}/ElementProperties.js +11 -10
  213. package/src/private/{inspector → devsupport/devmenu/elementinspector}/Inspector.js +14 -12
  214. package/src/private/{inspector → devsupport/devmenu/elementinspector}/InspectorOverlay.js +5 -4
  215. package/src/private/{inspector → devsupport/devmenu/elementinspector}/InspectorPanel.js +9 -8
  216. package/src/private/{inspector → devsupport/devmenu/elementinspector}/NetworkOverlay.js +10 -9
  217. package/src/private/{inspector → devsupport/devmenu/elementinspector}/ReactDevToolsOverlay.js +7 -7
  218. package/src/private/{inspector → devsupport/devmenu/elementinspector}/StyleInspector.js +7 -6
  219. package/src/private/{inspector → devsupport/devmenu/elementinspector}/XHRInterceptor.js +2 -2
  220. package/src/private/{inspector → devsupport/devmenu/elementinspector}/getInspectorDataForViewAtPoint.js +4 -4
  221. package/src/private/{inspector → devsupport/devmenu/elementinspector}/resolveBoxStyle.js +1 -1
  222. package/src/private/{inspector → devsupport/devmenu/perfmonitor}/PerformanceOverlay.js +6 -5
  223. package/src/private/{specs_DEPRECATED/modules → devsupport/devmenu/specs}/NativeDevMenu.js +2 -2
  224. package/src/private/{debugging → devsupport/rndevtools}/ReactDevToolsSettingsManager.android.js +1 -1
  225. package/src/private/{debugging → devsupport/rndevtools}/ReactDevToolsSettingsManager.ios.js +1 -1
  226. package/src/private/{debugging → devsupport/rndevtools}/ReactDevToolsSettingsManager.win32.js +1 -1
  227. package/src/private/{debugging → devsupport/rndevtools}/setUpFuseboxReactDevToolsDispatcher.js +1 -1
  228. package/src/private/{fusebox → devsupport/rndevtools}/specs/NativeReactDevToolsRuntimeSettingsModule.js +2 -2
  229. package/src/private/{specs_DEPRECATED/modules → devsupport/rndevtools/specs}/NativeReactDevToolsSettingsManager.js +2 -2
  230. package/src/private/featureflags/ReactNativeFeatureFlags.js +82 -80
  231. package/src/private/featureflags/ReactNativeFeatureFlagsBase.js +9 -1
  232. package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +17 -13
  233. package/src/private/renderer/errorhandling/ErrorHandlers.js +2 -2
  234. package/src/private/specs_DEPRECATED/modules/NativeAnimatedModule.js +1 -1
  235. package/src/private/specs_DEPRECATED/modules/NativeAnimatedTurboModule.js +1 -1
  236. package/src/private/specs_DEPRECATED/modules/NativeSampleTurboModule.js +3 -0
  237. package/src/private/styles/composeStyles.js +12 -5
  238. package/src/private/types/HostComponent.js +1 -1
  239. package/src/private/types/HostInstance.js +67 -1
  240. package/src/private/webapis/dom/nodes/ReactNativeElement.js +2 -5
  241. package/src/private/webapis/dom/nodes/ReadOnlyNode.js +5 -18
  242. package/src/private/webapis/dom/nodes/internals/NodeInternals.js +6 -0
  243. package/src/private/webapis/performance/Performance.js +1 -3
  244. package/src/private/webapis/performance/PerformanceEntry.js +6 -1
  245. package/src/private/webapis/performance/internals/RawPerformanceEntry.js +3 -0
  246. package/src/private/webapis/performance/specs/NativePerformance.js +10 -1
  247. package/src/types/globals.d.ts +42 -0
  248. package/src-win/Libraries/Components/TextInput/Tests/TextInputTest.tsx +7 -7
  249. package/src-win/Libraries/Components/Touchable/Tests/TouchableWin32Test.tsx +3 -3
  250. package/src-win/Libraries/Image/Tests/ImageWin32Test.tsx +1 -1
  251. package/src-win/Libraries/Text/Text.d.ts +2 -5
  252. package/types/index.d.ts +6 -3
  253. package/types/public/ReactNativeTypes.d.ts +2 -2
  254. package/Libraries/BatchedBridge/__mocks__/MessageQueueTestConfig.js +0 -38
  255. package/Libraries/BatchedBridge/__mocks__/MessageQueueTestModule.js +0 -22
  256. package/Libraries/Blob/FileReader_new.js +0 -231
  257. package/Libraries/Blob/FileReader_old.js +0 -186
  258. package/Libraries/Blob/__mocks__/FileReaderModule.js +0 -20
  259. package/Libraries/Components/RefreshControl/__mocks__/RefreshControlMock.js +0 -32
  260. package/Libraries/Core/__mocks__/ErrorUtils.js +0 -33
  261. package/Libraries/Core/__mocks__/NativeExceptionsManager.js +0 -19
  262. package/Libraries/EventEmitter/__mocks__/NativeEventEmitter.js +0 -49
  263. package/Libraries/Events/CustomEvent.js +0 -32
  264. package/Libraries/Events/EventPolyfill.js +0 -239
  265. package/Libraries/Lists/__flowtests__/FlatList-flowtest.js +0 -118
  266. package/Libraries/Lists/__flowtests__/SectionList-flowtest.js +0 -134
  267. package/Libraries/Network/XMLHttpRequest_new.js +0 -794
  268. package/Libraries/Network/XMLHttpRequest_old.js +0 -701
  269. package/Libraries/NewAppScreen/components/DebugInstructions.js +0 -41
  270. package/Libraries/NewAppScreen/components/Header.js +0 -77
  271. package/Libraries/NewAppScreen/components/HermesBadge.js +0 -53
  272. package/Libraries/NewAppScreen/components/LearnMoreLinks.js +0 -148
  273. package/Libraries/NewAppScreen/components/ReloadInstructions.js +0 -39
  274. package/Libraries/NewAppScreen/components/logo.png +0 -0
  275. package/Libraries/NewAppScreen/index.js +0 -25
  276. package/Libraries/StyleSheet/__flowtests__/StyleSheet-flowtest.js +0 -58
  277. package/Libraries/Utilities/DeviceInfo.win32.js +0 -19
  278. package/Libraries/Utilities/__mocks__/BackHandler.js +0 -45
  279. package/Libraries/Utilities/__mocks__/GlobalPerformanceLogger.js +0 -16
  280. package/Libraries/Utilities/__mocks__/PixelRatio.js +0 -25
  281. package/Libraries/WebSocket/WebSocketEvent.js +0 -30
  282. package/Libraries/WebSocket/WebSocket_new.js +0 -325
  283. package/Libraries/WebSocket/WebSocket_old.js +0 -297
  284. package/Libraries/WebSocket/__mocks__/event-target-shim.js +0 -27
  285. package/Libraries/__flowtests__/ReactNativeTypes-flowtest.js +0 -30
  286. package/Libraries/vendor/emitter/__flowtests__/EventEmitter-flowtest.js +0 -81
  287. package/flow/jest.js +0 -1287
  288. package/jest/__tests__/setup-test.js +0 -18
  289. package/src/private/components/VScrollViewNativeComponents.js +0 -25
  290. package/src/private/utilities/ensureInstance.js +0 -21
  291. package/src/private/webapis/performance/specs/__mocks__/NativePerformanceMock.js +0 -267
  292. package/types/modules/LaunchScreen.d.ts +0 -18
  293. /package/src/private/{devmenu → devsupport/devmenu}/DevMenu.d.ts +0 -0
  294. /package/src/private/{debugging → devsupport/rndevtools}/FuseboxSessionObserver.js +0 -0
@@ -7,7 +7,7 @@
7
7
  * @noformat
8
8
  * @nolint
9
9
  * @flow strict
10
- * @generated SignedSource<<5c76b092e0c981f96ca894e381ee593b>>
10
+ * @generated SignedSource<<2264e9839602043a41f1e13913b43b0f>>
11
11
  */
12
12
 
13
13
  import type {
@@ -84,8 +84,8 @@ export type ViewConfig = $ReadOnly<{
84
84
  }>;
85
85
 
86
86
  export type PartialViewConfig = $ReadOnly<{
87
- bubblingEventTypes?: $PropertyType<ViewConfig, 'bubblingEventTypes'>,
88
- directEventTypes?: $PropertyType<ViewConfig, 'directEventTypes'>,
87
+ bubblingEventTypes?: ViewConfig['bubblingEventTypes'],
88
+ directEventTypes?: ViewConfig['directEventTypes'],
89
89
  supportsRawText?: boolean,
90
90
  uiViewClassName: string,
91
91
  validAttributes?: PartialAttributeConfiguration,
@@ -29,6 +29,7 @@ const Settings = {
29
29
 
30
30
  set(settings: Object) {
31
31
  // $FlowFixMe[object-this-reference]
32
+ // $FlowFixMe[unsafe-object-assign]
32
33
  this._settings = Object.assign(this._settings, settings);
33
34
  NativeSettingsManager.setValues(settings);
34
35
  },
@@ -8,26 +8,20 @@
8
8
  * @flow
9
9
  */
10
10
 
11
- 'use strict';
11
+ import Platform from '../Utilities/Platform';
12
12
 
13
- const Settings = {
14
- get(key: string): any {
15
- console.warn('Settings is not yet supported on this platform.');
16
- return null;
17
- },
18
-
19
- set(settings: Object) {
20
- console.warn('Settings is not yet supported on this platform.');
21
- },
22
-
23
- watchKeys(keys: string | Array<string>, callback: () => void): number {
24
- console.warn('Settings is not yet supported on this platform.');
25
- return -1;
26
- },
27
-
28
- clearWatch(watchId: number) {
29
- console.warn('Settings is not yet supported on this platform.');
30
- },
13
+ let Settings: {
14
+ get(key: string): any,
15
+ set(settings: Object): void,
16
+ watchKeys(keys: string | Array<string>, callback: () => void): number,
17
+ clearWatch(watchId: number): void,
18
+ ...
31
19
  };
32
20
 
21
+ if (Platform.OS === 'ios') {
22
+ Settings = require('./Settings').default;
23
+ } else {
24
+ Settings = require('./SettingsFallback').default;
25
+ }
26
+
33
27
  export default Settings;
@@ -1,28 +1,27 @@
1
1
  /**
2
- * Copyright (c) Microsoft Corporation.
3
- * Licensed under the MIT License.
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
4
8
  * @format
5
9
  */
6
- 'use strict';
7
10
 
8
- var Settings = {
9
- get(key: string): any {
10
- console.warn('Settings is not yet supported on Win32');
11
- return null;
12
- },
11
+ import Platform from '../Utilities/Platform';
13
12
 
14
- set(settings: Object) {
15
- console.warn('Settings is not yet supported on Win32');
16
- },
17
-
18
- watchKeys(keys: string | Array<string>, callback: () => void): number {
19
- console.warn('Settings is not yet supported on Win32');
20
- return -1;
21
- },
22
-
23
- clearWatch(watchId: number) {
24
- console.warn('Settings is not yet supported on Win32');
25
- },
13
+ let Settings: {
14
+ get(key: string): any,
15
+ set(settings: Object): void,
16
+ watchKeys(keys: string | Array<string>, callback: () => void): number,
17
+ clearWatch(watchId: number): void,
18
+ ...
26
19
  };
27
20
 
21
+ if (Platform.OS === 'ios') {
22
+ Settings = require('./Settings').default;
23
+ } else {
24
+ Settings = require('./SettingsFallback').default;
25
+ }
26
+
28
27
  export default Settings;
@@ -0,0 +1,33 @@
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
+ * @format
8
+ * @flow
9
+ */
10
+
11
+ 'use strict';
12
+
13
+ const Settings = {
14
+ get(key: string): any {
15
+ console.warn('Settings is not yet supported on this platform.');
16
+ return null;
17
+ },
18
+
19
+ set(settings: Object) {
20
+ console.warn('Settings is not yet supported on this platform.');
21
+ },
22
+
23
+ watchKeys(keys: string | Array<string>, callback: () => void): number {
24
+ console.warn('Settings is not yet supported on this platform.');
25
+ return -1;
26
+ },
27
+
28
+ clearWatch(watchId: number) {
29
+ console.warn('Settings is not yet supported on this platform.');
30
+ },
31
+ };
32
+
33
+ export default Settings;
@@ -0,0 +1,15 @@
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
+ // NOTE: This file supports backwards compatibility of subpath (deep) imports
12
+ // from 'react-native' with platform-specific extensions. It can be deleted
13
+ // once we remove the "./*" mapping from package.json "exports".
14
+
15
+ export * from './PlatformColorValueTypes';
@@ -17,6 +17,12 @@ export type DynamicColorIOSTuple = {
17
17
  highContrastDark?: ColorValue,
18
18
  };
19
19
 
20
+ /**
21
+ * Specify color to display depending on the current system appearance settings
22
+ *
23
+ * @param tuple Colors you want to use for "light mode" and "dark mode"
24
+ * @platform ios
25
+ */
20
26
  export const DynamicColorIOS = (tuple: DynamicColorIOSTuple): ColorValue => {
21
27
  throw new Error('DynamicColorIOS is not available on this platform.');
22
28
  };
@@ -15,6 +15,7 @@ export type Rect = $ReadOnly<{
15
15
  top?: ?number,
16
16
  }>;
17
17
 
18
+ export type Insets = Rect;
18
19
  export type RectOrSize = Rect | number;
19
20
 
20
21
  export function createSquare(size: number): Rect {
@@ -10,27 +10,30 @@
10
10
 
11
11
  'use strict';
12
12
 
13
+ import typeof * as StyleSheetExports from './StyleSheetExports';
13
14
  import type {
14
15
  ____ColorValue_Internal,
15
16
  ____DangerouslyImpreciseStyle_Internal,
16
17
  ____DangerouslyImpreciseStyleProp_Internal,
18
+ ____FontVariant_Internal,
17
19
  ____ImageStyle_Internal,
18
20
  ____ImageStyleProp_Internal,
19
- ____Styles_Internal,
20
21
  ____TextStyle_Internal,
21
22
  ____TextStyleProp_Internal,
23
+ ____TransformStyle_Internal,
22
24
  ____ViewStyle_Internal,
23
25
  ____ViewStyleProp_Internal,
26
+ NativeColorValue,
27
+ } from './StyleSheetTypes';
28
+ const StyleSheet: StyleSheetExports = (
29
+ require('./StyleSheetExports') as $FlowFixMe
30
+ ).default;
31
+
32
+ export type {
33
+ BoxShadowValue,
34
+ NativeColorValue,
35
+ FilterFunction,
24
36
  } from './StyleSheetTypes';
25
-
26
- import composeStyles from '../../src/private/styles/composeStyles';
27
- import flatten from './flattenStyle';
28
-
29
- const ReactNativeStyleAttributes =
30
- require('../Components/View/ReactNativeStyleAttributes').default;
31
- const PixelRatio = require('../Utilities/PixelRatio').default;
32
-
33
- export type {NativeColorValue} from './StyleSheetTypes';
34
37
 
35
38
  /**
36
39
  * This type should be used as the type for anything that is a color. It is
@@ -41,6 +44,22 @@ export type {NativeColorValue} from './StyleSheetTypes';
41
44
  */
42
45
  export type ColorValue = ____ColorValue_Internal;
43
46
 
47
+ /**
48
+ * Expose the opaque type for NativeColorValue.
49
+ * @deprecated Use NativeColorValue instead.
50
+ */
51
+ export type OpaqueColorValue = NativeColorValue;
52
+
53
+ /**
54
+ * This type is an object of the properties related to transforms.
55
+ */
56
+ export type TransformsStyle = ____TransformStyle_Internal;
57
+
58
+ /**
59
+ * This type holds possible values for the `fontVariant` style property.
60
+ */
61
+ export type FontVariant = ____FontVariant_Internal;
62
+
44
63
  /**
45
64
  * This type should be used as the type for a prop that is passed through
46
65
  * to a <View>'s `style` prop. This ensures call sites of the component
@@ -99,7 +118,7 @@ export type DangerouslyImpreciseStyleProp =
99
118
  */
100
119
  export type TypeForStyleKey<
101
120
  +key: $Keys<____DangerouslyImpreciseStyle_Internal>,
102
- > = $ElementType<____DangerouslyImpreciseStyle_Internal, key>;
121
+ > = ____DangerouslyImpreciseStyle_Internal[key];
103
122
 
104
123
  /**
105
124
  * This type is an object of the different possible style
@@ -166,192 +185,4 @@ export type ImageStyle = ____ImageStyle_Internal;
166
185
  */
167
186
  export type DangerouslyImpreciseStyle = ____DangerouslyImpreciseStyle_Internal;
168
187
 
169
- let hairlineWidth: number = PixelRatio.roundToNearestPixel(0.4);
170
- if (hairlineWidth === 0) {
171
- hairlineWidth = 1 / PixelRatio.get();
172
- }
173
-
174
- const absoluteFill: {
175
- +bottom: 0,
176
- +left: 0,
177
- +position: 'absolute',
178
- +right: 0,
179
- +top: 0,
180
- } = {
181
- position: 'absolute',
182
- left: 0,
183
- right: 0,
184
- top: 0,
185
- bottom: 0,
186
- };
187
- if (__DEV__) {
188
- Object.freeze(absoluteFill);
189
- }
190
-
191
- /**
192
- * A StyleSheet is an abstraction similar to CSS StyleSheets
193
- *
194
- * Create a new StyleSheet:
195
- *
196
- * ```
197
- * const styles = StyleSheet.create({
198
- * container: {
199
- * borderRadius: 4,
200
- * borderWidth: 0.5,
201
- * borderColor: '#d6d7da',
202
- * },
203
- * title: {
204
- * fontSize: 19,
205
- * fontWeight: 'bold',
206
- * },
207
- * activeTitle: {
208
- * color: 'red',
209
- * },
210
- * });
211
- * ```
212
- *
213
- * Use a StyleSheet:
214
- *
215
- * ```
216
- * <View style={styles.container}>
217
- * <Text style={[styles.title, this.props.isActive && styles.activeTitle]} />
218
- * </View>
219
- * ```
220
- *
221
- * Code quality:
222
- *
223
- * - By moving styles away from the render function, you're making the code
224
- * easier to understand.
225
- * - Naming the styles is a good way to add meaning to the low level components
226
- * in the render function, and encourage reuse.
227
- * - In most IDEs, using `StyleSheet.create()` will offer static type checking
228
- * and suggestions to help you write valid styles.
229
- *
230
- */
231
- export default {
232
- /**
233
- * This is defined as the width of a thin line on the platform. It can be
234
- * used as the thickness of a border or division between two elements.
235
- * Example:
236
- * ```
237
- * {
238
- * borderBottomColor: '#bbb',
239
- * borderBottomWidth: StyleSheet.hairlineWidth
240
- * }
241
- * ```
242
- *
243
- * This constant will always be a round number of pixels (so a line defined
244
- * by it look crisp) and will try to match the standard width of a thin line
245
- * on the underlying platform. However, you should not rely on it being a
246
- * constant size, because on different platforms and screen densities its
247
- * value may be calculated differently.
248
- *
249
- * A line with hairline width may not be visible if your simulator is downscaled.
250
- */
251
- hairlineWidth,
252
-
253
- /**
254
- * A very common pattern is to create overlays with position absolute and zero positioning,
255
- * so `absoluteFill` can be used for convenience and to reduce duplication of these repeated
256
- * styles.
257
- */
258
- absoluteFill: (absoluteFill: any), // TODO: This should be updated after we fix downstream Flow sites.
259
-
260
- /**
261
- * Sometimes you may want `absoluteFill` but with a couple tweaks - `absoluteFillObject` can be
262
- * used to create a customized entry in a `StyleSheet`, e.g.:
263
- *
264
- * const styles = StyleSheet.create({
265
- * wrapper: {
266
- * ...StyleSheet.absoluteFillObject,
267
- * top: 10,
268
- * backgroundColor: 'transparent',
269
- * },
270
- * });
271
- */
272
- absoluteFillObject: absoluteFill,
273
-
274
- /**
275
- * Combines two styles such that `style2` will override any styles in `style1`.
276
- * If either style is falsy, the other one is returned without allocating an
277
- * array, saving allocations and maintaining reference equality for
278
- * PureComponent checks.
279
- */
280
- compose: composeStyles,
281
-
282
- /**
283
- * Flattens an array of style objects, into one aggregated style object.
284
- *
285
- * Example:
286
- * ```
287
- * const styles = StyleSheet.create({
288
- * listItem: {
289
- * flex: 1,
290
- * fontSize: 16,
291
- * color: 'white'
292
- * },
293
- * selectedListItem: {
294
- * color: 'green'
295
- * }
296
- * });
297
- *
298
- * StyleSheet.flatten([styles.listItem, styles.selectedListItem])
299
- * // returns { flex: 1, fontSize: 16, color: 'green' }
300
- * ```
301
- */
302
- flatten,
303
-
304
- /**
305
- * WARNING: EXPERIMENTAL. Breaking changes will probably happen a lot and will
306
- * not be reliably announced. The whole thing might be deleted, who knows? Use
307
- * at your own risk.
308
- *
309
- * Sets a function to use to pre-process a style property value. This is used
310
- * internally to process color and transform values. You should not use this
311
- * unless you really know what you are doing and have exhausted other options.
312
- */
313
- setStyleAttributePreprocessor(
314
- property: string,
315
- process: (nextProp: mixed) => mixed,
316
- ) {
317
- let value;
318
-
319
- if (ReactNativeStyleAttributes[property] === true) {
320
- value = {process};
321
- } else if (typeof ReactNativeStyleAttributes[property] === 'object') {
322
- value = {...ReactNativeStyleAttributes[property], process};
323
- } else {
324
- console.error(`${property} is not a valid style attribute`);
325
- return;
326
- }
327
-
328
- if (
329
- __DEV__ &&
330
- typeof value.process === 'function' &&
331
- typeof ReactNativeStyleAttributes[property]?.process === 'function' &&
332
- value.process !== ReactNativeStyleAttributes[property]?.process
333
- ) {
334
- console.warn(`Overwriting ${property} style attribute preprocessor`);
335
- }
336
-
337
- ReactNativeStyleAttributes[property] = value;
338
- },
339
-
340
- /**
341
- * An identity function for creating style sheets.
342
- */
343
- // $FlowFixMe[unsupported-variance-annotation]
344
- create<+S: ____Styles_Internal>(obj: S): $ReadOnly<S> {
345
- // TODO: This should return S as the return type. But first,
346
- // we need to codemod all the callsites that are typing this
347
- // return value as a number (even though it was opaque).
348
- if (__DEV__) {
349
- for (const key in obj) {
350
- if (obj[key]) {
351
- Object.freeze(obj[key]);
352
- }
353
- }
354
- }
355
- return obj;
356
- },
357
- };
188
+ export default StyleSheet;
@@ -0,0 +1,188 @@
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
8
+ * @format
9
+ */
10
+
11
+ export * as default from './StyleSheetExports';
12
+
13
+ import type {
14
+ ____ColorValue_Internal,
15
+ ____DangerouslyImpreciseStyle_Internal,
16
+ ____DangerouslyImpreciseStyleProp_Internal,
17
+ ____FontVariant_Internal,
18
+ ____ImageStyle_Internal,
19
+ ____ImageStyleProp_Internal,
20
+ ____TextStyle_Internal,
21
+ ____TextStyleProp_Internal,
22
+ ____TransformStyle_Internal,
23
+ ____ViewStyle_Internal,
24
+ ____ViewStyleProp_Internal,
25
+ NativeColorValue,
26
+ } from './StyleSheetTypes';
27
+
28
+ export type {
29
+ BoxShadowValue,
30
+ FilterFunction,
31
+ NativeColorValue,
32
+ StyleProp,
33
+ } from './StyleSheetTypes';
34
+
35
+ export type StyleSheetProperties = {
36
+ hairlineWidth: number,
37
+ flatten<T: string>(style: T): T,
38
+ };
39
+
40
+ /**
41
+ * This type should be used as the type for anything that is a color. It is
42
+ * most useful when using DynamicColorIOS which can be a string or a dynamic
43
+ * color object.
44
+ *
45
+ * type props = {backgroundColor: ColorValue};
46
+ */
47
+ export type ColorValue = ____ColorValue_Internal;
48
+
49
+ /**
50
+ * Expose the opaque type for NativeColorValue.
51
+ * @deprecated Use NativeColorValue instead.
52
+ */
53
+ export type OpaqueColorValue = NativeColorValue;
54
+
55
+ /**
56
+ * This type is an object of the properties related to transforms.
57
+ */
58
+ export type TransformsStyle = ____TransformStyle_Internal;
59
+
60
+ /**
61
+ * This type holds possible values for the `fontVariant` style property.
62
+ */
63
+ export type FontVariant = ____FontVariant_Internal;
64
+
65
+ /**
66
+ * This type should be used as the type for a prop that is passed through
67
+ * to a <View>'s `style` prop. This ensures call sites of the component
68
+ * can't pass styles that View doesn't support such as `fontSize`.`
69
+ *
70
+ * type Props = {style: ViewStyleProp}
71
+ * const MyComponent = (props: Props) => <View style={props.style} />
72
+ */
73
+ export type ViewStyleProp = ____ViewStyleProp_Internal;
74
+
75
+ /**
76
+ * This type should be used as the type for a prop that is passed through
77
+ * to a <Text>'s `style` prop. This ensures call sites of the component
78
+ * can't pass styles that Text doesn't support such as `resizeMode`.`
79
+ *
80
+ * type Props = {style: TextStyleProp}
81
+ * const MyComponent = (props: Props) => <Text style={props.style} />
82
+ */
83
+ export type TextStyleProp = ____TextStyleProp_Internal;
84
+
85
+ /**
86
+ * This type should be used as the type for a prop that is passed through
87
+ * to an <Image>'s `style` prop. This ensures call sites of the component
88
+ * can't pass styles that Image doesn't support such as `fontSize`.`
89
+ *
90
+ * type Props = {style: ImageStyleProp}
91
+ * const MyComponent = (props: Props) => <Image style={props.style} />
92
+ */
93
+ export type ImageStyleProp = ____ImageStyleProp_Internal;
94
+
95
+ /**
96
+ * WARNING: You probably shouldn't be using this type. This type
97
+ * is similar to the ones above except it allows styles that are accepted
98
+ * by all of View, Text, or Image. It is therefore very unsafe to pass this
99
+ * through to an underlying component. Using this is almost always a mistake
100
+ * and using one of the other more restrictive types is likely the right choice.
101
+ */
102
+ export type DangerouslyImpreciseStyleProp =
103
+ ____DangerouslyImpreciseStyleProp_Internal;
104
+
105
+ /**
106
+ * Utility type for getting the values for specific style keys.
107
+ *
108
+ * The following is bad because position is more restrictive than 'string':
109
+ * ```
110
+ * type Props = {position: string};
111
+ * ```
112
+ *
113
+ * You should use the following instead:
114
+ *
115
+ * ```
116
+ * type Props = {position: TypeForStyleKey<'position'>};
117
+ * ```
118
+ *
119
+ * This will correctly give you the type 'absolute' | 'relative'
120
+ */
121
+ export type TypeForStyleKey<
122
+ +key: $Keys<____DangerouslyImpreciseStyle_Internal>,
123
+ > = ____DangerouslyImpreciseStyle_Internal[key];
124
+
125
+ /**
126
+ * This type is an object of the different possible style
127
+ * properties that can be specified for View.
128
+ *
129
+ * Note that this isn't a safe way to type a style prop for a component as
130
+ * results from StyleSheet.create return an internal identifier, not
131
+ * an object of styles.
132
+ *
133
+ * If you want to type the style prop of a function,
134
+ * consider using ViewStyleProp.
135
+ *
136
+ * A reasonable usage of this type is for helper functions that return an
137
+ * object of styles to pass to a View that can't be precomputed with
138
+ * StyleSheet.create.
139
+ */
140
+ export type ViewStyle = ____ViewStyle_Internal;
141
+
142
+ /**
143
+ * This type is an object of the different possible style
144
+ * properties that can be specified for Text.
145
+ *
146
+ * Note that this isn't a safe way to type a style prop for a component as
147
+ * results from StyleSheet.create return an internal identifier, not
148
+ * an object of styles.
149
+ *
150
+ * If you want to type the style prop of a function,
151
+ * consider using TextStyleProp.
152
+ *
153
+ * A reasonable usage of this type is for helper functions that return an
154
+ * object of styles to pass to a Text that can't be precomputed with
155
+ * StyleSheet.create.
156
+ */
157
+ export type TextStyle = ____TextStyle_Internal;
158
+
159
+ /**
160
+ * This type is an object of the different possible style
161
+ * properties that can be specified for Image.
162
+ *
163
+ * Note that this isn't a safe way to type a style prop for a component as
164
+ * results from StyleSheet.create return an internal identifier, not
165
+ * an object of styles.
166
+ *
167
+ * If you want to type the style prop of a function,
168
+ * consider using ImageStyleProp.
169
+ *
170
+ * A reasonable usage of this type is for helper functions that return an
171
+ * object of styles to pass to an Image that can't be precomputed with
172
+ * StyleSheet.create.
173
+ */
174
+ export type ImageStyle = ____ImageStyle_Internal;
175
+
176
+ /**
177
+ * WARNING: You probably shouldn't be using this type. This type is an object
178
+ * with all possible style keys and their values. Note that this isn't
179
+ * a safe way to type a style prop for a component as results from
180
+ * StyleSheet.create return an internal identifier, not an object of styles.
181
+ *
182
+ * If you want to type the style prop of a function, consider using
183
+ * ViewStyleProp, TextStyleProp, or ImageStyleProp.
184
+ *
185
+ * This should only be used by very core utilities that operate on an object
186
+ * containing any possible style value.
187
+ */
188
+ export type DangerouslyImpreciseStyle = ____DangerouslyImpreciseStyle_Internal;