@office-iss/react-native-win32 0.81.2 → 0.82.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 (209) hide show
  1. package/.flowconfig +3 -11
  2. package/CHANGELOG.json +118 -43
  3. package/CHANGELOG.md +45 -27
  4. package/IntegrationTests/IntegrationTestsApp.js +2 -2
  5. package/IntegrationTests/LayoutEventsTest.js +3 -3
  6. package/Libraries/ActionSheetIOS/ActionSheetIOS.js +7 -3
  7. package/Libraries/Alert/RCTAlertManager.android.js +4 -2
  8. package/Libraries/Animated/Animated.d.ts +2 -0
  9. package/Libraries/Animated/AnimatedEvent.js +1 -1
  10. package/Libraries/Animated/AnimatedExports.js.flow +1 -0
  11. package/Libraries/Animated/AnimatedImplementation.js +4 -2
  12. package/Libraries/Animated/AnimatedMock.js +1 -1
  13. package/Libraries/Animated/Easing.js +2 -0
  14. package/Libraries/Animated/NativeAnimatedAllowlist.js +1 -0
  15. package/Libraries/Animated/animations/Animation.js +19 -20
  16. package/Libraries/Animated/animations/TimingAnimation.js +2 -0
  17. package/Libraries/Animated/components/AnimatedScrollView.js +3 -2
  18. package/Libraries/Animated/components/AnimatedSectionList.js +1 -1
  19. package/Libraries/Animated/nodes/AnimatedColor.js +9 -9
  20. package/Libraries/Animated/nodes/AnimatedInterpolation.js +4 -4
  21. package/Libraries/Animated/nodes/AnimatedNode.js +14 -7
  22. package/Libraries/Animated/nodes/AnimatedObject.js +7 -7
  23. package/Libraries/Animated/nodes/AnimatedProps.js +32 -32
  24. package/Libraries/Animated/nodes/AnimatedStyle.js +23 -21
  25. package/Libraries/Animated/nodes/AnimatedTransform.js +6 -6
  26. package/Libraries/Animated/nodes/AnimatedValue.js +18 -26
  27. package/Libraries/AppState/AppState.js +8 -4
  28. package/Libraries/BatchedBridge/BatchedBridge.js +1 -0
  29. package/Libraries/BatchedBridge/MessageQueue.js +5 -0
  30. package/Libraries/BatchedBridge/NativeModules.js +1 -1
  31. package/Libraries/Blob/BlobManager.js +1 -1
  32. package/Libraries/Blob/URLSearchParams.js +2 -0
  33. package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js +2 -2
  34. package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.win32.js +2 -2
  35. package/Libraries/Components/Button.js +1 -1
  36. package/Libraries/Components/Button.win32.js +1 -1
  37. package/Libraries/Components/Pressable/Pressable.js +10 -1
  38. package/Libraries/Components/Pressable/Pressable.win32.js +9 -0
  39. package/Libraries/Components/Pressable/useAndroidRippleForView.js +2 -2
  40. package/Libraries/Components/ScrollView/ScrollView.js +13 -4
  41. package/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +1 -1
  42. package/Libraries/Components/StatusBar/StatusBar.js +2 -2
  43. package/Libraries/Components/Switch/Switch.js +1 -1
  44. package/Libraries/Components/TextInput/TextInput.flow.js +12 -5
  45. package/Libraries/Components/TextInput/TextInput.flow.win32.js +12 -5
  46. package/Libraries/Components/TextInput/TextInput.js +14 -5
  47. package/Libraries/Components/TextInput/TextInput.win32.js +15 -7
  48. package/Libraries/Components/TextInput/TextInputState.js +1 -1
  49. package/Libraries/Components/TextInput/TextInputState.win32.js +1 -1
  50. package/Libraries/Components/TextInput/Win32TextInputNativeComponent.js +2 -3
  51. package/Libraries/Components/Touchable/TouchableBounce.js +1 -1
  52. package/Libraries/Components/Touchable/TouchableHighlight.js +1 -1
  53. package/Libraries/Components/Touchable/TouchableNativeFeedback.js +1 -1
  54. package/Libraries/Components/Touchable/TouchableOpacity.js +1 -1
  55. package/Libraries/Components/Touchable/TouchableWin32.js +1 -1
  56. package/Libraries/Components/Touchable/TouchableWin32.js.map +1 -1
  57. package/Libraries/Components/Touchable/TouchableWithoutFeedback.js +3 -3
  58. package/Libraries/Components/View/View.js +81 -167
  59. package/Libraries/Components/View/View.win32.js +3 -1
  60. package/Libraries/Core/Devtools/loadBundleFromServer.js +1 -1
  61. package/Libraries/Core/Devtools/loadBundleFromServer.win32.js +1 -1
  62. package/Libraries/Core/ExceptionsManager.js +4 -2
  63. package/Libraries/Core/ReactFiberErrorDialog.js +3 -3
  64. package/Libraries/Core/ReactNativeVersion.js +37 -10
  65. package/Libraries/Core/Timers/JSTimers.js +4 -1
  66. package/Libraries/Core/Timers/NativeTiming.js +1 -0
  67. package/Libraries/Core/Timers/immediateShim.js +2 -1
  68. package/Libraries/Core/Timers/queueMicrotask.js +1 -0
  69. package/Libraries/Core/setUpPerformance.js +3 -4
  70. package/Libraries/Debugging/DebuggingOverlayRegistry.js +5 -3
  71. package/Libraries/Image/Image.android.js +327 -111
  72. package/Libraries/Image/Image.ios.js +6 -1
  73. package/Libraries/Image/Image.win32.js +6 -1
  74. package/Libraries/Image/ImageSourceUtils.js +8 -2
  75. package/Libraries/Image/assetPaths.js +1 -1
  76. package/Libraries/Image/resolveAssetSource.js +1 -1
  77. package/Libraries/Image/resolveAssetSource.win32.js +6 -7
  78. package/Libraries/Interaction/InteractionManager.js +118 -167
  79. package/Libraries/Interaction/PanResponder.js +7 -52
  80. package/Libraries/LayoutAnimation/LayoutAnimation.js +2 -0
  81. package/Libraries/Lists/FlatList.js +5 -6
  82. package/Libraries/LogBox/Data/LogBoxData.js +5 -2
  83. package/Libraries/LogBox/Data/parseLogBoxLog.js +1 -1
  84. package/Libraries/LogBox/UI/LogBoxInspectorHeader.win32.js +2 -2
  85. package/Libraries/LogBox/UI/LogBoxInspectorSourceMapStatus.js +1 -1
  86. package/Libraries/LogBox/UI/LogBoxInspectorSourceMapStatus.win32.js +1 -1
  87. package/Libraries/Modal/Modal.js +3 -3
  88. package/Libraries/NativeComponent/NativeComponentRegistry.js +1 -1
  89. package/Libraries/NativeComponent/ViewConfig.js +2 -2
  90. package/Libraries/Network/RCTNetworking.android.js +1 -1
  91. package/Libraries/Network/RCTNetworking.ios.js +1 -1
  92. package/Libraries/Network/RCTNetworking.win32.js +1 -1
  93. package/Libraries/Network/XMLHttpRequest.js +20 -5
  94. package/Libraries/Network/convertRequestBody.js +1 -1
  95. package/Libraries/PermissionsAndroid/PermissionsAndroid.js +10 -9
  96. package/Libraries/Pressability/HoverState.js +2 -0
  97. package/Libraries/Pressability/HoverState.win32.js +2 -0
  98. package/Libraries/Pressability/Pressability.js +1 -1
  99. package/Libraries/Pressability/Pressability.win32.js +1 -1
  100. package/Libraries/PushNotificationIOS/PushNotificationIOS.js +2 -2
  101. package/Libraries/ReactNative/AppRegistryImpl.js +4 -2
  102. package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricHostComponent.js +2 -0
  103. package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstance.js +3 -3
  104. package/Libraries/ReactNative/RendererImplementation.js +116 -116
  105. package/Libraries/ReactNative/UIManager.js +3 -3
  106. package/Libraries/ReactNative/renderApplication.js +1 -0
  107. package/Libraries/ReactPrivate/ReactNativePrivateInterface.js +1 -1
  108. package/Libraries/Renderer/implementations/ReactFabric-dev.js +38 -35
  109. package/Libraries/Renderer/implementations/ReactFabric-prod.js +51 -22
  110. package/Libraries/Renderer/implementations/ReactFabric-profiling.js +54 -24
  111. package/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js +36 -33
  112. package/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js +5 -5
  113. package/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.js +5 -5
  114. package/Libraries/Renderer/shims/ReactNativeViewConfigRegistry.js +3 -1
  115. package/Libraries/Share/Share.js +4 -0
  116. package/Libraries/StyleSheet/PlatformColorValueTypes.android.js +2 -2
  117. package/Libraries/StyleSheet/PlatformColorValueTypes.ios.js +2 -2
  118. package/Libraries/StyleSheet/PlatformColorValueTypes.win32.js +4 -0
  119. package/Libraries/StyleSheet/StyleSheet.d.ts +7 -22
  120. package/Libraries/StyleSheet/StyleSheetExports.js +2 -8
  121. package/Libraries/StyleSheet/StyleSheetExports.js.flow +11 -18
  122. package/Libraries/StyleSheet/flattenStyle.js +2 -2
  123. package/Libraries/StyleSheet/processAspectRatio.js +2 -0
  124. package/Libraries/StyleSheet/processFilter.js +5 -5
  125. package/Libraries/StyleSheet/splitLayoutProps.js +2 -2
  126. package/Libraries/Text/Text.js +534 -234
  127. package/Libraries/Text/Text.win32.js +647 -274
  128. package/Libraries/Text/TextNativeComponent.js +2 -2
  129. package/Libraries/Text/TextNativeComponent.win32.js +2 -2
  130. package/Libraries/Utilities/Appearance.d.ts +3 -5
  131. package/Libraries/Utilities/Appearance.js +5 -17
  132. package/Libraries/Utilities/HMRClient.js +2 -1
  133. package/Libraries/Utilities/Platform.android.js +3 -3
  134. package/Libraries/Utilities/Platform.d.ts +1 -0
  135. package/Libraries/Utilities/Platform.ios.js +1 -1
  136. package/Libraries/Utilities/Platform.win32.js +3 -3
  137. package/Libraries/Utilities/PlatformTypes.js +1 -1
  138. package/Libraries/Utilities/ReactNativeTestTools.js +12 -0
  139. package/Libraries/Utilities/SceneTracker.js +1 -1
  140. package/Libraries/Utilities/codegenNativeCommands.js +1 -1
  141. package/Libraries/Utilities/codegenNativeComponent.js +1 -1
  142. package/Libraries/Utilities/createPerformanceLogger.js +32 -0
  143. package/Libraries/Utilities/deepFreezeAndThrowOnMutationInDev.js +2 -0
  144. package/Libraries/Utilities/differ/pointsDiffer.js +1 -1
  145. package/Libraries/Utilities/useMergeRefs.js +1 -1
  146. package/Libraries/WebSocket/WebSocketInterceptor.js +2 -0
  147. package/Libraries/promiseRejectionTrackingOptions.js +17 -31
  148. package/Libraries/vendor/emitter/EventEmitter.js +1 -1
  149. package/flow/bom.js.flow +223 -1
  150. package/flow/prettier.js.flow +14 -0
  151. package/index.js +14 -2
  152. package/index.win32.js +16 -2
  153. package/jest/local-setup.js +2 -2
  154. package/jest/mock.js +1 -1
  155. package/jest/mockComponent.js +9 -9
  156. package/jest/mockNativeComponent.js +3 -2
  157. package/jest/mocks/Modal.js +1 -1
  158. package/jest/mocks/ScrollView.js +1 -1
  159. package/jest/mocks/ViewNativeComponent.js +1 -1
  160. package/jest/setup.js +23 -12
  161. package/overrides.json +23 -23
  162. package/package.json +28 -27
  163. package/saveAssetPlugin.js +2 -2
  164. package/src/private/animated/NativeAnimatedHelper.js +16 -5
  165. package/src/private/animated/NativeAnimatedHelper.win32.js +16 -5
  166. package/src/private/animated/createAnimatedPropsHook.js +11 -60
  167. package/src/private/animated/createAnimatedPropsMemoHook.js +8 -54
  168. package/src/private/components/virtualview/VirtualView.js +43 -12
  169. package/src/private/components/virtualview/VirtualViewExperimentalNativeComponent.js +93 -0
  170. package/src/private/components/virtualview/VirtualViewNativeComponent.js +6 -0
  171. package/src/private/devsupport/devmenu/elementinspector/Inspector.js +2 -2
  172. package/src/private/devsupport/devmenu/elementinspector/ReactDevToolsOverlay.js +2 -2
  173. package/src/private/featureflags/ReactNativeFeatureFlags.js +85 -52
  174. package/src/private/featureflags/ReactNativeFeatureFlagsBase.js +23 -4
  175. package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +15 -6
  176. package/src/private/renderer/errorhandling/ErrorHandlers.js +3 -3
  177. package/src/private/setup/{setUpPerformanceObserver.js → setUpPerformanceModern.js} +43 -18
  178. package/src/private/specs_DEPRECATED/modules/NativeTiming.js +1 -0
  179. package/src/private/types/HostInstance.js +4 -1
  180. package/src/private/webapis/dom/nodes/ReactNativeDocument.js +22 -2
  181. package/src/private/webapis/dom/nodes/ReactNativeElement.js +1 -1
  182. package/src/private/webapis/dom/nodes/ReadOnlyElement.js +5 -3
  183. package/src/private/webapis/dom/nodes/ReadOnlyNode.js +16 -13
  184. package/src/private/webapis/dom/nodes/internals/NodeInternals.js +45 -22
  185. package/src/private/webapis/dom/nodes/internals/ReactNativeDocumentInstanceHandle.js +1 -1
  186. package/src/private/webapis/dom/nodes/specs/NativeDOM.js +26 -192
  187. package/src/private/webapis/dom/oldstylecollections/HTMLCollection.js +15 -12
  188. package/src/private/webapis/dom/oldstylecollections/NodeList.js +14 -11
  189. package/src/private/webapis/geometry/DOMRectList.js +2 -2
  190. package/src/private/webapis/intersectionobserver/internals/IntersectionObserverManager.js +19 -74
  191. package/src/private/webapis/intersectionobserver/specs/NativeIntersectionObserver.js +0 -4
  192. package/src/private/webapis/mutationobserver/internals/MutationObserverManager.js +1 -1
  193. package/src/private/webapis/performance/EventTiming.js +40 -25
  194. package/src/private/webapis/performance/LongTasks.js +35 -2
  195. package/src/private/webapis/performance/Performance.js +347 -166
  196. package/src/private/webapis/performance/PerformanceEntry.js +40 -23
  197. package/src/private/webapis/performance/PerformanceObserver.js +37 -29
  198. package/src/private/webapis/performance/ReactNativeStartupTiming.js +3 -24
  199. package/src/private/webapis/performance/ResourceTiming.js +29 -18
  200. package/src/private/webapis/performance/UserTiming.js +92 -34
  201. package/src/private/webapis/performance/UserTimingExtensibility.js.flow +38 -0
  202. package/src/private/webapis/performance/internals/RawPerformanceEntry.js +3 -4
  203. package/src/private/webapis/performance/internals/Utilities.js +9 -0
  204. package/src/private/webapis/performance/specs/NativePerformance.js +23 -23
  205. package/src/private/webapis/structuredClone/structuredClone.js +10 -10
  206. package/src-win/Libraries/Components/Touchable/TouchableWin32.tsx +1 -1
  207. package/Libraries/Interaction/InteractionManagerStub.js +0 -184
  208. package/Libraries/Interaction/TaskQueue.js +0 -183
  209. package/Libraries/ReactNative/ReactNativeFeatureFlags.js +0 -31
@@ -7,7 +7,7 @@
7
7
  * @noflow
8
8
  * @nolint
9
9
  * @preventMunge
10
- * @generated SignedSource<<43be62d6fc9b622e265e2acb066ed13c>>
10
+ * @generated SignedSource<<5ea611585e32bbcbcdc91868aa8ed875>>
11
11
  *
12
12
  * This file was sync'd from the facebook/react repository.
13
13
  */
@@ -10603,11 +10603,11 @@ function updateContainer(element, container, parentComponent, callback) {
10603
10603
  return lane;
10604
10604
  }
10605
10605
  var isomorphicReactPackageVersion = React.version;
10606
- if ("19.1.0" !== isomorphicReactPackageVersion)
10606
+ if ("19.1.1" !== isomorphicReactPackageVersion)
10607
10607
  throw Error(
10608
10608
  'Incompatible React versions: The "react" and "react-native-renderer" packages must have the exact same version. Instead got:\n - react: ' +
10609
10609
  (isomorphicReactPackageVersion +
10610
- "\n - react-native-renderer: 19.1.0\nLearn more: https://react.dev/warnings/version-mismatch")
10610
+ "\n - react-native-renderer: 19.1.1\nLearn more: https://react.dev/warnings/version-mismatch")
10611
10611
  );
10612
10612
  if (
10613
10613
  "function" !==
@@ -10656,10 +10656,10 @@ batchedUpdatesImpl = function (fn, a) {
10656
10656
  var roots = new Map(),
10657
10657
  internals$jscomp$inline_1269 = {
10658
10658
  bundleType: 0,
10659
- version: "19.1.0",
10659
+ version: "19.1.1",
10660
10660
  rendererPackageName: "react-native-renderer",
10661
10661
  currentDispatcherRef: ReactSharedInternals,
10662
- reconcilerVersion: "19.1.0"
10662
+ reconcilerVersion: "19.1.1"
10663
10663
  };
10664
10664
  null !== extraDevToolsConfig &&
10665
10665
  (internals$jscomp$inline_1269.rendererConfig = extraDevToolsConfig);
@@ -7,7 +7,7 @@
7
7
  * @noflow
8
8
  * @nolint
9
9
  * @preventMunge
10
- * @generated SignedSource<<d0e536371839f0311bec769f15162a4b>>
10
+ * @generated SignedSource<<68ab59ddfed0642b58d7b4db6803da29>>
11
11
  *
12
12
  * This file was sync'd from the facebook/react repository.
13
13
  */
@@ -11245,11 +11245,11 @@ function updateContainer(element, container, parentComponent, callback) {
11245
11245
  return lane;
11246
11246
  }
11247
11247
  var isomorphicReactPackageVersion = React.version;
11248
- if ("19.1.0" !== isomorphicReactPackageVersion)
11248
+ if ("19.1.1" !== isomorphicReactPackageVersion)
11249
11249
  throw Error(
11250
11250
  'Incompatible React versions: The "react" and "react-native-renderer" packages must have the exact same version. Instead got:\n - react: ' +
11251
11251
  (isomorphicReactPackageVersion +
11252
- "\n - react-native-renderer: 19.1.0\nLearn more: https://react.dev/warnings/version-mismatch")
11252
+ "\n - react-native-renderer: 19.1.1\nLearn more: https://react.dev/warnings/version-mismatch")
11253
11253
  );
11254
11254
  if (
11255
11255
  "function" !==
@@ -11298,10 +11298,10 @@ batchedUpdatesImpl = function (fn, a) {
11298
11298
  var roots = new Map(),
11299
11299
  internals$jscomp$inline_1362 = {
11300
11300
  bundleType: 0,
11301
- version: "19.1.0",
11301
+ version: "19.1.1",
11302
11302
  rendererPackageName: "react-native-renderer",
11303
11303
  currentDispatcherRef: ReactSharedInternals,
11304
- reconcilerVersion: "19.1.0"
11304
+ reconcilerVersion: "19.1.1"
11305
11305
  };
11306
11306
  null !== extraDevToolsConfig &&
11307
11307
  (internals$jscomp$inline_1362.rendererConfig = extraDevToolsConfig);
@@ -7,7 +7,7 @@
7
7
  * @noformat
8
8
  * @nolint
9
9
  * @flow strict-local
10
- * @generated SignedSource<<83073425aa3f71ced2c8c51f25a25938>>
10
+ * @generated SignedSource<<1f7876c0dc0b05685a730513dc410236>>
11
11
  */
12
12
 
13
13
  'use strict';
@@ -82,6 +82,8 @@ export function register(name: string, callback: () => ViewConfig): string {
82
82
  typeof callback === 'function',
83
83
  'View config getter callback for component `%s` must be a function (received `%s`)',
84
84
  name,
85
+ /* $FlowFixMe[invalid-compare] Error discovered during Constant Condition
86
+ * roll out. See https://fburl.com/workplace/5whu3i34. */
85
87
  callback === null ? 'null' : typeof callback,
86
88
  );
87
89
  viewConfigCallbacks.set(name, callback);
@@ -83,6 +83,8 @@ class Share {
83
83
  options?: ShareOptions = {},
84
84
  ): Promise<{action: string, activityType: ?string}> {
85
85
  invariant(
86
+ /* $FlowFixMe[invalid-compare] Error discovered during Constant Condition
87
+ * roll out. See https://fburl.com/workplace/5whu3i34. */
86
88
  typeof content === 'object' && content !== null,
87
89
  'Content to share must be a valid object',
88
90
  );
@@ -91,6 +93,8 @@ class Share {
91
93
  'At least one of URL or message is required',
92
94
  );
93
95
  invariant(
96
+ /* $FlowFixMe[invalid-compare] Error discovered during Constant Condition
97
+ * roll out. See https://fburl.com/workplace/5whu3i34. */
94
98
  typeof options === 'object' && options !== null,
95
99
  'Options must be a valid object',
96
100
  );
@@ -17,7 +17,7 @@ type LocalNativeColorValue = {
17
17
  };
18
18
 
19
19
  export const PlatformColor = (...names: Array<string>): ColorValue => {
20
- /* $FlowExpectedError[incompatible-return]
20
+ /* $FlowExpectedError[incompatible-type]
21
21
  * LocalNativeColorValue is the actual type of the opaque NativeColorValue on Android platform */
22
22
  return ({resource_paths: names}: LocalNativeColorValue);
23
23
  };
@@ -25,7 +25,7 @@ export const PlatformColor = (...names: Array<string>): ColorValue => {
25
25
  export const normalizeColorObject = (
26
26
  color: NativeColorValue,
27
27
  ): ?ProcessedColorValue => {
28
- /* $FlowExpectedError[incompatible-cast]
28
+ /* $FlowExpectedError[incompatible-type]
29
29
  * LocalNativeColorValue is the actual type of the opaque NativeColorValue on Android platform */
30
30
  if ('resource_paths' in (color: LocalNativeColorValue)) {
31
31
  return color;
@@ -23,7 +23,7 @@ type LocalNativeColorValue = {
23
23
  };
24
24
 
25
25
  export const PlatformColor = (...names: Array<string>): ColorValue => {
26
- // $FlowExpectedError[incompatible-return] LocalNativeColorValue is the iOS LocalNativeColorValue type
26
+ // $FlowExpectedError[incompatible-type] LocalNativeColorValue is the iOS LocalNativeColorValue type
27
27
  return ({semantic: names}: LocalNativeColorValue);
28
28
  };
29
29
 
@@ -44,7 +44,7 @@ export const DynamicColorIOSPrivate = (
44
44
  highContrastLight: tuple.highContrastLight,
45
45
  highContrastDark: tuple.highContrastDark,
46
46
  },
47
- /* $FlowExpectedError[incompatible-return]
47
+ /* $FlowExpectedError[incompatible-type]
48
48
  * LocalNativeColorValue is the actual type of the opaque NativeColorValue on iOS platform */
49
49
  }: LocalNativeColorValue);
50
50
  };
@@ -32,6 +32,7 @@ type LocalNativeColorValue =
32
32
 
33
33
  export const PlatformColor = (...names: Array<string>): ColorValue => {
34
34
  // $FlowExpectedError[incompatible-return] LocalNativeColorValue is the Windows LocalNativeColorValue type
35
+ // $FlowExpectedError[incompatible-type]
35
36
  return ({resource_paths: names}: LocalNativeColorValue);
36
37
  };
37
38
 
@@ -39,6 +40,7 @@ export const ColorGradientWin32Private = (
39
40
  gradientColor: GradientColorValueWin32,
40
41
  ): ColorValue => {
41
42
  // $FlowExpectedError[incompatible-return]
43
+ // $FlowExpectedError[incompatible-type]
42
44
  return gradientColor;
43
45
  };
44
46
 
@@ -49,8 +51,10 @@ export const normalizeColorObject = (
49
51
  * LocalNativeColorValue is the actual type of the opaque NativeColorValue on Windows platform */
50
52
  if (
51
53
  // $FlowExpectedError[incompatible-cast]
54
+ // $FlowExpectedError[incompatible-type]
52
55
  'resource_paths' in (color: LocalNativeColorValue) ||
53
56
  // $FlowExpectedError[incompatible-cast]
57
+ // $FlowExpectedError[incompatible-type]
54
58
  'gradientDirection' in (color: LocalNativeColorValue)
55
59
  ) {
56
60
  return color;
@@ -17,13 +17,7 @@ export interface StyleSheetProperties {
17
17
  type Falsy = undefined | null | false | '';
18
18
  interface RecursiveArray<T>
19
19
  extends Array<T | ReadonlyArray<T> | RecursiveArray<T>> {}
20
- /** Keep a brand of 'T' so that calls to `StyleSheet.flatten` can take `RegisteredStyle<T>` and return `T`. */
21
- type RegisteredStyle<T> = number & {__registeredStyleBrand: T};
22
- export type StyleProp<T> =
23
- | T
24
- | RegisteredStyle<T>
25
- | RecursiveArray<T | RegisteredStyle<T> | Falsy>
26
- | Falsy;
20
+ export type StyleProp<T> = T | RecursiveArray<T | Falsy> | Falsy;
27
21
 
28
22
  type OpaqueColorValue = symbol & {__TYPE__: 'Color'};
29
23
  export type ColorValue = string | OpaqueColorValue;
@@ -127,24 +121,15 @@ export namespace StyleSheet {
127
121
  bottom: 0;
128
122
  }
129
123
 
130
- /**
131
- * Sometimes you may want `absoluteFill` but with a couple tweaks - `absoluteFillObject` can be
132
- * used to create a customized entry in a `StyleSheet`, e.g.:
133
- *
134
- * const styles = StyleSheet.create({
135
- * wrapper: {
136
- * ...StyleSheet.absoluteFillObject,
137
- * top: 10,
138
- * backgroundColor: 'transparent',
139
- * },
140
- * });
141
- */
142
- export const absoluteFillObject: AbsoluteFillStyle;
143
-
144
124
  /**
145
125
  * A very common pattern is to create overlays with position absolute and zero positioning,
146
126
  * so `absoluteFill` can be used for convenience and to reduce duplication of these repeated
147
127
  * styles.
148
128
  */
149
- export const absoluteFill: RegisteredStyle<AbsoluteFillStyle>;
129
+ export const absoluteFill: AbsoluteFillStyle;
130
+
131
+ /**
132
+ * @deprecated Use `StyleSheet.absoluteFill`.
133
+ */
134
+ export const absoluteFillObject: AbsoluteFillStyle;
150
135
  }
@@ -24,13 +24,7 @@ if (hairlineWidth === 0) {
24
24
  hairlineWidth = 1 / PixelRatio.get();
25
25
  }
26
26
 
27
- const absoluteFill: {
28
- +bottom: 0,
29
- +left: 0,
30
- +position: 'absolute',
31
- +right: 0,
32
- +top: 0,
33
- } = {
27
+ const absoluteFill = {
34
28
  position: 'absolute',
35
29
  left: 0,
36
30
  right: 0,
@@ -108,7 +102,7 @@ export default {
108
102
  * so `absoluteFill` can be used for convenience and to reduce duplication of these repeated
109
103
  * styles.
110
104
  */
111
- absoluteFill: (absoluteFill: any), // TODO: This should be updated after we fix downstream Flow sites.
105
+ absoluteFill,
112
106
 
113
107
  /**
114
108
  * Sometimes you may want `absoluteFill` but with a couple tweaks - `absoluteFillObject` can be
@@ -13,6 +13,14 @@ import type {____Styles_Internal} from './StyleSheetTypes';
13
13
  import composeStyles from '../../src/private/styles/composeStyles';
14
14
  import flattenStyle from './flattenStyle';
15
15
 
16
+ type AbsoluteFillStyle = $ReadOnly<{
17
+ position: 'absolute',
18
+ left: 0,
19
+ right: 0,
20
+ top: 0,
21
+ bottom: 0,
22
+ }>;
23
+
16
24
  /**
17
25
  * This is defined as the width of a thin line on the platform. It can be
18
26
  * used as the thickness of a border or division between two elements.
@@ -37,27 +45,12 @@ declare export const hairlineWidth: number;
37
45
  * so `absoluteFill` can be used for convenience and to reduce duplication of these repeated
38
46
  * styles.
39
47
  */
40
- declare export const absoluteFill: any;
48
+ declare export const absoluteFill: AbsoluteFillStyle;
41
49
 
42
50
  /**
43
- * Sometimes you may want `absoluteFill` but with a couple tweaks - `absoluteFillObject` can be
44
- * used to create a customized entry in a `StyleSheet`, e.g.:
45
- *
46
- * const styles = StyleSheet.create({
47
- * wrapper: {
48
- * ...StyleSheet.absoluteFillObject,
49
- * top: 10,
50
- * backgroundColor: 'transparent',
51
- * },
52
- * });
51
+ * @deprecated Use `StyleSheet.absoluteFill`.
53
52
  */
54
- declare export const absoluteFillObject: {
55
- +bottom: 0,
56
- +left: 0,
57
- +position: 'absolute',
58
- +right: 0,
59
- +top: 0,
60
- };
53
+ declare export const absoluteFillObject: AbsoluteFillStyle;
61
54
 
62
55
  /**
63
56
  * Combines two styles such that style2 will override any styles in style1.
@@ -31,7 +31,7 @@ function flattenStyle<
31
31
  }
32
32
 
33
33
  if (!Array.isArray(style)) {
34
- // $FlowFixMe[incompatible-return]
34
+ // $FlowFixMe[incompatible-type]
35
35
  return style;
36
36
  }
37
37
 
@@ -49,7 +49,7 @@ function flattenStyle<
49
49
  }
50
50
  }
51
51
  }
52
- // $FlowFixMe[incompatible-return]
52
+ // $FlowFixMe[incompatible-type]
53
53
  return result;
54
54
  }
55
55
 
@@ -19,6 +19,8 @@ function processAspectRatio(aspectRatio?: number | string): ?number {
19
19
  if (typeof aspectRatio !== 'string') {
20
20
  if (__DEV__) {
21
21
  invariant(
22
+ /* $FlowFixMe[constant-condition] Error discovered during Constant
23
+ * Condition roll out. See https://fburl.com/workplace/1v97vimq. */
22
24
  !aspectRatio,
23
25
  'aspectRatio must either be a number, a ratio string or `auto`. You passed: %s',
24
26
  aspectRatio,
@@ -69,9 +69,9 @@ export default function processFilter(
69
69
 
70
70
  if (amount != null) {
71
71
  const filterFunction = {};
72
- // $FlowFixMe The key will be the correct one but flow can't see that.
72
+ // $FlowFixMe[prop-missing] The key will be the correct one but flow can't see that.
73
73
  filterFunction[camelizedName] = amount;
74
- // $FlowFixMe The key will be the correct one but flow can't see that.
74
+ // $FlowFixMe[incompatible-type] The key will be the correct one but flow can't see that.
75
75
  result.push(filterFunction);
76
76
  } else {
77
77
  // If any primitive is invalid then apply none of the filters. This is how
@@ -85,7 +85,7 @@ export default function processFilter(
85
85
  for (const filterFunction of filter) {
86
86
  const [filterName, filterValue] = Object.entries(filterFunction)[0];
87
87
  if (filterName === 'dropShadow') {
88
- // $FlowFixMe
88
+ // $FlowFixMe[incompatible-type]
89
89
  const dropShadow = parseDropShadow(filterValue);
90
90
  if (dropShadow == null) {
91
91
  return [];
@@ -96,9 +96,9 @@ export default function processFilter(
96
96
 
97
97
  if (amount != null) {
98
98
  const resultObject = {};
99
- // $FlowFixMe
99
+ // $FlowFixMe[prop-missing]
100
100
  resultObject[filterName] = amount;
101
- // $FlowFixMe
101
+ // $FlowFixMe[incompatible-type]
102
102
  result.push(resultObject);
103
103
  } else {
104
104
  // If any primitive is invalid then apply none of the filters. This is how
@@ -18,9 +18,9 @@ export default function splitLayoutProps(props: ?____ViewStyle_Internal): {
18
18
  let inner: ?____ViewStyle_Internal = null;
19
19
 
20
20
  if (props != null) {
21
- // $FlowIgnore[incompatible-exact] Will contain a subset of keys from `props`.
21
+ // $FlowFixMe[incompatible-exact] Will contain a subset of keys from `props`.
22
22
  outer = {};
23
- // $FlowIgnore[incompatible-exact] Will contain a subset of keys from `props`.
23
+ // $FlowFixMe[incompatible-exact] Will contain a subset of keys from `props`.
24
24
  inner = {};
25
25
 
26
26
  for (const prop of Object.keys(props)) {