Skip to content

Commit

Permalink
DOT web samples release v1.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
TvojTatk0 committed Feb 25, 2022
1 parent 0ca43d2 commit d7493f9
Show file tree
Hide file tree
Showing 16 changed files with 1,072 additions and 863 deletions.
8 changes: 4 additions & 4 deletions angular-components-integration/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angular-components-integration",
"version": "0.0.0",
"version": "1.0.1",
"scripts": {
"copy-sam": "cp ./node_modules/@innovatrics/dot-document-auto-capture/sam.wasm ./src",
"ng": "ng",
Expand All @@ -19,8 +19,8 @@
"@angular/platform-browser": "~13.1.0",
"@angular/platform-browser-dynamic": "~13.1.0",
"@angular/router": "~13.1.0",
"@innovatrics/dot-document-auto-capture": "^3.0.2",
"@innovatrics/dot-face-auto-capture": "^3.0.2",
"@innovatrics/dot-document-auto-capture": "^3.1.0",
"@innovatrics/dot-face-auto-capture": "^3.1.0",
"rxjs": "~7.4.0",
"tslib": "^2.3.0",
"zone.js": "~0.11.4"
Expand All @@ -40,4 +40,4 @@
"karma-jasmine-html-reporter": "~1.7.0",
"typescript": "~4.5.2"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,28 @@ import '@innovatrics/dot-document-auto-capture';
export class DocumentAutoCaptureComponent implements OnInit {
@Output() photoTakenCallBack = new EventEmitter<PhotoTakenCbProps>();

constructor(private ngZone: NgZone) { }
constructor(private ngZone: NgZone) {}

ngOnInit(): void {
this.initDocumentAutoCapture();
}

initDocumentAutoCapture() {
const documentElement = document.getElementById('dot-document-auto-capture') as HTMLDocumentCaptureElement | null;
const documentElement = document.getElementById(
'dot-document-auto-capture'
) as HTMLDocumentCaptureElement | null;

if (documentElement) {
documentElement.cameraOptions = {
imageType: 'png',
cameraFacing: 'environment',
detectionLayerVisible: true,
photoTakenCb: (image, data) => {
this.ngZone.run(() => {
this.photoTakenCallBack.emit({ image, data });
});
}
}
},
};
}
}
}
91 changes: 46 additions & 45 deletions angular-components-integration/src/app/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,64 +6,64 @@ export enum Step {
}

export type PhotoTakenCbProps = {
image: Blob,
data: DocumentComponentData | FaceComponentData
}
image: Blob;
data: DocumentComponentData | FaceComponentData;
};

export enum DocumentValidationMode {
STANDARD = "standard",
STRICT = "strict",
STANDARD = 'standard',
STRICT = 'strict',
}

export type DocumentPlaceholder =
| "id-rectangle-corners-front"
| "id-rectangle-dash-front"
| "id-rectangle-dot-front"
| "id-rectangle-solid-front"
| "id-rounded-rectangle-photo-front"
| "id-rounded-rectangle-corners-front"
| "id-rounded-rectangle-dash-front"
| "id-rounded-rectangle-dot-front"
| "id-rounded-rectangle-solid-back"
| "id-rounded-rectangle-solid-front"
| "pass-rounded-rectangle-solid-back"
| "pass-rounded-rectangle-solid-back-blank";
| 'id-rectangle-corners-front'
| 'id-rectangle-dash-front'
| 'id-rectangle-dot-front'
| 'id-rectangle-solid-front'
| 'id-rounded-rectangle-photo-front'
| 'id-rounded-rectangle-corners-front'
| 'id-rounded-rectangle-dash-front'
| 'id-rounded-rectangle-dot-front'
| 'id-rounded-rectangle-solid-back'
| 'id-rounded-rectangle-solid-front'
| 'pass-rounded-rectangle-solid-back'
| 'pass-rounded-rectangle-solid-back-blank';

export type FacePlaceholder =
| "circle-solid"
| "ellipse-solid"
| "man-solid"
| "woman-solid"
| "square-rounded-dash"
| "square-rounded-solid"
| "square-dash"
| "square-solid";
| 'circle-solid'
| 'ellipse-solid'
| 'man-solid'
| 'woman-solid'
| 'square-rounded-dash'
| 'square-rounded-solid'
| 'square-dash'
| 'square-solid';

export type FacingMode = "environment" | "user";
export type FacingMode = 'environment' | 'user';

export type ImageType = "jpeg" | "png";
export type ImageType = 'jpeg' | 'png';

export type FaceInstructionCode =
| "candidate_selection"
| "face_too_close"
| "face_too_far"
| "face_centering"
| "face_not_present"
| "lighting";
| 'candidate_selection'
| 'face_too_close'
| 'face_too_far'
| 'face_centering'
| 'face_not_present'
| 'lighting';

export type DocumentInstructionCode =
| "candidate_selection"
| "document_centering"
| "document_too_close"
| "document_not_present"
| "document_too_far"
| "sharpness_too_low"
| "brightness_too_low"
| "brightness_too_high"
| "hotspots_present"
| "hold_still";

export type MediaType = "image/jpeg" | "image/png";
| 'candidate_selection'
| 'document_centering'
| 'document_too_close'
| 'document_not_present'
| 'document_too_far'
| 'sharpness_too_low'
| 'brightness_too_low'
| 'brightness_too_high'
| 'hotspots_present'
| 'hold_still';

export type MediaType = 'image/jpeg' | 'image/png';

export type HTMLDocumentCaptureElement = HTMLElement & {
cameraOptions: DocumentCameraProps;
Expand Down Expand Up @@ -157,6 +157,7 @@ export type BaseCameraProps = {
export type DocumentCameraProps = BaseCameraProps & {
photoTakenCb: DocumentCallback;
thresholds?: DocumentThresholds;
detectionLayerVisible?: boolean;
validationMode?: DocumentValidationMode;
uiCustomisation?: {
placeholder?: {
Expand Down
16 changes: 8 additions & 8 deletions angular-components-integration/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1225,10 +1225,10 @@
resolved "https://registry.yarnpkg.com/@gar/promisify/-/promisify-1.1.2.tgz#30aa825f11d438671d585bd44e7fd564535fc210"
integrity sha512-82cpyJyKRoQoRi+14ibCeGPu0CwypgtBAdBhq1WfvagpCZNKqwXbKwXllYSMG91DhmG4jt9gN8eP6lGOtozuaw==

"@innovatrics/dot-document-auto-capture@^3.0.2":
version "3.0.2"
resolved "https://registry.yarnpkg.com/@innovatrics/dot-document-auto-capture/-/dot-document-auto-capture-3.0.2.tgz#626730274404201f88b1fa5a7c4f1c75db859648"
integrity sha512-3QJi+FQj/24XMTxNvMrpL60bY3UlvtZoSuunKghkDZsjVhF162FMn6YrcTkF8iBFeGi5ykK1HWfKaE2GBFyqPQ==
"@innovatrics/dot-document-auto-capture@^3.1.0":
version "3.1.0"
resolved "https://registry.yarnpkg.com/@innovatrics/dot-document-auto-capture/-/dot-document-auto-capture-3.1.0.tgz#bcdfe83696447341856e0534fdece87e143bd0fc"
integrity sha512-JW7kKZuU9m51zSEqIHf44g3r5sFiIK9yKpfuwoiKcseR70qiUc0BJ6+RGaOPMqeH2FKyefcatSnEtc9rYKPchw==
dependencies:
"@types/emscripten" "^1.39.5"
polished "^4.1.0"
Expand All @@ -1238,10 +1238,10 @@
styled-components "^5.2.1"
tar "^6.1.11"

"@innovatrics/dot-face-auto-capture@^3.0.2":
version "3.0.2"
resolved "https://registry.yarnpkg.com/@innovatrics/dot-face-auto-capture/-/dot-face-auto-capture-3.0.2.tgz#cffd2ea850fcada167d2e7e8788ab9aef3903342"
integrity sha512-IFg/K98NZ6O5p2t+CSzvWFZrgHrOBe/If3pEU6KZWJ2NvKkkr42osHIkuOlOLcFyeePBgdmMtTMps3kxfzQfcw==
"@innovatrics/dot-face-auto-capture@^3.1.0":
version "3.1.0"
resolved "https://registry.yarnpkg.com/@innovatrics/dot-face-auto-capture/-/dot-face-auto-capture-3.1.0.tgz#0f702b09fa5d23f0da7c90de5d986c549b48c939"
integrity sha512-GETIEChdBCyan4GtZccXs6m8WbomGpZnrGnAdXScpIy6nk3X/T4mHID0QnteaMUOtl1XG5vVpzz8CWEDpZNAZQ==
dependencies:
polished "^4.1.0"
preact "^10.5.12"
Expand Down
Loading

0 comments on commit d7493f9

Please sign in to comment.