keycloakify 9.6.6 → 10.0.0-rc.0
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/README.md +1 -1
- package/account/Template.js +34 -14
- package/account/Template.js.map +1 -1
- package/account/i18n/baseMessages/de.d.ts +1 -1
- package/account/i18n/baseMessages/de.js +1 -1
- package/account/i18n/baseMessages/de.js.map +1 -1
- package/account/i18n/baseMessages/en.d.ts +2 -0
- package/account/i18n/baseMessages/en.js +2 -0
- package/account/i18n/baseMessages/en.js.map +1 -1
- package/account/i18n/baseMessages/es.d.ts +230 -0
- package/account/i18n/baseMessages/es.js +231 -1
- package/account/i18n/baseMessages/es.js.map +1 -1
- package/account/i18n/baseMessages/index.d.ts +353 -407
- package/account/i18n/baseMessages/index.js +1 -0
- package/account/i18n/baseMessages/index.js.map +1 -1
- package/account/i18n/baseMessages/pl.d.ts +115 -1
- package/account/i18n/baseMessages/pl.js +115 -1
- package/account/i18n/baseMessages/pl.js.map +1 -1
- package/account/i18n/baseMessages/tr.d.ts +1 -1
- package/account/i18n/baseMessages/tr.js +1 -1
- package/account/i18n/baseMessages/tr.js.map +1 -1
- package/account/i18n/baseMessages/uk.d.ts +337 -0
- package/account/i18n/baseMessages/uk.js +342 -0
- package/account/i18n/baseMessages/uk.js.map +1 -0
- package/account/i18n/baseMessages/zh-CN.d.ts +10 -0
- package/account/i18n/baseMessages/zh-CN.js +10 -0
- package/account/i18n/baseMessages/zh-CN.js.map +1 -1
- package/bin/constants.d.ts +0 -1
- package/bin/constants.js +1 -2
- package/bin/constants.js.map +1 -1
- package/bin/download-builtin-keycloak-theme.js +12 -2
- package/bin/download-builtin-keycloak-theme.js.map +1 -1
- package/bin/keycloakify/buildJars/buildJar.d.ts +14 -0
- package/bin/keycloakify/buildJars/buildJar.js +216 -0
- package/bin/keycloakify/buildJars/buildJar.js.map +1 -0
- package/bin/keycloakify/buildJars/buildJars.d.ts +10 -0
- package/bin/keycloakify/buildJars/buildJars.js +95 -0
- package/bin/keycloakify/buildJars/buildJars.js.map +1 -0
- package/bin/keycloakify/buildJars/extensionVersions.d.ts +12 -0
- package/bin/keycloakify/buildJars/extensionVersions.js +7 -0
- package/bin/keycloakify/buildJars/extensionVersions.js.map +1 -0
- package/bin/keycloakify/buildJars/generatePom.d.ts +13 -0
- package/bin/keycloakify/buildJars/generatePom.js +94 -0
- package/bin/keycloakify/buildJars/generatePom.js.map +1 -0
- package/bin/keycloakify/buildJars/getKeycloakVersionRangeForJar.d.ts +6 -0
- package/bin/keycloakify/buildJars/getKeycloakVersionRangeForJar.js +35 -0
- package/bin/keycloakify/buildJars/getKeycloakVersionRangeForJar.js.map +1 -0
- package/bin/keycloakify/buildJars/index.d.ts +1 -0
- package/bin/keycloakify/buildJars/index.js +18 -0
- package/bin/keycloakify/buildJars/index.js.map +1 -0
- package/bin/keycloakify/buildOptions/UserProvidedBuildOptions.d.ts +0 -8
- package/bin/keycloakify/buildOptions/UserProvidedBuildOptions.js +1 -3
- package/bin/keycloakify/buildOptions/UserProvidedBuildOptions.js.map +1 -1
- package/bin/keycloakify/buildOptions/buildOptions.d.ts +0 -2
- package/bin/keycloakify/buildOptions/buildOptions.js +3 -5
- package/bin/keycloakify/buildOptions/buildOptions.js.map +1 -1
- package/bin/keycloakify/buildOptions/getNpmWorkspaceRootDirPath.js +1 -1
- package/bin/keycloakify/buildOptions/getNpmWorkspaceRootDirPath.js.map +1 -1
- package/bin/keycloakify/generateFtl/ftl_object_to_js_code_declaring_an_object.ftl +103 -232
- package/bin/keycloakify/generateFtl/generateFtl.js +17 -39
- package/bin/keycloakify/generateFtl/generateFtl.js.map +1 -1
- package/bin/keycloakify/generateFtl/pageId.d.ts +1 -1
- package/bin/keycloakify/generateFtl/pageId.js +11 -3
- package/bin/keycloakify/generateFtl/pageId.js.map +1 -1
- package/bin/keycloakify/generateStartKeycloakTestingContainer.d.ts +0 -1
- package/bin/keycloakify/generateStartKeycloakTestingContainer.js +3 -6
- package/bin/keycloakify/generateStartKeycloakTestingContainer.js.map +1 -1
- package/bin/keycloakify/generateTheme/bringInAccountV1.d.ts +1 -1
- package/bin/keycloakify/generateTheme/bringInAccountV1.js +5 -9
- package/bin/keycloakify/generateTheme/bringInAccountV1.js.map +1 -1
- package/bin/keycloakify/generateTheme/generateSrcMainResources.d.ts +21 -0
- package/bin/keycloakify/generateTheme/generateSrcMainResources.js +340 -0
- package/bin/keycloakify/generateTheme/generateSrcMainResources.js.map +1 -0
- package/bin/keycloakify/generateTheme/generateTheme.d.ts +5 -13
- package/bin/keycloakify/generateTheme/generateTheme.js +30 -293
- package/bin/keycloakify/generateTheme/generateTheme.js.map +1 -1
- package/bin/keycloakify/generateTheme/generateThemeVariants.d.ts +5 -0
- package/bin/keycloakify/generateTheme/generateThemeVariants.js +67 -0
- package/bin/keycloakify/generateTheme/generateThemeVariants.js.map +1 -0
- package/bin/keycloakify/generateTheme/readFieldNameUsage.js +54 -18
- package/bin/keycloakify/generateTheme/readFieldNameUsage.js.map +1 -1
- package/bin/keycloakify/keycloakify.js +28 -104
- package/bin/keycloakify/keycloakify.js.map +1 -1
- package/lib/useGetClassName.js +2 -2
- package/lib/useGetClassName.js.map +1 -1
- package/login/Fallback.d.ts +7 -1
- package/login/Fallback.js +32 -8
- package/login/Fallback.js.map +1 -1
- package/login/Template.js +76 -20
- package/login/Template.js.map +1 -1
- package/login/TemplateProps.d.ts +4 -2
- package/login/UserProfileFormFields.d.ts +22 -0
- package/login/UserProfileFormFields.js +327 -0
- package/login/UserProfileFormFields.js.map +1 -0
- package/login/i18n/baseMessages/ar.d.ts +3 -0
- package/login/i18n/baseMessages/ar.js +3 -0
- package/login/i18n/baseMessages/ar.js.map +1 -1
- package/login/i18n/baseMessages/ca.d.ts +1 -0
- package/login/i18n/baseMessages/ca.js +1 -0
- package/login/i18n/baseMessages/ca.js.map +1 -1
- package/login/i18n/baseMessages/cs.d.ts +3 -0
- package/login/i18n/baseMessages/cs.js +3 -0
- package/login/i18n/baseMessages/cs.js.map +1 -1
- package/login/i18n/baseMessages/da.d.ts +1 -0
- package/login/i18n/baseMessages/da.js +1 -0
- package/login/i18n/baseMessages/da.js.map +1 -1
- package/login/i18n/baseMessages/de.d.ts +1 -0
- package/login/i18n/baseMessages/de.js +1 -0
- package/login/i18n/baseMessages/de.js.map +1 -1
- package/login/i18n/baseMessages/el.d.ts +1 -0
- package/login/i18n/baseMessages/el.js +1 -0
- package/login/i18n/baseMessages/el.js.map +1 -1
- package/login/i18n/baseMessages/en.d.ts +7 -0
- package/login/i18n/baseMessages/en.js +23 -16
- package/login/i18n/baseMessages/en.js.map +1 -1
- package/login/i18n/baseMessages/es.d.ts +239 -0
- package/login/i18n/baseMessages/es.js +240 -1
- package/login/i18n/baseMessages/es.js.map +1 -1
- package/login/i18n/baseMessages/fa.d.ts +1 -0
- package/login/i18n/baseMessages/fa.js +1 -0
- package/login/i18n/baseMessages/fa.js.map +1 -1
- package/login/i18n/baseMessages/fi.d.ts +1 -0
- package/login/i18n/baseMessages/fi.js +1 -0
- package/login/i18n/baseMessages/fi.js.map +1 -1
- package/login/i18n/baseMessages/fr.d.ts +1 -0
- package/login/i18n/baseMessages/fr.js +2 -1
- package/login/i18n/baseMessages/fr.js.map +1 -1
- package/login/i18n/baseMessages/hu.d.ts +1 -0
- package/login/i18n/baseMessages/hu.js +1 -0
- package/login/i18n/baseMessages/hu.js.map +1 -1
- package/login/i18n/baseMessages/index.d.ts +211 -416
- package/login/i18n/baseMessages/index.js +1 -0
- package/login/i18n/baseMessages/index.js.map +1 -1
- package/login/i18n/baseMessages/it.d.ts +1 -0
- package/login/i18n/baseMessages/it.js +1 -0
- package/login/i18n/baseMessages/it.js.map +1 -1
- package/login/i18n/baseMessages/ja.d.ts +1 -0
- package/login/i18n/baseMessages/ja.js +1 -0
- package/login/i18n/baseMessages/ja.js.map +1 -1
- package/login/i18n/baseMessages/lt.d.ts +1 -0
- package/login/i18n/baseMessages/lt.js +1 -0
- package/login/i18n/baseMessages/lt.js.map +1 -1
- package/login/i18n/baseMessages/lv.d.ts +1 -0
- package/login/i18n/baseMessages/lv.js +1 -0
- package/login/i18n/baseMessages/lv.js.map +1 -1
- package/login/i18n/baseMessages/nl.d.ts +1 -0
- package/login/i18n/baseMessages/nl.js +1 -0
- package/login/i18n/baseMessages/nl.js.map +1 -1
- package/login/i18n/baseMessages/no.d.ts +1 -0
- package/login/i18n/baseMessages/no.js +1 -0
- package/login/i18n/baseMessages/no.js.map +1 -1
- package/login/i18n/baseMessages/pl.d.ts +1 -0
- package/login/i18n/baseMessages/pl.js +1 -0
- package/login/i18n/baseMessages/pl.js.map +1 -1
- package/login/i18n/baseMessages/pt-BR.d.ts +1 -0
- package/login/i18n/baseMessages/pt-BR.js +1 -0
- package/login/i18n/baseMessages/pt-BR.js.map +1 -1
- package/login/i18n/baseMessages/ru.d.ts +1 -0
- package/login/i18n/baseMessages/ru.js +1 -0
- package/login/i18n/baseMessages/ru.js.map +1 -1
- package/login/i18n/baseMessages/sk.d.ts +2 -0
- package/login/i18n/baseMessages/sk.js +3 -1
- package/login/i18n/baseMessages/sk.js.map +1 -1
- package/login/i18n/baseMessages/sv.d.ts +1 -0
- package/login/i18n/baseMessages/sv.js +1 -0
- package/login/i18n/baseMessages/sv.js.map +1 -1
- package/login/i18n/baseMessages/th.d.ts +1 -0
- package/login/i18n/baseMessages/th.js +1 -0
- package/login/i18n/baseMessages/th.js.map +1 -1
- package/login/i18n/baseMessages/tr.d.ts +1 -0
- package/login/i18n/baseMessages/tr.js +1 -0
- package/login/i18n/baseMessages/tr.js.map +1 -1
- package/login/i18n/baseMessages/uk.d.ts +433 -0
- package/login/i18n/baseMessages/uk.js +438 -0
- package/login/i18n/baseMessages/uk.js.map +1 -0
- package/login/i18n/baseMessages/zh-CN.d.ts +273 -3
- package/login/i18n/baseMessages/zh-CN.js +325 -55
- package/login/i18n/baseMessages/zh-CN.js.map +1 -1
- package/login/i18n/i18n.d.ts +4 -0
- package/login/i18n/i18n.js +6 -2
- package/login/i18n/i18n.js.map +1 -1
- package/login/kcContext/KcContext.d.ts +181 -105
- package/login/kcContext/KcContext.js +1 -1
- package/login/kcContext/KcContext.js.map +1 -1
- package/login/kcContext/createGetKcContext.js +3 -9
- package/login/kcContext/createGetKcContext.js.map +1 -1
- package/login/kcContext/kcContextMocks.d.ts +1 -1
- package/login/kcContext/kcContextMocks.js +92 -198
- package/login/kcContext/kcContextMocks.js.map +1 -1
- package/login/lib/useDownloadTerms.d.ts +4 -1
- package/login/lib/useDownloadTerms.js +9 -4
- package/login/lib/useDownloadTerms.js.map +1 -1
- package/login/lib/useGetClassName.js +112 -73
- package/login/lib/useGetClassName.js.map +1 -1
- package/login/lib/useUserProfileForm.d.ts +74 -0
- package/login/lib/useUserProfileForm.js +868 -0
- package/login/lib/useUserProfileForm.js.map +1 -0
- package/login/pages/{UpdateUserProfile.d.ts → Code.d.ts} +2 -2
- package/login/pages/Code.js +13 -0
- package/login/pages/Code.js.map +1 -0
- package/login/pages/DeleteAccountConfirm.d.ts +7 -0
- package/login/pages/DeleteAccountConfirm.js +14 -0
- package/login/pages/DeleteAccountConfirm.js.map +1 -0
- package/login/pages/{RegisterUserProfile.d.ts → DeleteCredential.d.ts} +2 -2
- package/login/pages/DeleteCredential.js +14 -0
- package/login/pages/DeleteCredential.js.map +1 -0
- package/login/pages/Error.js +2 -2
- package/login/pages/Error.js.map +1 -1
- package/login/pages/FrontchannelLogout.d.ts +7 -0
- package/login/pages/FrontchannelLogout.js +14 -0
- package/login/pages/FrontchannelLogout.js.map +1 -0
- package/login/pages/IdpReviewUserProfile.d.ts +8 -2
- package/login/pages/IdpReviewUserProfile.js +3 -4
- package/login/pages/IdpReviewUserProfile.js.map +1 -1
- package/login/pages/Info.js +14 -1
- package/login/pages/Info.js.map +1 -1
- package/login/pages/Login.js +24 -38
- package/login/pages/Login.js.map +1 -1
- package/login/pages/LoginConfigTotp.js +8 -1
- package/login/pages/LoginConfigTotp.js.map +1 -1
- package/login/pages/{LoginDeviceVerifyUserCode.d.ts → LoginOauth2DeviceVerifyUserCode.d.ts} +1 -1
- package/login/pages/{LoginDeviceVerifyUserCode.js → LoginOauth2DeviceVerifyUserCode.js} +2 -2
- package/login/pages/LoginOauth2DeviceVerifyUserCode.js.map +1 -0
- package/login/pages/LoginOauthGrant.js +3 -2
- package/login/pages/LoginOauthGrant.js.map +1 -1
- package/login/pages/LoginOtp.js +4 -6
- package/login/pages/LoginOtp.js.map +1 -1
- package/login/pages/LoginPageExpired.js +1 -1
- package/login/pages/LoginPageExpired.js.map +1 -1
- package/login/pages/LoginPassword.d.ts +1 -1
- package/login/pages/LoginPassword.js +18 -11
- package/login/pages/LoginPassword.js.map +1 -1
- package/login/pages/LoginRecoveryAuthnCodeConfig.d.ts +7 -0
- package/login/pages/LoginRecoveryAuthnCodeConfig.js +147 -0
- package/login/pages/LoginRecoveryAuthnCodeConfig.js.map +1 -0
- package/login/pages/LoginRecoveryAuthnCodeInput.d.ts +7 -0
- package/login/pages/LoginRecoveryAuthnCodeInput.js +14 -0
- package/login/pages/LoginRecoveryAuthnCodeInput.js.map +1 -0
- package/login/pages/LoginResetOtp.d.ts +7 -0
- package/login/pages/LoginResetOtp.js +15 -0
- package/login/pages/LoginResetOtp.js.map +1 -0
- package/login/pages/LoginResetPassword.js +4 -3
- package/login/pages/LoginResetPassword.js.map +1 -1
- package/login/pages/LoginUpdatePassword.js +21 -3
- package/login/pages/LoginUpdatePassword.js.map +1 -1
- package/login/pages/LoginUpdateProfile.d.ts +8 -2
- package/login/pages/LoginUpdateProfile.js +11 -5
- package/login/pages/LoginUpdateProfile.js.map +1 -1
- package/login/pages/LoginUsername.js +11 -35
- package/login/pages/LoginUsername.js.map +1 -1
- package/login/pages/LoginVerifyEmail.js +1 -1
- package/login/pages/LoginVerifyEmail.js.map +1 -1
- package/login/pages/LoginX509Info.d.ts +7 -0
- package/login/pages/LoginX509Info.js +14 -0
- package/login/pages/LoginX509Info.js.map +1 -0
- package/login/pages/LogoutConfirm.js +1 -1
- package/login/pages/LogoutConfirm.js.map +1 -1
- package/login/pages/Register.d.ts +8 -2
- package/login/pages/Register.js +26 -4
- package/login/pages/Register.js.map +1 -1
- package/login/pages/SamlPostForm.js +1 -1
- package/login/pages/SamlPostForm.js.map +1 -1
- package/login/pages/SelectAuthenticator.js +5 -21
- package/login/pages/SelectAuthenticator.js.map +1 -1
- package/login/pages/Terms.js +4 -6
- package/login/pages/Terms.js.map +1 -1
- package/login/pages/UpdateEmail.d.ts +8 -2
- package/login/pages/UpdateEmail.js +16 -5
- package/login/pages/UpdateEmail.js.map +1 -1
- package/login/pages/WebauthnAuthenticate.js +121 -83
- package/login/pages/WebauthnAuthenticate.js.map +1 -1
- package/login/pages/WebauthnError.d.ts +7 -0
- package/login/pages/WebauthnError.js +21 -0
- package/login/pages/WebauthnError.js.map +1 -0
- package/login/pages/WebauthnRegister.d.ts +7 -0
- package/login/pages/WebauthnRegister.js +193 -0
- package/login/pages/WebauthnRegister.js.map +1 -0
- package/package.json +138 -43
- package/src/account/Template.tsx +41 -14
- package/src/account/i18n/baseMessages/de.ts +1 -1
- package/src/account/i18n/baseMessages/en.ts +2 -0
- package/src/account/i18n/baseMessages/es.ts +231 -1
- package/src/account/i18n/baseMessages/index.ts +1 -0
- package/src/account/i18n/baseMessages/pl.ts +115 -1
- package/src/account/i18n/baseMessages/tr.ts +1 -1
- package/src/account/i18n/baseMessages/uk.ts +343 -0
- package/src/account/i18n/baseMessages/zh-CN.ts +10 -0
- package/src/bin/constants.ts +0 -1
- package/src/bin/download-builtin-keycloak-theme.ts +14 -1
- package/src/bin/keycloakify/buildJars/buildJar.ts +163 -0
- package/src/bin/keycloakify/buildJars/buildJars.ts +62 -0
- package/src/bin/keycloakify/buildJars/extensionVersions.ts +16 -0
- package/src/bin/keycloakify/buildJars/generatePom.ts +86 -0
- package/src/bin/keycloakify/buildJars/getKeycloakVersionRangeForJar.ts +37 -0
- package/src/bin/keycloakify/buildJars/index.ts +1 -0
- package/src/bin/keycloakify/buildOptions/UserProvidedBuildOptions.ts +1 -5
- package/src/bin/keycloakify/buildOptions/buildOptions.ts +1 -5
- package/src/bin/keycloakify/buildOptions/getNpmWorkspaceRootDirPath.ts +1 -1
- package/src/bin/keycloakify/generateFtl/ftl_object_to_js_code_declaring_an_object.ftl +103 -232
- package/src/bin/keycloakify/generateFtl/generateFtl.ts +15 -31
- package/src/bin/keycloakify/generateFtl/pageId.ts +11 -3
- package/src/bin/keycloakify/generateStartKeycloakTestingContainer.ts +4 -8
- package/src/bin/keycloakify/generateTheme/bringInAccountV1.ts +5 -11
- package/src/bin/keycloakify/generateTheme/generateSrcMainResources.ts +267 -0
- package/src/bin/keycloakify/generateTheme/generateTheme.ts +22 -309
- package/src/bin/keycloakify/generateTheme/generateThemeVariants.ts +50 -0
- package/src/bin/keycloakify/generateTheme/readFieldNameUsage.ts +33 -8
- package/src/bin/keycloakify/keycloakify.ts +23 -56
- package/src/lib/useGetClassName.ts +2 -2
- package/src/login/Fallback.tsx +39 -9
- package/src/login/Template.tsx +160 -61
- package/src/login/TemplateProps.ts +113 -63
- package/src/login/UserProfileFormFields.tsx +750 -0
- package/src/login/i18n/baseMessages/ar.ts +3 -0
- package/src/login/i18n/baseMessages/ca.ts +1 -0
- package/src/login/i18n/baseMessages/cs.ts +3 -0
- package/src/login/i18n/baseMessages/da.ts +1 -0
- package/src/login/i18n/baseMessages/de.ts +1 -0
- package/src/login/i18n/baseMessages/el.ts +1 -0
- package/src/login/i18n/baseMessages/en.ts +23 -16
- package/src/login/i18n/baseMessages/es.ts +240 -1
- package/src/login/i18n/baseMessages/fa.ts +1 -0
- package/src/login/i18n/baseMessages/fi.ts +1 -0
- package/src/login/i18n/baseMessages/fr.ts +2 -1
- package/src/login/i18n/baseMessages/hu.ts +1 -0
- package/src/login/i18n/baseMessages/index.ts +1 -0
- package/src/login/i18n/baseMessages/it.ts +1 -0
- package/src/login/i18n/baseMessages/ja.ts +1 -0
- package/src/login/i18n/baseMessages/lt.ts +1 -0
- package/src/login/i18n/baseMessages/lv.ts +1 -0
- package/src/login/i18n/baseMessages/nl.ts +1 -0
- package/src/login/i18n/baseMessages/no.ts +1 -0
- package/src/login/i18n/baseMessages/pl.ts +1 -0
- package/src/login/i18n/baseMessages/pt-BR.ts +1 -0
- package/src/login/i18n/baseMessages/ru.ts +1 -0
- package/src/login/i18n/baseMessages/sk.ts +3 -1
- package/src/login/i18n/baseMessages/sv.ts +1 -0
- package/src/login/i18n/baseMessages/th.ts +1 -0
- package/src/login/i18n/baseMessages/tr.ts +1 -0
- package/src/login/i18n/baseMessages/uk.ts +439 -0
- package/src/login/i18n/baseMessages/zh-CN.ts +325 -55
- package/src/login/i18n/i18n.tsx +6 -2
- package/src/login/kcContext/KcContext.ts +216 -103
- package/src/login/kcContext/createGetKcContext.ts +11 -19
- package/src/login/kcContext/kcContextMocks.ts +165 -226
- package/src/login/lib/useDownloadTerms.ts +15 -7
- package/src/login/lib/useGetClassName.ts +112 -83
- package/src/login/lib/useUserProfileForm.tsx +1227 -0
- package/src/login/pages/Code.tsx +35 -0
- package/src/login/pages/DeleteAccountConfirm.tsx +53 -0
- package/src/login/pages/DeleteCredential.tsx +45 -0
- package/src/login/pages/Error.tsx +2 -2
- package/src/login/pages/FrontchannelLogout.tsx +41 -0
- package/src/login/pages/IdpReviewUserProfile.tsx +15 -5
- package/src/login/pages/Info.tsx +29 -19
- package/src/login/pages/Login.tsx +156 -117
- package/src/login/pages/LoginConfigTotp.tsx +26 -1
- package/src/login/pages/{LoginDeviceVerifyUserCode.tsx → LoginOauth2DeviceVerifyUserCode.tsx} +3 -1
- package/src/login/pages/LoginOauthGrant.tsx +38 -2
- package/src/login/pages/LoginOtp.tsx +73 -65
- package/src/login/pages/LoginPageExpired.tsx +1 -1
- package/src/login/pages/LoginPassword.tsx +77 -28
- package/src/login/pages/LoginRecoveryAuthnCodeConfig.tsx +260 -0
- package/src/login/pages/LoginRecoveryAuthnCodeInput.tsx +73 -0
- package/src/login/pages/LoginResetOtp.tsx +70 -0
- package/src/login/pages/LoginResetPassword.tsx +11 -4
- package/src/login/pages/LoginUpdatePassword.tsx +120 -81
- package/src/login/pages/LoginUpdateProfile.tsx +41 -115
- package/src/login/pages/LoginUsername.tsx +93 -101
- package/src/login/pages/LoginVerifyEmail.tsx +14 -8
- package/src/login/pages/LoginX509Info.tsx +94 -0
- package/src/login/pages/LogoutConfirm.tsx +2 -2
- package/src/login/pages/Register.tsx +83 -131
- package/src/login/pages/SamlPostForm.tsx +1 -1
- package/src/login/pages/SelectAuthenticator.tsx +29 -52
- package/src/login/pages/Terms.tsx +4 -7
- package/src/login/pages/UpdateEmail.tsx +69 -54
- package/src/login/pages/WebauthnAuthenticate.tsx +205 -165
- package/src/login/pages/WebauthnError.tsx +66 -0
- package/src/login/pages/WebauthnRegister.tsx +285 -0
- package/src/tools/formatNumber.ts +48 -0
- package/src/tools/useInsertLinkTags.ts +82 -0
- package/src/tools/useInsertScriptTags.ts +106 -0
- package/src/tools/useSetClassName.ts +21 -0
- package/tools/formatNumber.d.ts +1 -0
- package/tools/formatNumber.js +37 -0
- package/tools/formatNumber.js.map +1 -0
- package/tools/useInsertLinkTags.d.ts +7 -0
- package/tools/useInsertLinkTags.js +57 -0
- package/tools/useInsertLinkTags.js.map +1 -0
- package/tools/useInsertScriptTags.d.ts +20 -0
- package/tools/useInsertScriptTags.js +75 -0
- package/tools/useInsertScriptTags.js.map +1 -0
- package/tools/useSetClassName.d.ts +4 -0
- package/tools/useSetClassName.js +16 -0
- package/tools/useSetClassName.js.map +1 -0
- package/vite-plugin/tsconfig.tsbuildinfo +1 -1
- package/bin/keycloakify/generatePom.d.ts +0 -12
- package/bin/keycloakify/generatePom.js +0 -59
- package/bin/keycloakify/generatePom.js.map +0 -1
- package/lib/usePrepareTemplate.d.ts +0 -11
- package/lib/usePrepareTemplate.js +0 -80
- package/lib/usePrepareTemplate.js.map +0 -1
- package/login/lib/useFormValidation.d.ts +0 -47
- package/login/lib/useFormValidation.js +0 -316
- package/login/lib/useFormValidation.js.map +0 -1
- package/login/pages/LoginDeviceVerifyUserCode.js.map +0 -1
- package/login/pages/RegisterUserProfile.js +0 -18
- package/login/pages/RegisterUserProfile.js.map +0 -1
- package/login/pages/UpdateUserProfile.js +0 -17
- package/login/pages/UpdateUserProfile.js.map +0 -1
- package/login/pages/shared/UserProfileFormFields.d.ts +0 -18
- package/login/pages/shared/UserProfileFormFields.js +0 -58
- package/login/pages/shared/UserProfileFormFields.js.map +0 -1
- package/src/bin/keycloakify/generatePom.ts +0 -70
- package/src/lib/usePrepareTemplate.ts +0 -113
- package/src/login/lib/useFormValidation.tsx +0 -474
- package/src/login/pages/RegisterUserProfile.tsx +0 -72
- package/src/login/pages/UpdateUserProfile.tsx +0 -82
- package/src/login/pages/shared/UserProfileFormFields.tsx +0 -177
- package/src/tools/headInsert.ts +0 -73
- package/tools/headInsert.d.ts +0 -12
- package/tools/headInsert.js +0 -50
- package/tools/headInsert.js.map +0 -1
@@ -1,331 +1,44 @@
|
|
1
|
-
import {
|
2
|
-
import * as fs from "fs";
|
3
|
-
import { join as pathJoin, basename as pathBasename, resolve as pathResolve, dirname as pathDirname } from "path";
|
4
|
-
import { replaceImportsInJsCode } from "../replacers/replaceImportsInJsCode";
|
5
|
-
import { replaceImportsInCssCode } from "../replacers/replaceImportsInCssCode";
|
6
|
-
import { generateFtlFilesCodeFactory, loginThemePageIds, accountThemePageIds } from "../generateFtl";
|
7
|
-
import {
|
8
|
-
type ThemeType,
|
9
|
-
lastKeycloakVersionWithAccountV1,
|
10
|
-
keycloak_resources,
|
11
|
-
retrocompatPostfix,
|
12
|
-
accountV1ThemeName,
|
13
|
-
basenameOfTheKeycloakifyResourcesDir
|
14
|
-
} from "../../constants";
|
15
|
-
import { isInside } from "../../tools/isInside";
|
1
|
+
import { join as pathJoin } from "path";
|
16
2
|
import type { BuildOptions } from "../buildOptions";
|
17
|
-
import { assert
|
18
|
-
import {
|
19
|
-
import {
|
20
|
-
import { readExtraPagesNames } from "./readExtraPageNames";
|
21
|
-
import { generateMessageProperties } from "./generateMessageProperties";
|
22
|
-
import { bringInAccountV1 } from "./bringInAccountV1";
|
23
|
-
import { rmSync } from "../../tools/fs.rmSync";
|
3
|
+
import { assert } from "tsafe/assert";
|
4
|
+
import { generateSrcMainResources, type BuildOptionsLike as BuildOptionsLike_generateSrcMainResources } from "./generateSrcMainResources";
|
5
|
+
import { generateThemeVariations } from "./generateThemeVariants";
|
24
6
|
|
25
|
-
export type BuildOptionsLike = {
|
26
|
-
bundler: "vite" | "webpack";
|
27
|
-
extraThemeProperties: string[] | undefined;
|
28
|
-
themeVersion: string;
|
29
|
-
loginThemeResourcesFromKeycloakVersion: string;
|
7
|
+
export type BuildOptionsLike = BuildOptionsLike_generateSrcMainResources & {
|
30
8
|
keycloakifyBuildDirPath: string;
|
31
|
-
reactAppBuildDirPath: string;
|
32
|
-
cacheDirPath: string;
|
33
|
-
assetsDirPath: string;
|
34
|
-
urlPathname: string | undefined;
|
35
|
-
doBuildRetrocompatAccountTheme: boolean;
|
36
9
|
themeNames: string[];
|
37
|
-
npmWorkspaceRootDirPath: string;
|
38
10
|
};
|
39
11
|
|
40
12
|
assert<BuildOptions extends BuildOptionsLike ? true : false>();
|
41
13
|
|
42
14
|
export async function generateTheme(params: {
|
43
|
-
themeName: string;
|
44
15
|
themeSrcDirPath: string;
|
45
16
|
keycloakifySrcDirPath: string;
|
46
17
|
buildOptions: BuildOptionsLike;
|
47
18
|
keycloakifyVersion: string;
|
48
|
-
}): Promise<
|
49
|
-
const {
|
19
|
+
}): Promise<{ doesImplementAccountTheme: boolean }> {
|
20
|
+
const { themeSrcDirPath, keycloakifySrcDirPath, buildOptions, keycloakifyVersion } = params;
|
50
21
|
|
51
|
-
const
|
52
|
-
const { themeType, isRetrocompat = false } = params;
|
53
|
-
return pathJoin(
|
54
|
-
buildOptions.keycloakifyBuildDirPath,
|
55
|
-
"src",
|
56
|
-
"main",
|
57
|
-
"resources",
|
58
|
-
"theme",
|
59
|
-
`${themeName}${isRetrocompat ? retrocompatPostfix : ""}`,
|
60
|
-
themeType
|
61
|
-
);
|
62
|
-
};
|
22
|
+
const [themeName, ...themeVariantNames] = buildOptions.themeNames;
|
63
23
|
|
64
|
-
const
|
24
|
+
const srcMainResourcesDirPath = pathJoin(buildOptions.keycloakifyBuildDirPath, "src", "main", "resources");
|
65
25
|
|
66
|
-
const
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
26
|
+
const { doesImplementAccountTheme } = await generateSrcMainResources({
|
27
|
+
themeName,
|
28
|
+
srcMainResourcesDirPath,
|
29
|
+
themeSrcDirPath,
|
30
|
+
keycloakifySrcDirPath,
|
31
|
+
keycloakifyVersion,
|
32
|
+
buildOptions
|
33
|
+
});
|
71
34
|
|
72
|
-
for (const
|
73
|
-
|
74
|
-
continue;
|
75
|
-
}
|
76
|
-
|
77
|
-
implementedThemeTypes[themeType] = true;
|
78
|
-
|
79
|
-
const themeTypeDirPath = getThemeTypeDirPath({ themeType });
|
80
|
-
|
81
|
-
apply_replacers_and_move_to_theme_resources: {
|
82
|
-
const destDirPath = pathJoin(themeTypeDirPath, "resources", basenameOfTheKeycloakifyResourcesDir);
|
83
|
-
|
84
|
-
// NOTE: Prevent accumulation of files in the assets dir, as names are hashed they pile up.
|
85
|
-
rmSync(destDirPath, { "recursive": true, "force": true });
|
86
|
-
|
87
|
-
if (themeType === "account" && implementedThemeTypes.login) {
|
88
|
-
// NOTE: We prevend doing it twice, it has been done for the login theme.
|
89
|
-
|
90
|
-
transformCodebase({
|
91
|
-
"srcDirPath": pathJoin(
|
92
|
-
getThemeTypeDirPath({
|
93
|
-
"themeType": "login"
|
94
|
-
}),
|
95
|
-
"resources",
|
96
|
-
basenameOfTheKeycloakifyResourcesDir
|
97
|
-
),
|
98
|
-
destDirPath
|
99
|
-
});
|
100
|
-
|
101
|
-
break apply_replacers_and_move_to_theme_resources;
|
102
|
-
}
|
103
|
-
|
104
|
-
transformCodebase({
|
105
|
-
"srcDirPath": buildOptions.reactAppBuildDirPath,
|
106
|
-
destDirPath,
|
107
|
-
"transformSourceCode": ({ filePath, sourceCode }) => {
|
108
|
-
//NOTE: Prevent cycles, excludes the folder we generated for debug in public/
|
109
|
-
// This should not happen if users follow the new instruction setup but we keep it for retrocompatibility.
|
110
|
-
if (
|
111
|
-
isInside({
|
112
|
-
"dirPath": pathJoin(buildOptions.reactAppBuildDirPath, keycloak_resources),
|
113
|
-
filePath
|
114
|
-
})
|
115
|
-
) {
|
116
|
-
return undefined;
|
117
|
-
}
|
118
|
-
|
119
|
-
if (/\.css?$/i.test(filePath)) {
|
120
|
-
const { cssGlobalsToDefine: cssGlobalsToDefineForThisFile, fixedCssCode } = replaceImportsInCssCode({
|
121
|
-
"cssCode": sourceCode.toString("utf8")
|
122
|
-
});
|
123
|
-
|
124
|
-
Object.entries(cssGlobalsToDefineForThisFile).forEach(([key, value]) => {
|
125
|
-
cssGlobalsToDefine[key] = value;
|
126
|
-
});
|
127
|
-
|
128
|
-
return { "modifiedSourceCode": Buffer.from(fixedCssCode, "utf8") };
|
129
|
-
}
|
130
|
-
|
131
|
-
if (/\.js?$/i.test(filePath)) {
|
132
|
-
const { fixedJsCode } = replaceImportsInJsCode({
|
133
|
-
"jsCode": sourceCode.toString("utf8"),
|
134
|
-
buildOptions
|
135
|
-
});
|
136
|
-
|
137
|
-
return { "modifiedSourceCode": Buffer.from(fixedJsCode, "utf8") };
|
138
|
-
}
|
139
|
-
|
140
|
-
return { "modifiedSourceCode": sourceCode };
|
141
|
-
}
|
142
|
-
});
|
143
|
-
}
|
144
|
-
|
145
|
-
const { generateFtlFilesCode } = generateFtlFilesCodeFactory({
|
35
|
+
for (const themeVariantName of themeVariantNames) {
|
36
|
+
generateThemeVariations({
|
146
37
|
themeName,
|
147
|
-
|
148
|
-
|
149
|
-
buildOptions,
|
150
|
-
keycloakifyVersion,
|
151
|
-
themeType,
|
152
|
-
"fieldNames": readFieldNameUsage({
|
153
|
-
keycloakifySrcDirPath,
|
154
|
-
themeSrcDirPath,
|
155
|
-
themeType
|
156
|
-
})
|
157
|
-
});
|
158
|
-
|
159
|
-
[
|
160
|
-
...(() => {
|
161
|
-
switch (themeType) {
|
162
|
-
case "login":
|
163
|
-
return loginThemePageIds;
|
164
|
-
case "account":
|
165
|
-
return accountThemePageIds;
|
166
|
-
}
|
167
|
-
})(),
|
168
|
-
...readExtraPagesNames({
|
169
|
-
themeType,
|
170
|
-
themeSrcDirPath
|
171
|
-
})
|
172
|
-
].forEach(pageId => {
|
173
|
-
const { ftlCode } = generateFtlFilesCode({ pageId });
|
174
|
-
|
175
|
-
fs.mkdirSync(themeTypeDirPath, { "recursive": true });
|
176
|
-
|
177
|
-
fs.writeFileSync(pathJoin(themeTypeDirPath, pageId), Buffer.from(ftlCode, "utf8"));
|
38
|
+
themeVariantName,
|
39
|
+
srcMainResourcesDirPath
|
178
40
|
});
|
179
|
-
|
180
|
-
generateMessageProperties({
|
181
|
-
themeSrcDirPath,
|
182
|
-
themeType
|
183
|
-
}).forEach(({ languageTag, propertiesFileSource }) => {
|
184
|
-
const messagesDirPath = pathJoin(themeTypeDirPath, "messages");
|
185
|
-
|
186
|
-
fs.mkdirSync(pathJoin(themeTypeDirPath, "messages"), { "recursive": true });
|
187
|
-
|
188
|
-
const propertiesFilePath = pathJoin(messagesDirPath, `messages_${languageTag}.properties`);
|
189
|
-
|
190
|
-
fs.writeFileSync(propertiesFilePath, Buffer.from(propertiesFileSource, "utf8"));
|
191
|
-
});
|
192
|
-
|
193
|
-
await downloadKeycloakStaticResources({
|
194
|
-
"keycloakVersion": (() => {
|
195
|
-
switch (themeType) {
|
196
|
-
case "account":
|
197
|
-
return lastKeycloakVersionWithAccountV1;
|
198
|
-
case "login":
|
199
|
-
return buildOptions.loginThemeResourcesFromKeycloakVersion;
|
200
|
-
}
|
201
|
-
})(),
|
202
|
-
"themeDirPath": pathResolve(pathJoin(themeTypeDirPath, "..")),
|
203
|
-
themeType,
|
204
|
-
buildOptions
|
205
|
-
});
|
206
|
-
|
207
|
-
fs.writeFileSync(
|
208
|
-
pathJoin(themeTypeDirPath, "theme.properties"),
|
209
|
-
Buffer.from(
|
210
|
-
[
|
211
|
-
`parent=${(() => {
|
212
|
-
switch (themeType) {
|
213
|
-
case "account":
|
214
|
-
return accountV1ThemeName;
|
215
|
-
case "login":
|
216
|
-
return "keycloak";
|
217
|
-
}
|
218
|
-
assert<Equals<typeof themeType, never>>(false);
|
219
|
-
})()}`,
|
220
|
-
...(buildOptions.extraThemeProperties ?? [])
|
221
|
-
].join("\n\n"),
|
222
|
-
"utf8"
|
223
|
-
)
|
224
|
-
);
|
225
|
-
|
226
|
-
if (themeType === "account" && buildOptions.doBuildRetrocompatAccountTheme) {
|
227
|
-
transformCodebase({
|
228
|
-
"srcDirPath": themeTypeDirPath,
|
229
|
-
"destDirPath": getThemeTypeDirPath({ themeType, "isRetrocompat": true }),
|
230
|
-
"transformSourceCode": ({ filePath, sourceCode }) => {
|
231
|
-
if (pathBasename(filePath) === "theme.properties") {
|
232
|
-
return {
|
233
|
-
"modifiedSourceCode": Buffer.from(
|
234
|
-
sourceCode.toString("utf8").replace(`parent=${accountV1ThemeName}`, "parent=keycloak"),
|
235
|
-
"utf8"
|
236
|
-
)
|
237
|
-
};
|
238
|
-
}
|
239
|
-
|
240
|
-
return { "modifiedSourceCode": sourceCode };
|
241
|
-
}
|
242
|
-
});
|
243
|
-
}
|
244
|
-
}
|
245
|
-
|
246
|
-
email: {
|
247
|
-
const emailThemeSrcDirPath = pathJoin(themeSrcDirPath, "email");
|
248
|
-
|
249
|
-
if (!fs.existsSync(emailThemeSrcDirPath)) {
|
250
|
-
break email;
|
251
|
-
}
|
252
|
-
|
253
|
-
implementedThemeTypes.email = true;
|
254
|
-
|
255
|
-
transformCodebase({
|
256
|
-
"srcDirPath": emailThemeSrcDirPath,
|
257
|
-
"destDirPath": getThemeTypeDirPath({ "themeType": "email" })
|
258
|
-
});
|
259
|
-
}
|
260
|
-
|
261
|
-
const parsedKeycloakThemeJson: { themes: { name: string; types: string[] }[] } = { "themes": [] };
|
262
|
-
|
263
|
-
buildOptions.themeNames.forEach(themeName =>
|
264
|
-
parsedKeycloakThemeJson.themes.push({
|
265
|
-
"name": themeName,
|
266
|
-
"types": Object.entries(implementedThemeTypes)
|
267
|
-
.filter(([, isImplemented]) => isImplemented)
|
268
|
-
.map(([themeType]) => themeType)
|
269
|
-
})
|
270
|
-
);
|
271
|
-
|
272
|
-
account_specific_extra_work: {
|
273
|
-
if (!implementedThemeTypes.account) {
|
274
|
-
break account_specific_extra_work;
|
275
|
-
}
|
276
|
-
|
277
|
-
await bringInAccountV1({ buildOptions });
|
278
|
-
|
279
|
-
parsedKeycloakThemeJson.themes.push({
|
280
|
-
"name": accountV1ThemeName,
|
281
|
-
"types": ["account"]
|
282
|
-
});
|
283
|
-
|
284
|
-
add_retrocompat_account_theme: {
|
285
|
-
if (!buildOptions.doBuildRetrocompatAccountTheme) {
|
286
|
-
break add_retrocompat_account_theme;
|
287
|
-
}
|
288
|
-
|
289
|
-
transformCodebase({
|
290
|
-
"srcDirPath": getThemeTypeDirPath({ "themeType": "account" }),
|
291
|
-
"destDirPath": getThemeTypeDirPath({ "themeType": "account", "isRetrocompat": true }),
|
292
|
-
"transformSourceCode": ({ filePath, sourceCode }) => {
|
293
|
-
if (pathBasename(filePath) === "theme.properties") {
|
294
|
-
return {
|
295
|
-
"modifiedSourceCode": Buffer.from(
|
296
|
-
sourceCode.toString("utf8").replace(`parent=${accountV1ThemeName}`, "parent=keycloak"),
|
297
|
-
"utf8"
|
298
|
-
)
|
299
|
-
};
|
300
|
-
}
|
301
|
-
|
302
|
-
return { "modifiedSourceCode": sourceCode };
|
303
|
-
}
|
304
|
-
});
|
305
|
-
|
306
|
-
buildOptions.themeNames.forEach(themeName =>
|
307
|
-
parsedKeycloakThemeJson.themes.push({
|
308
|
-
"name": `${themeName}${retrocompatPostfix}`,
|
309
|
-
"types": ["account"]
|
310
|
-
})
|
311
|
-
);
|
312
|
-
}
|
313
41
|
}
|
314
42
|
|
315
|
-
{
|
316
|
-
const keycloakThemeJsonFilePath = pathJoin(
|
317
|
-
buildOptions.keycloakifyBuildDirPath,
|
318
|
-
"src",
|
319
|
-
"main",
|
320
|
-
"resources",
|
321
|
-
"META-INF",
|
322
|
-
"keycloak-themes.json"
|
323
|
-
);
|
324
|
-
|
325
|
-
try {
|
326
|
-
fs.mkdirSync(pathDirname(keycloakThemeJsonFilePath));
|
327
|
-
} catch {}
|
328
|
-
|
329
|
-
fs.writeFileSync(keycloakThemeJsonFilePath, Buffer.from(JSON.stringify(parsedKeycloakThemeJson, null, 2), "utf8"));
|
330
|
-
}
|
43
|
+
return { doesImplementAccountTheme };
|
331
44
|
}
|
@@ -0,0 +1,50 @@
|
|
1
|
+
import { join as pathJoin, extname as pathExtname, sep as pathSep } from "path";
|
2
|
+
import { transformCodebase } from "../../tools/transformCodebase";
|
3
|
+
import { assert } from "tsafe/assert";
|
4
|
+
import * as fs from "fs";
|
5
|
+
|
6
|
+
export function generateThemeVariations(params: { themeName: string; themeVariantName: string; srcMainResourcesDirPath: string }) {
|
7
|
+
const { themeName, themeVariantName, srcMainResourcesDirPath } = params;
|
8
|
+
|
9
|
+
const mainThemeDirPath = pathJoin(srcMainResourcesDirPath, "theme", themeName);
|
10
|
+
|
11
|
+
transformCodebase({
|
12
|
+
"srcDirPath": mainThemeDirPath,
|
13
|
+
"destDirPath": pathJoin(mainThemeDirPath, themeVariantName),
|
14
|
+
"transformSourceCode": ({ fileRelativePath, sourceCode }) => {
|
15
|
+
if (pathExtname(fileRelativePath) === ".ftl" && fileRelativePath.split(pathSep).length === 2) {
|
16
|
+
const modifiedSourceCode = Buffer.from(
|
17
|
+
Buffer.from(sourceCode)
|
18
|
+
.toString("utf-8")
|
19
|
+
.replace(`out["themeName"] = "${themeName}";`, `out["themeName"] = "${themeVariantName}";`),
|
20
|
+
"utf8"
|
21
|
+
);
|
22
|
+
|
23
|
+
assert(Buffer.compare(modifiedSourceCode, sourceCode) !== 0);
|
24
|
+
|
25
|
+
return { modifiedSourceCode };
|
26
|
+
}
|
27
|
+
|
28
|
+
return { "modifiedSourceCode": sourceCode };
|
29
|
+
}
|
30
|
+
});
|
31
|
+
|
32
|
+
{
|
33
|
+
const keycloakThemeJsonFilePath = pathJoin(srcMainResourcesDirPath, "META-INF", "keycloak-themes.json");
|
34
|
+
|
35
|
+
const modifiedParsedJson = JSON.parse(fs.readFileSync(keycloakThemeJsonFilePath).toString("utf8")) as {
|
36
|
+
themes: { name: string; types: string[] }[];
|
37
|
+
};
|
38
|
+
|
39
|
+
modifiedParsedJson.themes.push({
|
40
|
+
"name": themeVariantName,
|
41
|
+
"types": (() => {
|
42
|
+
const theme = modifiedParsedJson.themes.find(({ name }) => name === themeName);
|
43
|
+
assert(theme !== undefined);
|
44
|
+
return theme.types;
|
45
|
+
})()
|
46
|
+
});
|
47
|
+
|
48
|
+
fs.writeFileSync(keycloakThemeJsonFilePath, Buffer.from(JSON.stringify(modifiedParsedJson, null, 2), "utf8"));
|
49
|
+
}
|
50
|
+
}
|
@@ -1,5 +1,4 @@
|
|
1
1
|
import { crawl } from "../../tools/crawl";
|
2
|
-
import { removeDuplicates } from "evt/tools/reducers/removeDuplicates";
|
3
2
|
import { join as pathJoin } from "path";
|
4
3
|
import * as fs from "fs";
|
5
4
|
import type { ThemeType } from "../../constants";
|
@@ -8,7 +7,7 @@ import type { ThemeType } from "../../constants";
|
|
8
7
|
export function readFieldNameUsage(params: { keycloakifySrcDirPath: string; themeSrcDirPath: string; themeType: ThemeType }): string[] {
|
9
8
|
const { keycloakifySrcDirPath, themeSrcDirPath, themeType } = params;
|
10
9
|
|
11
|
-
const fieldNames
|
10
|
+
const fieldNames = new Set<string>();
|
12
11
|
|
13
12
|
for (const srcDirPath of [pathJoin(keycloakifySrcDirPath, themeType), pathJoin(themeSrcDirPath, themeType)]) {
|
14
13
|
const filePaths = crawl({ "dirPath": srcDirPath, "returnedPathsType": "absolute" }).filter(filePath => /\.(ts|tsx|js|jsx)$/.test(filePath));
|
@@ -20,13 +19,39 @@ export function readFieldNameUsage(params: { keycloakifySrcDirPath: string; them
|
|
20
19
|
continue;
|
21
20
|
}
|
22
21
|
|
23
|
-
|
24
|
-
|
25
|
-
|
22
|
+
for (const functionName of ["printIfExists", "existsError", "get", "exists", "getFirstError"] as const) {
|
23
|
+
if (!rawSourceFile.includes(functionName)) {
|
24
|
+
continue;
|
25
|
+
}
|
26
|
+
|
27
|
+
try {
|
28
|
+
rawSourceFile
|
29
|
+
.split(functionName)
|
30
|
+
.filter(part => part.startsWith("("))
|
31
|
+
.map(part => {
|
32
|
+
let [p1] = part.split(")");
|
33
|
+
|
34
|
+
p1 = p1.slice(1);
|
35
|
+
|
36
|
+
return p1;
|
37
|
+
})
|
38
|
+
.map(part => {
|
39
|
+
console.log(part);
|
40
|
+
|
41
|
+
return part
|
42
|
+
.split(",")
|
43
|
+
.map(a => a.trim())
|
44
|
+
.filter((...[, i]) => (functionName !== "printIfExists" ? true : i === 0))
|
45
|
+
.filter(a => a.startsWith('"') || a.startsWith("'") || a.startsWith("`"))
|
46
|
+
.filter(a => a.endsWith('"') || a.endsWith("'") || a.endsWith("`"))
|
47
|
+
.map(a => a.slice(1).slice(0, -1));
|
48
|
+
})
|
49
|
+
.flat()
|
50
|
+
.forEach(fieldName => fieldNames.add(fieldName));
|
51
|
+
} catch {}
|
52
|
+
}
|
26
53
|
}
|
27
54
|
}
|
28
55
|
|
29
|
-
|
30
|
-
|
31
|
-
return out;
|
56
|
+
return Array.from(fieldNames);
|
32
57
|
}
|
@@ -1,6 +1,5 @@
|
|
1
1
|
import { generateTheme } from "./generateTheme";
|
2
|
-
import {
|
3
|
-
import { join as pathJoin, relative as pathRelative, basename as pathBasename, dirname as pathDirname, sep as pathSep } from "path";
|
2
|
+
import { join as pathJoin, relative as pathRelative, sep as pathSep } from "path";
|
4
3
|
import * as child_process from "child_process";
|
5
4
|
import { generateStartKeycloakTestingContainer } from "./generateStartKeycloakTestingContainer";
|
6
5
|
import * as fs from "fs";
|
@@ -10,6 +9,7 @@ import { getThemeSrcDirPath } from "../getThemeSrcDirPath";
|
|
10
9
|
import { getThisCodebaseRootDirPath } from "../tools/getThisCodebaseRootDirPath";
|
11
10
|
import { readThisNpmProjectVersion } from "../tools/readThisNpmProjectVersion";
|
12
11
|
import { keycloakifyBuildOptionsForPostPostBuildScriptEnvName } from "../constants";
|
12
|
+
import { buildJars } from "./buildJars";
|
13
13
|
|
14
14
|
export async function main() {
|
15
15
|
const buildOptions = readBuildOptions({
|
@@ -21,34 +21,21 @@ export async function main() {
|
|
21
21
|
|
22
22
|
const { themeSrcDirPath } = getThemeSrcDirPath({ "reactAppRootDirPath": buildOptions.reactAppRootDirPath });
|
23
23
|
|
24
|
-
for (const themeName of buildOptions.themeNames) {
|
25
|
-
await generateTheme({
|
26
|
-
themeName,
|
27
|
-
themeSrcDirPath,
|
28
|
-
"keycloakifySrcDirPath": pathJoin(getThisCodebaseRootDirPath(), "src"),
|
29
|
-
"keycloakifyVersion": readThisNpmProjectVersion(),
|
30
|
-
buildOptions
|
31
|
-
});
|
32
|
-
}
|
33
|
-
|
34
24
|
{
|
35
|
-
|
25
|
+
if (!fs.existsSync(buildOptions.keycloakifyBuildDirPath)) {
|
26
|
+
fs.mkdirSync(buildOptions.keycloakifyBuildDirPath, { "recursive": true });
|
27
|
+
}
|
36
28
|
|
37
|
-
fs.writeFileSync(pathJoin(buildOptions.keycloakifyBuildDirPath, "
|
29
|
+
fs.writeFileSync(pathJoin(buildOptions.keycloakifyBuildDirPath, ".gitignore"), Buffer.from("*", "utf8"));
|
38
30
|
}
|
39
31
|
|
40
|
-
const
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
generateStartKeycloakTestingContainer({
|
45
|
-
"keycloakVersion": containerKeycloakVersion,
|
46
|
-
jarFilePath,
|
32
|
+
const { doesImplementAccountTheme } = await generateTheme({
|
33
|
+
themeSrcDirPath,
|
34
|
+
"keycloakifySrcDirPath": pathJoin(getThisCodebaseRootDirPath(), "src"),
|
35
|
+
"keycloakifyVersion": readThisNpmProjectVersion(),
|
47
36
|
buildOptions
|
48
37
|
});
|
49
38
|
|
50
|
-
fs.writeFileSync(pathJoin(buildOptions.keycloakifyBuildDirPath, ".gitignore"), Buffer.from("*", "utf8"));
|
51
|
-
|
52
39
|
run_post_build_script: {
|
53
40
|
if (buildOptions.bundler !== "vite") {
|
54
41
|
break run_post_build_script;
|
@@ -63,44 +50,24 @@ export async function main() {
|
|
63
50
|
});
|
64
51
|
}
|
65
52
|
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
child_process.execSync("mvn clean install", { "cwd": buildOptions.keycloakifyBuildDirPath });
|
72
|
-
|
73
|
-
const jarDirPath = pathDirname(jarFilePath);
|
74
|
-
const retrocompatJarFilePath = pathJoin(jarDirPath, "retrocompat-" + pathBasename(jarFilePath));
|
75
|
-
|
76
|
-
fs.renameSync(pathJoin(jarDirPath, "original-" + pathBasename(jarFilePath)), retrocompatJarFilePath);
|
53
|
+
const { lastJarFileBasename } = await buildJars({
|
54
|
+
doesImplementAccountTheme,
|
55
|
+
buildOptions
|
56
|
+
});
|
77
57
|
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
`- The ${jarFilePath} is to be used in Keycloak 23 and up. `,
|
83
|
-
`- The ${retrocompatJarFilePath} is to be used in Keycloak 22 and below.`,
|
84
|
-
` Note that Keycloak 22 is only supported for login and email theme but not for account themes. `
|
85
|
-
].join("\n"),
|
86
|
-
"utf8"
|
87
|
-
)
|
88
|
-
);
|
89
|
-
}
|
58
|
+
generateStartKeycloakTestingContainer({
|
59
|
+
"jarFilePath": pathJoin(buildOptions.keycloakifyBuildDirPath, lastJarFileBasename),
|
60
|
+
buildOptions
|
61
|
+
});
|
90
62
|
|
91
63
|
logger.log(
|
92
64
|
[
|
65
|
+
`✅ Your keycloak theme has been generated and bundled into .${pathSep}${pathJoin(
|
66
|
+
pathRelative(buildOptions.reactAppRootDirPath, buildOptions.keycloakifyBuildDirPath),
|
67
|
+
"keycloak-theme-for-kc-*.jar"
|
68
|
+
)}`,
|
93
69
|
"",
|
94
|
-
|
95
|
-
? []
|
96
|
-
: [
|
97
|
-
`✅ Your keycloak theme has been generated and bundled into .${pathSep}${pathRelative(
|
98
|
-
buildOptions.reactAppRootDirPath,
|
99
|
-
jarFilePath
|
100
|
-
)} 🚀`
|
101
|
-
]),
|
102
|
-
"",
|
103
|
-
`To test your theme locally you can spin up a Keycloak ${containerKeycloakVersion} container image with the theme pre loaded by running:`,
|
70
|
+
`To test your theme locally you can spin up a Keycloak container image with the theme pre loaded by running:`,
|
104
71
|
"",
|
105
72
|
`👉 $ .${pathSep}${pathRelative(
|
106
73
|
buildOptions.reactAppRootDirPath,
|
@@ -5,10 +5,10 @@ export function createUseClassName<ClassKey extends string>(params: { defaultCla
|
|
5
5
|
const { defaultClasses } = params;
|
6
6
|
|
7
7
|
function useGetClassName(params: { doUseDefaultCss: boolean; classes: Partial<Record<ClassKey, string>> | undefined }) {
|
8
|
-
const { classes } = params;
|
8
|
+
const { classes, doUseDefaultCss } = params;
|
9
9
|
|
10
10
|
const getClassName = useConstCallback((classKey: ClassKey): string => {
|
11
|
-
return clsx(classKey, defaultClasses[classKey], classes?.[classKey]);
|
11
|
+
return clsx(classKey, doUseDefaultCss ? defaultClasses[classKey] : undefined, classes?.[classKey]);
|
12
12
|
});
|
13
13
|
|
14
14
|
return { getClassName };
|