datakeen-session-react 1.1.202-dev.16 → 1.1.202-dev.17
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/document-collection/DocumentCollection.js +9 -0
- package/dist/cjs/components/selfie/Video.js +2 -2
- package/dist/cjs/components/selfie/selfie-flow/SelfieFlow.js +4 -2
- package/dist/cjs/components/session/DocumentCheck.js +18 -0
- package/dist/cjs/components/session/EndFlow.js +4 -0
- package/dist/cjs/components/session/Selfie.js +1 -1
- package/dist/cjs/components/signature-electronic/SignatureElectronic.js +9 -2
- package/dist/cjs/components/template/TemplateNodeRenderer.js +3 -1
- package/dist/cjs/components/ui/Button.js +3 -3
- package/dist/cjs/hooks/useClientInfo.js +7 -0
- package/dist/cjs/hooks/useUserInputForm.js +3 -1
- package/dist/cjs/i18n/en.json.js +28 -1
- package/dist/cjs/i18n/es.json.js +28 -1
- package/dist/cjs/i18n/fr.json.js +28 -1
- package/dist/cjs/index.css.js +1 -1
- package/dist/cjs/index.js +2 -0
- package/dist/cjs/preview/DatakeenJourneyPreview.js +257 -0
- package/dist/cjs/preview/PreviewAutomaticStep.js +23 -0
- package/dist/cjs/preview/PreviewBranchPicker.js +54 -0
- package/dist/cjs/preview/PreviewCaptureDisabled.js +19 -0
- package/dist/cjs/preview/previewAdapter.js +27 -0
- package/dist/cjs/preview/previewMode.js +21 -0
- package/dist/cjs/preview/previewNavigation.js +105 -0
- package/dist/cjs/services/api.js +5 -0
- package/dist/cjs/services/cameraService.js +6 -0
- package/dist/cjs/services/realtime/sseClient.js +4 -0
- package/dist/cjs/services/sessionService.js +7 -0
- package/dist/cjs/utils/cssLoader.js +6 -4
- package/dist/cjs/utils/isMobileDevice.js +8 -0
- package/dist/esm/components/document-collection/DocumentCollection.js +10 -1
- package/dist/esm/components/selfie/Video.js +2 -2
- package/dist/esm/components/selfie/selfie-flow/SelfieFlow.js +4 -2
- package/dist/esm/components/session/DocumentCheck.js +18 -0
- package/dist/esm/components/session/EndFlow.js +4 -0
- package/dist/esm/components/session/Selfie.js +1 -1
- package/dist/esm/components/signature-electronic/SignatureElectronic.js +9 -2
- package/dist/esm/components/template/TemplateNodeRenderer.js +3 -1
- package/dist/esm/components/ui/Button.js +3 -3
- package/dist/esm/hooks/useClientInfo.js +7 -0
- package/dist/esm/hooks/useUserInputForm.js +3 -1
- package/dist/esm/i18n/en.json.js +28 -2
- package/dist/esm/i18n/es.json.js +28 -2
- package/dist/esm/i18n/fr.json.js +28 -2
- package/dist/esm/index.css.js +1 -1
- package/dist/esm/index.js +1 -0
- package/dist/esm/preview/DatakeenJourneyPreview.js +253 -0
- package/dist/esm/preview/PreviewAutomaticStep.js +19 -0
- package/dist/esm/preview/PreviewBranchPicker.js +48 -0
- package/dist/esm/preview/PreviewCaptureDisabled.js +15 -0
- package/dist/esm/preview/previewAdapter.js +25 -0
- package/dist/esm/preview/previewMode.js +15 -0
- package/dist/esm/preview/previewNavigation.js +98 -0
- package/dist/esm/services/api.js +5 -0
- package/dist/esm/services/cameraService.js +6 -0
- package/dist/esm/services/realtime/sseClient.js +4 -0
- package/dist/esm/services/sessionService.js +7 -0
- package/dist/esm/utils/cssLoader.js +6 -4
- package/dist/esm/utils/isMobileDevice.js +8 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/preview/DatakeenJourneyPreview.d.ts +6 -0
- package/dist/types/preview/types.d.ts +77 -0
- package/dist/types/services/documentTemplate.d.ts +13 -0
- package/dist/types/types/session.d.ts +254 -1
- package/dist/types/utils/cssLoader.d.ts +0 -4
- package/package.json +1 -1
|
@@ -22,6 +22,8 @@ var ButtonDesktop = require('../ui/ButtonDesktop.js');
|
|
|
22
22
|
var analysis = require('../../services/analysis.js');
|
|
23
23
|
var retryService = require('../../services/retryService.js');
|
|
24
24
|
var SessionContext = require('../../context/SessionContext.js');
|
|
25
|
+
var previewMode = require('../../preview/previewMode.js');
|
|
26
|
+
var PreviewCaptureDisabled = require('../../preview/PreviewCaptureDisabled.js');
|
|
25
27
|
var imageProcessing = require('../../utils/imageProcessing.js');
|
|
26
28
|
|
|
27
29
|
/**
|
|
@@ -290,6 +292,13 @@ var DocumentCollection = function (_a) {
|
|
|
290
292
|
setCurrentStep(currentStep - 1);
|
|
291
293
|
}
|
|
292
294
|
};
|
|
295
|
+
// APP3-2057 — aperçu du builder : ni caméra, ni upload, ni analyse. Les écrans d'introduction,
|
|
296
|
+
// de sélection et de choix de méthode restent les vrais ; la capture est remplacée.
|
|
297
|
+
if (previewMode.isPreviewMode() &&
|
|
298
|
+
(currentStep === 4 ||
|
|
299
|
+
(currentStep === 3 && (selectedMethod === "download" || photoSubStep !== "before-recto")))) {
|
|
300
|
+
return jsxRuntime.jsx(PreviewCaptureDisabled.default, { onContinue: handleSuccessContinue });
|
|
301
|
+
}
|
|
293
302
|
switch (currentStep) {
|
|
294
303
|
case 0:
|
|
295
304
|
return (jsxRuntime.jsx(DocumentCollectionIntroduction.default, { onContinue: handleContinueFromIntroduction, onBack: stepObject.canGoBack ? handleBack : undefined, introductionPage: introductionPage }));
|
|
@@ -10,7 +10,7 @@ var SelfieFlow = require('./selfie-flow/SelfieFlow.js');
|
|
|
10
10
|
var VideoResetStyles = require('./VideoResetStyles.js');
|
|
11
11
|
|
|
12
12
|
var Video = function (_a) {
|
|
13
|
-
var setSelfieData = _a.setSelfieData, setStep = _a.setStep, sessionId = _a.sessionId, iad = _a.iad, btnBg = _a.btnBg, btnText = _a.btnText;
|
|
13
|
+
var setSelfieData = _a.setSelfieData, setStep = _a.setStep, sessionId = _a.sessionId, iad = _a.iad, btnBg = _a.btnBg, btnText = _a.btnText, onPreviewContinue = _a.onPreviewContinue;
|
|
14
14
|
// Effet pour ajouter la classe au body lorsque le composant est monté
|
|
15
15
|
React.useEffect(function () {
|
|
16
16
|
// Empêcher le scroll sur le body lorsque la capture est active
|
|
@@ -32,7 +32,7 @@ var Video = function (_a) {
|
|
|
32
32
|
setStep(1); // Move to the next step after selfie capture
|
|
33
33
|
}, 300);
|
|
34
34
|
};
|
|
35
|
-
return (jsxRuntime.jsxs("div", { className: "w-full h-full overflow-hidden flex flex-col", children: [jsxRuntime.jsx(VideoResetStyles.default, {}), jsxRuntime.jsx(SelfieFlow.default, { handleSelfie: handleSelfie, sessionId: sessionId, iad: iad, btnBg: btnBg, btnText: btnText })] }));
|
|
35
|
+
return (jsxRuntime.jsxs("div", { className: "w-full h-full overflow-hidden flex flex-col", children: [jsxRuntime.jsx(VideoResetStyles.default, {}), jsxRuntime.jsx(SelfieFlow.default, { handleSelfie: handleSelfie, sessionId: sessionId, iad: iad, btnBg: btnBg, btnText: btnText, onPreviewContinue: onPreviewContinue })] }));
|
|
36
36
|
};
|
|
37
37
|
|
|
38
38
|
exports.default = Video;
|
|
@@ -7,16 +7,18 @@ var React = require('react');
|
|
|
7
7
|
var SelfiePreIntroduction = require('./SelfiePreIntroduction.js');
|
|
8
8
|
var InstructionsSelfie = require('./InstructionsSelfie.js');
|
|
9
9
|
var LoadingState = require('../../states/LoadingState.js');
|
|
10
|
+
var previewMode = require('../../../preview/previewMode.js');
|
|
11
|
+
var PreviewCaptureDisabled = require('../../../preview/PreviewCaptureDisabled.js');
|
|
10
12
|
|
|
11
13
|
var SelfieRecorder = React.lazy(function () { return Promise.resolve().then(function () { return require('./SelfieRecorder.js'); }); });
|
|
12
14
|
var SelfieFlow = function (_a) {
|
|
13
15
|
var _b;
|
|
14
|
-
var handleSelfie = _a.handleSelfie, sessionId = _a.sessionId, iad = _a.iad, btnBg = _a.btnBg, btnText = _a.btnText;
|
|
16
|
+
var handleSelfie = _a.handleSelfie, sessionId = _a.sessionId, iad = _a.iad, btnBg = _a.btnBg, btnText = _a.btnText, onPreviewContinue = _a.onPreviewContinue;
|
|
15
17
|
var _c = React.useState(-1), internalStep = _c[0], setInternalStep = _c[1]; // Commencer à -1 pour la pré-introduction
|
|
16
18
|
return (jsxRuntime.jsxs("div", { className: "h-full w-full flex flex-col", style: (_b = {},
|
|
17
19
|
_b["--dk-btn-bg"] = btnBg !== null && btnBg !== void 0 ? btnBg : "#11E5C5",
|
|
18
20
|
_b["--dk-btn-text"] = btnText !== null && btnText !== void 0 ? btnText : "#3C3C40",
|
|
19
|
-
_b), children: [internalStep === -1 && (jsxRuntime.jsx("div", { className: "flex-1 flex flex-col h-full", children: jsxRuntime.jsx(SelfiePreIntroduction.default, { onContinue: function () { return setInternalStep(0); } }) })), internalStep === 0 && (jsxRuntime.jsx("div", { className: "flex-1 flex flex-col h-full", children: jsxRuntime.jsx(InstructionsSelfie.default, { setStep: setInternalStep, onBack: function () { return setInternalStep(-1); } }) })), internalStep === 1 && (jsxRuntime.jsx("div", { className: "flex-1 flex flex-col h-full overflow-hidden", children: jsxRuntime.jsx(React.Suspense, { fallback: jsxRuntime.jsx(LoadingState.default, {}), children: jsxRuntime.jsx(SelfieRecorder, { handleSelfie: handleSelfie, sessionId: sessionId, iad: iad, btnBg: btnBg, btnText: btnText }) }) }))] }));
|
|
21
|
+
_b), children: [internalStep === -1 && (jsxRuntime.jsx("div", { className: "flex-1 flex flex-col h-full", children: jsxRuntime.jsx(SelfiePreIntroduction.default, { onContinue: function () { return setInternalStep(0); } }) })), internalStep === 0 && (jsxRuntime.jsx("div", { className: "flex-1 flex flex-col h-full", children: jsxRuntime.jsx(InstructionsSelfie.default, { setStep: setInternalStep, onBack: function () { return setInternalStep(-1); } }) })), internalStep === 1 && previewMode.isPreviewMode() && (jsxRuntime.jsx("div", { className: "flex-1 flex flex-col h-full", children: jsxRuntime.jsx(PreviewCaptureDisabled.default, { onContinue: onPreviewContinue }) })), internalStep === 1 && !previewMode.isPreviewMode() && (jsxRuntime.jsx("div", { className: "flex-1 flex flex-col h-full overflow-hidden", children: jsxRuntime.jsx(React.Suspense, { fallback: jsxRuntime.jsx(LoadingState.default, {}), children: jsxRuntime.jsx(SelfieRecorder, { handleSelfie: handleSelfie, sessionId: sessionId, iad: iad, btnBg: btnBg, btnText: btnText }) }) }))] }));
|
|
20
22
|
};
|
|
21
23
|
|
|
22
24
|
exports.default = SelfieFlow;
|
|
@@ -35,6 +35,8 @@ var sessionService = require('../../services/sessionService.js');
|
|
|
35
35
|
var NfcScanNode = require('../nfc-scan/NfcScanNode.js');
|
|
36
36
|
var NfcChipGate = require('../nfc-scan/NfcChipGate.js');
|
|
37
37
|
var NfcFallbackSurvey = require('../nfc-scan/NfcFallbackSurvey.js');
|
|
38
|
+
var previewMode = require('../../preview/previewMode.js');
|
|
39
|
+
var PreviewCaptureDisabled = require('../../preview/PreviewCaptureDisabled.js');
|
|
38
40
|
var controleJdiPolicy = require('./controleJdiPolicy.js');
|
|
39
41
|
var europeanCountries = require('../../utils/europeanCountries.js');
|
|
40
42
|
|
|
@@ -720,6 +722,17 @@ var DocumentCheck = function (_a) {
|
|
|
720
722
|
setDocStep(function (prev) { return prev - 1; });
|
|
721
723
|
}
|
|
722
724
|
};
|
|
725
|
+
// APP3-2057 — aperçu du builder : ni caméra, ni upload, ni analyse, ni scan NFC. Les écrans
|
|
726
|
+
// d'introduction et de sélection restent les vrais ; la capture est remplacée par un écran neutre.
|
|
727
|
+
var renderPreviewCaptureDisabled = function () {
|
|
728
|
+
var previewTemplate = template;
|
|
729
|
+
return (jsxRuntime.jsx(PreviewCaptureDisabled.default, { onContinue: previewTemplate
|
|
730
|
+
? function () { return stepObject.goToNextStep(node.id, previewTemplate); }
|
|
731
|
+
: undefined }));
|
|
732
|
+
};
|
|
733
|
+
if (previewMode.isPreviewMode() && (docStep === 4 || docStep === 7)) {
|
|
734
|
+
return renderPreviewCaptureDisabled();
|
|
735
|
+
}
|
|
723
736
|
switch (docStep) {
|
|
724
737
|
case -1: {
|
|
725
738
|
var hasIntroduction_1 = ((_f = node.introductionPage) === null || _f === void 0 ? void 0 : _f.title) !== undefined ||
|
|
@@ -762,6 +775,9 @@ var DocumentCheck = function (_a) {
|
|
|
762
775
|
var activeMethod = selectedMethod ||
|
|
763
776
|
(isPictureAllowed && isMobileCapture ? "picture" : "download");
|
|
764
777
|
if (activeMethod === "picture" && isPictureAllowed) {
|
|
778
|
+
if (previewMode.isPreviewMode() && currentPhotoStep !== "before-recto") {
|
|
779
|
+
return renderPreviewCaptureDisabled();
|
|
780
|
+
}
|
|
765
781
|
var isSingleSided = (selectedDocumentType === null || selectedDocumentType === void 0 ? void 0 : selectedDocumentType.id) === "passport" ||
|
|
766
782
|
(selectedDocumentType === null || selectedDocumentType === void 0 ? void 0 : selectedDocumentType.id) === "pinkDriverLicense";
|
|
767
783
|
var onConfirm = node.withVideo
|
|
@@ -794,6 +810,8 @@ var DocumentCheck = function (_a) {
|
|
|
794
810
|
return (jsxRuntime.jsx(BeforePhoto.default, { setStep: function () { return setCurrentPhotoStep("recto"); }, isSingleSided: isSingleSided, onBack: function () { return setDocStep(2); } }));
|
|
795
811
|
}
|
|
796
812
|
else {
|
|
813
|
+
if (previewMode.isPreviewMode())
|
|
814
|
+
return renderPreviewCaptureDisabled();
|
|
797
815
|
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 () {
|
|
798
816
|
if (isPictureAllowed && isDownloadAllowed) {
|
|
799
817
|
setSelectedMethod(null);
|
|
@@ -19,6 +19,7 @@ var useI18n = require('../../hooks/useI18n.js');
|
|
|
19
19
|
var useIsMobile = require('../../hooks/useIsMobile.js');
|
|
20
20
|
var endScreenIcons = require('./endScreenIcons.js');
|
|
21
21
|
var navigation = require('../../utils/navigation.js');
|
|
22
|
+
var previewMode = require('../../preview/previewMode.js');
|
|
22
23
|
|
|
23
24
|
// Couleur des icônes = couleur du bouton choisie pour le journey (buttonBgColor).
|
|
24
25
|
var ICON_COLOR = "var(--dk-btn-bg, #11e5c5)";
|
|
@@ -105,6 +106,9 @@ var EndFlow = function (_a) {
|
|
|
105
106
|
}, []);
|
|
106
107
|
var handleEndSession = function () { return tslib_es6.__awaiter(void 0, void 0, void 0, function () {
|
|
107
108
|
return tslib_es6.__generator(this, function (_a) {
|
|
109
|
+
// APP3-2057 — aperçu du builder : ni fermeture, ni redirection, ni postMessage, ni nettoyage.
|
|
110
|
+
if (previewMode.isPreviewMode())
|
|
111
|
+
return [2 /*return*/];
|
|
108
112
|
setIsEnding(true);
|
|
109
113
|
try {
|
|
110
114
|
sessionService.clearSessionSensitiveData(sessionId);
|
|
@@ -49,7 +49,7 @@ var Selfie = function (_a) {
|
|
|
49
49
|
var handleRetakeSelfie = function () {
|
|
50
50
|
setInternalStep(0);
|
|
51
51
|
};
|
|
52
|
-
return (jsxRuntime.jsxs("div", { className: "h-full w-full transition-opacity duration-500 ".concat(isTransitioning ? "opacity-50" : "opacity-100"), children: [internalStep === 0 && (jsxRuntime.jsx(Video.default, { setSelfieData: setSelfieData, setStep: setInternalStep, sessionId: sessionId, iad: node.iad, btnBg: (_b = template.buttonBgColor) !== null && _b !== void 0 ? _b : "#11E5C5", btnText: (_c = template.buttonTextColor) !== null && _c !== void 0 ? _c : "#3C3C40" })), internalStep === 1 && selfieData && (jsxRuntime.jsx(SelfieConfirmation.default, { selfieData: selfieData, onConfirm: handleConfirmSelfie, onRetake: handleRetakeSelfie, setSelfiePhoto: setSelfiePhoto })), internalStep === 2 && selfieData && (jsxRuntime.jsx(SelfieProcessing.default, { onProcessingComplete: selfieProcessed, selfieVideo: selfieData, selfiePhoto: selfiePhoto, onRetake: onRetake, nodeId: node.id, onContinueAnyway: node.allowContinueOnFailure === false
|
|
52
|
+
return (jsxRuntime.jsxs("div", { className: "h-full w-full transition-opacity duration-500 ".concat(isTransitioning ? "opacity-50" : "opacity-100"), children: [internalStep === 0 && (jsxRuntime.jsx(Video.default, { setSelfieData: setSelfieData, setStep: setInternalStep, sessionId: sessionId, iad: node.iad, btnBg: (_b = template.buttonBgColor) !== null && _b !== void 0 ? _b : "#11E5C5", btnText: (_c = template.buttonTextColor) !== null && _c !== void 0 ? _c : "#3C3C40", onPreviewContinue: function () { return stepObject.goToNextStep(node.id, template); } })), internalStep === 1 && selfieData && (jsxRuntime.jsx(SelfieConfirmation.default, { selfieData: selfieData, onConfirm: handleConfirmSelfie, onRetake: handleRetakeSelfie, setSelfiePhoto: setSelfiePhoto })), internalStep === 2 && selfieData && (jsxRuntime.jsx(SelfieProcessing.default, { onProcessingComplete: selfieProcessed, selfieVideo: selfieData, selfiePhoto: selfiePhoto, onRetake: onRetake, nodeId: node.id, onContinueAnyway: node.allowContinueOnFailure === false
|
|
53
53
|
? undefined
|
|
54
54
|
: handleContinueAnyway }))] }));
|
|
55
55
|
};
|
|
@@ -9,6 +9,8 @@ var index = require('../../i18n/index.js');
|
|
|
9
9
|
var SignatureElectronicIntroduction = require('./SignatureElectronicIntroduction.js');
|
|
10
10
|
var DocusealSignature = require('./DocusealSignature.js');
|
|
11
11
|
var SignedDocumentPreview = require('./SignedDocumentPreview.js');
|
|
12
|
+
var previewMode = require('../../preview/previewMode.js');
|
|
13
|
+
var PreviewCaptureDisabled = require('../../preview/PreviewCaptureDisabled.js');
|
|
12
14
|
|
|
13
15
|
/**
|
|
14
16
|
* Maps an InformationFieldKey (journey field) to the corresponding UserInput key.
|
|
@@ -32,14 +34,15 @@ var SignatureElectronic = function (_a) {
|
|
|
32
34
|
var t = reactI18next.useTranslation("translation", { i18n: index.default }).t;
|
|
33
35
|
var signatureViewStorageKey = React.useMemo(function () { return "dk-signature-open:".concat(sessionId, ":").concat(external_id !== null && external_id !== void 0 ? external_id : "no-template"); }, [sessionId, external_id]);
|
|
34
36
|
var _c = React.useState(function () {
|
|
35
|
-
if (typeof window === "undefined")
|
|
37
|
+
if (typeof window === "undefined" || previewMode.isPreviewMode())
|
|
36
38
|
return false;
|
|
37
39
|
return window.sessionStorage.getItem(signatureViewStorageKey) === "1";
|
|
38
40
|
}), showSignature = _c[0], setShowSignature = _c[1];
|
|
39
41
|
var _d = React.useState(false), showSignedDocumentPreview = _d[0], setShowSignedDocumentPreview = _d[1];
|
|
40
42
|
var _e = React.useState(null), signedAt = _e[0], setSignedAt = _e[1];
|
|
41
43
|
React.useEffect(function () {
|
|
42
|
-
|
|
44
|
+
// APP3-2057 — aperçu du builder : rien n'est écrit dans le stockage du navigateur.
|
|
45
|
+
if (typeof window === "undefined" || previewMode.isPreviewMode())
|
|
43
46
|
return;
|
|
44
47
|
if (showSignature) {
|
|
45
48
|
window.sessionStorage.setItem(signatureViewStorageKey, "1");
|
|
@@ -119,6 +122,10 @@ var SignatureElectronic = function (_a) {
|
|
|
119
122
|
if (showSignedDocumentPreview) {
|
|
120
123
|
return (jsxRuntime.jsx(SignedDocumentPreview.default, { sessionId: sessionId, nodeId: node.id, nodeTitle: node.pageTitle || node.title, completedAt: signedAt, logo: (_b = session === null || session === void 0 ? void 0 : session.template) === null || _b === void 0 ? void 0 : _b.logo, title: node.signedScreenTitle, description: node.signedScreenDescription, downloadHint: node.signedScreenDownloadHint, onContinue: handleContinueFromPreview }));
|
|
121
124
|
}
|
|
125
|
+
// APP3-2057 — aperçu du builder : pas de signature Docuseal (ni jeton, ni iframe tierce).
|
|
126
|
+
if (showSignature && previewMode.isPreviewMode()) {
|
|
127
|
+
return jsxRuntime.jsx(PreviewCaptureDisabled.default, { onContinue: handleContinueFromPreview });
|
|
128
|
+
}
|
|
122
129
|
if (showSignature && external_id) {
|
|
123
130
|
return (jsxRuntime.jsx(DocusealSignature.default, { sessionId: sessionId, templateId: external_id, templateName: title, onComplete: handleComplete, onBack: handleBack, prefillValues: prefillValues, readonlyFieldNames: readonlyFieldNames }));
|
|
124
131
|
}
|
|
@@ -22,6 +22,7 @@ var SignatureElectronic = require('../signature-electronic/SignatureElectronic.j
|
|
|
22
22
|
var ExternalVerificationNodeHandler = require('./ExternalVerificationNodeHandler.js');
|
|
23
23
|
var PdfGeneration = require('../session/PdfGeneration.js');
|
|
24
24
|
var LegalConsentNode = require('../legal-consent/LegalConsentNode.js');
|
|
25
|
+
var isMobileDevice = require('../../utils/isMobileDevice.js');
|
|
25
26
|
|
|
26
27
|
var TemplateNodeRenderer = function (_a) {
|
|
27
28
|
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
@@ -109,7 +110,8 @@ var TemplateNodeRenderer = function (_a) {
|
|
|
109
110
|
return (jsxRuntime.jsxs("div", { className: "flex flex-col items-center justify-center h-full p-4 text-center", children: [jsxRuntime.jsx("div", { className: "text-red-500 text-4xl mb-4", children: "\u26A0\uFE0F" }), jsxRuntime.jsx("h2", { className: "text-xl font-bold text-red-600 mb-2", children: "Erreur de configuration" }), jsxRuntime.jsx("p", { className: "text-gray-600 mb-4", children: "Le type de document requis n'est pas sp\u00E9cifi\u00E9 dans le template." }), jsxRuntime.jsx("button", { className: "px-4 py-2 bg-primary text-white rounded hover:bg-primary-dark transition-colors", onClick: function () { return stepObject.setStep(0); }, children: "Recommencer" })] }));
|
|
110
111
|
}
|
|
111
112
|
// Determine if current device is mobile for capture method
|
|
112
|
-
|
|
113
|
+
// (même détection par user-agent ; suit l'appareil simulé en aperçu, APP3-2057).
|
|
114
|
+
var isMobile = isMobileDevice.isMobileDevice();
|
|
113
115
|
return (jsxRuntime.jsx(DocumentCheck.default, { stepObject: stepObject, node: node, sessionId: sessionId, documentTypeId: node.requiredDocumentType, acceptedCountries: node.acceptedCountries, onContinueOnPC: onContinueOnPC, isMobileCapture: isMobileTemplate && isMobile, allowedAddingMethods: node.allowedAddingMethods || ["download", "picture"], template: session.template, templateIndex: templateIndex, setUserInput: setUserInput }, "doc-check-".concat(templateIndex)));
|
|
114
116
|
// }
|
|
115
117
|
}
|
|
@@ -8,7 +8,7 @@ var useIsMobile = require('../../hooks/useIsMobile.js');
|
|
|
8
8
|
|
|
9
9
|
var Button = function (_a) {
|
|
10
10
|
var _b, _c;
|
|
11
|
-
var _d = _a.variant, variant = _d === void 0 ? "primary" : _d, children = _a.children, _e = _a.className, className = _e === void 0 ? "" : _e, style = _a.style, onClick = _a.onClick, _f = _a.disabled, disabled = _f === void 0 ? false : _f, _g = _a.type, type = _g === void 0 ? "button" : _g;
|
|
11
|
+
var _d = _a.variant, variant = _d === void 0 ? "primary" : _d, children = _a.children, _e = _a.className, className = _e === void 0 ? "" : _e, style = _a.style, onClick = _a.onClick, _f = _a.disabled, disabled = _f === void 0 ? false : _f, _g = _a.type, type = _g === void 0 ? "button" : _g, testId = _a.testId;
|
|
12
12
|
var isMobile = useIsMobile.default(768);
|
|
13
13
|
var baseShared = "flex items-center justify-center gap-2 shrink-0 font-poppins text-sm font-medium leading-[110%] transition-filter";
|
|
14
14
|
var base = isMobile
|
|
@@ -17,13 +17,13 @@ var Button = function (_a) {
|
|
|
17
17
|
if (variant === "secondary") {
|
|
18
18
|
return (jsxRuntime.jsx("button", { type: type, className: "".concat(base, " bg-transparent border border-gray-300 text-gray-600 ").concat(disabled
|
|
19
19
|
? "opacity-60 cursor-not-allowed"
|
|
20
|
-
: "hover:bg-black/5 cursor-pointer", " ").concat(className), onClick: onClick, disabled: disabled, children: children }));
|
|
20
|
+
: "hover:bg-black/5 cursor-pointer", " ").concat(className), onClick: onClick, disabled: disabled, "data-testid": testId, children: children }));
|
|
21
21
|
}
|
|
22
22
|
return (jsxRuntime.jsx("button", { type: type, className: "".concat(base, " ").concat(disabled
|
|
23
23
|
? "bg-gray-200 text-gray-400 cursor-not-allowed opacity-60"
|
|
24
24
|
: "hover:brightness-110 active:brightness-90 cursor-pointer", " ").concat(className), style: disabled
|
|
25
25
|
? style
|
|
26
|
-
: tslib_es6.__assign(tslib_es6.__assign({}, style), { backgroundColor: (_b = style === null || style === void 0 ? void 0 : style.backgroundColor) !== null && _b !== void 0 ? _b : "var(--dk-btn-bg)", color: (_c = style === null || style === void 0 ? void 0 : style.color) !== null && _c !== void 0 ? _c : "var(--dk-btn-text)" }), onClick: onClick, disabled: disabled, children: children }));
|
|
26
|
+
: tslib_es6.__assign(tslib_es6.__assign({}, style), { backgroundColor: (_b = style === null || style === void 0 ? void 0 : style.backgroundColor) !== null && _b !== void 0 ? _b : "var(--dk-btn-bg)", color: (_c = style === null || style === void 0 ? void 0 : style.color) !== null && _c !== void 0 ? _c : "var(--dk-btn-text)" }), onClick: onClick, disabled: disabled, "data-testid": testId, children: children }));
|
|
27
27
|
};
|
|
28
28
|
|
|
29
29
|
exports.default = Button;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var React = require('react');
|
|
4
4
|
var uaParserJs = require('ua-parser-js');
|
|
5
|
+
var previewMode = require('../preview/previewMode.js');
|
|
5
6
|
|
|
6
7
|
var getClientInfoFromUA = function () {
|
|
7
8
|
var uaResult = new uaParserJs.UAParser().getResult();
|
|
@@ -20,6 +21,12 @@ var useClientInfo = function () {
|
|
|
20
21
|
var _b = React.useState(false), isLoaded = _b[0], setIsLoaded = _b[1];
|
|
21
22
|
React.useEffect(function () {
|
|
22
23
|
var _a = getClientInfoFromUA(), device = _a.device, browser = _a.browser, os = _a.os;
|
|
24
|
+
// APP3-2057 — aperçu du builder : pas de géolocalisation IP (aucun appel tiers).
|
|
25
|
+
if (previewMode.isPreviewMode()) {
|
|
26
|
+
setInfo({ device: device, browser: browser, os: os, ip: "unknown_ip", location: "unknown_location" });
|
|
27
|
+
setIsLoaded(true);
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
23
30
|
fetch("https://ipapi.co/json/")
|
|
24
31
|
.then(function (response) { return response.json(); })
|
|
25
32
|
.then(function (data) {
|
|
@@ -15,6 +15,7 @@ var useI18n = require('./useI18n.js');
|
|
|
15
15
|
var auditTrailService = require('../services/auditTrailService.js');
|
|
16
16
|
var sessionService = require('../services/sessionService.js');
|
|
17
17
|
var extractedCopy = require('../utils/extractedCopy.js');
|
|
18
|
+
var previewMode = require('../preview/previewMode.js');
|
|
18
19
|
|
|
19
20
|
var useUserInputForm = function (_a) {
|
|
20
21
|
var stepObject = _a.stepObject, setUserInput = _a.setUserInput, initialUserInput = _a.initialUserInput, node = _a.node, template = _a.template, contactInfo = _a.contactInfo, setContactInfo = _a.setContactInfo, onContinueCallback = _a.onContinueCallback, sessionId = _a.sessionId;
|
|
@@ -179,7 +180,8 @@ var useUserInputForm = function (_a) {
|
|
|
179
180
|
clearTimeout(addressRequestState.current.debounce);
|
|
180
181
|
addressRequestState.current.debounce = null;
|
|
181
182
|
}
|
|
182
|
-
|
|
183
|
+
// APP3-2057 — aperçu du builder : pas d'appel au service d'autocomplétion d'adresse.
|
|
184
|
+
if (query.trim().length < 3 || previewMode.isPreviewMode()) {
|
|
183
185
|
if (addressRequestState.current.controller) {
|
|
184
186
|
addressRequestState.current.controller.abort();
|
|
185
187
|
addressRequestState.current.controller = null;
|
package/dist/cjs/i18n/en.json.js
CHANGED
|
@@ -1133,6 +1133,31 @@ var complementary_mandate = {
|
|
|
1133
1133
|
error: "The mandate check failed. Please try again.",
|
|
1134
1134
|
retry: "Try again"
|
|
1135
1135
|
};
|
|
1136
|
+
var preview = {
|
|
1137
|
+
automatic: {
|
|
1138
|
+
description: "This step runs automatically during the journey, without any user action.",
|
|
1139
|
+
choose_branch: "Choose which path to show in the preview.",
|
|
1140
|
+
no_branch: "This step is not connected to any next step."
|
|
1141
|
+
},
|
|
1142
|
+
branch_picker: {
|
|
1143
|
+
title: "Which path should be shown?",
|
|
1144
|
+
description: "In a real journey, the next step depends on the result of this step. Choose the branch to preview."
|
|
1145
|
+
},
|
|
1146
|
+
branch: {
|
|
1147
|
+
"true": "True",
|
|
1148
|
+
"false": "False",
|
|
1149
|
+
compliant: "Compliant",
|
|
1150
|
+
non_compliant: "Non-compliant",
|
|
1151
|
+
to_verify: "To verify",
|
|
1152
|
+
validated: "Validated",
|
|
1153
|
+
invalidated: "Invalidated",
|
|
1154
|
+
unnamed: "Next step"
|
|
1155
|
+
},
|
|
1156
|
+
capture_disabled: {
|
|
1157
|
+
title: "Capture disabled in preview",
|
|
1158
|
+
description: "In the preview, the camera, file uploads, signature and analyses are not started."
|
|
1159
|
+
}
|
|
1160
|
+
};
|
|
1136
1161
|
var enTranslations = {
|
|
1137
1162
|
start: start,
|
|
1138
1163
|
user_input_form: user_input_form,
|
|
@@ -1191,7 +1216,8 @@ var enTranslations = {
|
|
|
1191
1216
|
nfc_scan: nfc_scan,
|
|
1192
1217
|
inpi_verification: inpi_verification,
|
|
1193
1218
|
signed_document: signed_document,
|
|
1194
|
-
complementary_mandate: complementary_mandate
|
|
1219
|
+
complementary_mandate: complementary_mandate,
|
|
1220
|
+
preview: preview
|
|
1195
1221
|
};
|
|
1196
1222
|
|
|
1197
1223
|
exports.LEGAL_CONSENT = LEGAL_CONSENT;
|
|
@@ -1218,6 +1244,7 @@ exports.orientation = orientation;
|
|
|
1218
1244
|
exports.pdf_generation = pdf_generation;
|
|
1219
1245
|
exports.photo = photo;
|
|
1220
1246
|
exports.powered_by = powered_by;
|
|
1247
|
+
exports.preview = preview;
|
|
1221
1248
|
exports.processing = processing;
|
|
1222
1249
|
exports.qr_code = qr_code;
|
|
1223
1250
|
exports.select_component = select_component;
|
package/dist/cjs/i18n/es.json.js
CHANGED
|
@@ -1133,6 +1133,31 @@ var complementary_mandate = {
|
|
|
1133
1133
|
error: "La verificación del mandato ha fallado. Inténtelo de nuevo.",
|
|
1134
1134
|
retry: "Reintentar"
|
|
1135
1135
|
};
|
|
1136
|
+
var preview = {
|
|
1137
|
+
automatic: {
|
|
1138
|
+
description: "Este paso se ejecuta automáticamente durante el recorrido, sin acción del usuario.",
|
|
1139
|
+
choose_branch: "Elija qué continuación mostrar en la vista previa.",
|
|
1140
|
+
no_branch: "Este paso no está conectado a ningún paso siguiente."
|
|
1141
|
+
},
|
|
1142
|
+
branch_picker: {
|
|
1143
|
+
title: "¿Qué continuación mostrar?",
|
|
1144
|
+
description: "En un recorrido real, la continuación depende del resultado de este paso. Elija la rama que desea previsualizar."
|
|
1145
|
+
},
|
|
1146
|
+
branch: {
|
|
1147
|
+
"true": "Verdadero",
|
|
1148
|
+
"false": "Falso",
|
|
1149
|
+
compliant: "Conforme",
|
|
1150
|
+
non_compliant: "No conforme",
|
|
1151
|
+
to_verify: "Por verificar",
|
|
1152
|
+
validated: "Validado",
|
|
1153
|
+
invalidated: "Invalidado",
|
|
1154
|
+
unnamed: "Paso siguiente"
|
|
1155
|
+
},
|
|
1156
|
+
capture_disabled: {
|
|
1157
|
+
title: "Captura desactivada en la vista previa",
|
|
1158
|
+
description: "En la vista previa no se inician la cámara, el envío de archivos, la firma ni los análisis."
|
|
1159
|
+
}
|
|
1160
|
+
};
|
|
1136
1161
|
var esTranslations = {
|
|
1137
1162
|
start: start,
|
|
1138
1163
|
user_input_form: user_input_form,
|
|
@@ -1191,7 +1216,8 @@ var esTranslations = {
|
|
|
1191
1216
|
nfc_scan: nfc_scan,
|
|
1192
1217
|
inpi_verification: inpi_verification,
|
|
1193
1218
|
signed_document: signed_document,
|
|
1194
|
-
complementary_mandate: complementary_mandate
|
|
1219
|
+
complementary_mandate: complementary_mandate,
|
|
1220
|
+
preview: preview
|
|
1195
1221
|
};
|
|
1196
1222
|
|
|
1197
1223
|
exports.LEGAL_CONSENT = LEGAL_CONSENT;
|
|
@@ -1218,6 +1244,7 @@ exports.orientation = orientation;
|
|
|
1218
1244
|
exports.pdf_generation = pdf_generation;
|
|
1219
1245
|
exports.photo = photo;
|
|
1220
1246
|
exports.powered_by = powered_by;
|
|
1247
|
+
exports.preview = preview;
|
|
1221
1248
|
exports.processing = processing;
|
|
1222
1249
|
exports.qr_code = qr_code;
|
|
1223
1250
|
exports.select_component = select_component;
|
package/dist/cjs/i18n/fr.json.js
CHANGED
|
@@ -1133,6 +1133,31 @@ var complementary_mandate = {
|
|
|
1133
1133
|
error: "La vérification du mandat a échoué. Veuillez réessayer.",
|
|
1134
1134
|
retry: "Réessayer"
|
|
1135
1135
|
};
|
|
1136
|
+
var preview = {
|
|
1137
|
+
automatic: {
|
|
1138
|
+
description: "Cette étape s'exécute automatiquement pendant le parcours, sans action de l'utilisateur.",
|
|
1139
|
+
choose_branch: "Choisissez la suite à afficher dans l'aperçu.",
|
|
1140
|
+
no_branch: "Cette étape n'est reliée à aucune étape suivante."
|
|
1141
|
+
},
|
|
1142
|
+
branch_picker: {
|
|
1143
|
+
title: "Quelle suite afficher ?",
|
|
1144
|
+
description: "Dans un vrai parcours, la suite dépend du résultat de cette étape. Choisissez la branche à prévisualiser."
|
|
1145
|
+
},
|
|
1146
|
+
branch: {
|
|
1147
|
+
"true": "Vrai",
|
|
1148
|
+
"false": "Faux",
|
|
1149
|
+
compliant: "Conforme",
|
|
1150
|
+
non_compliant: "Non conforme",
|
|
1151
|
+
to_verify: "À vérifier",
|
|
1152
|
+
validated: "Validé",
|
|
1153
|
+
invalidated: "Invalidé",
|
|
1154
|
+
unnamed: "Étape suivante"
|
|
1155
|
+
},
|
|
1156
|
+
capture_disabled: {
|
|
1157
|
+
title: "Capture désactivée dans l'aperçu",
|
|
1158
|
+
description: "Dans l'aperçu, la caméra, l'envoi de fichiers, la signature et les analyses ne sont pas lancés."
|
|
1159
|
+
}
|
|
1160
|
+
};
|
|
1136
1161
|
var frTranslations = {
|
|
1137
1162
|
start: start,
|
|
1138
1163
|
user_input_form: user_input_form,
|
|
@@ -1191,7 +1216,8 @@ var frTranslations = {
|
|
|
1191
1216
|
nfc_scan: nfc_scan,
|
|
1192
1217
|
inpi_verification: inpi_verification,
|
|
1193
1218
|
signed_document: signed_document,
|
|
1194
|
-
complementary_mandate: complementary_mandate
|
|
1219
|
+
complementary_mandate: complementary_mandate,
|
|
1220
|
+
preview: preview
|
|
1195
1221
|
};
|
|
1196
1222
|
|
|
1197
1223
|
exports.LEGAL_CONSENT = LEGAL_CONSENT;
|
|
@@ -1218,6 +1244,7 @@ exports.orientation = orientation;
|
|
|
1218
1244
|
exports.pdf_generation = pdf_generation;
|
|
1219
1245
|
exports.photo = photo;
|
|
1220
1246
|
exports.powered_by = powered_by;
|
|
1247
|
+
exports.preview = preview;
|
|
1221
1248
|
exports.processing = processing;
|
|
1222
1249
|
exports.qr_code = qr_code;
|
|
1223
1250
|
exports.select_component = select_component;
|