diff --git a/RNLiveMarkdown.podspec b/RNLiveMarkdown.podspec index a22f0de00..f2601e76c 100644 --- a/RNLiveMarkdown.podspec +++ b/RNLiveMarkdown.podspec @@ -30,10 +30,10 @@ Pod::Spec.new do |s| install_modules_dependencies(s) - if ENV['USE_FRAMEWORKS'] && ENV['RCT_NEW_ARCH_ENABLED'] - add_dependency(s, "React-Fabric", :additional_framework_paths => [ + if ENV['USE_FRAMEWORKS'] != nil && ENV['RCT_NEW_ARCH_ENABLED'] == '1' + add_dependency(s, "React-FabricComponents", :additional_framework_paths => [ "react/renderer/textlayoutmanager/platform/ios", - "react/renderer/components/textinput/iostextinput", + "react/renderer/components/textinput/platform/ios", ]) end diff --git a/cpp/react/renderer/components/RNLiveMarkdownSpec/MarkdownShadowFamilyRegistry.cpp b/cpp/react/renderer/components/RNLiveMarkdownSpec/MarkdownShadowFamilyRegistry.cpp index 1a0f4a746..de564b32f 100644 --- a/cpp/react/renderer/components/RNLiveMarkdownSpec/MarkdownShadowFamilyRegistry.cpp +++ b/cpp/react/renderer/components/RNLiveMarkdownSpec/MarkdownShadowFamilyRegistry.cpp @@ -2,6 +2,9 @@ #include "MarkdownShadowFamilyRegistry.h" +namespace expensify { +namespace livemarkdown { + std::set MarkdownShadowFamilyRegistry::familiesToUpdate_; std::set MarkdownShadowFamilyRegistry::forcedUpdates_; @@ -55,4 +58,7 @@ bool MarkdownShadowFamilyRegistry::shouldForceUpdate(facebook::react::Tag tag) { return false; } +} // namespace livemarkdown +} // namespace expensify + #endif diff --git a/cpp/react/renderer/components/RNLiveMarkdownSpec/MarkdownShadowFamilyRegistry.h b/cpp/react/renderer/components/RNLiveMarkdownSpec/MarkdownShadowFamilyRegistry.h index f76c87d8b..4e9431b5f 100644 --- a/cpp/react/renderer/components/RNLiveMarkdownSpec/MarkdownShadowFamilyRegistry.h +++ b/cpp/react/renderer/components/RNLiveMarkdownSpec/MarkdownShadowFamilyRegistry.h @@ -6,6 +6,9 @@ #include #include +namespace expensify { +namespace livemarkdown { + // A registry to store pointers to the ShadowNodeFamilies of markdown // decorators. The only place we can _legally_ access the family of shadow node // is in the constructor and we need it inside commit hook. To achieve it, we @@ -32,4 +35,7 @@ class MarkdownShadowFamilyRegistry { static std::mutex mutex_; }; +} // namespace livemarkdown +} // namespace expensify + #endif diff --git a/cpp/react/renderer/components/RNLiveMarkdownSpec/MarkdownTextInputDecoratorShadowNode.cpp b/cpp/react/renderer/components/RNLiveMarkdownSpec/MarkdownTextInputDecoratorShadowNode.cpp index 9240e9ebb..ae56126df 100644 --- a/cpp/react/renderer/components/RNLiveMarkdownSpec/MarkdownTextInputDecoratorShadowNode.cpp +++ b/cpp/react/renderer/components/RNLiveMarkdownSpec/MarkdownTextInputDecoratorShadowNode.cpp @@ -5,6 +5,8 @@ #include "MarkdownShadowFamilyRegistry.h" #include "MarkdownTextInputDecoratorShadowNode.h" +using namespace expensify::livemarkdown; + namespace facebook { namespace react { diff --git a/cpp/react/renderer/components/RNLiveMarkdownSpec/MarkdownTextInputDecoratorShadowNode.h b/cpp/react/renderer/components/RNLiveMarkdownSpec/MarkdownTextInputDecoratorShadowNode.h index 597752cb6..3392d5576 100644 --- a/cpp/react/renderer/components/RNLiveMarkdownSpec/MarkdownTextInputDecoratorShadowNode.h +++ b/cpp/react/renderer/components/RNLiveMarkdownSpec/MarkdownTextInputDecoratorShadowNode.h @@ -8,6 +8,8 @@ #include #include +using namespace expensify::livemarkdown; + namespace facebook { namespace react { diff --git a/example/android/settings.gradle b/example/android/settings.gradle index a4b10f0e7..66a7a71ab 100644 --- a/example/android/settings.gradle +++ b/example/android/settings.gradle @@ -4,11 +4,11 @@ extensions.configure(com.facebook.react.ReactSettingsExtension){ ex -> ex.autoli rootProject.name = 'LiveMarkdownExample' include ':app' includeBuild('../node_modules/@react-native/gradle-plugin') -includeBuild('../node_modules/react-native') { - dependencySubstitution { - substitute(module("com.facebook.react:react-android")).using(project(":packages:react-native:ReactAndroid")) - substitute(module("com.facebook.react:react-native")).using(project(":packages:react-native:ReactAndroid")) - substitute(module("com.facebook.react:hermes-android")).using(project(":packages:react-native:ReactAndroid:hermes-engine")) - substitute(module("com.facebook.react:hermes-engine")).using(project(":packages:react-native:ReactAndroid:hermes-engine")) - } -} +// includeBuild('../node_modules/react-native') { +// dependencySubstitution { +// substitute(module("com.facebook.react:react-android")).using(project(":packages:react-native:ReactAndroid")) +// substitute(module("com.facebook.react:react-native")).using(project(":packages:react-native:ReactAndroid")) +// substitute(module("com.facebook.react:hermes-android")).using(project(":packages:react-native:ReactAndroid:hermes-engine")) +// substitute(module("com.facebook.react:hermes-engine")).using(project(":packages:react-native:ReactAndroid:hermes-engine")) +// } +// } diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index fbfcaa022..cc793edcd 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -1497,7 +1497,7 @@ PODS: - React-logger (= 0.75.2) - React-perflogger (= 0.75.2) - React-utils (= 0.75.2) - - RNLiveMarkdown (0.1.134): + - RNLiveMarkdown (0.1.137): - DoubleConversion - glog - hermes-engine @@ -1517,9 +1517,9 @@ PODS: - ReactCodegen - ReactCommon/turbomodule/bridging - ReactCommon/turbomodule/core - - RNLiveMarkdown/common (= 0.1.134) + - RNLiveMarkdown/common (= 0.1.137) - Yoga - - RNLiveMarkdown/common (0.1.134): + - RNLiveMarkdown/common (0.1.137): - DoubleConversion - glog - hermes-engine @@ -1805,7 +1805,7 @@ SPEC CHECKSUMS: React-utils: 81a715d9c0a2a49047e77a86f3a2247408540deb ReactCodegen: 60973d382704c793c605b9be0fc7f31cb279442f ReactCommon: 6ef348087d250257c44c0204461c03f036650e9b - RNLiveMarkdown: 5a67af97df2685c773aba5c2a00e50f497399915 + RNLiveMarkdown: b2d706acf1bbd968b8dab0be0dc69f130a14db6d SocketRocket: abac6f5de4d4d62d24e11868d7a2f427e0ef940d Yoga: 2a45d7e59592db061217551fd3bbe2dd993817ae diff --git a/ios/MarkdownCommitHook.h b/ios/MarkdownCommitHook.h index 92f0acaff..ac6cc45e2 100644 --- a/ios/MarkdownCommitHook.h +++ b/ios/MarkdownCommitHook.h @@ -11,6 +11,7 @@ using namespace facebook::react; +namespace expensify { namespace livemarkdown { struct MarkdownTextInputDecoratorPair { @@ -38,5 +39,6 @@ class MarkdownCommitHook : public UIManagerCommitHook { }; } // namespace livemarkdown +} // namespace expensify #endif // RCT_NEW_ARCH_ENABLED diff --git a/ios/MarkdownCommitHook.mm b/ios/MarkdownCommitHook.mm index 53f3ddd31..6524cac96 100644 --- a/ios/MarkdownCommitHook.mm +++ b/ios/MarkdownCommitHook.mm @@ -11,6 +11,7 @@ using namespace facebook::react; +namespace expensify { namespace livemarkdown { MarkdownCommitHook::MarkdownCommitHook( @@ -192,5 +193,6 @@ } } // namespace livemarkdown +} // namespace expensify #endif // RCT_NEW_ARCH_ENABLED diff --git a/ios/RCTLiveMarkdownModule.mm b/ios/RCTLiveMarkdownModule.mm index 24bbcb846..53e917851 100644 --- a/ios/RCTLiveMarkdownModule.mm +++ b/ios/RCTLiveMarkdownModule.mm @@ -7,13 +7,15 @@ #import "MarkdownShadowFamilyRegistry.h" #import "RCTLiveMarkdownModule.h" +using namespace expensify::livemarkdown; + // A turbomodule used to register the commit hook // I think this is the easiest way to access the UIManager, which we need to // actually register the hook @implementation RCTLiveMarkdownModule { BOOL installed_; - std::shared_ptr commitHook_; + std::shared_ptr commitHook_; __weak RCTSurfacePresenter *surfacePresenter_; } @@ -23,8 +25,7 @@ - (NSNumber *)install { if (!installed_ && surfacePresenter_ != nil) { RCTScheduler *scheduler = [surfacePresenter_ scheduler]; - commitHook_ = - std::make_shared(scheduler.uiManager); + commitHook_ = std::make_shared(scheduler.uiManager); installed_ = YES; } return @1; diff --git a/ios/RCTTextInputComponentView+Markdown.mm b/ios/RCTTextInputComponentView+Markdown.mm index 3161e00d0..5ce1e63e0 100644 --- a/ios/RCTTextInputComponentView+Markdown.mm +++ b/ios/RCTTextInputComponentView+Markdown.mm @@ -8,6 +8,8 @@ #import "MarkdownShadowFamilyRegistry.h" +using namespace expensify::livemarkdown; + @implementation RCTTextInputComponentView (Markdown) - (void)setMarkdownUtils:(RCTMarkdownUtils *)markdownUtils { diff --git a/package.json b/package.json index d38d76bb4..7eb8bf9be 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@expensify/react-native-live-markdown", - "version": "0.1.134", + "version": "0.1.137", "description": "Drop-in replacement for React Native's TextInput component with Markdown formatting.", "main": "lib/commonjs/index", "module": "lib/module/index",