@mleonard9/vin-scanner 1.5.0 → 1.5.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.
Files changed (64) hide show
  1. package/README.md +19 -2
  2. package/ios/VisionCameraBarcodeScanner.m +2 -23
  3. package/ios/VisionCameraTextRecognition.m +2 -21
  4. package/lib/commonjs/ManualVinInput.js +25 -15
  5. package/lib/commonjs/ManualVinInput.js.map +1 -1
  6. package/lib/commonjs/PendingVinBanner.js +44 -21
  7. package/lib/commonjs/PendingVinBanner.js.map +1 -1
  8. package/lib/commonjs/ScannerChromeOverlay.js +185 -0
  9. package/lib/commonjs/ScannerChromeOverlay.js.map +1 -0
  10. package/lib/commonjs/TextVinPrompt.js +33 -18
  11. package/lib/commonjs/TextVinPrompt.js.map +1 -1
  12. package/lib/commonjs/index.js +11 -3
  13. package/lib/commonjs/index.js.map +1 -1
  14. package/lib/commonjs/scanBarcodes.js +25 -24
  15. package/lib/commonjs/scanBarcodes.js.map +1 -1
  16. package/lib/commonjs/scanText.js +22 -22
  17. package/lib/commonjs/scanText.js.map +1 -1
  18. package/lib/commonjs/useVinScanner.js +15 -4
  19. package/lib/commonjs/useVinScanner.js.map +1 -1
  20. package/lib/commonjs/vinUtils.js +6 -4
  21. package/lib/commonjs/vinUtils.js.map +1 -1
  22. package/lib/module/ManualVinInput.js +25 -15
  23. package/lib/module/ManualVinInput.js.map +1 -1
  24. package/lib/module/PendingVinBanner.js +45 -22
  25. package/lib/module/PendingVinBanner.js.map +1 -1
  26. package/lib/module/ScannerChromeOverlay.js +177 -0
  27. package/lib/module/ScannerChromeOverlay.js.map +1 -0
  28. package/lib/module/TextVinPrompt.js +33 -18
  29. package/lib/module/TextVinPrompt.js.map +1 -1
  30. package/lib/module/index.js +5 -3
  31. package/lib/module/index.js.map +1 -1
  32. package/lib/module/scanBarcodes.js +25 -24
  33. package/lib/module/scanBarcodes.js.map +1 -1
  34. package/lib/module/scanText.js +22 -22
  35. package/lib/module/scanText.js.map +1 -1
  36. package/lib/module/useVinScanner.js +15 -4
  37. package/lib/module/useVinScanner.js.map +1 -1
  38. package/lib/module/vinUtils.js +6 -4
  39. package/lib/module/vinUtils.js.map +1 -1
  40. package/lib/typescript/src/ManualVinInput.d.ts.map +1 -1
  41. package/lib/typescript/src/PendingVinBanner.d.ts +2 -1
  42. package/lib/typescript/src/PendingVinBanner.d.ts.map +1 -1
  43. package/lib/typescript/src/ScannerChromeOverlay.d.ts +19 -0
  44. package/lib/typescript/src/ScannerChromeOverlay.d.ts.map +1 -0
  45. package/lib/typescript/src/TextVinPrompt.d.ts.map +1 -1
  46. package/lib/typescript/src/index.d.ts +1 -0
  47. package/lib/typescript/src/index.d.ts.map +1 -1
  48. package/lib/typescript/src/scanBarcodes.d.ts.map +1 -1
  49. package/lib/typescript/src/scanText.d.ts.map +1 -1
  50. package/lib/typescript/src/types.d.ts +8 -2
  51. package/lib/typescript/src/types.d.ts.map +1 -1
  52. package/lib/typescript/src/useVinScanner.d.ts.map +1 -1
  53. package/lib/typescript/src/vinUtils.d.ts.map +1 -1
  54. package/package.json +1 -1
  55. package/src/ManualVinInput.tsx +22 -15
  56. package/src/PendingVinBanner.tsx +66 -27
  57. package/src/ScannerChromeOverlay.tsx +214 -0
  58. package/src/TextVinPrompt.tsx +31 -16
  59. package/src/index.tsx +6 -2
  60. package/src/scanBarcodes.ts +46 -40
  61. package/src/scanText.ts +34 -45
  62. package/src/types.ts +8 -2
  63. package/src/useVinScanner.ts +20 -4
  64. package/src/vinUtils.ts +5 -1
package/src/vinUtils.ts CHANGED
@@ -66,6 +66,7 @@ const DEFAULT_RESOLVED_OPTIONS: ResolvedVinScannerOptions = {
66
66
  text: {
67
67
  enabled: true,
68
68
  language: 'latin',
69
+ validationPattern: '[A-Z0-9]{10,}',
69
70
  requireConfirmation: false,
70
71
  pendingTtlMs: 5000,
71
72
  },
@@ -76,7 +77,7 @@ const DEFAULT_RESOLVED_OPTIONS: ResolvedVinScannerOptions = {
76
77
  scanRegion: { x: 0.15, y: 0.15, width: 0.7, height: 0.7 },
77
78
  minLuma: 30,
78
79
  minSharpness: 12,
79
- minConfidence: 0.6,
80
+ minConfidence: 0,
80
81
  barcodeFallbackAfter: 45,
81
82
  },
82
83
  showOverlay: false,
@@ -111,6 +112,9 @@ export const resolveOptions = (
111
112
  enabled: options?.text?.enabled ?? DEFAULT_RESOLVED_OPTIONS.text.enabled,
112
113
  language:
113
114
  options?.text?.language ?? DEFAULT_RESOLVED_OPTIONS.text.language,
115
+ validationPattern:
116
+ options?.text?.validationPattern ??
117
+ DEFAULT_RESOLVED_OPTIONS.text.validationPattern,
114
118
  requireConfirmation:
115
119
  options?.text?.requireConfirmation ??
116
120
  DEFAULT_RESOLVED_OPTIONS.text.requireConfirmation,