@microblink/blinkid-ux-manager 7.4.3 → 7.6.0
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 +142 -0
- package/dist/blinkid-ux-manager.js +1874 -1270
- package/package.json +3 -3
- package/types/core/BlinkIdProcessingError.d.ts +1 -1
- package/types/core/BlinkIdProcessingError.d.ts.map +1 -1
- package/types/core/BlinkIdUxManager.d.ts +29 -2
- package/types/core/BlinkIdUxManager.d.ts.map +1 -1
- package/types/core/HapticFeedback.d.ts +57 -0
- package/types/core/HapticFeedback.d.ts.map +1 -0
- package/types/core/HapticFeedback.test.d.ts +5 -0
- package/types/core/HapticFeedback.test.d.ts.map +1 -0
- package/types/core/blinkid-ui-state.d.ts +7 -5
- package/types/core/blinkid-ui-state.d.ts.map +1 -1
- package/types/core/ping-camera-utils.d.ts +16 -0
- package/types/core/ping-camera-utils.d.ts.map +1 -0
- package/types/index.d.ts +1 -0
- package/types/index.d.ts.map +1 -1
- package/types/index.rollup.d.ts +139 -44
- package/types/shared/ping-implementations.d.ts +60 -0
- package/types/shared/ping-implementations.d.ts.map +1 -0
- package/types/shared/uiEventFeedbackMapper.d.ts +7 -0
- package/types/shared/uiEventFeedbackMapper.d.ts.map +1 -0
- package/types/ui/BlinkIdFeedbackUi.d.ts.map +1 -1
- package/types/ui/BlinkIdUiStoreContext.d.ts +6 -6
- package/types/ui/BlinkIdUiStoreContext.d.ts.map +1 -1
- package/types/ui/UiFeedbackOverlay.d.ts.map +1 -1
- package/types/ui/createBlinkIdFeedbackUi.d.ts +7 -1
- package/types/ui/createBlinkIdFeedbackUi.d.ts.map +1 -1
- package/types/ui/dialogs/HelpModal.d.ts.map +1 -1
- package/types/ui/dialogs/OnboardingGuideModal.d.ts.map +1 -1
- package/types/ui/feedbackMessages.d.ts.map +1 -1
- package/types/ui/locales/ak.d.ts +55 -0
- package/types/ui/locales/ak.d.ts.map +1 -0
- package/types/ui/locales/am.d.ts +55 -0
- package/types/ui/locales/am.d.ts.map +1 -0
- package/types/ui/locales/ar.d.ts +55 -0
- package/types/ui/locales/ar.d.ts.map +1 -0
- package/types/ui/locales/bn.d.ts +55 -0
- package/types/ui/locales/bn.d.ts.map +1 -0
- package/types/ui/locales/cs.d.ts +55 -0
- package/types/ui/locales/cs.d.ts.map +1 -0
- package/types/ui/locales/da.d.ts +55 -0
- package/types/ui/locales/da.d.ts.map +1 -0
- package/types/ui/locales/de.d.ts +55 -0
- package/types/ui/locales/de.d.ts.map +1 -0
- package/types/ui/locales/el.d.ts +55 -0
- package/types/ui/locales/el.d.ts.map +1 -0
- package/types/ui/locales/en.d.ts +40 -39
- package/types/ui/locales/en.d.ts.map +1 -1
- package/types/ui/locales/en_GB.d.ts +55 -0
- package/types/ui/locales/en_GB.d.ts.map +1 -0
- package/types/ui/locales/es.d.ts +55 -0
- package/types/ui/locales/es.d.ts.map +1 -0
- package/types/ui/locales/es_MX.d.ts +55 -0
- package/types/ui/locales/es_MX.d.ts.map +1 -0
- package/types/ui/locales/fa-latn.d.ts +55 -0
- package/types/ui/locales/fa-latn.d.ts.map +1 -0
- package/types/ui/locales/fi.d.ts +55 -0
- package/types/ui/locales/fi.d.ts.map +1 -0
- package/types/ui/locales/fil.d.ts +55 -0
- package/types/ui/locales/fil.d.ts.map +1 -0
- package/types/ui/locales/fr.d.ts +55 -0
- package/types/ui/locales/fr.d.ts.map +1 -0
- package/types/ui/locales/fr_CA.d.ts +55 -0
- package/types/ui/locales/fr_CA.d.ts.map +1 -0
- package/types/ui/locales/ha.d.ts +55 -0
- package/types/ui/locales/ha.d.ts.map +1 -0
- package/types/ui/locales/he.d.ts +55 -0
- package/types/ui/locales/he.d.ts.map +1 -0
- package/types/ui/locales/hi.d.ts +55 -0
- package/types/ui/locales/hi.d.ts.map +1 -0
- package/types/ui/locales/hr.d.ts +55 -0
- package/types/ui/locales/hr.d.ts.map +1 -0
- package/types/ui/locales/hu.d.ts +55 -0
- package/types/ui/locales/hu.d.ts.map +1 -0
- package/types/ui/locales/id.d.ts +55 -0
- package/types/ui/locales/id.d.ts.map +1 -0
- package/types/ui/locales/index.d.ts +60 -0
- package/types/ui/locales/index.d.ts.map +1 -0
- package/types/ui/locales/is.d.ts +55 -0
- package/types/ui/locales/is.d.ts.map +1 -0
- package/types/ui/locales/it.d.ts +55 -0
- package/types/ui/locales/it.d.ts.map +1 -0
- package/types/ui/locales/ja.d.ts +55 -0
- package/types/ui/locales/ja.d.ts.map +1 -0
- package/types/ui/locales/ka_GE.d.ts +55 -0
- package/types/ui/locales/ka_GE.d.ts.map +1 -0
- package/types/ui/locales/kk.d.ts +55 -0
- package/types/ui/locales/kk.d.ts.map +1 -0
- package/types/ui/locales/km_KH.d.ts +55 -0
- package/types/ui/locales/km_KH.d.ts.map +1 -0
- package/types/ui/locales/ko.d.ts +55 -0
- package/types/ui/locales/ko.d.ts.map +1 -0
- package/types/ui/locales/lv.d.ts +55 -0
- package/types/ui/locales/lv.d.ts.map +1 -0
- package/types/ui/locales/ms.d.ts +55 -0
- package/types/ui/locales/ms.d.ts.map +1 -0
- package/types/ui/locales/ne.d.ts +55 -0
- package/types/ui/locales/ne.d.ts.map +1 -0
- package/types/ui/locales/nl.d.ts +55 -0
- package/types/ui/locales/nl.d.ts.map +1 -0
- package/types/ui/locales/no.d.ts +55 -0
- package/types/ui/locales/no.d.ts.map +1 -0
- package/types/ui/locales/pl.d.ts +55 -0
- package/types/ui/locales/pl.d.ts.map +1 -0
- package/types/ui/locales/ps_AF.d.ts +55 -0
- package/types/ui/locales/ps_AF.d.ts.map +1 -0
- package/types/ui/locales/pt.d.ts +55 -0
- package/types/ui/locales/pt.d.ts.map +1 -0
- package/types/ui/locales/pt_BR.d.ts +55 -0
- package/types/ui/locales/pt_BR.d.ts.map +1 -0
- package/types/ui/locales/ro.d.ts +55 -0
- package/types/ui/locales/ro.d.ts.map +1 -0
- package/types/ui/locales/ru.d.ts +55 -0
- package/types/ui/locales/ru.d.ts.map +1 -0
- package/types/ui/locales/si.d.ts +55 -0
- package/types/ui/locales/si.d.ts.map +1 -0
- package/types/ui/locales/sk.d.ts +55 -0
- package/types/ui/locales/sk.d.ts.map +1 -0
- package/types/ui/locales/sl.d.ts +55 -0
- package/types/ui/locales/sl.d.ts.map +1 -0
- package/types/ui/locales/sr.d.ts +55 -0
- package/types/ui/locales/sr.d.ts.map +1 -0
- package/types/ui/locales/sv.d.ts +55 -0
- package/types/ui/locales/sv.d.ts.map +1 -0
- package/types/ui/locales/sw.d.ts +55 -0
- package/types/ui/locales/sw.d.ts.map +1 -0
- package/types/ui/locales/th.d.ts +55 -0
- package/types/ui/locales/th.d.ts.map +1 -0
- package/types/ui/locales/tr.d.ts +55 -0
- package/types/ui/locales/tr.d.ts.map +1 -0
- package/types/ui/locales/uk.d.ts +55 -0
- package/types/ui/locales/uk.d.ts.map +1 -0
- package/types/ui/locales/ur.d.ts +55 -0
- package/types/ui/locales/ur.d.ts.map +1 -0
- package/types/ui/locales/uz.d.ts +55 -0
- package/types/ui/locales/uz.d.ts.map +1 -0
- package/types/ui/locales/vi.d.ts +55 -0
- package/types/ui/locales/vi.d.ts.map +1 -0
- package/types/ui/locales/yo.d.ts +55 -0
- package/types/ui/locales/yo.d.ts.map +1 -0
- package/types/ui/locales/zh_CN.d.ts +55 -0
- package/types/ui/locales/zh_CN.d.ts.map +1 -0
- package/types/ui/locales/zh_TW.d.ts +55 -0
- package/types/ui/locales/zh_TW.d.ts.map +1 -0
package/README.md
CHANGED
|
@@ -2,10 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
This package provides user experience management and feedback UI for the BlinkID browser SDK. It parses results from [`@microblink/blinkid-core`](https://www.npmjs.com/package/@microblink/blinkid-core) and guides the user through the scanning process, controlling [`@microblink/camera-manager`](https://www.npmjs.com/package/@microblink/camera-manager) as needed.
|
|
4
4
|
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **Smart UI State Management:** Provides both headless and UI components for user feedback during scanning
|
|
8
|
+
- **Camera Integration:** Integrates with BlinkID Core and Camera Manager
|
|
9
|
+
- **Haptic Feedback:** Built-in haptic feedback support for enhanced user experience on mobile devices
|
|
10
|
+
- **Document Filtering:** Advanced document class filtering capabilities
|
|
11
|
+
- **Timeout Management:** Configurable scanning timeouts with automatic state management
|
|
12
|
+
- **Localization Support:** Multi-language support with customizable strings
|
|
13
|
+
|
|
5
14
|
## Overview
|
|
6
15
|
|
|
7
16
|
- Provides both headless and UI components for user feedback during scanning.
|
|
8
17
|
- Integrates with BlinkID Core and Camera Manager.
|
|
18
|
+
- Includes haptic feedback system for mobile devices.
|
|
9
19
|
- Used by [`@microblink/blinkid`](https://www.npmjs.com/package/@microblink/blinkid) and can be used directly for custom UI integrations.
|
|
10
20
|
|
|
11
21
|
## Installation
|
|
@@ -20,6 +30,52 @@ yarn add @microblink/blinkid-ux-manager
|
|
|
20
30
|
pnpm add @microblink/blinkid-ux-manager
|
|
21
31
|
```
|
|
22
32
|
|
|
33
|
+
## Haptic Feedback
|
|
34
|
+
|
|
35
|
+
The UX Manager includes a comprehensive haptic feedback system that provides tactile responses during the document scanning process. **This feature is primarily designed for Android devices using Chrome browser**, where it works reliably to enhance the scanning experience.
|
|
36
|
+
|
|
37
|
+
### Haptic Feedback Types
|
|
38
|
+
|
|
39
|
+
| Event | Duration | Type | Description |
|
|
40
|
+
| ------------------ | -------- | ----- | --------------------------------------------- |
|
|
41
|
+
| First Side Success | 100ms | Short | When the first side of an ID card is captured |
|
|
42
|
+
| Final Success | 300ms | Long | When document scanning is completed |
|
|
43
|
+
| Error States | 100ms | Short | Quality issues (blur, glare, positioning) |
|
|
44
|
+
| Error Dialogs | 300ms | Long | Timeout or critical errors |
|
|
45
|
+
| Flashlight Toggle | 100ms | Short | When camera flashlight is activated |
|
|
46
|
+
| Warning States | 100ms | Short | During sensing phases (with 1s cooldown) |
|
|
47
|
+
|
|
48
|
+
### Haptic Feedback Usage
|
|
49
|
+
|
|
50
|
+
```javascript
|
|
51
|
+
import {
|
|
52
|
+
BlinkIdUxManager,
|
|
53
|
+
HapticFeedbackManager,
|
|
54
|
+
} from "@microblink/blinkid-ux-manager";
|
|
55
|
+
|
|
56
|
+
// Create UX Manager (haptic feedback enabled by default)
|
|
57
|
+
const uxManager = new BlinkIdUxManager(cameraManager, scanningSession);
|
|
58
|
+
|
|
59
|
+
// Check if haptic feedback is supported
|
|
60
|
+
if (uxManager.isHapticFeedbackSupported()) {
|
|
61
|
+
console.log("Device supports haptic feedback");
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// Enable/disable haptic feedback
|
|
65
|
+
uxManager.setHapticFeedbackEnabled(true); // Enable
|
|
66
|
+
uxManager.setHapticFeedbackEnabled(false); // Disable
|
|
67
|
+
|
|
68
|
+
// Access haptic manager directly for manual control
|
|
69
|
+
const hapticManager = uxManager.getHapticFeedbackManager();
|
|
70
|
+
hapticManager.triggerShort(); // 100ms vibration for short feedback
|
|
71
|
+
hapticManager.triggerLong(); // 300ms vibration for long feedback
|
|
72
|
+
hapticManager.stop(); // Stop all vibration
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### Browser Compatibility
|
|
76
|
+
|
|
77
|
+
**⚠️ Important:** Haptic feedback uses the [Web Vibration API](https://developer.mozilla.org/en-US/docs/Web/API/Vibration_API), which has **limited browser support**:
|
|
78
|
+
|
|
23
79
|
## Usage
|
|
24
80
|
|
|
25
81
|
You can use `@microblink/blinkid-ux-manager` directly in your project for advanced or custom integrations. For most use cases, use [`@microblink/blinkid`](https://www.npmjs.com/package/@microblink/blinkid) for a simpler setup.
|
|
@@ -42,4 +98,90 @@ To build the package locally:
|
|
|
42
98
|
pnpm build
|
|
43
99
|
```
|
|
44
100
|
|
|
101
|
+
3. Run tests:
|
|
102
|
+
|
|
103
|
+
```sh
|
|
104
|
+
pnpm test
|
|
105
|
+
```
|
|
106
|
+
|
|
45
107
|
The output files will be available in the `dist/` and `types/` directories.
|
|
108
|
+
|
|
109
|
+
### Internationalization
|
|
110
|
+
|
|
111
|
+
You can customize UI strings when creating the feedback UI:
|
|
112
|
+
|
|
113
|
+
```
|
|
114
|
+
createBlinkIdFeedbackUi(uxManager, cameraUi, {
|
|
115
|
+
localizationStrings: {
|
|
116
|
+
scan_the_barcode: "Please scan the barcode"
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
#### Provided Translations
|
|
122
|
+
|
|
123
|
+
<details>
|
|
124
|
+
<summary>Click to see all available translation files</summary>
|
|
125
|
+
|
|
126
|
+
- [ak.ts](src/ui/locales/ak.ts)
|
|
127
|
+
- [am.ts](src/ui/locales/am.ts)
|
|
128
|
+
- [ar.ts](src/ui/locales/ar.ts)
|
|
129
|
+
- [bn.ts](src/ui/locales/bn.ts)
|
|
130
|
+
- [cs.ts](src/ui/locales/cs.ts)
|
|
131
|
+
- [da.ts](src/ui/locales/da.ts)
|
|
132
|
+
- [de.ts](src/ui/locales/de.ts)
|
|
133
|
+
- [el.ts](src/ui/locales/el.ts)
|
|
134
|
+
- [en.ts](src/ui/locales/en.ts)
|
|
135
|
+
- [en_GB.ts](src/ui/locales/en_GB.ts)
|
|
136
|
+
- [es.ts](src/ui/locales/es.ts)
|
|
137
|
+
- [es_MX.ts](src/ui/locales/es_MX.ts)
|
|
138
|
+
- [fa-latn.ts](src/ui/locales/fa-latn.ts)
|
|
139
|
+
- [fi.ts](src/ui/locales/fi.ts)
|
|
140
|
+
- [fil.ts](src/ui/locales/fil.ts)
|
|
141
|
+
- [fr.ts](src/ui/locales/fr.ts)
|
|
142
|
+
- [fr_CA.ts](src/ui/locales/fr_CA.ts)
|
|
143
|
+
- [ha.ts](src/ui/locales/ha.ts)
|
|
144
|
+
- [he.ts](src/ui/locales/he.ts)
|
|
145
|
+
- [hi.ts](src/ui/locales/hi.ts)
|
|
146
|
+
- [hr.ts](src/ui/locales/hr.ts)
|
|
147
|
+
- [hu.ts](src/ui/locales/hu.ts)
|
|
148
|
+
- [id.ts](src/ui/locales/id.ts)
|
|
149
|
+
- [is.ts](src/ui/locales/is.ts)
|
|
150
|
+
- [it.ts](src/ui/locales/it.ts)
|
|
151
|
+
- [ja.ts](src/ui/locales/ja.ts)
|
|
152
|
+
- [ka_GE.ts](src/ui/locales/ka_GE.ts)
|
|
153
|
+
- [kk.ts](src/ui/locales/kk.ts)
|
|
154
|
+
- [km_KH.ts](src/ui/locales/km_KH.ts)
|
|
155
|
+
- [ko.ts](src/ui/locales/ko.ts)
|
|
156
|
+
- [lv.ts](src/ui/locales/lv.ts)
|
|
157
|
+
- [ms.ts](src/ui/locales/ms.ts)
|
|
158
|
+
- [ne.ts](src/ui/locales/ne.ts)
|
|
159
|
+
- [nl.ts](src/ui/locales/nl.ts)
|
|
160
|
+
- [no.ts](src/ui/locales/no.ts)
|
|
161
|
+
- [pl.ts](src/ui/locales/pl.ts)
|
|
162
|
+
- [ps_AF.ts](src/ui/locales/ps_AF.ts)
|
|
163
|
+
- [pt.ts](src/ui/locales/pt.ts)
|
|
164
|
+
- [pt_BR.ts](src/ui/locales/pt_BR.ts)
|
|
165
|
+
- [ro.ts](src/ui/locales/ro.ts)
|
|
166
|
+
- [ru.ts](src/ui/locales/ru.ts)
|
|
167
|
+
- [si.ts](src/ui/locales/si.ts)
|
|
168
|
+
- [sk.ts](src/ui/locales/sk.ts)
|
|
169
|
+
- [sl.ts](src/ui/locales/sl.ts)
|
|
170
|
+
- [sr.ts](src/ui/locales/sr.ts)
|
|
171
|
+
- [sv.ts](src/ui/locales/sv.ts)
|
|
172
|
+
- [sw.ts](src/ui/locales/sw.ts)
|
|
173
|
+
- [th.ts](src/ui/locales/th.ts)
|
|
174
|
+
- [tr.ts](src/ui/locales/tr.ts)
|
|
175
|
+
- [uk.ts](src/ui/locales/uk.ts)
|
|
176
|
+
- [ur.ts](src/ui/locales/ur.ts)
|
|
177
|
+
- [uz.ts](src/ui/locales/uz.ts)
|
|
178
|
+
- [vi.ts](src/ui/locales/vi.ts)
|
|
179
|
+
- [yo.ts](src/ui/locales/yo.ts)
|
|
180
|
+
- [zh_CN.ts](src/ui/locales/zh_CN.ts)
|
|
181
|
+
- [zh_TW.ts](src/ui/locales/zh_TW.ts)
|
|
182
|
+
|
|
183
|
+
</details>
|
|
184
|
+
|
|
185
|
+
---
|
|
186
|
+
|
|
187
|
+
You can import any of these files directly or use them as a starting point for your own localization.
|