@incodetech/web 0.0.0-dev-20260826-a53f4308 → 0.0.0-dev-20260826-ffaa247e

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.
@@ -3,7 +3,7 @@ import { c as z, d as T, l as A, o as P, p as d, v as y, y as u } from "../vendo
3
3
  import { Q as StatusPage, St as useManager, ct as ResolvedConfigProvider, mt as TransitionSpinner, rt as IncodeComponent, ut as TerminalErrorPage } from "../extensibility-BnZixBAO.js";
4
4
  import { O as ErrorIcon } from "../dropdownComposed-Ch49Jspl.js";
5
5
  import { t as registerIncodeModuleElement } from "../incodeModule-C9IJ7BBr.js";
6
- 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-CXAVtoDG.js";
6
+ 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, y as resolveSessionLanguage } from "../useModuleLoader-C2JIaFOa.js";
7
7
  import { getRequiredWasmPipelines } from "@incodetech/core/flow";
8
8
  import { bootstrapSession, refreshQrUrlUuid } from "@incodetech/core/session";
9
9
  //#region src/shared/processing/useDelayedFlag.ts
@@ -31,6 +31,15 @@ function useDelayedFlag(isTrue, delayMs) {
31
31
  return delayed;
32
32
  }
33
33
  //#endregion
34
+ //#region src/modules/flow/flowConfig.ts
35
+ function hasFlowToken(config) {
36
+ return typeof config.token === "string";
37
+ }
38
+ function isSelfLoadingFlowConfig(config) {
39
+ const bootstrapConfig = config;
40
+ return typeof bootstrapConfig.configurationId === "string" && (typeof bootstrapConfig.apiKey === "string" || typeof bootstrapConfig.clientId === "string");
41
+ }
42
+ //#endregion
34
43
  //#region src/modules/flow/moduleErrorHandler.ts
35
44
  /**
36
45
  * Use the module's real error message when present, else `fallbackMessage`.
@@ -73,15 +82,6 @@ async function createFlowSession(config, signal) {
73
82
  }, signal);
74
83
  }
75
84
  //#endregion
76
- //#region src/modules/flow/flowConfig.ts
77
- function hasFlowToken(config) {
78
- return typeof config.token === "string";
79
- }
80
- function isSelfLoadingFlowConfig(config) {
81
- const bootstrapConfig = config;
82
- return typeof bootstrapConfig.configurationId === "string" && (typeof bootstrapConfig.apiKey === "string" || typeof bootstrapConfig.clientId === "string");
83
- }
84
- //#endregion
85
85
  //#region src/modules/flow/preloadFlow.ts
86
86
  var preloadCache = /* @__PURE__ */ new Map();
87
87
  function createPreloadHandle(token) {
@@ -345,10 +345,16 @@ function useFlowInitialization(options) {
345
345
  var LazyHomeScreen = z(() => import("../homeScreen-6lQbBul-.js").then((module) => ({ default: module.HomeScreen })));
346
346
  var IncodeFlowContent = ({ config, onFinish, onError }) => {
347
347
  const { i18n } = useTranslation();
348
+ const initialSessionLanguage = A(isSelfLoadingFlowConfig(config) ? resolveSessionLanguage(config.lang, i18n.language, readStoredLanguage()) : config.lang).current;
348
349
  const initState = useFlowInitialization(T(() => ({
349
350
  ...config,
351
+ lang: initialSessionLanguage,
352
+ onError
353
+ }), [
354
+ config,
355
+ initialSessionLanguage,
350
356
  onError
351
- }), [config, onError]));
357
+ ]));
352
358
  const [flowState, flowManager] = useManager(() => initState.flowManager, { autoLoad: false });
353
359
  const lazyModuleKey = flowState.presentation.lazyModuleKey;
354
360
  const currentModuleKey = flowState.status === "ready" ? flowState.currentStep : void 0;
@@ -7,6 +7,27 @@ import { initializeWasmUtil, resolveWasmConfigForPipelines, setWasmConfig, upgra
7
7
  import { isDesktopOrEmulated } from "@incodetech/core/device";
8
8
  import { createOrchestratedFlowManager, getFlow, getRequiredWasmPipelines } from "@incodetech/core/flow";
9
9
  import { getFinishStatus, initializeSession } from "@incodetech/core/session";
10
+ //#region src/shared/selfLoading/resolveSessionLanguage.ts
11
+ var sessionLanguageAliases = {
12
+ en: "en-US",
13
+ es: "es-ES",
14
+ pt: "pt-BR"
15
+ };
16
+ function normalizeSessionLanguage(language) {
17
+ if (!language || language.includes("-")) return language;
18
+ return sessionLanguageAliases[language.toLowerCase()] ?? language;
19
+ }
20
+ /**
21
+ * Resolve the locale sent while creating a self-loading session.
22
+ *
23
+ * A language selected in the SDK Settings UI takes precedence over the host's
24
+ * configured default. Otherwise the configured language wins, followed by the
25
+ * active i18n language (from setup or browser detection).
26
+ */
27
+ function resolveSessionLanguage(configuredLanguage, activeLanguage, storedLanguage) {
28
+ return normalizeSessionLanguage(storedLanguage ? activeLanguage : configuredLanguage ?? activeLanguage);
29
+ }
30
+ //#endregion
10
31
  //#region src/shared/device/redirectDeviceClassification.ts
11
32
  function isDesktopOrEmulated$1() {
12
33
  return isDesktopOrEmulated();
@@ -459,4 +480,4 @@ function usePrefetchNextModule(steps, currentStepIndex, modules, currentModuleLo
459
480
  ]);
460
481
  }
461
482
  //#endregion
462
- export { warmupWasmIfNeeded as _, resolveApiKey as a, HEADLESS_FLOW_MODULE_KEYS as c, fetchTheme as d, initializeFlowManager as f, setupSDK as g, preloadRedirectToMobile as h, HEADLESS_WORKFLOW_MODULE_KEYS as i, LAZY_UI_MODULES as l, preloadHomeScreen as m, useModulePreloader as n, extractIncodeStatus as o, preloadFirstModule as p, usePrefetchNextModule as r, UnsupportedModule as s, useModuleLoader as t, createFlowManager as u, isDesktopOrEmulated$1 as v };
483
+ export { warmupWasmIfNeeded as _, resolveApiKey as a, HEADLESS_FLOW_MODULE_KEYS as c, fetchTheme as d, initializeFlowManager as f, setupSDK as g, preloadRedirectToMobile as h, HEADLESS_WORKFLOW_MODULE_KEYS as i, LAZY_UI_MODULES as l, preloadHomeScreen as m, useModulePreloader as n, extractIncodeStatus as o, preloadFirstModule as p, usePrefetchNextModule as r, UnsupportedModule as s, useModuleLoader as t, createFlowManager as u, isDesktopOrEmulated$1 as v, resolveSessionLanguage as y };
@@ -3,7 +3,7 @@ import { c as z, l as A, o as P, p as d, v as y, y as u } from "../vendor-preact
3
3
  import { i as fetchAndApplyTheme } from "../dashboardTheme-Dh8-3k4t.js";
4
4
  import { St as useManager, at as AutoFocusTitle, ct as ResolvedConfigProvider, dt as Page, mt as TransitionSpinner, rt as IncodeComponent, ut as TerminalErrorPage } from "../extensibility-BnZixBAO.js";
5
5
  import { t as registerIncodeModuleElement } from "../incodeModule-C9IJ7BBr.js";
6
- import { a as resolveApiKey, g as setupSDK, i as HEADLESS_WORKFLOW_MODULE_KEYS, l as LAZY_UI_MODULES, o as extractIncodeStatus, s as UnsupportedModule, t as useModuleLoader, v as isDesktopOrEmulated } from "../useModuleLoader-CXAVtoDG.js";
6
+ import { a as resolveApiKey, g as setupSDK, i as HEADLESS_WORKFLOW_MODULE_KEYS, l as LAZY_UI_MODULES, o as extractIncodeStatus, s as UnsupportedModule, t as useModuleLoader, v as isDesktopOrEmulated, y as resolveSessionLanguage } from "../useModuleLoader-C2JIaFOa.js";
7
7
  import { resolveWasmConfigForPipelines, upgradeToWasmHttpClient, warmupWasm } from "@incodetech/core/wasm";
8
8
  import { classifyScoreStatus } from "@incodetech/core/flow";
9
9
  import { bootstrapSession, refreshQrUrlUuid } from "@incodetech/core/session";
@@ -427,8 +427,10 @@ var IncodeWorkflowReady = ({ config, workflowManager: initialManager, onFinish,
427
427
  };
428
428
  var IncodeWorkflowContent = ({ config, onFinish, onError }) => {
429
429
  const { i18n } = useTranslation();
430
+ const initialSessionLanguage = A(isSelfLoadingWorkflowConfig(config) ? resolveSessionLanguage(config.lang, i18n.language, readStoredLanguage()) : config.lang).current;
430
431
  const initState = useWorkflowInitialization({
431
432
  ...config,
433
+ lang: initialSessionLanguage,
432
434
  onError
433
435
  });
434
436
  y(() => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@incodetech/web",
3
- "version": "0.0.0-dev-20260826-a53f4308",
3
+ "version": "0.0.0-dev-20260826-ffaa247e",
4
4
  "license": "ISC",
5
5
  "repository": {
6
6
  "type": "git",
@@ -292,7 +292,7 @@
292
292
  "qrcode": "^1.5.4",
293
293
  "signature_pad": "^5.1.3",
294
294
  "tailwindcss": "^4.1.17",
295
- "@incodetech/core": "0.0.0-dev-20260826-a53f4308"
295
+ "@incodetech/core": "0.0.0-dev-20260826-ffaa247e"
296
296
  },
297
297
  "devDependencies": {
298
298
  "@microsoft/api-extractor": "^7.53.3",