From 8196594a81be57c0402b5d807ee512a519d9f824 Mon Sep 17 00:00:00 2001 From: Hailey Date: Sun, 22 Jun 2025 01:04:12 -0700 Subject: [PATCH] update paste input to fix both android and ios problems --- package.json | 2 +- ...rmost+react-native-paste-input+0.8.1.patch | 108 ------------------ yarn.lock | 4 +- 3 files changed, 3 insertions(+), 111 deletions(-) delete mode 100644 patches/@mattermost+react-native-paste-input+0.8.1.patch diff --git a/package.json b/package.json index b58c893d44..1eaa9f3059 100644 --- a/package.json +++ b/package.json @@ -89,7 +89,7 @@ "@haileyok/bluesky-video": "0.3.1", "@ipld/dag-cbor": "^9.2.0", "@lingui/react": "^4.14.1", - "@mattermost/react-native-paste-input": "haileyok/react-native-paste-input", + "@mattermost/react-native-paste-input": "bluesky-social/react-native-paste-input#rn-079", "@miblanchard/react-native-slider": "^2.6.0", "@mozzius/expo-dynamic-app-icon": "1.5.0", "@react-native-async-storage/async-storage": "2.1.2", diff --git a/patches/@mattermost+react-native-paste-input+0.8.1.patch b/patches/@mattermost+react-native-paste-input+0.8.1.patch deleted file mode 100644 index 1b674d6ade..0000000000 --- a/patches/@mattermost+react-native-paste-input+0.8.1.patch +++ /dev/null @@ -1,108 +0,0 @@ -diff --git a/node_modules/@mattermost/react-native-paste-input/ios/PasteTextInput.mm b/node_modules/@mattermost/react-native-paste-input/ios/PasteTextInput.mm -index dd50053..2ed7017 100644 ---- a/node_modules/@mattermost/react-native-paste-input/ios/PasteTextInput.mm -+++ b/node_modules/@mattermost/react-native-paste-input/ios/PasteTextInput.mm -@@ -122,8 +122,8 @@ - (void)updateProps:(const Props::Shared &)props oldProps:(const Props::Shared & - const auto &newTextInputProps = static_cast(*props); - - // Traits: -- if (newTextInputProps.traits.multiline != oldTextInputProps.traits.multiline) { -- [self _setMultiline:newTextInputProps.traits.multiline]; -+ if (newTextInputProps.multiline != oldTextInputProps.multiline) { -+ [self _setMultiline:newTextInputProps.multiline]; - } - - if (newTextInputProps.traits.autocapitalizationType != oldTextInputProps.traits.autocapitalizationType) { -@@ -421,7 +421,7 @@ - (void)textInputDidChangeSelection - return; - } - const auto &props = static_cast(*_props); -- if (props.traits.multiline && ![_lastStringStateWasUpdatedWith isEqual:_backedTextInputView.attributedText]) { -+ if (props.multiline && ![_lastStringStateWasUpdatedWith isEqual:_backedTextInputView.attributedText]) { - [self textInputDidChange]; - _ignoreNextTextInputCall = YES; - } -@@ -708,11 +708,11 @@ - (BOOL)_textOf:(NSAttributedString *)newText equals:(NSAttributedString *)oldTe - - (SubmitBehavior)getSubmitBehavior - { - const auto &props = static_cast(*_props); -- const SubmitBehavior submitBehaviorDefaultable = props.traits.submitBehavior; -+ const SubmitBehavior submitBehaviorDefaultable = props.submitBehavior; - - // We should always have a non-default `submitBehavior`, but in case we don't, set it based on multiline. - if (submitBehaviorDefaultable == SubmitBehavior::Default) { -- return props.traits.multiline ? SubmitBehavior::Newline : SubmitBehavior::BlurAndSubmit; -+ return props.multiline ? SubmitBehavior::Newline : SubmitBehavior::BlurAndSubmit; - } - - return submitBehaviorDefaultable; -diff --git a/node_modules/@mattermost/react-native-paste-input/ios/PasteTextInputSpecs/Props.cpp b/node_modules/@mattermost/react-native-paste-input/ios/PasteTextInputSpecs/Props.cpp -index 29e094f..3c59520 100644 ---- a/node_modules/@mattermost/react-native-paste-input/ios/PasteTextInputSpecs/Props.cpp -+++ b/node_modules/@mattermost/react-native-paste-input/ios/PasteTextInputSpecs/Props.cpp -@@ -22,8 +22,7 @@ PasteTextInputProps::PasteTextInputProps( - const PropsParserContext &context, - const PasteTextInputProps &sourceProps, - const RawProps& rawProps) -- : ViewProps(context, sourceProps, rawProps), -- BaseTextProps(context, sourceProps, rawProps), -+ : BaseTextInputProps(context, sourceProps, rawProps), - traits(convertRawProp(context, rawProps, sourceProps.traits, {})), - smartPunctuation(convertRawProp(context, rawProps, "smartPunctuation", sourceProps.smartPunctuation, {})), - disableCopyPaste(convertRawProp(context, rawProps, "disableCopyPaste", sourceProps.disableCopyPaste, {false})), -@@ -133,7 +132,7 @@ TextAttributes PasteTextInputProps::getEffectiveTextAttributes(Float fontSizeMul - ParagraphAttributes PasteTextInputProps::getEffectiveParagraphAttributes() const { - auto result = paragraphAttributes; - -- if (!traits.multiline) { -+ if (!multiline) { - result.maximumNumberOfLines = 1; - } - -diff --git a/node_modules/@mattermost/react-native-paste-input/ios/PasteTextInputSpecs/Props.h b/node_modules/@mattermost/react-native-paste-input/ios/PasteTextInputSpecs/Props.h -index 723d00c..e871cd7 100644 ---- a/node_modules/@mattermost/react-native-paste-input/ios/PasteTextInputSpecs/Props.h -+++ b/node_modules/@mattermost/react-native-paste-input/ios/PasteTextInputSpecs/Props.h -@@ -15,6 +15,7 @@ - #include - #include - #include -+#include - #include - #include - #include -@@ -25,7 +26,7 @@ - - namespace facebook::react { - --class PasteTextInputProps final : public ViewProps, public BaseTextProps { -+class PasteTextInputProps final : public BaseTextInputProps { - public: - PasteTextInputProps() = default; - PasteTextInputProps(const PropsParserContext& context, const PasteTextInputProps& sourceProps, const RawProps& rawProps); -diff --git a/node_modules/@mattermost/react-native-paste-input/ios/PasteTextInputSpecs/ShadowNodes.cpp b/node_modules/@mattermost/react-native-paste-input/ios/PasteTextInputSpecs/ShadowNodes.cpp -index 31e07e3..ef82d50 100644 ---- a/node_modules/@mattermost/react-native-paste-input/ios/PasteTextInputSpecs/ShadowNodes.cpp -+++ b/node_modules/@mattermost/react-native-paste-input/ios/PasteTextInputSpecs/ShadowNodes.cpp -@@ -91,12 +91,7 @@ void PasteTextInputShadowNode::updateStateIfNeeded( - const auto& state = getStateData(); - - react_native_assert(textLayoutManager_); -- react_native_assert( -- (!state.layoutManager || state.layoutManager == textLayoutManager_) && -- "`StateData` refers to a different `TextLayoutManager`"); -- -- if (state.reactTreeAttributedString == reactTreeAttributedString && -- state.layoutManager == textLayoutManager_) { -+ if (state.reactTreeAttributedString == reactTreeAttributedString) { - return; - } - -@@ -104,7 +99,6 @@ void PasteTextInputShadowNode::updateStateIfNeeded( - newState.attributedStringBox = AttributedStringBox{reactTreeAttributedString}; - newState.paragraphAttributes = getConcreteProps().paragraphAttributes; - newState.reactTreeAttributedString = reactTreeAttributedString; -- newState.layoutManager = textLayoutManager_; - newState.mostRecentEventCount = getConcreteProps().mostRecentEventCount; - setStateData(std::move(newState)); - } diff --git a/yarn.lock b/yarn.lock index ae156065e5..79a65fe580 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5112,9 +5112,9 @@ "@babel/runtime" "^7.20.13" "@lingui/core" "4.14.1" -"@mattermost/react-native-paste-input@haileyok/react-native-paste-input": +"@mattermost/react-native-paste-input@bluesky-social/react-native-paste-input#rn-079": version "0.8.1" - resolved "https://codeload.github.com/haileyok/react-native-paste-input/tar.gz/f260447edc645a817ab1ba7b46d8341d84dba8e9" + resolved "https://codeload.github.com/bluesky-social/react-native-paste-input/tar.gz/0be30b2ae86395c01edf58e7040c73c712bce472" dependencies: semver "7.6.3"