@volr/react 0.2.2 → 0.2.4
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.cjs +4 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -289,6 +289,11 @@ type VolrConfig = {
|
|
|
289
289
|
projectApiKey: string;
|
|
290
290
|
rpcOverrides?: Record<string, string>;
|
|
291
291
|
autoRecoverOnLogin?: boolean;
|
|
292
|
+
/**
|
|
293
|
+
* Allowed locales for UI language selection.
|
|
294
|
+
* If the user's locale is not allowed, English is used.
|
|
295
|
+
*/
|
|
296
|
+
allowedLocales?: Array<"en" | "ko">;
|
|
292
297
|
providerPolicy?: {
|
|
293
298
|
enforceOnFirstLogin?: boolean;
|
|
294
299
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -289,6 +289,11 @@ type VolrConfig = {
|
|
|
289
289
|
projectApiKey: string;
|
|
290
290
|
rpcOverrides?: Record<string, string>;
|
|
291
291
|
autoRecoverOnLogin?: boolean;
|
|
292
|
+
/**
|
|
293
|
+
* Allowed locales for UI language selection.
|
|
294
|
+
* If the user's locale is not allowed, English is used.
|
|
295
|
+
*/
|
|
296
|
+
allowedLocales?: Array<"en" | "ko">;
|
|
292
297
|
providerPolicy?: {
|
|
293
298
|
enforceOnFirstLogin?: boolean;
|
|
294
299
|
};
|
package/dist/index.js
CHANGED
|
@@ -10736,7 +10736,7 @@ function VolrProvider({ config, children }) {
|
|
|
10736
10736
|
const client = useMemo(() => {
|
|
10737
10737
|
if (!config.projectApiKey) {
|
|
10738
10738
|
throw new Error(
|
|
10739
|
-
"VolrProvider requires config.projectApiKey. Please
|
|
10739
|
+
"VolrProvider requires config.projectApiKey. Please provide projectApiKey in config."
|
|
10740
10740
|
);
|
|
10741
10741
|
}
|
|
10742
10742
|
return new APIClient({
|
|
@@ -19910,7 +19910,9 @@ Issued At: ${issuedAt}`;
|
|
|
19910
19910
|
if (apiBaseUrl.includes("dev-api") || apiBaseUrl.includes("localhost")) {
|
|
19911
19911
|
params.set("env", "dev");
|
|
19912
19912
|
}
|
|
19913
|
-
const
|
|
19913
|
+
const detectedLang = typeof navigator !== "undefined" ? navigator.language?.toLowerCase().startsWith("ko") ? "ko" : "en" : "en";
|
|
19914
|
+
const allowedLocales = config.allowedLocales;
|
|
19915
|
+
const lang = allowedLocales && !allowedLocales.includes(detectedLang) ? "en" : detectedLang;
|
|
19914
19916
|
params.set("lang", lang);
|
|
19915
19917
|
return `https://sign.volr.io?${params.toString()}`;
|
|
19916
19918
|
},
|