@office-iss/react-native-win32 0.75.2 → 0.76.0-preview.1

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 (174) hide show
  1. package/.eslintrc.js +11 -0
  2. package/.flowconfig +5 -4
  3. package/CHANGELOG.json +164 -47
  4. package/CHANGELOG.md +53 -28
  5. package/Libraries/Alert/Alert.js +3 -0
  6. package/Libraries/Animated/AnimatedEvent.js +1 -1
  7. package/Libraries/Animated/AnimatedImplementation.js +7 -7
  8. package/Libraries/Animated/NativeAnimatedAllowlist.js +111 -0
  9. package/Libraries/Animated/animations/Animation.js +11 -1
  10. package/Libraries/Animated/animations/DecayAnimation.js +1 -1
  11. package/Libraries/Animated/animations/SpringAnimation.js +1 -1
  12. package/Libraries/Animated/animations/TimingAnimation.js +2 -1
  13. package/Libraries/Animated/components/AnimatedScrollView.js +3 -2
  14. package/Libraries/Animated/createAnimatedComponent.js +10 -9
  15. package/Libraries/Animated/nodes/AnimatedColor.js +1 -1
  16. package/Libraries/Animated/nodes/AnimatedInterpolation.js +3 -2
  17. package/Libraries/Animated/nodes/AnimatedNode.js +42 -33
  18. package/Libraries/Animated/nodes/AnimatedObject.js +56 -50
  19. package/Libraries/Animated/nodes/AnimatedProps.js +77 -40
  20. package/Libraries/Animated/nodes/AnimatedStyle.js +103 -59
  21. package/Libraries/Animated/nodes/AnimatedTracking.js +1 -1
  22. package/Libraries/Animated/nodes/AnimatedTransform.js +102 -67
  23. package/Libraries/Animated/nodes/AnimatedValue.js +2 -1
  24. package/Libraries/Animated/nodes/AnimatedWithChildren.js +21 -22
  25. package/Libraries/Animated/useAnimatedProps.js +142 -7
  26. package/Libraries/BatchedBridge/NativeModules.js +2 -0
  27. package/Libraries/Blob/FileReader.js +1 -1
  28. package/Libraries/Blob/URL.js +2 -62
  29. package/Libraries/Blob/URLSearchParams.js +71 -0
  30. package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js +1 -1
  31. package/Libraries/Components/RefreshControl/__mocks__/RefreshControlMock.js +1 -1
  32. package/Libraries/Components/ScrollView/ScrollView.js +131 -169
  33. package/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +1 -1
  34. package/Libraries/Components/StatusBar/StatusBar.js +3 -1
  35. package/Libraries/Components/TextInput/TextInput.d.ts +32 -2
  36. package/Libraries/Components/TextInput/TextInput.js +230 -94
  37. package/Libraries/Components/TextInput/TextInput.win32.js +230 -100
  38. package/Libraries/Components/View/ReactNativeStyleAttributes.js +22 -0
  39. package/Libraries/Components/View/ReactNativeViewAttributes.js +2 -0
  40. package/Libraries/Components/View/ReactNativeViewAttributes.win32.js +2 -0
  41. package/Libraries/Components/View/ViewAccessibility.d.ts +15 -0
  42. package/Libraries/Components/View/ViewNativeComponent.js +0 -1
  43. package/Libraries/Components/View/ViewPropTypes.js +14 -0
  44. package/Libraries/Components/View/ViewPropTypes.win32.js +14 -0
  45. package/Libraries/Core/ExceptionsManager.js +2 -0
  46. package/Libraries/Core/InitializeCore.js +3 -1
  47. package/Libraries/Core/ReactFiberErrorDialog.js +3 -0
  48. package/Libraries/Core/ReactNativeVersion.js +4 -4
  49. package/Libraries/Core/ReactNativeVersionCheck.win32.js +1 -1
  50. package/Libraries/Core/setUpErrorHandling.js +7 -1
  51. package/Libraries/Core/setUpGlobals.js +1 -0
  52. package/Libraries/Core/setUpReactRefresh.js +0 -4
  53. package/Libraries/Image/AssetSourceResolver.js +28 -1
  54. package/Libraries/Image/Image.android.js +9 -14
  55. package/Libraries/Image/Image.ios.js +11 -22
  56. package/Libraries/Image/Image.win32.js +11 -24
  57. package/Libraries/Image/ImageBackground.js +1 -8
  58. package/Libraries/Image/ImageUtils.js +9 -9
  59. package/Libraries/Image/ImageViewNativeComponent.js +1 -0
  60. package/Libraries/Inspector/Inspector.js +3 -2
  61. package/Libraries/Inspector/Inspector.win32.js +3 -2
  62. package/Libraries/Inspector/InspectorPanel.js +16 -10
  63. package/Libraries/Inspector/NetworkOverlay.js +1 -1
  64. package/Libraries/Interaction/TaskQueue.js +1 -0
  65. package/Libraries/Lists/FlatList.js +1 -1
  66. package/Libraries/Lists/SectionList.js +2 -2
  67. package/Libraries/Lists/SectionListModern.js +3 -3
  68. package/Libraries/LogBox/Data/LogBoxData.js +24 -3
  69. package/Libraries/LogBox/LogBoxNotificationContainer.js +3 -2
  70. package/Libraries/LogBox/UI/LogBoxInspectorHeader.js +9 -8
  71. package/Libraries/LogBox/UI/LogBoxInspectorHeader.win32.js +9 -29
  72. package/Libraries/Modal/Modal.js +0 -1
  73. package/Libraries/NativeComponent/BaseViewConfig.android.js +8 -0
  74. package/Libraries/NativeComponent/BaseViewConfig.ios.js +7 -0
  75. package/Libraries/NativeComponent/BaseViewConfig.win32.js +7 -0
  76. package/Libraries/NativeComponent/NativeComponentRegistry.js +22 -22
  77. package/Libraries/NativeComponent/StaticViewConfigValidator.js +0 -21
  78. package/Libraries/Network/XMLHttpRequest.js +4 -2
  79. package/Libraries/ReactNative/AppContainer-dev.js +1 -5
  80. package/Libraries/ReactNative/AppContainer-prod.js +1 -5
  81. package/Libraries/ReactNative/AppContainer.js +0 -1
  82. package/Libraries/ReactNative/AppRegistry.js +0 -6
  83. package/Libraries/ReactNative/BridgelessUIManager.js +1 -0
  84. package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricHostComponent.js +1 -1
  85. package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstance.js +5 -5
  86. package/Libraries/ReactNative/RendererImplementation.js +26 -4
  87. package/Libraries/ReactNative/getNativeComponentAttributes.js +8 -0
  88. package/Libraries/ReactNative/renderApplication.js +0 -2
  89. package/Libraries/Renderer/shims/ReactNativeTypes.js +11 -4
  90. package/Libraries/StyleSheet/StyleSheet.js +1 -1
  91. package/Libraries/StyleSheet/StyleSheet.win32.js +1 -1
  92. package/Libraries/StyleSheet/StyleSheetTypes.d.ts +57 -0
  93. package/Libraries/StyleSheet/StyleSheetTypes.js +60 -5
  94. package/Libraries/StyleSheet/processBackgroundImage.js +384 -0
  95. package/Libraries/StyleSheet/processBoxShadow.js +211 -0
  96. package/Libraries/StyleSheet/processFilter.js +231 -42
  97. package/Libraries/Text/Text.js +394 -196
  98. package/Libraries/Text/Text.win32.js +442 -229
  99. package/Libraries/Text/TextNativeComponent.js +2 -1
  100. package/Libraries/Text/TextNativeComponent.win32.js +1 -1
  101. package/Libraries/TurboModule/TurboModuleRegistry.js +13 -50
  102. package/Libraries/Types/CodegenTypes.js +3 -1
  103. package/Libraries/Utilities/Appearance.js +108 -84
  104. package/Libraries/Utilities/DevLoadingView.js +2 -4
  105. package/Libraries/Utilities/HMRClient.js +2 -1
  106. package/Libraries/Utilities/ReactNativeTestTools.js +1 -1
  107. package/Libraries/Utilities/createPerformanceLogger.js +0 -9
  108. package/Libraries/Utilities/stringifyViewConfig.js +22 -0
  109. package/Libraries/Utilities/useColorScheme.js +3 -3
  110. package/Libraries/WebSocket/WebSocket.js +1 -1
  111. package/Libraries/promiseRejectionTrackingOptions.js +1 -1
  112. package/Libraries/vendor/emitter/EventEmitter.js +6 -5
  113. package/flow/jest.js +2 -2
  114. package/index.js +3 -1
  115. package/index.win32.js +3 -1
  116. package/jest/mockComponent.js +4 -1
  117. package/jest/mockModal.js +1 -3
  118. package/jest/mockScrollView.js +1 -1
  119. package/jest/renderer.js +2 -2
  120. package/jest/setup.js +16 -13
  121. package/jest.config.js +1 -2
  122. package/overrides.json +22 -22
  123. package/package.json +30 -30
  124. package/src/private/animated/NativeAnimatedHelper.js +438 -0
  125. package/src/private/animated/NativeAnimatedHelper.win32.js +440 -0
  126. package/src/private/animated/NativeAnimatedValidation.js +64 -0
  127. package/src/private/components/HScrollViewNativeComponents.js +56 -0
  128. package/src/private/components/SafeAreaView_INTERNAL_DO_NOT_USE.js +27 -0
  129. package/src/private/components/VScrollViewNativeComponents.js +48 -0
  130. package/src/private/components/useSyncOnScroll.js +48 -0
  131. package/src/private/featureflags/ReactNativeFeatureFlags.js +166 -16
  132. package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +29 -5
  133. package/src/private/fusebox/FuseboxSessionObserver.js +42 -0
  134. package/{Libraries/Core → src/private/renderer/errorhandling}/ErrorHandlers.js +14 -4
  135. package/src/private/setup/setUpDOM.js +28 -0
  136. package/src/private/setup/setUpIntersectionObserver.js +27 -0
  137. package/src/private/setup/setUpMutationObserver.js +26 -0
  138. package/src/private/setup/setUpPerformanceObserver.js +64 -0
  139. package/src/private/specs/modules/NativeAppearance.js +3 -3
  140. package/src/private/specs/modules/NativeLinkingManager.js +1 -1
  141. package/src/private/specs/modules/NativePlatformConstantsWin.js +7 -0
  142. package/src/private/specs/modules/NativeSampleTurboModule.js +14 -1
  143. package/src/private/webapis/dom/nodes/ReadOnlyNode.js +6 -4
  144. package/{Libraries/IntersectionObserver → src/private/webapis/intersectionobserver}/IntersectionObserver.js +5 -3
  145. package/{Libraries/IntersectionObserver → src/private/webapis/intersectionobserver}/IntersectionObserverEntry.js +3 -3
  146. package/{Libraries/IntersectionObserver → src/private/webapis/intersectionobserver}/IntersectionObserverManager.js +14 -17
  147. package/src/private/{specs/modules → webapis/intersectionobserver/specs}/NativeIntersectionObserver.js +2 -2
  148. package/{Libraries/IntersectionObserver → src/private/webapis/intersectionobserver/specs}/__mocks__/NativeIntersectionObserver.js +4 -4
  149. package/{Libraries/MutationObserver → src/private/webapis/mutationobserver}/MutationObserver.js +5 -3
  150. package/{Libraries/MutationObserver → src/private/webapis/mutationobserver}/MutationObserverManager.js +24 -15
  151. package/{Libraries/MutationObserver → src/private/webapis/mutationobserver}/MutationRecord.js +4 -6
  152. package/src/private/{specs/modules → webapis/mutationobserver/specs}/NativeMutationObserver.js +2 -2
  153. package/{Libraries/MutationObserver → src/private/webapis/mutationobserver/specs}/__mocks__/NativeMutationObserver.js +5 -5
  154. package/src/private/webapis/performance/{EventCounts.js → EventTiming.js} +65 -3
  155. package/src/private/webapis/performance/LongTasks.js +39 -0
  156. package/src/private/webapis/performance/Performance.js +22 -9
  157. package/src/private/webapis/performance/PerformanceEntry.js +36 -18
  158. package/src/private/webapis/performance/PerformanceObserver.js +29 -43
  159. package/src/private/webapis/performance/RawPerformanceEntry.js +24 -1
  160. package/src/private/webapis/performance/UserTiming.js +17 -12
  161. package/src/private/webapis/performance/specs/NativePerformanceObserver.js +1 -1
  162. package/src-win/Libraries/Components/View/ViewAccessibility.d.ts +15 -0
  163. package/types/experimental.d.ts +20 -1
  164. package/Libraries/Animated/NativeAnimatedHelper.js +0 -615
  165. package/Libraries/Animated/NativeAnimatedHelper.win32.js +0 -617
  166. package/Libraries/Core/setUpIntersectionObserver.js +0 -16
  167. package/Libraries/Core/setUpMutationObserver.js +0 -16
  168. package/Libraries/Core/setUpPerformanceObserver.js +0 -18
  169. package/Libraries/IntersectionObserver/NativeIntersectionObserver.js +0 -13
  170. package/Libraries/MutationObserver/NativeMutationObserver.js +0 -13
  171. package/Libraries/Utilities/verifyComponentAttributeEquivalence.js +0 -135
  172. package/src/private/core/setUpDOM.js +0 -18
  173. package/src/private/webapis/performance/PerformanceEventTiming.js +0 -55
  174. /package/src/private/{core → styles}/composeStyles.js +0 -0
@@ -1,135 +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
- * @format
8
- * @flow
9
- */
10
-
11
- import PlatformBaseViewConfig from '../NativeComponent/PlatformBaseViewConfig';
12
- import {type ViewConfig} from '../Renderer/shims/ReactNativeTypes';
13
-
14
- const IGNORED_KEYS = ['transform', 'hitSlop'];
15
-
16
- /**
17
- * The purpose of this function is to validate that the view config that
18
- * native exposes for a given view manager is the same as the view config
19
- * that is specified for that view manager in JS.
20
- *
21
- * In order to improve perf, we want to avoid calling into native to get
22
- * the view config when each view manager is used. To do this, we are moving
23
- * the configs to JS. In the future we will use these JS based view configs
24
- * to codegen the view manager on native to ensure they stay in sync without
25
- * this runtime check.
26
- *
27
- * If this function fails, that likely means a change was made to the native
28
- * view manager without updating the JS config as well. Ideally you can make
29
- * that direct change to the JS config. If you don't know what the differences
30
- * are, the best approach I've found is to create a view that prints
31
- * the return value of getNativeComponentAttributes, and then copying that
32
- * text and pasting it back into JS:
33
- * <Text selectable={true}>{JSON.stringify(getNativeComponentAttributes('RCTView'))}</Text>
34
- *
35
- * This is meant to be a stopgap until the time comes when we only have a
36
- * single source of truth. I wonder if this message will still be here two
37
- * years from now...
38
- */
39
- export default function verifyComponentAttributeEquivalence(
40
- nativeViewConfig: ViewConfig,
41
- staticViewConfig: ViewConfig,
42
- ) {
43
- for (const prop of [
44
- 'validAttributes',
45
- 'bubblingEventTypes',
46
- 'directEventTypes',
47
- ]) {
48
- const diff = Object.keys(
49
- lefthandObjectDiff(nativeViewConfig[prop], staticViewConfig[prop]),
50
- );
51
-
52
- if (diff.length > 0) {
53
- const name =
54
- staticViewConfig.uiViewClassName ?? nativeViewConfig.uiViewClassName;
55
- console.error(
56
- `'${name}' has a view config that does not match native. ` +
57
- `'${prop}' is missing: ${diff.join(', ')}`,
58
- );
59
- }
60
- }
61
- }
62
-
63
- // Return the different key-value pairs of the right object, by iterating through the keys in the left object
64
- // Note it won't return a difference where a key is missing in the left but exists the right.
65
- function lefthandObjectDiff(leftObj: Object, rightObj: Object): Object {
66
- const differentKeys: {[string]: any | {...}} = {};
67
-
68
- function compare(leftItem: any, rightItem: any, key: string) {
69
- if (typeof leftItem !== typeof rightItem && leftItem != null) {
70
- differentKeys[key] = rightItem;
71
- return;
72
- }
73
-
74
- if (typeof leftItem === 'object') {
75
- const objDiff = lefthandObjectDiff(leftItem, rightItem);
76
- if (Object.keys(objDiff).length > 1) {
77
- differentKeys[key] = objDiff;
78
- }
79
- return;
80
- }
81
-
82
- if (leftItem !== rightItem) {
83
- differentKeys[key] = rightItem;
84
- return;
85
- }
86
- }
87
-
88
- for (const key in leftObj) {
89
- if (IGNORED_KEYS.includes(key)) {
90
- continue;
91
- }
92
-
93
- if (!rightObj) {
94
- differentKeys[key] = {};
95
- } else if (leftObj.hasOwnProperty(key)) {
96
- compare(leftObj[key], rightObj[key], key);
97
- }
98
- }
99
-
100
- return differentKeys;
101
- }
102
-
103
- export function getConfigWithoutViewProps(
104
- viewConfig: ViewConfig,
105
- propName: string,
106
- ): {...} {
107
- // $FlowFixMe[invalid-computed-prop]
108
- if (!viewConfig[propName]) {
109
- return {};
110
- }
111
-
112
- return (
113
- Object.keys(viewConfig[propName])
114
- // $FlowFixMe[invalid-computed-prop]
115
- .filter(prop => !PlatformBaseViewConfig[propName][prop])
116
- .reduce<{[string]: any}>((obj, prop) => {
117
- // $FlowFixMe[invalid-computed-prop]
118
- obj[prop] = viewConfig[propName][prop];
119
- return obj;
120
- }, {})
121
- );
122
- }
123
-
124
- export function stringifyViewConfig(viewConfig: any): string {
125
- return JSON.stringify(
126
- viewConfig,
127
- (key, val) => {
128
- if (typeof val === 'function') {
129
- return `ƒ ${val.name}`;
130
- }
131
- return val;
132
- },
133
- 2,
134
- );
135
- }
@@ -1,18 +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
8
- * @format
9
- */
10
-
11
- import DOMRect from '../webapis/dom/geometry/DOMRect';
12
- import DOMRectReadOnly from '../webapis/dom/geometry/DOMRectReadOnly';
13
-
14
- // $FlowExpectedError[cannot-write] The global isn't writable anywhere but here, where we define it
15
- global.DOMRect = DOMRect;
16
-
17
- // $FlowExpectedError[cannot-write] The global isn't writable anywhere but here, where we define it
18
- global.DOMRectReadOnly = DOMRectReadOnly;
@@ -1,55 +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
- * @format
8
- * @flow strict
9
- */
10
-
11
- import type {HighResTimeStamp, PerformanceEntryJSON} from './PerformanceEntry';
12
-
13
- import {PerformanceEntry} from './PerformanceEntry';
14
-
15
- export type PerformanceEventTimingJSON = {
16
- ...PerformanceEntryJSON,
17
- processingStart: HighResTimeStamp,
18
- processingEnd: HighResTimeStamp,
19
- interactionId: number,
20
- ...
21
- };
22
-
23
- export default class PerformanceEventTiming extends PerformanceEntry {
24
- processingStart: HighResTimeStamp;
25
- processingEnd: HighResTimeStamp;
26
- interactionId: number;
27
-
28
- constructor(init: {
29
- name: string,
30
- startTime?: HighResTimeStamp,
31
- duration?: HighResTimeStamp,
32
- processingStart?: HighResTimeStamp,
33
- processingEnd?: HighResTimeStamp,
34
- interactionId?: number,
35
- }) {
36
- super({
37
- name: init.name,
38
- entryType: 'event',
39
- startTime: init.startTime ?? 0,
40
- duration: init.duration ?? 0,
41
- });
42
- this.processingStart = init.processingStart ?? 0;
43
- this.processingEnd = init.processingEnd ?? 0;
44
- this.interactionId = init.interactionId ?? 0;
45
- }
46
-
47
- toJSON(): PerformanceEventTimingJSON {
48
- return {
49
- ...super.toJSON(),
50
- processingStart: this.processingStart,
51
- processingEnd: this.processingEnd,
52
- interactionId: this.interactionId,
53
- };
54
- }
55
- }
File without changes