diff --git a/src/KcApp.tsx b/src/KcApp.tsx index 813d5354..4b6c2671 100644 --- a/src/KcApp.tsx +++ b/src/KcApp.tsx @@ -1,7 +1,7 @@ import React, { lazy, Suspense } from "react"; import { __unsafe_useI18n as useI18n } from "./i18n"; import DefaultTemplate from "./Template"; -import type { KcContextBase } from "./getKcContext/KcContextBase"; +import type { KcContextBase } from "./kcContext/KcContextBase"; import type { PageProps } from "./KcProps"; import type { I18nBase } from "./i18n"; import type { SetOptional } from "./tools/SetOptional"; diff --git a/src/KcProps.ts b/src/KcProps.ts index d80f7a80..21a3e40c 100644 --- a/src/KcProps.ts +++ b/src/KcProps.ts @@ -1,6 +1,6 @@ import { allPropertiesValuesToUndefined } from "./tools/allPropertiesValuesToUndefined"; import { assert } from "tsafe/assert"; -import type { KcContextBase } from "./getKcContext"; +import type { KcContextBase } from "./kcContext"; import type { ReactNode } from "react"; import { I18nBase } from "./i18n"; diff --git a/src/Template.tsx b/src/Template.tsx index 2442b1a6..e8894044 100644 --- a/src/Template.tsx +++ b/src/Template.tsx @@ -4,7 +4,7 @@ import { headInsert } from "./tools/headInsert"; import { pathJoin } from "./bin/tools/pathJoin"; import { clsx } from "./tools/clsx"; import type { TemplateProps } from "./KcProps"; -import type { KcContextBase } from "./getKcContext/KcContextBase"; +import type { KcContextBase } from "./kcContext/KcContextBase"; import type { I18nBase } from "./i18n"; export default function Template(props: TemplateProps) { diff --git a/src/i18n/i18n.tsx b/src/i18n/i18n.tsx index 788831b6..cf1f9dde 100644 --- a/src/i18n/i18n.tsx +++ b/src/i18n/i18n.tsx @@ -3,7 +3,7 @@ import "minimal-polyfills/Object.fromEntries"; import React, { useEffect, useState, useRef } from "react"; import type baseMessages from "./generated_messages/18.0.1/login/en"; import { assert } from "tsafe/assert"; -import type { KcContextBase } from "../getKcContext/KcContextBase"; +import type { KcContextBase } from "../kcContext/KcContextBase"; import { Markdown } from "../tools/Markdown"; export const fallbackLanguageTag = "en"; diff --git a/src/index.ts b/src/index.ts index 014e0acb..0ec02a50 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,4 +1,4 @@ -export * from "./getKcContext"; +export * from "./kcContext"; export * from "./i18n"; diff --git a/src/getKcContext/KcContextBase.ts b/src/kcContext/KcContextBase.ts similarity index 100% rename from src/getKcContext/KcContextBase.ts rename to src/kcContext/KcContextBase.ts diff --git a/src/getKcContext/getKcContext.ts b/src/kcContext/getKcContext.ts similarity index 100% rename from src/getKcContext/getKcContext.ts rename to src/kcContext/getKcContext.ts diff --git a/src/getKcContext/getKcContextFromWindow.ts b/src/kcContext/getKcContextFromWindow.ts similarity index 100% rename from src/getKcContext/getKcContextFromWindow.ts rename to src/kcContext/getKcContextFromWindow.ts diff --git a/src/getKcContext/index.ts b/src/kcContext/index.ts similarity index 100% rename from src/getKcContext/index.ts rename to src/kcContext/index.ts diff --git a/src/getKcContext/kcContextMocks.ts b/src/kcContext/kcContextMocks.ts similarity index 100% rename from src/getKcContext/kcContextMocks.ts rename to src/kcContext/kcContextMocks.ts diff --git a/src/pages/Error.tsx b/src/pages/Error.tsx index eb2bf86f..ee9548de 100644 --- a/src/pages/Error.tsx +++ b/src/pages/Error.tsx @@ -1,6 +1,6 @@ import React from "react"; import type { PageProps } from "../KcProps"; -import type { KcContextBase } from "../getKcContext"; +import type { KcContextBase } from "../kcContext"; import type { I18nBase } from "../i18n"; export default function Error(props: PageProps, I18nBase>) { diff --git a/src/pages/IdpReviewUserProfile.tsx b/src/pages/IdpReviewUserProfile.tsx index c485c1ec..896861d2 100644 --- a/src/pages/IdpReviewUserProfile.tsx +++ b/src/pages/IdpReviewUserProfile.tsx @@ -2,7 +2,7 @@ import React, { useState } from "react"; import { clsx } from "../tools/clsx"; import { UserProfileFormFields } from "./shared/UserProfileCommons"; import type { PageProps } from "../KcProps"; -import type { KcContextBase } from "../getKcContext"; +import type { KcContextBase } from "../kcContext"; import type { I18nBase } from "../i18n"; export default function IdpReviewUserProfile(props: PageProps, I18nBase>) { diff --git a/src/pages/Info.tsx b/src/pages/Info.tsx index 5df78d9d..e186eefb 100644 --- a/src/pages/Info.tsx +++ b/src/pages/Info.tsx @@ -1,7 +1,7 @@ import React from "react"; import { assert } from "../tools/assert"; import type { PageProps } from "../KcProps"; -import type { KcContextBase } from "../getKcContext"; +import type { KcContextBase } from "../kcContext"; import type { I18nBase } from "../i18n"; export default function Info(props: PageProps, I18nBase>) { diff --git a/src/pages/Login.tsx b/src/pages/Login.tsx index 587729b0..f006d391 100644 --- a/src/pages/Login.tsx +++ b/src/pages/Login.tsx @@ -2,7 +2,7 @@ import React, { useState, type FormEventHandler } from "react"; import { clsx } from "../tools/clsx"; import { useConstCallback } from "../tools/useConstCallback"; import type { PageProps } from "../KcProps"; -import type { KcContextBase } from "../getKcContext"; +import type { KcContextBase } from "../kcContext"; import type { I18nBase } from "../i18n"; export default function Login(props: PageProps, I18nBase>) { diff --git a/src/pages/LoginConfigTotp.tsx b/src/pages/LoginConfigTotp.tsx index 5a48eef9..b83e7964 100644 --- a/src/pages/LoginConfigTotp.tsx +++ b/src/pages/LoginConfigTotp.tsx @@ -1,7 +1,7 @@ import React from "react"; import { clsx } from "../tools/clsx"; import type { PageProps } from "../KcProps"; -import type { KcContextBase } from "../getKcContext"; +import type { KcContextBase } from "../kcContext"; import type { I18nBase } from "../i18n"; export default function LoginConfigTotp(props: PageProps, I18nBase>) { diff --git a/src/pages/LoginIdpLinkConfirm.tsx b/src/pages/LoginIdpLinkConfirm.tsx index 01324460..7a18a071 100644 --- a/src/pages/LoginIdpLinkConfirm.tsx +++ b/src/pages/LoginIdpLinkConfirm.tsx @@ -1,7 +1,7 @@ import React from "react"; import { clsx } from "../tools/clsx"; import type { PageProps } from "../KcProps"; -import type { KcContextBase } from "../getKcContext"; +import type { KcContextBase } from "../kcContext"; import type { I18nBase } from "../i18n"; export default function LoginIdpLinkConfirm(props: PageProps, I18nBase>) { diff --git a/src/pages/LoginIdpLinkEmail.tsx b/src/pages/LoginIdpLinkEmail.tsx index 345b6ac7..7d1c6743 100644 --- a/src/pages/LoginIdpLinkEmail.tsx +++ b/src/pages/LoginIdpLinkEmail.tsx @@ -1,5 +1,5 @@ import React from "react"; -import type { KcContextBase } from "../getKcContext"; +import type { KcContextBase } from "../kcContext"; import type { PageProps } from "../KcProps"; import type { I18nBase } from "../i18n"; diff --git a/src/pages/LoginOtp.tsx b/src/pages/LoginOtp.tsx index 3525d8f8..51b7e9bd 100644 --- a/src/pages/LoginOtp.tsx +++ b/src/pages/LoginOtp.tsx @@ -3,7 +3,7 @@ import { headInsert } from "../tools/headInsert"; import { pathJoin } from "../bin/tools/pathJoin"; import { clsx } from "../tools/clsx"; import type { PageProps } from "../KcProps"; -import type { KcContextBase } from "../getKcContext"; +import type { KcContextBase } from "../kcContext"; import type { I18nBase } from "../i18n"; export default function LoginOtp(props: PageProps, I18nBase>) { diff --git a/src/pages/LoginPageExpired.tsx b/src/pages/LoginPageExpired.tsx index 84b11a67..0c63e9e9 100644 --- a/src/pages/LoginPageExpired.tsx +++ b/src/pages/LoginPageExpired.tsx @@ -1,6 +1,6 @@ import React from "react"; import type { PageProps } from "../KcProps"; -import type { KcContextBase } from "../getKcContext"; +import type { KcContextBase } from "../kcContext"; import type { I18nBase } from "../i18n"; export default function LoginPageExpired(props: PageProps, I18nBase>) { diff --git a/src/pages/LoginPassword.tsx b/src/pages/LoginPassword.tsx index e94fb73f..2de08bc3 100644 --- a/src/pages/LoginPassword.tsx +++ b/src/pages/LoginPassword.tsx @@ -3,7 +3,7 @@ import { clsx } from "../tools/clsx"; import { useConstCallback } from "../tools/useConstCallback"; import type { FormEventHandler } from "react"; import type { PageProps } from "../KcProps"; -import type { KcContextBase } from "../getKcContext"; +import type { KcContextBase } from "../kcContext"; import type { I18nBase } from "../i18n"; export default function LoginPassword(props: PageProps, I18nBase>) { diff --git a/src/pages/LoginResetPassword.tsx b/src/pages/LoginResetPassword.tsx index 8725ac11..175c841e 100644 --- a/src/pages/LoginResetPassword.tsx +++ b/src/pages/LoginResetPassword.tsx @@ -1,7 +1,7 @@ import React from "react"; import { clsx } from "../tools/clsx"; import type { PageProps } from "../KcProps"; -import type { KcContextBase } from "../getKcContext"; +import type { KcContextBase } from "../kcContext"; import type { I18nBase } from "../i18n"; export default function LoginResetPassword(props: PageProps, I18nBase>) { diff --git a/src/pages/LoginUpdatePassword.tsx b/src/pages/LoginUpdatePassword.tsx index 7081d6c5..8a67122d 100644 --- a/src/pages/LoginUpdatePassword.tsx +++ b/src/pages/LoginUpdatePassword.tsx @@ -1,7 +1,7 @@ import React from "react"; import { clsx } from "../tools/clsx"; import type { PageProps } from "../KcProps"; -import type { KcContextBase } from "../getKcContext"; +import type { KcContextBase } from "../kcContext"; import type { I18nBase } from "../i18n"; export default function LoginUpdatePassword(props: PageProps, I18nBase>) { diff --git a/src/pages/LoginUpdateProfile.tsx b/src/pages/LoginUpdateProfile.tsx index b1aa5119..4929b4ce 100644 --- a/src/pages/LoginUpdateProfile.tsx +++ b/src/pages/LoginUpdateProfile.tsx @@ -1,7 +1,7 @@ import React from "react"; import { clsx } from "../tools/clsx"; import type { PageProps } from "../KcProps"; -import type { KcContextBase } from "../getKcContext"; +import type { KcContextBase } from "../kcContext"; import type { I18nBase } from "../i18n"; export default function LoginUpdateProfile(props: PageProps, I18nBase>) { diff --git a/src/pages/LoginUsername.tsx b/src/pages/LoginUsername.tsx index 11a3e35b..c97f819f 100644 --- a/src/pages/LoginUsername.tsx +++ b/src/pages/LoginUsername.tsx @@ -3,7 +3,7 @@ import { clsx } from "../tools/clsx"; import { useConstCallback } from "../tools/useConstCallback"; import type { FormEventHandler } from "react"; import type { PageProps } from "../KcProps"; -import type { KcContextBase } from "../getKcContext"; +import type { KcContextBase } from "../kcContext"; import type { I18nBase } from "../i18n"; export default function LoginUsername(props: PageProps, I18nBase>) { diff --git a/src/pages/LoginVerifyEmail.tsx b/src/pages/LoginVerifyEmail.tsx index 164612e9..528106f6 100644 --- a/src/pages/LoginVerifyEmail.tsx +++ b/src/pages/LoginVerifyEmail.tsx @@ -1,6 +1,6 @@ import React from "react"; import type { PageProps } from "../KcProps"; -import type { KcContextBase } from "../getKcContext"; +import type { KcContextBase } from "../kcContext"; import type { I18nBase } from "../i18n"; export default function LoginVerifyEmail(props: PageProps, I18nBase>) { diff --git a/src/pages/LogoutConfirm.tsx b/src/pages/LogoutConfirm.tsx index 024286da..dd1c5e92 100644 --- a/src/pages/LogoutConfirm.tsx +++ b/src/pages/LogoutConfirm.tsx @@ -1,7 +1,7 @@ import React from "react"; import { clsx } from "../tools/clsx"; import type { PageProps } from "../KcProps"; -import type { KcContextBase } from "../getKcContext"; +import type { KcContextBase } from "../kcContext"; import type { I18nBase } from "../i18n"; export default function LogoutConfirm(props: PageProps, I18nBase>) { diff --git a/src/pages/Register.tsx b/src/pages/Register.tsx index a5d7774f..944a85d0 100644 --- a/src/pages/Register.tsx +++ b/src/pages/Register.tsx @@ -1,7 +1,7 @@ import React from "react"; import { clsx } from "../tools/clsx"; import type { PageProps } from "../KcProps"; -import type { KcContextBase } from "../getKcContext"; +import type { KcContextBase } from "../kcContext"; import type { I18nBase } from "../i18n"; export default function Register(props: PageProps, I18nBase>) { diff --git a/src/pages/RegisterUserProfile.tsx b/src/pages/RegisterUserProfile.tsx index 1f0f7362..8d1dc1a8 100644 --- a/src/pages/RegisterUserProfile.tsx +++ b/src/pages/RegisterUserProfile.tsx @@ -2,7 +2,7 @@ import React, { useState } from "react"; import { clsx } from "../tools/clsx"; import { UserProfileFormFields } from "./shared/UserProfileCommons"; import type { PageProps } from "../KcProps"; -import type { KcContextBase } from "../getKcContext"; +import type { KcContextBase } from "../kcContext"; import type { I18nBase } from "../i18n"; export default function RegisterUserProfile(props: PageProps, I18nBase>) { diff --git a/src/pages/Terms.tsx b/src/pages/Terms.tsx index f4c8d59b..cae27529 100644 --- a/src/pages/Terms.tsx +++ b/src/pages/Terms.tsx @@ -10,7 +10,7 @@ import { useConstCallback } from "../tools/useConstCallback"; import { Markdown } from "../tools/Markdown"; import type { Extends } from "tsafe"; import type { PageProps } from "../KcProps"; -import type { KcContextBase } from "../getKcContext"; +import type { KcContextBase } from "../kcContext"; import type { I18nBase } from "../i18n"; export default function Terms(props: PageProps, I18nBase>) { diff --git a/src/pages/UpdateUserProfile.tsx b/src/pages/UpdateUserProfile.tsx index 364c5958..9d7c6486 100644 --- a/src/pages/UpdateUserProfile.tsx +++ b/src/pages/UpdateUserProfile.tsx @@ -2,7 +2,7 @@ import React, { useState } from "react"; import { clsx } from "../tools/clsx"; import { UserProfileFormFields } from "./shared/UserProfileCommons"; import type { PageProps } from "../KcProps"; -import type { KcContextBase } from "../getKcContext"; +import type { KcContextBase } from "../kcContext"; import type { I18nBase } from "../i18n"; export default function UpdateUserProfile(props: PageProps, I18nBase>) { diff --git a/src/pages/WebauthnAuthenticate.tsx b/src/pages/WebauthnAuthenticate.tsx index c2e9a51f..715867e9 100644 --- a/src/pages/WebauthnAuthenticate.tsx +++ b/src/pages/WebauthnAuthenticate.tsx @@ -4,7 +4,7 @@ import type { MessageKeyBase } from "../i18n"; import { base64url } from "rfc4648"; import { useConstCallback } from "../tools/useConstCallback"; import type { PageProps } from "../KcProps"; -import type { KcContextBase } from "../getKcContext"; +import type { KcContextBase } from "../kcContext"; import type { I18nBase } from "../i18n"; export default function WebauthnAuthenticate(props: PageProps, I18nBase>) { diff --git a/src/pages/shared/UserProfileCommons.tsx b/src/pages/shared/UserProfileCommons.tsx index e1c95f87..4015c821 100644 --- a/src/pages/shared/UserProfileCommons.tsx +++ b/src/pages/shared/UserProfileCommons.tsx @@ -2,7 +2,7 @@ import React, { useEffect, Fragment } from "react"; import type { KcProps } from "../../KcProps"; import { clsx } from "../../tools/clsx"; import type { I18nBase } from "../../i18n"; -import type { Attribute } from "../../getKcContext"; +import type { Attribute } from "../../kcContext"; // If you are copy pasting this code in your theme project // you can delete all the following import and replace them by @@ -11,7 +11,7 @@ import type { Attribute } from "../../getKcContext"; // to be modified. import "../../tools/Array.prototype.every"; import { useMemo, useReducer } from "react"; -import type { KcContextBase, Validators } from "../../getKcContext"; +import type { KcContextBase, Validators } from "../../kcContext"; import { useConstCallback } from "../../tools/useConstCallback"; import { emailRegexp } from "../../tools/emailRegExp"; import type { MessageKeyBase } from "../../i18n"; diff --git a/src/test/lib/getKcContext.ts b/src/test/lib/getKcContext.ts index 93efa2f2..f98bd3a9 100644 --- a/src/test/lib/getKcContext.ts +++ b/src/test/lib/getKcContext.ts @@ -1,10 +1,10 @@ -import { getKcContext } from "../../getKcContext"; -import type { KcContextBase } from "../../getKcContext"; -import type { ExtendsKcContextBase } from "../../getKcContext"; +import { getKcContext } from "../../kcContext"; +import type { KcContextBase } from "../../kcContext"; +import type { ExtendsKcContextBase } from "../../kcContext"; import { same } from "evt/tools/inDepth"; import { assert } from "tsafe/assert"; import type { Equals } from "tsafe"; -import { kcContextMocks, kcContextCommonMock } from "../../getKcContext/kcContextMocks"; +import { kcContextMocks, kcContextCommonMock } from "../../kcContext/kcContextMocks"; import { deepClone } from "../../tools/deepClone"; { diff --git a/src/test/lib/index.ts b/src/test/lib/index.ts index 8df0b5d4..1bffaa17 100644 --- a/src/test/lib/index.ts +++ b/src/test/lib/index.ts @@ -1 +1 @@ -import "./getKcContext"; +import "./kcContext";