Skip to content

Commit

Permalink
DOT web samples release v1.0.6
Browse files Browse the repository at this point in the history
  • Loading branch information
TvojTatk0 committed Aug 10, 2022
1 parent 941c04e commit 0b8421a
Show file tree
Hide file tree
Showing 24 changed files with 627 additions and 1,042 deletions.
6 changes: 3 additions & 3 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": "1.0.5",
"version": "1.0.6",
"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.3.1",
"@innovatrics/dot-face-auto-capture": "3.3.1",
"@innovatrics/dot-document-auto-capture": "3.4.1",
"@innovatrics/dot-face-auto-capture": "3.4.1",
"rxjs": "~7.4.0",
"tslib": "^2.3.0",
"zone.js": "~0.11.4"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Component, OnInit, Output, EventEmitter, NgZone } from '@angular/core';
import { PhotoTakenCbProps, Step } from 'src/app/types';
import '@innovatrics/dot-document-auto-capture';
import { HTMLDocumentCaptureElement } from '@innovatrics/auto-capture';
import type { HTMLDocumentCaptureElement } from '@innovatrics/dot-document-auto-capture';

@Component({
selector: 'app-document-auto-capture',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Component, NgZone, OnInit, Output, EventEmitter } from '@angular/core';
import { PhotoTakenCbProps, Step } from 'src/app/types';
import '@innovatrics/dot-face-auto-capture'
import { HTMLDocumentCaptureElement } from '@innovatrics/auto-capture';
import type { HTMLDocumentCaptureElement } from '@innovatrics/dot-document-auto-capture';

@Component({
selector: 'app-face-auto-capture',
Expand Down
3 changes: 2 additions & 1 deletion angular-components-integration/src/app/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { DocumentComponentData, FaceComponentData } from "@innovatrics/auto-capture";
import type { DocumentComponentData } from "@innovatrics/dot-document-auto-capture";
import type { FaceComponentData } from "@innovatrics/dot-face-auto-capture";

export enum Step {
SELECT_COMPONENT,
Expand Down
98 changes: 22 additions & 76 deletions angular-components-integration/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1144,7 +1144,7 @@
dependencies:
regenerator-runtime "^0.13.4"

"@babel/runtime@^7.17.8", "@babel/runtime@^7.2.0", "@babel/runtime@^7.8.4":
"@babel/runtime@^7.8.4":
version "7.18.3"
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.18.3.tgz#c7b654b57f6f63cf7f8b418ac9ca04408c4579f4"
integrity sha512-38Y8f7YUhce/K7RMwTp7m0uCumpv9hZkitCbBClqQIow1qSbCvGkcegKOXpEWCQLfWmevgRiWokZ1GkpfhbZug==
Expand Down Expand Up @@ -1242,29 +1242,23 @@
resolved "https://registry.yarnpkg.com/@gar/promisify/-/promisify-1.1.3.tgz#555193ab2e3bb3b6adc3d551c9c030d9e860daf6"
integrity sha512-k2Ty1JcVojjJFwrg/ThKi2ujJ7XNLYaFGNB/bWT9wGR+oSMJHMa5w+CUq6p/pVrKeNNgA7pCqEcjSnHVoqJQFw==

"@innovatrics/dot-document-auto-capture@3.3.1":
version "3.3.1"
resolved "https://registry.yarnpkg.com/@innovatrics/dot-document-auto-capture/-/dot-document-auto-capture-3.3.1.tgz#cf0eebf504f7527a5a8a68362c9aeef121fa39bc"
integrity sha512-Ug0EyQTtYYS+Sk877zfGO2hgAQVVzmWhgWO+yS7v0Hy0xOUPgTVPEO2r0k9vJlikU4JWOwoKsOb2b7KVREVi1w==
"@innovatrics/dot-document-auto-capture@3.4.1":
version "3.4.1"
resolved "https://registry.yarnpkg.com/@innovatrics/dot-document-auto-capture/-/dot-document-auto-capture-3.4.1.tgz#bb23482f187b9b099835de8b92513c250a8acbf5"
integrity sha512-XyE+R65Vvr28z3/E0x+JXVUhX4/6Ap/TQpMotxXzBc4DVDF8lUs7hKcMyE6W72Xtpu9xu+cDip95okEXgmpDpA==
dependencies:
"@types/emscripten" "^1.39.5"
polished "^4.1.0"
preact "^10.5.12"
preact "^10.9.0"
preact-custom-element "^4.2.1"
react-measure "^2.5.2"
styled-components "^5.2.1"
tar "^6.1.11"
styled-components "^5.3.5"

"@innovatrics/dot-face-auto-capture@3.3.1":
version "3.3.1"
resolved "https://registry.yarnpkg.com/@innovatrics/dot-face-auto-capture/-/dot-face-auto-capture-3.3.1.tgz#677913cb1f8858e0eec095a3561671c4e05fb527"
integrity sha512-TFcK3u+MZHmxx6kCQR2Mx2J51QUcL4vjtslPQpg3KHWqHCIOT53eS/Vceo0SwaxJeuKE5031cXZRWylvLTjswA==
"@innovatrics/dot-face-auto-capture@3.4.1":
version "3.4.1"
resolved "https://registry.yarnpkg.com/@innovatrics/dot-face-auto-capture/-/dot-face-auto-capture-3.4.1.tgz#997f2ca4c2bd68dce06214f4adb7c891498c6e65"
integrity sha512-9m7TpXuFJrQk+OofnBNldBXPq+5C+HFvcryTrtXzfdwczMPOWF2ouYbycMwZ0fGY9CTp1ob1RmiV8nr6Zasy+g==
dependencies:
polished "^4.1.0"
preact "^10.5.12"
preact "^10.9.0"
preact-custom-element "^4.2.1"
react-measure "^2.5.2"
styled-components "^5.2.1"
styled-components "^5.3.5"

"@istanbuljs/load-nyc-config@^1.0.0":
version "1.1.0"
Expand Down Expand Up @@ -1442,11 +1436,6 @@
resolved "https://registry.yarnpkg.com/@types/cors/-/cors-2.8.12.tgz#6b2c510a7ad7039e98e7b8d3d6598f4359e5c080"
integrity sha512-vt+kDhq/M2ayberEtJcIN/hxXy1Pk+59g2FV/ZQceeaTyCtCucjL2Q7FXlFjtWn4n15KCr1NE2lNNFhp0lEThw==

"@types/emscripten@^1.39.5":
version "1.39.6"
resolved "https://registry.yarnpkg.com/@types/emscripten/-/emscripten-1.39.6.tgz#698b90fe60d44acf93c31064218fbea93fbfd85a"
integrity sha512-H90aoynNhhkQP6DRweEjJp5vfUVdIj7tdPLsu7pq89vODD/lcugKfZOsfgwpvM6XUewEp2N5dCg1Uf3Qe55Dcg==

"@types/eslint-scope@^3.7.0":
version "3.7.3"
resolved "https://registry.yarnpkg.com/@types/eslint-scope/-/eslint-scope-3.7.3.tgz#125b88504b61e3c8bc6f870882003253005c3224"
Expand Down Expand Up @@ -3302,11 +3291,6 @@ get-intrinsic@^1.0.2, get-intrinsic@^1.1.1:
has "^1.0.3"
has-symbols "^1.0.1"

get-node-dimensions@^1.2.1:
version "1.2.1"
resolved "https://registry.yarnpkg.com/get-node-dimensions/-/get-node-dimensions-1.2.1.tgz#fb7b4bb57060fb4247dd51c9d690dfbec56b0823"
integrity sha512-2MSPMu7S1iOTL+BOa6K1S62hB2zUAYNF/lV0gSVlOaacd087lc6nR1H1r0e3B1CerTo+RceOmi1iJW+vp21xcQ==

get-package-type@^0.1.0:
version "0.1.0"
resolved "https://registry.yarnpkg.com/get-package-type/-/get-package-type-0.1.0.tgz#8de2d803cff44df3bc6c456e6668b36c3926e11a"
Expand Down Expand Up @@ -3922,7 +3906,7 @@ jest-worker@^27.4.5:
merge-stream "^2.0.0"
supports-color "^8.0.0"

"js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0:
js-tokens@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499"
integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==
Expand Down Expand Up @@ -4179,13 +4163,6 @@ log4js@^6.4.1:
rfdc "^1.3.0"
streamroller "^3.1.1"

loose-envify@^1.4.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf"
integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==
dependencies:
js-tokens "^3.0.0 || ^4.0.0"

lru-cache@^6.0.0:
version "6.0.0"
resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94"
Expand Down Expand Up @@ -4618,7 +4595,7 @@ nth-check@^2.0.1:
dependencies:
boolbase "^1.0.0"

object-assign@^4, object-assign@^4.1.1:
object-assign@^4:
version "4.1.1"
resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863"
integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=
Expand Down Expand Up @@ -4909,13 +4886,6 @@ pkg-dir@^4.1.0:
dependencies:
find-up "^4.0.0"

polished@^4.1.0:
version "4.2.2"
resolved "https://registry.yarnpkg.com/polished/-/polished-4.2.2.tgz#2529bb7c3198945373c52e34618c8fe7b1aa84d1"
integrity sha512-Sz2Lkdxz6F2Pgnpi9U5Ng/WdWAUZxmHrNPoVlm3aAemxoy2Qy7LGjQg4uf8qKelDAUW94F4np3iH2YPf2qefcQ==
dependencies:
"@babel/runtime" "^7.17.8"

portfinder@^1.0.28:
version "1.0.28"
resolved "https://registry.yarnpkg.com/portfinder/-/portfinder-1.0.28.tgz#67c4622852bd5374dd1dd900f779f53462fac778"
Expand Down Expand Up @@ -5221,10 +5191,10 @@ preact-custom-element@^4.2.1:
resolved "https://registry.yarnpkg.com/preact-custom-element/-/preact-custom-element-4.2.1.tgz#a18752ef60823ea61199d9cdc1866e51139b3f46"
integrity sha512-/fiEEAyC+MXRlCBRmv/owoN5BLpO2nF/MF3YBHLtp4C2lNqlhV+a4he74A5DhfDoRmxDHm0sYVgQzWFEyzTDsw==

preact@^10.5.12:
version "10.7.2"
resolved "https://registry.yarnpkg.com/preact/-/preact-10.7.2.tgz#5c632ba194b87345dcaee6598b3b6529b58e6a12"
integrity sha512-GLjn0I3r6ka+NvxJUppsVFqb4V0qDTEHT/QxHlidPuClGaxF/4AI2Qti4a0cv3XMh5n1+D3hLScW10LRIm5msQ==
preact@^10.9.0:
version "10.10.1"
resolved "https://registry.yarnpkg.com/preact/-/preact-10.10.1.tgz#df67e4348f50fc6ad2e11e813553f15c6543176b"
integrity sha512-cXljG59ylGtSLismoLojXPAGvnh2ipQr3BYz9KZQr+1sdASCT+sR/v8dSMDS96xGCdtln2wHfAHCnLJK+XcBNg==

pretty-bytes@^5.3.0:
version "5.6.0"
Expand All @@ -5249,15 +5219,6 @@ promise-retry@^2.0.1:
err-code "^2.0.2"
retry "^0.12.0"

prop-types@^15.6.2:
version "15.8.1"
resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.8.1.tgz#67d87bf1a694f48435cf332c24af10214a3140b5"
integrity sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==
dependencies:
loose-envify "^1.4.0"
object-assign "^4.1.1"
react-is "^16.13.1"

proxy-addr@~2.0.7:
version "2.0.7"
resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.7.tgz#f19fe69ceab311eeb94b42e70e8c2070f9ba1025"
Expand Down Expand Up @@ -5325,21 +5286,11 @@ [email protected]:
iconv-lite "0.4.24"
unpipe "1.0.0"

react-is@^16.13.1, react-is@^16.7.0:
react-is@^16.7.0:
version "16.13.1"
resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4"
integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==

react-measure@^2.5.2:
version "2.5.2"
resolved "https://registry.yarnpkg.com/react-measure/-/react-measure-2.5.2.tgz#4ffc410e8b9cb836d9455a9ff18fc1f0fca67f89"
integrity sha512-M+rpbTLWJ3FD6FXvYV6YEGvQ5tMayQ3fGrZhRPHrE9bVlBYfDCLuDcgNttYfk8IqfOI03jz6cbpqMRTUclQnaA==
dependencies:
"@babel/runtime" "^7.2.0"
get-node-dimensions "^1.2.1"
prop-types "^15.6.2"
resize-observer-polyfill "^1.5.0"

read-cache@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/read-cache/-/read-cache-1.0.0.tgz#e664ef31161166c9751cdbe8dbcf86b5fb58f774"
Expand Down Expand Up @@ -5466,11 +5417,6 @@ requires-port@^1.0.0:
resolved "https://registry.yarnpkg.com/requires-port/-/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff"
integrity sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=

resize-observer-polyfill@^1.5.0:
version "1.5.1"
resolved "https://registry.yarnpkg.com/resize-observer-polyfill/-/resize-observer-polyfill-1.5.1.tgz#0e9020dd3d21024458d4ebd27e23e40269810464"
integrity sha512-LwZrotdHOo12nQuZlHEmtuXdqGoOD0OhaxopaNFxWzInpEgaLWoVuAMbTzixuosCx2nEG58ngzW3vxdWoxIgdg==

resolve-from@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6"
Expand Down Expand Up @@ -6009,7 +5955,7 @@ strip-final-newline@^2.0.0:
resolved "https://registry.yarnpkg.com/strip-final-newline/-/strip-final-newline-2.0.0.tgz#89b852fb2fcbe936f6f4b3187afb0a12c1ab58ad"
integrity sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==

styled-components@^5.2.1:
styled-components@^5.3.5:
version "5.3.5"
resolved "https://registry.yarnpkg.com/styled-components/-/styled-components-5.3.5.tgz#a750a398d01f1ca73af16a241dec3da6deae5ec4"
integrity sha512-ndETJ9RKaaL6q41B69WudeqLzOpY1A/ET/glXkNZ2T7dPjPqpPCXXQjDFYZWwNnE5co0wX+gTCqx9mfxTmSIPg==
Expand Down Expand Up @@ -6084,7 +6030,7 @@ tapable@^2.1.1, tapable@^2.2.0:
resolved "https://registry.yarnpkg.com/tapable/-/tapable-2.2.1.tgz#1967a73ef4060a82f12ab96af86d52fdb76eeca0"
integrity sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==

tar@^6.0.2, tar@^6.1.0, tar@^6.1.11, tar@^6.1.2:
tar@^6.0.2, tar@^6.1.0, tar@^6.1.2:
version "6.1.11"
resolved "https://registry.yarnpkg.com/tar/-/tar-6.1.11.tgz#6760a38f003afa1b2ffd0ffe9e9abbd0eab3d621"
integrity sha512-an/KZQzQUkZCkuoAA64hM92X0Urb6VpRhAFllDzz44U2mcD5scmT3zBc4VgVpkugF580+DQn8eAFSyoQt0tznA==
Expand Down
39 changes: 39 additions & 0 deletions jquery-components-integration/lib/commonTypes.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
export declare type FacingMode = 'environment' | 'user';
export declare type ImageType = 'jpeg' | 'png';
export declare type BaseCameraProps = {
imageType?: ImageType;
cameraFacing?: FacingMode;
onError: (e: Error) => void;
samWasmUrl?: string;
};
export declare type AppStateInstruction = {
text?: string;
visible?: boolean;
};
export declare type AppStateInstructions = {
loading?: AppStateInstruction;
waiting?: AppStateInstruction;
};
export declare type CustomColors = {
placeholderColor?: string;
placeholderColorSuccess?: string;
instructionColor?: string;
instructionColorSuccess?: string;
instructionTextColor?: string;
};
export declare type ImageParameters = {
brightness: number;
sharpness: number;
hotspots: number;
};
export declare type CameraSettings = MediaTrackSettings & {
deviceName?: string;
};
export declare type Resolution = {
width: number;
height: number;
};
export declare type Point = {
x: number;
y: number;
};
77 changes: 77 additions & 0 deletions jquery-components-integration/lib/documentTypes.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
import { AppStateInstructions, BaseCameraProps, CameraSettings, CustomColors, ImageParameters, Point, Resolution } from './commonTypes';
declare type CustomEvents<K extends string> = {
[key in K]: (event: CustomEvent) => void;
};
declare type CustomElement<T, K extends string = ''> = Partial<T & HTMLElement & {
children: unknown;
} & CustomEvents<`on${K}`>>;
declare global {
interface Window {
DOT_DEBUG_MODE?: boolean;
}
namespace preact.createElement.JSX {
interface IntrinsicElements {
['x-dot-document-auto-capture']: CustomElement<DocumentCameraProps>;
}
}
}
export declare type HTMLDocumentCaptureElement = HTMLElement & {
cameraOptions: DocumentCameraProps;
};
export declare type ParsedDetectedDocument = ImageParameters & {
confidence: number;
topLeft: Point;
topRight: Point;
bottomRight: Point;
bottomLeft: Point;
};
export declare type DetectedDocument = ParsedDetectedDocument & ImageParameters & {
smallestEdge: number;
placeholderFitError: number;
};
export declare type DocumentComponentData = {
cameraSettings: CameraSettings;
detection?: DetectedDocument;
imageResolution: Resolution;
record?: DetectedDocument[];
};
export declare type DocumentCallback = (image: Blob, data: DocumentComponentData) => void;
export declare type DocumentThresholds = {
confidenceThreshold?: number;
placeholderErrorScoreThreshold?: number;
sharpnessThreshold?: number;
brightnessLowThreshold?: number;
brightnessHighThreshold?: number;
hotspotsScoreThreshold?: number;
outOfBoundsThreshold?: number;
sizeSmallThreshold?: number;
};
export declare type DocumentValidationMode = 'standard' | 'strict';
export declare 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';
export declare type DocumentInstructions = {
candidate_selection?: string;
document_centering?: string;
document_too_close?: string;
document_not_present?: string;
document_too_far?: string;
sharpness_too_low?: string;
brightness_too_low?: string;
brightness_too_high?: string;
hotspots_present?: string;
};
export declare type DocumentCameraProps = BaseCameraProps & {
photoTakenCb: DocumentCallback;
thresholds?: DocumentThresholds;
validationMode?: DocumentValidationMode;
detectionLayerVisible?: boolean;
uiCustomisation?: {
placeholder?: {
documentPlaceholder?: DocumentPlaceholder;
customSVG?: string;
};
instructions?: DocumentInstructions;
appStateInstructions?: AppStateInstructions;
colors?: CustomColors;
};
};
export {};
Loading

0 comments on commit 0b8421a

Please sign in to comment.