biometry-react-components 1.3.0 → 1.3.2
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 +6 -6
- package/dist/index.js +6 -6
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -7297,7 +7297,7 @@ function generateRandomDigits$1(count) {
|
|
|
7297
7297
|
}
|
|
7298
7298
|
return digits.slice(0, count);
|
|
7299
7299
|
}
|
|
7300
|
-
const FaceRecorder = ({ rectWidth = 360, rectHeight =
|
|
7300
|
+
const FaceRecorder = ({ rectWidth = 360, rectHeight = 470, onConfirmRecording, onRecorded, className, style, noShadow = false, }) => {
|
|
7301
7301
|
const [state, setState] = useState('preparation');
|
|
7302
7302
|
const [prepTimer, setPrepTimer] = useState(PREP_SECONDS$1);
|
|
7303
7303
|
const [recordTimer, setRecordTimer] = useState(RECORD_SECONDS$1);
|
|
@@ -7522,7 +7522,7 @@ const FaceRecorder = ({ rectWidth = 360, rectHeight = 576, onConfirmRecording, o
|
|
|
7522
7522
|
alignItems: 'center',
|
|
7523
7523
|
justifyContent: 'center',
|
|
7524
7524
|
width: rectWidth,
|
|
7525
|
-
height: rectHeight +
|
|
7525
|
+
height: rectHeight + 100,
|
|
7526
7526
|
margin: '0 auto',
|
|
7527
7527
|
...style,
|
|
7528
7528
|
};
|
|
@@ -7575,8 +7575,8 @@ const FaceRecorder = ({ rectWidth = 360, rectHeight = 576, onConfirmRecording, o
|
|
|
7575
7575
|
const numberRow = {
|
|
7576
7576
|
display: 'flex',
|
|
7577
7577
|
justifyContent: 'center',
|
|
7578
|
-
gap:
|
|
7579
|
-
|
|
7578
|
+
gap: 5,
|
|
7579
|
+
marginBottom: 12,
|
|
7580
7580
|
width: '100%',
|
|
7581
7581
|
maxWidth: rectWidth - 40,
|
|
7582
7582
|
};
|
|
@@ -7696,7 +7696,7 @@ const FaceRecorder = ({ rectWidth = 360, rectHeight = 576, onConfirmRecording, o
|
|
|
7696
7696
|
if (!permission) {
|
|
7697
7697
|
return (jsx("div", { className: className, style: wrapperStyle, children: jsxs("div", { style: { textAlign: 'center', padding: '20px' }, children: [jsx("h3", { children: "Camera Permission Required" }), jsx("p", { children: "Please allow camera and microphone access to use this component." }), jsx("button", { type: "button", style: actionButton, onClick: requestPermissions, children: "Grant Permissions" })] }) }));
|
|
7698
7698
|
}
|
|
7699
|
-
return (jsxs("div", { className: className, style: wrapperStyle, children: [state !== 'result' && state !== 'processing' && !isConfirming && (jsxs(Fragment, { children: [jsxs("div", { className: "facerecorder-camera-area", style: cameraArea, children: [jsx("video", { ref: videoRef, width: rectWidth - 40, height: rectHeight - 40, className: "facerecorder-video", style: {
|
|
7699
|
+
return (jsxs("div", { className: className, style: wrapperStyle, children: [state !== 'result' && state !== 'processing' && !isConfirming && (jsxs(Fragment, { children: [jsx("div", { className: "facerecorder-number-row", style: numberRow, children: (state === 'recording' ? digits : Array(DIGITS_NUMBER$1).fill('*')).map((num, i) => (jsx("div", { style: numberBox, children: num }, i))) }), jsxs("div", { className: "facerecorder-camera-area", style: cameraArea, children: [jsx("video", { ref: videoRef, width: rectWidth - 40, height: rectHeight - 40, className: "facerecorder-video", style: {
|
|
7700
7700
|
width: rectWidth - 40,
|
|
7701
7701
|
height: rectHeight - 40,
|
|
7702
7702
|
objectFit: 'cover',
|
|
@@ -7712,7 +7712,7 @@ const FaceRecorder = ({ rectWidth = 360, rectHeight = 576, onConfirmRecording, o
|
|
|
7712
7712
|
background: 'rgba(0,0,0,0.4)',
|
|
7713
7713
|
zIndex: 1,
|
|
7714
7714
|
borderRadius: noShadow ? 0 : 8,
|
|
7715
|
-
} }), 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 })), (state === 'recording' || state === 'preparation') && (jsxs("div", { style: soundwaveStyle, children: [jsx("div", { style: { ...barBase, height: `${8 + micLevel * 30}px` } }), jsx("div", { style: { ...barBase, height: `${4 + micLevel * 40}px` } }), jsx("div", { style: { ...barBase, height: `${10 + micLevel * 20}px` } })] }))] }),
|
|
7715
|
+
} }), 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 })), (state === 'recording' || state === 'preparation') && (jsxs("div", { style: soundwaveStyle, children: [jsx("div", { style: { ...barBase, height: `${8 + micLevel * 30}px` } }), jsx("div", { style: { ...barBase, height: `${4 + micLevel * 40}px` } }), jsx("div", { style: { ...barBase, height: `${10 + micLevel * 20}px` } })] }))] }), 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: {
|
|
7716
7716
|
display: 'flex',
|
|
7717
7717
|
flexDirection: 'column',
|
|
7718
7718
|
alignItems: 'center',
|
package/dist/index.js
CHANGED
|
@@ -7297,7 +7297,7 @@ function generateRandomDigits$1(count) {
|
|
|
7297
7297
|
}
|
|
7298
7298
|
return digits.slice(0, count);
|
|
7299
7299
|
}
|
|
7300
|
-
const FaceRecorder = ({ rectWidth = 360, rectHeight =
|
|
7300
|
+
const FaceRecorder = ({ rectWidth = 360, rectHeight = 470, onConfirmRecording, onRecorded, className, style, noShadow = false, }) => {
|
|
7301
7301
|
const [state, setState] = React.useState('preparation');
|
|
7302
7302
|
const [prepTimer, setPrepTimer] = React.useState(PREP_SECONDS$1);
|
|
7303
7303
|
const [recordTimer, setRecordTimer] = React.useState(RECORD_SECONDS$1);
|
|
@@ -7522,7 +7522,7 @@ const FaceRecorder = ({ rectWidth = 360, rectHeight = 576, onConfirmRecording, o
|
|
|
7522
7522
|
alignItems: 'center',
|
|
7523
7523
|
justifyContent: 'center',
|
|
7524
7524
|
width: rectWidth,
|
|
7525
|
-
height: rectHeight +
|
|
7525
|
+
height: rectHeight + 100,
|
|
7526
7526
|
margin: '0 auto',
|
|
7527
7527
|
...style,
|
|
7528
7528
|
};
|
|
@@ -7575,8 +7575,8 @@ const FaceRecorder = ({ rectWidth = 360, rectHeight = 576, onConfirmRecording, o
|
|
|
7575
7575
|
const numberRow = {
|
|
7576
7576
|
display: 'flex',
|
|
7577
7577
|
justifyContent: 'center',
|
|
7578
|
-
gap:
|
|
7579
|
-
|
|
7578
|
+
gap: 5,
|
|
7579
|
+
marginBottom: 12,
|
|
7580
7580
|
width: '100%',
|
|
7581
7581
|
maxWidth: rectWidth - 40,
|
|
7582
7582
|
};
|
|
@@ -7696,7 +7696,7 @@ const FaceRecorder = ({ rectWidth = 360, rectHeight = 576, onConfirmRecording, o
|
|
|
7696
7696
|
if (!permission) {
|
|
7697
7697
|
return (jsxRuntime.jsx("div", { className: className, style: wrapperStyle, children: jsxRuntime.jsxs("div", { style: { textAlign: 'center', padding: '20px' }, children: [jsxRuntime.jsx("h3", { children: "Camera Permission Required" }), jsxRuntime.jsx("p", { children: "Please allow camera and microphone access to use this component." }), jsxRuntime.jsx("button", { type: "button", style: actionButton, onClick: requestPermissions, children: "Grant Permissions" })] }) }));
|
|
7698
7698
|
}
|
|
7699
|
-
return (jsxRuntime.jsxs("div", { className: className, style: wrapperStyle, children: [state !== 'result' && state !== 'processing' && !isConfirming && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("div", { className: "facerecorder-camera-area", style: cameraArea, children: [jsxRuntime.jsx("video", { ref: videoRef, width: rectWidth - 40, height: rectHeight - 40, className: "facerecorder-video", style: {
|
|
7699
|
+
return (jsxRuntime.jsxs("div", { className: className, style: wrapperStyle, children: [state !== 'result' && state !== 'processing' && !isConfirming && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("div", { className: "facerecorder-number-row", style: numberRow, children: (state === 'recording' ? digits : Array(DIGITS_NUMBER$1).fill('*')).map((num, i) => (jsxRuntime.jsx("div", { style: numberBox, children: num }, i))) }), jsxRuntime.jsxs("div", { className: "facerecorder-camera-area", style: cameraArea, children: [jsxRuntime.jsx("video", { ref: videoRef, width: rectWidth - 40, height: rectHeight - 40, className: "facerecorder-video", style: {
|
|
7700
7700
|
width: rectWidth - 40,
|
|
7701
7701
|
height: rectHeight - 40,
|
|
7702
7702
|
objectFit: 'cover',
|
|
@@ -7712,7 +7712,7 @@ const FaceRecorder = ({ rectWidth = 360, rectHeight = 576, onConfirmRecording, o
|
|
|
7712
7712
|
background: 'rgba(0,0,0,0.4)',
|
|
7713
7713
|
zIndex: 1,
|
|
7714
7714
|
borderRadius: noShadow ? 0 : 8,
|
|
7715
|
-
} }), 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 })), (state === 'recording' || state === 'preparation') && (jsxRuntime.jsxs("div", { style: soundwaveStyle, children: [jsxRuntime.jsx("div", { style: { ...barBase, height: `${8 + micLevel * 30}px` } }), jsxRuntime.jsx("div", { style: { ...barBase, height: `${4 + micLevel * 40}px` } }), jsxRuntime.jsx("div", { style: { ...barBase, height: `${10 + micLevel * 20}px` } })] }))] }),
|
|
7715
|
+
} }), 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 })), (state === 'recording' || state === 'preparation') && (jsxRuntime.jsxs("div", { style: soundwaveStyle, children: [jsxRuntime.jsx("div", { style: { ...barBase, height: `${8 + micLevel * 30}px` } }), jsxRuntime.jsx("div", { style: { ...barBase, height: `${4 + micLevel * 40}px` } }), jsxRuntime.jsx("div", { style: { ...barBase, height: `${10 + micLevel * 20}px` } })] }))] }), 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: {
|
|
7716
7716
|
display: 'flex',
|
|
7717
7717
|
flexDirection: 'column',
|
|
7718
7718
|
alignItems: 'center',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "biometry-react-components",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.2",
|
|
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",
|