keycloakify 11.3.7 → 11.3.9-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 -0
- package/bin/526.index.js +4 -4
- package/login/lib/getUserProfileApi/getUserProfileApi.d.ts +88 -0
- package/login/lib/getUserProfileApi/getUserProfileApi.js +1076 -0
- package/login/lib/getUserProfileApi/getUserProfileApi.js.map +1 -0
- package/login/lib/getUserProfileApi/index.d.ts +1 -0
- package/login/lib/getUserProfileApi/index.js +2 -0
- package/login/lib/getUserProfileApi/index.js.map +1 -0
- package/login/lib/getUserProfileApi/kcNumberUnFormat.d.ts +1 -0
- package/login/lib/getUserProfileApi/kcNumberUnFormat.js +84 -0
- package/login/lib/getUserProfileApi/kcNumberUnFormat.js.map +1 -0
- package/login/lib/useUserProfileForm.d.ts +9 -34
- package/login/lib/useUserProfileForm.js +44 -998
- package/login/lib/useUserProfileForm.js.map +1 -1
- package/login/pages/LoginPasskeysConditionalAuthenticate.useScript.js +7 -1
- package/login/pages/LoginPasskeysConditionalAuthenticate.useScript.js.map +1 -1
- package/login/pages/LoginRecoveryAuthnCodeConfig.useScript.js +7 -1
- package/login/pages/LoginRecoveryAuthnCodeConfig.useScript.js.map +1 -1
- package/login/pages/WebauthnAuthenticate.useScript.js +7 -1
- package/login/pages/WebauthnAuthenticate.useScript.js.map +1 -1
- package/login/pages/WebauthnRegister.useScript.js +7 -1
- package/login/pages/WebauthnRegister.useScript.js.map +1 -1
- package/package.json +17 -1
- package/src/bin/start-keycloak/start-keycloak.ts +4 -4
- package/src/login/lib/getUserProfileApi/getUserProfileApi.ts +1561 -0
- package/src/login/lib/getUserProfileApi/index.ts +1 -0
- package/src/login/lib/getUserProfileApi/kcNumberUnFormat.ts +109 -0
- package/src/login/lib/useUserProfileForm.tsx +82 -1322
- package/src/login/pages/LoginPasskeysConditionalAuthenticate.useScript.tsx +8 -1
- package/src/login/pages/LoginRecoveryAuthnCodeConfig.useScript.tsx +8 -1
- package/src/login/pages/WebauthnAuthenticate.useScript.tsx +8 -1
- package/src/login/pages/WebauthnRegister.useScript.tsx +8 -1
- package/src/tools/waitForElementMountedOnDom.ts +30 -0
- package/tools/waitForElementMountedOnDom.d.ts +3 -0
- package/tools/waitForElementMountedOnDom.js +21 -0
- package/tools/waitForElementMountedOnDom.js.map +1 -0
@@ -2,6 +2,7 @@ import { useEffect } from "react";
|
|
2
2
|
import { useInsertScriptTags } from "keycloakify/tools/useInsertScriptTags";
|
3
3
|
import { assert } from "keycloakify/tools/assert";
|
4
4
|
import { KcContext } from "keycloakify/login/KcContext/KcContext";
|
5
|
+
import { waitForElementMountedOnDom } from "keycloakify/tools/waitForElementMountedOnDom";
|
5
6
|
|
6
7
|
type KcContextLike = {
|
7
8
|
url: {
|
@@ -67,6 +68,12 @@ export function useScript(params: { authButtonId: string; kcContext: KcContextLi
|
|
67
68
|
return;
|
68
69
|
}
|
69
70
|
|
70
|
-
|
71
|
+
(async () => {
|
72
|
+
await waitForElementMountedOnDom({
|
73
|
+
elementId: authButtonId
|
74
|
+
});
|
75
|
+
|
76
|
+
insertScriptTags();
|
77
|
+
})();
|
71
78
|
}, [isFetchingTranslations]);
|
72
79
|
}
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { useEffect } from "react";
|
2
2
|
import { useInsertScriptTags } from "keycloakify/tools/useInsertScriptTags";
|
3
|
+
import { waitForElementMountedOnDom } from "keycloakify/tools/waitForElementMountedOnDom";
|
3
4
|
|
4
5
|
type I18nLike = {
|
5
6
|
msgStr: (key: "recovery-codes-download-file-header" | "recovery-codes-download-file-description" | "recovery-codes-download-file-date") => string;
|
@@ -137,6 +138,12 @@ export function useScript(params: { olRecoveryCodesListId: string; i18n: I18nLik
|
|
137
138
|
return;
|
138
139
|
}
|
139
140
|
|
140
|
-
|
141
|
+
(async () => {
|
142
|
+
await waitForElementMountedOnDom({
|
143
|
+
elementId: olRecoveryCodesListId
|
144
|
+
});
|
145
|
+
|
146
|
+
insertScriptTags();
|
147
|
+
})();
|
141
148
|
}, [isFetchingTranslations]);
|
142
149
|
}
|
@@ -2,6 +2,7 @@ import { useEffect } from "react";
|
|
2
2
|
import { useInsertScriptTags } from "keycloakify/tools/useInsertScriptTags";
|
3
3
|
import { assert } from "keycloakify/tools/assert";
|
4
4
|
import { KcContext } from "keycloakify/login/KcContext/KcContext";
|
5
|
+
import { waitForElementMountedOnDom } from "keycloakify/tools/waitForElementMountedOnDom";
|
5
6
|
|
6
7
|
type KcContextLike = {
|
7
8
|
url: {
|
@@ -59,6 +60,12 @@ export function useScript(params: { authButtonId: string; kcContext: KcContextLi
|
|
59
60
|
return;
|
60
61
|
}
|
61
62
|
|
62
|
-
|
63
|
+
(async () => {
|
64
|
+
await waitForElementMountedOnDom({
|
65
|
+
elementId: authButtonId
|
66
|
+
});
|
67
|
+
|
68
|
+
insertScriptTags();
|
69
|
+
})();
|
63
70
|
}, [isFetchingTranslations]);
|
64
71
|
}
|
@@ -2,6 +2,7 @@ import { useEffect } from "react";
|
|
2
2
|
import { useInsertScriptTags } from "keycloakify/tools/useInsertScriptTags";
|
3
3
|
import { assert } from "keycloakify/tools/assert";
|
4
4
|
import { KcContext } from "keycloakify/login/KcContext/KcContext";
|
5
|
+
import { waitForElementMountedOnDom } from "keycloakify/tools/waitForElementMountedOnDom";
|
5
6
|
|
6
7
|
type KcContextLike = {
|
7
8
|
url: {
|
@@ -88,6 +89,12 @@ export function useScript(params: { authButtonId: string; kcContext: KcContextLi
|
|
88
89
|
return;
|
89
90
|
}
|
90
91
|
|
91
|
-
|
92
|
+
(async () => {
|
93
|
+
await waitForElementMountedOnDom({
|
94
|
+
elementId: authButtonId
|
95
|
+
});
|
96
|
+
|
97
|
+
insertScriptTags();
|
98
|
+
})();
|
92
99
|
}, [isFetchingTranslations]);
|
93
100
|
}
|
@@ -0,0 +1,30 @@
|
|
1
|
+
export async function waitForElementMountedOnDom(params: {
|
2
|
+
elementId: string;
|
3
|
+
}): Promise<void> {
|
4
|
+
const { elementId } = params;
|
5
|
+
|
6
|
+
const getElement = () => document.getElementById(elementId);
|
7
|
+
|
8
|
+
const element = getElement();
|
9
|
+
|
10
|
+
if (element === null) {
|
11
|
+
let prElementPresentInTheDom_resolve: () => void;
|
12
|
+
const prElementPresentInTheDom = new Promise<void>(
|
13
|
+
resolve => (prElementPresentInTheDom_resolve = resolve)
|
14
|
+
);
|
15
|
+
|
16
|
+
// Observe the dom for the element to be added
|
17
|
+
const observer = new MutationObserver(() => {
|
18
|
+
const element = getElement();
|
19
|
+
if (element === null) {
|
20
|
+
return;
|
21
|
+
}
|
22
|
+
observer.disconnect();
|
23
|
+
prElementPresentInTheDom_resolve();
|
24
|
+
});
|
25
|
+
|
26
|
+
observer.observe(document.body, { childList: true, subtree: true });
|
27
|
+
|
28
|
+
await prElementPresentInTheDom;
|
29
|
+
}
|
30
|
+
}
|
@@ -0,0 +1,21 @@
|
|
1
|
+
export async function waitForElementMountedOnDom(params) {
|
2
|
+
const { elementId } = params;
|
3
|
+
const getElement = () => document.getElementById(elementId);
|
4
|
+
const element = getElement();
|
5
|
+
if (element === null) {
|
6
|
+
let prElementPresentInTheDom_resolve;
|
7
|
+
const prElementPresentInTheDom = new Promise(resolve => (prElementPresentInTheDom_resolve = resolve));
|
8
|
+
// Observe the dom for the element to be added
|
9
|
+
const observer = new MutationObserver(() => {
|
10
|
+
const element = getElement();
|
11
|
+
if (element === null) {
|
12
|
+
return;
|
13
|
+
}
|
14
|
+
observer.disconnect();
|
15
|
+
prElementPresentInTheDom_resolve();
|
16
|
+
});
|
17
|
+
observer.observe(document.body, { childList: true, subtree: true });
|
18
|
+
await prElementPresentInTheDom;
|
19
|
+
}
|
20
|
+
}
|
21
|
+
//# sourceMappingURL=waitForElementMountedOnDom.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"waitForElementMountedOnDom.js","sourceRoot":"","sources":["../src/tools/waitForElementMountedOnDom.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,KAAK,UAAU,0BAA0B,CAAC,MAEhD;IACG,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,CAAC;IAE7B,MAAM,UAAU,GAAG,GAAG,EAAE,CAAC,QAAQ,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC;IAE5D,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;IAE7B,IAAI,OAAO,KAAK,IAAI,EAAE;QAClB,IAAI,gCAA4C,CAAC;QACjD,MAAM,wBAAwB,GAAG,IAAI,OAAO,CACxC,OAAO,CAAC,EAAE,CAAC,CAAC,gCAAgC,GAAG,OAAO,CAAC,CAC1D,CAAC;QAEF,8CAA8C;QAC9C,MAAM,QAAQ,GAAG,IAAI,gBAAgB,CAAC,GAAG,EAAE;YACvC,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;YAC7B,IAAI,OAAO,KAAK,IAAI,EAAE;gBAClB,OAAO;aACV;YACD,QAAQ,CAAC,UAAU,EAAE,CAAC;YACtB,gCAAgC,EAAE,CAAC;QACvC,CAAC,CAAC,CAAC;QAEH,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;QAEpE,MAAM,wBAAwB,CAAC;KAClC;AACL,CAAC"}
|