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.
Files changed (424) hide show
  1. package/README.md +1 -1
  2. package/account/Template.js +34 -14
  3. package/account/Template.js.map +1 -1
  4. package/account/i18n/baseMessages/de.d.ts +1 -1
  5. package/account/i18n/baseMessages/de.js +1 -1
  6. package/account/i18n/baseMessages/de.js.map +1 -1
  7. package/account/i18n/baseMessages/en.d.ts +2 -0
  8. package/account/i18n/baseMessages/en.js +2 -0
  9. package/account/i18n/baseMessages/en.js.map +1 -1
  10. package/account/i18n/baseMessages/es.d.ts +230 -0
  11. package/account/i18n/baseMessages/es.js +231 -1
  12. package/account/i18n/baseMessages/es.js.map +1 -1
  13. package/account/i18n/baseMessages/index.d.ts +353 -407
  14. package/account/i18n/baseMessages/index.js +1 -0
  15. package/account/i18n/baseMessages/index.js.map +1 -1
  16. package/account/i18n/baseMessages/pl.d.ts +115 -1
  17. package/account/i18n/baseMessages/pl.js +115 -1
  18. package/account/i18n/baseMessages/pl.js.map +1 -1
  19. package/account/i18n/baseMessages/tr.d.ts +1 -1
  20. package/account/i18n/baseMessages/tr.js +1 -1
  21. package/account/i18n/baseMessages/tr.js.map +1 -1
  22. package/account/i18n/baseMessages/uk.d.ts +337 -0
  23. package/account/i18n/baseMessages/uk.js +342 -0
  24. package/account/i18n/baseMessages/uk.js.map +1 -0
  25. package/account/i18n/baseMessages/zh-CN.d.ts +10 -0
  26. package/account/i18n/baseMessages/zh-CN.js +10 -0
  27. package/account/i18n/baseMessages/zh-CN.js.map +1 -1
  28. package/bin/constants.d.ts +0 -1
  29. package/bin/constants.js +1 -2
  30. package/bin/constants.js.map +1 -1
  31. package/bin/download-builtin-keycloak-theme.js +12 -2
  32. package/bin/download-builtin-keycloak-theme.js.map +1 -1
  33. package/bin/keycloakify/buildJars/buildJar.d.ts +14 -0
  34. package/bin/keycloakify/buildJars/buildJar.js +216 -0
  35. package/bin/keycloakify/buildJars/buildJar.js.map +1 -0
  36. package/bin/keycloakify/buildJars/buildJars.d.ts +10 -0
  37. package/bin/keycloakify/buildJars/buildJars.js +95 -0
  38. package/bin/keycloakify/buildJars/buildJars.js.map +1 -0
  39. package/bin/keycloakify/buildJars/extensionVersions.d.ts +12 -0
  40. package/bin/keycloakify/buildJars/extensionVersions.js +7 -0
  41. package/bin/keycloakify/buildJars/extensionVersions.js.map +1 -0
  42. package/bin/keycloakify/buildJars/generatePom.d.ts +13 -0
  43. package/bin/keycloakify/buildJars/generatePom.js +94 -0
  44. package/bin/keycloakify/buildJars/generatePom.js.map +1 -0
  45. package/bin/keycloakify/buildJars/getKeycloakVersionRangeForJar.d.ts +6 -0
  46. package/bin/keycloakify/buildJars/getKeycloakVersionRangeForJar.js +35 -0
  47. package/bin/keycloakify/buildJars/getKeycloakVersionRangeForJar.js.map +1 -0
  48. package/bin/keycloakify/buildJars/index.d.ts +1 -0
  49. package/bin/keycloakify/buildJars/index.js +18 -0
  50. package/bin/keycloakify/buildJars/index.js.map +1 -0
  51. package/bin/keycloakify/buildOptions/UserProvidedBuildOptions.d.ts +0 -8
  52. package/bin/keycloakify/buildOptions/UserProvidedBuildOptions.js +1 -3
  53. package/bin/keycloakify/buildOptions/UserProvidedBuildOptions.js.map +1 -1
  54. package/bin/keycloakify/buildOptions/buildOptions.d.ts +0 -2
  55. package/bin/keycloakify/buildOptions/buildOptions.js +3 -5
  56. package/bin/keycloakify/buildOptions/buildOptions.js.map +1 -1
  57. package/bin/keycloakify/buildOptions/getNpmWorkspaceRootDirPath.js +1 -1
  58. package/bin/keycloakify/buildOptions/getNpmWorkspaceRootDirPath.js.map +1 -1
  59. package/bin/keycloakify/generateFtl/ftl_object_to_js_code_declaring_an_object.ftl +103 -232
  60. package/bin/keycloakify/generateFtl/generateFtl.js +17 -39
  61. package/bin/keycloakify/generateFtl/generateFtl.js.map +1 -1
  62. package/bin/keycloakify/generateFtl/pageId.d.ts +1 -1
  63. package/bin/keycloakify/generateFtl/pageId.js +11 -3
  64. package/bin/keycloakify/generateFtl/pageId.js.map +1 -1
  65. package/bin/keycloakify/generateStartKeycloakTestingContainer.d.ts +0 -1
  66. package/bin/keycloakify/generateStartKeycloakTestingContainer.js +3 -6
  67. package/bin/keycloakify/generateStartKeycloakTestingContainer.js.map +1 -1
  68. package/bin/keycloakify/generateTheme/bringInAccountV1.d.ts +1 -1
  69. package/bin/keycloakify/generateTheme/bringInAccountV1.js +5 -9
  70. package/bin/keycloakify/generateTheme/bringInAccountV1.js.map +1 -1
  71. package/bin/keycloakify/generateTheme/generateSrcMainResources.d.ts +21 -0
  72. package/bin/keycloakify/generateTheme/generateSrcMainResources.js +340 -0
  73. package/bin/keycloakify/generateTheme/generateSrcMainResources.js.map +1 -0
  74. package/bin/keycloakify/generateTheme/generateTheme.d.ts +5 -13
  75. package/bin/keycloakify/generateTheme/generateTheme.js +30 -293
  76. package/bin/keycloakify/generateTheme/generateTheme.js.map +1 -1
  77. package/bin/keycloakify/generateTheme/generateThemeVariants.d.ts +5 -0
  78. package/bin/keycloakify/generateTheme/generateThemeVariants.js +67 -0
  79. package/bin/keycloakify/generateTheme/generateThemeVariants.js.map +1 -0
  80. package/bin/keycloakify/generateTheme/readFieldNameUsage.js +54 -18
  81. package/bin/keycloakify/generateTheme/readFieldNameUsage.js.map +1 -1
  82. package/bin/keycloakify/keycloakify.js +28 -104
  83. package/bin/keycloakify/keycloakify.js.map +1 -1
  84. package/lib/useGetClassName.js +2 -2
  85. package/lib/useGetClassName.js.map +1 -1
  86. package/login/Fallback.d.ts +7 -1
  87. package/login/Fallback.js +32 -8
  88. package/login/Fallback.js.map +1 -1
  89. package/login/Template.js +76 -20
  90. package/login/Template.js.map +1 -1
  91. package/login/TemplateProps.d.ts +4 -2
  92. package/login/UserProfileFormFields.d.ts +22 -0
  93. package/login/UserProfileFormFields.js +327 -0
  94. package/login/UserProfileFormFields.js.map +1 -0
  95. package/login/i18n/baseMessages/ar.d.ts +3 -0
  96. package/login/i18n/baseMessages/ar.js +3 -0
  97. package/login/i18n/baseMessages/ar.js.map +1 -1
  98. package/login/i18n/baseMessages/ca.d.ts +1 -0
  99. package/login/i18n/baseMessages/ca.js +1 -0
  100. package/login/i18n/baseMessages/ca.js.map +1 -1
  101. package/login/i18n/baseMessages/cs.d.ts +3 -0
  102. package/login/i18n/baseMessages/cs.js +3 -0
  103. package/login/i18n/baseMessages/cs.js.map +1 -1
  104. package/login/i18n/baseMessages/da.d.ts +1 -0
  105. package/login/i18n/baseMessages/da.js +1 -0
  106. package/login/i18n/baseMessages/da.js.map +1 -1
  107. package/login/i18n/baseMessages/de.d.ts +1 -0
  108. package/login/i18n/baseMessages/de.js +1 -0
  109. package/login/i18n/baseMessages/de.js.map +1 -1
  110. package/login/i18n/baseMessages/el.d.ts +1 -0
  111. package/login/i18n/baseMessages/el.js +1 -0
  112. package/login/i18n/baseMessages/el.js.map +1 -1
  113. package/login/i18n/baseMessages/en.d.ts +7 -0
  114. package/login/i18n/baseMessages/en.js +23 -16
  115. package/login/i18n/baseMessages/en.js.map +1 -1
  116. package/login/i18n/baseMessages/es.d.ts +239 -0
  117. package/login/i18n/baseMessages/es.js +240 -1
  118. package/login/i18n/baseMessages/es.js.map +1 -1
  119. package/login/i18n/baseMessages/fa.d.ts +1 -0
  120. package/login/i18n/baseMessages/fa.js +1 -0
  121. package/login/i18n/baseMessages/fa.js.map +1 -1
  122. package/login/i18n/baseMessages/fi.d.ts +1 -0
  123. package/login/i18n/baseMessages/fi.js +1 -0
  124. package/login/i18n/baseMessages/fi.js.map +1 -1
  125. package/login/i18n/baseMessages/fr.d.ts +1 -0
  126. package/login/i18n/baseMessages/fr.js +2 -1
  127. package/login/i18n/baseMessages/fr.js.map +1 -1
  128. package/login/i18n/baseMessages/hu.d.ts +1 -0
  129. package/login/i18n/baseMessages/hu.js +1 -0
  130. package/login/i18n/baseMessages/hu.js.map +1 -1
  131. package/login/i18n/baseMessages/index.d.ts +211 -416
  132. package/login/i18n/baseMessages/index.js +1 -0
  133. package/login/i18n/baseMessages/index.js.map +1 -1
  134. package/login/i18n/baseMessages/it.d.ts +1 -0
  135. package/login/i18n/baseMessages/it.js +1 -0
  136. package/login/i18n/baseMessages/it.js.map +1 -1
  137. package/login/i18n/baseMessages/ja.d.ts +1 -0
  138. package/login/i18n/baseMessages/ja.js +1 -0
  139. package/login/i18n/baseMessages/ja.js.map +1 -1
  140. package/login/i18n/baseMessages/lt.d.ts +1 -0
  141. package/login/i18n/baseMessages/lt.js +1 -0
  142. package/login/i18n/baseMessages/lt.js.map +1 -1
  143. package/login/i18n/baseMessages/lv.d.ts +1 -0
  144. package/login/i18n/baseMessages/lv.js +1 -0
  145. package/login/i18n/baseMessages/lv.js.map +1 -1
  146. package/login/i18n/baseMessages/nl.d.ts +1 -0
  147. package/login/i18n/baseMessages/nl.js +1 -0
  148. package/login/i18n/baseMessages/nl.js.map +1 -1
  149. package/login/i18n/baseMessages/no.d.ts +1 -0
  150. package/login/i18n/baseMessages/no.js +1 -0
  151. package/login/i18n/baseMessages/no.js.map +1 -1
  152. package/login/i18n/baseMessages/pl.d.ts +1 -0
  153. package/login/i18n/baseMessages/pl.js +1 -0
  154. package/login/i18n/baseMessages/pl.js.map +1 -1
  155. package/login/i18n/baseMessages/pt-BR.d.ts +1 -0
  156. package/login/i18n/baseMessages/pt-BR.js +1 -0
  157. package/login/i18n/baseMessages/pt-BR.js.map +1 -1
  158. package/login/i18n/baseMessages/ru.d.ts +1 -0
  159. package/login/i18n/baseMessages/ru.js +1 -0
  160. package/login/i18n/baseMessages/ru.js.map +1 -1
  161. package/login/i18n/baseMessages/sk.d.ts +2 -0
  162. package/login/i18n/baseMessages/sk.js +3 -1
  163. package/login/i18n/baseMessages/sk.js.map +1 -1
  164. package/login/i18n/baseMessages/sv.d.ts +1 -0
  165. package/login/i18n/baseMessages/sv.js +1 -0
  166. package/login/i18n/baseMessages/sv.js.map +1 -1
  167. package/login/i18n/baseMessages/th.d.ts +1 -0
  168. package/login/i18n/baseMessages/th.js +1 -0
  169. package/login/i18n/baseMessages/th.js.map +1 -1
  170. package/login/i18n/baseMessages/tr.d.ts +1 -0
  171. package/login/i18n/baseMessages/tr.js +1 -0
  172. package/login/i18n/baseMessages/tr.js.map +1 -1
  173. package/login/i18n/baseMessages/uk.d.ts +433 -0
  174. package/login/i18n/baseMessages/uk.js +438 -0
  175. package/login/i18n/baseMessages/uk.js.map +1 -0
  176. package/login/i18n/baseMessages/zh-CN.d.ts +273 -3
  177. package/login/i18n/baseMessages/zh-CN.js +325 -55
  178. package/login/i18n/baseMessages/zh-CN.js.map +1 -1
  179. package/login/i18n/i18n.d.ts +4 -0
  180. package/login/i18n/i18n.js +6 -2
  181. package/login/i18n/i18n.js.map +1 -1
  182. package/login/kcContext/KcContext.d.ts +181 -105
  183. package/login/kcContext/KcContext.js +1 -1
  184. package/login/kcContext/KcContext.js.map +1 -1
  185. package/login/kcContext/createGetKcContext.js +3 -9
  186. package/login/kcContext/createGetKcContext.js.map +1 -1
  187. package/login/kcContext/kcContextMocks.d.ts +1 -1
  188. package/login/kcContext/kcContextMocks.js +92 -198
  189. package/login/kcContext/kcContextMocks.js.map +1 -1
  190. package/login/lib/useDownloadTerms.d.ts +4 -1
  191. package/login/lib/useDownloadTerms.js +9 -4
  192. package/login/lib/useDownloadTerms.js.map +1 -1
  193. package/login/lib/useGetClassName.js +112 -73
  194. package/login/lib/useGetClassName.js.map +1 -1
  195. package/login/lib/useUserProfileForm.d.ts +74 -0
  196. package/login/lib/useUserProfileForm.js +868 -0
  197. package/login/lib/useUserProfileForm.js.map +1 -0
  198. package/login/pages/{UpdateUserProfile.d.ts → Code.d.ts} +2 -2
  199. package/login/pages/Code.js +13 -0
  200. package/login/pages/Code.js.map +1 -0
  201. package/login/pages/DeleteAccountConfirm.d.ts +7 -0
  202. package/login/pages/DeleteAccountConfirm.js +14 -0
  203. package/login/pages/DeleteAccountConfirm.js.map +1 -0
  204. package/login/pages/{RegisterUserProfile.d.ts → DeleteCredential.d.ts} +2 -2
  205. package/login/pages/DeleteCredential.js +14 -0
  206. package/login/pages/DeleteCredential.js.map +1 -0
  207. package/login/pages/Error.js +2 -2
  208. package/login/pages/Error.js.map +1 -1
  209. package/login/pages/FrontchannelLogout.d.ts +7 -0
  210. package/login/pages/FrontchannelLogout.js +14 -0
  211. package/login/pages/FrontchannelLogout.js.map +1 -0
  212. package/login/pages/IdpReviewUserProfile.d.ts +8 -2
  213. package/login/pages/IdpReviewUserProfile.js +3 -4
  214. package/login/pages/IdpReviewUserProfile.js.map +1 -1
  215. package/login/pages/Info.js +14 -1
  216. package/login/pages/Info.js.map +1 -1
  217. package/login/pages/Login.js +24 -38
  218. package/login/pages/Login.js.map +1 -1
  219. package/login/pages/LoginConfigTotp.js +8 -1
  220. package/login/pages/LoginConfigTotp.js.map +1 -1
  221. package/login/pages/{LoginDeviceVerifyUserCode.d.ts → LoginOauth2DeviceVerifyUserCode.d.ts} +1 -1
  222. package/login/pages/{LoginDeviceVerifyUserCode.js → LoginOauth2DeviceVerifyUserCode.js} +2 -2
  223. package/login/pages/LoginOauth2DeviceVerifyUserCode.js.map +1 -0
  224. package/login/pages/LoginOauthGrant.js +3 -2
  225. package/login/pages/LoginOauthGrant.js.map +1 -1
  226. package/login/pages/LoginOtp.js +4 -6
  227. package/login/pages/LoginOtp.js.map +1 -1
  228. package/login/pages/LoginPageExpired.js +1 -1
  229. package/login/pages/LoginPageExpired.js.map +1 -1
  230. package/login/pages/LoginPassword.d.ts +1 -1
  231. package/login/pages/LoginPassword.js +18 -11
  232. package/login/pages/LoginPassword.js.map +1 -1
  233. package/login/pages/LoginRecoveryAuthnCodeConfig.d.ts +7 -0
  234. package/login/pages/LoginRecoveryAuthnCodeConfig.js +147 -0
  235. package/login/pages/LoginRecoveryAuthnCodeConfig.js.map +1 -0
  236. package/login/pages/LoginRecoveryAuthnCodeInput.d.ts +7 -0
  237. package/login/pages/LoginRecoveryAuthnCodeInput.js +14 -0
  238. package/login/pages/LoginRecoveryAuthnCodeInput.js.map +1 -0
  239. package/login/pages/LoginResetOtp.d.ts +7 -0
  240. package/login/pages/LoginResetOtp.js +15 -0
  241. package/login/pages/LoginResetOtp.js.map +1 -0
  242. package/login/pages/LoginResetPassword.js +4 -3
  243. package/login/pages/LoginResetPassword.js.map +1 -1
  244. package/login/pages/LoginUpdatePassword.js +21 -3
  245. package/login/pages/LoginUpdatePassword.js.map +1 -1
  246. package/login/pages/LoginUpdateProfile.d.ts +8 -2
  247. package/login/pages/LoginUpdateProfile.js +11 -5
  248. package/login/pages/LoginUpdateProfile.js.map +1 -1
  249. package/login/pages/LoginUsername.js +11 -35
  250. package/login/pages/LoginUsername.js.map +1 -1
  251. package/login/pages/LoginVerifyEmail.js +1 -1
  252. package/login/pages/LoginVerifyEmail.js.map +1 -1
  253. package/login/pages/LoginX509Info.d.ts +7 -0
  254. package/login/pages/LoginX509Info.js +14 -0
  255. package/login/pages/LoginX509Info.js.map +1 -0
  256. package/login/pages/LogoutConfirm.js +1 -1
  257. package/login/pages/LogoutConfirm.js.map +1 -1
  258. package/login/pages/Register.d.ts +8 -2
  259. package/login/pages/Register.js +26 -4
  260. package/login/pages/Register.js.map +1 -1
  261. package/login/pages/SamlPostForm.js +1 -1
  262. package/login/pages/SamlPostForm.js.map +1 -1
  263. package/login/pages/SelectAuthenticator.js +5 -21
  264. package/login/pages/SelectAuthenticator.js.map +1 -1
  265. package/login/pages/Terms.js +4 -6
  266. package/login/pages/Terms.js.map +1 -1
  267. package/login/pages/UpdateEmail.d.ts +8 -2
  268. package/login/pages/UpdateEmail.js +16 -5
  269. package/login/pages/UpdateEmail.js.map +1 -1
  270. package/login/pages/WebauthnAuthenticate.js +121 -83
  271. package/login/pages/WebauthnAuthenticate.js.map +1 -1
  272. package/login/pages/WebauthnError.d.ts +7 -0
  273. package/login/pages/WebauthnError.js +21 -0
  274. package/login/pages/WebauthnError.js.map +1 -0
  275. package/login/pages/WebauthnRegister.d.ts +7 -0
  276. package/login/pages/WebauthnRegister.js +193 -0
  277. package/login/pages/WebauthnRegister.js.map +1 -0
  278. package/package.json +138 -43
  279. package/src/account/Template.tsx +41 -14
  280. package/src/account/i18n/baseMessages/de.ts +1 -1
  281. package/src/account/i18n/baseMessages/en.ts +2 -0
  282. package/src/account/i18n/baseMessages/es.ts +231 -1
  283. package/src/account/i18n/baseMessages/index.ts +1 -0
  284. package/src/account/i18n/baseMessages/pl.ts +115 -1
  285. package/src/account/i18n/baseMessages/tr.ts +1 -1
  286. package/src/account/i18n/baseMessages/uk.ts +343 -0
  287. package/src/account/i18n/baseMessages/zh-CN.ts +10 -0
  288. package/src/bin/constants.ts +0 -1
  289. package/src/bin/download-builtin-keycloak-theme.ts +14 -1
  290. package/src/bin/keycloakify/buildJars/buildJar.ts +163 -0
  291. package/src/bin/keycloakify/buildJars/buildJars.ts +62 -0
  292. package/src/bin/keycloakify/buildJars/extensionVersions.ts +16 -0
  293. package/src/bin/keycloakify/buildJars/generatePom.ts +86 -0
  294. package/src/bin/keycloakify/buildJars/getKeycloakVersionRangeForJar.ts +37 -0
  295. package/src/bin/keycloakify/buildJars/index.ts +1 -0
  296. package/src/bin/keycloakify/buildOptions/UserProvidedBuildOptions.ts +1 -5
  297. package/src/bin/keycloakify/buildOptions/buildOptions.ts +1 -5
  298. package/src/bin/keycloakify/buildOptions/getNpmWorkspaceRootDirPath.ts +1 -1
  299. package/src/bin/keycloakify/generateFtl/ftl_object_to_js_code_declaring_an_object.ftl +103 -232
  300. package/src/bin/keycloakify/generateFtl/generateFtl.ts +15 -31
  301. package/src/bin/keycloakify/generateFtl/pageId.ts +11 -3
  302. package/src/bin/keycloakify/generateStartKeycloakTestingContainer.ts +4 -8
  303. package/src/bin/keycloakify/generateTheme/bringInAccountV1.ts +5 -11
  304. package/src/bin/keycloakify/generateTheme/generateSrcMainResources.ts +267 -0
  305. package/src/bin/keycloakify/generateTheme/generateTheme.ts +22 -309
  306. package/src/bin/keycloakify/generateTheme/generateThemeVariants.ts +50 -0
  307. package/src/bin/keycloakify/generateTheme/readFieldNameUsage.ts +33 -8
  308. package/src/bin/keycloakify/keycloakify.ts +23 -56
  309. package/src/lib/useGetClassName.ts +2 -2
  310. package/src/login/Fallback.tsx +39 -9
  311. package/src/login/Template.tsx +160 -61
  312. package/src/login/TemplateProps.ts +113 -63
  313. package/src/login/UserProfileFormFields.tsx +750 -0
  314. package/src/login/i18n/baseMessages/ar.ts +3 -0
  315. package/src/login/i18n/baseMessages/ca.ts +1 -0
  316. package/src/login/i18n/baseMessages/cs.ts +3 -0
  317. package/src/login/i18n/baseMessages/da.ts +1 -0
  318. package/src/login/i18n/baseMessages/de.ts +1 -0
  319. package/src/login/i18n/baseMessages/el.ts +1 -0
  320. package/src/login/i18n/baseMessages/en.ts +23 -16
  321. package/src/login/i18n/baseMessages/es.ts +240 -1
  322. package/src/login/i18n/baseMessages/fa.ts +1 -0
  323. package/src/login/i18n/baseMessages/fi.ts +1 -0
  324. package/src/login/i18n/baseMessages/fr.ts +2 -1
  325. package/src/login/i18n/baseMessages/hu.ts +1 -0
  326. package/src/login/i18n/baseMessages/index.ts +1 -0
  327. package/src/login/i18n/baseMessages/it.ts +1 -0
  328. package/src/login/i18n/baseMessages/ja.ts +1 -0
  329. package/src/login/i18n/baseMessages/lt.ts +1 -0
  330. package/src/login/i18n/baseMessages/lv.ts +1 -0
  331. package/src/login/i18n/baseMessages/nl.ts +1 -0
  332. package/src/login/i18n/baseMessages/no.ts +1 -0
  333. package/src/login/i18n/baseMessages/pl.ts +1 -0
  334. package/src/login/i18n/baseMessages/pt-BR.ts +1 -0
  335. package/src/login/i18n/baseMessages/ru.ts +1 -0
  336. package/src/login/i18n/baseMessages/sk.ts +3 -1
  337. package/src/login/i18n/baseMessages/sv.ts +1 -0
  338. package/src/login/i18n/baseMessages/th.ts +1 -0
  339. package/src/login/i18n/baseMessages/tr.ts +1 -0
  340. package/src/login/i18n/baseMessages/uk.ts +439 -0
  341. package/src/login/i18n/baseMessages/zh-CN.ts +325 -55
  342. package/src/login/i18n/i18n.tsx +6 -2
  343. package/src/login/kcContext/KcContext.ts +216 -103
  344. package/src/login/kcContext/createGetKcContext.ts +11 -19
  345. package/src/login/kcContext/kcContextMocks.ts +165 -226
  346. package/src/login/lib/useDownloadTerms.ts +15 -7
  347. package/src/login/lib/useGetClassName.ts +112 -83
  348. package/src/login/lib/useUserProfileForm.tsx +1227 -0
  349. package/src/login/pages/Code.tsx +35 -0
  350. package/src/login/pages/DeleteAccountConfirm.tsx +53 -0
  351. package/src/login/pages/DeleteCredential.tsx +45 -0
  352. package/src/login/pages/Error.tsx +2 -2
  353. package/src/login/pages/FrontchannelLogout.tsx +41 -0
  354. package/src/login/pages/IdpReviewUserProfile.tsx +15 -5
  355. package/src/login/pages/Info.tsx +29 -19
  356. package/src/login/pages/Login.tsx +156 -117
  357. package/src/login/pages/LoginConfigTotp.tsx +26 -1
  358. package/src/login/pages/{LoginDeviceVerifyUserCode.tsx → LoginOauth2DeviceVerifyUserCode.tsx} +3 -1
  359. package/src/login/pages/LoginOauthGrant.tsx +38 -2
  360. package/src/login/pages/LoginOtp.tsx +73 -65
  361. package/src/login/pages/LoginPageExpired.tsx +1 -1
  362. package/src/login/pages/LoginPassword.tsx +77 -28
  363. package/src/login/pages/LoginRecoveryAuthnCodeConfig.tsx +260 -0
  364. package/src/login/pages/LoginRecoveryAuthnCodeInput.tsx +73 -0
  365. package/src/login/pages/LoginResetOtp.tsx +70 -0
  366. package/src/login/pages/LoginResetPassword.tsx +11 -4
  367. package/src/login/pages/LoginUpdatePassword.tsx +120 -81
  368. package/src/login/pages/LoginUpdateProfile.tsx +41 -115
  369. package/src/login/pages/LoginUsername.tsx +93 -101
  370. package/src/login/pages/LoginVerifyEmail.tsx +14 -8
  371. package/src/login/pages/LoginX509Info.tsx +94 -0
  372. package/src/login/pages/LogoutConfirm.tsx +2 -2
  373. package/src/login/pages/Register.tsx +83 -131
  374. package/src/login/pages/SamlPostForm.tsx +1 -1
  375. package/src/login/pages/SelectAuthenticator.tsx +29 -52
  376. package/src/login/pages/Terms.tsx +4 -7
  377. package/src/login/pages/UpdateEmail.tsx +69 -54
  378. package/src/login/pages/WebauthnAuthenticate.tsx +205 -165
  379. package/src/login/pages/WebauthnError.tsx +66 -0
  380. package/src/login/pages/WebauthnRegister.tsx +285 -0
  381. package/src/tools/formatNumber.ts +48 -0
  382. package/src/tools/useInsertLinkTags.ts +82 -0
  383. package/src/tools/useInsertScriptTags.ts +106 -0
  384. package/src/tools/useSetClassName.ts +21 -0
  385. package/tools/formatNumber.d.ts +1 -0
  386. package/tools/formatNumber.js +37 -0
  387. package/tools/formatNumber.js.map +1 -0
  388. package/tools/useInsertLinkTags.d.ts +7 -0
  389. package/tools/useInsertLinkTags.js +57 -0
  390. package/tools/useInsertLinkTags.js.map +1 -0
  391. package/tools/useInsertScriptTags.d.ts +20 -0
  392. package/tools/useInsertScriptTags.js +75 -0
  393. package/tools/useInsertScriptTags.js.map +1 -0
  394. package/tools/useSetClassName.d.ts +4 -0
  395. package/tools/useSetClassName.js +16 -0
  396. package/tools/useSetClassName.js.map +1 -0
  397. package/vite-plugin/tsconfig.tsbuildinfo +1 -1
  398. package/bin/keycloakify/generatePom.d.ts +0 -12
  399. package/bin/keycloakify/generatePom.js +0 -59
  400. package/bin/keycloakify/generatePom.js.map +0 -1
  401. package/lib/usePrepareTemplate.d.ts +0 -11
  402. package/lib/usePrepareTemplate.js +0 -80
  403. package/lib/usePrepareTemplate.js.map +0 -1
  404. package/login/lib/useFormValidation.d.ts +0 -47
  405. package/login/lib/useFormValidation.js +0 -316
  406. package/login/lib/useFormValidation.js.map +0 -1
  407. package/login/pages/LoginDeviceVerifyUserCode.js.map +0 -1
  408. package/login/pages/RegisterUserProfile.js +0 -18
  409. package/login/pages/RegisterUserProfile.js.map +0 -1
  410. package/login/pages/UpdateUserProfile.js +0 -17
  411. package/login/pages/UpdateUserProfile.js.map +0 -1
  412. package/login/pages/shared/UserProfileFormFields.d.ts +0 -18
  413. package/login/pages/shared/UserProfileFormFields.js +0 -58
  414. package/login/pages/shared/UserProfileFormFields.js.map +0 -1
  415. package/src/bin/keycloakify/generatePom.ts +0 -70
  416. package/src/lib/usePrepareTemplate.ts +0 -113
  417. package/src/login/lib/useFormValidation.tsx +0 -474
  418. package/src/login/pages/RegisterUserProfile.tsx +0 -72
  419. package/src/login/pages/UpdateUserProfile.tsx +0 -82
  420. package/src/login/pages/shared/UserProfileFormFields.tsx +0 -177
  421. package/src/tools/headInsert.ts +0 -73
  422. package/tools/headInsert.d.ts +0 -12
  423. package/tools/headInsert.js +0 -50
  424. package/tools/headInsert.js.map +0 -1
@@ -1,331 +1,44 @@
1
- import { transformCodebase } from "../../tools/transformCodebase";
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, type Equals } from "tsafe/assert";
18
- import { downloadKeycloakStaticResources } from "./downloadKeycloakStaticResources";
19
- import { readFieldNameUsage } from "./readFieldNameUsage";
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<void> {
49
- const { themeName, themeSrcDirPath, keycloakifySrcDirPath, buildOptions, keycloakifyVersion } = params;
19
+ }): Promise<{ doesImplementAccountTheme: boolean }> {
20
+ const { themeSrcDirPath, keycloakifySrcDirPath, buildOptions, keycloakifyVersion } = params;
50
21
 
51
- const getThemeTypeDirPath = (params: { themeType: ThemeType | "email"; isRetrocompat?: true }) => {
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 cssGlobalsToDefine: Record<string, string> = {};
24
+ const srcMainResourcesDirPath = pathJoin(buildOptions.keycloakifyBuildDirPath, "src", "main", "resources");
65
25
 
66
- const implementedThemeTypes: Record<ThemeType | "email", boolean> = {
67
- "login": false,
68
- "account": false,
69
- "email": false
70
- };
26
+ const { doesImplementAccountTheme } = await generateSrcMainResources({
27
+ themeName,
28
+ srcMainResourcesDirPath,
29
+ themeSrcDirPath,
30
+ keycloakifySrcDirPath,
31
+ keycloakifyVersion,
32
+ buildOptions
33
+ });
71
34
 
72
- for (const themeType of ["login", "account"] as const) {
73
- if (!fs.existsSync(pathJoin(themeSrcDirPath, themeType))) {
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
- "indexHtmlCode": fs.readFileSync(pathJoin(buildOptions.reactAppBuildDirPath, "index.html")).toString("utf8"),
148
- cssGlobalsToDefine,
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: string[] = [];
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
- fieldNames.push(
24
- ...Array.from(rawSourceFile.matchAll(/(?:(?:printIfExists)|(?:existsError)|(?:get)|(?:exists))\(\s*["']([^"']+)["']/g), m => m[1])
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
- const out = fieldNames.reduce(...removeDuplicates<string>());
30
-
31
- return out;
56
+ return Array.from(fieldNames);
32
57
  }
@@ -1,6 +1,5 @@
1
1
  import { generateTheme } from "./generateTheme";
2
- import { generatePom } from "./generatePom";
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
- const { pomFileCode } = generatePom({ buildOptions });
25
+ if (!fs.existsSync(buildOptions.keycloakifyBuildDirPath)) {
26
+ fs.mkdirSync(buildOptions.keycloakifyBuildDirPath, { "recursive": true });
27
+ }
36
28
 
37
- fs.writeFileSync(pathJoin(buildOptions.keycloakifyBuildDirPath, "pom.xml"), Buffer.from(pomFileCode, "utf8"));
29
+ fs.writeFileSync(pathJoin(buildOptions.keycloakifyBuildDirPath, ".gitignore"), Buffer.from("*", "utf8"));
38
30
  }
39
31
 
40
- const containerKeycloakVersion = "23.0.6";
41
-
42
- const jarFilePath = pathJoin(buildOptions.keycloakifyBuildDirPath, "target", `${buildOptions.artifactId}-${buildOptions.themeVersion}.jar`);
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
- create_jar: {
67
- if (!buildOptions.doCreateJar) {
68
- break create_jar;
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
- fs.writeFileSync(
79
- pathJoin(jarDirPath, "README.md"),
80
- Buffer.from(
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
- ...(!buildOptions.doCreateJar
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 };