react-native 0.73.0-rc.7 → 0.73.0

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.
@@ -13,5 +13,5 @@ exports.version = {
13
13
  major: 0,
14
14
  minor: 73,
15
15
  patch: 0,
16
- prerelease: 'rc.7',
16
+ prerelease: null,
17
17
  };
@@ -24,7 +24,7 @@ NSDictionary* RCTGetReactNativeVersion(void)
24
24
  RCTVersionMajor: @(0),
25
25
  RCTVersionMinor: @(73),
26
26
  RCTVersionPatch: @(0),
27
- RCTVersionPrerelease: @"rc.7",
27
+ RCTVersionPrerelease: [NSNull null],
28
28
  };
29
29
  });
30
30
  return __rnVersion;
@@ -1,4 +1,4 @@
1
- VERSION_NAME=0.73.0-rc.7
1
+ VERSION_NAME=0.73.0
2
2
  react.internal.publishingGroup=com.facebook.react
3
3
 
4
4
  android.useAndroidX=true
@@ -18,5 +18,5 @@ public class ReactNativeVersion {
18
18
  "major", 0,
19
19
  "minor", 73,
20
20
  "patch", 0,
21
- "prerelease", "rc.7");
21
+ "prerelease", null);
22
22
  }
@@ -75,16 +75,6 @@ public abstract class ReactTextAnchorViewManager<T extends View, C extends React
75
75
  view.setAdjustFontSizeToFit(adjustsFontSizeToFit);
76
76
  }
77
77
 
78
- @ReactProp(name = ViewProps.ALLOW_FONT_SCALING, defaultBoolean = true)
79
- public void setAllowFontScaling(ReactTextView view, boolean allowFontScaling) {
80
- view.setAllowFontScaling(allowFontScaling);
81
- }
82
-
83
- @ReactProp(name = ViewProps.MAX_FONT_SIZE_MULTIPLIER, defaultFloat = Float.NaN)
84
- public void setMaxFontSizeMultiplier(ReactTextView view, float maxFontSizeMultiplier) {
85
- view.setMaxFontSizeMultiplier(maxFontSizeMultiplier);
86
- }
87
-
88
78
  @ReactProp(name = ViewProps.FONT_SIZE)
89
79
  public void setFontSize(ReactTextView view, float fontSize) {
90
80
  view.setFontSize(fontSize);
@@ -58,6 +58,8 @@ public class ReactTextView extends AppCompatTextView implements ReactCompoundVie
58
58
  private int mNumberOfLines;
59
59
  private TextUtils.TruncateAt mEllipsizeLocation;
60
60
  private boolean mAdjustsFontSizeToFit;
61
+ private float mFontSize = Float.NaN;
62
+ private float mLetterSpacing = Float.NaN;
61
63
  private int mLinkifyMaskType;
62
64
  private boolean mNotifyOnInlineViewLayout;
63
65
  private boolean mTextIsSelectable;
@@ -65,12 +67,6 @@ public class ReactTextView extends AppCompatTextView implements ReactCompoundVie
65
67
  private ReactViewBackgroundManager mReactBackgroundManager;
66
68
  private Spannable mSpanned;
67
69
 
68
- /**
69
- * Used to collect some text size affecting attributes to fix some text cut-off issues when users
70
- * adjust text size and font weight to the max value in system font settings.
71
- */
72
- private TextAttributes mTextAttributes;
73
-
74
70
  public ReactTextView(Context context) {
75
71
  super(context);
76
72
 
@@ -102,7 +98,6 @@ public class ReactTextView extends AppCompatTextView implements ReactCompoundVie
102
98
  mEllipsizeLocation = TextUtils.TruncateAt.END;
103
99
 
104
100
  mSpanned = null;
105
- mTextAttributes = new TextAttributes();
106
101
  }
107
102
 
108
103
  /* package */ void recycleView() {
@@ -592,6 +587,29 @@ public class ReactTextView extends AppCompatTextView implements ReactCompoundVie
592
587
  mAdjustsFontSizeToFit = adjustsFontSizeToFit;
593
588
  }
594
589
 
590
+ public void setFontSize(float fontSize) {
591
+ mFontSize =
592
+ mAdjustsFontSizeToFit
593
+ ? (float) Math.ceil(PixelUtil.toPixelFromSP(fontSize))
594
+ : (float) Math.ceil(PixelUtil.toPixelFromDIP(fontSize));
595
+
596
+ applyTextAttributes();
597
+ }
598
+
599
+ public void setLetterSpacing(float letterSpacing) {
600
+ if (Float.isNaN(letterSpacing)) {
601
+ return;
602
+ }
603
+
604
+ float letterSpacingPixels = PixelUtil.toPixelFromDIP(letterSpacing);
605
+
606
+ // `letterSpacingPixels` and `getEffectiveFontSize` are both in pixels,
607
+ // yielding an accurate em value.
608
+ mLetterSpacing = letterSpacingPixels / mFontSize;
609
+
610
+ applyTextAttributes();
611
+ }
612
+
595
613
  public void setEllipsizeLocation(TextUtils.TruncateAt ellipsizeLocation) {
596
614
  mEllipsizeLocation = ellipsizeLocation;
597
615
  }
@@ -607,8 +625,6 @@ public class ReactTextView extends AppCompatTextView implements ReactCompoundVie
607
625
  ? null
608
626
  : mEllipsizeLocation;
609
627
  setEllipsize(ellipsizeLocation);
610
-
611
- applyTextAttributes();
612
628
  }
613
629
 
614
630
  @Override
@@ -664,37 +680,16 @@ public class ReactTextView extends AppCompatTextView implements ReactCompoundVie
664
680
  return super.dispatchHoverEvent(event);
665
681
  }
666
682
 
667
- public void setLetterSpacing(float letterSpacing) {
668
- mTextAttributes.setLetterSpacing(letterSpacing);
669
- }
670
-
671
- public void setAllowFontScaling(boolean allowFontScaling) {
672
- if (mTextAttributes.getAllowFontScaling() != allowFontScaling) {
673
- mTextAttributes.setAllowFontScaling(allowFontScaling);
674
- }
675
- }
676
-
677
- public void setFontSize(float fontSize) {
678
- mTextAttributes.setFontSize(fontSize);
679
- }
680
-
681
- public void setMaxFontSizeMultiplier(float maxFontSizeMultiplier) {
682
- if (maxFontSizeMultiplier != mTextAttributes.getMaxFontSizeMultiplier()) {
683
- mTextAttributes.setMaxFontSizeMultiplier(maxFontSizeMultiplier);
684
- }
685
- }
686
-
687
683
  private void applyTextAttributes() {
688
- // In general, the `getEffective*` functions return `Float.NaN` if the
689
- // property hasn't been set.
690
-
691
- // `getEffectiveFontSize` always returns a value so don't need to check for anything like
692
- // `Float.NaN`.
693
- setTextSize(TypedValue.COMPLEX_UNIT_PX, mTextAttributes.getEffectiveFontSize());
684
+ // Workaround for an issue where text can be cut off with an ellipsis when
685
+ // using certain font sizes and padding. Sets the provided text size and
686
+ // letter spacing to ensure consistent rendering and prevent cut-off.
687
+ if (!Float.isNaN(mFontSize)) {
688
+ setTextSize(TypedValue.COMPLEX_UNIT_PX, mFontSize);
689
+ }
694
690
 
695
- float effectiveLetterSpacing = mTextAttributes.getEffectiveLetterSpacing();
696
- if (!Float.isNaN(effectiveLetterSpacing)) {
697
- super.setLetterSpacing(effectiveLetterSpacing);
691
+ if (!Float.isNaN(mLetterSpacing)) {
692
+ super.setLetterSpacing(mLetterSpacing);
698
693
  }
699
694
  }
700
695
  }
@@ -18,7 +18,7 @@ constexpr struct {
18
18
  int32_t Major = 0;
19
19
  int32_t Minor = 73;
20
20
  int32_t Patch = 0;
21
- std::string_view Prerelease = "rc.7";
21
+ std::string_view Prerelease = "";
22
22
  } ReactNativeVersion;
23
23
 
24
24
  } // namespace facebook::react
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native",
3
- "version": "0.73.0-rc.7",
3
+ "version": "0.73.0",
4
4
  "description": "A framework for building native apps using React",
5
5
  "license": "MIT",
6
6
  "repository": {
Binary file
Binary file
Binary file
@@ -11,7 +11,7 @@
11
11
  },
12
12
  "dependencies": {
13
13
  "react": "18.2.0",
14
- "react-native": "0.73.0-rc.7"
14
+ "react-native": "0.73.0"
15
15
  },
16
16
  "devDependencies": {
17
17
  "@babel/core": "^7.20.0",