react-native-windows 0.79.5 → 0.80.0-preview.10
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 +12 -3
- package/Directory.Build.props +11 -2
- package/Folly/TEMP_UntilFollyUpdate/json/json.cpp +1 -1
- package/Libraries/Alert/Alert.d.ts +4 -1
- package/Libraries/Alert/Alert.js +3 -0
- package/Libraries/Alert/Alert.windows.js +3 -0
- package/Libraries/Alert/RCTAlertManager.js +17 -0
- package/Libraries/Animated/Animated.js.flow +1 -3
- package/Libraries/Animated/AnimatedEvent.js +4 -3
- package/Libraries/Animated/AnimatedExports.js +2 -2
- package/Libraries/Animated/AnimatedExports.js.flow +140 -0
- package/Libraries/Animated/AnimatedImplementation.js +2 -123
- package/Libraries/Animated/Easing.js +13 -15
- package/Libraries/Animated/animations/Animation.js +8 -4
- package/Libraries/Animated/components/AnimatedFlatList.js +7 -6
- package/Libraries/Animated/components/AnimatedScrollView.js +48 -42
- package/Libraries/Animated/components/AnimatedSectionList.js +11 -7
- package/Libraries/Animated/createAnimatedComponent.js +105 -57
- package/Libraries/Animated/nodes/AnimatedNode.js +4 -3
- package/Libraries/Animated/nodes/AnimatedProps.js +46 -26
- package/Libraries/Animated/nodes/AnimatedValue.js +16 -7
- package/Libraries/Animated/nodes/AnimatedValueXY.js +3 -1
- package/Libraries/AppState/AppState.js +7 -2
- package/Libraries/BatchedBridge/MessageQueue.js +2 -2
- package/Libraries/BatchedBridge/NativeModules.js +2 -0
- package/Libraries/Blob/BlobManager.js +1 -0
- package/Libraries/Blob/FileReader.js +219 -8
- package/Libraries/Blob/URL.js +37 -12
- package/Libraries/Blob/URLSearchParams.js +106 -31
- package/Libraries/Blob/URLSearchParams.js.flow +12 -7
- package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js +1 -1
- package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.windows.js +1 -1
- package/Libraries/Components/AccessibilityInfo/legacySendAccessibilityEvent.js +17 -0
- package/Libraries/Components/ActivityIndicator/ActivityIndicator.js +1 -0
- package/Libraries/Components/Button.d.ts +3 -0
- package/Libraries/Components/Button.js +1 -1
- package/Libraries/Components/Button.windows.js +27 -1
- package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js +1 -3
- package/Libraries/{NewAppScreen/components/Colors.js → Components/DrawerAndroid/DrawerLayoutAndroid.ios.js} +6 -10
- package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.js +6 -66
- package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.js.flow +18 -0
- package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroidFallback.js +71 -0
- package/Libraries/Components/Flyout/Flyout.js +11 -0
- package/Libraries/Components/Keyboard/Keyboard.js +5 -3
- package/Libraries/Components/Keyboard/KeyboardAvoidingView.js +6 -3
- package/Libraries/Components/Keyboard/KeyboardExt.js.map +1 -1
- package/Libraries/Components/Popup/Popup.js +11 -0
- package/Libraries/Components/Pressable/Pressable.js +20 -4
- package/Libraries/Components/Pressable/Pressable.windows.js +20 -4
- package/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.js +25 -3
- package/Libraries/Components/ProgressBarAndroid/ProgressBarAndroidTypes.js +29 -20
- package/Libraries/Components/RefreshControl/RefreshControl.js +1 -1
- package/Libraries/Components/RefreshControl/RefreshControl.windows.js +1 -1
- package/Libraries/Components/ScrollView/ScrollView.d.ts +3 -3
- package/Libraries/Components/ScrollView/ScrollView.js +132 -122
- package/Libraries/Components/ScrollView/ScrollView.windows.js +131 -122
- package/Libraries/Components/StaticRenderer.js +1 -1
- package/Libraries/Components/Switch/Switch.d.ts +3 -0
- package/Libraries/Components/Switch/Switch.js +8 -4
- package/Libraries/Components/Switch/Switch.windows.js +17 -4
- package/Libraries/Components/TextInput/AndroidTextInputNativeComponent.js +2 -1
- package/Libraries/Components/TextInput/RCTTextInputViewConfig.js +2 -4
- package/Libraries/Components/TextInput/TextInput.d.ts +70 -33
- package/Libraries/Components/TextInput/TextInput.flow.js +100 -51
- package/Libraries/Components/TextInput/TextInput.flow.windows.js +1246 -0
- package/Libraries/Components/TextInput/TextInput.js +88 -1027
- package/Libraries/Components/TextInput/TextInput.windows.js +104 -1092
- package/Libraries/Components/TextInput/TextInputState.js +1 -1
- package/Libraries/Components/TextInput/TextInputState.windows.js +1 -1
- package/Libraries/Components/TextInput/WindowsTextInputNativeComponent.js +2 -1
- package/Libraries/{Modal/ModalInjection.js → Components/ToastAndroid/ToastAndroid.ios.js} +3 -5
- package/Libraries/Components/ToastAndroid/ToastAndroid.js +4 -32
- package/Libraries/Components/ToastAndroid/ToastAndroid.js.flow +109 -0
- package/Libraries/Components/ToastAndroid/ToastAndroidFallback.js +45 -0
- package/Libraries/Components/Touchable/Touchable.js +5 -5
- package/Libraries/Components/Touchable/Touchable.windows.js +5 -5
- package/Libraries/Components/Touchable/TouchableBounce.js +14 -7
- package/Libraries/Components/Touchable/TouchableBounce.windows.js +14 -7
- package/Libraries/Components/Touchable/TouchableHighlight.js +10 -7
- package/Libraries/Components/Touchable/TouchableHighlight.windows.js +10 -7
- package/Libraries/Components/Touchable/TouchableNativeFeedback.js +6 -6
- package/Libraries/Components/Touchable/TouchableNativeFeedback.windows.js +6 -6
- package/Libraries/Components/Touchable/TouchableOpacity.js +13 -6
- package/Libraries/Components/Touchable/TouchableOpacity.windows.js +13 -6
- package/Libraries/Components/View/View.js +18 -21
- package/Libraries/Components/View/View.windows.js +39 -41
- package/Libraries/Components/View/ViewAccessibility.d.ts +8 -0
- package/Libraries/Components/View/ViewAccessibility.js +25 -1
- package/Libraries/Components/View/ViewAccessibility.windows.js +9 -1
- package/Libraries/Components/View/ViewPropTypes.js +49 -3
- package/Libraries/Components/View/ViewPropTypes.windows.js +50 -2
- package/Libraries/Core/ReactNativeVersion.js +1 -1
- package/Libraries/Core/setUpReactDevTools.js +5 -5
- package/Libraries/Debugging/DebuggingOverlayRegistry.js +3 -3
- package/Libraries/EventEmitter/NativeEventEmitter.js +9 -4
- package/Libraries/Image/AssetSourceResolver.js +17 -4
- package/Libraries/Image/AssetSourceResolver.windows.js +17 -4
- package/Libraries/Image/Image.d.ts +26 -10
- package/Libraries/Image/Image.js +17 -0
- package/Libraries/Image/Image.js.flow +5 -5
- package/Libraries/Image/Image.windows.js +13 -1
- package/Libraries/Image/ImageBackground.js +2 -0
- package/Libraries/Image/ImageInjection.js +1 -1
- package/Libraries/Image/ImageProps.js +22 -17
- package/Libraries/Image/ImageSource.js +3 -1
- package/Libraries/Image/ImageSourceUtils.js +4 -2
- package/Libraries/Image/ImageTypes.flow.js +1 -1
- package/Libraries/Interaction/InteractionManager.d.ts +13 -0
- package/Libraries/Interaction/InteractionManager.js +1 -1
- package/Libraries/Interaction/PanResponder.js +3 -3
- package/Libraries/Interaction/TaskQueue.js +1 -0
- package/Libraries/LayoutAnimation/LayoutAnimation.js +2 -2
- package/Libraries/Linking/Linking.js +1 -1
- package/Libraries/Lists/FlatList.d.ts +2 -2
- package/Libraries/Lists/FlatList.js +8 -11
- package/Libraries/Lists/SectionList.js +39 -42
- package/Libraries/Lists/SectionListModern.js +25 -34
- package/Libraries/Lists/VirtualizedList.js +1 -0
- package/Libraries/Lists/VirtualizedSectionList.js +1 -0
- package/Libraries/LogBox/Data/LogBoxData.js +1 -1
- package/Libraries/LogBox/LogBoxNotificationContainer.js +1 -1
- package/Libraries/Modal/Modal.js +33 -7
- package/Libraries/Modal/Modal.windows.js +33 -10
- package/Libraries/NativeComponent/BaseViewConfig.android.js +2 -0
- package/Libraries/NativeComponent/BaseViewConfig.ios.js +2 -0
- package/Libraries/NativeComponent/BaseViewConfig.js +17 -0
- package/Libraries/NativeComponent/BaseViewConfig.windows.js +3 -0
- package/Libraries/NativeComponent/PlatformBaseViewConfig.js +2 -2
- package/Libraries/NativeModules/specs/NativeDevMenu.js +2 -2
- package/Libraries/Network/RCTNetworking.android.js +1 -1
- package/Libraries/Network/RCTNetworking.ios.js +1 -1
- package/Libraries/Network/RCTNetworking.js +17 -0
- package/Libraries/Network/RCTNetworking.js.flow +1 -1
- package/Libraries/Network/RCTNetworking.windows.js +1 -1
- package/Libraries/Network/XMLHttpRequest.js +781 -10
- package/Libraries/Performance/Systrace.js +7 -7
- package/Libraries/Pressability/Pressability.js +1 -1
- package/Libraries/Pressability/Pressability.windows.js +1 -1
- package/Libraries/ReactNative/AppContainer-dev.js +5 -4
- package/Libraries/ReactNative/AppRegistry.flow.js +49 -0
- package/Libraries/ReactNative/AppRegistry.js +2 -322
- package/Libraries/ReactNative/AppRegistry.js.flow +23 -0
- package/Libraries/ReactNative/AppRegistryImpl.js +316 -0
- package/Libraries/ReactNative/FabricUIManager.js +10 -0
- package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricHostComponent.js +2 -4
- package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstance.js +1 -4
- package/Libraries/ReactNative/RendererImplementation.js +10 -5
- package/Libraries/ReactNative/getNativeComponentAttributes.js +1 -0
- package/Libraries/ReactNative/renderApplication.js +9 -0
- package/Libraries/ReactPrivate/ReactNativePrivateInterface.js +3 -3
- package/Libraries/ReactPrivate/ReactNativePrivateInterface.js.flow +51 -0
- package/Libraries/Renderer/implementations/ReactFabric-dev.js +4840 -4748
- package/Libraries/Renderer/implementations/ReactFabric-prod.js +4947 -4829
- package/Libraries/Renderer/implementations/ReactFabric-profiling.js +3998 -3888
- package/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js +5005 -4948
- package/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js +2744 -2652
- package/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.js +5020 -4933
- package/Libraries/Renderer/shims/ReactNativeTypes.js +3 -3
- package/Libraries/Settings/Settings.ios.js +1 -0
- package/Libraries/Settings/Settings.js +13 -19
- package/Libraries/Settings/SettingsFallback.js +33 -0
- package/Libraries/StyleSheet/PlatformColorValueTypes.js +15 -0
- package/Libraries/StyleSheet/PlatformColorValueTypesIOS.js +6 -0
- package/Libraries/StyleSheet/Rect.js +1 -0
- package/Libraries/StyleSheet/StyleSheet.js +31 -200
- package/Libraries/StyleSheet/StyleSheet.js.flow +188 -0
- package/Libraries/StyleSheet/StyleSheetExports.js +210 -0
- package/Libraries/StyleSheet/StyleSheetExports.js.flow +112 -0
- package/Libraries/StyleSheet/StyleSheetTypes.d.ts +1 -1
- package/Libraries/StyleSheet/StyleSheetTypes.js +130 -52
- package/Libraries/StyleSheet/flattenStyle.js +14 -4
- package/Libraries/StyleSheet/private/_TransformStyle.js +49 -21
- package/Libraries/StyleSheet/processBackgroundImage.js +670 -214
- package/Libraries/Text/Text.d.ts +2 -5
- package/Libraries/Text/Text.js +3 -3
- package/Libraries/Text/Text.windows.js +3 -3
- package/Libraries/Text/TextNativeComponent.js +0 -4
- package/Libraries/Text/TextProps.js +5 -33
- package/Libraries/Text/TextProps.windows.js +5 -32
- package/Libraries/Types/CodegenTypesNamespace.d.ts +45 -0
- package/Libraries/{Blob/__mocks__/BlobModule.js → Types/CodegenTypesNamespace.js} +4 -6
- package/Libraries/Types/CoreEventTypes.d.ts +6 -1
- package/Libraries/Types/CoreEventTypes.js +1 -1
- package/Libraries/Types/CoreEventTypes.windows.js +1 -1
- package/Libraries/Utilities/Appearance.js +2 -0
- package/Libraries/Utilities/BackHandler.js +17 -0
- package/Libraries/Utilities/DeviceInfo.js +2 -0
- package/Libraries/Utilities/Dimensions.js +1 -1
- package/Libraries/Utilities/Platform.js +17 -0
- package/Libraries/Utilities/PlatformTypes.js +11 -3
- package/Libraries/Utilities/ReactNativeTestTools.js +2 -2
- package/Libraries/Utilities/codegenNativeCommands.d.ts +18 -0
- package/Libraries/Utilities/codegenNativeComponent.d.ts +26 -0
- package/Libraries/WebSocket/WebSocket.js +313 -8
- package/Libraries/vendor/core/ErrorUtils.js +28 -2
- package/Libraries/vendor/emitter/EventEmitter.js +6 -2
- package/Microsoft.ReactNative/CompositionSwitcher.idl +3 -0
- package/Microsoft.ReactNative/Fabric/AbiComponentDescriptor.cpp +0 -6
- package/Microsoft.ReactNative/Fabric/Composition/CompositionContextHelper.cpp +248 -6
- package/Microsoft.ReactNative/Fabric/Composition/CompositionDynamicAutomationProvider.cpp +55 -160
- package/Microsoft.ReactNative/Fabric/Composition/CompositionTextRangeProvider.cpp +30 -9
- package/Microsoft.ReactNative/Fabric/Composition/CompositionViewComponentView.cpp +36 -0
- package/Microsoft.ReactNative/Fabric/Composition/ParagraphComponentView.cpp +36 -33
- package/Microsoft.ReactNative/Fabric/Composition/ReactNativeIsland.cpp +22 -0
- package/Microsoft.ReactNative/Fabric/Composition/ReactNativeIsland.h +3 -0
- package/Microsoft.ReactNative/Fabric/Composition/ScrollViewComponentView.cpp +46 -0
- package/Microsoft.ReactNative/Fabric/Composition/ScrollViewComponentView.h +4 -1
- package/Microsoft.ReactNative/Fabric/Composition/SwitchComponentView.cpp +11 -0
- package/Microsoft.ReactNative/Fabric/Composition/TextDrawing.cpp +37 -5
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.cpp +177 -25
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.h +4 -0
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputEventEmitter.cpp +29 -0
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputEventEmitter.h +2 -0
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputShadowNode.cpp +17 -34
- package/Microsoft.ReactNative/Fabric/Composition/UiaHelpers.cpp +225 -0
- package/Microsoft.ReactNative/Fabric/Composition/UiaHelpers.h +23 -0
- package/Microsoft.ReactNative/Fabric/FabricUIManagerModule.cpp +9 -3
- package/Microsoft.ReactNative/Fabric/FabricUIManagerModule.h +2 -0
- package/Microsoft.ReactNative/Fabric/ImageManager.cpp +1 -1
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/components/view/HostPlatformViewEventEmitter.cpp +16 -0
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/components/view/HostPlatformViewEventEmitter.h +1 -0
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/components/view/HostPlatformViewProps.cpp +9 -0
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/components/view/HostPlatformViewProps.h +1 -0
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/components/view/HostPlatformViewTraitsInitializer.h +4 -0
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/graphics/PlatformColorUtils.cpp +64 -0
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/graphics/PlatformColorUtils.h +11 -0
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/textlayoutmanager/WindowsTextLayoutManager.cpp +36 -96
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/textlayoutmanager/WindowsTextLayoutManager.h +1 -1
- package/Microsoft.ReactNative/Modules/AccessibilityInfoModule.cpp +29 -0
- package/Microsoft.ReactNative/Modules/SampleTurboModule.cpp +4 -0
- package/Microsoft.ReactNative/Modules/SampleTurboModule.h +3 -0
- package/Microsoft.ReactNative/TurboModulesProvider.h +1 -1
- package/Microsoft.ReactNative/Utils/ThemeUtils.cpp +49 -0
- package/Microsoft.ReactNative/Utils/ThemeUtils.h +31 -0
- package/Microsoft.ReactNative.Cxx/JSI/JsiApiContext.h +1 -1
- package/Microsoft.ReactNative.Cxx/JSI/LongLivedJsiValue.h +1 -1
- package/PropertySheets/Generated/PackageVersion.g.props +4 -4
- package/PropertySheets/JSEngine.props +1 -1
- package/PropertySheets/React.Cpp.props +4 -0
- package/PropertySheets/Warnings.props +45 -0
- package/README.md +6 -2
- package/ReactCommon/ReactCommon.vcxproj +9 -4
- package/ReactCommon/ReactCommon.vcxproj.filters +6 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/CxxNativeModule.cpp +253 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/JSExecutor.cpp +5 -2
- package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/NativeToJsBridge.cpp +4 -8
- package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/TraceSection.h +184 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/jsinspector-modern/NetworkIOAgent.cpp +22 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/jsinspector-modern/NetworkIOAgent.h +2 -4
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/nativemodule/core/ReactCommon/TurboModuleWithJSIBindings.cpp +27 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/componentregistry/ComponentDescriptorRegistry.cpp +3 -2
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/view/AccessibilityPrimitives.h +1 -1
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/view/AccessibilityProps.cpp +308 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/core/DynamicEventPayload.cpp +42 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/css/CSSTokenizer.h +7 -51
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/runtime/ReactInstance.cpp +10 -5
- package/Scripts/creaternwapp.cmd +9 -3
- package/Scripts/rnw-dependencies.ps1 +16 -3
- package/Shared/Shared.vcxitems +3 -2
- package/Shared/Shared.vcxitems.filters +2 -1
- package/codegen/NativeAnimatedModuleSpec.g.h +2 -0
- package/codegen/NativeAnimatedTurboModuleSpec.g.h +2 -0
- package/codegen/NativePerformanceSpec.g.h +14 -0
- package/codegen/NativeReactNativeFeatureFlagsSpec.g.h +151 -127
- package/codegen/NativeSampleTurboModuleSpec.g.h +14 -8
- package/codegen/react/components/rnwcore/EventEmitters.cpp +48 -48
- package/codegen/rnwcoreJSI-generated.cpp +159 -129
- package/codegen/rnwcoreJSI.h +534 -408
- package/index.js +51 -331
- package/index.windows.js +70 -352
- package/interface.js +0 -4
- package/jest/resolver.js +31 -0
- package/jest/setup.js +6 -2
- package/package.json +29 -28
- package/src/private/animated/NativeAnimatedHelper.js +21 -8
- package/src/private/animated/createAnimatedPropsHook.js +11 -16
- package/src/private/animated/createAnimatedPropsMemoHook.js +1 -2
- package/src/private/components/{SafeAreaView_INTERNAL_DO_NOT_USE.js → safeareaview/SafeAreaView_INTERNAL_DO_NOT_USE.js} +6 -6
- package/src/private/components/{HScrollViewNativeComponents.js → scrollview/HScrollViewNativeComponents.js} +8 -8
- package/src/private/components/scrollview/VScrollViewNativeComponents.js +25 -0
- package/src/private/{devmenu → devsupport/devmenu}/DevMenu.js +1 -1
- package/src/private/{inspector → devsupport/devmenu/elementinspector}/BorderBox.js +3 -3
- package/src/private/{inspector → devsupport/devmenu/elementinspector}/BoxInspector.js +6 -5
- package/src/private/{inspector → devsupport/devmenu/elementinspector}/ElementBox.js +8 -6
- package/src/private/{inspector → devsupport/devmenu/elementinspector}/ElementProperties.js +11 -10
- package/src/private/{inspector → devsupport/devmenu/elementinspector}/Inspector.js +14 -12
- package/src/private/{inspector → devsupport/devmenu/elementinspector}/InspectorOverlay.js +5 -4
- package/src/private/{inspector → devsupport/devmenu/elementinspector}/InspectorPanel.js +9 -8
- package/src/private/{inspector → devsupport/devmenu/elementinspector}/NetworkOverlay.js +10 -9
- package/src/private/{inspector → devsupport/devmenu/elementinspector}/ReactDevToolsOverlay.js +7 -7
- package/src/private/{inspector → devsupport/devmenu/elementinspector}/StyleInspector.js +7 -6
- package/src/private/{inspector → devsupport/devmenu/elementinspector}/XHRInterceptor.js +2 -2
- package/src/private/{inspector → devsupport/devmenu/elementinspector}/getInspectorDataForViewAtPoint.js +4 -4
- package/src/private/{inspector → devsupport/devmenu/elementinspector}/resolveBoxStyle.js +1 -1
- package/src/private/{inspector → devsupport/devmenu/perfmonitor}/PerformanceOverlay.js +6 -5
- package/src/private/{specs_DEPRECATED/modules → devsupport/devmenu/specs}/NativeDevMenu.js +2 -2
- package/src/private/{debugging → devsupport/rndevtools}/ReactDevToolsSettingsManager.android.js +1 -1
- package/src/private/{debugging → devsupport/rndevtools}/ReactDevToolsSettingsManager.ios.js +1 -1
- package/src/private/{debugging → devsupport/rndevtools}/ReactDevToolsSettingsManager.windows.js +1 -1
- package/src/private/{debugging → devsupport/rndevtools}/setUpFuseboxReactDevToolsDispatcher.js +1 -1
- package/src/private/{fusebox → devsupport/rndevtools}/specs/NativeReactDevToolsRuntimeSettingsModule.js +2 -2
- package/src/private/{specs_DEPRECATED/modules → devsupport/rndevtools/specs}/NativeReactDevToolsSettingsManager.js +2 -2
- package/src/private/featureflags/ReactNativeFeatureFlags.js +82 -80
- package/src/private/featureflags/ReactNativeFeatureFlagsBase.js +12 -1
- package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +17 -13
- package/src/private/renderer/errorhandling/ErrorHandlers.js +2 -2
- package/src/private/specs_DEPRECATED/modules/NativeAnimatedModule.js +1 -1
- package/src/private/specs_DEPRECATED/modules/NativeAnimatedTurboModule.js +1 -1
- package/src/private/specs_DEPRECATED/modules/NativeSampleTurboModule.js +3 -0
- package/src/private/styles/composeStyles.js +12 -5
- package/src/private/types/HostComponent.js +1 -1
- package/src/private/types/HostInstance.js +67 -1
- package/src/private/webapis/dom/nodes/ReactNativeElement.js +2 -5
- package/src/private/webapis/dom/nodes/ReadOnlyNode.js +5 -18
- package/src/private/webapis/dom/nodes/internals/NodeInternals.js +6 -0
- package/src/private/webapis/performance/Performance.js +1 -3
- package/src/private/webapis/performance/PerformanceEntry.js +6 -1
- package/src/private/webapis/performance/internals/RawPerformanceEntry.js +3 -0
- package/src/private/webapis/performance/specs/NativePerformance.js +10 -1
- package/src/types/globals.d.ts +42 -0
- package/stubs/double-conversion/double-conversion.h +3 -1
- package/templates/cpp-app/template.config.js +2 -1
- package/templates/cpp-app/windows/MyApp/MyApp.vcxproj +4 -0
- package/templates/cpp-lib/example/metro.config.js +1 -1
- package/templates/cpp-lib/windows/MyLib/MyLib.vcxproj +4 -0
- package/templates/old/generateWrapper.js +1 -1
- package/templates/old/uwp-cpp-app/template.config.js +1 -1
- package/types/index.d.ts +6 -3
- package/types/public/ReactNativeTypes.d.ts +2 -2
- package/Libraries/BatchedBridge/__mocks__/MessageQueueTestConfig.js +0 -38
- package/Libraries/BatchedBridge/__mocks__/MessageQueueTestModule.js +0 -22
- package/Libraries/Blob/FileReader_new.js +0 -231
- package/Libraries/Blob/FileReader_old.js +0 -186
- package/Libraries/Blob/__mocks__/FileReaderModule.js +0 -20
- package/Libraries/Components/RefreshControl/__mocks__/RefreshControlMock.js +0 -32
- package/Libraries/Core/__mocks__/ErrorUtils.js +0 -33
- package/Libraries/Core/__mocks__/NativeExceptionsManager.js +0 -19
- package/Libraries/EventEmitter/__mocks__/NativeEventEmitter.js +0 -49
- package/Libraries/Events/CustomEvent.js +0 -32
- package/Libraries/Events/EventPolyfill.js +0 -239
- package/Libraries/Lists/__flowtests__/FlatList-flowtest.js +0 -118
- package/Libraries/Lists/__flowtests__/SectionList-flowtest.js +0 -134
- package/Libraries/Network/XMLHttpRequest_new.js +0 -794
- package/Libraries/Network/XMLHttpRequest_old.js +0 -701
- package/Libraries/NewAppScreen/components/DebugInstructions.js +0 -41
- package/Libraries/NewAppScreen/components/DebugInstructions.windows.js +0 -30
- package/Libraries/NewAppScreen/components/Header.js +0 -77
- package/Libraries/NewAppScreen/components/HermesBadge.js +0 -53
- package/Libraries/NewAppScreen/components/LearnMoreLinks.js +0 -148
- package/Libraries/NewAppScreen/components/ReloadInstructions.js +0 -39
- package/Libraries/NewAppScreen/components/ReloadInstructions.windows.js +0 -31
- package/Libraries/NewAppScreen/components/logo.png +0 -0
- package/Libraries/NewAppScreen/index.js +0 -25
- package/Libraries/StyleSheet/__flowtests__/StyleSheet-flowtest.js +0 -58
- package/Libraries/Utilities/__mocks__/BackHandler.js +0 -45
- package/Libraries/Utilities/__mocks__/GlobalPerformanceLogger.js +0 -16
- package/Libraries/Utilities/__mocks__/PixelRatio.js +0 -25
- package/Libraries/WebSocket/WebSocketEvent.js +0 -30
- package/Libraries/WebSocket/WebSocket_new.js +0 -325
- package/Libraries/WebSocket/WebSocket_old.js +0 -297
- package/Libraries/WebSocket/__mocks__/event-target-shim.js +0 -27
- package/Libraries/__flowtests__/ReactNativeTypes-flowtest.js +0 -30
- package/Libraries/vendor/emitter/__flowtests__/EventEmitter-flowtest.js +0 -81
- package/jest/__tests__/setup-test.js +0 -18
- package/src/private/components/VScrollViewNativeComponents.js +0 -25
- package/src/private/utilities/ensureInstance.js +0 -21
- package/src/private/webapis/performance/specs/__mocks__/NativePerformanceMock.js +0 -267
- package/types/modules/LaunchScreen.d.ts +0 -18
- /package/src/private/{devmenu → devsupport/devmenu}/DevMenu.d.ts +0 -0
- /package/src/private/{debugging → devsupport/rndevtools}/FuseboxSessionObserver.js +0 -0
|
@@ -0,0 +1,210 @@
|
|
|
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
|
|
8
|
+
* @format
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
'use strict';
|
|
12
|
+
|
|
13
|
+
import type {____Styles_Internal} from './StyleSheetTypes';
|
|
14
|
+
|
|
15
|
+
import composeStyles from '../../src/private/styles/composeStyles';
|
|
16
|
+
import flatten from './flattenStyle';
|
|
17
|
+
|
|
18
|
+
const ReactNativeStyleAttributes =
|
|
19
|
+
require('../Components/View/ReactNativeStyleAttributes').default;
|
|
20
|
+
const PixelRatio = require('../Utilities/PixelRatio').default;
|
|
21
|
+
|
|
22
|
+
let hairlineWidth: number = PixelRatio.roundToNearestPixel(0.4);
|
|
23
|
+
if (hairlineWidth === 0) {
|
|
24
|
+
hairlineWidth = 1 / PixelRatio.get();
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const absoluteFill: {
|
|
28
|
+
+bottom: 0,
|
|
29
|
+
+left: 0,
|
|
30
|
+
+position: 'absolute',
|
|
31
|
+
+right: 0,
|
|
32
|
+
+top: 0,
|
|
33
|
+
} = {
|
|
34
|
+
position: 'absolute',
|
|
35
|
+
left: 0,
|
|
36
|
+
right: 0,
|
|
37
|
+
top: 0,
|
|
38
|
+
bottom: 0,
|
|
39
|
+
};
|
|
40
|
+
if (__DEV__) {
|
|
41
|
+
Object.freeze(absoluteFill);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* A StyleSheet is an abstraction similar to CSS StyleSheets
|
|
46
|
+
*
|
|
47
|
+
* Create a new StyleSheet:
|
|
48
|
+
*
|
|
49
|
+
* ```
|
|
50
|
+
* const styles = StyleSheet.create({
|
|
51
|
+
* container: {
|
|
52
|
+
* borderRadius: 4,
|
|
53
|
+
* borderWidth: 0.5,
|
|
54
|
+
* borderColor: '#d6d7da',
|
|
55
|
+
* },
|
|
56
|
+
* title: {
|
|
57
|
+
* fontSize: 19,
|
|
58
|
+
* fontWeight: 'bold',
|
|
59
|
+
* },
|
|
60
|
+
* activeTitle: {
|
|
61
|
+
* color: 'red',
|
|
62
|
+
* },
|
|
63
|
+
* });
|
|
64
|
+
* ```
|
|
65
|
+
*
|
|
66
|
+
* Use a StyleSheet:
|
|
67
|
+
*
|
|
68
|
+
* ```
|
|
69
|
+
* <View style={styles.container}>
|
|
70
|
+
* <Text style={[styles.title, this.props.isActive && styles.activeTitle]} />
|
|
71
|
+
* </View>
|
|
72
|
+
* ```
|
|
73
|
+
*
|
|
74
|
+
* Code quality:
|
|
75
|
+
*
|
|
76
|
+
* - By moving styles away from the render function, you're making the code
|
|
77
|
+
* easier to understand.
|
|
78
|
+
* - Naming the styles is a good way to add meaning to the low level components
|
|
79
|
+
* in the render function, and encourage reuse.
|
|
80
|
+
* - In most IDEs, using `StyleSheet.create()` will offer static type checking
|
|
81
|
+
* and suggestions to help you write valid styles.
|
|
82
|
+
*
|
|
83
|
+
*/
|
|
84
|
+
export default {
|
|
85
|
+
/**
|
|
86
|
+
* This is defined as the width of a thin line on the platform. It can be
|
|
87
|
+
* used as the thickness of a border or division between two elements.
|
|
88
|
+
* Example:
|
|
89
|
+
* ```
|
|
90
|
+
* {
|
|
91
|
+
* borderBottomColor: '#bbb',
|
|
92
|
+
* borderBottomWidth: StyleSheet.hairlineWidth
|
|
93
|
+
* }
|
|
94
|
+
* ```
|
|
95
|
+
*
|
|
96
|
+
* This constant will always be a round number of pixels (so a line defined
|
|
97
|
+
* by it look crisp) and will try to match the standard width of a thin line
|
|
98
|
+
* on the underlying platform. However, you should not rely on it being a
|
|
99
|
+
* constant size, because on different platforms and screen densities its
|
|
100
|
+
* value may be calculated differently.
|
|
101
|
+
*
|
|
102
|
+
* A line with hairline width may not be visible if your simulator is downscaled.
|
|
103
|
+
*/
|
|
104
|
+
hairlineWidth,
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* A very common pattern is to create overlays with position absolute and zero positioning,
|
|
108
|
+
* so `absoluteFill` can be used for convenience and to reduce duplication of these repeated
|
|
109
|
+
* styles.
|
|
110
|
+
*/
|
|
111
|
+
absoluteFill: (absoluteFill: any), // TODO: This should be updated after we fix downstream Flow sites.
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Sometimes you may want `absoluteFill` but with a couple tweaks - `absoluteFillObject` can be
|
|
115
|
+
* used to create a customized entry in a `StyleSheet`, e.g.:
|
|
116
|
+
*
|
|
117
|
+
* const styles = StyleSheet.create({
|
|
118
|
+
* wrapper: {
|
|
119
|
+
* ...StyleSheet.absoluteFillObject,
|
|
120
|
+
* top: 10,
|
|
121
|
+
* backgroundColor: 'transparent',
|
|
122
|
+
* },
|
|
123
|
+
* });
|
|
124
|
+
*/
|
|
125
|
+
absoluteFillObject: absoluteFill,
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Combines two styles such that `style2` will override any styles in `style1`.
|
|
129
|
+
* If either style is falsy, the other one is returned without allocating an
|
|
130
|
+
* array, saving allocations and maintaining reference equality for
|
|
131
|
+
* PureComponent checks.
|
|
132
|
+
*/
|
|
133
|
+
compose: composeStyles,
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Flattens an array of style objects, into one aggregated style object.
|
|
137
|
+
*
|
|
138
|
+
* Example:
|
|
139
|
+
* ```
|
|
140
|
+
* const styles = StyleSheet.create({
|
|
141
|
+
* listItem: {
|
|
142
|
+
* flex: 1,
|
|
143
|
+
* fontSize: 16,
|
|
144
|
+
* color: 'white'
|
|
145
|
+
* },
|
|
146
|
+
* selectedListItem: {
|
|
147
|
+
* color: 'green'
|
|
148
|
+
* }
|
|
149
|
+
* });
|
|
150
|
+
*
|
|
151
|
+
* StyleSheet.flatten([styles.listItem, styles.selectedListItem])
|
|
152
|
+
* // returns { flex: 1, fontSize: 16, color: 'green' }
|
|
153
|
+
* ```
|
|
154
|
+
*/
|
|
155
|
+
flatten,
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* WARNING: EXPERIMENTAL. Breaking changes will probably happen a lot and will
|
|
159
|
+
* not be reliably announced. The whole thing might be deleted, who knows? Use
|
|
160
|
+
* at your own risk.
|
|
161
|
+
*
|
|
162
|
+
* Sets a function to use to pre-process a style property value. This is used
|
|
163
|
+
* internally to process color and transform values. You should not use this
|
|
164
|
+
* unless you really know what you are doing and have exhausted other options.
|
|
165
|
+
*/
|
|
166
|
+
setStyleAttributePreprocessor(
|
|
167
|
+
property: string,
|
|
168
|
+
process: (nextProp: mixed) => mixed,
|
|
169
|
+
) {
|
|
170
|
+
let value;
|
|
171
|
+
|
|
172
|
+
if (ReactNativeStyleAttributes[property] === true) {
|
|
173
|
+
value = {process};
|
|
174
|
+
} else if (typeof ReactNativeStyleAttributes[property] === 'object') {
|
|
175
|
+
value = {...ReactNativeStyleAttributes[property], process};
|
|
176
|
+
} else {
|
|
177
|
+
console.error(`${property} is not a valid style attribute`);
|
|
178
|
+
return;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
if (
|
|
182
|
+
__DEV__ &&
|
|
183
|
+
typeof value.process === 'function' &&
|
|
184
|
+
typeof ReactNativeStyleAttributes[property]?.process === 'function' &&
|
|
185
|
+
value.process !== ReactNativeStyleAttributes[property]?.process
|
|
186
|
+
) {
|
|
187
|
+
console.warn(`Overwriting ${property} style attribute preprocessor`);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
ReactNativeStyleAttributes[property] = value;
|
|
191
|
+
},
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* An identity function for creating style sheets.
|
|
195
|
+
*/
|
|
196
|
+
// $FlowFixMe[unsupported-variance-annotation]
|
|
197
|
+
create<+S: ____Styles_Internal>(obj: S): $ReadOnly<S> {
|
|
198
|
+
// TODO: This should return S as the return type. But first,
|
|
199
|
+
// we need to codemod all the callsites that are typing this
|
|
200
|
+
// return value as a number (even though it was opaque).
|
|
201
|
+
if (__DEV__) {
|
|
202
|
+
for (const key in obj) {
|
|
203
|
+
if (obj[key]) {
|
|
204
|
+
Object.freeze(obj[key]);
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
return obj;
|
|
209
|
+
},
|
|
210
|
+
};
|
|
@@ -0,0 +1,112 @@
|
|
|
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
|
|
8
|
+
* @format
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import type {____Styles_Internal} from './StyleSheetTypes';
|
|
12
|
+
|
|
13
|
+
import composeStyles from '../../src/private/styles/composeStyles';
|
|
14
|
+
import flattenStyle from './flattenStyle';
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* This is defined as the width of a thin line on the platform. It can be
|
|
18
|
+
* used as the thickness of a border or division between two elements.
|
|
19
|
+
* Example:
|
|
20
|
+
* ```
|
|
21
|
+
* {
|
|
22
|
+
* borderBottomColor: '#bbb',
|
|
23
|
+
* borderBottomWidth: StyleSheet.hairlineWidth
|
|
24
|
+
* }
|
|
25
|
+
* ```
|
|
26
|
+
*
|
|
27
|
+
* This constant will always be a round number of pixels (so a line defined
|
|
28
|
+
* by it look crisp) and will try to match the standard width of a thin line
|
|
29
|
+
* on the underlying platform. However, you should not rely on it being a
|
|
30
|
+
* constant size, because on different platforms and screen densities its
|
|
31
|
+
* value may be calculated differently.
|
|
32
|
+
*/
|
|
33
|
+
declare export const hairlineWidth: number;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* A very common pattern is to create overlays with position absolute and zero positioning,
|
|
37
|
+
* so `absoluteFill` can be used for convenience and to reduce duplication of these repeated
|
|
38
|
+
* styles.
|
|
39
|
+
*/
|
|
40
|
+
declare export const absoluteFill: any;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Sometimes you may want `absoluteFill` but with a couple tweaks - `absoluteFillObject` can be
|
|
44
|
+
* used to create a customized entry in a `StyleSheet`, e.g.:
|
|
45
|
+
*
|
|
46
|
+
* const styles = StyleSheet.create({
|
|
47
|
+
* wrapper: {
|
|
48
|
+
* ...StyleSheet.absoluteFillObject,
|
|
49
|
+
* top: 10,
|
|
50
|
+
* backgroundColor: 'transparent',
|
|
51
|
+
* },
|
|
52
|
+
* });
|
|
53
|
+
*/
|
|
54
|
+
declare export const absoluteFillObject: {
|
|
55
|
+
+bottom: 0,
|
|
56
|
+
+left: 0,
|
|
57
|
+
+position: 'absolute',
|
|
58
|
+
+right: 0,
|
|
59
|
+
+top: 0,
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Combines two styles such that style2 will override any styles in style1.
|
|
64
|
+
* If either style is falsy, the other one is returned without allocating
|
|
65
|
+
* an array, saving allocations and maintaining reference equality for
|
|
66
|
+
* PureComponent checks.
|
|
67
|
+
*/
|
|
68
|
+
declare export const compose: typeof composeStyles;
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Flattens an array of style objects, into one aggregated style object.
|
|
72
|
+
*
|
|
73
|
+
* Example:
|
|
74
|
+
* ```
|
|
75
|
+
* const styles = StyleSheet.create({
|
|
76
|
+
* listItem: {
|
|
77
|
+
* flex: 1,
|
|
78
|
+
* fontSize: 16,
|
|
79
|
+
* color: 'white'
|
|
80
|
+
* },
|
|
81
|
+
* selectedListItem: {
|
|
82
|
+
* color: 'green'
|
|
83
|
+
* }
|
|
84
|
+
* });
|
|
85
|
+
*
|
|
86
|
+
* StyleSheet.flatten([styles.listItem, styles.selectedListItem])
|
|
87
|
+
* // returns { flex: 1, fontSize: 16, color: 'green' }
|
|
88
|
+
* ```
|
|
89
|
+
*/
|
|
90
|
+
declare export const flatten: typeof flattenStyle;
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* WARNING: EXPERIMENTAL. Breaking changes will probably happen a lot and will
|
|
94
|
+
* not be reliably announced. The whole thing might be deleted, who knows? Use
|
|
95
|
+
* at your own risk.
|
|
96
|
+
*
|
|
97
|
+
* Sets a function to use to pre-process a style property value. This is used
|
|
98
|
+
* internally to process color and transform values. You should not use this
|
|
99
|
+
* unless you really know what you are doing and have exhausted other options.
|
|
100
|
+
*/
|
|
101
|
+
declare export const setStyleAttributePreprocessor: (
|
|
102
|
+
property: string,
|
|
103
|
+
process: (nextProp: any) => any,
|
|
104
|
+
) => void;
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* An identity function for creating style sheets.
|
|
108
|
+
*/
|
|
109
|
+
// $FlowFixMe[unsupported-variance-annotation]
|
|
110
|
+
declare export const create: <+S: ____Styles_Internal>(
|
|
111
|
+
obj: S & ____Styles_Internal,
|
|
112
|
+
) => $ReadOnly<S>;
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
'use strict';
|
|
12
12
|
|
|
13
|
+
import type {WithAnimatedValue} from '../Animated/createAnimatedComponent';
|
|
13
14
|
import type AnimatedNode from '../Animated/nodes/AnimatedNode';
|
|
14
15
|
import type {ImageResizeMode} from './../Image/ImageResizeMode';
|
|
15
16
|
import type {
|
|
@@ -20,6 +21,9 @@ import type {
|
|
|
20
21
|
____ViewStyle_InternalOverrides,
|
|
21
22
|
} from './private/_StyleSheetTypesOverrides';
|
|
22
23
|
import type {____TransformStyle_Internal} from './private/_TransformStyle';
|
|
24
|
+
import type {ColorValue} from './StyleSheet';
|
|
25
|
+
|
|
26
|
+
export type {____TransformStyle_Internal};
|
|
23
27
|
|
|
24
28
|
declare export opaque type NativeColorValue;
|
|
25
29
|
export type ____ColorValue_Internal = null | string | number | NativeColorValue;
|
|
@@ -35,8 +39,7 @@ export type EdgeInsetsValue = {
|
|
|
35
39
|
bottom: number,
|
|
36
40
|
};
|
|
37
41
|
|
|
38
|
-
export type DimensionValue = number | string | 'auto' |
|
|
39
|
-
export type AnimatableNumericValue = number | AnimatedNode;
|
|
42
|
+
export type DimensionValue = number | string | 'auto' | null;
|
|
40
43
|
|
|
41
44
|
export type CursorValue = 'auto' | 'pointer';
|
|
42
45
|
|
|
@@ -691,7 +694,7 @@ export type ____ShadowStyle_InternalCore = $ReadOnly<{
|
|
|
691
694
|
* Sets the drop shadow opacity (multiplied by the color's alpha component)
|
|
692
695
|
* @platform ios
|
|
693
696
|
*/
|
|
694
|
-
shadowOpacity?:
|
|
697
|
+
shadowOpacity?: number,
|
|
695
698
|
/**
|
|
696
699
|
* Sets the drop shadow blur radius
|
|
697
700
|
* @platform ios
|
|
@@ -723,8 +726,8 @@ export type DropShadowValue = {
|
|
|
723
726
|
color?: ____ColorValue_Internal,
|
|
724
727
|
};
|
|
725
728
|
|
|
726
|
-
|
|
727
|
-
type: '
|
|
729
|
+
type LinearGradientValue = {
|
|
730
|
+
type: 'linear-gradient',
|
|
728
731
|
// Angle or direction enums
|
|
729
732
|
direction?: string,
|
|
730
733
|
colorStops: $ReadOnlyArray<{
|
|
@@ -733,6 +736,50 @@ export type GradientValue = {
|
|
|
733
736
|
}>,
|
|
734
737
|
};
|
|
735
738
|
|
|
739
|
+
type RadialExtent =
|
|
740
|
+
| 'closest-corner'
|
|
741
|
+
| 'closest-side'
|
|
742
|
+
| 'farthest-corner'
|
|
743
|
+
| 'farthest-side';
|
|
744
|
+
export type RadialGradientPosition =
|
|
745
|
+
| {
|
|
746
|
+
top: number | string,
|
|
747
|
+
left: number | string,
|
|
748
|
+
}
|
|
749
|
+
| {
|
|
750
|
+
top: number | string,
|
|
751
|
+
right: number | string,
|
|
752
|
+
}
|
|
753
|
+
| {
|
|
754
|
+
bottom: number | string,
|
|
755
|
+
left: number | string,
|
|
756
|
+
}
|
|
757
|
+
| {
|
|
758
|
+
bottom: number | string,
|
|
759
|
+
right: number | string,
|
|
760
|
+
};
|
|
761
|
+
|
|
762
|
+
export type RadialGradientShape = 'circle' | 'ellipse';
|
|
763
|
+
export type RadialGradientSize =
|
|
764
|
+
| RadialExtent
|
|
765
|
+
| {
|
|
766
|
+
x: string | number,
|
|
767
|
+
y: string | number,
|
|
768
|
+
};
|
|
769
|
+
|
|
770
|
+
type RadialGradientValue = {
|
|
771
|
+
type: 'radial-gradient',
|
|
772
|
+
shape: RadialGradientShape,
|
|
773
|
+
size: RadialGradientSize,
|
|
774
|
+
position: RadialGradientPosition,
|
|
775
|
+
colorStops: $ReadOnlyArray<{
|
|
776
|
+
color: ____ColorValue_Internal,
|
|
777
|
+
positions?: $ReadOnlyArray<string>,
|
|
778
|
+
}>,
|
|
779
|
+
};
|
|
780
|
+
|
|
781
|
+
export type BackgroundImageValue = LinearGradientValue | RadialGradientValue;
|
|
782
|
+
|
|
736
783
|
export type BoxShadowValue = {
|
|
737
784
|
offsetX: number | string,
|
|
738
785
|
offsetY: number | string,
|
|
@@ -760,10 +807,7 @@ type ____BlendMode_Internal =
|
|
|
760
807
|
| 'color'
|
|
761
808
|
| 'luminosity';
|
|
762
809
|
|
|
763
|
-
export type
|
|
764
|
-
...$Exact<____LayoutStyle_Internal>,
|
|
765
|
-
...$Exact<____ShadowStyle_Internal>,
|
|
766
|
-
...$Exact<____TransformStyle_Internal>,
|
|
810
|
+
export type ____ViewStyle_InternalBase = $ReadOnly<{
|
|
767
811
|
backfaceVisibility?: 'visible' | 'hidden',
|
|
768
812
|
backgroundColor?: ____ColorValue_Internal,
|
|
769
813
|
borderColor?: ____ColorValue_Internal,
|
|
@@ -777,42 +821,49 @@ export type ____ViewStyle_InternalCore = $ReadOnly<{
|
|
|
777
821
|
borderBlockColor?: ____ColorValue_Internal,
|
|
778
822
|
borderBlockEndColor?: ____ColorValue_Internal,
|
|
779
823
|
borderBlockStartColor?: ____ColorValue_Internal,
|
|
780
|
-
borderRadius?:
|
|
781
|
-
borderBottomEndRadius?:
|
|
782
|
-
borderBottomLeftRadius?:
|
|
783
|
-
borderBottomRightRadius?:
|
|
784
|
-
borderBottomStartRadius?:
|
|
785
|
-
borderEndEndRadius?:
|
|
786
|
-
borderEndStartRadius?:
|
|
787
|
-
borderStartEndRadius?:
|
|
788
|
-
borderStartStartRadius?:
|
|
789
|
-
borderTopEndRadius?:
|
|
790
|
-
borderTopLeftRadius?:
|
|
791
|
-
borderTopRightRadius?:
|
|
792
|
-
borderTopStartRadius?:
|
|
824
|
+
borderRadius?: number | string,
|
|
825
|
+
borderBottomEndRadius?: number | string,
|
|
826
|
+
borderBottomLeftRadius?: number | string,
|
|
827
|
+
borderBottomRightRadius?: number | string,
|
|
828
|
+
borderBottomStartRadius?: number | string,
|
|
829
|
+
borderEndEndRadius?: number | string,
|
|
830
|
+
borderEndStartRadius?: number | string,
|
|
831
|
+
borderStartEndRadius?: number | string,
|
|
832
|
+
borderStartStartRadius?: number | string,
|
|
833
|
+
borderTopEndRadius?: number | string,
|
|
834
|
+
borderTopLeftRadius?: number | string,
|
|
835
|
+
borderTopRightRadius?: number | string,
|
|
836
|
+
borderTopStartRadius?: number | string,
|
|
793
837
|
borderStyle?: 'solid' | 'dotted' | 'dashed',
|
|
794
|
-
borderWidth?:
|
|
795
|
-
borderBottomWidth?:
|
|
796
|
-
borderEndWidth?:
|
|
797
|
-
borderLeftWidth?:
|
|
798
|
-
borderRightWidth?:
|
|
799
|
-
borderStartWidth?:
|
|
800
|
-
borderTopWidth?:
|
|
801
|
-
opacity?:
|
|
838
|
+
borderWidth?: number,
|
|
839
|
+
borderBottomWidth?: number,
|
|
840
|
+
borderEndWidth?: number,
|
|
841
|
+
borderLeftWidth?: number,
|
|
842
|
+
borderRightWidth?: number,
|
|
843
|
+
borderStartWidth?: number,
|
|
844
|
+
borderTopWidth?: number,
|
|
845
|
+
opacity?: number,
|
|
802
846
|
outlineColor?: ____ColorValue_Internal,
|
|
803
|
-
outlineOffset?:
|
|
847
|
+
outlineOffset?: number,
|
|
804
848
|
outlineStyle?: 'solid' | 'dotted' | 'dashed',
|
|
805
|
-
outlineWidth?:
|
|
849
|
+
outlineWidth?: number,
|
|
806
850
|
elevation?: number,
|
|
807
851
|
pointerEvents?: 'auto' | 'none' | 'box-none' | 'box-only',
|
|
808
852
|
cursor?: CursorValue,
|
|
809
853
|
boxShadow?: $ReadOnlyArray<BoxShadowValue> | string,
|
|
810
854
|
filter?: $ReadOnlyArray<FilterFunction> | string,
|
|
811
855
|
mixBlendMode?: ____BlendMode_Internal,
|
|
812
|
-
experimental_backgroundImage?: $ReadOnlyArray<
|
|
856
|
+
experimental_backgroundImage?: $ReadOnlyArray<BackgroundImageValue> | string,
|
|
813
857
|
isolation?: 'auto' | 'isolate',
|
|
814
858
|
}>;
|
|
815
859
|
|
|
860
|
+
export type ____ViewStyle_InternalCore = $ReadOnly<{
|
|
861
|
+
...$Exact<____LayoutStyle_Internal>,
|
|
862
|
+
...$Exact<____ShadowStyle_Internal>,
|
|
863
|
+
...$Exact<____TransformStyle_Internal>,
|
|
864
|
+
...____ViewStyle_InternalBase,
|
|
865
|
+
}>;
|
|
866
|
+
|
|
816
867
|
export type ____ViewStyle_Internal = $ReadOnly<{
|
|
817
868
|
...____ViewStyle_InternalCore,
|
|
818
869
|
...____ViewStyle_InternalOverrides,
|
|
@@ -867,7 +918,7 @@ export type ____FontWeight_Internal =
|
|
|
867
918
|
| 'heavy'
|
|
868
919
|
| 'black';
|
|
869
920
|
|
|
870
|
-
export type
|
|
921
|
+
export type ____FontVariant_Internal =
|
|
871
922
|
| 'small-caps'
|
|
872
923
|
| 'oldstyle-nums'
|
|
873
924
|
| 'lining-nums'
|
|
@@ -900,11 +951,12 @@ export type ____FontVariantArray_Internal = $ReadOnlyArray<
|
|
|
900
951
|
| 'stylistic-seventeen'
|
|
901
952
|
| 'stylistic-eighteen'
|
|
902
953
|
| 'stylistic-nineteen'
|
|
903
|
-
| 'stylistic-twenty'
|
|
904
|
-
>;
|
|
954
|
+
| 'stylistic-twenty';
|
|
905
955
|
|
|
906
|
-
export type
|
|
907
|
-
|
|
956
|
+
export type ____FontVariantArray_Internal =
|
|
957
|
+
$ReadOnlyArray<____FontVariant_Internal>;
|
|
958
|
+
|
|
959
|
+
type ____TextStyle_InternalBase = $ReadOnly<{
|
|
908
960
|
color?: ____ColorValue_Internal,
|
|
909
961
|
fontFamily?: string,
|
|
910
962
|
fontSize?: number,
|
|
@@ -935,6 +987,11 @@ export type ____TextStyle_InternalCore = $ReadOnly<{
|
|
|
935
987
|
writingDirection?: 'auto' | 'ltr' | 'rtl',
|
|
936
988
|
}>;
|
|
937
989
|
|
|
990
|
+
export type ____TextStyle_InternalCore = $ReadOnly<{
|
|
991
|
+
...$Exact<____ViewStyle_Internal>,
|
|
992
|
+
...____TextStyle_InternalBase,
|
|
993
|
+
}>;
|
|
994
|
+
|
|
938
995
|
export type ____TextStyle_Internal = $ReadOnly<{
|
|
939
996
|
...____TextStyle_InternalCore,
|
|
940
997
|
...____TextStyle_InternalOverrides,
|
|
@@ -945,7 +1002,8 @@ export type ____ImageStyle_InternalCore = $ReadOnly<{
|
|
|
945
1002
|
resizeMode?: ImageResizeMode,
|
|
946
1003
|
objectFit?: 'cover' | 'contain' | 'fill' | 'scale-down' | 'none',
|
|
947
1004
|
tintColor?: ____ColorValue_Internal,
|
|
948
|
-
overlayColor?:
|
|
1005
|
+
overlayColor?: ColorValue,
|
|
1006
|
+
overflow?: 'visible' | 'hidden',
|
|
949
1007
|
}>;
|
|
950
1008
|
|
|
951
1009
|
export type ____ImageStyle_Internal = $ReadOnly<{
|
|
@@ -958,7 +1016,7 @@ export type ____DangerouslyImpreciseStyle_InternalCore = $ReadOnly<{
|
|
|
958
1016
|
resizeMode?: ImageResizeMode,
|
|
959
1017
|
objectFit?: 'cover' | 'contain' | 'fill' | 'scale-down' | 'none',
|
|
960
1018
|
tintColor?: ____ColorValue_Internal,
|
|
961
|
-
overlayColor?:
|
|
1019
|
+
overlayColor?: ColorValue,
|
|
962
1020
|
}>;
|
|
963
1021
|
|
|
964
1022
|
export type ____DangerouslyImpreciseStyle_Internal = $ReadOnly<{
|
|
@@ -967,24 +1025,28 @@ export type ____DangerouslyImpreciseStyle_Internal = $ReadOnly<{
|
|
|
967
1025
|
...
|
|
968
1026
|
}>;
|
|
969
1027
|
|
|
970
|
-
type
|
|
1028
|
+
export type StyleProp<+T> =
|
|
971
1029
|
| null
|
|
972
1030
|
| void
|
|
973
1031
|
| T
|
|
974
1032
|
| false
|
|
975
1033
|
| ''
|
|
976
|
-
| $ReadOnlyArray<
|
|
1034
|
+
| $ReadOnlyArray<StyleProp<T>>;
|
|
977
1035
|
|
|
978
|
-
export type ____DangerouslyImpreciseStyleProp_Internal =
|
|
1036
|
+
export type ____DangerouslyImpreciseStyleProp_Internal = StyleProp<
|
|
979
1037
|
Partial<____DangerouslyImpreciseStyle_Internal>,
|
|
980
1038
|
>;
|
|
981
|
-
|
|
1039
|
+
|
|
1040
|
+
export type ____DangerouslyImpreciseAnimatedStyleProp_Internal =
|
|
1041
|
+
WithAnimatedValue<StyleProp<Partial<____DangerouslyImpreciseStyle_Internal>>>;
|
|
1042
|
+
|
|
1043
|
+
export type ____ViewStyleProp_Internal = StyleProp<
|
|
982
1044
|
$ReadOnly<Partial<____ViewStyle_Internal>>,
|
|
983
1045
|
>;
|
|
984
|
-
export type ____TextStyleProp_Internal =
|
|
1046
|
+
export type ____TextStyleProp_Internal = StyleProp<
|
|
985
1047
|
$ReadOnly<Partial<____TextStyle_Internal>>,
|
|
986
1048
|
>;
|
|
987
|
-
export type ____ImageStyleProp_Internal =
|
|
1049
|
+
export type ____ImageStyleProp_Internal = StyleProp<
|
|
988
1050
|
$ReadOnly<Partial<____ImageStyle_Internal>>,
|
|
989
1051
|
>;
|
|
990
1052
|
|
|
@@ -995,10 +1057,26 @@ export type ____Styles_Internal = {
|
|
|
995
1057
|
...
|
|
996
1058
|
};
|
|
997
1059
|
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1060
|
+
// A depth limiter, to avoid TS2589 in TypeScript. This and
|
|
1061
|
+
// ____FlattenStyleProp_Helper should be considered internal.
|
|
1062
|
+
type FlattenDepthLimiter = [void, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
|
|
1063
|
+
type ____FlattenStyleProp_Helper<
|
|
1064
|
+
+TStyleProp: StyleProp<mixed>,
|
|
1065
|
+
Depth: $Values<FlattenDepthLimiter> = 9,
|
|
1066
|
+
> = Depth extends 0
|
|
1001
1067
|
? empty
|
|
1002
|
-
: TStyleProp extends
|
|
1003
|
-
?
|
|
1004
|
-
: TStyleProp
|
|
1068
|
+
: TStyleProp extends null | void | false | ''
|
|
1069
|
+
? empty
|
|
1070
|
+
: // When TStyleProp is an array, recurse with decremented Depth
|
|
1071
|
+
TStyleProp extends $ReadOnlyArray<infer V>
|
|
1072
|
+
? ____FlattenStyleProp_Helper<
|
|
1073
|
+
V,
|
|
1074
|
+
Depth extends number ? FlattenDepthLimiter[Depth] : 0,
|
|
1075
|
+
>
|
|
1076
|
+
: TStyleProp;
|
|
1077
|
+
|
|
1078
|
+
export type ____FlattenStyleProp_Internal<+TStyleProp: StyleProp<mixed>> =
|
|
1079
|
+
____FlattenStyleProp_Helper<TStyleProp> extends empty
|
|
1080
|
+
? // $FlowFixMe[unclear-type]
|
|
1081
|
+
any
|
|
1082
|
+
: ____FlattenStyleProp_Helper<TStyleProp>;
|
|
@@ -10,13 +10,22 @@
|
|
|
10
10
|
|
|
11
11
|
'use strict';
|
|
12
12
|
|
|
13
|
-
import type
|
|
14
|
-
import type {
|
|
13
|
+
import type AnimatedNode from '../Animated/nodes/AnimatedNode';
|
|
14
|
+
import type {
|
|
15
|
+
____DangerouslyImpreciseAnimatedStyleProp_Internal,
|
|
16
|
+
____FlattenStyleProp_Internal,
|
|
17
|
+
} from './StyleSheetTypes';
|
|
15
18
|
|
|
16
|
-
|
|
19
|
+
type NonAnimatedNodeObject<TStyleProp> = TStyleProp extends AnimatedNode
|
|
20
|
+
? empty
|
|
21
|
+
: TStyleProp;
|
|
22
|
+
|
|
23
|
+
function flattenStyle<
|
|
24
|
+
TStyleProp: ____DangerouslyImpreciseAnimatedStyleProp_Internal,
|
|
25
|
+
>(
|
|
17
26
|
style: ?TStyleProp,
|
|
18
27
|
// $FlowFixMe[underconstrained-implicit-instantiation]
|
|
19
|
-
): ?____FlattenStyleProp_Internal<TStyleProp
|
|
28
|
+
): ?NonAnimatedNodeObject<____FlattenStyleProp_Internal<TStyleProp>> {
|
|
20
29
|
if (style === null || typeof style !== 'object') {
|
|
21
30
|
return undefined;
|
|
22
31
|
}
|
|
@@ -35,6 +44,7 @@ function flattenStyle<TStyleProp: DangerouslyImpreciseStyleProp>(
|
|
|
35
44
|
for (const key in computedStyle) {
|
|
36
45
|
// $FlowFixMe[incompatible-use]
|
|
37
46
|
// $FlowFixMe[invalid-computed-prop]
|
|
47
|
+
// $FlowFixMe[prop-missing]
|
|
38
48
|
result[key] = computedStyle[key];
|
|
39
49
|
}
|
|
40
50
|
}
|