diff --git a/packages/react-native/Libraries/Components/View/ReactNativeStyleAttributes.js b/packages/react-native/Libraries/Components/View/ReactNativeStyleAttributes.js index ba345e117ca..f70b0f04c7b 100644 --- a/packages/react-native/Libraries/Components/View/ReactNativeStyleAttributes.js +++ b/packages/react-native/Libraries/Components/View/ReactNativeStyleAttributes.js @@ -194,7 +194,7 @@ const ReactNativeStyleAttributes: {[string]: AnyAttributeType, ...} = { /** * BackgroundImage */ - experimental_backgroundImage: backgroundImageAttribute, + backgroundImage: backgroundImageAttribute, /** * BackgroundSize diff --git a/packages/react-native/Libraries/Components/View/__tests__/View-itest.js b/packages/react-native/Libraries/Components/View/__tests__/View-itest.js index 934e606a289..8d8e7e69410 100644 --- a/packages/react-native/Libraries/Components/View/__tests__/View-itest.js +++ b/packages/react-native/Libraries/Components/View/__tests__/View-itest.js @@ -335,13 +335,12 @@ describe('', () => { <> | string | undefined; mixBlendMode?: BlendMode | undefined; - experimental_backgroundImage?: - | ReadonlyArray - | string - | undefined; + backgroundImage?: ReadonlyArray | string | undefined; experimental_backgroundSize?: | ReadonlyArray | string diff --git a/packages/react-native/Libraries/StyleSheet/StyleSheetTypes.js b/packages/react-native/Libraries/StyleSheet/StyleSheetTypes.js index dfc047579ff..9fb11e68824 100644 --- a/packages/react-native/Libraries/StyleSheet/StyleSheetTypes.js +++ b/packages/react-native/Libraries/StyleSheet/StyleSheetTypes.js @@ -887,7 +887,7 @@ export type ____ViewStyle_InternalBase = Readonly<{ boxShadow?: ReadonlyArray | string, filter?: ReadonlyArray | string, mixBlendMode?: ____BlendMode_Internal, - experimental_backgroundImage?: ReadonlyArray | string, + backgroundImage?: ReadonlyArray | string, experimental_backgroundSize?: ReadonlyArray | string, experimental_backgroundPosition?: | ReadonlyArray diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewProps.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewProps.kt index 16176a0f29c..ac281c11be2 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewProps.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewProps.kt @@ -72,7 +72,7 @@ public object ViewProps { // Props that affect more than just layout public const val ENABLED: String = "enabled" public const val BACKGROUND_COLOR: String = "backgroundColor" - public const val BACKGROUND_IMAGE: String = "experimental_backgroundImage" + public const val BACKGROUND_IMAGE: String = "backgroundImage" public const val BACKGROUND_SIZE: String = "experimental_backgroundSize" public const val BACKGROUND_POSITION: String = "experimental_backgroundPosition" public const val BACKGROUND_REPEAT: String = "experimental_backgroundRepeat" diff --git a/packages/react-native/ReactCommon/react/renderer/components/view/BaseViewProps.cpp b/packages/react-native/ReactCommon/react/renderer/components/view/BaseViewProps.cpp index 9fe8d764f6a..c0f5584911f 100644 --- a/packages/react-native/ReactCommon/react/renderer/components/view/BaseViewProps.cpp +++ b/packages/react-native/ReactCommon/react/renderer/components/view/BaseViewProps.cpp @@ -223,7 +223,7 @@ BaseViewProps::BaseViewProps( : convertRawProp( context, rawProps, - "experimental_backgroundImage", + "backgroundImage", sourceProps.backgroundImage, {})), backgroundSize( @@ -403,7 +403,7 @@ void BaseViewProps::setProp( switch (hash) { RAW_SET_PROP_SWITCH_CASE_BASIC(opacity); RAW_SET_PROP_SWITCH_CASE_BASIC(backgroundColor); - RAW_SET_PROP_SWITCH_CASE(backgroundImage, "experimental_backgroundImage"); + RAW_SET_PROP_SWITCH_CASE_BASIC(backgroundImage); RAW_SET_PROP_SWITCH_CASE(backgroundSize, "experimental_backgroundSize"); RAW_SET_PROP_SWITCH_CASE( backgroundPosition, "experimental_backgroundPosition"); diff --git a/packages/react-native/ReactCommon/react/renderer/components/view/platform/android/react/renderer/components/view/HostPlatformViewProps.cpp b/packages/react-native/ReactCommon/react/renderer/components/view/platform/android/react/renderer/components/view/HostPlatformViewProps.cpp index e3b17415629..304cfa8c27d 100644 --- a/packages/react-native/ReactCommon/react/renderer/components/view/platform/android/react/renderer/components/view/HostPlatformViewProps.cpp +++ b/packages/react-native/ReactCommon/react/renderer/components/view/platform/android/react/renderer/components/view/HostPlatformViewProps.cpp @@ -625,7 +625,7 @@ folly::dynamic HostPlatformViewProps::getDiffProps( } if (backgroundImage != oldProps->backgroundImage) { - result["experimental_backgroundImage"] = toDynamic(backgroundImage); + result["backgroundImage"] = toDynamic(backgroundImage); } if (mixBlendMode != oldProps->mixBlendMode) { diff --git a/packages/react-native/ReactNativeApi.d.ts b/packages/react-native/ReactNativeApi.d.ts index 48505ca1b82..567e2db03e9 100644 --- a/packages/react-native/ReactNativeApi.d.ts +++ b/packages/react-native/ReactNativeApi.d.ts @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> * * This file was generated by scripts/js-api/build-types/index.js. */ @@ -907,6 +907,7 @@ declare type ____ViewStyle_Internal = Readonly< declare type ____ViewStyle_InternalBase = { readonly backfaceVisibility?: "hidden" | "visible" readonly backgroundColor?: ____ColorValue_Internal + readonly backgroundImage?: ReadonlyArray | string readonly borderBlockColor?: ____ColorValue_Internal readonly borderBlockEndColor?: ____ColorValue_Internal readonly borderBlockStartColor?: ____ColorValue_Internal @@ -1649,6 +1650,7 @@ declare type AttributeType = readonly process?: (arg1: V) => T } declare type AutoCapitalize = "characters" | "none" | "sentences" | "words" +declare type BackgroundImageValue = LinearGradientValue | RadialGradientValue declare type BackHandler = typeof BackHandler declare type BackPressEventName = "backPress" | "hardwareBackPress" declare type BaseKeyboardEvent = { @@ -2925,6 +2927,14 @@ declare type LayoutRectangle = { readonly x: number readonly y: number } +declare type LinearGradientValue = { + colorStops: ReadonlyArray<{ + color: ____ColorValue_Internal + positions?: ReadonlyArray + }> + direction?: string + type: "linear-gradient" +} declare type Linking = typeof Linking declare type LinkingEventDefinitions = { url: [ @@ -3845,6 +3855,45 @@ declare type PushNotificationPermissions = { badge: boolean sound: boolean } +declare type RadialExtent = + | "closest-corner" + | "closest-side" + | "farthest-corner" + | "farthest-side" +declare type RadialGradientPosition = + | { + bottom: number | string + left: number | string + } + | { + bottom: number | string + right: number | string + } + | { + left: number | string + top: number | string + } + | { + right: number | string + top: number | string + } +declare type RadialGradientShape = "circle" | "ellipse" +declare type RadialGradientSize = + | RadialExtent + | { + x: number | string + y: number | string + } +declare type RadialGradientValue = { + colorStops: ReadonlyArray<{ + color: ____ColorValue_Internal + positions?: ReadonlyArray + }> + position: RadialGradientPosition + shape: RadialGradientShape + size: RadialGradientSize + type: "radial-gradient" +} declare type Rationale = { buttonNegative?: string buttonNeutral?: string @@ -5850,18 +5899,18 @@ export { AccessibilityValue, // cf8bcb74 ActionSheetIOS, // b558559e ActionSheetIOSOptions, // 1756eb5a - ActivityIndicator, // b2398ac8 + ActivityIndicator, // 2a0518e9 ActivityIndicatorInstance, // a82dd4e7 - ActivityIndicatorProps, // 410756e8 + ActivityIndicatorProps, // f330d1dc Alert, // 5bf12165 AlertButton, // bf1a3b60 AlertButtonStyle, // ec9fb242 AlertOptions, // a0cdac0f AlertType, // 5ab91217 AndroidKeyboardEvent, // e03becc8 - Animated, // b23fe360 + Animated, // 09c0f98d AppConfig, // 35c0ca70 - AppRegistry, // ce465c83 + AppRegistry, // 7ef8e53a AppState, // 12012be5 AppStateEvent, // 80f034c3 AppStateStatus, // 447e5ef2 @@ -5871,8 +5920,8 @@ export { BackPressEventName, // 4620fb76 BlurEvent, // 4ba4f941 BoxShadowValue, // b679703f - Button, // 2763dfbf - ButtonInstance, // 93fc348a + Button, // d7ffb46e + ButtonInstance, // 3f83f7e7 ButtonProps, // 35ffc98c Clipboard, // 41addb89 CodegenTypes, // ab4986cc @@ -5891,9 +5940,9 @@ export { DimensionsPayload, // 653bc26c DisplayMetrics, // 1dc35cef DisplayMetricsAndroid, // 872e62eb - DrawerLayoutAndroid, // 4dcb4a45 + DrawerLayoutAndroid, // 52018924 DrawerLayoutAndroidInstance, // c0694352 - DrawerLayoutAndroidProps, // 2f0e6568 + DrawerLayoutAndroidProps, // 8dfceaf9 DrawerSlideEvent, // c4ab8fba DropShadowValue, // e9df2606 DynamicColorIOS, // d96c228c @@ -5908,9 +5957,9 @@ export { EventSubscription, // b8d084aa ExtendedExceptionData, // 5a6ccf5a FilterFunction, // bf24c0e3 - FlatList, // cb72efc9 - FlatListInstance, // 8ae5b7be - FlatListProps, // 51cbbb65 + FlatList, // d98f538f + FlatListInstance, // 62941810 + FlatListProps, // deadf762 FocusEvent, // 850f1517 FontVariant, // 7c7558bb GestureResponderEvent, // 14d3e77a @@ -5921,36 +5970,36 @@ export { IEventEmitter, // fbef6131 IOSKeyboardEvent, // e67bfe3a IgnorePattern, // ec6f6ece - Image, // c9d40e0a - ImageBackground, // 1ebf73eb - ImageBackgroundInstance, // 88068b4d - ImageBackgroundProps, // d4ec764b + Image, // c6bb54ac + ImageBackground, // f4c8dcea + ImageBackgroundInstance, // 7c3cd110 + ImageBackgroundProps, // 3b22066a ImageErrorEvent, // 978933f4 ImageInstance, // 9a100753 ImageLoadEvent, // 77f0b718 ImageProgressEventIOS, // 445331a4 - ImageProps, // 75d78475 + ImageProps, // 3765f681 ImagePropsAndroid, // 9fd9bcbb - ImagePropsBase, // 3366fcf2 + ImagePropsBase, // 2cab4147 ImagePropsIOS, // 4a080668 ImageRequireSource, // 681d683b ImageResolvedAssetSource, // f3060931 ImageSize, // 1c47cf88 ImageSource, // 48c7f316 ImageSourcePropType, // bfb5e5c6 - ImageStyle, // ad6a6dee + ImageStyle, // b184020c ImageURISource, // 016eb083 - InputAccessoryView, // 0b924b84 - InputAccessoryViewProps, // ac36060b + InputAccessoryView, // 9695d393 + InputAccessoryViewProps, // d94dc290 InputModeOptions, // 4e8581b9 Insets, // e7fe432a KeyDownEvent, // 5b147614 KeyEvent, // 20fa4267 KeyUpEvent, // 57f832c5 Keyboard, // 49414c97 - KeyboardAvoidingView, // f612e39b - KeyboardAvoidingViewInstance, // 084c1430 - KeyboardAvoidingViewProps, // 8f05bdcc + KeyboardAvoidingView, // 0af358b6 + KeyboardAvoidingViewInstance, // 1a3c8471 + KeyboardAvoidingViewProps, // 83473aa1 KeyboardEvent, // c3f895d4 KeyboardEventEasing, // af4091c8 KeyboardEventName, // 59299ad6 @@ -5975,10 +6024,10 @@ export { MeasureInWindowOnSuccessCallback, // a285f598 MeasureLayoutOnSuccessCallback, // 3592502a MeasureOnSuccessCallback, // 82824e59 - Modal, // 2ae8076c + Modal, // f30cc19f ModalBaseProps, // 71945951 ModalInstance, // d466ce77 - ModalProps, // 96a029e2 + ModalProps, // 4eb5a731 ModalPropsAndroid, // 515fb173 ModalPropsIOS, // 0e13cfcc ModeChangeEvent, // f64bf69d @@ -6013,15 +6062,15 @@ export { PointerEvent, // ff599afe PressabilityConfig, // faab5639 PressabilityEventHandlers, // 0b910091 - Pressable, // 1317b500 + Pressable, // d508cef4 PressableAndroidRippleConfig, // ee32eaca PressableInstance, // eebfe911 - PressableProps, // fa87db54 + PressableProps, // f5bffd11 PressableStateCallbackType, // 9af36561 ProcessedColorValue, // 33f74304 - ProgressBarAndroid, // 5fe46213 + ProgressBarAndroid, // 8ef8ba6a ProgressBarAndroidInstance, // ab545ef1 - ProgressBarAndroidProps, // d83cd71f + ProgressBarAndroidProps, // f31ec709 PublicRootInstance, // 8040afd7 PublicTextInstance, // 6937c7bf PushNotificationEventName, // 84e7e150 @@ -6029,9 +6078,9 @@ export { PushNotificationPermissions, // c2e7ae4f Rationale, // 5df1b1c1 ReactNativeVersion, // abd76827 - RefreshControl, // 36c129c8 - RefreshControlInstance, // be7161ec - RefreshControlProps, // d564221a + RefreshControl, // 48160637 + RefreshControlInstance, // f7d632ba + RefreshControlProps, // b028bb5a RefreshControlPropsAndroid, // 99f64c97 RefreshControlPropsIOS, // 72a36381 Registry, // 6c39216d @@ -6040,27 +6089,27 @@ export { Role, // af7b889d RootTag, // 3cd10504 RootTagContext, // 38bfc8f6 - RootViewStyleProvider, // d4818465 + RootViewStyleProvider, // 8792d506 Runnable, // 594dd93a Runnables, // 4367c557 - SafeAreaView, // 0bfa1f1d + SafeAreaView, // 963d85d0 SafeAreaViewInstance, // 21dba39c ScaledSize, // 07e417c7 ScrollEvent, // d7abdd0a - ScrollResponderType, // 3991d0ad + ScrollResponderType, // 8864c38f ScrollToLocationParamsType, // d7ecdad1 - ScrollView, // f493b5d4 - ScrollViewImperativeMethods, // 2791f991 - ScrollViewInstance, // 8a170aaf - ScrollViewProps, // 346eb88e + ScrollView, // c67a52a8 + ScrollViewImperativeMethods, // b4c3feed + ScrollViewInstance, // 971d4924 + ScrollViewProps, // 3ab71e04 ScrollViewPropsAndroid, // 44210553 ScrollViewPropsIOS, // b7921e26 ScrollViewScrollToOptions, // 3313411e SectionBase, // dca83594 - SectionList, // 876f013f + SectionList, // e4cd2cce SectionListData, // e0d79987 - SectionListInstance, // dbdba666 - SectionListProps, // 8bd0ac05 + SectionListInstance, // 06be7c37 + SectionListProps, // 983ca166 SectionListRenderItem, // 466e3e87 SectionListRenderItemInfo, // d809238e Separators, // 6a45f7e3 @@ -6077,19 +6126,19 @@ export { StatusBarProps, // b72a9127 StatusBarStyle, // 78f53eea StyleProp, // fa0e9b4a - StyleSheet, // fc631571 + StyleSheet, // 29f1b323 SubmitBehavior, // c4ddf490 - Switch, // 135ac108 + Switch, // 370e8ea2 SwitchChangeEvent, // 899635b1 SwitchInstance, // 3c50eec5 - SwitchProps, // 7a40abb7 + SwitchProps, // 61214431 Systrace, // 626d178c TVViewPropsIOS, // 330ce7b5 TargetedEvent, // 16e98910 TaskProvider, // 266dedf2 - Text, // 2cf03c50 + Text, // 17a6c136 TextContentType, // 239b3ecc - TextInput, // 772bbb29 + TextInput, // 8f39debf TextInputAndroidProps, // 3f09ce49 TextInputChangeEvent, // f55eef98 TextInputContentSizeChangeEvent, // a27cd32a @@ -6098,45 +6147,45 @@ export { TextInputIOSProps, // 0d05a855 TextInputInstance, // 5a0c0e0d TextInputKeyPressEvent, // 546c5d07 - TextInputProps, // cf23de8e + TextInputProps, // 899880a2 TextInputSelectionChangeEvent, // e58f2abc TextInputSubmitEditingEvent, // 6bcb2aa5 TextInstance, // 05463a96 TextLayoutEvent, // 3f54186f - TextProps, // 5d931082 - TextStyle, // fe84eb23 + TextProps, // a7822140 + TextStyle, // ab0f32ca ToastAndroid, // 88a8969a Touchable, // b280637f - TouchableHighlight, // 7e5ec9c5 + TouchableHighlight, // 452aa27b TouchableHighlightInstance, // b510c0eb - TouchableHighlightProps, // 09dc3407 - TouchableNativeFeedback, // d18394ba - TouchableNativeFeedbackInstance, // 74dc04e1 - TouchableNativeFeedbackProps, // 98677960 - TouchableOpacity, // 16b54a1a + TouchableHighlightProps, // dc0126c9 + TouchableNativeFeedback, // bee68787 + TouchableNativeFeedbackInstance, // f66604fc + TouchableNativeFeedbackProps, // 91de1ed8 + TouchableOpacity, // 0c1239fd TouchableOpacityInstance, // b186055b - TouchableOpacityProps, // aa6b543f - TouchableWithoutFeedback, // 56a6ea8f - TouchableWithoutFeedbackProps, // 482dfc28 + TouchableOpacityProps, // 4c5af3d2 + TouchableWithoutFeedback, // 8d374ae1 + TouchableWithoutFeedbackProps, // 65c8c30a TransformsStyle, // 65e70f18 TurboModule, // dfe29706 TurboModuleRegistry, // 4ace6db2 UIManager, // a1a7cc01 UTFSequence, // ad625158 Vibration, // 31e4bbf8 - View, // c5b3d5fe + View, // 6b216377 ViewInstance, // ffde5573 - ViewProps, // a50b7cfa + ViewProps, // cbb6c0b5 ViewPropsAndroid, // 03c17367 ViewPropsIOS, // 58ee19bf - ViewStyle, // 00a0f8fb + ViewStyle, // e45056b1 VirtualViewMode, // 6be59722 VirtualizedList, // 68c7345e VirtualizedListInstance, // 423ee7c0 - VirtualizedListProps, // a5458c31 + VirtualizedListProps, // f05a76fd VirtualizedSectionList, // 9fd9cd61 VirtualizedSectionListInstance, // 12b706d5 - VirtualizedSectionListProps, // ef387a8a + VirtualizedSectionListProps, // 283047f7 WrapperComponentProvider, // 4b8c7962 codegenNativeCommands, // 628a7c0a codegenNativeComponent, // 32a1bca6 diff --git a/packages/rn-tester/js/examples/BackgroundImage/BackgroundImageExample.js b/packages/rn-tester/js/examples/BackgroundImage/BackgroundImageExample.js index 4857fed46e6..cab3deb3109 100644 --- a/packages/rn-tester/js/examples/BackgroundImage/BackgroundImageExample.js +++ b/packages/rn-tester/js/examples/BackgroundImage/BackgroundImageExample.js @@ -67,7 +67,7 @@ exports.examples = [ return ( Basic @@ -85,8 +85,7 @@ exports.examples = [ 45deg @@ -95,8 +94,7 @@ exports.examples = [ 90deg @@ -105,8 +103,7 @@ exports.examples = [ 180deg @@ -125,7 +122,7 @@ exports.examples = [ 3 colors 4 colors Rainbow Circle @@ -175,8 +171,7 @@ exports.examples = [ Ellipse @@ -198,7 +193,7 @@ exports.examples = [ style={{ width: 200, height: 200, - experimental_backgroundImage: + backgroundImage: 'linear-gradient(45deg, #ff6b6b 25%, transparent 25%), linear-gradient(-45deg, #4ecdc4 25%, transparent 25%)', experimental_backgroundRepeat: 'repeat', experimental_backgroundSize: '20px 20px', @@ -212,8 +207,7 @@ exports.examples = [ style={{ width: 200, height: 200, - experimental_backgroundImage: - 'linear-gradient(45deg, #ff6b6b, #4ecdc4)', + backgroundImage: 'linear-gradient(45deg, #ff6b6b, #4ecdc4)', experimental_backgroundRepeat: 'space', experimental_backgroundSize: '50px 50px', }} @@ -228,8 +222,7 @@ exports.examples = [ style={{ width: 200, height: 200, - experimental_backgroundImage: - 'linear-gradient(90deg, #a8edea, #fed6e3)', + backgroundImage: 'linear-gradient(90deg, #a8edea, #fed6e3)', experimental_backgroundRepeat: 'round', experimental_backgroundSize: '60px 60px', }} @@ -242,8 +235,7 @@ exports.examples = [ style={{ width: 200, height: 200, - experimental_backgroundImage: - 'radial-gradient(circle, #ffecd2, #fcb69f)', + backgroundImage: 'radial-gradient(circle, #ffecd2, #fcb69f)', experimental_backgroundRepeat: 'no-repeat', experimental_backgroundSize: '100px 100px', backgroundColor: 'purple', @@ -266,8 +258,7 @@ exports.examples = [ center 25% 75% right bottom borderRadius borderWidth + borderColor non uniform borderRadius non uniform borderWidth Linear Gradient @@ -73,7 +73,7 @@ exports.examples = [ return ( @@ -128,8 +127,7 @@ exports.examples = [ return ( @@ -144,7 +142,7 @@ exports.examples = [ @@ -159,7 +157,7 @@ exports.examples = [ @@ -258,7 +254,7 @@ exports.examples = [ return ( ); diff --git a/packages/rn-tester/js/examples/RadialGradient/RadialGradientExample.js b/packages/rn-tester/js/examples/RadialGradient/RadialGradientExample.js index c0c5c2d7be8..34c640610fc 100644 --- a/packages/rn-tester/js/examples/RadialGradient/RadialGradientExample.js +++ b/packages/rn-tester/js/examples/RadialGradient/RadialGradientExample.js @@ -57,7 +57,7 @@ exports.examples = [ return ( Radial Gradient @@ -73,8 +73,7 @@ exports.examples = [ return ( @@ -89,7 +88,7 @@ exports.examples = [ return ( @@ -120,7 +119,7 @@ exports.examples = [ @@ -161,7 +159,7 @@ exports.examples = [ @@ -199,7 +197,7 @@ exports.examples = [ @@ -244,7 +242,7 @@ exports.examples = [