scandit-react-native-datacapture-core 6.21.2 → 6.22.0-beta.2
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 +1 -2
- package/android/src/main/kotlin/com/scandit/datacapture/reactnative/core/ScanditDataCaptureCoreModule.kt +45 -0
- package/android/src/main/kotlin/com/scandit/datacapture/reactnative/core/ui/DataCaptureViewManager.kt +3 -1
- package/dist/core.js +191 -50
- package/dist/core.js.map +1 -1
- package/dist/dts/DataCaptureView.d.ts +3 -2
- package/dist/dts/native/CameraProxy.d.ts +1 -1
- package/dist/dts/native/DataCaptureContextProxy.d.ts +7 -4
- package/dist/dts/native/DataCaptureViewProxy.d.ts +8 -0
- package/dist/dts/native/ImageFrameSourceProxy.d.ts +1 -2
- package/dist/index.js +52 -14
- package/dist/index.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/ios/Sources/ScanditDataCaptureCore.m +43 -0
- package/ios/Sources/ScanditDataCaptureCore.swift +68 -8
- package/ios/Sources/ScanditDataCaptureViewManager.swift +5 -5
- package/package.json +3 -3
- package/scandit-react-native-datacapture-core.podspec +3 -2
- package/scripts/detect_frameworks.rb +1 -1
|
@@ -95,14 +95,6 @@ public class ScanditDataCaptureCore: RCTEventEmitter {
|
|
|
95
95
|
ScanditDataCaptureCore.rntSDCComponentDeserializers
|
|
96
96
|
}
|
|
97
97
|
|
|
98
|
-
static public func register(componentDeserializer: DataCaptureComponentDeserializer) {
|
|
99
|
-
Deserializers.Factory.add(componentDeserializer)
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
static public func unregister(componentDeserializer: DataCaptureComponentDeserializer) {
|
|
103
|
-
Deserializers.Factory.remove(componentDeserializer)
|
|
104
|
-
}
|
|
105
|
-
|
|
106
98
|
internal var components = [DataCaptureComponent]() {
|
|
107
99
|
didSet {
|
|
108
100
|
componentsSet = Set<String>(components.map { $0.componentId })
|
|
@@ -151,6 +143,10 @@ public class ScanditDataCaptureCore: RCTEventEmitter {
|
|
|
151
143
|
dispose()
|
|
152
144
|
}
|
|
153
145
|
|
|
146
|
+
deinit {
|
|
147
|
+
invalidate()
|
|
148
|
+
}
|
|
149
|
+
|
|
154
150
|
@objc(contextFromJSON:resolve:reject:)
|
|
155
151
|
func contextFromJSON(json: String,
|
|
156
152
|
resolve: @escaping RCTPromiseResolveBlock,
|
|
@@ -206,6 +202,16 @@ public class ScanditDataCaptureCore: RCTEventEmitter {
|
|
|
206
202
|
coreModule.isTorchAvailable(cameraPosition: cameraPosition, result: ReactNativeResult(resolve, reject))
|
|
207
203
|
}
|
|
208
204
|
|
|
205
|
+
@objc(switchCameraToDesiredState:resolve:reject:)
|
|
206
|
+
func switchCameraToDesiredState(desiredStateJson: String,
|
|
207
|
+
resolve: @escaping RCTPromiseResolveBlock,
|
|
208
|
+
reject: @escaping RCTPromiseRejectBlock) {
|
|
209
|
+
coreModule.switchCameraToDesiredState(
|
|
210
|
+
stateJson: desiredStateJson,
|
|
211
|
+
result: ReactNativeResult(resolve, reject)
|
|
212
|
+
)
|
|
213
|
+
}
|
|
214
|
+
|
|
209
215
|
@objc(getLastFrame:reject:)
|
|
210
216
|
func getLastFrame(resolve: @escaping RCTPromiseResolveBlock,
|
|
211
217
|
reject: @escaping RCTPromiseRejectBlock) {
|
|
@@ -262,6 +268,60 @@ public class ScanditDataCaptureCore: RCTEventEmitter {
|
|
|
262
268
|
@objc func unregisterListenerForViewEvents() {
|
|
263
269
|
coreModule.unregisterDataCaptureViewListener()
|
|
264
270
|
}
|
|
271
|
+
|
|
272
|
+
@objc(addModeToContext:resolve:reject:)
|
|
273
|
+
func addModeToContext(modeJson: String,
|
|
274
|
+
resolve: @escaping RCTPromiseResolveBlock,
|
|
275
|
+
reject: @escaping RCTPromiseRejectBlock) {
|
|
276
|
+
coreModule.addModeToContext(modeJson: modeJson, result: ReactNativeResult(resolve, reject))
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
@objc(removeModeFromContext:resolve:reject:)
|
|
280
|
+
func removeModeFromContext(modeJson: String,
|
|
281
|
+
resolve: @escaping RCTPromiseResolveBlock,
|
|
282
|
+
reject: @escaping RCTPromiseRejectBlock) {
|
|
283
|
+
coreModule.removeModeFromContext(modeJson: modeJson, result: ReactNativeResult(resolve, reject))
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
@objc(removeAllModesFromContext:reject:)
|
|
287
|
+
func removeAllModesFromContext(resolve: @escaping RCTPromiseResolveBlock,
|
|
288
|
+
reject: @escaping RCTPromiseRejectBlock) {
|
|
289
|
+
coreModule.removeAllModes(result: ReactNativeResult(resolve, reject))
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
@objc(createDataCaptureView:resolve:reject:)
|
|
293
|
+
func createDataCaptureView(viewJson: String,
|
|
294
|
+
resolve: @escaping RCTPromiseResolveBlock,
|
|
295
|
+
reject: @escaping RCTPromiseRejectBlock) {
|
|
296
|
+
_ = coreModule.createDataCaptureView(viewJson: viewJson, result: ReactNativeResult(resolve, reject))
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
@objc(updateDataCaptureView:resolve:reject:)
|
|
300
|
+
func updateDataCaptureView(viewJson: String,
|
|
301
|
+
resolve: @escaping RCTPromiseResolveBlock,
|
|
302
|
+
reject: @escaping RCTPromiseRejectBlock) {
|
|
303
|
+
coreModule.updateDataCaptureView(viewJson: viewJson, result: ReactNativeResult(resolve, reject))
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
@objc(addOverlay:resolve:reject:)
|
|
307
|
+
func addOverlay(overlayJson: String,
|
|
308
|
+
resolve: @escaping RCTPromiseResolveBlock,
|
|
309
|
+
reject: @escaping RCTPromiseRejectBlock) {
|
|
310
|
+
coreModule.addOverlayToView(overlayJson: overlayJson, result: ReactNativeResult(resolve, reject))
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
@objc(removeOverlay:resolve:reject:)
|
|
314
|
+
func removeOverlay(overlayJson: String,
|
|
315
|
+
resolve: @escaping RCTPromiseResolveBlock,
|
|
316
|
+
reject: @escaping RCTPromiseRejectBlock) {
|
|
317
|
+
coreModule.removeOverlayFromView(overlayJson: overlayJson, result: ReactNativeResult(resolve, reject))
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
@objc(removeAllOverlays:reject:)
|
|
321
|
+
func removeAllOverlays(resolve: @escaping RCTPromiseResolveBlock,
|
|
322
|
+
reject: @escaping RCTPromiseRejectBlock) {
|
|
323
|
+
coreModule.removeAllOverlays(result: ReactNativeResult(resolve, reject))
|
|
324
|
+
}
|
|
265
325
|
}
|
|
266
326
|
|
|
267
327
|
extension ScanditDataCaptureCore: DeserializationLifeCycleObserver {
|
|
@@ -39,11 +39,11 @@ class RNTSDCDataCaptureViewManager: RCTViewManager, DeserializationLifeCycleObse
|
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
if dcView.superview != nil && dcView.superview == container {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
42
|
+
// if attached to the same container do nothing. Removing and adding
|
|
43
|
+
// it again might trigger something in the DataCaptureView that we don't
|
|
44
|
+
// want. (overlay re-drawn, black screen, etc.)
|
|
45
|
+
return
|
|
46
|
+
}
|
|
47
47
|
|
|
48
48
|
if dcView.superview != nil {
|
|
49
49
|
dcView.removeFromSuperview()
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "scandit-react-native-datacapture-core",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.22.0-beta.2",
|
|
4
4
|
"description": "Scandit Data Capture SDK for React Native",
|
|
5
5
|
"homepage": "https://github.com/Scandit/scandit-react-native-datacapture-core",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@types/react-native": ">=0.60.0-rc.0 <1.0.x",
|
|
32
|
-
"tslint": "
|
|
32
|
+
"tslint": "6.1.2",
|
|
33
33
|
"typescript": "4.9.5",
|
|
34
34
|
"rollup": "3.21.6",
|
|
35
35
|
"@rollup/plugin-node-resolve": "15.0.2",
|
|
@@ -37,6 +37,6 @@
|
|
|
37
37
|
"@rollup/plugin-commonjs": "24.1.0"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"scandit-datacapture-frameworks-core": "6.
|
|
40
|
+
"scandit-datacapture-frameworks-core": "6.22.0-beta.2"
|
|
41
41
|
}
|
|
42
42
|
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
require "json"
|
|
2
2
|
|
|
3
3
|
package = JSON.parse(File.read(File.join(__dir__, "package.json")))
|
|
4
|
+
version = package["version"]
|
|
4
5
|
|
|
5
6
|
Pod::Spec.new do |s|
|
|
6
7
|
s.name = package["name"]
|
|
7
|
-
s.version =
|
|
8
|
+
s.version = version
|
|
8
9
|
s.summary = package["description"]
|
|
9
10
|
s.homepage = package["homepage"]
|
|
10
11
|
s.license = package["license"]
|
|
@@ -17,6 +18,6 @@ Pod::Spec.new do |s|
|
|
|
17
18
|
s.module_name = "ScanditDataCaptureCore"
|
|
18
19
|
s.header_dir = "ScanditDataCaptureCore"
|
|
19
20
|
|
|
20
|
-
s.dependency "scandit-datacapture-frameworks-core", '= 6.
|
|
21
|
+
s.dependency "scandit-datacapture-frameworks-core", '= 6.22.0-beta.2'
|
|
21
22
|
s.dependency "React"
|
|
22
23
|
end
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
def podspec_path_for_pod(pod_name, current_path)
|
|
2
2
|
# the current_path will be always the folder of the Podfile where this function is executed
|
|
3
3
|
archive_dir = File.expand_path(File.join('..', '..', '..'))
|
|
4
|
-
if File.
|
|
4
|
+
if File.exist?(File.join(archive_dir, 'frameworks'))
|
|
5
5
|
File.join(archive_dir, 'frameworks', 'shared', 'ios', pod_name)
|
|
6
6
|
else
|
|
7
7
|
File.join(current_path.split('data-capture-sdk')[0], 'data-capture-sdk', 'frameworks', 'shared', 'ios', pod_name)
|