@office-iss/react-native-win32 0.75.1 → 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.
- package/.eslintrc.js +11 -0
- package/.flowconfig +5 -4
- package/CHANGELOG.json +172 -40
- package/CHANGELOG.md +57 -24
- package/Libraries/Alert/Alert.js +3 -0
- package/Libraries/Animated/AnimatedEvent.js +1 -1
- package/Libraries/Animated/AnimatedImplementation.js +7 -7
- package/Libraries/Animated/NativeAnimatedAllowlist.js +111 -0
- package/Libraries/Animated/animations/Animation.js +11 -1
- package/Libraries/Animated/animations/DecayAnimation.js +1 -1
- package/Libraries/Animated/animations/SpringAnimation.js +1 -1
- package/Libraries/Animated/animations/TimingAnimation.js +2 -1
- package/Libraries/Animated/components/AnimatedScrollView.js +3 -2
- package/Libraries/Animated/createAnimatedComponent.js +10 -9
- package/Libraries/Animated/nodes/AnimatedColor.js +1 -1
- package/Libraries/Animated/nodes/AnimatedInterpolation.js +3 -2
- package/Libraries/Animated/nodes/AnimatedNode.js +42 -33
- package/Libraries/Animated/nodes/AnimatedObject.js +56 -50
- package/Libraries/Animated/nodes/AnimatedProps.js +77 -40
- package/Libraries/Animated/nodes/AnimatedStyle.js +103 -59
- package/Libraries/Animated/nodes/AnimatedTracking.js +1 -1
- package/Libraries/Animated/nodes/AnimatedTransform.js +102 -67
- package/Libraries/Animated/nodes/AnimatedValue.js +2 -1
- package/Libraries/Animated/nodes/AnimatedWithChildren.js +21 -22
- package/Libraries/Animated/useAnimatedProps.js +142 -7
- package/Libraries/BatchedBridge/NativeModules.js +2 -0
- package/Libraries/Blob/FileReader.js +1 -1
- package/Libraries/Blob/URL.js +2 -62
- package/Libraries/Blob/URLSearchParams.js +71 -0
- package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js +1 -1
- package/Libraries/Components/RefreshControl/__mocks__/RefreshControlMock.js +1 -1
- package/Libraries/Components/ScrollView/ScrollView.js +131 -169
- package/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +1 -1
- package/Libraries/Components/StatusBar/StatusBar.js +3 -1
- package/Libraries/Components/TextInput/TextInput.d.ts +32 -2
- package/Libraries/Components/TextInput/TextInput.js +230 -94
- package/Libraries/Components/TextInput/TextInput.win32.js +230 -100
- package/Libraries/Components/View/ReactNativeStyleAttributes.js +22 -0
- package/Libraries/Components/View/ReactNativeViewAttributes.js +2 -0
- package/Libraries/Components/View/ReactNativeViewAttributes.win32.js +2 -0
- package/Libraries/Components/View/ViewAccessibility.d.ts +15 -0
- package/Libraries/Components/View/ViewNativeComponent.js +0 -1
- package/Libraries/Components/View/ViewPropTypes.js +14 -0
- package/Libraries/Components/View/ViewPropTypes.win32.js +14 -0
- package/Libraries/Core/ExceptionsManager.js +2 -0
- package/Libraries/Core/InitializeCore.js +3 -1
- package/Libraries/Core/ReactFiberErrorDialog.js +3 -0
- package/Libraries/Core/ReactNativeVersion.js +4 -4
- package/Libraries/Core/ReactNativeVersionCheck.win32.js +1 -1
- package/Libraries/Core/setUpErrorHandling.js +7 -1
- package/Libraries/Core/setUpGlobals.js +1 -0
- package/Libraries/Core/setUpReactRefresh.js +0 -4
- package/Libraries/Image/AssetSourceResolver.js +28 -1
- package/Libraries/Image/Image.android.js +9 -14
- package/Libraries/Image/Image.ios.js +11 -22
- package/Libraries/Image/Image.win32.js +11 -24
- package/Libraries/Image/ImageBackground.js +1 -8
- package/Libraries/Image/ImageUtils.js +9 -9
- package/Libraries/Image/ImageViewNativeComponent.js +1 -0
- package/Libraries/Inspector/Inspector.js +3 -2
- package/Libraries/Inspector/Inspector.win32.js +3 -2
- package/Libraries/Inspector/InspectorPanel.js +16 -10
- package/Libraries/Inspector/NetworkOverlay.js +1 -1
- package/Libraries/Interaction/TaskQueue.js +1 -0
- package/Libraries/Lists/FlatList.js +1 -1
- package/Libraries/Lists/SectionList.js +2 -2
- package/Libraries/Lists/SectionListModern.js +3 -3
- package/Libraries/LogBox/Data/LogBoxData.js +24 -3
- package/Libraries/LogBox/LogBoxNotificationContainer.js +3 -2
- package/Libraries/LogBox/UI/LogBoxInspectorHeader.js +9 -8
- package/Libraries/LogBox/UI/LogBoxInspectorHeader.win32.js +9 -29
- package/Libraries/Modal/Modal.js +0 -1
- package/Libraries/NativeComponent/BaseViewConfig.android.js +8 -0
- package/Libraries/NativeComponent/BaseViewConfig.ios.js +7 -0
- package/Libraries/NativeComponent/BaseViewConfig.win32.js +7 -0
- package/Libraries/NativeComponent/NativeComponentRegistry.js +22 -22
- package/Libraries/NativeComponent/StaticViewConfigValidator.js +0 -21
- package/Libraries/Network/XMLHttpRequest.js +4 -2
- package/Libraries/ReactNative/AppContainer-dev.js +1 -5
- package/Libraries/ReactNative/AppContainer-prod.js +1 -5
- package/Libraries/ReactNative/AppContainer.js +0 -1
- package/Libraries/ReactNative/AppRegistry.js +0 -6
- package/Libraries/ReactNative/BridgelessUIManager.js +1 -0
- package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricHostComponent.js +1 -1
- package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstance.js +5 -5
- package/Libraries/ReactNative/RendererImplementation.js +26 -4
- package/Libraries/ReactNative/getNativeComponentAttributes.js +8 -0
- package/Libraries/ReactNative/renderApplication.js +0 -2
- package/Libraries/Renderer/shims/ReactNativeTypes.js +11 -4
- package/Libraries/StyleSheet/StyleSheet.js +1 -1
- package/Libraries/StyleSheet/StyleSheet.win32.js +1 -1
- package/Libraries/StyleSheet/StyleSheetTypes.d.ts +74 -15
- package/Libraries/StyleSheet/StyleSheetTypes.js +60 -5
- package/Libraries/StyleSheet/processBackgroundImage.js +384 -0
- package/Libraries/StyleSheet/processBoxShadow.js +211 -0
- package/Libraries/StyleSheet/processFilter.js +231 -42
- package/Libraries/Text/Text.js +394 -196
- package/Libraries/Text/Text.win32.js +442 -229
- package/Libraries/Text/TextNativeComponent.js +2 -1
- package/Libraries/Text/TextNativeComponent.win32.js +1 -1
- package/Libraries/TurboModule/TurboModuleRegistry.js +13 -50
- package/Libraries/Types/CodegenTypes.js +3 -1
- package/Libraries/Utilities/Appearance.js +108 -84
- package/Libraries/Utilities/DevLoadingView.js +2 -4
- package/Libraries/Utilities/HMRClient.js +2 -1
- package/Libraries/Utilities/ReactNativeTestTools.js +1 -1
- package/Libraries/Utilities/createPerformanceLogger.js +0 -9
- package/Libraries/Utilities/stringifyViewConfig.js +22 -0
- package/Libraries/Utilities/useColorScheme.js +3 -3
- package/Libraries/WebSocket/WebSocket.js +1 -1
- package/Libraries/promiseRejectionTrackingOptions.js +1 -1
- package/Libraries/vendor/emitter/EventEmitter.js +6 -5
- package/flow/jest.js +2 -2
- package/index.js +3 -1
- package/index.win32.js +3 -1
- package/jest/mockComponent.js +4 -1
- package/jest/mockModal.js +1 -3
- package/jest/mockScrollView.js +1 -1
- package/jest/renderer.js +2 -2
- package/jest/setup.js +16 -13
- package/jest.config.js +1 -2
- package/overrides.json +22 -22
- package/package.json +27 -26
- package/src/private/animated/NativeAnimatedHelper.js +438 -0
- package/src/private/animated/NativeAnimatedHelper.win32.js +440 -0
- package/src/private/animated/NativeAnimatedValidation.js +64 -0
- package/src/private/components/HScrollViewNativeComponents.js +56 -0
- package/src/private/components/SafeAreaView_INTERNAL_DO_NOT_USE.js +27 -0
- package/src/private/components/VScrollViewNativeComponents.js +48 -0
- package/src/private/components/useSyncOnScroll.js +48 -0
- package/src/private/featureflags/ReactNativeFeatureFlags.js +166 -16
- package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +29 -5
- package/src/private/fusebox/FuseboxSessionObserver.js +42 -0
- package/{Libraries/Core → src/private/renderer/errorhandling}/ErrorHandlers.js +14 -4
- package/src/private/setup/setUpDOM.js +28 -0
- package/src/private/setup/setUpIntersectionObserver.js +27 -0
- package/src/private/setup/setUpMutationObserver.js +26 -0
- package/src/private/setup/setUpPerformanceObserver.js +64 -0
- package/src/private/specs/modules/NativeAppearance.js +3 -3
- package/src/private/specs/modules/NativeLinkingManager.js +1 -1
- package/src/private/specs/modules/NativePlatformConstantsWin.js +7 -0
- package/src/private/specs/modules/NativeSampleTurboModule.js +14 -1
- package/src/private/webapis/dom/nodes/ReadOnlyNode.js +6 -4
- package/{Libraries/IntersectionObserver → src/private/webapis/intersectionobserver}/IntersectionObserver.js +5 -3
- package/{Libraries/IntersectionObserver → src/private/webapis/intersectionobserver}/IntersectionObserverEntry.js +3 -3
- package/{Libraries/IntersectionObserver → src/private/webapis/intersectionobserver}/IntersectionObserverManager.js +14 -17
- package/src/private/{specs/modules → webapis/intersectionobserver/specs}/NativeIntersectionObserver.js +2 -2
- package/{Libraries/IntersectionObserver → src/private/webapis/intersectionobserver/specs}/__mocks__/NativeIntersectionObserver.js +4 -4
- package/{Libraries/MutationObserver → src/private/webapis/mutationobserver}/MutationObserver.js +5 -3
- package/{Libraries/MutationObserver → src/private/webapis/mutationobserver}/MutationObserverManager.js +24 -15
- package/{Libraries/MutationObserver → src/private/webapis/mutationobserver}/MutationRecord.js +4 -6
- package/src/private/{specs/modules → webapis/mutationobserver/specs}/NativeMutationObserver.js +2 -2
- package/{Libraries/MutationObserver → src/private/webapis/mutationobserver/specs}/__mocks__/NativeMutationObserver.js +5 -5
- package/src/private/webapis/performance/{EventCounts.js → EventTiming.js} +65 -3
- package/src/private/webapis/performance/LongTasks.js +39 -0
- package/src/private/webapis/performance/Performance.js +22 -9
- package/src/private/webapis/performance/PerformanceEntry.js +36 -18
- package/src/private/webapis/performance/PerformanceObserver.js +29 -43
- package/src/private/webapis/performance/RawPerformanceEntry.js +24 -1
- package/src/private/webapis/performance/UserTiming.js +17 -12
- package/src/private/webapis/performance/specs/NativePerformanceObserver.js +1 -1
- package/src-win/Libraries/Components/View/ViewAccessibility.d.ts +15 -0
- package/types/experimental.d.ts +20 -1
- package/Libraries/Animated/NativeAnimatedHelper.js +0 -615
- package/Libraries/Animated/NativeAnimatedHelper.win32.js +0 -617
- package/Libraries/Core/setUpIntersectionObserver.js +0 -16
- package/Libraries/Core/setUpMutationObserver.js +0 -16
- package/Libraries/Core/setUpPerformanceObserver.js +0 -18
- package/Libraries/IntersectionObserver/NativeIntersectionObserver.js +0 -13
- package/Libraries/MutationObserver/NativeMutationObserver.js +0 -13
- package/Libraries/Utilities/verifyComponentAttributeEquivalence.js +0 -135
- package/src/private/core/setUpDOM.js +0 -18
- package/src/private/webapis/performance/PerformanceEventTiming.js +0 -55
- /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
|