scandit-react-native-datacapture-id 8.2.1 → 8.3.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.
- package/android/build.gradle +29 -1
- package/android/generated/java/com/facebook/fbreact/specs/NativeScanditDataCaptureIdSpec.java +75 -0
- package/android/generated/jni/CMakeLists.txt +29 -0
- package/android/generated/jni/ScanditReactNativeDatacaptureIdSpec-generated.cpp +40 -0
- package/android/generated/jni/ScanditReactNativeDatacaptureIdSpec.h +31 -0
- package/android/generated/jni/react/renderer/components/ScanditReactNativeDatacaptureIdSpec/ScanditReactNativeDatacaptureIdSpecJSI-generated.cpp +33 -0
- package/android/generated/jni/react/renderer/components/ScanditReactNativeDatacaptureIdSpec/ScanditReactNativeDatacaptureIdSpecJSI.h +151 -0
- package/android/src/main/kotlin/com/scandit/datacapture/reactnative/id/{ScanditDataCaptureIdModule.kt → ScanditDataCaptureIdModuleBase.kt} +14 -31
- package/android/src/main/kotlin/com/scandit/datacapture/reactnative/id/ScanditDataCaptureIdPackage.kt +2 -15
- package/android/src/main/newArch/kotlin/com/scandit/datacapture/reactnative/id/ScanditDataCaptureIdModule.kt +53 -0
- package/android/src/main/oldArch/kotlin/com/scandit/datacapture/reactnative/id/ScanditDataCaptureIdModule.kt +63 -0
- package/dist/id.js +26 -12
- package/dist/id.js.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/ios/Sources/NewArch/ScanditDataCaptureId.mm +95 -0
- package/ios/Sources/OldArch/ScanditDataCaptureId.mm +83 -0
- package/ios/Sources/ScanditDataCaptureId.h +25 -0
- package/ios/Sources/ScanditDataCaptureId.swift +51 -26
- package/ios/generated/ScanditReactNativeDatacaptureIdSpec/ScanditReactNativeDatacaptureIdSpec-generated.mm +53 -0
- package/ios/generated/ScanditReactNativeDatacaptureIdSpec/ScanditReactNativeDatacaptureIdSpec.h +103 -0
- package/ios/generated/ScanditReactNativeDatacaptureIdSpecJSI-generated.cpp +33 -0
- package/ios/generated/ScanditReactNativeDatacaptureIdSpecJSI.h +151 -0
- package/package.json +24 -11
- package/react-native.config.js +12 -0
- package/scandit-react-native-datacapture-id.podspec +17 -30
- package/specs/NativeScanditDataCaptureId.ts +29 -0
- package/ios/Sources/ScanditDataCaptureId.m +0 -9
package/package.json
CHANGED
|
@@ -1,20 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "scandit-react-native-datacapture-id",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.3.0",
|
|
4
4
|
"description": "Scandit Data Capture SDK for React Native",
|
|
5
5
|
"homepage": "https://github.com/Scandit/scandit-react-native-datacapture-id",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/dts/index.d.ts",
|
|
8
8
|
"flow": "dist/index.js.flow",
|
|
9
9
|
"scripts": {
|
|
10
|
+
"build": "rollup -c ../../rollup.config.js --bundleConfigAsCjs",
|
|
11
|
+
"generate-flow": "flowgen dist/dts/index.d.ts -o dist/index.js.flow",
|
|
10
12
|
"jest": "jest",
|
|
11
13
|
"coverage": "jest --coverage --passWithNoTests",
|
|
12
14
|
"test": "pnpm run lint",
|
|
13
|
-
"lint": "eslint
|
|
14
|
-
"build": "pnpm run rollup && pnpm run generate-flow",
|
|
15
|
-
"rollup": "rollup -c rollup.config.js --bundleConfigAsCjs",
|
|
16
|
-
"generate-flow": "flowgen dist/dts/index.d.ts -o dist/index.js.flow",
|
|
17
|
-
"start": "pnpm build -- --watch"
|
|
15
|
+
"lint": "eslint ts"
|
|
18
16
|
},
|
|
19
17
|
"keywords": [
|
|
20
18
|
"scandit",
|
|
@@ -46,14 +44,29 @@
|
|
|
46
44
|
"flowgen": "^1.21.0",
|
|
47
45
|
"jest": "^29.7.0",
|
|
48
46
|
"rollup": "3.29.2",
|
|
49
|
-
"rollup-plugin-modify": "3.0.0",
|
|
50
47
|
"ts-jest": "^29.3.3",
|
|
51
48
|
"typescript": "4.9.5"
|
|
52
49
|
},
|
|
53
50
|
"dependencies": {
|
|
54
|
-
"scandit-datacapture-frameworks-core": "8.
|
|
55
|
-
"scandit-datacapture-frameworks-id": "8.
|
|
56
|
-
"scandit-react-native-datacapture-core": "8.
|
|
51
|
+
"scandit-datacapture-frameworks-core": "8.3.0",
|
|
52
|
+
"scandit-datacapture-frameworks-id": "8.3.0",
|
|
53
|
+
"scandit-react-native-datacapture-core": "8.3.0"
|
|
57
54
|
},
|
|
58
|
-
"packageManager": "pnpm@10.15.0"
|
|
55
|
+
"packageManager": "pnpm@10.15.0",
|
|
56
|
+
"codegenConfig": {
|
|
57
|
+
"name": "ScanditReactNativeDatacaptureIdSpec",
|
|
58
|
+
"type": "modules",
|
|
59
|
+
"jsSrcsDir": "specs",
|
|
60
|
+
"outputDir": {
|
|
61
|
+
"ios": "ios/generated",
|
|
62
|
+
"android": "android/generated"
|
|
63
|
+
},
|
|
64
|
+
"includesGeneratedCode": true,
|
|
65
|
+
"android": {
|
|
66
|
+
"javaPackageName": "com.scandit.datacapture.reactnative.id"
|
|
67
|
+
},
|
|
68
|
+
"ios": {
|
|
69
|
+
"unstableRequiresMainQueueSetup": true
|
|
70
|
+
}
|
|
71
|
+
}
|
|
59
72
|
}
|
|
@@ -3,23 +3,6 @@ require "json"
|
|
|
3
3
|
package = JSON.parse(File.read(File.join(__dir__, "package.json")))
|
|
4
4
|
version = package["version"]
|
|
5
5
|
|
|
6
|
-
# Helper to detect React Native version
|
|
7
|
-
rn_version_gte = lambda do |min_version|
|
|
8
|
-
begin
|
|
9
|
-
rn_package_path = File.join(__dir__, "..", "react-native", "package.json")
|
|
10
|
-
unless File.exist?(rn_package_path)
|
|
11
|
-
# Try node_modules path for samples/apps
|
|
12
|
-
rn_package_path = File.join(__dir__, "..", "..", "node_modules", "react-native", "package.json")
|
|
13
|
-
end
|
|
14
|
-
return false unless File.exist?(rn_package_path)
|
|
15
|
-
|
|
16
|
-
rn_package = JSON.parse(File.read(rn_package_path))
|
|
17
|
-
rn_version = rn_package["version"]
|
|
18
|
-
Gem::Version.new(rn_version) >= Gem::Version.new(min_version)
|
|
19
|
-
rescue
|
|
20
|
-
false
|
|
21
|
-
end
|
|
22
|
-
end
|
|
23
6
|
|
|
24
7
|
Pod::Spec.new do |s|
|
|
25
8
|
s.name = package["name"]
|
|
@@ -31,29 +14,33 @@ Pod::Spec.new do |s|
|
|
|
31
14
|
s.platforms = { :ios => "15.0" }
|
|
32
15
|
s.source = { :git => package["homepage"] + ".git", :tag => "#{s.version}" }
|
|
33
16
|
s.swift_version = '5.0'
|
|
34
|
-
s.source_files = "ios/Sources/**/*.{h,m,swift}"
|
|
35
17
|
s.requires_arc = true
|
|
36
18
|
s.module_name = "ScanditDataCaptureId"
|
|
37
19
|
s.header_dir = "ScanditDataCaptureId"
|
|
38
20
|
|
|
39
|
-
s.dependency "React-Core"
|
|
40
21
|
s.dependency "scandit-react-native-datacapture-core", "= #{version}"
|
|
41
|
-
s.dependency "scandit-datacapture-frameworks-id", '= 8.
|
|
22
|
+
s.dependency "scandit-datacapture-frameworks-id", '= 8.3.0'
|
|
42
23
|
|
|
43
|
-
|
|
44
|
-
if ENV['RCT_NEW_ARCH_ENABLED'] == '1'
|
|
45
|
-
s.dependency "React-RCTAppDelegate"
|
|
24
|
+
is_new_arch_enabled = ENV['RCT_NEW_ARCH_ENABLED'] == '1'
|
|
46
25
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
26
|
+
if is_new_arch_enabled
|
|
27
|
+
s.source_files = "ios/Sources/**/*.{h,m,mm,swift}", "ios/generated/**/*.{h,m,mm,cpp}"
|
|
28
|
+
s.private_header_files = "ios/generated/**/*.h"
|
|
29
|
+
s.exclude_files = "ios/Sources/OldArch/**/*"
|
|
30
|
+
s.dependency "React-RCTAppDelegate"
|
|
52
31
|
|
|
53
32
|
s.pod_target_xcconfig = {
|
|
54
|
-
'OTHER_SWIFT_FLAGS' =>
|
|
33
|
+
'OTHER_SWIFT_FLAGS' => '-DRCT_NEW_ARCH_ENABLED',
|
|
34
|
+
'HEADER_SEARCH_PATHS' => '"$(PODS_TARGET_SRCROOT)/ios/generated"'
|
|
55
35
|
}
|
|
36
|
+
else
|
|
37
|
+
s.source_files = "ios/Sources/**/*.{h,m,mm,swift}"
|
|
38
|
+
s.exclude_files = "ios/Sources/NewArch/**/*"
|
|
56
39
|
end
|
|
57
40
|
|
|
58
|
-
install_modules_dependencies
|
|
41
|
+
if respond_to?(:install_modules_dependencies, true)
|
|
42
|
+
install_modules_dependencies(s)
|
|
43
|
+
else
|
|
44
|
+
s.dependency "React-Core"
|
|
45
|
+
end
|
|
59
46
|
end
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import {TurboModule, TurboModuleRegistry} from 'react-native';
|
|
2
|
+
import type {EventEmitter} from 'react-native/Libraries/Types/CodegenTypes';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Unified event payload for all Scandit events.
|
|
6
|
+
* Events are filtered by name on the JS side.
|
|
7
|
+
*/
|
|
8
|
+
export type ScanditEventPayload = {
|
|
9
|
+
name: string;
|
|
10
|
+
data: string;
|
|
11
|
+
viewId?: number;
|
|
12
|
+
modeId?: number;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export interface Spec extends TurboModule {
|
|
16
|
+
// Events - unified event emitter for all ID events
|
|
17
|
+
readonly onScanditEvent: EventEmitter<ScanditEventPayload>;
|
|
18
|
+
|
|
19
|
+
readonly getConstants: () => {
|
|
20
|
+
// eslint-disable-next-line @typescript-eslint/no-wrapper-object-types
|
|
21
|
+
Defaults: Object;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
// Single entry point for all ID operations - use Object so codegen produces NSDictionary on iOS
|
|
25
|
+
// eslint-disable-next-line @typescript-eslint/no-wrapper-object-types
|
|
26
|
+
executeId(data: Object): Promise<void>;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export default TurboModuleRegistry.getEnforcing<Spec>('ScanditDataCaptureId');
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
#import "ScanditDataCaptureId.h"
|
|
2
|
-
#import <React/RCTEventEmitter.h>
|
|
3
|
-
|
|
4
|
-
@interface RCT_EXTERN_MODULE (ScanditDataCaptureId, RCTEventEmitter)
|
|
5
|
-
RCT_EXTERN_METHOD(executeId
|
|
6
|
-
: (NSDictionary *)data resolve
|
|
7
|
-
: (RCTPromiseResolveBlock)resolve reject
|
|
8
|
-
: (RCTPromiseRejectBlock)reject)
|
|
9
|
-
@end
|