@expensify/react-native-live-markdown 0.1.121 → 0.1.123
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/README.md +1 -1
- package/android/src/main/java/com/expensify/livemarkdown/CustomMountingManager.java +2 -2
- package/android/src/main/java/com/expensify/livemarkdown/LiveMarkdownModule.java +0 -1
- package/android/src/main/java/com/expensify/livemarkdown/MarkdownUtils.java +1 -6
- package/android/src/main/new_arch/CMakeLists.txt +4 -2
- package/cpp/react/renderer/components/RNLiveMarkdownSpec/MarkdownTextInputDecoratorShadowNode.cpp +3 -3
- package/cpp/react/renderer/components/RNLiveMarkdownSpec/MarkdownTextInputDecoratorShadowNode.h +16 -3
- package/lib/commonjs/MarkdownTextInput.web.js +1 -1
- package/lib/module/MarkdownTextInput.web.js +1 -1
- package/package.json +5 -4
- package/src/MarkdownTextInput.web.tsx +1 -1
package/README.md
CHANGED
|
@@ -132,7 +132,7 @@ Currently, `react-native-live-markdown` supports only [ExpensiMark](https://gith
|
|
|
132
132
|
|
|
133
133
|
## Compatibility
|
|
134
134
|
|
|
135
|
-
`react-native-live-markdown` requires React Native 0.
|
|
135
|
+
`react-native-live-markdown` requires React Native 0.74 or newer.
|
|
136
136
|
|
|
137
137
|
## License
|
|
138
138
|
|
|
@@ -21,8 +21,8 @@ import com.facebook.react.fabric.mounting.MountingManager;
|
|
|
21
21
|
import com.facebook.react.uimanager.PixelUtil;
|
|
22
22
|
import com.facebook.react.uimanager.ViewManagerRegistry;
|
|
23
23
|
import com.facebook.react.views.text.TextAttributeProps;
|
|
24
|
-
import com.facebook.react.views.text.TextInlineViewPlaceholderSpan;
|
|
25
24
|
import com.facebook.react.views.text.TextLayoutManagerMapBuffer;
|
|
25
|
+
import com.facebook.react.views.text.internal.span.TextInlineViewPlaceholderSpan;
|
|
26
26
|
import com.facebook.yoga.YogaMeasureMode;
|
|
27
27
|
import com.facebook.yoga.YogaMeasureOutput;
|
|
28
28
|
|
|
@@ -44,7 +44,7 @@ public class CustomMountingManager extends MountingManager {
|
|
|
44
44
|
|
|
45
45
|
AssetManager assetManager = context.getAssets();
|
|
46
46
|
MarkdownUtils.maybeInitializeRuntime(assetManager);
|
|
47
|
-
|
|
47
|
+
|
|
48
48
|
this.markdownUtils = new MarkdownUtils(assetManager);
|
|
49
49
|
this.markdownUtils.setMarkdownStyle(new MarkdownStyle(decoratorProps, context));
|
|
50
50
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
package com.expensify.livemarkdown;
|
|
2
2
|
|
|
3
3
|
import com.facebook.react.bridge.ReactApplicationContext;
|
|
4
|
-
import com.facebook.react.bridge.UIManager;
|
|
5
4
|
import com.facebook.react.fabric.FabricUIManager;
|
|
6
5
|
import com.facebook.react.uimanager.UIManagerHelper;
|
|
7
6
|
import com.facebook.react.uimanager.common.UIManagerType;
|
|
@@ -1,17 +1,12 @@
|
|
|
1
1
|
package com.expensify.livemarkdown;
|
|
2
2
|
|
|
3
|
-
import static com.facebook.infer.annotation.ThreadConfined.UI;
|
|
4
|
-
|
|
5
3
|
import android.content.res.AssetManager;
|
|
6
4
|
import android.text.SpannableStringBuilder;
|
|
7
5
|
import android.text.Spanned;
|
|
8
6
|
|
|
9
7
|
import androidx.annotation.NonNull;
|
|
10
8
|
|
|
11
|
-
import com.facebook.
|
|
12
|
-
import com.facebook.infer.annotation.ThreadConfined;
|
|
13
|
-
import com.facebook.react.bridge.UiThreadUtil;
|
|
14
|
-
import com.facebook.react.views.text.CustomLineHeightSpan;
|
|
9
|
+
import com.facebook.react.views.text.internal.span.CustomLineHeightSpan;
|
|
15
10
|
import com.facebook.soloader.SoLoader;
|
|
16
11
|
|
|
17
12
|
import org.json.JSONArray;
|
|
@@ -19,7 +19,7 @@ set(RN_DIR ${LIB_ANDROID_DIR}/../example/node_modules/react-native)
|
|
|
19
19
|
|
|
20
20
|
add_library(
|
|
21
21
|
${LIB_TARGET_NAME}
|
|
22
|
-
SHARED
|
|
22
|
+
SHARED
|
|
23
23
|
${LIB_MODULE_SRCS}
|
|
24
24
|
${LIB_CUSTOM_SRCS}
|
|
25
25
|
${LIB_CODEGEN_SRCS}
|
|
@@ -42,6 +42,8 @@ target_link_libraries(
|
|
|
42
42
|
ReactAndroid::rrc_textinput
|
|
43
43
|
ReactAndroid::react_render_textlayoutmanager
|
|
44
44
|
ReactAndroid::react_render_imagemanager
|
|
45
|
+
ReactAndroid::reactnativejni
|
|
46
|
+
ReactAndroid::mapbufferjni
|
|
45
47
|
fabricjni
|
|
46
48
|
fbjni
|
|
47
49
|
folly_runtime
|
|
@@ -79,4 +81,4 @@ target_include_directories(
|
|
|
79
81
|
${CMAKE_PROJECT_NAME}
|
|
80
82
|
PUBLIC
|
|
81
83
|
${CMAKE_CURRENT_SOURCE_DIR}
|
|
82
|
-
)
|
|
84
|
+
)
|
package/cpp/react/renderer/components/RNLiveMarkdownSpec/MarkdownTextInputDecoratorShadowNode.cpp
CHANGED
|
@@ -11,7 +11,7 @@ namespace react {
|
|
|
11
11
|
extern const char MarkdownTextInputDecoratorViewComponentName[] =
|
|
12
12
|
"MarkdownTextInputDecoratorView";
|
|
13
13
|
|
|
14
|
-
const
|
|
14
|
+
const OwningShadowNodeFragment
|
|
15
15
|
MarkdownTextInputDecoratorShadowNode::updateFragmentState(
|
|
16
16
|
ShadowNodeFragment const &fragment,
|
|
17
17
|
ShadowNodeFamily::Shared const &family) {
|
|
@@ -24,12 +24,12 @@ MarkdownTextInputDecoratorShadowNode::updateFragmentState(
|
|
|
24
24
|
// propagated on every clone we need it to clear the reference in the registry
|
|
25
25
|
// when the view is removed from window it cannot be done in the destructor,
|
|
26
26
|
// as multiple shadow nodes for the same family may be created
|
|
27
|
-
return
|
|
27
|
+
return OwningShadowNodeFragment{
|
|
28
28
|
.props = fragment.props,
|
|
29
29
|
.children = fragment.children,
|
|
30
30
|
.state =
|
|
31
31
|
std::make_shared<const ConcreteState>(newStateData, *fragment.state),
|
|
32
|
-
}
|
|
32
|
+
};
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
} // namespace react
|
package/cpp/react/renderer/components/RNLiveMarkdownSpec/MarkdownTextInputDecoratorShadowNode.h
CHANGED
|
@@ -11,6 +11,20 @@
|
|
|
11
11
|
namespace facebook {
|
|
12
12
|
namespace react {
|
|
13
13
|
|
|
14
|
+
struct OwningShadowNodeFragment {
|
|
15
|
+
Props::Shared props;
|
|
16
|
+
ShadowNode::SharedListOfShared children;
|
|
17
|
+
State::Shared state;
|
|
18
|
+
|
|
19
|
+
operator ShadowNodeFragment() const {
|
|
20
|
+
return ShadowNodeFragment {
|
|
21
|
+
.props = props,
|
|
22
|
+
.children = children,
|
|
23
|
+
.state = state
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
|
|
14
28
|
JSI_EXPORT extern const char MarkdownTextInputDecoratorViewComponentName[];
|
|
15
29
|
|
|
16
30
|
class JSI_EXPORT MarkdownTextInputDecoratorShadowNode final
|
|
@@ -22,8 +36,7 @@ public:
|
|
|
22
36
|
MarkdownTextInputDecoratorShadowNode(ShadowNodeFragment const &fragment,
|
|
23
37
|
ShadowNodeFamily::Shared const &family,
|
|
24
38
|
ShadowNodeTraits traits)
|
|
25
|
-
: ConcreteViewShadowNode(
|
|
26
|
-
updateFragmentState(fragment, family)),
|
|
39
|
+
: ConcreteViewShadowNode(updateFragmentState(fragment, family),
|
|
27
40
|
family, traits) {}
|
|
28
41
|
|
|
29
42
|
MarkdownTextInputDecoratorShadowNode(ShadowNode const &sourceShadowNode,
|
|
@@ -37,7 +50,7 @@ public:
|
|
|
37
50
|
}
|
|
38
51
|
|
|
39
52
|
private:
|
|
40
|
-
static const
|
|
53
|
+
static const OwningShadowNodeFragment
|
|
41
54
|
updateFragmentState(ShadowNodeFragment const &fragment,
|
|
42
55
|
ShadowNodeFamily::Shared const &family);
|
|
43
56
|
};
|
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.123",
|
|
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",
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
"nodemon": "^3.1.3",
|
|
92
92
|
"prettier": "2.8.8",
|
|
93
93
|
"react": "18.2.0",
|
|
94
|
-
"react-native": "0.
|
|
94
|
+
"react-native": "0.74.5",
|
|
95
95
|
"react-native-builder-bob": "^0.20.0",
|
|
96
96
|
"react-native-web": "^0.19.10",
|
|
97
97
|
"release-it": "^15.0.0",
|
|
@@ -100,7 +100,8 @@
|
|
|
100
100
|
},
|
|
101
101
|
"resolutions": {
|
|
102
102
|
"@types/react": "17.0.21",
|
|
103
|
-
"link@^2.1.1": "patch:link@npm%3A2.1.1#./.yarn/patches/link-npm-2.1.1-1c9fea076e.patch"
|
|
103
|
+
"link@^2.1.1": "patch:link@npm%3A2.1.1#./.yarn/patches/link-npm-2.1.1-1c9fea076e.patch",
|
|
104
|
+
"react-native@0.74.5": "patch:react-native@npm%3A0.74.5#./.yarn/patches/react-native-npm-0.74.5-3cfd406787.patch"
|
|
104
105
|
},
|
|
105
106
|
"peerDependencies": {
|
|
106
107
|
"react": "*",
|
|
@@ -111,7 +112,7 @@
|
|
|
111
112
|
"example",
|
|
112
113
|
"WebExample"
|
|
113
114
|
],
|
|
114
|
-
"packageManager": "yarn@3.6.
|
|
115
|
+
"packageManager": "yarn@3.6.4",
|
|
115
116
|
"engines": {
|
|
116
117
|
"node": ">= 18.0.0"
|
|
117
118
|
},
|