react-native-scanbot-barcode-scanner-sdk 5.1.2-alpha.1 → 6.1.0-rc.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.
Files changed (154) hide show
  1. package/Libraries.txt +439 -16
  2. package/RNScanbotBarcodeSDK.podspec +1 -1
  3. package/android/build.gradle +1 -1
  4. package/android/gradle.properties +4 -4
  5. package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/ScanbotBarcodeSdkModule.kt +27 -25
  6. package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/ScanbotBarcodeSdkPluginResultDelegate.kt +2 -2
  7. package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/components/barcode_scanner_view/ScanbotBarcodeScannerViewEvents.kt +4 -4
  8. package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/components/barcode_scanner_view/ScanbotBarcodeScannerViewManager.kt +0 -1
  9. package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/models/ScanbotBarcodeScannerModels.kt +4 -10
  10. package/ios/Components/BarcodeScannerView/RNScanbotBarcodeScannerLegacyView.m +4 -4
  11. package/ios/Components/BarcodeScannerView/RNScanbotBarcodeScannerView.mm +0 -4
  12. package/ios/Components/BarcodeScannerView/RNScanbotBarcodeScannerViewControllerWrapper.h +0 -3
  13. package/ios/Components/BarcodeScannerView/RNScanbotBarcodeScannerViewControllerWrapper.m +1 -5
  14. package/ios/ScanbotBarcodeSdk.m +57 -48
  15. package/ios/ScanbotBarcodeSdkPluginResultDelegate.h +1 -1
  16. package/ios/ScanbotBarcodeSdkPluginResultDelegate.m +13 -13
  17. package/lib/commonjs/component/spec/ScanbotBarcodeScannerViewNativeComponent.js.map +1 -1
  18. package/lib/commonjs/documents/BarcodeDocumentModel.js +612 -613
  19. package/lib/commonjs/documents/BarcodeDocumentModel.js.map +1 -1
  20. package/lib/commonjs/documents/GenericDocument.js +82 -49
  21. package/lib/commonjs/documents/GenericDocument.js.map +1 -1
  22. package/lib/commonjs/index.js +15 -13
  23. package/lib/commonjs/index.js.map +1 -1
  24. package/lib/commonjs/ui_v2/barcode/ArTrackingOverlayConfiguration.js +10 -47
  25. package/lib/commonjs/ui_v2/barcode/ArTrackingOverlayConfiguration.js.map +1 -1
  26. package/lib/commonjs/ui_v2/barcode/BarcodeRecognizerConfiguration.js +47 -19
  27. package/lib/commonjs/ui_v2/barcode/BarcodeRecognizerConfiguration.js.map +1 -1
  28. package/lib/commonjs/ui_v2/barcode/BarcodeScannerConfiguration.js.map +1 -1
  29. package/lib/commonjs/ui_v2/barcode/FindAndPickScanningModeUseCase.js +8 -4
  30. package/lib/commonjs/ui_v2/barcode/FindAndPickScanningModeUseCase.js.map +1 -1
  31. package/lib/commonjs/ui_v2/barcode/MultipleScanningModeUseCase.js +9 -1
  32. package/lib/commonjs/ui_v2/barcode/MultipleScanningModeUseCase.js.map +1 -1
  33. package/lib/commonjs/ui_v2/barcode/SingleScanningModeUseCase.js +1 -1
  34. package/lib/commonjs/ui_v2/barcode/SingleScanningModeUseCase.js.map +1 -1
  35. package/lib/commonjs/ui_v2/common/CameraPermission.js +22 -6
  36. package/lib/commonjs/ui_v2/common/CameraPermission.js.map +1 -1
  37. package/lib/commonjs/ui_v2/common/Common.js +175 -5
  38. package/lib/commonjs/ui_v2/common/Common.js.map +1 -1
  39. package/lib/commonjs/ui_v2/common/NavigationBarConfiguration.js +6 -0
  40. package/lib/commonjs/ui_v2/common/NavigationBarConfiguration.js.map +1 -0
  41. package/lib/commonjs/ui_v2/common/ScanbotAlertDialog.js +27 -5
  42. package/lib/commonjs/ui_v2/common/ScanbotAlertDialog.js.map +1 -1
  43. package/lib/commonjs/ui_v2/common/UserGuidanceConfiguration.js +48 -1
  44. package/lib/commonjs/ui_v2/common/UserGuidanceConfiguration.js.map +1 -1
  45. package/lib/commonjs/ui_v2/index.js +14 -1
  46. package/lib/commonjs/ui_v2/index.js.map +1 -1
  47. package/lib/commonjs/utils.js +8 -1
  48. package/lib/commonjs/utils.js.map +1 -1
  49. package/lib/module/component/spec/ScanbotBarcodeScannerViewNativeComponent.js.map +1 -1
  50. package/lib/module/documents/BarcodeDocumentModel.js +611 -612
  51. package/lib/module/documents/BarcodeDocumentModel.js.map +1 -1
  52. package/lib/module/documents/GenericDocument.js +84 -51
  53. package/lib/module/documents/GenericDocument.js.map +1 -1
  54. package/lib/module/index.js +7 -1
  55. package/lib/module/index.js.map +1 -1
  56. package/lib/module/ui_v2/barcode/ArTrackingOverlayConfiguration.js +1 -36
  57. package/lib/module/ui_v2/barcode/ArTrackingOverlayConfiguration.js.map +1 -1
  58. package/lib/module/ui_v2/barcode/BarcodeRecognizerConfiguration.js +47 -19
  59. package/lib/module/ui_v2/barcode/BarcodeRecognizerConfiguration.js.map +1 -1
  60. package/lib/module/ui_v2/barcode/BarcodeScannerConfiguration.js.map +1 -1
  61. package/lib/module/ui_v2/barcode/FindAndPickScanningModeUseCase.js +6 -2
  62. package/lib/module/ui_v2/barcode/FindAndPickScanningModeUseCase.js.map +1 -1
  63. package/lib/module/ui_v2/barcode/MultipleScanningModeUseCase.js +9 -1
  64. package/lib/module/ui_v2/barcode/MultipleScanningModeUseCase.js.map +1 -1
  65. package/lib/module/ui_v2/barcode/SingleScanningModeUseCase.js +1 -1
  66. package/lib/module/ui_v2/barcode/SingleScanningModeUseCase.js.map +1 -1
  67. package/lib/module/ui_v2/common/CameraPermission.js +22 -6
  68. package/lib/module/ui_v2/common/CameraPermission.js.map +1 -1
  69. package/lib/module/ui_v2/common/Common.js +168 -2
  70. package/lib/module/ui_v2/common/Common.js.map +1 -1
  71. package/lib/module/ui_v2/common/NavigationBarConfiguration.js +2 -0
  72. package/lib/module/ui_v2/common/NavigationBarConfiguration.js.map +1 -0
  73. package/lib/module/ui_v2/common/ScanbotAlertDialog.js +28 -5
  74. package/lib/module/ui_v2/common/ScanbotAlertDialog.js.map +1 -1
  75. package/lib/module/ui_v2/common/UserGuidanceConfiguration.js +47 -0
  76. package/lib/module/ui_v2/common/UserGuidanceConfiguration.js.map +1 -1
  77. package/lib/module/ui_v2/index.js +3 -1
  78. package/lib/module/ui_v2/index.js.map +1 -1
  79. package/lib/module/utils.js +6 -0
  80. package/lib/module/utils.js.map +1 -1
  81. package/lib/typescript/src/component/barcode-camera-view/ScanbotBarcodeCameraViewProperties.d.ts +3 -5
  82. package/lib/typescript/src/component/barcode-camera-view/ScanbotBarcodeCameraViewProperties.d.ts.map +1 -1
  83. package/lib/typescript/src/component/spec/ScanbotBarcodeScannerViewNativeComponent.d.ts +0 -1
  84. package/lib/typescript/src/component/spec/ScanbotBarcodeScannerViewNativeComponent.d.ts.map +1 -1
  85. package/lib/typescript/src/configurations.d.ts +13 -5
  86. package/lib/typescript/src/configurations.d.ts.map +1 -1
  87. package/lib/typescript/src/customConfigurations.d.ts +19 -3
  88. package/lib/typescript/src/customConfigurations.d.ts.map +1 -1
  89. package/lib/typescript/src/documents/BarcodeDocumentModel.d.ts +70 -71
  90. package/lib/typescript/src/documents/BarcodeDocumentModel.d.ts.map +1 -1
  91. package/lib/typescript/src/documents/CommonFieldType.d.ts +58 -109
  92. package/lib/typescript/src/documents/CommonFieldType.d.ts.map +1 -1
  93. package/lib/typescript/src/documents/GenericDocument.d.ts +95 -86
  94. package/lib/typescript/src/documents/GenericDocument.d.ts.map +1 -1
  95. package/lib/typescript/src/index.d.ts +5 -1
  96. package/lib/typescript/src/index.d.ts.map +1 -1
  97. package/lib/typescript/src/results.d.ts +1 -13
  98. package/lib/typescript/src/results.d.ts.map +1 -1
  99. package/lib/typescript/src/types.d.ts +25 -20
  100. package/lib/typescript/src/types.d.ts.map +1 -1
  101. package/lib/typescript/src/ui_v2/barcode/ArTrackingOverlayConfiguration.d.ts +1 -22
  102. package/lib/typescript/src/ui_v2/barcode/ArTrackingOverlayConfiguration.d.ts.map +1 -1
  103. package/lib/typescript/src/ui_v2/barcode/BarcodeRecognizerConfiguration.d.ts +41 -19
  104. package/lib/typescript/src/ui_v2/barcode/BarcodeRecognizerConfiguration.d.ts.map +1 -1
  105. package/lib/typescript/src/ui_v2/barcode/BarcodeScannerConfiguration.d.ts.map +1 -1
  106. package/lib/typescript/src/ui_v2/barcode/FindAndPickScanningModeUseCase.d.ts +4 -0
  107. package/lib/typescript/src/ui_v2/barcode/FindAndPickScanningModeUseCase.d.ts.map +1 -1
  108. package/lib/typescript/src/ui_v2/barcode/MultipleScanningModeUseCase.d.ts +5 -0
  109. package/lib/typescript/src/ui_v2/barcode/MultipleScanningModeUseCase.d.ts.map +1 -1
  110. package/lib/typescript/src/ui_v2/common/CameraPermission.d.ts.map +1 -1
  111. package/lib/typescript/src/ui_v2/common/Common.d.ts +103 -1
  112. package/lib/typescript/src/ui_v2/common/Common.d.ts.map +1 -1
  113. package/lib/typescript/src/ui_v2/common/NavigationBarConfiguration.d.ts +12 -0
  114. package/lib/typescript/src/ui_v2/common/NavigationBarConfiguration.d.ts.map +1 -0
  115. package/lib/typescript/src/ui_v2/common/ScanbotAlertDialog.d.ts +4 -0
  116. package/lib/typescript/src/ui_v2/common/ScanbotAlertDialog.d.ts.map +1 -1
  117. package/lib/typescript/src/ui_v2/common/UserGuidanceConfiguration.d.ts +25 -0
  118. package/lib/typescript/src/ui_v2/common/UserGuidanceConfiguration.d.ts.map +1 -1
  119. package/lib/typescript/src/ui_v2/index.d.ts +1 -0
  120. package/lib/typescript/src/ui_v2/index.d.ts.map +1 -1
  121. package/lib/typescript/src/utils.d.ts +5 -0
  122. package/lib/typescript/src/utils.d.ts.map +1 -1
  123. package/package.json +2 -2
  124. package/src/component/barcode-camera-view/ScanbotBarcodeCameraViewProperties.ts +2 -5
  125. package/src/component/spec/ScanbotBarcodeScannerViewNativeComponent.ts +0 -1
  126. package/src/configurations.ts +19 -7
  127. package/src/customConfigurations.ts +19 -3
  128. package/src/documents/BarcodeDocumentModel.ts +644 -623
  129. package/src/documents/CommonFieldType.ts +59 -82
  130. package/src/documents/GenericDocument.ts +104 -86
  131. package/src/index.ts +7 -1
  132. package/src/results.ts +1 -16
  133. package/src/types.ts +26 -23
  134. package/src/ui_v2/barcode/ArTrackingOverlayConfiguration.ts +1 -36
  135. package/src/ui_v2/barcode/BarcodeRecognizerConfiguration.ts +60 -22
  136. package/src/ui_v2/barcode/BarcodeScannerConfiguration.ts +2 -2
  137. package/src/ui_v2/barcode/BarcodeUseCase.ts +1 -1
  138. package/src/ui_v2/barcode/FindAndPickScanningModeUseCase.ts +6 -2
  139. package/src/ui_v2/barcode/MultipleScanningModeUseCase.ts +9 -1
  140. package/src/ui_v2/barcode/SingleScanningModeUseCase.ts +1 -1
  141. package/src/ui_v2/common/CameraPermission.ts +22 -6
  142. package/src/ui_v2/common/Common.ts +168 -2
  143. package/src/ui_v2/common/NavigationBarConfiguration.ts +13 -0
  144. package/src/ui_v2/common/ScanbotAlertDialog.ts +25 -6
  145. package/src/ui_v2/common/UserGuidanceConfiguration.ts +41 -0
  146. package/src/ui_v2/index.ts +5 -9
  147. package/src/utils.ts +10 -0
  148. package/lib/commonjs/documents/Point.js +0 -14
  149. package/lib/commonjs/documents/Point.js.map +0 -1
  150. package/lib/module/documents/Point.js +0 -7
  151. package/lib/module/documents/Point.js.map +0 -1
  152. package/lib/typescript/src/documents/Point.d.ts +0 -6
  153. package/lib/typescript/src/documents/Point.d.ts.map +0 -1
  154. package/src/documents/Point.ts +0 -10
@@ -1,14 +1,14 @@
1
1
  import { DeepPartial, PartiallyConstructible } from '../../utils';
2
2
 
3
3
  /**
4
- Expected quantity of QR codes in an image.
4
+ The customer format used in AUSTRALIA_POST codes. Only relevant for format codes 59 and 62.
5
5
 
6
- - `LOW`:
7
- Up to 6 QR codes per image.
8
- - `HIGH`:
9
- Up to 24 QR codes per image.
6
+ - `NUMERIC`:
7
+ The numeric format.
8
+ - `ALPHA_NUMERIC`:
9
+ The alphanumeric format.
10
10
  */
11
- export type CodeDensity = 'LOW' | 'HIGH';
11
+ export type AustraliaPostCustomerFormat = 'NUMERIC' | 'ALPHA_NUMERIC';
12
12
 
13
13
  /**
14
14
  Type of MSI plessey checksum algorithm used.
@@ -41,15 +41,25 @@ export type MSIPlesseyChecksumAlgorithm =
41
41
  GS1_COMPOSITE barcode type handling
42
42
 
43
43
  - `NONE`:
44
- No special handling for GS1-formatted results. Special (FNC1) characters are stripped.
44
+ The (FNC1) character is simply stripped from the result in barcodes that implement this mode. Do not use. Will be removed in a future release.
45
45
  - `PARSE`:
46
- GS1 messages are converted to machine-readable format per the GS1 spec (the special character is converted to ASCII \x1D). Message is not validated. The implied 01 AI key is prepended to DataBar results.
47
- - `VALIDATE`:
48
- GS1 messages are converted to machine-readable format per the GS1 spec (the special character is converted to ASCII \x1D) and validated. The implied 01 AI key is prepended to DataBar results. Invalid messages are not returned.
49
- - `DECODE`:
50
- GS1 strings are converted to human-readable format and validated. The implied (01) AI key is prepended to DataBar results. Invalid messages are not returned.
46
+ GS1 messages are converted to the machine-readable format per the GS1 spec (the special FNC1 character is converted to ASCII \x1D). The implied 01 AI key is prepended to DataBar results. No validation is performed.
47
+ - `VALIDATE_STRUCTURE`:
48
+ Same as PARSE. Additionally, messages containing unknown AI keys, or containing values of incorrect format for known keys, are not returned.
49
+ - `DECODE_STRUCTURE`:
50
+ Same as VALIDATE_STRUCTURE, except that GS1 strings are converted to the human-readable format, instead (with parentheses used to wrap AI keys, e.g. (01)123456789). The \x1D character is never used in this representation.
51
+ - `VALIDATE_FULL`:
52
+ Full validation including linting and checksums. This is the most strict mode.
53
+ - `DECODE_FULL`:
54
+ Same as DECODE_STRUCTURE, but with full validation.
51
55
  */
52
- export type Gs1Handling = 'NONE' | 'PARSE' | 'VALIDATE' | 'DECODE';
56
+ export type Gs1Handling =
57
+ | 'NONE'
58
+ | 'PARSE'
59
+ | 'VALIDATE_STRUCTURE'
60
+ | 'DECODE_STRUCTURE'
61
+ | 'VALIDATE_FULL'
62
+ | 'DECODE_FULL';
53
63
 
54
64
  /**
55
65
  Type of barcode document format used.
@@ -143,6 +153,14 @@ Barcode symbology used.
143
153
  GS1 Composite
144
154
  - `MICRO_PDF_417`:
145
155
  Databar micro pdf 417
156
+ - `MAXI_CODE`:
157
+ Maxicode
158
+ - `RMQR_CODE`:
159
+ RMQR code
160
+ - `CODE_11`:
161
+ Code 11 barcode type
162
+ - `CODE_32`:
163
+ Code 32 barcode type
146
164
  */
147
165
  export type BarcodeFormat =
148
166
  | 'AZTEC'
@@ -172,7 +190,11 @@ export type BarcodeFormat =
172
190
  | 'AUSTRALIA_POST'
173
191
  | 'DATABAR_LIMITED'
174
192
  | 'GS1_COMPOSITE'
175
- | 'MICRO_PDF_417';
193
+ | 'MICRO_PDF_417'
194
+ | 'MAXI_CODE'
195
+ | 'RMQR_CODE'
196
+ | 'CODE_11'
197
+ | 'CODE_32';
176
198
 
177
199
  /**
178
200
  Filter for extended EAN and UPC barcodes.
@@ -227,6 +249,16 @@ export class BarcodeRecognizerConfiguration extends PartiallyConstructible {
227
249
  Default is false
228
250
  */
229
251
  public stripCheckDigits: boolean = false;
252
+ /**
253
+ If `true`, the optional check digit for IATA_2_OF_5 codes is used in validation. The default is `true`.
254
+ Default is true
255
+ */
256
+ public useIATA2OF5Checksum: boolean = true;
257
+ /**
258
+ If `true`, the optional check digit for CODE_11 codes is used in validation. The default is `true`.
259
+ Default is true
260
+ */
261
+ public useCode11Checksum: boolean = true;
230
262
  /**
231
263
  List of accepted barcode symbologies.
232
264
  */
@@ -236,16 +268,16 @@ export class BarcodeRecognizerConfiguration extends PartiallyConstructible {
236
268
  Default is MOD_10
237
269
  */
238
270
  public msiPlesseyChecksumAlgorithm: MSIPlesseyChecksumAlgorithm = 'MOD_10';
271
+ /**
272
+ The customer format used in AUSTRALIA_POST codes. The default value is ALPHA_NUMERIC.
273
+ Default is ALPHA_NUMERIC
274
+ */
275
+ public australiaPostCustomerFormat: AustraliaPostCustomerFormat = 'ALPHA_NUMERIC';
239
276
  /**
240
277
  If `true`, enables a mode that slightly decreases scanning quality and energy consumption. Increases scanning speed. If `false`, the mode is disabled. The default is `false`. Android only.
241
278
  Default is false
242
279
  */
243
280
  public lowPowerMode: boolean = false;
244
- /**
245
- The expected quantity of QR codes in an image.
246
- Default is LOW
247
- */
248
- public codeDensity: CodeDensity = 'LOW';
249
281
  /**
250
282
  The expected way of handling GS1_COMPOSITE barcodes.
251
283
  Default is PARSE
@@ -276,18 +308,24 @@ export class BarcodeRecognizerConfiguration extends PartiallyConstructible {
276
308
  if (source.stripCheckDigits !== undefined) {
277
309
  this.stripCheckDigits = source.stripCheckDigits;
278
310
  }
311
+ if (source.useIATA2OF5Checksum !== undefined) {
312
+ this.useIATA2OF5Checksum = source.useIATA2OF5Checksum;
313
+ }
314
+ if (source.useCode11Checksum !== undefined) {
315
+ this.useCode11Checksum = source.useCode11Checksum;
316
+ }
279
317
  if (source.barcodeFormats !== undefined) {
280
318
  this.barcodeFormats = source.barcodeFormats.map((it) => it);
281
319
  }
282
320
  if (source.msiPlesseyChecksumAlgorithm !== undefined) {
283
321
  this.msiPlesseyChecksumAlgorithm = source.msiPlesseyChecksumAlgorithm;
284
322
  }
323
+ if (source.australiaPostCustomerFormat !== undefined) {
324
+ this.australiaPostCustomerFormat = source.australiaPostCustomerFormat;
325
+ }
285
326
  if (source.lowPowerMode !== undefined) {
286
327
  this.lowPowerMode = source.lowPowerMode;
287
328
  }
288
- if (source.codeDensity !== undefined) {
289
- this.codeDensity = source.codeDensity;
290
- }
291
329
  if (source.gs1Handling !== undefined) {
292
330
  this.gs1Handling = source.gs1Handling;
293
331
  }
@@ -3,8 +3,9 @@ import { ArOverlayFindAndPickConfiguration } from '../barcode/ArTrackingOverlayC
3
3
  import { ArOverlayGeneralConfiguration } from '../barcode/ArTrackingOverlayConfiguration';
4
4
  import { ArOverlayPolygonConfiguration } from '../barcode/ArTrackingOverlayConfiguration';
5
5
  import { AspectRatio } from '../common/Common';
6
+ import { AustraliaPostCustomerFormat } from '../barcode/BarcodeRecognizerConfiguration';
6
7
  import { BackgroundStyle } from '../common/Common';
7
- import { BadgeStyle } from '../barcode/ArTrackingOverlayConfiguration';
8
+ import { BadgeStyle } from '../common/Common';
8
9
  import { BadgedButton } from '../common/Common';
9
10
  import { BarcodeDocumentFormat } from '../barcode/BarcodeRecognizerConfiguration';
10
11
  import { BarcodeFormat } from '../barcode/BarcodeRecognizerConfiguration';
@@ -22,7 +23,6 @@ import { CameraConfiguration } from '../common/CameraConfiguration';
22
23
  import { CameraModule } from '../common/CameraConfiguration';
23
24
  import { CameraPermissionScreen } from '../common/CameraPermission';
24
25
  import { CameraPreviewMode } from '../common/Common';
25
- import { CodeDensity } from '../barcode/BarcodeRecognizerConfiguration';
26
26
  import { CollapsedVisibleHeight } from '../barcode/MultipleScanningModeUseCase';
27
27
  import { DeepPartial, PartiallyConstructible } from '../../utils';
28
28
  import { ExpectedBarcode } from '../barcode/FindAndPickScanningModeUseCase';
@@ -2,7 +2,7 @@ import { ArOverlayFindAndPickConfiguration } from '../barcode/ArTrackingOverlayC
2
2
  import { ArOverlayGeneralConfiguration } from '../barcode/ArTrackingOverlayConfiguration';
3
3
  import { ArOverlayPolygonConfiguration } from '../barcode/ArTrackingOverlayConfiguration';
4
4
  import { BackgroundStyle } from '../common/Common';
5
- import { BadgeStyle } from '../barcode/ArTrackingOverlayConfiguration';
5
+ import { BadgeStyle } from '../common/Common';
6
6
  import { BadgedButton } from '../common/Common';
7
7
  import { BarcodeInfoMapping } from '../barcode/BarcodeInfoMapping';
8
8
  import { BarcodeItemConfiguration } from '../barcode/ArTrackingOverlayConfiguration';
@@ -2,7 +2,7 @@ import { ArOverlayFindAndPickConfiguration } from '../barcode/ArTrackingOverlayC
2
2
  import { ArOverlayGeneralConfiguration } from '../barcode/ArTrackingOverlayConfiguration';
3
3
  import { ArOverlayPolygonConfiguration } from '../barcode/ArTrackingOverlayConfiguration';
4
4
  import { BackgroundStyle } from '../common/Common';
5
- import { BadgeStyle } from '../barcode/ArTrackingOverlayConfiguration';
5
+ import { BadgeStyle } from '../common/Common';
6
6
  import { BadgedButton } from '../common/Common';
7
7
  import { BarcodeInfoMapping } from '../barcode/BarcodeInfoMapping';
8
8
  import { BarcodeItemConfiguration } from '../barcode/ArTrackingOverlayConfiguration';
@@ -50,6 +50,10 @@ export class ExpectedBarcode extends PartiallyConstructible {
50
50
  Default is 1
51
51
  */
52
52
  public count: number = 1;
53
+ /**
54
+ Use this key to display the original barcode image
55
+ */
56
+ public static readonly barcodeImageKey = 'BARCODE_IMAGE';
53
57
 
54
58
  /** @param source {@displayType `DeepPartial<ExpectedBarcode>`} */
55
59
  public constructor(source: DeepPartial<ExpectedBarcode> = {}) {
@@ -247,7 +251,7 @@ export class FindAndPickScanningMode extends PartiallyConstructible {
247
251
  Configuration of the AR overlay.
248
252
  */
249
253
  public arOverlay: ArOverlayFindAndPickConfiguration = new ArOverlayFindAndPickConfiguration({
250
- visible: false,
254
+ visible: true,
251
255
  automaticSelectionEnabled: true,
252
256
  polygon: new FindAndPickArOverlayPolygonConfiguration({
253
257
  partiallyScanned: new PolygonStyle({
@@ -2,7 +2,7 @@ import { ArOverlayFindAndPickConfiguration } from '../barcode/ArTrackingOverlayC
2
2
  import { ArOverlayGeneralConfiguration } from '../barcode/ArTrackingOverlayConfiguration';
3
3
  import { ArOverlayPolygonConfiguration } from '../barcode/ArTrackingOverlayConfiguration';
4
4
  import { BackgroundStyle } from '../common/Common';
5
- import { BadgeStyle } from '../barcode/ArTrackingOverlayConfiguration';
5
+ import { BadgeStyle } from '../common/Common';
6
6
  import { BadgedButton } from '../common/Common';
7
7
  import { BarcodeInfoMapping } from '../barcode/BarcodeInfoMapping';
8
8
  import { BarcodeItemConfiguration } from '../barcode/ArTrackingOverlayConfiguration';
@@ -428,6 +428,11 @@ export class MultipleScanningMode extends PartiallyConstructible {
428
428
  Default is 1000
429
429
  */
430
430
  public countingRepeatDelay: number = 1000;
431
+ /**
432
+ Whether the user can submit an empty barcode list.
433
+ Default is false
434
+ */
435
+ public allowEmptySubmission: boolean = false;
431
436
  /**
432
437
  Mode used for scanning multiple barcodes.
433
438
  Default is COUNTING
@@ -694,6 +699,9 @@ export class MultipleScanningMode extends PartiallyConstructible {
694
699
  if (source.countingRepeatDelay !== undefined) {
695
700
  this.countingRepeatDelay = source.countingRepeatDelay;
696
701
  }
702
+ if (source.allowEmptySubmission !== undefined) {
703
+ this.allowEmptySubmission = source.allowEmptySubmission;
704
+ }
697
705
  if (source.mode !== undefined) {
698
706
  this.mode = source.mode;
699
707
  }
@@ -2,7 +2,7 @@ import { ArOverlayFindAndPickConfiguration } from '../barcode/ArTrackingOverlayC
2
2
  import { ArOverlayGeneralConfiguration } from '../barcode/ArTrackingOverlayConfiguration';
3
3
  import { ArOverlayPolygonConfiguration } from '../barcode/ArTrackingOverlayConfiguration';
4
4
  import { BackgroundStyle } from '../common/Common';
5
- import { BadgeStyle } from '../barcode/ArTrackingOverlayConfiguration';
5
+ import { BadgeStyle } from '../common/Common';
6
6
  import { BadgedButton } from '../common/Common';
7
7
  import { BarcodeInfoMapping } from '../barcode/BarcodeInfoMapping';
8
8
  import { BarcodeItemConfiguration } from '../barcode/ArTrackingOverlayConfiguration';
@@ -33,24 +33,40 @@ export class CameraPermissionScreen extends PartiallyConstructible {
33
33
  Configuration of the camera permission request's confirmation button.
34
34
  */
35
35
  public enableCameraButton: ButtonConfiguration = new ButtonConfiguration({
36
- text: "{'type': 'String', 'default': 'Grant permission'}",
37
- background: new BackgroundStyle({}),
38
- foreground: new ForegroundStyle({}),
36
+ text: 'Grant permission',
37
+ background: new BackgroundStyle({
38
+ strokeColor: '?sbColorPrimary',
39
+ fillColor: '?sbColorPrimary',
40
+ strokeWidth: 0.0,
41
+ }),
42
+ foreground: new ForegroundStyle({
43
+ iconVisible: false,
44
+ color: '?sbColorOnPrimary',
45
+ useShadow: false,
46
+ }),
39
47
  });
40
48
  /**
41
49
  Configuration of the camera permission request's close button.
42
50
  */
43
51
  public closeButton: ButtonConfiguration = new ButtonConfiguration({
44
52
  text: 'Close',
45
- background: new BackgroundStyle({}),
46
- foreground: new ForegroundStyle({}),
53
+ background: new BackgroundStyle({
54
+ strokeColor: '#00000000',
55
+ fillColor: '#00000000',
56
+ strokeWidth: 0.0,
57
+ }),
58
+ foreground: new ForegroundStyle({
59
+ iconVisible: false,
60
+ color: '?sbColorPrimary',
61
+ useShadow: false,
62
+ }),
47
63
  });
48
64
  /**
49
65
  Configuration of the camera permission request's title.
50
66
  */
51
67
  public enableCameraTitle: StyledText = new StyledText({
52
68
  text: 'Camera permission denied!',
53
- color: '?colorOnSurface',
69
+ color: '?sbColorOnSurface',
54
70
  });
55
71
  /**
56
72
  Configuration of the camera permission request's explanatory text.
@@ -209,6 +209,41 @@ export class IconStyle extends PartiallyConstructible {
209
209
  }
210
210
  }
211
211
 
212
+ /**
213
+ Configuration of the icon appearance.
214
+ */
215
+ export class IconButton extends PartiallyConstructible {
216
+ /**
217
+ Whether the icon is visible on the button.
218
+ Default is true
219
+ */
220
+ public visible: boolean = true;
221
+ /**
222
+ Icon color.
223
+ Default is "#FFFFFF"
224
+ */
225
+ public color: string = '#FFFFFF';
226
+ /**
227
+ The text to be read when button is selected through accessibility mode.
228
+ Default is ""
229
+ */
230
+ public accessibilityDescription: string = '';
231
+
232
+ /** @param source {@displayType `DeepPartial<IconButton>`} */
233
+ public constructor(source: DeepPartial<IconButton> = {}) {
234
+ super();
235
+ if (source.visible !== undefined) {
236
+ this.visible = source.visible;
237
+ }
238
+ if (source.color !== undefined) {
239
+ this.color = source.color;
240
+ }
241
+ if (source.accessibilityDescription !== undefined) {
242
+ this.accessibilityDescription = source.accessibilityDescription;
243
+ }
244
+ }
245
+ }
246
+
212
247
  /**
213
248
  Configuration of the polygon appearance.
214
249
  */
@@ -220,9 +255,9 @@ export class PolygonStyle extends PartiallyConstructible {
220
255
  public strokeColor: string = '#FFFFFFFF';
221
256
  /**
222
257
  Polygon color.
223
- Default is "#30FFFFFF"
258
+ Default is "#FFFFFF30"
224
259
  */
225
- public fillColor: string = '#30FFFFFF';
260
+ public fillColor: string = '#FFFFFF30';
226
261
  /**
227
262
  Width of the polygon outline in dp.
228
263
  Default is 2.0
@@ -349,6 +384,40 @@ export class AspectRatio extends PartiallyConstructible {
349
384
  }
350
385
  }
351
386
 
387
+ /**
388
+ Configuration of the round button.
389
+ */
390
+ export class BadgeStyle extends PartiallyConstructible {
391
+ /**
392
+ Control the visibility of the badge.
393
+ Default is true
394
+ */
395
+ public visible: boolean = true;
396
+ /**
397
+ The style of the button's background.
398
+ */
399
+ public background: BackgroundStyle = new BackgroundStyle({});
400
+ /**
401
+ Color of the button foreground (icon, text).
402
+ Default is "?sbColorOnSurface"
403
+ */
404
+ public foregroundColor: string = '?sbColorOnSurface';
405
+
406
+ /** @param source {@displayType `DeepPartial<BadgeStyle>`} */
407
+ public constructor(source: DeepPartial<BadgeStyle> = {}) {
408
+ super();
409
+ if (source.visible !== undefined) {
410
+ this.visible = source.visible;
411
+ }
412
+ if (source.background !== undefined) {
413
+ this.background = new BackgroundStyle(source.background);
414
+ }
415
+ if (source.foregroundColor !== undefined) {
416
+ this.foregroundColor = source.foregroundColor;
417
+ }
418
+ }
419
+ }
420
+
352
421
  /**
353
422
  Configuration of the round button.
354
423
  */
@@ -358,6 +427,11 @@ export class RoundButton extends PartiallyConstructible {
358
427
  Default is true
359
428
  */
360
429
  public visible: boolean = true;
430
+ /**
431
+ The text to be read when button is selected through accessibility mode.
432
+ Default is ""
433
+ */
434
+ public accessibilityDescription: string = '';
361
435
  /**
362
436
  Color of the button background shape.
363
437
  Default is "#0000007A"
@@ -385,6 +459,9 @@ export class RoundButton extends PartiallyConstructible {
385
459
  if (source.visible !== undefined) {
386
460
  this.visible = source.visible;
387
461
  }
462
+ if (source.accessibilityDescription !== undefined) {
463
+ this.accessibilityDescription = source.accessibilityDescription;
464
+ }
388
465
  if (source.backgroundColor !== undefined) {
389
466
  this.backgroundColor = source.backgroundColor;
390
467
  }
@@ -481,6 +558,11 @@ export class ButtonConfiguration extends PartiallyConstructible {
481
558
  Default is ""
482
559
  */
483
560
  public text: string = '';
561
+ /**
562
+ The text to be read when button is selected through accessibility mode.
563
+ Default is ""
564
+ */
565
+ public accessibilityDescription: string = '';
484
566
  /**
485
567
  The style of the button's background.
486
568
  */
@@ -499,6 +581,9 @@ export class ButtonConfiguration extends PartiallyConstructible {
499
581
  if (source.text !== undefined) {
500
582
  this.text = source.text;
501
583
  }
584
+ if (source.accessibilityDescription !== undefined) {
585
+ this.accessibilityDescription = source.accessibilityDescription;
586
+ }
502
587
  if (source.background !== undefined) {
503
588
  this.background = new BackgroundStyle(source.background);
504
589
  }
@@ -508,6 +593,87 @@ export class ButtonConfiguration extends PartiallyConstructible {
508
593
  }
509
594
  }
510
595
 
596
+ /**
597
+ Button configuration.
598
+ */
599
+ export class PopupMenuItem extends PartiallyConstructible {
600
+ /**
601
+ The text to be displayed on the button.
602
+ */
603
+ public title: StyledText = new StyledText({});
604
+ /**
605
+ The text to be read when button is selected through accessibility mode.
606
+ Default is ""
607
+ */
608
+ public accessibilityDescription: string = '';
609
+ /**
610
+ The style of the button's icon (icon, text).
611
+ */
612
+ public icon: IconStyle = new IconStyle({});
613
+
614
+ /** @param source {@displayType `DeepPartial<PopupMenuItem>`} */
615
+ public constructor(source: DeepPartial<PopupMenuItem> = {}) {
616
+ super();
617
+ if (source.title !== undefined) {
618
+ this.title = new StyledText(source.title);
619
+ }
620
+ if (source.accessibilityDescription !== undefined) {
621
+ this.accessibilityDescription = source.accessibilityDescription;
622
+ }
623
+ if (source.icon !== undefined) {
624
+ this.icon = new IconStyle(source.icon);
625
+ }
626
+ }
627
+ }
628
+
629
+ /**
630
+ Button configuration.
631
+ */
632
+ export class BarButtonConfiguration extends PartiallyConstructible {
633
+ /**
634
+ Whether the button is visible or not.
635
+ Default is true
636
+ */
637
+ public visible: boolean = true;
638
+ /**
639
+ The text to be displayed on the button.
640
+ */
641
+ public title: StyledText = new StyledText({});
642
+ /**
643
+ The text to be read when button is selected through accessibility mode.
644
+ Default is ""
645
+ */
646
+ public accessibilityDescription: string = '';
647
+ /**
648
+ The style of the button's background.
649
+ */
650
+ public background: BackgroundStyle = new BackgroundStyle({});
651
+ /**
652
+ The style of the button's icon (icon, text).
653
+ */
654
+ public icon: IconStyle = new IconStyle({});
655
+
656
+ /** @param source {@displayType `DeepPartial<BarButtonConfiguration>`} */
657
+ public constructor(source: DeepPartial<BarButtonConfiguration> = {}) {
658
+ super();
659
+ if (source.visible !== undefined) {
660
+ this.visible = source.visible;
661
+ }
662
+ if (source.title !== undefined) {
663
+ this.title = new StyledText(source.title);
664
+ }
665
+ if (source.accessibilityDescription !== undefined) {
666
+ this.accessibilityDescription = source.accessibilityDescription;
667
+ }
668
+ if (source.background !== undefined) {
669
+ this.background = new BackgroundStyle(source.background);
670
+ }
671
+ if (source.icon !== undefined) {
672
+ this.icon = new IconStyle(source.icon);
673
+ }
674
+ }
675
+ }
676
+
511
677
  /**
512
678
  Configure the orientation of the interface.
513
679
 
@@ -0,0 +1,13 @@
1
+ import { DeepPartial, PartiallyConstructible } from '../../utils';
2
+
3
+ /**
4
+ Visual mode used for the navigation bar icons. Android only.
5
+
6
+ - `DARK`:
7
+ Display all icons in the navigation bar in black.
8
+ - `LIGHT`:
9
+ Display all icons in the navigation bar in white.
10
+ - `HIDDEN`:
11
+ Hide the navigation bar.
12
+ */
13
+ export type NavigationBarMode = 'DARK' | 'LIGHT' | 'HIDDEN';
@@ -37,11 +37,31 @@ export class ScanbotAlertDialog extends PartiallyConstructible {
37
37
  /**
38
38
  Configuration of the retry button.
39
39
  */
40
- public okButton: ButtonConfiguration;
40
+ public okButton: ButtonConfiguration = new ButtonConfiguration({
41
+ background: new BackgroundStyle({ fillColor: '?sbColorPrimary' }),
42
+ });
43
+ /**
44
+ Configuration of the middle button for dialogs with tree buttons.
45
+ */
46
+ public actionButton: ButtonConfiguration = new ButtonConfiguration({
47
+ visible: false,
48
+ background: new BackgroundStyle({
49
+ strokeColor: '#00000000',
50
+ fillColor: '#00000000',
51
+ strokeWidth: 0.0,
52
+ }),
53
+ });
41
54
  /**
42
55
  Configuration of the cancel button.
43
56
  */
44
- public cancelButton: ButtonConfiguration;
57
+ public cancelButton: ButtonConfiguration = new ButtonConfiguration({
58
+ visible: true,
59
+ background: new BackgroundStyle({
60
+ strokeColor: '#00000000',
61
+ fillColor: '#00000000',
62
+ strokeWidth: 0.0,
63
+ }),
64
+ });
45
65
 
46
66
  /** @param source {@displayType `DeepPartial<ScanbotAlertDialog>`} */
47
67
  public constructor(source: DeepPartial<ScanbotAlertDialog> = {}) {
@@ -63,13 +83,12 @@ export class ScanbotAlertDialog extends PartiallyConstructible {
63
83
  }
64
84
  if (source.okButton !== undefined) {
65
85
  this.okButton = new ButtonConfiguration(source.okButton);
66
- } else {
67
- throw new Error('okButton must be present in constructor argument');
86
+ }
87
+ if (source.actionButton !== undefined) {
88
+ this.actionButton = new ButtonConfiguration(source.actionButton);
68
89
  }
69
90
  if (source.cancelButton !== undefined) {
70
91
  this.cancelButton = new ButtonConfiguration(source.cancelButton);
71
- } else {
72
- throw new Error('cancelButton must be present in constructor argument');
73
92
  }
74
93
  }
75
94
  }
@@ -1,5 +1,6 @@
1
1
  import { BackgroundStyle } from '../common/Common';
2
2
  import { DeepPartial, PartiallyConstructible } from '../../utils';
3
+ import { IconStyle } from '../common/Common';
3
4
  import { StyledText } from '../common/Common';
4
5
 
5
6
  /**
@@ -37,3 +38,43 @@ export class UserGuidanceConfiguration extends PartiallyConstructible {
37
38
  }
38
39
  }
39
40
  }
41
+
42
+ /**
43
+ Configuration of the hint guiding users through the scanning process.
44
+ */
45
+ export class IconUserGuidanceConfiguration extends PartiallyConstructible {
46
+ /**
47
+ Whether the user guidance is visible.
48
+ Default is true
49
+ */
50
+ public visible: boolean = true;
51
+ /**
52
+ Icon of the user guidance.
53
+ */
54
+ public icon: IconStyle = new IconStyle({ color: '?sbColorOnPrimary' });
55
+ /**
56
+ Title of the user guidance.
57
+ */
58
+ public title: StyledText = new StyledText({ color: '?sbColorOnPrimary' });
59
+ /**
60
+ Background style used for the user guidance.
61
+ */
62
+ public background: BackgroundStyle = new BackgroundStyle({ fillColor: '?sbColorSurfaceLow' });
63
+
64
+ /** @param source {@displayType `DeepPartial<IconUserGuidanceConfiguration>`} */
65
+ public constructor(source: DeepPartial<IconUserGuidanceConfiguration> = {}) {
66
+ super();
67
+ if (source.visible !== undefined) {
68
+ this.visible = source.visible;
69
+ }
70
+ if (source.icon !== undefined) {
71
+ this.icon = new IconStyle(source.icon);
72
+ }
73
+ if (source.title !== undefined) {
74
+ this.title = new StyledText(source.title);
75
+ }
76
+ if (source.background !== undefined) {
77
+ this.background = new BackgroundStyle(source.background);
78
+ }
79
+ }
80
+ }
@@ -55,18 +55,13 @@ export function startBarcodeScanner(
55
55
  barcodeItemMapperEventEmitter.addListener(
56
56
  barcodeItemMapperEventName,
57
57
  (barcodeItem: BarcodeItem) => {
58
+ const barcodeItemUuid = `${barcodeItem.textWithExtension}_${barcodeItem.type ?? ''}`;
59
+
58
60
  barcodeItemMapperCallback!(
59
61
  barcodeItem,
60
62
  (barcodeMappedData: BarcodeMappedData) =>
61
- ScanbotBarcodeSDKImpl.onBarcodeItemMapper(
62
- isIOS ? JSON.stringify(barcodeItem) : barcodeItem,
63
- barcodeMappedData
64
- ),
65
- () =>
66
- ScanbotBarcodeSDKImpl.onBarcodeItemMapper(
67
- isIOS ? JSON.stringify(barcodeItem) : barcodeItem,
68
- null
69
- )
63
+ ScanbotBarcodeSDKImpl.onBarcodeItemMapper(barcodeItemUuid, barcodeMappedData),
64
+ () => ScanbotBarcodeSDKImpl.onBarcodeItemMapper(barcodeItemUuid, null)
70
65
  );
71
66
  }
72
67
  );
@@ -115,6 +110,7 @@ export * from './common/ActionBarConfiguration';
115
110
  export * from './common/CameraConfiguration';
116
111
  export * from './common/CameraPermission';
117
112
  export * from './common/Common';
113
+ export * from './common/NavigationBarConfiguration';
118
114
  export * from './common/ScanbotAlertDialog';
119
115
  export * from './common/TopBarConfiguration';
120
116
  export * from './common/UserGuidanceConfiguration';