scandit-react-native-datacapture-core 6.27.0 → 6.28.0-beta.1
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 -1
- package/android/src/main/kotlin/com/scandit/datacapture/reactnative/core/ScanditDataCaptureCoreModule.kt +0 -22
- package/android/src/main/kotlin/com/scandit/datacapture/reactnative/core/ScanditDataCaptureCorePackage.kt +14 -7
- package/android/src/main/kotlin/com/scandit/datacapture/reactnative/core/ui/DataCaptureViewManager.kt +17 -16
- package/dist/core.js +47 -19
- package/dist/core.js.map +1 -1
- package/dist/dts/native/DataCaptureViewProxy.d.ts +1 -3
- package/dist/index.js +3 -9
- package/dist/index.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/ios/Sources/ScanditDataCaptureCore.m +0 -14
- package/ios/Sources/ScanditDataCaptureCore.swift +13 -70
- package/ios/Sources/ScanditDataCaptureViewManager.swift +12 -31
- package/package.json +2 -2
- package/scandit-react-native-datacapture-core.podspec +1 -1
|
@@ -15,6 +15,14 @@ class RNTSDCDataCaptureViewWrapper: UIView {
|
|
|
15
15
|
if let viewManager = viewManager,
|
|
16
16
|
let index = viewManager.containers.firstIndex(of: self) {
|
|
17
17
|
viewManager.containers.remove(at: index)
|
|
18
|
+
|
|
19
|
+
if let droppedView = viewManager.dataCaptureView {
|
|
20
|
+
viewManager.dataCaptureView = nil
|
|
21
|
+
// on iOS we don't have a callback like the android onDropViewInstance where we can remove the dropped instance.
|
|
22
|
+
// here we just override the willRemoveSubview of the wrapper and notify the core module that the dcview has been removed.
|
|
23
|
+
DeserializationLifeCycleDispatcher.shared.dispatchDataCaptureViewRemoved(view: droppedView)
|
|
24
|
+
}
|
|
25
|
+
|
|
18
26
|
viewManager.addCaptureViewToLastContainer()
|
|
19
27
|
}
|
|
20
28
|
super.removeFromSuperview()
|
|
@@ -22,7 +30,7 @@ class RNTSDCDataCaptureViewWrapper: UIView {
|
|
|
22
30
|
}
|
|
23
31
|
|
|
24
32
|
@objc(RNTSDCDataCaptureViewManager)
|
|
25
|
-
class RNTSDCDataCaptureViewManager: RCTViewManager, DeserializationLifeCycleObserver
|
|
33
|
+
class RNTSDCDataCaptureViewManager: RCTViewManager, DeserializationLifeCycleObserver {
|
|
26
34
|
|
|
27
35
|
internal var containers: [RNTSDCDataCaptureViewWrapper] = []
|
|
28
36
|
|
|
@@ -33,9 +41,6 @@ class RNTSDCDataCaptureViewManager: RCTViewManager, DeserializationLifeCycleObse
|
|
|
33
41
|
}
|
|
34
42
|
|
|
35
43
|
guard let dcView = dataCaptureView else {
|
|
36
|
-
container.subviews.forEach {
|
|
37
|
-
$0.removeFromSuperview()
|
|
38
|
-
}
|
|
39
44
|
return
|
|
40
45
|
}
|
|
41
46
|
|
|
@@ -61,33 +66,13 @@ class RNTSDCDataCaptureViewManager: RCTViewManager, DeserializationLifeCycleObse
|
|
|
61
66
|
|
|
62
67
|
var isObserving = false
|
|
63
68
|
|
|
64
|
-
override init() {
|
|
65
|
-
super.init()
|
|
66
|
-
DeserializationLifeCycleDispatcher.shared.attach(observer: self)
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
func invalidate() {
|
|
70
|
-
DeserializationLifeCycleDispatcher.shared.detach(observer: self)
|
|
71
|
-
}
|
|
72
|
-
|
|
73
69
|
func addCaptureViewToLastContainer() {
|
|
74
70
|
guard let container = containers.last,
|
|
75
|
-
let captureView =
|
|
71
|
+
let captureView = DataCaptureViewHandler.shared.topmostDataCaptureView else {
|
|
76
72
|
return
|
|
77
73
|
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
// it again might trigger something in the DataCaptureView that we don't
|
|
81
|
-
// want. (overlay re-drawn, black screen, etc.)
|
|
82
|
-
return
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
if captureView.superview != nil {
|
|
86
|
-
captureView.removeFromSuperview()
|
|
87
|
-
}
|
|
88
|
-
captureView.frame = container.bounds
|
|
89
|
-
captureView.autoresizingMask = [.flexibleWidth, .flexibleHeight]
|
|
90
|
-
container.addSubview(captureView)
|
|
74
|
+
|
|
75
|
+
dataCaptureView = captureView
|
|
91
76
|
}
|
|
92
77
|
|
|
93
78
|
override func view() -> UIView! {
|
|
@@ -111,8 +96,4 @@ class RNTSDCDataCaptureViewManager: RCTViewManager, DeserializationLifeCycleObse
|
|
|
111
96
|
|
|
112
97
|
return container
|
|
113
98
|
}
|
|
114
|
-
|
|
115
|
-
func dataCaptureView(deserialized view: DataCaptureView?) {
|
|
116
|
-
dataCaptureView = view
|
|
117
|
-
}
|
|
118
99
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "scandit-react-native-datacapture-core",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.28.0-beta.1",
|
|
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",
|
|
@@ -49,6 +49,6 @@
|
|
|
49
49
|
"typescript": "4.9.5"
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"scandit-datacapture-frameworks-core": "6.
|
|
52
|
+
"scandit-datacapture-frameworks-core": "6.28.0-beta.1"
|
|
53
53
|
}
|
|
54
54
|
}
|
|
@@ -18,6 +18,6 @@ Pod::Spec.new do |s|
|
|
|
18
18
|
s.module_name = "ScanditDataCaptureCore"
|
|
19
19
|
s.header_dir = "ScanditDataCaptureCore"
|
|
20
20
|
|
|
21
|
-
s.dependency "scandit-datacapture-frameworks-core", '= 6.
|
|
21
|
+
s.dependency "scandit-datacapture-frameworks-core", '= 6.28.0-beta.1'
|
|
22
22
|
s.dependency "React"
|
|
23
23
|
end
|