@expensify/react-native-live-markdown 0.1.122 → 0.1.124

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.
@@ -11,7 +11,7 @@ namespace react {
11
11
  extern const char MarkdownTextInputDecoratorViewComponentName[] =
12
12
  "MarkdownTextInputDecoratorView";
13
13
 
14
- const ShadowNodeFragment::Value
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 ShadowNodeFragment::Value({
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
@@ -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(static_cast<ShadowNodeFragment>(
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 ShadowNodeFragment::Value
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.122",
3
+ "version": "0.1.124",
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",