@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
@@ -1,152 +0,0 @@
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-local
8
- * @format
9
- */
10
-
11
- import type {
12
- HostInstance,
13
- MeasureInWindowOnSuccessCallback,
14
- MeasureLayoutOnSuccessCallback,
15
- MeasureOnSuccessCallback,
16
- NativeMethods,
17
- } from '../../../src/private/types/HostInstance';
18
- import type {
19
- InternalInstanceHandle,
20
- ViewConfig,
21
- } from '../../Renderer/shims/ReactNativeTypes';
22
-
23
- import TextInputState from '../../Components/TextInput/TextInputState';
24
- import {getNodeFromInternalInstanceHandle} from '../../ReactNative/RendererProxy';
25
- import {getFabricUIManager} from '../FabricUIManager';
26
- import {create} from './ReactNativeAttributePayload';
27
- import warnForStyleProps from './warnForStyleProps';
28
- import nullthrows from 'nullthrows';
29
-
30
- const {
31
- measure: fabricMeasure,
32
- measureInWindow: fabricMeasureInWindow,
33
- measureLayout: fabricMeasureLayout,
34
- getBoundingClientRect: fabricGetBoundingClientRect,
35
- setNativeProps,
36
- } = nullthrows(getFabricUIManager());
37
-
38
- const noop = () => {};
39
-
40
- /**
41
- * This is used for refs on host components.
42
- */
43
- export default class ReactFabricHostComponent implements NativeMethods {
44
- // These need to be accessible from `ReactFabricPublicInstanceUtils`.
45
- __nativeTag: number;
46
- __internalInstanceHandle: InternalInstanceHandle;
47
-
48
- _viewConfig: ViewConfig;
49
-
50
- constructor(
51
- tag: number,
52
- viewConfig: ViewConfig,
53
- internalInstanceHandle: InternalInstanceHandle,
54
- ) {
55
- this.__nativeTag = tag;
56
- this._viewConfig = viewConfig;
57
- this.__internalInstanceHandle = internalInstanceHandle;
58
- }
59
-
60
- blur() {
61
- // $FlowFixMe[incompatible-type] - Error supressed during the migration of HostInstance to ReactNativeElement
62
- TextInputState.blurTextInput(this);
63
- }
64
-
65
- focus() {
66
- // $FlowFixMe[incompatible-type] - Error supressed during the migration of HostInstance to ReactNativeElement
67
- TextInputState.focusTextInput(this);
68
- }
69
-
70
- measure(callback: MeasureOnSuccessCallback) {
71
- const node = getNodeFromInternalInstanceHandle(
72
- this.__internalInstanceHandle,
73
- );
74
- if (node != null) {
75
- fabricMeasure(node, callback);
76
- }
77
- }
78
-
79
- measureInWindow(callback: MeasureInWindowOnSuccessCallback) {
80
- const node = getNodeFromInternalInstanceHandle(
81
- this.__internalInstanceHandle,
82
- );
83
- if (node != null) {
84
- fabricMeasureInWindow(node, callback);
85
- }
86
- }
87
-
88
- measureLayout(
89
- relativeToNativeNode: number | HostInstance,
90
- onSuccess: MeasureLayoutOnSuccessCallback,
91
- onFail?: () => void /* currently unused */,
92
- ) {
93
- if (
94
- typeof relativeToNativeNode === 'number' ||
95
- !(relativeToNativeNode instanceof ReactFabricHostComponent)
96
- ) {
97
- if (__DEV__) {
98
- console.error(
99
- 'Warning: ref.measureLayout must be called with a ref to a native component.',
100
- );
101
- }
102
-
103
- return;
104
- }
105
-
106
- const toStateNode = getNodeFromInternalInstanceHandle(
107
- this.__internalInstanceHandle,
108
- );
109
- const fromStateNode = getNodeFromInternalInstanceHandle(
110
- relativeToNativeNode.__internalInstanceHandle,
111
- );
112
-
113
- if (toStateNode != null && fromStateNode != null) {
114
- fabricMeasureLayout(
115
- toStateNode,
116
- fromStateNode,
117
- onFail != null ? onFail : noop,
118
- onSuccess != null ? onSuccess : noop,
119
- );
120
- }
121
- }
122
-
123
- unstable_getBoundingClientRect(): DOMRect {
124
- const node = getNodeFromInternalInstanceHandle(
125
- this.__internalInstanceHandle,
126
- );
127
- if (node != null) {
128
- const rect = fabricGetBoundingClientRect(node, true);
129
-
130
- if (rect) {
131
- return new DOMRect(rect[0], rect[1], rect[2], rect[3]);
132
- }
133
- }
134
-
135
- // Empty rect if any of the above failed
136
- return new DOMRect(0, 0, 0, 0);
137
- }
138
-
139
- setNativeProps(nativeProps: {...}): void {
140
- if (__DEV__) {
141
- warnForStyleProps(nativeProps, this._viewConfig.validAttributes);
142
- }
143
- const updatePayload = create(nativeProps, this._viewConfig.validAttributes);
144
-
145
- const node = getNodeFromInternalInstanceHandle(
146
- this.__internalInstanceHandle,
147
- );
148
- if (node != null && updatePayload != null) {
149
- setNativeProps(node, updatePayload);
150
- }
151
- }
152
- }