@neofaceid/web-sdk 1.28.0 → 1.28.1

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/index.d.ts CHANGED
@@ -195,7 +195,7 @@ declare interface BiometricRegistrationCallbacks {
195
195
  onError(code: string, message: string): void;
196
196
  }
197
197
 
198
- export declare function BiometricRegistrationModal({ personData, applicationToken, onClose, onSuccess, onPhotosCaptured, onError, }: BiometricRegistrationModalProps): JSX_2.Element;
198
+ export declare function BiometricRegistrationModal({ personData, applicationToken, onClose, onSuccess, onPhotosCaptured, onError, onCannotGesture, }: BiometricRegistrationModalProps): JSX_2.Element;
199
199
 
200
200
  declare interface BiometricRegistrationModalProps {
201
201
  personData?: {
@@ -211,6 +211,13 @@ declare interface BiometricRegistrationModalProps {
211
211
  onPhotosCaptured?: (photos: Blob[]) => void;
212
212
  onError: (error: string) => void;
213
213
  useRealApi?: boolean;
214
+ /**
215
+ * NEO-410 · US14.3 — callback disparado pelo botão "Não consigo fazer esse movimento",
216
+ * visível desde o PRIMEIRO desafio. O consumidor decide o que fazer (abrir fallback
217
+ * próprio, pedir vivacidade passiva ao backend, cair para email/senha). Se ausente,
218
+ * o clique fecha o modal via `onClose`.
219
+ */
220
+ onCannotGesture?: () => void;
214
221
  }
215
222
 
216
223
  declare interface BiometricRegistrationResult {
@@ -532,12 +539,17 @@ export declare enum ErrorType {
532
539
  CONSENT_DENIED = "ConsentDeniedError"
533
540
  }
534
541
 
535
- export declare function FaceCaptureModal({ accessToken, onClose, onSuccess }: FaceCaptureModalProps): JSX_2.Element;
542
+ export declare function FaceCaptureModal({ accessToken, onClose, onSuccess, onCannotGesture, }: FaceCaptureModalProps): JSX_2.Element;
536
543
 
537
544
  declare interface FaceCaptureModalProps {
538
545
  accessToken: string;
539
546
  onClose: () => void;
540
547
  onSuccess: (result: RecognitionResult) => void;
548
+ /**
549
+ * NEO-410 · US14.3 — callback do botão "Não consigo fazer esse movimento",
550
+ * visível desde o PRIMEIRO desafio. Ausente = clique fecha o modal.
551
+ */
552
+ onCannotGesture?: () => void;
541
553
  }
542
554
 
543
555
  /**
@@ -1361,6 +1373,8 @@ export declare const simpleIdentification: (documentType: string, documentNumber
1361
1373
 
1362
1374
  export declare function start(applicationToken: string, callbacks: Callbacks, options?: {
1363
1375
  appName?: string;
1376
+ /** NEO-410 · US14.3 — botão "Não consigo fazer esse movimento" visível desde o 1º desafio. */
1377
+ onCannotGesture?: () => void;
1364
1378
  }): void;
1365
1379
 
1366
1380
  /**
@@ -1384,6 +1398,8 @@ export declare function startBiometricRegistration(personData: {
1384
1398
  }, applicationToken: string, callbacks: BiometricRegistrationCallbacks, options?: {
1385
1399
  useRealApi?: boolean;
1386
1400
  appName?: string;
1401
+ /** NEO-410 · US14.3 — botão "Não consigo fazer esse movimento" visível desde o 1º desafio. */
1402
+ onCannotGesture?: () => void;
1387
1403
  }): void;
1388
1404
 
1389
1405
  /**
@@ -1415,6 +1431,8 @@ export declare function startLivenessCapture(applicationToken: string, callbacks
1415
1431
  onCancel?(): void;
1416
1432
  }, options?: {
1417
1433
  appName?: string;
1434
+ /** NEO-410 · US14.3 — botão "Não consigo fazer esse movimento" visível desde o 1º desafio. */
1435
+ onCannotGesture?: () => void;
1418
1436
  }): void;
1419
1437
 
1420
1438
  /**
@@ -1494,7 +1512,7 @@ export declare const validateToken: (applicationToken: string) => Promise<boolea
1494
1512
  * MINOR: Incrementado quando adicionamos funcionalidades mantendo compatibilidade
1495
1513
  * PATCH: Incrementado quando corrigimos bugs mantendo compatibilidade
1496
1514
  */
1497
- export declare const VERSION = "1.28.0";
1515
+ export declare const VERSION = "1.28.1";
1498
1516
 
1499
1517
  /**
1500
1518
  * Executa `fn(sessionId)`. Se o servidor devolver 410 (sessão consumida/expirada),
@@ -6101,7 +6101,12 @@ const keyframes = `
6101
6101
  100% { transform: translate(-50%, -50%) rotate(360deg); }
6102
6102
  }
6103
6103
  `;
6104
- function FaceCaptureModal({ accessToken, onClose, onSuccess }) {
6104
+ function FaceCaptureModal({
6105
+ accessToken,
6106
+ onClose,
6107
+ onSuccess,
6108
+ onCannotGesture
6109
+ }) {
6105
6110
  const videoRef = useRef(null);
6106
6111
  const canvasRef = useRef(null);
6107
6112
  const streamRef = useRef(null);
@@ -6246,8 +6251,39 @@ function FaceCaptureModal({ accessToken, onClose, onSuccess }) {
6246
6251
  /* @__PURE__ */ jsx("video", { ref: videoRef, style: styles.video, autoPlay: true, playsInline: true, muted: true }),
6247
6252
  /* @__PURE__ */ jsx("canvas", { ref: canvasRef, style: styles.canvas }),
6248
6253
  /* @__PURE__ */ jsx("div", { style: styles.guide }),
6249
- state.status === "ready" && !faceDetected && /* @__PURE__ */ jsx("div", { style: styles.message, children: "Centralize seu rosto no círculo" }),
6250
- state.status === "capturing" && /* @__PURE__ */ jsx("div", { style: styles.message, children: "Por favor, pisque os olhos" }),
6254
+ state.status === "ready" && !faceDetected && /* @__PURE__ */ jsx("div", { style: styles.message, "aria-live": "assertive", children: "Centralize seu rosto no círculo" }),
6255
+ state.status === "capturing" && /* @__PURE__ */ jsx("div", { style: styles.message, "aria-live": "assertive", children: "Por favor, pisque os olhos" }),
6256
+ (state.status === "ready" || state.status === "capturing") && /* @__PURE__ */ jsx(
6257
+ "button",
6258
+ {
6259
+ type: "button",
6260
+ className: "neofaceid-face-cannot-gesture",
6261
+ onClick: () => {
6262
+ if (onCannotGesture) onCannotGesture();
6263
+ else onClose();
6264
+ },
6265
+ "aria-label": "Não consigo fazer esse movimento — buscar alternativa",
6266
+ style: {
6267
+ position: "absolute",
6268
+ bottom: 100,
6269
+ left: "50%",
6270
+ transform: "translateX(-50%)",
6271
+ minHeight: 44,
6272
+ minWidth: 44,
6273
+ padding: "10px 20px",
6274
+ background: "transparent",
6275
+ border: "1px solid rgba(255, 255, 255, 0.32)",
6276
+ borderRadius: 22,
6277
+ color: "rgba(255, 255, 255, 0.9)",
6278
+ fontSize: 14,
6279
+ fontWeight: 500,
6280
+ fontFamily: "inherit",
6281
+ cursor: "pointer",
6282
+ zIndex: 10
6283
+ },
6284
+ children: "Não consigo fazer esse movimento"
6285
+ }
6286
+ ),
6251
6287
  state.status === "uploading" && /* @__PURE__ */ jsx("div", { style: styles.spinner }),
6252
6288
  state.status === "success" && /* @__PURE__ */ jsx("div", { style: styles.message, children: "Autenticado!" }),
6253
6289
  state.status === "error" && /* @__PURE__ */ jsx("div", { style: styles.message, children: state.message }),
@@ -6694,7 +6730,8 @@ function BiometricRegistrationModal({
6694
6730
  onClose,
6695
6731
  onSuccess,
6696
6732
  onPhotosCaptured,
6697
- onError
6733
+ onError,
6734
+ onCannotGesture
6698
6735
  }) {
6699
6736
  const videoRef = useRef(null);
6700
6737
  const canvasRef = useRef(null);
@@ -7236,9 +7273,22 @@ function BiometricRegistrationModal({
7236
7273
  }
7237
7274
  ) }),
7238
7275
  /* @__PURE__ */ jsxs("div", { className: "instruction-box", children: [
7239
- /* @__PURE__ */ jsx("p", { className: "instruction-text", children: livenessInstructions[state.step] }),
7276
+ /* @__PURE__ */ jsx("p", { className: "instruction-text", "aria-live": "assertive", children: livenessInstructions[state.step] }),
7240
7277
  stepProgress > 0 && /* @__PURE__ */ jsx("div", { className: "progress-bar", children: /* @__PURE__ */ jsx("div", { className: "progress-fill", style: { width: `${stepProgress}%` } }) })
7241
7278
  ] }),
7279
+ /* @__PURE__ */ jsx(
7280
+ "button",
7281
+ {
7282
+ type: "button",
7283
+ className: "cannot-gesture-button",
7284
+ onClick: () => {
7285
+ if (onCannotGesture) onCannotGesture();
7286
+ else onClose();
7287
+ },
7288
+ "aria-label": "Não consigo fazer esse movimento — buscar alternativa",
7289
+ children: "Não consigo fazer esse movimento"
7290
+ }
7291
+ ),
7242
7292
  /* @__PURE__ */ jsxs("div", { className: "branding-small", children: [
7243
7293
  /* @__PURE__ */ jsx(
7244
7294
  "span",
@@ -7811,6 +7861,31 @@ function BiometricRegistrationModal({
7811
7861
  transition: width 0.05s linear;
7812
7862
  }
7813
7863
 
7864
+ /* NEO-410 · US14.3 — botão "Não consigo fazer esse movimento" */
7865
+ .cannot-gesture-button {
7866
+ margin-top: 16px;
7867
+ min-height: 44px;
7868
+ min-width: 44px;
7869
+ padding: 10px 20px;
7870
+ background: transparent;
7871
+ border: 1px solid rgba(255, 255, 255, 0.28);
7872
+ border-radius: 22px;
7873
+ color: rgba(255, 255, 255, 0.85);
7874
+ font-size: 14px;
7875
+ font-weight: 500;
7876
+ font-family: inherit;
7877
+ cursor: pointer;
7878
+ transition: background 120ms ease-out, border-color 120ms ease-out;
7879
+ }
7880
+ .cannot-gesture-button:hover {
7881
+ background: rgba(255, 255, 255, 0.08);
7882
+ border-color: rgba(255, 255, 255, 0.42);
7883
+ }
7884
+ .cannot-gesture-button:focus-visible {
7885
+ outline: 2px solid #0059C4;
7886
+ outline-offset: 2px;
7887
+ }
7888
+
7814
7889
  .branding-small {
7815
7890
  position: absolute;
7816
7891
  bottom: 24px;
@@ -10565,7 +10640,7 @@ const biometricDetection = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.
10565
10640
  initializeBiometricDetection,
10566
10641
  isAdvancedDetectionAvailable
10567
10642
  }, Symbol.toStringTag, { value: "Module" }));
10568
- const VERSION = "1.28.0";
10643
+ const VERSION = "1.28.1";
10569
10644
  const RELEASE_DATE = "2026-09-01";
10570
10645
  let cachedSession = null;
10571
10646
  function getCachedCaptureSession() {
@@ -12561,7 +12636,8 @@ function start(applicationToken, callbacks, options) {
12561
12636
  email: result.data.faceId,
12562
12637
  documentId: result.data.faceId
12563
12638
  });
12564
- }
12639
+ },
12640
+ onCannotGesture: options == null ? void 0 : options.onCannotGesture
12565
12641
  });
12566
12642
  const root = createRoot(container);
12567
12643
  root.render(modalElement);
@@ -12603,7 +12679,8 @@ function startBiometricRegistration(personData, applicationToken, callbacks, opt
12603
12679
  onError: (error) => {
12604
12680
  cleanup();
12605
12681
  callbacks.onError("BIOMETRIC_REGISTRATION_ERROR", error);
12606
- }
12682
+ },
12683
+ onCannotGesture: options == null ? void 0 : options.onCannotGesture
12607
12684
  });
12608
12685
  rootRef = createRoot(container);
12609
12686
  rootRef.render(modalElement);
@@ -12650,7 +12727,8 @@ function startLivenessCapture(applicationToken, callbacks, options) {
12650
12727
  onError: (error) => {
12651
12728
  cleanup();
12652
12729
  callbacks.onError("LIVENESS_CAPTURE_ERROR", error);
12653
- }
12730
+ },
12731
+ onCannotGesture: options == null ? void 0 : options.onCannotGesture
12654
12732
  });
12655
12733
  rootRef = createRoot(container);
12656
12734
  rootRef.render(modalElement);