Skip to content

Commit

Permalink
feat: update patches
Browse files Browse the repository at this point in the history
  • Loading branch information
WoLewicki committed Jul 25, 2024
1 parent 575be41 commit c1e0494
Show file tree
Hide file tree
Showing 5 changed files with 81 additions and 22 deletions.
Original file line number Diff line number Diff line change
@@ -1,16 +1,3 @@
diff --git a/node_modules/@expensify/react-native-live-markdown/android/src/main/java/com/expensify/livemarkdown/CustomMountingManager.java b/node_modules/@expensify/react-native-live-markdown/android/src/main/java/com/expensify/livemarkdown/CustomMountingManager.java
index 1b4381b..c7f6ad6 100644
--- a/node_modules/@expensify/react-native-live-markdown/android/src/main/java/com/expensify/livemarkdown/CustomMountingManager.java
+++ b/node_modules/@expensify/react-native-live-markdown/android/src/main/java/com/expensify/livemarkdown/CustomMountingManager.java
@@ -21,7 +21,7 @@ import com.facebook.react.fabric.mounting.MountingManager;
import com.facebook.react.uimanager.PixelUtil;
import com.facebook.react.uimanager.ViewManagerRegistry;
import com.facebook.react.views.text.TextAttributeProps;
-import com.facebook.react.views.text.TextInlineViewPlaceholderSpan;
+import com.facebook.react.views.text.internal.span.TextInlineViewPlaceholderSpan;
import com.facebook.react.views.text.TextLayoutManagerMapBuffer;
import com.facebook.yoga.YogaMeasureMode;
import com.facebook.yoga.YogaMeasureOutput;
diff --git a/node_modules/@expensify/react-native-live-markdown/android/src/main/java/com/expensify/livemarkdown/LiveMarkdownModule.java b/node_modules/@expensify/react-native-live-markdown/android/src/main/java/com/expensify/livemarkdown/LiveMarkdownModule.java
index ed1428b..80641ce 100644
--- a/node_modules/@expensify/react-native-live-markdown/android/src/main/java/com/expensify/livemarkdown/LiveMarkdownModule.java
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,27 @@
diff --git a/node_modules/@expensify/react-native-live-markdown/android/src/main/java/com/expensify/livemarkdown/CustomMountingManager.java b/node_modules/@expensify/react-native-live-markdown/android/src/main/java/com/expensify/livemarkdown/CustomMountingManager.java
index c7f6ad6..7b535b7 100644
index 1b4381b..7e3aebe 100644
--- a/node_modules/@expensify/react-native-live-markdown/android/src/main/java/com/expensify/livemarkdown/CustomMountingManager.java
+++ b/node_modules/@expensify/react-native-live-markdown/android/src/main/java/com/expensify/livemarkdown/CustomMountingManager.java
@@ -22,7 +22,7 @@ import com.facebook.react.uimanager.PixelUtil;
@@ -13,7 +13,6 @@ import android.text.TextPaint;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

-import com.facebook.common.logging.FLog;
import com.facebook.react.bridge.ReactContext;
import com.facebook.react.bridge.ReadableMap;
import com.facebook.react.common.mapbuffer.MapBuffer;
@@ -21,8 +20,8 @@ import com.facebook.react.fabric.mounting.MountingManager;
import com.facebook.react.uimanager.PixelUtil;
import com.facebook.react.uimanager.ViewManagerRegistry;
import com.facebook.react.views.text.TextAttributeProps;
import com.facebook.react.views.text.internal.span.TextInlineViewPlaceholderSpan;
-import com.facebook.react.views.text.TextInlineViewPlaceholderSpan;
-import com.facebook.react.views.text.TextLayoutManagerMapBuffer;
+import com.facebook.react.views.text.internal.span.TextInlineViewPlaceholderSpan;
+import com.facebook.react.views.text.TextLayoutManager;
import com.facebook.yoga.YogaMeasureMode;
import com.facebook.yoga.YogaMeasureOutput;

@@ -63,7 +63,7 @@ public class CustomMountingManager extends MountingManager {
@@ -63,7 +62,7 @@ public class CustomMountingManager extends MountingManager {
@Nullable float[] attachmentsPositions) {

Spannable text =
Expand All @@ -20,7 +30,7 @@ index c7f6ad6..7b535b7 100644

if (text == null) {
return 0;
@@ -71,14 +71,14 @@ public class CustomMountingManager extends MountingManager {
@@ -71,14 +70,14 @@ public class CustomMountingManager extends MountingManager {

int textBreakStrategy =
TextAttributeProps.getTextBreakStrategy(
Expand All @@ -39,17 +49,31 @@ index c7f6ad6..7b535b7 100644

// StaticLayout returns wrong metrics for the last line if it's empty, add something to the
// last line so it's measured correctly
@@ -93,7 +93,7 @@ public class CustomMountingManager extends MountingManager {
@@ -89,13 +88,15 @@ public class CustomMountingManager extends MountingManager {
text = sb;
}

+ Layout.Alignment alignment = TextLayoutManager.getTextAlignment(attributedString, text);
+
markdownUtils.applyMarkdownFormatting((SpannableStringBuilder)text);

BoringLayout.Metrics boring = BoringLayout.isBoring(text, sTextPaintInstance);

- Class<TextLayoutManagerMapBuffer> mapBufferClass = TextLayoutManagerMapBuffer.class;
+ Class<TextLayoutManager> mapBufferClass = TextLayoutManager.class;
try {
Method createLayoutMethod = mapBufferClass.getDeclaredMethod("createLayout", Spannable.class, BoringLayout.Metrics.class, float.class, YogaMeasureMode.class, boolean.class, int.class, int.class);
- Method createLayoutMethod = mapBufferClass.getDeclaredMethod("createLayout", Spannable.class, BoringLayout.Metrics.class, float.class, YogaMeasureMode.class, boolean.class, int.class, int.class);
+ Method createLayoutMethod = mapBufferClass.getDeclaredMethod("createLayout", Spannable.class, BoringLayout.Metrics.class, float.class, YogaMeasureMode.class, boolean.class, int.class, int.class, Layout.Alignment.class);
createLayoutMethod.setAccessible(true);
@@ -109,8 +109,8 @@ public class CustomMountingManager extends MountingManager {
hyphenationFrequency);

Layout layout = (Layout)createLayoutMethod.invoke(
@@ -106,11 +107,12 @@ public class CustomMountingManager extends MountingManager {
widthYogaMeasureMode,
includeFontPadding,
textBreakStrategy,
- hyphenationFrequency);
+ hyphenationFrequency,
+ alignment);

int maximumNumberOfLines =
- paragraphAttributes.contains(TextLayoutManagerMapBuffer.PA_KEY_MAX_NUMBER_OF_LINES)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/node_modules/react-native/ReactCommon/react/renderer/components/textinput/CMakeLists.txt b/node_modules/react-native/ReactCommon/react/renderer/components/textinput/CMakeLists.txt
index 9881461..c311a05 100644
--- a/node_modules/react-native/ReactCommon/react/renderer/components/textinput/CMakeLists.txt
+++ b/node_modules/react-native/ReactCommon/react/renderer/components/textinput/CMakeLists.txt
@@ -15,7 +15,7 @@ add_compile_options(
-DLOG_TAG=\"Fabric\")

file(GLOB rrc_textinput_SRC CONFIGURE_DEPENDS *.cpp platform/android/react/renderer/components/androidtextinput/*.cpp)
-add_library(rrc_textinput STATIC ${rrc_textinput_SRC})
+add_library(rrc_textinput SHARED ${rrc_textinput_SRC})

target_include_directories(rrc_textinput PUBLIC . ${CMAKE_CURRENT_SOURCE_DIR}/platform/android/)

23 changes: 23 additions & 0 deletions patches/react-native-animatable+1.3.3.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
diff --git a/node_modules/react-native-animatable/createAnimatableComponent.js b/node_modules/react-native-animatable/createAnimatableComponent.js
index 2847e12..331d44f 100644
--- a/node_modules/react-native-animatable/createAnimatableComponent.js
+++ b/node_modules/react-native-animatable/createAnimatableComponent.js
@@ -465,7 +465,9 @@ export default function createAnimatableComponent(WrappedComponent) {
const needsZeroClamping =
ZERO_CLAMPED_STYLE_PROPERTIES.indexOf(property) !== -1;
if (needsInterpolation) {
- transitionValue.setValue(0);
+ transitionValue = new Animated.Value(0);
+ transitionValues[property] = transitionValue;
+
transitionStyle[property] = transitionValue.interpolate({
inputRange: [0, 1],
outputRange: [fromValue, toValue],
@@ -546,7 +548,6 @@ export default function createAnimatableComponent(WrappedComponent) {
transitions.to[property] = toValue;
}
});
-
if (Object.keys(transitions.from).length) {
this.transition(transitions.from, transitions.to, duration, easing);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git a/node_modules/react-native-reanimated/src/component/PerformanceMonitor.tsx b/node_modules/react-native-reanimated/src/component/PerformanceMonitor.tsx
index 9e66803..3620fe9 100644
--- a/node_modules/react-native-reanimated/src/component/PerformanceMonitor.tsx
+++ b/node_modules/react-native-reanimated/src/component/PerformanceMonitor.tsx
@@ -47,7 +47,6 @@ function createCircularDoublesBuffer(size: number) {
}

const DEFAULT_BUFFER_SIZE = 60;
-addWhitelistedNativeProps({ text: true });
const AnimatedTextInput = createAnimatedComponent(TextInput);

function loopAnimationFrame(fn: (lastTime: number, time: number) => void) {

0 comments on commit c1e0494

Please sign in to comment.