react-native-capture-studio 0.1.0

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.
Files changed (67) hide show
  1. package/LICENSE +20 -0
  2. package/README.md +86 -0
  3. package/android/build.gradle +139 -0
  4. package/android/generated/java/com/capturestudio/NativeCaptureStudioSpec.java +48 -0
  5. package/android/generated/jni/CMakeLists.txt +31 -0
  6. package/android/generated/jni/RNCaptureStudioSpec-generated.cpp +44 -0
  7. package/android/generated/jni/RNCaptureStudioSpec.h +31 -0
  8. package/android/generated/jni/react/renderer/components/RNCaptureStudioSpec/RNCaptureStudioSpecJSI.h +56 -0
  9. package/android/gradle.properties +5 -0
  10. package/android/src/main/AndroidManifest.xml +13 -0
  11. package/android/src/main/AndroidManifestNew.xml +2 -0
  12. package/android/src/main/java/com/capturestudio/CaptureStudioModule.kt +177 -0
  13. package/android/src/main/java/com/capturestudio/CaptureStudioPackage.kt +33 -0
  14. package/android/src/main/java/com/capturestudio/data/CameraRepository.kt +43 -0
  15. package/android/src/main/java/com/capturestudio/data/processing/ImageProcessingWorker.kt +126 -0
  16. package/android/src/main/java/com/capturestudio/data/processing/ImageProcessor.kt +244 -0
  17. package/android/src/main/java/com/capturestudio/domain/CaptureOptions.kt +0 -0
  18. package/android/src/main/java/com/capturestudio/domain/model/ImageProcessingItem.kt +18 -0
  19. package/android/src/main/java/com/capturestudio/domain/model/ProcessingResult.kt +14 -0
  20. package/android/src/main/java/com/capturestudio/ui/camera/CameraActivity.kt +55 -0
  21. package/android/src/main/java/com/capturestudio/ui/camera/CameraUiState.kt +7 -0
  22. package/android/src/main/java/com/capturestudio/ui/camera/CameraViewModel.kt +34 -0
  23. package/android/src/main/java/com/capturestudio/ui/camera/CameraViewModelFactory.kt +17 -0
  24. package/android/src/main/res/layout/activity_camera.xml +10 -0
  25. package/ios/CaptureStudio.h +7 -0
  26. package/ios/CaptureStudio.mm +186 -0
  27. package/ios/ImageProcessor.h +22 -0
  28. package/ios/ImageProcessor.mm +383 -0
  29. package/ios/generated/Package.swift +59 -0
  30. package/ios/generated/ReactAppDependencyProvider/RCTAppDependencyProvider.h +25 -0
  31. package/ios/generated/ReactAppDependencyProvider/RCTAppDependencyProvider.mm +40 -0
  32. package/ios/generated/ReactAppDependencyProvider/ReactAppDependencyProvider.podspec +34 -0
  33. package/ios/generated/ReactCodegen/RCTModuleProviders.h +16 -0
  34. package/ios/generated/ReactCodegen/RCTModuleProviders.mm +51 -0
  35. package/ios/generated/ReactCodegen/RCTModulesConformingToProtocolsProvider.h +18 -0
  36. package/ios/generated/ReactCodegen/RCTModulesConformingToProtocolsProvider.mm +54 -0
  37. package/ios/generated/ReactCodegen/RCTThirdPartyComponentsProvider.h +16 -0
  38. package/ios/generated/ReactCodegen/RCTThirdPartyComponentsProvider.mm +30 -0
  39. package/ios/generated/ReactCodegen/RCTUnstableModulesRequiringMainQueueSetupProvider.h +14 -0
  40. package/ios/generated/ReactCodegen/RCTUnstableModulesRequiringMainQueueSetupProvider.mm +19 -0
  41. package/ios/generated/ReactCodegen/RNCaptureStudioSpec/RNCaptureStudioSpec-generated.mm +53 -0
  42. package/ios/generated/ReactCodegen/RNCaptureStudioSpec/RNCaptureStudioSpec.h +70 -0
  43. package/ios/generated/ReactCodegen/RNCaptureStudioSpecJSI.h +56 -0
  44. package/ios/generated/ReactCodegen/ReactCodegen.podspec +110 -0
  45. package/lib/commonjs/NativeCaptureStudio.js +9 -0
  46. package/lib/commonjs/NativeCaptureStudio.js.map +1 -0
  47. package/lib/commonjs/index.js +20 -0
  48. package/lib/commonjs/index.js.map +1 -0
  49. package/lib/module/NativeCaptureStudio.js +5 -0
  50. package/lib/module/NativeCaptureStudio.js.map +1 -0
  51. package/lib/module/index.js +13 -0
  52. package/lib/module/index.js.map +1 -0
  53. package/lib/typescript/commonjs/package.json +1 -0
  54. package/lib/typescript/commonjs/src/NativeCaptureStudio.d.ts +9 -0
  55. package/lib/typescript/commonjs/src/NativeCaptureStudio.d.ts.map +1 -0
  56. package/lib/typescript/commonjs/src/index.d.ts +19 -0
  57. package/lib/typescript/commonjs/src/index.d.ts.map +1 -0
  58. package/lib/typescript/module/package.json +1 -0
  59. package/lib/typescript/module/src/NativeCaptureStudio.d.ts +9 -0
  60. package/lib/typescript/module/src/NativeCaptureStudio.d.ts.map +1 -0
  61. package/lib/typescript/module/src/index.d.ts +19 -0
  62. package/lib/typescript/module/src/index.d.ts.map +1 -0
  63. package/package.json +202 -0
  64. package/react-native-capture-studio.podspec +48 -0
  65. package/react-native.config.js +12 -0
  66. package/src/NativeCaptureStudio.ts +11 -0
  67. package/src/index.tsx +30 -0
@@ -0,0 +1,40 @@
1
+ /*
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+ #import "RCTAppDependencyProvider.h"
9
+ #import <ReactCodegen/RCTModulesConformingToProtocolsProvider.h>
10
+ #import <ReactCodegen/RCTThirdPartyComponentsProvider.h>
11
+ #import <ReactCodegen/RCTUnstableModulesRequiringMainQueueSetupProvider.h>
12
+ #import <ReactCodegen/RCTModuleProviders.h>
13
+
14
+ @implementation RCTAppDependencyProvider
15
+
16
+ - (nonnull NSArray<NSString *> *)URLRequestHandlerClassNames {
17
+ return RCTModulesConformingToProtocolsProvider.URLRequestHandlerClassNames;
18
+ }
19
+
20
+ - (nonnull NSArray<NSString *> *)imageDataDecoderClassNames {
21
+ return RCTModulesConformingToProtocolsProvider.imageDataDecoderClassNames;
22
+ }
23
+
24
+ - (nonnull NSArray<NSString *> *)imageURLLoaderClassNames {
25
+ return RCTModulesConformingToProtocolsProvider.imageURLLoaderClassNames;
26
+ }
27
+
28
+ - (nonnull NSArray<NSString *> *)unstableModulesRequiringMainQueueSetup {
29
+ return RCTUnstableModulesRequiringMainQueueSetupProvider.modules;
30
+ }
31
+
32
+ - (nonnull NSDictionary<NSString *,Class<RCTComponentViewProtocol>> *)thirdPartyFabricComponents {
33
+ return RCTThirdPartyComponentsProvider.thirdPartyFabricComponents;
34
+ }
35
+
36
+ - (nonnull NSDictionary<NSString *, id<RCTModuleProvider>> *)moduleProviders {
37
+ return RCTModuleProviders.moduleProviders;
38
+ }
39
+
40
+ @end
@@ -0,0 +1,34 @@
1
+ # Copyright (c) Meta Platforms, Inc. and affiliates.
2
+ #
3
+ # This source code is licensed under the MIT license found in the
4
+ # LICENSE file in the root directory of this source tree.
5
+
6
+ version = "0.83.1"
7
+ source = { :git => 'https://github.com/facebook/react-native.git' }
8
+ if version == '1000.0.0'
9
+ # This is an unpublished version, use the latest commit hash of the react-native repo, which we’re presumably in.
10
+ source[:commit] = `git rev-parse HEAD`.strip if system("git rev-parse --git-dir > /dev/null 2>&1")
11
+ else
12
+ source[:tag] = "v#{version}"
13
+ end
14
+
15
+ Pod::Spec.new do |s|
16
+ s.name = "ReactAppDependencyProvider"
17
+ s.version = version
18
+ s.summary = "The third party dependency provider for the app"
19
+ s.homepage = "https://reactnative.dev/"
20
+ s.documentation_url = "https://reactnative.dev/"
21
+ s.license = "MIT"
22
+ s.author = "Meta Platforms, Inc. and its affiliates"
23
+ s.platforms = min_supported_versions
24
+ s.source = source
25
+ s.source_files = "**/RCTAppDependencyProvider.{h,mm}"
26
+
27
+ # This guard prevent to install the dependencies when we run `pod install` in the old architecture.
28
+ s.pod_target_xcconfig = {
29
+ "CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(),
30
+ "DEFINES_MODULE" => "YES"
31
+ }
32
+
33
+ s.dependency "ReactCodegen"
34
+ end
@@ -0,0 +1,16 @@
1
+ /*
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+ #import <Foundation/Foundation.h>
9
+
10
+ @protocol RCTModuleProvider;
11
+
12
+ @interface RCTModuleProviders: NSObject
13
+
14
+ + (NSDictionary<NSString *, id<RCTModuleProvider>> *)moduleProviders;
15
+
16
+ @end
@@ -0,0 +1,51 @@
1
+ /*
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+ #import <Foundation/Foundation.h>
9
+
10
+ #import "RCTModuleProviders.h"
11
+ #import <ReactCommon/RCTTurboModule.h>
12
+ #import <React/RCTLog.h>
13
+
14
+ @implementation RCTModuleProviders
15
+
16
+ + (NSDictionary<NSString *, id<RCTModuleProvider>> *)moduleProviders
17
+ {
18
+ static NSDictionary<NSString *, id<RCTModuleProvider>> *providers = nil;
19
+ static dispatch_once_t onceToken;
20
+
21
+ dispatch_once(&onceToken, ^{
22
+ NSDictionary<NSString *, NSString *> * moduleMapping = @{
23
+
24
+ };
25
+
26
+ NSMutableDictionary *dict = [[NSMutableDictionary alloc] initWithCapacity:moduleMapping.count];
27
+
28
+ for (NSString *key in moduleMapping) {
29
+ NSString * moduleProviderName = moduleMapping[key];
30
+ Class klass = NSClassFromString(moduleProviderName);
31
+ if (!klass) {
32
+ RCTLogError(@"Module provider %@ cannot be found in the runtime", moduleProviderName);
33
+ continue;
34
+ }
35
+
36
+ id instance = [klass new];
37
+ if (![instance respondsToSelector:@selector(getTurboModule:)]) {
38
+ RCTLogError(@"Module provider %@ does not conform to RCTModuleProvider", moduleProviderName);
39
+ continue;
40
+ }
41
+
42
+ [dict setObject:instance forKey:key];
43
+ }
44
+
45
+ providers = dict;
46
+ });
47
+
48
+ return providers;
49
+ }
50
+
51
+ @end
@@ -0,0 +1,18 @@
1
+ /*
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+ #import <Foundation/Foundation.h>
9
+
10
+ @interface RCTModulesConformingToProtocolsProvider: NSObject
11
+
12
+ +(NSArray<NSString *> *)imageURLLoaderClassNames;
13
+
14
+ +(NSArray<NSString *> *)imageDataDecoderClassNames;
15
+
16
+ +(NSArray<NSString *> *)URLRequestHandlerClassNames;
17
+
18
+ @end
@@ -0,0 +1,54 @@
1
+ /*
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+ #import "RCTModulesConformingToProtocolsProvider.h"
9
+
10
+ @implementation RCTModulesConformingToProtocolsProvider
11
+
12
+ +(NSArray<NSString *> *)imageURLLoaderClassNames
13
+ {
14
+ static NSArray<NSString *> *classNames = nil;
15
+ static dispatch_once_t onceToken;
16
+
17
+ dispatch_once(&onceToken, ^{
18
+ classNames = @[
19
+
20
+ ];
21
+ });
22
+
23
+ return classNames;
24
+ }
25
+
26
+ +(NSArray<NSString *> *)imageDataDecoderClassNames
27
+ {
28
+ static NSArray<NSString *> *classNames = nil;
29
+ static dispatch_once_t onceToken;
30
+
31
+ dispatch_once(&onceToken, ^{
32
+ classNames = @[
33
+
34
+ ];
35
+ });
36
+
37
+ return classNames;
38
+ }
39
+
40
+ +(NSArray<NSString *> *)URLRequestHandlerClassNames
41
+ {
42
+ static NSArray<NSString *> *classNames = nil;
43
+ static dispatch_once_t onceToken;
44
+
45
+ dispatch_once(&onceToken, ^{
46
+ classNames = @[
47
+
48
+ ];
49
+ });
50
+
51
+ return classNames;
52
+ }
53
+
54
+ @end
@@ -0,0 +1,16 @@
1
+ /*
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+ #import <Foundation/Foundation.h>
9
+
10
+ @protocol RCTComponentViewProtocol;
11
+
12
+ @interface RCTThirdPartyComponentsProvider: NSObject
13
+
14
+ + (NSDictionary<NSString *, Class<RCTComponentViewProtocol>> *)thirdPartyFabricComponents;
15
+
16
+ @end
@@ -0,0 +1,30 @@
1
+ /*
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+
9
+ #import <Foundation/Foundation.h>
10
+
11
+ #import "RCTThirdPartyComponentsProvider.h"
12
+ #import <React/RCTComponentViewProtocol.h>
13
+
14
+ @implementation RCTThirdPartyComponentsProvider
15
+
16
+ + (NSDictionary<NSString *, Class<RCTComponentViewProtocol>> *)thirdPartyFabricComponents
17
+ {
18
+ static NSDictionary<NSString *, Class<RCTComponentViewProtocol>> *thirdPartyComponents = nil;
19
+ static dispatch_once_t nativeComponentsToken;
20
+
21
+ dispatch_once(&nativeComponentsToken, ^{
22
+ thirdPartyComponents = @{
23
+
24
+ };
25
+ });
26
+
27
+ return thirdPartyComponents;
28
+ }
29
+
30
+ @end
@@ -0,0 +1,14 @@
1
+ /*
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+ #import <Foundation/Foundation.h>
9
+
10
+ @interface RCTUnstableModulesRequiringMainQueueSetupProvider: NSObject
11
+
12
+ +(NSArray<NSString *> *)modules;
13
+
14
+ @end
@@ -0,0 +1,19 @@
1
+ /*
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+ #import "RCTUnstableModulesRequiringMainQueueSetupProvider.h"
9
+
10
+ @implementation RCTUnstableModulesRequiringMainQueueSetupProvider
11
+
12
+ +(NSArray<NSString *> *)modules
13
+ {
14
+ return @[
15
+
16
+ ];
17
+ }
18
+
19
+ @end
@@ -0,0 +1,53 @@
1
+ /**
2
+ * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
3
+ *
4
+ * Do not edit this file as changes may cause incorrect behavior and will be lost
5
+ * once the code is regenerated.
6
+ *
7
+ * @generated by codegen project: GenerateModuleObjCpp
8
+ *
9
+ * We create an umbrella header (and corresponding implementation) here since
10
+ * Cxx compilation in BUCK has a limitation: source-code producing genrule()s
11
+ * must have a single output. More files => more genrule()s => slower builds.
12
+ */
13
+
14
+ #import "RNCaptureStudioSpec.h"
15
+
16
+
17
+ @implementation NativeCaptureStudioSpecBase
18
+
19
+
20
+ - (void)setEventEmitterCallback:(EventEmitterCallbackWrapper *)eventEmitterCallbackWrapper
21
+ {
22
+ _eventEmitterCallback = std::move(eventEmitterCallbackWrapper->_eventEmitterCallback);
23
+ }
24
+ @end
25
+
26
+
27
+ namespace facebook::react {
28
+
29
+ static facebook::jsi::Value __hostFunction_NativeCaptureStudioSpecJSI_openCaptureStudio(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
30
+ return static_cast<ObjCTurboModule&>(turboModule).invokeObjCMethod(rt, PromiseKind, "openCaptureStudio", @selector(openCaptureStudio:resolve:reject:), args, count);
31
+ }
32
+
33
+ static facebook::jsi::Value __hostFunction_NativeCaptureStudioSpecJSI_processImages(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
34
+ return static_cast<ObjCTurboModule&>(turboModule).invokeObjCMethod(rt, PromiseKind, "processImages", @selector(processImages:resolve:reject:), args, count);
35
+ }
36
+
37
+ static facebook::jsi::Value __hostFunction_NativeCaptureStudioSpecJSI_fetchProcessingResult(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
38
+ return static_cast<ObjCTurboModule&>(turboModule).invokeObjCMethod(rt, PromiseKind, "fetchProcessingResult", @selector(fetchProcessingResult:resolve:reject:), args, count);
39
+ }
40
+
41
+ NativeCaptureStudioSpecJSI::NativeCaptureStudioSpecJSI(const ObjCTurboModule::InitParams &params)
42
+ : ObjCTurboModule(params) {
43
+
44
+ methodMap_["openCaptureStudio"] = MethodMetadata {1, __hostFunction_NativeCaptureStudioSpecJSI_openCaptureStudio};
45
+
46
+
47
+ methodMap_["processImages"] = MethodMetadata {1, __hostFunction_NativeCaptureStudioSpecJSI_processImages};
48
+
49
+
50
+ methodMap_["fetchProcessingResult"] = MethodMetadata {1, __hostFunction_NativeCaptureStudioSpecJSI_fetchProcessingResult};
51
+
52
+ }
53
+ } // namespace facebook::react
@@ -0,0 +1,70 @@
1
+ /**
2
+ * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
3
+ *
4
+ * Do not edit this file as changes may cause incorrect behavior and will be lost
5
+ * once the code is regenerated.
6
+ *
7
+ * @generated by codegen project: GenerateModuleObjCpp
8
+ *
9
+ * We create an umbrella header (and corresponding implementation) here since
10
+ * Cxx compilation in BUCK has a limitation: source-code producing genrule()s
11
+ * must have a single output. More files => more genrule()s => slower builds.
12
+ */
13
+
14
+ #ifndef __cplusplus
15
+ #error This file must be compiled as Obj-C++. If you are importing it, you must change your file extension to .mm.
16
+ #endif
17
+
18
+ // Avoid multiple includes of RNCaptureStudioSpec symbols
19
+ #ifndef RNCaptureStudioSpec_H
20
+ #define RNCaptureStudioSpec_H
21
+
22
+ #import <Foundation/Foundation.h>
23
+ #import <RCTRequired/RCTRequired.h>
24
+ #import <RCTTypeSafety/RCTConvertHelpers.h>
25
+ #import <RCTTypeSafety/RCTTypedModuleConstants.h>
26
+ #import <React/RCTBridgeModule.h>
27
+ #import <React/RCTCxxConvert.h>
28
+ #import <React/RCTManagedPointer.h>
29
+ #import <ReactCommon/RCTTurboModule.h>
30
+ #import <optional>
31
+ #import <vector>
32
+
33
+
34
+ NS_ASSUME_NONNULL_BEGIN
35
+
36
+ @protocol NativeCaptureStudioSpec <RCTBridgeModule, RCTTurboModule>
37
+
38
+ - (void)openCaptureStudio:(NSDictionary *)options
39
+ resolve:(RCTPromiseResolveBlock)resolve
40
+ reject:(RCTPromiseRejectBlock)reject;
41
+ - (void)processImages:(NSArray *)images
42
+ resolve:(RCTPromiseResolveBlock)resolve
43
+ reject:(RCTPromiseRejectBlock)reject;
44
+ - (void)fetchProcessingResult:(NSString *)operationId
45
+ resolve:(RCTPromiseResolveBlock)resolve
46
+ reject:(RCTPromiseRejectBlock)reject;
47
+
48
+ @end
49
+
50
+ @interface NativeCaptureStudioSpecBase : NSObject {
51
+ @protected
52
+ facebook::react::EventEmitterCallback _eventEmitterCallback;
53
+ }
54
+ - (void)setEventEmitterCallback:(EventEmitterCallbackWrapper *)eventEmitterCallbackWrapper;
55
+
56
+
57
+ @end
58
+
59
+ namespace facebook::react {
60
+ /**
61
+ * ObjC++ class for module 'NativeCaptureStudio'
62
+ */
63
+ class JSI_EXPORT NativeCaptureStudioSpecJSI : public ObjCTurboModule {
64
+ public:
65
+ NativeCaptureStudioSpecJSI(const ObjCTurboModule::InitParams &params);
66
+ };
67
+ } // namespace facebook::react
68
+
69
+ NS_ASSUME_NONNULL_END
70
+ #endif // RNCaptureStudioSpec_H
@@ -0,0 +1,56 @@
1
+ /**
2
+ * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
3
+ *
4
+ * Do not edit this file as changes may cause incorrect behavior and will be lost
5
+ * once the code is regenerated.
6
+ *
7
+ * @generated by codegen project: GenerateModuleH.js
8
+ */
9
+
10
+ #pragma once
11
+
12
+ #include <ReactCommon/TurboModule.h>
13
+ #include <react/bridging/Bridging.h>
14
+
15
+ namespace facebook::react {
16
+
17
+
18
+ template <typename T>
19
+ class JSI_EXPORT NativeCaptureStudioCxxSpec : public TurboModule {
20
+ public:
21
+ static constexpr std::string_view kModuleName = "CaptureStudio";
22
+
23
+ protected:
24
+ NativeCaptureStudioCxxSpec(std::shared_ptr<CallInvoker> jsInvoker) : TurboModule(std::string{NativeCaptureStudioCxxSpec::kModuleName}, jsInvoker) {
25
+ methodMap_["openCaptureStudio"] = MethodMetadata {.argCount = 1, .invoker = __openCaptureStudio};
26
+ methodMap_["processImages"] = MethodMetadata {.argCount = 1, .invoker = __processImages};
27
+ methodMap_["fetchProcessingResult"] = MethodMetadata {.argCount = 1, .invoker = __fetchProcessingResult};
28
+ }
29
+
30
+ private:
31
+ static jsi::Value __openCaptureStudio(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
32
+ static_assert(
33
+ bridging::getParameterCount(&T::openCaptureStudio) == 2,
34
+ "Expected openCaptureStudio(...) to have 2 parameters");
35
+ return bridging::callFromJs<jsi::Value>(rt, &T::openCaptureStudio, static_cast<NativeCaptureStudioCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule),
36
+ count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt));
37
+ }
38
+
39
+ static jsi::Value __processImages(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
40
+ static_assert(
41
+ bridging::getParameterCount(&T::processImages) == 2,
42
+ "Expected processImages(...) to have 2 parameters");
43
+ return bridging::callFromJs<jsi::Value>(rt, &T::processImages, static_cast<NativeCaptureStudioCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule),
44
+ count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt).asArray(rt));
45
+ }
46
+
47
+ static jsi::Value __fetchProcessingResult(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
48
+ static_assert(
49
+ bridging::getParameterCount(&T::fetchProcessingResult) == 2,
50
+ "Expected fetchProcessingResult(...) to have 2 parameters");
51
+ return bridging::callFromJs<jsi::Value>(rt, &T::fetchProcessingResult, static_cast<NativeCaptureStudioCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule),
52
+ count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt));
53
+ }
54
+ };
55
+
56
+ } // namespace facebook::react
@@ -0,0 +1,110 @@
1
+ # Copyright (c) Meta Platforms, Inc. and affiliates.
2
+ #
3
+ # This source code is licensed under the MIT license found in the
4
+ # LICENSE file in the root directory of this source tree.
5
+
6
+ version = "0.83.1"
7
+ source = { :git => 'https://github.com/facebook/react-native.git' }
8
+ if version == '1000.0.0'
9
+ # This is an unpublished version, use the latest commit hash of the react-native repo, which we’re presumably in.
10
+ source[:commit] = `git rev-parse HEAD`.strip if system("git rev-parse --git-dir > /dev/null 2>&1")
11
+ else
12
+ source[:tag] = "v#{version}"
13
+ end
14
+
15
+ use_frameworks = ENV['USE_FRAMEWORKS'] != nil
16
+ folly_compiler_flags = Helpers::Constants.folly_config[:compiler_flags]
17
+ boost_compiler_flags = Helpers::Constants.boost_config[:compiler_flags]
18
+
19
+ header_search_paths = []
20
+ framework_search_paths = []
21
+
22
+ header_search_paths = [
23
+ "\"$(PODS_ROOT)/ReactNativeDependencies\"",
24
+ "\"${PODS_ROOT}/Headers/Public/ReactCodegen/react/renderer/components\"",
25
+ "\"$(PODS_ROOT)/Headers/Private/React-Fabric\"",
26
+ "\"$(PODS_ROOT)/Headers/Private/React-RCTFabric\"",
27
+ "\"$(PODS_ROOT)/Headers/Private/Yoga\"",
28
+ "\"$(PODS_TARGET_SRCROOT)\"",
29
+ ]
30
+
31
+ if use_frameworks
32
+ ReactNativePodsUtils.create_header_search_path_for_frameworks("PODS_CONFIGURATION_BUILD_DIR", "React-Fabric", "React_Fabric", ["react/renderer/components/view/platform/cxx"])
33
+ .concat(ReactNativePodsUtils.create_header_search_path_for_frameworks("PODS_CONFIGURATION_BUILD_DIR", "React-FabricImage", "React_FabricImage", []))
34
+ .concat(ReactNativePodsUtils.create_header_search_path_for_frameworks("PODS_CONFIGURATION_BUILD_DIR", "React-graphics", "React_graphics", ["react/renderer/graphics/platform/ios"]))
35
+ .concat(ReactNativePodsUtils.create_header_search_path_for_frameworks("PODS_CONFIGURATION_BUILD_DIR", "ReactCommon", "ReactCommon", ["react/nativemodule/core"]))
36
+ .concat(ReactNativePodsUtils.create_header_search_path_for_frameworks("PODS_CONFIGURATION_BUILD_DIR", "React-runtimeexecutor", "React_runtimeexecutor", ["platform/ios"]))
37
+ .concat(ReactNativePodsUtils.create_header_search_path_for_frameworks("PODS_CONFIGURATION_BUILD_DIR", "React-NativeModulesApple", "React_NativeModulesApple", []))
38
+ .concat(ReactNativePodsUtils.create_header_search_path_for_frameworks("PODS_CONFIGURATION_BUILD_DIR", "React-RCTFabric", "RCTFabric", []))
39
+ .concat(ReactNativePodsUtils.create_header_search_path_for_frameworks("PODS_CONFIGURATION_BUILD_DIR", "React-debug", "React_debug", []))
40
+ .concat(ReactNativePodsUtils.create_header_search_path_for_frameworks("PODS_CONFIGURATION_BUILD_DIR", "React-rendererdebug", "React_rendererdebug", []))
41
+ .concat(ReactNativePodsUtils.create_header_search_path_for_frameworks("PODS_CONFIGURATION_BUILD_DIR", "React-utils", "React_utils", []))
42
+ .concat(ReactNativePodsUtils.create_header_search_path_for_frameworks("PODS_CONFIGURATION_BUILD_DIR", "React-featureflags", "React_featureflags", []))
43
+ .each { |search_path|
44
+ header_search_paths << "\"#{search_path}\""
45
+ }
46
+ end
47
+
48
+ Pod::Spec.new do |s|
49
+ s.name = "ReactCodegen"
50
+ s.version = version
51
+ s.summary = 'Temp pod for generated files for React Native'
52
+ s.homepage = 'https://facebook.com/'
53
+ s.license = 'Unlicense'
54
+ s.authors = 'Facebook'
55
+ s.compiler_flags = "#{folly_compiler_flags} #{boost_compiler_flags} -Wno-nullability-completeness -std=c++20"
56
+ s.source = { :git => '' }
57
+ s.header_mappings_dir = './'
58
+ s.platforms = min_supported_versions
59
+ s.source_files = "**/*.{h,mm,cpp}"
60
+ s.exclude_files = "RCTAppDependencyProvider.{h,mm}" # these files are generated in the same codegen path but needs to belong to a different pod
61
+ s.pod_target_xcconfig = {
62
+ "HEADER_SEARCH_PATHS" => header_search_paths.join(' '),
63
+ "FRAMEWORK_SEARCH_PATHS" => framework_search_paths,
64
+ "OTHER_CPLUSPLUSFLAGS" => "$(inherited) #{folly_compiler_flags} #{boost_compiler_flags}"
65
+ }
66
+
67
+ s.dependency "React-jsiexecutor"
68
+ s.dependency "RCTRequired"
69
+ s.dependency "RCTTypeSafety"
70
+ s.dependency "React-Core"
71
+ s.dependency "React-jsi"
72
+ s.dependency "ReactCommon/turbomodule/bridging"
73
+ s.dependency "ReactCommon/turbomodule/core"
74
+ s.dependency "React-NativeModulesApple"
75
+ s.dependency 'React-graphics'
76
+ s.dependency 'React-rendererdebug'
77
+ s.dependency 'React-Fabric'
78
+ s.dependency 'React-FabricImage'
79
+ s.dependency 'React-debug'
80
+ s.dependency 'React-utils'
81
+ s.dependency 'React-featureflags'
82
+ s.dependency 'React-RCTAppDelegate'
83
+
84
+ depend_on_js_engine(s)
85
+ add_rn_third_party_dependencies(s)
86
+ add_rncore_dependency(s)
87
+
88
+ s.script_phases = {
89
+ 'name' => 'Generate Specs',
90
+ 'execution_position' => :before_compile,
91
+ 'input_files' => ["${PODS_ROOT}/../../../src/NativeCaptureStudio.ts"],
92
+ 'show_env_vars_in_log' => true,
93
+ 'output_files' => ["${DERIVED_FILE_DIR}/react-codegen.log"],
94
+ 'script': <<-SCRIPT
95
+ pushd "$PODS_ROOT/../" > /dev/null
96
+ RCT_SCRIPT_POD_INSTALLATION_ROOT=$(pwd)
97
+ popd >/dev/null
98
+
99
+ export RCT_SCRIPT_RN_DIR="$RCT_SCRIPT_POD_INSTALLATION_ROOT/../../node_modules/react-native"
100
+ export RCT_SCRIPT_APP_PATH="$RCT_SCRIPT_POD_INSTALLATION_ROOT/../.."
101
+ export RCT_SCRIPT_OUTPUT_DIR="$RCT_SCRIPT_POD_INSTALLATION_ROOT"
102
+ export RCT_SCRIPT_TYPE="withCodegenDiscovery"
103
+
104
+ export SCRIPT_PHASES_SCRIPT="$RCT_SCRIPT_RN_DIR/scripts/react_native_pods_utils/script_phases.sh"
105
+ export WITH_ENVIRONMENT="$RCT_SCRIPT_RN_DIR/scripts/xcode/with-environment.sh"
106
+ /bin/sh -c '"$WITH_ENVIRONMENT" "$SCRIPT_PHASES_SCRIPT"'
107
+ SCRIPT
108
+ }
109
+
110
+ end
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _reactNative = require("react-native");
8
+ var _default = exports.default = _reactNative.TurboModuleRegistry.getEnforcing('CaptureStudio');
9
+ //# sourceMappingURL=NativeCaptureStudio.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_reactNative","require","_default","exports","default","TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../src","sources":["NativeCaptureStudio.ts"],"mappings":";;;;;;AACA,IAAAA,YAAA,GAAAC,OAAA;AAAmD,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GASpCC,gCAAmB,CAACC,YAAY,CAAO,eAAe,CAAC","ignoreList":[]}
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.fetchProcessingResult = fetchProcessingResult;
7
+ exports.openCaptureStudio = openCaptureStudio;
8
+ exports.processImages = processImages;
9
+ var _NativeCaptureStudio = _interopRequireDefault(require("./NativeCaptureStudio.js"));
10
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
11
+ function openCaptureStudio(options = {}) {
12
+ return _NativeCaptureStudio.default.openCaptureStudio(options);
13
+ }
14
+ function processImages(images) {
15
+ return _NativeCaptureStudio.default.processImages(images);
16
+ }
17
+ function fetchProcessingResult(operationId) {
18
+ return _NativeCaptureStudio.default.fetchProcessingResult(operationId);
19
+ }
20
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_NativeCaptureStudio","_interopRequireDefault","require","e","__esModule","default","openCaptureStudio","options","CaptureStudio","processImages","images","fetchProcessingResult","operationId"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;;;;;;;AAAA,IAAAA,oBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAAkD,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAmB3C,SAASG,iBAAiBA,CAACC,OAAuB,GAAG,CAAC,CAAC,EAAgB;EAC5E,OAAOC,4BAAa,CAACF,iBAAiB,CAACC,OAAO,CAAC;AACjD;AAEO,SAASE,aAAaA,CAACC,MAA6B,EAAmB;EAC5E,OAAOF,4BAAa,CAACC,aAAa,CAACC,MAAM,CAAC;AAC5C;AAEO,SAASC,qBAAqBA,CAACC,WAAmB,EAAmB;EAC1E,OAAOJ,4BAAa,CAACG,qBAAqB,CAACC,WAAW,CAAC;AACzD","ignoreList":[]}
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ import { TurboModuleRegistry } from 'react-native';
4
+ export default TurboModuleRegistry.getEnforcing('CaptureStudio');
5
+ //# sourceMappingURL=NativeCaptureStudio.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../src","sources":["NativeCaptureStudio.ts"],"mappings":";;AACA,SAASA,mBAAmB,QAAQ,cAAc;AASlD,eAAeA,mBAAmB,CAACC,YAAY,CAAO,eAAe,CAAC","ignoreList":[]}
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+
3
+ import CaptureStudio from "./NativeCaptureStudio.js";
4
+ export function openCaptureStudio(options = {}) {
5
+ return CaptureStudio.openCaptureStudio(options);
6
+ }
7
+ export function processImages(images) {
8
+ return CaptureStudio.processImages(images);
9
+ }
10
+ export function fetchProcessingResult(operationId) {
11
+ return CaptureStudio.fetchProcessingResult(operationId);
12
+ }
13
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["CaptureStudio","openCaptureStudio","options","processImages","images","fetchProcessingResult","operationId"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA,OAAOA,aAAa,MAAM,0BAAuB;AAmBjD,OAAO,SAASC,iBAAiBA,CAACC,OAAuB,GAAG,CAAC,CAAC,EAAgB;EAC5E,OAAOF,aAAa,CAACC,iBAAiB,CAACC,OAAO,CAAC;AACjD;AAEA,OAAO,SAASC,aAAaA,CAACC,MAA6B,EAAmB;EAC5E,OAAOJ,aAAa,CAACG,aAAa,CAACC,MAAM,CAAC;AAC5C;AAEA,OAAO,SAASC,qBAAqBA,CAACC,WAAmB,EAAmB;EAC1E,OAAON,aAAa,CAACK,qBAAqB,CAACC,WAAW,CAAC;AACzD","ignoreList":[]}
@@ -0,0 +1 @@
1
+ {"type":"commonjs"}