@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.
- package/.flowconfig +1 -1
- package/CHANGELOG.json +16 -1
- package/CHANGELOG.md +16 -8
- package/IntegrationTests/LayoutEventsTest.js +16 -11
- package/Libraries/Alert/Alert.js +51 -5
- package/Libraries/Alert/Alert.win32.js +50 -5
- package/Libraries/Animated/animations/Animation.js +1 -4
- package/Libraries/Animated/nodes/AnimatedObject.js +1 -0
- package/Libraries/AppState/AppState.js +24 -7
- package/Libraries/BatchedBridge/MessageQueue.js +3 -2
- package/Libraries/BatchedBridge/NativeModules.js +2 -1
- package/Libraries/Blob/Blob.js +1 -1
- package/Libraries/Blob/FileReader_old.js +9 -9
- package/Libraries/Blob/URL.js +1 -1
- package/Libraries/Blob/URLSearchParams.js +9 -9
- package/Libraries/Components/Button.js +3 -3
- package/Libraries/Components/Button.win32.js +3 -6
- package/Libraries/Components/LayoutConformance/LayoutConformance.js +1 -1
- package/Libraries/Components/Pressable/Pressable.js +9 -9
- package/Libraries/Components/Pressable/Pressable.win32.js +9 -9
- package/Libraries/Components/Pressable/useAndroidRippleForView.js +7 -7
- package/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.js +7 -1
- package/Libraries/Components/RefreshControl/RefreshControl.js +1 -1
- package/Libraries/Components/ScrollView/ScrollView.js +74 -59
- package/Libraries/Components/ScrollView/ScrollViewNativeComponent.js +5 -5
- package/Libraries/Components/ScrollView/ScrollViewNativeComponentType.js +5 -2
- package/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +3 -3
- package/Libraries/Components/Switch/Switch.js +2 -2
- package/Libraries/Components/TextInput/RCTTextInputViewConfig.js +3 -1
- package/Libraries/Components/TextInput/TextInput.flow.js +15 -13
- package/Libraries/Components/TextInput/TextInput.js +16 -14
- package/Libraries/Components/TextInput/TextInput.win32.js +16 -14
- package/Libraries/Components/TextInput/TextInputState.js +1 -1
- package/Libraries/Components/TextInput/TextInputState.win32.js +1 -1
- package/Libraries/Components/Touchable/Touchable.js +16 -16
- package/Libraries/Components/Touchable/Touchable.win32.js +16 -16
- package/Libraries/Components/Touchable/TouchableNativeFeedback.js +2 -2
- package/Libraries/Components/Touchable/TouchableWithoutFeedback.js +7 -7
- package/Libraries/Components/View/ReactNativeStyleAttributes.js +16 -2
- package/Libraries/Components/View/ViewAccessibility.js +243 -3
- package/Libraries/Components/View/ViewAccessibility.win32.js +243 -3
- package/Libraries/Components/View/ViewPropTypes.d.ts +14 -14
- package/Libraries/Components/View/ViewPropTypes.js +35 -226
- package/Libraries/Components/View/ViewPropTypes.win32.js +37 -229
- package/Libraries/Core/Devtools/symbolicateStackTrace.js +1 -1
- package/Libraries/Core/InitializeCore.js +2 -1
- package/Libraries/Core/ReactNativeVersion.js +1 -1
- package/Libraries/Core/Timers/JSTimers.js +6 -4
- package/Libraries/Core/setUpBatchedBridge.js +9 -5
- package/Libraries/Core/setUpDeveloperTools.js +3 -29
- package/Libraries/Core/setUpReactDevTools.js +1 -1
- package/Libraries/Core/setUpReactRefresh.js +1 -1
- package/Libraries/Core/setUpXHR.js +5 -2
- package/Libraries/EventEmitter/NativeEventEmitter.js +8 -2
- package/Libraries/EventEmitter/RCTDeviceEventEmitter.js +5 -4
- package/Libraries/EventEmitter/__mocks__/NativeEventEmitter.js +3 -2
- package/Libraries/Events/CustomEvent.js +1 -1
- package/Libraries/Events/EventPolyfill.js +2 -2
- package/Libraries/Image/AssetSourceResolver.js +1 -1
- package/Libraries/Image/ImageProps.js +8 -5
- package/Libraries/Image/ImageViewNativeComponent.js +1 -1
- package/Libraries/Image/resolveAssetSource.win32.js +1 -1
- package/Libraries/Interaction/InteractionManager.js +1 -1
- package/Libraries/Interaction/InteractionManagerStub.js +9 -1
- package/Libraries/Interaction/JSEventLoopWatchdog.js +1 -1
- package/Libraries/Interaction/PanResponder.js +32 -29
- package/Libraries/Interaction/TaskQueue.js +1 -1
- package/Libraries/LayoutAnimation/LayoutAnimation.js +18 -4
- package/Libraries/Lists/FillRateHelper.js +3 -3
- package/Libraries/Lists/FlatList.js +13 -13
- package/Libraries/Lists/SectionList.js +3 -1
- package/Libraries/Lists/SectionListModern.js +3 -1
- package/Libraries/Lists/ViewabilityHelper.js +3 -2
- package/Libraries/Lists/VirtualizeUtils.js +3 -3
- package/Libraries/Lists/VirtualizedList.js +5 -5
- package/Libraries/Lists/VirtualizedListContext.js +4 -2
- package/Libraries/Lists/VirtualizedSectionList.js +4 -2
- package/Libraries/LogBox/LogBox.js +9 -1
- package/Libraries/LogBox/UI/AnsiHighlight.js +7 -3
- package/Libraries/LogBox/UI/LogBoxButton.js +4 -2
- package/Libraries/LogBox/UI/LogBoxInspector.js +1 -1
- package/Libraries/LogBox/UI/LogBoxInspectorFooter.js +11 -3
- package/Libraries/LogBox/UI/LogBoxInspectorFooterButton.js +2 -0
- package/Libraries/LogBox/UI/LogBoxInspectorHeader.js +8 -2
- package/Libraries/LogBox/UI/LogBoxInspectorHeader.win32.js +8 -2
- package/Libraries/LogBox/UI/LogBoxInspectorHeaderButton.js +2 -0
- package/Libraries/LogBox/UI/LogBoxInspectorMessageHeader.js +4 -2
- package/Libraries/LogBox/UI/LogBoxInspectorReactFrames.js +3 -1
- package/Libraries/LogBox/UI/LogBoxInspectorReactFrames.win32.js +3 -1
- package/Libraries/LogBox/UI/LogBoxInspectorSourceMapStatus.js +2 -2
- package/Libraries/LogBox/UI/LogBoxInspectorStackFrame.js +5 -3
- package/Libraries/LogBox/UI/LogBoxInspectorStackFrame.win32.js +5 -3
- package/Libraries/LogBox/UI/LogBoxNotification.js +6 -2
- package/Libraries/LogBox/UI/LogBoxNotificationCountBadge.js +3 -1
- package/Libraries/LogBox/UI/LogBoxNotificationDismissButton.js +2 -0
- package/Libraries/LogBox/UI/LogBoxNotificationMessage.js +4 -1
- package/Libraries/Modal/Modal.js +74 -81
- package/Libraries/NativeComponent/BaseViewConfig.android.js +16 -6
- package/Libraries/NativeComponent/BaseViewConfig.ios.js +19 -9
- package/Libraries/NativeComponent/BaseViewConfig.win32.js +19 -9
- package/Libraries/NativeComponent/StaticViewConfigValidator.js +5 -1
- package/Libraries/Network/FormData.js +1 -1
- package/Libraries/Network/XMLHttpRequest.js +5 -6
- package/Libraries/Network/XMLHttpRequest_new.js +3 -2
- package/Libraries/Network/XMLHttpRequest_old.js +3 -2
- package/Libraries/Network/convertRequestBody.js +4 -3
- package/Libraries/Network/fetch.js +4 -3
- package/Libraries/PermissionsAndroid/PermissionsAndroid.js +63 -61
- package/Libraries/Pressability/Pressability.js +23 -23
- package/Libraries/Pressability/Pressability.win32.js +23 -23
- package/Libraries/PushNotificationIOS/PushNotificationIOS.js +119 -16
- package/Libraries/ReactNative/AppContainer-dev.js +2 -1
- package/Libraries/ReactNative/AppRegistry.js +3 -3
- package/Libraries/ReactNative/PaperUIManager.js +3 -2
- package/Libraries/ReactNative/PaperUIManager.win32.js +3 -2
- package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstance.js +2 -1
- package/Libraries/ReactNative/RootTag.js +1 -1
- package/Libraries/ReactNative/getNativeComponentAttributes.js +4 -4
- package/Libraries/ReactPrivate/ReactNativePrivateInterface.js +6 -4
- package/Libraries/Renderer/shims/ReactNativeTypes.js +4 -5
- package/Libraries/Settings/Settings.js +2 -2
- package/Libraries/Settings/Settings.win32.js +2 -2
- package/Libraries/Share/Share.js +10 -3
- package/Libraries/StyleSheet/PlatformColorValueTypes.ios.js +1 -1
- package/Libraries/StyleSheet/StyleSheet.js +1 -1
- package/Libraries/StyleSheet/StyleSheet.win32.js +2 -2
- package/Libraries/StyleSheet/__flowtests__/StyleSheet-flowtest.js +1 -1
- package/Libraries/StyleSheet/flattenStyle.js +1 -1
- package/Libraries/StyleSheet/normalizeColor.js +1 -1
- package/Libraries/StyleSheet/processAspectRatio.js +1 -1
- package/Libraries/StyleSheet/processColor.js +2 -2
- package/Libraries/StyleSheet/processFilter.js +4 -0
- package/Libraries/StyleSheet/processFontVariant.js +1 -1
- package/Libraries/StyleSheet/processTransform.js +1 -1
- package/Libraries/StyleSheet/setNormalizedColorAlpha.js +1 -1
- package/Libraries/Text/Text.js +15 -15
- package/Libraries/Text/Text.win32.js +15 -15
- package/Libraries/Text/TextAncestor.js +1 -1
- package/Libraries/Text/TextNativeComponent.js +2 -2
- package/Libraries/Text/TextNativeComponent.win32.js +2 -2
- package/Libraries/Text/TextProps.js +11 -11
- package/Libraries/Text/TextProps.win32.js +11 -11
- package/Libraries/Types/CodegenTypes.js +3 -3
- package/Libraries/Types/CoreEventTypes.js +103 -72
- package/Libraries/Types/CoreEventTypes.win32.js +115 -79
- package/Libraries/UTFSequence.js +2 -1
- package/Libraries/Utilities/BackHandler.android.js +1 -1
- package/Libraries/Utilities/BackHandler.ios.js +5 -5
- package/Libraries/Utilities/BackHandler.win32.js +1 -1
- package/Libraries/Utilities/DevLoadingView.js +1 -1
- package/Libraries/Utilities/DevSettings.js +1 -1
- package/Libraries/Utilities/DeviceInfo.js +1 -1
- package/Libraries/Utilities/DeviceInfo.win32.js +1 -1
- package/Libraries/Utilities/FeatureDetection.js +2 -4
- package/Libraries/Utilities/FocusManager.win32.js +3 -3
- package/Libraries/Utilities/GlobalPerformanceLogger.js +1 -1
- package/Libraries/Utilities/HMRClient.js +5 -33
- package/Libraries/Utilities/HMRClientProdShim.js +1 -2
- package/Libraries/Utilities/Platform.android.js +2 -2
- package/Libraries/Utilities/Platform.ios.js +2 -2
- package/Libraries/Utilities/Platform.win32.js +2 -2
- package/Libraries/Utilities/{Platform.flow.win32.js → PlatformTypes.js} +1 -0
- package/Libraries/Utilities/PolyfillFunctions.js +3 -5
- package/Libraries/Utilities/RCTLog.js +1 -1
- package/Libraries/Utilities/ReactNativeTestTools.js +1 -1
- package/Libraries/Utilities/SceneTracker.js +1 -1
- package/Libraries/Utilities/__mocks__/GlobalPerformanceLogger.js +2 -2
- package/Libraries/Utilities/binaryToBase64.js +1 -1
- package/Libraries/Utilities/deepFreezeAndThrowOnMutationInDev.js +1 -1
- package/Libraries/Utilities/defineLazyObjectProperty.js +1 -1
- package/Libraries/Utilities/differ/deepDiffer.js +3 -3
- package/Libraries/Utilities/differ/insetsDiffer.js +3 -3
- package/Libraries/Utilities/differ/matricesDiffer.js +3 -6
- package/Libraries/Utilities/differ/pointsDiffer.js +3 -3
- package/Libraries/Utilities/differ/sizesDiffer.js +3 -3
- package/Libraries/Utilities/dismissKeyboard.js +1 -1
- package/Libraries/Utilities/infoLog.js +1 -1
- package/Libraries/Utilities/logError.js +1 -1
- package/Libraries/Utilities/mapWithSeparator.js +1 -1
- package/Libraries/Utilities/warnOnce.js +1 -1
- package/Libraries/Vibration/Vibration.js +3 -3
- package/Libraries/vendor/emitter/EventEmitter.js +21 -9
- package/index.js +113 -199
- package/index.win32.js +21 -13
- package/jest/setup.js +9 -2
- package/overrides.json +35 -34
- package/package.json +15 -15
- package/src/private/devmenu/DevMenu.js +1 -1
- package/src/private/featureflags/ReactNativeFeatureFlags.js +22 -23
- package/src/private/featureflags/ReactNativeFeatureFlagsBase.js +4 -7
- package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +5 -4
- package/src/private/inspector/BoxInspector.js +1 -1
- package/src/private/inspector/ElementBox.js +3 -2
- package/src/private/inspector/ElementProperties.js +5 -3
- package/src/private/inspector/Inspector.js +2 -2
- package/src/private/inspector/InspectorOverlay.js +4 -4
- package/src/private/inspector/InspectorPanel.js +1 -1
- package/src/private/inspector/NetworkOverlay.js +4 -4
- package/src/private/inspector/PerformanceOverlay.js +3 -2
- package/src/private/inspector/ReactDevToolsOverlay.js +3 -3
- package/src/private/inspector/StyleInspector.js +1 -1
- package/src/private/inspector/XHRInterceptor.js +5 -2
- package/src/private/renderer/errorhandling/ErrorHandlers.js +2 -1
- package/src/private/specs_DEPRECATED/modules/NativeExceptionsManager.js +1 -1
- package/src/private/specs_DEPRECATED/modules/NativePermissionsAndroid.js +5 -4
- package/src/private/specs_DEPRECATED/modules/NativeUIManager.js +92 -19
- package/src/private/webapis/dom/events/CustomEvent.js +5 -7
- package/src/private/webapis/dom/events/Event.js +5 -5
- package/src/private/webapis/dom/nodes/internals/ReactNativeDocumentInstanceHandle.js +1 -0
- package/src/private/webapis/html/events/MessageEvent.js +12 -19
- package/src/private/webapis/websockets/events/CloseEvent.js +9 -11
- package/src/private/webapis/xhr/events/ProgressEvent.js +9 -11
- package/src-win/Libraries/Components/View/ViewPropTypes.d.ts +14 -14
- package/Libraries/Alert/Alert.flow.js +0 -62
- package/Libraries/Alert/RCTAlertManager.flow.js +0 -20
- package/Libraries/Utilities/Platform.flow.js +0 -91
- package/flow/react.js +0 -15
|
@@ -19,10 +19,7 @@
|
|
|
19
19
|
* @param {MatrixMath.Matrix} two Second matrix.
|
|
20
20
|
* @return {boolean} Whether or not the two matrices differ.
|
|
21
21
|
*/
|
|
22
|
-
|
|
23
|
-
one: ?Array<number>,
|
|
24
|
-
two: ?Array<number>,
|
|
25
|
-
): boolean {
|
|
22
|
+
function matricesDiffer(one: ?Array<number>, two: ?Array<number>): boolean {
|
|
26
23
|
if (one === two) {
|
|
27
24
|
return false;
|
|
28
25
|
}
|
|
@@ -46,6 +43,6 @@ const matricesDiffer = function (
|
|
|
46
43
|
one[11] !== two[11] ||
|
|
47
44
|
one[15] !== two[15]
|
|
48
45
|
);
|
|
49
|
-
}
|
|
46
|
+
}
|
|
50
47
|
|
|
51
|
-
|
|
48
|
+
export default matricesDiffer;
|
|
@@ -18,10 +18,10 @@ type Point = {
|
|
|
18
18
|
|
|
19
19
|
const dummyPoint = {x: undefined, y: undefined};
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
function pointsDiffer(one: ?Point, two: ?Point): boolean {
|
|
22
22
|
one = one || dummyPoint;
|
|
23
23
|
two = two || dummyPoint;
|
|
24
24
|
return one !== two && (one.x !== two.x || one.y !== two.y);
|
|
25
|
-
}
|
|
25
|
+
}
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
export default pointsDiffer;
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
const dummySize = {width: undefined, height: undefined};
|
|
14
14
|
type Size = {width: ?number, height: ?number};
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
function sizesDiffer(one: Size, two: Size): boolean {
|
|
17
17
|
const defaultedOne = one || dummySize;
|
|
18
18
|
const defaultedTwo = two || dummySize;
|
|
19
19
|
return (
|
|
@@ -21,6 +21,6 @@ const sizesDiffer = function (one: Size, two: Size): boolean {
|
|
|
21
21
|
(defaultedOne.width !== defaultedTwo.width ||
|
|
22
22
|
defaultedOne.height !== defaultedTwo.height)
|
|
23
23
|
);
|
|
24
|
-
}
|
|
24
|
+
}
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
export default sizesDiffer;
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
|
|
12
12
|
import NativeVibration from './NativeVibration';
|
|
13
13
|
|
|
14
|
-
const Platform = require('../Utilities/Platform');
|
|
14
|
+
const Platform = require('../Utilities/Platform').default;
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
* Vibration API
|
|
@@ -72,8 +72,8 @@ const Vibration = {
|
|
|
72
72
|
* See https://reactnative.dev/docs/vibration#vibrate
|
|
73
73
|
*/
|
|
74
74
|
vibrate: function (
|
|
75
|
-
pattern
|
|
76
|
-
repeat
|
|
75
|
+
pattern?: number | Array<number> = _default_vibration_length,
|
|
76
|
+
repeat?: boolean = false,
|
|
77
77
|
) {
|
|
78
78
|
if (Platform.OS === 'android') {
|
|
79
79
|
if (typeof pattern === 'number') {
|
|
@@ -8,11 +8,16 @@
|
|
|
8
8
|
* @format
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
+
// $FlowFixMe[unclear-type] unclear type of events
|
|
12
|
+
type UnsafeObject = Object;
|
|
13
|
+
|
|
11
14
|
export interface EventSubscription {
|
|
12
15
|
remove(): void;
|
|
13
16
|
}
|
|
14
17
|
|
|
15
|
-
export interface IEventEmitter<
|
|
18
|
+
export interface IEventEmitter<
|
|
19
|
+
TEventToArgsMap: $ReadOnly<Record<string, $ReadOnlyArray<UnsafeObject>>>,
|
|
20
|
+
> {
|
|
16
21
|
addListener<TEvent: $Keys<TEventToArgsMap>>(
|
|
17
22
|
eventType: TEvent,
|
|
18
23
|
listener: (...args: TEventToArgsMap[TEvent]) => mixed,
|
|
@@ -35,7 +40,9 @@ interface Registration<TArgs> {
|
|
|
35
40
|
+remove: () => void;
|
|
36
41
|
}
|
|
37
42
|
|
|
38
|
-
type Registry<
|
|
43
|
+
type Registry<
|
|
44
|
+
TEventToArgsMap: $ReadOnly<Record<string, $ReadOnlyArray<UnsafeObject>>>,
|
|
45
|
+
> = {
|
|
39
46
|
[K in keyof TEventToArgsMap]: Set<Registration<TEventToArgsMap[K]>>,
|
|
40
47
|
};
|
|
41
48
|
|
|
@@ -59,8 +66,11 @@ type Registry<TEventToArgsMap: {...}> = {
|
|
|
59
66
|
* emitter.emit('error', new Error('Resource not found'));
|
|
60
67
|
*
|
|
61
68
|
*/
|
|
62
|
-
export default class EventEmitter<
|
|
63
|
-
|
|
69
|
+
export default class EventEmitter<
|
|
70
|
+
TEventToArgsMap: $ReadOnly<
|
|
71
|
+
Record<string, $ReadOnlyArray<UnsafeObject>>,
|
|
72
|
+
> = $ReadOnly<Record<string, $ReadOnlyArray<UnsafeObject>>>,
|
|
73
|
+
> implements IEventEmitter<TEventToArgsMap>
|
|
64
74
|
{
|
|
65
75
|
// $FlowFixMe[incompatible-type]
|
|
66
76
|
#registry: Registry<TEventToArgsMap> = {};
|
|
@@ -81,7 +91,7 @@ export default class EventEmitter<TEventToArgsMap: {...}>
|
|
|
81
91
|
}
|
|
82
92
|
const registrations = allocate<
|
|
83
93
|
TEventToArgsMap,
|
|
84
|
-
|
|
94
|
+
$Keys<TEventToArgsMap>,
|
|
85
95
|
TEventToArgsMap[TEvent],
|
|
86
96
|
>(this.#registry, eventType);
|
|
87
97
|
const registration: Registration<TEventToArgsMap[TEvent]> = {
|
|
@@ -136,20 +146,22 @@ export default class EventEmitter<TEventToArgsMap: {...}>
|
|
|
136
146
|
* Returns the number of registered listeners for the supplied event.
|
|
137
147
|
*/
|
|
138
148
|
listenerCount<TEvent: $Keys<TEventToArgsMap>>(eventType: TEvent): number {
|
|
139
|
-
const registrations: ?Set<Registration<
|
|
149
|
+
const registrations: ?Set<Registration<TEventToArgsMap[TEvent]>> =
|
|
150
|
+
this.#registry[eventType];
|
|
140
151
|
return registrations == null ? 0 : registrations.size;
|
|
141
152
|
}
|
|
142
153
|
}
|
|
143
154
|
|
|
144
155
|
function allocate<
|
|
145
|
-
TEventToArgsMap:
|
|
156
|
+
TEventToArgsMap: $ReadOnly<Record<string, $ReadOnlyArray<UnsafeObject>>>,
|
|
146
157
|
TEvent: $Keys<TEventToArgsMap>,
|
|
147
158
|
TEventArgs: TEventToArgsMap[TEvent],
|
|
148
159
|
>(
|
|
149
160
|
registry: Registry<TEventToArgsMap>,
|
|
150
161
|
eventType: TEvent,
|
|
151
|
-
): Set<Registration<
|
|
152
|
-
let registrations: ?Set<Registration<
|
|
162
|
+
): Set<Registration<TEventToArgsMap[TEvent]>> {
|
|
163
|
+
let registrations: ?Set<Registration<TEventToArgsMap[TEvent]>> =
|
|
164
|
+
registry[eventType];
|
|
153
165
|
if (registrations == null) {
|
|
154
166
|
registrations = new Set();
|
|
155
167
|
registry[eventType] = registrations;
|