update paste input to fix both android and ios problems
This commit is contained in:
+1
-1
@@ -89,7 +89,7 @@
|
|||||||
"@haileyok/bluesky-video": "0.3.1",
|
"@haileyok/bluesky-video": "0.3.1",
|
||||||
"@ipld/dag-cbor": "^9.2.0",
|
"@ipld/dag-cbor": "^9.2.0",
|
||||||
"@lingui/react": "^4.14.1",
|
"@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",
|
"@miblanchard/react-native-slider": "^2.6.0",
|
||||||
"@mozzius/expo-dynamic-app-icon": "1.5.0",
|
"@mozzius/expo-dynamic-app-icon": "1.5.0",
|
||||||
"@react-native-async-storage/async-storage": "2.1.2",
|
"@react-native-async-storage/async-storage": "2.1.2",
|
||||||
|
|||||||
@@ -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<const PasteTextInputProps &>(*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<const PasteTextInputProps &>(*_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<const PasteTextInputProps &>(*_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 <react/renderer/components/iostextinput/conversions.h>
|
|
||||||
#include <react/renderer/components/iostextinput/primitives.h>
|
|
||||||
#include <react/renderer/components/text/BaseTextProps.h>
|
|
||||||
+#include <react/renderer/components/textinput/BaseTextInputProps.h>
|
|
||||||
#include <react/renderer/components/view/ViewProps.h>
|
|
||||||
#include <react/renderer/core/Props.h>
|
|
||||||
#include <react/renderer/core/PropsParserContext.h>
|
|
||||||
@@ -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));
|
|
||||||
}
|
|
||||||
@@ -5112,9 +5112,9 @@
|
|||||||
"@babel/runtime" "^7.20.13"
|
"@babel/runtime" "^7.20.13"
|
||||||
"@lingui/core" "4.14.1"
|
"@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"
|
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:
|
dependencies:
|
||||||
semver "7.6.3"
|
semver "7.6.3"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user