@expensify/react-native-live-markdown 0.1.255 → 0.1.257
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.
- package/RNLiveMarkdown.podspec +2 -0
- package/android/src/main/java/com/expensify/livemarkdown/LiveMarkdownModule.java +0 -10
- package/android/src/main/java/com/expensify/livemarkdown/MarkdownTextInputDecoratorView.java +5 -28
- package/android/src/main/java/com/expensify/livemarkdown/MarkdownTextInputDecoratorViewManagerSpec.java +3 -3
- package/android/src/main/new_arch/CMakeLists.txt +2 -1
- package/android/src/main/new_arch/react/renderer/components/RNLiveMarkdownSpec/MarkdownTextInputDecoratorShadowNode.cpp +135 -0
- package/android/src/main/new_arch/react/renderer/components/RNLiveMarkdownSpec/MarkdownTextInputDecoratorShadowNode.h +75 -0
- package/apple/LiveMarkdownModule.mm +1 -53
- package/apple/MarkdownParser.mm +4 -4
- package/apple/MarkdownTextInputDecoratorComponentView.mm +6 -36
- package/apple/MarkdownTextInputDecoratorShadowNode.h +67 -0
- package/apple/MarkdownTextInputDecoratorShadowNode.mm +271 -0
- package/apple/RCTMarkdownUtils.mm +6 -0
- package/apple/RCTTextInputComponentView+Markdown.mm +0 -16
- package/cpp/react/renderer/components/RNLiveMarkdownSpec/MarkdownTextInputDecoratorState.h +3 -16
- package/lib/commonjs/MarkdownTextInput.js +7 -9
- package/lib/commonjs/MarkdownTextInput.js.map +1 -1
- package/lib/module/MarkdownTextInput.js +7 -9
- package/lib/module/MarkdownTextInput.js.map +1 -1
- package/lib/typescript/src/MarkdownTextInput.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/MarkdownTextInput.tsx +8 -11
- package/android/src/main/java/com/expensify/livemarkdown/NativeProxy.java +0 -24
- package/android/src/main/new_arch/MarkdownCommitHook.cpp +0 -192
- package/android/src/main/new_arch/MarkdownCommitHook.h +0 -58
- package/android/src/main/new_arch/NativeProxy.cpp +0 -40
- package/android/src/main/new_arch/NativeProxy.h +0 -39
- package/android/src/main/new_arch/OnLoad.cpp +0 -8
- package/apple/MarkdownCommitHook.h +0 -46
- package/apple/MarkdownCommitHook.mm +0 -303
- package/cpp/react/renderer/components/RNLiveMarkdownSpec/MarkdownShadowFamilyRegistry.cpp +0 -60
- package/cpp/react/renderer/components/RNLiveMarkdownSpec/MarkdownShadowFamilyRegistry.h +0 -38
- package/cpp/react/renderer/components/RNLiveMarkdownSpec/MarkdownTextInputDecoratorShadowNode.cpp +0 -33
- package/cpp/react/renderer/components/RNLiveMarkdownSpec/MarkdownTextInputDecoratorShadowNode.h +0 -46
- package/cpp/react/renderer/components/RNLiveMarkdownSpec/OwningShadowNodeFragment.h +0 -28
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
#include "MarkdownTextInputDecoratorShadowNode.h"
|
|
2
|
+
|
|
3
|
+
#include <react/renderer/components/iostextinput/TextInputState.h>
|
|
4
|
+
|
|
5
|
+
#include <React/RCTUtils.h>
|
|
6
|
+
#include <react/renderer/components/view/conversions.h>
|
|
7
|
+
#include <react/renderer/core/ComponentDescriptor.h>
|
|
8
|
+
#include <react/renderer/textlayoutmanager/RCTAttributedTextUtils.h>
|
|
9
|
+
#include <yoga/Yoga.h>
|
|
10
|
+
|
|
11
|
+
#include "RCTMarkdownStyle.h"
|
|
12
|
+
#include "RCTMarkdownUtils.h"
|
|
13
|
+
|
|
14
|
+
namespace facebook {
|
|
15
|
+
namespace react {
|
|
16
|
+
|
|
17
|
+
extern const char MarkdownTextInputDecoratorViewComponentName[] =
|
|
18
|
+
"MarkdownTextInputDecoratorView";
|
|
19
|
+
|
|
20
|
+
void MarkdownTextInputDecoratorShadowNode::initialize() {
|
|
21
|
+
// Setting display: contents style results in ForceFlattenView trait being set
|
|
22
|
+
// on the shadow node. This trait causes the node not to have a host view. By
|
|
23
|
+
// removing the trait, it's possible to force RN to create a host view, layout
|
|
24
|
+
// of which can then be customized.
|
|
25
|
+
ShadowNode::traits_.unset(ShadowNodeTraits::ForceFlattenView);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
void MarkdownTextInputDecoratorShadowNode::overwriteMeasureCallbackConnector() {
|
|
29
|
+
const auto &children = getChildren();
|
|
30
|
+
if (children.empty()) {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
react_native_assert(
|
|
34
|
+
children.size() == 1 &&
|
|
35
|
+
"MarkdownTextInputDecoratorView received more than one child");
|
|
36
|
+
|
|
37
|
+
const auto child = std::dynamic_pointer_cast<const TextInputShadowNode>(children[0]);
|
|
38
|
+
react_native_assert(
|
|
39
|
+
child != nullptr &&
|
|
40
|
+
"MarkdownTextInputDecoratorView received child other than a TextInput");
|
|
41
|
+
child->ensureUnsealed();
|
|
42
|
+
|
|
43
|
+
// This is obviously not correct, but since both MarkdownTextInputDecoratorShadowNode and
|
|
44
|
+
// TextInputShadowNode inherit from YogaLayoutableShadowNode by doing this cast it's
|
|
45
|
+
// possible to access protected members from TextInputShadowNode like yogaNode_.
|
|
46
|
+
// As only things from YogaLayoutableShadowNode are accessed, it should be safe,
|
|
47
|
+
// since the vtable should be the same between them.
|
|
48
|
+
const auto &nodeWithAccessibleYogaNode =
|
|
49
|
+
std::reinterpret_pointer_cast<const MarkdownTextInputDecoratorShadowNode>(child);
|
|
50
|
+
|
|
51
|
+
// decorator node cannot have a measure function since it's not a leaf node
|
|
52
|
+
// but we can redirect measuring of the child input to call measureContent
|
|
53
|
+
// on the decorator
|
|
54
|
+
const auto &yogaNode = &nodeWithAccessibleYogaNode->yogaNode_;
|
|
55
|
+
YGNodeSetMeasureFunc(yogaNode, yogaNodeMeasureCallbackConnector);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
void MarkdownTextInputDecoratorShadowNode::appendChild(
|
|
59
|
+
const ShadowNode::Shared &child) {
|
|
60
|
+
YogaLayoutableShadowNode::appendChild(child);
|
|
61
|
+
|
|
62
|
+
overwriteMeasureCallbackConnector();
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
void MarkdownTextInputDecoratorShadowNode::replaceChild(
|
|
66
|
+
const ShadowNode &oldChild, const ShadowNode::Shared &newChild,
|
|
67
|
+
size_t suggestedIndex) {
|
|
68
|
+
YogaLayoutableShadowNode::replaceChild(oldChild, newChild, suggestedIndex);
|
|
69
|
+
|
|
70
|
+
overwriteMeasureCallbackConnector();
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
Size MarkdownTextInputDecoratorShadowNode::measureContent(
|
|
74
|
+
const LayoutContext &layoutContext,
|
|
75
|
+
const LayoutConstraints &layoutConstraints) const {
|
|
76
|
+
const auto &children = getChildren();
|
|
77
|
+
react_native_assert(
|
|
78
|
+
children.size() == 1 &&
|
|
79
|
+
"MarkdownTextInputDecoratorView received wrong number of children");
|
|
80
|
+
|
|
81
|
+
const auto child =
|
|
82
|
+
std::static_pointer_cast<const TextInputShadowNode>(children[0]);
|
|
83
|
+
|
|
84
|
+
child->ensureUnsealed();
|
|
85
|
+
|
|
86
|
+
// apply markdown formatting before measuring the child
|
|
87
|
+
const auto &mutableChild =
|
|
88
|
+
std::const_pointer_cast<TextInputShadowNode>(child);
|
|
89
|
+
applyMarkdownFormattingToTextInputState(mutableChild, layoutContext);
|
|
90
|
+
|
|
91
|
+
return child->measureContent(layoutContext, layoutConstraints);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
void MarkdownTextInputDecoratorShadowNode::layout(LayoutContext layoutContext) {
|
|
95
|
+
YogaLayoutableShadowNode::layout(layoutContext);
|
|
96
|
+
|
|
97
|
+
const auto &children = getChildren();
|
|
98
|
+
react_native_assert(
|
|
99
|
+
children.size() == 1 &&
|
|
100
|
+
"MarkdownTextInputDecoratorView didn't receive exactly one child");
|
|
101
|
+
|
|
102
|
+
const auto child =
|
|
103
|
+
std::static_pointer_cast<const TextInputShadowNode>(children[0]);
|
|
104
|
+
|
|
105
|
+
child->ensureUnsealed();
|
|
106
|
+
|
|
107
|
+
const auto &mutableChild =
|
|
108
|
+
std::const_pointer_cast<TextInputShadowNode>(child);
|
|
109
|
+
|
|
110
|
+
// TODO: this may not be the correct way to do this
|
|
111
|
+
// Since nodes with display: contents are skipped during layout, they have
|
|
112
|
+
// zero-layout. To properly display the view, assign the layout metrics from
|
|
113
|
+
// the child (text input, which was calculated by Yoga) to the decorator view.
|
|
114
|
+
auto childMetrics = child->getLayoutMetrics();
|
|
115
|
+
setLayoutMetrics(childMetrics);
|
|
116
|
+
|
|
117
|
+
// Then, it's also needed to update the metrics on the child as the position
|
|
118
|
+
// is relative to the parent, which was just moved above. By zeroing the
|
|
119
|
+
// origin, the child is effectively moved to the same position it was before
|
|
120
|
+
// the manipulation here.
|
|
121
|
+
childMetrics.frame.origin = Point{};
|
|
122
|
+
mutableChild->setLayoutMetrics(childMetrics);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
void MarkdownTextInputDecoratorShadowNode::applyMarkdownFormattingToTextInputState(
|
|
126
|
+
std::shared_ptr<TextInputShadowNode> textInput,
|
|
127
|
+
const LayoutContext &layoutContext) const {
|
|
128
|
+
|
|
129
|
+
const auto &textInputState =
|
|
130
|
+
*std::static_pointer_cast<const react::ConcreteState<TextInputState>>(
|
|
131
|
+
textInput->getState());
|
|
132
|
+
const auto &stateData = textInputState.getData();
|
|
133
|
+
const auto fontSizeMultiplier = layoutContext.fontSizeMultiplier;
|
|
134
|
+
|
|
135
|
+
const auto &decoratorProps =
|
|
136
|
+
*std::static_pointer_cast<MarkdownTextInputDecoratorViewProps const>(
|
|
137
|
+
getProps());
|
|
138
|
+
const auto &textInputProps =
|
|
139
|
+
*std::static_pointer_cast<TextInputProps const>(textInput->getProps());
|
|
140
|
+
|
|
141
|
+
const auto defaultTextAttributes =
|
|
142
|
+
textInputProps.getEffectiveTextAttributes(fontSizeMultiplier);
|
|
143
|
+
const auto defaultNSTextAttributes =
|
|
144
|
+
RCTNSTextAttributesFromTextAttributes(defaultTextAttributes);
|
|
145
|
+
|
|
146
|
+
// this can possibly be optimized
|
|
147
|
+
RCTMarkdownStyle *markdownStyle =
|
|
148
|
+
[[RCTMarkdownStyle alloc] initWithStruct:decoratorProps.markdownStyle];
|
|
149
|
+
RCTMarkdownUtils *utils = [[RCTMarkdownUtils alloc] init];
|
|
150
|
+
[utils setMarkdownStyle:markdownStyle];
|
|
151
|
+
[utils setParserId:[NSNumber numberWithInt:decoratorProps.parserId]];
|
|
152
|
+
|
|
153
|
+
// convert the attibuted string stored in state to
|
|
154
|
+
// NSAttributedString
|
|
155
|
+
auto nsAttributedString = RCTNSAttributedStringFromAttributedStringBox(
|
|
156
|
+
stateData.attributedStringBox);
|
|
157
|
+
|
|
158
|
+
auto newStateData = TextInputState(stateData);
|
|
159
|
+
|
|
160
|
+
if (stateData.attributedStringBox.getMode() ==
|
|
161
|
+
AttributedStringBox::Mode::Value) {
|
|
162
|
+
|
|
163
|
+
// Handles the first render, where the text stored in props is
|
|
164
|
+
// different than the one stored in state. The one in state is empty,
|
|
165
|
+
// while the one in props is passed from JS. If we don't update the
|
|
166
|
+
// state here, we'll end up with a one-default-line-sized text input
|
|
167
|
+
if (textInputState.getRevision() == State::initialRevisionValue) {
|
|
168
|
+
auto plainStringFromState =
|
|
169
|
+
std::string([[nsAttributedString string] UTF8String]);
|
|
170
|
+
|
|
171
|
+
if (plainStringFromState != textInputProps.text) {
|
|
172
|
+
// creates new AttributedString from props, adapted from
|
|
173
|
+
// TextInputShadowNode (ios one, text inputs are
|
|
174
|
+
// platform-specific)
|
|
175
|
+
auto attributedString = AttributedString{};
|
|
176
|
+
attributedString.appendFragment(AttributedString::Fragment{
|
|
177
|
+
textInputProps.text, defaultTextAttributes});
|
|
178
|
+
|
|
179
|
+
auto attachments = BaseTextShadowNode::Attachments{};
|
|
180
|
+
BaseTextShadowNode::buildAttributedString(
|
|
181
|
+
defaultTextAttributes, *textInput, attributedString, attachments);
|
|
182
|
+
|
|
183
|
+
// convert the newly created attributed string to
|
|
184
|
+
// NSAttributedString
|
|
185
|
+
nsAttributedString = RCTNSAttributedStringFromAttributedStringBox(
|
|
186
|
+
AttributedStringBox{attributedString});
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
// apply markdown
|
|
191
|
+
auto newString = [utils parseMarkdown:nsAttributedString
|
|
192
|
+
withDefaultTextAttributes:defaultNSTextAttributes];
|
|
193
|
+
|
|
194
|
+
// create a clone of the old TextInputState and update the
|
|
195
|
+
// attributed string box to point to the string with markdown
|
|
196
|
+
// applied
|
|
197
|
+
newStateData.attributedStringBox =
|
|
198
|
+
RCTAttributedStringBoxFromNSAttributedString(newString);
|
|
199
|
+
} else if (stateData.attributedStringBox.getMode() ==
|
|
200
|
+
AttributedStringBox::Mode::OpaquePointer) {
|
|
201
|
+
|
|
202
|
+
// apply markdown
|
|
203
|
+
auto newString = [utils parseMarkdown:nsAttributedString
|
|
204
|
+
withDefaultTextAttributes:defaultNSTextAttributes];
|
|
205
|
+
|
|
206
|
+
// create a clone of the old TextInputState and update the
|
|
207
|
+
// attributed string box to point to the string with markdown
|
|
208
|
+
// applied
|
|
209
|
+
newStateData.attributedStringBox =
|
|
210
|
+
RCTAttributedStringBoxFromNSAttributedString(newString);
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
textInput->setStateData(std::move(newStateData));
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
// this is private in YogaLayoutableShadowNode
|
|
217
|
+
YGSize MarkdownTextInputDecoratorShadowNode::yogaNodeMeasureCallbackConnector(
|
|
218
|
+
YGNodeConstRef yogaNode, float width, YGMeasureMode widthMode, float height,
|
|
219
|
+
YGMeasureMode heightMode) {
|
|
220
|
+
|
|
221
|
+
auto minimumSize = Size{0, 0};
|
|
222
|
+
auto maximumSize = Size{std::numeric_limits<Float>::infinity(),
|
|
223
|
+
std::numeric_limits<Float>::infinity()};
|
|
224
|
+
|
|
225
|
+
switch (widthMode) {
|
|
226
|
+
case YGMeasureModeUndefined:
|
|
227
|
+
break;
|
|
228
|
+
case YGMeasureModeExactly:
|
|
229
|
+
minimumSize.width = floatFromYogaFloat(width);
|
|
230
|
+
maximumSize.width = floatFromYogaFloat(width);
|
|
231
|
+
break;
|
|
232
|
+
case YGMeasureModeAtMost:
|
|
233
|
+
maximumSize.width = floatFromYogaFloat(width);
|
|
234
|
+
break;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
switch (heightMode) {
|
|
238
|
+
case YGMeasureModeUndefined:
|
|
239
|
+
break;
|
|
240
|
+
case YGMeasureModeExactly:
|
|
241
|
+
minimumSize.height = floatFromYogaFloat(height);
|
|
242
|
+
maximumSize.height = floatFromYogaFloat(height);
|
|
243
|
+
break;
|
|
244
|
+
case YGMeasureModeAtMost:
|
|
245
|
+
maximumSize.height = floatFromYogaFloat(height);
|
|
246
|
+
break;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
// This is where changes begin compared to the copied code
|
|
250
|
+
const auto &decoratorYogaNode = YGNodeGetParent(const_cast<YGNodeRef>(yogaNode));
|
|
251
|
+
const auto &decoratorShadowNode = shadowNodeFromContext(decoratorYogaNode);
|
|
252
|
+
|
|
253
|
+
LayoutContext context{};
|
|
254
|
+
context.fontSizeMultiplier = RCTFontSizeMultiplier();
|
|
255
|
+
|
|
256
|
+
const auto size = decoratorShadowNode.measureContent(context, {minimumSize, maximumSize});
|
|
257
|
+
|
|
258
|
+
return YGSize{yogaFloatFromFloat(size.width),
|
|
259
|
+
yogaFloatFromFloat(size.height)};
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
// this is private in YogaLayoutableShadowNode
|
|
263
|
+
YogaLayoutableShadowNode &
|
|
264
|
+
MarkdownTextInputDecoratorShadowNode::shadowNodeFromContext(
|
|
265
|
+
YGNodeConstRef yogaNode) {
|
|
266
|
+
return dynamic_cast<YogaLayoutableShadowNode &>(
|
|
267
|
+
*static_cast<ShadowNode *>(YGNodeGetContext(yogaNode)));
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
} // namespace react
|
|
271
|
+
} // namespace facebook
|
|
@@ -29,6 +29,12 @@
|
|
|
29
29
|
if (input == nil) {
|
|
30
30
|
return nil;
|
|
31
31
|
}
|
|
32
|
+
|
|
33
|
+
// `_markdownStyle` and `_parserId` may not be initialized immediately due to the order of mount instructions
|
|
34
|
+
// props update will be executed after the view hierarchy is initialized.
|
|
35
|
+
if (_markdownStyle == nil || _parserId == nil) {
|
|
36
|
+
return nil;
|
|
37
|
+
}
|
|
32
38
|
|
|
33
39
|
NSString *inputString = [input string];
|
|
34
40
|
if ([inputString isEqualToString:_prevInputString] && [defaultTextAttributes isEqualToDictionary:_prevDefaultTextAttributes] && [_markdownStyle isEqual:_prevMarkdownStyle] && [_parserId isEqualToNumber:_prevParserId]) {
|
|
@@ -3,20 +3,10 @@
|
|
|
3
3
|
#import <React/RCTUITextField.h>
|
|
4
4
|
#import <objc/message.h>
|
|
5
5
|
|
|
6
|
-
#import "MarkdownShadowFamilyRegistry.h"
|
|
7
|
-
|
|
8
|
-
using namespace expensify::livemarkdown;
|
|
9
|
-
|
|
10
6
|
@implementation RCTTextInputComponentView (Markdown)
|
|
11
7
|
|
|
12
8
|
- (void)setMarkdownUtils:(RCTMarkdownUtils *)markdownUtils {
|
|
13
9
|
objc_setAssociatedObject(self, @selector(getMarkdownUtils), markdownUtils, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
|
|
14
|
-
|
|
15
|
-
if (markdownUtils != nil) {
|
|
16
|
-
// force Markdown formatting on first render because `_setAttributedText` is called before `setMarkdownUtils`
|
|
17
|
-
RCTUITextField *backedTextInputView = [self getBackedTextInputView];
|
|
18
|
-
backedTextInputView.attributedText = [markdownUtils parseMarkdown:backedTextInputView.attributedText withDefaultTextAttributes:backedTextInputView.defaultTextAttributes];
|
|
19
|
-
}
|
|
20
10
|
}
|
|
21
11
|
|
|
22
12
|
- (RCTMarkdownUtils *)getMarkdownUtils {
|
|
@@ -34,12 +24,6 @@ using namespace expensify::livemarkdown;
|
|
|
34
24
|
RCTUITextField *backedTextInputView = [self getBackedTextInputView];
|
|
35
25
|
if (markdownUtils != nil && backedTextInputView != nil) {
|
|
36
26
|
attributedString = [markdownUtils parseMarkdown:attributedString withDefaultTextAttributes:backedTextInputView.defaultTextAttributes];
|
|
37
|
-
} else {
|
|
38
|
-
// If markdownUtils is undefined, the text input hasn't been mounted yet. It will
|
|
39
|
-
// update its state with the unformatted attributed string, we want to prevent displaying
|
|
40
|
-
// this state by applying markdown in the commit hook where we can read markdown styles
|
|
41
|
-
// from decorator props.
|
|
42
|
-
MarkdownShadowFamilyRegistry::forceNextStateUpdate((facebook::react::Tag)self.tag);
|
|
43
27
|
}
|
|
44
28
|
|
|
45
29
|
// Call the original method
|
|
@@ -10,29 +10,16 @@ class JSI_EXPORT MarkdownTextInputDecoratorState final {
|
|
|
10
10
|
public:
|
|
11
11
|
using Shared = std::shared_ptr<const MarkdownTextInputDecoratorState>;
|
|
12
12
|
|
|
13
|
-
MarkdownTextInputDecoratorState()
|
|
14
|
-
: decoratorFamily(nullptr), markdownUtils(nullptr){};
|
|
15
|
-
MarkdownTextInputDecoratorState(
|
|
16
|
-
const ShadowNodeFamily::Shared textInputFamily_)
|
|
17
|
-
: decoratorFamily(textInputFamily_), markdownUtils(nullptr){};
|
|
18
|
-
MarkdownTextInputDecoratorState(
|
|
19
|
-
const ShadowNodeFamily::Shared textInputFamily_,
|
|
20
|
-
const std::shared_ptr<void> markdownUtils_)
|
|
21
|
-
: decoratorFamily(textInputFamily_), markdownUtils(markdownUtils_){};
|
|
13
|
+
MarkdownTextInputDecoratorState(){};
|
|
22
14
|
|
|
23
15
|
#ifdef ANDROID
|
|
24
16
|
MarkdownTextInputDecoratorState(
|
|
25
|
-
MarkdownTextInputDecoratorState const &previousState, folly::dynamic data)
|
|
26
|
-
: decoratorFamily(previousState.decoratorFamily),
|
|
27
|
-
markdownUtils(nullptr){};
|
|
17
|
+
MarkdownTextInputDecoratorState const &previousState, folly::dynamic data){};
|
|
28
18
|
#endif
|
|
29
19
|
|
|
30
|
-
const ShadowNodeFamily::Shared decoratorFamily;
|
|
31
|
-
const std::shared_ptr<void> markdownUtils;
|
|
32
|
-
|
|
33
20
|
#ifdef ANDROID
|
|
34
21
|
folly::dynamic getDynamic() const {
|
|
35
|
-
return
|
|
22
|
+
return {};
|
|
36
23
|
}
|
|
37
24
|
MapBuffer getMapBuffer() const { return MapBufferBuilder::EMPTY(); };
|
|
38
25
|
#endif
|
|
@@ -78,19 +78,17 @@ const MarkdownTextInput = /*#__PURE__*/_react.default.forwardRef((props, ref) =>
|
|
|
78
78
|
_react.default.useEffect(() => {
|
|
79
79
|
return () => unregisterParser(parserId);
|
|
80
80
|
}, [parserId]);
|
|
81
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
82
|
-
|
|
83
|
-
})), /*#__PURE__*/_react.default.createElement(_MarkdownTextInputDecoratorViewNativeComponent.default, {
|
|
84
|
-
style: styles.farAway,
|
|
81
|
+
return /*#__PURE__*/_react.default.createElement(_MarkdownTextInputDecoratorViewNativeComponent.default, {
|
|
82
|
+
style: styles.displayContents,
|
|
85
83
|
markdownStyle: markdownStyle,
|
|
86
84
|
parserId: parserId
|
|
87
|
-
}
|
|
85
|
+
}, /*#__PURE__*/_react.default.createElement(_reactNative.TextInput, _extends({}, props, {
|
|
86
|
+
ref: ref
|
|
87
|
+
})));
|
|
88
88
|
});
|
|
89
89
|
const styles = _reactNative.StyleSheet.create({
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
top: 1e8,
|
|
93
|
-
left: 1e8
|
|
90
|
+
displayContents: {
|
|
91
|
+
display: 'contents'
|
|
94
92
|
}
|
|
95
93
|
});
|
|
96
94
|
var _default = exports.default = MarkdownTextInput;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","_react","_interopRequireDefault","_reactNativeReanimated","_MarkdownTextInputDecoratorViewNativeComponent","_NativeLiveMarkdownModule","_styleUtils","e","__esModule","default","_extends","Object","assign","bind","n","arguments","length","t","r","hasOwnProperty","call","apply","initialized","workletRuntime","getWorkletRuntime","undefined","Error","initializeLiveMarkdownIfNeeded","NativeLiveMarkdownModule","install","global","jsi_setMarkdownRuntime","createWorkletRuntime","registerParser","parser","shareableWorklet","makeShareableCloneRecursive","parserId","jsi_registerMarkdownWorklet","unregisterParser","jsi_unregisterMarkdownWorklet","processColorsInMarkdownStyle","input","output","JSON","parse","stringify","keys","forEach","key","obj","prop","endsWith","processColor","processMarkdownStyle","mergeMarkdownStyleWithDefault","MarkdownTextInput","React","forwardRef","props","ref","markdownStyle","useMemo","workletHash","__workletHash","useEffect","createElement","
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_react","_interopRequireDefault","_reactNativeReanimated","_MarkdownTextInputDecoratorViewNativeComponent","_NativeLiveMarkdownModule","_styleUtils","e","__esModule","default","_extends","Object","assign","bind","n","arguments","length","t","r","hasOwnProperty","call","apply","initialized","workletRuntime","getWorkletRuntime","undefined","Error","initializeLiveMarkdownIfNeeded","NativeLiveMarkdownModule","install","global","jsi_setMarkdownRuntime","createWorkletRuntime","registerParser","parser","shareableWorklet","makeShareableCloneRecursive","parserId","jsi_registerMarkdownWorklet","unregisterParser","jsi_unregisterMarkdownWorklet","processColorsInMarkdownStyle","input","output","JSON","parse","stringify","keys","forEach","key","obj","prop","endsWith","processColor","processMarkdownStyle","mergeMarkdownStyleWithDefault","MarkdownTextInput","React","forwardRef","props","ref","markdownStyle","useMemo","workletHash","__workletHash","useEffect","createElement","style","styles","displayContents","TextInput","StyleSheet","create","display","_default","exports"],"sourceRoot":"../../src","sources":["MarkdownTextInput.tsx"],"mappings":";;;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AAEA,IAAAG,sBAAA,GAAAH,OAAA;AAIA,IAAAI,8CAAA,GAAAF,sBAAA,CAAAF,OAAA;AAEA,IAAAK,yBAAA,GAAAH,sBAAA,CAAAF,OAAA;AACA,IAAAM,WAAA,GAAAN,OAAA;AAA2D,SAAAE,uBAAAK,CAAA,WAAAA,CAA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,MAAM,CAA8B8B,aAAa;EAC5E,IAAID,WAAW,KAAKtC,SAAS,EAAE;IAC7B,MAAM,IAAIC,KAAK,CAAC,wDAAwD,CAAC;EAC3E;EAEA,MAAMW,QAAQ,GAAGoB,cAAK,CAACK,OAAO,CAAC,MAAM;IACnC,OAAO7B,cAAc,CAAC0B,KAAK,CAACzB,MAAM,CAAC;EACrC,CAAC,EAAE,CAACyB,KAAK,CAACzB,MAAM,CAAC,CAAC;EAElBuB,cAAK,CAACQ,SAAS,CAAC,MAAM;IACpB,OAAO,MAAM1B,gBAAgB,CAACF,QAAQ,CAAC;EACzC,CAAC,EAAE,CAACA,QAAQ,CAAC,CAAC;EAEd,oBACEpC,MAAA,CAAAQ,OAAA,CAAAyD,aAAA,CAAC9D,8CAAA,CAAAK,OAA6C;IAC5C0D,KAAK,EAAEC,MAAM,CAACC,eAAgB;IAC9BR,aAAa,EAAEA,aAAc;IAC7BxB,QAAQ,EAAEA;EAAS,gBAEnBpC,MAAA,CAAAQ,OAAA,CAAAyD,aAAA,CAACnE,YAAA,CAAAuE,SAAS,EAAA5D,QAAA,KACJiD,KAAK;IACTC,GAAG,EAAEA;EAAI,EACV,CAC4C,CAAC;AAEpD,CAAC,CAAC;AAEF,MAAMQ,MAAM,GAAGG,uBAAU,CAACC,MAAM,CAAC;EAC/BH,eAAe,EAAE;IACfI,OAAO,EAAE;EACX;AACF,CAAC,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAlE,OAAA,GAIY+C,iBAAiB","ignoreList":[]}
|
|
@@ -70,19 +70,17 @@ const MarkdownTextInput = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
70
70
|
React.useEffect(() => {
|
|
71
71
|
return () => unregisterParser(parserId);
|
|
72
72
|
}, [parserId]);
|
|
73
|
-
return /*#__PURE__*/React.createElement(
|
|
74
|
-
|
|
75
|
-
})), /*#__PURE__*/React.createElement(MarkdownTextInputDecoratorViewNativeComponent, {
|
|
76
|
-
style: styles.farAway,
|
|
73
|
+
return /*#__PURE__*/React.createElement(MarkdownTextInputDecoratorViewNativeComponent, {
|
|
74
|
+
style: styles.displayContents,
|
|
77
75
|
markdownStyle: markdownStyle,
|
|
78
76
|
parserId: parserId
|
|
79
|
-
}
|
|
77
|
+
}, /*#__PURE__*/React.createElement(TextInput, _extends({}, props, {
|
|
78
|
+
ref: ref
|
|
79
|
+
})));
|
|
80
80
|
});
|
|
81
81
|
const styles = StyleSheet.create({
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
top: 1e8,
|
|
85
|
-
left: 1e8
|
|
82
|
+
displayContents: {
|
|
83
|
+
display: 'contents'
|
|
86
84
|
}
|
|
87
85
|
});
|
|
88
86
|
export default MarkdownTextInput;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["StyleSheet","TextInput","processColor","React","createWorkletRuntime","makeShareableCloneRecursive","MarkdownTextInputDecoratorViewNativeComponent","NativeLiveMarkdownModule","mergeMarkdownStyleWithDefault","initialized","workletRuntime","getWorkletRuntime","undefined","Error","initializeLiveMarkdownIfNeeded","install","global","jsi_setMarkdownRuntime","registerParser","parser","shareableWorklet","parserId","jsi_registerMarkdownWorklet","unregisterParser","jsi_unregisterMarkdownWorklet","processColorsInMarkdownStyle","input","output","JSON","parse","stringify","Object","keys","forEach","key","obj","prop","endsWith","processMarkdownStyle","MarkdownTextInput","forwardRef","props","ref","markdownStyle","useMemo","workletHash","__workletHash","useEffect","createElement","
|
|
1
|
+
{"version":3,"names":["StyleSheet","TextInput","processColor","React","createWorkletRuntime","makeShareableCloneRecursive","MarkdownTextInputDecoratorViewNativeComponent","NativeLiveMarkdownModule","mergeMarkdownStyleWithDefault","initialized","workletRuntime","getWorkletRuntime","undefined","Error","initializeLiveMarkdownIfNeeded","install","global","jsi_setMarkdownRuntime","registerParser","parser","shareableWorklet","parserId","jsi_registerMarkdownWorklet","unregisterParser","jsi_unregisterMarkdownWorklet","processColorsInMarkdownStyle","input","output","JSON","parse","stringify","Object","keys","forEach","key","obj","prop","endsWith","processMarkdownStyle","MarkdownTextInput","forwardRef","props","ref","markdownStyle","useMemo","workletHash","__workletHash","useEffect","createElement","style","styles","displayContents","_extends","create","display"],"sourceRoot":"../../src","sources":["MarkdownTextInput.tsx"],"mappings":";AAAA,SAAQA,UAAU,EAAEC,SAAS,EAAEC,YAAY,QAAO,cAAc;AAChE,OAAOC,KAAK,MAAM,OAAO;AAEzB,SAAQC,oBAAoB,EAAEC,2BAA2B,QAAO,yBAAyB;AAIzF,OAAOC,6CAA6C,MAAM,iDAAiD;AAE3G,OAAOC,wBAAwB,MAAM,4BAA4B;AACjE,SAAQC,6BAA6B,QAAO,cAAc;AAa1D,IAAIC,WAAW,GAAG,KAAK;AACvB,IAAIC,cAA0C;AAE9C,SAASC,iBAAiBA,CAAA,EAAmB;EAC3C,IAAID,cAAc,KAAKE,SAAS,EAAE;IAChC,MAAM,IAAIC,KAAK,CACb,qNACF,CAAC;EACH;EACA,OAAOH,cAAc;AACvB;AAEA,SAASI,8BAA8BA,CAAA,EAAG;EACxC,IAAIL,WAAW,EAAE;IACf;EACF;EACA,IAAIF,wBAAwB,EAAE;IAC5BA,wBAAwB,CAACQ,OAAO,CAAC,CAAC;EACpC;EACA,IAAI,CAACC,MAAM,CAACC,sBAAsB,EAAE;IAClC,MAAM,IAAIJ,KAAK,CAAC,6EAA6E,CAAC;EAChG;EACAH,cAAc,GAAGN,oBAAoB,CAAC,qBAAqB,CAAC;EAC5DY,MAAM,CAACC,sBAAsB,CAACP,cAAc,CAAC;EAC7CD,WAAW,GAAG,IAAI;AACpB;AAEA,SAASS,cAAcA,CAACC,MAA0C,EAAU;EAC1EL,8BAA8B,CAAC,CAAC;EAChC,MAAMM,gBAAgB,GAAGf,2BAA2B,CAACc,MAAM,CAA6D;EACxH,MAAME,QAAQ,GAAGL,MAAM,CAACM,2BAA2B,CAACF,gBAAgB,CAAC;EACrE,OAAOC,QAAQ;AACjB;AAEA,SAASE,gBAAgBA,CAACF,QAAgB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ANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@expensify/react-native-live-markdown",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.257",
|
|
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",
|
|
@@ -115,25 +115,22 @@ const MarkdownTextInput = React.forwardRef<MarkdownTextInput, MarkdownTextInputP
|
|
|
115
115
|
}, [parserId]);
|
|
116
116
|
|
|
117
117
|
return (
|
|
118
|
-
|
|
118
|
+
<MarkdownTextInputDecoratorViewNativeComponent
|
|
119
|
+
style={styles.displayContents}
|
|
120
|
+
markdownStyle={markdownStyle}
|
|
121
|
+
parserId={parserId}
|
|
122
|
+
>
|
|
119
123
|
<TextInput
|
|
120
124
|
{...props}
|
|
121
125
|
ref={ref}
|
|
122
126
|
/>
|
|
123
|
-
|
|
124
|
-
style={styles.farAway}
|
|
125
|
-
markdownStyle={markdownStyle}
|
|
126
|
-
parserId={parserId}
|
|
127
|
-
/>
|
|
128
|
-
</>
|
|
127
|
+
</MarkdownTextInputDecoratorViewNativeComponent>
|
|
129
128
|
);
|
|
130
129
|
});
|
|
131
130
|
|
|
132
131
|
const styles = StyleSheet.create({
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
top: 1e8,
|
|
136
|
-
left: 1e8,
|
|
132
|
+
displayContents: {
|
|
133
|
+
display: 'contents',
|
|
137
134
|
},
|
|
138
135
|
});
|
|
139
136
|
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
package com.expensify.livemarkdown;
|
|
2
|
-
|
|
3
|
-
import com.facebook.jni.HybridData;
|
|
4
|
-
import com.facebook.proguard.annotations.DoNotStrip;
|
|
5
|
-
import com.facebook.react.fabric.FabricUIManager;
|
|
6
|
-
import com.facebook.soloader.SoLoader;
|
|
7
|
-
|
|
8
|
-
public class NativeProxy {
|
|
9
|
-
static {
|
|
10
|
-
SoLoader.loadLibrary("react_codegen_RNLiveMarkdownSpec");
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
@DoNotStrip
|
|
14
|
-
@SuppressWarnings("unused")
|
|
15
|
-
private final HybridData mHybridData;
|
|
16
|
-
|
|
17
|
-
public NativeProxy() {
|
|
18
|
-
mHybridData = initHybrid();
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
private native HybridData initHybrid();
|
|
22
|
-
|
|
23
|
-
public native void createCommitHook(FabricUIManager fabricUIManager);
|
|
24
|
-
}
|