react-native-rectangle-doc-scanner 3.46.0 → 3.48.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/dist/DocScanner.js +1 -1
- package/dist/FullDocScanner.js +6 -8
- package/package.json +1 -1
- package/src/DocScanner.tsx +1 -1
- package/src/FullDocScanner.tsx +7 -9
package/dist/DocScanner.js
CHANGED
|
@@ -208,7 +208,7 @@ exports.DocScanner = (0, react_1.forwardRef)(({ onCapture, overlayColor = DEFAUL
|
|
|
208
208
|
return (react_1.default.createElement(react_native_1.View, { style: styles.container },
|
|
209
209
|
react_1.default.createElement(react_native_document_scanner_1.default, { ref: scannerRef, style: styles.scanner, detectionCountBeforeCapture: minStableFrames, overlayColor: overlayColor, enableTorch: enableTorch, quality: normalizedQuality, useBase64: useBase64, manualOnly: !autoCapture, detectionConfig: detectionConfig, onPictureTaken: handlePictureTaken, onError: handleError, onRectangleDetect: handleRectangleDetect }),
|
|
210
210
|
showGrid && overlayPolygon && (react_1.default.createElement(overlay_1.ScannerOverlay, { active: overlayIsActive, color: gridColor ?? overlayColor, lineWidth: gridLineWidth, polygon: overlayPolygon })),
|
|
211
|
-
|
|
211
|
+
showManualCaptureButton && (react_1.default.createElement(react_native_1.TouchableOpacity, { style: styles.button, onPress: handleManualCapture })),
|
|
212
212
|
children));
|
|
213
213
|
});
|
|
214
214
|
const styles = react_native_1.StyleSheet.create({
|
package/dist/FullDocScanner.js
CHANGED
|
@@ -121,12 +121,12 @@ const FullDocScanner = ({ onResult, onClose, detectionConfig, overlayColor = '#3
|
|
|
121
121
|
croppedPath: document.croppedPath,
|
|
122
122
|
initialPath: document.initialPath,
|
|
123
123
|
});
|
|
124
|
-
|
|
124
|
+
const normalizedDoc = normalizeCapturedDocument(document);
|
|
125
|
+
// Reset manual capture pending flag BEFORE processing
|
|
125
126
|
if (manualCapturePending.current) {
|
|
126
127
|
console.log('[FullDocScanner] Resetting manualCapturePending');
|
|
127
128
|
manualCapturePending.current = false;
|
|
128
129
|
}
|
|
129
|
-
const normalizedDoc = normalizeCapturedDocument(document);
|
|
130
130
|
// If grid detected and cropped image exists, show it directly in check_DP
|
|
131
131
|
if (normalizedDoc.croppedPath) {
|
|
132
132
|
console.log('[FullDocScanner] Grid detected: using pre-cropped image', normalizedDoc.croppedPath);
|
|
@@ -135,13 +135,11 @@ const FullDocScanner = ({ onResult, onClose, detectionConfig, overlayColor = '#3
|
|
|
135
135
|
});
|
|
136
136
|
}
|
|
137
137
|
else {
|
|
138
|
-
// No grid:
|
|
139
|
-
console.log('[FullDocScanner] No grid:
|
|
140
|
-
|
|
141
|
-
path: normalizedDoc.path,
|
|
142
|
-
});
|
|
138
|
+
// No grid: open cropper for manual crop
|
|
139
|
+
console.log('[FullDocScanner] No grid detected: opening cropper for manual crop', normalizedDoc.path);
|
|
140
|
+
await openCropper(normalizedDoc.path);
|
|
143
141
|
}
|
|
144
|
-
}, []);
|
|
142
|
+
}, [openCropper]);
|
|
145
143
|
const triggerManualCapture = (0, react_1.useCallback)(() => {
|
|
146
144
|
console.log('[FullDocScanner] triggerManualCapture called', {
|
|
147
145
|
processing,
|
package/package.json
CHANGED
package/src/DocScanner.tsx
CHANGED
|
@@ -317,7 +317,7 @@ export const DocScanner = forwardRef<DocScannerHandle, Props>(
|
|
|
317
317
|
polygon={overlayPolygon}
|
|
318
318
|
/>
|
|
319
319
|
)}
|
|
320
|
-
{
|
|
320
|
+
{showManualCaptureButton && (
|
|
321
321
|
<TouchableOpacity style={styles.button} onPress={handleManualCapture} />
|
|
322
322
|
)}
|
|
323
323
|
{children}
|
package/src/FullDocScanner.tsx
CHANGED
|
@@ -165,14 +165,14 @@ export const FullDocScanner: React.FC<FullDocScannerProps> = ({
|
|
|
165
165
|
initialPath: document.initialPath,
|
|
166
166
|
});
|
|
167
167
|
|
|
168
|
-
|
|
168
|
+
const normalizedDoc = normalizeCapturedDocument(document);
|
|
169
|
+
|
|
170
|
+
// Reset manual capture pending flag BEFORE processing
|
|
169
171
|
if (manualCapturePending.current) {
|
|
170
172
|
console.log('[FullDocScanner] Resetting manualCapturePending');
|
|
171
173
|
manualCapturePending.current = false;
|
|
172
174
|
}
|
|
173
175
|
|
|
174
|
-
const normalizedDoc = normalizeCapturedDocument(document);
|
|
175
|
-
|
|
176
176
|
// If grid detected and cropped image exists, show it directly in check_DP
|
|
177
177
|
if (normalizedDoc.croppedPath) {
|
|
178
178
|
console.log('[FullDocScanner] Grid detected: using pre-cropped image', normalizedDoc.croppedPath);
|
|
@@ -180,14 +180,12 @@ export const FullDocScanner: React.FC<FullDocScannerProps> = ({
|
|
|
180
180
|
path: normalizedDoc.croppedPath,
|
|
181
181
|
});
|
|
182
182
|
} else {
|
|
183
|
-
// No grid:
|
|
184
|
-
console.log('[FullDocScanner] No grid:
|
|
185
|
-
|
|
186
|
-
path: normalizedDoc.path,
|
|
187
|
-
});
|
|
183
|
+
// No grid: open cropper for manual crop
|
|
184
|
+
console.log('[FullDocScanner] No grid detected: opening cropper for manual crop', normalizedDoc.path);
|
|
185
|
+
await openCropper(normalizedDoc.path);
|
|
188
186
|
}
|
|
189
187
|
},
|
|
190
|
-
[],
|
|
188
|
+
[openCropper],
|
|
191
189
|
);
|
|
192
190
|
|
|
193
191
|
const triggerManualCapture = useCallback(() => {
|