@keycloakify/svelte 0.1.11 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/keycloakify-svelte/bin/818.index.js +1 -3
- package/keycloakify-svelte/login/Template.svelte +1 -1
- package/keycloakify-svelte/login/Template.useInitialize.d.ts +3 -0
- package/keycloakify-svelte/login/Template.useInitialize.js +8 -5
- package/keycloakify-svelte/login/components/InputFieldByType.svelte +2 -1
- package/keycloakify-svelte/login/components/InputFieldByType.svelte.d.ts +2 -1
- package/keycloakify-svelte/login/components/InputFieldByTypeProps.d.ts +1 -2
- package/keycloakify-svelte/login/components/InputTag.svelte +2 -1
- package/keycloakify-svelte/login/components/InputTag.svelte.d.ts +2 -1
- package/keycloakify-svelte/login/components/InputTagSelects.svelte +2 -1
- package/keycloakify-svelte/login/components/InputTagSelects.svelte.d.ts +2 -1
- package/keycloakify-svelte/login/components/SelectTag.svelte +3 -1
- package/keycloakify-svelte/login/components/SelectTag.svelte.d.ts +2 -1
- package/keycloakify-svelte/login/components/TextareaTag.svelte +4 -2
- package/keycloakify-svelte/login/components/TextareaTag.svelte.d.ts +2 -1
- package/keycloakify-svelte/login/pages/Register.svelte +1 -1
- package/keycloakify-svelte/login/pages/SamlPostForm.svelte +1 -1
- package/keycloakify-svelte/login/pages/WebauthnError.svelte +1 -1
- package/package.json +3 -3
- package/src/bin/eject-page.ts +1 -6
- package/src/login/Template.svelte +1 -1
- package/src/login/Template.useInitialize.ts +11 -5
- package/src/login/components/InputFieldByType.svelte +2 -1
- package/src/login/components/InputFieldByTypeProps.ts +1 -2
- package/src/login/components/InputTag.svelte +2 -1
- package/src/login/components/InputTagSelects.svelte +2 -1
- package/src/login/components/SelectTag.svelte +3 -1
- package/src/login/components/TextareaTag.svelte +4 -2
- package/src/login/pages/Register.svelte +1 -1
- package/src/login/pages/SamlPostForm.svelte +1 -1
- package/src/login/pages/WebauthnError.svelte +1 -1
|
@@ -673,8 +673,6 @@ async function command(params) {
|
|
|
673
673
|
'GroupLabel.svelte',
|
|
674
674
|
'InputTagSelects.svelte',
|
|
675
675
|
'TextareaTag.svelte',
|
|
676
|
-
'InputFieldByTypeProps.ts',
|
|
677
|
-
'UserProfileFormFieldsProps.ts',
|
|
678
676
|
];
|
|
679
677
|
}
|
|
680
678
|
return [(0,tsafe_capitalize__WEBPACK_IMPORTED_MODULE_6__/* .capitalize */ .Z)((0,_tools_kebabCaseToSnakeCase__WEBPACK_IMPORTED_MODULE_7__/* .kebabCaseToCamelCase */ .b)(pageIdOrComponent)).replace(/ftl$/, 'svelte')];
|
|
@@ -697,7 +695,7 @@ async function command(params) {
|
|
|
697
695
|
let componentCode = fs__WEBPACK_IMPORTED_MODULE_2__.readFileSync((0,path__WEBPACK_IMPORTED_MODULE_3__.join)((0,_tools_getThisCodebaseRootDirPath__WEBPACK_IMPORTED_MODULE_8__/* .getThisCodebaseRootDirPath */ .J)(), 'src', themeType, pagesOrDot, componentBasename))
|
|
698
696
|
.toString('utf8');
|
|
699
697
|
if (userProfileFormFieldsValue) {
|
|
700
|
-
componentCode = componentCode.replace(new RegExp(`from '@keycloakify/svelte/login/components/(${componentBasenames.join('|')
|
|
698
|
+
componentCode = componentCode.replace(new RegExp(`from '@keycloakify/svelte/login/components/(${componentBasenames.join('|')})`, 'g'), `from './$1`);
|
|
701
699
|
}
|
|
702
700
|
run_prettier: {
|
|
703
701
|
if (!(await (0,_tools_runPrettier__WEBPACK_IMPORTED_MODULE_9__/* .getIsPrettierAvailable */ .L)())) {
|
|
@@ -35,11 +35,14 @@ export function useInitialize(params) {
|
|
|
35
35
|
}))),
|
|
36
36
|
{
|
|
37
37
|
type: 'module',
|
|
38
|
-
textContent:
|
|
39
|
-
import {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
38
|
+
textContent: [
|
|
39
|
+
`import { startSessionPolling, checkAuthSession } from "${url.resourcesPath}/js/authChecker.js";`,
|
|
40
|
+
``,
|
|
41
|
+
`startSessionPolling("${kcContext.url.ssoLoginInOtherTabsUrl}");`,
|
|
42
|
+
kcContext.authenticationSession === undefined
|
|
43
|
+
? ''
|
|
44
|
+
: `checkAuthSession("${kcContext.authenticationSession.authSessionIdHash}");`,
|
|
45
|
+
].join('\n'),
|
|
43
46
|
},
|
|
44
47
|
],
|
|
45
48
|
});
|
|
@@ -5,8 +5,9 @@
|
|
|
5
5
|
import PasswordWrapper from './PasswordWrapper.svelte';
|
|
6
6
|
import SelectTag from './SelectTag.svelte';
|
|
7
7
|
import TextareaTag from './TextareaTag.svelte';
|
|
8
|
+
import type { I18n } from '../i18n';
|
|
8
9
|
|
|
9
|
-
let { displayableErrors, ...props }: InputFieldByTypeProps = $props();
|
|
10
|
+
let { displayableErrors, ...props }: InputFieldByTypeProps<I18n> = $props();
|
|
10
11
|
const { attribute, valueOrValues } = props;
|
|
11
12
|
const inputType = attribute.annotations.inputType ?? '';
|
|
12
13
|
</script>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { InputFieldByTypeProps } from './InputFieldByTypeProps';
|
|
2
|
-
|
|
2
|
+
import type { I18n } from '../i18n';
|
|
3
|
+
declare const InputFieldByType: import("svelte").Component<InputFieldByTypeProps<I18n>, {}, "">;
|
|
3
4
|
type InputFieldByType = ReturnType<typeof InputFieldByType>;
|
|
4
5
|
export default InputFieldByType;
|
|
@@ -2,9 +2,8 @@ import type { FormAction, FormFieldError } from '../lib/useUserProfileForm';
|
|
|
2
2
|
import type { Attribute } from 'keycloakify/login/KcContext';
|
|
3
3
|
import type { KcClsx } from 'keycloakify/login/lib/kcClsx';
|
|
4
4
|
import type { EventDispatcher } from 'svelte';
|
|
5
|
-
import type { I18n } from '../i18n';
|
|
6
5
|
import type { Readable } from 'svelte/store';
|
|
7
|
-
export type InputFieldByTypeProps = {
|
|
6
|
+
export type InputFieldByTypeProps<I18n> = {
|
|
8
7
|
attribute: Attribute;
|
|
9
8
|
valueOrValues: string | string[];
|
|
10
9
|
displayableErrors: FormFieldError[];
|
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
import FieldErrors from './FieldErrors.svelte';
|
|
4
4
|
import type { InputFieldByTypeProps } from './InputFieldByTypeProps';
|
|
5
5
|
import { assert } from 'keycloakify/tools/assert';
|
|
6
|
+
import type { I18n } from '../i18n';
|
|
6
7
|
|
|
7
|
-
type InputTagProps = InputFieldByTypeProps & { fieldIndex?: number };
|
|
8
|
+
type InputTagProps = InputFieldByTypeProps<I18n> & { fieldIndex?: number };
|
|
8
9
|
let {
|
|
9
10
|
attribute,
|
|
10
11
|
fieldIndex,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { InputFieldByTypeProps } from './InputFieldByTypeProps';
|
|
2
|
-
type
|
|
2
|
+
import type { I18n } from '../i18n';
|
|
3
|
+
type InputTagProps = InputFieldByTypeProps<I18n> & {
|
|
3
4
|
fieldIndex?: number;
|
|
4
5
|
};
|
|
5
6
|
declare const InputTag: import("svelte").Component<InputTagProps, {}, "displayableErrors">;
|
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
import type { InputFieldByTypeProps } from './InputFieldByTypeProps';
|
|
3
3
|
import { inputLabel } from './inputLabel';
|
|
4
4
|
import { assert } from 'keycloakify/tools/assert';
|
|
5
|
+
import type { I18n } from '../i18n';
|
|
5
6
|
|
|
6
|
-
const { attribute, dispatchFormAction, kcClsx, i18n, valueOrValues, displayableErrors }: InputFieldByTypeProps =
|
|
7
|
+
const { attribute, dispatchFormAction, kcClsx, i18n, valueOrValues, displayableErrors }: InputFieldByTypeProps<I18n> =
|
|
7
8
|
$props();
|
|
8
9
|
|
|
9
10
|
const { classDiv, classInput, classLabel, inputType } = (() => {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { InputFieldByTypeProps } from './InputFieldByTypeProps';
|
|
2
|
-
|
|
2
|
+
import type { I18n } from '../i18n';
|
|
3
|
+
declare const InputTagSelects: import("svelte").Component<InputFieldByTypeProps<I18n>, {}, "">;
|
|
3
4
|
type InputTagSelects = ReturnType<typeof InputTagSelects>;
|
|
4
5
|
export default InputTagSelects;
|
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
import type { InputFieldByTypeProps } from './InputFieldByTypeProps';
|
|
3
3
|
import { inputLabel } from './inputLabel';
|
|
4
4
|
import { assert } from 'keycloakify/tools/assert';
|
|
5
|
-
|
|
5
|
+
import type { I18n } from '../i18n';
|
|
6
|
+
|
|
7
|
+
const { attribute, dispatchFormAction, kcClsx, displayableErrors, i18n, valueOrValues }: InputFieldByTypeProps<I18n> =
|
|
6
8
|
$props();
|
|
7
9
|
|
|
8
10
|
const isMultiple = attribute.annotations.inputType === 'multiselect';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { InputFieldByTypeProps } from './InputFieldByTypeProps';
|
|
2
|
-
|
|
2
|
+
import type { I18n } from '../i18n';
|
|
3
|
+
declare const SelectTag: import("svelte").Component<InputFieldByTypeProps<I18n>, {}, "">;
|
|
3
4
|
type SelectTag = ReturnType<typeof SelectTag>;
|
|
4
5
|
export default SelectTag;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { assert } from 'keycloakify/tools/assert';
|
|
3
2
|
import type { InputFieldByTypeProps } from './InputFieldByTypeProps';
|
|
3
|
+
import { assert } from 'keycloakify/tools/assert';
|
|
4
|
+
import type { I18n } from '../i18n';
|
|
4
5
|
|
|
5
|
-
const { attribute, dispatchFormAction, kcClsx, displayableErrors, valueOrValues }: InputFieldByTypeProps =
|
|
6
|
+
const { attribute, dispatchFormAction, kcClsx, displayableErrors, valueOrValues }: InputFieldByTypeProps<I18n> =
|
|
7
|
+
$props();
|
|
6
8
|
|
|
7
9
|
assert(typeof valueOrValues === 'string');
|
|
8
10
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { InputFieldByTypeProps } from './InputFieldByTypeProps';
|
|
2
|
-
|
|
2
|
+
import type { I18n } from '../i18n';
|
|
3
|
+
declare const TextareaTag: import("svelte").Component<InputFieldByTypeProps<I18n>, {}, "">;
|
|
3
4
|
type TextareaTag = ReturnType<typeof TextareaTag>;
|
|
4
5
|
export default TextareaTag;
|
|
@@ -110,7 +110,7 @@
|
|
|
110
110
|
)}
|
|
111
111
|
data-sitekey={recaptchaSiteKey}
|
|
112
112
|
data-callback={() => {
|
|
113
|
-
(document.getElementById('kc-register-form') as HTMLFormElement).
|
|
113
|
+
(document.getElementById('kc-register-form') as HTMLFormElement).requestSubmit();
|
|
114
114
|
}}
|
|
115
115
|
data-action={recaptchaAction}
|
|
116
116
|
type="submit"
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
// @ts-expect-error: Trusted Keycloak's code
|
|
58
58
|
document.getElementById('executionValue').value = '${execution}';
|
|
59
59
|
// @ts-expect-error: Trusted Keycloak's code
|
|
60
|
-
document.getElementById('kc-error-credential-form').
|
|
60
|
+
document.getElementById('kc-error-credential-form').requestSubmit();
|
|
61
61
|
}}
|
|
62
62
|
type="button"
|
|
63
63
|
class={kcClsx('kcButtonClass', 'kcButtonPrimaryClass', 'kcButtonBlockClass', 'kcButtonLargeClass')}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@keycloakify/svelte",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Svelte Components for Keycloakify",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"keycloak",
|
|
@@ -432,7 +432,7 @@
|
|
|
432
432
|
"release": "sh scripts/release.sh"
|
|
433
433
|
},
|
|
434
434
|
"peerDependencies": {
|
|
435
|
-
"keycloakify": "^11.
|
|
435
|
+
"keycloakify": "^11.9.0",
|
|
436
436
|
"svelte": "^5.0.0"
|
|
437
437
|
},
|
|
438
438
|
"devDependencies": {
|
|
@@ -452,7 +452,7 @@
|
|
|
452
452
|
"eslint-plugin-svelte": "^3.10.1",
|
|
453
453
|
"eslint-plugin-unused-imports": "^4.1.4",
|
|
454
454
|
"globals": "^16.3.0",
|
|
455
|
-
"keycloakify": "^11.
|
|
455
|
+
"keycloakify": "^11.9.0",
|
|
456
456
|
"npm-check-updates": "^18.0.1",
|
|
457
457
|
"prettier": "^3.6.2",
|
|
458
458
|
"prettier-plugin-svelte": "^3.4.0",
|
package/src/bin/eject-page.ts
CHANGED
|
@@ -114,8 +114,6 @@ export async function command(params: { buildContext: BuildContext }) {
|
|
|
114
114
|
'GroupLabel.svelte',
|
|
115
115
|
'InputTagSelects.svelte',
|
|
116
116
|
'TextareaTag.svelte',
|
|
117
|
-
'InputFieldByTypeProps.ts',
|
|
118
|
-
'UserProfileFormFieldsProps.ts',
|
|
119
117
|
];
|
|
120
118
|
}
|
|
121
119
|
|
|
@@ -148,10 +146,7 @@ export async function command(params: { buildContext: BuildContext }) {
|
|
|
148
146
|
.toString('utf8');
|
|
149
147
|
if (userProfileFormFieldsValue) {
|
|
150
148
|
componentCode = componentCode.replace(
|
|
151
|
-
new RegExp(
|
|
152
|
-
`from '@keycloakify/svelte/login/components/(${componentBasenames.join('|').replace(/\.ts/g, '')})`,
|
|
153
|
-
'g',
|
|
154
|
-
),
|
|
149
|
+
new RegExp(`from '@keycloakify/svelte/login/components/(${componentBasenames.join('|')})`, 'g'),
|
|
155
150
|
`from './$1`,
|
|
156
151
|
);
|
|
157
152
|
}
|
|
@@ -11,6 +11,9 @@ export type KcContextLike = {
|
|
|
11
11
|
ssoLoginInOtherTabsUrl: string;
|
|
12
12
|
};
|
|
13
13
|
scripts?: string[];
|
|
14
|
+
authenticationSession?: {
|
|
15
|
+
authSessionIdHash: string;
|
|
16
|
+
};
|
|
14
17
|
};
|
|
15
18
|
|
|
16
19
|
assert<keyof KcContextLike extends keyof KcContext ? true : false>();
|
|
@@ -50,11 +53,14 @@ export function useInitialize(params: { kcContext: KcContextLike; doUseDefaultCs
|
|
|
50
53
|
}))),
|
|
51
54
|
{
|
|
52
55
|
type: 'module',
|
|
53
|
-
textContent:
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
textContent: [
|
|
57
|
+
`import { startSessionPolling, checkAuthSession } from "${url.resourcesPath}/js/authChecker.js";`,
|
|
58
|
+
``,
|
|
59
|
+
`startSessionPolling("${kcContext.url.ssoLoginInOtherTabsUrl}");`,
|
|
60
|
+
kcContext.authenticationSession === undefined
|
|
61
|
+
? ''
|
|
62
|
+
: `checkAuthSession("${kcContext.authenticationSession.authSessionIdHash}");`,
|
|
63
|
+
].join('\n'),
|
|
58
64
|
},
|
|
59
65
|
],
|
|
60
66
|
});
|
|
@@ -5,8 +5,9 @@
|
|
|
5
5
|
import PasswordWrapper from '@keycloakify/svelte/login/components/PasswordWrapper.svelte';
|
|
6
6
|
import SelectTag from '@keycloakify/svelte/login/components/SelectTag.svelte';
|
|
7
7
|
import TextareaTag from '@keycloakify/svelte/login/components/TextareaTag.svelte';
|
|
8
|
+
import type { I18n } from '../i18n';
|
|
8
9
|
|
|
9
|
-
let { displayableErrors, ...props }: InputFieldByTypeProps = $props();
|
|
10
|
+
let { displayableErrors, ...props }: InputFieldByTypeProps<I18n> = $props();
|
|
10
11
|
const { attribute, valueOrValues } = props;
|
|
11
12
|
const inputType = attribute.annotations.inputType ?? '';
|
|
12
13
|
</script>
|
|
@@ -2,10 +2,9 @@ import type { FormAction, FormFieldError } from '@keycloakify/svelte/login/lib/u
|
|
|
2
2
|
import type { Attribute } from 'keycloakify/login/KcContext';
|
|
3
3
|
import type { KcClsx } from 'keycloakify/login/lib/kcClsx';
|
|
4
4
|
import type { EventDispatcher } from 'svelte';
|
|
5
|
-
import type { I18n } from '../i18n';
|
|
6
5
|
import type { Readable } from 'svelte/store';
|
|
7
6
|
|
|
8
|
-
export type InputFieldByTypeProps = {
|
|
7
|
+
export type InputFieldByTypeProps<I18n> = {
|
|
9
8
|
attribute: Attribute;
|
|
10
9
|
valueOrValues: string | string[];
|
|
11
10
|
displayableErrors: FormFieldError[];
|
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
import FieldErrors from '@keycloakify/svelte/login/components/FieldErrors.svelte';
|
|
4
4
|
import type { InputFieldByTypeProps } from '@keycloakify/svelte/login/components/InputFieldByTypeProps';
|
|
5
5
|
import { assert } from 'keycloakify/tools/assert';
|
|
6
|
+
import type { I18n } from '../i18n';
|
|
6
7
|
|
|
7
|
-
type InputTagProps = InputFieldByTypeProps & { fieldIndex?: number };
|
|
8
|
+
type InputTagProps = InputFieldByTypeProps<I18n> & { fieldIndex?: number };
|
|
8
9
|
let {
|
|
9
10
|
attribute,
|
|
10
11
|
fieldIndex,
|
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
import type { InputFieldByTypeProps } from '@keycloakify/svelte/login/components/InputFieldByTypeProps';
|
|
3
3
|
import { inputLabel } from '@keycloakify/svelte/login/components/inputLabel';
|
|
4
4
|
import { assert } from 'keycloakify/tools/assert';
|
|
5
|
+
import type { I18n } from '../i18n';
|
|
5
6
|
|
|
6
|
-
const { attribute, dispatchFormAction, kcClsx, i18n, valueOrValues, displayableErrors }: InputFieldByTypeProps =
|
|
7
|
+
const { attribute, dispatchFormAction, kcClsx, i18n, valueOrValues, displayableErrors }: InputFieldByTypeProps<I18n> =
|
|
7
8
|
$props();
|
|
8
9
|
|
|
9
10
|
const { classDiv, classInput, classLabel, inputType } = (() => {
|
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
import type { InputFieldByTypeProps } from '@keycloakify/svelte/login/components/InputFieldByTypeProps';
|
|
3
3
|
import { inputLabel } from '@keycloakify/svelte/login/components/inputLabel';
|
|
4
4
|
import { assert } from 'keycloakify/tools/assert';
|
|
5
|
-
|
|
5
|
+
import type { I18n } from '../i18n';
|
|
6
|
+
|
|
7
|
+
const { attribute, dispatchFormAction, kcClsx, displayableErrors, i18n, valueOrValues }: InputFieldByTypeProps<I18n> =
|
|
6
8
|
$props();
|
|
7
9
|
|
|
8
10
|
const isMultiple = attribute.annotations.inputType === 'multiselect';
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { assert } from 'keycloakify/tools/assert';
|
|
3
2
|
import type { InputFieldByTypeProps } from '@keycloakify/svelte/login/components/InputFieldByTypeProps';
|
|
3
|
+
import { assert } from 'keycloakify/tools/assert';
|
|
4
|
+
import type { I18n } from '../i18n';
|
|
4
5
|
|
|
5
|
-
const { attribute, dispatchFormAction, kcClsx, displayableErrors, valueOrValues }: InputFieldByTypeProps =
|
|
6
|
+
const { attribute, dispatchFormAction, kcClsx, displayableErrors, valueOrValues }: InputFieldByTypeProps<I18n> =
|
|
7
|
+
$props();
|
|
6
8
|
|
|
7
9
|
assert(typeof valueOrValues === 'string');
|
|
8
10
|
|
|
@@ -110,7 +110,7 @@
|
|
|
110
110
|
)}
|
|
111
111
|
data-sitekey={recaptchaSiteKey}
|
|
112
112
|
data-callback={() => {
|
|
113
|
-
(document.getElementById('kc-register-form') as HTMLFormElement).
|
|
113
|
+
(document.getElementById('kc-register-form') as HTMLFormElement).requestSubmit();
|
|
114
114
|
}}
|
|
115
115
|
data-action={recaptchaAction}
|
|
116
116
|
type="submit"
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
// @ts-expect-error: Trusted Keycloak's code
|
|
58
58
|
document.getElementById('executionValue').value = '${execution}';
|
|
59
59
|
// @ts-expect-error: Trusted Keycloak's code
|
|
60
|
-
document.getElementById('kc-error-credential-form').
|
|
60
|
+
document.getElementById('kc-error-credential-form').requestSubmit();
|
|
61
61
|
}}
|
|
62
62
|
type="button"
|
|
63
63
|
class={kcClsx('kcButtonClass', 'kcButtonPrimaryClass', 'kcButtonBlockClass', 'kcButtonLargeClass')}
|