@exige/web-scanner-sdk 0.2.28 → 0.2.30

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/README.md CHANGED
@@ -215,7 +215,7 @@ await setLicenseKey(licenseKey)
215
215
  </ScannerProvider>
216
216
  ```
217
217
 
218
- `useScanner()` reads the session inside the provider. `useScannerRef()` gives the parent an imperative handle, passed as `apiRef`, the same idea as MUI's `useGridApiRef`. The camera covers the viewport, respects safe areas, shows finder/permission/error states, and keeps the existing auto-capture policies. On Android, `captureMode="auto"` skips the live preview and opens the system Camera app as soon as `open` becomes true from a user gesture; DocAligner then finds the most prominent document on that JPEG. A miss stays on screen with **Try again**. iOS keeps the live overlay and auto-capture. The live path requests an ideal 4K rear-camera stream (no 1080×1920 Android cap), shows that stream in the preview, and continuously mirrors the last non-black frame. Outside WebKit, live capture uses `ImageCapture.takePhoto()` at max photo size and keeps the still even when its aspect differs from the preview; a still longer than 4096px is scaled with high-quality smoothing. WebKit `takePhoto()` returns black stills, so iOS copies the live preview or the mirrored frame. A genuinely blank capture fails loudly instead of exporting black pixels. Finder analysis stays on a 520–1600 working copy. Render `ScannerDiagnostics` for a live diagnostics panel with engine/browser, video and track state, luminance, and the chosen capture path; **Copy report** pastes a shutter-time dump for support. Pass `theme` to `ScannerFrame` to recolor the camera. `primaryColorHex` replaces the yellowish-green accents (`#c8ff45`). `seekingColorHex` and `detectingColorHex` are the waiting box colors (both `#ef6a5b` unless set apart), `unstableColorHex` is `#ffbe40`, `readyColorHex` is `#8af25a`, and `capturedColorHex` is `#ffffff`. Omit `theme` or any field to keep that default. The [React camera guide](site/guide/react-camera-overlay.md#theme) lists what each field paints. The demo source screen chooses Default, Ocean, Violet, or Signal before the camera starts and passes that palette as `theme` on `ScannerFrame`. Capture results include the displayed quad and its bounded-analysis dimensions; use `mapDocumentCornersToFrame()` plus `cropDocument()` so the final crop matches what was on screen. The framework-free imperative APIs remain available from the root package.
218
+ `useScanner()` reads the session inside the provider. `useScannerRef()` gives the parent an imperative handle, passed as `apiRef`, the same idea as MUI's `useGridApiRef`. The camera covers the viewport, respects safe areas, shows finder/permission/error states, and keeps the existing auto-capture policies. On Android, `captureMode="auto"` skips the live preview and opens the system Camera app as soon as `open` becomes true from a user gesture; DocAligner then finds the most prominent document on that JPEG. A miss stays on screen with **Try again**. iOS keeps the live overlay and auto-capture. `useCase="drivers-license"` captures the front, then the back, and returns AAMVA fields from the PDF417 barcode (`onDriverLicense`). It does not call `onCapture`. See [Driver’s license](site/guide/drivers-license.md). The live path requests an ideal 4K rear-camera stream (no 1080×1920 Android cap), shows that stream in the preview, and continuously mirrors the last non-black frame. Outside WebKit, live capture uses `ImageCapture.takePhoto()` at max photo size and keeps the still even when its aspect differs from the preview; a still longer than 4096px is scaled with high-quality smoothing. WebKit `takePhoto()` returns black stills, so iOS copies the live preview or the mirrored frame. A genuinely blank capture fails loudly instead of exporting black pixels. Finder analysis stays on a 520–1600 working copy. Render `ScannerDiagnostics` for a live diagnostics panel with engine/browser, video and track state, luminance, and the chosen capture path; **Copy report** pastes a shutter-time dump for support. Pass `theme` to `ScannerFrame` to recolor the camera. `primaryColorHex` replaces the yellowish-green accents (`#c8ff45`). `seekingColorHex` and `detectingColorHex` are the waiting box colors (both `#ef6a5b` unless set apart), `unstableColorHex` is `#ffbe40`, `readyColorHex` is `#8af25a`, and `capturedColorHex` is `#ffffff`. Omit `theme` or any field to keep that default. The [React camera guide](site/guide/react-camera-overlay.md#theme) lists what each field paints. The demo source screen chooses Default, Ocean, Violet, or Signal before the camera starts and passes that palette as `theme` on `ScannerFrame`. Capture results include the displayed quad and its bounded-analysis dimensions; use `mapDocumentCornersToFrame()` plus `cropDocument()` so the final crop matches what was on screen. The framework-free imperative APIs remain available from the root package.
219
219
 
220
220
  ## Run the demo
221
221
 
@@ -224,7 +224,7 @@ npm install
224
224
  npm run dev
225
225
  ```
226
226
 
227
- Open [http://localhost:43127](http://localhost:43127). Upload a PNG/JPEG/WebP or use a mobile camera, then detect and crop, run OCR, inspect detection suggestions, apply developer redaction rules, and export the result. There is no draw-your-own box tool.
227
+ Open [http://localhost:43127](http://localhost:43127). Upload a PNG/JPEG/WebP or use a mobile camera, then detect and crop, run OCR, inspect detection suggestions, apply developer redaction rules, and export the result. There is no draw-your-own box tool. **Driver’s license** runs the two-sided AAMVA flow and prints jurisdiction, expiration, and the rest of the fields.
228
228
 
229
229
  ```bash
230
230
  npm test
@@ -238,7 +238,7 @@ The repository produces two independent bundles from the same source. The demo i
238
238
 
239
239
  | Command | Config | Output | Purpose |
240
240
  |---|---|---|---|
241
- | `npm run build:lib` | `vite.config.ts` | `dist/` | Vite library mode: ESM bundle `dist/scanner-sdk.js` plus `.d.ts` declarations. `tesseract.js` and `onnxruntime-web` stay external. The package copies the Tesseract worker, the three LSTM cores, English traineddata, and the ONNX Runtime JSEP wasm into `dist/assets/`. Those bytes are not inside `scanner-sdk.js`. ONNX model weights are not copied into `dist/`. This is what `files`, `exports`, and npm publish use. |
241
+ | `npm run build:lib` | `vite.config.ts` | `dist/` | Vite library mode: ESM bundle `dist/scanner-sdk.js` plus `.d.ts` declarations. `tesseract.js`, `onnxruntime-web`, and `zxing-wasm` stay external. The package copies the Tesseract worker, the three LSTM cores, English traineddata, the ONNX Runtime JSEP wasm, and `zxing_reader.wasm` into `dist/assets/`. Those bytes are not inside `scanner-sdk.js`. ONNX model weights are not copied into `dist/`. This is what `files`, `exports`, and npm publish use. |
242
242
  | `npm run build:demo` | `vite.config.app.ts` | `dist-demo/` | Standard Vite application build: real `index.html`, hashed JS/CSS assets, and `public/` files. This is what static hosting serves. |
243
243
  | `npm run build` | both | `dist/` and `dist-demo/` | Convenience wrapper that runs the library build then the demo build. |
244
244
 
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2023 Ze-Zheng Wu
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,4 @@
1
+ zxing-wasm (MIT) wraps ZXing-C++ compiled to WebAssembly.
2
+
3
+ ZXing-C++ is licensed under Apache License 2.0.
4
+ https://github.com/zxing-cpp/zxing-cpp
Binary file
@@ -7,5 +7,6 @@
7
7
  "tesseractCoreLstm": "./assets/tesseract/tesseract-core-lstm.wasm.js",
8
8
  "tesseractCoreSimdLstm": "./assets/tesseract/tesseract-core-simd-lstm.wasm.js",
9
9
  "tesseractCoreRelaxedSimdLstm": "./assets/tesseract/tesseract-core-relaxedsimd-lstm.wasm.js",
10
- "engTraineddata": "./assets/tesseract/eng.traineddata.gz"
10
+ "engTraineddata": "./assets/tesseract/eng.traineddata.gz",
11
+ "zxingReaderWasm": "./assets/zxing_reader.wasm"
11
12
  }