@office-iss/react-native-win32 0.72.7 → 0.73.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 +15 -4
- package/CHANGELOG.json +523 -94
- package/CHANGELOG.md +209 -52
- package/IntegrationTests/PromiseTest.js +1 -0
- package/IntegrationTests/websocket_integration_test_server.js +1 -1
- package/Libraries/Animated/Animated.js +1 -1
- package/Libraries/Animated/AnimatedImplementation.js +1 -1
- package/Libraries/Animated/NativeAnimatedHelper.js +14 -10
- package/Libraries/Animated/NativeAnimatedHelper.win32.js +16 -12
- package/Libraries/Animated/NativeAnimatedModule.js +6 -2
- package/Libraries/Animated/NativeAnimatedTurboModule.js +7 -4
- package/Libraries/Animated/animations/Animation.js +57 -3
- package/Libraries/Animated/animations/DecayAnimation.js +9 -0
- package/Libraries/Animated/animations/SpringAnimation.js +8 -0
- package/Libraries/Animated/animations/TimingAnimation.js +8 -0
- package/Libraries/Animated/components/AnimatedFlatList.js +2 -1
- package/Libraries/Animated/components/AnimatedScrollView.js +2 -0
- package/Libraries/Animated/components/AnimatedSectionList.js +2 -1
- package/Libraries/Animated/createAnimatedComponent.js +1 -0
- package/Libraries/Animated/nodes/AnimatedColor.js +1 -1
- package/Libraries/Animated/nodes/AnimatedObject.js +146 -0
- package/Libraries/Animated/nodes/AnimatedProps.js +19 -7
- package/Libraries/Animated/nodes/AnimatedStyle.js +29 -55
- package/Libraries/Animated/nodes/AnimatedValueXY.js +3 -17
- package/Libraries/Animated/shouldUseTurboAnimatedModule.js +17 -0
- package/Libraries/Animated/useAnimatedProps.js +9 -10
- package/Libraries/AppState/AppState.d.ts +1 -1
- package/Libraries/AppState/NativeAppState.js +8 -4
- package/Libraries/BatchedBridge/MessageQueue.js +45 -36
- package/Libraries/Blob/Blob.js +6 -2
- package/Libraries/Blob/BlobManager.js +9 -10
- package/Libraries/Blob/BlobRegistry.js +14 -9
- package/Libraries/Blob/File.js +1 -1
- package/Libraries/Blob/FileReader.js +1 -2
- package/Libraries/Components/Button/ButtonWin32.Props.d.ts +1 -1
- package/Libraries/Components/Button/ButtonWin32.Props.js.map +1 -1
- package/Libraries/Components/Button/ButtonWin32.d.ts +1 -1
- package/Libraries/Components/Button/ButtonWin32.js +1 -4
- package/Libraries/Components/Button/ButtonWin32.js.map +1 -1
- package/Libraries/Components/Clipboard/Clipboard.d.ts +4 -4
- package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js +3 -1
- package/Libraries/Components/EnterString.win32.d.ts +1 -1
- package/Libraries/Components/Keyboard/KeyboardAvoidingView.js +26 -6
- package/Libraries/Components/Pressable/Pressable.js +3 -2
- package/Libraries/Components/Pressable/Pressable.win32.js +4 -3
- package/Libraries/Components/Pressable/useAndroidRippleForView.js +1 -1
- package/Libraries/Components/SafeAreaView/SafeAreaView.js +7 -7
- package/Libraries/Components/SafeAreaView/SafeAreaView.win32.js +7 -8
- package/Libraries/Components/ScrollView/ScrollView.js +3 -1
- package/Libraries/Components/ScrollView/ScrollView.win32.js +3 -1
- package/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +39 -46
- package/Libraries/Components/Switch/Switch.js +1 -0
- package/Libraries/Components/Text/TextWin32.d.ts +1 -1
- package/Libraries/Components/TextInput/RCTTextInputViewConfig.js +1 -0
- package/Libraries/Components/TextInput/TextInput.d.ts +49 -7
- package/Libraries/Components/TextInput/TextInput.flow.js +43 -10
- package/Libraries/Components/TextInput/TextInput.js +62 -10
- package/Libraries/Components/TextInput/TextInput.win32.js +953 -206
- package/Libraries/Components/TextInput/Win32TextInputNativeComponent.js +23 -0
- package/Libraries/Components/ToastAndroid/{ToastAndroid.ios.js → ToastAndroid.js} +9 -1
- package/Libraries/Components/ToastAndroid/ToastAndroid.win32.js +9 -1
- package/Libraries/Components/Touchable/Tests/TouchableWin32Test.js +2 -2
- package/Libraries/Components/Touchable/Tests/TouchableWin32Test.js.map +1 -1
- package/Libraries/Components/Touchable/TouchableBounce.js +1 -1
- package/Libraries/Components/Touchable/TouchableHighlight.js +1 -1
- package/Libraries/Components/Touchable/TouchableNativeFeedback.js +1 -1
- package/Libraries/Components/Touchable/TouchableOpacity.js +4 -1
- package/Libraries/Components/Touchable/TouchableWin32.d.ts +1 -1
- package/Libraries/Components/Touchable/TouchableWin32.js.map +1 -1
- package/Libraries/Components/Touchable/TouchableWithoutFeedback.js +1 -0
- package/Libraries/Components/TraceUpdateOverlay/TraceUpdateOverlay.js +16 -6
- package/Libraries/Components/View/ReactNativeStyleAttributes.js +9 -0
- package/Libraries/Components/View/ReactNativeViewAttributes.js +1 -0
- package/Libraries/Components/View/ReactNativeViewAttributes.win32.js +1 -0
- package/Libraries/Components/View/View.js +46 -32
- package/Libraries/Components/View/View.win32.js +37 -6
- package/Libraries/Components/View/ViewAccessibility.d.ts +8 -2
- package/Libraries/Components/View/ViewNativeComponent.js +1 -0
- package/Libraries/Components/View/ViewPropTypes.js +18 -3
- package/Libraries/Components/View/ViewPropTypes.win32.js +30 -4
- package/Libraries/Components/View/ViewWin32.js +3 -2
- package/Libraries/Core/Devtools/loadBundleFromServer.js +152 -0
- package/Libraries/Core/Devtools/symbolicateStackTrace.js +2 -1
- package/Libraries/Core/ExceptionsManager.js +16 -7
- package/Libraries/Core/ExtendedError.js +12 -0
- package/Libraries/Core/ReactNativeVersion.js +3 -3
- package/Libraries/Core/ReactNativeVersionCheck.js +0 -2
- package/Libraries/Core/ReactNativeVersionCheck.win32.js +0 -2
- package/Libraries/Core/__mocks__/NativeExceptionsManager.js +20 -0
- package/Libraries/Core/setUpDeveloperTools.js +5 -1
- package/Libraries/Core/setUpIntersectionObserver.js +16 -0
- package/Libraries/{Components/ProgressBarAndroid/ProgressBarAndroid.ios.js → Core/setUpMutationObserver.js} +6 -2
- package/Libraries/Core/setUpPerformance.js +6 -13
- package/Libraries/Core/setUpPerformanceObserver.js +16 -0
- package/Libraries/Core/setUpRegeneratorRuntime.js +4 -2
- package/Libraries/DOM/Nodes/ReactNativeElement.js +135 -18
- package/Libraries/DOM/Nodes/ReadOnlyCharacterData.js +72 -0
- package/Libraries/DOM/Nodes/ReadOnlyElement.js +209 -21
- package/Libraries/DOM/Nodes/ReadOnlyNode.js +206 -17
- package/Libraries/DOM/Nodes/ReadOnlyText.js +30 -0
- package/Libraries/DOM/Nodes/Utilities/Traversal.js +54 -0
- package/Libraries/EventEmitter/NativeEventEmitter.d.ts +0 -6
- package/Libraries/EventEmitter/RCTDeviceEventEmitter.js +15 -4
- package/Libraries/Image/Image.android.js +8 -2
- package/Libraries/Image/Image.d.ts +1 -1
- package/Libraries/Image/Image.ios.js +4 -1
- package/Libraries/Image/Image.win32.js +6 -3
- package/Libraries/Image/ImageBackground.js +3 -0
- package/Libraries/Image/resolveAssetSource.win32.js +1 -1
- package/Libraries/Inspector/DevtoolsOverlay.js +6 -3
- package/Libraries/Inspector/NetworkOverlay.js +2 -2
- package/Libraries/Interaction/JSEventLoopWatchdog.js +1 -5
- package/Libraries/Interaction/PanResponder.js +1 -4
- package/Libraries/IntersectionObserver/IntersectionObserver.js +252 -0
- package/Libraries/IntersectionObserver/IntersectionObserverEntry.js +140 -0
- package/Libraries/IntersectionObserver/IntersectionObserverManager.js +221 -0
- package/Libraries/IntersectionObserver/NativeIntersectionObserver.js +41 -0
- package/Libraries/IntersectionObserver/__mocks__/NativeIntersectionObserver.js +162 -0
- package/Libraries/LayoutAnimation/LayoutAnimation.js +1 -1
- package/Libraries/Lists/FlatList.d.ts +2 -1
- package/Libraries/Lists/FlatList.js +15 -5
- package/Libraries/Lists/SectionList.js +4 -0
- package/Libraries/LogBox/Data/LogBoxLog.js +4 -1
- package/Libraries/LogBox/Data/LogBoxSymbolication.js +5 -2
- package/Libraries/LogBox/Data/parseLogBoxLog.js +57 -20
- package/Libraries/LogBox/UI/AnsiHighlight.js +1 -1
- package/Libraries/LogBox/UI/LogBoxInspectorFooter.js +24 -31
- package/Libraries/LogBox/UI/LogBoxInspectorHeader.js +1 -1
- package/Libraries/LogBox/UI/LogBoxMessage.js +4 -7
- package/Libraries/MutationObserver/MutationObserver.js +184 -0
- package/Libraries/MutationObserver/MutationObserverManager.js +218 -0
- package/Libraries/MutationObserver/MutationRecord.js +82 -0
- package/Libraries/MutationObserver/NativeMutationObserver.js +58 -0
- package/Libraries/MutationObserver/__mocks__/NativeMutationObserver.js +327 -0
- package/Libraries/NativeComponent/BaseViewConfig.android.js +18 -3
- package/Libraries/NativeComponent/BaseViewConfig.ios.js +33 -0
- package/Libraries/NativeComponent/BaseViewConfig.win32.js +33 -0
- package/Libraries/NativeComponent/NativeComponentRegistry.js +3 -5
- package/Libraries/NativeModules/specs/NativeSourceCode.js +6 -6
- package/Libraries/Network/RCTNetworking.android.js +2 -1
- package/Libraries/Network/XMLHttpRequest.js +1 -1
- package/Libraries/NewAppScreen/components/DebugInstructions.js +4 -4
- package/Libraries/NewAppScreen/components/LearnMoreLinks.js +9 -2
- package/Libraries/Performance/QuickPerformanceLogger.js +1 -1
- package/Libraries/PermissionsAndroid/NativePermissionsAndroid.js +1 -0
- package/Libraries/PermissionsAndroid/PermissionsAndroid.d.ts +1 -0
- package/Libraries/PermissionsAndroid/PermissionsAndroid.js +3 -1
- package/Libraries/Pressability/Pressability.js +28 -3
- package/Libraries/Pressability/Pressability.win32.js +30 -5
- package/Libraries/ReactNative/AppContainer.js +2 -3
- package/Libraries/ReactNative/AppRegistry.d.ts +0 -5
- package/Libraries/ReactNative/AppRegistry.js +66 -53
- package/Libraries/ReactNative/BridgelessUIManager.js +38 -9
- package/Libraries/ReactNative/FabricUIManager.js +143 -34
- package/Libraries/ReactNative/I18nManager.js +5 -11
- package/Libraries/ReactNative/NativeI18nManager.js +7 -5
- package/Libraries/ReactNative/PaperUIManager.win32.js +2 -2
- package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricHostComponent.js +151 -0
- package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstance.js +81 -0
- package/Libraries/ReactNative/ReactFabricPublicInstance/ReactNativeAttributePayload.js +492 -0
- package/Libraries/ReactNative/ReactFabricPublicInstance/warnForStyleProps.js +32 -0
- package/Libraries/ReactNative/ReactNativeFeatureFlags.js +19 -3
- package/Libraries/ReactNative/UIManager.js +8 -0
- package/Libraries/ReactNative/__mocks__/FabricUIManager.js +648 -0
- package/Libraries/ReactPrivate/ReactNativePrivateInterface.js +38 -2
- package/Libraries/Renderer/implementations/ReactFabric-dev.js +27 -27
- package/Libraries/Renderer/implementations/ReactFabric-prod.js +3 -3
- package/Libraries/Renderer/implementations/ReactFabric-profiling.js +3 -3
- package/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js +27 -27
- package/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js +3 -3
- package/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.js +3 -3
- package/Libraries/Renderer/shims/ReactFabric.js +5 -6
- package/Libraries/Renderer/shims/ReactFeatureFlags.js +2 -3
- package/Libraries/Renderer/shims/ReactNative.js +2 -3
- package/Libraries/Renderer/shims/ReactNativeTypes.js +35 -17
- package/Libraries/Renderer/shims/ReactNativeViewConfigRegistry.js +3 -3
- package/Libraries/Renderer/shims/createReactNativeComponentClass.js +2 -3
- package/Libraries/Settings/{Settings.android.js → Settings.js} +4 -4
- package/Libraries/Share/Share.d.ts +3 -9
- package/Libraries/StyleSheet/PlatformColorValueTypes.android.js +9 -4
- package/Libraries/StyleSheet/PlatformColorValueTypes.ios.js +28 -13
- package/Libraries/StyleSheet/PlatformColorValueTypes.win32.js +14 -4
- package/Libraries/StyleSheet/PlatformColorValueTypesIOS.ios.js +1 -1
- package/Libraries/StyleSheet/PlatformColorValueTypesWin32.d.ts +1 -1
- package/Libraries/StyleSheet/StyleSheet.d.ts +10 -1
- package/Libraries/StyleSheet/StyleSheet.js +3 -0
- package/Libraries/StyleSheet/StyleSheet.win32.js +3 -0
- package/Libraries/StyleSheet/StyleSheetTypes.d.ts +31 -17
- package/Libraries/StyleSheet/StyleSheetTypes.js +90 -6
- package/Libraries/StyleSheet/flattenStyle.js +4 -0
- package/Libraries/StyleSheet/private/_TransformStyle.js +16 -2
- package/Libraries/StyleSheet/processColor.js +1 -2
- package/Libraries/StyleSheet/processTransformOrigin.js +136 -0
- package/Libraries/StyleSheet/splitLayoutProps.js +1 -0
- package/Libraries/Text/Text.d.ts +5 -5
- package/Libraries/Text/Text.js +17 -10
- package/Libraries/Text/Text.win32.js +354 -0
- package/Libraries/Text/TextProps.win32.js +281 -0
- package/Libraries/TurboModule/TurboModuleRegistry.js +47 -7
- package/Libraries/TurboModule/samples/NativeSampleTurboModule.js +6 -0
- package/Libraries/Types/CoreEventTypes.d.ts +5 -2
- package/Libraries/Utilities/GlobalPerformanceLogger.js +2 -12
- package/Libraries/Utilities/NativeDeviceInfo.js +8 -9
- package/Libraries/Utilities/NativePlatformConstantsAndroid.js +23 -18
- package/Libraries/Utilities/NativePlatformConstantsIOS.js +16 -13
- package/Libraries/Utilities/NativePlatformConstantsWin.js +13 -10
- package/Libraries/Utilities/PerformanceLoggerContext.js +1 -1
- package/Libraries/Utilities/Platform.android.js +12 -8
- package/Libraries/Utilities/Platform.d.ts +1 -0
- package/Libraries/Utilities/Platform.flow.js +84 -0
- package/Libraries/Utilities/Platform.flow.win32.js +111 -0
- package/Libraries/Utilities/Platform.ios.js +12 -8
- package/Libraries/Utilities/Platform.win32.js +12 -8
- package/Libraries/Utilities/PolyfillFunctions.js +1 -1
- package/Libraries/Utilities/ReactNativeTestTools.js +1 -2
- package/Libraries/Utilities/SceneTracker.js +1 -1
- package/Libraries/Utilities/createPerformanceLogger.js +63 -32
- package/Libraries/Utilities/useColorScheme.js +7 -8
- package/Libraries/WebPerformance/MemoryInfo.js +1 -1
- package/Libraries/WebPerformance/NativePerformance.js +3 -8
- package/Libraries/WebPerformance/NativePerformanceObserver.js +4 -0
- package/Libraries/WebPerformance/Performance.js +42 -15
- package/Libraries/WebPerformance/PerformanceEntry.js +14 -6
- package/Libraries/WebPerformance/PerformanceEventTiming.js +18 -1
- package/Libraries/WebPerformance/ReactNativeStartupTiming.js +40 -14
- package/Libraries/WebPerformance/__mocks__/NativePerformance.js +4 -2
- package/Libraries/WebPerformance/__mocks__/NativePerformanceObserver.js +21 -3
- package/Libraries/promiseRejectionTrackingOptions.js +1 -3
- package/Libraries/vendor/emitter/EventEmitter.js +17 -17
- package/flow/global.js +1 -3
- package/flow/jest.js +5 -1
- package/{Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.ios.js → jest/ReactNativeInternalFeatureFlagsMock.js} +2 -1
- package/jest/__tests__/setup-test.js +18 -0
- package/jest/mockModal.js +6 -4
- package/jest/setup.js +61 -30
- package/jest.config.js +1 -1
- package/just-task.js +1 -0
- package/overrides.json +51 -46
- package/package.json +35 -33
- package/src/Libraries/Components/Button/ButtonWin32.Props.ts +1 -1
- package/src/Libraries/Components/Button/ButtonWin32.tsx +0 -2
- package/src/Libraries/Components/Touchable/Tests/TouchableWin32Test.tsx +2 -2
- package/src/Libraries/Components/Touchable/TouchableWin32.tsx +1 -1
- package/src/Libraries/Components/View/ViewAccessibility.d.ts +8 -2
- package/src/Libraries/StyleSheet/PlatformColorValueTypesWin32.d.ts +1 -1
- package/types/experimental.d.ts +44 -0
- package/types/index.d.ts +2 -1
- package/types/modules/Devtools.d.ts +1 -0
- package/types/modules/globals.d.ts +16 -1
- package/IntegrationTests/BUCK +0 -32
- package/IntegrationTests/PropertiesUpdateTest.js +0 -29
- package/IntegrationTests/RCTRootViewIntegrationTestApp.js +0 -86
- package/IntegrationTests/ReactContentSizeUpdateTest.js +0 -89
- package/IntegrationTests/SizeFlexibilityUpdateTest.js +0 -106
- package/Libraries/Components/TextInput/TextInput.Types.win32.d.ts +0 -51
- package/Libraries/Components/TextInput/TextInput.Types.win32.js +0 -3
- package/Libraries/Components/TextInput/TextInput.Types.win32.js.map +0 -1
- package/Libraries/Utilities/AcessibilityMapping.js +0 -154
- package/Libraries/Utilities/AcessibilityMapping.win32.js +0 -156
- package/Libraries/Utilities/NativeDevSplitBundleLoader.js +0 -19
- package/Libraries/Utilities/useColorScheme.win32.js +0 -26
- package/flow/use-sync-external-store.js +0 -20
- package/flow-typed/npm/base64-js_v1.x.x.js +0 -12
- package/flow-typed/npm/glob_v7.x.x.js +0 -79
- package/flow-typed/npm/pretty-format_v26.x.x.js +0 -49
- package/flow-typed/npm/promise_v8.x.x.js +0 -30
- package/flow-typed/npm/react-dom_v17.x.x.js +0 -139
- package/flow-typed/npm/react-test-renderer_v16.x.x.js +0 -79
- package/flow-typed/npm/stacktrace-parser_v0.1.x.js +0 -17
- package/flow-typed/npm/yargs_v17.x.x.js +0 -341
- package/src/Libraries/Components/TextInput/TextInput.Types.win32.ts +0 -68
- /package/Libraries/{Renderer/public → ReactNative/ReactFabricPublicInstance}/ReactFabricPublicInstanceUtils.js +0 -0
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
* @flow strict-local
|
|
8
|
+
* @format
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
'use strict';
|
|
12
|
+
|
|
13
|
+
import type {
|
|
14
|
+
AccessibilityActionEvent,
|
|
15
|
+
AccessibilityActionInfo,
|
|
16
|
+
AccessibilityRole,
|
|
17
|
+
AccessibilityState,
|
|
18
|
+
Role,
|
|
19
|
+
} from '../Components/View/ViewAccessibility';
|
|
20
|
+
import type {TextStyleProp} from '../StyleSheet/StyleSheet';
|
|
21
|
+
import type {
|
|
22
|
+
LayoutEvent,
|
|
23
|
+
PointerEvent,
|
|
24
|
+
PressEvent,
|
|
25
|
+
TextLayoutEvent,
|
|
26
|
+
} from '../Types/CoreEventTypes';
|
|
27
|
+
import type {Node} from 'react';
|
|
28
|
+
|
|
29
|
+
export type PressRetentionOffset = $ReadOnly<{|
|
|
30
|
+
top: number,
|
|
31
|
+
left: number,
|
|
32
|
+
bottom: number,
|
|
33
|
+
right: number,
|
|
34
|
+
|}>;
|
|
35
|
+
|
|
36
|
+
type PointerEventProps = $ReadOnly<{|
|
|
37
|
+
onPointerEnter?: (event: PointerEvent) => void,
|
|
38
|
+
onPointerLeave?: (event: PointerEvent) => void,
|
|
39
|
+
onPointerMove?: (event: PointerEvent) => void,
|
|
40
|
+
|}>;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* @see https://reactnative.dev/docs/text#reference
|
|
44
|
+
*/
|
|
45
|
+
export type TextProps = $ReadOnly<{|
|
|
46
|
+
...PointerEventProps,
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Indicates whether the view is an accessibility element.
|
|
50
|
+
*
|
|
51
|
+
* See https://reactnative.dev/docs/text#accessible
|
|
52
|
+
*/
|
|
53
|
+
accessible?: ?boolean,
|
|
54
|
+
accessibilityActions?: ?$ReadOnlyArray<AccessibilityActionInfo>,
|
|
55
|
+
onAccessibilityAction?: ?(event: AccessibilityActionEvent) => mixed,
|
|
56
|
+
accessibilityHint?: ?Stringish,
|
|
57
|
+
accessibilityLanguage?: ?Stringish,
|
|
58
|
+
accessibilityLabel?: ?Stringish,
|
|
59
|
+
accessibilityRole?: ?AccessibilityRole,
|
|
60
|
+
accessibilityState?: ?AccessibilityState,
|
|
61
|
+
'aria-label'?: ?string,
|
|
62
|
+
accessibilityControls?: ?Stringish, // Win32
|
|
63
|
+
accessibilityDescribedBy?: ?Stringish, // Win32
|
|
64
|
+
accessibilityDescription?: ?Stringish, // Win32
|
|
65
|
+
accessibilityLevel?: ?number, // Win32
|
|
66
|
+
accessibilityPositionInSet?: ?number, // Win32
|
|
67
|
+
accessibilitySetSize?: ?number, // Win32
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Whether font should be scaled down automatically.
|
|
71
|
+
*
|
|
72
|
+
* See https://reactnative.dev/docs/text#adjustsfontsizetofit
|
|
73
|
+
*/
|
|
74
|
+
adjustsFontSizeToFit?: ?boolean,
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Whether fonts should scale to respect Text Size accessibility settings.
|
|
78
|
+
*
|
|
79
|
+
* See https://reactnative.dev/docs/text#allowfontscaling
|
|
80
|
+
*/
|
|
81
|
+
allowFontScaling?: ?boolean,
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Set hyphenation strategy on Android.
|
|
85
|
+
*
|
|
86
|
+
*/
|
|
87
|
+
android_hyphenationFrequency?: ?('normal' | 'none' | 'full'),
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* alias for accessibilityState
|
|
91
|
+
*
|
|
92
|
+
* see https://reactnative.dev/docs/accessibility#accessibilitystate
|
|
93
|
+
*/
|
|
94
|
+
'aria-busy'?: ?boolean,
|
|
95
|
+
'aria-checked'?: ?boolean | 'mixed',
|
|
96
|
+
'aria-disabled'?: ?boolean,
|
|
97
|
+
'aria-expanded'?: ?boolean,
|
|
98
|
+
'aria-selected'?: ?boolean,
|
|
99
|
+
'aria-multiselectable'?: ?boolean, // Win32
|
|
100
|
+
'aria-required'?: ?boolean, // Win32
|
|
101
|
+
'aria-controls'?: ?Stringish, // Win32
|
|
102
|
+
'aria-describedby'?: ?Stringish, // Win32
|
|
103
|
+
'aria-description'?: ?Stringish, // Win32
|
|
104
|
+
'aria-level'?: ?number, // Win32
|
|
105
|
+
'aria-posinset'?: ?number, // Win32
|
|
106
|
+
'aria-setsize'?: ?number, // Win32
|
|
107
|
+
/**
|
|
108
|
+
* Represents the nativeID of the associated label text. When the assistive technology focuses on the component with this props, the text is read aloud.
|
|
109
|
+
* This prop is listed for cross-platform reasons and has no real effect on Android or iOS.
|
|
110
|
+
*/
|
|
111
|
+
'aria-labelledby'?: ?string,
|
|
112
|
+
|
|
113
|
+
children?: ?Node,
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* When `numberOfLines` is set, this prop defines how text will be
|
|
117
|
+
* truncated.
|
|
118
|
+
*
|
|
119
|
+
* See https://reactnative.dev/docs/text#ellipsizemode
|
|
120
|
+
*/
|
|
121
|
+
ellipsizeMode?: ?('clip' | 'head' | 'middle' | 'tail'),
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Used to locate this view from native code.
|
|
125
|
+
*
|
|
126
|
+
* See https://reactnative.dev/docs/text#nativeid
|
|
127
|
+
*/
|
|
128
|
+
id?: string,
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Specifies largest possible scale a font can reach when `allowFontScaling` is enabled.
|
|
132
|
+
* Possible values:
|
|
133
|
+
* `null/undefined` (default): inherit from the parent node or the global default (0)
|
|
134
|
+
* `0`: no max, ignore parent/global default
|
|
135
|
+
* `>= 1`: sets the maxFontSizeMultiplier of this node to this value
|
|
136
|
+
*/
|
|
137
|
+
maxFontSizeMultiplier?: ?number,
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Used to locate this view from native code.
|
|
141
|
+
*
|
|
142
|
+
* See https://reactnative.dev/docs/text#nativeid
|
|
143
|
+
*/
|
|
144
|
+
nativeID?: ?string,
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Used to truncate the text with an ellipsis.
|
|
148
|
+
*
|
|
149
|
+
* See https://reactnative.dev/docs/text#numberoflines
|
|
150
|
+
*/
|
|
151
|
+
numberOfLines?: ?number,
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* Invoked on mount and layout changes.
|
|
155
|
+
*
|
|
156
|
+
* See https://reactnative.dev/docs/text#onlayout
|
|
157
|
+
*/
|
|
158
|
+
onLayout?: ?(event: LayoutEvent) => mixed,
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* This function is called on long press.
|
|
162
|
+
*
|
|
163
|
+
* See https://reactnative.dev/docs/text#onlongpress
|
|
164
|
+
*/
|
|
165
|
+
onLongPress?: ?(event: PressEvent) => mixed,
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* This function is called on press.
|
|
169
|
+
*
|
|
170
|
+
* See https://reactnative.dev/docs/text#onpress
|
|
171
|
+
*/
|
|
172
|
+
onPress?: ?(event: PressEvent) => mixed,
|
|
173
|
+
onPressIn?: ?(event: PressEvent) => mixed,
|
|
174
|
+
onPressOut?: ?(event: PressEvent) => mixed,
|
|
175
|
+
onResponderGrant?: ?(event: PressEvent) => void,
|
|
176
|
+
onResponderMove?: ?(event: PressEvent) => void,
|
|
177
|
+
onResponderRelease?: ?(event: PressEvent) => void,
|
|
178
|
+
onResponderTerminate?: ?(event: PressEvent) => void,
|
|
179
|
+
onResponderTerminationRequest?: ?() => boolean,
|
|
180
|
+
onStartShouldSetResponder?: ?() => boolean,
|
|
181
|
+
onMoveShouldSetResponder?: ?() => boolean,
|
|
182
|
+
onTextLayout?: ?(event: TextLayoutEvent) => mixed,
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* Defines how far your touch may move off of the button, before
|
|
186
|
+
* deactivating the button.
|
|
187
|
+
*
|
|
188
|
+
* See https://reactnative.dev/docs/text#pressretentionoffset
|
|
189
|
+
*/
|
|
190
|
+
pressRetentionOffset?: ?PressRetentionOffset,
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* Indicates to accessibility services to treat UI component like a specific role.
|
|
194
|
+
*/
|
|
195
|
+
role?: ?Role,
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* Lets the user select text.
|
|
199
|
+
*
|
|
200
|
+
* See https://reactnative.dev/docs/text#selectable
|
|
201
|
+
*/
|
|
202
|
+
selectable?: ?boolean,
|
|
203
|
+
style?: ?TextStyleProp,
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
* Used to locate this view in end-to-end tests.
|
|
207
|
+
*
|
|
208
|
+
* See https://reactnative.dev/docs/text#testid
|
|
209
|
+
*/
|
|
210
|
+
testID?: ?string,
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* Android Only
|
|
214
|
+
*/
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* Specifies the disabled state of the text view for testing purposes.
|
|
218
|
+
*
|
|
219
|
+
* See https://reactnative.dev/docs/text#disabled
|
|
220
|
+
*/
|
|
221
|
+
disabled?: ?boolean,
|
|
222
|
+
|
|
223
|
+
/**
|
|
224
|
+
* The highlight color of the text.
|
|
225
|
+
*
|
|
226
|
+
* See https://reactnative.dev/docs/text#selectioncolor
|
|
227
|
+
*/
|
|
228
|
+
selectionColor?: ?string,
|
|
229
|
+
|
|
230
|
+
dataDetectorType?: ?('phoneNumber' | 'link' | 'email' | 'none' | 'all'),
|
|
231
|
+
|
|
232
|
+
/**
|
|
233
|
+
* Set text break strategy on Android.
|
|
234
|
+
*
|
|
235
|
+
* See https://reactnative.dev/docs/text#textbreakstrategy
|
|
236
|
+
*/
|
|
237
|
+
textBreakStrategy?: ?('balanced' | 'highQuality' | 'simple'),
|
|
238
|
+
|
|
239
|
+
/**
|
|
240
|
+
* iOS Only
|
|
241
|
+
*/
|
|
242
|
+
adjustsFontSizeToFit?: ?boolean,
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* The Dynamic Type scale ramp to apply to this element on iOS.
|
|
246
|
+
*/
|
|
247
|
+
dynamicTypeRamp?: ?(
|
|
248
|
+
| 'caption2'
|
|
249
|
+
| 'caption1'
|
|
250
|
+
| 'footnote'
|
|
251
|
+
| 'subheadline'
|
|
252
|
+
| 'callout'
|
|
253
|
+
| 'body'
|
|
254
|
+
| 'headline'
|
|
255
|
+
| 'title3'
|
|
256
|
+
| 'title2'
|
|
257
|
+
| 'title1'
|
|
258
|
+
| 'largeTitle'
|
|
259
|
+
),
|
|
260
|
+
|
|
261
|
+
/**
|
|
262
|
+
* Smallest possible scale a font can reach.
|
|
263
|
+
*
|
|
264
|
+
* See https://reactnative.dev/docs/text#minimumfontscale
|
|
265
|
+
*/
|
|
266
|
+
minimumFontScale?: ?number,
|
|
267
|
+
|
|
268
|
+
/**
|
|
269
|
+
* When `true`, no visual change is made when text is pressed down.
|
|
270
|
+
*
|
|
271
|
+
* See https://reactnative.dev/docs/text#supperhighlighting
|
|
272
|
+
*/
|
|
273
|
+
suppressHighlighting?: ?boolean,
|
|
274
|
+
|
|
275
|
+
/**
|
|
276
|
+
* Set line break strategy on iOS.
|
|
277
|
+
*
|
|
278
|
+
* See https://reactnative.dev/docs/text.html#linebreakstrategyios
|
|
279
|
+
*/
|
|
280
|
+
lineBreakStrategyIOS?: ?('none' | 'standard' | 'hangul-word' | 'push-out'),
|
|
281
|
+
|}>;
|
|
@@ -16,21 +16,52 @@ const NativeModules = require('../BatchedBridge/NativeModules');
|
|
|
16
16
|
|
|
17
17
|
const turboModuleProxy = global.__turboModuleProxy;
|
|
18
18
|
|
|
19
|
+
const moduleLoadHistory = {
|
|
20
|
+
NativeModules: ([]: Array<string>),
|
|
21
|
+
TurboModules: ([]: Array<string>),
|
|
22
|
+
NotFound: ([]: Array<string>),
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
function isBridgeless() {
|
|
26
|
+
return global.RN$Bridgeless === true;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function isTurboModuleInteropEnabled() {
|
|
30
|
+
return global.RN$TurboInterop === true;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// TODO(154308585): Remove "module not found" debug info logging
|
|
34
|
+
function shouldReportDebugInfo() {
|
|
35
|
+
return true;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// TODO(148943970): Consider reversing the lookup here:
|
|
39
|
+
// Lookup on __turboModuleProxy, then lookup on nativeModuleProxy
|
|
19
40
|
function requireModule<T: TurboModule>(name: string): ?T {
|
|
20
|
-
|
|
21
|
-
if (global.RN$Bridgeless !== true) {
|
|
41
|
+
if (!isBridgeless() || isTurboModuleInteropEnabled()) {
|
|
22
42
|
// Backward compatibility layer during migration.
|
|
23
43
|
const legacyModule = NativeModules[name];
|
|
24
44
|
if (legacyModule != null) {
|
|
45
|
+
if (shouldReportDebugInfo()) {
|
|
46
|
+
moduleLoadHistory.NativeModules.push(name);
|
|
47
|
+
}
|
|
25
48
|
return ((legacyModule: $FlowFixMe): T);
|
|
26
49
|
}
|
|
27
50
|
}
|
|
28
51
|
|
|
29
52
|
if (turboModuleProxy != null) {
|
|
30
53
|
const module: ?T = turboModuleProxy(name);
|
|
31
|
-
|
|
54
|
+
if (module != null) {
|
|
55
|
+
if (shouldReportDebugInfo()) {
|
|
56
|
+
moduleLoadHistory.TurboModules.push(name);
|
|
57
|
+
}
|
|
58
|
+
return module;
|
|
59
|
+
}
|
|
32
60
|
}
|
|
33
61
|
|
|
62
|
+
if (shouldReportDebugInfo() && !moduleLoadHistory.NotFound.includes(name)) {
|
|
63
|
+
moduleLoadHistory.NotFound.push(name);
|
|
64
|
+
}
|
|
34
65
|
return null;
|
|
35
66
|
}
|
|
36
67
|
|
|
@@ -40,10 +71,19 @@ export function get<T: TurboModule>(name: string): ?T {
|
|
|
40
71
|
|
|
41
72
|
export function getEnforcing<T: TurboModule>(name: string): T {
|
|
42
73
|
const module = requireModule<T>(name);
|
|
43
|
-
|
|
44
|
-
module != null,
|
|
74
|
+
let message =
|
|
45
75
|
`TurboModuleRegistry.getEnforcing(...): '${name}' could not be found. ` +
|
|
46
|
-
|
|
47
|
-
|
|
76
|
+
'Verify that a module by this name is registered in the native binary.';
|
|
77
|
+
|
|
78
|
+
if (shouldReportDebugInfo()) {
|
|
79
|
+
message += 'Bridgeless mode: ' + (isBridgeless() ? 'true' : 'false') + '. ';
|
|
80
|
+
message +=
|
|
81
|
+
'TurboModule interop: ' +
|
|
82
|
+
(isTurboModuleInteropEnabled() ? 'true' : 'false') +
|
|
83
|
+
'. ';
|
|
84
|
+
message += 'Modules loaded: ' + JSON.stringify(moduleLoadHistory);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
invariant(module != null, message);
|
|
48
88
|
return module;
|
|
49
89
|
}
|
|
@@ -37,6 +37,12 @@ export interface Spec extends TurboModule {
|
|
|
37
37
|
+getValue: (x: number, y: string, z: Object) => Object;
|
|
38
38
|
+getValueWithCallback: (callback: (value: string) => void) => void;
|
|
39
39
|
+getValueWithPromise: (error: boolean) => Promise<string>;
|
|
40
|
+
+voidFuncThrows?: () => void;
|
|
41
|
+
+getObjectThrows?: (arg: Object) => Object;
|
|
42
|
+
+promiseThrows?: () => Promise<void>;
|
|
43
|
+
+voidFuncAssert?: () => void;
|
|
44
|
+
+getObjectAssert?: (arg: Object) => Object;
|
|
45
|
+
+promiseAssert?: () => Promise<void>;
|
|
40
46
|
}
|
|
41
47
|
|
|
42
48
|
export default (TurboModuleRegistry.getEnforcing<Spec>(
|
|
@@ -8,7 +8,6 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
import type * as React from 'react';
|
|
11
|
-
import {NodeHandle} from '../ReactNative/RendererProxy';
|
|
12
11
|
import {HostComponent} from '../../types/public/ReactNativeTypes';
|
|
13
12
|
|
|
14
13
|
export interface LayoutRectangle {
|
|
@@ -42,7 +41,11 @@ export interface TextLayoutEventData extends TargetedEvent {
|
|
|
42
41
|
|
|
43
42
|
// Similar to React.SyntheticEvent except for nativeEvent
|
|
44
43
|
export interface NativeSyntheticEvent<T>
|
|
45
|
-
extends React.BaseSyntheticEvent<
|
|
44
|
+
extends React.BaseSyntheticEvent<
|
|
45
|
+
T,
|
|
46
|
+
React.ElementRef<HostComponent<unknown>>,
|
|
47
|
+
React.ElementRef<HostComponent<unknown>>
|
|
48
|
+
> {}
|
|
46
49
|
|
|
47
50
|
export interface NativeTouchEvent {
|
|
48
51
|
/**
|
|
@@ -10,17 +10,8 @@
|
|
|
10
10
|
|
|
11
11
|
import type {IPerformanceLogger} from './createPerformanceLogger';
|
|
12
12
|
|
|
13
|
-
import ReactNativeFeatureFlags from '../ReactNative/ReactNativeFeatureFlags';
|
|
14
|
-
import NativePerformance from '../WebPerformance/NativePerformance';
|
|
15
13
|
import createPerformanceLogger from './createPerformanceLogger';
|
|
16
14
|
|
|
17
|
-
function isLoggingForWebPerformance(): boolean {
|
|
18
|
-
return (
|
|
19
|
-
NativePerformance != null &&
|
|
20
|
-
ReactNativeFeatureFlags.isGlobalWebPerformanceLoggerEnabled()
|
|
21
|
-
);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
15
|
/**
|
|
25
16
|
* This is a global shared instance of IPerformanceLogger that is created with
|
|
26
17
|
* createPerformanceLogger().
|
|
@@ -28,8 +19,7 @@ function isLoggingForWebPerformance(): boolean {
|
|
|
28
19
|
* that are logged during loading bundle. If you want to log something from your
|
|
29
20
|
* React component you should use PerformanceLoggerContext instead.
|
|
30
21
|
*/
|
|
31
|
-
const GlobalPerformanceLogger: IPerformanceLogger =
|
|
32
|
-
|
|
33
|
-
);
|
|
22
|
+
const GlobalPerformanceLogger: IPerformanceLogger =
|
|
23
|
+
createPerformanceLogger(true);
|
|
34
24
|
|
|
35
25
|
module.exports = GlobalPerformanceLogger;
|
|
@@ -34,21 +34,20 @@ export type DimensionsPayload = {|
|
|
|
34
34
|
screenPhysicalPixels?: DisplayMetricsAndroid,
|
|
35
35
|
|};
|
|
36
36
|
|
|
37
|
+
export type DeviceInfoConstants = {|
|
|
38
|
+
+Dimensions: DimensionsPayload,
|
|
39
|
+
+isIPhoneX_deprecated?: boolean,
|
|
40
|
+
|};
|
|
41
|
+
|
|
37
42
|
export interface Spec extends TurboModule {
|
|
38
|
-
+getConstants: () =>
|
|
39
|
-
+Dimensions: DimensionsPayload,
|
|
40
|
-
+isIPhoneX_deprecated?: boolean,
|
|
41
|
-
|};
|
|
43
|
+
+getConstants: () => DeviceInfoConstants;
|
|
42
44
|
}
|
|
43
45
|
|
|
44
46
|
const NativeModule: Spec = TurboModuleRegistry.getEnforcing<Spec>('DeviceInfo');
|
|
45
|
-
let constants = null;
|
|
47
|
+
let constants: ?DeviceInfoConstants = null;
|
|
46
48
|
|
|
47
49
|
const NativeDeviceInfo = {
|
|
48
|
-
getConstants(): {
|
|
49
|
-
+Dimensions: DimensionsPayload,
|
|
50
|
-
+isIPhoneX_deprecated?: boolean,
|
|
51
|
-
|} {
|
|
50
|
+
getConstants(): DeviceInfoConstants {
|
|
52
51
|
if (constants == null) {
|
|
53
52
|
constants = NativeModule.getConstants();
|
|
54
53
|
}
|
|
@@ -12,25 +12,30 @@ import type {TurboModule} from '../TurboModule/RCTExport';
|
|
|
12
12
|
|
|
13
13
|
import * as TurboModuleRegistry from '../TurboModule/TurboModuleRegistry';
|
|
14
14
|
|
|
15
|
+
export type ReactNativeVersionAndroid = {|
|
|
16
|
+
major: number,
|
|
17
|
+
minor: number,
|
|
18
|
+
patch: number,
|
|
19
|
+
prerelease: ?number,
|
|
20
|
+
|};
|
|
21
|
+
|
|
22
|
+
export type PlatformConstantsAndroid = {|
|
|
23
|
+
isTesting: boolean,
|
|
24
|
+
isDisableAnimations?: boolean,
|
|
25
|
+
reactNativeVersion: ReactNativeVersionAndroid,
|
|
26
|
+
Version: number,
|
|
27
|
+
Release: string,
|
|
28
|
+
Serial: string,
|
|
29
|
+
Fingerprint: string,
|
|
30
|
+
Model: string,
|
|
31
|
+
ServerHost?: string,
|
|
32
|
+
uiMode: string,
|
|
33
|
+
Brand: string,
|
|
34
|
+
Manufacturer: string,
|
|
35
|
+
|};
|
|
36
|
+
|
|
15
37
|
export interface Spec extends TurboModule {
|
|
16
|
-
+getConstants: () =>
|
|
17
|
-
isTesting: boolean,
|
|
18
|
-
reactNativeVersion: {|
|
|
19
|
-
major: number,
|
|
20
|
-
minor: number,
|
|
21
|
-
patch: number,
|
|
22
|
-
prerelease: ?number,
|
|
23
|
-
|},
|
|
24
|
-
Version: number,
|
|
25
|
-
Release: string,
|
|
26
|
-
Serial: string,
|
|
27
|
-
Fingerprint: string,
|
|
28
|
-
Model: string,
|
|
29
|
-
ServerHost?: string,
|
|
30
|
-
uiMode: string,
|
|
31
|
-
Brand: string,
|
|
32
|
-
Manufacturer: string,
|
|
33
|
-
|};
|
|
38
|
+
+getConstants: () => PlatformConstantsAndroid;
|
|
34
39
|
+getAndroidID: () => string;
|
|
35
40
|
}
|
|
36
41
|
|
|
@@ -12,20 +12,23 @@ import type {TurboModule} from '../TurboModule/RCTExport';
|
|
|
12
12
|
|
|
13
13
|
import * as TurboModuleRegistry from '../TurboModule/TurboModuleRegistry';
|
|
14
14
|
|
|
15
|
+
export type PlatformConstantsIOS = {|
|
|
16
|
+
isTesting: boolean,
|
|
17
|
+
isDisableAnimations?: boolean,
|
|
18
|
+
reactNativeVersion: {|
|
|
19
|
+
major: number,
|
|
20
|
+
minor: number,
|
|
21
|
+
patch: number,
|
|
22
|
+
prerelease: ?number,
|
|
23
|
+
|},
|
|
24
|
+
forceTouchAvailable: boolean,
|
|
25
|
+
osVersion: string,
|
|
26
|
+
systemName: string,
|
|
27
|
+
interfaceIdiom: string,
|
|
28
|
+
|};
|
|
29
|
+
|
|
15
30
|
export interface Spec extends TurboModule {
|
|
16
|
-
+getConstants: () =>
|
|
17
|
-
isTesting: boolean,
|
|
18
|
-
reactNativeVersion: {|
|
|
19
|
-
major: number,
|
|
20
|
-
minor: number,
|
|
21
|
-
patch: number,
|
|
22
|
-
prerelease: ?number,
|
|
23
|
-
|},
|
|
24
|
-
forceTouchAvailable: boolean,
|
|
25
|
-
osVersion: string,
|
|
26
|
-
systemName: string,
|
|
27
|
-
interfaceIdiom: string,
|
|
28
|
-
|};
|
|
31
|
+
+getConstants: () => PlatformConstantsIOS;
|
|
29
32
|
}
|
|
30
33
|
|
|
31
34
|
export default (TurboModuleRegistry.getEnforcing<Spec>(
|
|
@@ -10,17 +10,20 @@ import type {TurboModule} from '../TurboModule/RCTExport';
|
|
|
10
10
|
|
|
11
11
|
import * as TurboModuleRegistry from '../TurboModule/TurboModuleRegistry';
|
|
12
12
|
|
|
13
|
+
export type PlatformConstantsWin32 = {|
|
|
14
|
+
isTesting: boolean,
|
|
15
|
+
isDisableAnimations?: boolean,
|
|
16
|
+
reactNativeVersion: {|
|
|
17
|
+
major: number,
|
|
18
|
+
minor: number,
|
|
19
|
+
patch: number,
|
|
20
|
+
prerelease: ?string | number,
|
|
21
|
+
|},
|
|
22
|
+
osVersion: number,
|
|
23
|
+
|};
|
|
24
|
+
|
|
13
25
|
export interface Spec extends TurboModule {
|
|
14
|
-
+getConstants: () =>
|
|
15
|
-
isTesting: boolean,
|
|
16
|
-
reactNativeVersion: {|
|
|
17
|
-
major: number,
|
|
18
|
-
minor: number,
|
|
19
|
-
patch: number,
|
|
20
|
-
prerelease: ?string | number,
|
|
21
|
-
|},
|
|
22
|
-
osVersion: number,
|
|
23
|
-
|};
|
|
26
|
+
+getConstants: () => PlatformConstantsWin32;
|
|
24
27
|
}
|
|
25
28
|
|
|
26
29
|
export default (TurboModuleRegistry.getEnforcing<Spec>(
|
|
@@ -18,7 +18,7 @@ import {useContext} from 'react';
|
|
|
18
18
|
* This is a React Context that provides a scoped instance of IPerformanceLogger.
|
|
19
19
|
* We wrap every <AppContainer /> with a Provider for this context so the logger
|
|
20
20
|
* should be available in every component.
|
|
21
|
-
* See React docs about using Context: https://
|
|
21
|
+
* See React docs about using Context: https://react.dev/docs/context.html
|
|
22
22
|
*/
|
|
23
23
|
const PerformanceLoggerContext: React.Context<IPerformanceLogger> =
|
|
24
24
|
React.createContext(GlobalPerformanceLogger);
|
|
@@ -8,16 +8,14 @@
|
|
|
8
8
|
* @flow strict
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
import
|
|
11
|
+
import type {
|
|
12
|
+
Platform as PlatformType,
|
|
13
|
+
PlatformSelectSpec,
|
|
14
|
+
} from './Platform.flow';
|
|
12
15
|
|
|
13
|
-
|
|
14
|
-
android?: T,
|
|
15
|
-
native?: T,
|
|
16
|
-
default?: T,
|
|
17
|
-
...
|
|
18
|
-
};
|
|
16
|
+
import NativePlatformConstantsAndroid from './NativePlatformConstantsAndroid';
|
|
19
17
|
|
|
20
|
-
const Platform = {
|
|
18
|
+
const Platform: PlatformType = {
|
|
21
19
|
__constants: null,
|
|
22
20
|
OS: 'android',
|
|
23
21
|
// $FlowFixMe[unsafe-getters-setters]
|
|
@@ -28,6 +26,7 @@ const Platform = {
|
|
|
28
26
|
// $FlowFixMe[unsafe-getters-setters]
|
|
29
27
|
get constants(): {|
|
|
30
28
|
isTesting: boolean,
|
|
29
|
+
isDisableAnimations?: boolean,
|
|
31
30
|
reactNativeVersion: {|
|
|
32
31
|
major: number,
|
|
33
32
|
minor: number,
|
|
@@ -61,6 +60,11 @@ const Platform = {
|
|
|
61
60
|
return false;
|
|
62
61
|
},
|
|
63
62
|
// $FlowFixMe[unsafe-getters-setters]
|
|
63
|
+
get isDisableAnimations(): boolean {
|
|
64
|
+
// $FlowFixMe[object-this-reference]
|
|
65
|
+
return this.constants.isDisableAnimations ?? this.isTesting;
|
|
66
|
+
},
|
|
67
|
+
// $FlowFixMe[unsafe-getters-setters]
|
|
64
68
|
get isTV(): boolean {
|
|
65
69
|
// $FlowFixMe[object-this-reference]
|
|
66
70
|
return this.constants.uiMode === 'tv';
|