react-native-rectangle-doc-scanner 3.71.0 → 3.72.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/FullDocScanner.js
CHANGED
|
@@ -244,6 +244,8 @@ const FullDocScanner = ({ onResult, onClose, detectionConfig, overlayColor = '#3
|
|
|
244
244
|
}
|
|
245
245
|
const imageUri = result.assets[0].uri;
|
|
246
246
|
console.log('[FullDocScanner] Gallery image selected:', imageUri);
|
|
247
|
+
// Allow the picker dismissal animation to complete before presenting the cropper
|
|
248
|
+
await new Promise((resolve) => setTimeout(resolve, 200));
|
|
247
249
|
// Open cropper with the selected image
|
|
248
250
|
await openCropper(imageUri);
|
|
249
251
|
}
|
package/package.json
CHANGED
package/src/FullDocScanner.tsx
CHANGED
|
@@ -326,6 +326,9 @@ export const FullDocScanner: React.FC<FullDocScannerProps> = ({
|
|
|
326
326
|
const imageUri = result.assets[0].uri;
|
|
327
327
|
console.log('[FullDocScanner] Gallery image selected:', imageUri);
|
|
328
328
|
|
|
329
|
+
// Allow the picker dismissal animation to complete before presenting the cropper
|
|
330
|
+
await new Promise((resolve) => setTimeout(resolve, 200));
|
|
331
|
+
|
|
329
332
|
// Open cropper with the selected image
|
|
330
333
|
await openCropper(imageUri);
|
|
331
334
|
} catch (error) {
|
|
@@ -34,12 +34,33 @@ RCT_EXPORT_VIEW_PROPERTY(quality, float)
|
|
|
34
34
|
RCT_EXPORT_VIEW_PROPERTY(brightness, float)
|
|
35
35
|
RCT_EXPORT_VIEW_PROPERTY(contrast, float)
|
|
36
36
|
|
|
37
|
-
// Main capture method -
|
|
38
|
-
RCT_EXPORT_METHOD(capture:(
|
|
37
|
+
// Main capture method - accept reactTag when available (falls back to cached view)
|
|
38
|
+
RCT_EXPORT_METHOD(capture:(nullable id)reactTag
|
|
39
|
+
resolver:(RCTPromiseResolveBlock)resolve
|
|
39
40
|
rejecter:(RCTPromiseRejectBlock)reject) {
|
|
40
|
-
NSLog(@"[RNPdfScannerManager] capture
|
|
41
|
+
NSLog(@"[RNPdfScannerManager] capture called with reactTag: %@", reactTag);
|
|
41
42
|
dispatch_async(dispatch_get_main_queue(), ^{
|
|
42
|
-
DocumentScannerView *targetView =
|
|
43
|
+
DocumentScannerView *targetView = nil;
|
|
44
|
+
|
|
45
|
+
if ([reactTag isKindOfClass:[NSNumber class]]) {
|
|
46
|
+
NSNumber *resolvedTag = (NSNumber *)reactTag;
|
|
47
|
+
UIView *view = [self.bridge.uiManager viewForReactTag:resolvedTag];
|
|
48
|
+
if ([view isKindOfClass:[DocumentScannerView class]]) {
|
|
49
|
+
targetView = (DocumentScannerView *)view;
|
|
50
|
+
self->_scannerView = targetView;
|
|
51
|
+
} else if (view) {
|
|
52
|
+
NSLog(@"[RNPdfScannerManager] View for tag %@ is not DocumentScannerView: %@", resolvedTag, NSStringFromClass(view.class));
|
|
53
|
+
} else {
|
|
54
|
+
NSLog(@"[RNPdfScannerManager] No view found for tag %@", resolvedTag);
|
|
55
|
+
}
|
|
56
|
+
} else if (reactTag) {
|
|
57
|
+
NSLog(@"[RNPdfScannerManager] Unexpected reactTag type %@ - ignoring reactTag", NSStringFromClass([reactTag class]));
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
if (!targetView && self->_scannerView) {
|
|
61
|
+
NSLog(@"[RNPdfScannerManager] Falling back to last known scanner view");
|
|
62
|
+
targetView = self->_scannerView;
|
|
63
|
+
}
|
|
43
64
|
|
|
44
65
|
if (!targetView) {
|
|
45
66
|
NSLog(@"[RNPdfScannerManager] ERROR: Scanner view not yet ready for capture");
|
|
@@ -27,15 +27,17 @@ class PdfScanner extends React.Component {
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
capture() {
|
|
30
|
-
console.log('[PdfScanner/ios.js] capture called');
|
|
30
|
+
console.log('[PdfScanner/ios.js] capture called, ref:', this.scannerRef.current);
|
|
31
|
+
const handle = findNodeHandle(this.scannerRef.current);
|
|
32
|
+
console.log('[PdfScanner/ios.js] node handle (reactTag):', handle);
|
|
31
33
|
|
|
32
|
-
if (
|
|
34
|
+
if (typeof handle !== 'number') {
|
|
33
35
|
const error = new Error('DocumentScanner native view is not ready');
|
|
34
36
|
console.error('[PdfScanner/ios.js] ERROR:', error.message);
|
|
35
37
|
return Promise.reject(error);
|
|
36
38
|
}
|
|
37
39
|
|
|
38
|
-
return NativeModules.RNPdfScannerManager.capture();
|
|
40
|
+
return NativeModules.RNPdfScannerManager.capture(handle);
|
|
39
41
|
}
|
|
40
42
|
|
|
41
43
|
render() {
|