@aws-amplify/ui-react-liveness 2.0.10 → 3.0.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.
- package/dist/esm/components/FaceLivenessDetector/FaceLivenessDetector.mjs +17 -1
- package/dist/esm/components/FaceLivenessDetector/FaceLivenessDetectorCore.mjs +42 -1
- package/dist/esm/components/FaceLivenessDetector/LivenessCheck/LivenessCameraModule.mjs +199 -1
- package/dist/esm/components/FaceLivenessDetector/LivenessCheck/LivenessCheck.mjs +97 -1
- package/dist/esm/components/FaceLivenessDetector/displayText.mjs +50 -1
- package/dist/esm/components/FaceLivenessDetector/hooks/useLivenessActor.mjs +13 -1
- package/dist/esm/components/FaceLivenessDetector/hooks/useLivenessSelector.mjs +12 -1
- package/dist/esm/components/FaceLivenessDetector/hooks/useMediaStreamInVideo.mjs +38 -1
- package/dist/esm/components/FaceLivenessDetector/providers/FaceLivenessDetectorProvider.mjs +15 -1
- package/dist/esm/components/FaceLivenessDetector/service/machine/index.mjs +1130 -1
- package/dist/esm/components/FaceLivenessDetector/service/types/error.mjs +16 -1
- package/dist/esm/components/FaceLivenessDetector/service/types/faceDetection.mjs +15 -1
- package/dist/esm/components/FaceLivenessDetector/service/types/liveness.mjs +23 -1
- package/dist/esm/components/FaceLivenessDetector/service/utils/CustomWebSocketFetchHandler.mjs +200 -1
- package/dist/esm/components/FaceLivenessDetector/service/utils/blazefaceFaceDetection.mjs +102 -1
- package/dist/esm/components/FaceLivenessDetector/service/utils/constants.mjs +18 -1
- package/dist/esm/components/FaceLivenessDetector/service/utils/eventUtils.mjs +30 -1
- package/dist/esm/components/FaceLivenessDetector/service/utils/freshnessColorDisplay.mjs +131 -1
- package/dist/esm/components/FaceLivenessDetector/service/utils/liveness.mjs +462 -1
- package/dist/esm/components/FaceLivenessDetector/service/utils/streamProvider.mjs +144 -1
- package/dist/esm/components/FaceLivenessDetector/service/utils/support.mjs +14 -1
- package/dist/esm/components/FaceLivenessDetector/service/utils/videoRecorder.mjs +98 -1
- package/dist/esm/components/FaceLivenessDetector/shared/CancelButton.mjs +24 -1
- package/dist/esm/components/FaceLivenessDetector/shared/DefaultStartScreenComponents.mjs +41 -1
- package/dist/esm/components/FaceLivenessDetector/shared/FaceLivenessErrorModal.mjs +88 -1
- package/dist/esm/components/FaceLivenessDetector/shared/Hint.mjs +114 -1
- package/dist/esm/components/FaceLivenessDetector/shared/LandscapeErrorModal.mjs +30 -1
- package/dist/esm/components/FaceLivenessDetector/shared/LivenessIconWithPopover.mjs +37 -1
- package/dist/esm/components/FaceLivenessDetector/shared/MatchIndicator.mjs +24 -1
- package/dist/esm/components/FaceLivenessDetector/shared/Overlay.mjs +9 -1
- package/dist/esm/components/FaceLivenessDetector/shared/RecordingIcon.mjs +13 -1
- package/dist/esm/components/FaceLivenessDetector/shared/Toast.mjs +12 -1
- package/dist/esm/components/FaceLivenessDetector/types/classNames.mjs +54 -1
- package/dist/esm/components/FaceLivenessDetector/utils/device.mjs +24 -1
- package/dist/esm/components/FaceLivenessDetector/utils/getDisplayText.mjs +78 -1
- package/dist/esm/components/FaceLivenessDetector/utils/helpers.mjs +14 -0
- package/dist/esm/components/FaceLivenessDetector/utils/platform.mjs +8 -1
- package/dist/esm/index.mjs +2 -1
- package/dist/esm/version.mjs +3 -1
- package/dist/index.js +3208 -1
- package/dist/styles.css +343 -680
- package/dist/types/components/FaceLivenessDetector/FaceLivenessDetector.d.ts +1 -1
- package/dist/types/components/FaceLivenessDetector/FaceLivenessDetectorCore.d.ts +1 -3
- package/dist/types/components/FaceLivenessDetector/LivenessCheck/LivenessCameraModule.d.ts +7 -3
- package/dist/types/components/FaceLivenessDetector/LivenessCheck/LivenessCheck.d.ts +5 -3
- package/dist/types/components/FaceLivenessDetector/displayText.d.ts +3 -10
- package/dist/types/components/FaceLivenessDetector/service/machine/index.d.ts +1 -1
- package/dist/types/components/FaceLivenessDetector/service/types/faceDetection.d.ts +2 -0
- package/dist/types/components/FaceLivenessDetector/service/types/liveness.d.ts +1 -1
- package/dist/types/components/FaceLivenessDetector/service/types/machine.d.ts +3 -1
- package/dist/types/components/FaceLivenessDetector/service/utils/blazefaceFaceDetection.d.ts +4 -3
- package/dist/types/components/FaceLivenessDetector/service/utils/liveness.d.ts +5 -2
- package/dist/types/components/FaceLivenessDetector/shared/DefaultStartScreenComponents.d.ts +9 -15
- package/dist/types/components/FaceLivenessDetector/shared/Overlay.d.ts +2 -5
- package/dist/types/components/FaceLivenessDetector/shared/Toast.d.ts +1 -0
- package/dist/types/components/FaceLivenessDetector/types/classNames.d.ts +3 -0
- package/dist/types/version.d.ts +1 -1
- package/package.json +16 -37
- package/dist/esm/components/FaceLivenessDetector/StartLiveness/StartLiveness.mjs +0 -1
- package/dist/esm/components/FaceLivenessDetector/StartLiveness/helpers.mjs +0 -1
- package/dist/esm/components/FaceLivenessDetector/shared/GoodFitIllustration.mjs +0 -1
- package/dist/esm/components/FaceLivenessDetector/shared/StartScreenFigure.mjs +0 -1
- package/dist/esm/components/FaceLivenessDetector/shared/TooFarIllustration.mjs +0 -1
- package/dist/types/components/FaceLivenessDetector/StartLiveness/StartLiveness.d.ts +0 -9
- package/dist/types/components/FaceLivenessDetector/StartLiveness/index.d.ts +0 -1
- /package/dist/types/components/FaceLivenessDetector/{StartLiveness → utils}/helpers.d.ts +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { FaceLivenessDetectorProps as FaceLivenessDetectorPropsFromUi } from './service';
|
|
3
|
-
import { FaceLivenessDetectorComponents } from './FaceLivenessDetectorCore';
|
|
4
3
|
import { LivenessDisplayText } from './displayText';
|
|
4
|
+
import { FaceLivenessDetectorComponents } from './shared/DefaultStartScreenComponents';
|
|
5
5
|
export interface FaceLivenessDetectorProps extends FaceLivenessDetectorPropsFromUi {
|
|
6
6
|
components?: FaceLivenessDetectorComponents;
|
|
7
7
|
displayText?: LivenessDisplayText;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { FaceLivenessDetectorCoreProps as FaceLivenessDetectorPropsFromUi } from './service';
|
|
3
|
-
import {
|
|
3
|
+
import { FaceLivenessDetectorComponents } from './shared/DefaultStartScreenComponents';
|
|
4
4
|
import { LivenessDisplayText } from './displayText';
|
|
5
|
-
import { CheckScreenComponents } from './shared/FaceLivenessErrorModal';
|
|
6
|
-
export type FaceLivenessDetectorComponents = StartScreenComponents & CheckScreenComponents;
|
|
7
5
|
export interface FaceLivenessDetectorCoreProps extends FaceLivenessDetectorPropsFromUi {
|
|
8
6
|
components?: FaceLivenessDetectorComponents;
|
|
9
7
|
displayText?: LivenessDisplayText;
|
|
@@ -1,18 +1,22 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { FaceMatchState } from '../service';
|
|
3
|
-
import { ErrorDisplayText, HintDisplayText, StreamDisplayText } from '../displayText';
|
|
4
|
-
import {
|
|
3
|
+
import { InstructionDisplayText, ErrorDisplayText, HintDisplayText, StreamDisplayText, CameraDisplayText } from '../displayText';
|
|
4
|
+
import { FaceLivenessDetectorComponents } from '../shared/DefaultStartScreenComponents';
|
|
5
5
|
export declare const selectVideoConstraints: import("../hooks").LivenessSelectorFn<MediaTrackConstraints | undefined>;
|
|
6
6
|
export declare const selectVideoStream: import("../hooks").LivenessSelectorFn<MediaStream | undefined>;
|
|
7
7
|
export declare const selectFaceMatchPercentage: import("../hooks").LivenessSelectorFn<number | undefined>;
|
|
8
8
|
export declare const selectFaceMatchState: import("../hooks").LivenessSelectorFn<FaceMatchState | undefined>;
|
|
9
|
+
export declare const selectSelectedDeviceId: import("../hooks").LivenessSelectorFn<string | undefined>;
|
|
10
|
+
export declare const selectSelectableDevices: import("../hooks").LivenessSelectorFn<MediaDeviceInfo[] | undefined>;
|
|
9
11
|
export interface LivenessCameraModuleProps {
|
|
10
12
|
isMobileScreen: boolean;
|
|
11
13
|
isRecordingStopped: boolean;
|
|
14
|
+
instructionDisplayText: Required<InstructionDisplayText>;
|
|
12
15
|
streamDisplayText: Required<StreamDisplayText>;
|
|
13
16
|
hintDisplayText: Required<HintDisplayText>;
|
|
14
17
|
errorDisplayText: Required<ErrorDisplayText>;
|
|
15
|
-
|
|
18
|
+
cameraDisplayText: Required<CameraDisplayText>;
|
|
19
|
+
components?: FaceLivenessDetectorComponents;
|
|
16
20
|
testId?: string;
|
|
17
21
|
}
|
|
18
22
|
export declare const LivenessCameraModule: (props: LivenessCameraModuleProps) => JSX.Element;
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { HintDisplayText, CameraDisplayText, StreamDisplayText, ErrorDisplayText } from '../displayText';
|
|
3
|
-
import {
|
|
2
|
+
import { InstructionDisplayText, HintDisplayText, CameraDisplayText, StreamDisplayText, ErrorDisplayText } from '../displayText';
|
|
3
|
+
import { FaceLivenessDetectorComponents } from '../shared/DefaultStartScreenComponents';
|
|
4
|
+
export declare const selectIsRecordingStopped: import("../hooks").LivenessSelectorFn<boolean | undefined>;
|
|
4
5
|
interface LivenessCheckProps {
|
|
6
|
+
instructionDisplayText: Required<InstructionDisplayText>;
|
|
5
7
|
hintDisplayText: Required<HintDisplayText>;
|
|
6
8
|
cameraDisplayText: Required<CameraDisplayText>;
|
|
7
9
|
streamDisplayText: Required<StreamDisplayText>;
|
|
8
10
|
errorDisplayText: Required<ErrorDisplayText>;
|
|
9
|
-
components?:
|
|
11
|
+
components?: FaceLivenessDetectorComponents;
|
|
10
12
|
}
|
|
11
13
|
export declare const LivenessCheck: React.FC<LivenessCheckProps>;
|
|
12
14
|
export {};
|
|
@@ -5,14 +5,13 @@ export type HintDisplayText = {
|
|
|
5
5
|
hintCanNotIdentifyText?: string;
|
|
6
6
|
hintTooCloseText?: string;
|
|
7
7
|
hintTooFarText?: string;
|
|
8
|
-
/** @deprecated `hintHoldFacePositionCountdownText` is no longer in use and will be removed in a future major version release. */
|
|
9
|
-
hintHoldFacePositionCountdownText?: string;
|
|
10
8
|
hintConnectingText?: string;
|
|
11
9
|
hintVerifyingText?: string;
|
|
12
10
|
hintIlluminationTooBrightText?: string;
|
|
13
11
|
hintIlluminationTooDarkText?: string;
|
|
14
12
|
hintIlluminationNormalText?: string;
|
|
15
13
|
hintHoldFaceForFreshnessText?: string;
|
|
14
|
+
hintCenterFaceText?: string;
|
|
16
15
|
};
|
|
17
16
|
export type CameraDisplayText = {
|
|
18
17
|
cameraMinSpecificationsHeadingText?: string;
|
|
@@ -20,23 +19,17 @@ export type CameraDisplayText = {
|
|
|
20
19
|
cameraNotFoundHeadingText?: string;
|
|
21
20
|
cameraNotFoundMessageText?: string;
|
|
22
21
|
retryCameraPermissionsText?: string;
|
|
22
|
+
waitingCameraPermissionText?: string;
|
|
23
23
|
};
|
|
24
24
|
export type InstructionDisplayText = {
|
|
25
|
-
instructionsHeaderHeadingText?: string;
|
|
26
|
-
instructionsHeaderBodyText?: string;
|
|
27
|
-
instructionsBeginCheckText?: string;
|
|
28
25
|
photosensitivyWarningHeadingText?: string;
|
|
29
26
|
photosensitivyWarningBodyText?: string;
|
|
30
27
|
photosensitivyWarningInfoText?: string;
|
|
31
|
-
instructionListHeadingText?: string;
|
|
32
28
|
goodFitCaptionText?: string;
|
|
33
29
|
goodFitAltText?: string;
|
|
34
30
|
tooFarCaptionText?: string;
|
|
35
31
|
tooFarAltText?: string;
|
|
36
|
-
|
|
37
|
-
instructionListStepTwoText?: string;
|
|
38
|
-
instructionListStepThreeText?: string;
|
|
39
|
-
instructionListStepFourText?: string;
|
|
32
|
+
startScreenBeginCheckText?: string;
|
|
40
33
|
};
|
|
41
34
|
export type StreamDisplayText = {
|
|
42
35
|
recordingIndicatorText?: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { LivenessEvent } from '../types';
|
|
2
|
-
export declare const MIN_FACE_MATCH_TIME =
|
|
2
|
+
export declare const MIN_FACE_MATCH_TIME = 1000;
|
|
3
3
|
export declare const livenessMachine: import("xstate").StateMachine<Partial<import("../types").HydratedLivenessContext>, any, LivenessEvent, {
|
|
4
4
|
value: any;
|
|
5
5
|
context: Partial<import("../types").HydratedLivenessContext>;
|
|
@@ -28,7 +28,7 @@ export interface FaceLivenessDetectorCoreProps {
|
|
|
28
28
|
/**
|
|
29
29
|
* Optional parameter for the disabling the Start/Get Ready Screen, default: false
|
|
30
30
|
*/
|
|
31
|
-
|
|
31
|
+
disableStartScreen?: boolean;
|
|
32
32
|
/**
|
|
33
33
|
* Optional parameter for advanced options for the component
|
|
34
34
|
*/
|
|
@@ -33,6 +33,8 @@ export interface VideoAssociatedParams {
|
|
|
33
33
|
videoRecorder?: VideoRecorder;
|
|
34
34
|
recordingStartTimestampMs?: number;
|
|
35
35
|
isMobile?: boolean;
|
|
36
|
+
selectedDeviceId?: string;
|
|
37
|
+
selectableDevices?: MediaDeviceInfo[];
|
|
36
38
|
}
|
|
37
39
|
export type LivenessContext = Partial<HydratedLivenessContext>;
|
|
38
40
|
export interface HydratedLivenessContext {
|
|
@@ -53,7 +55,7 @@ export interface HydratedLivenessContext {
|
|
|
53
55
|
isFaceFarEnoughBeforeRecording: boolean;
|
|
54
56
|
isRecordingStopped: boolean;
|
|
55
57
|
}
|
|
56
|
-
export type LivenessEventTypes = 'BEGIN' | 'START_RECORDING' | 'TIMEOUT' | 'ERROR' | 'CANCEL' | 'SET_SESSION_INFO' | 'DISCONNECT_EVENT' | 'SET_DOM_AND_CAMERA_DETAILS' | 'SERVER_ERROR' | 'RUNTIME_ERROR' | 'RETRY_CAMERA_CHECK' | 'MOBILE_LANDSCAPE_WARNING';
|
|
58
|
+
export type LivenessEventTypes = 'BEGIN' | 'START_RECORDING' | 'TIMEOUT' | 'ERROR' | 'CANCEL' | 'SET_SESSION_INFO' | 'DISCONNECT_EVENT' | 'SET_DOM_AND_CAMERA_DETAILS' | 'UPDATE_DEVICE_AND_STREAM' | 'SERVER_ERROR' | 'RUNTIME_ERROR' | 'RETRY_CAMERA_CHECK' | 'MOBILE_LANDSCAPE_WARNING';
|
|
57
59
|
export type LivenessEventData = Record<PropertyKey, any>;
|
|
58
60
|
export interface LivenessEvent {
|
|
59
61
|
type: LivenessEventTypes;
|
package/dist/types/components/FaceLivenessDetector/service/utils/blazefaceFaceDetection.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import '@tensorflow/tfjs-backend-cpu';
|
|
2
2
|
import { FaceDetection, Face } from '../types';
|
|
3
3
|
type BlazeFaceModelBackend = 'wasm' | 'cpu';
|
|
4
|
-
export declare const BLAZEFACE_VERSION = "
|
|
4
|
+
export declare const BLAZEFACE_VERSION = "1.0.2";
|
|
5
5
|
/**
|
|
6
6
|
* WARNING: When updating these links,
|
|
7
7
|
* also make sure to update documentation and the link in the canary/e2e test "canary/e2e/features/liveness/face-detect.feature"
|
|
8
8
|
*/
|
|
9
|
-
export declare const DEFAULT_BLAZEFACE_URL
|
|
10
|
-
export declare const DEFAULT_TFJS_WASM_URL
|
|
9
|
+
export declare const DEFAULT_BLAZEFACE_URL = "https://cdn.liveness.rekognition.amazonaws.com/face-detection/tensorflow-models/blazeface/1.0.2/model/model.json";
|
|
10
|
+
export declare const DEFAULT_TFJS_WASM_URL = "https://cdn.liveness.rekognition.amazonaws.com/face-detection/tensorflow/tfjs-backend-wasm/4.11.0/";
|
|
11
11
|
/**
|
|
12
12
|
* The BlazeFace implementation of the FaceDetection interface.
|
|
13
13
|
*/
|
|
@@ -19,6 +19,7 @@ export declare class BlazeFaceFaceDetection extends FaceDetection {
|
|
|
19
19
|
constructor(binaryPath?: string, faceModelUrl?: string);
|
|
20
20
|
loadModels(): Promise<void>;
|
|
21
21
|
detectFaces(videoEl: HTMLVideoElement): Promise<Face[]>;
|
|
22
|
+
private _getCoordinate;
|
|
22
23
|
private _loadWebAssemblyBackend;
|
|
23
24
|
private _loadCPUBackend;
|
|
24
25
|
}
|
|
@@ -28,21 +28,24 @@ export declare function getOvalDetailsFromSessionInformation({ sessionInformatio
|
|
|
28
28
|
/**
|
|
29
29
|
* Returns the details of a statically generated liveness oval based on the video dimensions
|
|
30
30
|
*/
|
|
31
|
-
export declare function getStaticLivenessOvalDetails({ width, height, widthSeed, centerXSeed, centerYSeed, }: {
|
|
31
|
+
export declare function getStaticLivenessOvalDetails({ width, height, widthSeed, centerXSeed, centerYSeed, ratioMultiplier, }: {
|
|
32
32
|
width: number;
|
|
33
33
|
height: number;
|
|
34
34
|
widthSeed?: number;
|
|
35
35
|
centerXSeed?: number;
|
|
36
36
|
centerYSeed?: number;
|
|
37
|
+
ratioMultiplier?: number;
|
|
37
38
|
}): LivenessOvalDetails;
|
|
39
|
+
export declare function drawStaticOval(canvasEl: HTMLCanvasElement, videoEl: HTMLVideoElement, videoMediaStream: MediaStream): void;
|
|
38
40
|
/**
|
|
39
41
|
* Draws the provided liveness oval on the canvas.
|
|
40
42
|
*/
|
|
41
|
-
export declare function drawLivenessOvalInCanvas({ canvas, oval, scaleFactor, videoEl, }: {
|
|
43
|
+
export declare function drawLivenessOvalInCanvas({ canvas, oval, scaleFactor, videoEl, isStartScreen, }: {
|
|
42
44
|
canvas: HTMLCanvasElement;
|
|
43
45
|
oval: LivenessOvalDetails;
|
|
44
46
|
scaleFactor: number;
|
|
45
47
|
videoEl: HTMLVideoElement;
|
|
48
|
+
isStartScreen?: boolean;
|
|
46
49
|
}): void;
|
|
47
50
|
interface FaceMatchStateInLivenessOval {
|
|
48
51
|
faceMatchState: FaceMatchState;
|
|
@@ -1,27 +1,21 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { CheckScreenComponents } from './FaceLivenessErrorModal';
|
|
3
|
+
export type FaceLivenessDetectorComponents = StartScreenComponents & CheckScreenComponents;
|
|
2
4
|
export interface StartScreenComponents {
|
|
3
|
-
Header?: React.ComponentType;
|
|
4
5
|
PhotosensitiveWarning?: React.ComponentType;
|
|
5
|
-
Instructions?: React.ComponentType;
|
|
6
6
|
}
|
|
7
|
-
interface DefaultHeaderProps {
|
|
8
|
-
headingText: string;
|
|
9
|
-
bodyText: string;
|
|
10
|
-
}
|
|
11
|
-
export declare const DefaultHeader: ({ headingText, bodyText, }: DefaultHeaderProps) => JSX.Element;
|
|
12
7
|
interface DefaultPhotosensitiveWarningProps {
|
|
13
8
|
headingText: string;
|
|
14
9
|
bodyText: string;
|
|
15
10
|
infoText: string;
|
|
16
11
|
}
|
|
17
12
|
export declare const DefaultPhotosensitiveWarning: ({ headingText, bodyText, infoText, }: DefaultPhotosensitiveWarningProps) => JSX.Element;
|
|
18
|
-
interface
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
steps: string[];
|
|
13
|
+
interface DefaultRecordingIconProps {
|
|
14
|
+
recordingIndicatorText: string;
|
|
15
|
+
}
|
|
16
|
+
export declare const DefaultRecordingIcon: ({ recordingIndicatorText, }: DefaultRecordingIconProps) => JSX.Element;
|
|
17
|
+
interface CancelButtonProps {
|
|
18
|
+
cancelLivenessCheckText: string;
|
|
25
19
|
}
|
|
26
|
-
export declare const
|
|
20
|
+
export declare const DefaultCancelButton: ({ cancelLivenessCheckText, }: CancelButtonProps) => JSX.Element;
|
|
27
21
|
export {};
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { FlexProps } from '@aws-amplify/ui-react';
|
|
3
|
-
interface AnchorOrigin {
|
|
4
|
-
horizontal: 'start' | 'center' | 'end';
|
|
5
|
-
vertical: 'start' | 'center' | 'end' | 'space-between';
|
|
6
|
-
}
|
|
7
3
|
interface OverlayProps extends FlexProps {
|
|
8
|
-
|
|
4
|
+
horizontal?: 'start' | 'center' | 'end';
|
|
5
|
+
vertical?: 'start' | 'center' | 'end' | 'space-between';
|
|
9
6
|
}
|
|
10
7
|
export declare const Overlay: React.FC<OverlayProps>;
|
|
11
8
|
export {};
|
|
@@ -34,6 +34,9 @@ export declare enum LivenessClassNames {
|
|
|
34
34
|
PopoverAnchorSecondary = "amplify-liveness-popover__anchor-secondary",
|
|
35
35
|
RecordingIconContainer = "amplify-liveness-recording-icon-container",
|
|
36
36
|
RecordingIcon = "amplify-liveness-recording-icon",
|
|
37
|
+
StartScreenCameraSelect = "amplify-liveness-start-screen-camera-select",
|
|
38
|
+
StartScreenCameraSelectContainer = "amplify-liveness-start-screen-camera-select__container",
|
|
39
|
+
StartScreenCameraWaiting = "amplify-liveness-start-screen-camera-waiting",
|
|
37
40
|
StartScreenHeader = "amplify-liveness-start-screen-header",
|
|
38
41
|
StartScreenHeaderBody = "amplify-liveness-start-screen-header__body",
|
|
39
42
|
StartScreenHeaderHeading = "amplify-liveness-start-screen-header__heading",
|
package/dist/types/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "
|
|
1
|
+
export declare const VERSION = "3.0.0";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-amplify/ui-react-liveness",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"module": "dist/esm/index.mjs",
|
|
6
6
|
"exports": {
|
|
@@ -38,62 +38,41 @@
|
|
|
38
38
|
"prebuild": "rimraf dist",
|
|
39
39
|
"size": "yarn size-limit",
|
|
40
40
|
"test": "jest",
|
|
41
|
-
"test:ci": "yarn test && yarn check:esm",
|
|
42
41
|
"test:watch": "yarn test --watch",
|
|
43
42
|
"typecheck": "tsc --noEmit"
|
|
44
43
|
},
|
|
45
44
|
"peerDependencies": {
|
|
46
|
-
"aws-amplify": "^
|
|
47
|
-
"react": "
|
|
48
|
-
"react-dom": "
|
|
45
|
+
"aws-amplify": "^6.0.2",
|
|
46
|
+
"react": "^16.14.0 || ^17.0 || ^18.0",
|
|
47
|
+
"react-dom": "^16.14.0 || ^17.0 || ^18.0"
|
|
49
48
|
},
|
|
50
49
|
"dependencies": {
|
|
51
|
-
"@aws-amplify/ui": "
|
|
52
|
-
"@aws-amplify/ui-react": "
|
|
50
|
+
"@aws-amplify/ui": "6.0.0",
|
|
51
|
+
"@aws-amplify/ui-react": "6.0.1",
|
|
53
52
|
"@aws-sdk/client-rekognitionstreaming": "3.398.0",
|
|
54
53
|
"@aws-sdk/util-format-url": "^3.410.0",
|
|
55
54
|
"@smithy/eventstream-serde-browser": "^2.0.4",
|
|
56
55
|
"@smithy/fetch-http-handler": "^2.1.3",
|
|
57
56
|
"@smithy/protocol-http": "^3.0.3",
|
|
58
|
-
"@
|
|
59
|
-
"@tensorflow/
|
|
60
|
-
"@tensorflow/tfjs-backend-
|
|
61
|
-
"@tensorflow/tfjs-
|
|
62
|
-
"@tensorflow/tfjs-
|
|
63
|
-
"@
|
|
64
|
-
"
|
|
57
|
+
"@mediapipe/face_detection": "~0.4.0",
|
|
58
|
+
"@tensorflow-models/face-detection": "1.0.2",
|
|
59
|
+
"@tensorflow/tfjs-backend-cpu": "4.11.0",
|
|
60
|
+
"@tensorflow/tfjs-backend-wasm": "4.11.0",
|
|
61
|
+
"@tensorflow/tfjs-converter": "4.11.0",
|
|
62
|
+
"@tensorflow/tfjs-core": "4.11.0",
|
|
63
|
+
"@xstate/react": "^3.2.2",
|
|
65
64
|
"nanoid": "3.1.31",
|
|
66
|
-
"tslib": "2.
|
|
65
|
+
"tslib": "^2.5.2",
|
|
67
66
|
"xstate": "^4.33.6"
|
|
68
67
|
},
|
|
69
68
|
"devDependencies": {
|
|
70
|
-
"@aws-amplify/eslint-config-amplify-ui": "0.0.0",
|
|
71
69
|
"@rollup/plugin-commonjs": "^22.0.1",
|
|
72
|
-
"@rollup/plugin-typescript": "^8.3.1",
|
|
73
|
-
"@size-limit/preset-big-lib": "^8.2.6",
|
|
74
|
-
"@testing-library/jest-dom": "^5.14.1",
|
|
75
|
-
"@testing-library/react": "^12.0.0",
|
|
76
|
-
"@testing-library/react-hooks": "^7.0.1",
|
|
77
|
-
"@testing-library/user-event": "^13.2.1",
|
|
78
|
-
"@types/jest": "^26.0.23",
|
|
79
70
|
"@types/jest-when": "^3.5.0",
|
|
80
|
-
"@types/react": "^17.0.2",
|
|
81
71
|
"blob-polyfill": "^7.0.20220408",
|
|
82
|
-
"
|
|
83
|
-
"jest": "^27.0.4",
|
|
84
|
-
"jest-canvas-mock": "^2.4.0",
|
|
72
|
+
"jest-canvas-mock": "^2.5.2",
|
|
85
73
|
"jest-websocket-mock": "^2.4.1",
|
|
86
74
|
"jest-when": "^3.5.1",
|
|
87
75
|
"mock-socket": "^9.2.1",
|
|
88
|
-
"react": "^17.0.2",
|
|
89
|
-
"react-dom": "^17.0.2",
|
|
90
|
-
"rimraf": "^3.0.2",
|
|
91
|
-
"rollup": "^2.70.0",
|
|
92
|
-
"rollup-plugin-node-externals": "^4.1.1",
|
|
93
|
-
"rollup-plugin-styles": "^4.0.0",
|
|
94
|
-
"rollup-plugin-terser": "^7.0.2",
|
|
95
|
-
"size-limit": "^8.2.6",
|
|
96
|
-
"ts-jest": "^27.0.3",
|
|
97
76
|
"web-streams-polyfill": "^3.2.1"
|
|
98
77
|
},
|
|
99
78
|
"size-limit": [
|
|
@@ -101,7 +80,7 @@
|
|
|
101
80
|
"name": "FaceLivenessDetector",
|
|
102
81
|
"path": "dist/esm/index.mjs",
|
|
103
82
|
"import": "{ FaceLivenessDetector }",
|
|
104
|
-
"limit": "
|
|
83
|
+
"limit": "291 kB"
|
|
105
84
|
}
|
|
106
85
|
]
|
|
107
86
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import*as t from"react";import{Card as e,Flex as n,Button as i}from"@aws-amplify/ui-react";import{DefaultHeader as o,DefaultPhotosensitiveWarning as r,DefaultInstructions as s}from"../shared/DefaultStartScreenComponents.mjs";const a="liveness-detector-start";function c(c){const{beginLivenessCheck:l,components:T,instructionDisplayText:x}=c;return t.createElement(e,{className:a,"data-testid":a},t.createElement(n,{direction:"column"},(null==T?void 0:T.Header)?t.createElement(T.Header,null):t.createElement(o,{headingText:x.instructionsHeaderHeadingText,bodyText:x.instructionsHeaderBodyText}),(null==T?void 0:T.PhotosensitiveWarning)?t.createElement(T.PhotosensitiveWarning,null):t.createElement(r,{headingText:x.photosensitivyWarningHeadingText,bodyText:x.photosensitivyWarningBodyText,infoText:x.photosensitivyWarningInfoText}),(null==T?void 0:T.Instructions)?t.createElement(T.Instructions,null):t.createElement(s,{headingText:x.instructionListHeadingText,goodFitCaptionText:x.goodFitCaptionText,goodFitAltText:x.goodFitAltText,tooFarCaptionText:x.tooFarCaptionText,tooFarAltText:x.tooFarAltText,steps:[x.instructionListStepOneText,x.instructionListStepTwoText,x.instructionListStepThreeText,x.instructionListStepFourText]}),t.createElement(n,{justifyContent:"center"},t.createElement(i,{variation:"primary",type:"button",onClick:l},x.instructionsBeginCheckText))))}export{c as StartLiveness};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e={width:{min:320,ideal:640},height:{min:240,ideal:480},frameRate:{min:15,ideal:30,max:30},facingMode:"user"};export{e as STATIC_VIDEO_CONSTRAINTS};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import l from"react";const e=({title:e,testId:t})=>l.createElement("svg",{width:"150",height:"150","data-testid":t},l.createElement("title",null,e),l.createElement("g",{fill:"none",fillRule:"evenodd",transform:"translate(0 -.001)"},l.createElement("path",{fill:"#5B361E",fillRule:"nonzero",d:"M124.655 0c9.173 8.155 9.394 17.812 13.258 32.385l.053.336.108.726.11.796.112.864.114.931.174 1.515.117 1.087.18 1.739.12 1.23.183 1.944.123 1.36.186 2.13.187 2.232.313 3.928.25 3.31.25 3.443.31 4.463.245 3.679.36 5.658.345 5.778.33 5.841.26 4.876.199 3.883.187 3.849.217 4.738.16 3.712.178 4.515.097 2.63v34.977L.519 150 .517 41.97c3-13.353 9.664-29.4 23.841-41.97h100.297Z"}),l.createElement("path",{fill:"#FCDDCC",fillRule:"nonzero",stroke:"#000",d:"m50.469 18.849.145.153c9.021 9.393 22.62 16.197 36.089 21.996l2.1.897 1.05.443 2.089.876 8.176 3.385 1.979.825 1.944.82c7.782 3.3 14.617 6.491 19.213 10.006 3.57 2.73 5.793 5.645 5.924 8.999v20.474l-.008.624-.016.669-.04 1.089-.04.777-.047.815-.06.853-.068.887-.08.918-.093.95-.104.978-.057.496-.123 1.016-.066.513-.144 1.049-.076.527-.165 1.077c-.057.36-.116.724-.178 1.086l-.193 1.103-.21 1.116-.11.557-.233 1.13c-.12.564-.247 1.13-.38 1.694l-.275 1.14c-1.037 4.147-2.426 8.3-4.271 11.978-6.17 9.34-12.996 16.035-19.28 20.691l-.8.584-.794.562-.784.539-1.165.77-1.147.724-.755.459c-.249.148-.497.294-.74.434l-.73.416-1.078.588-.702.367-1.033.517-.671.321-.657.303-.643.285-.541.23H68.149a75.81 75.81 0 0 1-.81-.284l-.918-.336a75.953 75.953 0 0 1-.935-.355l-.963-.382a85.513 85.513 0 0 1-1.988-.83l-1.032-.455c-.52-.233-1.05-.475-1.585-.727l-1.087-.517-1.113-.547c-.935-.465-1.893-.959-2.873-1.482l-1.193-.644a141.053 141.053 0 0 1-6.297-3.669l-1.33-.83c-17.11-10.783-22.636-33.458-23.66-49.98l-.071-1.267c-.02-.417-.038-.83-.053-1.235l-.037-1.212a86.317 86.317 0 0 1 .042-5.559l.047-1.002.06-.96.064-.843c1.09-2.51 2.164-4.304 3.296-5.882l.408-.558.415-.545.421-.538 2.026-2.492.481-.597.493-.624.507-.656.518-.69a61.722 61.722 0 0 0 3.769-5.754c4.03-6.917 7.127-14.806 9.544-21.668l.566-1.623.802-2.344 2.077-6.175.416-1.205.395-1.109.373-1.007.267-.682.253-.612c.47-.943.8-1.531 1.06-1.876l-.035.047Z"}),l.createElement("path",{fill:"#000",fillRule:"nonzero",d:"m94.566 121.353.722.895c-6.828 5.51-14.13 7.462-21.382 6.447-5.417-.758-10.535-3.2-13.987-6.186l-.318-.282.77-.854c3.285 2.964 8.343 5.434 13.694 6.183 6.797.95 13.632-.819 20.089-5.876l.412-.327Z"}),l.createElement("ellipse",{cx:"51.331",cy:"80.698",fill:"#000",fillRule:"nonzero",rx:"4.886",ry:"6.707"}),l.createElement("path",{fill:"#000",fillRule:"nonzero",d:"M42.539 63.719c4.453-2.586 11.355-3.268 17.22-.195l.35.19-.556 1.005c-5.437-3.01-11.946-2.479-16.175-.153l-.262.148-.577-.995Z"}),l.createElement("ellipse",{cx:"103.281",cy:"80.698",fill:"#000",fillRule:"nonzero",rx:"4.886",ry:"6.707"}),l.createElement("path",{fill:"#000",fillRule:"nonzero",d:"M94.492 63.719c4.453-2.586 11.355-3.268 17.22-.195l.35.19-.557 1.005c-5.436-3.01-11.946-2.479-16.174-.153l-.262.148-.577-.995Zm-22.972 32.9c0 4.216 2.006 7.72 5.831 7.48l.232-.018.115 1.144c-4.774.477-7.239-3.571-7.326-8.345l-.003-.26 1.15-.001h.001Z"}),l.createElement("path",{fill:"#FFF",fillRule:"nonzero",d:"M75.002.001H0v150h150v-150H75.002Zm0 0c25.627 0 46.402 33.579 46.402 75s-20.775 75-46.402 75c-25.627 0-46.402-33.579-46.402-75s20.775-75 46.402-75Z"}),l.createElement("path",{stroke:"#AEB3B7",strokeWidth:"2",d:"M120.921 75.001c0 20.555-5.214 39.117-13.589 52.507-8.386 13.406-19.838 21.493-32.313 21.493-12.476 0-23.928-8.087-32.312-21.493-8.377-13.39-13.59-31.952-13.59-52.507 0-20.555 5.214-39.116 13.589-52.507C51.091 9.09 62.543 1.001 75.018 1.001c12.476 0 23.928 8.088 32.314 21.493 8.375 13.39 13.588 31.952 13.588 52.507h.001Z"})));export{e as GoodFitIllustration};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{__rest as e}from"tslib";import t from"react";import{Flex as a,View as r}from"@aws-amplify/ui-react";import{LivenessClassNames as i}from"../types/classNames.mjs";const l=l=>{var{children:n,caption:c,variation:m="default"}=l,s=e(l,["children","caption","variation"]);return t.createElement(a,Object.assign({as:"figure",className:`${i.Figure} ${i.Figure}--${m}`},s),t.createElement(r,{className:`${i.FigureImage} ${i.FigureImage}--${m}`},"success"===m?t.createElement("svg",{className:i.FigureIcon,"aria-hidden":"true",width:"24",height:"24"},t.createElement("g",{fill:"none"},t.createElement("path",{fill:"#365E3D",d:"M0 0h24v24H0z"}),t.createElement("path",{fill:"#FFF",d:"m9.435 15.62-4.054-4.055L4 12.936l5.435 5.435L21.101 6.704l-1.37-1.371z"}))):null,"error"===m?t.createElement("svg",{className:i.FigureIcon,"aria-hidden":"true",width:"24",height:"24"},t.createElement("g",{fill:"none"},t.createElement("path",{fill:"#600",d:"M0 0h24v24H0z"}),t.createElement("path",{fill:"#FFF",d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}))):null,n),t.createElement(r,{as:"figcaption",className:`${i.FigureCaption} ${i.FigureCaption}--${m}`},c))};export{l as StartScreenFigure};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import e from"react";const l=({title:l,testId:t})=>e.createElement("svg",{width:"150",height:"150","data-testid":t},e.createElement("title",null,l),e.createElement("defs",null,e.createElement("linearGradient",{id:"a",x1:"50%",x2:"50%",y1:"0%",y2:"100%"},e.createElement("stop",{offset:"0%",stopColor:"#C2C2C2"}),e.createElement("stop",{offset:"100%",stopColor:"#C2C2C2",stopOpacity:"0"}))),e.createElement("g",{fill:"none",fillRule:"evenodd",transform:"translate(2)"},e.createElement("path",{fill:"#FFF",fillRule:"nonzero",d:"M3.997 0h136v150h-136z"}),e.createElement("path",{fill:"url(#a)",fillRule:"nonzero",d:"M4.333 0h138v150h-138z"}),e.createElement("path",{fill:"#5B361E",fillRule:"nonzero",stroke:"#000",strokeWidth:"1.353",d:"m22.515 58.137-1.895 82.434 98.784-2.343c0-8.798.813-16.271.813-31.497 0-15.748-2.345-55.36-3.766-64.125C108.16 11.338 74.737 5.03 56.707 11.04c-28.425 9.475-33.64 35.095-34.192 47.097Z"}),e.createElement("path",{fill:"#EF992A",fillRule:"nonzero",d:"M38.104 138.228c8.339-3.98 5.1-1.525 15.916-3.104H90.5c5.448 0 9.541 3.104 28.904 3.104 6.391 0 5.987 8.988-2.473 8.988-24.315 1.08-66.07 1.08-78.281 0-77.975-6.896-10.97-4.014-.546-8.988Z"}),e.createElement("path",{fill:"#FCDDCC",fillRule:"nonzero",stroke:"#000",strokeWidth:"1.353",d:"m54.306 134.26 2.645-21.765h30.498l3.05 21.765c-15.778 14.791-30.703 6.163-36.193 0zm-27.59-54.458C25.42 66.68 33.467 67.18 37.653 69.07l2.837 25.314c-10.328-2.228-13.772-12.961-13.772-14.58zm89.512-.81c4.05-15.067-3.984-15.998-8.506-14.58L105.9 91.75c10.328-8.505 9.113-12.758 10.328-12.758z"}),e.createElement("path",{fill:"#FCDDCC",fillRule:"nonzero",stroke:"#000",strokeWidth:"1.353",d:"M53.564 109.804c-14.195-8.986-16.116-30.658-15.302-40.37 2.24-5.21 4.37-5.723 7.958-11.909 6.3-10.86 9.028-25.451 10.579-25.009 14.241 16.008 50.215 20.259 50.649 31.708v13.023c0 4.178-.911 14.358-4.558 21.65-8.986 13.674-20.131 18.612-24.58 19.372-2.334.922-10.55.521-24.746-8.465Z"}),e.createElement("path",{fill:"#000",fillRule:"nonzero",d:"m83.935 98.402.85 1.052c-7.974 6.435-17.2 5.243-23.018.18l-.23-.204.905-1.004c5.273 4.756 13.744 5.998 21.175.227l.318-.251Z"}),e.createElement("ellipse",{cx:"56.448",cy:"72.613",fill:"#000",fillRule:"nonzero",rx:"3.128",ry:"4.294"}),e.createElement("path",{fill:"#000",fillRule:"nonzero",d:"M50.664 61.476c2.917-1.694 7.404-2.147 11.244-.172l.31.165-.655 1.183c-3.348-1.854-7.361-1.545-9.985-.137l-.234.13-.68-1.17Z"}),e.createElement("ellipse",{cx:"89.709",cy:"72.613",fill:"#000",fillRule:"nonzero",rx:"3.128",ry:"4.294"}),e.createElement("path",{fill:"#000",fillRule:"nonzero",d:"M83.926 61.476c2.917-1.694 7.404-2.147 11.244-.172l.31.165-.655 1.183c-3.348-1.854-7.361-1.545-9.985-.137l-.234.13-.68-1.17Z"}),e.createElement("path",{stroke:"#000",strokeWidth:"1.353",d:"M69.005 82.806c0 1.858.859 5.487 4.287 5.144"}),e.createElement("path",{fill:"#FFF",d:"M73.004 0H0v150h146V0H73.004Zm.496 0C98.629 0 119 33.579 119 75s-20.371 75-45.5 75S28 116.421 28 75 48.371 0 73.5 0Z"}),e.createElement("path",{stroke:"#AEB3B7",strokeWidth:"2",d:"M118.4 75c0 20.555-5.156 39.117-13.441 52.507C96.665 140.913 85.338 149 72.999 149c-12.34 0-23.667-8.087-31.961-21.493C32.753 114.117 27.597 95.555 27.597 75c0-20.555 5.156-39.117 13.44-52.507C49.333 9.087 60.66 1 72.999 1c12.34 0 23.667 8.087 31.961 21.493C113.244 35.883 118.4 54.445 118.4 75Z"})));export{l as TooFarIllustration};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { InstructionDisplayText } from '../displayText';
|
|
3
|
-
import { StartScreenComponents } from '../shared/DefaultStartScreenComponents';
|
|
4
|
-
export interface StartLivenessProps {
|
|
5
|
-
beginLivenessCheck: () => void;
|
|
6
|
-
components?: StartScreenComponents;
|
|
7
|
-
instructionDisplayText: Required<InstructionDisplayText>;
|
|
8
|
-
}
|
|
9
|
-
export declare function StartLiveness(props: StartLivenessProps): JSX.Element;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './StartLiveness';
|
|
File without changes
|