scandit-react-native-datacapture-core 6.10.0 → 6.11.0-beta.3
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 +5 -13
- package/android/src/main/kotlin/com/scandit/datacapture/reactnative/core/RnViewsOnUiThread.kt +8 -7
- package/android/src/main/kotlin/com/scandit/datacapture/reactnative/core/ScanditDataCaptureCoreModule.kt +81 -57
- package/android/src/main/kotlin/com/scandit/datacapture/reactnative/core/data/defaults/SerializableBrushDefaults.kt +3 -3
- package/android/src/main/kotlin/com/scandit/datacapture/reactnative/core/data/defaults/SerializableCameraDefaults.kt +6 -3
- package/android/src/main/kotlin/com/scandit/datacapture/reactnative/core/data/defaults/SerializableCameraSettingsDefaults.kt +6 -6
- package/android/src/main/kotlin/com/scandit/datacapture/reactnative/core/data/defaults/SerializableLaserlineViewfinderDefaults.kt +2 -1
- package/android/src/main/kotlin/com/scandit/datacapture/reactnative/core/data/defaults/SerializableRectangularViewfinderDefaults.kt +21 -14
- package/android/src/main/kotlin/com/scandit/datacapture/reactnative/core/deserializers/Deserializers.kt +17 -17
- package/android/src/main/kotlin/com/scandit/datacapture/reactnative/core/deserializers/TreeLifecycleObserver.kt +5 -5
- package/android/src/main/kotlin/com/scandit/datacapture/reactnative/core/listener/RCTDataCaptureContextListener.kt +2 -2
- package/android/src/main/kotlin/com/scandit/datacapture/reactnative/core/listener/RCTDataCaptureViewListener.kt +12 -6
- package/android/src/main/kotlin/com/scandit/datacapture/reactnative/core/ui/DataCaptureViewManager.kt +7 -4
- package/android/src/main/kotlin/com/scandit/datacapture/reactnative/core/utils/Extensions.kt +5 -5
- package/android/src/main/kotlin/com/scandit/datacapture/reactnative/core/utils/TestUtils.kt +1 -16
- package/ios/Sources/ScanditDataCaptureCore+Defaults.swift +2 -0
- package/ios/Sources/ScanditDataCaptureCore.m +4 -0
- package/ios/Sources/ScanditDataCaptureCore.swift +16 -0
- package/js/Camera+Related.d.ts +12 -0
- package/js/Camera+Related.js +28 -1
- package/js/Camera+Related.js.map +1 -1
- package/js/DataCaptureVersion.js +1 -1
- package/js/DataCaptureVersion.js.map +1 -1
- package/js/Viewfinder.d.ts +10 -2
- package/js/Viewfinder.js +43 -2
- package/js/Viewfinder.js.map +1 -1
- package/js/native/CameraProxy.d.ts +2 -0
- package/js/native/CameraProxy.js +6 -0
- package/js/native/CameraProxy.js.map +1 -1
- package/js/private/Defaults.js +4 -3
- package/js/private/Defaults.js.map +1 -1
- package/js/private/PrivateCamera+Related.d.ts +22 -1
- package/js/private/PrivateCamera+Related.js +34 -0
- package/js/private/PrivateCamera+Related.js.map +1 -1
- package/package.json +2 -2
- package/scandit-react-native-datacapture-core.podspec +1 -1
package/android/build.gradle
CHANGED
|
@@ -7,26 +7,19 @@ buildscript {
|
|
|
7
7
|
mavenCentral()
|
|
8
8
|
}
|
|
9
9
|
dependencies {
|
|
10
|
-
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.
|
|
10
|
+
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.10"
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
apply plugin: 'com.android.library'
|
|
15
15
|
apply plugin: 'kotlin-android'
|
|
16
|
-
apply plugin: 'maven'
|
|
17
16
|
|
|
18
17
|
android {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
sourceSets {
|
|
22
|
-
main.java.srcDirs += 'src/main/kotlin'
|
|
23
|
-
test.java.srcDirs += 'src/test/kotlin'
|
|
24
|
-
androidTest.java.srcDirs += 'src/androidTest/kotlin'
|
|
25
|
-
}
|
|
18
|
+
compileSdk safeExtGet('compileSdkVersion', 29)
|
|
26
19
|
|
|
27
20
|
defaultConfig {
|
|
28
|
-
|
|
29
|
-
|
|
21
|
+
minSdk safeExtGet('minSdkVersion', 21)
|
|
22
|
+
targetSdk safeExtGet('targetSdkVersion', 29)
|
|
30
23
|
versionCode 1
|
|
31
24
|
versionName "1.0"
|
|
32
25
|
}
|
|
@@ -37,12 +30,11 @@ android {
|
|
|
37
30
|
}
|
|
38
31
|
|
|
39
32
|
dependencies {
|
|
40
|
-
def sdk_version = "6.
|
|
33
|
+
def sdk_version = "6.11.0-beta.3"
|
|
41
34
|
|
|
42
35
|
api "com.scandit.datacapture:core:$sdk_version"
|
|
43
36
|
|
|
44
37
|
//noinspection GradleDynamicVersion
|
|
45
38
|
implementation 'com.facebook.react:react-native:+' // From node_modules
|
|
46
|
-
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.4.10"
|
|
47
39
|
implementation "com.squareup.okhttp3:okhttp:4.9.0"
|
|
48
40
|
}
|
package/android/src/main/kotlin/com/scandit/datacapture/reactnative/core/RnViewsOnUiThread.kt
CHANGED
|
@@ -20,14 +20,14 @@ internal inline fun withRnViewsRemovedOnUiThread(json: JsonString, update: (Json
|
|
|
20
20
|
val jsonObject = JSONObject(json)
|
|
21
21
|
val view = DataCaptureViewHandler.dataCaptureView
|
|
22
22
|
val barcodeTrackingAdvancedOverlay =
|
|
23
|
-
|
|
23
|
+
view?.getOverlay(Barcode.barcodeTrackingAdvancedOverlayClass)
|
|
24
24
|
|
|
25
25
|
if (barcodeTrackingAdvancedOverlay != null) {
|
|
26
26
|
withBarcodeTrackingAdvancedOverlayViewsRemovedOnUiThread(
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
view,
|
|
28
|
+
barcodeTrackingAdvancedOverlay,
|
|
29
|
+
jsonObject,
|
|
30
|
+
update
|
|
31
31
|
)
|
|
32
32
|
|
|
33
33
|
return
|
|
@@ -71,7 +71,7 @@ private inline fun withBarcodeTrackingAdvancedOverlayViewsRemovedOnUiThread(
|
|
|
71
71
|
|
|
72
72
|
internal object Barcode {
|
|
73
73
|
private const val BARCODE_TRACKING_ADVANCED_OVERLAY_CLASS_NAME =
|
|
74
|
-
|
|
74
|
+
"com.scandit.datacapture.barcode.tracking.ui.overlay.BarcodeTrackingAdvancedOverlay"
|
|
75
75
|
|
|
76
76
|
lateinit var barcodeTrackingAdvancedOverlayClass: Class<*>
|
|
77
77
|
private set
|
|
@@ -91,10 +91,11 @@ internal object Barcode {
|
|
|
91
91
|
private fun checkClasspath() {
|
|
92
92
|
try {
|
|
93
93
|
barcodeTrackingAdvancedOverlayClass =
|
|
94
|
-
|
|
94
|
+
Class.forName(BARCODE_TRACKING_ADVANCED_OVERLAY_CLASS_NAME)
|
|
95
95
|
isInClasspath = true
|
|
96
96
|
} catch (e: ClassNotFoundException) {
|
|
97
97
|
// Barcode not in classpath.
|
|
98
|
+
println(e)
|
|
98
99
|
}
|
|
99
100
|
|
|
100
101
|
classpathChecked = true
|
|
@@ -17,6 +17,8 @@ import com.scandit.datacapture.core.capture.DataCaptureContextListener
|
|
|
17
17
|
import com.scandit.datacapture.core.capture.DataCaptureVersion
|
|
18
18
|
import com.scandit.datacapture.core.common.feedback.Feedback
|
|
19
19
|
import com.scandit.datacapture.core.common.geometry.*
|
|
20
|
+
import com.scandit.datacapture.core.data.FrameData
|
|
21
|
+
import com.scandit.datacapture.core.data.toJson
|
|
20
22
|
import com.scandit.datacapture.core.json.JsonValue
|
|
21
23
|
import com.scandit.datacapture.core.source.*
|
|
22
24
|
import com.scandit.datacapture.core.source.serialization.FrameSourceDeserializer
|
|
@@ -45,15 +47,15 @@ class ScanditDataCaptureCoreModule(
|
|
|
45
47
|
private val reactContext: ReactApplicationContext,
|
|
46
48
|
eventEmitter: RCTDeviceEventEmitter = LazyEventEmitter(reactContext),
|
|
47
49
|
private val dataCaptureContextListener: RCTDataCaptureContextListener =
|
|
48
|
-
|
|
50
|
+
RCTDataCaptureContextListener(eventEmitter),
|
|
49
51
|
private val frameSourceListener: RCTFrameSourceListener = RCTFrameSourceListener(eventEmitter),
|
|
50
52
|
private val dataCaptureViewListener: RCTDataCaptureViewListener =
|
|
51
|
-
|
|
53
|
+
RCTDataCaptureViewListener(eventEmitter)
|
|
52
54
|
) : ReactContextBaseJavaModule(reactContext),
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
55
|
+
FrameSourceDeserializerListener,
|
|
56
|
+
DataCaptureContextListener by dataCaptureContextListener,
|
|
57
|
+
FrameSourceListener by frameSourceListener,
|
|
58
|
+
DataCaptureViewListener by dataCaptureViewListener {
|
|
57
59
|
|
|
58
60
|
companion object {
|
|
59
61
|
private const val VERSION_KEY = "Version"
|
|
@@ -62,8 +64,14 @@ class ScanditDataCaptureCoreModule(
|
|
|
62
64
|
private val ERROR_DESERIALIZATION_FAILED = Error(1, "Unable to deserialize a valid object.")
|
|
63
65
|
private val ERROR_NULL_VIEW = Error(2, "DataCaptureView is null")
|
|
64
66
|
private val ERROR_CAMERA_NOT_READY = Error(3, "Camera has yet not been instantiated.")
|
|
65
|
-
private val ERROR_WRONG_CAMERA_POSITION = Error(
|
|
66
|
-
|
|
67
|
+
private val ERROR_WRONG_CAMERA_POSITION = Error(
|
|
68
|
+
4,
|
|
69
|
+
"CameraPosition argument does not " +
|
|
70
|
+
"match the position of the currently used camera."
|
|
71
|
+
)
|
|
72
|
+
private val ERROR_NULL_FRAME = Error(5, "Frame is null, it might've been reused already.")
|
|
73
|
+
|
|
74
|
+
var lastFrame: FrameData? = null
|
|
67
75
|
}
|
|
68
76
|
|
|
69
77
|
@get:VisibleForTesting
|
|
@@ -91,39 +99,39 @@ class ScanditDataCaptureCoreModule(
|
|
|
91
99
|
val aimerViewfinder = AimerViewfinder()
|
|
92
100
|
val brush = Brush.transparent()
|
|
93
101
|
val availableCameraPositions = listOfNotNull(
|
|
94
|
-
|
|
95
|
-
|
|
102
|
+
Camera.getCamera(CameraPosition.USER_FACING)?.position,
|
|
103
|
+
Camera.getCamera(CameraPosition.WORLD_FACING)?.position
|
|
96
104
|
)
|
|
97
105
|
|
|
98
106
|
SerializableCoreDefaults(
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
),
|
|
104
|
-
availablePositions = availableCameraPositions,
|
|
105
|
-
defaultPosition = Camera.getDefaultCamera()?.position?.toJson()
|
|
106
|
-
),
|
|
107
|
-
dataCaptureViewDefaults = SerializableDataCaptureViewDefaults(dataCaptureView),
|
|
108
|
-
laserlineViewfinderDefaults = SerializableLaserlineViewfinderDefaults(
|
|
109
|
-
laserViewfinder
|
|
110
|
-
),
|
|
111
|
-
rectangularViewfinderDefaults = SerializableRectangularViewfinderDefaults(
|
|
112
|
-
rectangularViewfinder
|
|
113
|
-
),
|
|
114
|
-
spotlightViewfinderDefaults = SerializableSpotlightViewfinderDefaults(
|
|
115
|
-
size = spotlightViewfinder.sizeWithUnitAndAspect.toJson(),
|
|
116
|
-
enabledBorderColor = spotlightViewfinder.enabledBorderColor.hexString,
|
|
117
|
-
disabledBorderColor = spotlightViewfinder.disabledBorderColor.hexString,
|
|
118
|
-
backgroundColor = spotlightViewfinder.backgroundColor.hexString
|
|
107
|
+
deviceId = DataCaptureContext.DEVICE_ID,
|
|
108
|
+
cameraDefaults = SerializableCameraDefaults(
|
|
109
|
+
cameraSettingsDefaults = SerializableCameraSettingsDefaults(
|
|
110
|
+
settings = cameraSettings
|
|
119
111
|
),
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
112
|
+
availablePositions = availableCameraPositions,
|
|
113
|
+
defaultPosition = Camera.getDefaultCamera()?.position?.toJson()
|
|
114
|
+
),
|
|
115
|
+
dataCaptureViewDefaults = SerializableDataCaptureViewDefaults(dataCaptureView),
|
|
116
|
+
laserlineViewfinderDefaults = SerializableLaserlineViewfinderDefaults(
|
|
117
|
+
laserViewfinder
|
|
118
|
+
),
|
|
119
|
+
rectangularViewfinderDefaults = SerializableRectangularViewfinderDefaults(
|
|
120
|
+
rectangularViewfinder
|
|
121
|
+
),
|
|
122
|
+
spotlightViewfinderDefaults = SerializableSpotlightViewfinderDefaults(
|
|
123
|
+
size = spotlightViewfinder.sizeWithUnitAndAspect.toJson(),
|
|
124
|
+
enabledBorderColor = spotlightViewfinder.enabledBorderColor.hexString,
|
|
125
|
+
disabledBorderColor = spotlightViewfinder.disabledBorderColor.hexString,
|
|
126
|
+
backgroundColor = spotlightViewfinder.backgroundColor.hexString
|
|
127
|
+
),
|
|
128
|
+
aimerViewfinderDefaults = SerializableAimerViewfinderDefaults(
|
|
129
|
+
frameColor = aimerViewfinder.frameColor.hexString,
|
|
130
|
+
dotColor = aimerViewfinder.dotColor.hexString
|
|
131
|
+
),
|
|
132
|
+
brushDefaults = SerializableBrushDefaults(
|
|
133
|
+
brush = brush
|
|
134
|
+
)
|
|
127
135
|
)
|
|
128
136
|
}
|
|
129
137
|
|
|
@@ -138,8 +146,8 @@ class ScanditDataCaptureCoreModule(
|
|
|
138
146
|
override fun getName(): String = "ScanditDataCaptureCore"
|
|
139
147
|
|
|
140
148
|
override fun getConstants(): MutableMap<String, Any> = mutableMapOf(
|
|
141
|
-
|
|
142
|
-
|
|
149
|
+
VERSION_KEY to DataCaptureVersion.VERSION_STRING,
|
|
150
|
+
DEFAULTS_KEY to defaults.toWritableMap()
|
|
143
151
|
)
|
|
144
152
|
|
|
145
153
|
@ReactMethod
|
|
@@ -205,10 +213,10 @@ class ScanditDataCaptureCoreModule(
|
|
|
205
213
|
TreeLifecycleObserver.dispatchParsersRemoved()
|
|
206
214
|
|
|
207
215
|
val result = deserializers.dataCaptureContextDeserializer.updateContextFromJson(
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
216
|
+
dataCaptureContext,
|
|
217
|
+
DataCaptureViewHandler.dataCaptureView,
|
|
218
|
+
emptyList(),
|
|
219
|
+
newJson
|
|
212
220
|
)
|
|
213
221
|
|
|
214
222
|
DataCaptureViewHandler.dataCaptureView?.removeListener(this)
|
|
@@ -226,6 +234,18 @@ class ScanditDataCaptureCoreModule(
|
|
|
226
234
|
contextFromJSON(json, promise)
|
|
227
235
|
}
|
|
228
236
|
|
|
237
|
+
@ReactMethod
|
|
238
|
+
fun getLastFrame(promise: Promise) {
|
|
239
|
+
val lastFrame = ScanditDataCaptureCoreModule.lastFrame
|
|
240
|
+
|
|
241
|
+
if (lastFrame == null) {
|
|
242
|
+
promise.reject(ERROR_NULL_FRAME)
|
|
243
|
+
return
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
promise.resolve(lastFrame.toJson())
|
|
247
|
+
}
|
|
248
|
+
|
|
229
249
|
@ReactMethod
|
|
230
250
|
fun dispose() {
|
|
231
251
|
TreeLifecycleObserver.dispatchTreeDestroyed()
|
|
@@ -263,10 +283,11 @@ class ScanditDataCaptureCoreModule(
|
|
|
263
283
|
|
|
264
284
|
try {
|
|
265
285
|
val mappedPoint = view.mapFramePointToView(
|
|
266
|
-
|
|
286
|
+
PointDeserializer.fromJson(json)
|
|
267
287
|
).densityIndependent
|
|
268
288
|
promise.resolve(mappedPoint.toJson())
|
|
269
289
|
} catch (e: JSONException) {
|
|
290
|
+
println(e)
|
|
270
291
|
promise.reject(ERROR_DESERIALIZATION_FAILED)
|
|
271
292
|
}
|
|
272
293
|
}
|
|
@@ -280,20 +301,21 @@ class ScanditDataCaptureCoreModule(
|
|
|
280
301
|
|
|
281
302
|
try {
|
|
282
303
|
val mappedQuadrilateral = view.mapFrameQuadrilateralToView(
|
|
283
|
-
|
|
304
|
+
QuadrilateralDeserializer.fromJson(json)
|
|
284
305
|
).densityIndependent
|
|
285
306
|
promise.resolve(mappedQuadrilateral.toJson())
|
|
286
307
|
} catch (e: JSONException) {
|
|
308
|
+
println(e)
|
|
287
309
|
promise.reject(ERROR_DESERIALIZATION_FAILED)
|
|
288
310
|
}
|
|
289
311
|
}
|
|
290
312
|
|
|
291
313
|
private val Quadrilateral.densityIndependent: Quadrilateral
|
|
292
314
|
get() = Quadrilateral(
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
315
|
+
topLeft.densityIndependent,
|
|
316
|
+
topRight.densityIndependent,
|
|
317
|
+
bottomRight.densityIndependent,
|
|
318
|
+
bottomLeft.densityIndependent
|
|
297
319
|
)
|
|
298
320
|
|
|
299
321
|
private val Point.densityIndependent: Point
|
|
@@ -307,11 +329,11 @@ class ScanditDataCaptureCoreModule(
|
|
|
307
329
|
try {
|
|
308
330
|
@Suppress("UseCheckOrError") // Explicit exception for readability.
|
|
309
331
|
camera
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
332
|
+
?.takeIf { it.position == CameraPositionDeserializer.fromJson(cameraPosition) }
|
|
333
|
+
?.let { promise.resolve(it.currentState.toJson()) }
|
|
334
|
+
?: throw IllegalStateException(
|
|
335
|
+
"Camera at $cameraPosition has yet not been instantiated."
|
|
336
|
+
)
|
|
315
337
|
} catch (e: IllegalStateException) {
|
|
316
338
|
promise.reject(e)
|
|
317
339
|
}
|
|
@@ -342,14 +364,16 @@ class ScanditDataCaptureCoreModule(
|
|
|
342
364
|
camera?.let {
|
|
343
365
|
if (json.contains("desiredTorchState")) {
|
|
344
366
|
it.desiredTorchState = TorchStateDeserializer.fromJson(
|
|
345
|
-
|
|
367
|
+
json.requireByKeyAsString("desiredTorchState")
|
|
346
368
|
)
|
|
347
369
|
}
|
|
348
370
|
|
|
349
371
|
if (json.contains("desiredState")) {
|
|
350
|
-
it.switchToDesiredState(
|
|
372
|
+
it.switchToDesiredState(
|
|
373
|
+
FrameSourceStateDeserializer.fromJson(
|
|
351
374
|
json.requireByKeyAsString("desiredState")
|
|
352
|
-
|
|
375
|
+
)
|
|
376
|
+
)
|
|
353
377
|
}
|
|
354
378
|
}
|
|
355
379
|
}
|
|
@@ -20,9 +20,9 @@ data class SerializableBrushDefaults(
|
|
|
20
20
|
) : SerializableData {
|
|
21
21
|
|
|
22
22
|
constructor(brush: Brush?) : this(
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
fillColor = brush?.fillColor?.hexString,
|
|
24
|
+
strokeColor = brush?.strokeColor?.hexString,
|
|
25
|
+
strokeWidth = brush?.strokeWidth
|
|
26
26
|
)
|
|
27
27
|
|
|
28
28
|
override fun toWritableMap(): WritableMap = writableMap {
|
|
@@ -23,9 +23,12 @@ data class SerializableCameraDefaults(
|
|
|
23
23
|
override fun toWritableMap(): WritableMap = writableMap {
|
|
24
24
|
putData(FIELD_CAMERA_SETTINGS_DEFAULTS, cameraSettingsDefaults)
|
|
25
25
|
putString(FIELD_DEFAULT_POSITION, defaultPosition)
|
|
26
|
-
putArray(
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
putArray(
|
|
27
|
+
FIELD_AVAILABLE_POSITIONS,
|
|
28
|
+
writableArray {
|
|
29
|
+
availablePositions.forEach { pushString(it.toJson()) }
|
|
30
|
+
}
|
|
31
|
+
)
|
|
29
32
|
}
|
|
30
33
|
|
|
31
34
|
companion object {
|
|
@@ -22,12 +22,12 @@ data class SerializableCameraSettingsDefaults(
|
|
|
22
22
|
) : SerializableData {
|
|
23
23
|
|
|
24
24
|
constructor(settings: CameraSettings) : this(
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
25
|
+
prefResolution = settings.preferredResolution.toJson(),
|
|
26
|
+
zoomFactor = settings.zoomFactor,
|
|
27
|
+
focusRange = "full",
|
|
28
|
+
zoomGestureZoomFactor = settings.zoomGestureZoomFactor,
|
|
29
|
+
focusGestureStrategy = settings.focusGestureStrategy.toJson(),
|
|
30
|
+
shouldPreferSmoothAutoFocus = settings.shouldPreferSmoothAutoFocus
|
|
31
31
|
)
|
|
32
32
|
|
|
33
33
|
override fun toWritableMap(): WritableMap = writableMap {
|
|
@@ -21,7 +21,8 @@ class SerializableLaserlineViewfinderDefaults(
|
|
|
21
21
|
|
|
22
22
|
override fun toWritableMap(): WritableMap = writableMap {
|
|
23
23
|
putString(FIELD_VIEW_FINDER_DEFAULT_STYLE, viewFinder.style.toJson())
|
|
24
|
-
putMap(
|
|
24
|
+
putMap(
|
|
25
|
+
FIELD_VIEW_FINDER_STYLES,
|
|
25
26
|
writableMap {
|
|
26
27
|
putMap(
|
|
27
28
|
LaserlineViewfinderStyle.ANIMATED.toJson(),
|
|
@@ -20,20 +20,23 @@ class SerializableRectangularViewfinderDefaults(
|
|
|
20
20
|
|
|
21
21
|
override fun toWritableMap(): WritableMap = writableMap {
|
|
22
22
|
putString(FIELD_VIEW_FINDER_DEFAULT_STYLE, rectangularViewfinder.style.toJson())
|
|
23
|
-
putMap(
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
23
|
+
putMap(
|
|
24
|
+
FIELD_VIEW_FINDER_STYLES,
|
|
25
|
+
writableMap {
|
|
26
|
+
putMap(
|
|
27
|
+
RectangularViewfinderStyle.LEGACY.toJson(),
|
|
28
|
+
createViewfinderDefaults(RectangularViewfinderStyle.LEGACY)
|
|
29
|
+
)
|
|
30
|
+
putMap(
|
|
31
|
+
RectangularViewfinderStyle.ROUNDED.toJson(),
|
|
32
|
+
createViewfinderDefaults(RectangularViewfinderStyle.ROUNDED)
|
|
33
|
+
)
|
|
34
|
+
putMap(
|
|
35
|
+
RectangularViewfinderStyle.SQUARE.toJson(),
|
|
36
|
+
createViewfinderDefaults(RectangularViewfinderStyle.SQUARE)
|
|
37
|
+
)
|
|
38
|
+
}
|
|
39
|
+
)
|
|
37
40
|
}
|
|
38
41
|
|
|
39
42
|
private fun createViewfinderDefaults(
|
|
@@ -43,9 +46,11 @@ class SerializableRectangularViewfinderDefaults(
|
|
|
43
46
|
writableMap {
|
|
44
47
|
putString(FIELD_VIEW_FINDER_SIZE, sizeWithUnitAndAspect.toJson())
|
|
45
48
|
putString(FIELD_VIEW_FINDER_COLOR, color.hexString)
|
|
49
|
+
putString(FIELD_VIEW_FINDER_DISABLED_COLOR, disabledColor.hexString)
|
|
46
50
|
putString(FIELD_VIEW_FINDER_STYLE, style.toJson())
|
|
47
51
|
putString(FIELD_VIEW_FINDER_LINE_STYLE, lineStyle.toJson())
|
|
48
52
|
putDouble(FIELD_VIEW_FINDER_DIMMING, dimming.toDouble())
|
|
53
|
+
putDouble(FIELD_VIEW_FINDER_DISABLED_DIMMING, disabledDimming.toDouble())
|
|
49
54
|
putString(FIELD_VIEW_FINDER_ANIMATION, animation?.toJson())
|
|
50
55
|
}
|
|
51
56
|
}
|
|
@@ -56,9 +61,11 @@ class SerializableRectangularViewfinderDefaults(
|
|
|
56
61
|
private const val FIELD_VIEW_FINDER_STYLES = "styles"
|
|
57
62
|
private const val FIELD_VIEW_FINDER_SIZE = "size"
|
|
58
63
|
private const val FIELD_VIEW_FINDER_COLOR = "color"
|
|
64
|
+
private const val FIELD_VIEW_FINDER_DISABLED_COLOR = "disabledColor"
|
|
59
65
|
private const val FIELD_VIEW_FINDER_STYLE = "style"
|
|
60
66
|
private const val FIELD_VIEW_FINDER_LINE_STYLE = "lineStyle"
|
|
61
67
|
private const val FIELD_VIEW_FINDER_DIMMING = "dimming"
|
|
68
|
+
private const val FIELD_VIEW_FINDER_DISABLED_DIMMING = "disabledDimming"
|
|
62
69
|
private const val FIELD_VIEW_FINDER_ANIMATION = "animation"
|
|
63
70
|
}
|
|
64
71
|
}
|
|
@@ -48,31 +48,31 @@ class Deserializers private constructor(
|
|
|
48
48
|
fun create(
|
|
49
49
|
context: Context,
|
|
50
50
|
frameSourceDeserializerListener:
|
|
51
|
-
|
|
51
|
+
FrameSourceDeserializerListener
|
|
52
52
|
): Deserializers {
|
|
53
53
|
return Deserializers(
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
54
|
+
context,
|
|
55
|
+
modeDeserializers,
|
|
56
|
+
componentDeserializers,
|
|
57
|
+
frameSourceDeserializerListener
|
|
58
58
|
)
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
private val frameSourceDeserializer: FrameSourceDeserializer =
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
63
|
+
FrameSourceDeserializer(modeDeserializers).apply {
|
|
64
|
+
listener = frameSourceDeserializerListener
|
|
65
|
+
}
|
|
66
66
|
private val dataCaptureViewDeserializer: DataCaptureViewDeserializer =
|
|
67
|
-
|
|
67
|
+
DataCaptureViewDeserializer(context, modeDeserializers)
|
|
68
68
|
|
|
69
69
|
val dataCaptureContextDeserializer: DataCaptureContextDeserializer =
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
70
|
+
DataCaptureContextDeserializer(
|
|
71
|
+
frameSourceDeserializer,
|
|
72
|
+
dataCaptureViewDeserializer,
|
|
73
|
+
modeDeserializers,
|
|
74
|
+
componentDeserializers
|
|
75
|
+
).apply {
|
|
76
|
+
avoidThreadDependencies = true
|
|
77
|
+
}
|
|
78
78
|
}
|
|
@@ -32,14 +32,14 @@ object TreeLifecycleObserver {
|
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
interface Callbacks {
|
|
35
|
-
fun onTreeCreated(root: DataCaptureContext)
|
|
35
|
+
fun onTreeCreated(root: DataCaptureContext) { }
|
|
36
36
|
|
|
37
|
-
fun onTreeDestroyed()
|
|
37
|
+
fun onTreeDestroyed() { }
|
|
38
38
|
|
|
39
|
-
fun onBarcodeTrackingRemoved()
|
|
39
|
+
fun onBarcodeTrackingRemoved() { }
|
|
40
40
|
|
|
41
|
-
fun onBarcodeTrackingAdvancedOverlayRemoved()
|
|
41
|
+
fun onBarcodeTrackingAdvancedOverlayRemoved() { }
|
|
42
42
|
|
|
43
|
-
fun onParsersRemoved()
|
|
43
|
+
fun onParsersRemoved() { }
|
|
44
44
|
}
|
|
45
45
|
}
|
|
@@ -20,9 +20,9 @@ class RCTDataCaptureContextListener(
|
|
|
20
20
|
|
|
21
21
|
companion object {
|
|
22
22
|
private const val ON_OBSERVATION_STARTED_EVENT_NAME =
|
|
23
|
-
|
|
23
|
+
"dataCaptureContextListener-didStartObservingContext"
|
|
24
24
|
private const val ON_STATUS_CHANGED_EVENT_NAME =
|
|
25
|
-
|
|
25
|
+
"dataCaptureContextListener-didChangeStatus"
|
|
26
26
|
|
|
27
27
|
private const val FIELD_STATUS = "status"
|
|
28
28
|
}
|
|
@@ -32,12 +32,18 @@ class RCTDataCaptureViewListener(
|
|
|
32
32
|
if (!hasNativeListeners.get()) return
|
|
33
33
|
|
|
34
34
|
val params = writableMap {
|
|
35
|
-
putMap(
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
35
|
+
putMap(
|
|
36
|
+
FIELD_SIZE,
|
|
37
|
+
writableMap {
|
|
38
|
+
putInt(FIELD_WIDTH, width)
|
|
39
|
+
putInt(FIELD_HEIGHT, height)
|
|
40
|
+
}
|
|
41
|
+
)
|
|
42
|
+
putString(
|
|
43
|
+
FIELD_ORIENTATION,
|
|
44
|
+
DeviceOrientationMapper()
|
|
45
|
+
.mapRotationToOrientation(screenRotation).toJson()
|
|
46
|
+
)
|
|
41
47
|
}
|
|
42
48
|
eventEmitter.emit(ON_SIZE_CHANGED_EVENT_NAME, params)
|
|
43
49
|
}
|
|
@@ -17,8 +17,9 @@ import com.facebook.react.uimanager.ViewGroupManager
|
|
|
17
17
|
import com.scandit.datacapture.core.ui.DataCaptureView
|
|
18
18
|
import com.scandit.datacapture.reactnative.core.handler.DataCaptureViewHandler
|
|
19
19
|
|
|
20
|
-
class DataCaptureViewManager :
|
|
21
|
-
|
|
20
|
+
class DataCaptureViewManager :
|
|
21
|
+
ViewGroupManager<FrameLayout>(),
|
|
22
|
+
DataCaptureViewHandler.ViewListener {
|
|
22
23
|
|
|
23
24
|
@get:VisibleForTesting
|
|
24
25
|
var container: FrameLayout? = null
|
|
@@ -76,8 +77,10 @@ class DataCaptureViewManager : ViewGroupManager<FrameLayout>(),
|
|
|
76
77
|
container?.let { container ->
|
|
77
78
|
for (i in 0 until container.childCount) {
|
|
78
79
|
val child = container.getChildAt(i)
|
|
79
|
-
child.measure(
|
|
80
|
-
|
|
80
|
+
child.measure(
|
|
81
|
+
makeMeasureSpec(container.measuredWidth, View.MeasureSpec.EXACTLY),
|
|
82
|
+
makeMeasureSpec(container.measuredHeight, View.MeasureSpec.EXACTLY)
|
|
83
|
+
)
|
|
81
84
|
child.layout(0, 0, child.measuredWidth, child.measuredHeight)
|
|
82
85
|
}
|
|
83
86
|
}
|
package/android/src/main/kotlin/com/scandit/datacapture/reactnative/core/utils/Extensions.kt
CHANGED
|
@@ -18,19 +18,19 @@ val Int.hexString: String
|
|
|
18
18
|
get() {
|
|
19
19
|
val hex = String.format(Locale.getDefault(), "%08X", this)
|
|
20
20
|
return "#" + // ts is expecting the color in format #RRGGBBAA, we need to move the alpha.
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
hex.substring(2) + // RRGGBB
|
|
22
|
+
hex.substring(0, 2) // AA
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
inline fun writableMap(builder: WritableMap.() -> Unit): WritableMap =
|
|
26
|
-
|
|
26
|
+
Arguments.createMap().apply(builder)
|
|
27
27
|
|
|
28
28
|
inline fun writableArray(builder: WritableArray.() -> Unit): WritableArray =
|
|
29
|
-
|
|
29
|
+
Arguments.createArray().apply(builder)
|
|
30
30
|
|
|
31
31
|
fun WritableMap.putData(key: String, data: SerializableData) {
|
|
32
32
|
putMap(key, data.toWritableMap())
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
inline fun <reified T : JavaScriptModule> ReactApplicationContext.getJSModule(): T =
|
|
36
|
-
|
|
36
|
+
getJSModule(T::class.java)
|
|
@@ -10,7 +10,6 @@ import androidx.annotation.VisibleForTesting
|
|
|
10
10
|
import com.facebook.react.bridge.Promise
|
|
11
11
|
import com.facebook.react.bridge.WritableMap
|
|
12
12
|
import com.scandit.datacapture.reactnative.core.utils.TestPromise.Status.*
|
|
13
|
-
import java.lang.AssertionError
|
|
14
13
|
|
|
15
14
|
@VisibleForTesting(otherwise = VisibleForTesting.PRIVATE)
|
|
16
15
|
fun promise(): TestPromise = TestPromise()
|
|
@@ -96,22 +95,8 @@ class TestPromise : Promise {
|
|
|
96
95
|
|
|
97
96
|
override fun toString(): String {
|
|
98
97
|
return "TestPromise(value=$value, code=$code, message=$message, throwable=$throwable, " +
|
|
99
|
-
|
|
98
|
+
"userInfo=$userInfo, status=$status)"
|
|
100
99
|
}
|
|
101
100
|
|
|
102
101
|
enum class Status { PENDING, RESOLVED, REJECTED }
|
|
103
102
|
}
|
|
104
|
-
|
|
105
|
-
inline fun waitTill(conditionDescription: String, forMs: Long = 5000L, condition: () -> Boolean) {
|
|
106
|
-
val iterCount = forMs / 50
|
|
107
|
-
|
|
108
|
-
for (i in 0..iterCount) {
|
|
109
|
-
if (condition()) {
|
|
110
|
-
return
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
Thread.sleep(50)
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
throw AssertionError("Still false after ${forMs}ms: $conditionDescription")
|
|
117
|
-
}
|
|
@@ -88,8 +88,10 @@ extension ScanditDataCaptureCore {
|
|
|
88
88
|
"style": viewfinder.style.jsonString,
|
|
89
89
|
"size": viewfinder.sizeWithUnitAndAspect.jsonString,
|
|
90
90
|
"color": viewfinder.color.sdcHexString,
|
|
91
|
+
"disabledColor": viewfinder.disabledColor.sdcHexString,
|
|
91
92
|
"lineStyle": viewfinder.lineStyle.jsonString,
|
|
92
93
|
"dimming": viewfinder.dimming,
|
|
94
|
+
"disabledDimming": viewfinder.disabledDimming,
|
|
93
95
|
"animation": viewfinder.animation?.jsonString as Any
|
|
94
96
|
]
|
|
95
97
|
return defaults
|
|
@@ -50,6 +50,10 @@ RCT_EXTERN_METHOD(isTorchAvailable
|
|
|
50
50
|
: (RCTPromiseResolveBlock)resolve reject
|
|
51
51
|
: (RCTPromiseRejectBlock)reject)
|
|
52
52
|
|
|
53
|
+
RCT_EXTERN_METHOD(getLastFrame
|
|
54
|
+
: (RCTPromiseResolveBlock)resolve reject
|
|
55
|
+
: (RCTPromiseRejectBlock)reject)
|
|
56
|
+
|
|
53
57
|
RCT_EXTERN_METHOD(registerListenerForCameraEvents)
|
|
54
58
|
|
|
55
59
|
RCT_EXTERN_METHOD(unregisterListenerForCameraEvents)
|
|
@@ -17,6 +17,7 @@ public let SDCSharedMethodQeueue = DispatchQueue(label: "com.scandit.reactnative
|
|
|
17
17
|
enum ScanditDataCaptureCoreError: Int, CustomNSError {
|
|
18
18
|
case deserializationError = 1
|
|
19
19
|
case nilDataCaptureView
|
|
20
|
+
case nilFrame
|
|
20
21
|
|
|
21
22
|
var domain: String { return "ScanditDataCaptureCoreErrorDomain" }
|
|
22
23
|
|
|
@@ -30,6 +31,8 @@ enum ScanditDataCaptureCoreError: Int, CustomNSError {
|
|
|
30
31
|
return "Unable to deserialize a valid object."
|
|
31
32
|
case .nilDataCaptureView:
|
|
32
33
|
return "DataCaptureView is null."
|
|
34
|
+
case .nilFrame:
|
|
35
|
+
return "Frame is null, it might've been reused already."
|
|
33
36
|
}
|
|
34
37
|
}
|
|
35
38
|
|
|
@@ -63,6 +66,8 @@ public class ScanditDataCaptureCore: RCTEventEmitter {
|
|
|
63
66
|
.forEach { $0.didUpdate(dataCaptureView: dataCaptureView) }
|
|
64
67
|
}
|
|
65
68
|
}
|
|
69
|
+
|
|
70
|
+
public static var lastFrame: FrameData?
|
|
66
71
|
|
|
67
72
|
lazy internal var contextDeserializer: DataCaptureContextDeserializer = {
|
|
68
73
|
return DataCaptureContextDeserializer(frameSourceDeserializer: frameSourceDeserializer,
|
|
@@ -249,6 +254,17 @@ public class ScanditDataCaptureCore: RCTEventEmitter {
|
|
|
249
254
|
let camera = Camera(position: position)
|
|
250
255
|
resolve(camera?.isTorchAvailable ?? false)
|
|
251
256
|
}
|
|
257
|
+
|
|
258
|
+
@objc(getLastFrame:reject:)
|
|
259
|
+
func getLastFrame(resolve: @escaping RCTPromiseResolveBlock,
|
|
260
|
+
reject: @escaping RCTPromiseRejectBlock) {
|
|
261
|
+
guard let lastFrame = ScanditDataCaptureCore.lastFrame else {
|
|
262
|
+
let error = ScanditDataCaptureCoreError.nilFrame
|
|
263
|
+
reject(String(error.code), error.message, error)
|
|
264
|
+
return
|
|
265
|
+
}
|
|
266
|
+
resolve(lastFrame.jsonString)
|
|
267
|
+
}
|
|
252
268
|
|
|
253
269
|
public func addRNTDataCaptureViewListener(_ listener: RNTDataCaptureViewListener) {
|
|
254
270
|
pthread_mutex_lock(&dataCaptureViewListenersLock)
|
package/js/Camera+Related.d.ts
CHANGED
|
@@ -46,3 +46,15 @@ export declare class CameraSettings extends DefaultSerializeable {
|
|
|
46
46
|
setProperty(name: string, value: any): void;
|
|
47
47
|
getProperty(name: string): any;
|
|
48
48
|
}
|
|
49
|
+
export interface FrameData {
|
|
50
|
+
readonly imageBuffers: ImageBuffer[];
|
|
51
|
+
readonly orientation: number;
|
|
52
|
+
}
|
|
53
|
+
export declare class ImageBuffer {
|
|
54
|
+
private _width;
|
|
55
|
+
private _height;
|
|
56
|
+
private _data;
|
|
57
|
+
get width(): number;
|
|
58
|
+
get height(): number;
|
|
59
|
+
get data(): string;
|
|
60
|
+
}
|
package/js/Camera+Related.js
CHANGED
|
@@ -13,7 +13,7 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
13
13
|
};
|
|
14
14
|
})();
|
|
15
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
-
exports.CameraSettings = exports.FocusGestureStrategy = exports.FocusRange = exports.VideoResolution = exports.CameraPosition = exports.TorchState = void 0;
|
|
16
|
+
exports.ImageBuffer = exports.CameraSettings = exports.FocusGestureStrategy = exports.FocusRange = exports.VideoResolution = exports.CameraPosition = exports.TorchState = void 0;
|
|
17
17
|
var Defaults_1 = require("./private/Defaults");
|
|
18
18
|
var Serializeable_1 = require("./private/Serializeable");
|
|
19
19
|
var TorchState;
|
|
@@ -137,4 +137,31 @@ var CameraSettings = /** @class */ (function (_super) {
|
|
|
137
137
|
return CameraSettings;
|
|
138
138
|
}(Serializeable_1.DefaultSerializeable));
|
|
139
139
|
exports.CameraSettings = CameraSettings;
|
|
140
|
+
var ImageBuffer = /** @class */ (function () {
|
|
141
|
+
function ImageBuffer() {
|
|
142
|
+
}
|
|
143
|
+
Object.defineProperty(ImageBuffer.prototype, "width", {
|
|
144
|
+
get: function () {
|
|
145
|
+
return this._width;
|
|
146
|
+
},
|
|
147
|
+
enumerable: false,
|
|
148
|
+
configurable: true
|
|
149
|
+
});
|
|
150
|
+
Object.defineProperty(ImageBuffer.prototype, "height", {
|
|
151
|
+
get: function () {
|
|
152
|
+
return this._height;
|
|
153
|
+
},
|
|
154
|
+
enumerable: false,
|
|
155
|
+
configurable: true
|
|
156
|
+
});
|
|
157
|
+
Object.defineProperty(ImageBuffer.prototype, "data", {
|
|
158
|
+
get: function () {
|
|
159
|
+
return this._data;
|
|
160
|
+
},
|
|
161
|
+
enumerable: false,
|
|
162
|
+
configurable: true
|
|
163
|
+
});
|
|
164
|
+
return ImageBuffer;
|
|
165
|
+
}());
|
|
166
|
+
exports.ImageBuffer = ImageBuffer;
|
|
140
167
|
//# sourceMappingURL=Camera+Related.js.map
|
package/js/Camera+Related.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Camera+Related.js","sourceRoot":"","sources":["../ts/Camera+Related.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA8C;AAE9C,yDAA+D;AAE/D,IAAY,UAIX;AAJD,WAAY,UAAU;IACpB,uBAAS,CAAA;IACT,yBAAW,CAAA;IACX,2BAAa,CAAA;AACf,CAAC,EAJW,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAIrB;AAED,IAAY,cAIX;AAJD,WAAY,cAAc;IACxB,6CAA2B,CAAA;IAC3B,2CAAyB,CAAA;IACzB,6CAA2B,CAAA;AAC7B,CAAC,EAJW,c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QAAQ,CAAC,2BAA2B,GAAG,IAAI,CAAC,2BAA2B,CAAC;QACxE,IAAI,IAAI,CAAC,GAAG,KAAK,SAAS,IAAI,IAAI,CAAC,GAAG,KAAK,IAAI,EAAE;YAC/C,QAAQ,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC;SACzB;QACD,OAAO,QAAQ,CAAC;IAClB,CAAC;IAaM,oCAAW,GAAlB,UAAmB,IAAY,EAAE,KAAU;QACxC,IAAY,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC;IAC9B,CAAC;IAEM,oCAAW,GAAlB,UAAmB,IAAY;QAC7B,OAAQ,IAAY,CAAC,IAAI,CAAC,CAAC;IAC7B,CAAC;IACH,qBAAC;AAAD,CAAC,AAhFD,CAAoC,oCAAoB,GAgFvD;AAhFY,wCAAc;AAuF3B;IAAA;IAgBA,CAAC;IAXC,sBAAW,8BAAK;aAAhB;YACE,OAAO,IAAI,CAAC,MAAM,CAAC;QACrB,CAAC;;;OAAA;IAED,sBAAW,+BAAM;aAAjB;YACE,OAAO,IAAI,CAAC,OAAO,CAAC;QACtB,CAAC;;;OAAA;IAED,sBAAW,6BAAI;aAAf;YACE,OAAO,IAAI,CAAC,KAAK,CAAC;QACpB,CAAC;;;OAAA;IACH,kBAAC;AAAD,CAAC,AAhBD,IAgBC;AAhBY,kCAAW"}
|
package/js/DataCaptureVersion.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataCaptureVersion.js","sourceRoot":"","sources":["../ts/DataCaptureVersion.ts"],"names":[],"mappings":";;;AAAA,6CAA6C;AAE7C,yCAAyC;AACzC,IAAM,YAAY,GAAG,4BAAa,CAAC,sBAAsB,CAAC;AAE1D;IAAA;IAQA,CAAC;IAPC,sBAAkB,mCAAa;aAA/B;YACE,OAAO,
|
|
1
|
+
{"version":3,"file":"DataCaptureVersion.js","sourceRoot":"","sources":["../ts/DataCaptureVersion.ts"],"names":[],"mappings":";;;AAAA,6CAA6C;AAE7C,yCAAyC;AACzC,IAAM,YAAY,GAAG,4BAAa,CAAC,sBAAsB,CAAC;AAE1D;IAAA;IAQA,CAAC;IAPC,sBAAkB,mCAAa;aAA/B;YACE,OAAO,eAAe,CAAC;QACzB,CAAC;;;OAAA;IAED,sBAAkB,gCAAU;aAA5B;YACE,OAAO,YAAY,CAAC,OAAO,CAAC;QAC9B,CAAC;;;OAAA;IACH,yBAAC;AAAD,CAAC,AARD,IAQC;AARY,gDAAkB"}
|
package/js/Viewfinder.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Color, NumberWithUnit, SizeWithUnit, SizeWithUnitAndAspect } from './Common';
|
|
2
2
|
import { DefaultSerializeable } from './private/Serializeable';
|
|
3
|
-
import {
|
|
3
|
+
import { LaserlineViewfinderStyle, RectangularViewfinderAnimation, RectangularViewfinderLineStyle, RectangularViewfinderStyle } from './Viewfinder+Related';
|
|
4
4
|
export interface Viewfinder {
|
|
5
5
|
}
|
|
6
6
|
export declare const NoViewfinder: {
|
|
@@ -21,17 +21,25 @@ export declare class RectangularViewfinder extends DefaultSerializeable implemen
|
|
|
21
21
|
private readonly _style;
|
|
22
22
|
private readonly _lineStyle;
|
|
23
23
|
private _dimming;
|
|
24
|
+
private _disabledDimming;
|
|
24
25
|
private _animation;
|
|
25
26
|
private _sizeWithUnitAndAspect;
|
|
26
|
-
|
|
27
|
+
private _color;
|
|
28
|
+
private _disabledColor;
|
|
27
29
|
get sizeWithUnitAndAspect(): SizeWithUnitAndAspect;
|
|
28
30
|
constructor();
|
|
29
31
|
constructor(style: RectangularViewfinderStyle);
|
|
30
32
|
constructor(style: RectangularViewfinderStyle, lineStyle: RectangularViewfinderLineStyle);
|
|
31
33
|
get style(): RectangularViewfinderStyle;
|
|
32
34
|
get lineStyle(): RectangularViewfinderLineStyle;
|
|
35
|
+
get color(): Color;
|
|
36
|
+
set color(value: Color);
|
|
37
|
+
get disabledColor(): Color;
|
|
38
|
+
set disabledColor(value: Color);
|
|
33
39
|
get dimming(): number;
|
|
34
40
|
set dimming(value: number);
|
|
41
|
+
get disabledDimming(): number;
|
|
42
|
+
set disabledDimming(value: number);
|
|
35
43
|
get animation(): RectangularViewfinderAnimation | null;
|
|
36
44
|
set animation(animation: RectangularViewfinderAnimation | null);
|
|
37
45
|
setSize(size: SizeWithUnit): void;
|
package/js/Viewfinder.js
CHANGED
|
@@ -21,9 +21,9 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
21
21
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
22
|
exports.AimerViewfinder = exports.SpotlightViewfinder = exports.RectangularViewfinder = exports.LaserlineViewfinder = exports.NoViewfinder = void 0;
|
|
23
23
|
var Common_1 = require("./Common");
|
|
24
|
+
var CommonEnums_1 = require("./CommonEnums");
|
|
24
25
|
var Defaults_1 = require("./private/Defaults");
|
|
25
26
|
var Serializeable_1 = require("./private/Serializeable");
|
|
26
|
-
var CommonEnums_1 = require("./CommonEnums");
|
|
27
27
|
// tslint:disable-next-line:variable-name
|
|
28
28
|
exports.NoViewfinder = { type: 'none' };
|
|
29
29
|
var LaserlineViewfinder = /** @class */ (function (_super) {
|
|
@@ -60,8 +60,10 @@ var RectangularViewfinder = /** @class */ (function (_super) {
|
|
|
60
60
|
_this._style = Defaults_1.Defaults.RectangularViewfinder.styles[viewfinderStyle].style;
|
|
61
61
|
_this._lineStyle = Defaults_1.Defaults.RectangularViewfinder.styles[viewfinderStyle].lineStyle;
|
|
62
62
|
_this._dimming = Defaults_1.Defaults.RectangularViewfinder.styles[viewfinderStyle].dimming;
|
|
63
|
+
_this._disabledDimming = Defaults_1.Defaults.RectangularViewfinder.styles[viewfinderStyle].disabledDimming;
|
|
63
64
|
_this._animation = Defaults_1.Defaults.RectangularViewfinder.styles[viewfinderStyle].animation;
|
|
64
|
-
_this.
|
|
65
|
+
_this._color = Defaults_1.Defaults.RectangularViewfinder.styles[viewfinderStyle].color;
|
|
66
|
+
_this._disabledColor = Defaults_1.Defaults.RectangularViewfinder.styles[viewfinderStyle].disabledColor;
|
|
65
67
|
_this._sizeWithUnitAndAspect = Defaults_1.Defaults.RectangularViewfinder.styles[viewfinderStyle].size;
|
|
66
68
|
if (lineStyle !== undefined) {
|
|
67
69
|
_this._lineStyle = lineStyle;
|
|
@@ -89,6 +91,26 @@ var RectangularViewfinder = /** @class */ (function (_super) {
|
|
|
89
91
|
enumerable: false,
|
|
90
92
|
configurable: true
|
|
91
93
|
});
|
|
94
|
+
Object.defineProperty(RectangularViewfinder.prototype, "color", {
|
|
95
|
+
get: function () {
|
|
96
|
+
return this._color;
|
|
97
|
+
},
|
|
98
|
+
set: function (value) {
|
|
99
|
+
this._color = value;
|
|
100
|
+
},
|
|
101
|
+
enumerable: false,
|
|
102
|
+
configurable: true
|
|
103
|
+
});
|
|
104
|
+
Object.defineProperty(RectangularViewfinder.prototype, "disabledColor", {
|
|
105
|
+
get: function () {
|
|
106
|
+
return this._disabledColor;
|
|
107
|
+
},
|
|
108
|
+
set: function (value) {
|
|
109
|
+
this._disabledColor = value;
|
|
110
|
+
},
|
|
111
|
+
enumerable: false,
|
|
112
|
+
configurable: true
|
|
113
|
+
});
|
|
92
114
|
Object.defineProperty(RectangularViewfinder.prototype, "dimming", {
|
|
93
115
|
get: function () {
|
|
94
116
|
return this._dimming;
|
|
@@ -99,6 +121,16 @@ var RectangularViewfinder = /** @class */ (function (_super) {
|
|
|
99
121
|
enumerable: false,
|
|
100
122
|
configurable: true
|
|
101
123
|
});
|
|
124
|
+
Object.defineProperty(RectangularViewfinder.prototype, "disabledDimming", {
|
|
125
|
+
get: function () {
|
|
126
|
+
return this._disabledDimming;
|
|
127
|
+
},
|
|
128
|
+
set: function (value) {
|
|
129
|
+
this._disabledDimming = value;
|
|
130
|
+
},
|
|
131
|
+
enumerable: false,
|
|
132
|
+
configurable: true
|
|
133
|
+
});
|
|
102
134
|
Object.defineProperty(RectangularViewfinder.prototype, "animation", {
|
|
103
135
|
get: function () {
|
|
104
136
|
return this._animation;
|
|
@@ -130,12 +162,21 @@ var RectangularViewfinder = /** @class */ (function (_super) {
|
|
|
130
162
|
__decorate([
|
|
131
163
|
Serializeable_1.nameForSerialization('dimming')
|
|
132
164
|
], RectangularViewfinder.prototype, "_dimming", void 0);
|
|
165
|
+
__decorate([
|
|
166
|
+
Serializeable_1.nameForSerialization('disabledDimming')
|
|
167
|
+
], RectangularViewfinder.prototype, "_disabledDimming", void 0);
|
|
133
168
|
__decorate([
|
|
134
169
|
Serializeable_1.nameForSerialization('animation')
|
|
135
170
|
], RectangularViewfinder.prototype, "_animation", void 0);
|
|
136
171
|
__decorate([
|
|
137
172
|
Serializeable_1.nameForSerialization('size')
|
|
138
173
|
], RectangularViewfinder.prototype, "_sizeWithUnitAndAspect", void 0);
|
|
174
|
+
__decorate([
|
|
175
|
+
Serializeable_1.nameForSerialization('color')
|
|
176
|
+
], RectangularViewfinder.prototype, "_color", void 0);
|
|
177
|
+
__decorate([
|
|
178
|
+
Serializeable_1.nameForSerialization('disabledColor')
|
|
179
|
+
], RectangularViewfinder.prototype, "_disabledColor", void 0);
|
|
139
180
|
return RectangularViewfinder;
|
|
140
181
|
}(Serializeable_1.DefaultSerializeable));
|
|
141
182
|
exports.RectangularViewfinder = RectangularViewfinder;
|
package/js/Viewfinder.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Viewfinder.js","sourceRoot":"","sources":["../ts/Viewfinder.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,mCAAsF;AACtF,+CAA8C;AAC9C,yDAAqF;
|
|
1
|
+
{"version":3,"file":"Viewfinder.js","sourceRoot":"","sources":["../ts/Viewfinder.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,mCAAsF;AACtF,6CAA4C;AAC5C,+CAA8C;AAC9C,yDAAqF;AAWrF,yCAAyC;AAC5B,QAAA,YAAY,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;AAE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B,CAAC,MAAM,EAC9F,wBAAwB,CAAC,CAAC;IAC9B,CAAC;IA5BD;QADC,oCAAoB,CAAC,MAAM,CAAC;uEAC6D;IA6B5F,0BAAC;CAAA,AAjCD,CAAyC,oCAAoB,GAiC5D;AAjCY,kDAAmB;AAmChC;IAAqC,mCAAoB;IAMvD;QAAA,YACE,iBAAO,SACR;QAPO,UAAI,GAAG,OAAO,CAAC;QAEhB,gBAAU,GAAU,mBAAQ,CAAC,eAAe,CAAC,UAAU,CAAC;QACxD,cAAQ,GAAU,mBAAQ,CAAC,eAAe,CAAC,QAAQ,CAAC;;IAI3D,CAAC;IACH,sBAAC;AAAD,CAAC,AATD,CAAqC,oCAAoB,GASxD;AATY,0CAAe"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { Camera } from '../Camera';
|
|
2
2
|
import { FrameSourceState } from '../FrameSource';
|
|
3
|
+
import { FrameData } from '../private/PrivateCamera+Related';
|
|
3
4
|
export declare class CameraProxy {
|
|
4
5
|
private camera;
|
|
5
6
|
private nativeListeners;
|
|
6
7
|
static forCamera(camera: Camera): CameraProxy;
|
|
8
|
+
static getLastFrame(): Promise<FrameData>;
|
|
7
9
|
getCurrentState(): Promise<FrameSourceState>;
|
|
8
10
|
getIsTorchAvailable(): Promise<boolean>;
|
|
9
11
|
dispose(): void;
|
package/js/native/CameraProxy.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CameraProxy = void 0;
|
|
4
4
|
var react_native_1 = require("react-native");
|
|
5
|
+
var PrivateCamera_Related_1 = require("../private/PrivateCamera+Related");
|
|
5
6
|
// tslint:disable:variable-name
|
|
6
7
|
var NativeModule = react_native_1.NativeModules.ScanditDataCaptureCore;
|
|
7
8
|
var EventEmitter = new react_native_1.NativeEventEmitter(NativeModule);
|
|
@@ -19,6 +20,11 @@ var CameraProxy = /** @class */ (function () {
|
|
|
19
20
|
proxy.camera = camera;
|
|
20
21
|
return proxy;
|
|
21
22
|
};
|
|
23
|
+
CameraProxy.getLastFrame = function () {
|
|
24
|
+
return NativeModule.getLastFrame().then(function (frameDataJSONString) {
|
|
25
|
+
return PrivateCamera_Related_1.FrameData.fromJSON(JSON.parse(frameDataJSONString));
|
|
26
|
+
});
|
|
27
|
+
};
|
|
22
28
|
CameraProxy.prototype.getCurrentState = function () {
|
|
23
29
|
return NativeModule.getCurrentCameraState(this.camera.position);
|
|
24
30
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CameraProxy.js","sourceRoot":"","sources":["../../ts/native/CameraProxy.ts"],"names":[],"mappings":";;;AAAA,6CAAsF;
|
|
1
|
+
{"version":3,"file":"CameraProxy.js","sourceRoot":"","sources":["../../ts/native/CameraProxy.ts"],"names":[],"mappings":";;;AAAA,6CAAsF;AAKtF,0EAA6D;AAE7D,+BAA+B;AAC/B,IAAM,YAAY,GAAG,4BAAa,CAAC,sBAAsB,CAAC;AAC1D,IAAM,YAAY,GAAG,IAAI,iCAAkB,CAAC,YAAY,CAAC,CAAC;AAC1D,8BAA8B;AAE9B,IAAK,uBAEJ;AAFD,WAAK,uBAAuB;IAC1B,gFAAqD,CAAA;AACvD,CAAC,EAFI,uBAAuB,KAAvB,uBAAuB,QAE3B;AAED;IAAA;QAGU,oBAAe,GAA0B,EAAE,CAAC;IAiDtD,CAAC;IA/Ce,qBAAS,GAAvB,UAAwB,MAAc;QACpC,IAAM,KAAK,GAAG,IAAI,WAAW,EAAE,CAAC;QAChC,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC;QACtB,OAAO,KAAK,CAAC;IACf,CAAC;IAEa,wBAAY,GAA1B;QACE,OAAO,YAAY,CAAC,YAAY,EAAE,CAAC,IAAI,CAAC,UAAC,mBAA2B;YAClE,OAAO,iCAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC,CAAC;QAC7D,CAAC,CAAC,CAAC;IACL,CA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true });
|
|
|
3
3
|
exports.Defaults = void 0;
|
|
4
4
|
var react_native_1 = require("react-native");
|
|
5
5
|
var Common_1 = require("../Common");
|
|
6
|
-
var PrivateDataCaptureView_Related_1 = require("./PrivateDataCaptureView+Related");
|
|
7
6
|
var Viewfinder_Related_1 = require("../Viewfinder+Related");
|
|
7
|
+
var PrivateDataCaptureView_Related_1 = require("./PrivateDataCaptureView+Related");
|
|
8
8
|
// tslint:disable-next-line:variable-name
|
|
9
9
|
var NativeModule = react_native_1.NativeModules.ScanditDataCaptureCore;
|
|
10
10
|
// tslint:disable-next-line:variable-name
|
|
@@ -57,11 +57,12 @@ exports.Defaults = {
|
|
|
57
57
|
acc.styles[key] = {
|
|
58
58
|
size: Common_1.SizeWithUnitAndAspect
|
|
59
59
|
.fromJSON(JSON.parse(viewfinder.size)),
|
|
60
|
-
color: Common_1.Color
|
|
61
|
-
|
|
60
|
+
color: Common_1.Color.fromJSON(viewfinder.color),
|
|
61
|
+
disabledColor: Common_1.Color.fromJSON(viewfinder.disabledColor),
|
|
62
62
|
style: viewfinder.style,
|
|
63
63
|
lineStyle: viewfinder.lineStyle,
|
|
64
64
|
dimming: viewfinder.dimming,
|
|
65
|
+
disabledDimming: viewfinder.disabledDimming,
|
|
65
66
|
animation: Viewfinder_Related_1.RectangularViewfinderAnimation
|
|
66
67
|
.fromJSON(JSON.parse(viewfinder.animation)),
|
|
67
68
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Defaults.js","sourceRoot":"","sources":["../../ts/private/Defaults.ts"],"names":[],"mappings":";;;AAAA,6CAA6C;AAG7C,oCAAgH;
|
|
1
|
+
{"version":3,"file":"Defaults.js","sourceRoot":"","sources":["../../ts/private/Defaults.ts"],"names":[],"mappings":";;;AAAA,6CAA6C;AAG7C,oCAAgH;AAGhH,4DAK+B;AAS/B,mFAAmH;AAGnH,yCAAyC;AACzC,IAAM,YAAY,GAAG,4BAAa,CAAC,sBAAsB,CAAC;AAe1D,yCA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AAQ,EAAG,cAA6B,CAAC,QAAQ,CAAC,YAAY,CAAC,QAAQ,CAAC,eAAe,CAAC,QAAQ,CAAC;KAClG;IAED,KAAK,EAAE;QACL,SAAS,EAAG,cAA6B;aACtC,QAAQ,CAAC,YAAY,CAAC,QAAQ,CAAC,KAAK,CAAC,SAAS,CAAC;QAClD,WAAW,EAAG,cAA6B;aACxC,QAAQ,CAAC,YAAY,CAAC,QAAQ,CAAC,KAAK,CAAC,WAAW,CAAC;QACpD,WAAW,EAAE,YAAY,CAAC,QAAQ,CAAC,KAAK,CAAC,WAAW;KACrD;IAED,QAAQ,EAAE,YAAY,CAAC,QAAQ,CAAC,QAAQ;CACzC,CAAC;AAEF,wFAAwF;AACvF,cAA6B,CAAC,QAAQ,GAAG,gBAAQ,CAAC,KAAK,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CameraSettings } from '../Camera+Related';
|
|
1
|
+
import { CameraSettings, FrameData as IFrameData, ImageBuffer } from '../Camera+Related';
|
|
2
2
|
export interface CameraSettingsJSON {
|
|
3
3
|
preferredResolution: string;
|
|
4
4
|
zoomFactor: number;
|
|
@@ -11,3 +11,24 @@ export interface CameraSettingsJSON {
|
|
|
11
11
|
export interface PrivateCameraSettings {
|
|
12
12
|
fromJSON(json: CameraSettingsJSON): CameraSettings;
|
|
13
13
|
}
|
|
14
|
+
export interface PrivateImageBuffer {
|
|
15
|
+
_width: number;
|
|
16
|
+
_height: number;
|
|
17
|
+
_data: string;
|
|
18
|
+
}
|
|
19
|
+
export interface FrameDataJSON {
|
|
20
|
+
imageBuffers: ImageBufferJSON[];
|
|
21
|
+
orientation: number;
|
|
22
|
+
}
|
|
23
|
+
export interface ImageBufferJSON {
|
|
24
|
+
width: number;
|
|
25
|
+
height: number;
|
|
26
|
+
data: string;
|
|
27
|
+
}
|
|
28
|
+
export declare class FrameData implements IFrameData {
|
|
29
|
+
private _imageBuffers;
|
|
30
|
+
private _orientation;
|
|
31
|
+
get imageBuffers(): ImageBuffer[];
|
|
32
|
+
get orientation(): number;
|
|
33
|
+
static fromJSON(json: FrameDataJSON): IFrameData;
|
|
34
|
+
}
|
|
@@ -1,3 +1,37 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FrameData = void 0;
|
|
4
|
+
var Camera_Related_1 = require("../Camera+Related");
|
|
5
|
+
var FrameData = /** @class */ (function () {
|
|
6
|
+
function FrameData() {
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(FrameData.prototype, "imageBuffers", {
|
|
9
|
+
get: function () {
|
|
10
|
+
return this._imageBuffers;
|
|
11
|
+
},
|
|
12
|
+
enumerable: false,
|
|
13
|
+
configurable: true
|
|
14
|
+
});
|
|
15
|
+
Object.defineProperty(FrameData.prototype, "orientation", {
|
|
16
|
+
get: function () {
|
|
17
|
+
return this._orientation;
|
|
18
|
+
},
|
|
19
|
+
enumerable: false,
|
|
20
|
+
configurable: true
|
|
21
|
+
});
|
|
22
|
+
FrameData.fromJSON = function (json) {
|
|
23
|
+
var frameData = new FrameData();
|
|
24
|
+
frameData._imageBuffers = json.imageBuffers.map(function (imageBufferJSON) {
|
|
25
|
+
var imageBuffer = new Camera_Related_1.ImageBuffer();
|
|
26
|
+
imageBuffer._width = imageBufferJSON.width;
|
|
27
|
+
imageBuffer._height = imageBufferJSON.height;
|
|
28
|
+
imageBuffer._data = imageBufferJSON.data;
|
|
29
|
+
return imageBuffer;
|
|
30
|
+
});
|
|
31
|
+
frameData._orientation = json.orientation;
|
|
32
|
+
return frameData;
|
|
33
|
+
};
|
|
34
|
+
return FrameData;
|
|
35
|
+
}());
|
|
36
|
+
exports.FrameData = FrameData;
|
|
3
37
|
//# sourceMappingURL=PrivateCamera+Related.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrivateCamera+Related.js","sourceRoot":"","sources":["../../ts/private/PrivateCamera+Related.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"PrivateCamera+Related.js","sourceRoot":"","sources":["../../ts/private/PrivateCamera+Related.ts"],"names":[],"mappings":";;;AAAA,oDAAyF;AAiCzF;IAAA;IAyBA,CAAC;IArBC,sBAAW,mCAAY;aAAvB;YACE,OAAO,IAAI,CAAC,aAAa,CAAC;QAC5B,CAAC;;;OAAA;IAED,sBAAW,kCAAW;aAAtB;YACE,OAAO,IAAI,CAAC,YAAY,CAAC;QAC3B,CAAC;;;OAAA;IAEa,kBAAQ,GAAtB,UAAuB,IAAmB;QACxC,IAAM,SAAS,GAAG,IAAI,SAAS,EAAE,CAAC;QAClC,SAAS,CAAC,aAAa,GAAG,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,UAAC,eAAgC;YAC/E,IAAM,WAAW,GAAG,IAAI,4BAAW,EAAE,CAAC;YACrC,WAAyC,CAAC,MAAM,GAAG,eAAe,CAAC,KAAK,CAAC;YACzE,WAAyC,CAAC,OAAO,GAAG,eAAe,CAAC,MAAM,CAAC;YAC3E,WAAyC,CAAC,KAAK,GAAG,eAAe,CAAC,IAAI,CAAC;YACxE,OAAO,WAAW,CAAC;QACrB,CAAC,CAAC,CAAC;QACH,SAAS,CAAC,YAAY,GAAG,IAAI,CAAC,WAAW,CAAC;QAE1C,OAAO,SAAS,CAAC;IACnB,CAAC;IACH,gBAAC;AAAD,CAAC,AAzBD,IAyBC;AAzBY,8BAAS"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "scandit-react-native-datacapture-core",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.11.0-beta.3",
|
|
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": "js/index.js",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
},
|
|
22
22
|
"license": "Apache-2.0",
|
|
23
23
|
"peerDependencies": {
|
|
24
|
-
"react": "
|
|
24
|
+
"react": ">=16.8.1",
|
|
25
25
|
"react-native": ">=0.60.0-rc.0 <1.0.x"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
@@ -16,7 +16,7 @@ Pod::Spec.new do |s|
|
|
|
16
16
|
s.requires_arc = true
|
|
17
17
|
s.module_name = "ScanditDataCaptureCore"
|
|
18
18
|
s.header_dir = "ScanditDataCaptureCore"
|
|
19
|
-
s.dependency 'ScanditCaptureCore', '= 6.
|
|
19
|
+
s.dependency 'ScanditCaptureCore', '= 6.11.0-beta.3'
|
|
20
20
|
|
|
21
21
|
s.dependency "React"
|
|
22
22
|
end
|