@office-iss/react-native-win32 0.82.0 → 0.83.0-preview.0

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 (109) hide show
  1. package/.flowconfig +2 -2
  2. package/CHANGELOG.json +43 -40
  3. package/CHANGELOG.md +15 -20
  4. package/IntegrationTests/ImageCachePolicyTest.js +1 -1
  5. package/Libraries/Animated/components/AnimatedFlatList.js +5 -3
  6. package/Libraries/Animated/components/AnimatedImage.js +4 -3
  7. package/Libraries/Animated/components/AnimatedSectionList.js +2 -2
  8. package/Libraries/Animated/components/AnimatedText.js +7 -3
  9. package/Libraries/Animated/components/AnimatedView.js +3 -2
  10. package/Libraries/Animated/createAnimatedComponent.js +24 -12
  11. package/Libraries/Animated/nodes/AnimatedColor.js +26 -10
  12. package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js +43 -15
  13. package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.win32.js +43 -15
  14. package/Libraries/Components/ActivityIndicator/ActivityIndicator.d.ts +2 -2
  15. package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.d.ts +2 -2
  16. package/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.d.ts +2 -2
  17. package/Libraries/Components/RefreshControl/RefreshControl.d.ts +3 -3
  18. package/Libraries/Components/SafeAreaView/SafeAreaView.d.ts +2 -2
  19. package/Libraries/Components/ScrollView/ScrollView.js +1 -0
  20. package/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +6 -6
  21. package/Libraries/Components/Switch/Switch.d.ts +2 -2
  22. package/Libraries/Components/TextInput/TextInput.d.ts +2 -5
  23. package/Libraries/Components/TextInput/TextInput.js +6 -0
  24. package/Libraries/Components/TextInput/TextInput.win32.js +18 -12
  25. package/Libraries/Components/TextInput/TextInputState.win32.js +2 -2
  26. package/Libraries/Components/Touchable/TouchableBounce.js +7 -7
  27. package/Libraries/Components/Touchable/TouchableWin32.js +9 -6
  28. package/Libraries/Components/Touchable/TouchableWin32.js.map +1 -1
  29. package/Libraries/Components/View/ReactNativeStyleAttributes.js +19 -1
  30. package/Libraries/Components/View/View.d.ts +2 -2
  31. package/Libraries/Components/View/View.win32.js +17 -15
  32. package/Libraries/Components/View/ViewNativeComponent.js +13 -1
  33. package/Libraries/Components/View/ViewWin32.d.ts +2 -2
  34. package/Libraries/Components/View/ViewWin32.js +1 -1
  35. package/Libraries/Core/ReactNativeVersion.js +3 -3
  36. package/Libraries/Core/setUpPerformance.js +2 -0
  37. package/Libraries/Debugging/DebuggingOverlay.js +14 -14
  38. package/Libraries/Debugging/DebuggingOverlayRegistry.js +8 -2
  39. package/Libraries/EventEmitter/RCTDeviceEventEmitter.js +5 -2
  40. package/Libraries/Image/Image.d.ts +3 -3
  41. package/Libraries/Image/ImageInjection.js +3 -6
  42. package/Libraries/Image/ImageTypes.flow.js +3 -7
  43. package/Libraries/Lists/FlatList.js +8 -8
  44. package/Libraries/Lists/SectionList.d.ts +5 -1
  45. package/Libraries/Lists/ViewabilityHelper.js +1 -1
  46. package/Libraries/Lists/VirtualizedList.js +1 -0
  47. package/Libraries/LogBox/UI/AnsiHighlight.js +4 -1
  48. package/Libraries/NativeComponent/BaseViewConfig.android.js +11 -2
  49. package/Libraries/NativeComponent/NativeComponentRegistry.d.ts +98 -0
  50. package/Libraries/NativeComponent/NativeComponentRegistry.js +2 -0
  51. package/Libraries/NativeComponent/NativeComponentRegistryUnstable.js +3 -1
  52. package/Libraries/Network/RCTNetworking.android.js +3 -1
  53. package/Libraries/Network/RCTNetworking.ios.js +3 -0
  54. package/Libraries/Network/RCTNetworking.win32.js +3 -0
  55. package/Libraries/Network/XMLHttpRequest.js +1 -41
  56. package/Libraries/Pressability/Pressability.win32.js +5 -5
  57. package/Libraries/Pressability/usePressability.js +14 -3
  58. package/Libraries/ReactNative/PaperUIManager.win32.js +7 -7
  59. package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstance.js +20 -82
  60. package/Libraries/ReactNative/getNativeComponentAttributes.js +12 -0
  61. package/Libraries/Renderer/implementations/ReactFabric-dev.js +6759 -4478
  62. package/Libraries/Renderer/implementations/ReactFabric-prod.js +3169 -3119
  63. package/Libraries/Renderer/implementations/ReactFabric-profiling.js +4732 -3535
  64. package/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js +6646 -4070
  65. package/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js +3136 -2825
  66. package/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.js +4761 -3312
  67. package/Libraries/Renderer/shims/ReactNative.js +3 -1
  68. package/Libraries/Renderer/shims/ReactNativeTypes.js +2 -1
  69. package/Libraries/Renderer/shims/ReactNativeTypes.win32.js +2 -1
  70. package/Libraries/StyleSheet/StyleSheetTypes.d.ts +1 -1
  71. package/Libraries/StyleSheet/StyleSheetTypes.js +44 -0
  72. package/Libraries/StyleSheet/processBackgroundPosition.js +284 -0
  73. package/Libraries/StyleSheet/processBackgroundRepeat.js +105 -0
  74. package/Libraries/StyleSheet/processBackgroundSize.js +104 -0
  75. package/Libraries/Text/Text.d.ts +2 -2
  76. package/Libraries/Text/TextNativeComponent.js +10 -0
  77. package/Libraries/Text/TextNativeComponent.win32.js +10 -0
  78. package/Libraries/TurboModule/TurboModuleRegistry.js +3 -9
  79. package/Libraries/Utilities/DevLoadingView.js +14 -6
  80. package/Libraries/Utilities/FocusManager.win32.js +2 -2
  81. package/Libraries/Utilities/HMRClient.js +13 -5
  82. package/flow/bom.js.flow +1 -0
  83. package/index.js +6 -0
  84. package/index.win32.js +130 -207
  85. package/index.win32.js.flow +488 -0
  86. package/jest/mockComponent.js +6 -6
  87. package/jest/setup.js +15 -10
  88. package/overrides.json +16 -10
  89. package/package.json +39 -26
  90. package/src/private/components/virtualview/VirtualView.js +22 -27
  91. package/src/private/components/virtualview/VirtualViewExperimentalNativeComponent.js +6 -0
  92. package/src/private/featureflags/ReactNativeFeatureFlags.js +100 -19
  93. package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +18 -3
  94. package/src/private/setup/setUpDefaultReactNativeEnvironment.js +6 -0
  95. package/src/private/specs_DEPRECATED/modules/NativeNetworkingIOS.js +1 -0
  96. package/src/private/webapis/dom/nodes/ReactNativeElement.js +12 -2
  97. package/src/private/webapis/intersectionobserver/IntersectionObserver.js +76 -15
  98. package/src/private/webapis/intersectionobserver/internals/IntersectionObserverManager.js +1 -0
  99. package/src/private/webapis/intersectionobserver/specs/NativeIntersectionObserver.js +1 -0
  100. package/src/private/webapis/performance/ResourceTiming.js +31 -4
  101. package/src/private/webapis/performance/internals/RawPerformanceEntry.js +4 -1
  102. package/src/private/webapis/performance/specs/NativePerformance.js +3 -0
  103. package/src-win/Libraries/Components/Touchable/TouchableWin32.tsx +6 -3
  104. package/src-win/Libraries/Components/View/ViewWin32.d.ts +2 -2
  105. package/src-win/Libraries/Text/Text.d.ts +2 -2
  106. package/src-win/index.win32.js.flow +488 -0
  107. package/types/index.d.ts +1 -0
  108. package/types/public/ReactNativeTypes.d.ts +115 -2
  109. package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricHostComponent.js +0 -152
@@ -14,29 +14,37 @@ import NativeDevLoadingView from './NativeDevLoadingView';
14
14
 
15
15
  const COLOR_SCHEME = {
16
16
  dark: {
17
+ load: {
18
+ backgroundColor: '#fafafa',
19
+ textColor: '#242526',
20
+ },
17
21
  refresh: {
18
22
  backgroundColor: '#2584e8',
19
23
  textColor: '#ffffff',
20
24
  },
21
- load: {
22
- backgroundColor: '#fafafa',
23
- textColor: '#242526',
25
+ error: {
26
+ backgroundColor: '#1065AF',
27
+ textColor: '#ffffff',
24
28
  },
25
29
  },
26
30
  default: {
31
+ load: {
32
+ backgroundColor: '#404040',
33
+ textColor: '#ffffff',
34
+ },
27
35
  refresh: {
28
36
  backgroundColor: '#2584e8',
29
37
  textColor: '#ffffff',
30
38
  },
31
- load: {
32
- backgroundColor: '#404040',
39
+ error: {
40
+ backgroundColor: '#1065AF',
33
41
  textColor: '#ffffff',
34
42
  },
35
43
  },
36
44
  };
37
45
 
38
46
  export default {
39
- showMessage(message: string, type: 'load' | 'refresh') {
47
+ showMessage(message: string, type: 'load' | 'refresh' | 'error') {
40
48
  if (NativeDevLoadingView) {
41
49
  const colorScheme =
42
50
  getColorScheme() === 'dark' ? COLOR_SCHEME.dark : COLOR_SCHEME.default;
@@ -22,14 +22,14 @@ class FocusManager {
22
22
  if (ref) {
23
23
  if (setWindowFocus) {
24
24
  UIManager.dispatchViewManagerCommand(
25
- // $FlowIgnoreMe[incompatible-call]
25
+ // $FlowFixMe[incompatible-type]
26
26
  findNodeHandle(ref),
27
27
  UIManager.getViewManagerConfig('RCTView').Commands.aggressivefocus,
28
28
  [],
29
29
  );
30
30
  } else {
31
31
  UIManager.dispatchViewManagerCommand(
32
- // $FlowIgnoreMe[incompatible-call]
32
+ // $FlowFixMe[incompatible-type]
33
33
  findNodeHandle(ref),
34
34
  UIManager.getViewManagerConfig('RCTView').Commands.politefocus,
35
35
  [],
@@ -211,7 +211,9 @@ Error: ${e.message}`;
211
211
  setHMRUnavailableReason(error);
212
212
  });
213
213
 
214
+ let pendingUpdatesCount = 0;
214
215
  client.on('update-start', ({isInitialUpdate}) => {
216
+ pendingUpdatesCount++;
215
217
  currentCompileErrorMessage = null;
216
218
  didConnect = true;
217
219
 
@@ -228,12 +230,13 @@ Error: ${e.message}`;
228
230
  });
229
231
 
230
232
  client.on('update-done', () => {
231
- DevLoadingView.hide();
233
+ pendingUpdatesCount--;
234
+ if (pendingUpdatesCount === 0) {
235
+ DevLoadingView.hide();
236
+ }
232
237
  });
233
238
 
234
239
  client.on('error', data => {
235
- DevLoadingView.hide();
236
-
237
240
  if (data.type === 'GraphNotFoundError') {
238
241
  client.close();
239
242
  setHMRUnavailableReason(
@@ -253,8 +256,6 @@ Error: ${e.message}`;
253
256
  });
254
257
 
255
258
  client.on('close', closeEvent => {
256
- DevLoadingView.hide();
257
-
258
259
  // https://www.rfc-editor.org/rfc/rfc6455.html#section-7.4.1
259
260
  // https://www.rfc-editor.org/rfc/rfc6455.html#section-7.1.5
260
261
  const isNormalOrUnsetCloseReason =
@@ -296,10 +297,17 @@ function setHMRUnavailableReason(reason: string) {
296
297
  }
297
298
  hmrUnavailableReason = reason;
298
299
 
300
+ const DevLoadingView = require('./DevLoadingView').default;
301
+ DevLoadingView.hide();
302
+
299
303
  // We only want to show a warning if Fast Refresh is on *and* if we ever
300
304
  // previously managed to connect successfully. We don't want to show
301
305
  // the warning to native engineers who use cached bundles without Metro.
302
306
  if (hmrClient.isEnabled() && didConnect) {
307
+ DevLoadingView.showMessage(
308
+ 'Fast Refresh disconnected. Reload app to reconnect.',
309
+ 'error',
310
+ );
303
311
  console.warn(reason);
304
312
  // (Not using the `warning` module to prevent a Buck cycle.)
305
313
  }
package/flow/bom.js.flow CHANGED
@@ -72,6 +72,7 @@ declare var console: {
72
72
  trackName?: string,
73
73
  trackGroup?: string,
74
74
  color?: DevToolsColor,
75
+ detail?: {[string]: mixed},
75
76
  ): void,
76
77
 
77
78
  ...
package/index.js CHANGED
@@ -66,6 +66,12 @@ module.exports = {
66
66
  get Modal() {
67
67
  return require('./Libraries/Modal/Modal').default;
68
68
  },
69
+ get unstable_NativeText() {
70
+ return require('./Libraries/Text/TextNativeComponent').NativeText;
71
+ },
72
+ get unstable_NativeView() {
73
+ return require('./Libraries/Components/View/ViewNativeComponent').default;
74
+ },
69
75
  get Pressable() {
70
76
  return require('./Libraries/Components/Pressable/Pressable').default;
71
77
  },