biometry-react-components 1.2.6 → 1.2.7
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 +11 -9
- package/dist/index.js +11 -9
- package/package.json +2 -2
package/dist/index.esm.js
CHANGED
|
@@ -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 =
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
7418
|
+
setDigits(generateRandomDigits$1(DIGITS_NUMBER$1));
|
|
7418
7419
|
// Restart the stream for retake
|
|
7419
7420
|
requestPermissions();
|
|
7420
7421
|
};
|
|
@@ -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 =
|
|
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(
|
|
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(
|
|
7813
|
+
setDigits(generateRandomDigits(DIGITS_NUMBER));
|
|
7812
7814
|
setRecordTimer(RECORD_SECONDS);
|
|
7813
7815
|
setState('countdown');
|
|
7814
7816
|
};
|
package/dist/index.js
CHANGED
|
@@ -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 =
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
7418
|
+
setDigits(generateRandomDigits$1(DIGITS_NUMBER$1));
|
|
7418
7419
|
// Restart the stream for retake
|
|
7419
7420
|
requestPermissions();
|
|
7420
7421
|
};
|
|
@@ -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 =
|
|
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(
|
|
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(
|
|
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.
|
|
3
|
+
"version": "1.2.7",
|
|
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
|
+
}
|