scandit-capacitor-datacapture-barcode 7.0.2 → 7.1.0-beta.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.
- package/ScanditCapacitorDatacaptureBarcode.podspec +1 -1
- package/android/build.gradle +2 -2
- package/android/src/main/java/com/scandit/capacitor/datacapture/barcode/ScanditBarcodeNative.kt +53 -19
- package/android/src/main/java/com/scandit/capacitor/datacapture/barcode/count/BarcodeCountViewHandler.kt +1 -1
- package/android/src/main/java/com/scandit/capacitor/datacapture/barcode/pick/BarcodePickViewHandler.kt +2 -2
- package/dist/barcode.js +3831 -774
- package/dist/barcode.js.map +1 -1
- package/dist/dts/definitions.d.ts +16 -4
- package/dist/dts/ts/BarcodeCountView.d.ts +27 -65
- package/dist/dts/ts/BarcodeFindView.d.ts +3 -0
- package/dist/dts/ts/Capacitor/BarcodeCountSessionProxy.d.ts +3 -5
- package/dist/dts/ts/Capacitor/BarcodeCountViewProxy.d.ts +22 -24
- package/dist/dts/ts/Capacitor/BarcodeGeneratorProxy.d.ts +3 -2
- package/dist/dts/ts/Capacitor/BarcodePickViewProxy.d.ts +1 -0
- package/dist/dts/ts/Capacitor/BarcodeSelectionListenerProxy.d.ts +2 -1
- package/dist/dts/ts/Capacitor/Capacitor.d.ts +2 -0
- package/dist/index.js +2660 -3156
- package/dist/index.js.map +1 -1
- package/ios/Plugin/BarcodeCountViewHandler.swift +4 -17
- package/ios/Plugin/BarcodeFindViewHandler.swift +0 -8
- package/ios/Plugin/BarcodePickViewHandler.swift +0 -8
- package/ios/Plugin/Plugin.m +6 -1
- package/ios/Plugin/ScanditBarcodeCapture.swift +56 -21
- package/package.json +4 -4
|
@@ -13,28 +13,15 @@ class BarcodeCountViewHandler {
|
|
|
13
13
|
let webView: WKWebView
|
|
14
14
|
|
|
15
15
|
var barcodeCountView: BarcodeCountView? {
|
|
16
|
-
willSet {
|
|
17
|
-
barcodeCountView?.delegate = nil
|
|
18
|
-
barcodeCountView?.uiDelegate = nil
|
|
19
|
-
barcodeCountView?.removeFromSuperview()
|
|
20
|
-
}
|
|
21
16
|
didSet {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
barcodeCountView.uiDelegate = barcodeCountViewUIDelegate
|
|
27
|
-
webView.addSubview(barcodeCountView)
|
|
28
|
-
resetConstraints()
|
|
29
|
-
update()
|
|
30
|
-
}
|
|
17
|
+
guard let barcodeCountView = barcodeCountView else { return }
|
|
18
|
+
barcodeCountView.translatesAutoresizingMaskIntoConstraints = false
|
|
19
|
+
resetConstraints()
|
|
20
|
+
update()
|
|
31
21
|
|
|
32
22
|
}
|
|
33
23
|
}
|
|
34
24
|
|
|
35
|
-
weak var barcodeCountViewDelegate: BarcodeCountViewDelegate?
|
|
36
|
-
weak var barcodeCountViewUIDelegate: BarcodeCountViewUIDelegate?
|
|
37
|
-
|
|
38
25
|
private var top: NSLayoutConstraint?
|
|
39
26
|
private var left: NSLayoutConstraint?
|
|
40
27
|
private var width: NSLayoutConstraint?
|
|
@@ -12,22 +12,14 @@ class BarcodeFindViewHandler {
|
|
|
12
12
|
let webView: WKWebView
|
|
13
13
|
|
|
14
14
|
var barcodeFindView: BarcodeFindView? {
|
|
15
|
-
willSet {
|
|
16
|
-
barcodeFindView?.uiDelegate = nil
|
|
17
|
-
barcodeFindView?.removeFromSuperview()
|
|
18
|
-
}
|
|
19
15
|
didSet {
|
|
20
16
|
guard let barcodeFindView = barcodeFindView else { return }
|
|
21
17
|
barcodeFindView.translatesAutoresizingMaskIntoConstraints = false
|
|
22
|
-
barcodeFindView.uiDelegate = barcodeFindViewUIDelegate
|
|
23
|
-
webView.addSubview(barcodeFindView)
|
|
24
18
|
resetConstraints()
|
|
25
19
|
update()
|
|
26
20
|
}
|
|
27
21
|
}
|
|
28
22
|
|
|
29
|
-
weak var barcodeFindViewUIDelegate: BarcodeFindViewUIDelegate?
|
|
30
|
-
|
|
31
23
|
private var top: NSLayoutConstraint?
|
|
32
24
|
private var left: NSLayoutConstraint?
|
|
33
25
|
private var width: NSLayoutConstraint?
|
|
@@ -12,22 +12,14 @@ class BarcodePickViewHandler {
|
|
|
12
12
|
let webView: WKWebView
|
|
13
13
|
|
|
14
14
|
var barcodePickView: BarcodePickView? {
|
|
15
|
-
willSet {
|
|
16
|
-
barcodePickView?.uiDelegate = nil
|
|
17
|
-
barcodePickView?.removeFromSuperview()
|
|
18
|
-
}
|
|
19
15
|
didSet {
|
|
20
16
|
guard let barcodePickView = barcodePickView else { return }
|
|
21
17
|
barcodePickView.translatesAutoresizingMaskIntoConstraints = false
|
|
22
|
-
barcodePickView.uiDelegate = barcodePickViewUIDelegate
|
|
23
|
-
webView.addSubview(barcodePickView)
|
|
24
18
|
resetConstraints()
|
|
25
19
|
update()
|
|
26
20
|
}
|
|
27
21
|
}
|
|
28
22
|
|
|
29
|
-
weak var barcodePickViewUIDelegate: BarcodePickViewUIDelegate?
|
|
30
|
-
|
|
31
23
|
private var top: NSLayoutConstraint?
|
|
32
24
|
private var left: NSLayoutConstraint?
|
|
33
25
|
private var width: NSLayoutConstraint?
|
package/ios/Plugin/Plugin.m
CHANGED
|
@@ -50,6 +50,7 @@ CAP_PLUGIN(ScanditCapacitorBarcode, "ScanditBarcodeNative",
|
|
|
50
50
|
CAP_PLUGIN_METHOD(showView, CAPPluginReturnPromise);
|
|
51
51
|
CAP_PLUGIN_METHOD(hideView, CAPPluginReturnPromise);
|
|
52
52
|
CAP_PLUGIN_METHOD(createView, CAPPluginReturnPromise);
|
|
53
|
+
CAP_PLUGIN_METHOD(removeView, CAPPluginReturnPromise);
|
|
53
54
|
CAP_PLUGIN_METHOD(updateView, CAPPluginReturnPromise);
|
|
54
55
|
CAP_PLUGIN_METHOD(updateMode, CAPPluginReturnPromise);
|
|
55
56
|
CAP_PLUGIN_METHOD(resetBarcodeCount, CAPPluginReturnPromise);
|
|
@@ -63,7 +64,9 @@ CAP_PLUGIN(ScanditCapacitorBarcode, "ScanditBarcodeNative",
|
|
|
63
64
|
CAPPluginReturnPromise);
|
|
64
65
|
CAP_PLUGIN_METHOD(finishBarcodeCountViewListenerBrushForRecognizedBarcodeNotInList,
|
|
65
66
|
CAPPluginReturnPromise);
|
|
66
|
-
CAP_PLUGIN_METHOD(
|
|
67
|
+
CAP_PLUGIN_METHOD(finishBarcodeCountViewListenerOnBrushForAcceptedBarcode,
|
|
68
|
+
CAPPluginReturnPromise);
|
|
69
|
+
CAP_PLUGIN_METHOD(finishBarcodeCountViewListenerOnBrushForRejectedBarcode,
|
|
67
70
|
CAPPluginReturnPromise);
|
|
68
71
|
CAP_PLUGIN_METHOD(setBarcodeFindModeEnabledState, CAPPluginReturnPromise);
|
|
69
72
|
CAP_PLUGIN_METHOD(setBarcodeCountModeEnabledState, CAPPluginReturnPromise);
|
|
@@ -73,6 +76,7 @@ CAP_PLUGIN(ScanditCapacitorBarcode, "ScanditBarcodeNative",
|
|
|
73
76
|
CAP_PLUGIN_METHOD(setBarcodeCaptureModeEnabledState, CAPPluginReturnPromise);
|
|
74
77
|
// Barcode Find
|
|
75
78
|
CAP_PLUGIN_METHOD(createFindView, CAPPluginReturnPromise);
|
|
79
|
+
CAP_PLUGIN_METHOD(removeFindView, CAPPluginReturnPromise);
|
|
76
80
|
CAP_PLUGIN_METHOD(updateFindView, CAPPluginReturnPromise);
|
|
77
81
|
CAP_PLUGIN_METHOD(updateFindMode, CAPPluginReturnPromise);
|
|
78
82
|
CAP_PLUGIN_METHOD(registerBarcodeFindListener, CAPPluginReturnPromise);
|
|
@@ -111,6 +115,7 @@ CAP_PLUGIN(ScanditCapacitorBarcode, "ScanditBarcodeNative",
|
|
|
111
115
|
// Barcode Pick
|
|
112
116
|
CAP_PLUGIN_METHOD(createPickView, CAPPluginReturnPromise);
|
|
113
117
|
CAP_PLUGIN_METHOD(updatePickView, CAPPluginReturnPromise);
|
|
118
|
+
CAP_PLUGIN_METHOD(removePickView, CAPPluginReturnPromise);
|
|
114
119
|
CAP_PLUGIN_METHOD(addActionListener, CAPPluginReturnPromise);
|
|
115
120
|
CAP_PLUGIN_METHOD(removeActionListener, CAPPluginReturnPromise);
|
|
116
121
|
CAP_PLUGIN_METHOD(addScanningListener, CAPPluginReturnPromise);
|
|
@@ -335,10 +335,10 @@ class ScanditCapacitorBarcode: CAPPlugin {
|
|
|
335
335
|
call.reject(CommandError.invalidJSON.toJSONString())
|
|
336
336
|
return
|
|
337
337
|
}
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
338
|
+
barcodeSelectionModule.submitBarcodeCountForIdentifier(
|
|
339
|
+
selectionIdentifier: json.selectionIdentifier,
|
|
340
|
+
result: CapacitorResult(call)
|
|
341
|
+
)
|
|
342
342
|
}
|
|
343
343
|
|
|
344
344
|
@objc(resetBarcodeSelectionSession:)
|
|
@@ -554,10 +554,20 @@ class ScanditCapacitorBarcode: CAPPlugin {
|
|
|
554
554
|
call.reject(CommandError.invalidJSON.toJSONString())
|
|
555
555
|
return
|
|
556
556
|
}
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
557
|
+
dispatchMainSync {
|
|
558
|
+
barcodeCountModule.addViewFromJson(parent: barcodeCountViewHandler.webView,
|
|
559
|
+
viewJson: viewJson,
|
|
560
|
+
result: CapacitorResult(call))
|
|
561
|
+
barcodeCountViewHandler.barcodeCountView = barcodeCountModule.barcodeCountView
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
@objc(removeView:)
|
|
566
|
+
func removeView(_ call: CAPPluginCall) {
|
|
567
|
+
dispatchMainSync {
|
|
568
|
+
barcodeCountViewHandler.barcodeCountView = nil
|
|
569
|
+
barcodeCountModule.disposeBarcodeCountView()
|
|
570
|
+
}
|
|
561
571
|
}
|
|
562
572
|
|
|
563
573
|
@objc(updateView:)
|
|
@@ -647,17 +657,30 @@ class ScanditCapacitorBarcode: CAPPlugin {
|
|
|
647
657
|
result: CapacitorResult(call))
|
|
648
658
|
}
|
|
649
659
|
|
|
650
|
-
@objc(
|
|
651
|
-
func
|
|
660
|
+
@objc(finishBarcodeCountViewListenerOnBrushForAcceptedBarcode:)
|
|
661
|
+
func finishBarcodeCountViewListenerOnBrushForAcceptedBarcode(_ call: CAPPluginCall) {
|
|
652
662
|
guard let brushJson = call.options["brush"] as? String? else { call.reject("Invalid brush json received."); return }
|
|
653
663
|
guard let trackedBarcodeIdString = call.options["trackedBarcodeId"] as? String,
|
|
654
664
|
let trackedBarcodeId = Int(trackedBarcodeIdString)
|
|
655
665
|
else { call.reject("Invalid tracked barcode id received."); return }
|
|
656
666
|
|
|
657
667
|
let brush = brushJson.flatMap { Brush(jsonString: $0) }
|
|
658
|
-
barcodeCountModule.
|
|
659
|
-
|
|
660
|
-
|
|
668
|
+
barcodeCountModule.finishBrushForAcceptedBarcodeEvent(brush: brush,
|
|
669
|
+
trackedBarcodeId: trackedBarcodeId)
|
|
670
|
+
call.resolve()
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
@objc(finishBarcodeCountViewListenerOnBrushForRejectedBarcode:)
|
|
674
|
+
func finishBarcodeCountViewListenerOnBrushForRejectedBarcode(_ call: CAPPluginCall) {
|
|
675
|
+
guard let brushJson = call.options["brush"] as? String? else { call.reject("Invalid brush json received."); return }
|
|
676
|
+
guard let trackedBarcodeIdString = call.options["trackedBarcodeId"] as? String,
|
|
677
|
+
let trackedBarcodeId = Int(trackedBarcodeIdString)
|
|
678
|
+
else { call.reject("Invalid tracked barcode id received."); return }
|
|
679
|
+
|
|
680
|
+
let brush = brushJson.flatMap { Brush(jsonString: $0) }
|
|
681
|
+
barcodeCountModule.finishBrushForRejectedBarcodeEvent(brush: brush,
|
|
682
|
+
trackedBarcodeId: trackedBarcodeId)
|
|
683
|
+
call.resolve()
|
|
661
684
|
}
|
|
662
685
|
|
|
663
686
|
@objc(setBarcodeFindModeEnabledState:)
|
|
@@ -698,7 +721,7 @@ class ScanditCapacitorBarcode: CAPPlugin {
|
|
|
698
721
|
|
|
699
722
|
@objc(getSpatialMap:)
|
|
700
723
|
func getSpatialMap(_ call: CAPPluginCall) {
|
|
701
|
-
|
|
724
|
+
barcodeCountModule.submitSpatialMap(result: CapacitorResult(call))
|
|
702
725
|
}
|
|
703
726
|
|
|
704
727
|
@objc(getSpatialMapWithHints:)
|
|
@@ -713,9 +736,11 @@ class ScanditCapacitorBarcode: CAPPlugin {
|
|
|
713
736
|
return
|
|
714
737
|
}
|
|
715
738
|
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
739
|
+
barcodeCountModule.submitSpatialMap(
|
|
740
|
+
expectedNumberOfRows: expectedNumberOfRows,
|
|
741
|
+
expectedNumberOfColumns: expectedNumberOfColumns,
|
|
742
|
+
result: CapacitorResult(call)
|
|
743
|
+
)
|
|
719
744
|
}
|
|
720
745
|
|
|
721
746
|
@objc(setBarcodeCountModeEnabledState:)
|
|
@@ -785,8 +810,10 @@ class ScanditCapacitorBarcode: CAPPlugin {
|
|
|
785
810
|
|
|
786
811
|
@objc(removeFindView:)
|
|
787
812
|
func removeFindView(_ call: CAPPluginCall) {
|
|
788
|
-
|
|
789
|
-
|
|
813
|
+
dispatchMainSync {
|
|
814
|
+
barcodeFindViewHandler.barcodeFindView = nil
|
|
815
|
+
barcodeFindModule.removeBarcodeFindView(result: CapacitorResult(call))
|
|
816
|
+
}
|
|
790
817
|
}
|
|
791
818
|
|
|
792
819
|
@objc(updateFindMode:)
|
|
@@ -896,10 +923,18 @@ class ScanditCapacitorBarcode: CAPPlugin {
|
|
|
896
923
|
return
|
|
897
924
|
}
|
|
898
925
|
dispatchMainSync {
|
|
899
|
-
barcodePickModule.addViewToContainer(container: barcodePickViewHandler.webView,
|
|
926
|
+
self.barcodePickModule.addViewToContainer(container: self.barcodePickViewHandler.webView,
|
|
900
927
|
jsonString: viewJson,
|
|
901
928
|
result: CapacitorResult(call))
|
|
902
|
-
barcodePickViewHandler.barcodePickView = barcodePickModule.barcodePickView
|
|
929
|
+
self.barcodePickViewHandler.barcodePickView = self.barcodePickModule.barcodePickView
|
|
930
|
+
}
|
|
931
|
+
}
|
|
932
|
+
|
|
933
|
+
@objc(removePickView:)
|
|
934
|
+
func removePickView(_ call: CAPPluginCall) {
|
|
935
|
+
dispatchMainSync {
|
|
936
|
+
barcodePickViewHandler.barcodePickView = nil
|
|
937
|
+
barcodePickModule.removeBarcodePickView(result: CapacitorResult(call))
|
|
903
938
|
}
|
|
904
939
|
}
|
|
905
940
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "scandit-capacitor-datacapture-barcode",
|
|
3
|
-
"version": "7.0.2",
|
|
3
|
+
"version": "7.1.0-beta.2",
|
|
4
4
|
"description": "Scandit Data Capture SDK for Capacitor",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"private": false,
|
|
@@ -23,9 +23,9 @@
|
|
|
23
23
|
"watch": "tsc --watch"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"scandit-capacitor-datacapture-core": "7.0.2",
|
|
27
|
-
"scandit-datacapture-frameworks-barcode": "7.0.2",
|
|
28
|
-
"scandit-datacapture-frameworks-core": "7.0.2"
|
|
26
|
+
"scandit-capacitor-datacapture-core": "7.1.0-beta.2",
|
|
27
|
+
"scandit-datacapture-frameworks-barcode": "7.1.0-beta.2",
|
|
28
|
+
"scandit-datacapture-frameworks-core": "7.1.0-beta.2"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@babel/plugin-proposal-class-properties": "^7.18.6",
|