scandit-capacitor-datacapture-barcode 8.7.1 → 8.7.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.
@@ -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", '= 8.7.1'
20
+ s.dependency "scandit-datacapture-frameworks-barcode", '= 8.7.2'
21
21
  end
@@ -143,7 +143,7 @@ if (ext.has('repos')) {
143
143
  }
144
144
 
145
145
  dependencies {
146
- def sdk_version = "8.7.1"
146
+ def sdk_version = "8.7.2"
147
147
 
148
148
  implementation fileTree(dir: 'libs', include: ['*.jar'])
149
149
  implementation fileTree(dir: 'library', include: ['*.aar'])
package/dist/barcode.js CHANGED
@@ -16634,7 +16634,7 @@ class BarcodeCountViewEventHandlers {
16634
16634
  const trackedBarcode = TrackedBarcode['fromJSON'](JSON.parse(payload.trackedBarcode));
16635
16635
  let brush = this.view.recognizedBrush;
16636
16636
  if (this.view.listener && this.view.listener.brushForRecognizedBarcode) {
16637
- brush = this.view.listener.brushForRecognizedBarcode(this.view.platformView, trackedBarcode);
16637
+ brush = BarcodeCountViewEventHandlers.callOrFallback(() => this.view.listener.brushForRecognizedBarcode(this.view.platformView, trackedBarcode), this.view.recognizedBrush, 'brushFor*');
16638
16638
  }
16639
16639
  const finishPayload = this.buildTrackedBarcodeBrushPayload(trackedBarcode, brush);
16640
16640
  yield this.adapter.finishBarcodeCountBrushForRecognizedBarcode({
@@ -16660,7 +16660,7 @@ class BarcodeCountViewEventHandlers {
16660
16660
  const trackedBarcode = TrackedBarcode['fromJSON'](JSON.parse(payload.trackedBarcode));
16661
16661
  let brush = this.view.notInListBrush;
16662
16662
  if (this.view.listener && this.view.listener.brushForRecognizedBarcodeNotInList) {
16663
- brush = this.view.listener.brushForRecognizedBarcodeNotInList(this.view.platformView, trackedBarcode);
16663
+ brush = BarcodeCountViewEventHandlers.callOrFallback(() => this.view.listener.brushForRecognizedBarcodeNotInList(this.view.platformView, trackedBarcode), this.view.notInListBrush, 'brushFor*');
16664
16664
  }
16665
16665
  const finishPayload = this.buildTrackedBarcodeBrushPayload(trackedBarcode, brush);
16666
16666
  yield this.adapter.finishBarcodeCountBrushForRecognizedBarcodeNotInList({
@@ -16686,7 +16686,7 @@ class BarcodeCountViewEventHandlers {
16686
16686
  const trackedBarcode = TrackedBarcode['fromJSON'](JSON.parse(payload.trackedBarcode));
16687
16687
  let brush = this.view.acceptedBrush;
16688
16688
  if (this.view.listener && this.view.listener.brushForAcceptedBarcode) {
16689
- brush = this.view.listener.brushForAcceptedBarcode(this.view.platformView, trackedBarcode);
16689
+ brush = BarcodeCountViewEventHandlers.callOrFallback(() => this.view.listener.brushForAcceptedBarcode(this.view.platformView, trackedBarcode), this.view.acceptedBrush, 'brushFor*');
16690
16690
  }
16691
16691
  const finishPayload = this.buildTrackedBarcodeBrushPayload(trackedBarcode, brush);
16692
16692
  yield this.adapter.finishBarcodeCountBrushForAcceptedBarcode({
@@ -16712,7 +16712,7 @@ class BarcodeCountViewEventHandlers {
16712
16712
  const trackedBarcode = TrackedBarcode['fromJSON'](JSON.parse(payload.trackedBarcode));
16713
16713
  let brush = this.view.rejectedBrush;
16714
16714
  if (this.view.listener && this.view.listener.brushForRejectedBarcode) {
16715
- brush = this.view.listener.brushForRejectedBarcode(this.view.platformView, trackedBarcode);
16715
+ brush = BarcodeCountViewEventHandlers.callOrFallback(() => this.view.listener.brushForRejectedBarcode(this.view.platformView, trackedBarcode), this.view.rejectedBrush, 'brushFor*');
16716
16716
  }
16717
16717
  const finishPayload = this.buildTrackedBarcodeBrushPayload(trackedBarcode, brush);
16718
16718
  yield this.adapter.finishBarcodeCountBrushForRejectedBarcode({
@@ -16924,7 +16924,7 @@ class BarcodeCountViewEventHandlers {
16924
16924
  const listener = this.view.listener;
16925
16925
  if (listener && typeof listener.iconForRecognizedBarcode === 'function') {
16926
16926
  // Opted in, so the listener's answer stands -- null included, which clears the icon.
16927
- icon = BarcodeCountViewEventHandlers.iconOrDefault(() => listener.iconForRecognizedBarcode(this.view.platformView, trackedBarcode), getBarcodeCountDefaults().BarcodeCountView.defaultRecognizedIcon);
16927
+ icon = BarcodeCountViewEventHandlers.callOrFallback(() => listener.iconForRecognizedBarcode(this.view.platformView, trackedBarcode), getBarcodeCountDefaults().BarcodeCountView.defaultRecognizedIcon, 'iconFor*');
16928
16928
  }
16929
16929
  else {
16930
16930
  // Not opted in: answer with the default. The controller registers only the
@@ -16957,7 +16957,7 @@ class BarcodeCountViewEventHandlers {
16957
16957
  const listener = this.view.listener;
16958
16958
  if (listener && typeof listener.iconForRecognizedBarcodeNotInList === 'function') {
16959
16959
  // Opted in, so the listener's answer stands -- null included, which clears the icon.
16960
- icon = BarcodeCountViewEventHandlers.iconOrDefault(() => listener.iconForRecognizedBarcodeNotInList(this.view.platformView, trackedBarcode), getBarcodeCountDefaults().BarcodeCountView.defaultNotInListIcon);
16960
+ icon = BarcodeCountViewEventHandlers.callOrFallback(() => listener.iconForRecognizedBarcodeNotInList(this.view.platformView, trackedBarcode), getBarcodeCountDefaults().BarcodeCountView.defaultNotInListIcon, 'iconFor*');
16961
16961
  }
16962
16962
  else {
16963
16963
  // Not opted in: answer with the default. The controller registers only the
@@ -16990,7 +16990,7 @@ class BarcodeCountViewEventHandlers {
16990
16990
  const listener = this.view.listener;
16991
16991
  if (listener && typeof listener.iconForAcceptedBarcode === 'function') {
16992
16992
  // Opted in, so the listener's answer stands -- null included, which clears the icon.
16993
- icon = BarcodeCountViewEventHandlers.iconOrDefault(() => listener.iconForAcceptedBarcode(this.view.platformView, trackedBarcode), getBarcodeCountDefaults().BarcodeCountView.defaultAcceptedIcon);
16993
+ icon = BarcodeCountViewEventHandlers.callOrFallback(() => listener.iconForAcceptedBarcode(this.view.platformView, trackedBarcode), getBarcodeCountDefaults().BarcodeCountView.defaultAcceptedIcon, 'iconFor*');
16994
16994
  }
16995
16995
  else {
16996
16996
  // Not opted in: answer with the default. The controller registers only the
@@ -17023,7 +17023,7 @@ class BarcodeCountViewEventHandlers {
17023
17023
  const listener = this.view.listener;
17024
17024
  if (listener && typeof listener.iconForRejectedBarcode === 'function') {
17025
17025
  // Opted in, so the listener's answer stands -- null included, which clears the icon.
17026
- icon = BarcodeCountViewEventHandlers.iconOrDefault(() => listener.iconForRejectedBarcode(this.view.platformView, trackedBarcode), getBarcodeCountDefaults().BarcodeCountView.defaultRejectedIcon);
17026
+ icon = BarcodeCountViewEventHandlers.callOrFallback(() => listener.iconForRejectedBarcode(this.view.platformView, trackedBarcode), getBarcodeCountDefaults().BarcodeCountView.defaultRejectedIcon, 'iconFor*');
17027
17027
  }
17028
17028
  else {
17029
17029
  // Not opted in: answer with the default. The controller registers only the
@@ -17038,13 +17038,14 @@ class BarcodeCountViewEventHandlers {
17038
17038
  });
17039
17039
  });
17040
17040
  }
17041
- // A throwing app callback still gets a finish call, or native would keep no icon at all.
17042
- static iconOrDefault(callback, fallback) {
17041
+ // A throwing app callback still gets a finish call, or native would keep the placeholder brush
17042
+ // (brushFor*) or no icon at all (iconFor*).
17043
+ static callOrFallback(callback, fallback, label) {
17043
17044
  try {
17044
17045
  return callback();
17045
17046
  }
17046
17047
  catch (error) {
17047
- console.error(`BarcodeCountView iconFor* listener failed: ${String(error)}`);
17048
+ console.error(`BarcodeCountView ${label} listener failed: ${String(error)}`);
17048
17049
  return fallback;
17049
17050
  }
17050
17051
  }
@@ -17197,18 +17198,6 @@ class BarcodeCountViewController extends BaseController {
17197
17198
  this.handleOnStatusRequestedWrapper = (ev) => {
17198
17199
  this.handleOnStatusRequested(ev);
17199
17200
  };
17200
- this.handleBrushForRecognizedBarcodeWrapper = (ev) => {
17201
- return this.eventHandlers.handleBrushForRecognizedBarcode(ev);
17202
- };
17203
- this.handleBrushForRecognizedBarcodeNotInListWrapper = (ev) => {
17204
- return this.eventHandlers.handleBrushForRecognizedBarcodeNotInList(ev);
17205
- };
17206
- this.handleBrushForAcceptedBarcodeWrapper = (ev) => {
17207
- return this.eventHandlers.handleBrushForAcceptedBarcode(ev);
17208
- };
17209
- this.handleBrushForRejectedBarcodeWrapper = (ev) => {
17210
- return this.eventHandlers.handleBrushForRejectedBarcode(ev);
17211
- };
17212
17201
  this.handleFilteredBarcodeTappedWrapper = (ev) => {
17213
17202
  this.eventHandlers.handleFilteredBarcodeTapped(ev);
17214
17203
  };
@@ -17363,10 +17352,6 @@ class BarcodeCountViewController extends BaseController {
17363
17352
  // ListenerRegistry for the callbacks the listener implements.
17364
17353
  this._proxy.subscribeForEvents(BarcodeCountViewController.nonIconViewListenerEvents);
17365
17354
  yield this.syncIconEventRegistration(this.view.listener);
17366
- this._proxy.eventEmitter.on(BarcodeCountViewListenerEvents.brushForRecognizedBarcode, this.handleBrushForRecognizedBarcodeWrapper);
17367
- this._proxy.eventEmitter.on(BarcodeCountViewListenerEvents.brushForRecognizedBarcodeNotInList, this.handleBrushForRecognizedBarcodeNotInListWrapper);
17368
- this._proxy.eventEmitter.on(BarcodeCountViewListenerEvents.brushForAcceptedBarcode, this.handleBrushForAcceptedBarcodeWrapper);
17369
- this._proxy.eventEmitter.on(BarcodeCountViewListenerEvents.brushForRejectedBarcode, this.handleBrushForRejectedBarcodeWrapper);
17370
17355
  this._proxy.eventEmitter.on(BarcodeCountViewListenerEvents.filteredBarcodeTapped, this.handleFilteredBarcodeTappedWrapper);
17371
17356
  this._proxy.eventEmitter.on(BarcodeCountViewListenerEvents.recognizedBarcodeNotInListTapped, this.handleRecognizedBarcodeNotInListTappedWrapper);
17372
17357
  this._proxy.eventEmitter.on(BarcodeCountViewListenerEvents.recognizedBarcodeTapped, this.handleRecognizedBarcodeTappedWrapper);
@@ -17720,6 +17705,14 @@ class BarcodeCountViewController extends BaseController {
17720
17705
  return ev => this.eventHandlers.handleIconForAcceptedBarcode(ev);
17721
17706
  case BarcodeCountViewListenerEvents.iconForRejectedBarcode:
17722
17707
  return ev => this.eventHandlers.handleIconForRejectedBarcode(ev);
17708
+ case BarcodeCountViewListenerEvents.brushForRecognizedBarcode:
17709
+ return ev => this.eventHandlers.handleBrushForRecognizedBarcode(ev);
17710
+ case BarcodeCountViewListenerEvents.brushForRecognizedBarcodeNotInList:
17711
+ return ev => this.eventHandlers.handleBrushForRecognizedBarcodeNotInList(ev);
17712
+ case BarcodeCountViewListenerEvents.brushForAcceptedBarcode:
17713
+ return ev => this.eventHandlers.handleBrushForAcceptedBarcode(ev);
17714
+ case BarcodeCountViewListenerEvents.brushForRejectedBarcode:
17715
+ return ev => this.eventHandlers.handleBrushForRejectedBarcode(ev);
17723
17716
  default:
17724
17717
  return ev => this.eventHandlers.handleIconForRecognizedBarcode(ev);
17725
17718
  }
@@ -17783,10 +17776,6 @@ class BarcodeCountViewController extends BaseController {
17783
17776
  }
17784
17777
  this._proxy.unsubscribeFromEvents(BarcodeCountViewController.nonIconViewListenerEvents);
17785
17778
  yield this.syncIconEventRegistration(null);
17786
- this._proxy.eventEmitter.off(BarcodeCountViewListenerEvents.brushForRecognizedBarcode, this.handleBrushForRecognizedBarcodeWrapper);
17787
- this._proxy.eventEmitter.off(BarcodeCountViewListenerEvents.brushForRecognizedBarcodeNotInList, this.handleBrushForRecognizedBarcodeNotInListWrapper);
17788
- this._proxy.eventEmitter.off(BarcodeCountViewListenerEvents.brushForAcceptedBarcode, this.handleBrushForAcceptedBarcodeWrapper);
17789
- this._proxy.eventEmitter.off(BarcodeCountViewListenerEvents.brushForRejectedBarcode, this.handleBrushForRejectedBarcodeWrapper);
17790
17779
  this._proxy.eventEmitter.off(BarcodeCountViewListenerEvents.filteredBarcodeTapped, this.handleFilteredBarcodeTappedWrapper);
17791
17780
  this._proxy.eventEmitter.off(BarcodeCountViewListenerEvents.recognizedBarcodeNotInListTapped, this.handleRecognizedBarcodeNotInListTappedWrapper);
17792
17781
  this._proxy.eventEmitter.off(BarcodeCountViewListenerEvents.recognizedBarcodeTapped, this.handleRecognizedBarcodeTappedWrapper);
@@ -17826,13 +17815,17 @@ class BarcodeCountViewController extends BaseController {
17826
17815
  return data;
17827
17816
  }
17828
17817
  }
17829
- // The four iconFor* events go through the ListenerRegistry, one per implemented callback, so
17830
- // native answers nil (no default flash) only for an event the app will reply to.
17818
+ // The iconFor* and brushFor* events go through the ListenerRegistry, one per implemented
17819
+ // callback, so native answers a placeholder (no default flash) only for an event the app will reply to.
17831
17820
  BarcodeCountViewController.iconViewListenerEvents = [
17832
17821
  BarcodeCountViewListenerEvents.iconForRecognizedBarcode,
17833
17822
  BarcodeCountViewListenerEvents.iconForRecognizedBarcodeNotInList,
17834
17823
  BarcodeCountViewListenerEvents.iconForAcceptedBarcode,
17835
17824
  BarcodeCountViewListenerEvents.iconForRejectedBarcode,
17825
+ BarcodeCountViewListenerEvents.brushForRecognizedBarcode,
17826
+ BarcodeCountViewListenerEvents.brushForRecognizedBarcodeNotInList,
17827
+ BarcodeCountViewListenerEvents.brushForAcceptedBarcode,
17828
+ BarcodeCountViewListenerEvents.brushForRejectedBarcode,
17836
17829
  ];
17837
17830
  BarcodeCountViewController.nonIconViewListenerEvents = Object.values(BarcodeCountViewListenerEvents).filter(event => !BarcodeCountViewController.iconViewListenerEvents.includes(event));
17838
17831