react-native-rectangle-doc-scanner 3.124.0 → 3.125.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.
@@ -97,9 +97,9 @@ async function withTimeout(factory) {
97
97
  }
98
98
  }
99
99
  const AUTO_ENHANCE_PARAMS = {
100
- brightness: 0.08,
101
- contrast: 1.05,
102
- saturation: 0.92,
100
+ brightness: 0.18,
101
+ contrast: 1.12,
102
+ saturation: 0.78,
103
103
  };
104
104
  const normalizeCapturedDocument = (document) => {
105
105
  const { origin: _origin, ...rest } = document;
@@ -568,20 +568,24 @@ const FullDocScanner = ({ onResult, onClose, detectionConfig, overlayColor = '#3
568
568
  react_1.default.createElement(react_native_1.TouchableOpacity, { style: styles.rotateButtonTop, onPress: () => handleRotateImage(90), accessibilityLabel: "\uC624\uB978\uCABD\uC73C\uB85C 90\uB3C4 \uD68C\uC804", accessibilityRole: "button" },
569
569
  react_1.default.createElement(react_native_1.Text, { style: styles.rotateIconText }, "\u21BB"),
570
570
  react_1.default.createElement(react_native_1.Text, { style: styles.rotateButtonLabel }, "\uC6B0\uB85C 90\u00B0")))) : null,
571
- isBusinessMode && capturedPhotos.length === 0 && (react_1.default.createElement(react_native_1.TouchableOpacity, { style: styles.captureBackButton, onPress: handleCaptureSecondPhoto, accessibilityLabel: mergedStrings.secondBtn, accessibilityRole: "button" },
572
- react_1.default.createElement(react_native_1.Text, { style: styles.captureBackButtonText }, mergedStrings.secondBtn))),
573
- activePreviewImage ? (react_1.default.createElement(react_native_1.Image, { source: { uri: activePreviewImage.path }, style: [
574
- styles.previewImage,
575
- { transform: [{ rotate: `${rotationDegrees}deg` }] }
576
- ], resizeMode: "contain" })) : null,
577
571
  croppedImageData.enhanced ? (react_1.default.createElement(react_native_1.TouchableOpacity, { style: [
578
572
  styles.originalToggleButton,
579
- croppedImageData.useOriginal && styles.originalToggleButtonActive,
573
+ croppedImageData.useOriginal
574
+ ? styles.originalToggleButtonActive
575
+ : styles.originalToggleButtonInactive,
580
576
  ], onPress: () => setCroppedImageData((prev) => prev ? { ...prev, useOriginal: !prev.useOriginal } : prev), accessibilityRole: "button", accessibilityLabel: mergedStrings.originalBtn },
581
577
  react_1.default.createElement(react_native_1.Text, { style: [
582
578
  styles.originalToggleButtonText,
583
- croppedImageData.useOriginal && styles.originalToggleButtonTextActive,
579
+ croppedImageData.useOriginal
580
+ ? styles.originalToggleButtonTextActive
581
+ : styles.originalToggleButtonTextInactive,
584
582
  ] }, mergedStrings.originalBtn))) : null,
583
+ isBusinessMode && capturedPhotos.length === 0 && (react_1.default.createElement(react_native_1.TouchableOpacity, { style: styles.captureBackButton, onPress: handleCaptureSecondPhoto, accessibilityLabel: mergedStrings.secondBtn, accessibilityRole: "button" },
584
+ react_1.default.createElement(react_native_1.Text, { style: styles.captureBackButtonText }, mergedStrings.secondBtn))),
585
+ activePreviewImage ? (react_1.default.createElement(react_native_1.Image, { source: { uri: activePreviewImage.path }, style: [
586
+ styles.previewImage,
587
+ { transform: [{ rotate: `${rotationDegrees}deg` }] }
588
+ ], resizeMode: "contain" })) : null,
585
589
  react_1.default.createElement(react_native_1.View, { style: styles.confirmationButtons },
586
590
  react_1.default.createElement(react_native_1.TouchableOpacity, { style: [styles.confirmButton, styles.retakeButton], onPress: handleRetake, accessibilityLabel: mergedStrings.retake, accessibilityRole: "button" },
587
591
  react_1.default.createElement(react_native_1.Text, { style: styles.confirmButtonText }, mergedStrings.retake)),
@@ -795,26 +799,31 @@ const styles = react_native_1.StyleSheet.create({
795
799
  },
796
800
  originalToggleButton: {
797
801
  alignSelf: 'center',
798
- marginTop: 16,
802
+ marginTop: 12,
803
+ marginBottom: 4,
799
804
  paddingVertical: 10,
800
- paddingHorizontal: 24,
801
- borderRadius: 24,
805
+ paddingHorizontal: 28,
806
+ borderRadius: 999,
802
807
  borderWidth: 1,
803
- borderColor: 'rgba(255,255,255,0.4)',
804
- backgroundColor: 'rgba(30,30,30,0.7)',
805
808
  },
806
809
  originalToggleButtonActive: {
807
- backgroundColor: 'rgba(255,255,255,0.15)',
808
- borderColor: '#fff',
810
+ backgroundColor: '#3170f3',
811
+ borderColor: '#3170f3',
812
+ },
813
+ originalToggleButtonInactive: {
814
+ backgroundColor: 'rgba(255,255,255,0.12)',
815
+ borderColor: 'rgba(255,255,255,0.25)',
809
816
  },
810
817
  originalToggleButtonText: {
811
- color: '#fff',
812
818
  fontSize: 14,
813
- fontWeight: '600',
819
+ fontWeight: '700',
814
820
  },
815
821
  originalToggleButtonTextActive: {
816
822
  color: '#fff',
817
823
  },
824
+ originalToggleButtonTextInactive: {
825
+ color: 'rgba(255,255,255,0.65)',
826
+ },
818
827
  confirmButton: {
819
828
  paddingHorizontal: 40,
820
829
  paddingVertical: 16,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-rectangle-doc-scanner",
3
- "version": "3.124.0",
3
+ "version": "3.125.0",
4
4
  "description": "Native-backed document scanner for React Native with customizable overlays.",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -96,9 +96,9 @@ type PreviewImageData = {
96
96
  };
97
97
 
98
98
  const AUTO_ENHANCE_PARAMS = {
99
- brightness: 0.08,
100
- contrast: 1.05,
101
- saturation: 0.92,
99
+ brightness: 0.18,
100
+ contrast: 1.12,
101
+ saturation: 0.78,
102
102
  };
103
103
 
104
104
  const normalizeCapturedDocument = (document: DocScannerCapture): CapturedDocument => {
@@ -811,33 +811,13 @@ export const FullDocScanner: React.FC<FullDocScannerProps> = ({
811
811
  </View>
812
812
  ) : null}
813
813
 
814
- {/* 뒷면 촬영 버튼 - 상단에 표시 (Business 모드이고 첫 번째 사진일 때만) */}
815
- {isBusinessMode && capturedPhotos.length === 0 && (
816
- <TouchableOpacity
817
- style={styles.captureBackButton}
818
- onPress={handleCaptureSecondPhoto}
819
- accessibilityLabel={mergedStrings.secondBtn}
820
- accessibilityRole="button"
821
- >
822
- <Text style={styles.captureBackButtonText}>{mergedStrings.secondBtn}</Text>
823
- </TouchableOpacity>
824
- )}
825
-
826
- {activePreviewImage ? (
827
- <Image
828
- source={{ uri: activePreviewImage.path }}
829
- style={[
830
- styles.previewImage,
831
- { transform: [{ rotate: `${rotationDegrees}deg` }] }
832
- ]}
833
- resizeMode="contain"
834
- />
835
- ) : null}
836
814
  {croppedImageData.enhanced ? (
837
815
  <TouchableOpacity
838
816
  style={[
839
817
  styles.originalToggleButton,
840
- croppedImageData.useOriginal && styles.originalToggleButtonActive,
818
+ croppedImageData.useOriginal
819
+ ? styles.originalToggleButtonActive
820
+ : styles.originalToggleButtonInactive,
841
821
  ]}
842
822
  onPress={() =>
843
823
  setCroppedImageData((prev) =>
@@ -850,13 +830,38 @@ export const FullDocScanner: React.FC<FullDocScannerProps> = ({
850
830
  <Text
851
831
  style={[
852
832
  styles.originalToggleButtonText,
853
- croppedImageData.useOriginal && styles.originalToggleButtonTextActive,
833
+ croppedImageData.useOriginal
834
+ ? styles.originalToggleButtonTextActive
835
+ : styles.originalToggleButtonTextInactive,
854
836
  ]}
855
837
  >
856
838
  {mergedStrings.originalBtn}
857
839
  </Text>
858
840
  </TouchableOpacity>
859
841
  ) : null}
842
+
843
+ {/* 뒷면 촬영 버튼 - 상단에 표시 (Business 모드이고 첫 번째 사진일 때만) */}
844
+ {isBusinessMode && capturedPhotos.length === 0 && (
845
+ <TouchableOpacity
846
+ style={styles.captureBackButton}
847
+ onPress={handleCaptureSecondPhoto}
848
+ accessibilityLabel={mergedStrings.secondBtn}
849
+ accessibilityRole="button"
850
+ >
851
+ <Text style={styles.captureBackButtonText}>{mergedStrings.secondBtn}</Text>
852
+ </TouchableOpacity>
853
+ )}
854
+
855
+ {activePreviewImage ? (
856
+ <Image
857
+ source={{ uri: activePreviewImage.path }}
858
+ style={[
859
+ styles.previewImage,
860
+ { transform: [{ rotate: `${rotationDegrees}deg` }] }
861
+ ]}
862
+ resizeMode="contain"
863
+ />
864
+ ) : null}
860
865
  <View style={styles.confirmationButtons}>
861
866
  <TouchableOpacity
862
867
  style={[styles.confirmButton, styles.retakeButton]}
@@ -1164,26 +1169,31 @@ const styles = StyleSheet.create({
1164
1169
  },
1165
1170
  originalToggleButton: {
1166
1171
  alignSelf: 'center',
1167
- marginTop: 16,
1172
+ marginTop: 12,
1173
+ marginBottom: 4,
1168
1174
  paddingVertical: 10,
1169
- paddingHorizontal: 24,
1170
- borderRadius: 24,
1175
+ paddingHorizontal: 28,
1176
+ borderRadius: 999,
1171
1177
  borderWidth: 1,
1172
- borderColor: 'rgba(255,255,255,0.4)',
1173
- backgroundColor: 'rgba(30,30,30,0.7)',
1174
1178
  },
1175
1179
  originalToggleButtonActive: {
1176
- backgroundColor: 'rgba(255,255,255,0.15)',
1177
- borderColor: '#fff',
1180
+ backgroundColor: '#3170f3',
1181
+ borderColor: '#3170f3',
1182
+ },
1183
+ originalToggleButtonInactive: {
1184
+ backgroundColor: 'rgba(255,255,255,0.12)',
1185
+ borderColor: 'rgba(255,255,255,0.25)',
1178
1186
  },
1179
1187
  originalToggleButtonText: {
1180
- color: '#fff',
1181
1188
  fontSize: 14,
1182
- fontWeight: '600',
1189
+ fontWeight: '700',
1183
1190
  },
1184
1191
  originalToggleButtonTextActive: {
1185
1192
  color: '#fff',
1186
1193
  },
1194
+ originalToggleButtonTextInactive: {
1195
+ color: 'rgba(255,255,255,0.65)',
1196
+ },
1187
1197
  confirmButton: {
1188
1198
  paddingHorizontal: 40,
1189
1199
  paddingVertical: 16,