datakeen-session-react 1.1.202-rc.1 → 1.1.203
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/cjs/components/jdi/JDIDocumentSelection.js +3 -0
- package/dist/cjs/components/jdi/JDIDocumentUpload.js +5 -2
- package/dist/cjs/components/session/DocumentCheck.js +21 -21
- package/dist/cjs/i18n/en.json.js +1 -0
- package/dist/cjs/i18n/es.json.js +1 -0
- package/dist/cjs/i18n/fr.json.js +1 -0
- package/dist/esm/components/jdi/JDIDocumentSelection.js +3 -0
- package/dist/esm/components/jdi/JDIDocumentUpload.js +5 -2
- package/dist/esm/components/session/DocumentCheck.js +21 -21
- package/dist/esm/i18n/en.json.js +1 -0
- package/dist/esm/i18n/es.json.js +1 -0
- package/dist/esm/i18n/fr.json.js +1 -0
- package/package.json +1 -1
|
@@ -139,6 +139,7 @@ var JDIDocumentSelection = function (_a) {
|
|
|
139
139
|
case "idCard":
|
|
140
140
|
return [
|
|
141
141
|
t("jdi.document_selection.instructions.idCard.recto_verso"),
|
|
142
|
+
t("jdi.document_selection.instructions.two_sided_files"),
|
|
142
143
|
t("jdi.document_selection.instructions.idCard.readable"),
|
|
143
144
|
t("jdi.document_selection.instructions.idCard.valid"),
|
|
144
145
|
];
|
|
@@ -151,6 +152,7 @@ var JDIDocumentSelection = function (_a) {
|
|
|
151
152
|
case "driverLicense":
|
|
152
153
|
return [
|
|
153
154
|
t("jdi.document_selection.instructions.driverLicense.recto_verso"),
|
|
155
|
+
t("jdi.document_selection.instructions.two_sided_files"),
|
|
154
156
|
t("jdi.document_selection.instructions.driverLicense.not_expired"),
|
|
155
157
|
t("jdi.document_selection.instructions.driverLicense.all_visible"),
|
|
156
158
|
];
|
|
@@ -163,6 +165,7 @@ var JDIDocumentSelection = function (_a) {
|
|
|
163
165
|
case "residencePermit":
|
|
164
166
|
return [
|
|
165
167
|
t("jdi.document_selection.instructions.residencePermit.recto_verso"),
|
|
168
|
+
t("jdi.document_selection.instructions.two_sided_files"),
|
|
166
169
|
t("jdi.document_selection.instructions.residencePermit.valid"),
|
|
167
170
|
t("jdi.document_selection.instructions.residencePermit.readable"),
|
|
168
171
|
];
|
|
@@ -15,8 +15,11 @@ var documentLabels = require('../../utils/documentLabels.js');
|
|
|
15
15
|
var MobilePageLayout = require('../ui/MobilePageLayout.js');
|
|
16
16
|
|
|
17
17
|
var JDIDocumentUpload = function (_a) {
|
|
18
|
-
var documentType = _a.documentType, onUpload = _a.onUpload, onBack = _a.onBack, documentTypeId = _a.documentTypeId, documentLabel = _a.documentLabel, _b = _a.initialFront, initialFront = _b === void 0 ? null : _b, _c = _a.initialBack, initialBack = _c === void 0 ? null : _c; _a.sessionId;
|
|
18
|
+
var documentType = _a.documentType, onUpload = _a.onUpload, onBack = _a.onBack, documentTypeId = _a.documentTypeId, documentLabel = _a.documentLabel, _b = _a.initialFront, initialFront = _b === void 0 ? null : _b, _c = _a.initialBack, initialBack = _c === void 0 ? null : _c; _a.sessionId; var title = _a.title, description = _a.description;
|
|
19
19
|
var t = useI18n.useI18n().t;
|
|
20
|
+
var documentName = t("documentTypes." + documentType);
|
|
21
|
+
var customTitle = title === null || title === void 0 ? void 0 : title.trim().replace(/\{\{\s*document\s*\}\}/g, function () { return documentName; });
|
|
22
|
+
var customDescription = description === null || description === void 0 ? void 0 : description.trim().replace(/\{\{\s*document\s*\}\}/g, function () { return documentName; });
|
|
20
23
|
// Helper functions for conditional text
|
|
21
24
|
var getDropZoneText = function () {
|
|
22
25
|
return t("jdi.document_upload.drop_zone", {
|
|
@@ -462,7 +465,7 @@ var JDIDocumentUpload = function (_a) {
|
|
|
462
465
|
}
|
|
463
466
|
});
|
|
464
467
|
}); };
|
|
465
|
-
return (jsxRuntime.jsx(MobilePageLayout.default, { contentClassName: "h-full", footer: jsxRuntime.jsx(PageActions.default, { primary: jsxRuntime.jsx(Button.default, { onClick: handleUpload, disabled: (!frontFile && !isFrontFromInitial) || isUploading, children: getValidateButtonText() }), secondary: onBack ? (jsxRuntime.jsx(Button.default, { variant: "secondary", onClick: onBack, disabled: isUploading, children: t("jdi.document_upload.back") })) : undefined }), children: jsxRuntime.jsx("div", { className: "flex-1 flex items-start justify-center md:items-center p-4", children: jsxRuntime.jsxs("div", { className: "w-full max-w-lg", children: [jsxRuntime.jsxs("div", { className: "text-center mb-8", children: [jsxRuntime.jsx("h1", { className: "text-2xl md:text-3xl font-bold text-gray-900 mb-2", children: getDropZoneText() }), jsxRuntime.jsx("p", { className: "text-gray-600", children: getUploadInstruction() })] }), jsxRuntime.jsx(Card.Card, { ref: dropZoneRef, className: "border-2 border-dashed ".concat(isDragging
|
|
468
|
+
return (jsxRuntime.jsx(MobilePageLayout.default, { contentClassName: "h-full", footer: jsxRuntime.jsx(PageActions.default, { primary: jsxRuntime.jsx(Button.default, { onClick: handleUpload, disabled: (!frontFile && !isFrontFromInitial) || isUploading, children: getValidateButtonText() }), secondary: onBack ? (jsxRuntime.jsx(Button.default, { variant: "secondary", onClick: onBack, disabled: isUploading, children: t("jdi.document_upload.back") })) : undefined }), children: jsxRuntime.jsx("div", { className: "flex-1 flex items-start justify-center md:items-center p-4", children: jsxRuntime.jsxs("div", { className: "w-full max-w-lg", children: [jsxRuntime.jsxs("div", { className: "text-center mb-8", children: [jsxRuntime.jsx("h1", { className: "text-2xl md:text-3xl font-bold text-gray-900 mb-2", children: customTitle || getDropZoneText() }), jsxRuntime.jsx("p", { className: "text-gray-600 whitespace-pre-line", children: customDescription || getUploadInstruction() })] }), jsxRuntime.jsx(Card.Card, { ref: dropZoneRef, className: "border-2 border-dashed ".concat(isDragging
|
|
466
469
|
? "border-teal-500 bg-teal-100/50"
|
|
467
470
|
: "border-teal-300 bg-teal-50/30", " p-8 mb-6 transition-colors"), onDragEnter: handleDragEnter, onDragLeave: handleDragLeave, onDragOver: handleDragOver, onDrop: handleDrop, children: jsxRuntime.jsx("div", { className: "text-center space-y-6", children: !frontPreview ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("h3", { className: "text-lg font-semibold text-gray-900 mb-4", children: t("documentTypes." + documentType) }), jsxRuntime.jsx("div", { className: "flex justify-center w-full", children: jsxRuntime.jsx(Button.default, { onClick: function () { var _a; return (_a = frontInputRef.current) === null || _a === void 0 ? void 0 : _a.click(); }, className: "border border-teal-300 text-teal-600 bg-transparent hover:bg-teal-50 px-4 py-2 rounded-lg font-medium text-sm mx-auto flex items-center", disabled: isUploading, children: jsxRuntime.jsx("span", { children: t("jdi.document_upload.add_file") }) }) }), jsxRuntime.jsx("p", { className: "text-sm text-gray-500 italic", children: t("jdi.document_upload.drag_drop_hint", "ou glissez-déposez vos fichiers ici") }), jsxRuntime.jsxs("div", { className: "text-sm text-gray-600 space-y-1", children: [jsxRuntime.jsx("p", { children: t("jdi.document_upload.accepted_formats") }), jsxRuntime.jsx("p", { children: twoSidesRequired
|
|
468
471
|
? frontPreview
|
|
@@ -75,12 +75,12 @@ var normalizeNfcMode = function (mode) {
|
|
|
75
75
|
* - Uses hooks for translation, retry navigation, and context management.
|
|
76
76
|
*/
|
|
77
77
|
var DocumentCheck = function (_a) {
|
|
78
|
-
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
79
|
-
var stepObject = _a.stepObject, sessionId = _a.sessionId, node = _a.node, documentTypeId = _a.documentTypeId, acceptedCountries = _a.acceptedCountries,
|
|
78
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
79
|
+
var stepObject = _a.stepObject, sessionId = _a.sessionId, node = _a.node, documentTypeId = _a.documentTypeId, acceptedCountries = _a.acceptedCountries, _r = _a.isMobileCapture, isMobileCapture = _r === void 0 ? false : _r, allowedAddingMethods = _a.allowedAddingMethods, template = _a.template, setUserInput = _a.setUserInput;
|
|
80
80
|
var t = useI18n.useI18n().t;
|
|
81
81
|
var session = SessionContext.getSession().session;
|
|
82
|
-
var
|
|
83
|
-
var
|
|
82
|
+
var _s = React.useState(), documentTemplates = _s[0], setDocumentTemplates = _s[1];
|
|
83
|
+
var _t = React.useState(true), loadingTemplates = _t[0], setLoadingTemplates = _t[1];
|
|
84
84
|
React.useEffect(function () {
|
|
85
85
|
(function () { return tslib_es6.__awaiter(void 0, void 0, void 0, function () {
|
|
86
86
|
var templates;
|
|
@@ -99,7 +99,7 @@ var DocumentCheck = function (_a) {
|
|
|
99
99
|
}); })();
|
|
100
100
|
}, []);
|
|
101
101
|
var initialRetryCount = retryService.getNodeRetryCount(session, node.id);
|
|
102
|
-
var
|
|
102
|
+
var _u = React.useState(null), selectedMethod = _u[0], setSelectedMethod = _u[1];
|
|
103
103
|
var isPictureAllowed = (_b = allowedAddingMethods === null || allowedAddingMethods === void 0 ? void 0 : allowedAddingMethods.includes("picture")) !== null && _b !== void 0 ? _b : true;
|
|
104
104
|
var isDownloadAllowed = (_c = allowedAddingMethods === null || allowedAddingMethods === void 0 ? void 0 : allowedAddingMethods.includes("download")) !== null && _c !== void 0 ? _c : true;
|
|
105
105
|
// Check if retry is allowed based on initial retry count
|
|
@@ -118,25 +118,25 @@ var DocumentCheck = function (_a) {
|
|
|
118
118
|
return true;
|
|
119
119
|
};
|
|
120
120
|
// Initialize docStep - if retries exhausted, start at error page (step 6)
|
|
121
|
-
var
|
|
121
|
+
var _v = React.useState(function () {
|
|
122
122
|
if (initialRetryCount > 0 && !isInitialRetryAllowed()) {
|
|
123
123
|
return 6; // Error page
|
|
124
124
|
}
|
|
125
125
|
return 0; // Normal flow - start with introduction
|
|
126
|
-
}), docStep =
|
|
127
|
-
var
|
|
128
|
-
var
|
|
129
|
-
var
|
|
130
|
-
var
|
|
131
|
-
var
|
|
132
|
-
var
|
|
126
|
+
}), docStep = _v[0], setDocStep = _v[1];
|
|
127
|
+
var _w = React.useState(((_e = (_d = acceptedCountries === null || acceptedCountries === void 0 ? void 0 : acceptedCountries[0]) === null || _d === void 0 ? void 0 : _d.code) === null || _e === void 0 ? void 0 : _e.toUpperCase()) || "FR"), selectedCountry = _w[0], setSelectedCountry = _w[1];
|
|
128
|
+
var _x = React.useState(null), fileUploaded = _x[0], setFileUploaded = _x[1];
|
|
129
|
+
var _y = React.useState(null), analysisData = _y[0], setAnalysisData = _y[1];
|
|
130
|
+
var _z = React.useState(null), errorCode = _z[0], setErrorCode = _z[1];
|
|
131
|
+
var _0 = React.useState(false), blockContinue = _0[0], setBlockContinue = _0[1];
|
|
132
|
+
var _1 = React.useState(null), nfcPreparationError = _1[0], setNfcPreparationError = _1[1];
|
|
133
133
|
// Quand l'utilisateur déclare ne pas avoir de puce (questionnaire de fallback),
|
|
134
134
|
// on ne doit plus le réorienter vers le scan NFC (ni avant, ni après l'analyse API).
|
|
135
|
-
var
|
|
135
|
+
var _2 = React.useState(false), nfcSkipped = _2[0], setNfcSkipped = _2[1];
|
|
136
136
|
// Initialize retry count from session data
|
|
137
|
-
var
|
|
137
|
+
var _3 = React.useState(function () {
|
|
138
138
|
return retryService.getNodeRetryCount(session, node.id);
|
|
139
|
-
}), retryCount =
|
|
139
|
+
}), retryCount = _3[0], setRetryCount = _3[1];
|
|
140
140
|
// Update retry count when session loads/changes
|
|
141
141
|
React.useEffect(function () {
|
|
142
142
|
if (session) {
|
|
@@ -231,10 +231,10 @@ var DocumentCheck = function (_a) {
|
|
|
231
231
|
setDocStep(6);
|
|
232
232
|
}
|
|
233
233
|
}, [retryCount, node.allowResubmission, node.maxResubmissionAttempts]);
|
|
234
|
-
var
|
|
235
|
-
var
|
|
236
|
-
var
|
|
237
|
-
var
|
|
234
|
+
var _4 = React.useState({}), capturedImages = _4[0], setCapturedImages = _4[1];
|
|
235
|
+
var _5 = React.useState("before-recto"), currentPhotoStep = _5[0], setCurrentPhotoStep = _5[1];
|
|
236
|
+
var _6 = React.useState("photo"), videoFlowPhase = _6[0], setVideoFlowPhase = _6[1];
|
|
237
|
+
var _7 = DocumentContext.useDocumentContext(), selectedDocumentType = _7.selectedDocumentType, setSelectedDocumentType = _7.setSelectedDocumentType;
|
|
238
238
|
var finalAcceptedCountries = React.useMemo(function () {
|
|
239
239
|
if (loadingTemplates)
|
|
240
240
|
return acceptedCountries;
|
|
@@ -778,7 +778,7 @@ var DocumentCheck = function (_a) {
|
|
|
778
778
|
return (jsxRuntime.jsx(BeforePhoto.default, { setStep: function () { return setCurrentPhotoStep("recto"); }, isSingleSided: isSingleSided, onBack: function () { return setDocStep(2); } }));
|
|
779
779
|
}
|
|
780
780
|
else {
|
|
781
|
-
return (jsxRuntime.jsx(JDIDocumentUpload.default, { documentType: (selectedDocumentType === null || selectedDocumentType === void 0 ? void 0 : selectedDocumentType.id) || documentTypeId, documentTypeId: documentTypeId, documentLabel: selectedDocumentType === null || selectedDocumentType === void 0 ? void 0 : selectedDocumentType.label, onUpload: handleDocumentUpload, onBack: function () {
|
|
781
|
+
return (jsxRuntime.jsx(JDIDocumentUpload.default, { title: (_p = node.documentUpload) === null || _p === void 0 ? void 0 : _p.title, description: (_q = node.documentUpload) === null || _q === void 0 ? void 0 : _q.description, documentType: (selectedDocumentType === null || selectedDocumentType === void 0 ? void 0 : selectedDocumentType.id) || documentTypeId, documentTypeId: documentTypeId, documentLabel: selectedDocumentType === null || selectedDocumentType === void 0 ? void 0 : selectedDocumentType.label, onUpload: handleDocumentUpload, onBack: function () {
|
|
782
782
|
if (isPictureAllowed && isDownloadAllowed) {
|
|
783
783
|
setSelectedMethod(null);
|
|
784
784
|
}
|
package/dist/cjs/i18n/en.json.js
CHANGED
|
@@ -502,6 +502,7 @@ var jdi = {
|
|
|
502
502
|
error_select_document: "Please select a document type",
|
|
503
503
|
info_title: "Important information",
|
|
504
504
|
instructions: {
|
|
505
|
+
two_sided_files: "• Ensure both sides of the document (front and back) are included, either in a single file or in two separate files.",
|
|
505
506
|
jdd: {
|
|
506
507
|
recent: "• The document must be recent (less than 3 months old).",
|
|
507
508
|
name_address_visible: "• Your name and address must be clearly visible.",
|
package/dist/cjs/i18n/es.json.js
CHANGED
|
@@ -502,6 +502,7 @@ var jdi = {
|
|
|
502
502
|
error_select_document: "Selecciona un tipo de documento",
|
|
503
503
|
info_title: "Información importante",
|
|
504
504
|
instructions: {
|
|
505
|
+
two_sided_files: "• Asegúrese de que ambas caras del documento (anverso y reverso) estén presentes, en un mismo archivo o en dos archivos distintos.",
|
|
505
506
|
jdd: {
|
|
506
507
|
recent: "• El documento debe ser reciente (menos de 3 meses).",
|
|
507
508
|
name_address_visible: "• Tu nombre y dirección deben verse claramente.",
|
package/dist/cjs/i18n/fr.json.js
CHANGED
|
@@ -502,6 +502,7 @@ var jdi = {
|
|
|
502
502
|
error_select_document: "Veuillez sélectionner un type de document",
|
|
503
503
|
info_title: "Information importante",
|
|
504
504
|
instructions: {
|
|
505
|
+
two_sided_files: "• Assurez-vous que les deux faces du document (recto et verso) sont présentes, dans un même fichier ou dans deux fichiers distincts.",
|
|
505
506
|
jdd: {
|
|
506
507
|
recent: "• Le document doit être récent (moins de 3 mois).",
|
|
507
508
|
name_address_visible: "• Votre nom et adresse doivent être clairement visibles.",
|
|
@@ -135,6 +135,7 @@ var JDIDocumentSelection = function (_a) {
|
|
|
135
135
|
case "idCard":
|
|
136
136
|
return [
|
|
137
137
|
t("jdi.document_selection.instructions.idCard.recto_verso"),
|
|
138
|
+
t("jdi.document_selection.instructions.two_sided_files"),
|
|
138
139
|
t("jdi.document_selection.instructions.idCard.readable"),
|
|
139
140
|
t("jdi.document_selection.instructions.idCard.valid"),
|
|
140
141
|
];
|
|
@@ -147,6 +148,7 @@ var JDIDocumentSelection = function (_a) {
|
|
|
147
148
|
case "driverLicense":
|
|
148
149
|
return [
|
|
149
150
|
t("jdi.document_selection.instructions.driverLicense.recto_verso"),
|
|
151
|
+
t("jdi.document_selection.instructions.two_sided_files"),
|
|
150
152
|
t("jdi.document_selection.instructions.driverLicense.not_expired"),
|
|
151
153
|
t("jdi.document_selection.instructions.driverLicense.all_visible"),
|
|
152
154
|
];
|
|
@@ -159,6 +161,7 @@ var JDIDocumentSelection = function (_a) {
|
|
|
159
161
|
case "residencePermit":
|
|
160
162
|
return [
|
|
161
163
|
t("jdi.document_selection.instructions.residencePermit.recto_verso"),
|
|
164
|
+
t("jdi.document_selection.instructions.two_sided_files"),
|
|
162
165
|
t("jdi.document_selection.instructions.residencePermit.valid"),
|
|
163
166
|
t("jdi.document_selection.instructions.residencePermit.readable"),
|
|
164
167
|
];
|
|
@@ -11,8 +11,11 @@ import { requiresTwoSides } from '../../utils/documentLabels.js';
|
|
|
11
11
|
import MobilePageLayout from '../ui/MobilePageLayout.js';
|
|
12
12
|
|
|
13
13
|
var JDIDocumentUpload = function (_a) {
|
|
14
|
-
var documentType = _a.documentType, onUpload = _a.onUpload, onBack = _a.onBack, documentTypeId = _a.documentTypeId, documentLabel = _a.documentLabel, _b = _a.initialFront, initialFront = _b === void 0 ? null : _b, _c = _a.initialBack, initialBack = _c === void 0 ? null : _c; _a.sessionId;
|
|
14
|
+
var documentType = _a.documentType, onUpload = _a.onUpload, onBack = _a.onBack, documentTypeId = _a.documentTypeId, documentLabel = _a.documentLabel, _b = _a.initialFront, initialFront = _b === void 0 ? null : _b, _c = _a.initialBack, initialBack = _c === void 0 ? null : _c; _a.sessionId; var title = _a.title, description = _a.description;
|
|
15
15
|
var t = useI18n().t;
|
|
16
|
+
var documentName = t("documentTypes." + documentType);
|
|
17
|
+
var customTitle = title === null || title === void 0 ? void 0 : title.trim().replace(/\{\{\s*document\s*\}\}/g, function () { return documentName; });
|
|
18
|
+
var customDescription = description === null || description === void 0 ? void 0 : description.trim().replace(/\{\{\s*document\s*\}\}/g, function () { return documentName; });
|
|
16
19
|
// Helper functions for conditional text
|
|
17
20
|
var getDropZoneText = function () {
|
|
18
21
|
return t("jdi.document_upload.drop_zone", {
|
|
@@ -458,7 +461,7 @@ var JDIDocumentUpload = function (_a) {
|
|
|
458
461
|
}
|
|
459
462
|
});
|
|
460
463
|
}); };
|
|
461
|
-
return (jsx(MobilePageLayout, { contentClassName: "h-full", footer: jsx(PageActions, { primary: jsx(Button, { onClick: handleUpload, disabled: (!frontFile && !isFrontFromInitial) || isUploading, children: getValidateButtonText() }), secondary: onBack ? (jsx(Button, { variant: "secondary", onClick: onBack, disabled: isUploading, children: t("jdi.document_upload.back") })) : undefined }), children: jsx("div", { className: "flex-1 flex items-start justify-center md:items-center p-4", children: jsxs("div", { className: "w-full max-w-lg", children: [jsxs("div", { className: "text-center mb-8", children: [jsx("h1", { className: "text-2xl md:text-3xl font-bold text-gray-900 mb-2", children: getDropZoneText() }), jsx("p", { className: "text-gray-600", children: getUploadInstruction() })] }), jsx(Card, { ref: dropZoneRef, className: "border-2 border-dashed ".concat(isDragging
|
|
464
|
+
return (jsx(MobilePageLayout, { contentClassName: "h-full", footer: jsx(PageActions, { primary: jsx(Button, { onClick: handleUpload, disabled: (!frontFile && !isFrontFromInitial) || isUploading, children: getValidateButtonText() }), secondary: onBack ? (jsx(Button, { variant: "secondary", onClick: onBack, disabled: isUploading, children: t("jdi.document_upload.back") })) : undefined }), children: jsx("div", { className: "flex-1 flex items-start justify-center md:items-center p-4", children: jsxs("div", { className: "w-full max-w-lg", children: [jsxs("div", { className: "text-center mb-8", children: [jsx("h1", { className: "text-2xl md:text-3xl font-bold text-gray-900 mb-2", children: customTitle || getDropZoneText() }), jsx("p", { className: "text-gray-600 whitespace-pre-line", children: customDescription || getUploadInstruction() })] }), jsx(Card, { ref: dropZoneRef, className: "border-2 border-dashed ".concat(isDragging
|
|
462
465
|
? "border-teal-500 bg-teal-100/50"
|
|
463
466
|
: "border-teal-300 bg-teal-50/30", " p-8 mb-6 transition-colors"), onDragEnter: handleDragEnter, onDragLeave: handleDragLeave, onDragOver: handleDragOver, onDrop: handleDrop, children: jsx("div", { className: "text-center space-y-6", children: !frontPreview ? (jsxs(Fragment, { children: [jsx("h3", { className: "text-lg font-semibold text-gray-900 mb-4", children: t("documentTypes." + documentType) }), jsx("div", { className: "flex justify-center w-full", children: jsx(Button, { onClick: function () { var _a; return (_a = frontInputRef.current) === null || _a === void 0 ? void 0 : _a.click(); }, className: "border border-teal-300 text-teal-600 bg-transparent hover:bg-teal-50 px-4 py-2 rounded-lg font-medium text-sm mx-auto flex items-center", disabled: isUploading, children: jsx("span", { children: t("jdi.document_upload.add_file") }) }) }), jsx("p", { className: "text-sm text-gray-500 italic", children: t("jdi.document_upload.drag_drop_hint", "ou glissez-déposez vos fichiers ici") }), jsxs("div", { className: "text-sm text-gray-600 space-y-1", children: [jsx("p", { children: t("jdi.document_upload.accepted_formats") }), jsx("p", { children: twoSidesRequired
|
|
464
467
|
? frontPreview
|
|
@@ -71,12 +71,12 @@ var normalizeNfcMode = function (mode) {
|
|
|
71
71
|
* - Uses hooks for translation, retry navigation, and context management.
|
|
72
72
|
*/
|
|
73
73
|
var DocumentCheck = function (_a) {
|
|
74
|
-
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
75
|
-
var stepObject = _a.stepObject, sessionId = _a.sessionId, node = _a.node, documentTypeId = _a.documentTypeId, acceptedCountries = _a.acceptedCountries,
|
|
74
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
75
|
+
var stepObject = _a.stepObject, sessionId = _a.sessionId, node = _a.node, documentTypeId = _a.documentTypeId, acceptedCountries = _a.acceptedCountries, _r = _a.isMobileCapture, isMobileCapture = _r === void 0 ? false : _r, allowedAddingMethods = _a.allowedAddingMethods, template = _a.template, setUserInput = _a.setUserInput;
|
|
76
76
|
var t = useI18n().t;
|
|
77
77
|
var session = getSession().session;
|
|
78
|
-
var
|
|
79
|
-
var
|
|
78
|
+
var _s = useState(), documentTemplates = _s[0], setDocumentTemplates = _s[1];
|
|
79
|
+
var _t = useState(true), loadingTemplates = _t[0], setLoadingTemplates = _t[1];
|
|
80
80
|
useEffect(function () {
|
|
81
81
|
(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
82
82
|
var templates;
|
|
@@ -95,7 +95,7 @@ var DocumentCheck = function (_a) {
|
|
|
95
95
|
}); })();
|
|
96
96
|
}, []);
|
|
97
97
|
var initialRetryCount = getNodeRetryCount(session, node.id);
|
|
98
|
-
var
|
|
98
|
+
var _u = useState(null), selectedMethod = _u[0], setSelectedMethod = _u[1];
|
|
99
99
|
var isPictureAllowed = (_b = allowedAddingMethods === null || allowedAddingMethods === void 0 ? void 0 : allowedAddingMethods.includes("picture")) !== null && _b !== void 0 ? _b : true;
|
|
100
100
|
var isDownloadAllowed = (_c = allowedAddingMethods === null || allowedAddingMethods === void 0 ? void 0 : allowedAddingMethods.includes("download")) !== null && _c !== void 0 ? _c : true;
|
|
101
101
|
// Check if retry is allowed based on initial retry count
|
|
@@ -114,25 +114,25 @@ var DocumentCheck = function (_a) {
|
|
|
114
114
|
return true;
|
|
115
115
|
};
|
|
116
116
|
// Initialize docStep - if retries exhausted, start at error page (step 6)
|
|
117
|
-
var
|
|
117
|
+
var _v = useState(function () {
|
|
118
118
|
if (initialRetryCount > 0 && !isInitialRetryAllowed()) {
|
|
119
119
|
return 6; // Error page
|
|
120
120
|
}
|
|
121
121
|
return 0; // Normal flow - start with introduction
|
|
122
|
-
}), docStep =
|
|
123
|
-
var
|
|
124
|
-
var
|
|
125
|
-
var
|
|
126
|
-
var
|
|
127
|
-
var
|
|
128
|
-
var
|
|
122
|
+
}), docStep = _v[0], setDocStep = _v[1];
|
|
123
|
+
var _w = useState(((_e = (_d = acceptedCountries === null || acceptedCountries === void 0 ? void 0 : acceptedCountries[0]) === null || _d === void 0 ? void 0 : _d.code) === null || _e === void 0 ? void 0 : _e.toUpperCase()) || "FR"), selectedCountry = _w[0], setSelectedCountry = _w[1];
|
|
124
|
+
var _x = useState(null), fileUploaded = _x[0], setFileUploaded = _x[1];
|
|
125
|
+
var _y = useState(null), analysisData = _y[0], setAnalysisData = _y[1];
|
|
126
|
+
var _z = useState(null), errorCode = _z[0], setErrorCode = _z[1];
|
|
127
|
+
var _0 = useState(false), blockContinue = _0[0], setBlockContinue = _0[1];
|
|
128
|
+
var _1 = useState(null), nfcPreparationError = _1[0], setNfcPreparationError = _1[1];
|
|
129
129
|
// Quand l'utilisateur déclare ne pas avoir de puce (questionnaire de fallback),
|
|
130
130
|
// on ne doit plus le réorienter vers le scan NFC (ni avant, ni après l'analyse API).
|
|
131
|
-
var
|
|
131
|
+
var _2 = useState(false), nfcSkipped = _2[0], setNfcSkipped = _2[1];
|
|
132
132
|
// Initialize retry count from session data
|
|
133
|
-
var
|
|
133
|
+
var _3 = useState(function () {
|
|
134
134
|
return getNodeRetryCount(session, node.id);
|
|
135
|
-
}), retryCount =
|
|
135
|
+
}), retryCount = _3[0], setRetryCount = _3[1];
|
|
136
136
|
// Update retry count when session loads/changes
|
|
137
137
|
useEffect(function () {
|
|
138
138
|
if (session) {
|
|
@@ -227,10 +227,10 @@ var DocumentCheck = function (_a) {
|
|
|
227
227
|
setDocStep(6);
|
|
228
228
|
}
|
|
229
229
|
}, [retryCount, node.allowResubmission, node.maxResubmissionAttempts]);
|
|
230
|
-
var
|
|
231
|
-
var
|
|
232
|
-
var
|
|
233
|
-
var
|
|
230
|
+
var _4 = useState({}), capturedImages = _4[0], setCapturedImages = _4[1];
|
|
231
|
+
var _5 = useState("before-recto"), currentPhotoStep = _5[0], setCurrentPhotoStep = _5[1];
|
|
232
|
+
var _6 = useState("photo"), videoFlowPhase = _6[0], setVideoFlowPhase = _6[1];
|
|
233
|
+
var _7 = useDocumentContext(), selectedDocumentType = _7.selectedDocumentType, setSelectedDocumentType = _7.setSelectedDocumentType;
|
|
234
234
|
var finalAcceptedCountries = useMemo(function () {
|
|
235
235
|
if (loadingTemplates)
|
|
236
236
|
return acceptedCountries;
|
|
@@ -774,7 +774,7 @@ var DocumentCheck = function (_a) {
|
|
|
774
774
|
return (jsx(BeforePhoto, { setStep: function () { return setCurrentPhotoStep("recto"); }, isSingleSided: isSingleSided, onBack: function () { return setDocStep(2); } }));
|
|
775
775
|
}
|
|
776
776
|
else {
|
|
777
|
-
return (jsx(JDIDocumentUpload, { documentType: (selectedDocumentType === null || selectedDocumentType === void 0 ? void 0 : selectedDocumentType.id) || documentTypeId, documentTypeId: documentTypeId, documentLabel: selectedDocumentType === null || selectedDocumentType === void 0 ? void 0 : selectedDocumentType.label, onUpload: handleDocumentUpload, onBack: function () {
|
|
777
|
+
return (jsx(JDIDocumentUpload, { title: (_p = node.documentUpload) === null || _p === void 0 ? void 0 : _p.title, description: (_q = node.documentUpload) === null || _q === void 0 ? void 0 : _q.description, documentType: (selectedDocumentType === null || selectedDocumentType === void 0 ? void 0 : selectedDocumentType.id) || documentTypeId, documentTypeId: documentTypeId, documentLabel: selectedDocumentType === null || selectedDocumentType === void 0 ? void 0 : selectedDocumentType.label, onUpload: handleDocumentUpload, onBack: function () {
|
|
778
778
|
if (isPictureAllowed && isDownloadAllowed) {
|
|
779
779
|
setSelectedMethod(null);
|
|
780
780
|
}
|
package/dist/esm/i18n/en.json.js
CHANGED
|
@@ -498,6 +498,7 @@ var jdi = {
|
|
|
498
498
|
error_select_document: "Please select a document type",
|
|
499
499
|
info_title: "Important information",
|
|
500
500
|
instructions: {
|
|
501
|
+
two_sided_files: "• Ensure both sides of the document (front and back) are included, either in a single file or in two separate files.",
|
|
501
502
|
jdd: {
|
|
502
503
|
recent: "• The document must be recent (less than 3 months old).",
|
|
503
504
|
name_address_visible: "• Your name and address must be clearly visible.",
|
package/dist/esm/i18n/es.json.js
CHANGED
|
@@ -498,6 +498,7 @@ var jdi = {
|
|
|
498
498
|
error_select_document: "Selecciona un tipo de documento",
|
|
499
499
|
info_title: "Información importante",
|
|
500
500
|
instructions: {
|
|
501
|
+
two_sided_files: "• Asegúrese de que ambas caras del documento (anverso y reverso) estén presentes, en un mismo archivo o en dos archivos distintos.",
|
|
501
502
|
jdd: {
|
|
502
503
|
recent: "• El documento debe ser reciente (menos de 3 meses).",
|
|
503
504
|
name_address_visible: "• Tu nombre y dirección deben verse claramente.",
|
package/dist/esm/i18n/fr.json.js
CHANGED
|
@@ -498,6 +498,7 @@ var jdi = {
|
|
|
498
498
|
error_select_document: "Veuillez sélectionner un type de document",
|
|
499
499
|
info_title: "Information importante",
|
|
500
500
|
instructions: {
|
|
501
|
+
two_sided_files: "• Assurez-vous que les deux faces du document (recto et verso) sont présentes, dans un même fichier ou dans deux fichiers distincts.",
|
|
501
502
|
jdd: {
|
|
502
503
|
recent: "• Le document doit être récent (moins de 3 mois).",
|
|
503
504
|
name_address_visible: "• Votre nom et adresse doivent être clairement visibles.",
|