keycloakify 10.0.0-rc.36 → 10.0.0-rc.38
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/account/Fallback.d.ts +1 -2
- package/account/Fallback.js.map +1 -1
- package/account/KcContext/KcContext.d.ts +6 -6
- package/account/KcContext/getKcContextMock.d.ts +9 -9
- package/account/KcContext/getKcContextMock.js +3 -3
- package/account/KcContext/getKcContextMock.js.map +1 -1
- package/account/Template.d.ts +1 -2
- package/account/Template.js +7 -6
- package/account/Template.js.map +1 -1
- package/account/TemplateProps.d.ts +1 -3
- package/account/i18n/i18n.d.ts +9 -4
- package/account/i18n/i18n.js +132 -87
- package/account/i18n/i18n.js.map +1 -1
- package/account/i18n/index.d.ts +9 -2
- package/account/i18n/index.js +5 -1
- package/account/i18n/index.js.map +1 -1
- package/account/index.d.ts +1 -1
- package/account/lib/kcClsx.d.ts +9 -0
- package/account/lib/{useGetClassName.js → kcClsx.js} +3 -3
- package/account/lib/kcClsx.js.map +1 -0
- package/account/pages/Account.d.ts +1 -2
- package/account/pages/Account.js +9 -7
- package/account/pages/Account.js.map +1 -1
- package/account/pages/Applications.d.ts +1 -2
- package/account/pages/Applications.js +7 -7
- package/account/pages/Applications.js.map +1 -1
- package/account/pages/FederatedIdentity.d.ts +1 -2
- package/account/pages/FederatedIdentity.js +4 -3
- package/account/pages/FederatedIdentity.js.map +1 -1
- package/account/pages/Log.d.ts +1 -2
- package/account/pages/Log.js +6 -5
- package/account/pages/Log.js.map +1 -1
- package/account/pages/PageProps.d.ts +2 -4
- package/account/pages/Password.d.ts +1 -2
- package/account/pages/Password.js +10 -9
- package/account/pages/Password.js.map +1 -1
- package/account/pages/Sessions.d.ts +1 -2
- package/account/pages/Sessions.js +6 -6
- package/account/pages/Sessions.js.map +1 -1
- package/account/pages/Totp.d.ts +1 -2
- package/account/pages/Totp.js +6 -5
- package/account/pages/Totp.js.map +1 -1
- package/bin/{314.index.js → 21.index.js} +162 -4
- package/bin/{430.index.js → 214.index.js} +161 -2
- package/bin/3.index.js +81 -65
- package/bin/526.index.js +3 -2
- package/bin/538.index.js +552 -0
- package/bin/795.index.js +3 -2
- package/bin/{890.index.js → 941.index.js} +2 -159
- package/bin/main.js +19 -7
- package/lib/getKcClsx.d.ts +11 -0
- package/lib/getKcClsx.js +44 -0
- package/lib/getKcClsx.js.map +1 -0
- package/login/Fallback.d.ts +1 -2
- package/login/Fallback.js.map +1 -1
- package/login/KcContext/KcContext.d.ts +6 -6
- package/login/KcContext/getKcContextMock.d.ts +9 -9
- package/login/KcContext/getKcContextMock.js +3 -3
- package/login/KcContext/getKcContextMock.js.map +1 -1
- package/login/Template.d.ts +1 -2
- package/login/Template.js +10 -9
- package/login/Template.js.map +1 -1
- package/login/TemplateProps.d.ts +1 -3
- package/login/UserProfileFormFields.d.ts +5 -5
- package/login/UserProfileFormFields.js +35 -34
- package/login/UserProfileFormFields.js.map +1 -1
- package/login/i18n/i18n.d.ts +9 -4
- package/login/i18n/i18n.js +136 -91
- package/login/i18n/i18n.js.map +1 -1
- package/login/i18n/index.d.ts +9 -2
- package/login/i18n/index.js +5 -1
- package/login/i18n/index.js.map +1 -1
- package/login/index.d.ts +1 -1
- package/login/lib/kcClsx.d.ts +9 -0
- package/login/lib/{useGetClassName.js → kcClsx.js} +3 -3
- package/login/lib/kcClsx.js.map +1 -0
- package/login/lib/useUserProfileForm.d.ts +9 -6
- package/login/lib/useUserProfileForm.js +7 -5
- package/login/lib/useUserProfileForm.js.map +1 -1
- package/login/pages/Code.d.ts +1 -2
- package/login/pages/Code.js +6 -5
- package/login/pages/Code.js.map +1 -1
- package/login/pages/DeleteAccountConfirm.d.ts +1 -2
- package/login/pages/DeleteAccountConfirm.js +7 -7
- package/login/pages/DeleteAccountConfirm.js.map +1 -1
- package/login/pages/DeleteCredential.d.ts +1 -2
- package/login/pages/DeleteCredential.js +6 -6
- package/login/pages/DeleteCredential.js.map +1 -1
- package/login/pages/Error.d.ts +1 -2
- package/login/pages/Error.js +4 -3
- package/login/pages/Error.js.map +1 -1
- package/login/pages/FrontchannelLogout.d.ts +1 -2
- package/login/pages/FrontchannelLogout.js +4 -3
- package/login/pages/FrontchannelLogout.js.map +1 -1
- package/login/pages/IdpReviewUserProfile.d.ts +1 -2
- package/login/pages/IdpReviewUserProfile.js +6 -6
- package/login/pages/IdpReviewUserProfile.js.map +1 -1
- package/login/pages/Info.d.ts +1 -2
- package/login/pages/Info.js +4 -3
- package/login/pages/Info.js.map +1 -1
- package/login/pages/Login.d.ts +1 -2
- package/login/pages/Login.js +10 -8
- package/login/pages/Login.js.map +1 -1
- package/login/pages/LoginConfigTotp.d.ts +1 -2
- package/login/pages/LoginConfigTotp.js +8 -7
- package/login/pages/LoginConfigTotp.js.map +1 -1
- package/login/pages/LoginIdpLinkConfirm.d.ts +1 -2
- package/login/pages/LoginIdpLinkConfirm.js +6 -6
- package/login/pages/LoginIdpLinkConfirm.js.map +1 -1
- package/login/pages/LoginIdpLinkEmail.d.ts +1 -2
- package/login/pages/LoginIdpLinkEmail.js +4 -3
- package/login/pages/LoginIdpLinkEmail.js.map +1 -1
- package/login/pages/LoginOauth2DeviceVerifyUserCode.d.ts +1 -2
- package/login/pages/LoginOauth2DeviceVerifyUserCode.js +6 -6
- package/login/pages/LoginOauth2DeviceVerifyUserCode.js.map +1 -1
- package/login/pages/LoginOauthGrant.d.ts +1 -2
- package/login/pages/LoginOauthGrant.js +7 -7
- package/login/pages/LoginOauthGrant.js.map +1 -1
- package/login/pages/LoginOtp.d.ts +1 -2
- package/login/pages/LoginOtp.js +6 -6
- package/login/pages/LoginOtp.js.map +1 -1
- package/login/pages/LoginPageExpired.d.ts +1 -2
- package/login/pages/LoginPageExpired.js +4 -3
- package/login/pages/LoginPageExpired.js.map +1 -1
- package/login/pages/LoginPassword.d.ts +1 -2
- package/login/pages/LoginPassword.js +9 -7
- package/login/pages/LoginPassword.js.map +1 -1
- package/login/pages/LoginRecoveryAuthnCodeConfig.d.ts +1 -2
- package/login/pages/LoginRecoveryAuthnCodeConfig.js +9 -7
- package/login/pages/LoginRecoveryAuthnCodeConfig.js.map +1 -1
- package/login/pages/LoginRecoveryAuthnCodeInput.d.ts +1 -2
- package/login/pages/LoginRecoveryAuthnCodeInput.js +6 -6
- package/login/pages/LoginRecoveryAuthnCodeInput.js.map +1 -1
- package/login/pages/LoginResetOtp.d.ts +1 -2
- package/login/pages/LoginResetOtp.js +6 -6
- package/login/pages/LoginResetOtp.js.map +1 -1
- package/login/pages/LoginResetPassword.d.ts +1 -2
- package/login/pages/LoginResetPassword.js +7 -7
- package/login/pages/LoginResetPassword.js.map +1 -1
- package/login/pages/LoginUpdatePassword.d.ts +1 -2
- package/login/pages/LoginUpdatePassword.js +10 -9
- package/login/pages/LoginUpdatePassword.js.map +1 -1
- package/login/pages/LoginUpdateProfile.d.ts +1 -2
- package/login/pages/LoginUpdateProfile.js +7 -12
- package/login/pages/LoginUpdateProfile.js.map +1 -1
- package/login/pages/LoginUsername.d.ts +1 -2
- package/login/pages/LoginUsername.js +8 -7
- package/login/pages/LoginUsername.js.map +1 -1
- package/login/pages/LoginVerifyEmail.d.ts +1 -2
- package/login/pages/LoginVerifyEmail.js +4 -3
- package/login/pages/LoginVerifyEmail.js.map +1 -1
- package/login/pages/LoginX509Info.d.ts +1 -2
- package/login/pages/LoginX509Info.js +6 -6
- package/login/pages/LoginX509Info.js.map +1 -1
- package/login/pages/LogoutConfirm.d.ts +1 -2
- package/login/pages/LogoutConfirm.js +6 -6
- package/login/pages/LogoutConfirm.js.map +1 -1
- package/login/pages/PageProps.d.ts +2 -4
- package/login/pages/Register.d.ts +1 -2
- package/login/pages/Register.js +8 -16
- package/login/pages/Register.js.map +1 -1
- package/login/pages/SamlPostForm.d.ts +1 -2
- package/login/pages/SamlPostForm.js +4 -3
- package/login/pages/SamlPostForm.js.map +1 -1
- package/login/pages/SelectAuthenticator.d.ts +1 -2
- package/login/pages/SelectAuthenticator.js +6 -9
- package/login/pages/SelectAuthenticator.js.map +1 -1
- package/login/pages/Terms.d.ts +1 -2
- package/login/pages/Terms.js +7 -7
- package/login/pages/Terms.js.map +1 -1
- package/login/pages/UpdateEmail.d.ts +1 -2
- package/login/pages/UpdateEmail.js +8 -12
- package/login/pages/UpdateEmail.js.map +1 -1
- package/login/pages/WebauthnAuthenticate.d.ts +1 -2
- package/login/pages/WebauthnAuthenticate.js +13 -12
- package/login/pages/WebauthnAuthenticate.js.map +1 -1
- package/login/pages/WebauthnError.d.ts +1 -2
- package/login/pages/WebauthnError.js +7 -7
- package/login/pages/WebauthnError.js.map +1 -1
- package/login/pages/WebauthnRegister.d.ts +1 -2
- package/login/pages/WebauthnRegister.js +9 -8
- package/login/pages/WebauthnRegister.js.map +1 -1
- package/package.json +24 -16
- package/src/account/Fallback.tsx +1 -2
- package/src/account/KcContext/KcContext.ts +7 -7
- package/src/account/KcContext/getKcContextMock.ts +13 -24
- package/src/account/Template.tsx +8 -8
- package/src/account/TemplateProps.ts +1 -6
- package/src/account/i18n/i18n.tsx +204 -125
- package/src/account/i18n/index.ts +10 -2
- package/src/account/index.ts +1 -1
- package/src/account/lib/{useGetClassName.ts → kcClsx.ts} +6 -2
- package/src/account/pages/Account.tsx +15 -21
- package/src/account/pages/Applications.tsx +8 -9
- package/src/account/pages/FederatedIdentity.tsx +5 -5
- package/src/account/pages/Log.tsx +8 -8
- package/src/account/pages/PageProps.ts +2 -4
- package/src/account/pages/Password.tsx +13 -16
- package/src/account/pages/Sessions.tsx +9 -10
- package/src/account/pages/Totp.tsx +19 -28
- package/src/bin/keycloakify/generateSrcMainResources/generateMessageProperties.ts +2 -66
- package/src/bin/keycloakify/generateSrcMainResources/generateSrcMainResourcesForMainTheme.ts +7 -1
- package/src/bin/main.ts +15 -0
- package/src/bin/shared/buildOptions.ts +5 -2
- package/src/bin/shared/generateKcGenTs.ts +61 -0
- package/src/bin/tools/escapeStringForPropertiesFile.ts +64 -0
- package/src/bin/update-kc-gen.ts +13 -0
- package/src/lib/getKcClsx.ts +75 -0
- package/src/login/Fallback.tsx +1 -2
- package/src/login/KcContext/KcContext.ts +7 -7
- package/src/login/KcContext/getKcContextMock.ts +13 -24
- package/src/login/Template.tsx +36 -37
- package/src/login/TemplateProps.ts +1 -6
- package/src/login/UserProfileFormFields.tsx +66 -81
- package/src/login/i18n/i18n.tsx +208 -129
- package/src/login/i18n/index.ts +10 -2
- package/src/login/index.ts +1 -1
- package/src/login/lib/{useGetClassName.ts → kcClsx.ts} +6 -2
- package/src/login/lib/useUserProfileForm.tsx +29 -21
- package/src/login/pages/Code.tsx +10 -8
- package/src/login/pages/DeleteAccountConfirm.tsx +9 -10
- package/src/login/pages/DeleteCredential.tsx +11 -10
- package/src/login/pages/Error.tsx +5 -5
- package/src/login/pages/FrontchannelLogout.tsx +7 -5
- package/src/login/pages/IdpReviewUserProfile.tsx +16 -25
- package/src/login/pages/Info.tsx +7 -5
- package/src/login/pages/Login.tsx +34 -53
- package/src/login/pages/LoginConfigTotp.tsx +30 -38
- package/src/login/pages/LoginIdpLinkConfirm.tsx +10 -21
- package/src/login/pages/LoginIdpLinkEmail.tsx +5 -5
- package/src/login/pages/LoginOauth2DeviceVerifyUserCode.tsx +19 -24
- package/src/login/pages/LoginOauthGrant.tsx +14 -21
- package/src/login/pages/LoginOtp.tsx +29 -33
- package/src/login/pages/LoginPageExpired.tsx +5 -5
- package/src/login/pages/LoginPassword.tsx +23 -33
- package/src/login/pages/LoginRecoveryAuthnCodeConfig.tsx +21 -25
- package/src/login/pages/LoginRecoveryAuthnCodeInput.tsx +21 -25
- package/src/login/pages/LoginResetOtp.tsx +21 -25
- package/src/login/pages/LoginResetPassword.tsx +21 -25
- package/src/login/pages/LoginUpdatePassword.tsx +42 -52
- package/src/login/pages/LoginUpdateProfile.tsx +26 -33
- package/src/login/pages/LoginUsername.tsx +23 -35
- package/src/login/pages/LoginVerifyEmail.tsx +7 -5
- package/src/login/pages/LoginX509Info.tsx +27 -36
- package/src/login/pages/LogoutConfirm.tsx +11 -17
- package/src/login/pages/PageProps.ts +2 -4
- package/src/login/pages/Register.tsx +24 -49
- package/src/login/pages/SamlPostForm.tsx +5 -5
- package/src/login/pages/SelectAuthenticator.tsx +24 -26
- package/src/login/pages/Terms.tsx +11 -18
- package/src/login/pages/UpdateEmail.tsx +26 -36
- package/src/login/pages/WebauthnAuthenticate.tsx +26 -32
- package/src/login/pages/WebauthnError.tsx +11 -22
- package/src/login/pages/WebauthnRegister.tsx +20 -28
- package/src/tools/clsx.ts +6 -48
- package/src/tools/clsx_withTransform.ts +55 -0
- package/src/vite-plugin/vite-plugin.ts +14 -6
- package/tools/clsx.d.ts +3 -2
- package/tools/clsx.js +5 -41
- package/tools/clsx.js.map +1 -1
- package/tools/clsx_withTransform.d.ts +5 -0
- package/tools/clsx_withTransform.js +43 -0
- package/tools/clsx_withTransform.js.map +1 -0
- package/vite-plugin/index.js +167 -37
- package/account/lib/useGetClassName.d.ts +0 -7
- package/account/lib/useGetClassName.js.map +0 -1
- package/lib/useGetClassName.d.ts +0 -10
- package/lib/useGetClassName.js +0 -14
- package/lib/useGetClassName.js.map +0 -1
- package/login/lib/useGetClassName.d.ts +0 -7
- package/login/lib/useGetClassName.js.map +0 -1
- package/src/lib/useGetClassName.ts +0 -27
package/login/i18n/i18n.js
CHANGED
@@ -1,117 +1,162 @@
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
2
2
|
import "../../tools/Object.fromEntries";
|
3
|
-
import { useEffect, useState
|
3
|
+
import { useEffect, useState } from "react";
|
4
4
|
import { assert } from "tsafe/assert";
|
5
|
-
import
|
5
|
+
import messages_fallbackLanguage from "./baseMessages/en";
|
6
6
|
import { getMessages } from "./baseMessages";
|
7
7
|
import { Reflect } from "tsafe/Reflect";
|
8
8
|
export const fallbackLanguageTag = "en";
|
9
9
|
assert();
|
10
|
+
function createGetI18n(extraMessages) {
|
11
|
+
const cachedResultByKcContext = new WeakMap();
|
12
|
+
function getI18n(params) {
|
13
|
+
var _a, _b, _c, _d;
|
14
|
+
const { kcContext } = params;
|
15
|
+
use_cache: {
|
16
|
+
const cachedResult = cachedResultByKcContext.get(kcContext);
|
17
|
+
if (cachedResult === undefined) {
|
18
|
+
break use_cache;
|
19
|
+
}
|
20
|
+
return cachedResult;
|
21
|
+
}
|
22
|
+
const partialI18n = {
|
23
|
+
currentLanguageTag: (_b = (_a = kcContext.locale) === null || _a === void 0 ? void 0 : _a.currentLanguageTag) !== null && _b !== void 0 ? _b : fallbackLanguageTag,
|
24
|
+
getChangeLocalUrl: newLanguageTag => {
|
25
|
+
const { locale } = kcContext;
|
26
|
+
assert(locale !== undefined, "Internationalization not enabled");
|
27
|
+
const targetSupportedLocale = locale.supported.find(({ languageTag }) => languageTag === newLanguageTag);
|
28
|
+
assert(targetSupportedLocale !== undefined, `${newLanguageTag} need to be enabled in Keycloak admin`);
|
29
|
+
return targetSupportedLocale.url;
|
30
|
+
},
|
31
|
+
labelBySupportedLanguageTag: Object.fromEntries(((_d = (_c = kcContext.locale) === null || _c === void 0 ? void 0 : _c.supported) !== null && _d !== void 0 ? _d : []).map(({ languageTag, label }) => [languageTag, label]))
|
32
|
+
};
|
33
|
+
const { createI18nTranslationFunctions } = createI18nTranslationFunctionsFactory({
|
34
|
+
messages_fallbackLanguage,
|
35
|
+
extraMessages_fallbackLanguage: extraMessages[fallbackLanguageTag],
|
36
|
+
extraMessages: extraMessages[partialI18n.currentLanguageTag],
|
37
|
+
__localizationRealmOverridesUserProfile: kcContext.__localizationRealmOverridesUserProfile
|
38
|
+
});
|
39
|
+
const isCurrentLanguageFallbackLanguage = partialI18n.currentLanguageTag !== fallbackLanguageTag;
|
40
|
+
const result = {
|
41
|
+
i18n: Object.assign(Object.assign(Object.assign({}, partialI18n), createI18nTranslationFunctions({ messages: undefined })), { isFetchingTranslations: !isCurrentLanguageFallbackLanguage }),
|
42
|
+
prI18n_currentLanguage: isCurrentLanguageFallbackLanguage
|
43
|
+
? undefined
|
44
|
+
: (async () => {
|
45
|
+
const messages = await getMessages(partialI18n.currentLanguageTag);
|
46
|
+
const i18n_currentLanguage = Object.assign(Object.assign(Object.assign({}, partialI18n), createI18nTranslationFunctions({ messages })), { isFetchingTranslations: false });
|
47
|
+
// NOTE: This promise.resolve is just because without it we TypeScript
|
48
|
+
// gives a Variable 'result' is used before being assigned. error
|
49
|
+
await Promise.resolve().then(() => {
|
50
|
+
result.i18n = i18n_currentLanguage;
|
51
|
+
result.prI18n_currentLanguage = undefined;
|
52
|
+
});
|
53
|
+
return i18n_currentLanguage;
|
54
|
+
})()
|
55
|
+
};
|
56
|
+
cachedResultByKcContext.set(kcContext, result);
|
57
|
+
return result;
|
58
|
+
}
|
59
|
+
return { getI18n };
|
60
|
+
}
|
10
61
|
export function createUseI18n(extraMessages) {
|
62
|
+
const { getI18n } = createGetI18n(extraMessages);
|
11
63
|
function useI18n(params) {
|
12
64
|
const { kcContext } = params;
|
13
|
-
const
|
14
|
-
const
|
65
|
+
const { i18n, prI18n_currentLanguage } = getI18n({ kcContext });
|
66
|
+
const [i18n_toReturn, setI18n_toReturn] = useState(i18n);
|
15
67
|
useEffect(() => {
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
__localizationRealmOverridesUserProfile: kcContext.__localizationRealmOverridesUserProfile
|
27
|
-
})), { currentLanguageTag, getChangeLocalUrl: newLanguageTag => {
|
28
|
-
const { locale } = kcContext;
|
29
|
-
assert(locale !== undefined, "Internationalization not enabled");
|
30
|
-
const targetSupportedLocale = locale.supported.find(({ languageTag }) => languageTag === newLanguageTag);
|
31
|
-
assert(targetSupportedLocale !== undefined, `${newLanguageTag} need to be enabled in Keycloak admin`);
|
32
|
-
return targetSupportedLocale.url;
|
33
|
-
}, labelBySupportedLanguageTag: Object.fromEntries(((_e = (_d = kcContext.locale) === null || _d === void 0 ? void 0 : _d.supported) !== null && _e !== void 0 ? _e : []).map(({ languageTag, label }) => [languageTag, label])) }));
|
34
|
-
})();
|
68
|
+
let isActive = true;
|
69
|
+
prI18n_currentLanguage === null || prI18n_currentLanguage === void 0 ? void 0 : prI18n_currentLanguage.then(i18n => {
|
70
|
+
if (!isActive) {
|
71
|
+
return;
|
72
|
+
}
|
73
|
+
setI18n_toReturn(i18n);
|
74
|
+
});
|
75
|
+
return () => {
|
76
|
+
isActive = false;
|
77
|
+
};
|
35
78
|
}, []);
|
36
|
-
return
|
79
|
+
return i18n_toReturn;
|
37
80
|
}
|
38
|
-
return {
|
39
|
-
useI18n,
|
40
|
-
ofTypeI18n: Reflect()
|
41
|
-
};
|
81
|
+
return { useI18n, ofTypeI18n: Reflect() };
|
42
82
|
}
|
43
|
-
function
|
44
|
-
const {
|
45
|
-
|
46
|
-
|
47
|
-
const {
|
48
|
-
|
49
|
-
if (messageOrUndefined === undefined) {
|
50
|
-
return undefined;
|
51
|
-
}
|
52
|
-
const message = messageOrUndefined;
|
53
|
-
const messageWithArgsInjectedIfAny = (() => {
|
83
|
+
function createI18nTranslationFunctionsFactory(params) {
|
84
|
+
const { __localizationRealmOverridesUserProfile, extraMessages } = params;
|
85
|
+
const messages_fallbackLanguage = Object.assign(Object.assign({}, params.messages_fallbackLanguage), params.extraMessages_fallbackLanguage);
|
86
|
+
function createI18nTranslationFunctions(params) {
|
87
|
+
const messages = Object.assign(Object.assign({}, params.messages), extraMessages);
|
88
|
+
function resolveMsg(props) {
|
54
89
|
var _a;
|
55
|
-
const
|
56
|
-
|
57
|
-
if (
|
58
|
-
|
59
|
-
return message;
|
90
|
+
const { key, args, doRenderAsHtml } = props;
|
91
|
+
const messageOrUndefined = (_a = messages[key]) !== null && _a !== void 0 ? _a : messages_fallbackLanguage[key];
|
92
|
+
if (messageOrUndefined === undefined) {
|
93
|
+
return undefined;
|
60
94
|
}
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
95
|
+
const message = messageOrUndefined;
|
96
|
+
const messageWithArgsInjectedIfAny = (() => {
|
97
|
+
var _a;
|
98
|
+
const startIndex = (_a = message
|
99
|
+
.match(/{[0-9]+}/g)) === null || _a === void 0 ? void 0 : _a.map(g => g.match(/{([0-9]+)}/)[1]).map(indexStr => parseInt(indexStr)).sort((a, b) => a - b)[0];
|
100
|
+
if (startIndex === undefined) {
|
101
|
+
// No {0} in message (no arguments expected)
|
102
|
+
return message;
|
65
103
|
}
|
66
|
-
messageWithArgsInjected =
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
}
|
75
|
-
}
|
76
|
-
function resolveMsgAdvanced(props) {
|
77
|
-
const { key, args, doRenderAsHtml } = props;
|
78
|
-
if (__localizationRealmOverridesUserProfile !== undefined && key in __localizationRealmOverridesUserProfile) {
|
79
|
-
const resolvedMessage = __localizationRealmOverridesUserProfile[key];
|
104
|
+
let messageWithArgsInjected = message;
|
105
|
+
args.forEach((arg, i) => {
|
106
|
+
if (arg === undefined) {
|
107
|
+
return;
|
108
|
+
}
|
109
|
+
messageWithArgsInjected = messageWithArgsInjected.replace(new RegExp(`\\{${i + startIndex}\\}`, "g"), arg.replace(/</g, "<").replace(/>/g, ">"));
|
110
|
+
});
|
111
|
+
return messageWithArgsInjected;
|
112
|
+
})();
|
80
113
|
return doRenderAsHtml ? (_jsx("span", {
|
81
114
|
// NOTE: The message is trusted. The arguments are not but are escaped.
|
82
115
|
dangerouslySetInnerHTML: {
|
83
|
-
__html:
|
84
|
-
} })) : (
|
116
|
+
__html: messageWithArgsInjectedIfAny
|
117
|
+
} })) : (messageWithArgsInjectedIfAny);
|
85
118
|
}
|
86
|
-
|
87
|
-
const
|
88
|
-
if (
|
89
|
-
|
119
|
+
function resolveMsgAdvanced(props) {
|
120
|
+
const { key, args, doRenderAsHtml } = props;
|
121
|
+
if (__localizationRealmOverridesUserProfile !== undefined && key in __localizationRealmOverridesUserProfile) {
|
122
|
+
const resolvedMessage = __localizationRealmOverridesUserProfile[key];
|
123
|
+
return doRenderAsHtml ? (_jsx("span", {
|
124
|
+
// NOTE: The message is trusted. The arguments are not but are escaped.
|
125
|
+
dangerouslySetInnerHTML: {
|
126
|
+
__html: resolvedMessage
|
127
|
+
} })) : (resolvedMessage);
|
90
128
|
}
|
91
|
-
|
129
|
+
if (!/\$\{[^}]+\}/.test(key)) {
|
130
|
+
const resolvedMessage = resolveMsg({ key, args, doRenderAsHtml });
|
131
|
+
if (resolvedMessage === undefined) {
|
132
|
+
return doRenderAsHtml ? _jsx("span", { dangerouslySetInnerHTML: { __html: key } }) : key;
|
133
|
+
}
|
134
|
+
return resolvedMessage;
|
135
|
+
}
|
136
|
+
let isFirstMatch = true;
|
137
|
+
const resolvedComplexMessage = key.replace(/\$\{([^}]+)\}/g, (...[, key_i]) => {
|
138
|
+
var _a;
|
139
|
+
const replaceBy = (_a = resolveMsg({ key: key_i, args: isFirstMatch ? args : [], doRenderAsHtml: false })) !== null && _a !== void 0 ? _a : key_i;
|
140
|
+
isFirstMatch = false;
|
141
|
+
return replaceBy;
|
142
|
+
});
|
143
|
+
return doRenderAsHtml ? _jsx("span", { dangerouslySetInnerHTML: { __html: resolvedComplexMessage } }) : resolvedComplexMessage;
|
92
144
|
}
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
145
|
+
return {
|
146
|
+
msgStr: (key, ...args) => resolveMsg({ key, args, doRenderAsHtml: false }),
|
147
|
+
msg: (key, ...args) => resolveMsg({ key, args, doRenderAsHtml: true }),
|
148
|
+
advancedMsg: (key, ...args) => resolveMsgAdvanced({
|
149
|
+
key,
|
150
|
+
args,
|
151
|
+
doRenderAsHtml: true
|
152
|
+
}),
|
153
|
+
advancedMsgStr: (key, ...args) => resolveMsgAdvanced({
|
154
|
+
key,
|
155
|
+
args,
|
156
|
+
doRenderAsHtml: false
|
157
|
+
})
|
158
|
+
};
|
101
159
|
}
|
102
|
-
return {
|
103
|
-
msgStr: (key, ...args) => resolveMsg({ key, args, doRenderAsHtml: false }),
|
104
|
-
msg: (key, ...args) => resolveMsg({ key, args, doRenderAsHtml: true }),
|
105
|
-
advancedMsg: (key, ...args) => resolveMsgAdvanced({
|
106
|
-
key,
|
107
|
-
args,
|
108
|
-
doRenderAsHtml: true
|
109
|
-
}),
|
110
|
-
advancedMsgStr: (key, ...args) => resolveMsgAdvanced({
|
111
|
-
key,
|
112
|
-
args,
|
113
|
-
doRenderAsHtml: false
|
114
|
-
})
|
115
|
-
};
|
160
|
+
return { createI18nTranslationFunctions };
|
116
161
|
}
|
117
162
|
//# sourceMappingURL=i18n.js.map
|
package/login/i18n/i18n.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"i18n.js","sourceRoot":"","sources":["../../src/login/i18n/i18n.tsx"],"names":[],"mappings":";AAAA,OAAO,sCAAsC,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,
|
1
|
+
{"version":3,"file":"i18n.js","sourceRoot":"","sources":["../../src/login/i18n/i18n.tsx"],"names":[],"mappings":";AAAA,OAAO,sCAAsC,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,yBAAyB,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC,MAAM,CAAC,MAAM,mBAAmB,GAAG,IAAI,CAAC;AAUxC,MAAM,EAAkD,CAAC;AAyEzD,SAAS,aAAa,CAAyC,aAA8E;IAKzI,MAAM,uBAAuB,GAAG,IAAI,OAAO,EAAyB,CAAC;IAErE,SAAS,OAAO,CAAC,MAAoC;;QACjD,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,CAAC;QAE7B,SAAS,EAAE;YACP,MAAM,YAAY,G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,IAAI,EAAE,EAAE,CAAC,UAAU,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,CAAgB;YACrF,WAAW,EAAE,CAAC,GAAG,EAAE,GAAG,IAAI,EAAE,EAAE,CAC1B,kBAAkB,CAAC;gBACf,GAAG;gBACH,IAAI;gBACJ,cAAc,EAAE,IAAI;aACvB,CAAgB;YACrB,cAAc,EAAE,CAAC,GAAG,EAAE,GAAG,IAAI,EAAE,EAAE,CAC7B,kBAAkB,CAAC;gBACf,GAAG;gBACH,IAAI;gBACJ,cAAc,EAAE,KAAK;aACxB,CAAW;SACnB,CAAC;IACN,CAAC;IAED,OAAO,EAAE,8BAA8B,EAAE,CAAC;AAC9C,CAAC"}
|
package/login/i18n/index.d.ts
CHANGED
@@ -1,2 +1,9 @@
|
|
1
|
-
export type {
|
2
|
-
|
1
|
+
export type { MessageKey, KcContextLike } from "./i18n";
|
2
|
+
import { createUseI18n } from "./i18n";
|
3
|
+
export { createUseI18n };
|
4
|
+
export { fallbackLanguageTag } from "./i18n";
|
5
|
+
declare const useI18n: (params: {
|
6
|
+
kcContext: import("./i18n").KcContextLike;
|
7
|
+
}) => import("./i18n").GenericI18n<"region" | "address" | "email" | "password" | "totpAppFreeOTPName" | "totpAppMicrosoftAuthenticatorName" | "totpAppGoogleName" | "doCancel" | "doLogIn" | "noAccessMessage" | "updatePasswordTitle" | "updatePasswordMessage" | "authenticatorCode" | "firstName" | "givenName" | "fullName" | "lastName" | "familyName" | "passwordConfirm" | "passwordNew" | "username" | "street" | "locality" | "postal_code" | "country" | "emailVerified" | "website" | "phoneNumber" | "phoneNumberVerified" | "gender" | "birthday" | "zoneinfo" | "gssDelegationCredential" | "profileScopeConsentText" | "emailScopeConsentText" | "addressScopeConsentText" | "phoneScopeConsentText" | "offlineAccessScopeConsentText" | "samlRoleListScopeConsentText" | "rolesScopeConsentText" | "role_admin" | "role_realm-admin" | "role_create-realm" | "role_view-realm" | "role_view-users" | "role_view-applications" | "role_view-clients" | "role_view-events" | "role_view-identity-providers" | "role_manage-realm" | "role_manage-users" | "role_manage-applications" | "role_manage-identity-providers" | "role_manage-clients" | "role_manage-events" | "role_view-profile" | "role_manage-account" | "role_manage-account-links" | "role_read-token" | "role_offline-access" | "client_account" | "client_account-console" | "client_security-admin-console" | "client_admin-cli" | "client_realm-management" | "client_broker" | "requiredFields" | "backToApplication" | "inResource" | "irreversibleAction" | "deletingImplies" | "errasingData" | "loggingOutImmediately" | "accountUnusable" | "missingUsernameMessage" | "missingFirstNameMessage" | "invalidEmailMessage" | "missingLastNameMessage" | "missingEmailMessage" | "missingPasswordMessage" | "notMatchPasswordMessage" | "invalidUserMessage" | "missingTotpMessage" | "missingTotpDeviceNameMessage" | "invalidPasswordExistingMessage" | "invalidPasswordConfirmMessage" | "invalidTotpMessage" | "usernameExistsMessage" | "emailExistsMessage" | "readOnlyUsernameMessage" | "accountUpdatedMessage" | "accountPasswordUpdatedMessage" | "identityProviderNotFoundMessage" | "identityProviderAlreadyLinkedMessage" | "consentDenied" | "access-denied-when-idp-auth" | "accountDisabledMessage" | "accountTemporarilyDisabledMessage" | "invalidPasswordMinLengthMessage" | "invalidPasswordMaxLengthMessage" | "invalidPasswordMinLowerCaseCharsMessage" | "invalidPasswordMinDigitsMessage" | "invalidPasswordMinUpperCaseCharsMessage" | "invalidPasswordMinSpecialCharsMessage" | "invalidPasswordNotUsernameMessage" | "invalidPasswordNotEmailMessage" | "invalidPasswordRegexPatternMessage" | "invalidPasswordHistoryMessage" | "invalidPasswordBlacklistedMessage" | "invalidPasswordGenericMessage" | "locale_ar" | "locale_ca" | "locale_cs" | "locale_de" | "locale_en" | "locale_es" | "locale_fr" | "locale_hu" | "locale_it" | "locale_ja" | "locale_lt" | "locale_nl" | "locale_no" | "locale_pl" | "locale_pt-BR" | "locale_ru" | "locale_sk" | "locale_sv" | "locale_th" | "locale_tr" | "locale_uk" | "locale_zh-CN" | "locale_fi" | "clientNotFoundMessage" | "openshift.scope.user_info" | "openshift.scope.user_check-access" | "openshift.scope.user_full" | "openshift.scope.list-projects" | "error-invalid-value" | "error-invalid-blank" | "error-empty" | "error-invalid-length" | "error-invalid-length-too-short" | "error-invalid-length-too-long" | "error-invalid-email" | "error-invalid-number" | "error-number-out-of-range" | "error-number-out-of-range-too-small" | "error-number-out-of-range-too-big" | "error-pattern-no-match" | "error-invalid-uri" | "error-invalid-uri-scheme" | "error-invalid-uri-fragment" | "error-user-attribute-required" | "error-invalid-date" | "error-user-attribute-read-only" | "error-username-invalid-character" | "error-person-name-invalid-character" | "remove" | "usb" | "nfc" | "bluetooth" | "doRegister" | "doRegisterSecurityKey" | "doSubmit" | "doBack" | "doYes" | "doNo" | "doContinue" | "doIgnore" | "doAccept" | "doDecline" | "doForgotPassword" | "doClickHere" | "doImpersonate" | "doTryAgain" | "doTryAnotherWay" | "doConfirmDelete" | "errorDeletingAccount" | "deletingAccountForbidden" | "kerberosNotConfigured" | "kerberosNotConfiguredTitle" | "bypassKerberosDetail" | "kerberosNotSetUp" | "registerTitle" | "loginAccountTitle" | "loginTitle" | "loginTitleHtml" | "impersonateTitle" | "impersonateTitleHtml" | "realmChoice" | "unknownUser" | "loginTotpTitle" | "loginProfileTitle" | "loginIdpReviewProfileTitle" | "loginTimeout" | "reauthenticate" | "authenticateStrong" | "oauthGrantTitle" | "oauthGrantTitleHtml" | "oauthGrantInformation" | "oauthGrantReview" | "oauthGrantTos" | "oauthGrantPolicy" | "errorTitle" | "errorTitleHtml" | "emailVerifyTitle" | "emailForgotTitle" | "updateEmailTitle" | "emailUpdateConfirmationSentTitle" | "emailUpdateConfirmationSent" | "emailUpdatedTitle" | "emailUpdated" | "codeSuccessTitle" | "codeErrorTitle" | "displayUnsupported" | "browserRequired" | "browserContinue" | "browserContinuePrompt" | "browserContinueAnswer" | "internal" | "unknown" | "termsTitle" | "termsText" | "termsPlainText" | "termsAcceptanceRequired" | "acceptTerms" | "deleteCredentialTitle" | "deleteCredentialMessage" | "recaptchaFailed" | "recaptchaNotConfigured" | "noAccount" | "usernameOrEmail" | "passwordNewConfirm" | "hidePassword" | "showPassword" | "rememberMe" | "logoutOtherSessions" | "restartLoginTooltip" | "loginTotpIntro" | "loginTotpStep1" | "loginTotpStep2" | "loginTotpStep3" | "loginTotpStep3DeviceName" | "loginTotpManualStep2" | "loginTotpManualStep3" | "loginTotpUnableToScan" | "loginTotpScanBarcode" | "loginCredential" | "loginOtpOneTime" | "loginTotpType" | "loginTotpAlgorithm" | "loginTotpDigits" | "loginTotpInterval" | "loginTotpCounter" | "loginTotpDeviceName" | "loginTotp.totp" | "loginTotp.hotp" | "loginChooseAuthenticator" | "oauthGrantRequest" | "oauth2DeviceVerificationTitle" | "verifyOAuth2DeviceUserCode" | "oauth2DeviceInvalidUserCodeMessage" | "oauth2DeviceExpiredUserCodeMessage" | "oauth2DeviceVerificationCompleteHeader" | "oauth2DeviceVerificationCompleteMessage" | "oauth2DeviceVerificationFailedHeader" | "oauth2DeviceVerificationFailedMessage" | "oauth2DeviceConsentDeniedMessage" | "oauth2DeviceAuthorizationGrantDisabledMessage" | "emailVerifyInstruction1" | "emailVerifyInstruction2" | "emailVerifyInstruction3" | "emailLinkIdpTitle" | "emailLinkIdp1" | "emailLinkIdp2" | "emailLinkIdp3" | "emailLinkIdp4" | "emailLinkIdp5" | "backToLogin" | "emailInstruction" | "emailInstructionUsername" | "copyCodeInstruction" | "pageExpiredTitle" | "pageExpiredMsg1" | "pageExpiredMsg2" | "personalInfo" | "role_create-client" | "invalidUsernameMessage" | "invalidUsernameOrEmailMessage" | "invalidPasswordMessage" | "expiredCodeMessage" | "expiredActionMessage" | "expiredActionTokenNoSessionMessage" | "expiredActionTokenSessionExistsMessage" | "sessionLimitExceeded" | "error-reset-otp-missing-id" | "federatedIdentityExistsMessage" | "federatedIdentityUnavailableMessage" | "federatedIdentityUnmatchedEssentialClaimMessage" | "confirmLinkIdpTitle" | "federatedIdentityConfirmLinkMessage" | "federatedIdentityConfirmReauthenticateMessage" | "nestedFirstBrokerFlowMessage" | "confirmLinkIdpReviewProfile" | "confirmLinkIdpContinue" | "configureTotpMessage" | "configureBackupCodesMessage" | "updateProfileMessage" | "updateEmailMessage" | "resetPasswordMessage" | "verifyEmailMessage" | "linkIdpMessage" | "emailSentMessage" | "emailSendErrorMessage" | "delegationCompleteHeader" | "delegationCompleteMessage" | "delegationFailedHeader" | "delegationFailedMessage" | "failedToProcessResponseMessage" | "httpsRequiredMessage" | "realmNotEnabledMessage" | "invalidRequestMessage" | "successLogout" | "failedLogout" | "unknownLoginRequesterMessage" | "loginRequesterNotEnabledMessage" | "bearerOnlyMessage" | "standardFlowDisabledMessage" | "implicitFlowDisabledMessage" | "invalidRedirectUriMessage" | "unsupportedNameIdFormatMessage" | "invalidRequesterMessage" | "registrationNotAllowedMessage" | "resetCredentialNotAllowedMessage" | "permissionNotApprovedMessage" | "noRelayStateInResponseMessage" | "insufficientPermissionMessage" | "couldNotProceedWithAuthenticationRequestMessage" | "couldNotObtainTokenMessage" | "unexpectedErrorRetrievingTokenMessage" | "unexpectedErrorHandlingResponseMessage" | "identityProviderAuthenticationFailedMessage" | "couldNotSendAuthenticationRequestMessage" | "unexpectedErrorHandlingRequestMessage" | "invalidAccessCodeMessage" | "sessionNotActiveMessage" | "invalidCodeMessage" | "cookieNotFoundMessage" | "insufficientLevelOfAuthentication" | "identityProviderUnexpectedErrorMessage" | "identityProviderMissingStateMessage" | "identityProviderMissingCodeOrErrorMessage" | "identityProviderInvalidResponseMessage" | "identityProviderInvalidSignatureMessage" | "identityProviderLinkSuccess" | "staleCodeMessage" | "realmSupportsNoCredentialsMessage" | "credentialSetupRequired" | "identityProviderNotUniqueMessage" | "emailVerifiedMessage" | "emailVerifiedAlreadyMessage" | "staleEmailVerificationLink" | "confirmAccountLinking" | "confirmEmailAddressVerification" | "confirmExecutionOfActions" | "locale_da" | "locale_lv" | "missingParameterMessage" | "clientDisabledMessage" | "invalidParameterMessage" | "alreadyLoggedIn" | "differentUserAuthenticated" | "brokerLinkingSessionExpired" | "proceedWithAction" | "acrNotFulfilled" | "requiredAction.CONFIGURE_TOTP" | "requiredAction.TERMS_AND_CONDITIONS" | "requiredAction.UPDATE_PASSWORD" | "requiredAction.UPDATE_PROFILE" | "requiredAction.VERIFY_EMAIL" | "requiredAction.CONFIGURE_RECOVERY_AUTHN_CODES" | "requiredAction.webauthn-register-passwordless" | "invalidTokenRequiredActions" | "doX509Login" | "clientCertificate" | "noCertificate" | "pageNotFound" | "internalServerError" | "console-username" | "console-password" | "console-otp" | "console-new-password" | "console-confirm-password" | "console-update-password" | "console-verify-email" | "console-email-code" | "console-accept-terms" | "console-accept" | "saml.post-form.title" | "saml.post-form.message" | "saml.post-form.js-disabled" | "saml.artifactResolutionServiceInvalidResponse" | "otp-display-name" | "otp-help-text" | "otp-reset-description" | "password-display-name" | "password-help-text" | "auth-username-form-display-name" | "auth-username-form-help-text" | "auth-username-password-form-display-name" | "auth-username-password-form-help-text" | "auth-recovery-authn-code-form-display-name" | "auth-recovery-authn-code-form-help-text" | "auth-recovery-code-info-message" | "auth-recovery-code-prompt" | "auth-recovery-code-header" | "recovery-codes-error-invalid" | "recovery-code-config-header" | "recovery-code-config-warning-title" | "recovery-code-config-warning-message" | "recovery-codes-print" | "recovery-codes-download" | "recovery-codes-copy" | "recovery-codes-copied" | "recovery-codes-confirmation-message" | "recovery-codes-action-complete" | "recovery-codes-action-cancel" | "recovery-codes-download-file-header" | "recovery-codes-download-file-description" | "recovery-codes-download-file-date" | "recovery-codes-label-default" | "webauthn-display-name" | "webauthn-help-text" | "webauthn-passwordless-display-name" | "webauthn-passwordless-help-text" | "webauthn-login-title" | "webauthn-registration-title" | "webauthn-available-authenticators" | "webauthn-unsupported-browser-text" | "webauthn-doAuthenticate" | "webauthn-createdAt-label" | "webauthn-error-title" | "webauthn-error-registration" | "webauthn-error-api-get" | "webauthn-error-different-user" | "webauthn-error-auth-verification" | "webauthn-error-register-verification" | "webauthn-error-user-not-found" | "identity-provider-redirector" | "identity-provider-login-label" | "idp-email-verification-display-name" | "idp-email-verification-help-text" | "idp-username-password-form-display-name" | "idp-username-password-form-help-text" | "finalDeletionConfirmation" | "deleteAccountConfirm" | "userDeletedSuccessfully" | "access-denied" | "frontchannel-logout.title" | "frontchannel-logout.message" | "logoutConfirmTitle" | "logoutConfirmHeader" | "doLogout" | "error-invalid-multivalued-size" | "shouldBeEqual" | "shouldBeDifferent" | "shouldMatchPattern" | "mustBeAnInteger" | "notAValidOption" | "selectAnOption" | "addValue" | "languages">, ofTypeI18n: import("./i18n").GenericI18n<"region" | "address" | "email" | "password" | "totpAppFreeOTPName" | "totpAppMicrosoftAuthenticatorName" | "totpAppGoogleName" | "doCancel" | "doLogIn" | "noAccessMessage" | "updatePasswordTitle" | "updatePasswordMessage" | "authenticatorCode" | "firstName" | "givenName" | "fullName" | "lastName" | "familyName" | "passwordConfirm" | "passwordNew" | "username" | "street" | "locality" | "postal_code" | "country" | "emailVerified" | "website" | "phoneNumber" | "phoneNumberVerified" | "gender" | "birthday" | "zoneinfo" | "gssDelegationCredential" | "profileScopeConsentText" | "emailScopeConsentText" | "addressScopeConsentText" | "phoneScopeConsentText" | "offlineAccessScopeConsentText" | "samlRoleListScopeConsentText" | "rolesScopeConsentText" | "role_admin" | "role_realm-admin" | "role_create-realm" | "role_view-realm" | "role_view-users" | "role_view-applications" | "role_view-clients" | "role_view-events" | "role_view-identity-providers" | "role_manage-realm" | "role_manage-users" | "role_manage-applications" | "role_manage-identity-providers" | "role_manage-clients" | "role_manage-events" | "role_view-profile" | "role_manage-account" | "role_manage-account-links" | "role_read-token" | "role_offline-access" | "client_account" | "client_account-console" | "client_security-admin-console" | "client_admin-cli" | "client_realm-management" | "client_broker" | "requiredFields" | "backToApplication" | "inResource" | "irreversibleAction" | "deletingImplies" | "errasingData" | "loggingOutImmediately" | "accountUnusable" | "missingUsernameMessage" | "missingFirstNameMessage" | "invalidEmailMessage" | "missingLastNameMessage" | "missingEmailMessage" | "missingPasswordMessage" | "notMatchPasswordMessage" | "invalidUserMessage" | "missingTotpMessage" | "missingTotpDeviceNameMessage" | "invalidPasswordExistingMessage" | "invalidPasswordConfirmMessage" | "invalidTotpMessage" | "usernameExistsMessage" | "emailExistsMessage" | "readOnlyUsernameMessage" | "accountUpdatedMessage" | "accountPasswordUpdatedMessage" | "identityProviderNotFoundMessage" | "identityProviderAlreadyLinkedMessage" | "consentDenied" | "access-denied-when-idp-auth" | "accountDisabledMessage" | "accountTemporarilyDisabledMessage" | "invalidPasswordMinLengthMessage" | "invalidPasswordMaxLengthMessage" | "invalidPasswordMinLowerCaseCharsMessage" | "invalidPasswordMinDigitsMessage" | "invalidPasswordMinUpperCaseCharsMessage" | "invalidPasswordMinSpecialCharsMessage" | "invalidPasswordNotUsernameMessage" | "invalidPasswordNotEmailMessage" | "invalidPasswordRegexPatternMessage" | "invalidPasswordHistoryMessage" | "invalidPasswordBlacklistedMessage" | "invalidPasswordGenericMessage" | "locale_ar" | "locale_ca" | "locale_cs" | "locale_de" | "locale_en" | "locale_es" | "locale_fr" | "locale_hu" | "locale_it" | "locale_ja" | "locale_lt" | "locale_nl" | "locale_no" | "locale_pl" | "locale_pt-BR" | "locale_ru" | "locale_sk" | "locale_sv" | "locale_th" | "locale_tr" | "locale_uk" | "locale_zh-CN" | "locale_fi" | "clientNotFoundMessage" | "openshift.scope.user_info" | "openshift.scope.user_check-access" | "openshift.scope.user_full" | "openshift.scope.list-projects" | "error-invalid-value" | "error-invalid-blank" | "error-empty" | "error-invalid-length" | "error-invalid-length-too-short" | "error-invalid-length-too-long" | "error-invalid-email" | "error-invalid-number" | "error-number-out-of-range" | "error-number-out-of-range-too-small" | "error-number-out-of-range-too-big" | "error-pattern-no-match" | "error-invalid-uri" | "error-invalid-uri-scheme" | "error-invalid-uri-fragment" | "error-user-attribute-required" | "error-invalid-date" | "error-user-attribute-read-only" | "error-username-invalid-character" | "error-person-name-invalid-character" | "remove" | "usb" | "nfc" | "bluetooth" | "doRegister" | "doRegisterSecurityKey" | "doSubmit" | "doBack" | "doYes" | "doNo" | "doContinue" | "doIgnore" | "doAccept" | "doDecline" | "doForgotPassword" | "doClickHere" | "doImpersonate" | "doTryAgain" | "doTryAnotherWay" | "doConfirmDelete" | "errorDeletingAccount" | "deletingAccountForbidden" | "kerberosNotConfigured" | "kerberosNotConfiguredTitle" | "bypassKerberosDetail" | "kerberosNotSetUp" | "registerTitle" | "loginAccountTitle" | "loginTitle" | "loginTitleHtml" | "impersonateTitle" | "impersonateTitleHtml" | "realmChoice" | "unknownUser" | "loginTotpTitle" | "loginProfileTitle" | "loginIdpReviewProfileTitle" | "loginTimeout" | "reauthenticate" | "authenticateStrong" | "oauthGrantTitle" | "oauthGrantTitleHtml" | "oauthGrantInformation" | "oauthGrantReview" | "oauthGrantTos" | "oauthGrantPolicy" | "errorTitle" | "errorTitleHtml" | "emailVerifyTitle" | "emailForgotTitle" | "updateEmailTitle" | "emailUpdateConfirmationSentTitle" | "emailUpdateConfirmationSent" | "emailUpdatedTitle" | "emailUpdated" | "codeSuccessTitle" | "codeErrorTitle" | "displayUnsupported" | "browserRequired" | "browserContinue" | "browserContinuePrompt" | "browserContinueAnswer" | "internal" | "unknown" | "termsTitle" | "termsText" | "termsPlainText" | "termsAcceptanceRequired" | "acceptTerms" | "deleteCredentialTitle" | "deleteCredentialMessage" | "recaptchaFailed" | "recaptchaNotConfigured" | "noAccount" | "usernameOrEmail" | "passwordNewConfirm" | "hidePassword" | "showPassword" | "rememberMe" | "logoutOtherSessions" | "restartLoginTooltip" | "loginTotpIntro" | "loginTotpStep1" | "loginTotpStep2" | "loginTotpStep3" | "loginTotpStep3DeviceName" | "loginTotpManualStep2" | "loginTotpManualStep3" | "loginTotpUnableToScan" | "loginTotpScanBarcode" | "loginCredential" | "loginOtpOneTime" | "loginTotpType" | "loginTotpAlgorithm" | "loginTotpDigits" | "loginTotpInterval" | "loginTotpCounter" | "loginTotpDeviceName" | "loginTotp.totp" | "loginTotp.hotp" | "loginChooseAuthenticator" | "oauthGrantRequest" | "oauth2DeviceVerificationTitle" | "verifyOAuth2DeviceUserCode" | "oauth2DeviceInvalidUserCodeMessage" | "oauth2DeviceExpiredUserCodeMessage" | "oauth2DeviceVerificationCompleteHeader" | "oauth2DeviceVerificationCompleteMessage" | "oauth2DeviceVerificationFailedHeader" | "oauth2DeviceVerificationFailedMessage" | "oauth2DeviceConsentDeniedMessage" | "oauth2DeviceAuthorizationGrantDisabledMessage" | "emailVerifyInstruction1" | "emailVerifyInstruction2" | "emailVerifyInstruction3" | "emailLinkIdpTitle" | "emailLinkIdp1" | "emailLinkIdp2" | "emailLinkIdp3" | "emailLinkIdp4" | "emailLinkIdp5" | "backToLogin" | "emailInstruction" | "emailInstructionUsername" | "copyCodeInstruction" | "pageExpiredTitle" | "pageExpiredMsg1" | "pageExpiredMsg2" | "personalInfo" | "role_create-client" | "invalidUsernameMessage" | "invalidUsernameOrEmailMessage" | "invalidPasswordMessage" | "expiredCodeMessage" | "expiredActionMessage" | "expiredActionTokenNoSessionMessage" | "expiredActionTokenSessionExistsMessage" | "sessionLimitExceeded" | "error-reset-otp-missing-id" | "federatedIdentityExistsMessage" | "federatedIdentityUnavailableMessage" | "federatedIdentityUnmatchedEssentialClaimMessage" | "confirmLinkIdpTitle" | "federatedIdentityConfirmLinkMessage" | "federatedIdentityConfirmReauthenticateMessage" | "nestedFirstBrokerFlowMessage" | "confirmLinkIdpReviewProfile" | "confirmLinkIdpContinue" | "configureTotpMessage" | "configureBackupCodesMessage" | "updateProfileMessage" | "updateEmailMessage" | "resetPasswordMessage" | "verifyEmailMessage" | "linkIdpMessage" | "emailSentMessage" | "emailSendErrorMessage" | "delegationCompleteHeader" | "delegationCompleteMessage" | "delegationFailedHeader" | "delegationFailedMessage" | "failedToProcessResponseMessage" | "httpsRequiredMessage" | "realmNotEnabledMessage" | "invalidRequestMessage" | "successLogout" | "failedLogout" | "unknownLoginRequesterMessage" | "loginRequesterNotEnabledMessage" | "bearerOnlyMessage" | "standardFlowDisabledMessage" | "implicitFlowDisabledMessage" | "invalidRedirectUriMessage" | "unsupportedNameIdFormatMessage" | "invalidRequesterMessage" | "registrationNotAllowedMessage" | "resetCredentialNotAllowedMessage" | "permissionNotApprovedMessage" | "noRelayStateInResponseMessage" | "insufficientPermissionMessage" | "couldNotProceedWithAuthenticationRequestMessage" | "couldNotObtainTokenMessage" | "unexpectedErrorRetrievingTokenMessage" | "unexpectedErrorHandlingResponseMessage" | "identityProviderAuthenticationFailedMessage" | "couldNotSendAuthenticationRequestMessage" | "unexpectedErrorHandlingRequestMessage" | "invalidAccessCodeMessage" | "sessionNotActiveMessage" | "invalidCodeMessage" | "cookieNotFoundMessage" | "insufficientLevelOfAuthentication" | "identityProviderUnexpectedErrorMessage" | "identityProviderMissingStateMessage" | "identityProviderMissingCodeOrErrorMessage" | "identityProviderInvalidResponseMessage" | "identityProviderInvalidSignatureMessage" | "identityProviderLinkSuccess" | "staleCodeMessage" | "realmSupportsNoCredentialsMessage" | "credentialSetupRequired" | "identityProviderNotUniqueMessage" | "emailVerifiedMessage" | "emailVerifiedAlreadyMessage" | "staleEmailVerificationLink" | "confirmAccountLinking" | "confirmEmailAddressVerification" | "confirmExecutionOfActions" | "locale_da" | "locale_lv" | "missingParameterMessage" | "clientDisabledMessage" | "invalidParameterMessage" | "alreadyLoggedIn" | "differentUserAuthenticated" | "brokerLinkingSessionExpired" | "proceedWithAction" | "acrNotFulfilled" | "requiredAction.CONFIGURE_TOTP" | "requiredAction.TERMS_AND_CONDITIONS" | "requiredAction.UPDATE_PASSWORD" | "requiredAction.UPDATE_PROFILE" | "requiredAction.VERIFY_EMAIL" | "requiredAction.CONFIGURE_RECOVERY_AUTHN_CODES" | "requiredAction.webauthn-register-passwordless" | "invalidTokenRequiredActions" | "doX509Login" | "clientCertificate" | "noCertificate" | "pageNotFound" | "internalServerError" | "console-username" | "console-password" | "console-otp" | "console-new-password" | "console-confirm-password" | "console-update-password" | "console-verify-email" | "console-email-code" | "console-accept-terms" | "console-accept" | "saml.post-form.title" | "saml.post-form.message" | "saml.post-form.js-disabled" | "saml.artifactResolutionServiceInvalidResponse" | "otp-display-name" | "otp-help-text" | "otp-reset-description" | "password-display-name" | "password-help-text" | "auth-username-form-display-name" | "auth-username-form-help-text" | "auth-username-password-form-display-name" | "auth-username-password-form-help-text" | "auth-recovery-authn-code-form-display-name" | "auth-recovery-authn-code-form-help-text" | "auth-recovery-code-info-message" | "auth-recovery-code-prompt" | "auth-recovery-code-header" | "recovery-codes-error-invalid" | "recovery-code-config-header" | "recovery-code-config-warning-title" | "recovery-code-config-warning-message" | "recovery-codes-print" | "recovery-codes-download" | "recovery-codes-copy" | "recovery-codes-copied" | "recovery-codes-confirmation-message" | "recovery-codes-action-complete" | "recovery-codes-action-cancel" | "recovery-codes-download-file-header" | "recovery-codes-download-file-description" | "recovery-codes-download-file-date" | "recovery-codes-label-default" | "webauthn-display-name" | "webauthn-help-text" | "webauthn-passwordless-display-name" | "webauthn-passwordless-help-text" | "webauthn-login-title" | "webauthn-registration-title" | "webauthn-available-authenticators" | "webauthn-unsupported-browser-text" | "webauthn-doAuthenticate" | "webauthn-createdAt-label" | "webauthn-error-title" | "webauthn-error-registration" | "webauthn-error-api-get" | "webauthn-error-different-user" | "webauthn-error-auth-verification" | "webauthn-error-register-verification" | "webauthn-error-user-not-found" | "identity-provider-redirector" | "identity-provider-login-label" | "idp-email-verification-display-name" | "idp-email-verification-help-text" | "idp-username-password-form-display-name" | "idp-username-password-form-help-text" | "finalDeletionConfirmation" | "deleteAccountConfirm" | "userDeletedSuccessfully" | "access-denied" | "frontchannel-logout.title" | "frontchannel-logout.message" | "logoutConfirmTitle" | "logoutConfirmHeader" | "doLogout" | "error-invalid-multivalued-size" | "shouldBeEqual" | "shouldBeDifferent" | "shouldMatchPattern" | "mustBeAnInteger" | "notAValidOption" | "selectAnOption" | "addValue" | "languages">;
|
8
|
+
export type I18n = typeof ofTypeI18n;
|
9
|
+
export { useI18n };
|
package/login/i18n/index.js
CHANGED
@@ -1,2 +1,6 @@
|
|
1
|
-
|
1
|
+
import { createUseI18n } from "./i18n";
|
2
|
+
export { createUseI18n };
|
3
|
+
export { fallbackLanguageTag } from "./i18n";
|
4
|
+
const { useI18n, ofTypeI18n } = createUseI18n({});
|
5
|
+
export { useI18n };
|
2
6
|
//# sourceMappingURL=index.js.map
|
package/login/i18n/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/login/i18n/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,QAAQ,CAAC"}
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/login/i18n/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,CAAC;AACzB,OAAO,EAAE,mBAAmB,EAAE,MAAM,QAAQ,CAAC;AAE7C,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,GAAG,aAAa,CAAC,EAAE,CAAC,CAAC;AAIlD,OAAO,EAAE,OAAO,EAAE,CAAC"}
|
package/login/index.d.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
1
|
export type { ExtendKcContext, Attribute } from "../login/KcContext";
|
2
|
-
export type {
|
2
|
+
export type { ClassKey } from "../login/TemplateProps";
|
3
3
|
export { useDownloadTerms } from "../login/lib/useDownloadTerms";
|
4
4
|
export { createUseI18n } from "../login/i18n";
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import type { ClassKey } from "../../login/TemplateProps";
|
2
|
+
export declare const getKcClsx: (params: {
|
3
|
+
doUseDefaultCss: boolean;
|
4
|
+
classes: Partial<Record<ClassKey, string>> | undefined;
|
5
|
+
}) => {
|
6
|
+
kcClsx: (...args: import("../../tools/clsx_withTransform").CxArg<ClassKey>[]) => string;
|
7
|
+
};
|
8
|
+
export type { ClassKey };
|
9
|
+
export type KcClsx = ReturnType<typeof getKcClsx>["kcClsx"];
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import {
|
2
|
-
export const {
|
1
|
+
import { createGetKcClsx } from "../../lib/getKcClsx";
|
2
|
+
export const { getKcClsx } = createGetKcClsx({
|
3
3
|
defaultClasses: {
|
4
4
|
kcHtmlClass: "login-pf",
|
5
5
|
kcBodyClass: undefined,
|
@@ -127,4 +127,4 @@ export const { useGetClassName } = createUseClassName({
|
|
127
127
|
kcLabelClass: "pf-c-form__label pf-c-form__label-text"
|
128
128
|
}
|
129
129
|
});
|
130
|
-
//# sourceMappingURL=
|
130
|
+
//# sourceMappingURL=kcClsx.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"kcClsx.js","sourceRoot":"","sources":["../../src/login/lib/kcClsx.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAG5D,MAAM,CAAC,MAAM,EAAE,SAAS,EAAE,GAAG,eAAe,CAAW;IACnD,cAAc,EAAE;QACZ,WAAW,EAAE,UAAU;QACvB,WAAW,EAAE,SAAS;QACtB,oBAAoB,EAAE,SAAS;QAC/B,oBAAoB,EAAE,SAAS;QAC/B,sBAAsB,EAAE,SAAS;QACjC,yBAAyB,EAAE,SAAS;QACpC,yBAAyB,EAAE,SAAS;QACpC,qBAAqB,EAAE,SAAS;QAChC,qBAAqB,EAAE,SAAS;QAChC,qBAAqB,EAAE,SAAS;QAChC,oBAAoB,EAAE,SAAS;QAE/B,oBAAoB,EAAE,gBAAgB;QACtC,uBAAuB,EAAE,mCAAmC;QAC5D,qBAAqB,EAAE,iBAAiB;QACxC,4BAA4B,EAAE,gCAAgC;QAC9D,qBAAqB,EAAE,mBAAmB;QAC1C,yBAAyB,EAAE,sBAAsB;QACjD,yBAAyB,EAAE,oDAAoD;QAC/E,qBAAqB,EAAE,eAAe;QACtC,6BAA6B,EAAE,mBAAmB;QAClD,iBAAiB,EAAE,0BAA0B;QA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AAmB;QACjC,gBAAgB,EAAE,YAAY;QAC9B,kBAAkB,EAAE,cAAc;QAClC,oBAAoB,EAAE,YAAY;QAClC,2BAA2B,EAAE,gCAAgC;QAC7D,gCAAgC,EAAE,iBAAiB;QACnD,sBAAsB,EAAE,mBAAmB;QAC3C,kCAAkC,EAC9B,mEAAmE;QACvE,yBAAyB,EAAE,mBAAmB;QAC9C,kBAAkB,EAAE,yCAAyC;QAC7D,iBAAiB,EAAE,iBAAiB;QACpC,2BAA2B,EAAE,iBAAiB;QAC9C,oBAAoB,EAAE,cAAc;QACpC,4BAA4B,EACxB,sDAAsD;QAC1D,kBAAkB,EAAE,cAAc;QAClC,YAAY,EAAE,wCAAwC;KACzD;CACJ,CAAC,CAAC"}
|
@@ -1,7 +1,8 @@
|
|
1
1
|
import "../../tools/Array.prototype.every";
|
2
2
|
import { type Dispatch } from "react";
|
3
|
-
import type {
|
4
|
-
import type {
|
3
|
+
import type { PasswordPolicies, Attribute, Validators } from "../../login/KcContext";
|
4
|
+
import type { KcContext } from "../KcContext";
|
5
|
+
import { KcContextLike as KcContextLike_i18n } from "../../login/i18n";
|
5
6
|
export type FormFieldError = {
|
6
7
|
errorMessage: JSX.Element;
|
7
8
|
errorMessageStr: string;
|
@@ -46,8 +47,7 @@ export type FormAction = {
|
|
46
47
|
name: string;
|
47
48
|
fieldIndex: number | undefined;
|
48
49
|
};
|
49
|
-
export type KcContextLike = {
|
50
|
-
messagesPerField: Pick<KcContext.Common["messagesPerField"], "existsError" | "get">;
|
50
|
+
export type KcContextLike = KcContextLike_i18n & KcContextLike_useGetErrors & {
|
51
51
|
profile: {
|
52
52
|
attributesByName: Record<string, Attribute>;
|
53
53
|
html5DataAnnotations?: Record<string, string>;
|
@@ -56,14 +56,12 @@ export type KcContextLike = {
|
|
56
56
|
realm: {
|
57
57
|
registrationEmailAsUsername: boolean;
|
58
58
|
};
|
59
|
-
passwordPolicies?: PasswordPolicies;
|
60
59
|
url: {
|
61
60
|
resourcesPath: string;
|
62
61
|
};
|
63
62
|
};
|
64
63
|
export type ParamsOfUseUserProfileForm = {
|
65
64
|
kcContext: KcContextLike;
|
66
|
-
i18n: I18n;
|
67
65
|
doMakeUserConfirmPassword: boolean;
|
68
66
|
};
|
69
67
|
export type ReturnTypeOfUseUserProfileForm = {
|
@@ -71,6 +69,10 @@ export type ReturnTypeOfUseUserProfileForm = {
|
|
71
69
|
dispatchFormAction: Dispatch<FormAction>;
|
72
70
|
};
|
73
71
|
export declare function useUserProfileForm(params: ParamsOfUseUserProfileForm): ReturnTypeOfUseUserProfileForm;
|
72
|
+
type KcContextLike_useGetErrors = KcContextLike_i18n & {
|
73
|
+
messagesPerField: Pick<KcContext["messagesPerField"], "existsError" | "get">;
|
74
|
+
passwordPolicies?: PasswordPolicies;
|
75
|
+
};
|
74
76
|
export declare function getButtonToDisplayForMultivaluedAttributeField(params: {
|
75
77
|
attribute: Attribute;
|
76
78
|
values: string[];
|
@@ -79,3 +81,4 @@ export declare function getButtonToDisplayForMultivaluedAttributeField(params: {
|
|
79
81
|
hasRemove: boolean;
|
80
82
|
hasAdd: boolean;
|
81
83
|
};
|
84
|
+
export {};
|
@@ -19,9 +19,11 @@ import { useConstCallback } from "../../tools/useConstCallback";
|
|
19
19
|
import { emailRegexp } from "../../tools/emailRegExp";
|
20
20
|
import { formatNumber } from "../../tools/formatNumber";
|
21
21
|
import { useInsertScriptTags } from "../../tools/useInsertScriptTags";
|
22
|
+
import { useI18n } from "../i18n";
|
23
|
+
assert();
|
22
24
|
export function useUserProfileForm(params) {
|
23
25
|
var _a, _b;
|
24
|
-
const { kcContext,
|
26
|
+
const { kcContext, doMakeUserConfirmPassword } = params;
|
25
27
|
const { insertScriptTags } = useInsertScriptTags({
|
26
28
|
componentOrHookName: "useUserProfileForm",
|
27
29
|
scriptTags: Object.keys((_b = (_a = kcContext.profile) === null || _a === void 0 ? void 0 : _a.html5DataAnnotations) !== null && _b !== void 0 ? _b : {})
|
@@ -35,8 +37,7 @@ export function useUserProfileForm(params) {
|
|
35
37
|
insertScriptTags();
|
36
38
|
}, []);
|
37
39
|
const { getErrors } = useGetErrors({
|
38
|
-
kcContext
|
39
|
-
i18n
|
40
|
+
kcContext
|
40
41
|
});
|
41
42
|
const initialState = useMemo(() => {
|
42
43
|
// NOTE: We don't use te kcContext.profile.attributes directly because
|
@@ -341,10 +342,11 @@ export function useUserProfileForm(params) {
|
|
341
342
|
dispatchFormAction
|
342
343
|
};
|
343
344
|
}
|
345
|
+
assert();
|
344
346
|
function useGetErrors(params) {
|
345
|
-
const { kcContext
|
347
|
+
const { kcContext } = params;
|
346
348
|
const { messagesPerField, passwordPolicies } = kcContext;
|
347
|
-
const { msg, msgStr, advancedMsg, advancedMsgStr } =
|
349
|
+
const { msg, msgStr, advancedMsg, advancedMsgStr } = useI18n({ kcContext });
|
348
350
|
const getErrors = useConstCallback((params) => {
|
349
351
|
var _a, _b;
|
350
352
|
const { attributeName, formFieldStates } = params;
|