scandit-capacitor-datacapture-barcode 7.6.0-beta.1 → 7.6.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.
@@ -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", '= 7.6.0-beta.1'
20
+ s.dependency "scandit-datacapture-frameworks-barcode", '= 7.6.1'
21
21
  end
@@ -89,7 +89,7 @@ repositories {
89
89
  }
90
90
 
91
91
  dependencies {
92
- def sdk_version = "7.6.0-beta.1"
92
+ def sdk_version = "7.6.1"
93
93
 
94
94
  implementation fileTree(dir: 'libs', include: ['*.jar'])
95
95
  implementation fileTree(dir: 'library', include: ['*.aar'])
@@ -987,8 +987,10 @@ class ScanditBarcodeNative :
987
987
 
988
988
  val container = barcodeFindViewHandler.prepareContainer(this.context)
989
989
 
990
- barcodeFindModule.addViewToContainer(container, viewJson, CapacitorResult(call))
991
- barcodeFindViewHandler.addBarcodeFindViewContainer(getViewId(call), container, bridge.activity)
990
+ container.post {
991
+ barcodeFindModule.addViewToContainer(container, viewJson, CapacitorResult(call))
992
+ barcodeFindViewHandler.addBarcodeFindViewContainer(getViewId(call), container, bridge.activity)
993
+ }
992
994
  }
993
995
 
994
996
  @PluginMethod
@@ -1138,11 +1140,14 @@ class ScanditBarcodeNative :
1138
1140
 
1139
1141
  viewJson?.let {
1140
1142
  val container = barcodePickViewHandler.prepareContainer(this.context)
1141
- barcodePickModule.addViewToContainer(container, viewJson, CapacitorResult(call))
1142
1143
 
1143
- barcodePickViewHandler.addBarcodePickViewContainer(container, bridge.activity)
1144
- barcodePickViewHandler.render()
1144
+ container.post {
1145
+ barcodePickModule.addViewToContainer(container, viewJson, CapacitorResult(call))
1145
1146
 
1147
+ barcodePickViewHandler.addBarcodePickViewContainer(container, bridge.activity)
1148
+ barcodePickViewHandler.render()
1149
+
1150
+ }
1146
1151
  call.resolve()
1147
1152
  } ?: run {
1148
1153
  call.reject("missing parameter for createPickView()")
package/dist/barcode.js CHANGED
@@ -595,7 +595,7 @@ class BarcodeCount extends DefaultSerializeable {
595
595
  static forContext(context, settings) {
596
596
  const barcodeCount = new BarcodeCount(settings);
597
597
  // Preserve legacy factory semantics by attaching the mode to the provided context.
598
- context.setMode(barcodeCount);
598
+ context.addMode(barcodeCount);
599
599
  return barcodeCount;
600
600
  }
601
601
  constructor(settings) {
@@ -3531,13 +3531,13 @@ class BarcodeCapture extends DefaultSerializeable {
3531
3531
  * Use the public constructor instead and configure the instance manually:
3532
3532
  * ```ts
3533
3533
  * const barcodeCapture = new BarcodeCapture(settings);
3534
- * context.setMode(barcodeCapture);
3534
+ * context.addMode(barcodeCapture);
3535
3535
  * ```
3536
3536
  */
3537
3537
  static forContext(context, settings) {
3538
3538
  const barcodeCapture = new BarcodeCapture(settings);
3539
3539
  if (context) {
3540
- context.setMode(barcodeCapture);
3540
+ context.addMode(barcodeCapture);
3541
3541
  }
3542
3542
  return barcodeCapture;
3543
3543
  }
@@ -3724,7 +3724,7 @@ class BarcodeCaptureOverlay extends DefaultSerializeable {
3724
3724
  * ```
3725
3725
  */
3726
3726
  static withBarcodeCaptureForViewWithStyle(barcodeCapture, view, style) {
3727
- const overlay = new BarcodeCaptureOverlay();
3727
+ const overlay = new BarcodeCaptureOverlay(barcodeCapture);
3728
3728
  overlay._style = style;
3729
3729
  const barcodeCaptureOverlayDefaults = BarcodeCaptureOverlay.barcodeCaptureDefaults.BarcodeCaptureOverlay;
3730
3730
  const styles = barcodeCaptureOverlayDefaults.styles ? barcodeCaptureOverlayDefaults.styles : barcodeCaptureOverlayDefaults.Brushes;
@@ -3734,7 +3734,7 @@ class BarcodeCaptureOverlay extends DefaultSerializeable {
3734
3734
  }
3735
3735
  return overlay;
3736
3736
  }
3737
- constructor() {
3737
+ constructor(mode) {
3738
3738
  super();
3739
3739
  this.type = 'barcodeCapture';
3740
3740
  this.controller = null;
@@ -3742,6 +3742,7 @@ class BarcodeCaptureOverlay extends DefaultSerializeable {
3742
3742
  this._shouldShowScanAreaGuides = false;
3743
3743
  this._viewfinder = null;
3744
3744
  this._brush = BarcodeCaptureOverlay.barcodeCaptureDefaults.BarcodeCaptureOverlay.DefaultBrush;
3745
+ this.modeId = mode.modeId;
3745
3746
  this.eventEmitter = FactoryMaker.getInstance('EventEmitter');
3746
3747
  this.handleViewFinderUpdate = this.handleViewFinderUpdate.bind(this);
3747
3748
  }
@@ -3957,8 +3958,11 @@ class BarcodeAr extends DefaultSerializeable {
3957
3958
  this._settings = settings;
3958
3959
  }
3959
3960
  applySettings(settings) {
3960
- this._settings = settings;
3961
- return this.didChange();
3961
+ return __awaiter(this, void 0, void 0, function* () {
3962
+ var _a;
3963
+ this._settings = settings;
3964
+ return (_a = this._controller) === null || _a === void 0 ? void 0 : _a.applyNewSettings(settings);
3965
+ });
3962
3966
  }
3963
3967
  addListener(listener) {
3964
3968
  this.checkAndSubscribeListeners();
@@ -5466,7 +5470,13 @@ class BarcodeArViewController extends BaseNewController {
5466
5470
  }
5467
5471
  const barcodeAr = this.barcodeAr.toJSON();
5468
5472
  const json = JSON.stringify(barcodeAr);
5469
- return this._proxy.$updateBarcodeArMode({ viewId: this.baseView.viewId, barcodeArJson: json });
5473
+ return this._proxy.$updateBarcodeArMode({ viewId: this.baseView.viewId, modeJson: json });
5474
+ }
5475
+ applyNewSettings(settings) {
5476
+ if (!this.isViewCreated) {
5477
+ return Promise.resolve();
5478
+ }
5479
+ return this._proxy.$applyBarcodeArSettings({ viewId: this.baseView.viewId, settings: JSON.stringify(settings.toJSON()) });
5470
5480
  }
5471
5481
  resetMode() {
5472
5482
  if (!this.isViewCreated) {
@@ -6076,7 +6086,7 @@ class BarcodeSelection extends DefaultSerializeable {
6076
6086
  * Use the public constructor instead and configure the instance manually:
6077
6087
  * ```ts
6078
6088
  * const barcodeSelection = new BarcodeSelection(settings);
6079
- * context.setMode(barcodeSelection);
6089
+ * context.addMode(barcodeSelection);
6080
6090
  * ```
6081
6091
  */
6082
6092
  static forContext(context, settings) {
@@ -6089,6 +6099,7 @@ class BarcodeSelection extends DefaultSerializeable {
6089
6099
  constructor(settings) {
6090
6100
  super();
6091
6101
  this.type = 'barcodeSelection';
6102
+ this.modeId = Math.floor(Math.random() * 100000000);
6092
6103
  this._isEnabled = true;
6093
6104
  this._feedback = new BarcodeSelectionFeedback();
6094
6105
  this._pointOfInterest = null;
@@ -6387,7 +6398,7 @@ class BarcodeSelectionBasicOverlay extends DefaultSerializeable {
6387
6398
  * ```
6388
6399
  */
6389
6400
  static withBarcodeSelectionForViewWithStyle(barcodeSelection, view, style) {
6390
- const overlay = new BarcodeSelectionBasicOverlay(style);
6401
+ const overlay = new BarcodeSelectionBasicOverlay(barcodeSelection, style);
6391
6402
  overlay._trackedBrush = new Brush(BarcodeSelectionBasicOverlay.barcodeSelectionDefaults.BarcodeSelectionBasicOverlay.styles[style].DefaultTrackedBrush.fillColor, BarcodeSelectionBasicOverlay.barcodeSelectionDefaults.BarcodeSelectionBasicOverlay.styles[style].DefaultTrackedBrush.strokeColor, BarcodeSelectionBasicOverlay.barcodeSelectionDefaults.BarcodeSelectionBasicOverlay.styles[style].DefaultTrackedBrush.strokeWidth);
6392
6403
  overlay._aimedBrush = new Brush(BarcodeSelectionBasicOverlay.barcodeSelectionDefaults.BarcodeSelectionBasicOverlay.styles[style].DefaultAimedBrush.fillColor, BarcodeSelectionBasicOverlay.barcodeSelectionDefaults.BarcodeSelectionBasicOverlay.styles[style].DefaultAimedBrush.strokeColor, BarcodeSelectionBasicOverlay.barcodeSelectionDefaults.BarcodeSelectionBasicOverlay.styles[style].DefaultAimedBrush.strokeWidth);
6393
6404
  overlay._selectedBrush = new Brush(BarcodeSelectionBasicOverlay.barcodeSelectionDefaults.BarcodeSelectionBasicOverlay.styles[style].DefaultSelectedBrush.fillColor, BarcodeSelectionBasicOverlay.barcodeSelectionDefaults.BarcodeSelectionBasicOverlay.styles[style].DefaultSelectedBrush.strokeColor, BarcodeSelectionBasicOverlay.barcodeSelectionDefaults.BarcodeSelectionBasicOverlay.styles[style].DefaultSelectedBrush.strokeWidth);
@@ -6400,7 +6411,7 @@ class BarcodeSelectionBasicOverlay extends DefaultSerializeable {
6400
6411
  static get barcodeSelectionDefaults() {
6401
6412
  return getBarcodeSelectionDefaults();
6402
6413
  }
6403
- constructor(style) {
6414
+ constructor(mode, style) {
6404
6415
  super();
6405
6416
  this.type = 'barcodeSelectionBasic';
6406
6417
  this.controller = null;
@@ -6414,7 +6425,8 @@ class BarcodeSelectionBasicOverlay extends DefaultSerializeable {
6414
6425
  this._selectingBrush = new Brush(BarcodeSelectionBasicOverlay.barcodeSelectionDefaults.BarcodeSelectionBasicOverlay.styles[BarcodeSelectionBasicOverlay.barcodeSelectionDefaults.BarcodeSelectionBasicOverlay.defaultStyle].DefaultSelectingBrush.fillColor, BarcodeSelectionBasicOverlay.barcodeSelectionDefaults.BarcodeSelectionBasicOverlay.styles[BarcodeSelectionBasicOverlay.barcodeSelectionDefaults.BarcodeSelectionBasicOverlay.defaultStyle].DefaultSelectingBrush.strokeColor, BarcodeSelectionBasicOverlay.barcodeSelectionDefaults.BarcodeSelectionBasicOverlay.styles[BarcodeSelectionBasicOverlay.barcodeSelectionDefaults.BarcodeSelectionBasicOverlay.defaultStyle].DefaultSelectingBrush.strokeWidth);
6415
6426
  this.aimedBrushProvider = null;
6416
6427
  this.trackedBrushProvider = null;
6417
- this._style = style;
6428
+ this._style = style !== null && style !== void 0 ? style : BarcodeSelectionBasicOverlay.barcodeSelectionDefaults.BarcodeSelectionBasicOverlay.defaultStyle;
6429
+ this.modeId = mode.modeId;
6418
6430
  }
6419
6431
  setTextForAimToSelectAutoHint(text) {
6420
6432
  return __awaiter(this, void 0, void 0, function* () {
@@ -6816,7 +6828,7 @@ class BarcodeBatch extends DefaultSerializeable {
6816
6828
  static forContext(context, settings) {
6817
6829
  const barcodeBatch = new BarcodeBatch(settings);
6818
6830
  if (context) {
6819
- context.setMode(barcodeBatch);
6831
+ context.addMode(barcodeBatch);
6820
6832
  }
6821
6833
  return barcodeBatch;
6822
6834
  }
@@ -7324,7 +7336,7 @@ class BarcodeBatchBasicOverlay extends DefaultSerializeable {
7324
7336
  * ```
7325
7337
  */
7326
7338
  static withBarcodeBatchForViewWithStyle(barcodeBatch, view, style) {
7327
- const overlay = new BarcodeBatchBasicOverlay(style);
7339
+ const overlay = new BarcodeBatchBasicOverlay(barcodeBatch, style);
7328
7340
  overlay._brush = new Brush(BarcodeBatchBasicOverlay.barcodeBatchDefaults.BarcodeBatchBasicOverlay.styles[style].DefaultBrush.fillColor, BarcodeBatchBasicOverlay.barcodeBatchDefaults.BarcodeBatchBasicOverlay.styles[style].DefaultBrush.strokeColor, BarcodeBatchBasicOverlay.barcodeBatchDefaults.BarcodeBatchBasicOverlay.styles[style].DefaultBrush.strokeWidth);
7329
7341
  if (view) {
7330
7342
  view.addOverlay(overlay);
@@ -7334,7 +7346,7 @@ class BarcodeBatchBasicOverlay extends DefaultSerializeable {
7334
7346
  static get barcodeBatchDefaults() {
7335
7347
  return getBarcodeBatchDefaults();
7336
7348
  }
7337
- constructor(style) {
7349
+ constructor(mode, style) {
7338
7350
  super();
7339
7351
  this.type = 'barcodeTrackingBasic';
7340
7352
  this._view = null;
@@ -7344,6 +7356,7 @@ class BarcodeBatchBasicOverlay extends DefaultSerializeable {
7344
7356
  this._shouldShowScanAreaGuides = false;
7345
7357
  this.controller = null;
7346
7358
  this._style = style;
7359
+ this.modeId = mode.modeId;
7347
7360
  }
7348
7361
  setBrushForTrackedBarcode(brush, trackedBarcode) {
7349
7362
  return __awaiter(this, void 0, void 0, function* () {
@@ -7485,7 +7498,7 @@ class BaseBarcodeBatchAdvancedOverlay extends DefaultSerializeable {
7485
7498
  (_b = this.controller) === null || _b === void 0 ? void 0 : _b.unsubscribeListener();
7486
7499
  }
7487
7500
  }
7488
- constructor() {
7501
+ constructor(mode) {
7489
7502
  super();
7490
7503
  this.type = 'barcodeTrackingAdvanced';
7491
7504
  this.controller = null;
@@ -7493,6 +7506,7 @@ class BaseBarcodeBatchAdvancedOverlay extends DefaultSerializeable {
7493
7506
  this._shouldShowScanAreaGuides = false;
7494
7507
  this._hasListener = false;
7495
7508
  this._listener = null;
7509
+ this.modeId = mode.modeId;
7496
7510
  }
7497
7511
  setViewForTrackedBarcode(view, trackedBarcode) {
7498
7512
  return __awaiter(this, void 0, void 0, function* () {
@@ -10435,7 +10449,7 @@ __decorate([
10435
10449
  ], BarcodeFindFeedback.prototype, "_itemListUpdated", void 0);
10436
10450
 
10437
10451
  class BarcodeFind extends DefaultSerializeable {
10438
- constructor(dataCaptureContext, settings) {
10452
+ constructor(settings) {
10439
10453
  super();
10440
10454
  this.type = 'barcodeFind';
10441
10455
  this._feedback = BarcodeFindFeedback.defaultFeedback;
@@ -10446,13 +10460,18 @@ class BarcodeFind extends DefaultSerializeable {
10446
10460
  this._hasListeners = false;
10447
10461
  this.listeners = [];
10448
10462
  this._controller = null;
10463
+ this._dataCaptureContext = null;
10449
10464
  this.barcodeTransformer = null;
10450
10465
  this._settings = settings;
10451
- this._dataCaptureContext = dataCaptureContext;
10452
10466
  this._feedback.controller = this._controller;
10453
10467
  }
10468
+ /**
10469
+ * @deprecated Use the constructor instead.
10470
+ */
10454
10471
  static forContext(dataCaptureContext, settings) {
10455
- return new BarcodeFind(dataCaptureContext, settings);
10472
+ const mode = new BarcodeFind(settings);
10473
+ mode._dataCaptureContext = dataCaptureContext;
10474
+ return mode;
10456
10475
  }
10457
10476
  static get barcodeFindDefaults() {
10458
10477
  return getBarcodeFindDefaults();
@@ -11124,28 +11143,19 @@ class BaseBarcodeFindView {
11124
11143
  get context() {
11125
11144
  return this._dataCaptureContext;
11126
11145
  }
11127
- constructor(context, barcodeFind, barcodeFindViewSettings, cameraSettings) {
11146
+ constructor(props) {
11128
11147
  this.isViewCreated = false;
11129
11148
  this._startSearching = false;
11130
11149
  this._isInitialized = false;
11131
11150
  this._viewId = -1; // -1 means the view is not created yet
11132
11151
  this._barcodeFindViewUiListener = null;
11133
- this._dataCaptureContext = context;
11134
- this._barcodeFind = barcodeFind;
11135
- this._barcodeFindViewSettings = barcodeFindViewSettings;
11136
- this._cameraSettings = cameraSettings;
11152
+ this._dataCaptureContext = props.context;
11153
+ this._barcodeFind = props.barcodeFind;
11154
+ this._barcodeFindViewSettings = props.viewSettings;
11155
+ this._cameraSettings = props.cameraSettings;
11137
11156
  this.controller = BarcodeFindViewController.forBarcodeFindView(this);
11138
11157
  this._barcodeFind.controller = this.controller;
11139
11158
  }
11140
- static forMode(dataCaptureContext, barcodeFind) {
11141
- return new BaseBarcodeFindView(dataCaptureContext, barcodeFind);
11142
- }
11143
- static forModeWithViewSettings(dataCaptureContext, barcodeFind, viewSettings) {
11144
- return new BaseBarcodeFindView(dataCaptureContext, barcodeFind, viewSettings);
11145
- }
11146
- static forModeWithViewSettingsAndCameraSettings(dataCaptureContext, barcodeFind, viewSettings, cameraSettings) {
11147
- return new BaseBarcodeFindView(dataCaptureContext, barcodeFind, viewSettings, cameraSettings);
11148
- }
11149
11159
  static get barcodeFindViewDefaults() {
11150
11160
  return getBarcodeFindDefaults().BarcodeFindView;
11151
11161
  }