biometry-react-components 1.2.6 → 1.2.8

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.esm.js CHANGED
@@ -6,7 +6,7 @@ import {jsx,jsxs,Fragment}from'react/jsx-runtime';import {useState,useRef,useEff
6
6
  const streamRef = useRef(null);
7
7
  const QUALITY_MULTIPLIER = 3;
8
8
  // Crop area (dashed area) as percentages
9
- const cropTop = 0.1, cropLeft = 0.1, cropWidth = 0.8, cropHeight = 0.8;
9
+ const cropTop = 0.075, cropLeft = 0.075, cropWidth = 0.85, cropHeight = 0.85;
10
10
  useEffect(() => {
11
11
  let isMounted = true;
12
12
  if (!isConfirming) {
@@ -7267,8 +7267,9 @@ if (typeof window !== 'undefined' && typeof console !== 'undefined') {
7267
7267
  console.log('MediaRecorder supported:', typeof MediaRecorder !== 'undefined');
7268
7268
  console.log('getUserMedia supported:', !!(navigator.mediaDevices && navigator.mediaDevices.getUserMedia));
7269
7269
  }
7270
- const RECORD_SECONDS$1 = 10;
7270
+ const RECORD_SECONDS$1 = 7;
7271
7271
  const PREP_SECONDS$1 = 3;
7272
+ const DIGITS_NUMBER$1 = 7;
7272
7273
  function generateRandomDigits$1(count) {
7273
7274
  const digits = Array.from({ length: 10 }, (_, i) => i);
7274
7275
  for (let i = digits.length - 1; i > 0; i--) {
@@ -7281,7 +7282,7 @@ const FaceRecorder = ({ rectWidth = 360, rectHeight = 576, onCapture, className,
7281
7282
  const [state, setState] = useState('preparation');
7282
7283
  const [prepTimer, setPrepTimer] = useState(PREP_SECONDS$1);
7283
7284
  const [recordTimer, setRecordTimer] = useState(RECORD_SECONDS$1);
7284
- const [digits, setDigits] = useState(generateRandomDigits$1(10));
7285
+ const [digits, setDigits] = useState(generateRandomDigits$1(DIGITS_NUMBER$1));
7285
7286
  const { permission, stream, stopStreamTracks, requestPermissions, isLoading } = usePermissions({ rectWidth, rectHeight });
7286
7287
  const [videoBlob, setVideoBlob] = useState(null);
7287
7288
  const [audioBlob, setAudioBlob] = useState(null);
@@ -7364,7 +7365,7 @@ const FaceRecorder = ({ rectWidth = 360, rectHeight = 576, onCapture, className,
7364
7365
  }
7365
7366
  }, [state, recordTimer]);
7366
7367
  const startRecording = async () => {
7367
- setDigits(generateRandomDigits$1(10));
7368
+ setDigits(generateRandomDigits$1(DIGITS_NUMBER$1));
7368
7369
  setRecordTimer(RECORD_SECONDS$1);
7369
7370
  setState('countdown');
7370
7371
  };
@@ -7380,7 +7381,7 @@ const FaceRecorder = ({ rectWidth = 360, rectHeight = 576, onCapture, className,
7380
7381
  setVideoBlob(null);
7381
7382
  setAudioBlob(null);
7382
7383
  // Reset digits for next recording
7383
- setDigits(generateRandomDigits$1(10));
7384
+ setDigits(generateRandomDigits$1(DIGITS_NUMBER$1));
7384
7385
  // Restart the stream for cancellation
7385
7386
  requestPermissions();
7386
7387
  };
@@ -7400,7 +7401,7 @@ const FaceRecorder = ({ rectWidth = 360, rectHeight = 576, onCapture, className,
7400
7401
  setIsConfirming(false);
7401
7402
  setState('preparation');
7402
7403
  // Reset digits for next recording
7403
- setDigits(generateRandomDigits$1(10));
7404
+ setDigits(generateRandomDigits$1(DIGITS_NUMBER$1));
7404
7405
  // Restart stream for next recording
7405
7406
  requestPermissions();
7406
7407
  }
@@ -7414,7 +7415,7 @@ const FaceRecorder = ({ rectWidth = 360, rectHeight = 576, onCapture, className,
7414
7415
  setIsConfirming(false);
7415
7416
  setState('preparation');
7416
7417
  // Reset digits for next recording
7417
- setDigits(generateRandomDigits$1(10));
7418
+ setDigits(generateRandomDigits$1(DIGITS_NUMBER$1));
7418
7419
  // Restart the stream for retake
7419
7420
  requestPermissions();
7420
7421
  };
@@ -7449,8 +7450,8 @@ const FaceRecorder = ({ rectWidth = 360, rectHeight = 576, onCapture, className,
7449
7450
  top: '18%',
7450
7451
  left: '50%',
7451
7452
  transform: 'translateX(-50%)',
7452
- width: '72%',
7453
- height: '68%',
7453
+ width: '80%',
7454
+ height: '74%',
7454
7455
  zIndex: 2,
7455
7456
  display: 'flex',
7456
7457
  flexDirection: 'column',
@@ -7602,7 +7603,7 @@ const FaceRecorder = ({ rectWidth = 360, rectHeight = 576, onCapture, className,
7602
7603
  background: 'rgba(0,0,0,0.4)',
7603
7604
  zIndex: 1,
7604
7605
  borderRadius: noShadow ? 0 : 8,
7605
- } }), jsxs("div", { className: "facerecorder-oval-area", style: ovalArea, children: [jsx("span", { className: "facerecorder-guidance-text", style: guidanceText, children: "Place your face in the oval" }), jsx("div", { className: "facerecorder-oval-dashed", style: ovalDashed })] }), state === 'countdown' && (jsx("div", { style: prepTimerStyle, children: prepTimer })), state === 'recording' && (jsx("div", { style: timerStyle, children: recordTimer }))] }), jsx("div", { style: numberRow, children: (state === 'recording' ? digits : Array(10).fill('*')).map((num, i) => (jsx("div", { style: numberBox, children: num }, i))) }), state === 'preparation' && (jsx("button", { type: "button", style: actionButton, onClick: startRecording, children: "Start recording" })), state === 'recording' && (jsx("button", { type: "button", style: { ...actionButton, background: '#d32f2f' }, onClick: handleCancel, children: "Cancel" }))] })), state === 'processing' && (jsx(Fragment, { children: jsx("div", { className: "facerecorder-processing", style: preview, children: jsxs("div", { style: {
7606
+ } }), jsxs("div", { className: "facerecorder-oval-area", style: ovalArea, children: [jsx("span", { className: "facerecorder-guidance-text", style: guidanceText, children: "Place your face in the oval" }), jsx("div", { className: "facerecorder-oval-dashed", style: ovalDashed })] }), state === 'countdown' && (jsx("div", { style: prepTimerStyle, children: prepTimer })), state === 'recording' && (jsx("div", { style: timerStyle, children: recordTimer }))] }), jsx("div", { style: numberRow, children: (state === 'recording' ? digits : Array(DIGITS_NUMBER$1).fill('*')).map((num, i) => (jsx("div", { style: numberBox, children: num }, i))) }), state === 'preparation' && (jsx("button", { type: "button", style: actionButton, onClick: startRecording, children: "Start recording" })), state === 'recording' && (jsx("button", { type: "button", style: { ...actionButton, background: '#d32f2f' }, onClick: handleCancel, children: "Cancel" }))] })), state === 'processing' && (jsx(Fragment, { children: jsx("div", { className: "facerecorder-processing", style: preview, children: jsxs("div", { style: {
7606
7607
  display: 'flex',
7607
7608
  flexDirection: 'column',
7608
7609
  alignItems: 'center',
@@ -7707,8 +7708,9 @@ if (typeof document !== 'undefined') {
7707
7708
  style.textContent = spinnerStyle;
7708
7709
  document.head.appendChild(style);
7709
7710
  }
7710
- const RECORD_SECONDS = 10;
7711
+ const RECORD_SECONDS = 7;
7711
7712
  const PREP_SECONDS = 3;
7713
+ const DIGITS_NUMBER = 7;
7712
7714
  function generateRandomDigits(count) {
7713
7715
  const digits = Array.from({ length: 10 }, (_, i) => i);
7714
7716
  for (let i = digits.length - 1; i > 0; i--) {
@@ -7721,7 +7723,7 @@ const VoiceRecorder = ({ rectWidth = 360, rectHeight, onCapture, className, styl
7721
7723
  const [state, setState] = useState('preparation');
7722
7724
  const [prepTimer, setPrepTimer] = useState(PREP_SECONDS);
7723
7725
  const [recordTimer, setRecordTimer] = useState(RECORD_SECONDS);
7724
- const [digits, setDigits] = useState(generateRandomDigits(10));
7726
+ const [digits, setDigits] = useState(generateRandomDigits(DIGITS_NUMBER));
7725
7727
  const [audioLevel, setAudioLevel] = useState(0);
7726
7728
  const [waveformData, setWaveformData] = useState([]);
7727
7729
  const { permission, stream, stopStreamTracks, requestPermissions, isLoading } = useAudioPermissions();
@@ -7808,7 +7810,7 @@ const VoiceRecorder = ({ rectWidth = 360, rectHeight, onCapture, className, styl
7808
7810
  }
7809
7811
  }, [state, recordTimer]);
7810
7812
  const startRecording = async () => {
7811
- setDigits(generateRandomDigits(10));
7813
+ setDigits(generateRandomDigits(DIGITS_NUMBER));
7812
7814
  setRecordTimer(RECORD_SECONDS);
7813
7815
  setState('countdown');
7814
7816
  };
package/dist/index.js CHANGED
@@ -6,7 +6,7 @@
6
6
  const streamRef = react.useRef(null);
7
7
  const QUALITY_MULTIPLIER = 3;
8
8
  // Crop area (dashed area) as percentages
9
- const cropTop = 0.1, cropLeft = 0.1, cropWidth = 0.8, cropHeight = 0.8;
9
+ const cropTop = 0.075, cropLeft = 0.075, cropWidth = 0.85, cropHeight = 0.85;
10
10
  react.useEffect(() => {
11
11
  let isMounted = true;
12
12
  if (!isConfirming) {
@@ -7267,8 +7267,9 @@ if (typeof window !== 'undefined' && typeof console !== 'undefined') {
7267
7267
  console.log('MediaRecorder supported:', typeof MediaRecorder !== 'undefined');
7268
7268
  console.log('getUserMedia supported:', !!(navigator.mediaDevices && navigator.mediaDevices.getUserMedia));
7269
7269
  }
7270
- const RECORD_SECONDS$1 = 10;
7270
+ const RECORD_SECONDS$1 = 7;
7271
7271
  const PREP_SECONDS$1 = 3;
7272
+ const DIGITS_NUMBER$1 = 7;
7272
7273
  function generateRandomDigits$1(count) {
7273
7274
  const digits = Array.from({ length: 10 }, (_, i) => i);
7274
7275
  for (let i = digits.length - 1; i > 0; i--) {
@@ -7281,7 +7282,7 @@ const FaceRecorder = ({ rectWidth = 360, rectHeight = 576, onCapture, className,
7281
7282
  const [state, setState] = react.useState('preparation');
7282
7283
  const [prepTimer, setPrepTimer] = react.useState(PREP_SECONDS$1);
7283
7284
  const [recordTimer, setRecordTimer] = react.useState(RECORD_SECONDS$1);
7284
- const [digits, setDigits] = react.useState(generateRandomDigits$1(10));
7285
+ const [digits, setDigits] = react.useState(generateRandomDigits$1(DIGITS_NUMBER$1));
7285
7286
  const { permission, stream, stopStreamTracks, requestPermissions, isLoading } = usePermissions({ rectWidth, rectHeight });
7286
7287
  const [videoBlob, setVideoBlob] = react.useState(null);
7287
7288
  const [audioBlob, setAudioBlob] = react.useState(null);
@@ -7364,7 +7365,7 @@ const FaceRecorder = ({ rectWidth = 360, rectHeight = 576, onCapture, className,
7364
7365
  }
7365
7366
  }, [state, recordTimer]);
7366
7367
  const startRecording = async () => {
7367
- setDigits(generateRandomDigits$1(10));
7368
+ setDigits(generateRandomDigits$1(DIGITS_NUMBER$1));
7368
7369
  setRecordTimer(RECORD_SECONDS$1);
7369
7370
  setState('countdown');
7370
7371
  };
@@ -7380,7 +7381,7 @@ const FaceRecorder = ({ rectWidth = 360, rectHeight = 576, onCapture, className,
7380
7381
  setVideoBlob(null);
7381
7382
  setAudioBlob(null);
7382
7383
  // Reset digits for next recording
7383
- setDigits(generateRandomDigits$1(10));
7384
+ setDigits(generateRandomDigits$1(DIGITS_NUMBER$1));
7384
7385
  // Restart the stream for cancellation
7385
7386
  requestPermissions();
7386
7387
  };
@@ -7400,7 +7401,7 @@ const FaceRecorder = ({ rectWidth = 360, rectHeight = 576, onCapture, className,
7400
7401
  setIsConfirming(false);
7401
7402
  setState('preparation');
7402
7403
  // Reset digits for next recording
7403
- setDigits(generateRandomDigits$1(10));
7404
+ setDigits(generateRandomDigits$1(DIGITS_NUMBER$1));
7404
7405
  // Restart stream for next recording
7405
7406
  requestPermissions();
7406
7407
  }
@@ -7414,7 +7415,7 @@ const FaceRecorder = ({ rectWidth = 360, rectHeight = 576, onCapture, className,
7414
7415
  setIsConfirming(false);
7415
7416
  setState('preparation');
7416
7417
  // Reset digits for next recording
7417
- setDigits(generateRandomDigits$1(10));
7418
+ setDigits(generateRandomDigits$1(DIGITS_NUMBER$1));
7418
7419
  // Restart the stream for retake
7419
7420
  requestPermissions();
7420
7421
  };
@@ -7449,8 +7450,8 @@ const FaceRecorder = ({ rectWidth = 360, rectHeight = 576, onCapture, className,
7449
7450
  top: '18%',
7450
7451
  left: '50%',
7451
7452
  transform: 'translateX(-50%)',
7452
- width: '72%',
7453
- height: '68%',
7453
+ width: '80%',
7454
+ height: '74%',
7454
7455
  zIndex: 2,
7455
7456
  display: 'flex',
7456
7457
  flexDirection: 'column',
@@ -7602,7 +7603,7 @@ const FaceRecorder = ({ rectWidth = 360, rectHeight = 576, onCapture, className,
7602
7603
  background: 'rgba(0,0,0,0.4)',
7603
7604
  zIndex: 1,
7604
7605
  borderRadius: noShadow ? 0 : 8,
7605
- } }), jsxRuntime.jsxs("div", { className: "facerecorder-oval-area", style: ovalArea, children: [jsxRuntime.jsx("span", { className: "facerecorder-guidance-text", style: guidanceText, children: "Place your face in the oval" }), jsxRuntime.jsx("div", { className: "facerecorder-oval-dashed", style: ovalDashed })] }), state === 'countdown' && (jsxRuntime.jsx("div", { style: prepTimerStyle, children: prepTimer })), state === 'recording' && (jsxRuntime.jsx("div", { style: timerStyle, children: recordTimer }))] }), jsxRuntime.jsx("div", { style: numberRow, children: (state === 'recording' ? digits : Array(10).fill('*')).map((num, i) => (jsxRuntime.jsx("div", { style: numberBox, children: num }, i))) }), state === 'preparation' && (jsxRuntime.jsx("button", { type: "button", style: actionButton, onClick: startRecording, children: "Start recording" })), state === 'recording' && (jsxRuntime.jsx("button", { type: "button", style: { ...actionButton, background: '#d32f2f' }, onClick: handleCancel, children: "Cancel" }))] })), state === 'processing' && (jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsx("div", { className: "facerecorder-processing", style: preview, children: jsxRuntime.jsxs("div", { style: {
7606
+ } }), jsxRuntime.jsxs("div", { className: "facerecorder-oval-area", style: ovalArea, children: [jsxRuntime.jsx("span", { className: "facerecorder-guidance-text", style: guidanceText, children: "Place your face in the oval" }), jsxRuntime.jsx("div", { className: "facerecorder-oval-dashed", style: ovalDashed })] }), state === 'countdown' && (jsxRuntime.jsx("div", { style: prepTimerStyle, children: prepTimer })), state === 'recording' && (jsxRuntime.jsx("div", { style: timerStyle, children: recordTimer }))] }), jsxRuntime.jsx("div", { style: numberRow, children: (state === 'recording' ? digits : Array(DIGITS_NUMBER$1).fill('*')).map((num, i) => (jsxRuntime.jsx("div", { style: numberBox, children: num }, i))) }), state === 'preparation' && (jsxRuntime.jsx("button", { type: "button", style: actionButton, onClick: startRecording, children: "Start recording" })), state === 'recording' && (jsxRuntime.jsx("button", { type: "button", style: { ...actionButton, background: '#d32f2f' }, onClick: handleCancel, children: "Cancel" }))] })), state === 'processing' && (jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsx("div", { className: "facerecorder-processing", style: preview, children: jsxRuntime.jsxs("div", { style: {
7606
7607
  display: 'flex',
7607
7608
  flexDirection: 'column',
7608
7609
  alignItems: 'center',
@@ -7707,8 +7708,9 @@ if (typeof document !== 'undefined') {
7707
7708
  style.textContent = spinnerStyle;
7708
7709
  document.head.appendChild(style);
7709
7710
  }
7710
- const RECORD_SECONDS = 10;
7711
+ const RECORD_SECONDS = 7;
7711
7712
  const PREP_SECONDS = 3;
7713
+ const DIGITS_NUMBER = 7;
7712
7714
  function generateRandomDigits(count) {
7713
7715
  const digits = Array.from({ length: 10 }, (_, i) => i);
7714
7716
  for (let i = digits.length - 1; i > 0; i--) {
@@ -7721,7 +7723,7 @@ const VoiceRecorder = ({ rectWidth = 360, rectHeight, onCapture, className, styl
7721
7723
  const [state, setState] = react.useState('preparation');
7722
7724
  const [prepTimer, setPrepTimer] = react.useState(PREP_SECONDS);
7723
7725
  const [recordTimer, setRecordTimer] = react.useState(RECORD_SECONDS);
7724
- const [digits, setDigits] = react.useState(generateRandomDigits(10));
7726
+ const [digits, setDigits] = react.useState(generateRandomDigits(DIGITS_NUMBER));
7725
7727
  const [audioLevel, setAudioLevel] = react.useState(0);
7726
7728
  const [waveformData, setWaveformData] = react.useState([]);
7727
7729
  const { permission, stream, stopStreamTracks, requestPermissions, isLoading } = useAudioPermissions();
@@ -7808,7 +7810,7 @@ const VoiceRecorder = ({ rectWidth = 360, rectHeight, onCapture, className, styl
7808
7810
  }
7809
7811
  }, [state, recordTimer]);
7810
7812
  const startRecording = async () => {
7811
- setDigits(generateRandomDigits(10));
7813
+ setDigits(generateRandomDigits(DIGITS_NUMBER));
7812
7814
  setRecordTimer(RECORD_SECONDS);
7813
7815
  setState('countdown');
7814
7816
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "biometry-react-components",
3
- "version": "1.2.6",
3
+ "version": "1.2.8",
4
4
  "type": "module",
5
5
  "description": "React UI component library for capturing high-quality biometric data (voice, face, documents, video) to facilitate integration with Biometry services",
6
6
  "main": "dist/index.js",
@@ -62,4 +62,4 @@
62
62
  "recordrtc": "^5.6.2",
63
63
  "tslib": "^2.8.1"
64
64
  }
65
- }
65
+ }