@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.
Files changed (66) hide show
  1. package/dist/esm/components/FaceLivenessDetector/FaceLivenessDetector.mjs +17 -1
  2. package/dist/esm/components/FaceLivenessDetector/FaceLivenessDetectorCore.mjs +42 -1
  3. package/dist/esm/components/FaceLivenessDetector/LivenessCheck/LivenessCameraModule.mjs +199 -1
  4. package/dist/esm/components/FaceLivenessDetector/LivenessCheck/LivenessCheck.mjs +97 -1
  5. package/dist/esm/components/FaceLivenessDetector/displayText.mjs +50 -1
  6. package/dist/esm/components/FaceLivenessDetector/hooks/useLivenessActor.mjs +13 -1
  7. package/dist/esm/components/FaceLivenessDetector/hooks/useLivenessSelector.mjs +12 -1
  8. package/dist/esm/components/FaceLivenessDetector/hooks/useMediaStreamInVideo.mjs +38 -1
  9. package/dist/esm/components/FaceLivenessDetector/providers/FaceLivenessDetectorProvider.mjs +15 -1
  10. package/dist/esm/components/FaceLivenessDetector/service/machine/index.mjs +1130 -1
  11. package/dist/esm/components/FaceLivenessDetector/service/types/error.mjs +16 -1
  12. package/dist/esm/components/FaceLivenessDetector/service/types/faceDetection.mjs +15 -1
  13. package/dist/esm/components/FaceLivenessDetector/service/types/liveness.mjs +23 -1
  14. package/dist/esm/components/FaceLivenessDetector/service/utils/CustomWebSocketFetchHandler.mjs +200 -1
  15. package/dist/esm/components/FaceLivenessDetector/service/utils/blazefaceFaceDetection.mjs +102 -1
  16. package/dist/esm/components/FaceLivenessDetector/service/utils/constants.mjs +18 -1
  17. package/dist/esm/components/FaceLivenessDetector/service/utils/eventUtils.mjs +30 -1
  18. package/dist/esm/components/FaceLivenessDetector/service/utils/freshnessColorDisplay.mjs +131 -1
  19. package/dist/esm/components/FaceLivenessDetector/service/utils/liveness.mjs +462 -1
  20. package/dist/esm/components/FaceLivenessDetector/service/utils/streamProvider.mjs +144 -1
  21. package/dist/esm/components/FaceLivenessDetector/service/utils/support.mjs +14 -1
  22. package/dist/esm/components/FaceLivenessDetector/service/utils/videoRecorder.mjs +98 -1
  23. package/dist/esm/components/FaceLivenessDetector/shared/CancelButton.mjs +24 -1
  24. package/dist/esm/components/FaceLivenessDetector/shared/DefaultStartScreenComponents.mjs +41 -1
  25. package/dist/esm/components/FaceLivenessDetector/shared/FaceLivenessErrorModal.mjs +88 -1
  26. package/dist/esm/components/FaceLivenessDetector/shared/Hint.mjs +114 -1
  27. package/dist/esm/components/FaceLivenessDetector/shared/LandscapeErrorModal.mjs +30 -1
  28. package/dist/esm/components/FaceLivenessDetector/shared/LivenessIconWithPopover.mjs +37 -1
  29. package/dist/esm/components/FaceLivenessDetector/shared/MatchIndicator.mjs +24 -1
  30. package/dist/esm/components/FaceLivenessDetector/shared/Overlay.mjs +9 -1
  31. package/dist/esm/components/FaceLivenessDetector/shared/RecordingIcon.mjs +13 -1
  32. package/dist/esm/components/FaceLivenessDetector/shared/Toast.mjs +12 -1
  33. package/dist/esm/components/FaceLivenessDetector/types/classNames.mjs +54 -1
  34. package/dist/esm/components/FaceLivenessDetector/utils/device.mjs +24 -1
  35. package/dist/esm/components/FaceLivenessDetector/utils/getDisplayText.mjs +78 -1
  36. package/dist/esm/components/FaceLivenessDetector/utils/helpers.mjs +14 -0
  37. package/dist/esm/components/FaceLivenessDetector/utils/platform.mjs +8 -1
  38. package/dist/esm/index.mjs +2 -1
  39. package/dist/esm/version.mjs +3 -1
  40. package/dist/index.js +3208 -1
  41. package/dist/styles.css +343 -680
  42. package/dist/types/components/FaceLivenessDetector/FaceLivenessDetector.d.ts +1 -1
  43. package/dist/types/components/FaceLivenessDetector/FaceLivenessDetectorCore.d.ts +1 -3
  44. package/dist/types/components/FaceLivenessDetector/LivenessCheck/LivenessCameraModule.d.ts +7 -3
  45. package/dist/types/components/FaceLivenessDetector/LivenessCheck/LivenessCheck.d.ts +5 -3
  46. package/dist/types/components/FaceLivenessDetector/displayText.d.ts +3 -10
  47. package/dist/types/components/FaceLivenessDetector/service/machine/index.d.ts +1 -1
  48. package/dist/types/components/FaceLivenessDetector/service/types/faceDetection.d.ts +2 -0
  49. package/dist/types/components/FaceLivenessDetector/service/types/liveness.d.ts +1 -1
  50. package/dist/types/components/FaceLivenessDetector/service/types/machine.d.ts +3 -1
  51. package/dist/types/components/FaceLivenessDetector/service/utils/blazefaceFaceDetection.d.ts +4 -3
  52. package/dist/types/components/FaceLivenessDetector/service/utils/liveness.d.ts +5 -2
  53. package/dist/types/components/FaceLivenessDetector/shared/DefaultStartScreenComponents.d.ts +9 -15
  54. package/dist/types/components/FaceLivenessDetector/shared/Overlay.d.ts +2 -5
  55. package/dist/types/components/FaceLivenessDetector/shared/Toast.d.ts +1 -0
  56. package/dist/types/components/FaceLivenessDetector/types/classNames.d.ts +3 -0
  57. package/dist/types/version.d.ts +1 -1
  58. package/package.json +16 -37
  59. package/dist/esm/components/FaceLivenessDetector/StartLiveness/StartLiveness.mjs +0 -1
  60. package/dist/esm/components/FaceLivenessDetector/StartLiveness/helpers.mjs +0 -1
  61. package/dist/esm/components/FaceLivenessDetector/shared/GoodFitIllustration.mjs +0 -1
  62. package/dist/esm/components/FaceLivenessDetector/shared/StartScreenFigure.mjs +0 -1
  63. package/dist/esm/components/FaceLivenessDetector/shared/TooFarIllustration.mjs +0 -1
  64. package/dist/types/components/FaceLivenessDetector/StartLiveness/StartLiveness.d.ts +0 -9
  65. package/dist/types/components/FaceLivenessDetector/StartLiveness/index.d.ts +0 -1
  66. /package/dist/types/components/FaceLivenessDetector/{StartLiveness → utils}/helpers.d.ts +0 -0
@@ -1 +1,78 @@
1
- import{defaultLivenessDisplayText as e}from"../displayText.mjs";function t(t){const i=Object.assign(Object.assign({},e),t),{instructionsHeaderHeadingText:n,instructionsHeaderBodyText:a,instructionsBeginCheckText:o,photosensitivyWarningHeadingText:s,photosensitivyWarningBodyText:T,photosensitivyWarningInfoText:r,instructionListHeadingText:x,goodFitCaptionText:c,goodFitAltText:d,tooFarCaptionText:g,tooFarAltText:l,instructionListStepOneText:h,instructionListStepTwoText:u,instructionListStepThreeText:p,instructionListStepFourText:F,cameraMinSpecificationsHeadingText:m,cameraMinSpecificationsMessageText:H,cameraNotFoundHeadingText:y,cameraNotFoundMessageText:M,retryCameraPermissionsText:C,cancelLivenessCheckText:f,recordingIndicatorText:v,hintMoveFaceFrontOfCameraText:D,hintTooManyFacesText:I,hintFaceDetectedText:L,hintCanNotIdentifyText:S,hintTooCloseText:B,hintTooFarText:N,hintHoldFacePositionCountdownText:k,hintConnectingText:A,hintVerifyingText:O,hintIlluminationTooBrightText:W,hintIlluminationTooDarkText:w,hintIlluminationNormalText:P,hintHoldFaceForFreshnessText:j,timeoutHeaderText:b,timeoutMessageText:V,faceDistanceHeaderText:q,faceDistanceMessageText:z,multipleFacesHeaderText:E,multipleFacesMessageText:G,clientHeaderText:J,clientMessageText:K,serverHeaderText:Q,serverMessageText:R,landscapeHeaderText:U,landscapeMessageText:X,portraitMessageText:Y,tryAgainText:Z}=i;return{hintDisplayText:{hintMoveFaceFrontOfCameraText:D,hintTooManyFacesText:I,hintFaceDetectedText:L,hintCanNotIdentifyText:S,hintTooCloseText:B,hintTooFarText:N,hintHoldFacePositionCountdownText:k,hintConnectingText:A,hintVerifyingText:O,hintIlluminationTooBrightText:W,hintIlluminationTooDarkText:w,hintIlluminationNormalText:P,hintHoldFaceForFreshnessText:j},cameraDisplayText:{cameraMinSpecificationsHeadingText:m,cameraMinSpecificationsMessageText:H,cameraNotFoundHeadingText:y,cameraNotFoundMessageText:M,retryCameraPermissionsText:C},instructionDisplayText:{instructionsHeaderHeadingText:n,instructionsHeaderBodyText:a,instructionsBeginCheckText:o,photosensitivyWarningHeadingText:s,photosensitivyWarningBodyText:T,photosensitivyWarningInfoText:r,instructionListHeadingText:x,goodFitCaptionText:c,goodFitAltText:d,tooFarCaptionText:g,tooFarAltText:l,instructionListStepOneText:h,instructionListStepTwoText:u,instructionListStepThreeText:p,instructionListStepFourText:F},streamDisplayText:{cancelLivenessCheckText:f,recordingIndicatorText:v},errorDisplayText:{timeoutHeaderText:b,timeoutMessageText:V,faceDistanceHeaderText:q,faceDistanceMessageText:z,multipleFacesHeaderText:E,multipleFacesMessageText:G,clientHeaderText:J,clientMessageText:K,serverHeaderText:Q,serverMessageText:R,landscapeHeaderText:U,landscapeMessageText:X,portraitMessageText:Y,tryAgainText:Z}}}export{t as getDisplayText};
1
+ import { defaultLivenessDisplayText } from '../displayText.mjs';
2
+
3
+ /**
4
+ * Merges optional displayText prop with
5
+ * defaultLivenessDisplayText and returns more bite size portions to pass
6
+ * down to child components of FaceLivenessDetector.
7
+ * @param overrideDisplayText
8
+ * @returns hintDisplayText, cameraDisplayText, instructionDisplayText, cancelLivenessCheckText
9
+ */
10
+ function getDisplayText(overrideDisplayText) {
11
+ const displayText = {
12
+ ...defaultLivenessDisplayText,
13
+ ...overrideDisplayText,
14
+ };
15
+ const { photosensitivyWarningHeadingText, photosensitivyWarningBodyText, photosensitivyWarningInfoText, goodFitCaptionText, goodFitAltText, tooFarCaptionText, tooFarAltText, cameraMinSpecificationsHeadingText, cameraMinSpecificationsMessageText, cameraNotFoundHeadingText, cameraNotFoundMessageText, retryCameraPermissionsText, waitingCameraPermissionText, cancelLivenessCheckText, recordingIndicatorText, hintMoveFaceFrontOfCameraText, hintTooManyFacesText, hintFaceDetectedText, hintCanNotIdentifyText, hintTooCloseText, hintTooFarText, hintConnectingText, hintVerifyingText, hintIlluminationTooBrightText, hintIlluminationTooDarkText, hintIlluminationNormalText, hintHoldFaceForFreshnessText, timeoutHeaderText, timeoutMessageText, faceDistanceHeaderText, faceDistanceMessageText, multipleFacesHeaderText, multipleFacesMessageText, clientHeaderText, clientMessageText, serverHeaderText, serverMessageText, landscapeHeaderText, landscapeMessageText, portraitMessageText, tryAgainText, startScreenBeginCheckText, hintCenterFaceText, } = displayText;
16
+ const hintDisplayText = {
17
+ hintMoveFaceFrontOfCameraText,
18
+ hintTooManyFacesText,
19
+ hintFaceDetectedText,
20
+ hintCanNotIdentifyText,
21
+ hintTooCloseText,
22
+ hintTooFarText,
23
+ hintConnectingText,
24
+ hintVerifyingText,
25
+ hintIlluminationTooBrightText,
26
+ hintIlluminationTooDarkText,
27
+ hintIlluminationNormalText,
28
+ hintHoldFaceForFreshnessText,
29
+ hintCenterFaceText,
30
+ };
31
+ const cameraDisplayText = {
32
+ cameraMinSpecificationsHeadingText,
33
+ cameraMinSpecificationsMessageText,
34
+ cameraNotFoundHeadingText,
35
+ cameraNotFoundMessageText,
36
+ retryCameraPermissionsText,
37
+ waitingCameraPermissionText,
38
+ };
39
+ const instructionDisplayText = {
40
+ photosensitivyWarningHeadingText,
41
+ photosensitivyWarningBodyText,
42
+ photosensitivyWarningInfoText,
43
+ goodFitCaptionText,
44
+ goodFitAltText,
45
+ tooFarCaptionText,
46
+ tooFarAltText,
47
+ startScreenBeginCheckText,
48
+ };
49
+ const streamDisplayText = {
50
+ cancelLivenessCheckText,
51
+ recordingIndicatorText,
52
+ };
53
+ const errorDisplayText = {
54
+ timeoutHeaderText,
55
+ timeoutMessageText,
56
+ faceDistanceHeaderText,
57
+ faceDistanceMessageText,
58
+ multipleFacesHeaderText,
59
+ multipleFacesMessageText,
60
+ clientHeaderText,
61
+ clientMessageText,
62
+ serverHeaderText,
63
+ serverMessageText,
64
+ landscapeHeaderText,
65
+ landscapeMessageText,
66
+ portraitMessageText,
67
+ tryAgainText,
68
+ };
69
+ return {
70
+ hintDisplayText,
71
+ cameraDisplayText,
72
+ instructionDisplayText,
73
+ streamDisplayText,
74
+ errorDisplayText,
75
+ };
76
+ }
77
+
78
+ export { getDisplayText };
@@ -0,0 +1,14 @@
1
+ const STATIC_VIDEO_CONSTRAINTS = {
2
+ width: {
3
+ min: 320,
4
+ ideal: 640,
5
+ },
6
+ height: {
7
+ min: 240,
8
+ ideal: 480,
9
+ },
10
+ frameRate: { min: 15, ideal: 30, max: 30 },
11
+ facingMode: 'user',
12
+ };
13
+
14
+ export { STATIC_VIDEO_CONSTRAINTS };
@@ -1 +1,8 @@
1
- import{VERSION as e}from"../../../version.mjs";const o=`ui-react-liveness/${e}`,r=()=>o;export{r as getLivenessUserAgent};
1
+ import { VERSION } from '../../../version.mjs';
2
+
3
+ const BASE_USER_AGENT = `ui-react-liveness/${VERSION}`;
4
+ const getLivenessUserAgent = () => {
5
+ return BASE_USER_AGENT;
6
+ };
7
+
8
+ export { getLivenessUserAgent };
@@ -1 +1,2 @@
1
- export{default as FaceLivenessDetector}from"./components/FaceLivenessDetector/FaceLivenessDetector.mjs";export{default as FaceLivenessDetectorCore}from"./components/FaceLivenessDetector/FaceLivenessDetectorCore.mjs";
1
+ export { default as FaceLivenessDetector } from './components/FaceLivenessDetector/FaceLivenessDetector.mjs';
2
+ export { default as FaceLivenessDetectorCore } from './components/FaceLivenessDetector/FaceLivenessDetectorCore.mjs';
@@ -1 +1,3 @@
1
- const o="2.0.10";export{o as VERSION};
1
+ const VERSION = '3.0.0';
2
+
3
+ export { VERSION };