react-native-rectangle-doc-scanner 3.12.0 → 3.14.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.
@@ -109,7 +109,7 @@ exports.DocScanner = (0, react_1.forwardRef)(({ onCapture, overlayColor = DEFAUL
109
109
  },
110
110
  }), [capture]);
111
111
  return (react_1.default.createElement(react_native_1.View, { style: styles.container },
112
- react_1.default.createElement(react_native_document_scanner_1.default, { ref: scannerRef, style: react_native_1.StyleSheet.absoluteFillObject, detectionCountBeforeCapture: minStableFrames, overlayColor: overlayColor, enableTorch: enableTorch, quality: normalizedQuality, useBase64: useBase64, manualOnly: !autoCapture, onPictureTaken: handlePictureTaken, onError: handleError }),
112
+ 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, onPictureTaken: handlePictureTaken, onError: handleError }),
113
113
  !autoCapture && react_1.default.createElement(react_native_1.TouchableOpacity, { style: styles.button, onPress: handleManualCapture }),
114
114
  children));
115
115
  });
@@ -118,6 +118,15 @@ const styles = react_native_1.StyleSheet.create({
118
118
  flex: 1,
119
119
  backgroundColor: '#000',
120
120
  },
121
+ scanner: {
122
+ position: 'absolute',
123
+ top: 0,
124
+ left: 0,
125
+ right: 0,
126
+ bottom: 0,
127
+ width: '100%',
128
+ height: '100%',
129
+ },
121
130
  button: {
122
131
  position: 'absolute',
123
132
  bottom: 40,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-rectangle-doc-scanner",
3
- "version": "3.12.0",
3
+ "version": "3.14.0",
4
4
  "description": "Native-backed document scanner for React Native with customizable overlays.",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -35,6 +35,8 @@ try {
35
35
  const filesToCopy = [
36
36
  'ios/IPDFCameraViewController.m',
37
37
  'ios/DocumentScannerView.m',
38
+ 'ios/RNPdfScannerManager.m',
39
+ 'ios/RNPdfScannerManager.h',
38
40
  'ios.js'
39
41
  ];
40
42
 
@@ -152,7 +152,7 @@ export const DocScanner = forwardRef<DocScannerHandle, Props>(
152
152
  <View style={styles.container}>
153
153
  <DocumentScanner
154
154
  ref={scannerRef}
155
- style={StyleSheet.absoluteFillObject}
155
+ style={styles.scanner}
156
156
  detectionCountBeforeCapture={minStableFrames}
157
157
  overlayColor={overlayColor}
158
158
  enableTorch={enableTorch}
@@ -174,6 +174,15 @@ const styles = StyleSheet.create({
174
174
  flex: 1,
175
175
  backgroundColor: '#000',
176
176
  },
177
+ scanner: {
178
+ position: 'absolute',
179
+ top: 0,
180
+ left: 0,
181
+ right: 0,
182
+ bottom: 0,
183
+ width: '100%',
184
+ height: '100%',
185
+ },
177
186
  button: {
178
187
  position: 'absolute',
179
188
  bottom: 40,
@@ -39,6 +39,9 @@ RCT_EXPORT_METHOD(capture) {
39
39
 
40
40
  - (UIView*) view {
41
41
  _scannerView = [[DocumentScannerView alloc] init];
42
+ // Force layout update
43
+ _scannerView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
44
+ NSLog(@"[RNPdfScannerManager] Created view with frame: %@", NSStringFromCGRect(_scannerView.frame));
42
45
  return _scannerView;
43
46
  }
44
47