@office-iss/react-native-win32 0.68.0 → 0.69.0-preview.3

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 (183) hide show
  1. package/.eslintrc.js +1 -0
  2. package/.flowconfig +1 -3
  3. package/CHANGELOG.json +386 -32
  4. package/CHANGELOG.md +166 -19
  5. package/IntegrationTests/BUCK +4 -1
  6. package/Libraries/ActionSheetIOS/ActionSheetIOS.js +7 -0
  7. package/Libraries/ActionSheetIOS/NativeActionSheetManager.js +1 -0
  8. package/Libraries/Alert/Alert.win32.js +1 -1
  9. package/Libraries/Animated/AnimatedImplementation.js +1 -1
  10. package/Libraries/Animated/NativeAnimatedHelper.js +55 -9
  11. package/Libraries/Animated/NativeAnimatedModule.js +1 -0
  12. package/Libraries/Animated/NativeAnimatedTurboModule.js +1 -0
  13. package/Libraries/Animated/animations/TimingAnimation.js +6 -11
  14. package/Libraries/Animated/createAnimatedComponent.js +2 -2
  15. package/Libraries/Animated/nodes/AnimatedColor.js +95 -29
  16. package/Libraries/Animated/nodes/AnimatedInterpolation.js +19 -22
  17. package/Libraries/Animated/nodes/AnimatedNode.js +2 -2
  18. package/Libraries/Animated/nodes/AnimatedValue.js +1 -1
  19. package/Libraries/AppState/AppState.js +1 -1
  20. package/Libraries/Blob/URL.js +7 -1
  21. package/Libraries/Components/Button.js +3 -0
  22. package/Libraries/Components/DatePickerAndroid/NativeDatePickerAndroid.js +5 -0
  23. package/Libraries/Components/Pressable/Pressable.js +3 -3
  24. package/Libraries/Components/Pressable/Pressable.win32.js +3 -3
  25. package/Libraries/Components/ScrollView/AndroidHorizontalScrollViewNativeComponent.js +47 -38
  26. package/Libraries/Components/ScrollView/ScrollContentViewNativeComponent.js +15 -7
  27. package/Libraries/Components/ScrollView/ScrollView.js +1 -1
  28. package/Libraries/Components/ScrollView/ScrollViewNativeComponent.js +16 -3
  29. package/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +3 -1
  30. package/Libraries/Components/Slider/Slider.js +0 -2
  31. package/Libraries/Components/Slider/SliderNativeComponent.js +0 -1
  32. package/Libraries/Components/StatusBar/StatusBar.js +6 -1
  33. package/Libraries/Components/Switch/Switch.js +11 -1
  34. package/Libraries/Components/TextInput/AndroidTextInputNativeComponent.js +114 -109
  35. package/Libraries/Components/TextInput/RCTMultilineTextInputNativeComponent.js +17 -9
  36. package/Libraries/Components/TextInput/RCTSingelineTextInputNativeComponent.js +13 -5
  37. package/Libraries/Components/TextInput/RCTTextInputViewConfig.js +10 -0
  38. package/Libraries/Components/TextInput/TextInput.js +1 -8
  39. package/Libraries/Components/TextInput/TextInputState.js +10 -2
  40. package/Libraries/Components/TextInput/TextInputState.win32.js +10 -2
  41. package/Libraries/Components/Touchable/Tests/TouchableWin32Test.js.map +1 -1
  42. package/Libraries/Components/Touchable/TouchableBounce.js +1 -0
  43. package/Libraries/Components/Touchable/TouchableHighlight.js +1 -0
  44. package/Libraries/Components/Touchable/TouchableNativeFeedback.js +1 -0
  45. package/Libraries/Components/Touchable/TouchableOpacity.js +7 -1
  46. package/Libraries/Components/Touchable/TouchableWin32.Props.d.ts +3 -1
  47. package/Libraries/Components/Touchable/TouchableWin32.Props.js.map +1 -1
  48. package/Libraries/Components/Touchable/TouchableWithoutFeedback.js +2 -0
  49. package/Libraries/Components/View/ReactNativeViewAttributes.js +1 -0
  50. package/Libraries/Components/View/ReactNativeViewAttributes.win32.js +1 -0
  51. package/Libraries/Components/View/View.win32.js +33 -1
  52. package/Libraries/Components/View/ViewNativeComponent.js +68 -8
  53. package/Libraries/Components/View/ViewPropTypes.js +36 -4
  54. package/Libraries/Components/View/ViewPropTypes.win32.js +36 -4
  55. package/Libraries/Components/View/ViewWin32.Props.d.ts +1 -1
  56. package/Libraries/Components/View/ViewWin32.Props.js.map +1 -1
  57. package/Libraries/Core/Devtools/parseHermesStack.js +1 -1
  58. package/Libraries/Core/ExceptionsManager.js +1 -1
  59. package/Libraries/Core/RawEventEmitter.js +38 -0
  60. package/Libraries/Core/ReactNativeVersion.js +2 -2
  61. package/Libraries/Core/polyfillPromise.js +32 -0
  62. package/Libraries/Core/setUpReactDevTools.js +3 -2
  63. package/Libraries/EventEmitter/NativeEventEmitter.js +3 -3
  64. package/Libraries/EventEmitter/RCTDeviceEventEmitter.js +2 -1
  65. package/Libraries/EventEmitter/__mocks__/NativeEventEmitter.js +3 -3
  66. package/Libraries/Events/CustomEvent.js +32 -0
  67. package/Libraries/Events/EventPolyfill.js +239 -0
  68. package/Libraries/Image/Image.android.js +0 -6
  69. package/Libraries/Image/Image.ios.js +0 -6
  70. package/Libraries/Image/Image.win32.js +2 -8
  71. package/Libraries/Image/ImageViewNativeComponent.js +18 -3
  72. package/Libraries/Image/TextInlineImageNativeComponent.js +23 -15
  73. package/Libraries/Image/resolveAssetSource.win32.js +1 -1
  74. package/Libraries/Inspector/Inspector.js +2 -4
  75. package/Libraries/Inspector/Inspector.win32.js +7 -9
  76. package/Libraries/Interaction/BridgeSpyStallHandler.js +4 -3
  77. package/Libraries/Interaction/InteractionManager.js +1 -12
  78. package/Libraries/Interaction/TaskQueue.js +5 -4
  79. package/Libraries/LayoutAnimation/LayoutAnimation.js +13 -0
  80. package/Libraries/Linking/Linking.js +1 -1
  81. package/Libraries/Lists/FlatList.js +27 -6
  82. package/Libraries/Lists/VirtualizedList.js +71 -55
  83. package/Libraries/Lists/VirtualizedListContext.js +7 -3
  84. package/Libraries/Lists/VirtualizedSectionList.js +2 -2
  85. package/Libraries/Lists/__tests__/{FillRateHelper-test.windows.js → FillRateHelper-test.js} +2 -2
  86. package/Libraries/Lists/__tests__/{FlatList-test.windows.js → FlatList-test.js} +2 -2
  87. package/Libraries/Lists/__tests__/{SectionList-test.windows.js → SectionList-test.js} +14 -14
  88. package/Libraries/Lists/__tests__/{VirtualizeUtils-test.windows.js → VirtualizeUtils-test.js} +3 -3
  89. package/Libraries/Lists/__tests__/{VirtualizedList-test.windows.js → VirtualizedList-test.js} +92 -43
  90. package/Libraries/Lists/__tests__/{VirtualizedSectionList-test.windows.js → VirtualizedSectionList-test.js} +16 -14
  91. package/Libraries/LogBox/Data/LogBoxData.js +2 -2
  92. package/Libraries/LogBox/Data/LogBoxLog.js +1 -1
  93. package/Libraries/LogBox/Data/LogBoxSymbolication.js +1 -1
  94. package/Libraries/LogBox/Data/parseLogBoxLog.js +1 -1
  95. package/Libraries/LogBox/LogBox.js +2 -21
  96. package/Libraries/LogBox/UI/LogBoxInspectorFooter.js +1 -0
  97. package/Libraries/LogBox/UI/LogBoxInspectorHeader.js +2 -1
  98. package/Libraries/NativeComponent/BaseViewConfig.android.js +295 -0
  99. package/Libraries/NativeComponent/BaseViewConfig.ios.js +333 -0
  100. package/Libraries/NativeComponent/BaseViewConfig.win32.js +334 -0
  101. package/Libraries/NativeComponent/NativeComponentRegistry.js +0 -2
  102. package/Libraries/NativeComponent/PlatformBaseViewConfig.js +24 -0
  103. package/Libraries/NativeComponent/StaticViewConfigValidator.js +7 -42
  104. package/Libraries/NativeComponent/ViewConfig.js +4 -4
  105. package/Libraries/NativeComponent/ViewConfigIgnore.js +54 -0
  106. package/Libraries/Network/FormData.js +7 -1
  107. package/Libraries/Network/RCTNetworking.win32.js +1 -1
  108. package/Libraries/Pressability/Pressability.js +115 -46
  109. package/Libraries/Pressability/Pressability.win32.js +174 -69
  110. package/Libraries/Pressability/PressabilityDebug.js +5 -9
  111. package/Libraries/PushNotificationIOS/NativePushNotificationManagerIOS.js +1 -0
  112. package/Libraries/ReactNative/AppContainer.js +1 -1
  113. package/Libraries/ReactNative/{DummyUIManager.js → BridgelessUIManager.js} +62 -40
  114. package/Libraries/ReactNative/PaperUIManager.win32.js +5 -5
  115. package/Libraries/ReactNative/ReactNativeFeatureFlags.js +39 -0
  116. package/Libraries/ReactNative/UIManager.js +2 -3
  117. package/Libraries/ReactNative/renderApplication.js +4 -0
  118. package/Libraries/ReactPrivate/ReactNativePrivateInterface.js +8 -0
  119. package/Libraries/Renderer/implementations/ReactFabric-dev.js +5908 -4906
  120. package/Libraries/Renderer/implementations/ReactFabric-prod.js +2100 -1918
  121. package/Libraries/Renderer/implementations/ReactFabric-profiling.js +2567 -2352
  122. package/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js +5610 -4844
  123. package/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js +1710 -1556
  124. package/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.js +1830 -1639
  125. package/Libraries/Renderer/shims/ReactNativeTypes.js +2 -1
  126. package/Libraries/Renderer/shims/ReactNativeViewConfigRegistry.js +2 -1
  127. package/Libraries/StyleSheet/EdgeInsetsPropType.js +4 -1
  128. package/Libraries/StyleSheet/StyleSheetTypes.js +59 -66
  129. package/Libraries/StyleSheet/normalizeColor.js +1 -1
  130. package/Libraries/StyleSheet/private/_StyleSheetTypesOverrides.js +15 -0
  131. package/Libraries/StyleSheet/private/_TransformStyle.js +53 -0
  132. package/Libraries/Text/Text.js +13 -7
  133. package/Libraries/Text/TextNativeComponent.js +2 -0
  134. package/Libraries/Text/TextNativeComponent.win32.js +2 -0
  135. package/Libraries/Text/TextProps.js +10 -0
  136. package/Libraries/Types/CoreEventTypes.js +13 -1
  137. package/Libraries/Types/CoreEventTypes.win32.js +26 -1
  138. package/Libraries/Utilities/Appearance.js +0 -8
  139. package/Libraries/Utilities/HMRClient.js +1 -1
  140. package/Libraries/Utilities/ReactNativeTestTools.js +1 -0
  141. package/Libraries/Utilities/codegenNativeComponent.js +16 -6
  142. package/Libraries/Utilities/stringifySafe.js +4 -1
  143. package/Libraries/Utilities/useColorScheme.js +9 -15
  144. package/Libraries/Utilities/verifyComponentAttributeEquivalence.js +3 -3
  145. package/Libraries/WebSocket/WebSocket.js +1 -1
  146. package/Libraries/vendor/emitter/_EmitterSubscription.js +1 -1
  147. package/Libraries/vendor/emitter/_EventEmitter.js +1 -1
  148. package/Libraries/vendor/emitter/_EventSubscription.js +1 -1
  149. package/flow/{use-subscription.js → use-sync-external-store.js} +4 -4
  150. package/index.js +30 -25
  151. package/index.win32.js +30 -25
  152. package/jest/preprocessor.js +24 -107
  153. package/jest/preprocessor_DO_NOT_USE.js +122 -0
  154. package/metro.config.js +3 -47
  155. package/overrides.json +39 -46
  156. package/package.json +32 -29
  157. package/rntypes/index.d.ts +19 -7
  158. package/src/Libraries/Components/Touchable/Tests/TouchableWin32Test.tsx +1 -1
  159. package/src/Libraries/Components/Touchable/TouchableWin32.Props.tsx +3 -1
  160. package/src/Libraries/Components/View/ViewWin32.Props.ts +1 -0
  161. package/src/Libraries/Lists/__tests__/__snapshots__/FlatList-test.js.snap +427 -0
  162. package/src/Libraries/Lists/__tests__/__snapshots__/SectionList-test.js.snap +391 -0
  163. package/src/Libraries/Lists/__tests__/__snapshots__/VirtualizeUtils-test.js.snap +3 -0
  164. package/src/Libraries/Lists/__tests__/__snapshots__/VirtualizedList-test.js.snap +4565 -0
  165. package/src/Libraries/Lists/__tests__/__snapshots__/VirtualizedSectionList-test.js.snap +1153 -0
  166. package/src/rntypes/index.d.ts +19 -7
  167. package/typings-index.js +5 -1
  168. package/typings-index.js.map +1 -1
  169. package/Libraries/Components/SegmentedControlIOS/RCTSegmentedControlNativeComponent.js +0 -44
  170. package/Libraries/Components/SegmentedControlIOS/SegmentedControlIOS.android.js +0 -45
  171. package/Libraries/Components/SegmentedControlIOS/SegmentedControlIOS.ios.js +0 -123
  172. package/Libraries/Components/SegmentedControlIOS/SegmentedControlIOS.js +0 -45
  173. package/Libraries/Components/View/ReactNativeViewViewConfig.js +0 -360
  174. package/Libraries/Components/View/ReactNativeViewViewConfig.win32.js +0 -401
  175. package/Libraries/Components/View/ReactNativeViewViewConfigAndroid.js +0 -83
  176. package/Libraries/ReactNative/UIManagerInjection.js +0 -15
  177. package/Libraries/Renderer/implementations/ReactFabric-dev.fb.js +0 -24527
  178. package/Libraries/Renderer/implementations/ReactFabric-prod.fb.js +0 -8309
  179. package/Libraries/Renderer/implementations/ReactFabric-profiling.fb.js +0 -8961
  180. package/Libraries/Renderer/implementations/ReactNativeRenderer-dev.fb.js +0 -24948
  181. package/Libraries/Renderer/implementations/ReactNativeRenderer-prod.fb.js +0 -8400
  182. package/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.fb.js +0 -9049
  183. package/flow/Promise.js +0 -47
@@ -23,14 +23,14 @@ import type {PlatformConfig} from '../AnimatedPlatformConfig';
23
23
 
24
24
  type ExtrapolateType = 'extend' | 'identity' | 'clamp';
25
25
 
26
- export type InterpolationConfigType = {
26
+ export type InterpolationConfigType = $ReadOnly<{
27
27
  inputRange: $ReadOnlyArray<number>,
28
28
  outputRange: $ReadOnlyArray<number> | $ReadOnlyArray<string>,
29
29
  easing?: (input: number) => number,
30
30
  extrapolate?: ExtrapolateType,
31
31
  extrapolateLeft?: ExtrapolateType,
32
32
  extrapolateRight?: ExtrapolateType,
33
- };
33
+ }>;
34
34
 
35
35
  const linear = (t: number) => t;
36
36
 
@@ -46,20 +46,23 @@ function createInterpolation(
46
46
  }
47
47
 
48
48
  const outputRange: Array<number> = (config.outputRange: any);
49
- checkInfiniteRange('outputRange', outputRange);
50
49
 
51
50
  const inputRange = config.inputRange;
52
- checkInfiniteRange('inputRange', inputRange);
53
- checkValidInputRange(inputRange);
54
51
 
55
- invariant(
56
- inputRange.length === outputRange.length,
57
- 'inputRange (' +
58
- inputRange.length +
59
- ') and outputRange (' +
60
- outputRange.length +
61
- ') must have the same length',
62
- );
52
+ if (__DEV__) {
53
+ checkInfiniteRange('outputRange', outputRange);
54
+ checkInfiniteRange('inputRange', inputRange);
55
+ checkValidInputRange(inputRange);
56
+
57
+ invariant(
58
+ inputRange.length === outputRange.length,
59
+ 'inputRange (' +
60
+ inputRange.length +
61
+ ') and outputRange (' +
62
+ outputRange.length +
63
+ ') must have the same length',
64
+ );
65
+ }
63
66
 
64
67
  const easing = config.easing || linear;
65
68
 
@@ -276,16 +279,10 @@ function findRange(input: number, inputRange: $ReadOnlyArray<number>) {
276
279
 
277
280
  function checkValidInputRange(arr: $ReadOnlyArray<number>) {
278
281
  invariant(arr.length >= 2, 'inputRange must have at least 2 elements');
282
+ const message =
283
+ 'inputRange must be monotonically non-decreasing ' + String(arr);
279
284
  for (let i = 1; i < arr.length; ++i) {
280
- invariant(
281
- arr[i] >= arr[i - 1],
282
- /* $FlowFixMe[incompatible-type] (>=0.13.0) - In the addition expression
283
- * below this comment, one or both of the operands may be something that
284
- * doesn't cleanly convert to a string, like undefined, null, and object,
285
- * etc. If you really mean this implicit string conversion, you can do
286
- * something like String(myThing) */
287
- 'inputRange must be monotonically non-decreasing ' + arr,
288
- );
285
+ invariant(arr[i] >= arr[i - 1], message);
289
286
  }
290
287
  }
291
288
 
@@ -130,12 +130,12 @@ class AnimatedNode {
130
130
  if (data.tag !== this.__getNativeTag()) {
131
131
  return;
132
132
  }
133
- this._onAnimatedValueUpdateReceived(data.value);
133
+ this.__onAnimatedValueUpdateReceived(data.value);
134
134
  },
135
135
  );
136
136
  }
137
137
 
138
- _onAnimatedValueUpdateReceived(value: number) {
138
+ __onAnimatedValueUpdateReceived(value: number) {
139
139
  this.__callListeners(value);
140
140
  }
141
141
 
@@ -211,7 +211,7 @@ class AnimatedValue extends AnimatedWithChildren {
211
211
  }
212
212
  }
213
213
 
214
- _onAnimatedValueUpdateReceived(value: number): void {
214
+ __onAnimatedValueUpdateReceived(value: number): void {
215
215
  this._updateValue(value, false /*flush*/);
216
216
  }
217
217
 
@@ -154,7 +154,7 @@ class AppState {
154
154
  case 'focus':
155
155
  // $FlowIssue[invalid-tuple-arity] Flow cannot refine handler based on the event type
156
156
  // $FlowIssue[incompatible-call]
157
- emitter.addListener('appStateFocusChange', listener);
157
+ emitter.removeListener('appStateFocusChange', listener);
158
158
  return;
159
159
  }
160
160
  throw new Error('Trying to unsubscribe from unknown event: ' + type);
@@ -101,7 +101,13 @@ export class URLSearchParams {
101
101
  }
102
102
  const last = this._searchParams.length - 1;
103
103
  return this._searchParams.reduce((acc, curr, index) => {
104
- return acc + curr.join('=') + (index === last ? '' : '&');
104
+ return (
105
+ acc +
106
+ encodeURIComponent(curr[0]) +
107
+ '=' +
108
+ encodeURIComponent(curr[1]) +
109
+ (index === last ? '' : '&')
110
+ );
105
111
  }, '');
106
112
  }
107
113
  }
@@ -146,6 +146,7 @@ type ButtonProps = $ReadOnly<{|
146
146
  onAccessibilityAction?: ?(event: AccessibilityActionEvent) => mixed,
147
147
  accessibilityState?: ?AccessibilityState,
148
148
  accessibilityHint?: ?string,
149
+ accessibilityLanguage?: ?Stringish,
149
150
  |}>;
150
151
 
151
152
  /**
@@ -277,6 +278,7 @@ class Button extends React.Component<ButtonProps> {
277
278
  accessible,
278
279
  accessibilityActions,
279
280
  accessibilityHint,
281
+ accessibilityLanguage,
280
282
  onAccessibilityAction,
281
283
  } = this.props;
282
284
  const buttonStyles = [styles.button];
@@ -320,6 +322,7 @@ class Button extends React.Component<ButtonProps> {
320
322
  onAccessibilityAction={onAccessibilityAction}
321
323
  accessibilityLabel={accessibilityLabel}
322
324
  accessibilityHint={accessibilityHint}
325
+ accessibilityLanguage={accessibilityLanguage}
323
326
  accessibilityRole="button"
324
327
  accessibilityState={accessibilityState}
325
328
  hasTVPreferredFocus={hasTVPreferredFocus}
@@ -11,6 +11,11 @@
11
11
  import type {TurboModule} from '../../TurboModule/RCTExport';
12
12
  import * as TurboModuleRegistry from '../../TurboModule/TurboModuleRegistry';
13
13
 
14
+ /**
15
+ * This file backs native modules that are used internally at Meta
16
+ * and this JS spec was intentionally left here. In the meanwhile this
17
+ * file should not be deleted.
18
+ */
14
19
  export interface Spec extends TurboModule {
15
20
  +open: (options: Object) => Promise<Object>;
16
21
  }
@@ -22,7 +22,7 @@ import type {
22
22
  } from '../View/ViewAccessibility';
23
23
  import {PressabilityDebugView} from '../../Pressability/PressabilityDebug';
24
24
  import usePressability from '../../Pressability/usePressability';
25
- import {normalizeRect, type RectOrSize} from '../../StyleSheet/Rect';
25
+ import {type RectOrSize} from '../../StyleSheet/Rect';
26
26
  import type {
27
27
  LayoutEvent,
28
28
  MouseEvent,
@@ -43,6 +43,7 @@ type Props = $ReadOnly<{|
43
43
  accessibilityActions?: ?$ReadOnlyArray<AccessibilityActionInfo>,
44
44
  accessibilityElementsHidden?: ?boolean,
45
45
  accessibilityHint?: ?Stringish,
46
+ accessibilityLanguage?: ?Stringish,
46
47
  accessibilityIgnoresInvertColors?: ?boolean,
47
48
  accessibilityLabel?: ?Stringish,
48
49
  accessibilityLiveRegion?: ?('none' | 'polite' | 'assertive'),
@@ -181,6 +182,7 @@ function Pressable(props: Props, forwardedRef): React.Node {
181
182
  delayLongPress,
182
183
  disabled,
183
184
  focusable,
185
+ hitSlop,
184
186
  onHoverIn,
185
187
  onHoverOut,
186
188
  onLongPress,
@@ -201,8 +203,6 @@ function Pressable(props: Props, forwardedRef): React.Node {
201
203
 
202
204
  const [pressed, setPressed] = usePressState(testOnly_pressed === true);
203
205
 
204
- const hitSlop = normalizeRect(props.hitSlop);
205
-
206
206
  const accessibilityState =
207
207
  disabled != null
208
208
  ? {...props.accessibilityState, disabled}
@@ -22,7 +22,7 @@ import type {
22
22
  } from '../View/ViewAccessibility';
23
23
  import {PressabilityDebugView} from '../../Pressability/PressabilityDebug';
24
24
  import usePressability from '../../Pressability/usePressability';
25
- import {normalizeRect, type RectOrSize} from '../../StyleSheet/Rect';
25
+ import {type RectOrSize} from '../../StyleSheet/Rect';
26
26
  import type {
27
27
  LayoutEvent,
28
28
  MouseEvent,
@@ -49,6 +49,7 @@ type Props = $ReadOnly<{|
49
49
  accessibilityActions?: ?$ReadOnlyArray<AccessibilityActionInfo>,
50
50
  accessibilityElementsHidden?: ?boolean,
51
51
  accessibilityHint?: ?Stringish,
52
+ accessibilityLanguage?: ?Stringish,
52
53
  accessibilityIgnoresInvertColors?: ?boolean,
53
54
  accessibilityLabel?: ?Stringish,
54
55
  accessibilityLiveRegion?: ?('none' | 'polite' | 'assertive'),
@@ -227,6 +228,7 @@ function Pressable(props: Props, forwardedRef): React.Node {
227
228
  delayLongPress,
228
229
  disabled,
229
230
  focusable,
231
+ hitSlop,
230
232
  onHoverIn,
231
233
  onHoverOut,
232
234
  onLongPress,
@@ -269,8 +271,6 @@ function Pressable(props: Props, forwardedRef): React.Node {
269
271
 
270
272
  const [pressed, setPressed] = usePressState(testOnly_pressed === true);
271
273
 
272
- const hitSlop = normalizeRect(props.hitSlop);
273
-
274
274
  const accessibilityState =
275
275
  disabled != null
276
276
  ? {...props.accessibilityState, disabled}
@@ -9,46 +9,55 @@
9
9
  */
10
10
 
11
11
  import type {ScrollViewNativeProps as Props} from './ScrollViewNativeComponentType';
12
- import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes';
12
+ import type {
13
+ HostComponent,
14
+ PartialViewConfig,
15
+ } from '../../Renderer/shims/ReactNativeTypes';
13
16
  import * as NativeComponentRegistry from '../../NativeComponent/NativeComponentRegistry';
14
17
 
18
+ export const __INTERNAL_VIEW_CONFIG: PartialViewConfig = {
19
+ uiViewClassName: 'AndroidHorizontalScrollView',
20
+ bubblingEventTypes: {},
21
+ directEventTypes: {},
22
+ validAttributes: {
23
+ decelerationRate: true,
24
+ disableIntervalMomentum: true,
25
+ endFillColor: {process: require('../../StyleSheet/processColor')},
26
+ fadingEdgeLength: true,
27
+ nestedScrollEnabled: true,
28
+ overScrollMode: true,
29
+ pagingEnabled: true,
30
+ persistentScrollbar: true,
31
+ scrollEnabled: true,
32
+ scrollPerfTag: true,
33
+ sendMomentumEvents: true,
34
+ showsHorizontalScrollIndicator: true,
35
+ snapToAlignment: true,
36
+ snapToEnd: true,
37
+ snapToInterval: true,
38
+ snapToStart: true,
39
+ snapToOffsets: true,
40
+ contentOffset: true,
41
+ borderBottomLeftRadius: true,
42
+ borderBottomRightRadius: true,
43
+ borderRadius: true,
44
+ borderStyle: true,
45
+ borderRightColor: {process: require('../../StyleSheet/processColor')},
46
+ borderColor: {process: require('../../StyleSheet/processColor')},
47
+ borderBottomColor: {process: require('../../StyleSheet/processColor')},
48
+ borderTopLeftRadius: true,
49
+ borderTopColor: {process: require('../../StyleSheet/processColor')},
50
+ removeClippedSubviews: true,
51
+ borderTopRightRadius: true,
52
+ borderLeftColor: {process: require('../../StyleSheet/processColor')},
53
+ pointerEvents: true,
54
+ },
55
+ };
56
+
15
57
  const AndroidHorizontalScrollViewNativeComponent: HostComponent<Props> =
16
- NativeComponentRegistry.get<Props>('AndroidHorizontalScrollView', () => ({
17
- uiViewClassName: 'AndroidHorizontalScrollView',
18
- bubblingEventTypes: {},
19
- directEventTypes: {},
20
- validAttributes: {
21
- decelerationRate: true,
22
- disableIntervalMomentum: true,
23
- endFillColor: {process: require('../../StyleSheet/processColor')},
24
- fadingEdgeLength: true,
25
- nestedScrollEnabled: true,
26
- overScrollMode: true,
27
- pagingEnabled: true,
28
- persistentScrollbar: true,
29
- scrollEnabled: true,
30
- scrollPerfTag: true,
31
- sendMomentumEvents: true,
32
- showsHorizontalScrollIndicator: true,
33
- snapToAlignment: true,
34
- snapToEnd: true,
35
- snapToInterval: true,
36
- snapToStart: true,
37
- snapToOffsets: true,
38
- contentOffset: true,
39
- borderBottomLeftRadius: true,
40
- borderBottomRightRadius: true,
41
- borderRadius: true,
42
- borderStyle: true,
43
- borderRightColor: {process: require('../../StyleSheet/processColor')},
44
- borderColor: {process: require('../../StyleSheet/processColor')},
45
- borderBottomColor: {process: require('../../StyleSheet/processColor')},
46
- borderTopLeftRadius: true,
47
- borderTopColor: {process: require('../../StyleSheet/processColor')},
48
- removeClippedSubviews: true,
49
- borderTopRightRadius: true,
50
- borderLeftColor: {process: require('../../StyleSheet/processColor')},
51
- },
52
- }));
58
+ NativeComponentRegistry.get<Props>(
59
+ 'AndroidHorizontalScrollView',
60
+ () => __INTERNAL_VIEW_CONFIG,
61
+ );
53
62
 
54
63
  export default AndroidHorizontalScrollViewNativeComponent;
@@ -8,16 +8,24 @@
8
8
  * @flow
9
9
  */
10
10
 
11
- import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes';
11
+ import type {
12
+ HostComponent,
13
+ PartialViewConfig,
14
+ } from '../../Renderer/shims/ReactNativeTypes';
12
15
  import * as NativeComponentRegistry from '../../NativeComponent/NativeComponentRegistry';
13
16
  import type {ViewProps as Props} from '../View/ViewPropTypes';
14
17
 
18
+ export const __INTERNAL_VIEW_CONFIG: PartialViewConfig = {
19
+ uiViewClassName: 'RCTScrollContentView',
20
+ bubblingEventTypes: {},
21
+ directEventTypes: {},
22
+ validAttributes: {},
23
+ };
24
+
15
25
  const ScrollContentViewNativeComponent: HostComponent<Props> =
16
- NativeComponentRegistry.get<Props>('RCTScrollContentView', () => ({
17
- uiViewClassName: 'RCTScrollContentView',
18
- bubblingEventTypes: {},
19
- directEventTypes: {},
20
- validAttributes: {},
21
- }));
26
+ NativeComponentRegistry.get<Props>(
27
+ 'RCTScrollContentView',
28
+ () => __INTERNAL_VIEW_CONFIG,
29
+ );
22
30
 
23
31
  export default ScrollContentViewNativeComponent;
@@ -675,7 +675,7 @@ type State = {|
675
675
 
676
676
  const IS_ANIMATING_TOUCH_START_THRESHOLD_MS = 16;
677
677
 
678
- type ScrollViewComponentStatics = $ReadOnly<{|
678
+ export type ScrollViewComponentStatics = $ReadOnly<{|
679
679
  Context: typeof ScrollViewContext,
680
680
  |}>;
681
681
 
@@ -9,11 +9,15 @@
9
9
  */
10
10
 
11
11
  import type {ScrollViewNativeProps as Props} from './ScrollViewNativeComponentType';
12
- import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes';
12
+ import type {
13
+ HostComponent,
14
+ PartialViewConfig,
15
+ } from '../../Renderer/shims/ReactNativeTypes';
13
16
  import * as NativeComponentRegistry from '../../NativeComponent/NativeComponentRegistry';
17
+ import {ConditionallyIgnoredEventHandlers} from '../../NativeComponent/ViewConfigIgnore';
14
18
  import Platform from '../../Utilities/Platform';
15
19
 
16
- const RCTScrollViewViewConfig =
20
+ export const __INTERNAL_VIEW_CONFIG: PartialViewConfig =
17
21
  Platform.OS === 'android'
18
22
  ? {
19
23
  uiViewClassName: 'RCTScrollView',
@@ -70,6 +74,7 @@ const RCTScrollViewViewConfig =
70
74
  removeClippedSubviews: true,
71
75
  borderTopRightRadius: true,
72
76
  borderLeftColor: {process: require('../../StyleSheet/processColor')},
77
+ pointerEvents: true,
73
78
  },
74
79
  }
75
80
  : {
@@ -138,13 +143,21 @@ const RCTScrollViewViewConfig =
138
143
  snapToOffsets: true,
139
144
  snapToStart: true,
140
145
  zoomScale: true,
146
+ ...ConditionallyIgnoredEventHandlers({
147
+ onScrollBeginDrag: true,
148
+ onMomentumScrollEnd: true,
149
+ onScrollEndDrag: true,
150
+ onMomentumScrollBegin: true,
151
+ onScrollToTop: true,
152
+ onScroll: true,
153
+ }),
141
154
  },
142
155
  };
143
156
 
144
157
  const ScrollViewNativeComponent: HostComponent<Props> =
145
158
  NativeComponentRegistry.get<Props>(
146
159
  'RCTScrollView',
147
- () => RCTScrollViewViewConfig,
160
+ () => __INTERNAL_VIEW_CONFIG,
148
161
  );
149
162
 
150
163
  export default ScrollViewNativeComponent;
@@ -170,7 +170,9 @@ class ScrollViewStickyHeader extends React.Component<Props, State> {
170
170
 
171
171
  this.props.onLayout(event);
172
172
  const child = React.Children.only(this.props.children);
173
- if (child.props.onLayout) {
173
+ if (child.props.onCellLayout) {
174
+ child.props.onCellLayout(event, child.props.cellKey, child.props.index);
175
+ } else if (child.props.onLayout) {
174
176
  child.props.onLayout(event);
175
177
  }
176
178
  };
@@ -228,7 +228,6 @@ const Slider = (
228
228
  }
229
229
  : null;
230
230
 
231
- const onChangeEvent = onValueChangeEvent;
232
231
  const onSlidingCompleteEvent = onSlidingComplete
233
232
  ? (event: Event) => {
234
233
  onSlidingComplete(event.nativeEvent.value);
@@ -250,7 +249,6 @@ const Slider = (
250
249
  disabled={disabled}
251
250
  maximumValue={maximumValue}
252
251
  minimumValue={minimumValue}
253
- onChange={onChangeEvent}
254
252
  onResponderTerminationRequest={() => false}
255
253
  onSlidingComplete={onSlidingCompleteEvent}
256
254
  onStartShouldSetResponder={() => true}
@@ -47,7 +47,6 @@ type NativeProps = $ReadOnly<{|
47
47
  value?: WithDefault<Double, 0>,
48
48
 
49
49
  // Events
50
- onChange?: ?BubblingEventHandler<Event>,
51
50
  onValueChange?: ?BubblingEventHandler<Event>,
52
51
  onSlidingComplete?: ?DirectEventHandler<Event>,
53
52
  |}>;
@@ -471,7 +471,12 @@ class StatusBar extends React.Component<Props> {
471
471
  if (!oldProps || oldProps.hidden.value !== mergedProps.hidden.value) {
472
472
  NativeStatusBarManagerAndroid.setHidden(mergedProps.hidden.value);
473
473
  }
474
- if (!oldProps || oldProps.translucent !== mergedProps.translucent) {
474
+ // Activities are not translucent by default, so always set if true.
475
+ if (
476
+ !oldProps ||
477
+ oldProps.translucent !== mergedProps.translucent ||
478
+ mergedProps.translucent
479
+ ) {
475
480
  NativeStatusBarManagerAndroid.setTranslucent(mergedProps.translucent);
476
481
  }
477
482
  }
@@ -185,8 +185,18 @@ const SwitchWithForwardedRef: React.AbstractComponent<
185
185
  }, [value, native]);
186
186
 
187
187
  if (Platform.OS === 'android') {
188
+ const {accessibilityState} = restProps;
189
+ const _disabled =
190
+ disabled != null ? disabled : accessibilityState?.disabled;
191
+
192
+ const _accessibilityState =
193
+ _disabled !== accessibilityState?.disabled
194
+ ? {...accessibilityState, disabled: _disabled}
195
+ : accessibilityState;
196
+
188
197
  const platformProps = {
189
- enabled: disabled !== true,
198
+ accessibilityState: _accessibilityState,
199
+ enabled: _disabled !== true,
190
200
  on: value === true,
191
201
  style,
192
202
  thumbTintColor: thumbColor,