@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
package/index.js CHANGED
@@ -5,154 +5,79 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
7
  * @format
8
- * @flow
8
+ * @flow strict-local
9
9
  */
10
10
 
11
+ // flowlint unsafe-getters-setters:off
12
+ /* eslint-disable lint/no-commonjs-exports */
13
+
11
14
  'use strict';
12
15
  'use client';
13
16
 
14
- // APIs
15
- import typeof ActionSheetIOS from './Libraries/ActionSheetIOS/ActionSheetIOS';
16
- import typeof Alert from './Libraries/Alert/Alert';
17
- import typeof Animated from './Libraries/Animated/Animated';
18
- import typeof * as AnimatedModule from './Libraries/Animated/Animated';
19
- import typeof Easing from './Libraries/Animated/Easing';
20
- import typeof useAnimatedValue from './Libraries/Animated/useAnimatedValue';
21
- import typeof AppState from './Libraries/AppState/AppState';
22
- import typeof NativeModules from './Libraries/BatchedBridge/NativeModules';
23
- // Components
24
- import typeof AccessibilityInfo from './Libraries/Components/AccessibilityInfo/AccessibilityInfo';
25
- import typeof ActivityIndicator from './Libraries/Components/ActivityIndicator/ActivityIndicator';
26
- import typeof Button from './Libraries/Components/Button';
27
- import typeof Clipboard from './Libraries/Components/Clipboard/Clipboard';
28
- import typeof DrawerLayoutAndroid from './Libraries/Components/DrawerAndroid/DrawerLayoutAndroid';
29
- import typeof Keyboard from './Libraries/Components/Keyboard/Keyboard';
30
- import typeof KeyboardAvoidingView from './Libraries/Components/Keyboard/KeyboardAvoidingView';
31
- import typeof LayoutConformance from './Libraries/Components/LayoutConformance/LayoutConformance';
32
- import typeof Pressable from './Libraries/Components/Pressable/Pressable';
33
- import typeof ProgressBarAndroid from './Libraries/Components/ProgressBarAndroid/ProgressBarAndroid';
34
- import typeof RefreshControl from './Libraries/Components/RefreshControl/RefreshControl';
35
- import typeof SafeAreaView from './Libraries/Components/SafeAreaView/SafeAreaView';
36
- import typeof ScrollView from './Libraries/Components/ScrollView/ScrollView';
37
- import typeof StatusBar from './Libraries/Components/StatusBar/StatusBar';
38
- import typeof Switch from './Libraries/Components/Switch/Switch';
39
- import typeof InputAccessoryView from './Libraries/Components/TextInput/InputAccessoryView';
40
- import typeof TextInput from './Libraries/Components/TextInput/TextInput';
41
- import typeof ToastAndroid from './Libraries/Components/ToastAndroid/ToastAndroid';
42
- import typeof Touchable from './Libraries/Components/Touchable/Touchable';
43
- import typeof TouchableHighlight from './Libraries/Components/Touchable/TouchableHighlight';
44
- import typeof TouchableNativeFeedback from './Libraries/Components/Touchable/TouchableNativeFeedback';
45
- import typeof TouchableOpacity from './Libraries/Components/Touchable/TouchableOpacity';
46
- import typeof TouchableWithoutFeedback from './Libraries/Components/Touchable/TouchableWithoutFeedback';
47
- import typeof View from './Libraries/Components/View/View';
48
- import typeof RegisterCallableModule from './Libraries/Core/registerCallableModule';
49
- import typeof NativeEventEmitter from './Libraries/EventEmitter/NativeEventEmitter';
50
- import typeof RCTDeviceEventEmitter from './Libraries/EventEmitter/RCTDeviceEventEmitter';
51
- import typeof RCTNativeAppEventEmitter from './Libraries/EventEmitter/RCTNativeAppEventEmitter';
52
- import typeof Image from './Libraries/Image/Image';
53
- import typeof ImageBackground from './Libraries/Image/ImageBackground';
54
- import typeof InteractionManager from './Libraries/Interaction/InteractionManager';
55
- import typeof PanResponder from './Libraries/Interaction/PanResponder';
56
- import typeof LayoutAnimation from './Libraries/LayoutAnimation/LayoutAnimation';
57
- import typeof Linking from './Libraries/Linking/Linking';
58
- import typeof FlatList from './Libraries/Lists/FlatList';
59
- import typeof SectionList from './Libraries/Lists/SectionList';
60
- import typeof VirtualizedList from './Libraries/Lists/VirtualizedList';
61
- import typeof VirtualizedSectionList from './Libraries/Lists/VirtualizedSectionList';
62
- import typeof LogBox from './Libraries/LogBox/LogBox';
63
- import typeof Modal from './Libraries/Modal/Modal';
64
- // $FlowFixMe[invalid-exported-annotation]
65
- import typeof NativeDialogManagerAndroid from './Libraries/NativeModules/specs/NativeDialogManagerAndroid';
66
- import typeof Networking from './Libraries/Network/RCTNetworking';
67
- import typeof * as Systrace from './Libraries/Performance/Systrace';
68
- import typeof PermissionsAndroid from './Libraries/PermissionsAndroid/PermissionsAndroid';
69
- import typeof PushNotificationIOS from './Libraries/PushNotificationIOS/PushNotificationIOS';
70
- import typeof AppRegistry from './Libraries/ReactNative/AppRegistry';
71
- import typeof I18nManager from './Libraries/ReactNative/I18nManager';
72
- import typeof {RootTagContext} from './Libraries/ReactNative/RootTag';
73
- import typeof UIManager from './Libraries/ReactNative/UIManager';
74
- import typeof ReactNative from './Libraries/Renderer/shims/ReactNative';
75
- import type {
76
- HostComponent,
77
- HostInstance,
78
- } from './Libraries/Renderer/shims/ReactNativeTypes';
79
- import typeof Settings from './Libraries/Settings/Settings';
80
- import typeof Share from './Libraries/Share/Share';
81
- import typeof {PlatformColor} from './Libraries/StyleSheet/PlatformColorValueTypes';
82
- // Plugins
83
- import typeof {DynamicColorIOS} from './Libraries/StyleSheet/PlatformColorValueTypesIOS';
84
- import typeof processColor from './Libraries/StyleSheet/processColor';
85
- import typeof StyleSheet from './Libraries/StyleSheet/StyleSheet';
86
- import typeof Text from './Libraries/Text/Text';
87
- import typeof * as TurboModuleRegistry from './Libraries/TurboModule/TurboModuleRegistry';
88
- import typeof UTFSequence from './Libraries/UTFSequence';
89
- import typeof * as Appearance from './Libraries/Utilities/Appearance';
90
- import typeof BackHandler from './Libraries/Utilities/BackHandler';
91
- import typeof DeviceInfo from './Libraries/Utilities/DeviceInfo';
92
- import typeof DevSettings from './Libraries/Utilities/DevSettings';
93
- import typeof Dimensions from './Libraries/Utilities/Dimensions';
94
- import typeof PixelRatio from './Libraries/Utilities/PixelRatio';
95
- import typeof Platform from './Libraries/Utilities/Platform';
96
- import typeof useColorScheme from './Libraries/Utilities/useColorScheme';
97
- import typeof useWindowDimensions from './Libraries/Utilities/useWindowDimensions';
98
- import typeof Vibration from './Libraries/Vibration/Vibration';
99
- import typeof DevMenu from './src/private/devmenu/DevMenu';
17
+ // ----------------------------------------------------------------------------
18
+ // Runtime entry point for react-native.
19
+ //
20
+ // This module is separate from index.js.flow as it provides a more lenient
21
+ // `module.exports` API at runtime, for lazy module loading and backwards
22
+ // compatibility.
23
+ //
24
+ // IMPORTANT: Keep this file in sync with index.js.flow. Test your changes
25
+ // whenever updating React Native's public API.
26
+ // ----------------------------------------------------------------------------
100
27
 
101
- const warnOnce = require('./Libraries/Utilities/warnOnce');
102
- const invariant = require('invariant');
28
+ import typeof * as ReactNativePublicAPI from './index.js.flow';
103
29
 
104
- export type {HostComponent, HostInstance};
30
+ const warnOnce = require('./Libraries/Utilities/warnOnce').default;
31
+ const invariant = require('invariant');
105
32
 
106
33
  module.exports = {
107
- get registerCallableModule(): RegisterCallableModule {
34
+ get registerCallableModule() {
108
35
  return require('./Libraries/Core/registerCallableModule').default;
109
36
  },
110
- // Components
111
- get AccessibilityInfo(): AccessibilityInfo {
37
+ // #region Components
38
+ get AccessibilityInfo() {
112
39
  return require('./Libraries/Components/AccessibilityInfo/AccessibilityInfo')
113
40
  .default;
114
41
  },
115
- get ActivityIndicator(): ActivityIndicator {
42
+ get ActivityIndicator() {
116
43
  return require('./Libraries/Components/ActivityIndicator/ActivityIndicator')
117
44
  .default;
118
45
  },
119
- get Button(): Button {
46
+ get Button() {
120
47
  return require('./Libraries/Components/Button').default;
121
48
  },
122
- // $FlowFixMe[value-as-type]
123
- get DrawerLayoutAndroid(): DrawerLayoutAndroid {
49
+ get DrawerLayoutAndroid() {
124
50
  return require('./Libraries/Components/DrawerAndroid/DrawerLayoutAndroid')
125
51
  .default;
126
52
  },
127
- get FlatList(): FlatList {
53
+ get FlatList() {
128
54
  return require('./Libraries/Lists/FlatList').default;
129
55
  },
130
- get Image(): Image {
56
+ get Image() {
131
57
  return require('./Libraries/Image/Image').default;
132
58
  },
133
- get ImageBackground(): ImageBackground {
59
+ get ImageBackground() {
134
60
  return require('./Libraries/Image/ImageBackground').default;
135
61
  },
136
- get InputAccessoryView(): InputAccessoryView {
62
+ get InputAccessoryView() {
137
63
  return require('./Libraries/Components/TextInput/InputAccessoryView')
138
64
  .default;
139
65
  },
140
- get experimental_LayoutConformance(): LayoutConformance {
66
+ get experimental_LayoutConformance() {
141
67
  return require('./Libraries/Components/LayoutConformance/LayoutConformance')
142
68
  .default;
143
69
  },
144
- get KeyboardAvoidingView(): KeyboardAvoidingView {
70
+ get KeyboardAvoidingView() {
145
71
  return require('./Libraries/Components/Keyboard/KeyboardAvoidingView')
146
72
  .default;
147
73
  },
148
- get Modal(): Modal {
149
- return require('./Libraries/Modal/Modal');
74
+ get Modal() {
75
+ return require('./Libraries/Modal/Modal').default;
150
76
  },
151
- get Pressable(): Pressable {
77
+ get Pressable() {
152
78
  return require('./Libraries/Components/Pressable/Pressable').default;
153
79
  },
154
- // $FlowFixMe[value-as-type]
155
- get ProgressBarAndroid(): ProgressBarAndroid {
80
+ get ProgressBarAndroid() {
156
81
  warnOnce(
157
82
  'progress-bar-android-moved',
158
83
  'ProgressBarAndroid has been extracted from react-native core and will be removed in a future release. ' +
@@ -162,85 +87,84 @@ module.exports = {
162
87
  return require('./Libraries/Components/ProgressBarAndroid/ProgressBarAndroid')
163
88
  .default;
164
89
  },
165
- get RefreshControl(): RefreshControl {
90
+ get RefreshControl() {
166
91
  return require('./Libraries/Components/RefreshControl/RefreshControl')
167
92
  .default;
168
93
  },
169
- get SafeAreaView(): SafeAreaView {
94
+ get SafeAreaView() {
170
95
  return require('./Libraries/Components/SafeAreaView/SafeAreaView').default;
171
96
  },
172
- get ScrollView(): ScrollView {
97
+ get ScrollView() {
173
98
  return require('./Libraries/Components/ScrollView/ScrollView').default;
174
99
  },
175
- get SectionList(): SectionList {
100
+ get SectionList() {
176
101
  return require('./Libraries/Lists/SectionList').default;
177
102
  },
178
- get StatusBar(): StatusBar {
103
+ get StatusBar() {
179
104
  return require('./Libraries/Components/StatusBar/StatusBar').default;
180
105
  },
181
- get Switch(): Switch {
106
+ get Switch() {
182
107
  return require('./Libraries/Components/Switch/Switch').default;
183
108
  },
184
- get Text(): Text {
109
+ get Text() {
185
110
  return require('./Libraries/Text/Text').default;
186
111
  },
187
- get TextInput(): TextInput {
112
+ get TextInput() {
188
113
  return require('./Libraries/Components/TextInput/TextInput').default;
189
114
  },
190
- get Touchable(): Touchable {
115
+ get Touchable() {
191
116
  return require('./Libraries/Components/Touchable/Touchable').default;
192
117
  },
193
- get TouchableHighlight(): TouchableHighlight {
118
+ get TouchableHighlight() {
194
119
  return require('./Libraries/Components/Touchable/TouchableHighlight')
195
120
  .default;
196
121
  },
197
- get TouchableNativeFeedback(): TouchableNativeFeedback {
122
+ get TouchableNativeFeedback() {
198
123
  return require('./Libraries/Components/Touchable/TouchableNativeFeedback')
199
124
  .default;
200
125
  },
201
- get TouchableOpacity(): TouchableOpacity {
126
+ get TouchableOpacity() {
202
127
  return require('./Libraries/Components/Touchable/TouchableOpacity').default;
203
128
  },
204
- get TouchableWithoutFeedback(): TouchableWithoutFeedback {
129
+ get TouchableWithoutFeedback() {
205
130
  return require('./Libraries/Components/Touchable/TouchableWithoutFeedback')
206
131
  .default;
207
132
  },
208
- get View(): View {
133
+ get View() {
209
134
  return require('./Libraries/Components/View/View').default;
210
135
  },
211
- get VirtualizedList(): VirtualizedList {
136
+ get VirtualizedList() {
212
137
  return require('./Libraries/Lists/VirtualizedList').default;
213
138
  },
214
- get VirtualizedSectionList(): VirtualizedSectionList {
139
+ get VirtualizedSectionList() {
215
140
  return require('./Libraries/Lists/VirtualizedSectionList').default;
216
141
  },
217
-
218
- // APIs
219
- get ActionSheetIOS(): ActionSheetIOS {
142
+ // #endregion
143
+ // #region APIs
144
+ get ActionSheetIOS() {
220
145
  return require('./Libraries/ActionSheetIOS/ActionSheetIOS').default;
221
146
  },
222
- get Alert(): Alert {
147
+ get Alert() {
223
148
  return require('./Libraries/Alert/Alert').default;
224
149
  },
225
150
  // Include any types exported in the Animated module together with its default export, so
226
151
  // you can references types such as Animated.Numeric
227
- get Animated(): {...$Diff<AnimatedModule, {default: any}>, ...Animated} {
228
- // $FlowExpectedError[prop-missing]: we only return the default export, all other exports are types
152
+ get Animated() {
229
153
  return require('./Libraries/Animated/Animated').default;
230
154
  },
231
- get Appearance(): Appearance {
155
+ get Appearance() {
232
156
  return require('./Libraries/Utilities/Appearance');
233
157
  },
234
- get AppRegistry(): AppRegistry {
158
+ get AppRegistry() {
235
159
  return require('./Libraries/ReactNative/AppRegistry').default;
236
160
  },
237
- get AppState(): AppState {
161
+ get AppState() {
238
162
  return require('./Libraries/AppState/AppState').default;
239
163
  },
240
- get BackHandler(): BackHandler {
241
- return require('./Libraries/Utilities/BackHandler');
164
+ get BackHandler() {
165
+ return require('./Libraries/Utilities/BackHandler').default;
242
166
  },
243
- get Clipboard(): Clipboard {
167
+ get Clipboard() {
244
168
  warnOnce(
245
169
  'clipboard-moved',
246
170
  'Clipboard has been extracted from react-native core and will be removed in a future release. ' +
@@ -249,154 +173,144 @@ module.exports = {
249
173
  );
250
174
  return require('./Libraries/Components/Clipboard/Clipboard').default;
251
175
  },
252
- get DeviceInfo(): DeviceInfo {
253
- return require('./Libraries/Utilities/DeviceInfo');
176
+ get DeviceInfo() {
177
+ return require('./Libraries/Utilities/DeviceInfo').default;
254
178
  },
255
- get DevMenu(): DevMenu {
256
- return require('./src/private/devmenu/DevMenu');
179
+ get DevMenu() {
180
+ return require('./src/private/devmenu/DevMenu').default;
257
181
  },
258
- get DevSettings(): DevSettings {
259
- return require('./Libraries/Utilities/DevSettings');
182
+ get DevSettings() {
183
+ return require('./Libraries/Utilities/DevSettings').default;
260
184
  },
261
- get Dimensions(): Dimensions {
185
+ get Dimensions() {
262
186
  return require('./Libraries/Utilities/Dimensions').default;
263
187
  },
264
- get Easing(): Easing {
188
+ get Easing() {
265
189
  return require('./Libraries/Animated/Easing').default;
266
190
  },
267
- get findNodeHandle(): $PropertyType<ReactNative, 'findNodeHandle'> {
191
+ get findNodeHandle() {
268
192
  return require('./Libraries/ReactNative/RendererProxy').findNodeHandle;
269
193
  },
270
- get I18nManager(): I18nManager {
194
+ get I18nManager() {
271
195
  return require('./Libraries/ReactNative/I18nManager').default;
272
196
  },
273
- get InteractionManager(): InteractionManager {
197
+ get InteractionManager() {
274
198
  return require('./Libraries/Interaction/InteractionManager').default;
275
199
  },
276
- get Keyboard(): Keyboard {
200
+ get Keyboard() {
277
201
  return require('./Libraries/Components/Keyboard/Keyboard').default;
278
202
  },
279
- get LayoutAnimation(): LayoutAnimation {
203
+ get LayoutAnimation() {
280
204
  return require('./Libraries/LayoutAnimation/LayoutAnimation').default;
281
205
  },
282
- get Linking(): Linking {
206
+ get Linking() {
283
207
  return require('./Libraries/Linking/Linking').default;
284
208
  },
285
- get LogBox(): LogBox {
209
+ get LogBox() {
286
210
  return require('./Libraries/LogBox/LogBox').default;
287
211
  },
288
- get NativeDialogManagerAndroid(): NativeDialogManagerAndroid {
212
+ get NativeDialogManagerAndroid() {
289
213
  return require('./Libraries/NativeModules/specs/NativeDialogManagerAndroid')
290
214
  .default;
291
215
  },
292
- get NativeEventEmitter(): NativeEventEmitter {
216
+ get NativeEventEmitter() {
293
217
  return require('./Libraries/EventEmitter/NativeEventEmitter').default;
294
218
  },
295
- get Networking(): Networking {
219
+ get Networking() {
296
220
  return require('./Libraries/Network/RCTNetworking').default;
297
221
  },
298
- get PanResponder(): PanResponder {
222
+ get PanResponder() {
299
223
  return require('./Libraries/Interaction/PanResponder').default;
300
224
  },
301
- get PermissionsAndroid(): PermissionsAndroid {
302
- return require('./Libraries/PermissionsAndroid/PermissionsAndroid');
225
+ get PermissionsAndroid() {
226
+ return require('./Libraries/PermissionsAndroid/PermissionsAndroid').default;
303
227
  },
304
- get PixelRatio(): PixelRatio {
228
+ get PixelRatio() {
305
229
  return require('./Libraries/Utilities/PixelRatio').default;
306
230
  },
307
- get PushNotificationIOS(): PushNotificationIOS {
231
+ get PushNotificationIOS() {
308
232
  warnOnce(
309
233
  'pushNotificationIOS-moved',
310
234
  'PushNotificationIOS has been extracted from react-native core and will be removed in a future release. ' +
311
235
  "It can now be installed and imported from '@react-native-community/push-notification-ios' instead of 'react-native'. " +
312
236
  'See https://github.com/react-native-push-notification/ios',
313
237
  );
314
- return require('./Libraries/PushNotificationIOS/PushNotificationIOS');
238
+ return require('./Libraries/PushNotificationIOS/PushNotificationIOS')
239
+ .default;
315
240
  },
316
- get Settings(): Settings {
241
+ get Settings() {
317
242
  return require('./Libraries/Settings/Settings').default;
318
243
  },
319
- get Share(): Share {
244
+ get Share() {
320
245
  return require('./Libraries/Share/Share').default;
321
246
  },
322
- get StyleSheet(): StyleSheet {
323
- return require('./Libraries/StyleSheet/StyleSheet');
247
+ get StyleSheet() {
248
+ return require('./Libraries/StyleSheet/StyleSheet').default;
324
249
  },
325
- get Systrace(): Systrace {
250
+ get Systrace() {
326
251
  return require('./Libraries/Performance/Systrace');
327
252
  },
328
- // $FlowFixMe[value-as-type]
329
- get ToastAndroid(): ToastAndroid {
253
+ get ToastAndroid() {
330
254
  return require('./Libraries/Components/ToastAndroid/ToastAndroid').default;
331
255
  },
332
- get TurboModuleRegistry(): TurboModuleRegistry {
256
+ get TurboModuleRegistry() {
333
257
  return require('./Libraries/TurboModule/TurboModuleRegistry');
334
258
  },
335
- get UIManager(): UIManager {
259
+ get UIManager() {
336
260
  return require('./Libraries/ReactNative/UIManager').default;
337
261
  },
338
- get unstable_batchedUpdates(): $PropertyType<
339
- ReactNative,
340
- 'unstable_batchedUpdates',
341
- > {
262
+ get unstable_batchedUpdates() {
342
263
  return require('./Libraries/ReactNative/RendererProxy')
343
264
  .unstable_batchedUpdates;
344
265
  },
345
- get useAnimatedValue(): useAnimatedValue {
266
+ get useAnimatedValue() {
346
267
  return require('./Libraries/Animated/useAnimatedValue').default;
347
268
  },
348
- get useColorScheme(): useColorScheme {
269
+ get useColorScheme() {
349
270
  return require('./Libraries/Utilities/useColorScheme').default;
350
271
  },
351
- get useWindowDimensions(): useWindowDimensions {
272
+ get useWindowDimensions() {
352
273
  return require('./Libraries/Utilities/useWindowDimensions').default;
353
274
  },
354
- get UTFSequence(): UTFSequence {
275
+ get UTFSequence() {
355
276
  return require('./Libraries/UTFSequence').default;
356
277
  },
357
- get Vibration(): Vibration {
278
+ get Vibration() {
358
279
  return require('./Libraries/Vibration/Vibration').default;
359
280
  },
360
-
361
- // Plugins
362
- get DeviceEventEmitter(): RCTDeviceEventEmitter {
281
+ // #endregion
282
+ // #region Plugins
283
+ get DeviceEventEmitter() {
363
284
  return require('./Libraries/EventEmitter/RCTDeviceEventEmitter').default;
364
285
  },
365
- get DynamicColorIOS(): DynamicColorIOS {
286
+ get DynamicColorIOS() {
366
287
  return require('./Libraries/StyleSheet/PlatformColorValueTypesIOS')
367
288
  .DynamicColorIOS;
368
289
  },
369
- get NativeAppEventEmitter(): RCTNativeAppEventEmitter {
290
+ get NativeAppEventEmitter() {
370
291
  return require('./Libraries/EventEmitter/RCTNativeAppEventEmitter').default;
371
292
  },
372
- get NativeModules(): NativeModules {
293
+ get NativeModules() {
373
294
  return require('./Libraries/BatchedBridge/NativeModules').default;
374
295
  },
375
- get Platform(): Platform {
376
- return require('./Libraries/Utilities/Platform');
296
+ get Platform() {
297
+ return require('./Libraries/Utilities/Platform').default;
377
298
  },
378
- get PlatformColor(): PlatformColor {
299
+ get PlatformColor() {
379
300
  return require('./Libraries/StyleSheet/PlatformColorValueTypes')
380
301
  .PlatformColor;
381
302
  },
382
- get processColor(): processColor {
303
+ get processColor() {
383
304
  return require('./Libraries/StyleSheet/processColor').default;
384
305
  },
385
- get requireNativeComponent(): <T: {...}>(
386
- uiViewClassName: string,
387
- ) => HostComponent<T> {
306
+ get requireNativeComponent() {
388
307
  return require('./Libraries/ReactNative/requireNativeComponent').default;
389
308
  },
390
- get RootTagContext(): RootTagContext {
309
+ get RootTagContext() {
391
310
  return require('./Libraries/ReactNative/RootTag').RootTagContext;
392
311
  },
393
- get unstable_enableLogBox(): () => void {
394
- return () =>
395
- console.warn(
396
- 'LogBox is enabled by default so there is no need to call unstable_enableLogBox() anymore. This is a no op and will be removed in the next version.',
397
- );
398
- },
399
- };
312
+ // #endregion
313
+ } as ReactNativePublicAPI;
400
314
 
401
315
  if (__DEV__) {
402
316
  /* $FlowFixMe[prop-missing] This is intentional: Flow will error when
package/index.win32.js CHANGED
@@ -8,9 +8,12 @@
8
8
  * @flow
9
9
  */
10
10
 
11
+ // flowlint unsafe-getters-setters:off
12
+
11
13
  'use strict';
12
14
  'use client';
13
15
 
16
+ // [[Windows
14
17
  // APIs
15
18
  import typeof ActionSheetIOS from './Libraries/ActionSheetIOS/ActionSheetIOS';
16
19
  import typeof Alert from './Libraries/Alert/Alert';
@@ -97,21 +100,25 @@ import typeof useColorScheme from './Libraries/Utilities/useColorScheme';
97
100
  import typeof useWindowDimensions from './Libraries/Utilities/useWindowDimensions';
98
101
  import typeof Vibration from './Libraries/Vibration/Vibration';
99
102
  import typeof DevMenu from './src/private/devmenu/DevMenu';
103
+ import typeof registerCallableModule from './Libraries/Core/registerCallableModule';
104
+ // Windows]]
100
105
 
101
- const warnOnce = require('./Libraries/Utilities/warnOnce');
106
+ const warnOnce = require('./Libraries/Utilities/warnOnce').default;
102
107
  const invariant = require('invariant');
103
108
 
104
109
  // Windows types
105
110
  import typeof {ColorGradientWin32} from './Libraries/StyleSheet/PlatformColorValueTypesWin32';
106
111
 
107
- export type {HostComponent, HostInstance};
108
-
109
112
  module.exports = {
110
113
  // Components
111
114
  get AccessibilityInfo(): AccessibilityInfo {
112
115
  return require('./Libraries/Components/AccessibilityInfo/AccessibilityInfo')
113
116
  .default;
114
117
  },
118
+ get registerCallableModule(): registerCallableModule {
119
+ return require('./Libraries/Core/registerCallableModule').default;
120
+ },
121
+ // #region Components
115
122
  get ActivityIndicator(): ActivityIndicator {
116
123
  return require('./Libraries/Components/ActivityIndicator/ActivityIndicator')
117
124
  .default;
@@ -146,7 +153,7 @@ module.exports = {
146
153
  .default;
147
154
  },
148
155
  get Modal(): Modal {
149
- return require('./Libraries/Modal/Modal');
156
+ return require('./Libraries/Modal/Modal').default;
150
157
  },
151
158
  get Pressable(): Pressable {
152
159
  return require('./Libraries/Components/Pressable/Pressable').default;
@@ -240,7 +247,7 @@ module.exports = {
240
247
  return require('./Libraries/AppState/AppState').default;
241
248
  },
242
249
  get BackHandler(): BackHandler {
243
- return require('./Libraries/Utilities/BackHandler');
250
+ return require('./Libraries/Utilities/BackHandler').default;
244
251
  },
245
252
  get Clipboard(): Clipboard {
246
253
  warnOnce(
@@ -252,13 +259,13 @@ module.exports = {
252
259
  return require('./Libraries/Components/Clipboard/Clipboard').default;
253
260
  },
254
261
  get DeviceInfo(): DeviceInfo {
255
- return require('./Libraries/Utilities/DeviceInfo');
262
+ return require('./Libraries/Utilities/DeviceInfo').default;
256
263
  },
257
264
  get DevMenu(): DevMenu {
258
- return require('./src/private/devmenu/DevMenu');
265
+ return require('./src/private/devmenu/DevMenu').default;
259
266
  },
260
267
  get DevSettings(): DevSettings {
261
- return require('./Libraries/Utilities/DevSettings');
268
+ return require('./Libraries/Utilities/DevSettings').default;
262
269
  },
263
270
  get Dimensions(): Dimensions {
264
271
  return require('./Libraries/Utilities/Dimensions').default;
@@ -270,7 +277,7 @@ module.exports = {
270
277
  return require('./Libraries/ReactNative/RendererProxy').findNodeHandle;
271
278
  },
272
279
  get FocusManager(): FocusManager {
273
- return require('./Libraries/Utilities/FocusManager');
280
+ return require('./Libraries/Utilities/FocusManager').default;
274
281
  },
275
282
  get I18nManager(): I18nManager {
276
283
  return require('./Libraries/ReactNative/I18nManager').default;
@@ -304,7 +311,7 @@ module.exports = {
304
311
  return require('./Libraries/Interaction/PanResponder').default;
305
312
  },
306
313
  get PermissionsAndroid(): PermissionsAndroid {
307
- return require('./Libraries/PermissionsAndroid/PermissionsAndroid');
314
+ return require('./Libraries/PermissionsAndroid/PermissionsAndroid').default;
308
315
  },
309
316
  get PixelRatio(): PixelRatio {
310
317
  return require('./Libraries/Utilities/PixelRatio').default;
@@ -316,7 +323,8 @@ module.exports = {
316
323
  "It can now be installed and imported from '@react-native-community/push-notification-ios' instead of 'react-native'. " +
317
324
  'See https://github.com/react-native-push-notification/ios',
318
325
  );
319
- return require('./Libraries/PushNotificationIOS/PushNotificationIOS');
326
+ return require('./Libraries/PushNotificationIOS/PushNotificationIOS')
327
+ .default;
320
328
  },
321
329
  // $FlowFixMe[value-as-type]
322
330
  get Settings(): Settings {
@@ -326,7 +334,7 @@ module.exports = {
326
334
  return require('./Libraries/Share/Share').default;
327
335
  },
328
336
  get StyleSheet(): StyleSheet {
329
- return require('./Libraries/StyleSheet/StyleSheet');
337
+ return require('./Libraries/StyleSheet/StyleSheet').default;
330
338
  },
331
339
  get Systrace(): Systrace {
332
340
  return require('./Libraries/Performance/Systrace');
@@ -379,7 +387,7 @@ module.exports = {
379
387
  return require('./Libraries/BatchedBridge/NativeModules').default;
380
388
  },
381
389
  get Platform(): Platform {
382
- return require('./Libraries/Utilities/Platform');
390
+ return require('./Libraries/Utilities/Platform').default;
383
391
  },
384
392
  get PlatformColor(): PlatformColor {
385
393
  return require('./Libraries/StyleSheet/PlatformColorValueTypes')
package/jest/setup.js CHANGED
@@ -150,9 +150,16 @@ jest
150
150
  ),
151
151
  }))
152
152
  .mock('../Libraries/Modal/Modal', () => {
153
- const baseComponent = mockComponent('../Libraries/Modal/Modal');
153
+ const baseComponent = mockComponent(
154
+ '../Libraries/Modal/Modal',
155
+ /* instanceMethods */ null,
156
+ /* isESModule */ true,
157
+ );
154
158
  const mockModal = jest.requireActual('./mockModal');
155
- return mockModal(baseComponent);
159
+ return {
160
+ __esModule: true,
161
+ default: mockModal(baseComponent),
162
+ };
156
163
  })
157
164
  .mock('../Libraries/Components/View/View', () => ({
158
165
  __esModule: true,