react-native-rectangle-doc-scanner 3.46.0 → 3.47.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.
@@ -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
- (showManualCaptureButton || !autoCapture) && (react_1.default.createElement(react_native_1.TouchableOpacity, { style: styles.button, onPress: handleManualCapture })),
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({
@@ -135,13 +135,11 @@ const FullDocScanner = ({ onResult, onClose, detectionConfig, overlayColor = '#3
135
135
  });
136
136
  }
137
137
  else {
138
- // No grid: show original image in check_DP
139
- console.log('[FullDocScanner] No grid: using original image', normalizedDoc.path);
140
- setCroppedImageData({
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-rectangle-doc-scanner",
3
- "version": "3.46.0",
3
+ "version": "3.47.0",
4
4
  "description": "Native-backed document scanner for React Native with customizable overlays.",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -317,7 +317,7 @@ export const DocScanner = forwardRef<DocScannerHandle, Props>(
317
317
  polygon={overlayPolygon}
318
318
  />
319
319
  )}
320
- {(showManualCaptureButton || !autoCapture) && (
320
+ {showManualCaptureButton && (
321
321
  <TouchableOpacity style={styles.button} onPress={handleManualCapture} />
322
322
  )}
323
323
  {children}
@@ -180,14 +180,12 @@ export const FullDocScanner: React.FC<FullDocScannerProps> = ({
180
180
  path: normalizedDoc.croppedPath,
181
181
  });
182
182
  } else {
183
- // No grid: show original image in check_DP
184
- console.log('[FullDocScanner] No grid: using original image', normalizedDoc.path);
185
- setCroppedImageData({
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(() => {