@office-iss/react-native-win32 0.0.0-canary.285 → 0.0.0-canary.286

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 (217) hide show
  1. package/.flowconfig +1 -1
  2. package/CHANGELOG.json +16 -1
  3. package/CHANGELOG.md +16 -8
  4. package/IntegrationTests/LayoutEventsTest.js +16 -11
  5. package/Libraries/Alert/Alert.js +51 -5
  6. package/Libraries/Alert/Alert.win32.js +50 -5
  7. package/Libraries/Animated/animations/Animation.js +1 -4
  8. package/Libraries/Animated/nodes/AnimatedObject.js +1 -0
  9. package/Libraries/AppState/AppState.js +24 -7
  10. package/Libraries/BatchedBridge/MessageQueue.js +3 -2
  11. package/Libraries/BatchedBridge/NativeModules.js +2 -1
  12. package/Libraries/Blob/Blob.js +1 -1
  13. package/Libraries/Blob/FileReader_old.js +9 -9
  14. package/Libraries/Blob/URL.js +1 -1
  15. package/Libraries/Blob/URLSearchParams.js +9 -9
  16. package/Libraries/Components/Button.js +3 -3
  17. package/Libraries/Components/Button.win32.js +3 -6
  18. package/Libraries/Components/LayoutConformance/LayoutConformance.js +1 -1
  19. package/Libraries/Components/Pressable/Pressable.js +9 -9
  20. package/Libraries/Components/Pressable/Pressable.win32.js +9 -9
  21. package/Libraries/Components/Pressable/useAndroidRippleForView.js +7 -7
  22. package/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.js +7 -1
  23. package/Libraries/Components/RefreshControl/RefreshControl.js +1 -1
  24. package/Libraries/Components/ScrollView/ScrollView.js +74 -59
  25. package/Libraries/Components/ScrollView/ScrollViewNativeComponent.js +5 -5
  26. package/Libraries/Components/ScrollView/ScrollViewNativeComponentType.js +5 -2
  27. package/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +3 -3
  28. package/Libraries/Components/Switch/Switch.js +2 -2
  29. package/Libraries/Components/TextInput/RCTTextInputViewConfig.js +3 -1
  30. package/Libraries/Components/TextInput/TextInput.flow.js +15 -13
  31. package/Libraries/Components/TextInput/TextInput.js +16 -14
  32. package/Libraries/Components/TextInput/TextInput.win32.js +16 -14
  33. package/Libraries/Components/TextInput/TextInputState.js +1 -1
  34. package/Libraries/Components/TextInput/TextInputState.win32.js +1 -1
  35. package/Libraries/Components/Touchable/Touchable.js +16 -16
  36. package/Libraries/Components/Touchable/Touchable.win32.js +16 -16
  37. package/Libraries/Components/Touchable/TouchableNativeFeedback.js +2 -2
  38. package/Libraries/Components/Touchable/TouchableWithoutFeedback.js +7 -7
  39. package/Libraries/Components/View/ReactNativeStyleAttributes.js +16 -2
  40. package/Libraries/Components/View/ViewAccessibility.js +243 -3
  41. package/Libraries/Components/View/ViewAccessibility.win32.js +243 -3
  42. package/Libraries/Components/View/ViewPropTypes.d.ts +14 -14
  43. package/Libraries/Components/View/ViewPropTypes.js +35 -226
  44. package/Libraries/Components/View/ViewPropTypes.win32.js +37 -229
  45. package/Libraries/Core/Devtools/symbolicateStackTrace.js +1 -1
  46. package/Libraries/Core/InitializeCore.js +2 -1
  47. package/Libraries/Core/ReactNativeVersion.js +1 -1
  48. package/Libraries/Core/Timers/JSTimers.js +6 -4
  49. package/Libraries/Core/setUpBatchedBridge.js +9 -5
  50. package/Libraries/Core/setUpDeveloperTools.js +3 -29
  51. package/Libraries/Core/setUpReactDevTools.js +1 -1
  52. package/Libraries/Core/setUpReactRefresh.js +1 -1
  53. package/Libraries/Core/setUpXHR.js +5 -2
  54. package/Libraries/EventEmitter/NativeEventEmitter.js +8 -2
  55. package/Libraries/EventEmitter/RCTDeviceEventEmitter.js +5 -4
  56. package/Libraries/EventEmitter/__mocks__/NativeEventEmitter.js +3 -2
  57. package/Libraries/Events/CustomEvent.js +1 -1
  58. package/Libraries/Events/EventPolyfill.js +2 -2
  59. package/Libraries/Image/AssetSourceResolver.js +1 -1
  60. package/Libraries/Image/ImageProps.js +8 -5
  61. package/Libraries/Image/ImageViewNativeComponent.js +1 -1
  62. package/Libraries/Image/resolveAssetSource.win32.js +1 -1
  63. package/Libraries/Interaction/InteractionManager.js +1 -1
  64. package/Libraries/Interaction/InteractionManagerStub.js +9 -1
  65. package/Libraries/Interaction/JSEventLoopWatchdog.js +1 -1
  66. package/Libraries/Interaction/PanResponder.js +32 -29
  67. package/Libraries/Interaction/TaskQueue.js +1 -1
  68. package/Libraries/LayoutAnimation/LayoutAnimation.js +18 -4
  69. package/Libraries/Lists/FillRateHelper.js +3 -3
  70. package/Libraries/Lists/FlatList.js +13 -13
  71. package/Libraries/Lists/SectionList.js +3 -1
  72. package/Libraries/Lists/SectionListModern.js +3 -1
  73. package/Libraries/Lists/ViewabilityHelper.js +3 -2
  74. package/Libraries/Lists/VirtualizeUtils.js +3 -3
  75. package/Libraries/Lists/VirtualizedList.js +5 -5
  76. package/Libraries/Lists/VirtualizedListContext.js +4 -2
  77. package/Libraries/Lists/VirtualizedSectionList.js +4 -2
  78. package/Libraries/LogBox/LogBox.js +9 -1
  79. package/Libraries/LogBox/UI/AnsiHighlight.js +7 -3
  80. package/Libraries/LogBox/UI/LogBoxButton.js +4 -2
  81. package/Libraries/LogBox/UI/LogBoxInspector.js +1 -1
  82. package/Libraries/LogBox/UI/LogBoxInspectorFooter.js +11 -3
  83. package/Libraries/LogBox/UI/LogBoxInspectorFooterButton.js +2 -0
  84. package/Libraries/LogBox/UI/LogBoxInspectorHeader.js +8 -2
  85. package/Libraries/LogBox/UI/LogBoxInspectorHeader.win32.js +8 -2
  86. package/Libraries/LogBox/UI/LogBoxInspectorHeaderButton.js +2 -0
  87. package/Libraries/LogBox/UI/LogBoxInspectorMessageHeader.js +4 -2
  88. package/Libraries/LogBox/UI/LogBoxInspectorReactFrames.js +3 -1
  89. package/Libraries/LogBox/UI/LogBoxInspectorReactFrames.win32.js +3 -1
  90. package/Libraries/LogBox/UI/LogBoxInspectorSourceMapStatus.js +2 -2
  91. package/Libraries/LogBox/UI/LogBoxInspectorStackFrame.js +5 -3
  92. package/Libraries/LogBox/UI/LogBoxInspectorStackFrame.win32.js +5 -3
  93. package/Libraries/LogBox/UI/LogBoxNotification.js +6 -2
  94. package/Libraries/LogBox/UI/LogBoxNotificationCountBadge.js +3 -1
  95. package/Libraries/LogBox/UI/LogBoxNotificationDismissButton.js +2 -0
  96. package/Libraries/LogBox/UI/LogBoxNotificationMessage.js +4 -1
  97. package/Libraries/Modal/Modal.js +74 -81
  98. package/Libraries/NativeComponent/BaseViewConfig.android.js +16 -6
  99. package/Libraries/NativeComponent/BaseViewConfig.ios.js +19 -9
  100. package/Libraries/NativeComponent/BaseViewConfig.win32.js +19 -9
  101. package/Libraries/NativeComponent/StaticViewConfigValidator.js +5 -1
  102. package/Libraries/Network/FormData.js +1 -1
  103. package/Libraries/Network/XMLHttpRequest.js +5 -6
  104. package/Libraries/Network/XMLHttpRequest_new.js +3 -2
  105. package/Libraries/Network/XMLHttpRequest_old.js +3 -2
  106. package/Libraries/Network/convertRequestBody.js +4 -3
  107. package/Libraries/Network/fetch.js +4 -3
  108. package/Libraries/PermissionsAndroid/PermissionsAndroid.js +63 -61
  109. package/Libraries/Pressability/Pressability.js +23 -23
  110. package/Libraries/Pressability/Pressability.win32.js +23 -23
  111. package/Libraries/PushNotificationIOS/PushNotificationIOS.js +119 -16
  112. package/Libraries/ReactNative/AppContainer-dev.js +2 -1
  113. package/Libraries/ReactNative/AppRegistry.js +3 -3
  114. package/Libraries/ReactNative/PaperUIManager.js +3 -2
  115. package/Libraries/ReactNative/PaperUIManager.win32.js +3 -2
  116. package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstance.js +2 -1
  117. package/Libraries/ReactNative/RootTag.js +1 -1
  118. package/Libraries/ReactNative/getNativeComponentAttributes.js +4 -4
  119. package/Libraries/ReactPrivate/ReactNativePrivateInterface.js +6 -4
  120. package/Libraries/Renderer/shims/ReactNativeTypes.js +4 -5
  121. package/Libraries/Settings/Settings.js +2 -2
  122. package/Libraries/Settings/Settings.win32.js +2 -2
  123. package/Libraries/Share/Share.js +10 -3
  124. package/Libraries/StyleSheet/PlatformColorValueTypes.ios.js +1 -1
  125. package/Libraries/StyleSheet/StyleSheet.js +1 -1
  126. package/Libraries/StyleSheet/StyleSheet.win32.js +2 -2
  127. package/Libraries/StyleSheet/__flowtests__/StyleSheet-flowtest.js +1 -1
  128. package/Libraries/StyleSheet/flattenStyle.js +1 -1
  129. package/Libraries/StyleSheet/normalizeColor.js +1 -1
  130. package/Libraries/StyleSheet/processAspectRatio.js +1 -1
  131. package/Libraries/StyleSheet/processColor.js +2 -2
  132. package/Libraries/StyleSheet/processFilter.js +4 -0
  133. package/Libraries/StyleSheet/processFontVariant.js +1 -1
  134. package/Libraries/StyleSheet/processTransform.js +1 -1
  135. package/Libraries/StyleSheet/setNormalizedColorAlpha.js +1 -1
  136. package/Libraries/Text/Text.js +15 -15
  137. package/Libraries/Text/Text.win32.js +15 -15
  138. package/Libraries/Text/TextAncestor.js +1 -1
  139. package/Libraries/Text/TextNativeComponent.js +2 -2
  140. package/Libraries/Text/TextNativeComponent.win32.js +2 -2
  141. package/Libraries/Text/TextProps.js +11 -11
  142. package/Libraries/Text/TextProps.win32.js +11 -11
  143. package/Libraries/Types/CodegenTypes.js +3 -3
  144. package/Libraries/Types/CoreEventTypes.js +103 -72
  145. package/Libraries/Types/CoreEventTypes.win32.js +115 -79
  146. package/Libraries/UTFSequence.js +2 -1
  147. package/Libraries/Utilities/BackHandler.android.js +1 -1
  148. package/Libraries/Utilities/BackHandler.ios.js +5 -5
  149. package/Libraries/Utilities/BackHandler.win32.js +1 -1
  150. package/Libraries/Utilities/DevLoadingView.js +1 -1
  151. package/Libraries/Utilities/DevSettings.js +1 -1
  152. package/Libraries/Utilities/DeviceInfo.js +1 -1
  153. package/Libraries/Utilities/DeviceInfo.win32.js +1 -1
  154. package/Libraries/Utilities/FeatureDetection.js +2 -4
  155. package/Libraries/Utilities/FocusManager.win32.js +3 -3
  156. package/Libraries/Utilities/GlobalPerformanceLogger.js +1 -1
  157. package/Libraries/Utilities/HMRClient.js +5 -33
  158. package/Libraries/Utilities/HMRClientProdShim.js +1 -2
  159. package/Libraries/Utilities/Platform.android.js +2 -2
  160. package/Libraries/Utilities/Platform.ios.js +2 -2
  161. package/Libraries/Utilities/Platform.win32.js +2 -2
  162. package/Libraries/Utilities/{Platform.flow.win32.js → PlatformTypes.js} +1 -0
  163. package/Libraries/Utilities/PolyfillFunctions.js +3 -5
  164. package/Libraries/Utilities/RCTLog.js +1 -1
  165. package/Libraries/Utilities/ReactNativeTestTools.js +1 -1
  166. package/Libraries/Utilities/SceneTracker.js +1 -1
  167. package/Libraries/Utilities/__mocks__/GlobalPerformanceLogger.js +2 -2
  168. package/Libraries/Utilities/binaryToBase64.js +1 -1
  169. package/Libraries/Utilities/deepFreezeAndThrowOnMutationInDev.js +1 -1
  170. package/Libraries/Utilities/defineLazyObjectProperty.js +1 -1
  171. package/Libraries/Utilities/differ/deepDiffer.js +3 -3
  172. package/Libraries/Utilities/differ/insetsDiffer.js +3 -3
  173. package/Libraries/Utilities/differ/matricesDiffer.js +3 -6
  174. package/Libraries/Utilities/differ/pointsDiffer.js +3 -3
  175. package/Libraries/Utilities/differ/sizesDiffer.js +3 -3
  176. package/Libraries/Utilities/dismissKeyboard.js +1 -1
  177. package/Libraries/Utilities/infoLog.js +1 -1
  178. package/Libraries/Utilities/logError.js +1 -1
  179. package/Libraries/Utilities/mapWithSeparator.js +1 -1
  180. package/Libraries/Utilities/warnOnce.js +1 -1
  181. package/Libraries/Vibration/Vibration.js +3 -3
  182. package/Libraries/vendor/emitter/EventEmitter.js +21 -9
  183. package/index.js +113 -199
  184. package/index.win32.js +21 -13
  185. package/jest/setup.js +9 -2
  186. package/overrides.json +35 -34
  187. package/package.json +15 -15
  188. package/src/private/devmenu/DevMenu.js +1 -1
  189. package/src/private/featureflags/ReactNativeFeatureFlags.js +22 -23
  190. package/src/private/featureflags/ReactNativeFeatureFlagsBase.js +4 -7
  191. package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +5 -4
  192. package/src/private/inspector/BoxInspector.js +1 -1
  193. package/src/private/inspector/ElementBox.js +3 -2
  194. package/src/private/inspector/ElementProperties.js +5 -3
  195. package/src/private/inspector/Inspector.js +2 -2
  196. package/src/private/inspector/InspectorOverlay.js +4 -4
  197. package/src/private/inspector/InspectorPanel.js +1 -1
  198. package/src/private/inspector/NetworkOverlay.js +4 -4
  199. package/src/private/inspector/PerformanceOverlay.js +3 -2
  200. package/src/private/inspector/ReactDevToolsOverlay.js +3 -3
  201. package/src/private/inspector/StyleInspector.js +1 -1
  202. package/src/private/inspector/XHRInterceptor.js +5 -2
  203. package/src/private/renderer/errorhandling/ErrorHandlers.js +2 -1
  204. package/src/private/specs_DEPRECATED/modules/NativeExceptionsManager.js +1 -1
  205. package/src/private/specs_DEPRECATED/modules/NativePermissionsAndroid.js +5 -4
  206. package/src/private/specs_DEPRECATED/modules/NativeUIManager.js +92 -19
  207. package/src/private/webapis/dom/events/CustomEvent.js +5 -7
  208. package/src/private/webapis/dom/events/Event.js +5 -5
  209. package/src/private/webapis/dom/nodes/internals/ReactNativeDocumentInstanceHandle.js +1 -0
  210. package/src/private/webapis/html/events/MessageEvent.js +12 -19
  211. package/src/private/webapis/websockets/events/CloseEvent.js +9 -11
  212. package/src/private/webapis/xhr/events/ProgressEvent.js +9 -11
  213. package/src-win/Libraries/Components/View/ViewPropTypes.d.ts +14 -14
  214. package/Libraries/Alert/Alert.flow.js +0 -62
  215. package/Libraries/Alert/RCTAlertManager.flow.js +0 -20
  216. package/Libraries/Utilities/Platform.flow.js +0 -91
  217. package/flow/react.js +0 -15
@@ -28,7 +28,7 @@ export default function LogBoxInspectorFooter(props: Props): React.Node {
28
28
  return (
29
29
  <View style={styles.root}>
30
30
  <View style={styles.button}>
31
- <Text style={styles.syntaxErrorText}>
31
+ <Text id="logbox_dismissable_text" style={styles.syntaxErrorText}>
32
32
  This error cannot be dismissed.
33
33
  </Text>
34
34
  </View>
@@ -38,8 +38,16 @@ export default function LogBoxInspectorFooter(props: Props): React.Node {
38
38
 
39
39
  return (
40
40
  <View style={styles.root}>
41
- <LogBoxInspectorFooterButton text="Dismiss" onPress={props.onDismiss} />
42
- <LogBoxInspectorFooterButton text="Minimize" onPress={props.onMinimize} />
41
+ <LogBoxInspectorFooterButton
42
+ id="logbox_footer_button_dismiss"
43
+ text="Dismiss"
44
+ onPress={props.onDismiss}
45
+ />
46
+ <LogBoxInspectorFooterButton
47
+ id="logbox_footer_button_minimize"
48
+ text="Minimize"
49
+ onPress={props.onMinimize}
50
+ />
43
51
  </View>
44
52
  );
45
53
  }
@@ -17,6 +17,7 @@ import * as LogBoxStyle from './LogBoxStyle';
17
17
  import * as React from 'react';
18
18
 
19
19
  type ButtonProps = $ReadOnly<{
20
+ id: string,
20
21
  onPress: () => void,
21
22
  text: string,
22
23
  }>;
@@ -27,6 +28,7 @@ export default function LogBoxInspectorFooterButton(
27
28
  return (
28
29
  <SafeAreaView style={styles.button}>
29
30
  <LogBoxButton
31
+ id={props.id}
30
32
  backgroundColor={{
31
33
  default: 'transparent',
32
34
  pressed: LogBoxStyle.getBackgroundDarkColor(),
@@ -36,7 +36,9 @@ export default function LogBoxInspectorHeader(props: Props): React.Node {
36
36
  <LogBoxInspectorHeaderSafeArea style={styles[props.level]}>
37
37
  <View style={styles.header}>
38
38
  <View style={styles.title}>
39
- <Text style={styles.titleText}>Failed to compile</Text>
39
+ <Text style={styles.titleText} id="logbox_header_title_text">
40
+ Failed to compile
41
+ </Text>
40
42
  </View>
41
43
  </View>
42
44
  </LogBoxInspectorHeaderSafeArea>
@@ -54,15 +56,19 @@ export default function LogBoxInspectorHeader(props: Props): React.Node {
54
56
  <LogBoxInspectorHeaderSafeArea style={styles[props.level]}>
55
57
  <View style={styles.header}>
56
58
  <LogBoxInspectorHeaderButton
59
+ id="logbox_header_button_prev"
57
60
  disabled={props.total <= 1}
58
61
  level={props.level}
59
62
  image={require('./LogBoxImages/chevron-left.png')}
60
63
  onPress={() => props.onSelectIndex(prevIndex)}
61
64
  />
62
65
  <View style={styles.title}>
63
- <Text style={styles.titleText}>{titleText}</Text>
66
+ <Text style={styles.titleText} id="logbox_header_title_text">
67
+ {titleText}
68
+ </Text>
64
69
  </View>
65
70
  <LogBoxInspectorHeaderButton
71
+ id="logbox_header_button_next"
66
72
  disabled={props.total <= 1}
67
73
  level={props.level}
68
74
  image={require('./LogBoxImages/chevron-right.png')}
@@ -38,7 +38,9 @@ export default function LogBoxInspectorHeader(props: Props): React.Node {
38
38
  <LogBoxInspectorHeaderSafeArea style={styles[props.level]}>
39
39
  <View style={styles.header}>
40
40
  <View style={styles.title}>
41
- <Text style={styles.titleText}>Failed to compile</Text>
41
+ <Text style={styles.titleText} id="logbox_header_title_text">
42
+ Failed to compile
43
+ </Text>
42
44
  </View>
43
45
  </View>
44
46
  </LogBoxInspectorHeaderSafeArea>
@@ -56,15 +58,19 @@ export default function LogBoxInspectorHeader(props: Props): React.Node {
56
58
  <LogBoxInspectorHeaderSafeArea style={styles[props.level]}>
57
59
  <View style={styles.header}>
58
60
  <LogBoxInspectorHeaderButton
61
+ id="logbox_header_button_prev"
59
62
  disabled={props.total <= 1}
60
63
  level={props.level}
61
64
  image={new String('←')}
62
65
  onPress={() => props.onSelectIndex(prevIndex)}
63
66
  />
64
67
  <View style={styles.title}>
65
- <Text style={styles.titleText}>{titleText}</Text>
68
+ <Text style={styles.titleText} id="logbox_header_title_text">
69
+ {titleText}
70
+ </Text>
66
71
  </View>
67
72
  <LogBoxInspectorHeaderButton
73
+ id="logbox_header_button_next"
68
74
  disabled={props.total <= 1}
69
75
  level={props.level}
70
76
  image={new String('→')}
@@ -39,6 +39,7 @@ const backgroundForLevel = (level: LogLevel) =>
39
39
 
40
40
  export default function LogBoxInspectorHeaderButton(
41
41
  props: $ReadOnly<{
42
+ id: string,
42
43
  disabled: boolean,
43
44
  image: ImageSource,
44
45
  level: LogLevel,
@@ -47,6 +48,7 @@ export default function LogBoxInspectorHeaderButton(
47
48
  ): React.Node {
48
49
  return (
49
50
  <LogBoxButton
51
+ id={props.id}
50
52
  backgroundColor={backgroundForLevel(props.level)}
51
53
  onPress={props.disabled ? null : props.onPress}
52
54
  style={styles.button}>
@@ -46,11 +46,13 @@ function LogBoxInspectorMessageHeader(props: Props): React.Node {
46
46
  return (
47
47
  <View style={messageStyles.body}>
48
48
  <View style={messageStyles.heading}>
49
- <Text style={[messageStyles.headingText, messageStyles[props.level]]}>
49
+ <Text
50
+ style={[messageStyles.headingText, messageStyles[props.level]]}
51
+ id="logbox_message_title_text">
50
52
  {props.title}
51
53
  </Text>
52
54
  </View>
53
- <Text style={messageStyles.bodyText}>
55
+ <Text style={messageStyles.bodyText} id="logbox_message_contents_text">
54
56
  <LogBoxMessage
55
57
  maxLength={props.collapsed ? SHOW_MORE_MESSAGE_LENGTH : Infinity}
56
58
  message={props.message}
@@ -101,7 +101,9 @@ function LogBoxInspectorReactFrames(props: Props): React.Node {
101
101
  }
102
102
  style={componentStyles.frame}>
103
103
  <View style={componentStyles.component}>
104
- <Text style={componentStyles.frameName}>
104
+ <Text
105
+ id="logbox_component_stack_frame_text"
106
+ style={componentStyles.frameName}>
105
107
  <Text style={componentStyles.bracket}>{'<'}</Text>
106
108
  {frame.content}
107
109
  <Text style={componentStyles.bracket}>{' />'}</Text>
@@ -101,7 +101,9 @@ function LogBoxInspectorReactFrames(props: Props): React.Node {
101
101
  }
102
102
  style={componentStyles.frame}>
103
103
  <View style={componentStyles.component}>
104
- <Text style={componentStyles.frameName}>
104
+ <Text
105
+ id="logbox_component_stack_frame_text"
106
+ style={componentStyles.frameName}>
105
107
  <Text style={componentStyles.bracket}>{'<'}</Text>
106
108
  {frame.content}
107
109
  <Text style={componentStyles.bracket}>{' />'}</Text>
@@ -8,7 +8,7 @@
8
8
  * @format
9
9
  */
10
10
 
11
- import type {PressEvent} from '../../Types/CoreEventTypes';
11
+ import type {GestureResponderEvent} from '../../Types/CoreEventTypes';
12
12
 
13
13
  import Animated from '../../Animated/Animated';
14
14
  import Easing from '../../Animated/Easing';
@@ -19,7 +19,7 @@ import * as LogBoxStyle from './LogBoxStyle';
19
19
  import * as React from 'react';
20
20
 
21
21
  type Props = $ReadOnly<{
22
- onPress?: ?(event: PressEvent) => void,
22
+ onPress?: ?(event: GestureResponderEvent) => void,
23
23
  status: 'COMPLETE' | 'FAILED' | 'NONE' | 'PENDING',
24
24
  }>;
25
25
 
@@ -9,7 +9,7 @@
9
9
  */
10
10
 
11
11
  import type {StackFrame} from '../../Core/NativeExceptionsManager';
12
- import type {PressEvent} from '../../Types/CoreEventTypes';
12
+ import type {GestureResponderEvent} from '../../Types/CoreEventTypes';
13
13
 
14
14
  import View from '../../Components/View/View';
15
15
  import StyleSheet from '../../StyleSheet/StyleSheet';
@@ -21,7 +21,7 @@ import * as React from 'react';
21
21
 
22
22
  type Props = $ReadOnly<{
23
23
  frame: StackFrame,
24
- onPress?: ?(event: PressEvent) => void,
24
+ onPress?: ?(event: GestureResponderEvent) => void,
25
25
  }>;
26
26
 
27
27
  function LogBoxInspectorStackFrame(props: Props): React.Node {
@@ -43,7 +43,9 @@ function LogBoxInspectorStackFrame(props: Props): React.Node {
43
43
  }}
44
44
  onPress={onPress}
45
45
  style={styles.frame}>
46
- <Text style={[styles.name, frame.collapse === true && styles.dim]}>
46
+ <Text
47
+ id="logbox_stack_frame_text"
48
+ style={[styles.name, frame.collapse === true && styles.dim]}>
47
49
  {frame.methodName}
48
50
  </Text>
49
51
  <Text
@@ -9,7 +9,7 @@
9
9
  */
10
10
 
11
11
  import type {StackFrame} from '../../Core/NativeExceptionsManager';
12
- import type {PressEvent} from '../../Types/CoreEventTypes';
12
+ import type {GestureResponderEvent} from '../../Types/CoreEventTypes';
13
13
 
14
14
  import View from '../../Components/View/View';
15
15
  import StyleSheet from '../../StyleSheet/StyleSheet';
@@ -21,7 +21,7 @@ import * as React from 'react';
21
21
 
22
22
  type Props = $ReadOnly<{
23
23
  frame: StackFrame,
24
- onPress?: ?(event: PressEvent) => void,
24
+ onPress?: ?(event: GestureResponderEvent) => void,
25
25
  }>;
26
26
 
27
27
  function LogBoxInspectorStackFrame(props: Props): React.Node {
@@ -43,7 +43,9 @@ function LogBoxInspectorStackFrame(props: Props): React.Node {
43
43
  }}
44
44
  onPress={onPress}
45
45
  style={styles.frame}>
46
- <Text style={[styles.name, frame.collapse === true && styles.dim]}>
46
+ <Text
47
+ id="logbox_stack_frame_text"
48
+ style={[styles.name, frame.collapse === true && styles.dim]}>
47
49
  {frame.methodName}
48
50
  </Text>
49
51
  <Text
@@ -37,8 +37,9 @@ export default function LogBoxNotification(props: Props): React.Node {
37
37
  }, [log]);
38
38
 
39
39
  return (
40
- <View style={styles.container}>
40
+ <View id="logbox_notification" style={styles.container}>
41
41
  <LogBoxButton
42
+ id={`logbox_open_button_${level}`}
42
43
  onPress={props.onPressOpen}
43
44
  style={styles.press}
44
45
  backgroundColor={{
@@ -48,7 +49,10 @@ export default function LogBoxNotification(props: Props): React.Node {
48
49
  <View style={styles.content}>
49
50
  <LogBoxNotificationCountBadge count={totalLogCount} level={level} />
50
51
  <LogBoxNotificationMessage message={log.message} />
51
- <LogBoxNotificationDismissButton onPress={props.onPressDismiss} />
52
+ <LogBoxNotificationDismissButton
53
+ id={`logbox_dismiss_button_${level}`}
54
+ onPress={props.onPressDismiss}
55
+ />
52
56
  </View>
53
57
  </LogBoxButton>
54
58
  </View>
@@ -24,7 +24,9 @@ export default function LogBoxNotificationCountBadge(props: {
24
24
  * when fixing the type of `StyleSheet.create`. Remove this comment to
25
25
  * see the error. */}
26
26
  <View style={[styles.inside, styles[props.level]]}>
27
- <Text style={styles.text}>{props.count <= 1 ? '!' : props.count}</Text>
27
+ <Text id="logbox_notification_count_text" style={styles.text}>
28
+ {props.count <= 1 ? '!' : props.count}
29
+ </Text>
28
30
  </View>
29
31
  </View>
30
32
  );
@@ -16,11 +16,13 @@ import * as LogBoxStyle from './LogBoxStyle';
16
16
  import * as React from 'react';
17
17
 
18
18
  export default function LogBoxNotificationDismissButton(props: {
19
+ id: string,
19
20
  onPress: () => void,
20
21
  }): React.Node {
21
22
  return (
22
23
  <View style={styles.container}>
23
24
  <LogBoxButton
25
+ id={props.id}
24
26
  backgroundColor={{
25
27
  default: LogBoxStyle.getTextColor(0.3),
26
28
  pressed: LogBoxStyle.getTextColor(0.5),
@@ -22,7 +22,10 @@ export default function LogBoxNotificationMessage(props: {
22
22
  }): React.Node {
23
23
  return (
24
24
  <View style={styles.container}>
25
- <Text numberOfLines={1} style={styles.text}>
25
+ <Text
26
+ id="logbox_notification_message_text"
27
+ numberOfLines={1}
28
+ style={styles.text}>
26
29
  {props.message && (
27
30
  <LogBoxMessage
28
31
  plaintext
@@ -13,11 +13,12 @@ import type {RootTag} from '../ReactNative/RootTag';
13
13
  import type {DirectEventHandler} from '../Types/CodegenTypes';
14
14
 
15
15
  import NativeEventEmitter from '../EventEmitter/NativeEventEmitter';
16
+ import {type ColorValue} from '../StyleSheet/StyleSheet';
16
17
  import {type EventSubscription} from '../vendor/emitter/EventEmitter';
17
18
  import ModalInjection from './ModalInjection';
18
19
  import NativeModalManager from './NativeModalManager';
19
20
  import RCTModalHostView from './RCTModalHostViewNativeComponent';
20
- import {VirtualizedListContextResetter} from '@react-native/virtualized-lists';
21
+ import VirtualizedLists from '@react-native/virtualized-lists';
21
22
  import React from 'react';
22
23
 
23
24
  const ScrollView = require('../Components/ScrollView/ScrollView').default;
@@ -25,8 +26,11 @@ const View = require('../Components/View/View').default;
25
26
  const AppContainer = require('../ReactNative/AppContainer').default;
26
27
  const I18nManager = require('../ReactNative/I18nManager').default;
27
28
  const {RootTagContext} = require('../ReactNative/RootTag');
28
- const StyleSheet = require('../StyleSheet/StyleSheet');
29
- const Platform = require('../Utilities/Platform');
29
+ const StyleSheet = require('../StyleSheet/StyleSheet').default;
30
+ const Platform = require('../Utilities/Platform').default;
31
+
32
+ const VirtualizedListContextResetter =
33
+ VirtualizedLists.VirtualizedListContextResetter;
30
34
 
31
35
  type ModalEventDefinitions = {
32
36
  modalDismissed: [{modalID: number}],
@@ -57,99 +61,62 @@ type OrientationChangeEvent = $ReadOnly<{
57
61
  orientation: 'portrait' | 'landscape',
58
62
  }>;
59
63
 
60
- export type Props = $ReadOnly<{
61
- ...ViewProps,
62
-
64
+ export type ModalBaseProps = {
63
65
  /**
64
- * The `animationType` prop controls how the modal animates.
65
- *
66
- * See https://reactnative.dev/docs/modal#animationtype
66
+ * @deprecated Use animationType instead
67
67
  */
68
- animationType?: ?('none' | 'slide' | 'fade'),
69
-
68
+ animated?: boolean,
70
69
  /**
71
- * The `presentationStyle` prop controls how the modal appears.
70
+ * The `animationType` prop controls how the modal animates.
72
71
  *
73
- * See https://reactnative.dev/docs/modal#presentationstyle
72
+ * - `slide` slides in from the bottom
73
+ * - `fade` fades into view
74
+ * - `none` appears without an animation
74
75
  */
75
- presentationStyle?: ?(
76
- | 'fullScreen'
77
- | 'pageSheet'
78
- | 'formSheet'
79
- | 'overFullScreen'
80
- ),
81
-
76
+ animationType?: ?('none' | 'slide' | 'fade'),
82
77
  /**
83
- * The `transparent` prop determines whether your modal will fill the
84
- * entire view.
85
- *
86
- * See https://reactnative.dev/docs/modal#transparent
78
+ * The `transparent` prop determines whether your modal will fill the entire view.
79
+ * Setting this to `true` will render the modal over a transparent background.
87
80
  */
88
81
  transparent?: ?boolean,
89
-
90
- /**
91
- * The `statusBarTranslucent` prop determines whether your modal should go under
92
- * the system statusbar.
93
- *
94
- * See https://reactnative.dev/docs/modal.html#statusbartranslucent-android
95
- */
96
- statusBarTranslucent?: ?boolean,
97
-
98
- /**
99
- * The `navigationBarTranslucent` prop determines whether your modal should go under
100
- * the system navigationbar.
101
- *
102
- * See https://reactnative.dev/docs/modal.html#navigationbartranslucent-android
103
- */
104
- navigationBarTranslucent?: ?boolean,
105
-
106
- /**
107
- * The `hardwareAccelerated` prop controls whether to force hardware
108
- * acceleration for the underlying window.
109
- *
110
- * This prop works only on Android.
111
- *
112
- * See https://reactnative.dev/docs/modal#hardwareaccelerated
113
- */
114
- hardwareAccelerated?: ?boolean,
115
-
116
82
  /**
117
83
  * The `visible` prop determines whether your modal is visible.
118
- *
119
- * See https://reactnative.dev/docs/modal#visible
120
84
  */
121
85
  visible?: ?boolean,
122
-
123
86
  /**
124
- * The `onRequestClose` callback is called when the user taps the hardware
125
- * back button on Android or the menu button on Apple TV.
87
+ * The `onRequestClose` callback is called when the user taps the hardware back button on Android or the menu button on Apple TV.
126
88
  *
127
89
  * This is required on Apple TV and Android.
128
- *
129
- * See https://reactnative.dev/docs/modal#onrequestclose
130
90
  */
91
+ // onRequestClose?: (event: NativeSyntheticEvent<any>) => void;
131
92
  onRequestClose?: ?DirectEventHandler<null>,
132
-
133
93
  /**
134
- * The `onShow` prop allows passing a function that will be called once the
135
- * modal has been shown.
136
- *
137
- * See https://reactnative.dev/docs/modal#onshow
94
+ * The `onShow` prop allows passing a function that will be called once the modal has been shown.
138
95
  */
96
+ // onShow?: (event: NativeSyntheticEvent<any>) => void;
139
97
  onShow?: ?DirectEventHandler<null>,
140
98
 
141
99
  /**
142
- * The `onDismiss` prop allows passing a function that will be called once
143
- * the modal has been dismissed.
144
- *
145
- * See https://reactnative.dev/docs/modal#ondismiss
100
+ * The `backdropColor` props sets the background color of the modal's container.
101
+ * Defaults to `white` if not provided and transparent is `false`. Ignored if `transparent` is `true`.
146
102
  */
147
- onDismiss?: ?() => mixed,
103
+ backdropColor?: ColorValue,
104
+ };
105
+
106
+ export type ModalPropsIOS = {
107
+ /**
108
+ * The `presentationStyle` determines the style of modal to show
109
+ */
110
+ presentationStyle?: ?(
111
+ | 'fullScreen'
112
+ | 'pageSheet'
113
+ | 'formSheet'
114
+ | 'overFullScreen'
115
+ ),
148
116
 
149
117
  /**
150
118
  * The `supportedOrientations` prop allows the modal to be rotated to any of the specified orientations.
151
- *
152
- * See https://reactnative.dev/docs/modal#supportedorientations
119
+ * On iOS, the modal is still restricted by what's specified in your app's Info.plist's UISupportedInterfaceOrientations field.
153
120
  */
154
121
  supportedOrientations?: ?$ReadOnlyArray<
155
122
  | 'portrait'
@@ -159,21 +126,47 @@ export type Props = $ReadOnly<{
159
126
  | 'landscape-right',
160
127
  >,
161
128
 
129
+ /**
130
+ * The `onDismiss` prop allows passing a function that will be called once the modal has been dismissed.
131
+ */
132
+ // onDismiss?: (() => void) | undefined;
133
+ onDismiss?: ?() => void,
134
+
162
135
  /**
163
136
  * The `onOrientationChange` callback is called when the orientation changes while the modal is being displayed.
164
- *
165
- * See https://reactnative.dev/docs/modal#onorientationchange
137
+ * The orientation provided is only 'portrait' or 'landscape'. This callback is also called on initial render, regardless of the current orientation.
166
138
  */
139
+ // onOrientationChange?:
140
+ // | ((event: NativeSyntheticEvent<any>) => void)
141
+ // | undefined;
167
142
  onOrientationChange?: ?DirectEventHandler<OrientationChangeEvent>,
143
+ };
168
144
 
145
+ export type ModalPropsAndroid = {
169
146
  /**
170
- * The `backdropColor` props sets the background color of the modal's container.
171
- * Defaults to `white` if not provided and transparent is `false`. Ignored if `transparent` is `true`.
147
+ * Controls whether to force hardware acceleration for the underlying window.
172
148
  */
173
- backdropColor?: ?string,
174
- }>;
149
+ hardwareAccelerated?: ?boolean,
150
+
151
+ /**
152
+ * Determines whether your modal should go under the system statusbar.
153
+ */
154
+ statusBarTranslucent?: ?boolean,
155
+
156
+ /**
157
+ * Determines whether your modal should go under the system navigationbar.
158
+ */
159
+ navigationBarTranslucent?: ?boolean,
160
+ };
161
+
162
+ export type ModalProps = {
163
+ ...ModalBaseProps,
164
+ ...ModalPropsIOS,
165
+ ...ModalPropsAndroid,
166
+ ...ViewProps,
167
+ };
175
168
 
176
- function confirmProps(props: Props) {
169
+ function confirmProps(props: ModalProps) {
177
170
  if (__DEV__) {
178
171
  if (
179
172
  props.presentationStyle &&
@@ -201,7 +194,7 @@ type State = {
201
194
  isRendered: boolean,
202
195
  };
203
196
 
204
- class Modal extends React.Component<Props, State> {
197
+ class Modal extends React.Component<ModalProps, State> {
205
198
  static defaultProps: {hardwareAccelerated: boolean, visible: boolean} = {
206
199
  visible: true,
207
200
  hardwareAccelerated: false,
@@ -212,7 +205,7 @@ class Modal extends React.Component<Props, State> {
212
205
  _identifier: number;
213
206
  _eventSubscription: ?EventSubscription;
214
207
 
215
- constructor(props: Props) {
208
+ constructor(props: ModalProps) {
216
209
  super(props);
217
210
  if (__DEV__) {
218
211
  confirmProps(props);
@@ -248,7 +241,7 @@ class Modal extends React.Component<Props, State> {
248
241
  }
249
242
  }
250
243
 
251
- componentDidUpdate(prevProps: Props) {
244
+ componentDidUpdate(prevProps: ModalProps) {
252
245
  if (prevProps.visible === false && this.props.visible === true) {
253
246
  this.setState({isRendered: true});
254
247
  }
@@ -364,4 +357,4 @@ const styles = StyleSheet.create({
364
357
  const ExportedModal: React.ComponentType<React.ElementConfig<typeof Modal>> =
365
358
  ModalInjection.unstable_Modal ?? Modal;
366
359
 
367
- module.exports = ExportedModal;
360
+ export default ExportedModal;
@@ -10,6 +10,8 @@
10
10
 
11
11
  import type {PartialViewConfigWithoutName} from './PlatformBaseViewConfig';
12
12
 
13
+ import * as ReactNativeFeatureFlags from '../../src/private/featureflags/ReactNativeFeatureFlags';
14
+ import NativeReactNativeFeatureFlags from '../../src/private/featureflags/specs/NativeReactNativeFeatureFlags';
13
15
  import ReactNativeStyleAttributes from '../Components/View/ReactNativeStyleAttributes';
14
16
  import {DynamicallyInjectedByGestureHandler} from './ViewConfigIgnore';
15
17
 
@@ -169,12 +171,20 @@ const validAttributesForNonEventProps = {
169
171
  experimental_backgroundImage: {
170
172
  process: require('../StyleSheet/processBackgroundImage').default,
171
173
  },
172
- boxShadow: {
173
- process: require('../StyleSheet/processBoxShadow').default,
174
- },
175
- filter: {
176
- process: require('../StyleSheet/processFilter').default,
177
- },
174
+ boxShadow:
175
+ NativeReactNativeFeatureFlags != null &&
176
+ ReactNativeFeatureFlags.enableNativeCSSParsing()
177
+ ? true
178
+ : {
179
+ process: require('../StyleSheet/processBoxShadow').default,
180
+ },
181
+ filter:
182
+ NativeReactNativeFeatureFlags != null &&
183
+ ReactNativeFeatureFlags.enableNativeCSSParsing()
184
+ ? true
185
+ : {
186
+ process: require('../StyleSheet/processFilter').default,
187
+ },
178
188
  mixBlendMode: true,
179
189
  isolation: true,
180
190
  opacity: true,
@@ -10,6 +10,8 @@
10
10
 
11
11
  import type {PartialViewConfigWithoutName} from './PlatformBaseViewConfig';
12
12
 
13
+ import * as ReactNativeFeatureFlags from '../../src/private/featureflags/ReactNativeFeatureFlags';
14
+ import NativeReactNativeFeatureFlags from '../../src/private/featureflags/specs/NativeReactNativeFeatureFlags';
13
15
  import ReactNativeStyleAttributes from '../Components/View/ReactNativeStyleAttributes';
14
16
  import {
15
17
  ConditionallyIgnoredEventHandlers,
@@ -201,13 +203,13 @@ const validAttributesForNonEventProps = {
201
203
  cursor: true,
202
204
  opacity: true,
203
205
  shadowColor: {process: require('../StyleSheet/processColor').default},
204
- shadowOffset: {diff: require('../Utilities/differ/sizesDiffer')},
206
+ shadowOffset: {diff: require('../Utilities/differ/sizesDiffer').default},
205
207
  shadowOpacity: true,
206
208
  shadowRadius: true,
207
209
  needsOffscreenAlphaCompositing: true,
208
210
  overflow: true,
209
211
  shouldRasterizeIOS: true,
210
- transform: {diff: require('../Utilities/differ/matricesDiffer')},
212
+ transform: {diff: require('../Utilities/differ/matricesDiffer').default},
211
213
  transformOrigin: true,
212
214
  accessibilityRole: true,
213
215
  accessibilityState: true,
@@ -222,15 +224,23 @@ const validAttributesForNonEventProps = {
222
224
  borderWidth: true,
223
225
  borderBlockWidth: true,
224
226
  borderStyle: true,
225
- hitSlop: {diff: require('../Utilities/differ/insetsDiffer')},
227
+ hitSlop: {diff: require('../Utilities/differ/insetsDiffer').default},
226
228
  collapsable: true,
227
229
  collapsableChildren: true,
228
- filter: {
229
- process: require('../StyleSheet/processFilter').default,
230
- },
231
- boxShadow: {
232
- process: require('../StyleSheet/processBoxShadow').default,
233
- },
230
+ filter:
231
+ NativeReactNativeFeatureFlags != null &&
232
+ ReactNativeFeatureFlags.enableNativeCSSParsing()
233
+ ? true
234
+ : {
235
+ process: require('../StyleSheet/processFilter').default,
236
+ },
237
+ boxShadow:
238
+ NativeReactNativeFeatureFlags != null &&
239
+ ReactNativeFeatureFlags.enableNativeCSSParsing()
240
+ ? true
241
+ : {
242
+ process: require('../StyleSheet/processBoxShadow').default,
243
+ },
234
244
  mixBlendMode: true,
235
245
  isolation: true,
236
246