@expensify/react-native-live-markdown 0.1.246 → 0.1.247
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.
|
@@ -137,35 +137,22 @@ using namespace facebook::react;
|
|
|
137
137
|
const auto &newViewProps = *std::static_pointer_cast<MarkdownTextInputDecoratorViewProps const>(props);
|
|
138
138
|
|
|
139
139
|
if (oldViewProps.parserId != newViewProps.parserId) {
|
|
140
|
-
|
|
140
|
+
_parserId = @(newViewProps.parserId);
|
|
141
|
+
[_markdownUtils setParserId:_parserId];
|
|
141
142
|
}
|
|
142
143
|
|
|
143
144
|
// TODO: if (oldViewProps.markdownStyle != newViewProps.markdownStyle)
|
|
144
|
-
|
|
145
|
-
[
|
|
145
|
+
_markdownStyle = [[RCTMarkdownStyle alloc] initWithStruct:newViewProps.markdownStyle];
|
|
146
|
+
[_markdownUtils setMarkdownStyle:_markdownStyle];
|
|
146
147
|
|
|
147
|
-
|
|
148
|
-
|
|
148
|
+
// TODO: call applyNewStyles only if needed
|
|
149
|
+
[self applyNewStyles];
|
|
149
150
|
|
|
150
|
-
|
|
151
|
-
{
|
|
152
|
-
// TODO: move to updateProps method
|
|
153
|
-
_markdownStyle = markdownStyle;
|
|
154
|
-
[_markdownUtils setMarkdownStyle:markdownStyle];
|
|
155
|
-
[self applyNewStyles];
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
- (void)setParserId:(NSNumber *)parserId
|
|
159
|
-
{
|
|
160
|
-
// TODO: move to updateProps method
|
|
161
|
-
_parserId = parserId;
|
|
162
|
-
[_markdownUtils setParserId:parserId];
|
|
163
|
-
[self applyNewStyles];
|
|
151
|
+
[super updateProps:props oldProps:oldProps];
|
|
164
152
|
}
|
|
165
153
|
|
|
166
154
|
- (void)applyNewStyles
|
|
167
155
|
{
|
|
168
|
-
// TODO: call applyNewStyles only once if both markdownStyle and parserId change
|
|
169
156
|
if (_textView != nil) {
|
|
170
157
|
// We want to use `textStorage` for applying markdown when possible. Currently it's only available for UITextView
|
|
171
158
|
[_textView textDidChange];
|
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.247",
|
|
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",
|