scandit-react-native-datacapture-id 8.2.1 → 8.3.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.
Files changed (28) hide show
  1. package/android/build.gradle +29 -1
  2. package/android/generated/java/com/facebook/fbreact/specs/NativeScanditDataCaptureIdSpec.java +75 -0
  3. package/android/generated/jni/CMakeLists.txt +29 -0
  4. package/android/generated/jni/ScanditReactNativeDatacaptureIdSpec-generated.cpp +40 -0
  5. package/android/generated/jni/ScanditReactNativeDatacaptureIdSpec.h +31 -0
  6. package/android/generated/jni/react/renderer/components/ScanditReactNativeDatacaptureIdSpec/ScanditReactNativeDatacaptureIdSpecJSI-generated.cpp +33 -0
  7. package/android/generated/jni/react/renderer/components/ScanditReactNativeDatacaptureIdSpec/ScanditReactNativeDatacaptureIdSpecJSI.h +151 -0
  8. package/android/src/main/kotlin/com/scandit/datacapture/reactnative/id/{ScanditDataCaptureIdModule.kt → ScanditDataCaptureIdModuleBase.kt} +14 -31
  9. package/android/src/main/kotlin/com/scandit/datacapture/reactnative/id/ScanditDataCaptureIdPackage.kt +2 -15
  10. package/android/src/main/newArch/kotlin/com/scandit/datacapture/reactnative/id/ScanditDataCaptureIdModule.kt +53 -0
  11. package/android/src/main/oldArch/kotlin/com/scandit/datacapture/reactnative/id/ScanditDataCaptureIdModule.kt +63 -0
  12. package/dist/id.js +26 -12
  13. package/dist/id.js.map +1 -1
  14. package/dist/index.js.map +1 -1
  15. package/dist/tsconfig.tsbuildinfo +1 -1
  16. package/ios/Sources/NewArch/ScanditDataCaptureId.mm +95 -0
  17. package/ios/Sources/OldArch/ScanditDataCaptureId.mm +83 -0
  18. package/ios/Sources/ScanditDataCaptureId.h +25 -0
  19. package/ios/Sources/ScanditDataCaptureId.swift +51 -26
  20. package/ios/generated/ScanditReactNativeDatacaptureIdSpec/ScanditReactNativeDatacaptureIdSpec-generated.mm +53 -0
  21. package/ios/generated/ScanditReactNativeDatacaptureIdSpec/ScanditReactNativeDatacaptureIdSpec.h +103 -0
  22. package/ios/generated/ScanditReactNativeDatacaptureIdSpecJSI-generated.cpp +33 -0
  23. package/ios/generated/ScanditReactNativeDatacaptureIdSpecJSI.h +151 -0
  24. package/package.json +24 -11
  25. package/react-native.config.js +12 -0
  26. package/scandit-react-native-datacapture-id.podspec +17 -30
  27. package/specs/NativeScanditDataCaptureId.ts +29 -0
  28. package/ios/Sources/ScanditDataCaptureId.m +0 -9
package/dist/id.js CHANGED
@@ -1,21 +1,26 @@
1
- import { nameForSerialization, ignoreFromSerializationIfNull, DefaultSerializeable, FactoryMaker, Feedback, Sound, CameraSettings, Color, BaseController, ignoreFromSerialization, Brush, registerProxies, EventDataParser } from 'scandit-react-native-datacapture-core/dist/core';
1
+ import { nameForSerialization, ignoreFromSerializationIfNull, DefaultSerializeable, FactoryMaker, Feedback, Sound, CameraSettings, Color, BaseController, ignoreFromSerialization, Brush, registerProxies, EventDataParser, SKIP } from 'scandit-react-native-datacapture-core/dist/core';
2
2
 
3
3
  class DateResult {
4
- get day() { return this.json.day; }
5
- get month() { return this.json.month; }
6
- get year() { return this.json.year; }
4
+ constructor(day, month, year) {
5
+ this._day = day !== null && day !== void 0 ? day : 1;
6
+ this._month = month !== null && month !== void 0 ? month : 1;
7
+ this._year = year;
8
+ }
9
+ get day() { return this._day; }
10
+ get month() { return this._month; }
11
+ get year() { return this._year; }
7
12
  get localDate() {
8
- return new Date(this.json.year, this.json.month ? this.json.month - 1 : 1, this.json.day || 1);
13
+ return new Date(this._year, this._month - 1, this._day);
9
14
  }
10
15
  get utcDate() {
11
- return new Date(Date.UTC(this.json.year, this.json.month ? this.json.month - 1 : 1, this.json.day || 1));
16
+ return new Date(Date.UTC(this._year, this._month - 1, this._day));
12
17
  }
13
18
  static fromJSON(json) {
19
+ var _a, _b;
14
20
  if (json === null || json === undefined) {
15
21
  return null;
16
22
  }
17
- const dateResult = new DateResult();
18
- dateResult.json = json;
23
+ const dateResult = new DateResult((_a = json.day) !== null && _a !== void 0 ? _a : null, (_b = json.month) !== null && _b !== void 0 ? _b : null, json.year);
19
24
  return dateResult;
20
25
  }
21
26
  }
@@ -994,7 +999,7 @@ class DrivingLicenseDetails {
994
999
  }
995
1000
  get drivingLicenseCategories() {
996
1001
  if (this._drivingLicenseCategories.length === 0) {
997
- this._drivingLicenseCategories = this.json.drivingLicenseCategories.map(categoryJson => DrivingLicenseCategory.fromJSON(categoryJson)).filter(category => category !== null);
1002
+ this._drivingLicenseCategories = this.json.drivingLicenseCategories.map(categoryJson => DrivingLicenseCategory.fromJSON(categoryJson)).filter((category) => category !== null);
998
1003
  }
999
1004
  return this._drivingLicenseCategories;
1000
1005
  }
@@ -1485,7 +1490,7 @@ class MobileDocumentResult {
1485
1490
  }
1486
1491
  get drivingLicenseCategories() {
1487
1492
  if (this._drivingLicenseCategories.length === 0) {
1488
- this._drivingLicenseCategories = this.json.drivingLicenseCategories.map(categoryJson => DrivingLicenseCategory.fromJSON(categoryJson)).filter(category => category !== null);
1493
+ this._drivingLicenseCategories = this.json.drivingLicenseCategories.map(categoryJson => DrivingLicenseCategory.fromJSON(categoryJson)).filter((category) => category !== null);
1489
1494
  }
1490
1495
  return this._drivingLicenseCategories;
1491
1496
  }
@@ -1762,6 +1767,9 @@ class CapturedId {
1762
1767
  }
1763
1768
  return this._verificationResult;
1764
1769
  }
1770
+ get rejectionDiagnosticJSON() {
1771
+ return this.json.rejectionDiagnosticJSON;
1772
+ }
1765
1773
  get anonymizedFields() {
1766
1774
  return this.json.anonymizedFields.map(field => field);
1767
1775
  }
@@ -2110,7 +2118,10 @@ class IdCaptureListenerController extends BaseController {
2110
2118
  }
2111
2119
  handleDidCapture(ev) {
2112
2120
  return __awaiter(this, void 0, void 0, function* () {
2113
- const event = EventDataParser.parse(ev.data);
2121
+ const event = EventDataParser.parseIfShouldHandle(ev, { modeId: this.modeId });
2122
+ if (event === SKIP) {
2123
+ return;
2124
+ }
2114
2125
  if (event === null) {
2115
2126
  console.error('IdCaptureListenerController didCapture payload is null');
2116
2127
  return;
@@ -2124,7 +2135,10 @@ class IdCaptureListenerController extends BaseController {
2124
2135
  }
2125
2136
  handleDidReject(ev) {
2126
2137
  return __awaiter(this, void 0, void 0, function* () {
2127
- const event = EventDataParser.parse(ev.data);
2138
+ const event = EventDataParser.parseIfShouldHandle(ev, { modeId: this.modeId });
2139
+ if (event === SKIP) {
2140
+ return;
2141
+ }
2128
2142
  if (event === null) {
2129
2143
  console.error('IdCaptureListenerController didReject payload is null');
2130
2144
  return;