scandit-capacitor-datacapture-barcode 6.21.0-beta.2 → 6.21.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.
@@ -17,5 +17,5 @@ Pod::Spec.new do |s|
17
17
 
18
18
  s.dependency "Capacitor"
19
19
  s.dependency "ScanditCapacitorDatacaptureCore", "= #{version}"
20
- s.dependency "scandit-datacapture-frameworks-barcode", '= 6.21.0-beta.2'
20
+ s.dependency "scandit-datacapture-frameworks-barcode", '= 6.21.0'
21
21
  end
@@ -56,7 +56,7 @@ repositories {
56
56
  }
57
57
 
58
58
  dependencies {
59
- def sdk_version = "6.21.0-beta.2"
59
+ def sdk_version = "6.21.0"
60
60
 
61
61
  implementation fileTree(dir: 'libs', include: ['*.jar'])
62
62
  implementation fileTree(dir: 'library', include: ['*.aar'])
@@ -203,6 +203,12 @@ class ScanditBarcodeNative :
203
203
  call.resolve()
204
204
  }
205
205
 
206
+ @PluginMethod
207
+ fun unsubscribeBarcodeTrackingListener(call: PluginCall) {
208
+ barcodeTrackingModule.removeBarcodeTrackingListener()
209
+ call.resolve()
210
+ }
211
+
206
212
  @PluginMethod
207
213
  fun finishBarcodeTrackingDidUpdateSession(call: PluginCall) {
208
214
  barcodeTrackingModule.finishDidUpdateSession(call.data.getBoolean("enabled"))
@@ -221,12 +227,134 @@ class ScanditBarcodeNative :
221
227
  call.resolve()
222
228
  }
223
229
 
230
+ @PluginMethod
231
+ fun unsubscribeBarcodeTrackingBasicOverlayListener(call: PluginCall) {
232
+ barcodeTrackingModule.removeBasicOverlayListener()
233
+ call.resolve()
234
+ }
235
+
224
236
  @PluginMethod
225
237
  fun subscribeBarcodeSelectionListener(call: PluginCall) {
226
238
  barcodeSelectionModule.addListener()
227
239
  call.resolve()
228
240
  }
229
241
 
242
+ @PluginMethod
243
+ fun unsubscribeBarcodeSelectionListener(call: PluginCall) {
244
+ barcodeSelectionModule.removeListener()
245
+ call.resolve()
246
+ }
247
+
248
+ @PluginMethod
249
+ fun setTextForAimToSelectAutoHint(call: PluginCall) {
250
+ barcodeSelectionModule.setTextForAimToSelectAutoHint(
251
+ call.data.getString("text").orEmpty(),
252
+ CapacitorResult(call)
253
+ )
254
+ }
255
+
256
+ @PluginMethod
257
+ fun removeAimedBarcodeBrushProvider(call: PluginCall) {
258
+ barcodeSelectionModule.removeAimedBarcodeBrushProvider()
259
+ call.resolve()
260
+ }
261
+
262
+ @PluginMethod
263
+ fun setAimedBarcodeBrushProvider(call: PluginCall) {
264
+ barcodeSelectionModule.setAimedBarcodeBrushProvider(CapacitorResult(call))
265
+ }
266
+
267
+ @PluginMethod
268
+ fun finishBrushForAimedBarcodeCallback(call: PluginCall) {
269
+ val brushJson = call.data.getString("brush")
270
+ val selectionIdentifier = call.data.getString("selectionIdentifier")
271
+ if (selectionIdentifier == null) {
272
+ call.reject("selectionIdentifier is missing in the call parameters.")
273
+ return
274
+ }
275
+ barcodeSelectionModule.finishBrushForAimedBarcode(brushJson, selectionIdentifier)
276
+ call.resolve()
277
+ }
278
+
279
+ @PluginMethod
280
+ fun removeTrackedBarcodeBrushProvider(call: PluginCall) {
281
+ barcodeSelectionModule.removeTrackedBarcodeBrushProvider()
282
+ call.resolve()
283
+ }
284
+
285
+ @PluginMethod
286
+ fun setTrackedBarcodeBrushProvider(call: PluginCall) {
287
+ barcodeSelectionModule.setTrackedBarcodeBrushProvider(CapacitorResult(call))
288
+ }
289
+
290
+ @PluginMethod
291
+ fun finishBrushForTrackedBarcode(call: PluginCall) {
292
+ val brushJson = call.data.getString("brush")
293
+ val selectionIdentifier = call.data.getString("selectionIdentifier")
294
+ if (selectionIdentifier == null) {
295
+ call.reject("selectionIdentifier is missing in the call parameters.")
296
+ return
297
+ }
298
+ barcodeSelectionModule.finishBrushForTrackedBarcode(brushJson, selectionIdentifier)
299
+ call.resolve()
300
+ }
301
+
302
+ @PluginMethod
303
+ fun selectAimedBarcode(call: PluginCall) {
304
+ barcodeSelectionModule.selectAimedBarcode()
305
+ call.resolve()
306
+ }
307
+
308
+ @PluginMethod
309
+ fun unselectBarcodes(call: PluginCall) {
310
+ val barcodesStr = call.data.getString("barcodesStr")
311
+ if (barcodesStr == null) {
312
+ call.reject("barcodesStr is missing in the call parameters.")
313
+ return
314
+ }
315
+ barcodeSelectionModule.unselectBarcodes(barcodesStr, CapacitorResult(call))
316
+ }
317
+
318
+ @PluginMethod
319
+ fun setSelectBarcodeEnabled(call: PluginCall) {
320
+ val barcodesStr = call.data.getString("barcodesStr")
321
+ if (barcodesStr == null) {
322
+ call.reject("barcodesStr is missing in the call parameters.")
323
+ return
324
+ }
325
+ if (!call.data.has("enabled")) {
326
+ call.reject("enabled is missing in the call parameters.")
327
+ return
328
+ }
329
+ barcodeSelectionModule.setSelectBarcodeEnabled(
330
+ barcodesStr,
331
+ call.data.getBoolean("enabled"),
332
+ CapacitorResult(call)
333
+ )
334
+ }
335
+
336
+ @PluginMethod
337
+ fun subscribeBrushForAimedBarcode(call: PluginCall) {
338
+ // Setting the repository does subscribe
339
+ call.resolve()
340
+ }
341
+
342
+ @PluginMethod
343
+ fun subscribeBrushForTrackedBarcode(call: PluginCall) {
344
+ // Setting the repository does subscribe
345
+ call.resolve()
346
+ }
347
+
348
+ @PluginMethod
349
+ fun increaseCountForBarcodes(call: PluginCall) {
350
+ val barcodesStr = call.data.getString("barcodesStr")
351
+ if (barcodesStr == null) {
352
+ call.reject("barcodesStr is missing in the call parameters.")
353
+ return
354
+ }
355
+ barcodeSelectionModule.increaseCountForBarcodes(barcodesStr, CapacitorResult(call))
356
+ }
357
+
230
358
  @PluginMethod
231
359
  fun clearTrackedBarcodeBrushes(call: PluginCall) {
232
360
  barcodeTrackingModule.clearBasicOverlayTrackedBarcodeBrushes()
@@ -251,6 +379,18 @@ class ScanditBarcodeNative :
251
379
  call.resolve()
252
380
  }
253
381
 
382
+ @PluginMethod
383
+ fun unsubscribeBarcodeTrackingAdvancedOverlayListener(call: PluginCall) {
384
+ barcodeTrackingModule.removeAdvancedOverlayListener()
385
+ call.resolve()
386
+ }
387
+
388
+ @PluginMethod
389
+ fun clearTrackedBarcodeViews(call: PluginCall) {
390
+ barcodeTrackingModule.clearAdvancedOverlayTrackedBarcodeViews()
391
+ call.resolve()
392
+ }
393
+
254
394
  @PluginMethod
255
395
  fun setViewForTrackedBarcode(call: PluginCall) {
256
396
  try {
@@ -360,6 +500,18 @@ class ScanditBarcodeNative :
360
500
  call.resolve()
361
501
  }
362
502
 
503
+ @PluginMethod
504
+ fun finishBarcodeSelectionDidSelect(call: PluginCall) {
505
+ barcodeSelectionModule.finishDidSelect(call.data.getBoolean("enabled"))
506
+ call.resolve()
507
+ }
508
+
509
+ @PluginMethod
510
+ fun finishBarcodeSelectionDidUpdateSession(call: PluginCall) {
511
+ barcodeSelectionModule.finishDidUpdateSession(call.data.getBoolean("enabled"))
512
+ call.resolve()
513
+ }
514
+
363
515
  private fun onFinishBarcodeSelectionDidUpdateSession(
364
516
  finishData: SerializableFinishModeCallbackData?
365
517
  ) {
@@ -542,7 +694,7 @@ class ScanditBarcodeNative :
542
694
  @PluginMethod
543
695
  fun getSpatialMap(call: PluginCall) {
544
696
  val map = barcodeCountModule.getSpatialMap()
545
- call.resolve(JSObject.fromJSONObject(JSONObject(map?.toJson() ?: "{}")))
697
+ call.resolve(JSObject().putSafe("data", map?.toJson()))
546
698
  }
547
699
 
548
700
  @PluginMethod
@@ -552,7 +704,7 @@ class ScanditBarcodeNative :
552
704
  val expectedNumberOfColumns = call.data.getInteger("expectedNumberOfColumns")
553
705
  ?: return call.reject("No expectedNumberOfColumns was provided for the function.")
554
706
  val map = barcodeCountModule.getSpatialMap(expectedNumberOfRows, expectedNumberOfColumns)
555
- call.resolve(JSObject.fromJSONObject(JSONObject(map?.toJson() ?: "{}")))
707
+ call.resolve(JSObject().putSafe("data", map?.toJson()))
556
708
  }
557
709
 
558
710
  @PluginMethod
@@ -8,11 +8,12 @@ data class SerializableAdvancedOverlayViewData(
8
8
  val trackedBarcodeId: Int,
9
9
  val sessionFrameSequenceId: Long?
10
10
  ) {
11
-
12
11
  constructor(json: JSONObject) : this(
13
12
  view = SerializableAdvancedOverlayView.fromJson(json.optJSONObject(FIELD_VIEW)),
14
13
  trackedBarcodeId = json.getInt(FIELD_TRACKED_BARCODE_ID),
15
- sessionFrameSequenceId = if (json.has(FIELD_FRAME_SEQUENCE_ID)) {
14
+ sessionFrameSequenceId = if (json.has(FIELD_FRAME_SEQUENCE_ID) &&
15
+ json[FIELD_FRAME_SEQUENCE_ID] is Long
16
+ ) {
16
17
  json.getLong(FIELD_FRAME_SEQUENCE_ID)
17
18
  } else null
18
19
  )
package/dist/barcode.js CHANGED
@@ -893,11 +893,7 @@ class SparkScan extends DefaultSerializeable {
893
893
  }
894
894
  set isEnabled(isEnabled) {
895
895
  this._isEnabled = isEnabled;
896
- if (!this.isInListenerCallback) {
897
- // If we're "in" a listener callback, we don't want to deserialize the context to update the enabled state,
898
- // but rather pass that back to be applied in the native callback.
899
- this.listenerController.setModeEnabledState(isEnabled);
900
- }
896
+ this.listenerController.setModeEnabledState(isEnabled);
901
897
  }
902
898
  get context() {
903
899
  return this._context;
@@ -962,7 +958,7 @@ class SparkScan extends DefaultSerializeable {
962
958
  }
963
959
  }
964
960
  __decorate([
965
- nameForSerialization('enabled')
961
+ ignoreFromSerialization
966
962
  ], SparkScan.prototype, "_isEnabled", void 0);
967
963
  __decorate([
968
964
  nameForSerialization('feedback')
@@ -1519,11 +1515,7 @@ class BarcodeCapture extends DefaultSerializeable {
1519
1515
  }
1520
1516
  set isEnabled(isEnabled) {
1521
1517
  this._isEnabled = isEnabled;
1522
- if (!this.isInListenerCallback) {
1523
- // If we're "in" a listener callback, we don't want to deserialize the context to update the enabled state,
1524
- // but rather pass that back to be applied in the native callback.
1525
- this.controller.setModeEnabledState(isEnabled);
1526
- }
1518
+ this.controller.setModeEnabledState(isEnabled);
1527
1519
  }
1528
1520
  get context() {
1529
1521
  return this._context;
@@ -1596,7 +1588,7 @@ class BarcodeCapture extends DefaultSerializeable {
1596
1588
  }
1597
1589
  }
1598
1590
  __decorate([
1599
- nameForSerialization('enabled')
1591
+ ignoreFromSerialization
1600
1592
  ], BarcodeCapture.prototype, "_isEnabled", void 0);
1601
1593
  __decorate([
1602
1594
  nameForSerialization('feedback')
@@ -1717,12 +1709,6 @@ var BarcodeCaptureOverlayStyle;
1717
1709
  })(BarcodeCaptureOverlayStyle || (BarcodeCaptureOverlayStyle = {}));
1718
1710
 
1719
1711
  class BarcodeCaptureSettings extends DefaultSerializeable {
1720
- get codeDuplicateFilter() {
1721
- return BarcodeCaptureSettings.barcodeCaptureDefaults.BarcodeCaptureSettings.codeDuplicateFilter;
1722
- }
1723
- set codeDuplicateFilter(value) {
1724
- BarcodeCaptureSettings.barcodeCaptureDefaults.BarcodeCaptureSettings.codeDuplicateFilter = value;
1725
- }
1726
1712
  get enabledSymbologies() {
1727
1713
  return Object.keys(this.symbologies)
1728
1714
  .filter(symbology => this.symbologies[symbology].isEnabled);
@@ -1745,6 +1731,7 @@ class BarcodeCaptureSettings extends DefaultSerializeable {
1745
1731
  this.enabledCompositeTypes = [];
1746
1732
  this.properties = {};
1747
1733
  this.symbologies = {};
1734
+ this._codeDuplicateFilter = BarcodeCaptureSettings.barcodeCaptureDefaults.BarcodeCaptureSettings.codeDuplicateFilter;
1748
1735
  this._arucoDictionary = null;
1749
1736
  }
1750
1737
  settingsForSymbology(symbology) {
@@ -1775,10 +1762,19 @@ class BarcodeCaptureSettings extends DefaultSerializeable {
1775
1762
  setArucoDictionary(dictionary) {
1776
1763
  this._arucoDictionary = dictionary;
1777
1764
  }
1765
+ get codeDuplicateFilter() {
1766
+ return this._codeDuplicateFilter;
1767
+ }
1768
+ set codeDuplicateFilter(value) {
1769
+ this._codeDuplicateFilter = value;
1770
+ }
1778
1771
  }
1779
1772
  __decorate([
1780
1773
  serializationDefault(NoneLocationSelection)
1781
1774
  ], BarcodeCaptureSettings.prototype, "locationSelection", void 0);
1775
+ __decorate([
1776
+ nameForSerialization('codeDuplicateFilter')
1777
+ ], BarcodeCaptureSettings.prototype, "_codeDuplicateFilter", void 0);
1782
1778
  __decorate([
1783
1779
  nameForSerialization('arucoDictionary')
1784
1780
  ], BarcodeCaptureSettings.prototype, "_arucoDictionary", void 0);
@@ -1936,11 +1932,7 @@ class BarcodeSelection extends DefaultSerializeable {
1936
1932
  }
1937
1933
  set isEnabled(isEnabled) {
1938
1934
  this._isEnabled = isEnabled;
1939
- if (!this.isInListenerCallback) {
1940
- // If we're "in" a listener callback, we don't want to deserialize the context to update the enabled state,
1941
- // but rather pass that back to be applied in the native callback.
1942
- this.modeController.setModeEnabledState(isEnabled);
1943
- }
1935
+ this.modeController.setModeEnabledState(isEnabled);
1944
1936
  }
1945
1937
  get context() {
1946
1938
  return this._context;
@@ -2001,6 +1993,9 @@ class BarcodeSelection extends DefaultSerializeable {
2001
1993
  return this.didChange();
2002
1994
  }
2003
1995
  addListener(listener) {
1996
+ if (listener == undefined) {
1997
+ return;
1998
+ }
2004
1999
  if (this.listeners.includes(listener)) {
2005
2000
  return;
2006
2001
  }
@@ -2040,7 +2035,7 @@ class BarcodeSelection extends DefaultSerializeable {
2040
2035
  }
2041
2036
  }
2042
2037
  __decorate([
2043
- nameForSerialization('enabled')
2038
+ ignoreFromSerialization
2044
2039
  ], BarcodeSelection.prototype, "_isEnabled", void 0);
2045
2040
  __decorate([
2046
2041
  nameForSerialization('feedback')
@@ -2115,6 +2110,7 @@ __decorate([
2115
2110
 
2116
2111
  var BarcodeSelectionBrushProviderEvents;
2117
2112
  (function (BarcodeSelectionBrushProviderEvents) {
2113
+ BarcodeSelectionBrushProviderEvents["inCallback"] = "BarcodeSelectionAimedBrushProvider.inCallback";
2118
2114
  BarcodeSelectionBrushProviderEvents["brushForAimedBarcode"] = "BarcodeSelectionAimedBrushProvider.brushForBarcode";
2119
2115
  BarcodeSelectionBrushProviderEvents["brushForTrackedBarcode"] = "BarcodeSelectionTrackedBrushProvider.brushForBarcode";
2120
2116
  })(BarcodeSelectionBrushProviderEvents || (BarcodeSelectionBrushProviderEvents = {}));
@@ -2697,11 +2693,7 @@ class BarcodeCount extends DefaultSerializeable {
2697
2693
  }
2698
2694
  set isEnabled(isEnabled) {
2699
2695
  this._isEnabled = isEnabled;
2700
- if (!this.isInListenerCallback) {
2701
- // If we're "in" a listener callback, we don't want to deserialize the context to update the enabled state,
2702
- // but rather pass that back to be applied in the native callback.
2703
- this.listenerController.setModeEnabledState(isEnabled);
2704
- }
2696
+ this.listenerController.setModeEnabledState(isEnabled);
2705
2697
  }
2706
2698
  get context() {
2707
2699
  return this._context;
@@ -2797,7 +2789,7 @@ __decorate([
2797
2789
  nameForSerialization('feedback')
2798
2790
  ], BarcodeCount.prototype, "_feedback", void 0);
2799
2791
  __decorate([
2800
- nameForSerialization('enabled')
2792
+ ignoreFromSerialization
2801
2793
  ], BarcodeCount.prototype, "_isEnabled", void 0);
2802
2794
  __decorate([
2803
2795
  ignoreFromSerialization
@@ -3151,11 +3143,7 @@ class BarcodeTracking extends DefaultSerializeable {
3151
3143
  }
3152
3144
  set isEnabled(isEnabled) {
3153
3145
  this._isEnabled = isEnabled;
3154
- if (!this.isInListenerCallback) {
3155
- // If we're "in" a listener callback, we don't want to deserialize the context to update the enabled state,
3156
- // but rather pass that back to be applied in the native callback.
3157
- this.listenerController.setModeEnabledState(isEnabled);
3158
- }
3146
+ this.listenerController.setModeEnabledState(isEnabled);
3159
3147
  }
3160
3148
  get context() {
3161
3149
  return this._context;
@@ -3221,7 +3209,7 @@ class BarcodeTracking extends DefaultSerializeable {
3221
3209
  }
3222
3210
  }
3223
3211
  __decorate([
3224
- nameForSerialization('enabled')
3212
+ ignoreFromSerialization
3225
3213
  ], BarcodeTracking.prototype, "_isEnabled", void 0);
3226
3214
  __decorate([
3227
3215
  ignoreFromSerialization
@@ -3314,8 +3302,9 @@ class BarcodeTrackingAdvancedOverlayController {
3314
3302
  });
3315
3303
  this.eventEmitter.on(BarcodeTrackingAdvancedOverlayListenerEvents.didTapViewForTrackedBarcode, (body) => {
3316
3304
  var _a, _b;
3305
+ const payload = JSON.parse(body);
3317
3306
  const trackedBarcode = TrackedBarcode
3318
- .fromJSON(JSON.parse(body));
3307
+ .fromJSON(JSON.parse(payload.trackedBarcode));
3319
3308
  (_b = (_a = this.overlay.listener) === null || _a === void 0 ? void 0 : _a.didTapViewForTrackedBarcode) === null || _b === void 0 ? void 0 : _b.call(_a, this.overlay, trackedBarcode);
3320
3309
  });
3321
3310
  }