@microblink/blinkid-ux-manager 7.6.4 → 7.7.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 +48 -3
- package/dist/blinkid-ux-manager.js +2702 -2205
- 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 +71 -35
- package/types/core/BlinkIdUxManager.d.ts.map +1 -1
- package/types/core/BlinkIdUxManager.integration.test.d.ts +5 -0
- package/types/core/BlinkIdUxManager.integration.test.d.ts.map +1 -0
- package/types/core/__testdata/blankProcessResult.d.ts +2 -2
- package/types/core/__testdata/blankProcessResult.d.ts.map +1 -1
- package/types/core/__testdata/blinkidTestFixtures.d.ts +20 -0
- package/types/core/__testdata/blinkidTestFixtures.d.ts.map +1 -0
- package/types/core/blinkid-ui-state.d.ts +95 -8
- package/types/core/blinkid-ui-state.d.ts.map +1 -1
- package/types/core/createBlinkIdUxManager.d.ts +23 -0
- package/types/core/createBlinkIdUxManager.d.ts.map +1 -0
- package/types/core/getChainedUiStateKey.d.ts +18 -0
- package/types/core/getChainedUiStateKey.d.ts.map +1 -0
- package/types/core/getChainedUiStateKey.test.d.ts +5 -0
- package/types/core/getChainedUiStateKey.test.d.ts.map +1 -0
- package/types/core/test-helpers.integration.d.ts +65 -0
- package/types/core/test-helpers.integration.d.ts.map +1 -0
- package/types/core/ui-state-utils.d.ts +51 -0
- package/types/core/ui-state-utils.d.ts.map +1 -0
- package/types/core/uxAnalyticsMappers.d.ts +17 -0
- package/types/core/uxAnalyticsMappers.d.ts.map +1 -0
- package/types/index.d.ts +6 -5
- package/types/index.d.ts.map +1 -1
- package/types/index.rollup.d.ts +286 -60
- package/types/ui/BlinkIdFeedbackUi.d.ts.map +1 -1
- package/types/ui/BlinkIdUiStoreContext.d.ts +9 -4
- package/types/ui/BlinkIdUiStoreContext.d.ts.map +1 -1
- package/types/ui/UiFeedbackOverlay.d.ts +1 -0
- package/types/ui/UiFeedbackOverlay.d.ts.map +1 -1
- package/types/ui/createBlinkIdFeedbackUi.d.ts +15 -2
- package/types/ui/createBlinkIdFeedbackUi.d.ts.map +1 -1
- package/types/ui/dialogs/ErrorModal.d.ts.map +1 -1
- package/types/ui/dialogs/HelpModal.d.ts +3 -1
- package/types/ui/dialogs/HelpModal.d.ts.map +1 -1
- package/types/ui/dialogs/OnboardingGuideModal.d.ts +3 -1
- package/types/ui/dialogs/OnboardingGuideModal.d.ts.map +1 -1
- package/types/ui/feedbackMessages.d.ts +1 -1
- package/types/ui/feedbackMessages.d.ts.map +1 -1
- package/types/ui/locales/ak.d.ts +12 -1
- package/types/ui/locales/ak.d.ts.map +1 -1
- package/types/ui/locales/am.d.ts +12 -1
- package/types/ui/locales/am.d.ts.map +1 -1
- package/types/ui/locales/ar.d.ts +12 -1
- package/types/ui/locales/ar.d.ts.map +1 -1
- package/types/ui/locales/bn.d.ts +12 -1
- package/types/ui/locales/bn.d.ts.map +1 -1
- package/types/ui/locales/cs.d.ts +12 -1
- package/types/ui/locales/cs.d.ts.map +1 -1
- package/types/ui/locales/da.d.ts +12 -1
- package/types/ui/locales/da.d.ts.map +1 -1
- package/types/ui/locales/de.d.ts +12 -1
- package/types/ui/locales/de.d.ts.map +1 -1
- package/types/ui/locales/el.d.ts +12 -1
- package/types/ui/locales/el.d.ts.map +1 -1
- package/types/ui/locales/en.d.ts +12 -1
- package/types/ui/locales/en.d.ts.map +1 -1
- package/types/ui/locales/en_GB.d.ts +12 -1
- package/types/ui/locales/en_GB.d.ts.map +1 -1
- package/types/ui/locales/es.d.ts +12 -1
- package/types/ui/locales/es.d.ts.map +1 -1
- package/types/ui/locales/es_MX.d.ts +12 -1
- package/types/ui/locales/es_MX.d.ts.map +1 -1
- package/types/ui/locales/fa-latn.d.ts +12 -1
- package/types/ui/locales/fa-latn.d.ts.map +1 -1
- package/types/ui/locales/fi.d.ts +12 -1
- package/types/ui/locales/fi.d.ts.map +1 -1
- package/types/ui/locales/fil.d.ts +12 -1
- package/types/ui/locales/fil.d.ts.map +1 -1
- package/types/ui/locales/fr.d.ts +12 -1
- package/types/ui/locales/fr.d.ts.map +1 -1
- package/types/ui/locales/fr_CA.d.ts +12 -1
- package/types/ui/locales/fr_CA.d.ts.map +1 -1
- package/types/ui/locales/ha.d.ts +12 -1
- package/types/ui/locales/ha.d.ts.map +1 -1
- package/types/ui/locales/he.d.ts +12 -1
- package/types/ui/locales/he.d.ts.map +1 -1
- package/types/ui/locales/hi.d.ts +12 -1
- package/types/ui/locales/hi.d.ts.map +1 -1
- package/types/ui/locales/hr.d.ts +12 -1
- package/types/ui/locales/hr.d.ts.map +1 -1
- package/types/ui/locales/hu.d.ts +12 -1
- package/types/ui/locales/hu.d.ts.map +1 -1
- package/types/ui/locales/id.d.ts +12 -1
- package/types/ui/locales/id.d.ts.map +1 -1
- package/types/ui/locales/index.d.ts +2 -2
- package/types/ui/locales/index.d.ts.map +1 -1
- package/types/ui/locales/is.d.ts +12 -1
- package/types/ui/locales/is.d.ts.map +1 -1
- package/types/ui/locales/it.d.ts +12 -1
- package/types/ui/locales/it.d.ts.map +1 -1
- package/types/ui/locales/ja.d.ts +12 -1
- package/types/ui/locales/ja.d.ts.map +1 -1
- package/types/ui/locales/ka_GE.d.ts +12 -1
- package/types/ui/locales/ka_GE.d.ts.map +1 -1
- package/types/ui/locales/kk.d.ts +12 -1
- package/types/ui/locales/kk.d.ts.map +1 -1
- package/types/ui/locales/km_KH.d.ts +12 -1
- package/types/ui/locales/km_KH.d.ts.map +1 -1
- package/types/ui/locales/ko.d.ts +12 -1
- package/types/ui/locales/ko.d.ts.map +1 -1
- package/types/ui/locales/lv.d.ts +12 -1
- package/types/ui/locales/lv.d.ts.map +1 -1
- package/types/ui/locales/ms.d.ts +12 -1
- package/types/ui/locales/ms.d.ts.map +1 -1
- package/types/ui/locales/ne.d.ts +12 -1
- package/types/ui/locales/ne.d.ts.map +1 -1
- package/types/ui/locales/nl.d.ts +12 -1
- package/types/ui/locales/nl.d.ts.map +1 -1
- package/types/ui/locales/no.d.ts +12 -1
- package/types/ui/locales/no.d.ts.map +1 -1
- package/types/ui/locales/pl.d.ts +12 -1
- package/types/ui/locales/pl.d.ts.map +1 -1
- package/types/ui/locales/ps_AF.d.ts +12 -1
- package/types/ui/locales/ps_AF.d.ts.map +1 -1
- package/types/ui/locales/pt.d.ts +12 -1
- package/types/ui/locales/pt.d.ts.map +1 -1
- package/types/ui/locales/pt_BR.d.ts +12 -1
- package/types/ui/locales/pt_BR.d.ts.map +1 -1
- package/types/ui/locales/ro.d.ts +12 -1
- package/types/ui/locales/ro.d.ts.map +1 -1
- package/types/ui/locales/ru.d.ts +12 -1
- package/types/ui/locales/ru.d.ts.map +1 -1
- package/types/ui/locales/si.d.ts +12 -1
- package/types/ui/locales/si.d.ts.map +1 -1
- package/types/ui/locales/sk.d.ts +12 -1
- package/types/ui/locales/sk.d.ts.map +1 -1
- package/types/ui/locales/sl.d.ts +12 -1
- package/types/ui/locales/sl.d.ts.map +1 -1
- package/types/ui/locales/sr.d.ts +12 -1
- package/types/ui/locales/sr.d.ts.map +1 -1
- package/types/ui/locales/sv.d.ts +12 -1
- package/types/ui/locales/sv.d.ts.map +1 -1
- package/types/ui/locales/sw.d.ts +12 -1
- package/types/ui/locales/sw.d.ts.map +1 -1
- package/types/ui/locales/th.d.ts +12 -1
- package/types/ui/locales/th.d.ts.map +1 -1
- package/types/ui/locales/tr.d.ts +12 -1
- package/types/ui/locales/tr.d.ts.map +1 -1
- package/types/ui/locales/uk.d.ts +12 -1
- package/types/ui/locales/uk.d.ts.map +1 -1
- package/types/ui/locales/ur.d.ts +12 -1
- package/types/ui/locales/ur.d.ts.map +1 -1
- package/types/ui/locales/uz.d.ts +12 -1
- package/types/ui/locales/uz.d.ts.map +1 -1
- package/types/ui/locales/vi.d.ts +12 -1
- package/types/ui/locales/vi.d.ts.map +1 -1
- package/types/ui/locales/yo.d.ts +12 -1
- package/types/ui/locales/yo.d.ts.map +1 -1
- package/types/ui/locales/zh_CN.d.ts +12 -1
- package/types/ui/locales/zh_CN.d.ts.map +1 -1
- package/types/ui/locales/zh_TW.d.ts +12 -1
- package/types/ui/locales/zh_TW.d.ts.map +1 -1
- package/types/core/ping-camera-utils.d.ts +0 -16
- package/types/core/ping-camera-utils.d.ts.map +0 -1
- package/types/shared/ping-implementations.d.ts +0 -60
- package/types/shared/ping-implementations.d.ts.map +0 -1
- package/types/shared/uiEventFeedbackMapper.d.ts +0 -7
- package/types/shared/uiEventFeedbackMapper.d.ts.map +0 -1
package/README.md
CHANGED
|
@@ -10,6 +10,8 @@ This package provides user experience management and feedback UI for the BlinkID
|
|
|
10
10
|
- **Document Filtering:** Advanced document class filtering capabilities
|
|
11
11
|
- **Timeout Management:** Configurable scanning timeouts with automatic state management
|
|
12
12
|
- **Localization Support:** Multi-language support with customizable strings
|
|
13
|
+
- **Explicit Teardown:** `destroy()` method for deterministic resource cleanup
|
|
14
|
+
- **UI State Inspection:** `uiStateKey` (stabilized, visible state) and `mappedUiStateKey` (latest raw candidate before stabilization) getters
|
|
13
15
|
|
|
14
16
|
## Overview
|
|
15
17
|
|
|
@@ -49,12 +51,12 @@ The UX Manager includes a comprehensive haptic feedback system that provides tac
|
|
|
49
51
|
|
|
50
52
|
```javascript
|
|
51
53
|
import {
|
|
52
|
-
|
|
54
|
+
createBlinkIdUxManager,
|
|
53
55
|
HapticFeedbackManager,
|
|
54
56
|
} from "@microblink/blinkid-ux-manager";
|
|
55
57
|
|
|
56
58
|
// Create UX Manager (haptic feedback enabled by default)
|
|
57
|
-
const uxManager =
|
|
59
|
+
const uxManager = await createBlinkIdUxManager(cameraManager, scanningSession);
|
|
58
60
|
|
|
59
61
|
// Check if haptic feedback is supported
|
|
60
62
|
if (uxManager.isHapticFeedbackSupported()) {
|
|
@@ -76,11 +78,54 @@ hapticManager.stop(); // Stop all vibration
|
|
|
76
78
|
|
|
77
79
|
**⚠️ 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
80
|
|
|
81
|
+
| Browser | Support |
|
|
82
|
+
| ------- | ------- |
|
|
83
|
+
| Chrome for Android | ✅ Supported |
|
|
84
|
+
| Firefox for Android | ✅ Supported |
|
|
85
|
+
| Safari (iOS) | ❌ Not supported |
|
|
86
|
+
| Desktop browsers | ❌ Not supported |
|
|
87
|
+
|
|
88
|
+
The API is designed primarily for **Android devices using Chrome**, where it works reliably. On unsupported platforms `isHapticFeedbackSupported()` returns `false` and vibration calls are silently ignored.
|
|
89
|
+
|
|
79
90
|
## Usage
|
|
80
91
|
|
|
81
92
|
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.
|
|
82
93
|
|
|
83
|
-
|
|
94
|
+
### Creating the UX Manager
|
|
95
|
+
|
|
96
|
+
Use the async `createBlinkIdUxManager` factory — direct constructor instantiation is not supported:
|
|
97
|
+
|
|
98
|
+
```javascript
|
|
99
|
+
import { createBlinkIdUxManager } from "@microblink/blinkid-ux-manager";
|
|
100
|
+
|
|
101
|
+
const uxManager = await createBlinkIdUxManager(cameraManager, scanningSession);
|
|
102
|
+
|
|
103
|
+
// When done, release resources explicitly
|
|
104
|
+
uxManager.destroy();
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### Inspecting UI State
|
|
108
|
+
|
|
109
|
+
Two getters provide visibility into the current UI state:
|
|
110
|
+
|
|
111
|
+
- `uxManager.uiStateKey` — the stabilized, visible state key (what the UI shows)
|
|
112
|
+
- `uxManager.mappedUiStateKey` — the latest raw candidate key from the detector before stabilization (useful for debugging)
|
|
113
|
+
|
|
114
|
+
> **Note:** Starting in v7.7.0, the manager automatically advances through intermediate transition states after `PAGE_CAPTURED` (e.g. `PAGE_CAPTURED → FLIP_CARD → INTRO_BACK_PAGE` for two-sided IDs). Integrations that depend on exact UI-state key sequences should account for these chained transitions.
|
|
115
|
+
|
|
116
|
+
### Configuring Help Tooltip Delays
|
|
117
|
+
|
|
118
|
+
Tooltip delays can be configured via `FeedbackUiOptions` when creating the feedback UI:
|
|
119
|
+
|
|
120
|
+
```javascript
|
|
121
|
+
createBlinkIdFeedbackUi(uxManager, cameraUi, {
|
|
122
|
+
showHelpTooltipTimeout: 15000, // ms before tooltip appears
|
|
123
|
+
});
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
> **Deprecated:** The `setHelpTooltipShowDelay` and `setHelpTooltipHideDelay` methods on `BlinkIdUxManager` are deprecated. Prefer configuring delays through `FeedbackUiOptions` instead.
|
|
127
|
+
|
|
128
|
+
See the example apps in the `apps/examples` directory in the GitHub repository for full usage details.
|
|
84
129
|
|
|
85
130
|
## Development
|
|
86
131
|
|