@expensify/react-native-live-markdown 0.1.136 → 0.1.138
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/cpp/react/renderer/components/RNLiveMarkdownSpec/MarkdownShadowFamilyRegistry.cpp +6 -0
- package/cpp/react/renderer/components/RNLiveMarkdownSpec/MarkdownShadowFamilyRegistry.h +6 -0
- package/cpp/react/renderer/components/RNLiveMarkdownSpec/MarkdownTextInputDecoratorShadowNode.cpp +2 -0
- package/cpp/react/renderer/components/RNLiveMarkdownSpec/MarkdownTextInputDecoratorShadowNode.h +2 -0
- package/ios/MarkdownCommitHook.h +2 -0
- package/ios/MarkdownCommitHook.mm +2 -0
- package/ios/RCTLiveMarkdownModule.h +4 -0
- package/ios/RCTLiveMarkdownModule.mm +4 -3
- package/ios/RCTTextInputComponentView+Markdown.mm +2 -0
- package/package.json +1 -1
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
#include "MarkdownShadowFamilyRegistry.h"
|
|
4
4
|
|
|
5
|
+
namespace expensify {
|
|
6
|
+
namespace livemarkdown {
|
|
7
|
+
|
|
5
8
|
std::set<facebook::react::ShadowNodeFamily::Shared>
|
|
6
9
|
MarkdownShadowFamilyRegistry::familiesToUpdate_;
|
|
7
10
|
std::set<facebook::react::Tag> MarkdownShadowFamilyRegistry::forcedUpdates_;
|
|
@@ -55,4 +58,7 @@ bool MarkdownShadowFamilyRegistry::shouldForceUpdate(facebook::react::Tag tag) {
|
|
|
55
58
|
return false;
|
|
56
59
|
}
|
|
57
60
|
|
|
61
|
+
} // namespace livemarkdown
|
|
62
|
+
} // namespace expensify
|
|
63
|
+
|
|
58
64
|
#endif
|
|
@@ -6,6 +6,9 @@
|
|
|
6
6
|
#include <mutex>
|
|
7
7
|
#include <set>
|
|
8
8
|
|
|
9
|
+
namespace expensify {
|
|
10
|
+
namespace livemarkdown {
|
|
11
|
+
|
|
9
12
|
// A registry to store pointers to the ShadowNodeFamilies of markdown
|
|
10
13
|
// decorators. The only place we can _legally_ access the family of shadow node
|
|
11
14
|
// is in the constructor and we need it inside commit hook. To achieve it, we
|
|
@@ -32,4 +35,7 @@ private:
|
|
|
32
35
|
static std::mutex mutex_;
|
|
33
36
|
};
|
|
34
37
|
|
|
38
|
+
} // namespace livemarkdown
|
|
39
|
+
} // namespace expensify
|
|
40
|
+
|
|
35
41
|
#endif
|
package/ios/MarkdownCommitHook.h
CHANGED
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
|
|
12
12
|
using namespace facebook::react;
|
|
13
13
|
|
|
14
|
+
namespace expensify {
|
|
14
15
|
namespace livemarkdown {
|
|
15
16
|
|
|
16
17
|
struct MarkdownTextInputDecoratorPair {
|
|
@@ -38,5 +39,6 @@ private:
|
|
|
38
39
|
};
|
|
39
40
|
|
|
40
41
|
} // namespace livemarkdown
|
|
42
|
+
} // namespace expensify
|
|
41
43
|
|
|
42
44
|
#endif // RCT_NEW_ARCH_ENABLED
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
|
|
12
12
|
using namespace facebook::react;
|
|
13
13
|
|
|
14
|
+
namespace expensify {
|
|
14
15
|
namespace livemarkdown {
|
|
15
16
|
|
|
16
17
|
MarkdownCommitHook::MarkdownCommitHook(
|
|
@@ -192,5 +193,6 @@ RootShadowNode::Unshared MarkdownCommitHook::shadowTreeWillCommit(
|
|
|
192
193
|
}
|
|
193
194
|
|
|
194
195
|
} // namespace livemarkdown
|
|
196
|
+
} // namespace expensify
|
|
195
197
|
|
|
196
198
|
#endif // RCT_NEW_ARCH_ENABLED
|
|
@@ -4,9 +4,13 @@
|
|
|
4
4
|
#import <React/RCTEventEmitter.h>
|
|
5
5
|
#import <React/RCTUIManager.h>
|
|
6
6
|
|
|
7
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
8
|
+
|
|
7
9
|
// Without inheriting after RCTEventEmitter we don't get access to bridge
|
|
8
10
|
@interface RCTLiveMarkdownModule
|
|
9
11
|
: RCTEventEmitter <NativeLiveMarkdownModuleSpec>
|
|
10
12
|
@end
|
|
11
13
|
|
|
14
|
+
NS_ASSUME_NONNULL_END
|
|
15
|
+
|
|
12
16
|
#endif // RCT_NEW_ARCH_ENABLED
|
|
@@ -7,13 +7,15 @@
|
|
|
7
7
|
#import "MarkdownShadowFamilyRegistry.h"
|
|
8
8
|
#import "RCTLiveMarkdownModule.h"
|
|
9
9
|
|
|
10
|
+
using namespace expensify::livemarkdown;
|
|
11
|
+
|
|
10
12
|
// A turbomodule used to register the commit hook
|
|
11
13
|
// I think this is the easiest way to access the UIManager, which we need to
|
|
12
14
|
// actually register the hook
|
|
13
15
|
|
|
14
16
|
@implementation RCTLiveMarkdownModule {
|
|
15
17
|
BOOL installed_;
|
|
16
|
-
std::shared_ptr<
|
|
18
|
+
std::shared_ptr<MarkdownCommitHook> commitHook_;
|
|
17
19
|
__weak RCTSurfacePresenter *surfacePresenter_;
|
|
18
20
|
}
|
|
19
21
|
|
|
@@ -23,8 +25,7 @@ RCT_EXPORT_MODULE(@"LiveMarkdownModule")
|
|
|
23
25
|
if (!installed_ && surfacePresenter_ != nil) {
|
|
24
26
|
RCTScheduler *scheduler = [surfacePresenter_ scheduler];
|
|
25
27
|
|
|
26
|
-
commitHook_ =
|
|
27
|
-
std::make_shared<livemarkdown::MarkdownCommitHook>(scheduler.uiManager);
|
|
28
|
+
commitHook_ = std::make_shared<MarkdownCommitHook>(scheduler.uiManager);
|
|
28
29
|
installed_ = YES;
|
|
29
30
|
}
|
|
30
31
|
return @1;
|
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.138",
|
|
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",
|