@office-iss/react-native-win32 0.0.0-canary.273 → 0.0.0-canary.275

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 (114) hide show
  1. package/.flowconfig +5 -1
  2. package/CHANGELOG.json +31 -1
  3. package/CHANGELOG.md +20 -4
  4. package/Libraries/ActionSheetIOS/ActionSheetIOS.d.ts +1 -0
  5. package/Libraries/ActionSheetIOS/ActionSheetIOS.js +13 -0
  6. package/Libraries/Animated/animations/Animation.js +1 -5
  7. package/Libraries/Animated/components/AnimatedFlatList.js +1 -1
  8. package/Libraries/Animated/components/AnimatedSectionList.js +3 -1
  9. package/Libraries/Animated/createAnimatedComponent.js +7 -7
  10. package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js +16 -2
  11. package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.win32.js +21 -2
  12. package/Libraries/Components/ActivityIndicator/ActivityIndicator.js +1 -1
  13. package/Libraries/Components/RefreshControl/__mocks__/RefreshControlMock.js +3 -2
  14. package/Libraries/Components/ScrollView/AndroidHorizontalScrollViewNativeComponent.js +0 -1
  15. package/Libraries/Components/ScrollView/ScrollView.js +39 -78
  16. package/Libraries/Components/ScrollView/ScrollViewCommands.js +1 -1
  17. package/Libraries/Components/ScrollView/ScrollViewContext.js +2 -0
  18. package/Libraries/Components/ScrollView/ScrollViewNativeComponent.js +0 -2
  19. package/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +2 -3
  20. package/Libraries/Components/TextInput/InputAccessoryView.js +1 -1
  21. package/Libraries/Components/TextInput/RCTMultilineTextInputNativeComponent.js +4 -4
  22. package/Libraries/Components/TextInput/RCTSingelineTextInputNativeComponent.js +6 -4
  23. package/Libraries/Components/TextInput/RCTTextInputViewConfig.js +1 -0
  24. package/Libraries/Components/TextInput/TextInput.flow.js +11 -9
  25. package/Libraries/Components/TextInput/TextInput.js +7 -1
  26. package/Libraries/Components/TextInput/TextInput.win32.js +8 -1
  27. package/Libraries/Components/TextInput/Win32TextInputNativeComponent.js +3 -0
  28. package/Libraries/Components/Touchable/TouchableBounce.js +1 -0
  29. package/Libraries/Components/Touchable/TouchableOpacity.js +1 -0
  30. package/Libraries/Components/Touchable/TouchableWithoutFeedback.js +1 -2
  31. package/Libraries/Components/View/ViewPropTypes.d.ts +7 -0
  32. package/Libraries/Components/View/ViewWin32.js +1 -0
  33. package/Libraries/Core/ExceptionsManager.js +41 -27
  34. package/Libraries/Core/ReactNativeVersion.js +1 -1
  35. package/Libraries/Core/__mocks__/NativeExceptionsManager.js +0 -1
  36. package/Libraries/Core/setUpErrorHandling.js +18 -22
  37. package/Libraries/Core/setUpTimers.js +4 -12
  38. package/Libraries/Image/Image.d.ts +20 -29
  39. package/Libraries/Image/ImageProps.js +2 -1
  40. package/Libraries/Image/ImageResizeMode.d.ts +8 -1
  41. package/Libraries/Image/ImageResizeMode.js +4 -1
  42. package/Libraries/Image/ImageSource.d.ts +0 -2
  43. package/Libraries/Image/ImageSource.js +0 -2
  44. package/Libraries/Image/ImageUtils.js +6 -3
  45. package/Libraries/Inspector/Inspector.win32.js +1 -1
  46. package/Libraries/Interaction/InteractionManager.js +6 -1
  47. package/Libraries/Interaction/InteractionManagerStub.js +176 -0
  48. package/Libraries/Lists/FlatList.js +2 -2
  49. package/Libraries/Lists/SectionListModern.js +7 -7
  50. package/Libraries/LogBox/Data/LogBoxData.js +2 -2
  51. package/Libraries/LogBox/LogBox.js +1 -1
  52. package/Libraries/LogBox/LogBoxInspectorContainer.js +1 -1
  53. package/Libraries/LogBox/LogBoxNotificationContainer.js +1 -1
  54. package/Libraries/LogBox/UI/AnsiHighlight.js +26 -17
  55. package/Libraries/LogBox/UI/LogBoxInspectorCodeFrame.js +6 -1
  56. package/Libraries/LogBox/UI/LogBoxInspectorCodeFrame.win32.js +6 -1
  57. package/Libraries/LogBox/UI/LogBoxInspectorHeader.js +1 -1
  58. package/Libraries/LogBox/UI/LogBoxInspectorHeader.win32.js +1 -1
  59. package/Libraries/Modal/Modal.d.ts +5 -0
  60. package/Libraries/Modal/Modal.js +19 -3
  61. package/Libraries/NativeComponent/NativeComponentRegistry.js +3 -3
  62. package/Libraries/PermissionsAndroid/PermissionsAndroid.d.ts +49 -2
  63. package/Libraries/PermissionsAndroid/PermissionsAndroid.js +4 -4
  64. package/Libraries/Pressability/usePressability.js +4 -1
  65. package/Libraries/ReactNative/AppContainer.js +1 -1
  66. package/Libraries/ReactNative/AppRegistry.js +0 -6
  67. package/Libraries/ReactNative/DisplayMode.js +1 -1
  68. package/Libraries/ReactNative/RendererImplementation.js +14 -14
  69. package/Libraries/ReactNative/getCachedComponentWithDebugName.js +1 -3
  70. package/Libraries/ReactNative/renderApplication.js +9 -8
  71. package/Libraries/ReactNative/requireNativeComponent.js +5 -2
  72. package/Libraries/Renderer/implementations/ReactFabric-dev.js +26149 -15434
  73. package/Libraries/Renderer/implementations/ReactFabric-prod.js +1630 -2675
  74. package/Libraries/Renderer/implementations/ReactFabric-profiling.js +1691 -2954
  75. package/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js +27069 -16192
  76. package/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js +1657 -2714
  77. package/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.js +1733 -2980
  78. package/Libraries/Renderer/shims/ReactFabric.js +3 -3
  79. package/Libraries/Renderer/shims/ReactFeatureFlags.js +2 -2
  80. package/Libraries/Renderer/shims/ReactNative.js +3 -3
  81. package/Libraries/Renderer/shims/ReactNativeTypes.js +9 -10
  82. package/Libraries/Renderer/shims/createReactNativeComponentClass.js +2 -2
  83. package/Libraries/StyleSheet/StyleSheet.js +7 -1
  84. package/Libraries/StyleSheet/StyleSheet.win32.js +7 -1
  85. package/Libraries/StyleSheet/StyleSheetTypes.d.ts +7 -1
  86. package/Libraries/StyleSheet/StyleSheetTypes.js +5 -4
  87. package/Libraries/Utilities/BackHandler.android.js +6 -18
  88. package/Libraries/Utilities/BackHandler.d.ts +0 -4
  89. package/Libraries/Utilities/BackHandler.ios.js +0 -7
  90. package/Libraries/Utilities/BackHandler.win32.js +6 -18
  91. package/Libraries/Utilities/__mocks__/BackHandler.js +3 -8
  92. package/Libraries/Utilities/codegenNativeComponent.js +1 -1
  93. package/Libraries/__flowtests__/ReactNativeTypes-flowtest.js +1 -1
  94. package/index.js +1 -1
  95. package/index.win32.js +1 -1
  96. package/overrides.json +11 -11
  97. package/package.json +13 -13
  98. package/src/private/components/HScrollViewNativeComponents.js +1 -26
  99. package/src/private/components/SafeAreaView_INTERNAL_DO_NOT_USE.js +4 -4
  100. package/src/private/components/VScrollViewNativeComponents.js +2 -24
  101. package/src/private/featureflags/ReactNativeFeatureFlags.js +36 -46
  102. package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +7 -9
  103. package/src/private/specs/components/RCTModalHostViewNativeComponent.js +8 -0
  104. package/src/private/specs/modules/NativeAccessibilityInfo.js +6 -0
  105. package/src/private/specs/modules/NativeAccessibilityInfoWin32.js +6 -0
  106. package/src/private/specs/modules/NativeActionSheetManager.js +2 -0
  107. package/src/private/specs/modules/NativeExceptionsManager.js +0 -12
  108. package/src/private/webapis/intersectionobserver/IntersectionObserver.js +6 -0
  109. package/src/private/webapis/performance/Performance.js +1 -1
  110. package/src/private/webapis/performance/UserTiming.js +5 -5
  111. package/src-win/Libraries/Components/View/ViewPropTypes.d.ts +7 -0
  112. package/Libraries/ReactNative/ReactFabricInternals.js +0 -17
  113. package/src/private/components/useSyncOnScroll.js +0 -48
  114. package/types/experimental.d.ts +0 -59
@@ -0,0 +1,176 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ * @flow strict
8
+ * @format
9
+ */
10
+
11
+ import type {EventSubscription} from '../vendor/emitter/EventEmitter';
12
+
13
+ const invariant = require('invariant');
14
+
15
+ export type Handle = number;
16
+
17
+ type Task =
18
+ | {
19
+ name: string,
20
+ run: () => void,
21
+ }
22
+ | {
23
+ name: string,
24
+ gen: () => Promise<void>,
25
+ }
26
+ | (() => void);
27
+
28
+ /**
29
+ * InteractionManager allows long-running work to be scheduled after any
30
+ * interactions/animations have completed. In particular, this allows JavaScript
31
+ * animations to run smoothly.
32
+ *
33
+ * Applications can schedule tasks to run after interactions with the following:
34
+ *
35
+ * ```
36
+ * InteractionManager.runAfterInteractions(() => {
37
+ * // ...long-running synchronous task...
38
+ * });
39
+ * ```
40
+ *
41
+ * Compare this to other scheduling alternatives:
42
+ *
43
+ * - requestAnimationFrame(): for code that animates a view over time.
44
+ * - setImmediate/setTimeout(): run code later, note this may delay animations.
45
+ * - runAfterInteractions(): run code later, without delaying active animations.
46
+ *
47
+ * The touch handling system considers one or more active touches to be an
48
+ * 'interaction' and will delay `runAfterInteractions()` callbacks until all
49
+ * touches have ended or been cancelled.
50
+ *
51
+ * InteractionManager also allows applications to register animations by
52
+ * creating an interaction 'handle' on animation start, and clearing it upon
53
+ * completion:
54
+ *
55
+ * ```
56
+ * var handle = InteractionManager.createInteractionHandle();
57
+ * // run animation... (`runAfterInteractions` tasks are queued)
58
+ * // later, on animation completion:
59
+ * InteractionManager.clearInteractionHandle(handle);
60
+ * // queued tasks run if all handles were cleared
61
+ * ```
62
+ *
63
+ * `runAfterInteractions` takes either a plain callback function, or a
64
+ * `PromiseTask` object with a `gen` method that returns a `Promise`. If a
65
+ * `PromiseTask` is supplied, then it is fully resolved (including asynchronous
66
+ * dependencies that also schedule more tasks via `runAfterInteractions`) before
67
+ * starting on the next task that might have been queued up synchronously
68
+ * earlier.
69
+ *
70
+ * By default, queued tasks are executed together in a loop in one
71
+ * `setImmediate` batch. If `setDeadline` is called with a positive number, then
72
+ * tasks will only be executed until the deadline (in terms of js event loop run
73
+ * time) approaches, at which point execution will yield via setTimeout,
74
+ * allowing events such as touches to start interactions and block queued tasks
75
+ * from executing, making apps more responsive.
76
+ *
77
+ * @deprecated
78
+ */
79
+ const InteractionManagerStub = {
80
+ Events: {
81
+ interactionStart: 'interactionStart',
82
+ interactionComplete: 'interactionComplete',
83
+ },
84
+
85
+ /**
86
+ * Schedule a function to run after all interactions have completed. Returns a cancellable
87
+ * "promise".
88
+ *
89
+ * @deprecated
90
+ */
91
+ runAfterInteractions(task: ?Task): {
92
+ then: <U>(
93
+ onFulfill?: ?(void) => ?(Promise<U> | U),
94
+ onReject?: ?(error: mixed) => ?(Promise<U> | U),
95
+ ) => Promise<U>,
96
+ cancel: () => void,
97
+ ...
98
+ } {
99
+ let immediateID: ?$FlowIssue;
100
+ const promise = new Promise((resolve, reject) => {
101
+ immediateID = setImmediate(() => {
102
+ if (typeof task === 'object' && task !== null) {
103
+ if (typeof task.gen === 'function') {
104
+ task.gen().then(resolve, reject);
105
+ } else if (typeof task.run === 'function') {
106
+ try {
107
+ task.run();
108
+ resolve();
109
+ } catch (error) {
110
+ reject(error);
111
+ }
112
+ } else {
113
+ reject(new TypeError(`Task "${task.name}" missing gen or run.`));
114
+ }
115
+ } else if (typeof task === 'function') {
116
+ try {
117
+ task();
118
+ resolve();
119
+ } catch (error) {
120
+ reject(error);
121
+ }
122
+ } else {
123
+ reject(new TypeError('Invalid task of type: ' + typeof task));
124
+ }
125
+ });
126
+ });
127
+
128
+ return {
129
+ // $FlowFixMe[method-unbinding] added when improving typing for this parameters
130
+ then: promise.then.bind(promise),
131
+ cancel() {
132
+ clearImmediate(immediateID);
133
+ },
134
+ };
135
+ },
136
+
137
+ /**
138
+ * Notify manager that an interaction has started.
139
+ *
140
+ * @deprecated
141
+ */
142
+ createInteractionHandle(): Handle {
143
+ return -1;
144
+ },
145
+
146
+ /**
147
+ * Notify manager that an interaction has completed.
148
+ *
149
+ * @deprecated
150
+ */
151
+ clearInteractionHandle(handle: Handle) {
152
+ invariant(!!handle, 'InteractionManager: Must provide a handle to clear.');
153
+ },
154
+
155
+ /**
156
+ * @deprecated
157
+ */
158
+ addListener(): EventSubscription {
159
+ return {
160
+ remove() {},
161
+ };
162
+ },
163
+
164
+ /**
165
+ * A positive number will use setTimeout to schedule any tasks after the
166
+ * eventLoopRunningTime hits the deadline value, otherwise all tasks will be
167
+ * executed in one setImmediate batch (default).
168
+ *
169
+ * @deprecated
170
+ */
171
+ setDeadline(deadline: number) {
172
+ // Do nothing.
173
+ },
174
+ };
175
+
176
+ module.exports = InteractionManagerStub;
@@ -480,10 +480,10 @@ class FlatList<ItemT> extends React.PureComponent<Props<ItemT>, void> {
480
480
  this._checkProps(this.props);
481
481
  }
482
482
 
483
- _listRef: ?React.ElementRef<typeof VirtualizedList>;
483
+ _listRef: ?VirtualizedList;
484
484
  _virtualizedListPairs: Array<ViewabilityConfigCallbackPair> = [];
485
485
 
486
- _captureRef = (ref: ?React.ElementRef<typeof VirtualizedList>) => {
486
+ _captureRef = (ref: ?VirtualizedList) => {
487
487
  this._listRef = ref;
488
488
  };
489
489
 
@@ -16,7 +16,7 @@ import type {
16
16
  SectionBase as _SectionBase,
17
17
  VirtualizedSectionListProps,
18
18
  } from '@react-native/virtualized-lists';
19
- import type {AbstractComponent, ElementRef} from 'react';
19
+ import type {ElementRef} from 'react';
20
20
 
21
21
  import Platform from '../Utilities/Platform';
22
22
  import {VirtualizedSectionList} from '@react-native/virtualized-lists';
@@ -93,7 +93,7 @@ type OptionalProps<SectionT: SectionBase<any>> = {|
93
93
  removeClippedSubviews?: boolean,
94
94
  |};
95
95
 
96
- export type Props<SectionT> = {|
96
+ export type Props<SectionT: SectionBase<any>> = $ReadOnly<{|
97
97
  ...$Diff<
98
98
  VirtualizedSectionListProps<SectionT>,
99
99
  {
@@ -115,7 +115,7 @@ export type Props<SectionT> = {|
115
115
  >,
116
116
  ...RequiredProps<SectionT>,
117
117
  ...OptionalProps<SectionT>,
118
- |};
118
+ |}>;
119
119
 
120
120
  /**
121
121
  * A performant interface for rendering sectioned lists, supporting the most handy features:
@@ -172,10 +172,10 @@ export type Props<SectionT> = {|
172
172
  * Alternatively, you can provide a custom `keyExtractor` prop.
173
173
  *
174
174
  */
175
- const SectionList: AbstractComponent<Props<SectionBase<any>>, any> = forwardRef<
176
- Props<SectionBase<any>>,
177
- any,
178
- >((props, ref) => {
175
+ const SectionList: component(
176
+ ref?: React.RefSetter<any>,
177
+ ...Props<SectionBase<any>>
178
+ ) = forwardRef<Props<SectionBase<any>>, any>((props, ref) => {
179
179
  const propsWithDefaults = {
180
180
  stickySectionHeadersEnabled: Platform.OS === 'ios',
181
181
  ...props,
@@ -421,7 +421,7 @@ type State = $ReadOnly<{|
421
421
  selectedLogIndex: number,
422
422
  |}>;
423
423
 
424
- type SubscribedComponent = React.AbstractComponent<
424
+ type SubscribedComponent = React.ComponentType<
425
425
  $ReadOnly<{|
426
426
  logs: $ReadOnlyArray<LogBoxLog>,
427
427
  isDisabled: boolean,
@@ -431,7 +431,7 @@ type SubscribedComponent = React.AbstractComponent<
431
431
 
432
432
  export function withSubscription(
433
433
  WrappedComponent: SubscribedComponent,
434
- ): React.AbstractComponent<{||}> {
434
+ ): React.ComponentType<{||}> {
435
435
  class LogBoxStateSubscription extends React.Component<Props, State> {
436
436
  static getDerivedStateFromError(): {hasError: boolean} {
437
437
  return {hasError: true};
@@ -55,7 +55,7 @@ if (__DEV__) {
55
55
  if (global.RN$registerExceptionListener != null) {
56
56
  global.RN$registerExceptionListener(
57
57
  (error: ExtendedExceptionData & {preventDefault: () => mixed}) => {
58
- if (!error.isFatal) {
58
+ if (global.RN$isRuntimeReady?.() || !error.isFatal) {
59
59
  error.preventDefault();
60
60
  addException(error);
61
61
  }
@@ -65,4 +65,4 @@ export class _LogBoxInspectorContainer extends React.Component<Props> {
65
65
 
66
66
  export default (LogBoxData.withSubscription(
67
67
  _LogBoxInspectorContainer,
68
- ): React.AbstractComponent<{||}>);
68
+ ): React.ComponentType<{||}>);
@@ -102,4 +102,4 @@ const styles = StyleSheet.create({
102
102
 
103
103
  export default (LogBoxData.withSubscription(
104
104
  _LogBoxNotificationContainer,
105
- ): React.AbstractComponent<{||}>);
105
+ ): React.ComponentType<{||}>);
@@ -37,6 +37,8 @@ const COLORS = {
37
37
  'ansi-bright-white': 'rgb(247, 247, 247)',
38
38
  };
39
39
 
40
+ const LRM = '\u200E'; // Left-to-Right Mark
41
+
40
42
  export default function Ansi({
41
43
  text,
42
44
  style,
@@ -80,25 +82,28 @@ export default function Ansi({
80
82
  };
81
83
 
82
84
  return (
83
- <View>
85
+ <View style={styles.container}>
84
86
  {parsedLines.map((items, i) => (
85
87
  <View style={styles.line} key={i}>
86
- {items.map((bundle, key) => {
87
- const textStyle =
88
- bundle.fg && COLORS[bundle.fg]
89
- ? {
90
- backgroundColor: bundle.bg && COLORS[bundle.bg],
91
- color: bundle.fg && COLORS[bundle.fg],
92
- }
93
- : {
94
- backgroundColor: bundle.bg && COLORS[bundle.bg],
95
- };
96
- return (
97
- <Text style={[style, textStyle]} key={key}>
98
- {getText(bundle.content, key)}
99
- </Text>
100
- );
101
- })}
88
+ <Text>
89
+ {LRM}
90
+ {items.map((bundle, key) => {
91
+ const textStyle =
92
+ bundle.fg && COLORS[bundle.fg]
93
+ ? {
94
+ backgroundColor: bundle.bg && COLORS[bundle.bg],
95
+ color: bundle.fg && COLORS[bundle.fg],
96
+ }
97
+ : {
98
+ backgroundColor: bundle.bg && COLORS[bundle.bg],
99
+ };
100
+ return (
101
+ <Text style={[style, textStyle]} key={key}>
102
+ {getText(bundle.content, key)}
103
+ </Text>
104
+ );
105
+ })}
106
+ </Text>
102
107
  </View>
103
108
  ))}
104
109
  </View>
@@ -106,6 +111,10 @@ export default function Ansi({
106
111
  }
107
112
 
108
113
  const styles = StyleSheet.create({
114
+ container: {
115
+ minWidth: '100%',
116
+ direction: 'ltr',
117
+ },
109
118
  line: {
110
119
  flexDirection: 'row',
111
120
  },
@@ -59,7 +59,9 @@ function LogBoxInspectorCodeFrame(props: Props): React.Node {
59
59
  <LogBoxInspectorSection heading="Source" action={<AppInfo />}>
60
60
  <View style={styles.box}>
61
61
  <View style={styles.frame}>
62
- <ScrollView horizontal>
62
+ <ScrollView
63
+ horizontal
64
+ contentContainerStyle={styles.contentContainer}>
63
65
  <AnsiHighlight style={styles.content} text={codeFrame.content} />
64
66
  </ScrollView>
65
67
  </View>
@@ -138,6 +140,9 @@ const styles = StyleSheet.create({
138
140
  paddingTop: 10,
139
141
  paddingBottom: 10,
140
142
  },
143
+ contentContainer: {
144
+ minWidth: '100%',
145
+ },
141
146
  content: {
142
147
  color: LogBoxStyle.getTextColor(1),
143
148
  fontSize: 12,
@@ -59,7 +59,9 @@ function LogBoxInspectorCodeFrame(props: Props): React.Node {
59
59
  <LogBoxInspectorSection heading="Source" action={<AppInfo />}>
60
60
  <View style={styles.box}>
61
61
  <View style={styles.frame}>
62
- <ScrollView horizontal>
62
+ <ScrollView
63
+ horizontal
64
+ contentContainerStyle={styles.contentContainer}>
63
65
  <AnsiHighlight style={styles.content} text={codeFrame.content} />
64
66
  </ScrollView>
65
67
  </View>
@@ -138,6 +140,9 @@ const styles = StyleSheet.create({
138
140
  paddingTop: 10,
139
141
  paddingBottom: 10,
140
142
  },
143
+ contentContainer: {
144
+ minWidth: '100%',
145
+ },
141
146
  content: {
142
147
  color: LogBoxStyle.getTextColor(1),
143
148
  fontSize: 12,
@@ -27,7 +27,7 @@ type Props = $ReadOnly<{
27
27
  level: LogLevel,
28
28
  }>;
29
29
 
30
- const LogBoxInspectorHeaderSafeArea: React.AbstractComponent<ViewProps> =
30
+ const LogBoxInspectorHeaderSafeArea: React.ComponentType<ViewProps> =
31
31
  Platform.OS === 'android' ? View : SafeAreaView;
32
32
 
33
33
  export default function LogBoxInspectorHeader(props: Props): React.Node {
@@ -29,7 +29,7 @@ type Props = $ReadOnly<{
29
29
  level: LogLevel,
30
30
  }>;
31
31
 
32
- const LogBoxInspectorHeaderSafeArea: React.AbstractComponent<ViewProps> =
32
+ const LogBoxInspectorHeaderSafeArea: React.ComponentType<ViewProps> =
33
33
  Platform.OS === 'android' ? View : SafeAreaView;
34
34
 
35
35
  export default function LogBoxInspectorHeader(props: Props): React.Node {
@@ -101,6 +101,11 @@ export interface ModalPropsAndroid {
101
101
  * Determines whether your modal should go under the system statusbar.
102
102
  */
103
103
  statusBarTranslucent?: boolean | undefined;
104
+
105
+ /**
106
+ * Determines whether your modal should go under the system navigationbar.
107
+ */
108
+ navigationBarTranslucent?: boolean | undefined;
104
109
  }
105
110
 
106
111
  export type ModalProps = ModalBaseProps &
@@ -95,6 +95,14 @@ export type Props = $ReadOnly<{|
95
95
  */
96
96
  statusBarTranslucent?: ?boolean,
97
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
+
98
106
  /**
99
107
  * The `hardwareAccelerated` prop controls whether to force hardware
100
108
  * acceleration for the underlying window.
@@ -176,6 +184,14 @@ function confirmProps(props: Props) {
176
184
  `Modal with '${props.presentationStyle}' presentation style and 'transparent' value is not supported.`,
177
185
  );
178
186
  }
187
+ if (
188
+ props.navigationBarTranslucent === true &&
189
+ props.statusBarTranslucent !== true
190
+ ) {
191
+ console.warn(
192
+ 'Modal with translucent navigation bar and without translucent status bar is not supported.',
193
+ );
194
+ }
179
195
  }
180
196
  }
181
197
 
@@ -301,6 +317,7 @@ class Modal extends React.Component<Props, State> {
301
317
  onDismiss={onDismiss}
302
318
  visible={this.props.visible}
303
319
  statusBarTranslucent={this.props.statusBarTranslucent}
320
+ navigationBarTranslucent={this.props.navigationBarTranslucent}
304
321
  identifier={this._identifier}
305
322
  style={styles.modal}
306
323
  // $FlowFixMe[method-unbinding] added when improving typing for this parameters
@@ -342,8 +359,7 @@ const styles = StyleSheet.create({
342
359
  },
343
360
  });
344
361
 
345
- const ExportedModal: React.AbstractComponent<
346
- React.ElementConfig<typeof Modal>,
347
- > = ModalInjection.unstable_Modal ?? Modal;
362
+ const ExportedModal: React.ComponentType<React.ElementConfig<typeof Modal>> =
363
+ ModalInjection.unstable_Modal ?? Modal;
348
364
 
349
365
  module.exports = ExportedModal;
@@ -48,7 +48,7 @@ export function setRuntimeConfigProvider(
48
48
  * The supplied `viewConfigProvider` may or may not be invoked and utilized,
49
49
  * depending on how `setRuntimeConfigProvider` is configured.
50
50
  */
51
- export function get<Config>(
51
+ export function get<Config: {...}>(
52
52
  name: string,
53
53
  viewConfigProvider: () => PartialViewConfig,
54
54
  ): HostComponent<Config> {
@@ -121,10 +121,10 @@ export function get<Config>(
121
121
  * that the return value of this is not `HostComponent` because the returned
122
122
  * component instance is not guaranteed to have native methods.
123
123
  */
124
- export function getWithFallback_DEPRECATED<Config>(
124
+ export function getWithFallback_DEPRECATED<Config: {...}>(
125
125
  name: string,
126
126
  viewConfigProvider: () => PartialViewConfig,
127
- ): React.AbstractComponent<Config> {
127
+ ): React.ComponentType<Config> {
128
128
  if (getRuntimeConfig == null) {
129
129
  // `getRuntimeConfig == null` when static view configs are disabled
130
130
  // If `setRuntimeConfigProvider` is not configured, use native reflection.
@@ -66,11 +66,58 @@ export interface PermissionsAndroidStatic {
66
66
  /**
67
67
  * A list of permission results that are returned
68
68
  */
69
- RESULTS: {[key: string]: PermissionStatus};
69
+ RESULTS: {
70
+ [key in 'GRANTED' | 'DENIED' | 'NEVER_ASK_AGAIN']: PermissionStatus;
71
+ };
70
72
  /**
71
73
  * A list of specified "dangerous" permissions that require prompting the user
72
74
  */
73
- PERMISSIONS: {[key: string]: Permission};
75
+ PERMISSIONS: {
76
+ [key in
77
+ | 'READ_CALENDAR'
78
+ | 'WRITE_CALENDAR'
79
+ | 'CAMERA'
80
+ | 'READ_CONTACTS'
81
+ | 'WRITE_CONTACTS'
82
+ | 'GET_ACCOUNTS'
83
+ | 'ACCESS_FINE_LOCATION'
84
+ | 'ACCESS_COARSE_LOCATION'
85
+ | 'ACCESS_BACKGROUND_LOCATION'
86
+ | 'RECORD_AUDIO'
87
+ | 'READ_PHONE_STATE'
88
+ | 'CALL_PHONE'
89
+ | 'READ_CALL_LOG'
90
+ | 'WRITE_CALL_LOG'
91
+ | 'ADD_VOICEMAIL'
92
+ | 'READ_VOICEMAIL'
93
+ | 'WRITE_VOICEMAIL'
94
+ | 'USE_SIP'
95
+ | 'PROCESS_OUTGOING_CALLS'
96
+ | 'BODY_SENSORS'
97
+ | 'BODY_SENSORS_BACKGROUND'
98
+ | 'SEND_SMS'
99
+ | 'RECEIVE_SMS'
100
+ | 'READ_SMS'
101
+ | 'RECEIVE_WAP_PUSH'
102
+ | 'RECEIVE_MMS'
103
+ | 'READ_EXTERNAL_STORAGE'
104
+ | 'READ_MEDIA_IMAGES'
105
+ | 'READ_MEDIA_VIDEO'
106
+ | 'READ_MEDIA_AUDIO'
107
+ | 'READ_MEDIA_VISUAL_USER_SELECTED'
108
+ | 'WRITE_EXTERNAL_STORAGE'
109
+ | 'BLUETOOTH_CONNECT'
110
+ | 'BLUETOOTH_SCAN'
111
+ | 'BLUETOOTH_ADVERTISE'
112
+ | 'ACCESS_MEDIA_LOCATION'
113
+ | 'ACCEPT_HANDOVER'
114
+ | 'ACTIVITY_RECOGNITION'
115
+ | 'ANSWER_PHONE_CALLS'
116
+ | 'READ_PHONE_NUMBERS'
117
+ | 'UWB_RANGING'
118
+ | 'POST_NOTIFICATIONS'
119
+ | 'NEARBY_WIFI_DEVICES']: Permission;
120
+ };
74
121
  new (): PermissionsAndroidStatic;
75
122
  /**
76
123
  * @deprecated Use check instead
@@ -88,7 +88,7 @@ const PERMISSIONS = Object.freeze({
88
88
  */
89
89
 
90
90
  class PermissionsAndroid {
91
- PERMISSIONS: {|
91
+ PERMISSIONS: $ReadOnly<{|
92
92
  ACCEPT_HANDOVER: string,
93
93
  ACCESS_BACKGROUND_LOCATION: string,
94
94
  ACCESS_COARSE_LOCATION: string,
@@ -132,12 +132,12 @@ class PermissionsAndroid {
132
132
  WRITE_CALL_LOG: string,
133
133
  WRITE_CONTACTS: string,
134
134
  WRITE_EXTERNAL_STORAGE: string,
135
- |} = PERMISSIONS;
136
- RESULTS: {|
135
+ |}> = PERMISSIONS;
136
+ RESULTS: $ReadOnly<{|
137
137
  DENIED: 'denied',
138
138
  GRANTED: 'granted',
139
139
  NEVER_ASK_AGAIN: 'never_ask_again',
140
- |} = PERMISSION_REQUEST_RESULT;
140
+ |}> = PERMISSION_REQUEST_RESULT;
141
141
 
142
142
  /**
143
143
  * DEPRECATED - use check
@@ -14,6 +14,9 @@ import Pressability, {
14
14
  } from './Pressability';
15
15
  import {useEffect, useRef} from 'react';
16
16
 
17
+ declare function usePressability(config: PressabilityConfig): EventHandlers;
18
+ declare function usePressability(config: null | void): null | EventHandlers;
19
+
17
20
  /**
18
21
  * Creates a persistent instance of `Pressability` that automatically configures
19
22
  * itself and resets. Accepts null `config` to support lazy initialization. Once
@@ -28,7 +31,7 @@ import {useEffect, useRef} from 'react';
28
31
  */
29
32
  export default function usePressability(
30
33
  config: ?PressabilityConfig,
31
- ): ?EventHandlers {
34
+ ): null | EventHandlers {
32
35
  const pressabilityRef = useRef<?Pressability>(null);
33
36
  if (config != null && pressabilityRef.current == null) {
34
37
  pressabilityRef.current = new Pressability(config);
@@ -24,7 +24,7 @@ export type Props = $ReadOnly<{|
24
24
  internal_excludeInspector?: boolean,
25
25
  |}>;
26
26
 
27
- const AppContainer: React.AbstractComponent<Props> = __DEV__
27
+ const AppContainer: component(...Props) = __DEV__
28
28
  ? require('./AppContainer-dev').default
29
29
  : require('./AppContainer-prod').default;
30
30
 
@@ -46,7 +46,6 @@ type AppParameters = {
46
46
  initialProps: $ReadOnly<{[string]: mixed, ...}>,
47
47
  rootTag: RootTag,
48
48
  fabric?: boolean,
49
- concurrentRoot?: boolean,
50
49
  };
51
50
  export type Runnable = (
52
51
  appParameters: AppParameters,
@@ -120,10 +119,6 @@ const AppRegistry = {
120
119
  ): string {
121
120
  const scopedPerformanceLogger = createPerformanceLogger();
122
121
  runnables[appKey] = (appParameters, displayMode) => {
123
- const concurrentRootEnabled = Boolean(
124
- appParameters.initialProps?.concurrentRoot ||
125
- appParameters.concurrentRoot,
126
- );
127
122
  renderApplication(
128
123
  componentProviderInstrumentationHook(
129
124
  componentProvider,
@@ -138,7 +133,6 @@ const AppRegistry = {
138
133
  appKey === 'LogBox', // is logbox
139
134
  appKey,
140
135
  displayMode,
141
- concurrentRootEnabled,
142
136
  );
143
137
  };
144
138
  if (section) {
@@ -12,7 +12,7 @@ export opaque type DisplayModeType = number;
12
12
 
13
13
  /** DisplayMode should be in sync with the method displayModeToInt from
14
14
  * react/renderer/uimanager/primitives.h. */
15
- const DisplayMode: {[string]: DisplayModeType} = Object.freeze({
15
+ const DisplayMode: {+[string]: DisplayModeType} = Object.freeze({
16
16
  VISIBLE: 1,
17
17
  SUSPENDED: 2,
18
18
  HIDDEN: 3,