@expensify/react-native-live-markdown 0.1.185 → 0.1.186
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.
|
@@ -107,26 +107,31 @@ RootShadowNode::Unshared MarkdownCommitHook::shadowTreeWillCommit(
|
|
|
107
107
|
rootNode = rootNode->cloneTree(
|
|
108
108
|
nodes.textInput->getFamily(),
|
|
109
109
|
[this, &stateData, &textInputState, &nodes](ShadowNode const &node) {
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
110
|
+
std::shared_ptr<ShadowNode> newNode = nullptr;
|
|
111
|
+
|
|
112
|
+
if (stateData.cachedAttributedStringId != 0) {
|
|
113
|
+
auto newStateData =
|
|
114
|
+
std::make_shared<AndroidTextInputState>(stateData);
|
|
115
|
+
|
|
116
|
+
// force measurement of a map buffer
|
|
117
|
+
newStateData->cachedAttributedStringId = 0;
|
|
118
|
+
|
|
119
|
+
// setting -1 as the event counter makes sure that the update will be ignored by the java
|
|
120
|
+
// part of the code, which is what we want as we don't change the attributed string here
|
|
121
|
+
if (previousEventCount_.contains(nodes.textInput->getTag()) &&
|
|
118
122
|
previousEventCount_[nodes.textInput->getTag()] == stateData.mostRecentEventCount) {
|
|
119
123
|
newStateData->mostRecentEventCount = -1;
|
|
120
|
-
|
|
124
|
+
} else {
|
|
121
125
|
previousEventCount_[nodes.textInput->getTag()] = stateData.mostRecentEventCount;
|
|
122
|
-
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
auto newState = std::make_shared<const ConcreteState<AndroidTextInputState>>(
|
|
129
|
+
newStateData, textInputState);
|
|
123
130
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
newStateData, textInputState),
|
|
129
|
-
});
|
|
131
|
+
newNode = node.clone({ .state = newState });
|
|
132
|
+
} else {
|
|
133
|
+
newNode = node.clone({});
|
|
134
|
+
}
|
|
130
135
|
|
|
131
136
|
const auto currentDecoratorProps =
|
|
132
137
|
nodes.decorator->getProps()->rawProps["markdownStyle"];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@expensify/react-native-live-markdown",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.186",
|
|
4
4
|
"description": "Drop-in replacement for React Native's TextInput component with Markdown formatting.",
|
|
5
5
|
"main": "lib/commonjs/index",
|
|
6
6
|
"module": "lib/module/index",
|