diff --git a/packages/react-native/Libraries/Text/TextNativeComponent.js b/packages/react-native/Libraries/Text/TextNativeComponent.js index 11c869113337..774de082ea52 100644 --- a/packages/react-native/Libraries/Text/TextNativeComponent.js +++ b/packages/react-native/Libraries/Text/TextNativeComponent.js @@ -44,6 +44,7 @@ const textViewConfig = { adjustsFontSizeToFit: true, minimumFontScale: true, textBreakStrategy: true, + textWidthMode: true, onTextLayout: true, dataDetectorType: true, android_hyphenationFrequency: true, diff --git a/packages/react-native/Libraries/Text/TextProps.js b/packages/react-native/Libraries/Text/TextProps.js index 38e9899f2dfc..59364310fe6f 100644 --- a/packages/react-native/Libraries/Text/TextProps.js +++ b/packages/react-native/Libraries/Text/TextProps.js @@ -181,6 +181,15 @@ type TextBaseProps = Readonly<{ */ numberOfLines?: ?number, + /** + * Controls how wrapped text contributes its width to layout. `longest-line` + * uses the width of the longest rendered line instead of the wrapping + * constraint. + * + * @default `'default'` + */ + textWidthMode?: ?('default' | 'longest-line'), + onLayout?: ?(event: LayoutChangeEvent) => unknown, /** Called on long press. */ diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManager.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManager.kt index 66e6f24fbb0a..1a1a0371d278 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManager.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManager.kt @@ -96,6 +96,7 @@ internal object TextLayoutManager { const val PA_KEY_MINIMUM_FONT_SIZE: Int = 6 const val PA_KEY_MAXIMUM_FONT_SIZE: Int = 7 const val PA_KEY_TEXT_ALIGN_VERTICAL: Int = 8 + const val PA_KEY_TEXT_WIDTH_MODE: Int = 9 private val TAG: String = TextLayoutManager::class.java.simpleName @@ -110,6 +111,8 @@ internal object TextLayoutManager { private const val DEFAULT_ADJUST_FONT_SIZE_TO_FIT = false + private const val TEXT_WIDTH_MODE_LONGEST_LINE = "longest-line" + private val tagToSpannableCache = ConcurrentHashMap() // Lazily cached Method for StaticLayout.Builder.setUseBoundsForWidth (API 35+). @@ -1065,21 +1068,48 @@ internal object TextLayoutManager { ) } + var layout = createLayout( + text, + boring, + width, + widthYogaMeasureMode, + includeFontPadding, + textBreakStrategy, + hyphenationFrequency, + alignment, + justificationMode, + ellipsizeMode, + maximumNumberOfLines, + paint, + ) + + if ( + widthYogaMeasureMode == YogaMeasureMode.AT_MOST && + paragraphAttributes.contains(PA_KEY_TEXT_WIDTH_MODE) && + paragraphAttributes.getString(PA_KEY_TEXT_WIDTH_MODE) == TEXT_WIDTH_MODE_LONGEST_LINE + ) { + val lineCount = calculateLineCount(layout, maximumNumberOfLines) + val longestLineWidth = longestLineWidth(layout, lineCount) + val tightenedWidth = max(1, ceil(longestLineWidth).toInt()) + if (tightenedWidth < layout.width) { + layout = + buildLayout( + text, + tightenedWidth, + includeFontPadding, + textBreakStrategy, + hyphenationFrequency, + alignment, + justificationMode, + ellipsizeMode, + maximumNumberOfLines, + paint, + ) + } + } + return CreateLayoutResult( - createLayout( - text, - boring, - width, - widthYogaMeasureMode, - includeFontPadding, - textBreakStrategy, - hyphenationFrequency, - alignment, - justificationMode, - ellipsizeMode, - maximumNumberOfLines, - paint, - ), + layout, textBreakStrategy, justificationMode, ) @@ -1471,6 +1501,18 @@ internal object TextLayoutManager { layout.lineCount else min(maximumNumberOfLines, layout.lineCount) + @VisibleForTesting + internal fun longestLineWidth(layout: Layout, lineCount: Int): Float { + var longestLineWidth = 0f + for (line in 0 until lineCount) { + val lineEnd = layout.getLineEnd(line) + val endsWithNewLine = lineEnd > 0 && layout.text[lineEnd - 1] == '\n' + val lineWidth = if (endsWithNewLine) layout.getLineMax(line) else layout.getLineWidth(line) + longestLineWidth = max(longestLineWidth, lineWidth) + } + return longestLineWidth + } + private fun calculateWidth( layout: Layout, text: Spanned, diff --git a/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/views/text/TextLayoutManagerLongestLineWidthTest.kt b/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/views/text/TextLayoutManagerLongestLineWidthTest.kt new file mode 100644 index 000000000000..49ce97ec717a --- /dev/null +++ b/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/views/text/TextLayoutManagerLongestLineWidthTest.kt @@ -0,0 +1,47 @@ +/* + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +package com.facebook.react.views.text + +import android.text.Layout +import android.text.SpannableString +import android.text.StaticLayout +import android.text.TextPaint +import kotlin.math.ceil +import org.assertj.core.api.Assertions.assertThat +import org.junit.Test +import org.junit.runner.RunWith +import org.robolectric.RobolectricTestRunner +import org.robolectric.annotation.Config + +@RunWith(RobolectricTestRunner::class) +@Config(sdk = [34]) +class TextLayoutManagerLongestLineWidthTest { + + @Test + fun `longest line width tightens a wrapped layout without adding a line`() { + val text = SpannableString("Sitting, Standing,\nRoomscale") + val paint = TextPaint(TextPaint.ANTI_ALIAS_FLAG).apply { textSize = 16f } + val layout = createLayout(text, paint, 20) + + assertThat(layout.lineCount).isGreaterThan(1) + + val tightenedWidth = ceil(TextLayoutManager.longestLineWidth(layout, layout.lineCount)).toInt() + val tightenedLayout = createLayout(text, paint, tightenedWidth) + + assertThat(tightenedWidth).isLessThan(layout.width) + assertThat(tightenedLayout.lineCount).isEqualTo(layout.lineCount) + assertThat(TextLayoutManager.longestLineWidth(tightenedLayout, tightenedLayout.lineCount)) + .isLessThanOrEqualTo(tightenedWidth.toFloat()) + } + + private fun createLayout(text: SpannableString, paint: TextPaint, width: Int): Layout = + StaticLayout.Builder.obtain(text, 0, text.length, paint, width) + .setBreakStrategy(Layout.BREAK_STRATEGY_HIGH_QUALITY) + .setHyphenationFrequency(Layout.HYPHENATION_FREQUENCY_NONE) + .build() +} diff --git a/packages/react-native/ReactCommon/react/renderer/attributedstring/ParagraphAttributes.cpp b/packages/react-native/ReactCommon/react/renderer/attributedstring/ParagraphAttributes.cpp index 4eac922716fb..98992aa2287a 100644 --- a/packages/react-native/ReactCommon/react/renderer/attributedstring/ParagraphAttributes.cpp +++ b/packages/react-native/ReactCommon/react/renderer/attributedstring/ParagraphAttributes.cpp @@ -19,6 +19,7 @@ bool ParagraphAttributes::operator==(const ParagraphAttributes& rhs) const { maximumNumberOfLines, ellipsizeMode, textBreakStrategy, + textWidthMode, adjustsFontSizeToFit, includeFontPadding, android_hyphenationFrequency, @@ -27,6 +28,7 @@ bool ParagraphAttributes::operator==(const ParagraphAttributes& rhs) const { rhs.maximumNumberOfLines, rhs.ellipsizeMode, rhs.textBreakStrategy, + rhs.textWidthMode, rhs.adjustsFontSizeToFit, rhs.includeFontPadding, rhs.android_hyphenationFrequency, @@ -52,6 +54,8 @@ SharedDebugStringConvertibleList ParagraphAttributes::getDebugProps() const { "textBreakStrategy", textBreakStrategy, paragraphAttributes.textBreakStrategy), + debugStringConvertibleItem( + "textWidthMode", textWidthMode, paragraphAttributes.textWidthMode), debugStringConvertibleItem( "adjustsFontSizeToFit", adjustsFontSizeToFit, diff --git a/packages/react-native/ReactCommon/react/renderer/attributedstring/ParagraphAttributes.h b/packages/react-native/ReactCommon/react/renderer/attributedstring/ParagraphAttributes.h index 367ec8c3e0d7..84bda3ade630 100644 --- a/packages/react-native/ReactCommon/react/renderer/attributedstring/ParagraphAttributes.h +++ b/packages/react-native/ReactCommon/react/renderer/attributedstring/ParagraphAttributes.h @@ -46,6 +46,8 @@ class ParagraphAttributes : public DebugStringConvertible { */ TextBreakStrategy textBreakStrategy{TextBreakStrategy::HighQuality}; + TextWidthMode textWidthMode{TextWidthMode::Default}; + /* * Enables font size adjustment to fit constrained boundaries. */ @@ -103,6 +105,7 @@ struct hash { attributes.maximumNumberOfLines, attributes.ellipsizeMode, attributes.textBreakStrategy, + attributes.textWidthMode, attributes.adjustsFontSizeToFit, attributes.minimumFontSize, attributes.maximumFontSize, diff --git a/packages/react-native/ReactCommon/react/renderer/attributedstring/conversions.h b/packages/react-native/ReactCommon/react/renderer/attributedstring/conversions.h index beed96737801..6cb7ac77d2a1 100644 --- a/packages/react-native/ReactCommon/react/renderer/attributedstring/conversions.h +++ b/packages/react-native/ReactCommon/react/renderer/attributedstring/conversions.h @@ -202,6 +202,42 @@ inline void fromRawValue(const PropsParserContext &context, const RawValue &valu result = TextBreakStrategy::HighQuality; } +inline std::string toString(const TextWidthMode &textWidthMode) +{ + switch (textWidthMode) { + case TextWidthMode::Default: + return "default"; + case TextWidthMode::LongestLine: + return "longest-line"; + } + + LOG(ERROR) << "Unsupported TextWidthMode value"; + react_native_expect(false); + return "default"; +} + +inline void fromRawValue(const PropsParserContext & /*context*/, const RawValue &value, TextWidthMode &result) +{ + react_native_expect(value.hasType()); + if (value.hasType()) { + auto string = (std::string)value; + if (string == "default") { + result = TextWidthMode::Default; + } else if (string == "longest-line") { + result = TextWidthMode::LongestLine; + } else { + LOG(ERROR) << "Unsupported TextWidthMode value: " << string; + react_native_expect(false); + result = TextWidthMode::Default; + } + return; + } + + LOG(ERROR) << "Unsupported TextWidthMode type"; + react_native_expect(false); + result = TextWidthMode::Default; +} + inline void fromRawValue(const PropsParserContext &context, const RawValue &value, FontWeight &result) { react_native_expect(value.hasType() || value.hasType()); @@ -1029,6 +1065,12 @@ inline ParagraphAttributes convertRawProp( "textBreakStrategy", sourceParagraphAttributes.textBreakStrategy, defaultParagraphAttributes.textBreakStrategy); + paragraphAttributes.textWidthMode = convertRawProp( + context, + rawProps, + "textWidthMode", + sourceParagraphAttributes.textWidthMode, + defaultParagraphAttributes.textWidthMode); paragraphAttributes.adjustsFontSizeToFit = convertRawProp( context, rawProps, @@ -1158,6 +1200,7 @@ constexpr static MapBuffer::Key PA_KEY_HYPHENATION_FREQUENCY = 5; constexpr static MapBuffer::Key PA_KEY_MINIMUM_FONT_SIZE = 6; constexpr static MapBuffer::Key PA_KEY_MAXIMUM_FONT_SIZE = 7; constexpr static MapBuffer::Key PA_KEY_TEXT_ALIGN_VERTICAL = 8; +constexpr static MapBuffer::Key PA_KEY_TEXT_WIDTH_MODE = 9; inline MapBuffer toMapBuffer(const ParagraphAttributes ¶graphAttributes) { @@ -1165,6 +1208,7 @@ inline MapBuffer toMapBuffer(const ParagraphAttributes ¶graphAttributes) builder.putInt(PA_KEY_MAX_NUMBER_OF_LINES, paragraphAttributes.maximumNumberOfLines); builder.putString(PA_KEY_ELLIPSIZE_MODE, toString(paragraphAttributes.ellipsizeMode)); builder.putString(PA_KEY_TEXT_BREAK_STRATEGY, toString(paragraphAttributes.textBreakStrategy)); + builder.putString(PA_KEY_TEXT_WIDTH_MODE, toString(paragraphAttributes.textWidthMode)); builder.putBool(PA_KEY_ADJUST_FONT_SIZE_TO_FIT, paragraphAttributes.adjustsFontSizeToFit); builder.putBool(PA_KEY_INCLUDE_FONT_PADDING, paragraphAttributes.includeFontPadding); builder.putString(PA_KEY_HYPHENATION_FREQUENCY, toString(paragraphAttributes.android_hyphenationFrequency)); diff --git a/packages/react-native/ReactCommon/react/renderer/attributedstring/primitives.h b/packages/react-native/ReactCommon/react/renderer/attributedstring/primitives.h index 37ad9265edc6..d88bd6c5049b 100644 --- a/packages/react-native/ReactCommon/react/renderer/attributedstring/primitives.h +++ b/packages/react-native/ReactCommon/react/renderer/attributedstring/primitives.h @@ -92,6 +92,11 @@ enum class TextBreakStrategy { Balanced // Balances line lengths. }; +enum class TextWidthMode { + Default, + LongestLine, +}; + enum class TextAlignment { Natural, // Indicates the default alignment for script. Left, // Visually left aligned. diff --git a/packages/react-native/ReactCommon/react/renderer/attributedstring/tests/ParagraphAttributesTest.cpp b/packages/react-native/ReactCommon/react/renderer/attributedstring/tests/ParagraphAttributesTest.cpp index b5d4a47ed1fc..16d267644df7 100644 --- a/packages/react-native/ReactCommon/react/renderer/attributedstring/tests/ParagraphAttributesTest.cpp +++ b/packages/react-native/ReactCommon/react/renderer/attributedstring/tests/ParagraphAttributesTest.cpp @@ -70,4 +70,12 @@ TEST( EXPECT_FALSE(unset == set); } +TEST(ParagraphAttributesTest, testOperatorEqualsIncludesTextWidthMode) { + ParagraphAttributes defaultWidth{}; + ParagraphAttributes longestLineWidth{}; + longestLineWidth.textWidthMode = TextWidthMode::LongestLine; + + EXPECT_FALSE(defaultWidth == longestLineWidth); +} + } // namespace facebook::react diff --git a/packages/react-native/ReactCommon/react/renderer/components/text/BaseParagraphProps.cpp b/packages/react-native/ReactCommon/react/renderer/components/text/BaseParagraphProps.cpp index 9cd9fdbfbc61..db3f632e3a05 100644 --- a/packages/react-native/ReactCommon/react/renderer/components/text/BaseParagraphProps.cpp +++ b/packages/react-native/ReactCommon/react/renderer/components/text/BaseParagraphProps.cpp @@ -80,6 +80,8 @@ void BaseParagraphProps::setProp( paragraphAttributes, textBreakStrategy, "textBreakStrategy"); + REBUILD_FIELD_SWITCH_CASE( + paDefaults, value, paragraphAttributes, textWidthMode, "textWidthMode"); REBUILD_FIELD_SWITCH_CASE( paDefaults, value, diff --git a/packages/react-native/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTTextLayoutManager.mm b/packages/react-native/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTTextLayoutManager.mm index 5f9847a398fa..adadeee91fe5 100644 --- a/packages/react-native/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTTextLayoutManager.mm +++ b/packages/react-native/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTTextLayoutManager.mm @@ -568,7 +568,7 @@ - (TextMeasurement)_measureTextStorage:(NSTextStorage *)textStorage CGRect usedBounds = [layoutManager usedRectForTextContainer:textContainer]; CGSize size = usedBounds.size; - if (textDidWrap) { + if (textDidWrap && paragraphAttributes.textWidthMode == TextWidthMode::Default) { size.width = textContainer.size.width; } diff --git a/packages/react-native/ReactNativeApi.d.ts b/packages/react-native/ReactNativeApi.d.ts index e1654b681c24..2f1a12b7474e 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. */ @@ -4872,6 +4872,7 @@ declare type TextBaseProps = { readonly selectable?: boolean readonly style?: TextStyleProp readonly testID?: string + readonly textWidthMode?: "default" | "longest-line" } declare type TextContentType = | "addressCity" @@ -5756,7 +5757,7 @@ export { AlertOptions, // 8a116d2a AlertType, // 5ab91217 AndroidKeyboardEvent, // e03becc8 - Animated, // b73ca27a + Animated, // 57868d99 AppConfig, // 35c0ca70 AppRegistry, // eb82174d AppState, // 12012be5 @@ -5989,7 +5990,7 @@ export { TVViewPropsIOS, // 330ce7b5 TargetedEvent, // 16e98910 TaskProvider, // 266dedf2 - Text, // 3ccd8020 + Text, // ea238168 TextContentType, // 239b3ecc TextInput, // 89af456b TextInputAndroidProps, // 9ebbc103 @@ -6006,7 +6007,7 @@ export { TextInputSubmitEditingEvent, // 6bcb2aa5 TextInstance, // 05463a96 TextLayoutEvent, // 3f54186f - TextProps, // 2e3336ca + TextProps, // f8e8ca49 TextStyle, // d7678842 ToastAndroid, // 88a8969a TouchableHighlight, // edab1b07 diff --git a/packages/react-native/types_DEPRECATED/Libraries/Text/Text.d.ts b/packages/react-native/types_DEPRECATED/Libraries/Text/Text.d.ts index 25d8d8abe1ef..0fa34d1ae135 100644 --- a/packages/react-native/types_DEPRECATED/Libraries/Text/Text.d.ts +++ b/packages/react-native/types_DEPRECATED/Libraries/Text/Text.d.ts @@ -140,6 +140,11 @@ export interface TextProps */ numberOfLines?: number | undefined; + /** + * Controls how wrapped text contributes its width to layout. + */ + textWidthMode?: 'default' | 'longest-line' | undefined; + /** * Invoked on mount and layout changes with * diff --git a/packages/rn-tester/.maestro/screenshots/text-width-mode-android.png b/packages/rn-tester/.maestro/screenshots/text-width-mode-android.png new file mode 100644 index 000000000000..9eb7bdeaf087 Binary files /dev/null and b/packages/rn-tester/.maestro/screenshots/text-width-mode-android.png differ diff --git a/packages/rn-tester/.maestro/screenshots/text-width-mode-ios.png b/packages/rn-tester/.maestro/screenshots/text-width-mode-ios.png new file mode 100644 index 000000000000..293a2a35985c Binary files /dev/null and b/packages/rn-tester/.maestro/screenshots/text-width-mode-ios.png differ diff --git a/packages/rn-tester/.maestro/text-width-mode.yml b/packages/rn-tester/.maestro/text-width-mode.yml new file mode 100644 index 000000000000..304f636736bc --- /dev/null +++ b/packages/rn-tester/.maestro/text-width-mode.yml @@ -0,0 +1,27 @@ +appId: ${APP_ID} +tags: + - local-screenshot-baseline +--- +- runFlow: ./helpers/launch-app-and-search.yml +- inputText: 'Text' +- assertVisible: + id: 'Text' +- tapOn: + id: 'Text' +- assertVisible: + id: 'example_search' +- tapOn: + id: 'example_search' +- inputText: 'Wrapped text width mode' +- hideKeyboard +- scrollUntilVisible: + element: + id: 'text-width-mode-example' + direction: DOWN + speed: 40 + timeout: 10000 +- assertScreenshot: + path: screenshots/text-width-mode-${maestro.platform} + cropOn: + id: 'text-width-mode-example' + thresholdPercentage: 95 diff --git a/packages/rn-tester/js/examples/Text/TextExample.android.js b/packages/rn-tester/js/examples/Text/TextExample.android.js index a88bef0bac79..feb7d877deb3 100644 --- a/packages/rn-tester/js/examples/Text/TextExample.android.js +++ b/packages/rn-tester/js/examples/Text/TextExample.android.js @@ -17,6 +17,7 @@ import RNTesterText from '../../components/RNTesterText'; import TextLegend from '../../components/TextLegend'; import TextAdjustsDynamicLayoutExample from './TextAdjustsDynamicLayoutExample'; import TextSharedExamples from './TextSharedExamples'; +import TextWidthModeExample from './TextWidthModeExample'; const TextInlineView = require('../../components/TextInlineView'); const React = require('react'); @@ -1336,6 +1337,13 @@ function TextBaseLineLayoutExample(props: {}): React.Node { } const examples = [ + { + title: 'Wrapped text width mode', + name: 'textWidthMode', + description: + 'Compares default constrained text width with text sized to its longest rendered line.', + render: TextWidthModeExample, + }, { title: 'Background Color and Border Width', name: 'background-border-width', diff --git a/packages/rn-tester/js/examples/Text/TextExample.ios.js b/packages/rn-tester/js/examples/Text/TextExample.ios.js index b607c5094c01..603c739cc1c8 100644 --- a/packages/rn-tester/js/examples/Text/TextExample.ios.js +++ b/packages/rn-tester/js/examples/Text/TextExample.ios.js @@ -16,6 +16,7 @@ import hotdog from '../../assets/hotdog.jpg'; import RNTesterText from '../../components/RNTesterText'; import TextLegend from '../../components/TextLegend'; import TextSharedExamples from './TextSharedExamples'; +import TextWidthModeExample from './TextWidthModeExample'; const TextInlineView = require('../../components/TextInlineView'); const React = require('react'); @@ -571,6 +572,13 @@ class TextWithCapBaseBox extends React.Component< } const examples = [ + { + title: 'Wrapped text width mode', + name: 'textWidthMode', + description: + 'Compares default constrained text width with text sized to its longest rendered line.', + render: TextWidthModeExample, + }, { title: 'iOS System Font Families (iOS only)', name: 'iOSSystemFontFamilies', diff --git a/packages/rn-tester/js/examples/Text/TextWidthModeExample.js b/packages/rn-tester/js/examples/Text/TextWidthModeExample.js new file mode 100644 index 000000000000..682051c393a0 --- /dev/null +++ b/packages/rn-tester/js/examples/Text/TextWidthModeExample.js @@ -0,0 +1,79 @@ +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @flow strict-local + * @format + */ + +'use strict'; + +import RNTesterText from '../../components/RNTesterText'; +import * as React from 'react'; +import {ScrollView, StyleSheet, Text, View} from 'react-native'; + +const LABELS = [ + 'Comfort: Moderate', + 'Sitting, Standing, Roomscale', + 'Touch Controllers', +]; + +component TextWidthModeRow(testID: string, textWidthMode?: 'longest-line') { + return ( + + {LABELS.map(label => ( + + + {label} + + + ))} + + ); +} + +export default component TextWidthModeExample() { + return ( + + Default width + + Longest rendered line + + + ); +} + +const styles = StyleSheet.create({ + example: { + gap: 24, + }, + item: { + alignItems: 'flex-start', + flexDirection: 'row', + flexShrink: 1, + maxWidth: 120, + }, + row: { + alignItems: 'flex-start', + flexDirection: 'row', + gap: 16, + }, + text: { + backgroundColor: '#ff8a80', + color: '#111111', + flexShrink: 1, + fontSize: 12, + }, +}); diff --git a/scripts/cxx-api/api-snapshots/ReactAndroidDebugCxx.api b/scripts/cxx-api/api-snapshots/ReactAndroidDebugCxx.api index dbc39b765f3d..eab43b8b6106 100644 --- a/scripts/cxx-api/api-snapshots/ReactAndroidDebugCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactAndroidDebugCxx.api @@ -512,6 +512,7 @@ static constexpr facebook::react::MapBuffer::Key facebook::react::PA_KEY_MAX_NUM static constexpr facebook::react::MapBuffer::Key facebook::react::PA_KEY_MINIMUM_FONT_SIZE; static constexpr facebook::react::MapBuffer::Key facebook::react::PA_KEY_TEXT_ALIGN_VERTICAL; static constexpr facebook::react::MapBuffer::Key facebook::react::PA_KEY_TEXT_BREAK_STRATEGY; +static constexpr facebook::react::MapBuffer::Key facebook::react::PA_KEY_TEXT_WIDTH_MODE; static constexpr facebook::react::MapBuffer::Key facebook::react::TA_KEY_ACCESSIBILITY_ROLE; static constexpr facebook::react::MapBuffer::Key facebook::react::TA_KEY_ALIGNMENT; static constexpr facebook::react::MapBuffer::Key facebook::react::TA_KEY_ALIGNMENT_VERTICAL; @@ -992,6 +993,7 @@ std::string facebook::react::toString(const facebook::react::TextBreakStrategy& std::string facebook::react::toString(const facebook::react::TextDecorationLineType& textDecorationLineType); std::string facebook::react::toString(const facebook::react::TextDecorationStyle& textDecorationStyle); std::string facebook::react::toString(const facebook::react::TextTransform& textTransform); +std::string facebook::react::toString(const facebook::react::TextWidthMode& textWidthMode); std::string facebook::react::toString(const facebook::react::WritingDirection& writingDirection); std::string facebook::react::toString(double doubleValue, char suffix); std::string facebook::react::toString(facebook::react::AccessibilityLiveRegion accessibilityLiveRegion); @@ -1139,6 +1141,7 @@ void facebook::react::fromRawValue(const facebook::react::PropsParserContext&, c void facebook::react::fromRawValue(const facebook::react::PropsParserContext&, const facebook::react::RawValue& value, facebook::react::Size& result); void facebook::react::fromRawValue(const facebook::react::PropsParserContext&, const facebook::react::RawValue& value, facebook::react::SubmitBehavior& result); void facebook::react::fromRawValue(const facebook::react::PropsParserContext&, const facebook::react::RawValue& value, facebook::react::TextAlignmentVertical& result); +void facebook::react::fromRawValue(const facebook::react::PropsParserContext&, const facebook::react::RawValue& value, facebook::react::TextWidthMode& result); void facebook::react::fromRawValue(const facebook::react::PropsParserContext&, const facebook::react::RawValue& value, facebook::react::ValueUnit& result); void facebook::react::fromRawValue(const facebook::react::PropsParserContext&, const facebook::react::RawValue& value, facebook::yoga::BoxSizing& result); void facebook::react::fromRawValue(const facebook::react::PropsParserContext&, const facebook::react::RawValue& value, facebook::yoga::Style::SizeLength& result); @@ -4022,6 +4025,7 @@ class facebook::react::ParagraphAttributes : public facebook::react::DebugString public facebook::react::Float minimumFontSize; public facebook::react::HyphenationFrequency android_hyphenationFrequency; public facebook::react::TextBreakStrategy textBreakStrategy; + public facebook::react::TextWidthMode textWidthMode; public int maximumNumberOfLines; public std::optional textAlignVertical; } @@ -6689,6 +6693,11 @@ enum facebook::react::TextTransform { Uppercase, } +enum facebook::react::TextWidthMode { + Default, + LongestLine, +} + enum facebook::react::TimerSource { RequestAnimationFrame, SetInterval, diff --git a/scripts/cxx-api/api-snapshots/ReactAndroidNewarchCxx.api b/scripts/cxx-api/api-snapshots/ReactAndroidNewarchCxx.api index 2e0f57b22350..cab9928cdbbc 100644 --- a/scripts/cxx-api/api-snapshots/ReactAndroidNewarchCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactAndroidNewarchCxx.api @@ -512,6 +512,7 @@ static constexpr facebook::react::MapBuffer::Key facebook::react::PA_KEY_MAX_NUM static constexpr facebook::react::MapBuffer::Key facebook::react::PA_KEY_MINIMUM_FONT_SIZE; static constexpr facebook::react::MapBuffer::Key facebook::react::PA_KEY_TEXT_ALIGN_VERTICAL; static constexpr facebook::react::MapBuffer::Key facebook::react::PA_KEY_TEXT_BREAK_STRATEGY; +static constexpr facebook::react::MapBuffer::Key facebook::react::PA_KEY_TEXT_WIDTH_MODE; static constexpr facebook::react::MapBuffer::Key facebook::react::TA_KEY_ACCESSIBILITY_ROLE; static constexpr facebook::react::MapBuffer::Key facebook::react::TA_KEY_ALIGNMENT; static constexpr facebook::react::MapBuffer::Key facebook::react::TA_KEY_ALIGNMENT_VERTICAL; @@ -990,6 +991,7 @@ std::string facebook::react::toString(const facebook::react::TextBreakStrategy& std::string facebook::react::toString(const facebook::react::TextDecorationLineType& textDecorationLineType); std::string facebook::react::toString(const facebook::react::TextDecorationStyle& textDecorationStyle); std::string facebook::react::toString(const facebook::react::TextTransform& textTransform); +std::string facebook::react::toString(const facebook::react::TextWidthMode& textWidthMode); std::string facebook::react::toString(const facebook::react::WritingDirection& writingDirection); std::string facebook::react::toString(double doubleValue, char suffix); std::string facebook::react::toString(facebook::react::AccessibilityLiveRegion accessibilityLiveRegion); @@ -1135,6 +1137,7 @@ void facebook::react::fromRawValue(const facebook::react::PropsParserContext&, c void facebook::react::fromRawValue(const facebook::react::PropsParserContext&, const facebook::react::RawValue& value, facebook::react::Size& result); void facebook::react::fromRawValue(const facebook::react::PropsParserContext&, const facebook::react::RawValue& value, facebook::react::SubmitBehavior& result); void facebook::react::fromRawValue(const facebook::react::PropsParserContext&, const facebook::react::RawValue& value, facebook::react::TextAlignmentVertical& result); +void facebook::react::fromRawValue(const facebook::react::PropsParserContext&, const facebook::react::RawValue& value, facebook::react::TextWidthMode& result); void facebook::react::fromRawValue(const facebook::react::PropsParserContext&, const facebook::react::RawValue& value, facebook::react::ValueUnit& result); void facebook::react::fromRawValue(const facebook::react::PropsParserContext&, const facebook::react::RawValue& value, facebook::yoga::BoxSizing& result); void facebook::react::fromRawValue(const facebook::react::PropsParserContext&, const facebook::react::RawValue& value, facebook::yoga::Style::SizeLength& result); @@ -3876,6 +3879,7 @@ class facebook::react::ParagraphAttributes : public facebook::react::DebugString public facebook::react::Float minimumFontSize; public facebook::react::HyphenationFrequency android_hyphenationFrequency; public facebook::react::TextBreakStrategy textBreakStrategy; + public facebook::react::TextWidthMode textWidthMode; public int maximumNumberOfLines; public std::optional textAlignVertical; } @@ -6499,6 +6503,11 @@ enum facebook::react::TextTransform { Uppercase, } +enum facebook::react::TextWidthMode { + Default, + LongestLine, +} + enum facebook::react::TimerSource { RequestAnimationFrame, SetInterval, diff --git a/scripts/cxx-api/api-snapshots/ReactAndroidReleaseCxx.api b/scripts/cxx-api/api-snapshots/ReactAndroidReleaseCxx.api index c057c28b79b9..0c0ae1ea8f1a 100644 --- a/scripts/cxx-api/api-snapshots/ReactAndroidReleaseCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactAndroidReleaseCxx.api @@ -512,6 +512,7 @@ static constexpr facebook::react::MapBuffer::Key facebook::react::PA_KEY_MAX_NUM static constexpr facebook::react::MapBuffer::Key facebook::react::PA_KEY_MINIMUM_FONT_SIZE; static constexpr facebook::react::MapBuffer::Key facebook::react::PA_KEY_TEXT_ALIGN_VERTICAL; static constexpr facebook::react::MapBuffer::Key facebook::react::PA_KEY_TEXT_BREAK_STRATEGY; +static constexpr facebook::react::MapBuffer::Key facebook::react::PA_KEY_TEXT_WIDTH_MODE; static constexpr facebook::react::MapBuffer::Key facebook::react::TA_KEY_ACCESSIBILITY_ROLE; static constexpr facebook::react::MapBuffer::Key facebook::react::TA_KEY_ALIGNMENT; static constexpr facebook::react::MapBuffer::Key facebook::react::TA_KEY_ALIGNMENT_VERTICAL; @@ -992,6 +993,7 @@ std::string facebook::react::toString(const facebook::react::TextBreakStrategy& std::string facebook::react::toString(const facebook::react::TextDecorationLineType& textDecorationLineType); std::string facebook::react::toString(const facebook::react::TextDecorationStyle& textDecorationStyle); std::string facebook::react::toString(const facebook::react::TextTransform& textTransform); +std::string facebook::react::toString(const facebook::react::TextWidthMode& textWidthMode); std::string facebook::react::toString(const facebook::react::WritingDirection& writingDirection); std::string facebook::react::toString(double doubleValue, char suffix); std::string facebook::react::toString(facebook::react::AccessibilityLiveRegion accessibilityLiveRegion); @@ -1139,6 +1141,7 @@ void facebook::react::fromRawValue(const facebook::react::PropsParserContext&, c void facebook::react::fromRawValue(const facebook::react::PropsParserContext&, const facebook::react::RawValue& value, facebook::react::Size& result); void facebook::react::fromRawValue(const facebook::react::PropsParserContext&, const facebook::react::RawValue& value, facebook::react::SubmitBehavior& result); void facebook::react::fromRawValue(const facebook::react::PropsParserContext&, const facebook::react::RawValue& value, facebook::react::TextAlignmentVertical& result); +void facebook::react::fromRawValue(const facebook::react::PropsParserContext&, const facebook::react::RawValue& value, facebook::react::TextWidthMode& result); void facebook::react::fromRawValue(const facebook::react::PropsParserContext&, const facebook::react::RawValue& value, facebook::react::ValueUnit& result); void facebook::react::fromRawValue(const facebook::react::PropsParserContext&, const facebook::react::RawValue& value, facebook::yoga::BoxSizing& result); void facebook::react::fromRawValue(const facebook::react::PropsParserContext&, const facebook::react::RawValue& value, facebook::yoga::Style::SizeLength& result); @@ -4019,6 +4022,7 @@ class facebook::react::ParagraphAttributes : public facebook::react::DebugString public facebook::react::Float minimumFontSize; public facebook::react::HyphenationFrequency android_hyphenationFrequency; public facebook::react::TextBreakStrategy textBreakStrategy; + public facebook::react::TextWidthMode textWidthMode; public int maximumNumberOfLines; public std::optional textAlignVertical; } @@ -6680,6 +6684,11 @@ enum facebook::react::TextTransform { Uppercase, } +enum facebook::react::TextWidthMode { + Default, + LongestLine, +} + enum facebook::react::TimerSource { RequestAnimationFrame, SetInterval, diff --git a/scripts/cxx-api/api-snapshots/ReactAppleDebugCxx.api b/scripts/cxx-api/api-snapshots/ReactAppleDebugCxx.api index c23703c476a3..d7681157deba 100644 --- a/scripts/cxx-api/api-snapshots/ReactAppleDebugCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactAppleDebugCxx.api @@ -3838,6 +3838,7 @@ std::string facebook::react::toString(const facebook::react::TextBreakStrategy& std::string facebook::react::toString(const facebook::react::TextDecorationLineType& textDecorationLineType); std::string facebook::react::toString(const facebook::react::TextDecorationStyle& textDecorationStyle); std::string facebook::react::toString(const facebook::react::TextTransform& textTransform); +std::string facebook::react::toString(const facebook::react::TextWidthMode& textWidthMode); std::string facebook::react::toString(const facebook::react::WritingDirection& writingDirection); std::string facebook::react::toString(double doubleValue, char suffix); std::string facebook::react::toString(facebook::react::AccessibilityLiveRegion accessibilityLiveRegion); @@ -3986,6 +3987,7 @@ void facebook::react::fromRawValue(const facebook::react::PropsParserContext&, c void facebook::react::fromRawValue(const facebook::react::PropsParserContext&, const facebook::react::RawValue& value, facebook::react::Size& result); void facebook::react::fromRawValue(const facebook::react::PropsParserContext&, const facebook::react::RawValue& value, facebook::react::SubmitBehavior& result); void facebook::react::fromRawValue(const facebook::react::PropsParserContext&, const facebook::react::RawValue& value, facebook::react::TextAlignmentVertical& result); +void facebook::react::fromRawValue(const facebook::react::PropsParserContext&, const facebook::react::RawValue& value, facebook::react::TextWidthMode& result); void facebook::react::fromRawValue(const facebook::react::PropsParserContext&, const facebook::react::RawValue& value, facebook::react::ValueUnit& result); void facebook::react::fromRawValue(const facebook::react::PropsParserContext&, const facebook::react::RawValue& value, facebook::yoga::BoxSizing& result); void facebook::react::fromRawValue(const facebook::react::PropsParserContext&, const facebook::react::RawValue& value, facebook::yoga::Style::SizeLength& result); @@ -6221,6 +6223,7 @@ class facebook::react::ParagraphAttributes : public facebook::react::DebugString public facebook::react::Float minimumFontSize; public facebook::react::HyphenationFrequency android_hyphenationFrequency; public facebook::react::TextBreakStrategy textBreakStrategy; + public facebook::react::TextWidthMode textWidthMode; public int maximumNumberOfLines; public std::optional textAlignVertical; } @@ -8872,6 +8875,11 @@ enum facebook::react::TextTransform { Uppercase, } +enum facebook::react::TextWidthMode { + Default, + LongestLine, +} + enum facebook::react::TimerSource { RequestAnimationFrame, SetInterval, diff --git a/scripts/cxx-api/api-snapshots/ReactAppleNewarchCxx.api b/scripts/cxx-api/api-snapshots/ReactAppleNewarchCxx.api index 95f5e8b375fc..fcb694cd5fed 100644 --- a/scripts/cxx-api/api-snapshots/ReactAppleNewarchCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactAppleNewarchCxx.api @@ -3828,6 +3828,7 @@ std::string facebook::react::toString(const facebook::react::TextBreakStrategy& std::string facebook::react::toString(const facebook::react::TextDecorationLineType& textDecorationLineType); std::string facebook::react::toString(const facebook::react::TextDecorationStyle& textDecorationStyle); std::string facebook::react::toString(const facebook::react::TextTransform& textTransform); +std::string facebook::react::toString(const facebook::react::TextWidthMode& textWidthMode); std::string facebook::react::toString(const facebook::react::WritingDirection& writingDirection); std::string facebook::react::toString(double doubleValue, char suffix); std::string facebook::react::toString(facebook::react::AccessibilityLiveRegion accessibilityLiveRegion); @@ -3975,6 +3976,7 @@ void facebook::react::fromRawValue(const facebook::react::PropsParserContext&, c void facebook::react::fromRawValue(const facebook::react::PropsParserContext&, const facebook::react::RawValue& value, facebook::react::Size& result); void facebook::react::fromRawValue(const facebook::react::PropsParserContext&, const facebook::react::RawValue& value, facebook::react::SubmitBehavior& result); void facebook::react::fromRawValue(const facebook::react::PropsParserContext&, const facebook::react::RawValue& value, facebook::react::TextAlignmentVertical& result); +void facebook::react::fromRawValue(const facebook::react::PropsParserContext&, const facebook::react::RawValue& value, facebook::react::TextWidthMode& result); void facebook::react::fromRawValue(const facebook::react::PropsParserContext&, const facebook::react::RawValue& value, facebook::react::ValueUnit& result); void facebook::react::fromRawValue(const facebook::react::PropsParserContext&, const facebook::react::RawValue& value, facebook::yoga::BoxSizing& result); void facebook::react::fromRawValue(const facebook::react::PropsParserContext&, const facebook::react::RawValue& value, facebook::yoga::Style::SizeLength& result); @@ -6107,6 +6109,7 @@ class facebook::react::ParagraphAttributes : public facebook::react::DebugString public facebook::react::Float minimumFontSize; public facebook::react::HyphenationFrequency android_hyphenationFrequency; public facebook::react::TextBreakStrategy textBreakStrategy; + public facebook::react::TextWidthMode textWidthMode; public int maximumNumberOfLines; public std::optional textAlignVertical; } @@ -8714,6 +8717,11 @@ enum facebook::react::TextTransform { Uppercase, } +enum facebook::react::TextWidthMode { + Default, + LongestLine, +} + enum facebook::react::TimerSource { RequestAnimationFrame, SetInterval, diff --git a/scripts/cxx-api/api-snapshots/ReactAppleReleaseCxx.api b/scripts/cxx-api/api-snapshots/ReactAppleReleaseCxx.api index 9e9d12b2d5f0..5e82b53248cb 100644 --- a/scripts/cxx-api/api-snapshots/ReactAppleReleaseCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactAppleReleaseCxx.api @@ -3838,6 +3838,7 @@ std::string facebook::react::toString(const facebook::react::TextBreakStrategy& std::string facebook::react::toString(const facebook::react::TextDecorationLineType& textDecorationLineType); std::string facebook::react::toString(const facebook::react::TextDecorationStyle& textDecorationStyle); std::string facebook::react::toString(const facebook::react::TextTransform& textTransform); +std::string facebook::react::toString(const facebook::react::TextWidthMode& textWidthMode); std::string facebook::react::toString(const facebook::react::WritingDirection& writingDirection); std::string facebook::react::toString(double doubleValue, char suffix); std::string facebook::react::toString(facebook::react::AccessibilityLiveRegion accessibilityLiveRegion); @@ -3986,6 +3987,7 @@ void facebook::react::fromRawValue(const facebook::react::PropsParserContext&, c void facebook::react::fromRawValue(const facebook::react::PropsParserContext&, const facebook::react::RawValue& value, facebook::react::Size& result); void facebook::react::fromRawValue(const facebook::react::PropsParserContext&, const facebook::react::RawValue& value, facebook::react::SubmitBehavior& result); void facebook::react::fromRawValue(const facebook::react::PropsParserContext&, const facebook::react::RawValue& value, facebook::react::TextAlignmentVertical& result); +void facebook::react::fromRawValue(const facebook::react::PropsParserContext&, const facebook::react::RawValue& value, facebook::react::TextWidthMode& result); void facebook::react::fromRawValue(const facebook::react::PropsParserContext&, const facebook::react::RawValue& value, facebook::react::ValueUnit& result); void facebook::react::fromRawValue(const facebook::react::PropsParserContext&, const facebook::react::RawValue& value, facebook::yoga::BoxSizing& result); void facebook::react::fromRawValue(const facebook::react::PropsParserContext&, const facebook::react::RawValue& value, facebook::yoga::Style::SizeLength& result); @@ -6218,6 +6220,7 @@ class facebook::react::ParagraphAttributes : public facebook::react::DebugString public facebook::react::Float minimumFontSize; public facebook::react::HyphenationFrequency android_hyphenationFrequency; public facebook::react::TextBreakStrategy textBreakStrategy; + public facebook::react::TextWidthMode textWidthMode; public int maximumNumberOfLines; public std::optional textAlignVertical; } @@ -8863,6 +8866,11 @@ enum facebook::react::TextTransform { Uppercase, } +enum facebook::react::TextWidthMode { + Default, + LongestLine, +} + enum facebook::react::TimerSource { RequestAnimationFrame, SetInterval, diff --git a/scripts/cxx-api/api-snapshots/ReactCommonDebugCxx.api b/scripts/cxx-api/api-snapshots/ReactCommonDebugCxx.api index 97903e19cc4c..418fd46b085a 100644 --- a/scripts/cxx-api/api-snapshots/ReactCommonDebugCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactCommonDebugCxx.api @@ -563,6 +563,7 @@ std::string facebook::react::toString(const facebook::react::TextBreakStrategy& std::string facebook::react::toString(const facebook::react::TextDecorationLineType& textDecorationLineType); std::string facebook::react::toString(const facebook::react::TextDecorationStyle& textDecorationStyle); std::string facebook::react::toString(const facebook::react::TextTransform& textTransform); +std::string facebook::react::toString(const facebook::react::TextWidthMode& textWidthMode); std::string facebook::react::toString(const facebook::react::WritingDirection& writingDirection); std::string facebook::react::toString(double doubleValue, char suffix); std::string facebook::react::toString(facebook::react::AccessibilityLiveRegion accessibilityLiveRegion); @@ -698,6 +699,7 @@ void facebook::react::fromRawValue(const facebook::react::PropsParserContext&, c void facebook::react::fromRawValue(const facebook::react::PropsParserContext&, const facebook::react::RawValue& value, facebook::react::Size& result); void facebook::react::fromRawValue(const facebook::react::PropsParserContext&, const facebook::react::RawValue& value, facebook::react::SubmitBehavior& result); void facebook::react::fromRawValue(const facebook::react::PropsParserContext&, const facebook::react::RawValue& value, facebook::react::TextAlignmentVertical& result); +void facebook::react::fromRawValue(const facebook::react::PropsParserContext&, const facebook::react::RawValue& value, facebook::react::TextWidthMode& result); void facebook::react::fromRawValue(const facebook::react::PropsParserContext&, const facebook::react::RawValue& value, facebook::react::ValueUnit& result); void facebook::react::fromRawValue(const facebook::react::PropsParserContext&, const facebook::react::RawValue& value, facebook::yoga::BoxSizing& result); void facebook::react::fromRawValue(const facebook::react::PropsParserContext&, const facebook::react::RawValue& value, facebook::yoga::Style::SizeLength& result); @@ -2636,6 +2638,7 @@ class facebook::react::ParagraphAttributes : public facebook::react::DebugString public facebook::react::EllipsizeMode ellipsizeMode; public facebook::react::HyphenationFrequency android_hyphenationFrequency; public facebook::react::TextBreakStrategy textBreakStrategy; + public facebook::react::TextWidthMode textWidthMode; public int maximumNumberOfLines; public std::optional textAlignVertical; } @@ -5010,6 +5013,11 @@ enum facebook::react::TextTransform { Uppercase, } +enum facebook::react::TextWidthMode { + Default, + LongestLine, +} + enum facebook::react::TimerSource { RequestAnimationFrame, SetInterval, diff --git a/scripts/cxx-api/api-snapshots/ReactCommonNewarchCxx.api b/scripts/cxx-api/api-snapshots/ReactCommonNewarchCxx.api index 48a176dc7040..f9ea5eae0771 100644 --- a/scripts/cxx-api/api-snapshots/ReactCommonNewarchCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactCommonNewarchCxx.api @@ -561,6 +561,7 @@ std::string facebook::react::toString(const facebook::react::TextBreakStrategy& std::string facebook::react::toString(const facebook::react::TextDecorationLineType& textDecorationLineType); std::string facebook::react::toString(const facebook::react::TextDecorationStyle& textDecorationStyle); std::string facebook::react::toString(const facebook::react::TextTransform& textTransform); +std::string facebook::react::toString(const facebook::react::TextWidthMode& textWidthMode); std::string facebook::react::toString(const facebook::react::WritingDirection& writingDirection); std::string facebook::react::toString(double doubleValue, char suffix); std::string facebook::react::toString(facebook::react::AccessibilityLiveRegion accessibilityLiveRegion); @@ -695,6 +696,7 @@ void facebook::react::fromRawValue(const facebook::react::PropsParserContext&, c void facebook::react::fromRawValue(const facebook::react::PropsParserContext&, const facebook::react::RawValue& value, facebook::react::Size& result); void facebook::react::fromRawValue(const facebook::react::PropsParserContext&, const facebook::react::RawValue& value, facebook::react::SubmitBehavior& result); void facebook::react::fromRawValue(const facebook::react::PropsParserContext&, const facebook::react::RawValue& value, facebook::react::TextAlignmentVertical& result); +void facebook::react::fromRawValue(const facebook::react::PropsParserContext&, const facebook::react::RawValue& value, facebook::react::TextWidthMode& result); void facebook::react::fromRawValue(const facebook::react::PropsParserContext&, const facebook::react::RawValue& value, facebook::react::ValueUnit& result); void facebook::react::fromRawValue(const facebook::react::PropsParserContext&, const facebook::react::RawValue& value, facebook::yoga::BoxSizing& result); void facebook::react::fromRawValue(const facebook::react::PropsParserContext&, const facebook::react::RawValue& value, facebook::yoga::Style::SizeLength& result); @@ -2530,6 +2532,7 @@ class facebook::react::ParagraphAttributes : public facebook::react::DebugString public facebook::react::EllipsizeMode ellipsizeMode; public facebook::react::HyphenationFrequency android_hyphenationFrequency; public facebook::react::TextBreakStrategy textBreakStrategy; + public facebook::react::TextWidthMode textWidthMode; public int maximumNumberOfLines; public std::optional textAlignVertical; } @@ -4860,6 +4863,11 @@ enum facebook::react::TextTransform { Uppercase, } +enum facebook::react::TextWidthMode { + Default, + LongestLine, +} + enum facebook::react::TimerSource { RequestAnimationFrame, SetInterval, diff --git a/scripts/cxx-api/api-snapshots/ReactCommonReleaseCxx.api b/scripts/cxx-api/api-snapshots/ReactCommonReleaseCxx.api index 3eef4b97c942..1081546cfe27 100644 --- a/scripts/cxx-api/api-snapshots/ReactCommonReleaseCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactCommonReleaseCxx.api @@ -563,6 +563,7 @@ std::string facebook::react::toString(const facebook::react::TextBreakStrategy& std::string facebook::react::toString(const facebook::react::TextDecorationLineType& textDecorationLineType); std::string facebook::react::toString(const facebook::react::TextDecorationStyle& textDecorationStyle); std::string facebook::react::toString(const facebook::react::TextTransform& textTransform); +std::string facebook::react::toString(const facebook::react::TextWidthMode& textWidthMode); std::string facebook::react::toString(const facebook::react::WritingDirection& writingDirection); std::string facebook::react::toString(double doubleValue, char suffix); std::string facebook::react::toString(facebook::react::AccessibilityLiveRegion accessibilityLiveRegion); @@ -698,6 +699,7 @@ void facebook::react::fromRawValue(const facebook::react::PropsParserContext&, c void facebook::react::fromRawValue(const facebook::react::PropsParserContext&, const facebook::react::RawValue& value, facebook::react::Size& result); void facebook::react::fromRawValue(const facebook::react::PropsParserContext&, const facebook::react::RawValue& value, facebook::react::SubmitBehavior& result); void facebook::react::fromRawValue(const facebook::react::PropsParserContext&, const facebook::react::RawValue& value, facebook::react::TextAlignmentVertical& result); +void facebook::react::fromRawValue(const facebook::react::PropsParserContext&, const facebook::react::RawValue& value, facebook::react::TextWidthMode& result); void facebook::react::fromRawValue(const facebook::react::PropsParserContext&, const facebook::react::RawValue& value, facebook::react::ValueUnit& result); void facebook::react::fromRawValue(const facebook::react::PropsParserContext&, const facebook::react::RawValue& value, facebook::yoga::BoxSizing& result); void facebook::react::fromRawValue(const facebook::react::PropsParserContext&, const facebook::react::RawValue& value, facebook::yoga::Style::SizeLength& result); @@ -2633,6 +2635,7 @@ class facebook::react::ParagraphAttributes : public facebook::react::DebugString public facebook::react::EllipsizeMode ellipsizeMode; public facebook::react::HyphenationFrequency android_hyphenationFrequency; public facebook::react::TextBreakStrategy textBreakStrategy; + public facebook::react::TextWidthMode textWidthMode; public int maximumNumberOfLines; public std::optional textAlignVertical; } @@ -5001,6 +5004,11 @@ enum facebook::react::TextTransform { Uppercase, } +enum facebook::react::TextWidthMode { + Default, + LongestLine, +} + enum facebook::react::TimerSource { RequestAnimationFrame, SetInterval,