Compare commits
8 Commits
Author | SHA1 | Date | |
---|---|---|---|
da4146eb59 | |||
a0be35db8b | |||
14db9cd523 | |||
0c315385dd | |||
c0a0eb02fb | |||
ee407c32ad | |||
9262d21829 | |||
a13f710325 |
4
.github/FUNDING.yaml
vendored
Normal file
4
.github/FUNDING.yaml
vendored
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
# These are supported funding model platforms
|
||||||
|
|
||||||
|
github: [garronej]
|
||||||
|
custom: ['https://www.ringerhq.com/experts/garronej']
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "keycloakify",
|
"name": "keycloakify",
|
||||||
"version": "6.0.1",
|
"version": "6.0.3",
|
||||||
"description": "Keycloak theme generator for Reacts app",
|
"description": "Keycloak theme generator for Reacts app",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
@ -57,7 +57,7 @@ export function replaceImportsFromStaticInJsCode(params: { jsCode: string; build
|
|||||||
: `
|
: `
|
||||||
var p= "";
|
var p= "";
|
||||||
Object.defineProperty(${n}, "p", {
|
Object.defineProperty(${n}, "p", {
|
||||||
get: function() { return "${ftlValuesGlobalName}" in window ? "${buildOptions.urlOrigin}" : p; },
|
get: function() { return "${ftlValuesGlobalName}" in window ? "${buildOptions.urlOrigin}/" : p; },
|
||||||
set: function (value){ p = value;}
|
set: function (value){ p = value;}
|
||||||
});
|
});
|
||||||
`
|
`
|
||||||
@ -73,13 +73,13 @@ export function replaceImportsFromStaticInJsCode(params: { jsCode: string; build
|
|||||||
.replace(/([a-zA-Z]+\.[a-zA-Z]+)\+"static\//g, (...[, group]) =>
|
.replace(/([a-zA-Z]+\.[a-zA-Z]+)\+"static\//g, (...[, group]) =>
|
||||||
buildOptions.isStandalone
|
buildOptions.isStandalone
|
||||||
? `window.${ftlValuesGlobalName}.url.resourcesPath + "/build/static/`
|
? `window.${ftlValuesGlobalName}.url.resourcesPath + "/build/static/`
|
||||||
: `("${ftlValuesGlobalName}" in window ? "${buildOptions.urlOrigin}" : ${group}) + "static/`
|
: `("${ftlValuesGlobalName}" in window ? "${buildOptions.urlOrigin}/" : ${group}) + "static/`
|
||||||
)
|
)
|
||||||
//TODO: Write a test case for this
|
//TODO: Write a test case for this
|
||||||
.replace(/".chunk.css",([a-zA-Z])+=([a-zA-Z]+\.[a-zA-Z]+)\+([a-zA-Z]+),/, (...[, group1, group2, group3]) =>
|
.replace(/".chunk.css",([a-zA-Z])+=([a-zA-Z]+\.[a-zA-Z]+)\+([a-zA-Z]+),/, (...[, group1, group2, group3]) =>
|
||||||
buildOptions.isStandalone
|
buildOptions.isStandalone
|
||||||
? `".chunk.css",${group1} = window.${ftlValuesGlobalName}.url.resourcesPath + "/build/" + ${group3},`
|
? `".chunk.css",${group1} = window.${ftlValuesGlobalName}.url.resourcesPath + "/build/" + ${group3},`
|
||||||
: `".chunk.css",${group1} = ("${ftlValuesGlobalName}" in window ? "${buildOptions.urlOrigin}" : ${group2}) + ${group3},`
|
: `".chunk.css",${group1} = ("${ftlValuesGlobalName}" in window ? "${buildOptions.urlOrigin}/" : ${group2}) + ${group3},`
|
||||||
);
|
);
|
||||||
|
|
||||||
return { fixedJsCode };
|
return { fixedJsCode };
|
||||||
|
@ -83,8 +83,6 @@ export function __unsafe_useI18n<ExtraMessageKey extends string = never>(params:
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
let isMounted = true;
|
|
||||||
|
|
||||||
refHasStartedFetching.current = true;
|
refHasStartedFetching.current = true;
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
@ -144,10 +142,6 @@ export function __unsafe_useI18n<ExtraMessageKey extends string = never>(params:
|
|||||||
})()
|
})()
|
||||||
]).then(modules => modules.map(module => module.default));
|
]).then(modules => modules.map(module => module.default));
|
||||||
|
|
||||||
if (!isMounted) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
setI18n({
|
setI18n({
|
||||||
...createI18nTranslationFunctions({
|
...createI18nTranslationFunctions({
|
||||||
"fallbackMessages": {
|
"fallbackMessages": {
|
||||||
@ -180,10 +174,6 @@ export function __unsafe_useI18n<ExtraMessageKey extends string = never>(params:
|
|||||||
)
|
)
|
||||||
});
|
});
|
||||||
})();
|
})();
|
||||||
|
|
||||||
return () => {
|
|
||||||
isMounted = false;
|
|
||||||
};
|
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
return i18n ?? null;
|
return i18n ?? null;
|
||||||
|
@ -103,13 +103,13 @@ import { assetIsSameCode } from "../tools/assertIsSameCode";
|
|||||||
|
|
||||||
const fixedJsCodeExpected = `
|
const fixedJsCodeExpected = `
|
||||||
function f() {
|
function f() {
|
||||||
return ("kcContext" in window ? "https://demo-app.keycloakify.dev" : a.p) + "static/js/" + ({}[e] || e) + "." + {
|
return ("kcContext" in window ? "https://demo-app.keycloakify.dev/" : a.p) + "static/js/" + ({}[e] || e) + "." + {
|
||||||
3: "0664cdc0"
|
3: "0664cdc0"
|
||||||
}[e] + ".chunk.js"
|
}[e] + ".chunk.js"
|
||||||
}
|
}
|
||||||
|
|
||||||
function sameAsF() {
|
function sameAsF() {
|
||||||
return ("kcContext" in window ? "https://demo-app.keycloakify.dev" : a.p) + "static/js/" + ({}[e] || e) + "." + {
|
return ("kcContext" in window ? "https://demo-app.keycloakify.dev/" : a.p) + "static/js/" + ({}[e] || e) + "." + {
|
||||||
3: "0664cdc0"
|
3: "0664cdc0"
|
||||||
}[e] + ".chunk.js"
|
}[e] + ".chunk.js"
|
||||||
}
|
}
|
||||||
@ -119,7 +119,7 @@ import { assetIsSameCode } from "../tools/assertIsSameCode";
|
|||||||
if( pd === undefined || pd.configurable ){
|
if( pd === undefined || pd.configurable ){
|
||||||
var p= "";
|
var p= "";
|
||||||
Object.defineProperty(__webpack_require__, "p", {
|
Object.defineProperty(__webpack_require__, "p", {
|
||||||
get: function() { return "kcContext" in window ? "https://demo-app.keycloakify.dev" : p; },
|
get: function() { return "kcContext" in window ? "https://demo-app.keycloakify.dev/" : p; },
|
||||||
set: function (value){ p = value; }
|
set: function (value){ p = value; }
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -137,7 +137,7 @@ import { assetIsSameCode } from "../tools/assertIsSameCode";
|
|||||||
if( pd === undefined || pd.configurable ){
|
if( pd === undefined || pd.configurable ){
|
||||||
var p= "";
|
var p= "";
|
||||||
Object.defineProperty(t, "p", {
|
Object.defineProperty(t, "p", {
|
||||||
get: function() { return "kcContext" in window ? "https://demo-app.keycloakify.dev" : p; },
|
get: function() { return "kcContext" in window ? "https://demo-app.keycloakify.dev/" : p; },
|
||||||
set: function (value){ p = value; }
|
set: function (value){ p = value; }
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user