@incodetech/web 0.0.0-dev-20260723-397b76d8 → 0.0.0-dev-20260724-72008930
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/flow/flow.es.js +51 -7
- package/package.json +2 -2
package/dist/flow/flow.es.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { c as readStoredLanguage, i as useTranslation, t as setUiConfig } from "../uiConfig-DSGyRMSC.js";
|
|
2
2
|
import { _ as y, c as z, d as T, l as A, o as P, p as d, v as u } from "../vendor-preact-DThS2ZQ_.js";
|
|
3
3
|
import { g as useManager, n as ResolvedConfigProvider, r as TerminalErrorPage, s as TransitionSpinner } from "../hooks-Bl4BccV8.js";
|
|
4
|
+
import { n as ErrorIcon } from "../incode-logo-DasIBJw8.js";
|
|
4
5
|
import { t as IncodeComponent } from "../incodeComponent-DHbfYA-r.js";
|
|
6
|
+
import { t as StatusPage } from "../statusPage-DUejG583.js";
|
|
5
7
|
import { t as registerIncodeModuleElement } from "../incodeModule-BiwGYtcv.js";
|
|
6
8
|
import { _ as warmupWasmIfNeeded, a as resolveApiKey, c as HEADLESS_FLOW_MODULE_KEYS, d as fetchTheme, f as initializeFlowManager, h as preloadRedirectToMobile, l as LAZY_UI_MODULES, m as preloadHomeScreen, n as useModulePreloader, o as extractIncodeStatus, p as preloadFirstModule, r as usePrefetchNextModule, s as UnsupportedModule, t as useModuleLoader, u as createFlowManager, v as isDesktopOrEmulated } from "../useModuleLoader-V8kW4raN.js";
|
|
7
9
|
import { getRequiredWasmPipelines } from "@incodetech/core/flow";
|
|
@@ -31,6 +33,19 @@ function useDelayedFlag(isTrue, delayMs) {
|
|
|
31
33
|
return delayed;
|
|
32
34
|
}
|
|
33
35
|
//#endregion
|
|
36
|
+
//#region src/modules/flow/sessionFinishedPage.tsx
|
|
37
|
+
var SessionFinishedPage = () => {
|
|
38
|
+
const { ready, t } = useTranslation();
|
|
39
|
+
if (!ready) return /* @__PURE__ */ u(TransitionSpinner, {});
|
|
40
|
+
const subtitle = t("onboarding.errors.sessionFinished.message");
|
|
41
|
+
return /* @__PURE__ */ u(StatusPage, {
|
|
42
|
+
variant: "error",
|
|
43
|
+
icon: /* @__PURE__ */ u(ErrorIcon, { size: 48 }),
|
|
44
|
+
title: t("onboarding.errors.sessionFinished.title"),
|
|
45
|
+
subtitle: subtitle || void 0
|
|
46
|
+
});
|
|
47
|
+
};
|
|
48
|
+
//#endregion
|
|
34
49
|
//#region src/modules/flow/createFlowSession.ts
|
|
35
50
|
async function createFlowSession(config, signal) {
|
|
36
51
|
return bootstrapSession(await resolveApiKey(config), {
|
|
@@ -159,14 +174,18 @@ function maybePreloadHomeScreen(flowManager) {
|
|
|
159
174
|
function maybePreloadRedirectToMobile() {
|
|
160
175
|
if (isDesktopOrEmulated()) preloadRedirectToMobile();
|
|
161
176
|
}
|
|
177
|
+
function isFlowManagerError(flowManager, errorMessage) {
|
|
178
|
+
const managerState = flowManager.getState();
|
|
179
|
+
return managerState.status === "error" && managerState.error === errorMessage;
|
|
180
|
+
}
|
|
162
181
|
function useFlowInitialization(options) {
|
|
163
182
|
const { lang, disableDashboardTheme, enableHome, onError, useCPF } = options;
|
|
164
183
|
const token = hasFlowToken(options) ? options.token : void 0;
|
|
165
184
|
const flowManagerRef = A(null);
|
|
166
185
|
const [state, setState] = d(() => {
|
|
167
186
|
const preloaded = token ? getPreloadedData(token) : null;
|
|
168
|
-
if (token) {
|
|
169
|
-
if (preloaded
|
|
187
|
+
if (token && preloaded) {
|
|
188
|
+
if (preloaded.status === "ready") {
|
|
170
189
|
const consumed = consumePreloadedData(token);
|
|
171
190
|
if (consumed) {
|
|
172
191
|
flowManagerRef.current = consumed.flowManager;
|
|
@@ -179,6 +198,26 @@ function useFlowInitialization(options) {
|
|
|
179
198
|
};
|
|
180
199
|
}
|
|
181
200
|
}
|
|
201
|
+
if (preloaded.status === "error") {
|
|
202
|
+
const consumed = consumePreloadedData(token);
|
|
203
|
+
if (consumed) {
|
|
204
|
+
flowManagerRef.current = consumed.flowManager;
|
|
205
|
+
return {
|
|
206
|
+
status: "error",
|
|
207
|
+
error: consumed.error ?? "Preload failed",
|
|
208
|
+
flowManager: consumed.flowManager
|
|
209
|
+
};
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
if (preloaded.status === "loading") {
|
|
213
|
+
flowManagerRef.current = preloaded.flowManager;
|
|
214
|
+
maybePreloadHomeScreen(preloaded.flowManager);
|
|
215
|
+
maybePreloadRedirectToMobile();
|
|
216
|
+
return {
|
|
217
|
+
status: "initializing",
|
|
218
|
+
flowManager: preloaded.flowManager
|
|
219
|
+
};
|
|
220
|
+
}
|
|
182
221
|
}
|
|
183
222
|
const flowManager = createFlowManager({
|
|
184
223
|
authHint: options.authHint,
|
|
@@ -187,13 +226,13 @@ function useFlowInitialization(options) {
|
|
|
187
226
|
useCPF: options.useCPF
|
|
188
227
|
});
|
|
189
228
|
flowManagerRef.current = flowManager;
|
|
190
|
-
maybePreloadHomeScreen(flowManager);
|
|
191
|
-
maybePreloadRedirectToMobile();
|
|
192
229
|
if (preloaded?.status === "error") return {
|
|
193
230
|
status: "error",
|
|
194
231
|
error: preloaded.error ?? "Preload failed",
|
|
195
232
|
flowManager
|
|
196
233
|
};
|
|
234
|
+
maybePreloadHomeScreen(flowManager);
|
|
235
|
+
maybePreloadRedirectToMobile();
|
|
197
236
|
return {
|
|
198
237
|
status: "initializing",
|
|
199
238
|
flowManager
|
|
@@ -217,15 +256,16 @@ function useFlowInitialization(options) {
|
|
|
217
256
|
});
|
|
218
257
|
}
|
|
219
258
|
}).catch((error) => {
|
|
259
|
+
const flowManager = consumePreloadedData(token)?.flowManager ?? state.flowManager;
|
|
220
260
|
const errorMessage = error instanceof Error ? error.message : "Preload failed";
|
|
221
261
|
const errorCode = extractIncodeStatus(error);
|
|
222
262
|
setState({
|
|
223
263
|
status: "error",
|
|
224
264
|
error: errorMessage,
|
|
225
265
|
errorCode,
|
|
226
|
-
flowManager
|
|
266
|
+
flowManager
|
|
227
267
|
});
|
|
228
|
-
onError?.(errorMessage, errorCode);
|
|
268
|
+
if (!isFlowManagerError(flowManager, errorMessage)) onError?.(errorMessage, errorCode);
|
|
229
269
|
});
|
|
230
270
|
return;
|
|
231
271
|
}
|
|
@@ -272,7 +312,7 @@ function useFlowInitialization(options) {
|
|
|
272
312
|
errorCode,
|
|
273
313
|
flowManager: state.flowManager
|
|
274
314
|
});
|
|
275
|
-
onError?.(errorMessage, errorCode);
|
|
315
|
+
if (!isFlowManagerError(state.flowManager, errorMessage)) onError?.(errorMessage, errorCode);
|
|
276
316
|
}
|
|
277
317
|
};
|
|
278
318
|
initialize();
|
|
@@ -362,6 +402,10 @@ var IncodeFlowContent = ({ config, onFinish, onError }) => {
|
|
|
362
402
|
if (flowState?.status === "ready" && flowState.currentStep === "ID" && flowState.steps.includes("TUTORIAL_ID")) flowManager.completeModule();
|
|
363
403
|
}, [flowState, flowManager]);
|
|
364
404
|
const hideSpinnerText = !(config.spinnerConfig?.title || config.spinnerConfig?.subtitle);
|
|
405
|
+
if (flowState.status === "error" && flowState.moduleErrorCode === "SESSION_FINISHED") return /* @__PURE__ */ u("div", {
|
|
406
|
+
class: "IncodeFlow",
|
|
407
|
+
children: /* @__PURE__ */ u(SessionFinishedPage, {})
|
|
408
|
+
});
|
|
365
409
|
if (initState.status === "error") return /* @__PURE__ */ u("div", {
|
|
366
410
|
class: "IncodeFlow",
|
|
367
411
|
children: /* @__PURE__ */ u(TerminalErrorPage, { message: initState.error })
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@incodetech/web",
|
|
3
|
-
"version": "0.0.0-dev-
|
|
3
|
+
"version": "0.0.0-dev-20260724-72008930",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/IncodeTechnologies/incode-web-sdk.git"
|
|
@@ -291,7 +291,7 @@
|
|
|
291
291
|
"qrcode": "^1.5.4",
|
|
292
292
|
"signature_pad": "^5.1.3",
|
|
293
293
|
"tailwindcss": "^4.1.17",
|
|
294
|
-
"@incodetech/core": "0.0.0-dev-
|
|
294
|
+
"@incodetech/core": "0.0.0-dev-20260724-72008930"
|
|
295
295
|
},
|
|
296
296
|
"devDependencies": {
|
|
297
297
|
"@microsoft/api-extractor": "^7.53.3",
|