Compare commits

...

5 Commits

Author SHA1 Message Date
ef9c933ca8 Relase candidate 2024-06-05 18:42:50 +02:00
0461190a67 Do not export default the Fallback component 2024-06-05 18:42:32 +02:00
06b3211b08 Ease up the instentiation of i18n 2024-06-05 18:41:53 +02:00
2033a9ce0c Release candidate 2024-06-05 18:15:25 +02:00
fca18d9209 Add missing file to the NPM bundle 2024-06-05 18:15:13 +02:00
5 changed files with 12 additions and 11 deletions

View File

@ -1,6 +1,6 @@
{
"name": "keycloakify",
"version": "10.0.0-rc.24",
"version": "10.0.0-rc.26",
"description": "Create Keycloak themes using React",
"repository": {
"type": "git",
@ -46,6 +46,7 @@
"dist/bin/shared/constants.js.map",
"!dist/vite-plugin/",
"dist/vite-plugin/index.d.ts",
"dist/vite-plugin/vite-plugin.d.ts",
"dist/vite-plugin/index.js"
],
"keywords": [

View File

@ -4,6 +4,7 @@ import fallbackMessages from "./baseMessages/en";
import { getMessages } from "./baseMessages";
import { assert } from "tsafe/assert";
import type { KcContext } from "../kcContext/KcContext";
import { Reflect } from "tsafe/Reflect";
export const fallbackLanguageTag = "en";
@ -137,7 +138,10 @@ export function createUseI18n<ExtraMessageKey extends string = never>(extraMessa
return i18n ?? null;
}
return { useI18n };
return {
useI18n,
ofTypeI18n: Reflect<GenericI18n<MessageKey | ExtraMessageKey>>()
};
}
function createI18nTranslationFunctions<MessageKey extends string>(params: {

View File

@ -1,7 +1,3 @@
import Fallback from "keycloakify/account/Fallback";
export default Fallback;
export type { AccountThemePageId as PageId } from "keycloakify/bin/shared/constants";
export { createUseI18n } from "keycloakify/account/i18n/i18n";
export type { ExtendKcContext } from "keycloakify/account/kcContext";

View File

@ -4,6 +4,7 @@ import fallbackMessages from "./baseMessages/en";
import { getMessages } from "./baseMessages";
import { assert } from "tsafe/assert";
import type { KcContext } from "../kcContext/KcContext";
import { Reflect } from "tsafe/Reflect";
export const fallbackLanguageTag = "en";
@ -139,7 +140,10 @@ export function createUseI18n<ExtraMessageKey extends string = never>(extraMessa
return i18n ?? null;
}
return { useI18n };
return {
useI18n,
ofTypeI18n: Reflect<GenericI18n<MessageKey | ExtraMessageKey>>()
};
}
function createI18nTranslationFunctions<MessageKey extends string>(params: {

View File

@ -1,7 +1,3 @@
import Fallback from "keycloakify/login/Fallback";
export default Fallback;
export { useDownloadTerms } from "keycloakify/login/lib/useDownloadTerms";
export { createUseI18n } from "keycloakify/login/i18n/i18n";
export type {