From 7e514d7232e29a429953aab0d6db208516093190 Mon Sep 17 00:00:00 2001 From: Wojciech Lewicki Date: Thu, 24 Aug 2023 12:07:27 +0200 Subject: [PATCH] feat: add macos back to Example app (#2119) PR restoring macos CI job and restoring usage of UIGraphicsBeginImageContextWithOptions on macos since there is no implementation for UIGraphicsImageRendererFormat there yet. --- .eslintignore | 1 + .github/workflows/macos-build-test.yml | 72 + Example/ios/Podfile.lock | 8 +- Example/macos/.gitignore | 2 + Example/macos/.xcode.env | 1 + Example/macos/Example-macOS/AppDelegate.h | 6 + Example/macos/Example-macOS/AppDelegate.mm | 40 + .../AppIcon.appiconset/Contents.json | 58 + .../Assets.xcassets/Contents.json | 6 + .../Example-macOS/Base.lproj/Main.storyboard | 684 +++++++++ .../macos/Example-macOS/Example.entitlements | 12 + Example/macos/Example-macOS/Info.plist | 47 + Example/macos/Example-macOS/main.m | 5 + .../macos/Example.xcodeproj/project.pbxproj | 589 ++++++++ .../xcschemes/Example-macOS.xcscheme | 78 + .../contents.xcworkspacedata | 10 + .../xcshareddata/IDEWorkspaceChecks.plist | 8 + Example/macos/Podfile | 27 + Example/macos/Podfile.lock | 520 +++++++ Example/metro.config.js | 7 +- Example/package.json | 3 +- Example/src/App.tsx | 3 +- Example/yarn.lock | 1265 ++++++++++++++++- apple/Elements/RNSVGSvgView.mm | 15 +- apple/RNSVGRenderable.mm | 32 + 25 files changed, 3467 insertions(+), 32 deletions(-) create mode 100644 .github/workflows/macos-build-test.yml create mode 100644 Example/macos/.gitignore create mode 100644 Example/macos/.xcode.env create mode 100644 Example/macos/Example-macOS/AppDelegate.h create mode 100644 Example/macos/Example-macOS/AppDelegate.mm create mode 100644 Example/macos/Example-macOS/Assets.xcassets/AppIcon.appiconset/Contents.json create mode 100644 Example/macos/Example-macOS/Assets.xcassets/Contents.json create mode 100644 Example/macos/Example-macOS/Base.lproj/Main.storyboard create mode 100644 Example/macos/Example-macOS/Example.entitlements create mode 100644 Example/macos/Example-macOS/Info.plist create mode 100644 Example/macos/Example-macOS/main.m create mode 100644 Example/macos/Example.xcodeproj/project.pbxproj create mode 100644 Example/macos/Example.xcodeproj/xcshareddata/xcschemes/Example-macOS.xcscheme create mode 100644 Example/macos/Example.xcworkspace/contents.xcworkspacedata create mode 100644 Example/macos/Example.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist create mode 100644 Example/macos/Podfile create mode 100644 Example/macos/Podfile.lock diff --git a/.eslintignore b/.eslintignore index f4f82e8c..97a0e7c9 100644 --- a/.eslintignore +++ b/.eslintignore @@ -3,6 +3,7 @@ Example/examples/ Example/android/ Example/ios/ Example/windows/ +Example/macos/ screenshots/ android/ apple/ diff --git a/.github/workflows/macos-build-test.yml b/.github/workflows/macos-build-test.yml new file mode 100644 index 00000000..e98e35a4 --- /dev/null +++ b/.github/workflows/macos-build-test.yml @@ -0,0 +1,72 @@ +name: Test macOS build +on: + pull_request: + paths: + - .github/workflows/macos-build-test.yml + - RNSVG.podspec + - apple/** + - Example/package.json + - Example/macos/** + - src/fabric/** + - package.json + push: + branches: + - main + +jobs: + build: + runs-on: macos-12 + strategy: + matrix: + working-directory: [Example] + fail-fast: false + concurrency: + group: macos-${{ matrix.working-directory }}-${{ github.ref }} + cancel-in-progress: true + steps: + - name: Check out Git repository + uses: actions/checkout@v3 + + - name: Restore react-native-svg node_modules from cache + uses: actions/cache@v3 + with: + path: node_modules + key: ${{ runner.os }}-node-modules-svg-${{ hashFiles('yarn.lock') }} + restore-keys: ${{ runner.os }}-node-modules-svg- + + - name: Install react-native-svg node_modules + run: yarn install --frozen-lockfile + + - name: Restore app node_modules from cache + uses: actions/cache@v3 + with: + path: ${{ matrix.working-directory }}/node_modules + key: ${{ runner.os }}-node-modules-${{ matrix.working-directory }}-${{ hashFiles(format('{0}/yarn.lock', matrix.working-directory)) }} + restore-keys: ${{ runner.os }}-node-modules-${{ matrix.working-directory }}- + + - name: Install app node_modules + working-directory: ${{ matrix.working-directory }} + run: yarn install --frozen-lockfile + + - name: Restore Pods from cache + uses: actions/cache@v3 + with: + path: | + ${{ matrix.working-directory }}/macos/Pods + ~/Library/Caches/CocoaPods + ~/.cocoapods + key: ${{ runner.os }}-pods-${{ matrix.working-directory }}-${{ hashFiles(format('{0}/macos/Podfile.lock', matrix.working-directory)) }} + + - name: Install Pods + working-directory: ${{ matrix.working-directory }}/macos + run: pod install + + - name: Restore build artifacts from cache + uses: actions/cache@v3 + with: + path: ~/Library/Developer/Xcode/DerivedData + key: ${{ runner.os }}-macos-derived-data-${{ matrix.working-directory }}-${{ hashFiles(format('{0}/macos/Podfile.lock', matrix.working-directory)) }} + + - name: Build app + working-directory: ${{ matrix.working-directory }} + run: npx react-native run-macos diff --git a/Example/ios/Podfile.lock b/Example/ios/Podfile.lock index ff9c8ef9..8461fa39 100644 --- a/Example/ios/Podfile.lock +++ b/Example/ios/Podfile.lock @@ -484,7 +484,7 @@ PODS: - React-jsi (= 0.72.1) - React-logger (= 0.72.1) - React-perflogger (= 0.72.1) - - RNReanimated (3.4.2): + - RNReanimated (3.5.0-nightly-20230822-8ef27c219): - DoubleConversion - FBLazyVector - glog @@ -513,7 +513,7 @@ PODS: - React-RCTText - ReactCommon/turbomodule/core - Yoga - - RNSVG (13.11.0): + - RNSVG (13.12.0): - React-Core - SocketRocket (0.6.1) - Yoga (1.14.0) @@ -740,8 +740,8 @@ SPEC CHECKSUMS: React-runtimescheduler: 67707a955b9ecc628cc38bdc721fbc498910f0fd React-utils: 0a70ea97d4e2749f336b450c082905be1d389435 ReactCommon: e593d19c9e271a6da4d0bd7f13b28cfeae5d164b - RNReanimated: 726395a2fa2f04cea340274ba57a4e659bc0d9c1 - RNSVG: 791907c36f290562750132f8d274730c3aa529f6 + RNReanimated: c8c9d8f36908aa7a2997c0b87d0205a336e90186 + RNSVG: 6d07f8f8f246c85e3e16e0bcfc0d047db0c48496 SocketRocket: f32cd54efbe0f095c4d7594881e52619cfe80b17 Yoga: 65286bb6a07edce5e4fe8c90774da977ae8fc009 YogaKit: f782866e155069a2cca2517aafea43200b01fd5a diff --git a/Example/macos/.gitignore b/Example/macos/.gitignore new file mode 100644 index 00000000..daba1410 --- /dev/null +++ b/Example/macos/.gitignore @@ -0,0 +1,2 @@ +# CocoaPods +Pods/ diff --git a/Example/macos/.xcode.env b/Example/macos/.xcode.env new file mode 100644 index 00000000..772b339b --- /dev/null +++ b/Example/macos/.xcode.env @@ -0,0 +1 @@ +export NODE_BINARY=$(command -v node) diff --git a/Example/macos/Example-macOS/AppDelegate.h b/Example/macos/Example-macOS/AppDelegate.h new file mode 100644 index 00000000..63db9731 --- /dev/null +++ b/Example/macos/Example-macOS/AppDelegate.h @@ -0,0 +1,6 @@ +#import +#import + +@interface AppDelegate : RCTAppDelegate + +@end diff --git a/Example/macos/Example-macOS/AppDelegate.mm b/Example/macos/Example-macOS/AppDelegate.mm new file mode 100644 index 00000000..1629d8c7 --- /dev/null +++ b/Example/macos/Example-macOS/AppDelegate.mm @@ -0,0 +1,40 @@ +#import "AppDelegate.h" + +#import + +@implementation AppDelegate + +- (void)applicationDidFinishLaunching:(NSNotification *)notification +{ + self.moduleName = @"Example"; + // You can add your custom initial props in the dictionary below. + // They will be passed down to the ViewController used by React Native. + self.initialProps = @{}; + + return [super applicationDidFinishLaunching:notification]; +} + +- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge +{ +#if DEBUG + return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index"]; +#else + return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"]; +#endif +} + +/// This method controls whether the `concurrentRoot`feature of React18 is turned on or off. +/// +/// @see: https://reactjs.org/blog/2022/03/29/react-v18.html +/// @note: This requires to be rendering on Fabric (i.e. on the New Architecture). +/// @return: `true` if the `concurrentRoot` feature is enabled. Otherwise, it returns `false`. +- (BOOL)concurrentRootEnabled +{ +#ifdef RN_FABRIC_ENABLED + return true; +#else + return false; +#endif +} + +@end diff --git a/Example/macos/Example-macOS/Assets.xcassets/AppIcon.appiconset/Contents.json b/Example/macos/Example-macOS/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 00000000..3f00db43 --- /dev/null +++ b/Example/macos/Example-macOS/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,58 @@ +{ + "images" : [ + { + "idiom" : "mac", + "scale" : "1x", + "size" : "16x16" + }, + { + "idiom" : "mac", + "scale" : "2x", + "size" : "16x16" + }, + { + "idiom" : "mac", + "scale" : "1x", + "size" : "32x32" + }, + { + "idiom" : "mac", + "scale" : "2x", + "size" : "32x32" + }, + { + "idiom" : "mac", + "scale" : "1x", + "size" : "128x128" + }, + { + "idiom" : "mac", + "scale" : "2x", + "size" : "128x128" + }, + { + "idiom" : "mac", + "scale" : "1x", + "size" : "256x256" + }, + { + "idiom" : "mac", + "scale" : "2x", + "size" : "256x256" + }, + { + "idiom" : "mac", + "scale" : "1x", + "size" : "512x512" + }, + { + "idiom" : "mac", + "scale" : "2x", + "size" : "512x512" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Example/macos/Example-macOS/Assets.xcassets/Contents.json b/Example/macos/Example-macOS/Assets.xcassets/Contents.json new file mode 100644 index 00000000..73c00596 --- /dev/null +++ b/Example/macos/Example-macOS/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Example/macos/Example-macOS/Base.lproj/Main.storyboard b/Example/macos/Example-macOS/Base.lproj/Main.storyboard new file mode 100644 index 00000000..6504557d --- /dev/null +++ b/Example/macos/Example-macOS/Base.lproj/Main.storyboard @@ -0,0 +1,684 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Default + + + + + + + Left to Right + + + + + + + Right to Left + + + + + + + + + + + Default + + + + + + + Left to Right + + + + + + + Right to Left + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Example/macos/Example-macOS/Example.entitlements b/Example/macos/Example-macOS/Example.entitlements new file mode 100644 index 00000000..625af03d --- /dev/null +++ b/Example/macos/Example-macOS/Example.entitlements @@ -0,0 +1,12 @@ + + + + + com.apple.security.app-sandbox + + com.apple.security.files.user-selected.read-only + + com.apple.security.network.client + + + diff --git a/Example/macos/Example-macOS/Info.plist b/Example/macos/Example-macOS/Info.plist new file mode 100644 index 00000000..5c7ebb78 --- /dev/null +++ b/Example/macos/Example-macOS/Info.plist @@ -0,0 +1,47 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIconFile + + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSMinimumSystemVersion + $(MACOSX_DEPLOYMENT_TARGET) + NSAppTransportSecurity + + NSAllowsArbitraryLoads + + NSExceptionDomains + + localhost + + NSExceptionAllowsInsecureHTTPLoads + + + + + NSMainStoryboardFile + Main + NSPrincipalClass + NSApplication + NSSupportsAutomaticTermination + + NSSupportsSuddenTermination + + + diff --git a/Example/macos/Example-macOS/main.m b/Example/macos/Example-macOS/main.m new file mode 100644 index 00000000..1f154fcf --- /dev/null +++ b/Example/macos/Example-macOS/main.m @@ -0,0 +1,5 @@ +#import + +int main(int argc, const char *argv[]) { + return NSApplicationMain(argc, argv); +} diff --git a/Example/macos/Example.xcodeproj/project.pbxproj b/Example/macos/Example.xcodeproj/project.pbxproj new file mode 100644 index 00000000..39b1efc4 --- /dev/null +++ b/Example/macos/Example.xcodeproj/project.pbxproj @@ -0,0 +1,589 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 5142014D2437B4B30078DB4F /* AppDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5142014C2437B4B30078DB4F /* AppDelegate.mm */; }; + 514201522437B4B40078DB4F /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 514201512437B4B40078DB4F /* Assets.xcassets */; }; + 514201552437B4B40078DB4F /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 514201532437B4B40078DB4F /* Main.storyboard */; }; + 514201582437B4B40078DB4F /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 514201572437B4B40078DB4F /* main.m */; }; + D26D21973A74AD2932A10E03 /* libPods-Example-macOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5B3A8B869519AD65B4E8A654 /* libPods-Example-macOS.a */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 0A2FC2603533C7576E54F6F7 /* Pods-Example-macOS.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Example-macOS.debug.xcconfig"; path = "Target Support Files/Pods-Example-macOS/Pods-Example-macOS.debug.xcconfig"; sourceTree = ""; }; + 13B07F961A680F5B00A75B9A /* Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Example.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 514201492437B4B30078DB4F /* Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Example.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 5142014B2437B4B30078DB4F /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 5142014C2437B4B30078DB4F /* AppDelegate.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = AppDelegate.mm; sourceTree = ""; }; + 514201512437B4B40078DB4F /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 514201542437B4B40078DB4F /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 514201562437B4B40078DB4F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 514201572437B4B40078DB4F /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 514201592437B4B40078DB4F /* Example.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Example.entitlements; sourceTree = ""; }; + 5B3A8B869519AD65B4E8A654 /* libPods-Example-macOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Example-macOS.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + E500D1CD19D608256625B9AB /* Pods-Example-macOS.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Example-macOS.release.xcconfig"; path = "Target Support Files/Pods-Example-macOS/Pods-Example-macOS.release.xcconfig"; sourceTree = ""; }; + ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 13B07F8C1A680F5B00A75B9A /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 514201462437B4B30078DB4F /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + D26D21973A74AD2932A10E03 /* libPods-Example-macOS.a in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 2D16E6871FA4F8E400B85C8A /* Frameworks */ = { + isa = PBXGroup; + children = ( + ED297162215061F000B7C4FE /* JavaScriptCore.framework */, + 5B3A8B869519AD65B4E8A654 /* libPods-Example-macOS.a */, + ); + name = Frameworks; + sourceTree = ""; + }; + 5142014A2437B4B30078DB4F /* Example-macOS */ = { + isa = PBXGroup; + children = ( + 5142014B2437B4B30078DB4F /* AppDelegate.h */, + 5142014C2437B4B30078DB4F /* AppDelegate.mm */, + 514201512437B4B40078DB4F /* Assets.xcassets */, + 514201532437B4B40078DB4F /* Main.storyboard */, + 514201562437B4B40078DB4F /* Info.plist */, + 514201572437B4B40078DB4F /* main.m */, + 514201592437B4B40078DB4F /* Example.entitlements */, + ); + path = "Example-macOS"; + sourceTree = ""; + }; + 6E877EF5A3C5AA66CC38FAF7 /* Pods */ = { + isa = PBXGroup; + children = ( + 0A2FC2603533C7576E54F6F7 /* Pods-Example-macOS.debug.xcconfig */, + E500D1CD19D608256625B9AB /* Pods-Example-macOS.release.xcconfig */, + ); + name = Pods; + path = Pods; + sourceTree = ""; + }; + 832341AE1AAA6A7D00B99B32 /* Libraries */ = { + isa = PBXGroup; + children = ( + ); + name = Libraries; + sourceTree = ""; + }; + 83CBB9F61A601CBA00E9B192 = { + isa = PBXGroup; + children = ( + 5142014A2437B4B30078DB4F /* Example-macOS */, + 832341AE1AAA6A7D00B99B32 /* Libraries */, + 83CBBA001A601CBA00E9B192 /* Products */, + 2D16E6871FA4F8E400B85C8A /* Frameworks */, + 6E877EF5A3C5AA66CC38FAF7 /* Pods */, + ); + indentWidth = 2; + sourceTree = ""; + tabWidth = 2; + usesTabs = 0; + }; + 83CBBA001A601CBA00E9B192 /* Products */ = { + isa = PBXGroup; + children = ( + 13B07F961A680F5B00A75B9A /* Example.app */, + 514201492437B4B30078DB4F /* Example.app */, + ); + name = Products; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 13B07F861A680F5B00A75B9A /* Example-iOS */ = { + isa = PBXNativeTarget; + buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "Example-iOS" */; + buildPhases = ( + FD10A7F022414F080027D42C /* Start Packager */, + 13B07F871A680F5B00A75B9A /* Sources */, + 13B07F8C1A680F5B00A75B9A /* Frameworks */, + 13B07F8E1A680F5B00A75B9A /* Resources */, + 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Example-iOS"; + productName = Example; + productReference = 13B07F961A680F5B00A75B9A /* Example.app */; + productType = "com.apple.product-type.application"; + }; + 514201482437B4B30078DB4F /* Example-macOS */ = { + isa = PBXNativeTarget; + buildConfigurationList = 5142015A2437B4B40078DB4F /* Build configuration list for PBXNativeTarget "Example-macOS" */; + buildPhases = ( + 1A938104A937498D81B3BD3B /* [CP] Check Pods Manifest.lock */, + 381D8A6F24576A6C00465D17 /* Start Packager */, + 514201452437B4B30078DB4F /* Sources */, + 514201462437B4B30078DB4F /* Frameworks */, + 514201472437B4B30078DB4F /* Resources */, + 381D8A6E24576A4E00465D17 /* Bundle React Native code and images */, + 847973068F575633C249CEB3 /* [CP] Copy Pods Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Example-macOS"; + productName = Example; + productReference = 514201492437B4B30078DB4F /* Example.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 83CBB9F71A601CBA00E9B192 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 1130; + TargetAttributes = { + 13B07F861A680F5B00A75B9A = { + LastSwiftMigration = 1120; + }; + 514201482437B4B30078DB4F = { + CreatedOnToolsVersion = 11.4; + ProvisioningStyle = Automatic; + }; + }; + }; + buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "Example" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 83CBB9F61A601CBA00E9B192; + productRefGroup = 83CBBA001A601CBA00E9B192 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 13B07F861A680F5B00A75B9A /* Example-iOS */, + 514201482437B4B30078DB4F /* Example-macOS */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 13B07F8E1A680F5B00A75B9A /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 514201472437B4B30078DB4F /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 514201522437B4B40078DB4F /* Assets.xcassets in Resources */, + 514201552437B4B40078DB4F /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Bundle React Native code and images"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "export NODE_BINARY=node\n../node_modules/react-native-macos/scripts/react-native-xcode.sh\n"; + }; + 1A938104A937498D81B3BD3B /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-Example-macOS-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; + 381D8A6E24576A4E00465D17 /* Bundle React Native code and images */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + ); + name = "Bundle React Native code and images"; + outputFileListPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "export NODE_BINARY=node\n../node_modules/react-native-macos/scripts/react-native-xcode.sh\n"; + }; + 381D8A6F24576A6C00465D17 /* Start Packager */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + ); + name = "Start Packager"; + outputFileListPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "export RCT_METRO_PORT=\"${RCT_METRO_PORT:=8081}\"\necho \"export RCT_METRO_PORT=${RCT_METRO_PORT}\" > \"${SRCROOT}/../node_modules/react-native-macos/scripts/.packager.env\"\nif [ -z \"${RCT_NO_LAUNCH_PACKAGER+xxx}\" ] ; then\n if nc -w 5 -z localhost ${RCT_METRO_PORT} ; then\n if ! curl -s \"http://localhost:${RCT_METRO_PORT}/status\" | grep -q \"packager-status:running\" ; then\n echo \"Port ${RCT_METRO_PORT} already in use, packager is either not running or not running correctly\"\n exit 2\n fi\n else\n open \"$SRCROOT/../node_modules/react-native-macos/scripts/launchPackager.command\" || echo \"Can't start packager automatically\"\n fi\nfi\n"; + }; + 847973068F575633C249CEB3 /* [CP] Copy Pods Resources */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Example-macOS/Pods-Example-macOS-resources.sh", + "${PODS_CONFIGURATION_BUILD_DIR}/React-Core/AccessibilityResources.bundle", + ); + name = "[CP] Copy Pods Resources"; + outputPaths = ( + "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/AccessibilityResources.bundle", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Example-macOS/Pods-Example-macOS-resources.sh\"\n"; + showEnvVarsInLog = 0; + }; + FD10A7F022414F080027D42C /* Start Packager */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + ); + name = "Start Packager"; + outputFileListPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "export RCT_METRO_PORT=\"${RCT_METRO_PORT:=8081}\"\necho \"export RCT_METRO_PORT=${RCT_METRO_PORT}\" > \"${SRCROOT}/../node_modules/react-native-macos/scripts/.packager.env\"\nif [ -z \"${RCT_NO_LAUNCH_PACKAGER+xxx}\" ] ; then\n if nc -w 5 -z localhost ${RCT_METRO_PORT} ; then\n if ! curl -s \"http://localhost:${RCT_METRO_PORT}/status\" | grep -q \"packager-status:running\" ; then\n echo \"Port ${RCT_METRO_PORT} already in use, packager is either not running or not running correctly\"\n exit 2\n fi\n else\n open \"$SRCROOT/../node_modules/react-native-macos/scripts/launchPackager.command\" || echo \"Can't start packager automatically\"\n fi\nfi\n"; + showEnvVarsInLog = 0; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 13B07F871A680F5B00A75B9A /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 514201452437B4B30078DB4F /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 514201582437B4B40078DB4F /* main.m in Sources */, + 5142014D2437B4B30078DB4F /* AppDelegate.mm in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + 514201532437B4B40078DB4F /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 514201542437B4B40078DB4F /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 13B07F941A680F5B00A75B9A /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = 1; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = "Example-iOS/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + OTHER_LDFLAGS = ( + "$(inherited)", + "-ObjC", + "-lc++", + ); + PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.$(PRODUCT_NAME:rfc1034identifier)"; + PRODUCT_NAME = Example; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Debug; + }; + 13B07F951A680F5B00A75B9A /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = 1; + INFOPLIST_FILE = "Example-iOS/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + OTHER_LDFLAGS = ( + "$(inherited)", + "-ObjC", + "-lc++", + ); + PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.$(PRODUCT_NAME:rfc1034identifier)"; + PRODUCT_NAME = Example; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Release; + }; + 5142015B2437B4B40078DB4F /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 0A2FC2603533C7576E54F6F7 /* Pods-Example-macOS.debug.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CURRENT_PROJECT_VERSION = 1; + DEAD_CODE_STRIPPING = NO; + INFOPLIST_FILE = "Example-macos/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + MACOSX_DEPLOYMENT_TARGET = 10.15; + OTHER_LDFLAGS = ( + "$(inherited)", + "-ObjC", + "-lc++", + ); + PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.$(PRODUCT_NAME:rfc1034identifier)"; + PRODUCT_NAME = Example; + SDKROOT = macosx; + }; + name = Debug; + }; + 5142015C2437B4B40078DB4F /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = E500D1CD19D608256625B9AB /* Pods-Example-macOS.release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CURRENT_PROJECT_VERSION = 1; + INFOPLIST_FILE = "Example-macos/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + MACOSX_DEPLOYMENT_TARGET = 10.15; + OTHER_LDFLAGS = ( + "$(inherited)", + "-ObjC", + "-lc++", + ); + PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.$(PRODUCT_NAME:rfc1034identifier)"; + PRODUCT_NAME = Example; + SDKROOT = macosx; + }; + name = Release; + }; + 83CBBA201A601CBA00E9B192 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; + CLANG_CXX_LANGUAGE_STANDARD = "c++17"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = ""; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + LD_RUNPATH_SEARCH_PATHS = "/usr/lib/swift $(inherited)"; + LIBRARY_SEARCH_PATHS = ( + "$(SDKROOT)/usr/lib/swift", + "\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"", + "\"$(inherited)\"", + ); + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native"; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 83CBBA211A601CBA00E9B192 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; + CLANG_CXX_LANGUAGE_STANDARD = "c++17"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = ""; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + LD_RUNPATH_SEARCH_PATHS = "/usr/lib/swift $(inherited)"; + LIBRARY_SEARCH_PATHS = ( + "$(SDKROOT)/usr/lib/swift", + "\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"", + "\"$(inherited)\"", + ); + MTL_ENABLE_DEBUG_INFO = NO; + REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native"; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "Example-iOS" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 13B07F941A680F5B00A75B9A /* Debug */, + 13B07F951A680F5B00A75B9A /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 5142015A2437B4B40078DB4F /* Build configuration list for PBXNativeTarget "Example-macOS" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 5142015B2437B4B40078DB4F /* Debug */, + 5142015C2437B4B40078DB4F /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "Example" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 83CBBA201A601CBA00E9B192 /* Debug */, + 83CBBA211A601CBA00E9B192 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 83CBB9F71A601CBA00E9B192 /* Project object */; +} diff --git a/Example/macos/Example.xcodeproj/xcshareddata/xcschemes/Example-macOS.xcscheme b/Example/macos/Example.xcodeproj/xcshareddata/xcschemes/Example-macOS.xcscheme new file mode 100644 index 00000000..22ba7710 --- /dev/null +++ b/Example/macos/Example.xcodeproj/xcshareddata/xcschemes/Example-macOS.xcscheme @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Example/macos/Example.xcworkspace/contents.xcworkspacedata b/Example/macos/Example.xcworkspace/contents.xcworkspacedata new file mode 100644 index 00000000..a37cf193 --- /dev/null +++ b/Example/macos/Example.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,10 @@ + + + + + + + diff --git a/Example/macos/Example.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Example/macos/Example.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 00000000..18d98100 --- /dev/null +++ b/Example/macos/Example.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/Example/macos/Podfile b/Example/macos/Podfile new file mode 100644 index 00000000..cbf87e23 --- /dev/null +++ b/Example/macos/Podfile @@ -0,0 +1,27 @@ +require_relative '../node_modules/react-native-macos/scripts/react_native_pods' +require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules' + +prepare_react_native_project! + +target 'Example-macOS' do + platform :macos, '10.15' + use_native_modules! + + # Flags change depending on the env values. + flags = get_default_flags() + + use_react_native!( + :path => '../node_modules/react-native-macos', + :hermes_enabled => false, + :fabric_enabled => ENV['RCT_NEW_ARCH_ENABLED'] == '1', + # Flipper is not compatible w/ macOS + :flipper_configuration => FlipperConfiguration.disabled, + # An absolute path to your application root. + :app_path => "#{Pod::Config.instance.installation_root}/.." + ) + + post_install do |installer| + react_native_post_install(installer) + __apply_Xcode_12_5_M1_post_install_workaround(installer) + end +end diff --git a/Example/macos/Podfile.lock b/Example/macos/Podfile.lock new file mode 100644 index 00000000..5f268435 --- /dev/null +++ b/Example/macos/Podfile.lock @@ -0,0 +1,520 @@ +PODS: + - boost (1.76.0) + - DoubleConversion (1.1.6) + - FBLazyVector (0.71.33) + - FBReactNativeSpec (0.71.33): + - RCT-Folly (= 2021.07.22.00) + - RCTRequired (= 0.71.33) + - RCTTypeSafety (= 0.71.33) + - React-Core (= 0.71.33) + - React-jsi (= 0.71.33) + - ReactCommon/turbomodule/core (= 0.71.33) + - fmt (6.2.1) + - glog (0.3.5) + - RCT-Folly (2021.07.22.00): + - boost + - DoubleConversion + - fmt (~> 6.2.1) + - glog + - RCT-Folly/Default (= 2021.07.22.00) + - RCT-Folly/Default (2021.07.22.00): + - boost + - DoubleConversion + - fmt (~> 6.2.1) + - glog + - RCTRequired (0.71.33) + - RCTTypeSafety (0.71.33): + - FBLazyVector (= 0.71.33) + - RCTRequired (= 0.71.33) + - React-Core (= 0.71.33) + - React (0.71.33): + - React-Core (= 0.71.33) + - React-Core/DevSupport (= 0.71.33) + - React-Core/RCTWebSocket (= 0.71.33) + - React-RCTActionSheet (= 0.71.33) + - React-RCTAnimation (= 0.71.33) + - React-RCTBlob (= 0.71.33) + - React-RCTImage (= 0.71.33) + - React-RCTLinking (= 0.71.33) + - React-RCTNetwork (= 0.71.33) + - React-RCTSettings (= 0.71.33) + - React-RCTText (= 0.71.33) + - React-RCTVibration (= 0.71.33) + - React-callinvoker (0.71.33) + - React-Codegen (0.71.33): + - FBReactNativeSpec + - RCT-Folly + - RCTRequired + - RCTTypeSafety + - React-Core + - React-jsc + - React-jsi + - React-jsiexecutor + - ReactCommon/turbomodule/bridging + - ReactCommon/turbomodule/core + - React-Core (0.71.33): + - glog + - RCT-Folly (= 2021.07.22.00) + - React-Core/Default (= 0.71.33) + - React-cxxreact (= 0.71.33) + - React-jsc + - React-jsi (= 0.71.33) + - React-jsiexecutor (= 0.71.33) + - React-perflogger (= 0.71.33) + - SocketRocket (= 0.7.0) + - Yoga + - React-Core/CoreModulesHeaders (0.71.33): + - glog + - RCT-Folly (= 2021.07.22.00) + - React-Core/Default + - React-cxxreact (= 0.71.33) + - React-jsc + - React-jsi (= 0.71.33) + - React-jsiexecutor (= 0.71.33) + - React-perflogger (= 0.71.33) + - SocketRocket (= 0.7.0) + - Yoga + - React-Core/Default (0.71.33): + - glog + - RCT-Folly (= 2021.07.22.00) + - React-cxxreact (= 0.71.33) + - React-jsc + - React-jsi (= 0.71.33) + - React-jsiexecutor (= 0.71.33) + - React-perflogger (= 0.71.33) + - SocketRocket (= 0.7.0) + - Yoga + - React-Core/DevSupport (0.71.33): + - glog + - RCT-Folly (= 2021.07.22.00) + - React-Core/Default (= 0.71.33) + - React-Core/RCTWebSocket (= 0.71.33) + - React-cxxreact (= 0.71.33) + - React-jsc + - React-jsi (= 0.71.33) + - React-jsiexecutor (= 0.71.33) + - React-jsinspector (= 0.71.33) + - React-perflogger (= 0.71.33) + - SocketRocket (= 0.7.0) + - Yoga + - React-Core/RCTActionSheetHeaders (0.71.33): + - glog + - RCT-Folly (= 2021.07.22.00) + - React-Core/Default + - React-cxxreact (= 0.71.33) + - React-jsc + - React-jsi (= 0.71.33) + - React-jsiexecutor (= 0.71.33) + - React-perflogger (= 0.71.33) + - SocketRocket (= 0.7.0) + - Yoga + - React-Core/RCTAnimationHeaders (0.71.33): + - glog + - RCT-Folly (= 2021.07.22.00) + - React-Core/Default + - React-cxxreact (= 0.71.33) + - React-jsc + - React-jsi (= 0.71.33) + - React-jsiexecutor (= 0.71.33) + - React-perflogger (= 0.71.33) + - SocketRocket (= 0.7.0) + - Yoga + - React-Core/RCTBlobHeaders (0.71.33): + - glog + - RCT-Folly (= 2021.07.22.00) + - React-Core/Default + - React-cxxreact (= 0.71.33) + - React-jsc + - React-jsi (= 0.71.33) + - React-jsiexecutor (= 0.71.33) + - React-perflogger (= 0.71.33) + - SocketRocket (= 0.7.0) + - Yoga + - React-Core/RCTImageHeaders (0.71.33): + - glog + - RCT-Folly (= 2021.07.22.00) + - React-Core/Default + - React-cxxreact (= 0.71.33) + - React-jsc + - React-jsi (= 0.71.33) + - React-jsiexecutor (= 0.71.33) + - React-perflogger (= 0.71.33) + - SocketRocket (= 0.7.0) + - Yoga + - React-Core/RCTLinkingHeaders (0.71.33): + - glog + - RCT-Folly (= 2021.07.22.00) + - React-Core/Default + - React-cxxreact (= 0.71.33) + - React-jsc + - React-jsi (= 0.71.33) + - React-jsiexecutor (= 0.71.33) + - React-perflogger (= 0.71.33) + - SocketRocket (= 0.7.0) + - Yoga + - React-Core/RCTNetworkHeaders (0.71.33): + - glog + - RCT-Folly (= 2021.07.22.00) + - React-Core/Default + - React-cxxreact (= 0.71.33) + - React-jsc + - React-jsi (= 0.71.33) + - React-jsiexecutor (= 0.71.33) + - React-perflogger (= 0.71.33) + - SocketRocket (= 0.7.0) + - Yoga + - React-Core/RCTSettingsHeaders (0.71.33): + - glog + - RCT-Folly (= 2021.07.22.00) + - React-Core/Default + - React-cxxreact (= 0.71.33) + - React-jsc + - React-jsi (= 0.71.33) + - React-jsiexecutor (= 0.71.33) + - React-perflogger (= 0.71.33) + - SocketRocket (= 0.7.0) + - Yoga + - React-Core/RCTTextHeaders (0.71.33): + - glog + - RCT-Folly (= 2021.07.22.00) + - React-Core/Default + - React-cxxreact (= 0.71.33) + - React-jsc + - React-jsi (= 0.71.33) + - React-jsiexecutor (= 0.71.33) + - React-perflogger (= 0.71.33) + - SocketRocket (= 0.7.0) + - Yoga + - React-Core/RCTVibrationHeaders (0.71.33): + - glog + - RCT-Folly (= 2021.07.22.00) + - React-Core/Default + - React-cxxreact (= 0.71.33) + - React-jsc + - React-jsi (= 0.71.33) + - React-jsiexecutor (= 0.71.33) + - React-perflogger (= 0.71.33) + - SocketRocket (= 0.7.0) + - Yoga + - React-Core/RCTWebSocket (0.71.33): + - glog + - RCT-Folly (= 2021.07.22.00) + - React-Core/Default (= 0.71.33) + - React-cxxreact (= 0.71.33) + - React-jsc + - React-jsi (= 0.71.33) + - React-jsiexecutor (= 0.71.33) + - React-perflogger (= 0.71.33) + - SocketRocket (= 0.7.0) + - Yoga + - React-CoreModules (0.71.33): + - RCT-Folly (= 2021.07.22.00) + - RCTTypeSafety (= 0.71.33) + - React-Codegen (= 0.71.33) + - React-Core/CoreModulesHeaders (= 0.71.33) + - React-jsi (= 0.71.33) + - React-RCTBlob + - React-RCTImage (= 0.71.33) + - ReactCommon/turbomodule/core (= 0.71.33) + - SocketRocket (= 0.7.0) + - React-cxxreact (0.71.33): + - boost (= 1.76.0) + - DoubleConversion + - glog + - RCT-Folly (= 2021.07.22.00) + - React-callinvoker (= 0.71.33) + - React-jsi (= 0.71.33) + - React-jsinspector (= 0.71.33) + - React-logger (= 0.71.33) + - React-perflogger (= 0.71.33) + - React-runtimeexecutor (= 0.71.33) + - React-jsc (0.71.33): + - React-jsc/Fabric (= 0.71.33) + - React-jsi (= 0.71.33) + - React-jsc/Fabric (0.71.33): + - React-jsi (= 0.71.33) + - React-jsi (0.71.33): + - boost (= 1.76.0) + - DoubleConversion + - glog + - RCT-Folly (= 2021.07.22.00) + - React-jsiexecutor (0.71.33): + - DoubleConversion + - glog + - RCT-Folly (= 2021.07.22.00) + - React-cxxreact (= 0.71.33) + - React-jsi (= 0.71.33) + - React-perflogger (= 0.71.33) + - React-jsinspector (0.71.33) + - React-logger (0.71.33): + - glog + - React-perflogger (0.71.33) + - React-RCTActionSheet (0.71.33): + - React-Core/RCTActionSheetHeaders (= 0.71.33) + - React-RCTAnimation (0.71.33): + - RCT-Folly (= 2021.07.22.00) + - RCTTypeSafety (= 0.71.33) + - React-Codegen (= 0.71.33) + - React-Core/RCTAnimationHeaders (= 0.71.33) + - React-jsi (= 0.71.33) + - ReactCommon/turbomodule/core (= 0.71.33) + - React-RCTAppDelegate (0.71.33): + - RCT-Folly + - RCTRequired + - RCTTypeSafety + - React-Core + - ReactCommon/turbomodule/core + - React-RCTBlob (0.71.33): + - RCT-Folly (= 2021.07.22.00) + - React-Codegen (= 0.71.33) + - React-Core/RCTBlobHeaders (= 0.71.33) + - React-Core/RCTWebSocket (= 0.71.33) + - React-jsi (= 0.71.33) + - React-RCTNetwork (= 0.71.33) + - ReactCommon/turbomodule/core (= 0.71.33) + - React-RCTImage (0.71.33): + - RCT-Folly (= 2021.07.22.00) + - RCTTypeSafety (= 0.71.33) + - React-Codegen (= 0.71.33) + - React-Core/RCTImageHeaders (= 0.71.33) + - React-jsi (= 0.71.33) + - React-RCTNetwork (= 0.71.33) + - ReactCommon/turbomodule/core (= 0.71.33) + - React-RCTLinking (0.71.33): + - React-Codegen (= 0.71.33) + - React-Core/RCTLinkingHeaders (= 0.71.33) + - React-jsi (= 0.71.33) + - ReactCommon/turbomodule/core (= 0.71.33) + - React-RCTNetwork (0.71.33): + - RCT-Folly (= 2021.07.22.00) + - RCTTypeSafety (= 0.71.33) + - React-Codegen (= 0.71.33) + - React-Core/RCTNetworkHeaders (= 0.71.33) + - React-jsi (= 0.71.33) + - ReactCommon/turbomodule/core (= 0.71.33) + - React-RCTSettings (0.71.33): + - RCT-Folly (= 2021.07.22.00) + - RCTTypeSafety (= 0.71.33) + - React-Codegen (= 0.71.33) + - React-Core/RCTSettingsHeaders (= 0.71.33) + - React-jsi (= 0.71.33) + - ReactCommon/turbomodule/core (= 0.71.33) + - React-RCTText (0.71.33): + - React-Core/RCTTextHeaders (= 0.71.33) + - React-RCTVibration (0.71.33): + - RCT-Folly (= 2021.07.22.00) + - React-Codegen (= 0.71.33) + - React-Core/RCTVibrationHeaders (= 0.71.33) + - React-jsi (= 0.71.33) + - ReactCommon/turbomodule/core (= 0.71.33) + - React-runtimeexecutor (0.71.33): + - React-jsi (= 0.71.33) + - ReactCommon/turbomodule/bridging (0.71.33): + - DoubleConversion + - glog + - RCT-Folly (= 2021.07.22.00) + - React-callinvoker (= 0.71.33) + - React-Core (= 0.71.33) + - React-cxxreact (= 0.71.33) + - React-jsi (= 0.71.33) + - React-logger (= 0.71.33) + - React-perflogger (= 0.71.33) + - ReactCommon/turbomodule/core (0.71.33): + - DoubleConversion + - glog + - RCT-Folly (= 2021.07.22.00) + - React-callinvoker (= 0.71.33) + - React-Core (= 0.71.33) + - React-cxxreact (= 0.71.33) + - React-jsi (= 0.71.33) + - React-logger (= 0.71.33) + - React-perflogger (= 0.71.33) + - RNReanimated (3.5.0-nightly-20230822-8ef27c219): + - DoubleConversion + - FBLazyVector + - glog + - RCT-Folly + - RCTRequired + - RCTTypeSafety + - React-callinvoker + - React-Core + - React-Core/DevSupport + - React-Core/RCTWebSocket + - React-CoreModules + - React-cxxreact + - React-jsi + - React-jsiexecutor + - React-jsinspector + - React-RCTActionSheet + - React-RCTAnimation + - React-RCTAppDelegate + - React-RCTBlob + - React-RCTImage + - React-RCTLinking + - React-RCTNetwork + - React-RCTSettings + - React-RCTText + - ReactCommon/turbomodule/core + - Yoga + - RNSVG (13.12.0): + - React-Core + - SocketRocket (0.7.0) + - Yoga (1.14.0) + +DEPENDENCIES: + - boost (from `../node_modules/react-native-macos/third-party-podspecs/boost.podspec`) + - DoubleConversion (from `../node_modules/react-native-macos/third-party-podspecs/DoubleConversion.podspec`) + - FBLazyVector (from `../node_modules/react-native-macos/Libraries/FBLazyVector`) + - FBReactNativeSpec (from `../node_modules/react-native-macos/React/FBReactNativeSpec`) + - glog (from `../node_modules/react-native-macos/third-party-podspecs/glog.podspec`) + - RCT-Folly (from `../node_modules/react-native-macos/third-party-podspecs/RCT-Folly.podspec`) + - RCTRequired (from `../node_modules/react-native-macos/Libraries/RCTRequired`) + - RCTTypeSafety (from `../node_modules/react-native-macos/Libraries/TypeSafety`) + - React (from `../node_modules/react-native-macos/`) + - React-callinvoker (from `../node_modules/react-native-macos/ReactCommon/callinvoker`) + - React-Codegen (from `build/generated/ios`) + - React-Core (from `../node_modules/react-native-macos/`) + - React-Core/RCTWebSocket (from `../node_modules/react-native-macos/`) + - React-CoreModules (from `../node_modules/react-native-macos/React/CoreModules`) + - React-cxxreact (from `../node_modules/react-native-macos/ReactCommon/cxxreact`) + - React-jsc (from `../node_modules/react-native-macos/ReactCommon/jsc`) + - React-jsi (from `../node_modules/react-native-macos/ReactCommon/jsi`) + - React-jsiexecutor (from `../node_modules/react-native-macos/ReactCommon/jsiexecutor`) + - React-jsinspector (from `../node_modules/react-native-macos/ReactCommon/jsinspector`) + - React-logger (from `../node_modules/react-native-macos/ReactCommon/logger`) + - React-perflogger (from `../node_modules/react-native-macos/ReactCommon/reactperflogger`) + - React-RCTActionSheet (from `../node_modules/react-native-macos/Libraries/ActionSheetIOS`) + - React-RCTAnimation (from `../node_modules/react-native-macos/Libraries/NativeAnimation`) + - React-RCTAppDelegate (from `../node_modules/react-native-macos/Libraries/AppDelegate`) + - React-RCTBlob (from `../node_modules/react-native-macos/Libraries/Blob`) + - React-RCTImage (from `../node_modules/react-native-macos/Libraries/Image`) + - React-RCTLinking (from `../node_modules/react-native-macos/Libraries/LinkingIOS`) + - React-RCTNetwork (from `../node_modules/react-native-macos/Libraries/Network`) + - React-RCTSettings (from `../node_modules/react-native-macos/Libraries/Settings`) + - React-RCTText (from `../node_modules/react-native-macos/Libraries/Text`) + - React-RCTVibration (from `../node_modules/react-native-macos/Libraries/Vibration`) + - React-runtimeexecutor (from `../node_modules/react-native-macos/ReactCommon/runtimeexecutor`) + - ReactCommon/turbomodule/core (from `../node_modules/react-native-macos/ReactCommon`) + - RNReanimated (from `../node_modules/react-native-reanimated`) + - RNSVG (from `../node_modules/react-native-svg`) + - Yoga (from `../node_modules/react-native-macos/ReactCommon/yoga`) + +SPEC REPOS: + trunk: + - fmt + - SocketRocket + +EXTERNAL SOURCES: + boost: + :podspec: "../node_modules/react-native-macos/third-party-podspecs/boost.podspec" + DoubleConversion: + :podspec: "../node_modules/react-native-macos/third-party-podspecs/DoubleConversion.podspec" + FBLazyVector: + :path: "../node_modules/react-native-macos/Libraries/FBLazyVector" + FBReactNativeSpec: + :path: "../node_modules/react-native-macos/React/FBReactNativeSpec" + glog: + :podspec: "../node_modules/react-native-macos/third-party-podspecs/glog.podspec" + RCT-Folly: + :podspec: "../node_modules/react-native-macos/third-party-podspecs/RCT-Folly.podspec" + RCTRequired: + :path: "../node_modules/react-native-macos/Libraries/RCTRequired" + RCTTypeSafety: + :path: "../node_modules/react-native-macos/Libraries/TypeSafety" + React: + :path: "../node_modules/react-native-macos/" + React-callinvoker: + :path: "../node_modules/react-native-macos/ReactCommon/callinvoker" + React-Codegen: + :path: build/generated/ios + React-Core: + :path: "../node_modules/react-native-macos/" + React-CoreModules: + :path: "../node_modules/react-native-macos/React/CoreModules" + React-cxxreact: + :path: "../node_modules/react-native-macos/ReactCommon/cxxreact" + React-jsc: + :path: "../node_modules/react-native-macos/ReactCommon/jsc" + React-jsi: + :path: "../node_modules/react-native-macos/ReactCommon/jsi" + React-jsiexecutor: + :path: "../node_modules/react-native-macos/ReactCommon/jsiexecutor" + React-jsinspector: + :path: "../node_modules/react-native-macos/ReactCommon/jsinspector" + React-logger: + :path: "../node_modules/react-native-macos/ReactCommon/logger" + React-perflogger: + :path: "../node_modules/react-native-macos/ReactCommon/reactperflogger" + React-RCTActionSheet: + :path: "../node_modules/react-native-macos/Libraries/ActionSheetIOS" + React-RCTAnimation: + :path: "../node_modules/react-native-macos/Libraries/NativeAnimation" + React-RCTAppDelegate: + :path: "../node_modules/react-native-macos/Libraries/AppDelegate" + React-RCTBlob: + :path: "../node_modules/react-native-macos/Libraries/Blob" + React-RCTImage: + :path: "../node_modules/react-native-macos/Libraries/Image" + React-RCTLinking: + :path: "../node_modules/react-native-macos/Libraries/LinkingIOS" + React-RCTNetwork: + :path: "../node_modules/react-native-macos/Libraries/Network" + React-RCTSettings: + :path: "../node_modules/react-native-macos/Libraries/Settings" + React-RCTText: + :path: "../node_modules/react-native-macos/Libraries/Text" + React-RCTVibration: + :path: "../node_modules/react-native-macos/Libraries/Vibration" + React-runtimeexecutor: + :path: "../node_modules/react-native-macos/ReactCommon/runtimeexecutor" + ReactCommon: + :path: "../node_modules/react-native-macos/ReactCommon" + RNReanimated: + :path: "../node_modules/react-native-reanimated" + RNSVG: + :path: "../node_modules/react-native-svg" + Yoga: + :path: "../node_modules/react-native-macos/ReactCommon/yoga" + +SPEC CHECKSUMS: + boost: 8fa3cd00fa17ef6c3221e5fd283fa93e81d23017 + DoubleConversion: acaf5db79676d2e9119015819153f0f99191de12 + FBLazyVector: 732e9894455ba874b5a579460b785a698471abc3 + FBReactNativeSpec: c28894aa8c1224fdf9fa57c973684631dd10bd12 + fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9 + glog: 6df0a3d6e2750a50609471fd1a01fd2948d405b5 + RCT-Folly: bf7b4921a91932051ebf1c5c2d297154b1fa3c8c + RCTRequired: b924a3818bef3872776fc35568607e9fd1a7ccef + RCTTypeSafety: 34f12e6931e6ecff0d49578c88516574dd75c5fb + React: 72acb808d5ea012c54c0d8f3d9e0177a5164ce44 + React-callinvoker: 7f44c6485e733f907d8adccb8ea7bfd8c661ad73 + React-Codegen: 0b2114160ce592070f115f5fbff2747d76d0ae8e + React-Core: 675a479fdc03725925e1a7f9e5a3bf0548cb24c2 + React-CoreModules: 87b348ba58c041b57f45f9f5535fd0436479cb28 + React-cxxreact: 6f1f6ff3172ce0c542b4c32e399773f1643873e8 + React-jsc: a4b9eebe6ab71197b505b20f17c03b2552cd66b3 + React-jsi: d2cd70166fa1d42d1854a6fea0759968d4efe262 + React-jsiexecutor: 9d1f2ab1d5bce258038eb202728210cab73581af + React-jsinspector: b482ed08c8233d528c5917e1a916827e2357ab24 + React-logger: 9cca25c5cbc2bdc03dd79010992d17cbac337139 + React-perflogger: b2d0d3a34cb21df25dfdef7331c8eace64ebbac4 + React-RCTActionSheet: e2852db033ff9909d9e31f78a16a8b1a0d72b0b3 + React-RCTAnimation: af9d4eba93cbb7bf6b2b70ff30f4dde1ae47a4a6 + React-RCTAppDelegate: 1ed88f20871b6a095159a7f23ee6ba1376bc96e7 + React-RCTBlob: 00d5f9a111ab8d31c5030975feb9b4cd82dfcf16 + React-RCTImage: ee42851404992d7a14086ef0daa2a30238d5e175 + React-RCTLinking: 424dafdd86a0de70210f2bdae72ebe8dcf697493 + React-RCTNetwork: 9d5462fd172015c6b3fbc9d2dd93a8bc9a2ee5c7 + React-RCTSettings: f7dc22a18afb78123c2191bedb3200da9f2bb8ca + React-RCTText: f820084f73880a29393620119d365761c681aef3 + React-RCTVibration: dae031977d6a1ce3b89f0fbea95a5dd70024685d + React-runtimeexecutor: d475f7a753d3aff4c72c146e064cc174e593910e + ReactCommon: 79e0b0a3d0baa6d7512c06c8d88ad3c6d8b64339 + RNReanimated: dfc6512ed1a033b54d89a38c8121946709ade0fd + RNSVG: 6d07f8f8f246c85e3e16e0bcfc0d047db0c48496 + SocketRocket: abac6f5de4d4d62d24e11868d7a2f427e0ef940d + Yoga: 2b1bd30acc9239a612feef50886ca9bd8b313abc + +PODFILE CHECKSUM: 7ca6c640e923247f6b904914ff9f85e615d70b1a + +COCOAPODS: 1.11.3 diff --git a/Example/metro.config.js b/Example/metro.config.js index 9a2cc405..7efd0fe1 100644 --- a/Example/metro.config.js +++ b/Example/metro.config.js @@ -18,7 +18,11 @@ const rnwPath = fs.realpathSync( path.resolve(require.resolve('react-native-windows/package.json'), '..'), ); -const modules = [...Object.keys(pack.peerDependencies), 'react-native-windows']; +const modules = [ + ...Object.keys(pack.peerDependencies), + 'react-native-windows', + 'react-native-macos', +]; const config = { projectRoot: __dirname, @@ -36,6 +40,7 @@ const config = { new RegExp( `${path.join(__dirname, 'windows').replace(/[/\\]+/g, '/')}.*`, ), + new RegExp(`${path.join(__dirname, 'macos').replace(/[/\\]+/g, '/')}.*`), // This prevents "react-native run-windows" from hitting: EBUSY: resource busy or locked, open msbuild.ProjectImports.zip or other files produced by msbuild new RegExp(`${rnwPath}/build/.*`), new RegExp(`${rnwPath}/target/.*`), diff --git a/Example/package.json b/Example/package.json index ac30ca32..392e91d1 100644 --- a/Example/package.json +++ b/Example/package.json @@ -17,7 +17,8 @@ "react": "18.2.0", "react-dom": "^18.2.0", "react-native": "0.72.1", - "react-native-reanimated": "^3.4.2", + "react-native-macos": "^0.71.0-0", + "react-native-reanimated": "3.5.0-nightly-20230822-8ef27c219", "react-native-svg": "link:../", "react-native-web": "^0.18.12", "react-native-windows": "0.72.1" diff --git a/Example/src/App.tsx b/Example/src/App.tsx index 45ecb312..4282aa4c 100644 --- a/Example/src/App.tsx +++ b/Example/src/App.tsx @@ -205,7 +205,8 @@ export default class SvgExample extends Component { SVG library for React Apps {this.getExamples()} - {Platform.OS === 'windows' && this.state.modal ? ( + {(Platform.OS === 'windows' || Platform.OS === 'macos') && + this.state.modal ? ( {this.modalContent()} ) : ( = 2.1.2 < 3": version "2.1.2" resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" @@ -8260,6 +9349,16 @@ set-blocking@^2.0.0: resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" integrity sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw== +set-value@^2.0.0, set-value@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/set-value/-/set-value-2.0.1.tgz#a18d40530e6f07de4228c7defe4227af8cad005b" + integrity sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw== + dependencies: + extend-shallow "^2.0.1" + is-extendable "^0.1.1" + is-plain-object "^2.0.3" + split-string "^3.0.1" + setimmediate@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285" @@ -8363,6 +9462,36 @@ slice-ansi@^2.0.0: astral-regex "^1.0.0" is-fullwidth-code-point "^2.0.0" +snapdragon-node@^2.0.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/snapdragon-node/-/snapdragon-node-2.1.1.tgz#6c175f86ff14bdb0724563e8f3c1b021a286853b" + integrity sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw== + dependencies: + define-property "^1.0.0" + isobject "^3.0.0" + snapdragon-util "^3.0.1" + +snapdragon-util@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/snapdragon-util/-/snapdragon-util-3.0.1.tgz#f956479486f2acd79700693f6f7b805e45ab56e2" + integrity sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ== + dependencies: + kind-of "^3.2.0" + +snapdragon@^0.8.1: + version "0.8.2" + resolved "https://registry.yarnpkg.com/snapdragon/-/snapdragon-0.8.2.tgz#64922e7c565b0e14204ba1aa7d6964278d25182d" + integrity sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg== + dependencies: + base "^0.11.1" + debug "^2.2.0" + define-property "^0.2.5" + extend-shallow "^2.0.1" + map-cache "^0.2.2" + source-map "^0.5.6" + source-map-resolve "^0.5.0" + use "^3.1.0" + sockjs@^0.3.24: version "0.3.24" resolved "https://registry.yarnpkg.com/sockjs/-/sockjs-0.3.24.tgz#c9bc8995f33a111bea0395ec30aa3206bdb5ccce" @@ -8372,6 +9501,17 @@ sockjs@^0.3.24: uuid "^8.3.2" websocket-driver "^0.7.4" +source-map-resolve@^0.5.0: + version "0.5.3" + resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.5.3.tgz#190866bece7553e1f8f267a2ee82c606b5509a1a" + integrity sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw== + dependencies: + atob "^2.1.2" + decode-uri-component "^0.2.0" + resolve-url "^0.2.1" + source-map-url "^0.4.0" + urix "^0.1.0" + source-map-support@0.5.13: version "0.5.13" resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.13.tgz#31b24a9c2e73c2de85066c0feb7d44767ed52932" @@ -8388,6 +9528,11 @@ source-map-support@^0.5.16, source-map-support@^0.5.19, source-map-support@~0.5. buffer-from "^1.0.0" source-map "^0.6.0" +source-map-url@^0.4.0: + version "0.4.1" + resolved "https://registry.yarnpkg.com/source-map-url/-/source-map-url-0.4.1.tgz#0af66605a745a5a2f91cf1bbf8a7afbc283dec56" + integrity sha512-cPiFOTLUKvJFIg4SKVScy4ilPPW6rFgMgfuZJPNoDuMs3nC1HbMUycBoJw77xFIp6z1UJQJOfx6C9GMH80DiTw== + source-map@^0.5.6: version "0.5.7" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" @@ -8426,6 +9571,13 @@ spdy@^4.0.2: select-hose "^2.0.0" spdy-transport "^3.0.0" +split-string@^3.0.1, split-string@^3.0.2: + version "3.1.0" + resolved "https://registry.yarnpkg.com/split-string/-/split-string-3.1.0.tgz#7cb09dda3a86585705c64b39a6466038682e8fe2" + integrity sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw== + dependencies: + extend-shallow "^3.0.0" + sprintf-js@~1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" @@ -8448,13 +9600,21 @@ stackframe@^1.3.4: resolved "https://registry.yarnpkg.com/stackframe/-/stackframe-1.3.4.tgz#b881a004c8c149a5e8efef37d51b16e412943310" integrity sha512-oeVtt7eWQS+Na6F//S4kJ2K2VbRlS9D43mAlMyVpVWovy9o+jfgH8O9agzANzaiLjclA0oYzUXEM4PurhSUChw== -stacktrace-parser@^0.1.10: +stacktrace-parser@^0.1.10, stacktrace-parser@^0.1.3: version "0.1.10" resolved "https://registry.yarnpkg.com/stacktrace-parser/-/stacktrace-parser-0.1.10.tgz#29fb0cae4e0d0b85155879402857a1639eb6051a" integrity sha512-KJP1OCML99+8fhOHxwwzyWrlUuVX5GQ0ZpJTd1DFXhdkrvg1szxfHhawXUZ3g9TkXORQd4/WG68jMlQZ2p8wlg== dependencies: type-fest "^0.7.1" +static-extend@^0.1.1: + version "0.1.2" + resolved "https://registry.yarnpkg.com/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6" + integrity sha512-72E9+uLc27Mt718pMHt9VMNiAL4LMsmDbBva8mxWUCkT07fSzEGMYUCk0XWY6lp0j6RBAG4cJ3mWuZv2OE3s0g== + dependencies: + define-property "^0.2.5" + object-copy "^0.1.0" + statuses@2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/statuses/-/statuses-2.0.1.tgz#55cb000ccf1d48728bd23c685a063998cf1a1b63" @@ -8627,6 +9787,14 @@ tapable@^2.1.1, tapable@^2.2.0: resolved "https://registry.yarnpkg.com/tapable/-/tapable-2.2.1.tgz#1967a73ef4060a82f12ab96af86d52fdb76eeca0" integrity sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ== +temp@0.8.3: + version "0.8.3" + resolved "https://registry.yarnpkg.com/temp/-/temp-0.8.3.tgz#e0c6bc4d26b903124410e4fed81103014dfc1f59" + integrity sha512-jtnWJs6B1cZlHs9wPG7BrowKxZw/rf6+UpGAkr8AaYmiTyTO7zQlLoST8zx/8TcUPnZmeBoB+H8ARuHZaSijVw== + dependencies: + os-tmpdir "^1.0.0" + rimraf "~2.2.6" + temp@^0.8.4: version "0.8.4" resolved "https://registry.yarnpkg.com/temp/-/temp-0.8.4.tgz#8c97a33a4770072e0a05f919396c7665a7dd59f2" @@ -8697,6 +9865,21 @@ to-fast-properties@^2.0.0: resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" integrity sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog== +to-object-path@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/to-object-path/-/to-object-path-0.3.0.tgz#297588b7b0e7e0ac08e04e672f85c1f4999e17af" + integrity sha512-9mWHdnGRuh3onocaHzukyvCZhzvr6tiflAy/JRFXcJX0TjgfWA9pk9t8CMbzmBE4Jfw58pXbkngtBtqYxzNEyg== + dependencies: + kind-of "^3.0.2" + +to-regex-range@^2.1.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-2.1.1.tgz#7c80c17b9dfebe599e27367e0d4dd5590141db38" + integrity sha512-ZZWNfCjUokXXDGXFpZehJIkZqq91BcULFq/Pi7M5i4JnxXdhMKAK682z8bCW3o8Hj1wuuzoKcW3DfVzaP6VuNg== + dependencies: + is-number "^3.0.0" + repeat-string "^1.6.1" + to-regex-range@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" @@ -8704,6 +9887,16 @@ to-regex-range@^5.0.1: dependencies: is-number "^7.0.0" +to-regex@^3.0.1, to-regex@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/to-regex/-/to-regex-3.0.2.tgz#13cfdd9b336552f30b51f33a8ae1b42a7a7599ce" + integrity sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw== + dependencies: + define-property "^2.0.2" + extend-shallow "^3.0.2" + regex-not "^1.0.2" + safe-regex "^1.1.0" + toidentifier@1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.1.tgz#3be34321a88a820ed1bd80dfaa33e479fbb8dd35" @@ -8856,6 +10049,16 @@ unicode-property-aliases-ecmascript@^2.0.0: resolved "https://registry.yarnpkg.com/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-2.1.0.tgz#43d41e3be698bd493ef911077c9b131f827e8ccd" integrity sha512-6t3foTQI9qne+OZoVQB/8x8rk2k1eVy1gRXhV3oFQ5T6R1dqQ1xtin3XqSlx3+ATBkliTaR/hHyJBm+LVPNM8w== +union-value@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/union-value/-/union-value-1.0.1.tgz#0b6fe7b835aecda61c6ea4d4f02c14221e109847" + integrity sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg== + dependencies: + arr-union "^3.1.0" + get-value "^2.0.6" + is-extendable "^0.1.1" + set-value "^2.0.1" + universalify@^0.1.0: version "0.1.2" resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66" @@ -8866,6 +10069,14 @@ unpipe@1.0.0, unpipe@~1.0.0: resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" integrity sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ== +unset-value@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/unset-value/-/unset-value-1.0.0.tgz#8376873f7d2335179ffb1e6fc3a8ed0dfc8ab559" + integrity sha512-PcA2tsuGSF9cnySLHTLSh2qrQiJ70mn+r+Glzxv2TWZblxsxCC52BDlZoPCsz7STd9pN7EZetkWZBAvk4cgZdQ== + dependencies: + has-value "^0.3.1" + isobject "^3.0.0" + update-browserslist-db@^1.0.11: version "1.0.11" resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.0.11.tgz#9a2a641ad2907ae7b3616506f4b977851db5b940" @@ -8881,11 +10092,21 @@ uri-js@^4.2.2: dependencies: punycode "^2.1.0" +urix@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72" + integrity sha512-Am1ousAhSLBeB9cG/7k7r2R0zj50uDRlZHPGbazid5s9rlF1F/QKYObEKSIunSjIOkJZqwRRLpvewjEkM7pSqg== + use-sync-external-store@^1.0.0: version "1.2.0" resolved "https://registry.yarnpkg.com/use-sync-external-store/-/use-sync-external-store-1.2.0.tgz#7dbefd6ef3fe4e767a0cf5d7287aacfb5846928a" integrity sha512-eEgnFxGQ1Ife9bzYs6VLi8/4X6CObHMw9Qr9tPY43iKwsPw8xE8+EFsf/2cFZ5S3esXgpWgtSCtLNS41F+sKPA== +use@^3.1.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/use/-/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f" + integrity sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ== + username@^5.1.0: version "5.1.0" resolved "https://registry.yarnpkg.com/username/-/username-5.1.0.tgz#a7f9325adce2d0166448cdd55d4985b1360f2508" @@ -9307,7 +10528,7 @@ yargs@^16.2.0: y18n "^5.0.5" yargs-parser "^20.2.2" -yargs@^17.3.1, yargs@^17.6.2: +yargs@^17.3.1, yargs@^17.5.1, yargs@^17.6.2: version "17.7.2" resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.7.2.tgz#991df39aca675a192b816e1e0363f9d75d2aa269" integrity sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w== diff --git a/apple/Elements/RNSVGSvgView.mm b/apple/Elements/RNSVGSvgView.mm index e5da830c..a91fee4c 100644 --- a/apple/Elements/RNSVGSvgView.mm +++ b/apple/Elements/RNSVGSvgView.mm @@ -323,18 +323,27 @@ using namespace facebook::react; - (NSString *)getDataURLWithBounds:(CGRect)bounds { +#if !TARGET_OS_OSX // [macOS] UIGraphicsImageRenderer *renderer = [[UIGraphicsImageRenderer alloc] initWithSize:bounds.size]; - UIImage *image = [renderer imageWithActions:^(UIGraphicsImageRendererContext *_Nonnull rendererContext) { +#else // [macOS + UIGraphicsBeginImageContextWithOptions(bounds.size, NO, 1); +#endif // macOS] [self clearChildCache]; [self drawRect:bounds]; [self clearChildCache]; [self invalidate]; +#if !TARGET_OS_OSX // [macOS] }]; - +#endif +#if !TARGET_OS_OSX // [macOS] NSData *imageData = UIImagePNGRepresentation(image); NSString *base64 = [imageData base64EncodedStringWithOptions:NSDataBase64Encoding64CharacterLineLength]; - +#else // [macOS + NSData *imageData = UIImagePNGRepresentation(UIGraphicsGetImageFromCurrentImageContext()); + NSString *base64 = [imageData base64EncodedStringWithOptions:NSDataBase64Encoding64CharacterLineLength]; + UIGraphicsEndImageContext(); +#endif // macOS] return base64; } diff --git a/apple/RNSVGRenderable.mm b/apple/RNSVGRenderable.mm index 20b73787..bc65d00b 100644 --- a/apple/RNSVGRenderable.mm +++ b/apple/RNSVGRenderable.mm @@ -304,6 +304,7 @@ UInt32 saturate(CGFloat value) CGContextRelease(bcontext); free(pixels); +#if !TARGET_OS_OSX // [macOS] UIGraphicsImageRendererFormat *format = [UIGraphicsImageRendererFormat defaultFormat]; format.scale = scale; UIGraphicsImageRenderer *renderer = [[UIGraphicsImageRenderer alloc] initWithSize:boundsSize format:format]; @@ -328,6 +329,37 @@ UInt32 saturate(CGFloat value) // Render blended result into current render context CGImageRelease(maskImage); +#else // [macOS + // Render content of current SVG Renderable to image + UIGraphicsBeginImageContextWithOptions(boundsSize, NO, 0.0); + CGContextRef newContext = UIGraphicsGetCurrentContext(); + CGContextTranslateCTM(newContext, 0.0, height); + CGContextScaleCTM(newContext, 1.0, -1.0); + [self renderLayerTo:newContext rect:rect]; + CGImageRef contentImage = CGBitmapContextCreateImage(newContext); + UIGraphicsEndImageContext(); + + // Blend current element and mask + UIGraphicsBeginImageContextWithOptions(boundsSize, NO, 0.0); + newContext = UIGraphicsGetCurrentContext(); + CGContextTranslateCTM(newContext, 0.0, height); + CGContextScaleCTM(newContext, 1.0, -1.0); + + CGContextSetBlendMode(newContext, kCGBlendModeCopy); + CGContextDrawImage(newContext, drawBounds, maskImage); + CGImageRelease(maskImage); + + CGContextSetBlendMode(newContext, kCGBlendModeSourceIn); + CGContextDrawImage(newContext, drawBounds, contentImage); + CGImageRelease(contentImage); + + CGImageRef blendedImage = CGBitmapContextCreateImage(newContext); + UIGraphicsEndImageContext(); + + // Render blended result into current render context + CGContextDrawImage(context, drawBounds, blendedImage); + CGImageRelease(blendedImage); +#endif // macOS] } else { [self renderLayerTo:context rect:rect]; }