react-native-windows 0.69.6 → 0.70.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/.flowconfig +5 -1
- package/Chakra/ChakraHelpers.cpp +1 -1
- package/Chakra/ChakraPlatform.cpp +1 -1
- package/Chakra/ChakraValue.cpp +6 -3
- package/Chakra/ChakraValue.h +1 -1
- package/Directory.Build.props +7 -7
- package/Folly/Folly.vcxproj +20 -13
- package/Folly/cgmanifest.json +14 -0
- package/Libraries/Alert/Alert.js +18 -4
- package/Libraries/Alert/Alert.windows.js +4 -0
- package/Libraries/Alert/NativeAlertManager.js +1 -0
- package/Libraries/Animated/Animated.js +2 -2
- package/Libraries/Animated/AnimatedEvent.js +7 -4
- package/Libraries/Animated/AnimatedImplementation.js +17 -3
- package/Libraries/Animated/AnimatedMock.js +7 -2
- package/Libraries/Animated/NativeAnimatedHelper.js +220 -95
- package/Libraries/Animated/NativeAnimatedModule.js +3 -0
- package/Libraries/Animated/NativeAnimatedTurboModule.js +3 -0
- package/Libraries/Animated/animations/SpringAnimation.js +3 -3
- package/Libraries/Animated/animations/TimingAnimation.js +3 -3
- package/Libraries/Animated/createAnimatedComponent.js +8 -1
- package/Libraries/Animated/nodes/AnimatedAddition.js +3 -1
- package/Libraries/Animated/nodes/AnimatedColor.js +50 -29
- package/Libraries/Animated/nodes/AnimatedDiffClamp.js +3 -1
- package/Libraries/Animated/nodes/AnimatedDivision.js +3 -1
- package/Libraries/Animated/nodes/AnimatedInterpolation.js +22 -21
- package/Libraries/Animated/nodes/AnimatedModulo.js +3 -1
- package/Libraries/Animated/nodes/AnimatedMultiplication.js +3 -2
- package/Libraries/Animated/nodes/AnimatedProps.js +20 -12
- package/Libraries/Animated/nodes/AnimatedStyle.js +19 -16
- package/Libraries/Animated/nodes/AnimatedSubtraction.js +3 -1
- package/Libraries/Animated/nodes/AnimatedTransform.js +5 -5
- package/Libraries/Animated/nodes/AnimatedValue.js +14 -5
- package/Libraries/Animated/nodes/AnimatedValueXY.js +28 -1
- package/Libraries/Animated/useAnimatedProps.js +1 -0
- package/Libraries/AppState/AppState.js +0 -32
- package/Libraries/AppTheme/AppTheme.js +14 -8
- package/Libraries/AppTheme/AppThemeTypes.d.ts +0 -3
- package/Libraries/BatchedBridge/MessageQueue.js +21 -15
- package/Libraries/BatchedBridge/NativeModules.js +3 -4
- package/Libraries/Blob/FileReader.js +0 -6
- package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js +0 -20
- package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.windows.js +0 -20
- package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js +4 -0
- package/Libraries/Components/Keyboard/Keyboard.js +0 -11
- package/Libraries/Components/Pressable/Pressable.js +2 -0
- package/Libraries/Components/Pressable/Pressable.windows.js +2 -0
- package/Libraries/Components/SafeAreaView/RCTSafeAreaViewNativeComponent.js +1 -3
- package/Libraries/Components/SafeAreaView/SafeAreaView.js +3 -30
- package/Libraries/Components/SafeAreaView/SafeAreaView.windows.js +4 -30
- package/Libraries/Components/ScrollView/ScrollView.js +13 -11
- package/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +5 -3
- package/Libraries/Components/StatusBar/StatusBar.js +10 -7
- package/Libraries/Components/TextInput/InputAccessoryView.js +14 -13
- package/Libraries/Components/TextInput/TextInput.js +12 -2
- package/Libraries/Components/TextInput/TextInput.windows.js +12 -2
- package/Libraries/Components/Touchable/PooledClass.js +16 -4
- package/Libraries/Components/Touchable/Touchable.js +50 -1
- package/Libraries/Components/Touchable/Touchable.windows.js +972 -0
- package/Libraries/Components/Touchable/TouchableNativeFeedback.js +6 -2
- package/Libraries/Components/View/ReactNativeStyleAttributes.js +0 -7
- package/Libraries/Components/View/ViewPropTypes.js +3 -8
- package/Libraries/Components/View/ViewPropTypes.windows.js +3 -8
- package/Libraries/Core/ExceptionsManager.js +2 -0
- package/Libraries/Core/ReactNativeVersion.js +2 -2
- package/Libraries/Core/Timers/JSTimers.js +2 -2
- package/Libraries/Core/polyfillPromise.js +0 -32
- package/Libraries/Core/setUpBatchedBridge.js +5 -1
- package/Libraries/Core/setUpPerformance.js +1 -1
- package/Libraries/EventEmitter/NativeEventEmitter.js +0 -13
- package/Libraries/Image/AssetSourceResolver.js +2 -2
- package/Libraries/Image/Image.android.js +5 -3
- package/Libraries/Image/Image.ios.js +6 -3
- package/Libraries/Image/Image.windows.js +6 -3
- package/Libraries/Image/ImageSource.js +7 -5
- package/Libraries/Inspector/ElementBox.js +2 -2
- package/Libraries/Inspector/NetworkOverlay.js +13 -8
- package/Libraries/Interaction/PanResponder.js +16 -14
- package/Libraries/Linking/Linking.js +0 -11
- package/Libraries/Lists/FlatList.js +3 -2
- package/Libraries/Lists/SectionList.js +2 -0
- package/Libraries/Lists/ViewabilityHelper.js +7 -3
- package/Libraries/Lists/VirtualizeUtils.js +33 -20
- package/Libraries/Lists/VirtualizedList.js +93 -47
- package/Libraries/Lists/VirtualizedListContext.js +1 -0
- package/Libraries/Lists/VirtualizedSectionList.js +14 -9
- package/Libraries/Lists/__tests__/VirtualizeUtils-test.js +19 -18
- package/Libraries/Lists/__tests__/VirtualizedList-test.js +10 -6
- package/Libraries/LogBox/Data/LogBoxData.js +1 -1
- package/Libraries/LogBox/Data/parseLogBoxLog.js +1 -1
- package/Libraries/LogBox/LogBox.js +3 -1
- package/Libraries/LogBox/UI/AnsiHighlight.js +2 -0
- package/Libraries/LogBox/UI/LogBoxInspectorCodeFrame.js +3 -0
- package/Libraries/LogBox/UI/LogBoxInspectorSourceMapStatus.js +0 -3
- package/Libraries/LogBox/UI/LogBoxInspectorStackFrames.js +8 -3
- package/Libraries/NativeComponent/BaseViewConfig.android.js +9 -18
- package/Libraries/NativeComponent/BaseViewConfig.ios.js +26 -12
- package/Libraries/NativeComponent/BaseViewConfig.windows.js +26 -12
- package/Libraries/Network/XMLHttpRequest.js +9 -11
- package/Libraries/Performance/PureComponentDebug.js +1 -0
- package/Libraries/PermissionsAndroid/NativePermissionsAndroid.js +9 -1
- package/Libraries/PermissionsAndroid/PermissionsAndroid.js +16 -0
- package/Libraries/Pressability/Pressability.js +26 -16
- package/Libraries/Pressability/Pressability.windows.js +30 -17
- package/Libraries/Promise.js +0 -1
- package/Libraries/ReactNative/AppRegistry.js +16 -13
- package/Libraries/ReactNative/BridgelessUIManager.js +2 -0
- package/Libraries/ReactNative/PaperUIManager.js +9 -9
- package/Libraries/ReactNative/PaperUIManager.windows.js +7 -8
- package/Libraries/ReactNative/ReactNativeFeatureFlags.js +12 -0
- package/Libraries/ReactNative/ReactNativeRuntimeDiagnostics.js +68 -0
- package/Libraries/ReactNative/getNativeComponentAttributes.js +6 -7
- package/Libraries/ReactNative/renderApplication.js +1 -1
- package/Libraries/Renderer/implementations/ReactFabric-dev.js +4443 -3615
- package/Libraries/Renderer/implementations/ReactFabric-prod.js +1496 -1170
- package/Libraries/Renderer/implementations/ReactFabric-profiling.js +1694 -1356
- package/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js +4439 -3588
- package/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js +1583 -1249
- package/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.js +1719 -1372
- package/Libraries/Storage/AsyncStorage.js +7 -1
- package/Libraries/StyleSheet/PlatformColorValueTypes.ios.js +8 -0
- package/Libraries/StyleSheet/flattenStyle.js +1 -1
- package/Libraries/StyleSheet/processTransform.js +2 -0
- package/Libraries/StyleSheet/processTransform.windows.js +2 -0
- package/Libraries/StyleSheet/splitLayoutProps.js +2 -0
- package/Libraries/Text/Text.js +15 -7
- package/Libraries/Text/Text.windows.js +14 -7
- package/Libraries/Types/CoreEventTypes.js +137 -11
- package/Libraries/Types/CoreEventTypes.windows.js +147 -22
- package/Libraries/Utilities/Dimensions.js +0 -13
- package/Libraries/Utilities/HMRClient.js +3 -3
- package/Libraries/Utilities/Platform.ios.js +0 -7
- package/Libraries/Utilities/ReactNativeTestTools.js +3 -1
- package/Libraries/Utilities/codegenNativeCommands.js +11 -2
- package/Libraries/Utilities/deepFreezeAndThrowOnMutationInDev.js +2 -0
- package/Libraries/Utilities/stringifySafe.js +3 -1
- package/Libraries/Utilities/truncate.js +1 -1
- package/Libraries/Utilities/verifyComponentAttributeEquivalence.js +2 -2
- package/Libraries/Vibration/Vibration.js +1 -1
- package/Libraries/WebSocket/WebSocket.js +1 -0
- package/Libraries/vendor/emitter/EventEmitter.js +105 -12
- package/Libraries/vendor/emitter/__flowtests__/EventEmitter-flowtest.js +73 -117
- package/Microsoft.ReactNative/Base/CoreNativeModules.cpp +24 -12
- package/Microsoft.ReactNative/CoreApp.cpp +303 -0
- package/Microsoft.ReactNative/CoreAppPage.cpp +21 -0
- package/Microsoft.ReactNative/CoreAppPage.h +15 -0
- package/Microsoft.ReactNative/CoreAppPage.idl +12 -0
- package/Microsoft.ReactNative/CoreAppPage.xaml +14 -0
- package/Microsoft.ReactNative/Fabric/ActivityIndicatorComponentView.cpp +1 -2
- package/Microsoft.ReactNative/Fabric/ActivityIndicatorComponentView.h +1 -1
- package/Microsoft.ReactNative/Fabric/ComponentView.h +1 -1
- package/Microsoft.ReactNative/Fabric/ImageComponentView.cpp +1 -1
- package/Microsoft.ReactNative/Fabric/ImageComponentView.h +1 -1
- package/Microsoft.ReactNative/Fabric/ParagraphComponentView.cpp +1 -1
- package/Microsoft.ReactNative/Fabric/ParagraphComponentView.h +1 -1
- package/Microsoft.ReactNative/Fabric/ScrollViewComponentView.cpp +1 -1
- package/Microsoft.ReactNative/Fabric/ScrollViewComponentView.h +1 -1
- package/Microsoft.ReactNative/Fabric/SliderComponentView.cpp +1 -1
- package/Microsoft.ReactNative/Fabric/SliderComponentView.h +1 -1
- package/Microsoft.ReactNative/Fabric/SwitchComponentView.cpp +1 -1
- package/Microsoft.ReactNative/Fabric/SwitchComponentView.h +1 -1
- package/Microsoft.ReactNative/Fabric/TextComponentView.cpp +1 -1
- package/Microsoft.ReactNative/Fabric/TextComponentView.h +1 -1
- package/Microsoft.ReactNative/Fabric/TextInput/WindowsTextInputComponentView.cpp +1 -1
- package/Microsoft.ReactNative/Fabric/TextInput/WindowsTextInputComponentView.h +1 -1
- package/Microsoft.ReactNative/Fabric/ViewComponentView.cpp +1 -1
- package/Microsoft.ReactNative/Fabric/ViewComponentView.h +1 -1
- package/Microsoft.ReactNative/GlyphViewManager.cpp +1 -0
- package/Microsoft.ReactNative/IReactDispatcher.cpp +18 -0
- package/Microsoft.ReactNative/IReactDispatcher.h +18 -3
- package/Microsoft.ReactNative/IReactDispatcher.idl +15 -0
- package/Microsoft.ReactNative/IReactPropertyBag.cpp +9 -0
- package/Microsoft.ReactNative/IReactPropertyBag.h +3 -0
- package/Microsoft.ReactNative/IReactPropertyBag.idl +3 -0
- package/Microsoft.ReactNative/JsiApi.cpp +41 -1
- package/Microsoft.ReactNative/JsiApi.h +3 -0
- package/Microsoft.ReactNative/JsiApi.idl +19 -1
- package/Microsoft.ReactNative/Microsoft.ReactNative.vcxproj +18 -2
- package/Microsoft.ReactNative/Microsoft.ReactNative.vcxproj.filters +7 -7
- package/Microsoft.ReactNative/Modules/AccessibilityInfoModule.h +1 -1
- package/Microsoft.ReactNative/Modules/AlertModule.cpp +15 -12
- package/Microsoft.ReactNative/Modules/AlertModule.h +1 -1
- package/Microsoft.ReactNative/Modules/AppStateModule.cpp +45 -9
- package/Microsoft.ReactNative/Modules/AppStateModule.h +9 -3
- package/Microsoft.ReactNative/Modules/AppThemeModuleUwp.h +1 -1
- package/Microsoft.ReactNative/Modules/ClipboardModule.h +1 -1
- package/Microsoft.ReactNative/Modules/DevSettingsModule.h +1 -1
- package/Microsoft.ReactNative/Modules/DeviceInfoModule.h +1 -1
- package/Microsoft.ReactNative/Modules/I18nManagerModule.h +1 -1
- package/Microsoft.ReactNative/Modules/ImageViewManagerModule.cpp +1 -1
- package/Microsoft.ReactNative/Modules/ImageViewManagerModule.h +1 -1
- package/Microsoft.ReactNative/Modules/LinkingManagerModule.h +1 -1
- package/Microsoft.ReactNative/Modules/LogBoxModule.h +1 -1
- package/Microsoft.ReactNative/Modules/NativeUIManager.cpp +66 -39
- package/Microsoft.ReactNative/Modules/PaperUIManagerModule.cpp +41 -11
- package/Microsoft.ReactNative/Modules/PaperUIManagerModule.h +1 -1
- package/Microsoft.ReactNative/QuirkSettings.cpp +22 -0
- package/Microsoft.ReactNative/QuirkSettings.h +10 -0
- package/Microsoft.ReactNative/QuirkSettings.idl +7 -0
- package/Microsoft.ReactNative/ReactApplication.cpp +44 -0
- package/Microsoft.ReactNative/ReactApplication.h +40 -5
- package/Microsoft.ReactNative/ReactHost/JSCallInvokerScheduler.cpp +5 -2
- package/Microsoft.ReactNative/ReactHost/JSCallInvokerScheduler.h +1 -0
- package/Microsoft.ReactNative/ReactHost/ReactInstanceWin.cpp +23 -4
- package/Microsoft.ReactNative/ReactHost/ReactInstanceWin.h +1 -1
- package/Microsoft.ReactNative/ReactPointerEventArgs.cpp +12 -2
- package/Microsoft.ReactNative/Utils/BatchingEventEmitter.cpp +1 -0
- package/Microsoft.ReactNative/Utils/Helpers.cpp +1 -1
- package/Microsoft.ReactNative/Utils/Helpers.h +1 -1
- package/Microsoft.ReactNative/Utils/PropertyUtils.h +1 -1
- package/Microsoft.ReactNative/Utils/TransformableText.h +1 -1
- package/Microsoft.ReactNative/Utils/ValueUtils.cpp +0 -1
- package/Microsoft.ReactNative/Views/DynamicAutomationPeer.cpp +9 -7
- package/Microsoft.ReactNative/Views/DynamicAutomationProperties.cpp +3 -3
- package/Microsoft.ReactNative/Views/FlyoutViewManager.cpp +13 -1
- package/Microsoft.ReactNative/Views/FrameworkElementTransferProperties.cpp +1 -1
- package/Microsoft.ReactNative/Views/FrameworkElementViewManager.cpp +63 -13
- package/Microsoft.ReactNative/Views/Image/ImageViewManager.cpp +1 -1
- package/Microsoft.ReactNative/Views/Image/ReactImage.cpp +5 -6
- package/Microsoft.ReactNative/Views/Image/ReactImage.h +4 -4
- package/Microsoft.ReactNative/Views/Text/TextTransformParentVisitor.h +1 -1
- package/Microsoft.ReactNative/Views/TextInputViewManager.cpp +21 -2
- package/Microsoft.ReactNative/Views/TextViewManager.cpp +6 -3
- package/Microsoft.ReactNative/Views/TouchEventHandler.cpp +1 -1
- package/Microsoft.ReactNative/Views/ViewManagerBase.cpp +7 -1
- package/Microsoft.ReactNative/Views/ViewPanel.cpp +4 -0
- package/Microsoft.ReactNative/Views/ViewViewManager.cpp +8 -3
- package/Microsoft.ReactNative/Views/cppwinrt/DynamicAutomationPeer.idl +2 -0
- package/Microsoft.ReactNative/microsoft.reactnative.def +4 -1
- package/Microsoft.ReactNative.Cxx/AppModelHelpers.h +17 -0
- package/Microsoft.ReactNative.Cxx/CoreApp.h +60 -0
- package/Microsoft.ReactNative.Cxx/JSI/JsiAbiApi.cpp +65 -0
- package/Microsoft.ReactNative.Cxx/JSI/JsiAbiApi.h +13 -0
- package/Microsoft.ReactNative.Cxx/JSI/JsiValueHelpers.cpp +53 -0
- package/Microsoft.ReactNative.Cxx/JSI/JsiValueHelpers.h +32 -0
- package/Microsoft.ReactNative.Cxx/JSI/NodeApiJsiRuntime.cpp +14 -2
- package/Microsoft.ReactNative.Cxx/Microsoft.ReactNative.Cxx.vcxitems +3 -0
- package/Microsoft.ReactNative.Cxx/Microsoft.ReactNative.Cxx.vcxitems.filters +7 -0
- package/Microsoft.ReactNative.Managed/packages.lock.json +1 -24
- package/Mso/dispatchQueue/dispatchQueue.h +12 -4
- package/Mso/src/dispatchQueue/looperScheduler.cpp +36 -9
- package/Mso/src/dispatchQueue/queueService.cpp +2 -2
- package/Mso/src/dispatchQueue/queueService.h +2 -2
- package/Mso/src/memoryApi/memoryApi.cpp +3 -0
- package/PropertySheets/Generated/PackageVersion.g.props +3 -3
- package/PropertySheets/JSEngine.props +1 -1
- package/PropertySheets/Release.props +6 -0
- package/ReactCommon/ReactCommon.vcxproj +11 -21
- package/ReactCommon/ReactCommon.vcxproj.filters +64 -46
- package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/JSExecutor.h +145 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/NativeToJsBridge.cpp +344 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/text/BaseTextProps.cpp +313 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/view/ViewProps.cpp +455 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/core/ConcreteComponentDescriptor.h +216 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/core/PropsMacros.h +91 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/graphics/RectangleEdges.h +100 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/yoga/yoga/CompactValue.h +3 -1
- package/Scripts/Microsoft.ReactNative.nuspec +6 -0
- package/Scripts/Microsoft.ReactNative.targets +7 -0
- package/Shared/DevSettings.h +4 -0
- package/Shared/JSI/ChakraRuntime.cpp +11 -2
- package/Shared/JSI/ChakraRuntime.h +2 -0
- package/Shared/Modules/BlobModule.cpp +4 -4
- package/Shared/Modules/BlobModule.h +1 -1
- package/Shared/Modules/FileReaderModule.cpp +3 -2
- package/Shared/Modules/IBlobPersistor.h +1 -1
- package/Shared/Networking/IHttpResource.h +1 -0
- package/Shared/Networking/OriginPolicyHttpFilter.cpp +16 -10
- package/Shared/Networking/WinRTHttpResource.cpp +34 -2
- package/Shared/OInstance.cpp +14 -6
- package/Shared/Threading/BatchingQueueThread.cpp +23 -12
- package/Shared/Utils.cpp +2 -5
- package/codegen/NativeAlertManagerSpec.g.h +2 -0
- package/codegen/NativeAnimatedModuleSpec.g.h +6 -0
- package/codegen/NativeAnimatedTurboModuleSpec.g.h +6 -0
- package/codegen/react/components/rnwcore/Props.cpp +2 -2
- package/codegen/react/components/rnwcore/Props.h +1 -1
- package/fmt/cgmanifest.json +14 -0
- package/fmt/fmt.vcxproj +25 -11
- package/jest/assetFileTransformer.js +3 -2
- package/jest/setup.js +4 -0
- package/package.json +27 -28
- package/rntypes/index.d.ts +0 -1
- package/template/cs-app-WinAppSDK/proj/{NuGet.Config → NuGet_Config} +0 -0
- package/template/metro.devMode.config.js +49 -2
- package/template/shared-app/proj/{NuGet.Config → NuGet_Config} +0 -0
- package/template/shared-lib/proj/{NuGet.Config → NuGet_Config} +0 -0
- package/Libraries/vendor/emitter/EventSubscription.js +0 -19
- package/Libraries/vendor/emitter/_EmitterSubscription.js +0 -62
- package/Libraries/vendor/emitter/_EventEmitter.js +0 -184
- package/Libraries/vendor/emitter/_EventSubscription.js +0 -45
- package/Libraries/vendor/emitter/_EventSubscriptionVendor.js +0 -108
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/nativemodule/core/ReactCommon/TurboModule.h +0 -87
- package/Scripts/copyRNLibraries.js +0 -99
- package/jest/preprocessor.js +0 -40
- package/jest/preprocessor_DO_NOT_USE.js +0 -122
|
@@ -198,6 +198,8 @@ const AsyncStorage = {
|
|
|
198
198
|
*
|
|
199
199
|
* See https://reactnative.dev/docs/asyncstorage#flushgetrequests
|
|
200
200
|
* */
|
|
201
|
+
/* $FlowFixMe[missing-this-annot] The 'this' type annotation(s) required by
|
|
202
|
+
* Flow's LTI update could not be added via codemod */
|
|
201
203
|
flushGetRequests: function (): void {
|
|
202
204
|
const getRequests = this._getRequests;
|
|
203
205
|
const getKeys = this._getKeys;
|
|
@@ -213,7 +215,7 @@ const AsyncStorage = {
|
|
|
213
215
|
//
|
|
214
216
|
// Is there a way to avoid using the map but fix the bug in this breaking test?
|
|
215
217
|
// https://github.com/facebook/react-native/commit/8dd8ad76579d7feef34c014d387bf02065692264
|
|
216
|
-
const map = {};
|
|
218
|
+
const map: {[string]: string} = {};
|
|
217
219
|
result &&
|
|
218
220
|
result.forEach(([key, value]) => {
|
|
219
221
|
map[key] = value;
|
|
@@ -237,6 +239,8 @@ const AsyncStorage = {
|
|
|
237
239
|
*
|
|
238
240
|
* See https://reactnative.dev/docs/asyncstorage#multiget
|
|
239
241
|
*/
|
|
242
|
+
/* $FlowFixMe[missing-this-annot] The 'this' type annotation(s) required by
|
|
243
|
+
* Flow's LTI update could not be added via codemod */
|
|
240
244
|
multiGet: function (
|
|
241
245
|
keys: Array<string>,
|
|
242
246
|
callback?: ?(errors: ?Array<Error>, result: ?Array<Array<string>>) => void,
|
|
@@ -366,6 +370,8 @@ function convertErrors(
|
|
|
366
370
|
|
|
367
371
|
declare function convertError(void | null): null;
|
|
368
372
|
declare function convertError({message: string, key?: string}): Error;
|
|
373
|
+
/* $FlowFixMe[missing-local-annot] The type annotation(s) required by Flow's
|
|
374
|
+
* LTI update could not be added via codemod */
|
|
369
375
|
function convertError(error) {
|
|
370
376
|
if (!error) {
|
|
371
377
|
return null;
|
|
@@ -58,9 +58,13 @@ export const normalizeColorObject = (
|
|
|
58
58
|
const dynamic = color.dynamic;
|
|
59
59
|
const dynamicColor: NativeColorValue = {
|
|
60
60
|
dynamic: {
|
|
61
|
+
// $FlowFixMe[incompatible-use]
|
|
61
62
|
light: normalizeColor(dynamic.light),
|
|
63
|
+
// $FlowFixMe[incompatible-use]
|
|
62
64
|
dark: normalizeColor(dynamic.dark),
|
|
65
|
+
// $FlowFixMe[incompatible-use]
|
|
63
66
|
highContrastLight: normalizeColor(dynamic.highContrastLight),
|
|
67
|
+
// $FlowFixMe[incompatible-use]
|
|
64
68
|
highContrastDark: normalizeColor(dynamic.highContrastDark),
|
|
65
69
|
},
|
|
66
70
|
};
|
|
@@ -78,9 +82,13 @@ export const processColorObject = (
|
|
|
78
82
|
const dynamic = color.dynamic;
|
|
79
83
|
const dynamicColor: NativeColorValue = {
|
|
80
84
|
dynamic: {
|
|
85
|
+
// $FlowFixMe[incompatible-use]
|
|
81
86
|
light: processColor(dynamic.light),
|
|
87
|
+
// $FlowFixMe[incompatible-use]
|
|
82
88
|
dark: processColor(dynamic.dark),
|
|
89
|
+
// $FlowFixMe[incompatible-use]
|
|
83
90
|
highContrastLight: processColor(dynamic.highContrastLight),
|
|
91
|
+
// $FlowFixMe[incompatible-use]
|
|
84
92
|
highContrastDark: processColor(dynamic.highContrastDark),
|
|
85
93
|
},
|
|
86
94
|
};
|
|
@@ -24,7 +24,7 @@ function flattenStyle<+TStyleProp: DangerouslyImpreciseStyleProp>(
|
|
|
24
24
|
return style;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
const result = {};
|
|
27
|
+
const result: {[string]: $FlowFixMe} = {};
|
|
28
28
|
for (let i = 0, styleLength = style.length; i < styleLength; ++i) {
|
|
29
29
|
const computedStyle = flattenStyle(style[i]);
|
|
30
30
|
if (computedStyle) {
|
|
@@ -116,6 +116,8 @@ function processTransform(
|
|
|
116
116
|
/**
|
|
117
117
|
* Performs a destructive operation on a transform matrix.
|
|
118
118
|
*/
|
|
119
|
+
/* $FlowFixMe[missing-this-annot] The 'this' type annotation(s) required by
|
|
120
|
+
* Flow's LTI update could not be added via codemod */
|
|
119
121
|
function _multiplyTransform(
|
|
120
122
|
result: Array<number>,
|
|
121
123
|
matrixMathFunction: Function,
|
|
@@ -120,6 +120,8 @@ function processTransform(
|
|
|
120
120
|
/**
|
|
121
121
|
* Performs a destructive operation on a transform matrix.
|
|
122
122
|
*/
|
|
123
|
+
/* $FlowFixMe[missing-this-annot] The 'this' type annotation(s) required by
|
|
124
|
+
* Flow's LTI update could not be added via codemod */
|
|
123
125
|
function _multiplyTransform(
|
|
124
126
|
result: Array<number>,
|
|
125
127
|
matrixMathFunction: Function,
|
|
@@ -50,10 +50,12 @@ export default function splitLayoutProps(props: ?____ViewStyle_Internal): {
|
|
|
50
50
|
case 'top':
|
|
51
51
|
case 'transform':
|
|
52
52
|
// $FlowFixMe[cannot-write]
|
|
53
|
+
// $FlowFixMe[incompatible-use]
|
|
53
54
|
outer[prop] = props[prop];
|
|
54
55
|
break;
|
|
55
56
|
default:
|
|
56
57
|
// $FlowFixMe[cannot-write]
|
|
58
|
+
// $FlowFixMe[incompatible-use]
|
|
57
59
|
inner[prop] = props[prop];
|
|
58
60
|
break;
|
|
59
61
|
}
|
package/Libraries/Text/Text.js
CHANGED
|
@@ -8,6 +8,9 @@
|
|
|
8
8
|
* @format
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
+
import type {PressEvent} from '../Types/CoreEventTypes';
|
|
12
|
+
|
|
13
|
+
import Platform from '../Utilities/Platform';
|
|
11
14
|
import * as PressabilityDebug from '../Pressability/PressabilityDebug';
|
|
12
15
|
import usePressability from '../Pressability/usePressability';
|
|
13
16
|
import StyleSheet from '../StyleSheet/StyleSheet';
|
|
@@ -72,11 +75,11 @@ const Text: React.AbstractComponent<
|
|
|
72
75
|
pressRectOffset: pressRetentionOffset,
|
|
73
76
|
onLongPress,
|
|
74
77
|
onPress,
|
|
75
|
-
onPressIn(event) {
|
|
78
|
+
onPressIn(event: PressEvent) {
|
|
76
79
|
setHighlighted(!suppressHighlighting);
|
|
77
80
|
onPressIn?.(event);
|
|
78
81
|
},
|
|
79
|
-
onPressOut(event) {
|
|
82
|
+
onPressOut(event: PressEvent) {
|
|
80
83
|
setHighlighted(false);
|
|
81
84
|
onPressOut?.(event);
|
|
82
85
|
},
|
|
@@ -105,25 +108,25 @@ const Text: React.AbstractComponent<
|
|
|
105
108
|
eventHandlers == null
|
|
106
109
|
? null
|
|
107
110
|
: {
|
|
108
|
-
onResponderGrant(event) {
|
|
111
|
+
onResponderGrant(event: PressEvent) {
|
|
109
112
|
eventHandlers.onResponderGrant(event);
|
|
110
113
|
if (onResponderGrant != null) {
|
|
111
114
|
onResponderGrant(event);
|
|
112
115
|
}
|
|
113
116
|
},
|
|
114
|
-
onResponderMove(event) {
|
|
117
|
+
onResponderMove(event: PressEvent) {
|
|
115
118
|
eventHandlers.onResponderMove(event);
|
|
116
119
|
if (onResponderMove != null) {
|
|
117
120
|
onResponderMove(event);
|
|
118
121
|
}
|
|
119
122
|
},
|
|
120
|
-
onResponderRelease(event) {
|
|
123
|
+
onResponderRelease(event: PressEvent) {
|
|
121
124
|
eventHandlers.onResponderRelease(event);
|
|
122
125
|
if (onResponderRelease != null) {
|
|
123
126
|
onResponderRelease(event);
|
|
124
127
|
}
|
|
125
128
|
},
|
|
126
|
-
onResponderTerminate(event) {
|
|
129
|
+
onResponderTerminate(event: PressEvent) {
|
|
127
130
|
eventHandlers.onResponderTerminate(event);
|
|
128
131
|
if (onResponderTerminate != null) {
|
|
129
132
|
onResponderTerminate(event);
|
|
@@ -168,6 +171,11 @@ const Text: React.AbstractComponent<
|
|
|
168
171
|
|
|
169
172
|
const hasTextAncestor = useContext(TextAncestor);
|
|
170
173
|
|
|
174
|
+
const _accessible = Platform.select({
|
|
175
|
+
ios: accessible !== false,
|
|
176
|
+
default: accessible,
|
|
177
|
+
});
|
|
178
|
+
|
|
171
179
|
return hasTextAncestor ? (
|
|
172
180
|
<NativeVirtualText
|
|
173
181
|
{...restProps}
|
|
@@ -185,7 +193,7 @@ const Text: React.AbstractComponent<
|
|
|
185
193
|
{...restProps}
|
|
186
194
|
{...eventHandlersForText}
|
|
187
195
|
disabled={_disabled}
|
|
188
|
-
accessible={
|
|
196
|
+
accessible={_accessible}
|
|
189
197
|
accessibilityState={_accessibilityState}
|
|
190
198
|
allowFontScaling={allowFontScaling !== false}
|
|
191
199
|
ellipsizeMode={ellipsizeMode ?? 'tail'}
|
|
@@ -9,6 +9,9 @@
|
|
|
9
9
|
* @format
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
+
import type {PressEvent} from '../Types/CoreEventTypes';
|
|
13
|
+
|
|
14
|
+
import Platform from '../Utilities/Platform';
|
|
12
15
|
import * as PressabilityDebug from '../Pressability/PressabilityDebug';
|
|
13
16
|
import usePressability from '../Pressability/usePressability';
|
|
14
17
|
import StyleSheet from '../StyleSheet/StyleSheet';
|
|
@@ -76,11 +79,11 @@ const Text: React.AbstractComponent<
|
|
|
76
79
|
pressRectOffset: pressRetentionOffset,
|
|
77
80
|
onLongPress,
|
|
78
81
|
onPress,
|
|
79
|
-
onPressIn(event) {
|
|
82
|
+
onPressIn(event: PressEvent) {
|
|
80
83
|
setHighlighted(!suppressHighlighting);
|
|
81
84
|
onPressIn?.(event);
|
|
82
85
|
},
|
|
83
|
-
onPressOut(event) {
|
|
86
|
+
onPressOut(event: PressEvent) {
|
|
84
87
|
setHighlighted(false);
|
|
85
88
|
onPressOut?.(event);
|
|
86
89
|
},
|
|
@@ -109,25 +112,25 @@ const Text: React.AbstractComponent<
|
|
|
109
112
|
eventHandlers == null
|
|
110
113
|
? null
|
|
111
114
|
: {
|
|
112
|
-
onResponderGrant(event) {
|
|
115
|
+
onResponderGrant(event: PressEvent) {
|
|
113
116
|
eventHandlers.onResponderGrant(event);
|
|
114
117
|
if (onResponderGrant != null) {
|
|
115
118
|
onResponderGrant(event);
|
|
116
119
|
}
|
|
117
120
|
},
|
|
118
|
-
onResponderMove(event) {
|
|
121
|
+
onResponderMove(event: PressEvent) {
|
|
119
122
|
eventHandlers.onResponderMove(event);
|
|
120
123
|
if (onResponderMove != null) {
|
|
121
124
|
onResponderMove(event);
|
|
122
125
|
}
|
|
123
126
|
},
|
|
124
|
-
onResponderRelease(event) {
|
|
127
|
+
onResponderRelease(event: PressEvent) {
|
|
125
128
|
eventHandlers.onResponderRelease(event);
|
|
126
129
|
if (onResponderRelease != null) {
|
|
127
130
|
onResponderRelease(event);
|
|
128
131
|
}
|
|
129
132
|
},
|
|
130
|
-
onResponderTerminate(event) {
|
|
133
|
+
onResponderTerminate(event: PressEvent) {
|
|
131
134
|
eventHandlers.onResponderTerminate(event);
|
|
132
135
|
if (onResponderTerminate != null) {
|
|
133
136
|
onResponderTerminate(event);
|
|
@@ -172,13 +175,17 @@ const Text: React.AbstractComponent<
|
|
|
172
175
|
|
|
173
176
|
const hasTextAncestor = useContext(TextAncestor);
|
|
174
177
|
|
|
178
|
+
const _accessible = Platform.select({
|
|
179
|
+
ios: accessible !== false,
|
|
180
|
+
default: accessible,
|
|
181
|
+
});
|
|
175
182
|
if (hasTextAncestor) {
|
|
176
183
|
return (
|
|
177
184
|
<NativeVirtualText
|
|
178
185
|
{...restProps}
|
|
179
186
|
{...eventHandlersForText}
|
|
180
187
|
disabled={_disabled}
|
|
181
|
-
accessible={
|
|
188
|
+
accessible={_accessible}
|
|
182
189
|
accessibilityState={_accessibilityState}
|
|
183
190
|
allowFontScaling={allowFontScaling !== false}
|
|
184
191
|
ellipsizeMode={ellipsizeMode ?? 'tail'}
|
|
@@ -83,17 +83,143 @@ export type TextLayoutEvent = SyntheticEvent<
|
|
|
83
83
|
|}>,
|
|
84
84
|
>;
|
|
85
85
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
86
|
+
/**
|
|
87
|
+
* https://developer.mozilla.org/en-US/docs/Web/API/UIEvent
|
|
88
|
+
*/
|
|
89
|
+
export interface NativeUIEvent {
|
|
90
|
+
/**
|
|
91
|
+
* Returns a long with details about the event, depending on the event type.
|
|
92
|
+
*/
|
|
93
|
+
+detail: number;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent
|
|
98
|
+
*/
|
|
99
|
+
export interface NativeMouseEvent extends NativeUIEvent {
|
|
100
|
+
/**
|
|
101
|
+
* The X coordinate of the mouse pointer in global (screen) coordinates.
|
|
102
|
+
*/
|
|
103
|
+
+screenX: number;
|
|
104
|
+
/**
|
|
105
|
+
* The Y coordinate of the mouse pointer in global (screen) coordinates.
|
|
106
|
+
*/
|
|
107
|
+
+screenY: number;
|
|
108
|
+
/**
|
|
109
|
+
* The X coordinate of the mouse pointer relative to the whole document.
|
|
110
|
+
*/
|
|
111
|
+
+pageX: number;
|
|
112
|
+
/**
|
|
113
|
+
* The Y coordinate of the mouse pointer relative to the whole document.
|
|
114
|
+
*/
|
|
115
|
+
+pageY: number;
|
|
116
|
+
/**
|
|
117
|
+
* The X coordinate of the mouse pointer in local (DOM content) coordinates.
|
|
118
|
+
*/
|
|
119
|
+
+clientX: number;
|
|
120
|
+
/**
|
|
121
|
+
* The Y coordinate of the mouse pointer in local (DOM content) coordinates.
|
|
122
|
+
*/
|
|
123
|
+
+clientY: number;
|
|
124
|
+
/**
|
|
125
|
+
* Alias for NativeMouseEvent.clientX
|
|
126
|
+
*/
|
|
127
|
+
+x: number;
|
|
128
|
+
/**
|
|
129
|
+
* Alias for NativeMouseEvent.clientY
|
|
130
|
+
*/
|
|
131
|
+
+y: number;
|
|
132
|
+
/**
|
|
133
|
+
* Returns true if the control key was down when the mouse event was fired.
|
|
134
|
+
*/
|
|
135
|
+
+ctrlKey: boolean;
|
|
136
|
+
/**
|
|
137
|
+
* Returns true if the shift key was down when the mouse event was fired.
|
|
138
|
+
*/
|
|
139
|
+
+shiftKey: boolean;
|
|
140
|
+
/**
|
|
141
|
+
* Returns true if the alt key was down when the mouse event was fired.
|
|
142
|
+
*/
|
|
143
|
+
+altKey: boolean;
|
|
144
|
+
/**
|
|
145
|
+
* Returns true if the meta key was down when the mouse event was fired.
|
|
146
|
+
*/
|
|
147
|
+
+metaKey: boolean;
|
|
148
|
+
/**
|
|
149
|
+
* The button number that was pressed (if applicable) when the mouse event was fired.
|
|
150
|
+
*/
|
|
151
|
+
+button: number;
|
|
152
|
+
/**
|
|
153
|
+
* The buttons being depressed (if any) when the mouse event was fired.
|
|
154
|
+
*/
|
|
155
|
+
+buttons: number;
|
|
156
|
+
/**
|
|
157
|
+
* The secondary target for the event, if there is one.
|
|
158
|
+
*/
|
|
159
|
+
+relatedTarget: null | number | React.ElementRef<HostComponent<mixed>>;
|
|
160
|
+
// offset is proposed: https://drafts.csswg.org/cssom-view/#extensions-to-the-mouseevent-interface
|
|
161
|
+
/**
|
|
162
|
+
* The X coordinate of the mouse pointer between that event and the padding edge of the target node
|
|
163
|
+
*/
|
|
164
|
+
+offsetX: number;
|
|
165
|
+
/**
|
|
166
|
+
* The Y coordinate of the mouse pointer between that event and the padding edge of the target node
|
|
167
|
+
*/
|
|
168
|
+
+offsetY: number;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent
|
|
173
|
+
*/
|
|
174
|
+
export interface NativePointerEvent extends NativeMouseEvent {
|
|
175
|
+
/**
|
|
176
|
+
* A unique identifier for the pointer causing the event.
|
|
177
|
+
*/
|
|
178
|
+
+pointerId: number;
|
|
179
|
+
/**
|
|
180
|
+
* The width (magnitude on the X axis), in CSS pixels, of the contact geometry of the pointer
|
|
181
|
+
*/
|
|
182
|
+
+width: number;
|
|
183
|
+
/**
|
|
184
|
+
* The height (magnitude on the Y axis), in CSS pixels, of the contact geometry of the pointer.
|
|
185
|
+
*/
|
|
186
|
+
+height: number;
|
|
187
|
+
/**
|
|
188
|
+
* The normalized pressure of the pointer input in the range 0 to 1, where 0 and 1 represent
|
|
189
|
+
* the minimum and maximum pressure the hardware is capable of detecting, respectively.
|
|
190
|
+
*/
|
|
191
|
+
+pressure: number;
|
|
192
|
+
/**
|
|
193
|
+
* The normalized tangential pressure of the pointer input (also known as barrel pressure or
|
|
194
|
+
* cylinder stress) in the range -1 to 1, where 0 is the neutral position of the control.
|
|
195
|
+
*/
|
|
196
|
+
+tangentialPressure: number;
|
|
197
|
+
/**
|
|
198
|
+
* The plane angle (in degrees, in the range of -90 to 90) between the Y–Z plane and the plane
|
|
199
|
+
* containing both the pointer (e.g. pen stylus) axis and the Y axis.
|
|
200
|
+
*/
|
|
201
|
+
+tiltX: number;
|
|
202
|
+
/**
|
|
203
|
+
* The plane angle (in degrees, in the range of -90 to 90) between the X–Z plane and the plane
|
|
204
|
+
* containing both the pointer (e.g. pen stylus) axis and the X axis.
|
|
205
|
+
*/
|
|
206
|
+
+tiltY: number;
|
|
207
|
+
/**
|
|
208
|
+
* The clockwise rotation of the pointer (e.g. pen stylus) around its major axis in degrees,
|
|
209
|
+
* with a value in the range 0 to 359.
|
|
210
|
+
*/
|
|
211
|
+
+twist: number;
|
|
212
|
+
/**
|
|
213
|
+
* Indicates the device type that caused the event (mouse, pen, touch, etc.)
|
|
214
|
+
*/
|
|
215
|
+
+pointerType: string;
|
|
216
|
+
/**
|
|
217
|
+
* Indicates if the pointer represents the primary pointer of this pointer type.
|
|
218
|
+
*/
|
|
219
|
+
+isPrimary: boolean;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
export type PointerEvent = SyntheticEvent<NativePointerEvent>;
|
|
97
223
|
|
|
98
224
|
export type PressEvent = ResponderSyntheticEvent<
|
|
99
225
|
$ReadOnly<{|
|
|
@@ -83,28 +83,153 @@ export type TextLayoutEvent = SyntheticEvent<
|
|
|
83
83
|
|}>,
|
|
84
84
|
>;
|
|
85
85
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
86
|
+
/**
|
|
87
|
+
* https://developer.mozilla.org/en-US/docs/Web/API/UIEvent
|
|
88
|
+
*/
|
|
89
|
+
export interface NativeUIEvent {
|
|
90
|
+
/**
|
|
91
|
+
* Returns a long with details about the event, depending on the event type.
|
|
92
|
+
*/
|
|
93
|
+
+detail: number;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent
|
|
98
|
+
*/
|
|
99
|
+
export interface NativeMouseEvent extends NativeUIEvent {
|
|
100
|
+
/**
|
|
101
|
+
* The X coordinate of the mouse pointer in global (screen) coordinates.
|
|
102
|
+
*/
|
|
103
|
+
+screenX: number;
|
|
104
|
+
/**
|
|
105
|
+
* The Y coordinate of the mouse pointer in global (screen) coordinates.
|
|
106
|
+
*/
|
|
107
|
+
+screenY: number;
|
|
108
|
+
/**
|
|
109
|
+
* The X coordinate of the mouse pointer relative to the whole document.
|
|
110
|
+
*/
|
|
111
|
+
+pageX: number;
|
|
112
|
+
/**
|
|
113
|
+
* The Y coordinate of the mouse pointer relative to the whole document.
|
|
114
|
+
*/
|
|
115
|
+
+pageY: number;
|
|
116
|
+
/**
|
|
117
|
+
* The X coordinate of the mouse pointer in local (DOM content) coordinates.
|
|
118
|
+
*/
|
|
119
|
+
+clientX: number;
|
|
120
|
+
/**
|
|
121
|
+
* The Y coordinate of the mouse pointer in local (DOM content) coordinates.
|
|
122
|
+
*/
|
|
123
|
+
+clientY: number;
|
|
124
|
+
/**
|
|
125
|
+
* Alias for NativeMouseEvent.clientX
|
|
126
|
+
*/
|
|
127
|
+
+x: number;
|
|
128
|
+
/**
|
|
129
|
+
* Alias for NativeMouseEvent.clientY
|
|
130
|
+
*/
|
|
131
|
+
+y: number;
|
|
132
|
+
/**
|
|
133
|
+
* Returns true if the control key was down when the mouse event was fired.
|
|
134
|
+
*/
|
|
135
|
+
+ctrlKey: boolean;
|
|
136
|
+
/**
|
|
137
|
+
* Returns true if the shift key was down when the mouse event was fired.
|
|
138
|
+
*/
|
|
139
|
+
+shiftKey: boolean;
|
|
140
|
+
/**
|
|
141
|
+
* Returns true if the alt key was down when the mouse event was fired.
|
|
142
|
+
*/
|
|
143
|
+
+altKey: boolean;
|
|
144
|
+
/**
|
|
145
|
+
* Returns true if the meta key was down when the mouse event was fired.
|
|
146
|
+
*/
|
|
147
|
+
+metaKey: boolean;
|
|
148
|
+
/**
|
|
149
|
+
* The button number that was pressed (if applicable) when the mouse event was fired.
|
|
150
|
+
*/
|
|
151
|
+
+button: number;
|
|
152
|
+
/**
|
|
153
|
+
* The buttons being depressed (if any) when the mouse event was fired.
|
|
154
|
+
*/
|
|
155
|
+
+buttons: number;
|
|
156
|
+
/**
|
|
157
|
+
* The secondary target for the event, if there is one.
|
|
158
|
+
*/
|
|
159
|
+
+relatedTarget: null | number | React.ElementRef<HostComponent<mixed>>;
|
|
160
|
+
// offset is proposed: https://drafts.csswg.org/cssom-view/#extensions-to-the-mouseevent-interface
|
|
161
|
+
/**
|
|
162
|
+
* The X coordinate of the mouse pointer between that event and the padding edge of the target node
|
|
163
|
+
*/
|
|
164
|
+
+offsetX: number;
|
|
165
|
+
/**
|
|
166
|
+
* The Y coordinate of the mouse pointer between that event and the padding edge of the target node
|
|
167
|
+
*/
|
|
168
|
+
+offsetY: number;
|
|
169
|
+
|
|
170
|
+
// [Windows
|
|
171
|
+
+isLeftButton: boolean;
|
|
172
|
+
+isRightButton: boolean;
|
|
173
|
+
+isMiddleButton: boolean;
|
|
174
|
+
+isBarrelButtonPressed: boolean;
|
|
175
|
+
+isHorizontalScrollWheel: boolean;
|
|
176
|
+
+isEraser: boolean;
|
|
177
|
+
+target: ?number;
|
|
178
|
+
// Windows]
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent
|
|
183
|
+
*/
|
|
184
|
+
export interface NativePointerEvent extends NativeMouseEvent {
|
|
185
|
+
/**
|
|
186
|
+
* A unique identifier for the pointer causing the event.
|
|
187
|
+
*/
|
|
188
|
+
+pointerId: number;
|
|
189
|
+
/**
|
|
190
|
+
* The width (magnitude on the X axis), in CSS pixels, of the contact geometry of the pointer
|
|
191
|
+
*/
|
|
192
|
+
+width: number;
|
|
193
|
+
/**
|
|
194
|
+
* The height (magnitude on the Y axis), in CSS pixels, of the contact geometry of the pointer.
|
|
195
|
+
*/
|
|
196
|
+
+height: number;
|
|
197
|
+
/**
|
|
198
|
+
* The normalized pressure of the pointer input in the range 0 to 1, where 0 and 1 represent
|
|
199
|
+
* the minimum and maximum pressure the hardware is capable of detecting, respectively.
|
|
200
|
+
*/
|
|
201
|
+
+pressure: number;
|
|
202
|
+
/**
|
|
203
|
+
* The normalized tangential pressure of the pointer input (also known as barrel pressure or
|
|
204
|
+
* cylinder stress) in the range -1 to 1, where 0 is the neutral position of the control.
|
|
205
|
+
*/
|
|
206
|
+
+tangentialPressure: number;
|
|
207
|
+
/**
|
|
208
|
+
* The plane angle (in degrees, in the range of -90 to 90) between the Y–Z plane and the plane
|
|
209
|
+
* containing both the pointer (e.g. pen stylus) axis and the Y axis.
|
|
210
|
+
*/
|
|
211
|
+
+tiltX: number;
|
|
212
|
+
/**
|
|
213
|
+
* The plane angle (in degrees, in the range of -90 to 90) between the X–Z plane and the plane
|
|
214
|
+
* containing both the pointer (e.g. pen stylus) axis and the X axis.
|
|
215
|
+
*/
|
|
216
|
+
+tiltY: number;
|
|
217
|
+
/**
|
|
218
|
+
* The clockwise rotation of the pointer (e.g. pen stylus) around its major axis in degrees,
|
|
219
|
+
* with a value in the range 0 to 359.
|
|
220
|
+
*/
|
|
221
|
+
+twist: number;
|
|
222
|
+
/**
|
|
223
|
+
* Indicates the device type that caused the event (mouse, pen, touch, etc.)
|
|
224
|
+
*/
|
|
225
|
+
+pointerType: string;
|
|
226
|
+
/**
|
|
227
|
+
* Indicates if the pointer represents the primary pointer of this pointer type.
|
|
228
|
+
*/
|
|
229
|
+
+isPrimary: boolean;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
export type PointerEvent = SyntheticEvent<NativePointerEvent>;
|
|
108
233
|
|
|
109
234
|
export type PressEvent = ResponderSyntheticEvent<
|
|
110
235
|
$ReadOnly<{|
|
|
@@ -108,19 +108,6 @@ class Dimensions {
|
|
|
108
108
|
);
|
|
109
109
|
return eventEmitter.addListener(type, handler);
|
|
110
110
|
}
|
|
111
|
-
|
|
112
|
-
/**
|
|
113
|
-
* @deprecated Use `remove` on the EventSubscription from `addEventListener`.
|
|
114
|
-
*/
|
|
115
|
-
static removeEventListener(type: 'change', handler: Function) {
|
|
116
|
-
invariant(
|
|
117
|
-
type === 'change',
|
|
118
|
-
'Trying to remove listener for unknown event: "%s"',
|
|
119
|
-
type,
|
|
120
|
-
);
|
|
121
|
-
// NOTE: This will report a deprecation notice via `console.error`.
|
|
122
|
-
eventEmitter.removeListener(type, handler);
|
|
123
|
-
}
|
|
124
111
|
}
|
|
125
112
|
|
|
126
113
|
let initialDims: ?$ReadOnly<DimensionsPayload> =
|
|
@@ -256,7 +256,7 @@ Error: ${e.message}`;
|
|
|
256
256
|
},
|
|
257
257
|
};
|
|
258
258
|
|
|
259
|
-
function setHMRUnavailableReason(reason) {
|
|
259
|
+
function setHMRUnavailableReason(reason: string) {
|
|
260
260
|
invariant(hmrClient, 'Expected HMRClient.setup() call at startup.');
|
|
261
261
|
if (hmrUnavailableReason !== null) {
|
|
262
262
|
// Don't show more than one warning.
|
|
@@ -273,7 +273,7 @@ function setHMRUnavailableReason(reason) {
|
|
|
273
273
|
}
|
|
274
274
|
}
|
|
275
275
|
|
|
276
|
-
function registerBundleEntryPoints(client) {
|
|
276
|
+
function registerBundleEntryPoints(client: MetroHMRClient) {
|
|
277
277
|
if (hmrUnavailableReason != null) {
|
|
278
278
|
DevSettings.reload('Bundle Splitting – Metro disconnected');
|
|
279
279
|
return;
|
|
@@ -290,7 +290,7 @@ function registerBundleEntryPoints(client) {
|
|
|
290
290
|
}
|
|
291
291
|
}
|
|
292
292
|
|
|
293
|
-
function flushEarlyLogs(client) {
|
|
293
|
+
function flushEarlyLogs(client: MetroHMRClient) {
|
|
294
294
|
try {
|
|
295
295
|
pendingLogs.forEach(([level, data]) => {
|
|
296
296
|
HMRClient.log(level, data);
|
|
@@ -47,13 +47,6 @@ const Platform = {
|
|
|
47
47
|
get isPad(): boolean {
|
|
48
48
|
return this.constants.interfaceIdiom === 'pad';
|
|
49
49
|
},
|
|
50
|
-
/**
|
|
51
|
-
* Deprecated, use `isTV` instead.
|
|
52
|
-
*/
|
|
53
|
-
// $FlowFixMe[unsafe-getters-setters]
|
|
54
|
-
get isTVOS(): boolean {
|
|
55
|
-
return Platform.isTV;
|
|
56
|
-
},
|
|
57
50
|
// $FlowFixMe[unsafe-getters-setters]
|
|
58
51
|
get isTV(): boolean {
|
|
59
52
|
return this.constants.interfaceIdiom === 'tv';
|
|
@@ -180,7 +180,9 @@ function renderAndEnforceStrictMode(element: React.Node): any {
|
|
|
180
180
|
}
|
|
181
181
|
|
|
182
182
|
function renderWithStrictMode(element: React.Node): ReactTestRendererType {
|
|
183
|
-
const WorkAroundBugWithStrictModeInTestRenderer = prps
|
|
183
|
+
const WorkAroundBugWithStrictModeInTestRenderer = (prps: {
|
|
184
|
+
children: React.Node,
|
|
185
|
+
}) => prps.children;
|
|
184
186
|
const StrictMode = (React: $FlowFixMe).StrictMode;
|
|
185
187
|
return ReactTestRenderer.create(
|
|
186
188
|
<WorkAroundBugWithStrictModeInTestRenderer>
|