Compare commits
1 Commits
Author | SHA1 | Date | |
---|---|---|---|
1a79814dea |
@ -1,375 +0,0 @@
|
||||
{
|
||||
"files": [
|
||||
"README.md"
|
||||
],
|
||||
"imageSize": 100,
|
||||
"commit": false,
|
||||
"commitConvention": "angular",
|
||||
"contributors": [
|
||||
{
|
||||
"login": "lordvlad",
|
||||
"name": "Waldemar Reusch",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/1217769?v=4",
|
||||
"profile": "https://github.com/lordvlad",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "willwill96",
|
||||
"name": "William Will",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/10997562?v=4",
|
||||
"profile": "https://willwill96.github.io/the-ui-dawg-static-site/en/introduction/",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "Ann2827",
|
||||
"name": "Bystrova Ann",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/32645809?v=4",
|
||||
"profile": "https://github.com/Ann2827",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "mkreuzmayr",
|
||||
"name": "Michael Kreuzmayr",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/20108212?v=4",
|
||||
"profile": "https://github.com/mkreuzmayr",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "Mstrodl",
|
||||
"name": "Mary ",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/6877780?v=4",
|
||||
"profile": "https://coolmathgames.tech",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "Tasyp",
|
||||
"name": "German Öö",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/6623212?v=4",
|
||||
"profile": "https://tasyp.xyz/",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "revolunet",
|
||||
"name": "Julien Bouquillon",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/124937?v=4",
|
||||
"profile": "https://revolunet.com",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "aidangilmore",
|
||||
"name": "Aidan Gilmore",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/32880357?v=4",
|
||||
"profile": "https://github.com/aidangilmore",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "0x-Void",
|
||||
"name": "Void",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/32745739?v=4",
|
||||
"profile": "https://github.com/0x-Void",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "juffe",
|
||||
"name": "juffe",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/5393231?v=4",
|
||||
"profile": "https://github.com/juffe",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "lazToum",
|
||||
"name": "Lazaros Toumanidis",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/4764837?v=4",
|
||||
"profile": "https://github.com/lazToum",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "marcmrf",
|
||||
"name": "Marc",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/9928519?v=4",
|
||||
"profile": "https://github.com/marcmrf",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "kasir-barati",
|
||||
"name": "Kasir Barati",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/73785723?v=4",
|
||||
"profile": "http://kasir-barati.github.io",
|
||||
"contributions": [
|
||||
"doc"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "asashay",
|
||||
"name": "Alex Oliynyk",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/10714670?v=4",
|
||||
"profile": "https://github.com/asashay",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "thosil",
|
||||
"name": "Thomas Silvestre",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/1140574?v=4",
|
||||
"profile": "https://www.gravitysoftware.be",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "satanshiro",
|
||||
"name": "satanshiro",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/38865738?v=4",
|
||||
"profile": "https://github.com/satanshiro",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "kpoelhekke",
|
||||
"name": "Koen Poelhekke",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/1632377?v=4",
|
||||
"profile": "https://poelhekke.dev",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "zavoloklom",
|
||||
"name": "Sergey Kupletsky",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/4151869?v=4",
|
||||
"profile": "https://github.com/zavoloklom",
|
||||
"contributions": [
|
||||
"test",
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "rome-user",
|
||||
"name": "rome-user",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/114131048?v=4",
|
||||
"profile": "https://github.com/rome-user",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "celinepelletier",
|
||||
"name": "Céline Pelletier",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/82821620?v=4",
|
||||
"profile": "https://github.com/celinepelletier",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "xgp",
|
||||
"name": "Garth",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/244253?v=4",
|
||||
"profile": "https://github.com/xgp",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "BlackVoid",
|
||||
"name": "Felix Gustavsson",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/673720?v=4",
|
||||
"profile": "https://github.com/BlackVoid",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "msiemens",
|
||||
"name": "Markus Siemens",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/1873922?v=4",
|
||||
"profile": "https://m-siemens.de/",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "law108000",
|
||||
"name": "Rlok",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/8112024?v=4",
|
||||
"profile": "https://github.com/law108000",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "Moulyy",
|
||||
"name": "Moulyy",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/115405804?v=4",
|
||||
"profile": "https://github.com/Moulyy",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "madmadson",
|
||||
"name": "Tobias Matt",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/798831?v=4",
|
||||
"profile": "https://github.com/madmadson",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "oliviergoulet5",
|
||||
"name": "Olivier Goulet",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/17685861?v=4",
|
||||
"profile": "https://github.com/oliviergoulet5",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "liamlows",
|
||||
"name": "Liam Lowsley-Williams",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/1365914?v=4",
|
||||
"profile": "https://github.com/liamlows",
|
||||
"contributions": [
|
||||
"code",
|
||||
"doc"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "uchar",
|
||||
"name": "Omid",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/5172296?v=4",
|
||||
"profile": "https://www.linkedin.com/in/oes-rioniz/",
|
||||
"contributions": [
|
||||
"test",
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "kathari00",
|
||||
"name": "Katharina Eiserfey",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/42547712?v=4",
|
||||
"profile": "https://github.com/kathari00",
|
||||
"contributions": [
|
||||
"code",
|
||||
"test",
|
||||
"doc"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "luca-peruzzo",
|
||||
"name": "Luca Peruzzo",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/69015314?v=4",
|
||||
"profile": "https://github.com/luca-peruzzo",
|
||||
"contributions": [
|
||||
"code",
|
||||
"test"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "nima70",
|
||||
"name": "Nima Shokouhfar",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/5094767?v=4",
|
||||
"profile": "https://github.com/nima70",
|
||||
"contributions": [
|
||||
"code",
|
||||
"test"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "marvinruder",
|
||||
"name": "Marvin A. Ruder",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/18495294?v=4",
|
||||
"profile": "https://mruder.dev",
|
||||
"contributions": [
|
||||
"bug"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "zvn2060",
|
||||
"name": "HI_OuO",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/45450852?v=4",
|
||||
"profile": "https://github.com/zvn2060",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "tripheo0412",
|
||||
"name": "Tri Hoang",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/25382052?v=4",
|
||||
"profile": "https://github.com/tripheo0412",
|
||||
"contributions": [
|
||||
"doc"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "EternalSide",
|
||||
"name": "Lesha",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/118743608?v=4",
|
||||
"profile": "http://t.me/AAT_L",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "bacongobbler",
|
||||
"name": "Matthew Fisher",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/1360539?v=4",
|
||||
"profile": "https://blog.bacongobbler.com",
|
||||
"contributions": [
|
||||
"doc"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "kodebach",
|
||||
"name": "Klemens Böswirth",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/23529132?v=4",
|
||||
"profile": "https://github.com/kodebach",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "wnmzzzz",
|
||||
"name": "wnmzzzz",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/117174301?v=4",
|
||||
"profile": "https://github.com/wnmzzzz",
|
||||
"contributions": [
|
||||
"test"
|
||||
]
|
||||
}
|
||||
],
|
||||
"contributorsPerLine": 7,
|
||||
"skipCi": true,
|
||||
"repoType": "github",
|
||||
"repoHost": "https://github.com",
|
||||
"projectName": "keycloakify",
|
||||
"projectOwner": "keycloakify",
|
||||
"commitType": "docs"
|
||||
}
|
4
.gitattributes
vendored
@ -1,3 +1,3 @@
|
||||
src/lib/i18n/generated_kcMessages/* linguist-documentation
|
||||
src/bin/keycloakify/index.ts -linguist-detectable
|
||||
src/lib/i18n/generated_messages/* linguist-documentation
|
||||
src/bin/install-builtin-keycloak-themes.ts -linguist-detectable
|
||||
src/bin/build-keycloak-theme/index.ts -linguist-detectable
|
3
.github/FUNDING.yaml
vendored
@ -1,3 +0,0 @@
|
||||
# These are supported funding model platforms
|
||||
|
||||
github: [garronej]
|
139
.github/workflows/ci.yaml
vendored
@ -1,139 +0,0 @@
|
||||
name: ci
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
|
||||
test_lint:
|
||||
runs-on: ubuntu-latest
|
||||
if: ${{ !github.event.created && github.repository != 'garronej/ts-ci' }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
- uses: bahmutov/npm-install@v1
|
||||
- name: If this step fails run 'npm run format' then commit again.
|
||||
run: npm run _format --list-different
|
||||
test:
|
||||
runs-on: ${{ matrix.os }}
|
||||
needs: test_lint
|
||||
strategy:
|
||||
matrix:
|
||||
node: [ '18' ]
|
||||
os: [ ubuntu-latest ]
|
||||
name: Test with Node v${{ matrix.node }} on ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: ${{ matrix.node }}
|
||||
- uses: bahmutov/npm-install@v1
|
||||
- run: npm run build
|
||||
- run: npm run test
|
||||
|
||||
storybook:
|
||||
runs-on: ubuntu-latest
|
||||
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
||||
needs: test
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '18'
|
||||
- uses: bahmutov/npm-install@v1
|
||||
- run: npm run build-storybook
|
||||
- run: git remote set-url origin https://git:${GITHUB_TOKEN}@github.com/${{github.repository}}.git
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
- run: npx -y -p gh-pages@3.1.0 gh-pages -d ./storybook-static -u "github-actions-bot <actions@github.com>"
|
||||
|
||||
check_if_version_upgraded:
|
||||
name: Check if version upgrade
|
||||
# When someone forks the repo and opens a PR we want to enables the tests to be run (the previous jobs)
|
||||
# but obviously only us should be allowed to release.
|
||||
# In the following check we make sure that we own the branch this CI workflow is running on before continuing.
|
||||
# Without this check, trying to release would fail anyway because only us have the correct secret.NPM_TOKEN but
|
||||
# it's cleaner to stop the execution instead of letting the CI crash.
|
||||
if: |
|
||||
github.event_name == 'push' ||
|
||||
github.event.pull_request.head.repo.owner.login == github.event.pull_request.base.repo.owner.login
|
||||
runs-on: ubuntu-latest
|
||||
needs: test
|
||||
outputs:
|
||||
from_version: ${{ steps.step1.outputs.from_version }}
|
||||
to_version: ${{ steps.step1.outputs.to_version }}
|
||||
is_upgraded_version: ${{ steps.step1.outputs.is_upgraded_version }}
|
||||
is_pre_release: ${{steps.step1.outputs.is_pre_release }}
|
||||
steps:
|
||||
- uses: garronej/ts-ci@v2.1.2
|
||||
id: step1
|
||||
with:
|
||||
action_name: is_package_json_version_upgraded
|
||||
|
||||
create_github_release:
|
||||
runs-on: ubuntu-latest
|
||||
# We create release only if the version in the package.json have been upgraded and this CI is running against the main branch.
|
||||
# We allow branches with a PR open on main to publish pre-release (x.y.z-rc.u) but not actual releases.
|
||||
if: |
|
||||
needs.check_if_version_upgraded.outputs.is_upgraded_version == 'true' &&
|
||||
(
|
||||
github.event_name == 'push' ||
|
||||
needs.check_if_version_upgraded.outputs.is_pre_release == 'true'
|
||||
)
|
||||
needs:
|
||||
- check_if_version_upgraded
|
||||
steps:
|
||||
- uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
name: Release v${{ needs.check_if_version_upgraded.outputs.to_version }}
|
||||
tag_name: v${{ needs.check_if_version_upgraded.outputs.to_version }}
|
||||
target_commitish: ${{ github.head_ref || github.ref }}
|
||||
generate_release_notes: true
|
||||
draft: false
|
||||
prerelease: ${{ needs.check_if_version_upgraded.outputs.is_pre_release == 'true' }}
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
publish_on_npm:
|
||||
runs-on: ubuntu-latest
|
||||
needs:
|
||||
- create_github_release
|
||||
- check_if_version_upgraded
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ github.ref }}
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
registry-url: https://registry.npmjs.org/
|
||||
- uses: bahmutov/npm-install@v1
|
||||
- run: npm run build
|
||||
- run: npx -y -p denoify@1.6.13 enable_short_npm_import_path
|
||||
env:
|
||||
DRY_RUN: "0"
|
||||
- uses: garronej/ts-ci@v2.1.2
|
||||
with:
|
||||
action_name: remove_dark_mode_specific_images_from_readme
|
||||
- name: Publishing on NPM
|
||||
run: |
|
||||
if [ "$(npm show . version)" = "$VERSION" ]; then
|
||||
echo "This version is already published"
|
||||
exit 0
|
||||
fi
|
||||
if [ "$NODE_AUTH_TOKEN" = "" ]; then
|
||||
echo "Can't publish on NPM, You must first create a secret called NPM_TOKEN that contains your NPM auth token. https://help.github.com/en/actions/automating-your-workflow-with-github-actions/creating-and-using-encrypted-secrets"
|
||||
false
|
||||
fi
|
||||
EXTRA_ARGS=""
|
||||
if [ "$IS_PRE_RELEASE" = "true" ]; then
|
||||
EXTRA_ARGS="--tag next"
|
||||
fi
|
||||
npm publish $EXTRA_ARGS
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
|
||||
VERSION: ${{ needs.check_if_version_upgraded.outputs.to_version }}
|
||||
IS_PRE_RELEASE: ${{ needs.check_if_version_upgraded.outputs.is_pre_release }}
|
18
.gitignore
vendored
@ -41,21 +41,5 @@ jspm_packages
|
||||
.DS_Store
|
||||
|
||||
/dist
|
||||
/keycloakify_starter_test/
|
||||
/sample_custom_react_project/
|
||||
|
||||
/sample_react_project/
|
||||
/.yarn_home/
|
||||
|
||||
.idea
|
||||
|
||||
/src/login/i18n/messages_defaultSet/
|
||||
/src/account/i18n/
|
||||
|
||||
# VS Code devcontainers
|
||||
.devcontainer
|
||||
/.yarn
|
||||
/.yarnrc.yml
|
||||
|
||||
/stories/assets/fonts/
|
||||
/build_storybook/
|
||||
/storybook-static/
|
||||
|
@ -1,16 +0,0 @@
|
||||
node_modules/
|
||||
/dist/
|
||||
/CHANGELOG.md
|
||||
/.yarn_home/
|
||||
/src/test/apps/
|
||||
/src/tools/types/
|
||||
/build_keycloak/
|
||||
/.vscode/
|
||||
/src/login/i18n/messages_defaultSet/
|
||||
/src/account/i18n/messages_defaultSet/
|
||||
/dist_test
|
||||
/sample_react_project/
|
||||
/sample_custom_react_project/
|
||||
/keycloakify_starter_test/
|
||||
/.storybook/static/keycloak-resources/
|
||||
/src/bin/start-keycloak/*.json
|
@ -1,24 +0,0 @@
|
||||
{
|
||||
"printWidth": 90,
|
||||
"tabWidth": 4,
|
||||
"useTabs": false,
|
||||
"semi": true,
|
||||
"singleQuote": false,
|
||||
"trailingComma": "none",
|
||||
"bracketSpacing": true,
|
||||
"arrowParens": "avoid",
|
||||
"overrides": [
|
||||
{
|
||||
"files": "*.tsx",
|
||||
"options": {
|
||||
"printWidth": 150
|
||||
}
|
||||
},
|
||||
{
|
||||
"files": "useUserProfileForm.tsx",
|
||||
"options": {
|
||||
"printWidth": 150
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
@ -1,33 +0,0 @@
|
||||
const brandImage = "logo.png";
|
||||
const brandTitle = "Keycloakify";
|
||||
const brandUrl = "https://github.com/keycloakify/keycloakify";
|
||||
const fontBase = '"Work Sans", sans-serif';
|
||||
const fontCode = "monospace";
|
||||
|
||||
export const darkTheme = {
|
||||
base: "dark",
|
||||
appBg: "#1E1E1E",
|
||||
appContentBg: "#161616",
|
||||
barBg: "#161616",
|
||||
colorSecondary: "#8585F6",
|
||||
textColor: "#FFFFFF",
|
||||
brandImage,
|
||||
brandTitle,
|
||||
brandUrl,
|
||||
fontBase,
|
||||
fontCode
|
||||
};
|
||||
|
||||
export const lightTheme: typeof darkTheme = {
|
||||
base: "light",
|
||||
appBg: "#F6F6F6",
|
||||
appContentBg: "#FFFFFF",
|
||||
barBg: "#FFFFFF",
|
||||
colorSecondary: "#000091",
|
||||
textColor: "#212121",
|
||||
brandImage,
|
||||
brandTitle,
|
||||
brandUrl,
|
||||
fontBase,
|
||||
fontCode
|
||||
};
|
@ -1,13 +0,0 @@
|
||||
module.exports = {
|
||||
stories: [
|
||||
"../stories/**/*.stories.tsx"
|
||||
],
|
||||
addons: [
|
||||
"storybook-dark-mode",
|
||||
"@storybook/addon-a11y"
|
||||
],
|
||||
core: {
|
||||
builder: "webpack5"
|
||||
},
|
||||
staticDirs: ["./static", "../dist/res/public"]
|
||||
};
|
@ -1,32 +0,0 @@
|
||||
<!-- start favicon -->
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="/favicon_package/apple-touch-icon.png">
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="/favicon_package/favicon-32x32.png">
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="/favicon_package/favicon-16x16.png">
|
||||
<link rel="manifest" href="/favicon_package/site.webmanifest">
|
||||
<link rel="mask-icon" href="/favicon_package/safari-pinned-tab.svg" color="#5bbad5">
|
||||
<!-- end favicon -->
|
||||
|
||||
<!-- Meta tags generated by metatags.io -->
|
||||
<!-- Primary Meta Tags -->
|
||||
<title>Keycloakify Storybook</title>
|
||||
<meta name="title" content="Keycloakify Storybook">
|
||||
<meta name="description" content="Storybook of default components to use as a reference when building a custom Keycloak theme">
|
||||
|
||||
<!-- Facebook Meta Tags -->
|
||||
<meta property="og:url" content="https://www.keycloakify.dev">
|
||||
<meta property="og:type" content="website">
|
||||
<meta property="og:title" content="Keycloakify Storybook">
|
||||
<meta property="og:description" content="Storybook of default components to use as a reference when building a custom Keycloak theme">
|
||||
<meta property="og:image" content="https://storybook.keycloakify.dev/preview.png">
|
||||
|
||||
<!-- Twitter Meta Tags -->
|
||||
<meta name="twitter:card" content="summary_large_image">
|
||||
<meta name="twitter:title" content="Keycloakify Storybook">
|
||||
<meta name="twitter:description" content="Storybook of default components to use as a reference when building a custom Keycloak theme">
|
||||
<meta name="twitter:image" content="https://storybook.keycloakify.dev/preview.png">
|
||||
|
||||
<link rel="preload" href="/fonts/WorkSans/worksans-bold-webfont.woff2" as="font" crossorigin="anonymous">
|
||||
<link rel="preload" href="/fonts/WorkSans/worksans-medium-webfont.woff2" as="font" crossorigin="anonymous">
|
||||
<link rel="preload" href="/fonts/WorkSans/worksans-regular-webfont.woff2" as="font" crossorigin="anonymous">
|
||||
<link rel="preload" href="/fonts/WorkSans/worksans-semibold-webfont.woff2" as="font" crossorigin="anonymous">
|
||||
<link rel="stylesheet" type="text/css" href="/fonts/WorkSans/font.css">
|
@ -1,6 +0,0 @@
|
||||
import { addons } from '@storybook/addons';
|
||||
|
||||
addons.setConfig({
|
||||
selectedPanel: 'storybook/a11y/panel',
|
||||
showPanel: false
|
||||
});
|
@ -1,23 +0,0 @@
|
||||
<link rel="preload" href="/fonts/WorkSans/worksans-bold-webfont.woff2" as="font" crossorigin="anonymous">
|
||||
<link rel="preload" href="/fonts/WorkSans/worksans-medium-webfont.woff2" as="font" crossorigin="anonymous">
|
||||
<link rel="preload" href="/fonts/WorkSans/worksans-regular-webfont.woff2" as="font" crossorigin="anonymous">
|
||||
<link rel="preload" href="/fonts/WorkSans/worksans-semibold-webfont.woff2" as="font" crossorigin="anonymous">
|
||||
<link rel="stylesheet" type="text/css" href="/fonts/WorkSans/font.css">
|
||||
|
||||
<style>
|
||||
body.sb-show-main.sb-main-padded {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
body:not(.kcBodyClass) {
|
||||
background-color: #393939;
|
||||
}
|
||||
|
||||
body.sb-show-preparing-docs > .sb-wrapper {
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
body .sb-preparing-story {
|
||||
visibility: hidden;
|
||||
}
|
||||
</style>
|
@ -1,161 +0,0 @@
|
||||
import { darkTheme, lightTheme } from "./customTheme";
|
||||
import { create as createTheme } from "@storybook/theming";
|
||||
|
||||
export const parameters = {
|
||||
actions: { argTypesRegex: "^on[A-Z].*" },
|
||||
controls: {
|
||||
matchers: {
|
||||
color: /(background|color)$/i,
|
||||
date: /Date$/,
|
||||
},
|
||||
},
|
||||
backgrounds: { disable: true },
|
||||
darkMode: {
|
||||
light: createTheme(lightTheme),
|
||||
dark: createTheme(darkTheme),
|
||||
},
|
||||
controls: {
|
||||
disable: true,
|
||||
},
|
||||
actions: {
|
||||
disable: true
|
||||
},
|
||||
viewport: {
|
||||
viewports: {
|
||||
"1440p": {
|
||||
name: "1440p",
|
||||
styles: {
|
||||
width: "2560px",
|
||||
height: "1440px",
|
||||
},
|
||||
},
|
||||
fullHD: {
|
||||
name: "Full HD",
|
||||
styles: {
|
||||
width: "1920px",
|
||||
height: "1080px",
|
||||
},
|
||||
},
|
||||
macBookProBig: {
|
||||
name: "MacBook Pro Big",
|
||||
styles: {
|
||||
width: "1024px",
|
||||
height: "640px",
|
||||
},
|
||||
},
|
||||
macBookProMedium: {
|
||||
name: "MacBook Pro Medium",
|
||||
styles: {
|
||||
width: "1440px",
|
||||
height: "900px",
|
||||
},
|
||||
},
|
||||
macBookProSmall: {
|
||||
name: "MacBook Pro Small",
|
||||
styles: {
|
||||
width: "1680px",
|
||||
height: "1050px",
|
||||
},
|
||||
},
|
||||
pcAgent: {
|
||||
name: "PC Agent",
|
||||
styles: {
|
||||
width: "960px",
|
||||
height: "540px",
|
||||
},
|
||||
},
|
||||
iphone12Pro: {
|
||||
name: "Iphone 12 pro",
|
||||
styles: {
|
||||
width: "390px",
|
||||
height: "844px",
|
||||
},
|
||||
},
|
||||
iphone5se: {
|
||||
name: "Iphone 5/SE",
|
||||
styles: {
|
||||
width: "320px",
|
||||
height: "568px",
|
||||
},
|
||||
},
|
||||
ipadPro: {
|
||||
name: "Ipad pro",
|
||||
styles: {
|
||||
width: "1240px",
|
||||
height: "1366px",
|
||||
},
|
||||
},
|
||||
"Galaxy s9+": {
|
||||
name: "Galaxy S9+",
|
||||
styles: {
|
||||
width: "320px",
|
||||
height: "658px",
|
||||
},
|
||||
}
|
||||
},
|
||||
},
|
||||
options: {
|
||||
storySort: (a, b) =>
|
||||
getHardCodedWeight(b[1].kind) - getHardCodedWeight(a[1].kind),
|
||||
},
|
||||
};
|
||||
|
||||
const { getHardCodedWeight } = (() => {
|
||||
|
||||
const orderedPagesPrefix = [
|
||||
"Introduction",
|
||||
"login/login.ftl",
|
||||
"login/register.ftl",
|
||||
"login/terms.ftl",
|
||||
"login/error.ftl",
|
||||
"login/code.ftl",
|
||||
"login/delete-account-confirm.ftl",
|
||||
"login/delete-credential.ftl",
|
||||
"login/frontchannel-logout.ftl",
|
||||
"login/idp-review-user-profile.ftl",
|
||||
"login/info.ftl",
|
||||
"login/login-config-totp.ftl",
|
||||
"login/login-idp-link-confirm.ftl",
|
||||
"login/login-idp-link-email.ftl",
|
||||
"login/login-oauth-grant.ftl",
|
||||
"login/login-otp.ftl",
|
||||
"login/login-page-expired.ftl",
|
||||
"login/login-password.ftl",
|
||||
"login/login-reset-otp.ftl",
|
||||
"login/login-reset-password.ftl",
|
||||
"login/login-update-password.ftl",
|
||||
"login/login-update-profile.ftl",
|
||||
"login/login-username.ftl",
|
||||
"login/login-verify-email.ftl",
|
||||
"login/login-x509-info.ftl",
|
||||
"login/logout-confirm.ftl",
|
||||
"login/saml-post-form.ftl",
|
||||
"login/select-authenticator.ftl",
|
||||
"login/update-email.ftl",
|
||||
"login/webauthn-authenticate.ftl",
|
||||
"login/webauthn-error.ftl",
|
||||
"login/webauthn-register.ftl",
|
||||
"login/login-oauth2-device-verify-user-code.ftl",
|
||||
"login/login-recovery-authn-code-config.ftl",
|
||||
"login/login-recovery-authn-code-input.ftl",
|
||||
"account/account.ftl",
|
||||
"account/password.ftl",
|
||||
"account/federatedIdentity.ftl",
|
||||
"account/log.ftl",
|
||||
"account/sessions.ftl",
|
||||
"account/totp.ftl",
|
||||
];
|
||||
|
||||
function getHardCodedWeight(kind) {
|
||||
|
||||
for (let i = 0; i < orderedPagesPrefix.length; i++) {
|
||||
if (kind.toLowerCase().startsWith(orderedPagesPrefix[i].toLowerCase())) {
|
||||
return orderedPagesPrefix.length - i;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
return { getHardCodedWeight };
|
||||
})();
|
@ -1 +0,0 @@
|
||||
storybook.keycloakify.dev
|
Before Width: | Height: | Size: 33 KiB |
Before Width: | Height: | Size: 92 KiB |
Before Width: | Height: | Size: 30 KiB |
@ -1,9 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<browserconfig>
|
||||
<msapplication>
|
||||
<tile>
|
||||
<square150x150logo src="/mstile-150x150.png"/>
|
||||
<TileColor>#da532c</TileColor>
|
||||
</tile>
|
||||
</msapplication>
|
||||
</browserconfig>
|
Before Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 19 KiB |
@ -1,193 +0,0 @@
|
||||
<?xml version="1.0" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
|
||||
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
|
||||
<svg version="1.0" xmlns="http://www.w3.org/2000/svg"
|
||||
width="447.000000pt" height="447.000000pt" viewBox="0 0 447.000000 447.000000"
|
||||
preserveAspectRatio="xMidYMid meet">
|
||||
<metadata>
|
||||
Created by potrace 1.14, written by Peter Selinger 2001-2017
|
||||
</metadata>
|
||||
<g transform="translate(0.000000,447.000000) scale(0.100000,-0.100000)"
|
||||
fill="#000000" stroke="none">
|
||||
<path d="M2177 4413 c-3 -2 -17 -6 -33 -9 -85 -15 -204 -109 -286 -225 -95
|
||||
-133 -229 -437 -263 -597 -4 -18 -10 -30 -13 -28 -4 2 -7 -11 -8 -30 0 -19 -3
|
||||
-36 -6 -39 -3 -4 -23 1 -44 10 -51 22 -213 73 -289 92 -301 73 -516 74 -670 3
|
||||
-124 -57 -186 -153 -188 -295 -1 -67 5 -128 18 -180 3 -13 15 -45 26 -70 43
|
||||
-99 57 -135 53 -135 -3 0 4 -10 16 -22 11 -12 20 -26 20 -31 0 -5 9 -22 21
|
||||
-38 11 -16 18 -29 14 -29 -3 0 4 -10 15 -22 11 -12 18 -28 15 -36 -2 -7 -1
|
||||
-11 3 -8 4 2 19 -12 32 -32 13 -20 33 -47 44 -59 11 -13 17 -23 13 -23 -3 0
|
||||
12 -19 33 -42 22 -24 38 -49 35 -55 -2 -7 -1 -12 4 -10 4 1 32 -25 62 -58 30
|
||||
-33 88 -94 131 -135 l76 -75 -71 -70 c-112 -110 -174 -181 -262 -300 -106
|
||||
-144 -142 -202 -203 -325 -9 -19 -21 -38 -27 -42 -5 -4 -7 -8 -3 -8 4 0 -4
|
||||
-27 -18 -60 -25 -63 -58 -199 -50 -208 3 -2 1 -12 -4 -22 -5 -10 -6 -20 -3
|
||||
-24 4 -4 8 -23 10 -44 9 -107 77 -201 183 -251 33 -16 56 -32 52 -36 -4 -5 -2
|
||||
-5 4 -2 6 4 44 1 85 -6 41 -7 102 -12 136 -12 41 1 60 -2 55 -9 -3 -6 2 -5 11
|
||||
3 11 8 44 14 86 15 38 0 67 4 64 9 -4 6 10 8 79 11 14 0 24 3 22 5 -4 4 33 14
|
||||
145 37 13 3 33 10 43 15 11 6 26 8 34 5 10 -4 12 -2 8 6 -5 8 -2 9 9 5 10 -3
|
||||
17 -2 17 3 0 6 8 10 18 10 9 0 36 9 58 19 32 15 45 16 54 8 9 -9 11 -9 8 2 -2
|
||||
7 2 15 8 18 10 3 23 -34 38 -108 2 -8 6 -21 9 -29 15 -36 70 -206 70 -217 0
|
||||
-7 4 -13 8 -13 11 0 30 -61 22 -74 -3 -6 -3 -8 2 -4 8 7 86 -135 88 -159 0 -7
|
||||
4 -13 8 -13 13 0 39 -56 31 -66 -4 -5 -3 -6 2 -2 5 4 22 -12 39 -35 17 -23 49
|
||||
-59 71 -80 23 -21 40 -42 39 -47 -2 -6 0 -9 5 -8 15 3 63 -22 68 -37 3 -8 10
|
||||
-12 15 -10 5 3 22 -1 39 -10 17 -9 35 -13 40 -10 6 3 10 2 10 -2 0 -5 12 -8
|
||||
28 -8 15 1 33 -4 41 -9 11 -8 13 -8 8 0 -4 7 7 13 33 17 21 3 53 12 71 21 17
|
||||
9 36 13 42 9 5 -3 7 -1 3 5 -3 6 3 13 14 17 11 3 20 11 20 16 0 5 5 9 11 9 5
|
||||
0 7 -6 3 -13 -4 -7 -3 -9 2 -4 5 5 9 12 9 17 0 4 14 21 30 37 69 67 162 196
|
||||
179 251 4 12 12 20 17 16 5 -3 8 -2 7 3 -1 4 6 29 17 56 14 33 24 45 35 41 11
|
||||
-4 12 -2 4 6 -14 14 -6 52 9 43 5 -3 7 -2 4 4 -3 5 8 45 24 88 17 44 33 86 35
|
||||
94 7 34 56 206 59 209 1 1 15 -3 31 -9 16 -7 34 -13 39 -15 61 -18 144 -51
|
||||
139 -56 -3 -4 3 -4 14 -1 11 2 23 0 26 -6 4 -5 14 -7 23 -4 9 4 14 2 10 -3 -3
|
||||
-5 7 -9 21 -8 34 1 63 -6 58 -15 -2 -3 19 -7 47 -9 28 -2 55 -6 61 -10 13 -8
|
||||
18 -9 79 -10 27 -1 46 -5 44 -9 -3 -5 20 -6 50 -5 44 3 54 1 48 -10 -6 -10 -5
|
||||
-11 6 0 16 15 33 16 23 0 -5 -7 -3 -8 7 -3 7 5 29 10 49 12 74 5 116 11 135
|
||||
18 11 4 37 13 57 21 28 10 38 11 41 1 4 -8 6 -7 6 3 1 8 21 28 46 44 43 26 92
|
||||
86 109 131 28 73 27 217 -3 313 -5 18 -10 33 -9 35 2 23 -118 257 -184 356
|
||||
-44 67 -124 177 -138 191 -3 3 -34 39 -70 80 -36 41 -97 107 -137 146 l-72 71
|
||||
25 22 c14 12 30 19 36 15 6 -4 8 -3 4 4 -3 6 24 42 61 80 38 38 86 91 108 117
|
||||
22 27 46 54 53 61 6 7 12 17 12 23 0 6 3 11 8 11 4 0 22 22 41 50 19 27 37 47
|
||||
41 45 4 -3 7 3 6 13 0 9 5 16 12 14 8 -1 11 2 7 7 -5 9 36 83 55 101 5 5 101
|
||||
200 121 245 7 18 26 84 36 125 2 8 4 27 5 42 0 16 5 25 11 21 6 -4 7 -1 2 7
|
||||
-11 18 -11 62 0 80 5 8 4 11 -2 7 -6 -4 -12 10 -16 36 -6 51 -10 70 -18 77 -3
|
||||
3 -15 21 -27 41 -42 70 -184 145 -292 155 -205 20 -451 -18 -709 -108 -30 -10
|
||||
-60 -17 -68 -14 -8 3 -12 2 -9 -3 5 -7 -42 -31 -60 -31 -1 0 -5 15 -9 33 -18
|
||||
86 -108 342 -156 444 -17 35 -29 66 -29 69 1 4 -2 10 -7 13 -5 3 -24 32 -42
|
||||
64 -108 190 -245 296 -403 311 -20 2 -39 2 -41 -1z m53 -124 c0 -5 5 -7 10 -4
|
||||
14 9 52 -4 45 -16 -3 -5 0 -6 8 -4 17 7 69 -33 61 -47 -5 -7 -2 -8 5 -4 13 8
|
||||
43 -23 35 -36 -3 -4 1 -6 8 -3 7 2 24 -11 38 -31 14 -19 30 -41 35 -47 50 -56
|
||||
148 -233 139 -249 -4 -6 -3 -9 2 -5 12 7 97 -192 90 -210 -3 -8 -2 -12 3 -9
|
||||
11 7 45 -120 35 -135 -4 -8 -3 -9 4 -5 7 4 12 3 12 -3 0 -5 3 -16 6 -25 4 -11
|
||||
-23 -30 -113 -75 -138 -71 -276 -145 -350 -189 -29 -17 -53 -29 -53 -26 0 3
|
||||
-7 -1 -15 -10 -14 -14 -19 -13 -53 6 -20 11 -62 34 -92 51 -30 16 -59 33 -65
|
||||
37 -5 4 -86 47 -180 95 -93 48 -173 91 -177 94 -11 10 3 52 15 44 6 -3 7 -1 3
|
||||
6 -9 14 12 113 22 107 4 -2 8 7 8 20 2 24 42 134 53 144 3 3 7 12 9 20 2 8 17
|
||||
44 33 80 24 50 32 61 40 50 8 -11 9 -10 4 7 -5 17 10 47 60 123 36 55 71 98
|
||||
76 94 5 -3 9 -2 8 3 -4 23 2 35 17 29 8 -3 12 -2 9 3 -7 12 60 78 100 99 25
|
||||
13 70 27 98 31 4 1 7 -4 7 -10z m-1411 -783 c9 -6 12 -5 8 1 -4 6 10 10 34 11
|
||||
29 1 38 -1 33 -11 -5 -9 -4 -9 7 1 7 6 19 12 27 12 8 0 10 -5 6 -12 -6 -10 -5
|
||||
-10 7 -1 9 7 26 10 40 8 13 -3 47 -8 74 -11 63 -7 155 -23 175 -31 15 -6 35
|
||||
-10 71 -12 12 -1 17 -5 13 -13 -4 -7 -3 -8 4 -4 6 4 31 1 54 -5 24 -7 49 -13
|
||||
55 -15 25 -5 73 -29 73 -37 0 -5 4 -6 9 -3 12 8 41 -4 41 -16 0 -5 -4 -6 -10
|
||||
-3 -6 3 -7 -1 -4 -9 3 -9 1 -45 -5 -81 -6 -36 -14 -91 -17 -122 -4 -32 -11
|
||||
-61 -18 -65 -8 -6 -7 -8 2 -8 7 0 11 -4 8 -8 -3 -4 -8 -42 -11 -83 -4 -40 -9
|
||||
-81 -12 -89 -3 -8 -6 -44 -8 -80 -1 -36 -3 -65 -4 -65 -1 0 -3 -27 -4 -61 -3
|
||||
-66 0 -62 -92 -139 -33 -27 -62 -53 -63 -58 -2 -4 -8 -5 -13 -1 -5 3 -9 1 -9
|
||||
-3 0 -5 -41 -44 -91 -88 -50 -43 -98 -85 -106 -93 -13 -14 -23 -6 -91 64 -86
|
||||
90 -172 188 -186 213 -5 9 -12 18 -16 21 -12 9 -106 154 -139 215 -18 33 -37
|
||||
66 -43 72 -6 7 -8 20 -4 28 3 9 2 14 -3 11 -19 -12 -102 225 -105 296 0 27 -4
|
||||
48 -7 48 -16 0 9 108 32 142 22 31 125 81 151 74 10 -2 18 0 18 5 0 5 14 7 30
|
||||
5 17 -2 30 0 30 4 0 9 42 7 59 -4z m2823 1 c6 -9 8 -9 8 1 0 7 4 10 10 7 5 -3
|
||||
29 -8 52 -11 113 -13 201 -66 197 -118 0 -5 4 -12 10 -15 9 -6 11 -27 11 -124
|
||||
0 -16 -4 -26 -9 -23 -5 3 -7 -2 -4 -13 11 -41 -89 -307 -110 -294 -6 3 -7 1
|
||||
-3 -6 13 -20 -142 -281 -166 -281 -6 0 -8 -3 -5 -7 11 -10 -51 -84 -197 -238
|
||||
l-86 -89 -47 44 c-26 25 -52 50 -58 55 -7 6 -39 33 -71 61 -33 29 -86 73 -119
|
||||
100 -86 69 -87 71 -90 112 -5 69 -16 207 -21 242 -4 33 -10 92 -18 170 -4 37
|
||||
-14 114 -21 165 -2 17 -9 52 -14 80 -5 27 -9 50 -8 51 50 22 109 44 129 48 15
|
||||
2 36 10 48 16 12 6 28 9 35 6 8 -3 15 -1 17 5 2 5 19 11 39 13 20 2 40 6 45 9
|
||||
5 3 29 8 54 12 25 4 48 9 52 11 5 3 8 -1 8 -8 0 -9 2 -10 8 -2 9 16 43 21 61
|
||||
10 10 -7 12 -6 6 4 -6 10 -3 12 12 8 12 -3 25 -3 31 1 20 12 206 11 214 -2z
|
||||
m-1950 -189 c23 -13 46 -27 49 -31 3 -5 9 -8 13 -7 15 3 64 -25 59 -34 -3 -5
|
||||
-1 -6 5 -2 14 9 63 -14 55 -27 -3 -6 -2 -7 4 -4 5 3 56 -21 113 -53 57 -33
|
||||
107 -60 111 -60 4 0 11 -5 15 -12 5 -8 2 -9 -9 -5 -9 3 -16 2 -14 -2 1 -5 -48
|
||||
-42 -110 -83 -61 -40 -144 -95 -183 -123 -40 -27 -80 -54 -89 -60 -9 -5 -18
|
||||
-12 -21 -15 -17 -17 -80 -60 -80 -54 0 3 -9 -4 -20 -17 l-20 -24 6 105 c3 58
|
||||
7 121 9 140 2 19 5 52 6 72 1 20 5 36 8 34 3 -2 7 19 7 47 2 79 15 149 31 176
|
||||
8 13 10 20 4 17 -6 -4 -11 -2 -11 3 0 6 4 11 10 11 5 0 7 7 4 15 -8 20 -4 19
|
||||
48 -7z m1114 -66 c3 -26 8 -56 10 -67 10 -50 19 -145 19 -192 0 -28 3 -49 7
|
||||
-47 4 3 6 -16 5 -41 -1 -25 0 -45 3 -45 3 0 6 -32 7 -70 2 -39 -1 -70 -5 -70
|
||||
-5 0 -18 9 -30 20 -12 11 -26 20 -31 20 -5 0 -17 10 -25 22 -9 12 -16 19 -16
|
||||
15 0 -6 -92 56 -135 90 -25 20 -253 169 -278 182 -15 8 -26 15 -25 16 9 7 158
|
||||
95 184 108 17 9 34 13 38 10 3 -4 6 -1 6 5 0 11 175 102 197 102 7 0 13 4 13
|
||||
9 0 5 8 11 18 13 20 4 29 -14 38 -80z m-531 -268 c30 -20 55 -41 55 -45 0 -5
|
||||
6 -8 13 -6 6 1 11 -4 9 -11 -1 -8 2 -11 7 -7 14 8 82 -38 76 -52 -2 -7 2 -10
|
||||
11 -6 8 3 25 -3 37 -14 12 -11 35 -27 50 -37 16 -9 25 -22 21 -28 -4 -7 -3 -8
|
||||
4 -4 10 6 242 -148 250 -166 2 -5 9 -8 16 -8 7 0 21 -9 31 -20 17 -19 14 -24
|
||||
-10 -21 -5 1 -3 -4 5 -11 12 -10 15 -40 16 -138 0 -77 -4 -128 -10 -132 -7 -5
|
||||
-7 -8 -1 -8 12 0 14 -259 2 -277 -5 -7 -4 -13 1 -13 12 0 7 -79 -5 -90 -7 -7
|
||||
-244 -174 -287 -203 -10 -6 -24 -16 -30 -22 -12 -10 -34 -26 -211 -146 -96
|
||||
-65 -108 -71 -131 -60 -14 6 -22 16 -19 21 3 5 0 7 -7 5 -8 -3 -23 4 -35 15
|
||||
-12 11 -24 20 -27 20 -5 0 -246 166 -271 187 -5 4 -30 22 -55 38 -25 17 -49
|
||||
33 -55 38 -5 4 -44 31 -85 61 l-75 54 0 337 c1 317 2 338 19 351 11 7 23 11
|
||||
29 7 6 -3 7 -1 3 5 -4 7 3 17 18 24 14 6 26 15 26 20 0 4 7 8 15 8 8 0 15 5
|
||||
15 11 0 6 7 8 16 5 8 -3 13 -2 9 3 -3 5 12 20 32 32 21 13 41 27 44 32 4 5 12
|
||||
6 19 2 8 -5 11 -4 7 2 -9 15 38 44 60 37 12 -4 14 -3 6 3 -9 6 1 19 37 46 27
|
||||
20 54 37 59 37 5 0 11 3 13 8 5 12 131 95 144 95 7 0 12 4 11 8 -2 8 51 47 66
|
||||
48 4 1 32 -15 62 -35z m-822 -752 c2 -270 4 -262 -48 -215 -12 10 -41 34 -65
|
||||
53 -43 33 -83 67 -157 136 l-34 31 57 49 c177 153 219 185 228 176 4 -4 7 -2
|
||||
6 3 -4 17 0 29 6 23 3 -4 6 -119 7 -256z m1539 245 c7 -7 26 -20 41 -30 15
|
||||
-10 25 -23 21 -29 -4 -7 -3 -8 4 -4 7 4 12 2 12 -3 0 -6 6 -10 13 -8 6 1 11
|
||||
-4 9 -11 -1 -8 2 -11 7 -8 5 4 14 -2 20 -11 5 -10 13 -18 18 -18 4 0 7 -3 6
|
||||
-7 -2 -5 1 -7 5 -5 5 1 37 -22 71 -52 l62 -54 -53 -49 c-29 -27 -66 -59 -81
|
||||
-71 -16 -12 -34 -27 -41 -33 -43 -40 -129 -105 -133 -101 -2 3 0 14 6 25 7 13
|
||||
7 23 -2 32 -9 10 -9 14 1 17 6 3 9 9 6 14 -5 9 -8 289 -4 314 1 6 2 14 1 19
|
||||
-4 22 -8 86 -5 86 1 0 9 -6 16 -13z m-1862 -353 c48 -45 72 -65 109 -93 17
|
||||
-13 31 -30 31 -37 0 -8 3 -13 8 -13 21 4 32 -3 32 -18 0 -9 3 -14 6 -10 4 3
|
||||
13 -1 21 -9 8 -8 30 -26 49 -40 18 -15 31 -31 27 -37 -3 -5 -2 -7 4 -4 23 14
|
||||
43 -19 48 -78 10 -127 16 -186 40 -410 4 -33 10 -79 14 -102 5 -27 4 -46 -3
|
||||
-54 -8 -9 -8 -10 0 -6 7 4 14 -2 17 -13 3 -11 0 -20 -5 -20 -6 0 -5 -6 2 -15
|
||||
7 -8 10 -26 8 -40 -3 -13 -1 -22 3 -19 5 3 9 1 9 -5 0 -8 -35 -25 -50 -23 -3
|
||||
0 -14 -5 -25 -11 -11 -6 -22 -12 -25 -12 -3 -1 -36 -11 -75 -23 -61 -18 -120
|
||||
-33 -190 -48 -11 -2 -40 -7 -65 -10 -25 -3 -49 -8 -53 -11 -5 -3 -70 -6 -145
|
||||
-8 -122 -3 -168 0 -263 18 -72 14 -145 78 -155 136 -3 20 -8 44 -11 54 -2 9
|
||||
-1 17 4 17 4 0 8 17 7 37 -1 50 6 74 20 66 8 -4 8 -3 0 6 -12 14 33 164 47
|
||||
155 5 -3 6 2 3 10 -3 9 6 36 20 62 14 26 26 53 26 60 0 8 5 14 10 14 6 0 10 5
|
||||
10 11 0 22 93 168 103 162 6 -3 7 -2 4 4 -10 17 64 118 77 105 4 -3 5 0 2 8
|
||||
-4 9 12 35 39 65 25 28 73 80 106 117 34 38 65 65 70 62 5 -3 8 -2 7 3 -5 13
|
||||
26 42 37 35 6 -3 26 -21 45 -38z m2364 -103 c-1 -3 7 -12 18 -19 10 -7 15 -18
|
||||
12 -24 -4 -6 -2 -8 3 -5 6 4 21 -8 34 -25 13 -17 29 -36 34 -42 30 -33 63 -84
|
||||
58 -90 -4 -3 -1 -6 5 -6 17 0 85 -108 76 -121 -4 -7 -3 -9 3 -6 13 8 106 -169
|
||||
97 -185 -4 -6 -3 -8 3 -5 12 7 36 -50 28 -63 -3 -4 1 -10 9 -13 7 -3 17 -23
|
||||
21 -44 5 -21 10 -45 12 -53 2 -8 4 -24 6 -35 1 -11 6 -23 10 -26 5 -3 8 -36 8
|
||||
-73 0 -178 -108 -238 -417 -231 -78 2 -150 5 -161 8 -10 3 -34 8 -53 11 -19 3
|
||||
-48 8 -65 11 -114 22 -337 94 -329 106 3 5 -2 6 -12 2 -12 -5 -15 -2 -11 13 6
|
||||
20 16 78 22 129 2 17 6 46 9 65 3 19 8 60 11 90 3 30 8 69 11 87 2 17 7 62 10
|
||||
100 3 37 10 73 15 80 7 7 6 14 -1 18 -6 3 -7 12 -3 18 4 6 6 26 5 45 -2 25 1
|
||||
32 10 26 10 -6 10 -5 2 7 -16 21 -6 71 18 88 11 8 30 25 41 38 11 12 24 23 29
|
||||
23 4 0 25 16 45 36 63 60 110 94 118 86 5 -4 5 -2 2 4 -4 7 9 24 29 39 20 15
|
||||
49 40 66 57 l30 29 71 -72 c40 -39 71 -74 71 -78z m-1901 -294 c-3 -5 -2 -7 4
|
||||
-4 12 8 83 -39 83 -55 0 -6 3 -8 6 -5 7 7 136 -80 142 -95 2 -4 10 -8 18 -8 8
|
||||
0 14 -3 14 -8 0 -4 20 -18 45 -32 25 -14 45 -28 45 -32 0 -5 5 -8 10 -8 12 0
|
||||
124 -72 128 -82 2 -5 11 -8 20 -8 10 0 -36 -32 -101 -70 -65 -39 -124 -67
|
||||
-130 -64 -7 4 -8 3 -4 -2 5 -5 -41 -33 -110 -66 -80 -38 -120 -52 -125 -45 -3
|
||||
7 -9 32 -12 57 -3 25 -8 58 -11 74 -3 15 -8 49 -11 75 -3 25 -7 62 -9 81 -2
|
||||
19 -7 62 -10 94 -3 33 -8 64 -11 68 -3 4 0 8 6 8 6 0 8 5 4 11 -3 6 -8 43 -11
|
||||
82 -5 65 -4 70 11 58 9 -7 13 -18 9 -24z m1261 -64 c-4 -94 -9 -162 -18 -228
|
||||
-2 -16 -7 -55 -10 -85 -4 -30 -8 -62 -10 -70 -1 -8 -7 -37 -11 -65 -5 -27 -10
|
||||
-53 -11 -57 -1 -5 -2 -13 -3 -20 -1 -9 -4 -9 -13 0 -7 7 -20 12 -30 12 -10 0
|
||||
-18 5 -18 12 0 6 -3 9 -6 5 -4 -3 -54 19 -113 50 -58 31 -123 64 -143 75 -21
|
||||
10 -38 23 -38 29 0 6 -4 8 -9 5 -5 -3 -19 2 -32 12 -13 10 -37 24 -52 32 -25
|
||||
12 -26 15 -10 24 10 6 22 11 26 11 4 0 11 5 15 12 4 6 13 13 21 15 8 2 24 12
|
||||
36 23 13 12 36 27 52 35 15 8 35 21 43 28 8 7 18 12 23 12 4 0 16 8 26 18 42
|
||||
37 52 43 64 36 6 -4 9 -3 4 1 -9 11 43 46 56 38 6 -3 7 -2 4 4 -3 5 27 33 68
|
||||
62 41 28 77 56 80 61 12 20 13 8 9 -87z m-524 -403 c8 -5 30 -17 48 -26 17 -9
|
||||
32 -21 32 -26 0 -5 4 -7 9 -3 5 3 36 -11 68 -30 32 -19 63 -35 69 -35 5 0 21
|
||||
-10 34 -22 14 -13 25 -21 25 -18 1 8 154 -64 155 -73 0 -5 -4 -5 -10 -2 -6 4
|
||||
-7 -1 -3 -10 3 -10 0 -21 -8 -26 -11 -6 -11 -9 -1 -9 9 0 10 -5 4 -17 -5 -10
|
||||
-15 -40 -21 -68 -7 -27 -18 -63 -26 -80 -7 -16 -24 -58 -36 -92 -13 -34 -28
|
||||
-59 -33 -56 -5 3 -6 1 -3 -4 9 -14 -22 -75 -34 -68 -5 4 -6 -1 -3 -10 4 -9 -5
|
||||
-33 -20 -55 -14 -22 -26 -42 -26 -46 0 -3 -19 -33 -42 -67 -185 -267 -312
|
||||
-305 -471 -142 -56 56 -164 205 -150 205 4 0 3 4 -3 8 -14 8 -97 164 -109 202
|
||||
-4 14 -16 43 -26 65 -25 55 -76 216 -81 251 -2 23 1 29 14 28 10 -1 16 1 14 5
|
||||
-3 4 19 18 47 31 29 13 55 29 59 35 4 5 8 7 8 3 0 -4 23 6 50 22 28 16 50 26
|
||||
50 22 0 -4 4 -2 8 3 4 6 25 19 47 30 22 11 47 25 55 31 38 28 169 92 176 86 4
|
||||
-4 4 -2 1 5 -19 32 42 11 133 -47z"/>
|
||||
<path d="M2556 3192 c-3 -5 1 -9 9 -9 8 0 12 4 9 9 -3 4 -7 8 -9 8 -2 0 -6 -4
|
||||
-9 -8z"/>
|
||||
<path d="M2455 2831 c-3 -5 -2 -12 3 -15 5 -3 9 1 9 9 0 17 -3 19 -12 6z"/>
|
||||
<path d="M2500 2790 c-9 -6 -10 -10 -3 -10 6 0 15 5 18 10 8 12 4 12 -15 0z"/>
|
||||
<path d="M2144 2592 c-70 -35 -108 -103 -100 -179 3 -38 32 -93 62 -118 9 -7
|
||||
1 -43 -31 -140 -65 -196 -66 -176 5 -173 33 2 60 -1 60 -5 0 -5 4 -6 8 -3 13
|
||||
8 227 10 239 3 18 -11 23 7 13 39 -6 16 -28 83 -49 149 l-39 120 29 27 c16 16
|
||||
29 30 29 33 0 22 1 26 8 22 4 -3 8 20 8 51 3 88 -33 145 -108 176 -44 19 -96
|
||||
18 -134 -2z"/>
|
||||
<path d="M1113 2105 c0 -8 4 -12 9 -9 5 3 6 10 3 15 -9 13 -12 11 -12 -6z"/>
|
||||
<path d="M859 1903 c-13 -16 -12 -17 4 -4 9 7 17 15 17 17 0 8 -8 3 -21 -13z"/>
|
||||
<path d="M1436 1803 c-6 -14 -5 -15 5 -6 7 7 10 15 7 18 -3 3 -9 -2 -12 -12z"/>
|
||||
<path d="M3760 1596 c0 -2 8 -10 18 -17 15 -13 16 -12 3 4 -13 16 -21 21 -21
|
||||
13z"/>
|
||||
<path d="M1616 1691 c-3 -5 2 -15 12 -22 15 -12 16 -12 5 2 -7 9 -10 19 -6 22
|
||||
3 4 4 7 0 7 -3 0 -8 -4 -11 -9z"/>
|
||||
<path d="M2710 1590 c0 -5 5 -10 11 -10 5 0 7 5 4 10 -3 6 -8 10 -11 10 -2 0
|
||||
-4 -4 -4 -10z"/>
|
||||
<path d="M1090 831 c0 -6 4 -13 10 -16 6 -3 7 1 4 9 -7 18 -14 21 -14 7z"/>
|
||||
</g>
|
||||
</svg>
|
Before Width: | Height: | Size: 13 KiB |
@ -1,19 +0,0 @@
|
||||
{
|
||||
"name": "",
|
||||
"short_name": "",
|
||||
"icons": [
|
||||
{
|
||||
"src": "/android-chrome-192x192.png",
|
||||
"sizes": "192x192",
|
||||
"type": "image/png"
|
||||
},
|
||||
{
|
||||
"src": "/android-chrome-384x384.png",
|
||||
"sizes": "384x384",
|
||||
"type": "image/png"
|
||||
}
|
||||
],
|
||||
"theme_color": "#ffffff",
|
||||
"background_color": "#ffffff",
|
||||
"display": "standalone"
|
||||
}
|
@ -1,37 +0,0 @@
|
||||
/* latin */
|
||||
@font-face {
|
||||
font-family: 'Work Sans';
|
||||
font-style: normal;
|
||||
font-weight: normal;
|
||||
/*400*/
|
||||
font-display: swap;
|
||||
src: url("./worksans-regular-webfont.woff2") format("woff2");
|
||||
}
|
||||
|
||||
/* latin */
|
||||
@font-face {
|
||||
font-family: 'Work Sans';
|
||||
font-style: normal;
|
||||
font-weight: 500;
|
||||
font-display: swap;
|
||||
src: url("./worksans-medium-webfont.woff2") format("woff2");
|
||||
}
|
||||
|
||||
/* latin */
|
||||
@font-face {
|
||||
font-family: 'Work Sans';
|
||||
font-style: normal;
|
||||
font-weight: 600;
|
||||
font-display: swap;
|
||||
src: url("./worksans-semibold-webfont.woff2") format("woff2");
|
||||
}
|
||||
|
||||
/* latin */
|
||||
@font-face {
|
||||
font-family: 'Work Sans';
|
||||
font-style: normal;
|
||||
font-weight: bold;
|
||||
/*700*/
|
||||
font-display: swap;
|
||||
src: url("./worksans-bold-webfont.woff2") format("woff2");
|
||||
}
|
Before Width: | Height: | Size: 102 KiB |
Before Width: | Height: | Size: 104 KiB |
213
CHANGELOG.md
Normal file
@ -0,0 +1,213 @@
|
||||
### **0.1.3** (2021-03-07)
|
||||
|
||||
- Implement LoginVerifyEmail
|
||||
- Implement login-reset-password.ftl
|
||||
|
||||
### **0.1.2** (2021-03-07)
|
||||
|
||||
- Fix build
|
||||
- Fix build
|
||||
|
||||
### **0.1.1** (2021-03-06)
|
||||
|
||||
- Implement Error page
|
||||
- rename pageBasename by pageId
|
||||
- Implement reactive programing for language switching
|
||||
- Add Info page, refactor
|
||||
|
||||
## **0.1.0** (2021-03-05)
|
||||
|
||||
- Rename keycloakify
|
||||
|
||||
### **0.0.33** (2021-03-05)
|
||||
|
||||
- Fix syncronization with non react pages
|
||||
|
||||
### **0.0.32** (2021-03-05)
|
||||
|
||||
- bump version
|
||||
- Add log to tell when we are using react
|
||||
- Fix missing parentesis
|
||||
|
||||
### **0.0.31** (2021-03-05)
|
||||
|
||||
- Fix typo
|
||||
- Fix register page 500
|
||||
|
||||
### **0.0.30** (2021-03-05)
|
||||
|
||||
- Edit language statistique
|
||||
|
||||
### **0.0.30** (2021-03-05)
|
||||
|
||||
- avoid escaping urls
|
||||
- Use default value instead of value
|
||||
- Fix double single quote problem in messages
|
||||
- Fix typo
|
||||
- Fix non editable username
|
||||
- Fix some bugs
|
||||
- Fix Object.deepAssign
|
||||
- Make the dongle to download smaller
|
||||
- Split kcContext among pages
|
||||
- Implement register
|
||||
|
||||
### **0.0.29** (2021-03-04)
|
||||
|
||||
- Fix build
|
||||
- Fix i18n
|
||||
- Login appear to be working now
|
||||
- closer but not there yet
|
||||
|
||||
### **0.0.28** (2021-03-03)
|
||||
|
||||
- fix build
|
||||
- There is no reason not to let use translations outside of keycloak
|
||||
|
||||
### **0.0.27** (2021-03-02)
|
||||
|
||||
- Implement entrypoint
|
||||
|
||||
### **0.0.26** (2021-03-02)
|
||||
|
||||
- Login page implemented
|
||||
- Implement login
|
||||
- remove unesseary log
|
||||
|
||||
### **0.0.25** (2021-03-02)
|
||||
|
||||
- Fix build and reduce size
|
||||
- Implement the template
|
||||
|
||||
### **0.0.24** (2021-03-01)
|
||||
|
||||
- update
|
||||
- update
|
||||
- update
|
||||
|
||||
### **0.0.23** (2021-03-01)
|
||||
|
||||
- update
|
||||
|
||||
### **0.0.23** (2021-03-01)
|
||||
|
||||
- update
|
||||
- update
|
||||
|
||||
### **0.0.23** (2021-03-01)
|
||||
|
||||
- update
|
||||
- update
|
||||
|
||||
### **0.0.23** (2021-03-01)
|
||||
|
||||
- update
|
||||
- Handle formatting in translation function
|
||||
|
||||
### **0.0.22** (2021-02-28)
|
||||
|
||||
- Split page messages
|
||||
|
||||
### **0.0.21** (2021-02-28)
|
||||
|
||||
- Restore yarn file
|
||||
- Multiple fixes
|
||||
- Update deps
|
||||
- Update deps
|
||||
- includes translations
|
||||
- Update README.md
|
||||
- improve docs
|
||||
- update
|
||||
- Update README.md
|
||||
- update
|
||||
- update
|
||||
- update
|
||||
- update
|
||||
|
||||
### **0.0.20** (2021-02-27)
|
||||
|
||||
- update
|
||||
- update
|
||||
|
||||
### **0.0.19** (2021-02-27)
|
||||
|
||||
- update
|
||||
- update
|
||||
|
||||
### **0.0.18** (2021-02-23)
|
||||
|
||||
- Bump version number
|
||||
- Moving on with implementation of the lib
|
||||
- Update readme
|
||||
- Readme eddit
|
||||
- Fixing video link
|
||||
|
||||
### **0.0.16** (2021-02-23)
|
||||
|
||||
- Bump version
|
||||
- Give test container credentials
|
||||
|
||||
### **0.0.14** (2021-02-23)
|
||||
|
||||
- Bump version number
|
||||
- enable the docker container to be run from the root of the react project
|
||||
|
||||
### **0.0.13** (2021-02-23)
|
||||
|
||||
- bump version
|
||||
|
||||
### **0.0.12** (2021-02-23)
|
||||
|
||||
- update readme
|
||||
|
||||
### **0.0.11** (2021-02-23)
|
||||
|
||||
- Add documentation
|
||||
|
||||
### **0.0.10** (2021-02-23)
|
||||
|
||||
- Remove extra closing bracket
|
||||
|
||||
### **0.0.9** (2021-02-22)
|
||||
|
||||
- fix container startup script
|
||||
- minor update
|
||||
|
||||
### **0.0.8** (2021-02-21)
|
||||
|
||||
- Include theme properties
|
||||
|
||||
### **0.0.7** (2021-02-21)
|
||||
|
||||
- fix build
|
||||
- Fix bundle
|
||||
|
||||
### **0.0.6** (2021-02-21)
|
||||
|
||||
- Include missing files in the release bundle
|
||||
|
||||
### **0.0.5** (2021-02-21)
|
||||
|
||||
- Bump version number
|
||||
- Make the install faster
|
||||
|
||||
### **0.0.4** (2021-02-21)
|
||||
|
||||
- Fix script visibility
|
||||
|
||||
### **0.0.3** (2021-02-21)
|
||||
|
||||
- Do not run tests on window
|
||||
- Add script for downloading base themes
|
||||
- Generate debug files to be able to test the container
|
||||
- Fix many little bugs
|
||||
- refactor
|
||||
- Almoste there
|
||||
- Things are starting to take form
|
||||
- Seems to be working
|
||||
- First draft
|
||||
- Remove eslint and prettyer
|
||||
|
||||
### **0.0.2** (2021-02-20)
|
||||
|
||||
- Update package.json
|
||||
|
@ -1,3 +0,0 @@
|
||||
Looking to contribute? Thank you! PR are more than welcome.
|
||||
|
||||
Please refers to [this documentation page](https://docs.keycloakify.dev/faq-and-help/contributing) that will help you get started.
|
198
README.md
@ -2,182 +2,98 @@
|
||||
<img src="https://user-images.githubusercontent.com/6702424/109387840-eba11f80-7903-11eb-9050-db1dad883f78.png">
|
||||
</p>
|
||||
<p align="center">
|
||||
<i>🔏 Keycloak Theming for the Modern Web 🔏</i>
|
||||
<i>🔏 Keycloak theme generator for Reacts app 🔏</i>
|
||||
<br>
|
||||
<br>
|
||||
<a href="https://github.com/garronej/keycloakify/actions">
|
||||
<img src="https://github.com/keycloakify/keycloakify/actions/workflows/ci.yaml/badge.svg">
|
||||
</a>
|
||||
<a href="https://www.npmjs.com/package/keycloakify">
|
||||
<img src="https://img.shields.io/npm/dm/keycloakify">
|
||||
</a>
|
||||
<a href="https://github.com/garronej/keycloakify/blob/main/LICENSE">
|
||||
<img src="https://img.shields.io/npm/l/keycloakify">
|
||||
</a>
|
||||
<a href="https://github.com/thomasdarimont/awesome-keycloak">
|
||||
<img src="https://awesome.re/mentioned-badge.svg"/>
|
||||
</a>
|
||||
<p align="center">
|
||||
Check out our discord server!<br/>
|
||||
<a href="https://discord.gg/mJdYJSdcm4">
|
||||
<img src="https://dcbadge.limes.pink/api/server/kYFZG7fQmn"/>
|
||||
</a>
|
||||
</p>
|
||||
<p align="center">
|
||||
<a href="https://www.keycloakify.dev">Home</a>
|
||||
-
|
||||
<a href="https://docs.keycloakify.dev">Documentation</a>
|
||||
-
|
||||
<a href="https://storybook.keycloakify.dev">Storybook</a>
|
||||
-
|
||||
<a href="https://github.com/codegouvfr/keycloakify-starter">Starter project</a>
|
||||
</p>
|
||||
<img src="https://github.com/garronej/keycloakify/workflows/ci/badge.svg?branch=develop">
|
||||
<img src="https://img.shields.io/bundlephobia/minzip/keycloakify">
|
||||
<img src="https://img.shields.io/npm/dw/keycloakify">
|
||||
<img src="https://img.shields.io/npm/l/keycloakify">
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
<i>This build tool generates a Keycloak theme <a href="https://www.keycloakify.dev">Learn more</a></i>
|
||||
<br/>
|
||||
<br/>
|
||||
<img width="400" src="https://github.com/user-attachments/assets/6bf3bef9-00b0-4460-97b9-0d2da8500798">
|
||||
</p>
|
||||
|
||||
Keycloakify is fully compatible with Keycloak from version 11 to 26...[and beyond](https://github.com/keycloakify/keycloakify/discussions/346#discussioncomment-5889791)
|
||||
|
||||
> 📣 **Keycloakify 26 Released**
|
||||
> Themes built with Keycloakify versions **prior** to Keycloak 26 are **incompatible** with Keycloak 26.
|
||||
> To ensure compatibility, simply upgrade to the latest Keycloakify version for your major release (v10 or v11) and rebuild your theme.
|
||||
> No breaking changes have been introduced, but the target version ranges have been updated. For more details, see [this guide](https://docs.keycloakify.dev/features/compiler-options/keycloakversiontargets).
|
||||
**!!! This module is under active developement. It is not usable yet!!!**
|
||||
|
||||
## Sponsors
|
||||
# Motivations
|
||||
|
||||
Project backers, we trust and recommend their services.
|
||||
The problem:
|
||||
|
||||
<br/>
|
||||

|
||||
|
||||
<div align="center">
|
||||
When we redirected to Keycloak the user suffers from a harsh context switch.
|
||||
On je login/register pages the language is set back to default and the theme is different that the one on the app.
|
||||
|
||||

|
||||
Keycloak does offer a way to customize theses pages but it requires a lot of raw HTML/CSS hacking
|
||||
to reproduce the look and feel of a specific app. Not mentioning the maintenance cost of such an endeavour.
|
||||
|
||||
</div>
|
||||
Wouldn't it be great if we could just design the login and register pages as if they where part of our app while
|
||||
still letting Keycloak handle the heavy lifting of actually authenticating the users?
|
||||
|
||||
<div align="center">
|
||||
Here is `yarn add keycloakify` for you 🍸
|
||||
|
||||

|
||||
TODO: Insert video after.
|
||||
|
||||
</div>
|
||||
# How to use
|
||||
|
||||
<br/>
|
||||
## Setting up the build tool
|
||||
|
||||
<p align="center">
|
||||
<i><a href="https://phasetwo.io/?utm_source=keycloakify"><strong>Keycloak as a Service</strong></a> - Keycloak community contributors of popular <a href="https://github.com/p2-inc#our-extensions-?utm_source=keycloakify">extensions</a> providing free and dedicated <a href="https://phasetwo.io/hosting/?utm_source=keycloakify">Keycloak hosting</a> and enterprise <a href="https://phasetwo.io/support/?utm_source=keycloakify">Keycloak support</a> to businesses of all sizes.</i>
|
||||
</p>
|
||||
Add `keycloakify` to the dev dependencies of your project `npm install --save-dev keycloakify` or `yarn add --dev keycloakify`
|
||||
then configure your `package.json` build's script to build the keycloak's theme by adding `&& build-keycloak-theme`.
|
||||
|
||||
<br/>
|
||||
<br/>
|
||||
<br/>
|
||||
Typically you will get:
|
||||
|
||||
<div align="center">
|
||||
`package.json`:
|
||||
```json
|
||||
"devDependencies": {
|
||||
"keycloakify": "^0.0.10"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "react-scripts build && build-keycloak-theme"
|
||||
},
|
||||
```
|
||||
|
||||

|
||||
Then build your app with `yarn run build` or `npm run build`, you will be provided with instructions
|
||||
about how to load the theme into Keycloak.
|
||||
|
||||
</div>
|
||||
[](https://youtu.be/xTz0Rj7i2v8)
|
||||
|
||||
<div align="center">
|
||||
## Developing your login and register pages in your React app
|
||||
|
||||

|
||||
TODO
|
||||
|
||||
</div>
|
||||
# How to implement context persistance
|
||||
|
||||
<br/>
|
||||
If you want dark mode preference, language and others users preferences your can do so
|
||||
very easily by using [`powerhooks/useGlobalState`](https://github.com/garronej/powerhooks)
|
||||
|
||||
<p align="center">
|
||||
<a href="https://www.zone2.tech/services/keycloak-consulting">
|
||||
<i><strong>Keycloak Consulting Services</strong> - Your partner in Keycloak deployment, configuration, and extension development for optimized identity management solutions.</i>
|
||||
</a>
|
||||
</p>
|
||||
WARNING: `powerhooks` is still a work in progress.
|
||||
|
||||
<div align="center">
|
||||
# REQUIREMENTS
|
||||
|
||||

|
||||
This tools assumes you are bundling your app with Webpack (tested with 4.44.2) .
|
||||
It assumes there is a `build/` directory at the root of your react project directory containing a `index.html` file
|
||||
and a `static/` directory generated by webpack.
|
||||
|
||||
</div>
|
||||
**All this is defaults with [`create-react-app`](https://create-react-app.dev)** (tested with 4.0.3=)
|
||||
|
||||
<div align="center">
|
||||
- For building the theme: `mvn` (Maven) must be installed
|
||||
- For development, (testing the theme in a local container ): `rm`, `mkdir`, `wget`, `unzip` are assumed to be available
|
||||
and `docker` up and running.
|
||||
|
||||

|
||||
NOTE: This build tool has only be tested on MacOS.
|
||||
|
||||
</div>
|
||||
# API Reference
|
||||
|
||||
<p align="center">
|
||||
<a href="https://cloud-iam.com/?mtm_campaign=keycloakify-deal&mtm_source=keycloakify-github"><strong>Managed Keycloak Provider</strong> - With Cloud-IAM powering your Keycloak clusters, you can sleep easy knowing you've got the software and the experts you need for operational excellence. Cloud IAM is a french company. </a>
|
||||
<br/>
|
||||
Use code <code>keycloakify5</code> at checkout for a 5% discount.
|
||||
</p>
|
||||
## The build tool
|
||||
|
||||
## Contributors ✨
|
||||
Part of the lib that runs with node, at build time.
|
||||
|
||||
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
|
||||
- `npx build-keycloak-theme`: Builds the theme, the CWD is assumed to be the root of your react project.
|
||||
- `npx download-sample-keycloak-themes`: Downloads the keycloak default themes (for development purposes)
|
||||
|
||||
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
|
||||
<!-- prettier-ignore-start -->
|
||||
<!-- markdownlint-disable -->
|
||||
<table>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://github.com/lordvlad"><img src="https://avatars.githubusercontent.com/u/1217769?v=4?s=100" width="100px;" alt="Waldemar Reusch"/><br /><sub><b>Waldemar Reusch</b></sub></a><br /><a href="https://github.com/keycloakify/keycloakify/commits?author=lordvlad" title="Code">💻</a></td>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://willwill96.github.io/the-ui-dawg-static-site/en/introduction/"><img src="https://avatars.githubusercontent.com/u/10997562?v=4?s=100" width="100px;" alt="William Will"/><br /><sub><b>William Will</b></sub></a><br /><a href="https://github.com/keycloakify/keycloakify/commits?author=willwill96" title="Code">💻</a></td>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://github.com/Ann2827"><img src="https://avatars.githubusercontent.com/u/32645809?v=4?s=100" width="100px;" alt="Bystrova Ann"/><br /><sub><b>Bystrova Ann</b></sub></a><br /><a href="https://github.com/keycloakify/keycloakify/commits?author=Ann2827" title="Code">💻</a></td>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://github.com/mkreuzmayr"><img src="https://avatars.githubusercontent.com/u/20108212?v=4?s=100" width="100px;" alt="Michael Kreuzmayr"/><br /><sub><b>Michael Kreuzmayr</b></sub></a><br /><a href="https://github.com/keycloakify/keycloakify/commits?author=mkreuzmayr" title="Code">💻</a></td>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://coolmathgames.tech"><img src="https://avatars.githubusercontent.com/u/6877780?v=4?s=100" width="100px;" alt="Mary "/><br /><sub><b>Mary </b></sub></a><br /><a href="https://github.com/keycloakify/keycloakify/commits?author=Mstrodl" title="Code">💻</a></td>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://tasyp.xyz/"><img src="https://avatars.githubusercontent.com/u/6623212?v=4?s=100" width="100px;" alt="German Öö"/><br /><sub><b>German Öö</b></sub></a><br /><a href="https://github.com/keycloakify/keycloakify/commits?author=Tasyp" title="Code">💻</a></td>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://revolunet.com"><img src="https://avatars.githubusercontent.com/u/124937?v=4?s=100" width="100px;" alt="Julien Bouquillon"/><br /><sub><b>Julien Bouquillon</b></sub></a><br /><a href="https://github.com/keycloakify/keycloakify/commits?author=revolunet" title="Code">💻</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://github.com/aidangilmore"><img src="https://avatars.githubusercontent.com/u/32880357?v=4?s=100" width="100px;" alt="Aidan Gilmore"/><br /><sub><b>Aidan Gilmore</b></sub></a><br /><a href="https://github.com/keycloakify/keycloakify/commits?author=aidangilmore" title="Code">💻</a></td>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://github.com/0x-Void"><img src="https://avatars.githubusercontent.com/u/32745739?v=4?s=100" width="100px;" alt="Void"/><br /><sub><b>Void</b></sub></a><br /><a href="https://github.com/keycloakify/keycloakify/commits?author=0x-Void" title="Code">💻</a></td>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://github.com/juffe"><img src="https://avatars.githubusercontent.com/u/5393231?v=4?s=100" width="100px;" alt="juffe"/><br /><sub><b>juffe</b></sub></a><br /><a href="https://github.com/keycloakify/keycloakify/commits?author=juffe" title="Code">💻</a></td>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://github.com/lazToum"><img src="https://avatars.githubusercontent.com/u/4764837?v=4?s=100" width="100px;" alt="Lazaros Toumanidis"/><br /><sub><b>Lazaros Toumanidis</b></sub></a><br /><a href="https://github.com/keycloakify/keycloakify/commits?author=lazToum" title="Code">💻</a></td>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://github.com/marcmrf"><img src="https://avatars.githubusercontent.com/u/9928519?v=4?s=100" width="100px;" alt="Marc"/><br /><sub><b>Marc</b></sub></a><br /><a href="https://github.com/keycloakify/keycloakify/commits?author=marcmrf" title="Code">💻</a></td>
|
||||
<td align="center" valign="top" width="14.28%"><a href="http://kasir-barati.github.io"><img src="https://avatars.githubusercontent.com/u/73785723?v=4?s=100" width="100px;" alt="Kasir Barati"/><br /><sub><b>Kasir Barati</b></sub></a><br /><a href="https://github.com/keycloakify/keycloakify/commits?author=kasir-barati" title="Documentation">📖</a></td>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://github.com/asashay"><img src="https://avatars.githubusercontent.com/u/10714670?v=4?s=100" width="100px;" alt="Alex Oliynyk"/><br /><sub><b>Alex Oliynyk</b></sub></a><br /><a href="https://github.com/keycloakify/keycloakify/commits?author=asashay" title="Code">💻</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://www.gravitysoftware.be"><img src="https://avatars.githubusercontent.com/u/1140574?v=4?s=100" width="100px;" alt="Thomas Silvestre"/><br /><sub><b>Thomas Silvestre</b></sub></a><br /><a href="https://github.com/keycloakify/keycloakify/commits?author=thosil" title="Code">💻</a></td>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://github.com/satanshiro"><img src="https://avatars.githubusercontent.com/u/38865738?v=4?s=100" width="100px;" alt="satanshiro"/><br /><sub><b>satanshiro</b></sub></a><br /><a href="https://github.com/keycloakify/keycloakify/commits?author=satanshiro" title="Code">💻</a></td>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://poelhekke.dev"><img src="https://avatars.githubusercontent.com/u/1632377?v=4?s=100" width="100px;" alt="Koen Poelhekke"/><br /><sub><b>Koen Poelhekke</b></sub></a><br /><a href="https://github.com/keycloakify/keycloakify/commits?author=kpoelhekke" title="Code">💻</a></td>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://github.com/zavoloklom"><img src="https://avatars.githubusercontent.com/u/4151869?v=4?s=100" width="100px;" alt="Sergey Kupletsky"/><br /><sub><b>Sergey Kupletsky</b></sub></a><br /><a href="https://github.com/keycloakify/keycloakify/commits?author=zavoloklom" title="Tests">⚠️</a> <a href="https://github.com/keycloakify/keycloakify/commits?author=zavoloklom" title="Code">💻</a></td>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://github.com/rome-user"><img src="https://avatars.githubusercontent.com/u/114131048?v=4?s=100" width="100px;" alt="rome-user"/><br /><sub><b>rome-user</b></sub></a><br /><a href="https://github.com/keycloakify/keycloakify/commits?author=rome-user" title="Code">💻</a></td>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://github.com/celinepelletier"><img src="https://avatars.githubusercontent.com/u/82821620?v=4?s=100" width="100px;" alt="Céline Pelletier"/><br /><sub><b>Céline Pelletier</b></sub></a><br /><a href="https://github.com/keycloakify/keycloakify/commits?author=celinepelletier" title="Code">💻</a></td>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://github.com/xgp"><img src="https://avatars.githubusercontent.com/u/244253?v=4?s=100" width="100px;" alt="Garth"/><br /><sub><b>Garth</b></sub></a><br /><a href="https://github.com/keycloakify/keycloakify/commits?author=xgp" title="Code">💻</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://github.com/BlackVoid"><img src="https://avatars.githubusercontent.com/u/673720?v=4?s=100" width="100px;" alt="Felix Gustavsson"/><br /><sub><b>Felix Gustavsson</b></sub></a><br /><a href="https://github.com/keycloakify/keycloakify/commits?author=BlackVoid" title="Code">💻</a></td>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://m-siemens.de/"><img src="https://avatars.githubusercontent.com/u/1873922?v=4?s=100" width="100px;" alt="Markus Siemens"/><br /><sub><b>Markus Siemens</b></sub></a><br /><a href="https://github.com/keycloakify/keycloakify/commits?author=msiemens" title="Code">💻</a></td>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://github.com/law108000"><img src="https://avatars.githubusercontent.com/u/8112024?v=4?s=100" width="100px;" alt="Rlok"/><br /><sub><b>Rlok</b></sub></a><br /><a href="https://github.com/keycloakify/keycloakify/commits?author=law108000" title="Code">💻</a></td>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://github.com/Moulyy"><img src="https://avatars.githubusercontent.com/u/115405804?v=4?s=100" width="100px;" alt="Moulyy"/><br /><sub><b>Moulyy</b></sub></a><br /><a href="https://github.com/keycloakify/keycloakify/commits?author=Moulyy" title="Code">💻</a></td>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://github.com/madmadson"><img src="https://avatars.githubusercontent.com/u/798831?v=4?s=100" width="100px;" alt="Tobias Matt"/><br /><sub><b>Tobias Matt</b></sub></a><br /><a href="https://github.com/keycloakify/keycloakify/commits?author=madmadson" title="Code">💻</a></td>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://github.com/oliviergoulet5"><img src="https://avatars.githubusercontent.com/u/17685861?v=4?s=100" width="100px;" alt="Olivier Goulet"/><br /><sub><b>Olivier Goulet</b></sub></a><br /><a href="https://github.com/keycloakify/keycloakify/commits?author=oliviergoulet5" title="Code">💻</a></td>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://github.com/liamlows"><img src="https://avatars.githubusercontent.com/u/1365914?v=4?s=100" width="100px;" alt="Liam Lowsley-Williams"/><br /><sub><b>Liam Lowsley-Williams</b></sub></a><br /><a href="https://github.com/keycloakify/keycloakify/commits?author=liamlows" title="Code">💻</a> <a href="https://github.com/keycloakify/keycloakify/commits?author=liamlows" title="Documentation">📖</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://www.linkedin.com/in/oes-rioniz/"><img src="https://avatars.githubusercontent.com/u/5172296?v=4?s=100" width="100px;" alt="Omid"/><br /><sub><b>Omid</b></sub></a><br /><a href="https://github.com/keycloakify/keycloakify/commits?author=uchar" title="Tests">⚠️</a> <a href="https://github.com/keycloakify/keycloakify/commits?author=uchar" title="Code">💻</a></td>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://github.com/kathari00"><img src="https://avatars.githubusercontent.com/u/42547712?v=4?s=100" width="100px;" alt="Katharina Eiserfey"/><br /><sub><b>Katharina Eiserfey</b></sub></a><br /><a href="https://github.com/keycloakify/keycloakify/commits?author=kathari00" title="Code">💻</a> <a href="https://github.com/keycloakify/keycloakify/commits?author=kathari00" title="Tests">⚠️</a> <a href="https://github.com/keycloakify/keycloakify/commits?author=kathari00" title="Documentation">📖</a></td>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://github.com/luca-peruzzo"><img src="https://avatars.githubusercontent.com/u/69015314?v=4?s=100" width="100px;" alt="Luca Peruzzo"/><br /><sub><b>Luca Peruzzo</b></sub></a><br /><a href="https://github.com/keycloakify/keycloakify/commits?author=luca-peruzzo" title="Code">💻</a> <a href="https://github.com/keycloakify/keycloakify/commits?author=luca-peruzzo" title="Tests">⚠️</a></td>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://github.com/nima70"><img src="https://avatars.githubusercontent.com/u/5094767?v=4?s=100" width="100px;" alt="Nima Shokouhfar"/><br /><sub><b>Nima Shokouhfar</b></sub></a><br /><a href="https://github.com/keycloakify/keycloakify/commits?author=nima70" title="Code">💻</a> <a href="https://github.com/keycloakify/keycloakify/commits?author=nima70" title="Tests">⚠️</a></td>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://mruder.dev"><img src="https://avatars.githubusercontent.com/u/18495294?v=4?s=100" width="100px;" alt="Marvin A. Ruder"/><br /><sub><b>Marvin A. Ruder</b></sub></a><br /><a href="https://github.com/keycloakify/keycloakify/issues?q=author%3Amarvinruder" title="Bug reports">🐛</a></td>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://github.com/zvn2060"><img src="https://avatars.githubusercontent.com/u/45450852?v=4?s=100" width="100px;" alt="HI_OuO"/><br /><sub><b>HI_OuO</b></sub></a><br /><a href="https://github.com/keycloakify/keycloakify/commits?author=zvn2060" title="Code">💻</a></td>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://github.com/tripheo0412"><img src="https://avatars.githubusercontent.com/u/25382052?v=4?s=100" width="100px;" alt="Tri Hoang"/><br /><sub><b>Tri Hoang</b></sub></a><br /><a href="https://github.com/keycloakify/keycloakify/commits?author=tripheo0412" title="Documentation">📖</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center" valign="top" width="14.28%"><a href="http://t.me/AAT_L"><img src="https://avatars.githubusercontent.com/u/118743608?v=4?s=100" width="100px;" alt="Lesha"/><br /><sub><b>Lesha</b></sub></a><br /><a href="https://github.com/keycloakify/keycloakify/commits?author=EternalSide" title="Code">💻</a></td>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://blog.bacongobbler.com"><img src="https://avatars.githubusercontent.com/u/1360539?v=4?s=100" width="100px;" alt="Matthew Fisher"/><br /><sub><b>Matthew Fisher</b></sub></a><br /><a href="https://github.com/keycloakify/keycloakify/commits?author=bacongobbler" title="Documentation">📖</a></td>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://github.com/kodebach"><img src="https://avatars.githubusercontent.com/u/23529132?v=4?s=100" width="100px;" alt="Klemens Böswirth"/><br /><sub><b>Klemens Böswirth</b></sub></a><br /><a href="https://github.com/keycloakify/keycloakify/commits?author=kodebach" title="Code">💻</a></td>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://github.com/wnmzzzz"><img src="https://avatars.githubusercontent.com/u/117174301?v=4?s=100" width="100px;" alt="wnmzzzz"/><br /><sub><b>wnmzzzz</b></sub></a><br /><a href="https://github.com/keycloakify/keycloakify/commits?author=wnmzzzz" title="Tests">⚠️</a></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
## The fronted lib ( imported into your react app )
|
||||
|
||||
<!-- markdownlint-restore -->
|
||||
<!-- prettier-ignore-end -->
|
||||
Part of the lib that you import in your react project and runs on the browser.
|
||||
|
||||
<!-- ALL-CONTRIBUTORS-LIST:END -->
|
||||
**TODO**
|
||||
|
1
bin/build-keycloak-theme/ftlValuesGlobalName.d.ts
vendored
Normal file
@ -0,0 +1 @@
|
||||
export declare const ftlValuesGlobalName = "kcContext";
|
5
bin/build-keycloak-theme/ftlValuesGlobalName.js
Normal file
@ -0,0 +1,5 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.ftlValuesGlobalName = void 0;
|
||||
exports.ftlValuesGlobalName = "kcContext";
|
||||
//# sourceMappingURL=ftlValuesGlobalName.js.map
|
1
bin/build-keycloak-theme/ftlValuesGlobalName.js.map
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"ftlValuesGlobalName.js","sourceRoot":"","sources":["../../src/bin/build-keycloak-theme/ftlValuesGlobalName.ts"],"names":[],"mappings":";;;AACa,QAAA,mBAAmB,GAAG,WAAW,CAAC"}
|
6
bin/build-keycloak-theme/generateDebugFiles/index.d.ts
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
export declare const containerLaunchScriptBasename = "start_keycloak_testing_container.sh";
|
||||
/** Files for being able to run a hot reload keycloak container */
|
||||
export declare function generateDebugFiles(params: {
|
||||
packageJsonName: string;
|
||||
keycloakThemeBuildingDirPath: string;
|
||||
}): void;
|
68
bin/build-keycloak-theme/generateDebugFiles/index.js
Normal file
@ -0,0 +1,68 @@
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.generateDebugFiles = exports.containerLaunchScriptBasename = void 0;
|
||||
var fs = __importStar(require("fs"));
|
||||
var path_1 = require("path");
|
||||
exports.containerLaunchScriptBasename = "start_keycloak_testing_container.sh";
|
||||
/** Files for being able to run a hot reload keycloak container */
|
||||
function generateDebugFiles(params) {
|
||||
var packageJsonName = params.packageJsonName, keycloakThemeBuildingDirPath = params.keycloakThemeBuildingDirPath;
|
||||
fs.writeFileSync(path_1.join(keycloakThemeBuildingDirPath, "Dockerfile"), Buffer.from([
|
||||
"FROM jboss/keycloak:11.0.3",
|
||||
"",
|
||||
"USER root",
|
||||
"",
|
||||
"WORKDIR /",
|
||||
"",
|
||||
"ADD configuration /opt/jboss/keycloak/standalone/configuration/",
|
||||
"",
|
||||
'ENTRYPOINT [ "/opt/jboss/tools/docker-entrypoint.sh" ]',
|
||||
].join("\n"), "utf8"));
|
||||
var dockerImage = packageJsonName + "/keycloak-hot-reload";
|
||||
var containerName = "keycloak-testing-container";
|
||||
fs.writeFileSync(path_1.join(keycloakThemeBuildingDirPath, exports.containerLaunchScriptBasename), Buffer.from([
|
||||
"#!/bin/bash",
|
||||
"",
|
||||
"cd " + keycloakThemeBuildingDirPath,
|
||||
"",
|
||||
"docker rm " + containerName + " || true",
|
||||
"",
|
||||
"docker build . -t " + dockerImage,
|
||||
"",
|
||||
"docker run \\",
|
||||
" -p 8080:8080 \\",
|
||||
"\t--name " + containerName + " \\",
|
||||
" -e KEYCLOAK_USER=admin \\",
|
||||
" -e KEYCLOAK_PASSWORD=admin \\",
|
||||
"\t-v " + path_1.join(keycloakThemeBuildingDirPath, "src", "main", "resources", "theme", packageJsonName) + ":/opt/jboss/keycloak/themes/" + packageJsonName + ":rw \\",
|
||||
"\t-it " + dockerImage + ":latest",
|
||||
""
|
||||
].join("\n"), "utf8"), { "mode": 493 });
|
||||
var standaloneHaFilePath = path_1.join(keycloakThemeBuildingDirPath, "configuration", "standalone-ha.xml");
|
||||
try {
|
||||
fs.mkdirSync(path_1.dirname(standaloneHaFilePath));
|
||||
}
|
||||
catch (_a) { }
|
||||
fs.writeFileSync(standaloneHaFilePath, fs.readFileSync(path_1.join(__dirname, path_1.basename(standaloneHaFilePath))));
|
||||
}
|
||||
exports.generateDebugFiles = generateDebugFiles;
|
||||
//# sourceMappingURL=index.js.map
|
1
bin/build-keycloak-theme/generateDebugFiles/index.js.map
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/bin/build-keycloak-theme/generateDebugFiles/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AACA,qCAAyB;AACzB,6BAA0F;AAE7E,QAAA,6BAA6B,GAAG,qCAAqC,CAAC;AAEnF,kEAAkE;AAClE,SAAgB,kBAAkB,CAC9B,MAGC;IAGO,IAAA,eAAe,GAAmC,MAAM,gBAAzC,EAAE,4BAA4B,GAAK,MAAM,6BAAX,CAAY;IAEjE,EAAE,CAAC,aAAa,CACZ,WAA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AAlED,gDAkEC"}
|
666
bin/build-keycloak-theme/generateDebugFiles/standalone-ha.xml
Normal file
@ -0,0 +1,666 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
|
||||
<server xmlns="urn:jboss:domain:13.0">
|
||||
<extensions>
|
||||
<extension module="org.jboss.as.clustering.infinispan"/>
|
||||
<extension module="org.jboss.as.clustering.jgroups"/>
|
||||
<extension module="org.jboss.as.connector"/>
|
||||
<extension module="org.jboss.as.deployment-scanner"/>
|
||||
<extension module="org.jboss.as.ee"/>
|
||||
<extension module="org.jboss.as.ejb3"/>
|
||||
<extension module="org.jboss.as.jaxrs"/>
|
||||
<extension module="org.jboss.as.jmx"/>
|
||||
<extension module="org.jboss.as.jpa"/>
|
||||
<extension module="org.jboss.as.logging"/>
|
||||
<extension module="org.jboss.as.mail"/>
|
||||
<extension module="org.jboss.as.modcluster"/>
|
||||
<extension module="org.jboss.as.naming"/>
|
||||
<extension module="org.jboss.as.remoting"/>
|
||||
<extension module="org.jboss.as.security"/>
|
||||
<extension module="org.jboss.as.transactions"/>
|
||||
<extension module="org.jboss.as.weld"/>
|
||||
<extension module="org.keycloak.keycloak-server-subsystem"/>
|
||||
<extension module="org.wildfly.extension.bean-validation"/>
|
||||
<extension module="org.wildfly.extension.core-management"/>
|
||||
<extension module="org.wildfly.extension.elytron"/>
|
||||
<extension module="org.wildfly.extension.io"/>
|
||||
<extension module="org.wildfly.extension.microprofile.config-smallrye"/>
|
||||
<extension module="org.wildfly.extension.microprofile.health-smallrye"/>
|
||||
<extension module="org.wildfly.extension.microprofile.metrics-smallrye"/>
|
||||
<extension module="org.wildfly.extension.request-controller"/>
|
||||
<extension module="org.wildfly.extension.security.manager"/>
|
||||
<extension module="org.wildfly.extension.undertow"/>
|
||||
</extensions>
|
||||
<management>
|
||||
<security-realms>
|
||||
<security-realm name="ManagementRealm">
|
||||
<authentication>
|
||||
<local default-user="$local" skip-group-loading="true"/>
|
||||
<properties path="mgmt-users.properties" relative-to="jboss.server.config.dir"/>
|
||||
</authentication>
|
||||
<authorization map-groups-to-roles="false">
|
||||
<properties path="mgmt-groups.properties" relative-to="jboss.server.config.dir"/>
|
||||
</authorization>
|
||||
</security-realm>
|
||||
<security-realm name="ApplicationRealm">
|
||||
<server-identities>
|
||||
<ssl>
|
||||
<keystore path="application.keystore" relative-to="jboss.server.config.dir" keystore-password="password" alias="server" key-password="password" generate-self-signed-certificate-host="localhost"/>
|
||||
</ssl>
|
||||
</server-identities>
|
||||
<authentication>
|
||||
<local default-user="$local" allowed-users="*" skip-group-loading="true"/>
|
||||
<properties path="application-users.properties" relative-to="jboss.server.config.dir"/>
|
||||
</authentication>
|
||||
<authorization>
|
||||
<properties path="application-roles.properties" relative-to="jboss.server.config.dir"/>
|
||||
</authorization>
|
||||
</security-realm>
|
||||
</security-realms>
|
||||
<audit-log>
|
||||
<formatters>
|
||||
<json-formatter name="json-formatter"/>
|
||||
</formatters>
|
||||
<handlers>
|
||||
<file-handler name="file" formatter="json-formatter" path="audit-log.log" relative-to="jboss.server.data.dir"/>
|
||||
</handlers>
|
||||
<logger log-boot="true" log-read-only="false" enabled="false">
|
||||
<handlers>
|
||||
<handler name="file"/>
|
||||
</handlers>
|
||||
</logger>
|
||||
</audit-log>
|
||||
<management-interfaces>
|
||||
<http-interface security-realm="ManagementRealm">
|
||||
<http-upgrade enabled="true"/>
|
||||
<socket-binding http="management-http"/>
|
||||
</http-interface>
|
||||
</management-interfaces>
|
||||
<access-control provider="simple">
|
||||
<role-mapping>
|
||||
<role name="SuperUser">
|
||||
<include>
|
||||
<user name="$local"/>
|
||||
</include>
|
||||
</role>
|
||||
</role-mapping>
|
||||
</access-control>
|
||||
</management>
|
||||
<profile>
|
||||
<subsystem xmlns="urn:jboss:domain:logging:8.0">
|
||||
<console-handler name="CONSOLE">
|
||||
<formatter>
|
||||
<named-formatter name="COLOR-PATTERN"/>
|
||||
</formatter>
|
||||
</console-handler>
|
||||
<logger category="com.arjuna">
|
||||
<level name="WARN"/>
|
||||
</logger>
|
||||
<logger category="io.jaegertracing.Configuration">
|
||||
<level name="WARN"/>
|
||||
</logger>
|
||||
<logger category="org.jboss.as.config">
|
||||
<level name="DEBUG"/>
|
||||
</logger>
|
||||
<logger category="sun.rmi">
|
||||
<level name="WARN"/>
|
||||
</logger>
|
||||
<logger category="org.keycloak">
|
||||
<level name="${env.KEYCLOAK_LOGLEVEL:INFO}"/>
|
||||
</logger>
|
||||
<root-logger>
|
||||
<level name="${env.ROOT_LOGLEVEL:INFO}"/>
|
||||
<handlers>
|
||||
<handler name="CONSOLE"/>
|
||||
</handlers>
|
||||
</root-logger>
|
||||
<formatter name="PATTERN">
|
||||
<pattern-formatter pattern="%d{yyyy-MM-dd HH:mm:ss,SSS} %-5p [%c] (%t) %s%e%n"/>
|
||||
</formatter>
|
||||
<formatter name="COLOR-PATTERN">
|
||||
<pattern-formatter pattern="%K{level}%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%e%n"/>
|
||||
</formatter>
|
||||
</subsystem>
|
||||
<subsystem xmlns="urn:jboss:domain:bean-validation:1.0"/>
|
||||
<subsystem xmlns="urn:jboss:domain:core-management:1.0"/>
|
||||
<subsystem xmlns="urn:jboss:domain:datasources:6.0">
|
||||
<datasources>
|
||||
<datasource jndi-name="java:jboss/datasources/ExampleDS" pool-name="ExampleDS" enabled="true" use-java-context="true" statistics-enabled="${wildfly.datasources.statistics-enabled:${wildfly.statistics-enabled:false}}">
|
||||
<connection-url>jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE</connection-url>
|
||||
<driver>h2</driver>
|
||||
<security>
|
||||
<user-name>sa</user-name>
|
||||
<password>sa</password>
|
||||
</security>
|
||||
</datasource>
|
||||
<datasource jndi-name="java:jboss/datasources/KeycloakDS" pool-name="KeycloakDS" enabled="true" use-java-context="true" statistics-enabled="${wildfly.datasources.statistics-enabled:${wildfly.statistics-enabled:false}}">
|
||||
<connection-url>jdbc:h2:${jboss.server.data.dir}/keycloak;AUTO_SERVER=TRUE</connection-url>
|
||||
<driver>h2</driver>
|
||||
<pool>
|
||||
<max-pool-size>100</max-pool-size>
|
||||
</pool>
|
||||
<security>
|
||||
<user-name>sa</user-name>
|
||||
<password>sa</password>
|
||||
</security>
|
||||
</datasource>
|
||||
<drivers>
|
||||
<driver name="h2" module="com.h2database.h2">
|
||||
<xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>
|
||||
</driver>
|
||||
</drivers>
|
||||
</datasources>
|
||||
</subsystem>
|
||||
<subsystem xmlns="urn:jboss:domain:deployment-scanner:2.0">
|
||||
<deployment-scanner path="deployments" relative-to="jboss.server.base.dir" scan-interval="5000" runtime-failure-causes-rollback="${jboss.deployment.scanner.rollback.on.failure:false}"/>
|
||||
</subsystem>
|
||||
<subsystem xmlns="urn:jboss:domain:ee:5.0">
|
||||
<spec-descriptor-property-replacement>false</spec-descriptor-property-replacement>
|
||||
<concurrent>
|
||||
<context-services>
|
||||
<context-service name="default" jndi-name="java:jboss/ee/concurrency/context/default" use-transaction-setup-provider="true"/>
|
||||
</context-services>
|
||||
<managed-thread-factories>
|
||||
<managed-thread-factory name="default" jndi-name="java:jboss/ee/concurrency/factory/default" context-service="default"/>
|
||||
</managed-thread-factories>
|
||||
<managed-executor-services>
|
||||
<managed-executor-service name="default" jndi-name="java:jboss/ee/concurrency/executor/default" context-service="default" hung-task-threshold="60000" keepalive-time="5000"/>
|
||||
</managed-executor-services>
|
||||
<managed-scheduled-executor-services>
|
||||
<managed-scheduled-executor-service name="default" jndi-name="java:jboss/ee/concurrency/scheduler/default" context-service="default" hung-task-threshold="60000" keepalive-time="3000"/>
|
||||
</managed-scheduled-executor-services>
|
||||
</concurrent>
|
||||
<default-bindings context-service="java:jboss/ee/concurrency/context/default" datasource="java:jboss/datasources/ExampleDS" managed-executor-service="java:jboss/ee/concurrency/executor/default" managed-scheduled-executor-service="java:jboss/ee/concurrency/scheduler/default" managed-thread-factory="java:jboss/ee/concurrency/factory/default"/>
|
||||
</subsystem>
|
||||
<subsystem xmlns="urn:jboss:domain:ejb3:7.0">
|
||||
<session-bean>
|
||||
<stateless>
|
||||
<bean-instance-pool-ref pool-name="slsb-strict-max-pool"/>
|
||||
</stateless>
|
||||
<stateful default-access-timeout="5000" cache-ref="distributable" passivation-disabled-cache-ref="simple"/>
|
||||
<singleton default-access-timeout="5000"/>
|
||||
</session-bean>
|
||||
<pools>
|
||||
<bean-instance-pools>
|
||||
<strict-max-pool name="mdb-strict-max-pool" derive-size="from-cpu-count" instance-acquisition-timeout="5" instance-acquisition-timeout-unit="MINUTES"/>
|
||||
<strict-max-pool name="slsb-strict-max-pool" derive-size="from-worker-pools" instance-acquisition-timeout="5" instance-acquisition-timeout-unit="MINUTES"/>
|
||||
</bean-instance-pools>
|
||||
</pools>
|
||||
<caches>
|
||||
<cache name="simple"/>
|
||||
<cache name="distributable" passivation-store-ref="infinispan" aliases="passivating clustered"/>
|
||||
</caches>
|
||||
<passivation-stores>
|
||||
<passivation-store name="infinispan" cache-container="ejb" max-size="10000"/>
|
||||
</passivation-stores>
|
||||
<async thread-pool-name="default"/>
|
||||
<timer-service thread-pool-name="default" default-data-store="default-file-store">
|
||||
<data-stores>
|
||||
<file-data-store name="default-file-store" path="timer-service-data" relative-to="jboss.server.data.dir"/>
|
||||
</data-stores>
|
||||
</timer-service>
|
||||
<remote connector-ref="http-remoting-connector" thread-pool-name="default">
|
||||
<channel-creation-options>
|
||||
<option name="MAX_OUTBOUND_MESSAGES" value="1234" type="remoting"/>
|
||||
</channel-creation-options>
|
||||
</remote>
|
||||
<thread-pools>
|
||||
<thread-pool name="default">
|
||||
<max-threads count="10"/>
|
||||
<keepalive-time time="60" unit="seconds"/>
|
||||
</thread-pool>
|
||||
</thread-pools>
|
||||
<default-security-domain value="other"/>
|
||||
<default-missing-method-permissions-deny-access value="true"/>
|
||||
<statistics enabled="${wildfly.ejb3.statistics-enabled:${wildfly.statistics-enabled:false}}"/>
|
||||
<log-system-exceptions value="true"/>
|
||||
</subsystem>
|
||||
<subsystem xmlns="urn:wildfly:elytron:10.0" final-providers="combined-providers" disallowed-providers="OracleUcrypto">
|
||||
<providers>
|
||||
<aggregate-providers name="combined-providers">
|
||||
<providers name="elytron"/>
|
||||
<providers name="openssl"/>
|
||||
</aggregate-providers>
|
||||
<provider-loader name="elytron" module="org.wildfly.security.elytron"/>
|
||||
<provider-loader name="openssl" module="org.wildfly.openssl"/>
|
||||
</providers>
|
||||
<audit-logging>
|
||||
<file-audit-log name="local-audit" path="audit.log" relative-to="jboss.server.log.dir" format="JSON"/>
|
||||
</audit-logging>
|
||||
<security-domains>
|
||||
<security-domain name="ApplicationDomain" default-realm="ApplicationRealm" permission-mapper="default-permission-mapper">
|
||||
<realm name="ApplicationRealm" role-decoder="groups-to-roles"/>
|
||||
<realm name="local"/>
|
||||
</security-domain>
|
||||
<security-domain name="ManagementDomain" default-realm="ManagementRealm" permission-mapper="default-permission-mapper">
|
||||
<realm name="ManagementRealm" role-decoder="groups-to-roles"/>
|
||||
<realm name="local" role-mapper="super-user-mapper"/>
|
||||
</security-domain>
|
||||
</security-domains>
|
||||
<security-realms>
|
||||
<identity-realm name="local" identity="$local"/>
|
||||
<properties-realm name="ApplicationRealm">
|
||||
<users-properties path="application-users.properties" relative-to="jboss.server.config.dir" digest-realm-name="ApplicationRealm"/>
|
||||
<groups-properties path="application-roles.properties" relative-to="jboss.server.config.dir"/>
|
||||
</properties-realm>
|
||||
<properties-realm name="ManagementRealm">
|
||||
<users-properties path="mgmt-users.properties" relative-to="jboss.server.config.dir" digest-realm-name="ManagementRealm"/>
|
||||
<groups-properties path="mgmt-groups.properties" relative-to="jboss.server.config.dir"/>
|
||||
</properties-realm>
|
||||
</security-realms>
|
||||
<mappers>
|
||||
<simple-permission-mapper name="default-permission-mapper" mapping-mode="first">
|
||||
<permission-mapping>
|
||||
<principal name="anonymous"/>
|
||||
<permission-set name="default-permissions"/>
|
||||
</permission-mapping>
|
||||
<permission-mapping match-all="true">
|
||||
<permission-set name="login-permission"/>
|
||||
<permission-set name="default-permissions"/>
|
||||
</permission-mapping>
|
||||
</simple-permission-mapper>
|
||||
<constant-realm-mapper name="local" realm-name="local"/>
|
||||
<simple-role-decoder name="groups-to-roles" attribute="groups"/>
|
||||
<constant-role-mapper name="super-user-mapper">
|
||||
<role name="SuperUser"/>
|
||||
</constant-role-mapper>
|
||||
</mappers>
|
||||
<permission-sets>
|
||||
<permission-set name="login-permission">
|
||||
<permission class-name="org.wildfly.security.auth.permission.LoginPermission"/>
|
||||
</permission-set>
|
||||
<permission-set name="default-permissions">
|
||||
<permission class-name="org.wildfly.extension.batch.jberet.deployment.BatchPermission" module="org.wildfly.extension.batch.jberet" target-name="*"/>
|
||||
<permission class-name="org.wildfly.transaction.client.RemoteTransactionPermission" module="org.wildfly.transaction.client"/>
|
||||
<permission class-name="org.jboss.ejb.client.RemoteEJBPermission" module="org.jboss.ejb-client"/>
|
||||
</permission-set>
|
||||
</permission-sets>
|
||||
<http>
|
||||
<http-authentication-factory name="management-http-authentication" security-domain="ManagementDomain" http-server-mechanism-factory="global">
|
||||
<mechanism-configuration>
|
||||
<mechanism mechanism-name="DIGEST">
|
||||
<mechanism-realm realm-name="ManagementRealm"/>
|
||||
</mechanism>
|
||||
</mechanism-configuration>
|
||||
</http-authentication-factory>
|
||||
<provider-http-server-mechanism-factory name="global"/>
|
||||
</http>
|
||||
<sasl>
|
||||
<sasl-authentication-factory name="application-sasl-authentication" sasl-server-factory="configured" security-domain="ApplicationDomain">
|
||||
<mechanism-configuration>
|
||||
<mechanism mechanism-name="JBOSS-LOCAL-USER" realm-mapper="local"/>
|
||||
<mechanism mechanism-name="DIGEST-MD5">
|
||||
<mechanism-realm realm-name="ApplicationRealm"/>
|
||||
</mechanism>
|
||||
</mechanism-configuration>
|
||||
</sasl-authentication-factory>
|
||||
<sasl-authentication-factory name="management-sasl-authentication" sasl-server-factory="configured" security-domain="ManagementDomain">
|
||||
<mechanism-configuration>
|
||||
<mechanism mechanism-name="JBOSS-LOCAL-USER" realm-mapper="local"/>
|
||||
<mechanism mechanism-name="DIGEST-MD5">
|
||||
<mechanism-realm realm-name="ManagementRealm"/>
|
||||
</mechanism>
|
||||
</mechanism-configuration>
|
||||
</sasl-authentication-factory>
|
||||
<configurable-sasl-server-factory name="configured" sasl-server-factory="elytron">
|
||||
<properties>
|
||||
<property name="wildfly.sasl.local-user.default-user" value="$local"/>
|
||||
</properties>
|
||||
</configurable-sasl-server-factory>
|
||||
<mechanism-provider-filtering-sasl-server-factory name="elytron" sasl-server-factory="global">
|
||||
<filters>
|
||||
<filter provider-name="WildFlyElytron"/>
|
||||
</filters>
|
||||
</mechanism-provider-filtering-sasl-server-factory>
|
||||
<provider-sasl-server-factory name="global"/>
|
||||
</sasl>
|
||||
</subsystem>
|
||||
<subsystem xmlns="urn:jboss:domain:infinispan:10.0">
|
||||
<cache-container name="keycloak" module="org.keycloak.keycloak-model-infinispan">
|
||||
<transport lock-timeout="60000"/>
|
||||
<local-cache name="realms">
|
||||
<object-memory size="10000"/>
|
||||
</local-cache>
|
||||
<local-cache name="users">
|
||||
<object-memory size="10000"/>
|
||||
</local-cache>
|
||||
<local-cache name="authorization">
|
||||
<object-memory size="10000"/>
|
||||
</local-cache>
|
||||
<local-cache name="keys">
|
||||
<object-memory size="1000"/>
|
||||
<expiration max-idle="3600000"/>
|
||||
</local-cache>
|
||||
<replicated-cache name="work"/>
|
||||
<distributed-cache name="sessions" owners="1"/>
|
||||
<distributed-cache name="authenticationSessions" owners="1"/>
|
||||
<distributed-cache name="offlineSessions" owners="1"/>
|
||||
<distributed-cache name="clientSessions" owners="1"/>
|
||||
<distributed-cache name="offlineClientSessions" owners="1"/>
|
||||
<distributed-cache name="loginFailures" owners="1"/>
|
||||
<distributed-cache name="actionTokens" owners="2">
|
||||
<object-memory size="-1"/>
|
||||
<expiration interval="300000" max-idle="-1"/>
|
||||
</distributed-cache>
|
||||
</cache-container>
|
||||
<cache-container name="server" aliases="singleton cluster" default-cache="default" module="org.wildfly.clustering.server">
|
||||
<transport lock-timeout="60000"/>
|
||||
<replicated-cache name="default">
|
||||
<transaction mode="BATCH"/>
|
||||
</replicated-cache>
|
||||
</cache-container>
|
||||
<cache-container name="web" default-cache="dist" module="org.wildfly.clustering.web.infinispan">
|
||||
<transport lock-timeout="60000"/>
|
||||
<replicated-cache name="sso">
|
||||
<locking isolation="REPEATABLE_READ"/>
|
||||
<transaction mode="BATCH"/>
|
||||
</replicated-cache>
|
||||
<distributed-cache name="dist">
|
||||
<locking isolation="REPEATABLE_READ"/>
|
||||
<transaction mode="BATCH"/>
|
||||
<file-store/>
|
||||
</distributed-cache>
|
||||
<distributed-cache name="routing"/>
|
||||
</cache-container>
|
||||
<cache-container name="ejb" aliases="sfsb" default-cache="dist" module="org.wildfly.clustering.ejb.infinispan">
|
||||
<transport lock-timeout="60000"/>
|
||||
<distributed-cache name="dist">
|
||||
<locking isolation="REPEATABLE_READ"/>
|
||||
<transaction mode="BATCH"/>
|
||||
<file-store/>
|
||||
</distributed-cache>
|
||||
</cache-container>
|
||||
<cache-container name="hibernate" module="org.infinispan.hibernate-cache">
|
||||
<transport lock-timeout="60000"/>
|
||||
<local-cache name="local-query">
|
||||
<object-memory size="10000"/>
|
||||
<expiration max-idle="100000"/>
|
||||
</local-cache>
|
||||
<invalidation-cache name="entity">
|
||||
<transaction mode="NON_XA"/>
|
||||
<object-memory size="10000"/>
|
||||
<expiration max-idle="100000"/>
|
||||
</invalidation-cache>
|
||||
<replicated-cache name="timestamps"/>
|
||||
</cache-container>
|
||||
</subsystem>
|
||||
<subsystem xmlns="urn:jboss:domain:io:3.0">
|
||||
<worker name="default"/>
|
||||
<buffer-pool name="default"/>
|
||||
</subsystem>
|
||||
<subsystem xmlns="urn:jboss:domain:jaxrs:2.0"/>
|
||||
<subsystem xmlns="urn:jboss:domain:jca:5.0">
|
||||
<archive-validation enabled="true" fail-on-error="true" fail-on-warn="false"/>
|
||||
<bean-validation enabled="true"/>
|
||||
<default-workmanager>
|
||||
<short-running-threads>
|
||||
<core-threads count="50"/>
|
||||
<queue-length count="50"/>
|
||||
<max-threads count="50"/>
|
||||
<keepalive-time time="10" unit="seconds"/>
|
||||
</short-running-threads>
|
||||
<long-running-threads>
|
||||
<core-threads count="50"/>
|
||||
<queue-length count="50"/>
|
||||
<max-threads count="50"/>
|
||||
<keepalive-time time="10" unit="seconds"/>
|
||||
</long-running-threads>
|
||||
</default-workmanager>
|
||||
<cached-connection-manager/>
|
||||
</subsystem>
|
||||
<subsystem xmlns="urn:jboss:domain:jgroups:8.0">
|
||||
<channels default="ee">
|
||||
<channel name="ee" stack="udp" cluster="ejb"/>
|
||||
</channels>
|
||||
<stacks>
|
||||
<stack name="udp">
|
||||
<transport type="UDP" socket-binding="jgroups-udp"/>
|
||||
<protocol type="PING"/>
|
||||
<protocol type="MERGE3"/>
|
||||
<socket-protocol type="FD_SOCK" socket-binding="jgroups-udp-fd"/>
|
||||
<protocol type="FD_ALL"/>
|
||||
<protocol type="VERIFY_SUSPECT"/>
|
||||
<protocol type="pbcast.NAKACK2"/>
|
||||
<protocol type="UNICAST3"/>
|
||||
<protocol type="pbcast.STABLE"/>
|
||||
<protocol type="pbcast.GMS"/>
|
||||
<protocol type="UFC"/>
|
||||
<protocol type="MFC"/>
|
||||
<protocol type="FRAG3"/>
|
||||
</stack>
|
||||
<stack name="tcp">
|
||||
<transport type="TCP" socket-binding="jgroups-tcp"/>
|
||||
<socket-protocol type="MPING" socket-binding="jgroups-mping"/>
|
||||
<protocol type="MERGE3"/>
|
||||
<socket-protocol type="FD_SOCK" socket-binding="jgroups-tcp-fd"/>
|
||||
<protocol type="FD_ALL"/>
|
||||
<protocol type="VERIFY_SUSPECT"/>
|
||||
<protocol type="pbcast.NAKACK2"/>
|
||||
<protocol type="UNICAST3"/>
|
||||
<protocol type="pbcast.STABLE"/>
|
||||
<protocol type="pbcast.GMS"/>
|
||||
<protocol type="MFC"/>
|
||||
<protocol type="FRAG3"/>
|
||||
</stack>
|
||||
</stacks>
|
||||
</subsystem>
|
||||
<subsystem xmlns="urn:jboss:domain:jmx:1.3">
|
||||
<expose-resolved-model/>
|
||||
<expose-expression-model/>
|
||||
<remoting-connector/>
|
||||
</subsystem>
|
||||
<subsystem xmlns="urn:jboss:domain:jpa:1.1">
|
||||
<jpa default-datasource="" default-extended-persistence-inheritance="DEEP"/>
|
||||
</subsystem>
|
||||
<subsystem xmlns="urn:jboss:domain:keycloak-server:1.1">
|
||||
<web-context>auth</web-context>
|
||||
<providers>
|
||||
<provider>
|
||||
classpath:${jboss.home.dir}/providers/*
|
||||
</provider>
|
||||
</providers>
|
||||
<master-realm-name>master</master-realm-name>
|
||||
<scheduled-task-interval>900</scheduled-task-interval>
|
||||
<theme>
|
||||
<staticMaxAge>-1</staticMaxAge>
|
||||
<cacheThemes>false</cacheThemes>
|
||||
<cacheTemplates>false</cacheTemplates>
|
||||
<welcomeTheme>${env.KEYCLOAK_WELCOME_THEME:keycloak}</welcomeTheme>
|
||||
<default>${env.KEYCLOAK_DEFAULT_THEME:keycloak}</default>
|
||||
<dir>${jboss.home.dir}/themes</dir>
|
||||
</theme>
|
||||
<spi name="eventsStore">
|
||||
<provider name="jpa" enabled="true">
|
||||
<properties>
|
||||
<property name="exclude-events" value="["REFRESH_TOKEN"]"/>
|
||||
</properties>
|
||||
</provider>
|
||||
</spi>
|
||||
<spi name="userCache">
|
||||
<provider name="default" enabled="true"/>
|
||||
</spi>
|
||||
<spi name="userSessionPersister">
|
||||
<default-provider>jpa</default-provider>
|
||||
</spi>
|
||||
<spi name="timer">
|
||||
<default-provider>basic</default-provider>
|
||||
</spi>
|
||||
<spi name="connectionsHttpClient">
|
||||
<provider name="default" enabled="true"/>
|
||||
</spi>
|
||||
<spi name="connectionsJpa">
|
||||
<provider name="default" enabled="true">
|
||||
<properties>
|
||||
<property name="dataSource" value="java:jboss/datasources/KeycloakDS"/>
|
||||
<property name="initializeEmpty" value="true"/>
|
||||
<property name="migrationStrategy" value="update"/>
|
||||
<property name="migrationExport" value="${jboss.home.dir}/keycloak-database-update.sql"/>
|
||||
</properties>
|
||||
</provider>
|
||||
</spi>
|
||||
<spi name="realmCache">
|
||||
<provider name="default" enabled="true"/>
|
||||
</spi>
|
||||
<spi name="connectionsInfinispan">
|
||||
<default-provider>default</default-provider>
|
||||
<provider name="default" enabled="true">
|
||||
<properties>
|
||||
<property name="cacheContainer" value="java:jboss/infinispan/container/keycloak"/>
|
||||
</properties>
|
||||
</provider>
|
||||
</spi>
|
||||
<spi name="jta-lookup">
|
||||
<default-provider>${keycloak.jta.lookup.provider:jboss}</default-provider>
|
||||
<provider name="jboss" enabled="true"/>
|
||||
</spi>
|
||||
<spi name="publicKeyStorage">
|
||||
<provider name="infinispan" enabled="true">
|
||||
<properties>
|
||||
<property name="minTimeBetweenRequests" value="10"/>
|
||||
</properties>
|
||||
</provider>
|
||||
</spi>
|
||||
<spi name="x509cert-lookup">
|
||||
<default-provider>${keycloak.x509cert.lookup.provider:default}</default-provider>
|
||||
<provider name="default" enabled="true"/>
|
||||
</spi>
|
||||
<spi name="hostname">
|
||||
<default-provider>${keycloak.hostname.provider:default}</default-provider>
|
||||
<provider name="default" enabled="true">
|
||||
<properties>
|
||||
<property name="frontendUrl" value="${keycloak.frontendUrl:}"/>
|
||||
<property name="forceBackendUrlToFrontendUrl" value="false"/>
|
||||
</properties>
|
||||
</provider>
|
||||
<provider name="fixed" enabled="true">
|
||||
<properties>
|
||||
<property name="hostname" value="${keycloak.hostname.fixed.hostname:localhost}"/>
|
||||
<property name="httpPort" value="${keycloak.hostname.fixed.httpPort:-1}"/>
|
||||
<property name="httpsPort" value="${keycloak.hostname.fixed.httpsPort:-1}"/>
|
||||
<property name="alwaysHttps" value="${keycloak.hostname.fixed.alwaysHttps:false}"/>
|
||||
</properties>
|
||||
</provider>
|
||||
</spi>
|
||||
</subsystem>
|
||||
<subsystem xmlns="urn:jboss:domain:mail:4.0">
|
||||
<mail-session name="default" jndi-name="java:jboss/mail/Default">
|
||||
<smtp-server outbound-socket-binding-ref="mail-smtp"/>
|
||||
</mail-session>
|
||||
</subsystem>
|
||||
<subsystem xmlns="urn:wildfly:microprofile-config-smallrye:1.0"/>
|
||||
<subsystem xmlns="urn:wildfly:microprofile-health-smallrye:2.0" security-enabled="false" empty-liveness-checks-status="${env.MP_HEALTH_EMPTY_LIVENESS_CHECKS_STATUS:UP}" empty-readiness-checks-status="${env.MP_HEALTH_EMPTY_READINESS_CHECKS_STATUS:UP}"/>
|
||||
<subsystem xmlns="urn:wildfly:microprofile-metrics-smallrye:2.0" security-enabled="false" exposed-subsystems="*" prefix="${wildfly.metrics.prefix:wildfly}"/>
|
||||
<subsystem xmlns="urn:jboss:domain:modcluster:5.0">
|
||||
<proxy name="default" advertise-socket="modcluster" listener="ajp">
|
||||
<dynamic-load-provider>
|
||||
<load-metric type="cpu"/>
|
||||
</dynamic-load-provider>
|
||||
</proxy>
|
||||
</subsystem>
|
||||
<subsystem xmlns="urn:jboss:domain:naming:2.0">
|
||||
<remote-naming/>
|
||||
</subsystem>
|
||||
<subsystem xmlns="urn:jboss:domain:remoting:4.0">
|
||||
<http-connector name="http-remoting-connector" connector-ref="default" security-realm="ApplicationRealm"/>
|
||||
</subsystem>
|
||||
<subsystem xmlns="urn:jboss:domain:request-controller:1.0"/>
|
||||
<subsystem xmlns="urn:jboss:domain:security:2.0">
|
||||
<security-domains>
|
||||
<security-domain name="other" cache-type="default">
|
||||
<authentication>
|
||||
<login-module code="Remoting" flag="optional">
|
||||
<module-option name="password-stacking" value="useFirstPass"/>
|
||||
</login-module>
|
||||
<login-module code="RealmDirect" flag="required">
|
||||
<module-option name="password-stacking" value="useFirstPass"/>
|
||||
</login-module>
|
||||
</authentication>
|
||||
</security-domain>
|
||||
<security-domain name="jboss-web-policy" cache-type="default">
|
||||
<authorization>
|
||||
<policy-module code="Delegating" flag="required"/>
|
||||
</authorization>
|
||||
</security-domain>
|
||||
<security-domain name="jaspitest" cache-type="default">
|
||||
<authentication-jaspi>
|
||||
<login-module-stack name="dummy">
|
||||
<login-module code="Dummy" flag="optional"/>
|
||||
</login-module-stack>
|
||||
<auth-module code="Dummy"/>
|
||||
</authentication-jaspi>
|
||||
</security-domain>
|
||||
<security-domain name="jboss-ejb-policy" cache-type="default">
|
||||
<authorization>
|
||||
<policy-module code="Delegating" flag="required"/>
|
||||
</authorization>
|
||||
</security-domain>
|
||||
</security-domains>
|
||||
</subsystem>
|
||||
<subsystem xmlns="urn:jboss:domain:security-manager:1.0">
|
||||
<deployment-permissions>
|
||||
<maximum-set>
|
||||
<permission class="java.security.AllPermission"/>
|
||||
</maximum-set>
|
||||
</deployment-permissions>
|
||||
</subsystem>
|
||||
<subsystem xmlns="urn:jboss:domain:transactions:5.0">
|
||||
<core-environment node-identifier="${jboss.tx.node.id:1}">
|
||||
<process-id>
|
||||
<uuid/>
|
||||
</process-id>
|
||||
</core-environment>
|
||||
<recovery-environment socket-binding="txn-recovery-environment" status-socket-binding="txn-status-manager"/>
|
||||
<coordinator-environment statistics-enabled="${wildfly.transactions.statistics-enabled:${wildfly.statistics-enabled:false}}"/>
|
||||
<object-store path="tx-object-store" relative-to="jboss.server.data.dir"/>
|
||||
</subsystem>
|
||||
<subsystem xmlns="urn:jboss:domain:undertow:11.0" default-server="default-server" default-virtual-host="default-host" default-servlet-container="default" default-security-domain="other" statistics-enabled="${wildfly.undertow.statistics-enabled:${wildfly.statistics-enabled:false}}">
|
||||
<buffer-cache name="default"/>
|
||||
<server name="default-server">
|
||||
<ajp-listener name="ajp" socket-binding="ajp"/>
|
||||
<http-listener name="default" read-timeout="30000" socket-binding="http" redirect-socket="https" proxy-address-forwarding="${env.PROXY_ADDRESS_FORWARDING:false}" enable-http2="true"/>
|
||||
<https-listener name="https" read-timeout="30000" socket-binding="https" proxy-address-forwarding="${env.PROXY_ADDRESS_FORWARDING:false}" security-realm="ApplicationRealm" enable-http2="true"/>
|
||||
<host name="default-host" alias="localhost">
|
||||
<location name="/" handler="welcome-content"/>
|
||||
<http-invoker security-realm="ApplicationRealm"/>
|
||||
</host>
|
||||
</server>
|
||||
<servlet-container name="default">
|
||||
<jsp-config/>
|
||||
<websockets/>
|
||||
</servlet-container>
|
||||
<handlers>
|
||||
<file name="welcome-content" path="${jboss.home.dir}/welcome-content"/>
|
||||
</handlers>
|
||||
</subsystem>
|
||||
<subsystem xmlns="urn:jboss:domain:weld:4.0"/>
|
||||
</profile>
|
||||
<interfaces>
|
||||
<interface name="management">
|
||||
<inet-address value="${jboss.bind.address.management:127.0.0.1}"/>
|
||||
</interface>
|
||||
<interface name="private">
|
||||
<inet-address value="${jboss.bind.address.private:127.0.0.1}"/>
|
||||
</interface>
|
||||
<interface name="public">
|
||||
<inet-address value="${jboss.bind.address:127.0.0.1}"/>
|
||||
</interface>
|
||||
</interfaces>
|
||||
<socket-binding-group name="standard-sockets" default-interface="public" port-offset="${jboss.socket.binding.port-offset:0}">
|
||||
<socket-binding name="ajp" port="${jboss.ajp.port:8009}"/>
|
||||
<socket-binding name="http" port="${jboss.http.port:8080}"/>
|
||||
<socket-binding name="https" port="${jboss.https.port:8443}"/>
|
||||
<socket-binding name="jgroups-mping" interface="private" multicast-address="${jboss.default.multicast.address:230.0.0.4}" multicast-port="45700"/>
|
||||
<socket-binding name="jgroups-tcp" interface="private" port="7600"/>
|
||||
<socket-binding name="jgroups-tcp-fd" interface="private" port="57600"/>
|
||||
<socket-binding name="jgroups-udp" interface="private" port="55200" multicast-address="${jboss.default.multicast.address:230.0.0.4}" multicast-port="45688"/>
|
||||
<socket-binding name="jgroups-udp-fd" interface="private" port="54200"/>
|
||||
<socket-binding name="management-http" interface="management" port="${jboss.management.http.port:9990}"/>
|
||||
<socket-binding name="management-https" interface="management" port="${jboss.management.https.port:9993}"/>
|
||||
<socket-binding name="modcluster" multicast-address="${jboss.modcluster.multicast.address:224.0.1.105}" multicast-port="23364"/>
|
||||
<socket-binding name="txn-recovery-environment" port="4712"/>
|
||||
<socket-binding name="txn-status-manager" port="4713"/>
|
||||
<outbound-socket-binding name="mail-smtp">
|
||||
<remote-destination host="localhost" port="25"/>
|
||||
</outbound-socket-binding>
|
||||
</socket-binding-group>
|
||||
</server>
|
28
bin/build-keycloak-theme/generateFtl/Object.deepAssign.js
Normal file
@ -0,0 +1,28 @@
|
||||
|
||||
Object.defineProperty(
|
||||
Object,
|
||||
"deepAssign",
|
||||
{
|
||||
"value": function callee(target, source) {
|
||||
Object.keys(source).forEach(function (key) {
|
||||
var value = source[key];
|
||||
if (target[key] === undefined) {
|
||||
target[key] = value;
|
||||
return;
|
||||
}
|
||||
if (value instanceof Object) {
|
||||
if (value instanceof Array) {
|
||||
value.forEach(function (entry) {
|
||||
target[key].push(entry);
|
||||
});
|
||||
return;
|
||||
}
|
||||
callee(target[key], value);
|
||||
return;
|
||||
}
|
||||
target[key] = value;
|
||||
});
|
||||
return target;
|
||||
}
|
||||
}
|
||||
);
|
26
bin/build-keycloak-theme/generateFtl/String.htmlUnescape.js
Normal file
@ -0,0 +1,26 @@
|
||||
|
||||
var es = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34);/g;
|
||||
|
||||
var unes = {
|
||||
'&': '&',
|
||||
'&': '&',
|
||||
'<': '<',
|
||||
'<': '<',
|
||||
'>': '>',
|
||||
'>': '>',
|
||||
''': "'",
|
||||
''': "'",
|
||||
'"': '"',
|
||||
'"': '"'
|
||||
};
|
||||
var cape = function (m) { return unes[m]; };
|
||||
|
||||
Object.defineProperty(
|
||||
String,
|
||||
"htmlUnescape",
|
||||
{
|
||||
"value": function (un) {
|
||||
return String.prototype.replace.call(un, es, cape);
|
||||
}
|
||||
}
|
||||
);
|
15
bin/build-keycloak-theme/generateFtl/error.ftl
Normal file
@ -0,0 +1,15 @@
|
||||
<script>const _=
|
||||
{
|
||||
"client": (function (){
|
||||
|
||||
<#if client??>
|
||||
return {
|
||||
"baseUrl": "${(client.baseUrl!'')?no_esc}" || undefined
|
||||
};
|
||||
</#if>
|
||||
|
||||
return undefined;
|
||||
|
||||
})()
|
||||
}
|
||||
</script>
|
13
bin/build-keycloak-theme/generateFtl/index.d.ts
vendored
Normal file
@ -0,0 +1,13 @@
|
||||
export declare const pageIds: readonly ["login.ftl", "register.ftl", "info.ftl", "error.ftl", "login-reset-password.ftl", "login-verify-email.ftl"];
|
||||
export declare type PageId = typeof pageIds[number];
|
||||
export declare function generateFtlFilesCodeFactory(params: {
|
||||
ftlValuesGlobalName: string;
|
||||
cssGlobalsToDefine: Record<string, string>;
|
||||
indexHtmlCode: string;
|
||||
}): {
|
||||
generateFtlFilesCode: (params: {
|
||||
pageId: PageId;
|
||||
}) => {
|
||||
ftlCode: string;
|
||||
};
|
||||
};
|
151
bin/build-keycloak-theme/generateFtl/index.js
Normal file
@ -0,0 +1,151 @@
|
||||
"use strict";
|
||||
var __assign = (this && this.__assign) || function () {
|
||||
__assign = Object.assign || function(t) {
|
||||
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
||||
s = arguments[i];
|
||||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
||||
t[p] = s[p];
|
||||
}
|
||||
return t;
|
||||
};
|
||||
return __assign.apply(this, arguments);
|
||||
};
|
||||
var __read = (this && this.__read) || function (o, n) {
|
||||
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
||||
if (!m) return o;
|
||||
var i = m.call(o), r, ar = [], e;
|
||||
try {
|
||||
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
||||
}
|
||||
catch (error) { e = { error: error }; }
|
||||
finally {
|
||||
try {
|
||||
if (r && !r.done && (m = i["return"])) m.call(i);
|
||||
}
|
||||
finally { if (e) throw e.error; }
|
||||
}
|
||||
return ar;
|
||||
};
|
||||
var __spreadArray = (this && this.__spreadArray) || function (to, from) {
|
||||
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
|
||||
to[j] = from[i];
|
||||
return to;
|
||||
};
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.generateFtlFilesCodeFactory = exports.pageIds = void 0;
|
||||
var cheerio_1 = __importDefault(require("cheerio"));
|
||||
var replaceImportFromStatic_1 = require("../replaceImportFromStatic");
|
||||
var fs_1 = __importDefault(require("fs"));
|
||||
var path_1 = require("path");
|
||||
var objectKeys_1 = require("evt/tools/typeSafety/objectKeys");
|
||||
exports.pageIds = ["login.ftl", "register.ftl", "info.ftl", "error.ftl", "login-reset-password.ftl", "login-verify-email.ftl"];
|
||||
function loadAdjacentFile(fileBasename) {
|
||||
return fs_1.default.readFileSync(path_1.join(__dirname, fileBasename))
|
||||
.toString("utf8");
|
||||
}
|
||||
;
|
||||
function loadFtlFile(ftlFileBasename) {
|
||||
try {
|
||||
return loadAdjacentFile(ftlFileBasename)
|
||||
.match(/^<script>const _=((?:.|\n)+)<\/script>[\n]?$/)[1];
|
||||
}
|
||||
catch (_a) {
|
||||
return "{}";
|
||||
}
|
||||
}
|
||||
function generateFtlFilesCodeFactory(params) {
|
||||
var ftlValuesGlobalName = params.ftlValuesGlobalName, cssGlobalsToDefine = params.cssGlobalsToDefine, indexHtmlCode = params.indexHtmlCode;
|
||||
var $ = cheerio_1.default.load(indexHtmlCode);
|
||||
$("script:not([src])").each(function () {
|
||||
var _a = [];
|
||||
for (var _i = 0; _i < arguments.length; _i++) {
|
||||
_a[_i] = arguments[_i];
|
||||
}
|
||||
var _b = __read(_a, 2), element = _b[1];
|
||||
var fixedJsCode = replaceImportFromStatic_1.replaceImportFromStaticInJsCode({
|
||||
ftlValuesGlobalName: ftlValuesGlobalName,
|
||||
"jsCode": $(element).html()
|
||||
}).fixedJsCode;
|
||||
$(element).text(fixedJsCode);
|
||||
});
|
||||
[
|
||||
["link", "href"],
|
||||
["script", "src"],
|
||||
].forEach(function (_a) {
|
||||
var _b = __read(_a, 2), selector = _b[0], attrName = _b[1];
|
||||
return $(selector).each(function () {
|
||||
var _a = [];
|
||||
for (var _i = 0; _i < arguments.length; _i++) {
|
||||
_a[_i] = arguments[_i];
|
||||
}
|
||||
var _b = __read(_a, 2), element = _b[1];
|
||||
var href = $(element).attr(attrName);
|
||||
if (!(href === null || href === void 0 ? void 0 : href.startsWith("/"))) {
|
||||
return;
|
||||
}
|
||||
$(element).attr(attrName, "${url.resourcesPath}/build" + href);
|
||||
});
|
||||
});
|
||||
//FTL is no valid html, we can't insert with cheerio, we put placeholder for injecting later.
|
||||
var ftlCommonPlaceholders = {
|
||||
'{ "x": "vIdLqMeOed9sdLdIdOxdK0d" }': loadFtlFile("template.ftl"),
|
||||
'<!-- xIdLqMeOedErIdLsPdNdI9dSlxI -->': [
|
||||
'<#if scripts??>',
|
||||
' <#list scripts as script>',
|
||||
' <script src="${script}" type="text/javascript"></script>',
|
||||
' </#list>',
|
||||
'</#if>'
|
||||
].join("\n")
|
||||
};
|
||||
var pageSpecificCodePlaceholder = "<!-- dIddLqMeOedErIdLsPdNdI9dSl42sw -->";
|
||||
$("head").prepend(__spreadArray(__spreadArray(__spreadArray([], __read((Object.keys(cssGlobalsToDefine).length === 0 ? [] : [
|
||||
'',
|
||||
'<style>',
|
||||
replaceImportFromStatic_1.generateCssCodeToDefineGlobals({ cssGlobalsToDefine: cssGlobalsToDefine }).cssCodeToPrependInHead,
|
||||
'</style>',
|
||||
''
|
||||
]))), __read(["Object.deepAssign.js", "String.htmlUnescape.js"].map(function (fileBasename) { return [
|
||||
"<script>",
|
||||
loadAdjacentFile(fileBasename),
|
||||
"</script>"
|
||||
].join("\n"); }))), [
|
||||
'<script>',
|
||||
" window." + ftlValuesGlobalName + "= Object.assign(",
|
||||
" {},",
|
||||
" " + objectKeys_1.objectKeys(ftlCommonPlaceholders)[0],
|
||||
' );',
|
||||
'</script>',
|
||||
'',
|
||||
pageSpecificCodePlaceholder,
|
||||
'',
|
||||
objectKeys_1.objectKeys(ftlCommonPlaceholders)[1]
|
||||
]).join("\n"));
|
||||
var partiallyFixedIndexHtmlCode = $.html();
|
||||
function generateFtlFilesCode(params) {
|
||||
var pageId = params.pageId;
|
||||
var $ = cheerio_1.default.load(partiallyFixedIndexHtmlCode);
|
||||
var ftlPlaceholders = __assign({ '{ "x": "kxOlLqMeOed9sdLdIdOxd444" }': loadFtlFile(pageId) }, ftlCommonPlaceholders);
|
||||
var ftlCode = $.html()
|
||||
.replace(pageSpecificCodePlaceholder, [
|
||||
'<script>',
|
||||
" Object.deepAssign(",
|
||||
" window." + ftlValuesGlobalName + ",",
|
||||
" { \"pageId\": \"" + pageId + "\" }",
|
||||
' );',
|
||||
" Object.deepAssign(",
|
||||
" window." + ftlValuesGlobalName + ",",
|
||||
" " + objectKeys_1.objectKeys(ftlPlaceholders)[0],
|
||||
' );',
|
||||
'</script>'
|
||||
].join("\n"));
|
||||
objectKeys_1.objectKeys(ftlPlaceholders)
|
||||
.forEach(function (id) { return ftlCode = ftlCode.replace(id, ftlPlaceholders[id]); });
|
||||
return { ftlCode: ftlCode };
|
||||
}
|
||||
return { generateFtlFilesCode: generateFtlFilesCode };
|
||||
}
|
||||
exports.generateFtlFilesCodeFactory = generateFtlFilesCodeFactory;
|
||||
//# sourceMappingURL=index.js.map
|
1
bin/build-keycloak-theme/generateFtl/index.js.map
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/bin/build-keycloak-theme/generateFtl/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,oDAA8B;AAC9B,sEAGoC;AACpC,0CAAoB;AACpB,6BAAwC;AACxC,8DAA6D;AAEhD,QAAA,OAAO,GAAG,CAAC,WAAW,EAAE,cAAc,EAAE,UAAU,EAAE,WAAW,EAAE,0BAA0B,EAAE,wBAAwB,CAAU,CAAC;AAI7I,SAAS,gBAAgB,CAAC,YAAoB;IAC1C,OAAO,YAAE,CAAC,YAAY,CAAC,WAAQ,CAAC,SAAS,EAAE,YAAY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QACF,2BAA2B;QAC3B,EAAE;QACF,uBAAU,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC;OACtC,IAAI,CAAC,IAAI,CAAC,CACf,CAAC;IAEF,IAAM,2BAA2B,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;IAE7C,SAAS,oBAAoB,CACzB,MAEC;QAGO,IAAA,MAAM,GAAK,MAAM,OAAX,CAAY;QAE1B,IAAM,CAAC,GAAG,iBAAO,CAAC,IAAI,CAAC,2BAA2B,CAAC,CAAC;QAEpD,IAAM,eAAe,cACjB,qCAAqC,EAAE,WAAW,CAAC,MAAM,CAAC,IACvD,qBAAqB,CAC3B,CAAC;QAEF,IAAI,OAAO,GAAG,CAAC,CAAC,IAAI,EAAE;aACjB,OAAO,CACJ,2BAA2B,EAC3B;YACI,UAAU;YACV,wBAAwB;YACxB,oBAAkB,mBAAmB,MAAG;YACxC,6BAAwB,MAAM,SAAK;YACnC,QAAQ;YACR,wBAAwB;YACxB,oBAAkB,mBAAmB,MAAG;YACxC,aAAW,uBAAU,CAAC,eAAe,CAAC,CAAC,CAAC,CAAG;YAC3C,QAAQ;YACR,WAAW;SACd,CAAC,IAAI,CAAC,IAAI,CAAC,CACf,CAAC;QAEN,uBAAU,CAAC,eAAe,CAAC;aACtB,OAAO,CAAC,UAAA,EAAE,IAAI,OAAA,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,EAAE,EAAE,eAAe,CAAC,EAAE,CAAC,CAAC,EAAlD,CAAkD,CAAC,CAAC;QAEvE,OAAO,EAAE,OAAO,SAAA,EAAE,CAAC;IAEvB,CAAC;IAED,OAAO,EAAE,oBAAoB,sBAAA,EAAE,CAAC;AAGpC,CAAC;AAlID,kEAkIC"}
|
37
bin/build-keycloak-theme/generateFtl/info.ftl
Normal file
@ -0,0 +1,37 @@
|
||||
<script>const _=
|
||||
{
|
||||
"messageHeader": "${messageHeader!''}" || undefined,
|
||||
"requiredActions": (function (){
|
||||
|
||||
<#if requiredActions??>
|
||||
|
||||
var out =[];
|
||||
|
||||
<#list requiredActions>
|
||||
<#items as reqActionItem>
|
||||
out.push("${reqActionItem}");
|
||||
</#items></b>
|
||||
</#list>
|
||||
|
||||
return out;
|
||||
|
||||
<#else>
|
||||
|
||||
return undefined;
|
||||
|
||||
})(),
|
||||
"skipLink": (function (){
|
||||
|
||||
<#if skipLink??>
|
||||
return true;
|
||||
</#if>
|
||||
return false;
|
||||
|
||||
})(),
|
||||
"pageRedirectUri": "${(pageRedirectUri!'')?no_esc}" || undefined,
|
||||
"actionUri": "${(actionUri!'')?no_esc}" || undefined,
|
||||
"client": {
|
||||
"baseUrl": "${(client.baseUrl!'')?no_esc}" || undefined
|
||||
}
|
||||
}
|
||||
</script>
|
@ -0,0 +1,7 @@
|
||||
<script>const _=
|
||||
{
|
||||
"realm": {
|
||||
"loginWithEmailAllowed": ${realm.loginWithEmailAllowed?c}
|
||||
},
|
||||
}
|
||||
</script>
|
83
bin/build-keycloak-theme/generateFtl/login.ftl
Normal file
@ -0,0 +1,83 @@
|
||||
<script>const _=
|
||||
{
|
||||
"url": {
|
||||
"loginResetCredentialsUrl": "${url.loginResetCredentialsUrl?no_esc}",
|
||||
"registrationUrl": "${url.registrationUrl?no_esc}"
|
||||
},
|
||||
"realm": {
|
||||
"loginWithEmailAllowed": ${realm.loginWithEmailAllowed?c},
|
||||
"rememberMe": ${realm.rememberMe?c},
|
||||
"password": ${realm.password?c},
|
||||
"resetPasswordAllowed": ${realm.resetPasswordAllowed?c},
|
||||
"registrationAllowed": ${realm.registrationAllowed?c}
|
||||
},
|
||||
"auth": (function (){
|
||||
|
||||
<#if auth?has_content>
|
||||
|
||||
var out= {
|
||||
"selectedCredential": "${auth.selectedCredential!''}" || undefined
|
||||
};
|
||||
|
||||
return out;
|
||||
|
||||
</#if>
|
||||
|
||||
return undefined;
|
||||
|
||||
})(),
|
||||
"social": {
|
||||
"displayInfo": ${social.displayInfo?c},
|
||||
"providers": (()=>{
|
||||
|
||||
<#if social.providers??>
|
||||
|
||||
var out= [];
|
||||
|
||||
<#list social.providers as p>
|
||||
out.push({
|
||||
"loginUrl": "${p.loginUrl?no_esc}",
|
||||
"alias": "${p.alias}",
|
||||
"providerId": "${p.providerId}",
|
||||
"displayName": "${p.displayName}"
|
||||
});
|
||||
</#list>
|
||||
|
||||
return out;
|
||||
|
||||
</#if>
|
||||
|
||||
return undefined;
|
||||
|
||||
})()
|
||||
},
|
||||
"usernameEditDisabled": (function () {
|
||||
|
||||
<#if usernameEditDisabled??>
|
||||
return true;
|
||||
</#if>
|
||||
return false;
|
||||
|
||||
})(),
|
||||
"login": {
|
||||
"username": "${login.username!''}" || undefined,
|
||||
"rememberMe": (function (){
|
||||
|
||||
<#if login.rememberMe??>
|
||||
return true;
|
||||
</#if>
|
||||
return false;
|
||||
|
||||
|
||||
})()
|
||||
},
|
||||
"registrationDisabled": (function (){
|
||||
|
||||
<#if registrationDisabled??>
|
||||
return true;
|
||||
</#if>
|
||||
return false;
|
||||
|
||||
})()
|
||||
}
|
||||
</script>
|
46
bin/build-keycloak-theme/generateFtl/register.ftl
Normal file
@ -0,0 +1,46 @@
|
||||
<script>const _=
|
||||
{
|
||||
"url": {
|
||||
"registrationAction": "${url.registrationAction?no_esc}"
|
||||
},
|
||||
"messagesPerField": {
|
||||
"printIfExists": function (key, x) {
|
||||
switch(key){
|
||||
case "userLabel": "${messagesPerField.printIfExists('userLabel','1')}" ? x : undefined;
|
||||
case "username": "${messagesPerField.printIfExists('username','1')}" ? x : undefined;
|
||||
case "email": "${messagesPerField.printIfExists('email','1')}" ? x : undefined;
|
||||
case "firstName": "${messagesPerField.printIfExists('firstName','1')}" ? x : undefined;
|
||||
case "lastName": "${messagesPerField.printIfExists('lastName','1')}" ? x : undefined;
|
||||
case "password": "${messagesPerField.printIfExists('password','1')}" ? x : undefined;
|
||||
case "password-confirm": "${messagesPerField.printIfExists('password-confirm','1')}" ? x : undefined;
|
||||
}
|
||||
}
|
||||
},
|
||||
"register": {
|
||||
"formData": {
|
||||
"firstName": "${register.formData.firstName!''}" || undefined,
|
||||
"displayName": "${register.formData.displayName!''}" || undefined,
|
||||
"lastName": "${register.formData.lastName!''}" || undefined,
|
||||
"email": "${register.formData.email!''}" || undefined,
|
||||
"username": "${register.formData.username!''}" || undefined
|
||||
}
|
||||
},
|
||||
"passwordRequired": (function (){
|
||||
|
||||
<#if passwordRequired??>
|
||||
return true;
|
||||
</#if>
|
||||
return false;
|
||||
|
||||
})(),
|
||||
"recaptchaRequired": (function (){
|
||||
|
||||
<#if passwordRequired??>
|
||||
return true;
|
||||
</#if>
|
||||
return false;
|
||||
|
||||
})(),
|
||||
"recaptchaSiteKey": "${recaptchaSiteKey!''}" || undefined
|
||||
}
|
||||
</script>
|
114
bin/build-keycloak-theme/generateFtl/template.ftl
Normal file
@ -0,0 +1,114 @@
|
||||
<script>const _=
|
||||
{
|
||||
"url": {
|
||||
"loginAction": "${url.loginAction?no_esc}",
|
||||
"resourcesPath": "${url.resourcesPath?no_esc}",
|
||||
"resourcesCommonPath": "${url.resourcesCommonPath?no_esc}",
|
||||
"loginRestartFlowUrl": "${url.loginRestartFlowUrl?no_esc}",
|
||||
"loginUrl": "${url.loginUrl?no_esc}"
|
||||
},
|
||||
"realm": {
|
||||
"displayName": "${realm.displayName!''}" || undefined,
|
||||
"displayNameHtml": "${realm.displayNameHtml!''}" || undefined,
|
||||
"internationalizationEnabled": ${realm.internationalizationEnabled?c},
|
||||
"registrationEmailAsUsername": ${realm.registrationEmailAsUsername?c},
|
||||
},
|
||||
"locale": (function (){
|
||||
|
||||
<#if realm.internationalizationEnabled>
|
||||
|
||||
return {
|
||||
"supported": (function(){
|
||||
|
||||
<#if realm.internationalizationEnabled>
|
||||
|
||||
var out= [];
|
||||
|
||||
<#list locale.supported as lng>
|
||||
out.push({
|
||||
"url": "${lng.url?no_esc}",
|
||||
"label": "${lng.label}",
|
||||
"languageTag": "${lng.languageTag}"
|
||||
});
|
||||
</#list>
|
||||
|
||||
return out;
|
||||
|
||||
</#if>
|
||||
|
||||
return undefined;
|
||||
|
||||
})(),
|
||||
"current": "${locale.current}"
|
||||
};
|
||||
|
||||
</#if>
|
||||
|
||||
return undefined;
|
||||
|
||||
})(),
|
||||
"auth": (function (){
|
||||
|
||||
|
||||
<#if auth?has_content>
|
||||
|
||||
var out= {
|
||||
"showUsername": ${auth.showUsername()?c},
|
||||
"showResetCredentials": ${auth.showResetCredentials()?c},
|
||||
"showTryAnotherWayLink": ${auth.showTryAnotherWayLink()?c},
|
||||
};
|
||||
|
||||
<#if auth.showUsername() && !auth.showResetCredentials()>
|
||||
Object.assign(
|
||||
out,
|
||||
{
|
||||
"attemptedUsername": "${auth.attemptedUsername}"
|
||||
}
|
||||
);
|
||||
</#if>
|
||||
|
||||
return out;
|
||||
|
||||
</#if>
|
||||
|
||||
|
||||
return undefined;
|
||||
|
||||
})(),
|
||||
"scripts": (function(){
|
||||
|
||||
var out = [];
|
||||
|
||||
<#if scripts??>
|
||||
<#list scripts as script>
|
||||
out.push("${script}");
|
||||
</#list>
|
||||
</#if>
|
||||
|
||||
return out;
|
||||
|
||||
})(),
|
||||
"message": (function (){
|
||||
|
||||
<#if message?has_content>
|
||||
|
||||
return {
|
||||
"type": "${message.type}",
|
||||
"summary": String.htmlUnescape("${message.summary}")
|
||||
};
|
||||
|
||||
</#if>
|
||||
|
||||
return undefined;
|
||||
|
||||
})(),
|
||||
"isAppInitiatedAction": (function (){
|
||||
|
||||
<#if isAppInitiatedAction??>
|
||||
return true;
|
||||
</#if>
|
||||
return false;
|
||||
|
||||
})()
|
||||
}
|
||||
</script>
|
11
bin/build-keycloak-theme/generateJavaStackFiles.d.ts
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
export declare type ParsedPackageJson = {
|
||||
name: string;
|
||||
version: string;
|
||||
homepage?: string;
|
||||
};
|
||||
export declare function generateJavaStackFiles(params: {
|
||||
parsedPackageJson: ParsedPackageJson;
|
||||
keycloakThemeBuildingDirPath: string;
|
||||
}): {
|
||||
jarFilePath: string;
|
||||
};
|
73
bin/build-keycloak-theme/generateJavaStackFiles.js
Normal file
@ -0,0 +1,73 @@
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.generateJavaStackFiles = void 0;
|
||||
var url = __importStar(require("url"));
|
||||
var fs = __importStar(require("fs"));
|
||||
var path_1 = require("path");
|
||||
function generateJavaStackFiles(params) {
|
||||
var _a = params.parsedPackageJson, name = _a.name, version = _a.version, homepage = _a.homepage, keycloakThemeBuildingDirPath = params.keycloakThemeBuildingDirPath;
|
||||
{
|
||||
var pomFileCode = (function generatePomFileCode() {
|
||||
var groupId = (function () {
|
||||
var _a, _b;
|
||||
var fallbackGroupId = "there.was.no.homepage.field.in.the.package.json." + name;
|
||||
return (!homepage ?
|
||||
fallbackGroupId :
|
||||
(_b = (_a = url.parse(homepage).host) === null || _a === void 0 ? void 0 : _a.split(".").reverse().join(".")) !== null && _b !== void 0 ? _b : fallbackGroupId) + ".keycloak";
|
||||
})();
|
||||
var artefactId = name + "-keycloak-theme";
|
||||
var pomFileCode = [
|
||||
"<?xml version=\"1.0\"?>",
|
||||
"<project xmlns=\"http://maven.apache.org/POM/4.0.0\"",
|
||||
"\txmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"",
|
||||
"\txsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd\">",
|
||||
"\t<modelVersion>4.0.0</modelVersion>",
|
||||
"\t<groupId>" + groupId + "</groupId>",
|
||||
"\t<artifactId>" + artefactId + "</artifactId>",
|
||||
"\t<version>" + version + "</version>",
|
||||
"\t<name>" + artefactId + "</name>",
|
||||
"\t<description />",
|
||||
"</project>"
|
||||
].join("\n");
|
||||
return { pomFileCode: pomFileCode };
|
||||
})().pomFileCode;
|
||||
fs.writeFileSync(path_1.join(keycloakThemeBuildingDirPath, "pom.xml"), Buffer.from(pomFileCode, "utf8"));
|
||||
}
|
||||
{
|
||||
var themeManifestFilePath = path_1.join(keycloakThemeBuildingDirPath, "src", "main", "resources", "META-INF", "keycloak-themes.json");
|
||||
try {
|
||||
fs.mkdirSync(path_1.dirname(themeManifestFilePath));
|
||||
}
|
||||
catch (_b) { }
|
||||
fs.writeFileSync(themeManifestFilePath, Buffer.from(JSON.stringify({
|
||||
"themes": [
|
||||
{
|
||||
"name": name,
|
||||
"types": ["login"]
|
||||
}
|
||||
]
|
||||
}, null, 2), "utf8"));
|
||||
}
|
||||
return { "jarFilePath": path_1.join(keycloakThemeBuildingDirPath, "target", name + "-" + version + ".jar") };
|
||||
}
|
||||
exports.generateJavaStackFiles = generateJavaStackFiles;
|
||||
//# sourceMappingURL=generateJavaStackFiles.js.map
|
1
bin/build-keycloak-theme/generateJavaStackFiles.js.map
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"generateJavaStackFiles.js","sourceRoot":"","sources":["../../src/bin/build-keycloak-theme/generateJavaStackFiles.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AACA,uCAA2B;AAC3B,qCAAyB;AACzB,6BAAgE;AAQhE,SAAgB,s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QAEF,IAAI;YAEA,EAAE,CAAC,SAAS,CAAC,cAAW,CAAC,qBAAqB,CAAC,CAAC,CAAC;SAEpD;QAAC,WAAM,GAAG;QAEX,EAAE,CAAC,aAAa,CACZ,qBAAqB,EACrB,MAAM,CAAC,IAAI,CACP,IAAI,CAAC,SAAS,CAAC;YACX,QAAQ,EAAE;gBACN;oBACI,MAAM,EAAE,IAAI;oBACZ,OAAO,EAAE,CAAC,OAAO,CAAC;iBACrB;aACJ;SACJ,EAAE,IAAI,EAAE,CAAC,CAAC,EACX,MAAM,CACT,CACJ,CAAC;KAEL;IAED,OAAO,EAAE,aAAa,EAAE,WAAQ,CAAC,4BAA4B,EAAE,QAAQ,EAAK,IAAI,SAAI,OAAO,SAAM,CAAC,EAAE,CAAC;AAEzG,CAAC;AAvFD,wDAuFC"}
|
5
bin/build-keycloak-theme/generateKeycloakThemeResources.d.ts
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
export declare function generateKeycloakThemeResources(params: {
|
||||
themeName: string;
|
||||
reactAppBuildDirPath: string;
|
||||
keycloakThemeBuildingDirPath: string;
|
||||
}): void;
|
91
bin/build-keycloak-theme/generateKeycloakThemeResources.js
Normal file
@ -0,0 +1,91 @@
|
||||
"use strict";
|
||||
var __assign = (this && this.__assign) || function () {
|
||||
__assign = Object.assign || function(t) {
|
||||
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
||||
s = arguments[i];
|
||||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
||||
t[p] = s[p];
|
||||
}
|
||||
return t;
|
||||
};
|
||||
return __assign.apply(this, arguments);
|
||||
};
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.generateKeycloakThemeResources = void 0;
|
||||
var transformCodebase_1 = require("../tools/transformCodebase");
|
||||
var fs = __importStar(require("fs"));
|
||||
var path_1 = require("path");
|
||||
var replaceImportFromStatic_1 = require("./replaceImportFromStatic");
|
||||
var generateFtl_1 = require("./generateFtl");
|
||||
var install_builtin_keycloak_themes_1 = require("../install-builtin-keycloak-themes");
|
||||
var downloadAndUnzip_1 = require("../tools/downloadAndUnzip");
|
||||
var child_process = __importStar(require("child_process"));
|
||||
var ftlValuesGlobalName_1 = require("./ftlValuesGlobalName");
|
||||
function generateKeycloakThemeResources(params) {
|
||||
var themeName = params.themeName, reactAppBuildDirPath = params.reactAppBuildDirPath, keycloakThemeBuildingDirPath = params.keycloakThemeBuildingDirPath;
|
||||
var themeDirPath = path_1.join(keycloakThemeBuildingDirPath, "src", "main", "resources", "theme", themeName, "login");
|
||||
var allCssGlobalsToDefine = {};
|
||||
transformCodebase_1.transformCodebase({
|
||||
"destDirPath": path_1.join(themeDirPath, "resources", "build"),
|
||||
"srcDirPath": reactAppBuildDirPath,
|
||||
"transformSourceCode": function (_a) {
|
||||
var filePath = _a.filePath, sourceCode = _a.sourceCode;
|
||||
if (/\.css?$/i.test(filePath)) {
|
||||
var _b = replaceImportFromStatic_1.replaceImportFromStaticInCssCode({ "cssCode": sourceCode.toString("utf8") }), cssGlobalsToDefine = _b.cssGlobalsToDefine, fixedCssCode = _b.fixedCssCode;
|
||||
allCssGlobalsToDefine = __assign(__assign({}, allCssGlobalsToDefine), cssGlobalsToDefine);
|
||||
return { "modifiedSourceCode": Buffer.from(fixedCssCode, "utf8") };
|
||||
}
|
||||
if (/\.js?$/i.test(filePath)) {
|
||||
var fixedJsCode = replaceImportFromStatic_1.replaceImportFromStaticInJsCode({
|
||||
"jsCode": sourceCode.toString("utf8"),
|
||||
ftlValuesGlobalName: ftlValuesGlobalName_1.ftlValuesGlobalName
|
||||
}).fixedJsCode;
|
||||
return { "modifiedSourceCode": Buffer.from(fixedJsCode, "utf8") };
|
||||
}
|
||||
return { "modifiedSourceCode": sourceCode };
|
||||
}
|
||||
});
|
||||
var generateFtlFilesCode = generateFtl_1.generateFtlFilesCodeFactory({
|
||||
"cssGlobalsToDefine": allCssGlobalsToDefine,
|
||||
ftlValuesGlobalName: ftlValuesGlobalName_1.ftlValuesGlobalName,
|
||||
"indexHtmlCode": fs.readFileSync(path_1.join(reactAppBuildDirPath, "index.html")).toString("utf8")
|
||||
}).generateFtlFilesCode;
|
||||
generateFtl_1.pageIds.forEach(function (pageId) {
|
||||
var ftlCode = generateFtlFilesCode({ pageId: pageId }).ftlCode;
|
||||
fs.writeFileSync(path_1.join(themeDirPath, pageId), Buffer.from(ftlCode, "utf8"));
|
||||
});
|
||||
{
|
||||
var tmpDirPath = path_1.join(themeDirPath, "..", "tmp_xxKdLpdIdLd");
|
||||
downloadAndUnzip_1.downloadAndUnzip({
|
||||
"url": install_builtin_keycloak_themes_1.builtinThemesUrl,
|
||||
"destDirPath": tmpDirPath
|
||||
});
|
||||
transformCodebase_1.transformCodebase({
|
||||
"srcDirPath": path_1.join(tmpDirPath, "keycloak", "login", "resources"),
|
||||
"destDirPath": path_1.join(themeDirPath, "resources")
|
||||
});
|
||||
child_process.execSync("rm -r " + tmpDirPath);
|
||||
}
|
||||
fs.writeFileSync(path_1.join(themeDirPath, "theme.properties"), Buffer.from("parent=keycloak", "utf8"));
|
||||
}
|
||||
exports.generateKeycloakThemeResources = generateKeycloakThemeResources;
|
||||
//# sourceMappingURL=generateKeycloakThemeResources.js.map
|
@ -0,0 +1 @@
|
||||
{"version":3,"file":"generateKeycloakThemeResources.js","sourceRoot":"","sources":["../../src/bin/build-keycloak-theme/generateKeycloakThemeResources.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,gEAA+D;AAC/D,qCAAyB;AACzB,6BAAwC;AACxC,qEAGmC;AACnC,6CAAqE;AACrE,sFAAsE;AACtE,8DAA6D;AAC7D,2DAA+C;AAC/C,6DAA4D;AAE5D,SAAgB,8BAA8B,CAC1C,MAIC;IAGO,IAAA,SAAS,GAAyD,MAAM,UAA/D,EAAE,oBAAoB,GAAmC,MAAM,qBAAzC,EAAE,4BAA4B,GAAK,MAAM,6BAAX,CAAY;IAEjF,IAAM,YAAY,GAAG,WAAQ,CAAC,4BAA4B,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;IAErH,IAAI,qBAAqB,GAA2B,EAAE,CAAC;IAEvD,qCAAiB,CAAC;QACd,aAAa,EAAE,WAAQ,CAAC,YAAY,EAAE,WAAW,EAAE,OAAO,CAAC;QAC3D,YAAY,EAAE,oBAAoB;QAClC,qBAAqB,EAAE,UAAC,EAAwB;gBAAtB,QAAQ,cAAA,EAAE,UAAU,gBAAA;YAE1C,IAAI,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE;gBAErB,IAAA,KAAuC,0DAAgC,CACzE,EAAE,SAAS,EAAE,UAAU,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAC7C,EAFO,kBAAkB,wBAAA,EAAE,YAAY,kBAEvC,CAAC;gBAEF,qBAAqB,yBACd,qBAAqB,GACrB,kBAAkB,CACxB,CAAC;gBAEF,OAAO,EAAE,oBAAoB,EAAE,MAAM,CAAC,IAAI,CAAC,YAAY,EAAE,MAAM,CAAC,EAAE,CAAC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EAAE,WAAW,CAAC;SACrD,CAAC,CAAC;QAEH,aAAa,CAAC,QAAQ,CAAC,WAAS,UAAY,CAAC,CAAC;KAEjD;IAED,EAAE,CAAC,aAAa,CACZ,WAAQ,CAAC,YAAY,EAAE,kBAAkB,CAAC,EAC1C,MAAM,CAAC,IAAI,CAAC,iBAAiB,EAAE,MAAM,CAAC,CACzC,CAAC;AAEN,CAAC;AA5FD,wEA4FC"}
|
2
bin/build-keycloak-theme/index.d.ts
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
#!/usr/bin/env node
|
||||
export declare const keycloakThemeBuildingDirPath: string;
|
86
bin/build-keycloak-theme/index.js
Executable file
@ -0,0 +1,86 @@
|
||||
#!/usr/bin/env node
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.keycloakThemeBuildingDirPath = void 0;
|
||||
var generateKeycloakThemeResources_1 = require("./generateKeycloakThemeResources");
|
||||
var generateJavaStackFiles_1 = require("./generateJavaStackFiles");
|
||||
var path_1 = require("path");
|
||||
var child_process = __importStar(require("child_process"));
|
||||
var generateDebugFiles_1 = require("./generateDebugFiles");
|
||||
var reactProjectDirPath = process.cwd();
|
||||
var parsedPackageJson = require(path_1.join(reactProjectDirPath, "package.json"));
|
||||
exports.keycloakThemeBuildingDirPath = path_1.join(reactProjectDirPath, "build_keycloak");
|
||||
if (require.main === module) {
|
||||
console.log("🔏 Building the keycloak theme...⌚");
|
||||
generateKeycloakThemeResources_1.generateKeycloakThemeResources({
|
||||
keycloakThemeBuildingDirPath: exports.keycloakThemeBuildingDirPath,
|
||||
"reactAppBuildDirPath": path_1.join(reactProjectDirPath, "build"),
|
||||
"themeName": parsedPackageJson.name
|
||||
});
|
||||
var jarFilePath = generateJavaStackFiles_1.generateJavaStackFiles({
|
||||
parsedPackageJson: parsedPackageJson,
|
||||
keycloakThemeBuildingDirPath: exports.keycloakThemeBuildingDirPath
|
||||
}).jarFilePath;
|
||||
child_process.execSync("mvn package", { "cwd": exports.keycloakThemeBuildingDirPath });
|
||||
generateDebugFiles_1.generateDebugFiles({
|
||||
keycloakThemeBuildingDirPath: exports.keycloakThemeBuildingDirPath,
|
||||
"packageJsonName": parsedPackageJson.name
|
||||
});
|
||||
console.log([
|
||||
'',
|
||||
"\u2705 Your keycloak theme has been generated and bundled into ./" + path_1.relative(reactProjectDirPath, jarFilePath) + " \uD83D\uDE80",
|
||||
"It is to be placed in \"/opt/jboss/keycloak/standalone/deployments\" in the container running a jboss/keycloak Docker image. (Tested with 11.0.3)",
|
||||
'',
|
||||
'Using Helm (https://github.com/codecentric/helm-charts), edit to reflect:',
|
||||
'',
|
||||
'value.yaml: ',
|
||||
' extraInitContainers: |',
|
||||
' - name: realm-ext-provider',
|
||||
' image: curlimages/curl',
|
||||
' imagePullPolicy: IfNotPresent',
|
||||
' command:',
|
||||
' - sh',
|
||||
' args:',
|
||||
' - -c',
|
||||
" - curl -L -f -S -o /extensions/" + path_1.basename(jarFilePath) + " https://AN.URL.FOR/" + path_1.basename(jarFilePath),
|
||||
' volumeMounts:',
|
||||
' - name: extensions',
|
||||
' mountPath: /extensions',
|
||||
' ',
|
||||
' extraVolumeMounts: |',
|
||||
' - name: extensions',
|
||||
' mountPath: /opt/jboss/keycloak/standalone/deployments',
|
||||
'',
|
||||
'',
|
||||
'To test your theme locally, with hot reloading, you can spin up a Keycloak container image with the theme loaded by running:',
|
||||
'',
|
||||
"\uD83D\uDC49 $ ./" + path_1.relative(reactProjectDirPath, path_1.join(exports.keycloakThemeBuildingDirPath, generateDebugFiles_1.containerLaunchScriptBasename)) + " \uD83D\uDC48",
|
||||
'',
|
||||
'To enable the theme within keycloak log into the admin console ( 👉 http://localhost:8080 username: admin, password: admin 👈), create a realm (called "myrealm" for example),',
|
||||
"go to your realm settings, click on the theme tab then select " + parsedPackageJson.name + ".",
|
||||
"More details: https://www.keycloak.org/getting-started/getting-started-docker",
|
||||
'',
|
||||
'Once your container is up and configured 👉 http://localhost:8080/auth/realms/myrealm/account 👈',
|
||||
'',
|
||||
].join("\n"));
|
||||
}
|
||||
//# sourceMappingURL=index.js.map
|
1
bin/build-keycloak-theme/index.js.map
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/bin/build-keycloak-theme/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAEA,mFAAkF;AAClF,mEAAkE;AAElE,6BAA4F;AAC5F,2DAA+C;AAC/C,2DAAyF;AAGzF,IAAM,mBAAmB,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;AAE1C,IAAM,iBAAiB,GAAsB,OAAO,CAAC,WAAQ,CAAC,mBAAmB,EAAE,cAAc,CAAC,CAAC,CAAC;AAEvF,QAAA,4BAA4B,GAAG,WAAQ,CAAC,mBAAmB,EAAE,gBAAgB,CAAC,CAAC;AAG5F,IAAI,OAAO,CAAC,IAAI,KAAK,MAAM,EAAE;IAEzB,OAAO,CAAC,GAAG,CAAC,oCAAoC,CAAC,CAAC;IAElD,+DAA8B,CAAC;QAC3B,4BAA4B,sCAAA;QAC5B,sBAAsB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,0 +1,17 @@
|
||||
export declare function replaceImportFromStaticInJsCode(params: {
|
||||
ftlValuesGlobalName: string;
|
||||
jsCode: string;
|
||||
}): {
|
||||
fixedJsCode: string;
|
||||
};
|
||||
export declare function replaceImportFromStaticInCssCode(params: {
|
||||
cssCode: string;
|
||||
}): {
|
||||
fixedCssCode: string;
|
||||
cssGlobalsToDefine: Record<string, string>;
|
||||
};
|
||||
export declare function generateCssCodeToDefineGlobals(params: {
|
||||
cssGlobalsToDefine: Record<string, string>;
|
||||
}): {
|
||||
cssCodeToPrependInHead: string;
|
||||
};
|
94
bin/build-keycloak-theme/replaceImportFromStatic.js
Normal file
@ -0,0 +1,94 @@
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
var __read = (this && this.__read) || function (o, n) {
|
||||
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
||||
if (!m) return o;
|
||||
var i = m.call(o), r, ar = [], e;
|
||||
try {
|
||||
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
||||
}
|
||||
catch (error) { e = { error: error }; }
|
||||
finally {
|
||||
try {
|
||||
if (r && !r.done && (m = i["return"])) m.call(i);
|
||||
}
|
||||
finally { if (e) throw e.error; }
|
||||
}
|
||||
return ar;
|
||||
};
|
||||
var __spreadArray = (this && this.__spreadArray) || function (to, from) {
|
||||
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
|
||||
to[j] = from[i];
|
||||
return to;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.generateCssCodeToDefineGlobals = exports.replaceImportFromStaticInCssCode = exports.replaceImportFromStaticInJsCode = void 0;
|
||||
var crypto = __importStar(require("crypto"));
|
||||
function replaceImportFromStaticInJsCode(params) {
|
||||
var jsCode = params.jsCode, ftlValuesGlobalName = params.ftlValuesGlobalName;
|
||||
var fixedJsCode = jsCode.replace(/"static\//g, "window." + ftlValuesGlobalName + ".url.resourcesPath.replace(/^\\//,\"\") + \"/build/static/");
|
||||
return { fixedJsCode: fixedJsCode };
|
||||
}
|
||||
exports.replaceImportFromStaticInJsCode = replaceImportFromStaticInJsCode;
|
||||
function replaceImportFromStaticInCssCode(params) {
|
||||
var _a;
|
||||
var cssCode = params.cssCode;
|
||||
var cssGlobalsToDefine = {};
|
||||
new Set((_a = cssCode.match(/(url\(\/[^)]+\))/g)) !== null && _a !== void 0 ? _a : [])
|
||||
.forEach(function (match) {
|
||||
return cssGlobalsToDefine["url" + crypto
|
||||
.createHash("sha256")
|
||||
.update(match)
|
||||
.digest("hex")
|
||||
.substring(0, 15)] = match;
|
||||
});
|
||||
var fixedCssCode = cssCode;
|
||||
Object.keys(cssGlobalsToDefine).forEach(function (cssVariableName) {
|
||||
//NOTE: split/join pattern ~ replace all
|
||||
return fixedCssCode =
|
||||
fixedCssCode.split(cssGlobalsToDefine[cssVariableName])
|
||||
.join("var(--" + cssVariableName + ")");
|
||||
});
|
||||
return { fixedCssCode: fixedCssCode, cssGlobalsToDefine: cssGlobalsToDefine };
|
||||
}
|
||||
exports.replaceImportFromStaticInCssCode = replaceImportFromStaticInCssCode;
|
||||
function generateCssCodeToDefineGlobals(params) {
|
||||
var cssGlobalsToDefine = params.cssGlobalsToDefine;
|
||||
return {
|
||||
"cssCodeToPrependInHead": __spreadArray(__spreadArray([
|
||||
":root {"
|
||||
], __read(Object.keys(cssGlobalsToDefine)
|
||||
.map(function (cssVariableName) { return [
|
||||
"--" + cssVariableName + ":",
|
||||
[
|
||||
"url(",
|
||||
"${url.resourcesPath}/build" +
|
||||
cssGlobalsToDefine[cssVariableName].match(/^url\(([^)]+)\)$/)[1],
|
||||
")"
|
||||
].join("")
|
||||
].join(" "); })
|
||||
.map(function (line) { return " " + line + ";"; }))), [
|
||||
"}"
|
||||
]).join("\n")
|
||||
};
|
||||
}
|
||||
exports.generateCssCodeToDefineGlobals = generateCssCodeToDefineGlobals;
|
||||
//# sourceMappingURL=replaceImportFromStatic.js.map
|
1
bin/build-keycloak-theme/replaceImportFromStatic.js.map
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"replaceImportFromStatic.js","sourceRoot":"","sources":["../../src/bin/build-keycloak-theme/replaceImportFromStatic.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,6CAAiC;AAEjC,SAAgB,+BAA+B,CAC3C,MAGC;IAGO,IAAA,MAAM,GAA0B,MAAM,OAAhC,EAAE,mBAAmB,GAAK,MAAM,oBAAX,CAAY;IAE/C,IAAM,WAAW,GAAG,MAAO,CAAC,OAAO,CAC/B,YAAY,EACZ,YAAU,mBAAmB,+DAAyD,CACzF,CAAC;IAEF,OAAO,EAAE,WAAW,aAAA,EAAE,CAAC;AAE3B,CAAC;AAhBD,0EAgBC;AAED,SAAgB,gCAAgC,CAC5C,MAEC;;IAMO,IAAA,OAAO,GAAK,MAAM,QAAX,CAAY;IAE3B,IAAM,kBAAkB,GAA2B,EAAE,CAAC;IAEtD,IAAI,GAAG,CAAC,MAAA,OAAO,CAAC,KAAK,CAAC,mBAAmB,CAAC,mCAAI,EAAE,CAAC;SAC5C,OAAO,CAAC,UA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endored
Normal file
@ -0,0 +1 @@
|
||||
import "minimal-polyfills/Object.fromEntries";
|
85
bin/generate-i18n-messages.js
Normal file
@ -0,0 +1,85 @@
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
var __read = (this && this.__read) || function (o, n) {
|
||||
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
||||
if (!m) return o;
|
||||
var i = m.call(o), r, ar = [], e;
|
||||
try {
|
||||
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
||||
}
|
||||
catch (error) { e = { error: error }; }
|
||||
finally {
|
||||
try {
|
||||
if (r && !r.done && (m = i["return"])) m.call(i);
|
||||
}
|
||||
finally { if (e) throw e.error; }
|
||||
}
|
||||
return ar;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
require("minimal-polyfills/Object.fromEntries");
|
||||
var fs = __importStar(require("fs"));
|
||||
var path_1 = require("path");
|
||||
var crawl_1 = require("./tools/crawl");
|
||||
var downloadAndUnzip_1 = require("./tools/downloadAndUnzip");
|
||||
var install_builtin_keycloak_themes_1 = require("./install-builtin-keycloak-themes");
|
||||
var getProjectRoot_1 = require("./tools/getProjectRoot");
|
||||
var child_process = __importStar(require("child_process"));
|
||||
//@ts-ignore
|
||||
var propertiesParser = require("properties-parser");
|
||||
var tmpDirPath = path_1.join(getProjectRoot_1.getProjectRoot(), "tmp_xImOef9dOd44");
|
||||
child_process.execSync("rm -rf " + tmpDirPath);
|
||||
downloadAndUnzip_1.downloadAndUnzip({
|
||||
"destDirPath": tmpDirPath,
|
||||
"url": install_builtin_keycloak_themes_1.builtinThemesUrl
|
||||
});
|
||||
var record = {};
|
||||
process.chdir(path_1.join(tmpDirPath, "base"));
|
||||
crawl_1.crawl(".").forEach(function (filePath) {
|
||||
var _a;
|
||||
var match = filePath.match(/^([^/]+)\/messages\/messages_([^.]+)\.properties$/);
|
||||
if (match === null) {
|
||||
return;
|
||||
}
|
||||
var _b = __read(match, 3), typeOfPage = _b[1], language = _b[2];
|
||||
((_a = record[typeOfPage]) !== null && _a !== void 0 ? _a : (record[typeOfPage] = {}))[language.replace(/_/g, "-")] =
|
||||
Object.fromEntries(Object.entries(propertiesParser.parse(fs.readFileSync(filePath)
|
||||
.toString("utf8"))).map(function (_a) {
|
||||
var _b = __read(_a, 2), key = _b[0], value = _b[1];
|
||||
return [key, value.replace(/''/g, "'")];
|
||||
}));
|
||||
});
|
||||
child_process.execSync("rm -r " + tmpDirPath);
|
||||
var targetDirPath = path_1.join(getProjectRoot_1.getProjectRoot(), "src", "lib", "i18n", "generated_messages");
|
||||
fs.mkdirSync(targetDirPath, { "recursive": true });
|
||||
Object.keys(record).forEach(function (pageType) {
|
||||
var filePath = path_1.join(targetDirPath, pageType + ".ts");
|
||||
fs.writeFileSync(filePath, Buffer.from([
|
||||
"//This code was automatically generated by running " + path_1.relative(getProjectRoot_1.getProjectRoot(), __filename),
|
||||
'//PLEASE DO NOT EDIT MANUALLY',
|
||||
'',
|
||||
'/* spell-checker: disable */',
|
||||
"export const messages= " + JSON.stringify(record[pageType], null, 2) + " as const;",
|
||||
'/* spell-checker: enable */'
|
||||
].join("\n"), "utf8"));
|
||||
console.log(filePath + " wrote");
|
||||
});
|
||||
//# sourceMappingURL=generate-i18n-messages.js.map
|
1
bin/generate-i18n-messages.js.map
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"generate-i18n-messages.js","sourceRoot":"","sources":["../src/bin/generate-i18n-messages.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAA8C;AAC9C,qCAAyB;AACzB,6BAAkE;AAClE,uCAAsC;AACtC,6DAA4D;AAC5D,qFAAqE;AACrE,yDAAwD;AACxD,2DAA+C;AAE/C,YAAY;AACZ,IAAM,gBAAgB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;AAEtD,IAAM,UAAU,GAAG,WAAQ,CAAC,+BAAc,EAAE,EAAE,kBAAkB,CAAC,CAAC;AAElE,aAAa,CAAC,QAAQ,CAAC,YAAU,UAAY,CAAC,CAAC;AAE/C,mCAAgB,CAAC;IACb,aAAa,EAAE,UAAU;IACzB,KAAK,EAAE,kDAAgB;CAC1B,CAAC,CAAC;AAIH,IAAM,MAAM,GAAiE,EAAE,CAAC;AAEhF,OAAO,CAAC,KAAK,CAAC,WAAQ,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC;AAE5C,aAAK,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,UAAA,QAAQ;;IAEvB,IAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,mDAAmD,CAAC,CAAC;IAElF,IAAI,KAAK,KAAK,IAAI,EAAE;QAChB,OAAO;KACV;IAEK,IAAA,KAAA,OAA2B,KAAK,IAAA,EAA7B,UAAU,QAAA,EAAE,QAAQ,QAAS,CAAC;IAEvC,OAAC,MAAM,CAAC,UAAU,qCAAjB,MAAM,CAAC,UAAU,IAAM,EAAE,EAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;QACpD,MAAM,CAAC,WAAW,CAC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
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
#!/usr/bin/env node
|
||||
export declare const builtinThemesUrl = "https://github.com/garronej/keycloakify/releases/download/v0.0.1/keycloak_11.0.3_builtin_themes.zip";
|
15
bin/install-builtin-keycloak-themes.js
Executable file
@ -0,0 +1,15 @@
|
||||
#!/usr/bin/env node
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.builtinThemesUrl = void 0;
|
||||
var build_keycloak_theme_1 = require("./build-keycloak-theme");
|
||||
var downloadAndUnzip_1 = require("./tools/downloadAndUnzip");
|
||||
var path_1 = require("path");
|
||||
exports.builtinThemesUrl = "https://github.com/garronej/keycloakify/releases/download/v0.0.1/keycloak_11.0.3_builtin_themes.zip";
|
||||
if (require.main === module) {
|
||||
downloadAndUnzip_1.downloadAndUnzip({
|
||||
"url": exports.builtinThemesUrl,
|
||||
"destDirPath": path_1.join(build_keycloak_theme_1.keycloakThemeBuildingDirPath, "src", "main", "resources", "theme")
|
||||
});
|
||||
}
|
||||
//# sourceMappingURL=install-builtin-keycloak-themes.js.map
|
1
bin/install-builtin-keycloak-themes.js.map
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"install-builtin-keycloak-themes.js","sourceRoot":"","sources":["../src/bin/install-builtin-keycloak-themes.ts"],"names":[],"mappings":";;;;AAEA,+DAAsE;AACtE,6DAA4D;AAC5D,6BAAwC;AAE3B,QAAA,gBAAgB,GACzB,qGAAqG,CAAC;AAE1G,IAAI,OAAO,CAAC,IAAI,KAAK,MAAM,EAAE;IAEzB,mCAAgB,CAAC;QACb,KAAK,EAAE,wBAAgB;QACvB,aAAa,EAAE,WAAQ,CAAC,mDAA4B,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO,CAAC;KAC7F,CAAC,CAAC;CAEN"}
|
2
bin/tools/crawl.d.ts
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
/** List all files in a given directory return paths relative to the dir_path */
|
||||
export declare const crawl: (dir_path: string) => string[];
|
65
bin/tools/crawl.js
Normal file
@ -0,0 +1,65 @@
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
var __values = (this && this.__values) || function(o) {
|
||||
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
||||
if (m) return m.call(o);
|
||||
if (o && typeof o.length === "number") return {
|
||||
next: function () {
|
||||
if (o && i >= o.length) o = void 0;
|
||||
return { value: o && o[i++], done: !o };
|
||||
}
|
||||
};
|
||||
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.crawl = void 0;
|
||||
var fs = __importStar(require("fs"));
|
||||
var path = __importStar(require("path"));
|
||||
/** List all files in a given directory return paths relative to the dir_path */
|
||||
exports.crawl = (function () {
|
||||
var crawlRec = function (dir_path, paths) {
|
||||
var e_1, _a;
|
||||
try {
|
||||
for (var _b = __values(fs.readdirSync(dir_path)), _c = _b.next(); !_c.done; _c = _b.next()) {
|
||||
var file_name = _c.value;
|
||||
var file_path = path.join(dir_path, file_name);
|
||||
if (fs.lstatSync(file_path).isDirectory()) {
|
||||
crawlRec(file_path, paths);
|
||||
continue;
|
||||
}
|
||||
paths.push(file_path);
|
||||
}
|
||||
}
|
||||
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
||||
finally {
|
||||
try {
|
||||
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
||||
}
|
||||
finally { if (e_1) throw e_1.error; }
|
||||
}
|
||||
};
|
||||
return function crawl(dir_path) {
|
||||
var paths = [];
|
||||
crawlRec(dir_path, paths);
|
||||
return paths.map(function (file_path) { return path.relative(dir_path, file_path); });
|
||||
};
|
||||
})();
|
||||
//# sourceMappingURL=crawl.js.map
|
1
bin/tools/crawl.js.map
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"crawl.js","sourceRoot":"","sources":["../../src/bin/tools/crawl.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qCAAyB;AACzB,yCAA6B;AAE7B,gFAAgF;AACnE,QAAA,KAAK,GAAG,CAAC;IAElB,IAAM,QAAQ,GAAG,UAAC,QAAgB,EAAE,KAAe;;;YAE/C,KAAwB,IAAA,KAAA,SAAA,EAAE,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAA,gBAAA,4BAAE;gBAA7C,IAAM,SAAS,WAAA;gBAEhB,IAAM,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;gBAEjD,IAAI,EAAE,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,WAAW,EAAE,EAAE;oBAEvC,QAAQ,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;oBAE3B,SAAS;iBAEZ;gBAED,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;aAEzB;;;;;;;;;IAEL,CAAC,CAAC;IAEF,OAAO,SAAS,KAAK,CAAC,QAAgB;QAElC,IAAM,KAAK,GAAa,EAAE,CAAC;QAE3B,QAAQ,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;QAE1B,OAAO,KAAK,CAAC,GAAG,CAAC,UAAA,SAAS,IAAI,OAAA,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC,EAAlC,CAAkC,CAAC,CAAC;IAEtE,CAAC,CAAA;AAEL,CAAC,CAAC,EAAE,CAAC"}
|
5
bin/tools/downloadAndUnzip.d.ts
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
/** assert url ends with .zip */
|
||||
export declare function downloadAndUnzip(params: {
|
||||
url: string;
|
||||
destDirPath: string;
|
||||
}): void;
|
27
bin/tools/downloadAndUnzip.js
Normal file
@ -0,0 +1,27 @@
|
||||
"use strict";
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.downloadAndUnzip = void 0;
|
||||
var path_1 = require("path");
|
||||
var child_process_1 = require("child_process");
|
||||
var fs_1 = __importDefault(require("fs"));
|
||||
var transformCodebase_1 = require("../tools/transformCodebase");
|
||||
/** assert url ends with .zip */
|
||||
function downloadAndUnzip(params) {
|
||||
var url = params.url, destDirPath = params.destDirPath;
|
||||
var tmpDirPath = path_1.join(destDirPath, "..", "tmp_xxKdOxnEdx");
|
||||
child_process_1.execSync("rm -rf " + tmpDirPath);
|
||||
fs_1.default.mkdirSync(tmpDirPath, { "recursive": true });
|
||||
child_process_1.execSync("wget " + url, { "cwd": tmpDirPath });
|
||||
child_process_1.execSync("unzip " + path_1.basename(url), { "cwd": tmpDirPath });
|
||||
child_process_1.execSync("rm " + path_1.basename(url), { "cwd": tmpDirPath });
|
||||
transformCodebase_1.transformCodebase({
|
||||
"srcDirPath": tmpDirPath,
|
||||
"destDirPath": destDirPath,
|
||||
});
|
||||
child_process_1.execSync("rm -r " + tmpDirPath);
|
||||
}
|
||||
exports.downloadAndUnzip = downloadAndUnzip;
|
||||
//# sourceMappingURL=downloadAndUnzip.js.map
|
1
bin/tools/downloadAndUnzip.js.map
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"downloadAndUnzip.js","sourceRoot":"","sources":["../../src/bin/tools/downloadAndUnzip.ts"],"names":[],"mappings":";;;;;;AACA,6BAAkE;AAClE,+CAAyC;AACzC,0CAAoB;AACpB,gEAA+D;AAE/D,gCAAgC;AAChC,SAAgB,gBAAgB,CAC5B,MAGC;IAGO,IAAA,GAAG,GAAkB,MAAM,IAAxB,EAAE,WAAW,GAAK,MAAM,YAAX,CAAY;IAEpC,IAAM,UAAU,GAAG,WAAQ,CAAC,WAAW,EAAE,IAAI,EAAE,gBAAgB,CAAC,CAAC;IAEjE,wBAAQ,CAAC,YAAU,UAAY,CAAC,CAAC;IAEjC,YAAE,CAAC,SAAS,CAAC,UAAU,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC,CAAC;IAEhD,wBAAQ,CAAC,UAAQ,GAAK,EAAE,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,CAAA;IAC9C,wBAAQ,CAAC,WAAS,eAAY,CAAC,GAAG,CAAG,EAAE,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,CAAC;IAC9D,wBAAQ,CAAC,QAAM,eAAY,CAAC,GAAG,CAAG,EAAE,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,CAAC;IAE3D,qCAAiB,CAAC;QACd,YAAY,EAAE,UAAU;QACxB,aAAa,EAAE,WAAW;KAC7B,CAAC,CAAC;IAEH,wBAAQ,CAAC,WAAS,UAAY,CAAC,CAAC;AAEpC,CAAC;AA1BD,4CA0BC"}
|
1
bin/tools/getProjectRoot.d.ts
vendored
Normal file
@ -0,0 +1 @@
|
||||
export declare function getProjectRoot(): string;
|
39
bin/tools/getProjectRoot.js
Normal file
@ -0,0 +1,39 @@
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getProjectRoot = void 0;
|
||||
var fs = __importStar(require("fs"));
|
||||
var path = __importStar(require("path"));
|
||||
function getProjectRootRec(dirPath) {
|
||||
if (fs.existsSync(path.join(dirPath, "package.json"))) {
|
||||
return dirPath;
|
||||
}
|
||||
return getProjectRootRec(path.join(dirPath, ".."));
|
||||
}
|
||||
var result = undefined;
|
||||
function getProjectRoot() {
|
||||
if (result !== undefined) {
|
||||
return result;
|
||||
}
|
||||
return (result = getProjectRootRec(__dirname));
|
||||
}
|
||||
exports.getProjectRoot = getProjectRoot;
|
||||
//# sourceMappingURL=getProjectRoot.js.map
|
1
bin/tools/getProjectRoot.js.map
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"getProjectRoot.js","sourceRoot":"","sources":["../../src/bin/tools/getProjectRoot.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,qCAAyB;AACzB,yCAA6B;AAE7B,SAAS,iBAAiB,CAAC,OAAe;IACtC,IAAI,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC,EAAE;QACnD,OAAO,OAAO,CAAC;KAClB;IACD,OAAO,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC;AACvD,CAAC;AAED,IAAI,MAAM,GAAuB,SAAS,CAAC;AAE3C,SAAgB,cAAc;IAC1B,IAAI,MAAM,KAAK,SAAS,EAAE;QACtB,OAAO,MAAM,CAAC;KACjB;IAED,OAAO,CAAC,MAAM,GAAG,iBAAiB,CAAC,SAAS,CAAC,CAAC,CAAC;AACnD,CAAC;AAND,wCAMC"}
|
1
bin/tools/grant-exec-perms.d.ts
vendored
Normal file
@ -0,0 +1 @@
|
||||
export {};
|
30
bin/tools/grant-exec-perms.js
Normal file
@ -0,0 +1,30 @@
|
||||
"use strict";
|
||||
var __read = (this && this.__read) || function (o, n) {
|
||||
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
||||
if (!m) return o;
|
||||
var i = m.call(o), r, ar = [], e;
|
||||
try {
|
||||
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
||||
}
|
||||
catch (error) { e = { error: error }; }
|
||||
finally {
|
||||
try {
|
||||
if (r && !r.done && (m = i["return"])) m.call(i);
|
||||
}
|
||||
finally { if (e) throw e.error; }
|
||||
}
|
||||
return ar;
|
||||
};
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var getProjectRoot_1 = require("./getProjectRoot");
|
||||
var path_1 = require("path");
|
||||
var child_process_1 = __importDefault(require("child_process"));
|
||||
Object.entries(require(path_1.join(getProjectRoot_1.getProjectRoot(), "package.json"))["bin"])
|
||||
.forEach(function (_a) {
|
||||
var _b = __read(_a, 2), scriptPath = _b[1];
|
||||
return child_process_1.default.execSync("chmod +x " + scriptPath, { "cwd": getProjectRoot_1.getProjectRoot() });
|
||||
});
|
||||
//# sourceMappingURL=grant-exec-perms.js.map
|
1
bin/tools/grant-exec-perms.js.map
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"grant-exec-perms.js","sourceRoot":"","sources":["../../src/bin/tools/grant-exec-perms.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AACA,mDAAkD;AAClD,6BAAwC;AACxC,gEAA0C;AAE1C,MAAM,CAAC,OAAO,CAAS,OAAO,CAAC,WAAQ,CAAC,+BAAc,EAAE,EAAE,cAAc,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;KAC7E,OAAO,CAAC,UAAC,EAAc;QAAd,KAAA,aAAc,EAAX,UAAU,QAAA;IAAM,OAAA,uBAAa,CAAC,QAAQ,CAAC,cAAY,UAAY,EAAE,EAAE,KAAK,EAAE,+BAAc,EAAE,EAAE,CAAC;AAA7E,CAA6E,CAAC,CAAC"}
|
15
bin/tools/transformCodebase.d.ts
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
/// <reference types="node" />
|
||||
declare type TransformSourceCode = (params: {
|
||||
sourceCode: Buffer;
|
||||
filePath: string;
|
||||
}) => {
|
||||
modifiedSourceCode: Buffer;
|
||||
newFileName?: string;
|
||||
} | undefined;
|
||||
/** Apply a transformation function to every file of directory */
|
||||
export declare function transformCodebase(params: {
|
||||
srcDirPath: string;
|
||||
destDirPath: string;
|
||||
transformSourceCode?: TransformSourceCode;
|
||||
}): void;
|
||||
export {};
|
70
bin/tools/transformCodebase.js
Normal file
@ -0,0 +1,70 @@
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
var __values = (this && this.__values) || function(o) {
|
||||
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
||||
if (m) return m.call(o);
|
||||
if (o && typeof o.length === "number") return {
|
||||
next: function () {
|
||||
if (o && i >= o.length) o = void 0;
|
||||
return { value: o && o[i++], done: !o };
|
||||
}
|
||||
};
|
||||
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.transformCodebase = void 0;
|
||||
var fs = __importStar(require("fs"));
|
||||
var path = __importStar(require("path"));
|
||||
var crawl_1 = require("./crawl");
|
||||
var id_1 = require("evt/tools/typeSafety/id");
|
||||
/** Apply a transformation function to every file of directory */
|
||||
function transformCodebase(params) {
|
||||
var e_1, _a;
|
||||
var srcDirPath = params.srcDirPath, destDirPath = params.destDirPath, _b = params.transformSourceCode, transformSourceCode = _b === void 0 ? id_1.id(function (_a) {
|
||||
var sourceCode = _a.sourceCode;
|
||||
return ({ "modifiedSourceCode": sourceCode });
|
||||
}) : _b;
|
||||
try {
|
||||
for (var _c = __values(crawl_1.crawl(srcDirPath)), _d = _c.next(); !_d.done; _d = _c.next()) {
|
||||
var file_relative_path = _d.value;
|
||||
var filePath = path.join(srcDirPath, file_relative_path);
|
||||
var transformSourceCodeResult = transformSourceCode({
|
||||
"sourceCode": fs.readFileSync(filePath),
|
||||
"filePath": path.join(srcDirPath, file_relative_path)
|
||||
});
|
||||
if (transformSourceCodeResult === undefined) {
|
||||
continue;
|
||||
}
|
||||
fs.mkdirSync(path.dirname(path.join(destDirPath, file_relative_path)), { "recursive": true });
|
||||
var newFileName = transformSourceCodeResult.newFileName, modifiedSourceCode = transformSourceCodeResult.modifiedSourceCode;
|
||||
fs.writeFileSync(path.join(path.dirname(path.join(destDirPath, file_relative_path)), newFileName !== null && newFileName !== void 0 ? newFileName : path.basename(file_relative_path)), modifiedSourceCode);
|
||||
}
|
||||
}
|
||||
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
||||
finally {
|
||||
try {
|
||||
if (_d && !_d.done && (_a = _c.return)) _a.call(_c);
|
||||
}
|
||||
finally { if (e_1) throw e_1.error; }
|
||||
}
|
||||
}
|
||||
exports.transformCodebase = transformCodebase;
|
||||
//# sourceMappingURL=transformCodebase.js.map
|
1
bin/tools/transformCodebase.js.map
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"transformCodebase.js","sourceRoot":"","sources":["../../src/bin/tools/transformCodebase.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,qCAAyB;AACzB,yCAA6B;AAC7B,iCAAgC;AAChC,8CAA6C;AAW7C,iEAAiE;AACjE,SAAgB,iBAAiB,CAC7B,MAIC;;IAIG,IAAA,UAAU,GAGV,MAAM,WAHI,EACV,WAAW,GAEX,MAAM,YAFK,EACX,KACA,MAAM,oBADmG,EAAzG,mBAAmB,mBAAG,OAAE,CAAsB,UAAC,EAAc;YAAZ,UAAU,gBAAA;QAAO,OAAA,CAAC,EAAE,oBAAoB,EAAE,UAAU,EAAE,CAAC;IAAtC,CAAsC,CAAC,KAAA,CAClG;;QAEX,KAAiC,IAAA,KAAA,SAAA,aAAK,CAAC,UAAU,CAAC,CAAA,gBAAA,4BAAE;YAA/C,IAAM,kBAAkB,WAAA;YAEzB,IAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,kBAAkB,CAAC,CAAC;YAE3D,IAAM,yBAAyB,GAAG,mBAAmB,CAAC;gBAClD,YAAY,EAAE,EAAE,CAAC,YAAY,CAAC,QAAQ,CAAC;gBACvC,UAAU,EAAE,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,kBAAkB,CAAC;aACxD,CAAC,CAAC;YAEH,IAAI,yBAAyB,KAAK,SAAS,EAAE;gBACzC,SAAS;aACZ;YAED,EAAE,CAAC,SAAS,CACR,IAAI,CAAC,OAAO,CACR,IAAI,CAAC,IAAI,CACL,WAAW,EACX,kBAAkB,CACrB,CACJ,EACD,EAAE,WAAW,EAAE,IAAI,EAAE,CACxB,CAAC;YAEM,IAAA,WAAW,GAAyB,yBAAyB,YAAlD,EAAE,kBAAkB,GAAK,yBAAyB,mBAA9B,CAA+B;YAEtE,EAAE,CAAC,aAAa,CACZ,IAAI,CAAC,IAAI,CACL,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,kBAAkB,CAAC,CAAC,EACxD,WAAW,aAAX,WAAW,cAAX,WAAW,GAAI,IAAI,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CACnD,EACD,kBAAkB,CACrB,CAAC;SAEL;;;;;;;;;AAGL,CAAC;AAlDD,8CAkDC"}
|
3
lib/components/Error.d.ts
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
/// <reference types="react" />
|
||||
import type { KcProps } from "./KcProps";
|
||||
export declare const Error: import("react").MemoExoticComponent<(props: KcProps) => JSX.Element>;
|
31
lib/components/Error.js
Normal file
@ -0,0 +1,31 @@
|
||||
"use strict";
|
||||
var __assign = (this && this.__assign) || function () {
|
||||
__assign = Object.assign || function(t) {
|
||||
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
||||
s = arguments[i];
|
||||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
||||
t[p] = s[p];
|
||||
}
|
||||
return t;
|
||||
};
|
||||
return __assign.apply(this, arguments);
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.Error = void 0;
|
||||
var jsx_runtime_1 = require("react/jsx-runtime");
|
||||
var react_1 = require("react");
|
||||
var Template_1 = require("./Template");
|
||||
var assert_1 = require("../tools/assert");
|
||||
var kcContext_1 = require("../kcContext");
|
||||
var useKcMessage_1 = require("../i18n/useKcMessage");
|
||||
exports.Error = react_1.memo(function (props) {
|
||||
var msg = useKcMessage_1.useKcMessage().msg;
|
||||
assert_1.assert(kcContext_1.kcContext !== undefined &&
|
||||
kcContext_1.kcContext.pageId === "error.ftl" &&
|
||||
kcContext_1.kcContext.message !== undefined);
|
||||
var message = kcContext_1.kcContext.message, client = kcContext_1.kcContext.client;
|
||||
return (jsx_runtime_1.jsx(Template_1.Template, __assign({}, props, { displayMessage: false, headerNode: msg("errorTitle"), formNode: jsx_runtime_1.jsxs("div", __assign({ id: "kc-error-message" }, { children: [jsx_runtime_1.jsx("p", __assign({ className: "instruction" }, { children: message.summary }), void 0),
|
||||
client !== undefined && client.baseUrl !== undefined &&
|
||||
jsx_runtime_1.jsx("p", { children: jsx_runtime_1.jsx("a", __assign({ id: "backToApplication", href: client.baseUrl }, { children: msg("backToApplication") }), void 0) }, void 0)] }), void 0) }), void 0));
|
||||
});
|
||||
//# sourceMappingURL=Error.js.map
|
1
lib/components/Error.js.map
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"Error.js","sourceRoot":"","sources":["../../src/lib/components/Error.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,+BAA6B;AAC7B,uCAAsC;AAEtC,0CAAyC;AACzC,0CAAyC;AACzC,qDAAoD;AAEvC,QAAA,KAAK,GAAG,YAAI,CAAC,UAAC,KAAc;IAE7B,IAAA,GAAG,GAAK,2BAAY,EAAE,IAAnB,CAAoB;IAE/B,eAAM,CACF,qBAAS,KAAK,SAAS;QACvB,qBAAS,CAAC,MAAM,KAAK,WAAW;QAChC,qBAAS,CAAC,OAAO,KAAK,SAAS,CAClC,CAAC;IAEM,IAAA,OAAO,GAAa,qBAAS,QAAtB,EAAE,MAAM,GAAK,qBAAS,OAAd,CAAe;IAEtC,OAAO,CACH,kBAAC,mBAAQ,eACD,KAAK,IACT,cAAc,EAAE,KAAK,EACrB,UAAU,EAAE,GAAG,CAAC,YAAY,CAAC,EAC7B,QAAQ,EACJ,qCAAK,EAAE,EAAC,kBAAkB,iBACtB,kCAAG,SAAS,EAAC,aAAa,gBAAE,OAAO,CAAC,OAAO,YAAK;gBAE5C,MAAM,KAAK,SAAS,IAAI,MAAM,CAAC,OAAO,KAAK,SAAS;oBACpD,mCACI,kCAAG,EAAE,EAAC,mBAAmB,EAAC,IAAI,EAAE,MAAM,CAAC,OAAO,gBACzC,GAAG,CAAC,mBAAmB,CAAC,YACzB,WACJ,aAEN,YAEZ,CACL,CAAC;AACN,CAAC,CAAC,CAAC"}
|
3
lib/components/Info.d.ts
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
/// <reference types="react" />
|
||||
import type { KcProps } from "./KcProps";
|
||||
export declare const Info: import("react").MemoExoticComponent<(props: KcProps) => JSX.Element>;
|
44
lib/components/Info.js
Normal file
@ -0,0 +1,44 @@
|
||||
"use strict";
|
||||
var __assign = (this && this.__assign) || function () {
|
||||
__assign = Object.assign || function(t) {
|
||||
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
||||
s = arguments[i];
|
||||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
||||
t[p] = s[p];
|
||||
}
|
||||
return t;
|
||||
};
|
||||
return __assign.apply(this, arguments);
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.Info = void 0;
|
||||
var jsx_runtime_1 = require("react/jsx-runtime");
|
||||
var react_1 = require("react");
|
||||
var Template_1 = require("./Template");
|
||||
var assert_1 = require("../tools/assert");
|
||||
var kcContext_1 = require("../kcContext");
|
||||
var useKcMessage_1 = require("../i18n/useKcMessage");
|
||||
exports.Info = react_1.memo(function (props) {
|
||||
var msg = useKcMessage_1.useKcMessage().msg;
|
||||
assert_1.assert(kcContext_1.kcContext !== undefined &&
|
||||
kcContext_1.kcContext.pageId === "info.ftl" &&
|
||||
kcContext_1.kcContext.message !== undefined);
|
||||
var messageHeader = kcContext_1.kcContext.messageHeader, message = kcContext_1.kcContext.message, requiredActions = kcContext_1.kcContext.requiredActions, skipLink = kcContext_1.kcContext.skipLink, pageRedirectUri = kcContext_1.kcContext.pageRedirectUri, actionUri = kcContext_1.kcContext.actionUri, client = kcContext_1.kcContext.client;
|
||||
return (jsx_runtime_1.jsx(Template_1.Template, __assign({}, props, { displayMessage: false, headerNode: messageHeader !== undefined ?
|
||||
jsx_runtime_1.jsx(jsx_runtime_1.Fragment, { children: messageHeader }, void 0)
|
||||
:
|
||||
jsx_runtime_1.jsx(jsx_runtime_1.Fragment, { children: message.summary }, void 0), formNode: jsx_runtime_1.jsxs("div", __assign({ id: "kc-info-message" }, { children: [jsx_runtime_1.jsxs("p", __assign({ className: "instruction" }, { children: [message.summary, requiredActions !== undefined &&
|
||||
jsx_runtime_1.jsx("b", { children: requiredActions
|
||||
.map(function (requiredAction) { return msg("requiredAction." + requiredAction); })
|
||||
.join(",") }, void 0)] }), void 0),
|
||||
!skipLink &&
|
||||
pageRedirectUri !== undefined ?
|
||||
jsx_runtime_1.jsx("p", { children: jsx_runtime_1.jsxs("a", __assign({ href: "${pageRedirectUri}" }, { children: ["$", (msg("backToApplication"))] }), void 0) }, void 0)
|
||||
:
|
||||
actionUri !== undefined ?
|
||||
jsx_runtime_1.jsx("p", { children: jsx_runtime_1.jsxs("a", __assign({ href: "${actionUri}" }, { children: ["$", msg("proceedWithAction")] }), void 0) }, void 0)
|
||||
:
|
||||
client.baseUrl !== undefined &&
|
||||
jsx_runtime_1.jsx("p", { children: jsx_runtime_1.jsxs("a", __assign({ href: "${client.baseUrl}" }, { children: ["$", msg("backToApplication")] }), void 0) }, void 0)] }), void 0) }), void 0));
|
||||
});
|
||||
//# sourceMappingURL=Info.js.map
|
1
lib/components/Info.js.map
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"Info.js","sourceRoot":"","sources":["../../src/lib/components/Info.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,+BA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AC,cAAc,sBAAG,GAAG,CAAC,mBAAmB,CAAC,aAAK,WAAI;4BAC7D,CAAC;gCACD,MAAM,CAAC,OAAO,KAAK,SAAS;oCAC5B,mCAAG,mCAAG,IAAI,EAAC,mBAAmB,sBAAG,GAAG,CAAC,mBAAmB,CAAC,aAAK,WAAI,aAE5E,YAIZ,CACL,CAAC;AACN,CAAC,CAAC,CAAC"}
|
3
lib/components/KcApp.d.ts
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
/// <reference types="react" />
|
||||
import type { KcProps } from "./KcProps";
|
||||
export declare const KcApp: import("react").MemoExoticComponent<(props: KcProps) => JSX.Element>;
|
36
lib/components/KcApp.js
Normal file
@ -0,0 +1,36 @@
|
||||
"use strict";
|
||||
var __assign = (this && this.__assign) || function () {
|
||||
__assign = Object.assign || function(t) {
|
||||
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
||||
s = arguments[i];
|
||||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
||||
t[p] = s[p];
|
||||
}
|
||||
return t;
|
||||
};
|
||||
return __assign.apply(this, arguments);
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.KcApp = void 0;
|
||||
var jsx_runtime_1 = require("react/jsx-runtime");
|
||||
var react_1 = require("react");
|
||||
var kcContext_1 = require("../kcContext");
|
||||
var assert_1 = require("../tools/assert");
|
||||
var Login_1 = require("./Login");
|
||||
var Register_1 = require("./Register");
|
||||
var Info_1 = require("./Info");
|
||||
var Error_1 = require("./Error");
|
||||
var LoginResetPassword_1 = require("./LoginResetPassword");
|
||||
var LoginVerifyEmail_1 = require("./LoginVerifyEmail");
|
||||
exports.KcApp = react_1.memo(function (props) {
|
||||
assert_1.assert(kcContext_1.kcContext !== undefined, "App is not currently served by a Keycloak server");
|
||||
switch (kcContext_1.kcContext.pageId) {
|
||||
case "login.ftl": return jsx_runtime_1.jsx(Login_1.Login, __assign({}, props), void 0);
|
||||
case "register.ftl": return jsx_runtime_1.jsx(Register_1.Register, __assign({}, props), void 0);
|
||||
case "info.ftl": return jsx_runtime_1.jsx(Info_1.Info, __assign({}, props), void 0);
|
||||
case "error.ftl": return jsx_runtime_1.jsx(Error_1.Error, __assign({}, props), void 0);
|
||||
case "login-reset-password.ftl": return jsx_runtime_1.jsx(LoginResetPassword_1.LoginResetPassword, __assign({}, props), void 0);
|
||||
case "login-verify-email.ftl": return jsx_runtime_1.jsx(LoginVerifyEmail_1.LoginVerifyEmail, __assign({}, props), void 0);
|
||||
}
|
||||
});
|
||||
//# sourceMappingURL=KcApp.js.map
|
1
lib/components/KcApp.js.map
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"KcApp.js","sourceRoot":"","sources":["../../src/lib/components/KcApp.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,+BAA6B;AAC7B,0CAAyC;AACzC,0CAAyC;AAEzC,iCAAgC;AAChC,uCAAsC;AACtC,+BAA8B;AAC9B,iCAAgC;AAChC,2DAA0D;AAC1D,uDAAsD;AAEzC,QAAA,KAAK,GAAG,YAAI,CAAC,UAAC,KAAc;IAErC,eAAM,CAAC,qBAAS,KAAK,SAAS,EAAE,kDAAkD,CAAC,CAAC;IAEpF,QAAQ,qBAAS,CAAC,MAAM,EAAE;QACtB,KAAK,WAAW,CAAC,CAAC,OAAO,kBAAC,aAAK,eAAK,KAAK,UAAI,CAAC;QAC9C,KAAK,cAAc,CAAC,CAAC,OAAO,kBAAC,mBAAQ,eAAK,KAAK,UAAI,CAAC;QACpD,KAAK,UAAU,CAAC,CAAC,OAAO,kBAAC,WAAI,eAAK,KAAK,UAAI,CAAC;QAC5C,KAAK,WAAW,CAAC,CAAC,OAAO,kBAAC,aAAK,eAAK,KAAK,UAAI,CAAC;QAC9C,KAAK,0BAA0B,CAAC,CAAC,OAAO,kBAAC,uCAAkB,eAAK,KAAK,UAAI,CAAC;QAC1E,KAAK,wBAAwB,CAAC,CAAC,OAAO,kBAAC,mCAAgB,eAAK,KAAK,UAAI,CAAC;KACzE;AAEL,CAAC,CAAC,CAAC"}
|
108
lib/components/KcProps.d.ts
vendored
Normal file
@ -0,0 +1,108 @@
|
||||
/** Class names can be provided as an array or separated by whitespace */
|
||||
export declare type KcPropsGeneric<CssClasses extends string> = {
|
||||
[key in CssClasses]: readonly string[] | string | undefined;
|
||||
};
|
||||
export declare type KcTemplateClassKey = "stylesCommon" | "styles" | "scripts" | "kcHtmlClass" | "kcLoginClass" | "kcHeaderClass" | "kcHeaderWrapperClass" | "kcFormCardClass" | "kcFormCardAccountClass" | "kcFormHeaderClass" | "kcLocaleWrapperClass" | "kcContentWrapperClass" | "kcLabelWrapperClass" | "kcContentWrapperClass" | "kcLabelWrapperClass" | "kcFormGroupClass" | "kcResetFlowIcon" | "kcResetFlowIcon" | "kcFeedbackSuccessIcon" | "kcFeedbackWarningIcon" | "kcFeedbackErrorIcon" | "kcFeedbackInfoIcon" | "kcContentWrapperClass" | "kcFormSocialAccountContentClass" | "kcFormSocialAccountClass" | "kcSignUpClass" | "kcInfoAreaWrapperClass";
|
||||
export declare type KcTemplateProps = KcPropsGeneric<KcTemplateClassKey>;
|
||||
export declare const defaultKcTemplateProps: {
|
||||
readonly stylesCommon: readonly ["node_modules/patternfly/dist/css/patternfly.min.css", "node_modules/patternfly/dist/css/patternfly-additions.min.css", "lib/zocial/zocial.css"];
|
||||
readonly styles: readonly ["css/login.css"];
|
||||
readonly scripts: readonly [];
|
||||
readonly kcHtmlClass: readonly ["login-pf"];
|
||||
readonly kcLoginClass: readonly ["login-pf-page"];
|
||||
readonly kcContentWrapperClass: readonly ["row"];
|
||||
readonly kcHeaderClass: readonly ["login-pf-page-header"];
|
||||
readonly kcHeaderWrapperClass: readonly [];
|
||||
readonly kcFormCardClass: readonly ["card-pf"];
|
||||
readonly kcFormCardAccountClass: readonly ["login-pf-accounts"];
|
||||
readonly kcFormSocialAccountClass: readonly ["login-pf-social-section"];
|
||||
readonly kcFormSocialAccountContentClass: readonly ["col-xs-12", "col-sm-6"];
|
||||
readonly kcFormHeaderClass: readonly ["login-pf-header"];
|
||||
readonly kcLocaleWrapperClass: readonly [];
|
||||
readonly kcFeedbackErrorIcon: readonly ["pficon", "pficon-error-circle-o"];
|
||||
readonly kcFeedbackWarningIcon: readonly ["pficon", "pficon-warning-triangle-o"];
|
||||
readonly kcFeedbackSuccessIcon: readonly ["pficon", "pficon-ok"];
|
||||
readonly kcFeedbackInfoIcon: readonly ["pficon", "pficon-info"];
|
||||
readonly kcResetFlowIcon: readonly ["pficon", "pficon-arrow fa-2x"];
|
||||
readonly kcFormGroupClass: readonly ["form-group"];
|
||||
readonly kcLabelWrapperClass: readonly ["col-xs-12", "col-sm-12", "col-md-12", "col-lg-12"];
|
||||
readonly kcSignUpClass: readonly ["login-pf-signup"];
|
||||
readonly kcInfoAreaWrapperClass: readonly [];
|
||||
};
|
||||
/** Tu use if you don't want any default */
|
||||
export declare const allClearKcTemplateProps: Record<"stylesCommon" | "styles" | "scripts" | "kcHtmlClass" | "kcLoginClass" | "kcHeaderClass" | "kcHeaderWrapperClass" | "kcFormCardClass" | "kcFormCardAccountClass" | "kcFormHeaderClass" | "kcLocaleWrapperClass" | "kcContentWrapperClass" | "kcLabelWrapperClass" | "kcFormGroupClass" | "kcResetFlowIcon" | "kcFeedbackSuccessIcon" | "kcFeedbackWarningIcon" | "kcFeedbackErrorIcon" | "kcFeedbackInfoIcon" | "kcFormSocialAccountContentClass" | "kcFormSocialAccountClass" | "kcSignUpClass" | "kcInfoAreaWrapperClass", undefined>;
|
||||
export declare type KcProps = KcPropsGeneric<KcTemplateClassKey | "kcLogoLink" | "kcLogoClass" | "kcContainerClass" | "kcContentClass" | "kcFeedbackAreaClass" | "kcLocaleClass" | "kcAlertIconClasserror" | "kcFormAreaClass" | "kcFormSocialAccountListClass" | "kcFormSocialAccountDoubleListClass" | "kcFormSocialAccountListLinkClass" | "kcWebAuthnKeyIcon" | "kcFormClass" | "kcFormGroupErrorClass" | "kcLabelClass" | "kcInputClass" | "kcInputWrapperClass" | "kcFormOptionsClass" | "kcFormButtonsClass" | "kcFormSettingClass" | "kcTextareaClass" | "kcInfoAreaClass" | "kcButtonClass" | "kcButtonPrimaryClass" | "kcButtonDefaultClass" | "kcButtonLargeClass" | "kcButtonBlockClass" | "kcInputLargeClass" | "kcSrOnlyClass" | "kcSelectAuthListClass" | "kcSelectAuthListItemClass" | "kcSelectAuthListItemInfoClass" | "kcSelectAuthListItemLeftClass" | "kcSelectAuthListItemBodyClass" | "kcSelectAuthListItemDescriptionClass" | "kcSelectAuthListItemHeadingClass" | "kcSelectAuthListItemHelpTextClass" | "kcAuthenticatorDefaultClass" | "kcAuthenticatorPasswordClass" | "kcAuthenticatorOTPClass" | "kcAuthenticatorWebAuthnClass" | "kcAuthenticatorWebAuthnPasswordlessClass" | "kcSelectOTPListClass" | "kcSelectOTPListItemClass" | "kcAuthenticatorOtpCircleClass" | "kcSelectOTPItemHeadingClass" | "kcFormOptionsWrapperClass">;
|
||||
export declare const defaultKcProps: {
|
||||
readonly kcLogoLink: "http://www.keycloak.org";
|
||||
readonly kcLogoClass: "login-pf-brand";
|
||||
readonly kcContainerClass: "container-fluid";
|
||||
readonly kcContentClass: readonly ["col-sm-8", "col-sm-offset-2", "col-md-6", "col-md-offset-3", "col-lg-6", "col-lg-offset-3"];
|
||||
readonly kcFeedbackAreaClass: readonly ["col-md-12"];
|
||||
readonly kcLocaleClass: readonly ["col-xs-12", "col-sm-1"];
|
||||
readonly kcAlertIconClasserror: readonly ["pficon", "pficon-error-circle-o"];
|
||||
readonly kcFormAreaClass: readonly ["col-sm-10", "col-sm-offset-1", "col-md-8", "col-md-offset-2", "col-lg-8", "col-lg-offset-2"];
|
||||
readonly kcFormSocialAccountListClass: readonly ["login-pf-social", "list-unstyled", "login-pf-social-all"];
|
||||
readonly kcFormSocialAccountDoubleListClass: readonly ["login-pf-social-double-col"];
|
||||
readonly kcFormSocialAccountListLinkClass: readonly ["login-pf-social-link"];
|
||||
readonly kcWebAuthnKeyIcon: readonly ["pficon", "pficon-key"];
|
||||
readonly kcFormClass: readonly ["form-horizontal"];
|
||||
readonly kcFormGroupErrorClass: readonly ["has-error"];
|
||||
readonly kcLabelClass: readonly ["control-label"];
|
||||
readonly kcInputClass: readonly ["form-control"];
|
||||
readonly kcInputWrapperClass: readonly ["col-xs-12", "col-sm-12", "col-md-12", "col-lg-12"];
|
||||
readonly kcFormOptionsClass: readonly ["col-xs-12", "col-sm-12", "col-md-12", "col-lg-12"];
|
||||
readonly kcFormButtonsClass: readonly ["col-xs-12", "col-sm-12", "col-md-12", "col-lg-12"];
|
||||
readonly kcFormSettingClass: readonly ["login-pf-settings"];
|
||||
readonly kcTextareaClass: readonly ["form-control"];
|
||||
readonly kcInfoAreaClass: readonly ["col-xs-12", "col-sm-4", "col-md-4", "col-lg-5", "details"];
|
||||
readonly kcButtonClass: readonly ["btn"];
|
||||
readonly kcButtonPrimaryClass: readonly ["btn-primary"];
|
||||
readonly kcButtonDefaultClass: readonly ["btn-default"];
|
||||
readonly kcButtonLargeClass: readonly ["btn-lg"];
|
||||
readonly kcButtonBlockClass: readonly ["btn-block"];
|
||||
readonly kcInputLargeClass: readonly ["input-lg"];
|
||||
readonly kcSrOnlyClass: readonly ["sr-only"];
|
||||
readonly kcSelectAuthListClass: readonly ["list-group", "list-view-pf"];
|
||||
readonly kcSelectAuthListItemClass: readonly ["list-group-item", "list-view-pf-stacked"];
|
||||
readonly kcSelectAuthListItemInfoClass: readonly ["list-view-pf-main-info"];
|
||||
readonly kcSelectAuthListItemLeftClass: readonly ["list-view-pf-left"];
|
||||
readonly kcSelectAuthListItemBodyClass: readonly ["list-view-pf-body"];
|
||||
readonly kcSelectAuthListItemDescriptionClass: readonly ["list-view-pf-description"];
|
||||
readonly kcSelectAuthListItemHeadingClass: readonly ["list-group-item-heading"];
|
||||
readonly kcSelectAuthListItemHelpTextClass: readonly ["list-group-item-text"];
|
||||
readonly kcAuthenticatorDefaultClass: readonly ["fa", "list-view-pf-icon-lg"];
|
||||
readonly kcAuthenticatorPasswordClass: readonly ["fa", "fa-unlock list-view-pf-icon-lg"];
|
||||
readonly kcAuthenticatorOTPClass: readonly ["fa", "fa-mobile", "list-view-pf-icon-lg"];
|
||||
readonly kcAuthenticatorWebAuthnClass: readonly ["fa", "fa-key", "list-view-pf-icon-lg"];
|
||||
readonly kcAuthenticatorWebAuthnPasswordlessClass: readonly ["fa", "fa-key", "list-view-pf-icon-lg"];
|
||||
readonly kcSelectOTPListClass: readonly ["card-pf", "card-pf-view", "card-pf-view-select", "card-pf-view-single-select"];
|
||||
readonly kcSelectOTPListItemClass: readonly ["card-pf-body", "card-pf-top-element"];
|
||||
readonly kcAuthenticatorOtpCircleClass: readonly ["fa", "fa-mobile", "card-pf-icon-circle"];
|
||||
readonly kcSelectOTPItemHeadingClass: readonly ["card-pf-title", "text-center"];
|
||||
readonly kcFormOptionsWrapperClass: readonly [];
|
||||
readonly stylesCommon: readonly ["node_modules/patternfly/dist/css/patternfly.min.css", "node_modules/patternfly/dist/css/patternfly-additions.min.css", "lib/zocial/zocial.css"];
|
||||
readonly styles: readonly ["css/login.css"];
|
||||
readonly scripts: readonly [];
|
||||
readonly kcHtmlClass: readonly ["login-pf"];
|
||||
readonly kcLoginClass: readonly ["login-pf-page"];
|
||||
readonly kcContentWrapperClass: readonly ["row"];
|
||||
readonly kcHeaderClass: readonly ["login-pf-page-header"];
|
||||
readonly kcHeaderWrapperClass: readonly [];
|
||||
readonly kcFormCardClass: readonly ["card-pf"];
|
||||
readonly kcFormCardAccountClass: readonly ["login-pf-accounts"];
|
||||
readonly kcFormSocialAccountClass: readonly ["login-pf-social-section"];
|
||||
readonly kcFormSocialAccountContentClass: readonly ["col-xs-12", "col-sm-6"];
|
||||
readonly kcFormHeaderClass: readonly ["login-pf-header"];
|
||||
readonly kcLocaleWrapperClass: readonly [];
|
||||
readonly kcFeedbackErrorIcon: readonly ["pficon", "pficon-error-circle-o"];
|
||||
readonly kcFeedbackWarningIcon: readonly ["pficon", "pficon-warning-triangle-o"];
|
||||
readonly kcFeedbackSuccessIcon: readonly ["pficon", "pficon-ok"];
|
||||
readonly kcFeedbackInfoIcon: readonly ["pficon", "pficon-info"];
|
||||
readonly kcResetFlowIcon: readonly ["pficon", "pficon-arrow fa-2x"];
|
||||
readonly kcFormGroupClass: readonly ["form-group"];
|
||||
readonly kcLabelWrapperClass: readonly ["col-xs-12", "col-sm-12", "col-md-12", "col-lg-12"];
|
||||
readonly kcSignUpClass: readonly ["login-pf-signup"];
|
||||
readonly kcInfoAreaWrapperClass: readonly [];
|
||||
};
|
||||
/** Tu use if you don't want any default */
|
||||
export declare const allClearKcProps: Record<"stylesCommon" | "styles" | "scripts" | "kcHtmlClass" | "kcLoginClass" | "kcHeaderClass" | "kcHeaderWrapperClass" | "kcFormCardClass" | "kcFormCardAccountClass" | "kcFormHeaderClass" | "kcLocaleWrapperClass" | "kcContentWrapperClass" | "kcLabelWrapperClass" | "kcFormGroupClass" | "kcResetFlowIcon" | "kcFeedbackSuccessIcon" | "kcFeedbackWarningIcon" | "kcFeedbackErrorIcon" | "kcFeedbackInfoIcon" | "kcFormSocialAccountContentClass" | "kcFormSocialAccountClass" | "kcSignUpClass" | "kcInfoAreaWrapperClass" | "kcLogoLink" | "kcLogoClass" | "kcContainerClass" | "kcContentClass" | "kcFeedbackAreaClass" | "kcLocaleClass" | "kcAlertIconClasserror" | "kcFormAreaClass" | "kcFormSocialAccountListClass" | "kcFormSocialAccountDoubleListClass" | "kcFormSocialAccountListLinkClass" | "kcWebAuthnKeyIcon" | "kcFormClass" | "kcFormGroupErrorClass" | "kcLabelClass" | "kcInputClass" | "kcInputWrapperClass" | "kcFormOptionsClass" | "kcFormButtonsClass" | "kcFormSettingClass" | "kcTextareaClass" | "kcInfoAreaClass" | "kcButtonClass" | "kcButtonPrimaryClass" | "kcButtonDefaultClass" | "kcButtonLargeClass" | "kcButtonBlockClass" | "kcInputLargeClass" | "kcSrOnlyClass" | "kcSelectAuthListClass" | "kcSelectAuthListItemClass" | "kcSelectAuthListItemInfoClass" | "kcSelectAuthListItemLeftClass" | "kcSelectAuthListItemBodyClass" | "kcSelectAuthListItemDescriptionClass" | "kcSelectAuthListItemHeadingClass" | "kcSelectAuthListItemHelpTextClass" | "kcAuthenticatorDefaultClass" | "kcAuthenticatorPasswordClass" | "kcAuthenticatorOTPClass" | "kcAuthenticatorWebAuthnClass" | "kcAuthenticatorWebAuthnPasswordlessClass" | "kcSelectOTPListClass" | "kcSelectOTPListItemClass" | "kcAuthenticatorOtpCircleClass" | "kcSelectOTPItemHeadingClass" | "kcFormOptionsWrapperClass", undefined>;
|
71
lib/components/KcProps.js
Normal file
@ -0,0 +1,71 @@
|
||||
"use strict";
|
||||
var __assign = (this && this.__assign) || function () {
|
||||
__assign = Object.assign || function(t) {
|
||||
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
||||
s = arguments[i];
|
||||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
||||
t[p] = s[p];
|
||||
}
|
||||
return t;
|
||||
};
|
||||
return __assign.apply(this, arguments);
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.allClearKcProps = exports.defaultKcProps = exports.allClearKcTemplateProps = exports.defaultKcTemplateProps = void 0;
|
||||
var allPropertiesValuesToUndefined_1 = require("../tools/allPropertiesValuesToUndefined");
|
||||
var doExtends_1 = require("evt/tools/typeSafety/doExtends");
|
||||
exports.defaultKcTemplateProps = {
|
||||
"stylesCommon": [
|
||||
"node_modules/patternfly/dist/css/patternfly.min.css",
|
||||
"node_modules/patternfly/dist/css/patternfly-additions.min.css",
|
||||
"lib/zocial/zocial.css"
|
||||
],
|
||||
"styles": ["css/login.css"],
|
||||
"scripts": [],
|
||||
"kcHtmlClass": ["login-pf"],
|
||||
"kcLoginClass": ["login-pf-page"],
|
||||
"kcContentWrapperClass": ["row"],
|
||||
"kcHeaderClass": ["login-pf-page-header"],
|
||||
"kcHeaderWrapperClass": [],
|
||||
"kcFormCardClass": ["card-pf"],
|
||||
"kcFormCardAccountClass": ["login-pf-accounts"],
|
||||
"kcFormSocialAccountClass": ["login-pf-social-section"],
|
||||
"kcFormSocialAccountContentClass": ["col-xs-12", "col-sm-6"],
|
||||
"kcFormHeaderClass": ["login-pf-header"],
|
||||
"kcLocaleWrapperClass": [],
|
||||
"kcFeedbackErrorIcon": ["pficon", "pficon-error-circle-o"],
|
||||
"kcFeedbackWarningIcon": ["pficon", "pficon-warning-triangle-o"],
|
||||
"kcFeedbackSuccessIcon": ["pficon", "pficon-ok"],
|
||||
"kcFeedbackInfoIcon": ["pficon", "pficon-info"],
|
||||
"kcResetFlowIcon": ["pficon", "pficon-arrow fa-2x"],
|
||||
"kcFormGroupClass": ["form-group"],
|
||||
"kcLabelWrapperClass": ["col-xs-12", "col-sm-12", "col-md-12", "col-lg-12"],
|
||||
"kcSignUpClass": ["login-pf-signup"],
|
||||
"kcInfoAreaWrapperClass": []
|
||||
};
|
||||
doExtends_1.doExtends();
|
||||
/** Tu use if you don't want any default */
|
||||
exports.allClearKcTemplateProps = allPropertiesValuesToUndefined_1.allPropertiesValuesToUndefined(exports.defaultKcTemplateProps);
|
||||
doExtends_1.doExtends();
|
||||
exports.defaultKcProps = __assign(__assign({}, exports.defaultKcTemplateProps), { "kcLogoLink": "http://www.keycloak.org", "kcLogoClass": "login-pf-brand", "kcContainerClass": "container-fluid", "kcContentClass": ["col-sm-8", "col-sm-offset-2", "col-md-6", "col-md-offset-3", "col-lg-6", "col-lg-offset-3"], "kcFeedbackAreaClass": ["col-md-12"], "kcLocaleClass": ["col-xs-12", "col-sm-1"], "kcAlertIconClasserror": ["pficon", "pficon-error-circle-o"], "kcFormAreaClass": ["col-sm-10", "col-sm-offset-1", "col-md-8", "col-md-offset-2", "col-lg-8", "col-lg-offset-2"], "kcFormSocialAccountListClass": ["login-pf-social", "list-unstyled", "login-pf-social-all"], "kcFormSocialAccountDoubleListClass": ["login-pf-social-double-col"], "kcFormSocialAccountListLinkClass": ["login-pf-social-link"], "kcWebAuthnKeyIcon": ["pficon", "pficon-key"], "kcFormClass": ["form-horizontal"], "kcFormGroupErrorClass": ["has-error"], "kcLabelClass": ["control-label"], "kcInputClass": ["form-control"], "kcInputWrapperClass": ["col-xs-12", "col-sm-12", "col-md-12", "col-lg-12"], "kcFormOptionsClass": ["col-xs-12", "col-sm-12", "col-md-12", "col-lg-12"], "kcFormButtonsClass": ["col-xs-12", "col-sm-12", "col-md-12", "col-lg-12"], "kcFormSettingClass": ["login-pf-settings"], "kcTextareaClass": ["form-control"], "kcInfoAreaClass": ["col-xs-12", "col-sm-4", "col-md-4", "col-lg-5", "details"],
|
||||
// css classes for form buttons main class used for all buttons
|
||||
"kcButtonClass": ["btn"],
|
||||
// classes defining priority of the button - primary or default (there is typically only one priority button for the form)
|
||||
"kcButtonPrimaryClass": ["btn-primary"], "kcButtonDefaultClass": ["btn-default"],
|
||||
// classes defining size of the button
|
||||
"kcButtonLargeClass": ["btn-lg"], "kcButtonBlockClass": ["btn-block"],
|
||||
// css classes for input
|
||||
"kcInputLargeClass": ["input-lg"],
|
||||
// css classes for form accessability
|
||||
"kcSrOnlyClass": ["sr-only"],
|
||||
// css classes for select-authenticator form
|
||||
"kcSelectAuthListClass": ["list-group", "list-view-pf"], "kcSelectAuthListItemClass": ["list-group-item", "list-view-pf-stacked"], "kcSelectAuthListItemInfoClass": ["list-view-pf-main-info"], "kcSelectAuthListItemLeftClass": ["list-view-pf-left"], "kcSelectAuthListItemBodyClass": ["list-view-pf-body"], "kcSelectAuthListItemDescriptionClass": ["list-view-pf-description"], "kcSelectAuthListItemHeadingClass": ["list-group-item-heading"], "kcSelectAuthListItemHelpTextClass": ["list-group-item-text"],
|
||||
// css classes for the authenticators
|
||||
"kcAuthenticatorDefaultClass": ["fa", "list-view-pf-icon-lg"], "kcAuthenticatorPasswordClass": ["fa", "fa-unlock list-view-pf-icon-lg"], "kcAuthenticatorOTPClass": ["fa", "fa-mobile", "list-view-pf-icon-lg"], "kcAuthenticatorWebAuthnClass": ["fa", "fa-key", "list-view-pf-icon-lg"], "kcAuthenticatorWebAuthnPasswordlessClass": ["fa", "fa-key", "list-view-pf-icon-lg"],
|
||||
//css classes for the OTP Login Form
|
||||
"kcSelectOTPListClass": ["card-pf", "card-pf-view", "card-pf-view-select", "card-pf-view-single-select"], "kcSelectOTPListItemClass": ["card-pf-body", "card-pf-top-element"], "kcAuthenticatorOtpCircleClass": ["fa", "fa-mobile", "card-pf-icon-circle"], "kcSelectOTPItemHeadingClass": ["card-pf-title", "text-center"], "kcFormOptionsWrapperClass": [] });
|
||||
doExtends_1.doExtends();
|
||||
/** Tu use if you don't want any default */
|
||||
exports.allClearKcProps = allPropertiesValuesToUndefined_1.allPropertiesValuesToUndefined(exports.defaultKcProps);
|
||||
doExtends_1.doExtends();
|
||||
//# sourceMappingURL=KcProps.js.map
|
1
lib/components/KcProps.js.map
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"KcProps.js","sourceRoot":"","sources":["../../src/lib/components/KcProps.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AACA,0FAAyF;AACzF,4DAA2D;AAqC9C,QAAA,sBAAsB,GAAG;IAClC,cAAc,EAAE;QACZ,qDAAqD;QACrD,+DAA+D;QAC/D,uBAAuB;KAC1B;IACD,QAAQ,EAAE,CAAC,eAAe,CAAC;IAC3B,SAAS,EAAE,EAAE;IACb,aAAa,EAAE,CAAC,UAAU,CAAC;IAC3B,cAAc,EAAE,CAAC,eAAe,CAAC;IACjC,uBAAuB,EAAE,CAAC,KAAK,CAAC;IAChC,eAAe,EAAE,CAAC,sBAAsB,CAAC;IACzC,sBAAsB,EAAE,EAAE;IAC1B,iBAAiB,EAAE,CAAC,SAAS,CAAC;IAC9B,wBAAwB,EAAE,CAAC,mBAAmB,CAAC;IAC/C,0BAA0B,EAAE,CAAC,yBAAyB,CAAC;IACvD,iCAAiC,EAAE,CAAC,WAAW,EAAE,UAAU,CAAC;IAC5D,mBAAmB,EAA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EACtD,sCAAsC,EAAE,CAAC,0BAA0B,CAAC,EACpE,kCAAkC,EAAE,CAAC,yBAAyB,CAAC,EAC/D,mCAAmC,EAAE,CAAC,sBAAsB,CAAC;IAE7D,qCAAqC;IACrC,6BAA6B,EAAE,CAAC,IAAI,EAAE,sBAAsB,CAAC,EAC7D,8BAA8B,EAAE,CAAC,IAAI,EAAE,gCAAgC,CAAC,EACxE,yBAAyB,EAAE,CAAC,IAAI,EAAE,WAAW,EAAE,sBAAsB,CAAC,EACtE,8BAA8B,EAAE,CAAC,IAAI,EAAE,QAAQ,EAAE,sBAAsB,CAAC,EACxE,0CAA0C,EAAE,CAAC,IAAI,EAAE,QAAQ,EAAE,sBAAsB,CAAC;IAEpF,oCAAoC;IACpC,sBAAsB,EAAE,CAAC,SAAS,EAAE,cAAc,EAAE,qBAAqB,EAAE,4BAA4B,CAAC,EACxG,0BAA0B,EAAE,CAAC,cAAc,EAAE,qBAAqB,CAAC,EACnE,+BAA+B,EAAE,CAAC,IAAI,EAAE,WAAW,EAAE,qBAAqB,CAAC,EAC3E,6BAA6B,EAAE,CAAC,eAAe,EAAE,aAAa,CAAC,EAC/D,2BAA2B,EAAE,EAAE,GACzB,CAAC;AAEX,qBAAS,EAAkC,CAAC;AAE5C,2CAA2C;AAC9B,QAAA,eAAe,GACxB,+DAA8B,CAAC,sBAAc,CAAC,CAAC;AAEnD,qBAAS,EAAmC,CAAC"}
|
3
lib/components/Login.d.ts
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
/// <reference types="react" />
|
||||
import type { KcProps } from "./KcProps";
|
||||
export declare const Login: import("react").MemoExoticComponent<(props: KcProps) => JSX.Element>;
|
74
lib/components/Login.js
Normal file
@ -0,0 +1,74 @@
|
||||
"use strict";
|
||||
var __assign = (this && this.__assign) || function () {
|
||||
__assign = Object.assign || function(t) {
|
||||
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
||||
s = arguments[i];
|
||||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
||||
t[p] = s[p];
|
||||
}
|
||||
return t;
|
||||
};
|
||||
return __assign.apply(this, arguments);
|
||||
};
|
||||
var __read = (this && this.__read) || function (o, n) {
|
||||
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
||||
if (!m) return o;
|
||||
var i = m.call(o), r, ar = [], e;
|
||||
try {
|
||||
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
||||
}
|
||||
catch (error) { e = { error: error }; }
|
||||
finally {
|
||||
try {
|
||||
if (r && !r.done && (m = i["return"])) m.call(i);
|
||||
}
|
||||
finally { if (e) throw e.error; }
|
||||
}
|
||||
return ar;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.Login = void 0;
|
||||
var jsx_runtime_1 = require("react/jsx-runtime");
|
||||
var react_1 = require("react");
|
||||
var Template_1 = require("./Template");
|
||||
var assert_1 = require("../tools/assert");
|
||||
var kcContext_1 = require("../kcContext");
|
||||
var useKcMessage_1 = require("../i18n/useKcMessage");
|
||||
var tss_react_1 = require("tss-react");
|
||||
var powerhooks_1 = require("powerhooks");
|
||||
exports.Login = react_1.memo(function (props) {
|
||||
var _a;
|
||||
var _b = useKcMessage_1.useKcMessage(), msg = _b.msg, msgStr = _b.msgStr;
|
||||
assert_1.assert(kcContext_1.kcContext !== undefined &&
|
||||
kcContext_1.kcContext.pageId === "login.ftl");
|
||||
var social = kcContext_1.kcContext.social, realm = kcContext_1.kcContext.realm, url = kcContext_1.kcContext.url, usernameEditDisabled = kcContext_1.kcContext.usernameEditDisabled, login = kcContext_1.kcContext.login, auth = kcContext_1.kcContext.auth, registrationDisabled = kcContext_1.kcContext.registrationDisabled;
|
||||
var _c = __read(react_1.useState(false), 2), isLoginButtonDisabled = _c[0], setIsLoginButtonDisabled = _c[1];
|
||||
var onSubmit = powerhooks_1.useConstCallback(function () {
|
||||
return (setIsLoginButtonDisabled(true), true);
|
||||
});
|
||||
return (jsx_runtime_1.jsx(Template_1.Template, __assign({}, props, { displayInfo: social.displayInfo, displayWide: realm.password && social.providers !== undefined, headerNode: msg("doLogIn"), formNode: jsx_runtime_1.jsxs("div", __assign({ id: "kc-form", className: tss_react_1.cx(realm.password && social.providers !== undefined && props.kcContentWrapperClass) }, { children: [jsx_runtime_1.jsx("div", __assign({ id: "kc-form-wrapper", className: tss_react_1.cx(realm.password && social.providers && [props.kcFormSocialAccountContentClass, props.kcFormSocialAccountClass]) }, { children: realm.password &&
|
||||
(jsx_runtime_1.jsxs("form", __assign({ id: "kc-form-login", onSubmit: onSubmit, action: url.loginAction, method: "post" }, { children: [jsx_runtime_1.jsxs("div", __assign({ className: tss_react_1.cx(props.kcFormGroupClass) }, { children: [jsx_runtime_1.jsx("label", __assign({ htmlFor: "username", className: tss_react_1.cx(props.kcLabelClass) }, { children: !realm.loginWithEmailAllowed ?
|
||||
msg("username")
|
||||
:
|
||||
(!realm.registrationEmailAsUsername ?
|
||||
msg("usernameOrEmail") :
|
||||
msg("email")) }), void 0),
|
||||
jsx_runtime_1.jsx("input", __assign({ tabIndex: 1, id: "username", className: tss_react_1.cx(props.kcInputClass), name: "username", defaultValue: (_a = login.username) !== null && _a !== void 0 ? _a : '', type: "text" }, (usernameEditDisabled ? { "disabled": true } : { "autoFocus": true, "autocomplete": "off" })), void 0)] }), void 0),
|
||||
jsx_runtime_1.jsxs("div", __assign({ className: tss_react_1.cx(props.kcFormGroupClass) }, { children: [jsx_runtime_1.jsx("label", __assign({ htmlFor: "password", className: tss_react_1.cx(props.kcLabelClass) }, { children: msg("password") }), void 0),
|
||||
jsx_runtime_1.jsx("input", { tabIndex: 2, id: "password", className: tss_react_1.cx(props.kcInputClass), name: "password", type: "password", autoComplete: "off" }, void 0)] }), void 0),
|
||||
jsx_runtime_1.jsxs("div", __assign({ className: tss_react_1.cx(props.kcFormGroupClass, props.kcFormSettingClass) }, { children: [jsx_runtime_1.jsx("div", __assign({ id: "kc-form-options" }, { children: (realm.rememberMe &&
|
||||
!usernameEditDisabled) &&
|
||||
jsx_runtime_1.jsx("div", __assign({ className: "checkbox" }, { children: jsx_runtime_1.jsxs("label", { children: [jsx_runtime_1.jsx("input", __assign({ tabIndex: 3, id: "rememberMe", name: "rememberMe", type: "checkbox" }, (login.rememberMe ? { "checked": true } : {})), void 0), msg("rememberMe")] }, void 0) }), void 0) }), void 0),
|
||||
jsx_runtime_1.jsx("div", __assign({ className: tss_react_1.cx(props.kcFormOptionsWrapperClass) }, { children: realm.resetPasswordAllowed &&
|
||||
jsx_runtime_1.jsx("span", { children: jsx_runtime_1.jsx("a", __assign({ tabIndex: 5, href: url.loginResetCredentialsUrl }, { children: msg("doForgotPassword") }), void 0) }, void 0) }), void 0)] }), void 0),
|
||||
jsx_runtime_1.jsxs("div", __assign({ id: "kc-form-buttons", className: tss_react_1.cx(props.kcFormGroupClass) }, { children: [jsx_runtime_1.jsx("input", __assign({ type: "hidden", id: "id-hidden-input", name: "credentialId" }, ((auth === null || auth === void 0 ? void 0 : auth.selectedCredential) !== undefined ? { "value": auth.selectedCredential } : {})), void 0),
|
||||
jsx_runtime_1.jsx("input", { tabIndex: 4, className: tss_react_1.cx(props.kcButtonClass, props.kcButtonPrimaryClass, props.kcButtonBlockClass, props.kcButtonLargeClass), name: "login", id: "kc-login", type: "submit", value: msgStr("doLogIn"), disabled: isLoginButtonDisabled }, void 0)] }), void 0)] }), void 0)) }), void 0),
|
||||
(realm.password && social.providers !== undefined) &&
|
||||
jsx_runtime_1.jsx("div", __assign({ id: "kc-social-providers", className: tss_react_1.cx(props.kcFormSocialAccountContentClass, props.kcFormSocialAccountClass) }, { children: jsx_runtime_1.jsx("ul", __assign({ className: tss_react_1.cx(props.kcFormSocialAccountListClass, social.providers.length > 4 && props.kcFormSocialAccountDoubleListClass) }, { children: social.providers.map(function (p) {
|
||||
return jsx_runtime_1.jsx("li", __assign({ className: tss_react_1.cx(props.kcFormSocialAccountListLinkClass) }, { children: jsx_runtime_1.jsx("a", __assign({ href: p.loginUrl, id: "zocial-" + p.alias, className: tss_react_1.cx("zocial", p.providerId) }, { children: jsx_runtime_1.jsx("span", { children: p.displayName }, void 0) }), void 0) }), void 0);
|
||||
}) }), void 0) }), void 0)] }), void 0), infoNode: (realm.password &&
|
||||
realm.registrationAllowed &&
|
||||
!registrationDisabled) &&
|
||||
jsx_runtime_1.jsx("div", __assign({ id: "kc-registration" }, { children: jsx_runtime_1.jsxs("span", { children: [msg("noAccount"), jsx_runtime_1.jsx("a", __assign({ tabIndex: 6, href: url.registrationUrl }, { children: msg("doRegister") }), void 0)] }, void 0) }), void 0) }), void 0));
|
||||
});
|
||||
//# sourceMappingURL=Login.js.map
|
1
lib/components/Login.js.map
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"Login.js","sourceRoot":"","sources":["../../src/lib/components/Login.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,+BAAuC;AACvC,uCAAsC;AAEtC,0CAAyC;AACzC,0CAAyC;AACzC,qDAAoD;AACpD,uCAA+B;AAC/B,yCAA8C;AAEjC,QAAA,KAAK,GAAG,YAAI,CAAC,UAAC,KAAc;;IAE/B,IAAA,KAAkB,2BAAY,EAAE,EAA9B,GAAG,SAAA,EAAE,MAAM,YAAmB,CAAC;IAEvC,eAAM,CACF,qBAAS,KAAK,SAAS;QACvB,qBAAS,CAAC,MAAM,KAAK,WAAW,CACnC,CAAC;IAGE,IAAA,MAAM,GAGN,qBAAS,OAHH,EAAE,KAAK,GAGb,qBAAS,MAHI,EAAE,GAAG,GAGlB,qBAAS,IAHS,EAClB,oBAAoB,GAEpB,qBAAS,qBAFW,EAAE,KAAK,GAE3B,qBAAS,MAFkB,EAC3B,IAAI,GACJ,qBAAS,KADL,EAAE,oBAAoB,GAC1B,qBAAS,qBADiB,CAChB;IAER,IAAA,KAAA,OAAoD,gBAAQ,CAAC,KAAK,CAAC,IAAA,EAAlE,qBAAqB,QAAA,EAAE,wBAAwB,QAAmB,CAAC;IAE1E,IAAM,QAAQ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