@regulaforensics/react-native-document-reader-api 5.8.0 → 6.1.2

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.
Files changed (54) hide show
  1. package/README.md +2 -2
  2. package/RNDocumentReaderApi.podspec +2 -2
  3. package/android/build.gradle +4 -6
  4. package/android/src/main/java/com/regula/documentreader/Helpers.java +8 -3
  5. package/android/src/main/java/com/regula/documentreader/JSONConstructor.java +110 -10
  6. package/android/src/main/java/com/regula/documentreader/RNRegulaDocumentReaderModule.java +58 -26
  7. package/android/src/main/java/com/regula/documentreader/RegulaConfig.java +72 -9
  8. package/example/.editorconfig +3 -0
  9. package/example/.flowconfig +4 -13
  10. package/example/.gitattributes +3 -1
  11. package/example/.prettierrc.js +1 -0
  12. package/example/App.js +30 -18
  13. package/example/android/app/BUCK +55 -0
  14. package/example/android/app/build.gradle +35 -17
  15. package/example/android/app/debug.keystore +0 -0
  16. package/example/android/app/src/debug/AndroidManifest.xml +6 -1
  17. package/example/android/app/src/main/AndroidManifest.xml +21 -22
  18. package/example/android/app/src/main/assets/index.android.bundle +636 -0
  19. package/example/android/app/src/main/java/com/regula/dr/fullrfid/MainApplication.java +1 -2
  20. package/example/android/app/src/main/res/drawable-mdpi/images_id.png +0 -0
  21. package/example/android/app/src/main/res/drawable-mdpi/images_portrait.png +0 -0
  22. package/example/android/app/src/main/res/drawable-mdpi/node_modules_reactnativecheckbox_img_ic_check_box.png +0 -0
  23. package/example/android/app/src/main/res/drawable-mdpi/node_modules_reactnativecheckbox_img_ic_check_box_outline_blank.png +0 -0
  24. package/example/android/app/src/main/res/drawable-mdpi/node_modules_reactnativecheckbox_img_ic_indeterminate_check_box.png +0 -0
  25. package/example/android/app/src/main/res/drawable-xhdpi/node_modules_reactnativecheckbox_img_ic_check_box.png +0 -0
  26. package/example/android/app/src/main/res/drawable-xhdpi/node_modules_reactnativecheckbox_img_ic_check_box_outline_blank.png +0 -0
  27. package/example/android/app/src/main/res/drawable-xxhdpi/node_modules_reactnativecheckbox_img_ic_check_box.png +0 -0
  28. package/example/android/app/src/main/res/drawable-xxhdpi/node_modules_reactnativecheckbox_img_ic_check_box_outline_blank.png +0 -0
  29. package/example/android/build.gradle +12 -6
  30. package/example/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  31. package/example/android/gradle/wrapper/gradle-wrapper.properties +1 -1
  32. package/example/android/gradle.properties +2 -1
  33. package/example/android/gradlew +14 -17
  34. package/example/android/gradlew.bat +7 -18
  35. package/example/android/settings.gradle +0 -2
  36. package/example/ios/DocumentReader/AppDelegate.m +7 -3
  37. package/example/ios/DocumentReader/Info.plist +8 -10
  38. package/example/ios/DocumentReader/LaunchScreen.storyboard +47 -0
  39. package/example/ios/DocumentReader.xcodeproj/project.pbxproj +257 -96
  40. package/example/ios/DocumentReader.xcodeproj/xcshareddata/xcschemes/DocumentReader.xcscheme +1 -1
  41. package/example/ios/DocumentReaderTests/DocumentReaderTests.m +65 -0
  42. package/example/ios/DocumentReaderTests/Info.plist +24 -0
  43. package/example/ios/Podfile +13 -4
  44. package/example/metro.config.js +1 -1
  45. package/example/package.json +17 -18
  46. package/index.d.ts +724 -514
  47. package/index.js +672 -510
  48. package/ios/RGLWJSONConstructor.h +6 -0
  49. package/ios/RGLWJSONConstructor.m +92 -0
  50. package/ios/RNRegulaDocumentReader.m +34 -25
  51. package/ios/RegulaConfig.h +2 -0
  52. package/ios/RegulaConfig.m +119 -31
  53. package/package.json +1 -1
  54. package/example/ios/DocumentReader.xcodeproj/xcshareddata/xcschemes/DocumentReader-tvOS.xcscheme +0 -88
@@ -0,0 +1,65 @@
1
+ #import <UIKit/UIKit.h>
2
+ #import <XCTest/XCTest.h>
3
+
4
+ #import <React/RCTLog.h>
5
+ #import <React/RCTRootView.h>
6
+
7
+ #define TIMEOUT_SECONDS 600
8
+ #define TEXT_TO_LOOK_FOR @"Welcome to React"
9
+
10
+ @interface DocumentReaderTests : XCTestCase
11
+
12
+ @end
13
+
14
+ @implementation DocumentReaderTests
15
+
16
+ - (BOOL)findSubviewInView:(UIView *)view matching:(BOOL(^)(UIView *view))test
17
+ {
18
+ if (test(view)) {
19
+ return YES;
20
+ }
21
+ for (UIView *subview in [view subviews]) {
22
+ if ([self findSubviewInView:subview matching:test]) {
23
+ return YES;
24
+ }
25
+ }
26
+ return NO;
27
+ }
28
+
29
+ - (void)testRendersWelcomeScreen
30
+ {
31
+ UIViewController *vc = [[[RCTSharedApplication() delegate] window] rootViewController];
32
+ NSDate *date = [NSDate dateWithTimeIntervalSinceNow:TIMEOUT_SECONDS];
33
+ BOOL foundElement = NO;
34
+
35
+ __block NSString *redboxError = nil;
36
+ #ifdef DEBUG
37
+ RCTSetLogFunction(^(RCTLogLevel level, RCTLogSource source, NSString *fileName, NSNumber *lineNumber, NSString *message) {
38
+ if (level >= RCTLogLevelError) {
39
+ redboxError = message;
40
+ }
41
+ });
42
+ #endif
43
+
44
+ while ([date timeIntervalSinceNow] > 0 && !foundElement && !redboxError) {
45
+ [[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];
46
+ [[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];
47
+
48
+ foundElement = [self findSubviewInView:vc.view matching:^BOOL(UIView *view) {
49
+ if ([view.accessibilityLabel isEqualToString:TEXT_TO_LOOK_FOR]) {
50
+ return YES;
51
+ }
52
+ return NO;
53
+ }];
54
+ }
55
+
56
+ #ifdef DEBUG
57
+ RCTSetLogFunction(RCTDefaultLogFunction);
58
+ #endif
59
+
60
+ XCTAssertNil(redboxError, @"RedBox error: %@", redboxError);
61
+ XCTAssertTrue(foundElement, @"Couldn't find element with text '%@' in %d seconds", TEXT_TO_LOOK_FOR, TIMEOUT_SECONDS);
62
+ }
63
+
64
+
65
+ @end
@@ -0,0 +1,24 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+ <plist version="1.0">
4
+ <dict>
5
+ <key>CFBundleDevelopmentRegion</key>
6
+ <string>en</string>
7
+ <key>CFBundleExecutable</key>
8
+ <string>$(EXECUTABLE_NAME)</string>
9
+ <key>CFBundleIdentifier</key>
10
+ <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
11
+ <key>CFBundleInfoDictionaryVersion</key>
12
+ <string>6.0</string>
13
+ <key>CFBundleName</key>
14
+ <string>$(PRODUCT_NAME)</string>
15
+ <key>CFBundlePackageType</key>
16
+ <string>BNDL</string>
17
+ <key>CFBundleShortVersionString</key>
18
+ <string>1.0</string>
19
+ <key>CFBundleSignature</key>
20
+ <string>????</string>
21
+ <key>CFBundleVersion</key>
22
+ <string>1</string>
23
+ </dict>
24
+ </plist>
@@ -1,15 +1,24 @@
1
1
  require_relative '../node_modules/react-native/scripts/react_native_pods'
2
2
  require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
3
3
 
4
- platform :ios, '10.0'
4
+ platform :ios, '11.0'
5
5
 
6
6
  target 'DocumentReader' do
7
7
  config = use_native_modules!
8
8
 
9
- use_react_native!(:path => config["reactNativePath"])
9
+ use_react_native!(
10
+ :path => config[:reactNativePath],
11
+ :hermes_enabled => false
12
+ )
13
+
14
+ target 'DocumentReaderTests' do
15
+ inherit! :complete
16
+ end
17
+
18
+ use_flipper!()
10
19
 
11
- use_flipper!({ 'Flipper' => '0.87.0', 'Flipper-Folly' => '2.5.3', 'Flipper-RSocket' => '1.3.1' })
12
20
  post_install do |installer|
13
- flipper_post_install(installer)
21
+ react_native_post_install(installer)
22
+ __apply_Xcode_12_5_M1_post_install_workaround(installer)
14
23
  end
15
24
  end
@@ -10,7 +10,7 @@ module.exports = {
10
10
  getTransformOptions: async () => ({
11
11
  transform: {
12
12
  experimentalImportSupport: false,
13
- inlineRequires: false,
13
+ inlineRequires: true,
14
14
  },
15
15
  }),
16
16
  },
@@ -7,29 +7,28 @@
7
7
  "ios": "react-native run-ios",
8
8
  "start": "react-native start",
9
9
  "test": "jest",
10
- "lint": "eslint .",
11
- "build:ios": "react-native bundle --entry-file='index.js' --bundle-output='./ios/main.jsbundle' --dev=false --platform='ios'"
10
+ "lint": "eslint ."
12
11
  },
13
12
  "dependencies": {
14
- "react": "16.13.1",
15
- "react-native": "0.63.4",
13
+ "@regulaforensics/react-native-document-reader-api": "^6.1.2",
14
+ "@regulaforensics/react-native-document-reader-core-fullrfid": "^6.1.1",
15
+ "react": "17.0.2",
16
+ "react-native": "^0.67.0",
16
17
  "react-native-check-box": "^2.1.7",
17
- "react-native-customized-image-picker": "^1.1.0",
18
- "@regulaforensics/react-native-document-reader-api": "^5.8.0",
19
- "@regulaforensics/react-native-document-reader-core-fullrfid": "^5.8.0",
20
- "react-native-progress": "^4.1.2",
21
- "react-native-fs": "^2.16.6",
22
- "react-native-radio-buttons-group": "^1.0.7"
18
+ "react-native-fs": "^2.18.0",
19
+ "react-native-image-picker": "^4.1.2",
20
+ "react-native-progress": "5.0.0",
21
+ "react-native-radio-buttons-group": "^2.2.7"
23
22
  },
24
23
  "devDependencies": {
25
- "@babel/core": "^7.6.2",
26
- "@babel/runtime": "^7.6.2",
27
- "@react-native-community/eslint-config": "^0.0.5",
28
- "babel-jest": "^24.9.0",
29
- "eslint": "^6.5.1",
30
- "jest": "^24.9.0",
31
- "metro-react-native-babel-preset": "^0.58.0",
32
- "react-test-renderer": "16.11.0"
24
+ "@babel/core": "7.16.0",
25
+ "@babel/runtime": "7.16.0",
26
+ "@react-native-community/eslint-config": "2.0.0",
27
+ "babel-jest": "26.6.3",
28
+ "eslint": "7.14.0",
29
+ "jest": "26.6.3",
30
+ "metro-react-native-babel-preset": "^0.66.2",
31
+ "react-test-renderer": "17.0.2"
33
32
  },
34
33
  "jest": {
35
34
  "preset": "react-native"