scandit-react-native-datacapture-id 7.6.0 → 8.0.0-beta.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.
- package/android/build.gradle +1 -1
- package/android/src/main/kotlin/com/scandit/datacapture/reactnative/id/ScanditDataCaptureIdModule.kt +38 -24
- package/android/src/main/kotlin/com/scandit/datacapture/reactnative/id/ScanditDataCaptureIdPackage.kt +1 -2
- package/dist/dts/index.d.ts +3 -2
- package/dist/id.js +585 -467
- package/dist/id.js.map +1 -1
- package/dist/index.js +137 -146
- package/dist/index.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/ios/Sources/ScanditDataCaptureId.m +19 -11
- package/ios/Sources/ScanditDataCaptureId.swift +54 -43
- package/package.json +10 -10
- package/scandit-react-native-datacapture-id.podspec +2 -2
- package/dist/dts/native/IdCaptureListenerProxy.d.ts +0 -14
- package/dist/dts/native/IdCaptureProxy.d.ts +0 -11
package/dist/index.js
CHANGED
|
@@ -1,82 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import React, { forwardRef, useImperativeHandle, useState, useEffect, useRef
|
|
7
|
-
|
|
8
|
-
// tslint:disable:variable-name
|
|
9
|
-
const NativeModule$1 = NativeModules.ScanditDataCaptureId;
|
|
10
|
-
new NativeEventEmitter(NativeModule$1);
|
|
11
|
-
// tslint:enable:variable-name
|
|
12
|
-
class NativeIdCaptureProxy {
|
|
13
|
-
resetMode() {
|
|
14
|
-
return NativeModule$1.reset();
|
|
15
|
-
}
|
|
16
|
-
createContextForBarcodeVerification(contextJSON) {
|
|
17
|
-
return NativeModule$1.createContextForBarcodeVerification(contextJSON);
|
|
18
|
-
}
|
|
19
|
-
verifyCapturedIdAsync(capturedId) {
|
|
20
|
-
return NativeModule$1.verifyCapturedIdAsync(capturedId);
|
|
21
|
-
}
|
|
22
|
-
setModeEnabledState(enabled) {
|
|
23
|
-
NativeModule$1.setModeEnabledState(enabled);
|
|
24
|
-
}
|
|
25
|
-
updateIdCaptureMode(modeJson) {
|
|
26
|
-
return NativeModule$1.updateIdCaptureMode(modeJson);
|
|
27
|
-
}
|
|
28
|
-
applyIdCaptureModeSettings(newSettingsJson) {
|
|
29
|
-
return NativeModule$1.applyIdCaptureModeSettings(newSettingsJson);
|
|
30
|
-
}
|
|
31
|
-
updateFeedback(feedbackJson) {
|
|
32
|
-
return NativeModule$1.updateIdCaptureFeedback(feedbackJson);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
// tslint:disable:variable-name
|
|
37
|
-
const NativeModule = NativeModules.ScanditDataCaptureId;
|
|
38
|
-
const RNEventEmitter = new NativeEventEmitter(NativeModule);
|
|
39
|
-
// tslint:enable:variable-name
|
|
40
|
-
class NativeIdCaptureListenerProxy {
|
|
41
|
-
nativeListeners = [];
|
|
42
|
-
eventEmitter;
|
|
43
|
-
constructor() {
|
|
44
|
-
this.eventEmitter = FactoryMaker.getInstance('EventEmitter');
|
|
45
|
-
}
|
|
46
|
-
isModeEnabled = () => false;
|
|
47
|
-
subscribeDidCaptureListener() {
|
|
48
|
-
const didCaptureListener = RNEventEmitter.addListener(IdCaptureListenerEvents.didCapture, (event) => {
|
|
49
|
-
this.eventEmitter.emit(IdCaptureListenerEvents.didCapture, event.data);
|
|
50
|
-
});
|
|
51
|
-
this.nativeListeners.push(didCaptureListener);
|
|
52
|
-
}
|
|
53
|
-
subscribeDidRejectListener() {
|
|
54
|
-
const didRejectListener = RNEventEmitter.addListener(IdCaptureListenerEvents.didReject, (event) => {
|
|
55
|
-
this.eventEmitter.emit(IdCaptureListenerEvents.didReject, event.data);
|
|
56
|
-
});
|
|
57
|
-
this.nativeListeners.push(didRejectListener);
|
|
58
|
-
}
|
|
59
|
-
unregisterListenerForEvents() {
|
|
60
|
-
this.nativeListeners.forEach(listener => listener.remove());
|
|
61
|
-
this.nativeListeners = [];
|
|
62
|
-
}
|
|
63
|
-
finishDidCaptureCallback(isEnabled) {
|
|
64
|
-
NativeModule.finishDidCaptureCallback(isEnabled);
|
|
65
|
-
}
|
|
66
|
-
finishDidLocalizeCallback(isEnabled) {
|
|
67
|
-
NativeModule.finishDidLocalizeCallback(isEnabled);
|
|
68
|
-
}
|
|
69
|
-
finishDidRejectCallback(isEnabled) {
|
|
70
|
-
NativeModule.finishDidRejectCallback(isEnabled);
|
|
71
|
-
}
|
|
72
|
-
finishDidTimeOutCallback(isEnabled) {
|
|
73
|
-
NativeModule.finishDidTimeOutCallback(isEnabled);
|
|
74
|
-
}
|
|
75
|
-
}
|
|
1
|
+
import { CameraOwnershipHelper, FactoryMaker, createNativeProxy } from 'scandit-react-native-datacapture-core/dist/core';
|
|
2
|
+
import { FrameSourceState, CameraPosition, DataCaptureView, createRNNativeCaller, initCoreDefaults } from 'scandit-react-native-datacapture-core';
|
|
3
|
+
import { NativeModules, AppState } from 'react-native';
|
|
4
|
+
import { IdCapture, IdCaptureSettings, IdCaptureOverlay, loadIdDefaults } from './id.js';
|
|
5
|
+
export { AamvaBarcodeVerificationResult, AamvaBarcodeVerificationStatus, BarcodeResult, CapturedId, CapturedSides, DataConsistencyCheck, DataConsistencyResult, DateResult, DriverLicense, DrivingLicenseCategory, DrivingLicenseDetails, Duration, FullDocumentScanner, HealthInsuranceCard, IdAnonymizationMode, IdCapture, IdCaptureController, IdCaptureDocumentType, IdCaptureFeedback, IdCaptureListenerController, IdCaptureListenerEvents, IdCaptureOverlay, IdCaptureRegion, IdCaptureSettings, IdCard, IdFieldType, IdImageType, IdImages, IdLayoutLineStyle, IdLayoutStyle, IdSide, MRZResult, MobileDocumentResult, Passport, ProfessionalDrivingPermit, RegionSpecific, RegionSpecificSubtype, RejectionReason, ResidencePermit, Sex, SingleSideScanner, TextHintPosition, UsRealIdStatus, VIZResult, VehicleRestriction, VerificationResult, VisaIcao } from './id.js';
|
|
6
|
+
import React, { forwardRef, useImperativeHandle, useState, useMemo, useCallback, useEffect, useRef } from 'react';
|
|
76
7
|
|
|
77
8
|
function initIdProxy() {
|
|
78
|
-
FactoryMaker.
|
|
79
|
-
|
|
9
|
+
FactoryMaker.bindLazyInstance('IdCaptureProxy', () => {
|
|
10
|
+
const caller = createRNNativeCaller(NativeModules.ScanditDataCaptureId);
|
|
11
|
+
return createNativeProxy(caller);
|
|
12
|
+
});
|
|
13
|
+
FactoryMaker.bindLazyInstance('IdCaptureListenerProxy', () => {
|
|
14
|
+
const caller = createRNNativeCaller(NativeModules.ScanditDataCaptureId);
|
|
15
|
+
return createNativeProxy(caller);
|
|
16
|
+
});
|
|
80
17
|
FactoryMaker.bindLazyInstance('IdCaptureOverlayProxy', () => {
|
|
81
18
|
const caller = createRNNativeCaller(NativeModules.ScanditDataCaptureId);
|
|
82
19
|
return createNativeProxy(caller);
|
|
@@ -95,49 +32,48 @@ const IdCaptureView = forwardRef(function IdCaptureView(props, ref) {
|
|
|
95
32
|
reset() {
|
|
96
33
|
getMode().reset();
|
|
97
34
|
},
|
|
98
|
-
}),
|
|
35
|
+
}),
|
|
36
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
37
|
+
[]);
|
|
99
38
|
/* STATE VARIABLES */
|
|
100
39
|
const [isEnabledState, setIsEnabledState] = useState(false);
|
|
101
40
|
const [frameSourceState, setFrameSourceState] = useState(FrameSourceState.Off);
|
|
41
|
+
const [viewId] = useState(() => Math.floor(Math.random() * 1000000));
|
|
42
|
+
const [isCameraSetup, setIsCameraSetup] = useState(false);
|
|
43
|
+
// Create camera owner using viewId
|
|
44
|
+
const cameraOwner = useMemo(() => ({
|
|
45
|
+
id: `id-capture-view-${viewId}`,
|
|
46
|
+
}), [viewId]);
|
|
102
47
|
/* STATE HANDLERS */
|
|
48
|
+
const getMode = useCallback(() => {
|
|
49
|
+
if (idCaptureModeRef.current !== null) {
|
|
50
|
+
return idCaptureModeRef.current;
|
|
51
|
+
}
|
|
52
|
+
idCaptureModeRef.current = new IdCapture(props.idCaptureSettings || new IdCaptureSettings());
|
|
53
|
+
idCaptureModeRef.current.parentId = viewId;
|
|
54
|
+
return idCaptureModeRef.current;
|
|
55
|
+
}, [props.idCaptureSettings, viewId]);
|
|
103
56
|
useEffect(() => {
|
|
104
57
|
getMode().isEnabled = isEnabledState;
|
|
105
|
-
}, [isEnabledState]);
|
|
58
|
+
}, [isEnabledState, getMode]);
|
|
106
59
|
useEffect(() => {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
60
|
+
const position = props.desiredCameraPosition || CameraPosition.WorldFacing;
|
|
61
|
+
CameraOwnershipHelper.withCamera(position, cameraOwner, async (camera) => {
|
|
62
|
+
await camera.switchToDesiredState(frameSourceState);
|
|
63
|
+
});
|
|
64
|
+
}, [frameSourceState, props.desiredCameraPosition, cameraOwner]);
|
|
111
65
|
const viewRef = useRef(null);
|
|
112
66
|
const componentIsSetUp = useRef(false);
|
|
113
|
-
const viewId = useRef(Math.floor(Math.random() * 1000000));
|
|
114
|
-
const screenStateManager = useMemo(() => {
|
|
115
|
-
return ScreenStateManager.getInstance();
|
|
116
|
-
}, []);
|
|
117
67
|
const idCaptureModeRef = useRef(null);
|
|
118
|
-
function getMode() {
|
|
119
|
-
if (idCaptureModeRef.current !== null) {
|
|
120
|
-
return idCaptureModeRef.current;
|
|
121
|
-
}
|
|
122
|
-
idCaptureModeRef.current = IdCapture.forContext(null, props.idCaptureSettings || new IdCaptureSettings());
|
|
123
|
-
return idCaptureModeRef.current;
|
|
124
|
-
}
|
|
125
68
|
const idCaptureOverlayRef = useRef(null);
|
|
126
|
-
|
|
69
|
+
const getIdCaptureOverlay = useCallback(() => {
|
|
127
70
|
if (idCaptureOverlayRef.current !== null) {
|
|
128
71
|
return idCaptureOverlayRef.current;
|
|
129
72
|
}
|
|
130
73
|
idCaptureOverlayRef.current = new IdCaptureOverlay(getMode());
|
|
131
74
|
return idCaptureOverlayRef.current;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
function getCamera() {
|
|
135
|
-
if (cameraRef.current !== null) {
|
|
136
|
-
return cameraRef.current;
|
|
137
|
-
}
|
|
138
|
-
cameraRef.current = Camera.asPositionWithSettings(props.desiredCameraPosition || CameraPosition.WorldFacing, props.cameraSettings || IdCapture.recommendedCameraSettings);
|
|
139
|
-
return cameraRef.current;
|
|
140
|
-
}
|
|
75
|
+
}, [getMode]);
|
|
76
|
+
// Remove getCamera function as we'll use CameraOwnershipHelper
|
|
141
77
|
const torchSwitchControl = useRef(null);
|
|
142
78
|
const zoomSwitchControl = useRef(null);
|
|
143
79
|
const appState = useRef(AppState.currentState);
|
|
@@ -157,27 +93,49 @@ const IdCaptureView = forwardRef(function IdCaptureView(props, ref) {
|
|
|
157
93
|
});
|
|
158
94
|
return () => {
|
|
159
95
|
subscription.remove();
|
|
160
|
-
|
|
96
|
+
doDestroy();
|
|
161
97
|
};
|
|
98
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
162
99
|
}, []);
|
|
163
|
-
const
|
|
164
|
-
|
|
100
|
+
const setupCamera = useCallback(async () => {
|
|
101
|
+
const position = props.desiredCameraPosition || CameraPosition.WorldFacing;
|
|
102
|
+
// Request ownership and set up camera
|
|
103
|
+
await CameraOwnershipHelper.withCameraWhenAvailable(position, cameraOwner, async (camera) => {
|
|
104
|
+
const settings = props.cameraSettings || IdCapture.createRecommendedCameraSettings();
|
|
105
|
+
await camera.applySettings(settings);
|
|
106
|
+
await props.context.setFrameSource(camera);
|
|
107
|
+
await camera.switchToDesiredState(props.desiredCameraState || FrameSourceState.On);
|
|
108
|
+
// Mark camera as set up
|
|
109
|
+
setIsCameraSetup(true);
|
|
110
|
+
});
|
|
111
|
+
}, [props.desiredCameraPosition, cameraOwner, props.cameraSettings, props.context, props.desiredCameraState]);
|
|
112
|
+
const doSetup = useCallback(() => {
|
|
165
113
|
if (componentIsSetUp.current)
|
|
166
114
|
return;
|
|
167
115
|
componentIsSetUp.current = true;
|
|
168
|
-
/*
|
|
169
|
-
|
|
116
|
+
/* Setup camera with ownership - WAIT for completion */
|
|
117
|
+
setupCamera();
|
|
118
|
+
/* Only proceed after camera is ready */
|
|
170
119
|
props.context.removeAllModes();
|
|
171
120
|
props.context.addMode(getMode());
|
|
172
121
|
/* Adding ID Capture Overlay */
|
|
173
122
|
if (viewRef.current) {
|
|
174
123
|
viewRef.current.addOverlay(getIdCaptureOverlay());
|
|
175
124
|
}
|
|
125
|
+
}, [setupCamera, props.context, getMode, getIdCaptureOverlay]);
|
|
126
|
+
const doDestroy = () => {
|
|
127
|
+
doCleanup();
|
|
128
|
+
idCaptureModeRef.current = null;
|
|
129
|
+
torchSwitchControl.current = null;
|
|
130
|
+
zoomSwitchControl.current = null;
|
|
131
|
+
idCaptureOverlayRef.current = null;
|
|
176
132
|
};
|
|
177
|
-
const doCleanup = () => {
|
|
133
|
+
const doCleanup = useCallback(() => {
|
|
178
134
|
if (!componentIsSetUp.current)
|
|
179
135
|
return;
|
|
180
136
|
componentIsSetUp.current = false;
|
|
137
|
+
// Reset camera setup state
|
|
138
|
+
setIsCameraSetup(false);
|
|
181
139
|
/* Remove the torch control */
|
|
182
140
|
if (torchSwitchControl.current) {
|
|
183
141
|
viewRef.current?.removeControl(torchSwitchControl.current);
|
|
@@ -186,43 +144,61 @@ const IdCaptureView = forwardRef(function IdCaptureView(props, ref) {
|
|
|
186
144
|
if (zoomSwitchControl.current) {
|
|
187
145
|
viewRef.current?.removeControl(zoomSwitchControl.current);
|
|
188
146
|
}
|
|
189
|
-
/* Closing the camera if camera is active */
|
|
190
|
-
if (screenStateManager.isScreenActive(viewId.current)) {
|
|
191
|
-
getCamera()?.switchToDesiredState(FrameSourceState.Off);
|
|
192
|
-
props.context.setFrameSource(null);
|
|
193
|
-
}
|
|
194
147
|
/* Cleaning Data Capture Context */
|
|
195
148
|
if (idCaptureModeRef.current) {
|
|
196
149
|
props.context.removeMode(idCaptureModeRef.current);
|
|
197
150
|
}
|
|
198
|
-
idCaptureModeRef.current = null;
|
|
199
151
|
/* Cleaning Overlays */
|
|
200
152
|
if (viewRef.current) {
|
|
201
153
|
viewRef.current.view?.overlays?.forEach((overlay) => viewRef.current?.view?.removeOverlay(overlay));
|
|
202
154
|
}
|
|
203
|
-
|
|
155
|
+
/* Turn off camera and release ownership */
|
|
156
|
+
const position = props.desiredCameraPosition || CameraPosition.WorldFacing;
|
|
157
|
+
CameraOwnershipHelper.withCamera(position, cameraOwner, async (camera) => {
|
|
158
|
+
await camera.switchToDesiredState(FrameSourceState.Off);
|
|
159
|
+
await props.context.setFrameSource(null);
|
|
160
|
+
}).finally(() => {
|
|
161
|
+
// Release camera ownership
|
|
162
|
+
CameraOwnershipHelper.releaseOwnership(position, cameraOwner);
|
|
163
|
+
});
|
|
164
|
+
}, [props.desiredCameraPosition, cameraOwner, props.context]);
|
|
204
165
|
/* ID CAPTURE MODE */
|
|
205
166
|
useEffect(() => {
|
|
206
167
|
if (props.idCaptureSettings) {
|
|
207
168
|
getMode().applySettings(props.idCaptureSettings);
|
|
208
169
|
}
|
|
209
|
-
}, [props.idCaptureSettings]);
|
|
170
|
+
}, [props.idCaptureSettings, getMode]);
|
|
210
171
|
useEffect(() => {
|
|
211
172
|
setIsEnabledState(props.isEnabled);
|
|
212
173
|
setFrameSourceState(props.desiredCameraState || FrameSourceState.On);
|
|
213
|
-
}, [props.isEnabled]);
|
|
174
|
+
}, [props.isEnabled, props.desiredCameraState]);
|
|
175
|
+
const listenerRef = useRef(null);
|
|
176
|
+
const callbacksRef = useRef({ didCaptureId: props.didCaptureId, didRejectId: props.didRejectId });
|
|
177
|
+
// Update callback references when props change
|
|
214
178
|
useEffect(() => {
|
|
215
|
-
|
|
216
|
-
listeners.forEach((listener) => {
|
|
217
|
-
getMode().removeListener(listener);
|
|
218
|
-
});
|
|
219
|
-
if (props.didCaptureId || props.didRejectId) {
|
|
220
|
-
getMode().addListener({
|
|
221
|
-
didCaptureId: props.didCaptureId,
|
|
222
|
-
didRejectId: props.didRejectId,
|
|
223
|
-
});
|
|
224
|
-
}
|
|
179
|
+
callbacksRef.current = { didCaptureId: props.didCaptureId, didRejectId: props.didRejectId };
|
|
225
180
|
}, [props.didCaptureId, props.didRejectId]);
|
|
181
|
+
// Add/remove listener only when needed
|
|
182
|
+
useEffect(() => {
|
|
183
|
+
const setupListeners = async () => {
|
|
184
|
+
const shouldHaveListener = props.didCaptureId || props.didRejectId;
|
|
185
|
+
const hasListener = listenerRef.current !== null;
|
|
186
|
+
if (shouldHaveListener && !hasListener) {
|
|
187
|
+
// Add listener
|
|
188
|
+
listenerRef.current = {
|
|
189
|
+
didCaptureId: (idCapture, capturedId) => callbacksRef.current.didCaptureId?.(idCapture, capturedId),
|
|
190
|
+
didRejectId: (idCapture, rejectedId, reason) => callbacksRef.current.didRejectId?.(idCapture, rejectedId, reason),
|
|
191
|
+
};
|
|
192
|
+
await getMode().addListener(listenerRef.current);
|
|
193
|
+
}
|
|
194
|
+
else if (!shouldHaveListener && hasListener && listenerRef.current) {
|
|
195
|
+
// Remove listener
|
|
196
|
+
await getMode().removeListener(listenerRef.current);
|
|
197
|
+
listenerRef.current = null;
|
|
198
|
+
}
|
|
199
|
+
};
|
|
200
|
+
setupListeners();
|
|
201
|
+
}, [props.didCaptureId, props.didRejectId, getMode, listenerRef, callbacksRef]);
|
|
226
202
|
/* OVERLAYS */
|
|
227
203
|
useEffect(() => {
|
|
228
204
|
if (props.capturedBrush) {
|
|
@@ -234,33 +210,48 @@ const IdCaptureView = forwardRef(function IdCaptureView(props, ref) {
|
|
|
234
210
|
if (props.localizedBrush) {
|
|
235
211
|
getIdCaptureOverlay().localizedBrush = props.localizedBrush;
|
|
236
212
|
}
|
|
237
|
-
}, [props.capturedBrush, props.rejectedBrush, props.localizedBrush]);
|
|
213
|
+
}, [props.capturedBrush, props.rejectedBrush, props.localizedBrush, getIdCaptureOverlay]);
|
|
238
214
|
/* CAMERA */
|
|
239
215
|
useEffect(() => {
|
|
240
|
-
|
|
241
|
-
|
|
216
|
+
if (!isCameraSetup)
|
|
217
|
+
return; // Don't run until camera is ready
|
|
218
|
+
const position = props.desiredCameraPosition || CameraPosition.WorldFacing;
|
|
219
|
+
const settings = props.cameraSettings || IdCapture.createRecommendedCameraSettings();
|
|
220
|
+
CameraOwnershipHelper.withCamera(position, cameraOwner, async (camera) => {
|
|
221
|
+
await camera.applySettings(settings);
|
|
222
|
+
});
|
|
223
|
+
}, [props.cameraSettings, props.desiredCameraPosition, cameraOwner, isCameraSetup]);
|
|
242
224
|
useEffect(() => {
|
|
243
|
-
if (props.desiredCameraState
|
|
225
|
+
if (props.desiredCameraState) {
|
|
244
226
|
setFrameSourceState(props.desiredCameraState);
|
|
245
227
|
}
|
|
246
228
|
}, [props.desiredCameraState]);
|
|
247
229
|
useEffect(() => {
|
|
248
230
|
if (props.desiredCameraPosition) {
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
231
|
+
// Handle camera position change with ownership
|
|
232
|
+
const currentOwnedPosition = CameraOwnershipHelper.getOwnedPosition(cameraOwner);
|
|
233
|
+
const newPosition = props.desiredCameraPosition;
|
|
234
|
+
if (currentOwnedPosition && currentOwnedPosition !== newPosition) {
|
|
235
|
+
// Release old camera ownership
|
|
236
|
+
CameraOwnershipHelper.releaseOwnership(currentOwnedPosition, cameraOwner);
|
|
237
|
+
// Set up new camera
|
|
238
|
+
setupCamera();
|
|
239
|
+
}
|
|
240
|
+
else if (!currentOwnedPosition) {
|
|
241
|
+
// No camera owned yet, set up new camera
|
|
242
|
+
setupCamera();
|
|
243
|
+
}
|
|
256
244
|
}
|
|
257
|
-
}, [props.desiredCameraPosition]);
|
|
245
|
+
}, [props.desiredCameraPosition, cameraOwner, setupCamera]);
|
|
258
246
|
/* CONTROLS */
|
|
259
247
|
useEffect(() => {
|
|
260
248
|
if (props.desiredTorchState) {
|
|
261
|
-
|
|
249
|
+
const position = props.desiredCameraPosition || CameraPosition.WorldFacing;
|
|
250
|
+
CameraOwnershipHelper.withCameraWhenAvailable(position, cameraOwner, async (camera) => {
|
|
251
|
+
camera.desiredTorchState = props.desiredTorchState;
|
|
252
|
+
});
|
|
262
253
|
}
|
|
263
|
-
}, [props.desiredTorchState]);
|
|
254
|
+
}, [props.desiredTorchState, props.desiredCameraPosition, cameraOwner]);
|
|
264
255
|
useEffect(() => {
|
|
265
256
|
if (!viewRef.current)
|
|
266
257
|
return;
|
|
@@ -288,7 +279,7 @@ const IdCaptureView = forwardRef(function IdCaptureView(props, ref) {
|
|
|
288
279
|
if (props.feedback) {
|
|
289
280
|
getMode().feedback = props.feedback;
|
|
290
281
|
}
|
|
291
|
-
}, [props.feedback]);
|
|
282
|
+
}, [props.feedback, getMode]);
|
|
292
283
|
useEffect(() => {
|
|
293
284
|
if (!props.navigation)
|
|
294
285
|
return;
|
|
@@ -308,8 +299,8 @@ const IdCaptureView = forwardRef(function IdCaptureView(props, ref) {
|
|
|
308
299
|
// tslint:disable-next-line:no-console
|
|
309
300
|
console.error(e);
|
|
310
301
|
}
|
|
311
|
-
}, [props.navigation]);
|
|
312
|
-
return React.createElement(DataCaptureView, { context: props.context, style: { flex: 1 }, ref: viewRef });
|
|
302
|
+
}, [props.navigation, doSetup, doCleanup]);
|
|
303
|
+
return React.createElement(DataCaptureView, { context: props.context, parentId: viewId, style: { flex: 1 }, ref: viewRef });
|
|
313
304
|
});
|
|
314
305
|
|
|
315
306
|
initIdDefaults();
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../ts/native/IdCaptureProxy.ts","../ts/native/IdCaptureListenerProxy.ts","../ts/native/initProxy.ts","../ts/private/initDefaults.ts","../ts/IdCaptureView.tsx","../ts/index.ts"],"sourcesContent":["import { NativeEventEmitter, NativeModules } from 'react-native';\n// tslint:disable:variable-name\nconst NativeModule = NativeModules.ScanditDataCaptureId;\nconst RNEventEmitter = new NativeEventEmitter(NativeModule);\n// tslint:enable:variable-name\nexport class NativeIdCaptureProxy {\n resetMode() {\n return NativeModule.reset();\n }\n createContextForBarcodeVerification(contextJSON) {\n return NativeModule.createContextForBarcodeVerification(contextJSON);\n }\n verifyCapturedIdAsync(capturedId) {\n return NativeModule.verifyCapturedIdAsync(capturedId);\n }\n setModeEnabledState(enabled) {\n NativeModule.setModeEnabledState(enabled);\n }\n updateIdCaptureMode(modeJson) {\n return NativeModule.updateIdCaptureMode(modeJson);\n }\n applyIdCaptureModeSettings(newSettingsJson) {\n return NativeModule.applyIdCaptureModeSettings(newSettingsJson);\n }\n updateFeedback(feedbackJson) {\n return NativeModule.updateIdCaptureFeedback(feedbackJson);\n }\n}\n//# sourceMappingURL=IdCaptureProxy.js.map","import { NativeEventEmitter, NativeModules } from 'react-native';\nimport { FactoryMaker } from 'scandit-datacapture-frameworks-core';\nimport { IdCaptureListenerEvents } from 'scandit-datacapture-frameworks-id';\n// tslint:disable:variable-name\nconst NativeModule = NativeModules.ScanditDataCaptureId;\nconst RNEventEmitter = new NativeEventEmitter(NativeModule);\n// tslint:enable:variable-name\nexport class NativeIdCaptureListenerProxy {\n nativeListeners = [];\n eventEmitter;\n constructor() {\n this.eventEmitter = FactoryMaker.getInstance('EventEmitter');\n }\n isModeEnabled = () => false;\n subscribeDidCaptureListener() {\n const didCaptureListener = RNEventEmitter.addListener(IdCaptureListenerEvents.didCapture, (event) => {\n this.eventEmitter.emit(IdCaptureListenerEvents.didCapture, event.data);\n });\n this.nativeListeners.push(didCaptureListener);\n }\n subscribeDidRejectListener() {\n const didRejectListener = RNEventEmitter.addListener(IdCaptureListenerEvents.didReject, (event) => {\n this.eventEmitter.emit(IdCaptureListenerEvents.didReject, event.data);\n });\n this.nativeListeners.push(didRejectListener);\n }\n unregisterListenerForEvents() {\n this.nativeListeners.forEach(listener => listener.remove());\n this.nativeListeners = [];\n }\n finishDidCaptureCallback(isEnabled) {\n NativeModule.finishDidCaptureCallback(isEnabled);\n }\n finishDidLocalizeCallback(isEnabled) {\n NativeModule.finishDidLocalizeCallback(isEnabled);\n }\n finishDidRejectCallback(isEnabled) {\n NativeModule.finishDidRejectCallback(isEnabled);\n }\n finishDidTimeOutCallback(isEnabled) {\n NativeModule.finishDidTimeOutCallback(isEnabled);\n }\n}\n//# sourceMappingURL=IdCaptureListenerProxy.js.map","import { createNativeProxy, FactoryMaker } from 'scandit-datacapture-frameworks-core';\nimport { NativeIdCaptureProxy } from './IdCaptureProxy';\nimport { NativeIdCaptureListenerProxy } from './IdCaptureListenerProxy';\nimport { createRNNativeCaller } from 'scandit-react-native-datacapture-core';\nimport { NativeModules } from 'react-native';\nexport function initIdProxy() {\n FactoryMaker.bindInstance('IdCaptureProxy', new NativeIdCaptureProxy());\n FactoryMaker.bindInstance('IdCaptureListenerProxy', new NativeIdCaptureListenerProxy());\n FactoryMaker.bindLazyInstance('IdCaptureOverlayProxy', () => {\n const caller = createRNNativeCaller(NativeModules.ScanditDataCaptureId);\n return createNativeProxy(caller);\n });\n}\n//# sourceMappingURL=initProxy.js.map","import { NativeModules } from 'react-native';\nimport { initCoreDefaults } from 'scandit-react-native-datacapture-core';\nimport { loadIdDefaults } from 'scandit-datacapture-frameworks-id';\nconst dataCaptureId = NativeModules.ScanditDataCaptureId;\nexport function initIdDefaults() {\n initCoreDefaults();\n loadIdDefaults(dataCaptureId.Defaults);\n}\n//# sourceMappingURL=initDefaults.js.map","import React, { useEffect, useRef, useState, forwardRef, useImperativeHandle, useMemo } from 'react';\nimport { AppState } from 'react-native';\nimport { Camera, CameraPosition, DataCaptureView, FrameSourceState, } from 'scandit-react-native-datacapture-core';\nimport { IdCapture, IdCaptureOverlay, IdCaptureSettings, } from 'scandit-datacapture-frameworks-id';\nimport { ScreenStateManager } from 'scandit-datacapture-frameworks-core';\n// tslint:disable-next-line\nexport const IdCaptureView = forwardRef(function IdCaptureView(props, ref) {\n useImperativeHandle(ref, () => ({\n reset() {\n getMode().reset();\n },\n }), []);\n /* STATE VARIABLES */\n const [isEnabledState, setIsEnabledState] = useState(false);\n const [frameSourceState, setFrameSourceState] = useState(FrameSourceState.Off);\n /* STATE HANDLERS */\n useEffect(() => {\n getMode().isEnabled = isEnabledState;\n }, [isEnabledState]);\n useEffect(() => {\n if (screenStateManager.isScreenActive(viewId.current)) {\n getCamera()?.switchToDesiredState(frameSourceState);\n }\n }, [frameSourceState]);\n const viewRef = useRef(null);\n const componentIsSetUp = useRef(false);\n const viewId = useRef(Math.floor(Math.random() * 1000000));\n const screenStateManager = useMemo(() => {\n return ScreenStateManager.getInstance();\n }, []);\n const idCaptureModeRef = useRef(null);\n function getMode() {\n if (idCaptureModeRef.current !== null) {\n return idCaptureModeRef.current;\n }\n idCaptureModeRef.current = IdCapture.forContext(null, props.idCaptureSettings || new IdCaptureSettings());\n return idCaptureModeRef.current;\n }\n const idCaptureOverlayRef = useRef(null);\n function getIdCaptureOverlay() {\n if (idCaptureOverlayRef.current !== null) {\n return idCaptureOverlayRef.current;\n }\n idCaptureOverlayRef.current = new IdCaptureOverlay(getMode());\n return idCaptureOverlayRef.current;\n }\n const cameraRef = useRef(null);\n function getCamera() {\n if (cameraRef.current !== null) {\n return cameraRef.current;\n }\n cameraRef.current = Camera.asPositionWithSettings(props.desiredCameraPosition || CameraPosition.WorldFacing, props.cameraSettings || IdCapture.recommendedCameraSettings);\n return cameraRef.current;\n }\n const torchSwitchControl = useRef(null);\n const zoomSwitchControl = useRef(null);\n const appState = useRef(AppState.currentState);\n /* SETUP */\n useEffect(() => {\n doSetup();\n const subscription = AppState.addEventListener('change', nextAppState => {\n if (appState.current.match(/inactive|background/) && nextAppState === 'active') {\n setIsEnabledState(props.isEnabled);\n setFrameSourceState(props.desiredCameraState || FrameSourceState.On);\n }\n else {\n setIsEnabledState(false);\n setFrameSourceState(FrameSourceState.Off);\n }\n appState.current = nextAppState;\n });\n return () => {\n subscription.remove();\n doCleanup();\n };\n }, []);\n const doSetup = () => {\n screenStateManager.setActiveScreen(viewId.current);\n if (componentIsSetUp.current)\n return;\n componentIsSetUp.current = true;\n /* Handling Data Capture Context */\n props.context.setFrameSource(getCamera());\n props.context.removeAllModes();\n props.context.addMode(getMode());\n /* Adding ID Capture Overlay */\n if (viewRef.current) {\n viewRef.current.addOverlay(getIdCaptureOverlay());\n }\n };\n const doCleanup = () => {\n if (!componentIsSetUp.current)\n return;\n componentIsSetUp.current = false;\n /* Remove the torch control */\n if (torchSwitchControl.current) {\n viewRef.current?.removeControl(torchSwitchControl.current);\n }\n /* Remove the zoom control */\n if (zoomSwitchControl.current) {\n viewRef.current?.removeControl(zoomSwitchControl.current);\n }\n /* Closing the camera if camera is active */\n if (screenStateManager.isScreenActive(viewId.current)) {\n getCamera()?.switchToDesiredState(FrameSourceState.Off);\n props.context.setFrameSource(null);\n }\n /* Cleaning Data Capture Context */\n if (idCaptureModeRef.current) {\n props.context.removeMode(idCaptureModeRef.current);\n }\n idCaptureModeRef.current = null;\n /* Cleaning Overlays */\n if (viewRef.current) {\n viewRef.current.view?.overlays?.forEach((overlay) => viewRef.current?.view?.removeOverlay(overlay));\n }\n };\n /* ID CAPTURE MODE */\n useEffect(() => {\n if (props.idCaptureSettings) {\n getMode().applySettings(props.idCaptureSettings);\n }\n }, [props.idCaptureSettings]);\n useEffect(() => {\n setIsEnabledState(props.isEnabled);\n setFrameSourceState(props.desiredCameraState || FrameSourceState.On);\n }, [props.isEnabled]);\n useEffect(() => {\n const listeners = [...getMode().listeners];\n listeners.forEach((listener) => {\n getMode().removeListener(listener);\n });\n if (props.didCaptureId || props.didRejectId) {\n getMode().addListener({\n didCaptureId: props.didCaptureId,\n didRejectId: props.didRejectId,\n });\n }\n }, [props.didCaptureId, props.didRejectId]);\n /* OVERLAYS */\n useEffect(() => {\n if (props.capturedBrush) {\n getIdCaptureOverlay().capturedBrush = props.capturedBrush;\n }\n if (props.rejectedBrush) {\n getIdCaptureOverlay().rejectedBrush = props.rejectedBrush;\n }\n if (props.localizedBrush) {\n getIdCaptureOverlay().localizedBrush = props.localizedBrush;\n }\n }, [props.capturedBrush, props.rejectedBrush, props.localizedBrush]);\n /* CAMERA */\n useEffect(() => {\n getCamera()?.applySettings(props.cameraSettings || IdCapture.recommendedCameraSettings);\n }, [props.cameraSettings]);\n useEffect(() => {\n if (props.desiredCameraState && screenStateManager.isScreenActive(viewId.current)) {\n setFrameSourceState(props.desiredCameraState);\n }\n }, [props.desiredCameraState]);\n useEffect(() => {\n if (props.desiredCameraPosition) {\n setFrameSourceState(FrameSourceState.Off);\n props.context.setFrameSource(null).then(() => {\n cameraRef.current = Camera.asPositionWithSettings(props.desiredCameraPosition || CameraPosition.WorldFacing, props.cameraSettings || IdCapture.recommendedCameraSettings);\n props.context.setFrameSource(getCamera()).then(() => {\n setFrameSourceState(props.desiredCameraState || FrameSourceState.On);\n });\n });\n }\n }, [props.desiredCameraPosition]);\n /* CONTROLS */\n useEffect(() => {\n if (props.desiredTorchState) {\n getCamera().desiredTorchState = props.desiredTorchState;\n }\n }, [props.desiredTorchState]);\n useEffect(() => {\n if (!viewRef.current)\n return;\n if (torchSwitchControl.current) {\n viewRef.current?.removeControl(torchSwitchControl.current);\n }\n if (!props.torchSwitchControl)\n return;\n torchSwitchControl.current = props.torchSwitchControl;\n viewRef.current.addControl(torchSwitchControl.current);\n }, [props.torchSwitchControl]);\n useEffect(() => {\n if (!viewRef.current)\n return;\n if (zoomSwitchControl.current) {\n viewRef.current?.removeControl(zoomSwitchControl.current);\n }\n if (!props.zoomSwitchControl)\n return;\n zoomSwitchControl.current = props.zoomSwitchControl;\n viewRef.current.addControl(zoomSwitchControl.current);\n }, [props.zoomSwitchControl]);\n /* MISC */\n useEffect(() => {\n if (props.feedback) {\n getMode().feedback = props.feedback;\n }\n }, [props.feedback]);\n useEffect(() => {\n if (!props.navigation)\n return;\n try {\n const unsubscribeFromFocus = props.navigation.addListener('focus', () => {\n doSetup();\n });\n const unsubscribeFromBlur = props.navigation.addListener('blur', () => {\n doCleanup();\n });\n return () => {\n unsubscribeFromFocus();\n unsubscribeFromBlur();\n };\n }\n catch (e) {\n // tslint:disable-next-line:no-console\n console.error(e);\n }\n }, [props.navigation]);\n return React.createElement(DataCaptureView, { context: props.context, style: { flex: 1 }, ref: viewRef });\n});\n//# sourceMappingURL=IdCaptureView.js.map","import { initIdProxy } from './native/initProxy';\nimport { initIdDefaults } from './private/initDefaults';\ninitIdDefaults();\ninitIdProxy();\nexport { DateResult, IdAnonymizationMode, IdImageType, CapturedSides, TextHintPosition, Duration } from 'scandit-datacapture-frameworks-id';\nexport { AamvaBarcodeVerificationResult, AamvaBarcodeVerificationStatus, AamvaBarcodeVerifier } from 'scandit-datacapture-frameworks-id';\nexport { CapturedId, BarcodeResult, MRZResult, ProfessionalDrivingPermit } from 'scandit-datacapture-frameworks-id';\nexport { VehicleRestriction, VIZResult } from 'scandit-datacapture-frameworks-id';\nexport { UsRealIdStatus } from 'scandit-datacapture-frameworks-id';\nexport { IdCaptureController, IdCaptureListenerController, IdCaptureListenerEvents } from 'scandit-datacapture-frameworks-id';\nexport { IdCapture, IdCaptureFeedback, IdCaptureOverlay, IdCaptureSettings, IdLayoutLineStyle, IdLayoutStyle, RejectionReason } from 'scandit-datacapture-frameworks-id';\nexport { IdCaptureDocumentType, DriverLicense, HealthInsuranceCard, IdCard, Passport, RegionSpecific, ResidencePermit, VisaIcao } from 'scandit-datacapture-frameworks-id';\nexport { SingleSideScanner, FullDocumentScanner, IdCaptureRegion, RegionSpecificSubtype, IdImages, IdSide } from 'scandit-datacapture-frameworks-id';\nexport * from './IdCaptureView';\n//# sourceMappingURL=index.js.map"],"names":["NativeModule"],"mappings":";;;;;;;AACA;AACA,MAAMA,cAAY,GAAG,aAAa,CAAC,oBAAoB,CAAC;AACjC,IAAI,kBAAkB,CAACA,cAAY,EAAE;AAC5D;AACO,MAAM,oBAAoB,CAAC;AAClC,IAAI,SAAS,GAAG;AAChB,QAAQ,OAAOA,cAAY,CAAC,KAAK,EAAE,CAAC;AACpC,KAAK;AACL,IAAI,mCAAmC,CAAC,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,MAAM;AACrF,gBAAgB,OAAO,EAAE,CAAC;AAC1B,aAAa,CAAC,CAAC;AACf,YAAY,MAAM,mBAAmB,GAAG,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,MAAM,EAAE,MAAM;AACnF,gBAAgB,SAAS,EAAE,CAAC;AAC5B,aAAa,CAAC,CAAC;AACf,YAAY,OAAO,MAAM;AACzB,gBAAgB,oBAAoB,EAAE,CAAC;AACvC,gBAAgB,mBAAmB,EAAE,CAAC;AACtC,aAAa,CAAC;AACd,SAAS;AACT,QAAQ,OAAO,CAAC,EAAE;AAClB;AACA,YAAY,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAC7B,SAAS;AACT,KAAK,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC;AAC3B,IAAI,OAAO,KAAK,CAAC,aAAa,CAAC,eAAe,EAAE,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC,CAAC;AAC9G,CAAC;;AChOD,cAAc,EAAE,CAAC;AACjB,WAAW,EAAE;;;;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../ts/native/initProxy.ts","../ts/private/initDefaults.ts","../ts/IdCaptureView.tsx","../ts/index.ts"],"sourcesContent":["import { createNativeProxy, FactoryMaker } from 'scandit-datacapture-frameworks-core';\nimport { createRNNativeCaller } from 'scandit-react-native-datacapture-core';\nimport { NativeModules } from 'react-native';\nexport function initIdProxy() {\n FactoryMaker.bindLazyInstance('IdCaptureProxy', () => {\n const caller = createRNNativeCaller(NativeModules.ScanditDataCaptureId);\n return createNativeProxy(caller);\n });\n FactoryMaker.bindLazyInstance('IdCaptureListenerProxy', () => {\n const caller = createRNNativeCaller(NativeModules.ScanditDataCaptureId);\n return createNativeProxy(caller);\n });\n FactoryMaker.bindLazyInstance('IdCaptureOverlayProxy', () => {\n const caller = createRNNativeCaller(NativeModules.ScanditDataCaptureId);\n return createNativeProxy(caller);\n });\n}\n//# sourceMappingURL=initProxy.js.map","import { NativeModules } from 'react-native';\nimport { initCoreDefaults } from 'scandit-react-native-datacapture-core';\nimport { loadIdDefaults } from 'scandit-datacapture-frameworks-id';\nconst dataCaptureId = NativeModules.ScanditDataCaptureId;\nexport function initIdDefaults() {\n initCoreDefaults();\n loadIdDefaults(dataCaptureId.Defaults);\n}\n//# sourceMappingURL=initDefaults.js.map","import React, { useEffect, useRef, useState, forwardRef, useImperativeHandle, useMemo, useCallback } from 'react';\nimport { AppState } from 'react-native';\nimport { CameraPosition, DataCaptureView, FrameSourceState, } from 'scandit-react-native-datacapture-core';\nimport { IdCapture, IdCaptureOverlay, IdCaptureSettings, } from 'scandit-datacapture-frameworks-id';\nimport { CameraOwnershipHelper } from 'scandit-datacapture-frameworks-core';\n// tslint:disable-next-line\nexport const IdCaptureView = forwardRef(function IdCaptureView(props, ref) {\n useImperativeHandle(ref, () => ({\n reset() {\n getMode().reset();\n },\n }), \n // eslint-disable-next-line react-hooks/exhaustive-deps\n []);\n /* STATE VARIABLES */\n const [isEnabledState, setIsEnabledState] = useState(false);\n const [frameSourceState, setFrameSourceState] = useState(FrameSourceState.Off);\n const [viewId] = useState(() => Math.floor(Math.random() * 1000000));\n const [isCameraSetup, setIsCameraSetup] = useState(false);\n // Create camera owner using viewId\n const cameraOwner = useMemo(() => ({\n id: `id-capture-view-${viewId}`,\n }), [viewId]);\n /* STATE HANDLERS */\n const getMode = useCallback(() => {\n if (idCaptureModeRef.current !== null) {\n return idCaptureModeRef.current;\n }\n idCaptureModeRef.current = new IdCapture(props.idCaptureSettings || new IdCaptureSettings());\n idCaptureModeRef.current.parentId = viewId;\n return idCaptureModeRef.current;\n }, [props.idCaptureSettings, viewId]);\n useEffect(() => {\n getMode().isEnabled = isEnabledState;\n }, [isEnabledState, getMode]);\n useEffect(() => {\n const position = props.desiredCameraPosition || CameraPosition.WorldFacing;\n CameraOwnershipHelper.withCamera(position, cameraOwner, async (camera) => {\n await camera.switchToDesiredState(frameSourceState);\n });\n }, [frameSourceState, props.desiredCameraPosition, cameraOwner]);\n const viewRef = useRef(null);\n const componentIsSetUp = useRef(false);\n const idCaptureModeRef = useRef(null);\n const idCaptureOverlayRef = useRef(null);\n const getIdCaptureOverlay = useCallback(() => {\n if (idCaptureOverlayRef.current !== null) {\n return idCaptureOverlayRef.current;\n }\n idCaptureOverlayRef.current = new IdCaptureOverlay(getMode());\n return idCaptureOverlayRef.current;\n }, [getMode]);\n // Remove getCamera function as we'll use CameraOwnershipHelper\n const torchSwitchControl = useRef(null);\n const zoomSwitchControl = useRef(null);\n const appState = useRef(AppState.currentState);\n /* SETUP */\n useEffect(() => {\n doSetup();\n const subscription = AppState.addEventListener('change', nextAppState => {\n if (appState.current.match(/inactive|background/) && nextAppState === 'active') {\n setIsEnabledState(props.isEnabled);\n setFrameSourceState(props.desiredCameraState || FrameSourceState.On);\n }\n else {\n setIsEnabledState(false);\n setFrameSourceState(FrameSourceState.Off);\n }\n appState.current = nextAppState;\n });\n return () => {\n subscription.remove();\n doDestroy();\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n const setupCamera = useCallback(async () => {\n const position = props.desiredCameraPosition || CameraPosition.WorldFacing;\n // Request ownership and set up camera\n await CameraOwnershipHelper.withCameraWhenAvailable(position, cameraOwner, async (camera) => {\n const settings = props.cameraSettings || IdCapture.createRecommendedCameraSettings();\n await camera.applySettings(settings);\n await props.context.setFrameSource(camera);\n await camera.switchToDesiredState(props.desiredCameraState || FrameSourceState.On);\n // Mark camera as set up\n setIsCameraSetup(true);\n });\n }, [props.desiredCameraPosition, cameraOwner, props.cameraSettings, props.context, props.desiredCameraState]);\n const doSetup = useCallback(() => {\n if (componentIsSetUp.current)\n return;\n componentIsSetUp.current = true;\n /* Setup camera with ownership - WAIT for completion */\n setupCamera();\n /* Only proceed after camera is ready */\n props.context.removeAllModes();\n props.context.addMode(getMode());\n /* Adding ID Capture Overlay */\n if (viewRef.current) {\n viewRef.current.addOverlay(getIdCaptureOverlay());\n }\n }, [setupCamera, props.context, getMode, getIdCaptureOverlay]);\n const doDestroy = () => {\n doCleanup();\n idCaptureModeRef.current = null;\n torchSwitchControl.current = null;\n zoomSwitchControl.current = null;\n idCaptureOverlayRef.current = null;\n };\n const doCleanup = useCallback(() => {\n if (!componentIsSetUp.current)\n return;\n componentIsSetUp.current = false;\n // Reset camera setup state\n setIsCameraSetup(false);\n /* Remove the torch control */\n if (torchSwitchControl.current) {\n viewRef.current?.removeControl(torchSwitchControl.current);\n }\n /* Remove the zoom control */\n if (zoomSwitchControl.current) {\n viewRef.current?.removeControl(zoomSwitchControl.current);\n }\n /* Cleaning Data Capture Context */\n if (idCaptureModeRef.current) {\n props.context.removeMode(idCaptureModeRef.current);\n }\n /* Cleaning Overlays */\n if (viewRef.current) {\n viewRef.current.view?.overlays?.forEach((overlay) => viewRef.current?.view?.removeOverlay(overlay));\n }\n /* Turn off camera and release ownership */\n const position = props.desiredCameraPosition || CameraPosition.WorldFacing;\n CameraOwnershipHelper.withCamera(position, cameraOwner, async (camera) => {\n await camera.switchToDesiredState(FrameSourceState.Off);\n await props.context.setFrameSource(null);\n }).finally(() => {\n // Release camera ownership\n CameraOwnershipHelper.releaseOwnership(position, cameraOwner);\n });\n }, [props.desiredCameraPosition, cameraOwner, props.context]);\n /* ID CAPTURE MODE */\n useEffect(() => {\n if (props.idCaptureSettings) {\n getMode().applySettings(props.idCaptureSettings);\n }\n }, [props.idCaptureSettings, getMode]);\n useEffect(() => {\n setIsEnabledState(props.isEnabled);\n setFrameSourceState(props.desiredCameraState || FrameSourceState.On);\n }, [props.isEnabled, props.desiredCameraState]);\n const listenerRef = useRef(null);\n const callbacksRef = useRef({ didCaptureId: props.didCaptureId, didRejectId: props.didRejectId });\n // Update callback references when props change\n useEffect(() => {\n callbacksRef.current = { didCaptureId: props.didCaptureId, didRejectId: props.didRejectId };\n }, [props.didCaptureId, props.didRejectId]);\n // Add/remove listener only when needed\n useEffect(() => {\n const setupListeners = async () => {\n const shouldHaveListener = props.didCaptureId || props.didRejectId;\n const hasListener = listenerRef.current !== null;\n if (shouldHaveListener && !hasListener) {\n // Add listener\n listenerRef.current = {\n didCaptureId: (idCapture, capturedId) => callbacksRef.current.didCaptureId?.(idCapture, capturedId),\n didRejectId: (idCapture, rejectedId, reason) => callbacksRef.current.didRejectId?.(idCapture, rejectedId, reason),\n };\n await getMode().addListener(listenerRef.current);\n }\n else if (!shouldHaveListener && hasListener && listenerRef.current) {\n // Remove listener\n await getMode().removeListener(listenerRef.current);\n listenerRef.current = null;\n }\n };\n setupListeners();\n }, [props.didCaptureId, props.didRejectId, getMode, listenerRef, callbacksRef]);\n /* OVERLAYS */\n useEffect(() => {\n if (props.capturedBrush) {\n getIdCaptureOverlay().capturedBrush = props.capturedBrush;\n }\n if (props.rejectedBrush) {\n getIdCaptureOverlay().rejectedBrush = props.rejectedBrush;\n }\n if (props.localizedBrush) {\n getIdCaptureOverlay().localizedBrush = props.localizedBrush;\n }\n }, [props.capturedBrush, props.rejectedBrush, props.localizedBrush, getIdCaptureOverlay]);\n /* CAMERA */\n useEffect(() => {\n if (!isCameraSetup)\n return; // Don't run until camera is ready\n const position = props.desiredCameraPosition || CameraPosition.WorldFacing;\n const settings = props.cameraSettings || IdCapture.createRecommendedCameraSettings();\n CameraOwnershipHelper.withCamera(position, cameraOwner, async (camera) => {\n await camera.applySettings(settings);\n });\n }, [props.cameraSettings, props.desiredCameraPosition, cameraOwner, isCameraSetup]);\n useEffect(() => {\n if (props.desiredCameraState) {\n setFrameSourceState(props.desiredCameraState);\n }\n }, [props.desiredCameraState]);\n useEffect(() => {\n if (props.desiredCameraPosition) {\n // Handle camera position change with ownership\n const currentOwnedPosition = CameraOwnershipHelper.getOwnedPosition(cameraOwner);\n const newPosition = props.desiredCameraPosition;\n if (currentOwnedPosition && currentOwnedPosition !== newPosition) {\n // Release old camera ownership\n CameraOwnershipHelper.releaseOwnership(currentOwnedPosition, cameraOwner);\n // Set up new camera\n setupCamera();\n }\n else if (!currentOwnedPosition) {\n // No camera owned yet, set up new camera\n setupCamera();\n }\n }\n }, [props.desiredCameraPosition, cameraOwner, setupCamera]);\n /* CONTROLS */\n useEffect(() => {\n if (props.desiredTorchState) {\n const position = props.desiredCameraPosition || CameraPosition.WorldFacing;\n CameraOwnershipHelper.withCameraWhenAvailable(position, cameraOwner, async (camera) => {\n camera.desiredTorchState = props.desiredTorchState;\n });\n }\n }, [props.desiredTorchState, props.desiredCameraPosition, cameraOwner]);\n useEffect(() => {\n if (!viewRef.current)\n return;\n if (torchSwitchControl.current) {\n viewRef.current?.removeControl(torchSwitchControl.current);\n }\n if (!props.torchSwitchControl)\n return;\n torchSwitchControl.current = props.torchSwitchControl;\n viewRef.current.addControl(torchSwitchControl.current);\n }, [props.torchSwitchControl]);\n useEffect(() => {\n if (!viewRef.current)\n return;\n if (zoomSwitchControl.current) {\n viewRef.current?.removeControl(zoomSwitchControl.current);\n }\n if (!props.zoomSwitchControl)\n return;\n zoomSwitchControl.current = props.zoomSwitchControl;\n viewRef.current.addControl(zoomSwitchControl.current);\n }, [props.zoomSwitchControl]);\n /* MISC */\n useEffect(() => {\n if (props.feedback) {\n getMode().feedback = props.feedback;\n }\n }, [props.feedback, getMode]);\n useEffect(() => {\n if (!props.navigation)\n return;\n try {\n const unsubscribeFromFocus = props.navigation.addListener('focus', () => {\n doSetup();\n });\n const unsubscribeFromBlur = props.navigation.addListener('blur', () => {\n doCleanup();\n });\n return () => {\n unsubscribeFromFocus();\n unsubscribeFromBlur();\n };\n }\n catch (e) {\n // tslint:disable-next-line:no-console\n console.error(e);\n }\n }, [props.navigation, doSetup, doCleanup]);\n return React.createElement(DataCaptureView, { context: props.context, parentId: viewId, style: { flex: 1 }, ref: viewRef });\n});\n//# sourceMappingURL=IdCaptureView.js.map","import { initIdProxy } from './native/initProxy';\nimport { initIdDefaults } from './private/initDefaults';\ninitIdDefaults();\ninitIdProxy();\nexport { DateResult, IdAnonymizationMode, IdImageType, CapturedSides, TextHintPosition, Duration } from 'scandit-datacapture-frameworks-id';\nexport { AamvaBarcodeVerificationResult, AamvaBarcodeVerificationStatus } from 'scandit-datacapture-frameworks-id';\nexport { CapturedId, BarcodeResult, MRZResult, ProfessionalDrivingPermit } from 'scandit-datacapture-frameworks-id';\nexport { VehicleRestriction, VIZResult, IdFieldType } from 'scandit-datacapture-frameworks-id';\nexport { UsRealIdStatus } from 'scandit-datacapture-frameworks-id';\nexport { IdCaptureController, IdCaptureListenerController, IdCaptureListenerEvents } from 'scandit-datacapture-frameworks-id';\nexport { IdCapture, IdCaptureFeedback, IdCaptureOverlay, IdCaptureSettings, IdLayoutLineStyle, IdLayoutStyle, RejectionReason } from 'scandit-datacapture-frameworks-id';\nexport { IdCaptureDocumentType, DriverLicense, HealthInsuranceCard, IdCard, Passport, RegionSpecific, ResidencePermit, VisaIcao } from 'scandit-datacapture-frameworks-id';\nexport { SingleSideScanner, FullDocumentScanner, IdCaptureRegion, RegionSpecificSubtype, IdImages, IdSide } from 'scandit-datacapture-frameworks-id';\nexport { DataConsistencyResult, DrivingLicenseCategory, DrivingLicenseDetails, DataConsistencyCheck, MobileDocumentResult, VerificationResult, Sex } from 'scandit-datacapture-frameworks-id';\nexport * from './IdCaptureView';\n//# sourceMappingURL=index.js.map"],"names":[],"mappings":";;;;;;;AAGO,SAAS,WAAW,GAAG;AAC9B,IAAI,YAAY,CAAC,gBAAgB,CAAC,gBAAgB,EAAE,MAAM;AAC1D,QAAQ,MAAM,MAAM,GAAG,oBAAoB,CAAC,aAAa,CAAC,oBAAoB,CAAC,CAAC;AAChF,QAAQ,OAAO,iBAAiB,CAAC,MAAM,CAAC,CAAC;AACzC,KAAK,CAAC,CAAC;AACP,IAAI,YAAY,CAAC,gBAAgB,CAAC,wBAAwB,EAAE,MAAM;AAClE,QAAQ,MAAM,MAAM,GAAG,oBAAoB,CAAC,aAAa,CAAC,oBAAoB,CAAC,CAAC;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