@expensify/react-native-live-markdown 0.1.246 → 0.1.248

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.
@@ -25,18 +25,6 @@ target_link_libraries(
25
25
  ${CMAKE_PROJECT_NAME}
26
26
  fbjni::fbjni
27
27
  ReactAndroid::jsi
28
+ ReactAndroid::reactnative
28
29
  react-native-reanimated::worklets
29
30
  )
30
-
31
- if (ReactAndroid_VERSION_MINOR GREATER_EQUAL 76)
32
- target_link_libraries(${CMAKE_PROJECT_NAME} ReactAndroid::reactnative)
33
- elseif (ReactAndroid_VERSION_MINOR GREATER_EQUAL 75)
34
- target_link_libraries(
35
- ${CMAKE_PROJECT_NAME}
36
- ReactAndroid::react_nativemodule_core
37
- ReactAndroid::reactnativejni
38
- ReactAndroid::runtimeexecutor
39
- )
40
- else ()
41
- message(FATAL_ERROR "react-native-live-markdown requires react-native 0.75 or newer.")
42
- endif ()
@@ -39,41 +39,9 @@ target_link_libraries(
39
39
  ${LIB_TARGET_NAME}
40
40
  fbjni::fbjni
41
41
  ReactAndroid::jsi
42
+ ReactAndroid::reactnative
42
43
  )
43
44
 
44
- if (ReactAndroid_VERSION_MINOR GREATER_EQUAL 76)
45
- target_link_libraries(
46
- ${LIB_TARGET_NAME}
47
- ReactAndroid::reactnative
48
- )
49
- elseif (ReactAndroid_VERSION_MINOR GREATER_EQUAL 75)
50
- target_link_libraries(
51
- ${LIB_TARGET_NAME}
52
- ReactAndroid::fabricjni
53
- ReactAndroid::folly_runtime
54
- ReactAndroid::glog
55
- ReactAndroid::react_debug
56
- ReactAndroid::react_nativemodule_core
57
- ReactAndroid::react_performance_timeline
58
- ReactAndroid::react_render_consistency
59
- ReactAndroid::react_render_core
60
- ReactAndroid::react_render_debug
61
- ReactAndroid::react_render_graphics
62
- ReactAndroid::react_render_imagemanager
63
- ReactAndroid::react_render_mapbuffer
64
- ReactAndroid::react_render_observers_events
65
- ReactAndroid::react_render_textlayoutmanager
66
- ReactAndroid::reactnativejni
67
- ReactAndroid::rrc_text
68
- ReactAndroid::rrc_textinput
69
- ReactAndroid::rrc_view
70
- ReactAndroid::runtimeexecutor
71
- ReactAndroid::yoga
72
- )
73
- else ()
74
- message(FATAL_ERROR "react-native-live-markdown requires react-native 0.75 or newer.")
75
- endif ()
76
-
77
45
  target_compile_options(
78
46
  ${LIB_TARGET_NAME}
79
47
  PRIVATE
@@ -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
- [self setParserId:@(newViewProps.parserId)];
140
+ _parserId = @(newViewProps.parserId);
141
+ [_markdownUtils setParserId:_parserId];
141
142
  }
142
143
 
143
144
  // TODO: if (oldViewProps.markdownStyle != newViewProps.markdownStyle)
144
- RCTMarkdownStyle *markdownStyle = [[RCTMarkdownStyle alloc] initWithStruct:newViewProps.markdownStyle];
145
- [self setMarkdownStyle:markdownStyle];
145
+ _markdownStyle = [[RCTMarkdownStyle alloc] initWithStruct:newViewProps.markdownStyle];
146
+ [_markdownUtils setMarkdownStyle:_markdownStyle];
146
147
 
147
- [super updateProps:props oldProps:oldProps];
148
- }
148
+ // TODO: call applyNewStyles only if needed
149
+ [self applyNewStyles];
149
150
 
150
- - (void)setMarkdownStyle:(RCTMarkdownStyle *)markdownStyle
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.246",
3
+ "version": "0.1.248",
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",