@keycloakify/svelte 0.2.7 → 0.2.8

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.
Files changed (127) hide show
  1. package/keycloakify-svelte/account/DefaultPage.svelte +1 -1
  2. package/keycloakify-svelte/account/Template.svelte +14 -7
  3. package/keycloakify-svelte/account/pages/Account.svelte +10 -8
  4. package/keycloakify-svelte/account/pages/Applications.svelte +8 -6
  5. package/keycloakify-svelte/account/pages/FederatedIdentity.svelte +2 -2
  6. package/keycloakify-svelte/account/pages/Log.svelte +8 -6
  7. package/keycloakify-svelte/account/pages/Password.svelte +10 -8
  8. package/keycloakify-svelte/account/pages/Sessions.svelte +8 -6
  9. package/keycloakify-svelte/account/pages/Totp.svelte +8 -6
  10. package/keycloakify-svelte/bin/200.index.js +27 -28
  11. package/keycloakify-svelte/bin/266.index.js +47 -49
  12. package/keycloakify-svelte/bin/{343.index.js → 545.index.js} +4079 -2565
  13. package/keycloakify-svelte/bin/709.index.js +40 -41
  14. package/keycloakify-svelte/bin/818.index.js +57 -59
  15. package/keycloakify-svelte/bin/index.js +626 -1903
  16. package/keycloakify-svelte/login/DefaultPage.svelte +1 -1
  17. package/keycloakify-svelte/login/Template.svelte +14 -8
  18. package/keycloakify-svelte/login/components/AddRemoveButtonsMultiValuedAttribute.svelte +6 -4
  19. package/keycloakify-svelte/login/components/AddRemoveButtonsMultiValuedAttribute.svelte.d.ts +1 -1
  20. package/keycloakify-svelte/login/components/GroupLabel.svelte +11 -9
  21. package/keycloakify-svelte/login/components/InputFieldByType.svelte +2 -2
  22. package/keycloakify-svelte/login/components/InputTag.svelte +5 -5
  23. package/keycloakify-svelte/login/components/InputTagSelects.svelte +51 -47
  24. package/keycloakify-svelte/login/components/LogoutOtherSessions.svelte +1 -1
  25. package/keycloakify-svelte/login/components/PasswordWrapper.svelte +2 -2
  26. package/keycloakify-svelte/login/components/SelectTag.svelte +21 -19
  27. package/keycloakify-svelte/login/components/TermsAcceptance.svelte +1 -1
  28. package/keycloakify-svelte/login/components/TextareaTag.svelte +6 -3
  29. package/keycloakify-svelte/login/components/UserProfileFormFields.svelte +6 -6
  30. package/keycloakify-svelte/login/pages/Code.svelte +9 -7
  31. package/keycloakify-svelte/login/pages/DeleteAccountConfirm.svelte +8 -6
  32. package/keycloakify-svelte/login/pages/DeleteCredential.svelte +8 -6
  33. package/keycloakify-svelte/login/pages/Error.svelte +2 -2
  34. package/keycloakify-svelte/login/pages/FrontchannelLogout.svelte +2 -2
  35. package/keycloakify-svelte/login/pages/IdpReviewUserProfile.svelte +8 -6
  36. package/keycloakify-svelte/login/pages/Info.svelte +2 -2
  37. package/keycloakify-svelte/login/pages/Login.svelte +10 -7
  38. package/keycloakify-svelte/login/pages/LoginConfigTotp.svelte +8 -6
  39. package/keycloakify-svelte/login/pages/LoginIdpLinkConfirm.svelte +8 -6
  40. package/keycloakify-svelte/login/pages/LoginIdpLinkConfirmOverride.svelte +8 -6
  41. package/keycloakify-svelte/login/pages/LoginIdpLinkEmail.svelte +2 -2
  42. package/keycloakify-svelte/login/pages/LoginOauth2DeviceVerifyUserCode.svelte +8 -6
  43. package/keycloakify-svelte/login/pages/LoginOauthGrant.svelte +8 -6
  44. package/keycloakify-svelte/login/pages/LoginOtp.svelte +8 -6
  45. package/keycloakify-svelte/login/pages/LoginPageExpired.svelte +2 -2
  46. package/keycloakify-svelte/login/pages/LoginPasskeysConditionalAuthenticate.svelte +14 -7
  47. package/keycloakify-svelte/login/pages/LoginPassword.svelte +8 -6
  48. package/keycloakify-svelte/login/pages/LoginRecoveryAuthnCodeConfig.svelte +10 -7
  49. package/keycloakify-svelte/login/pages/LoginRecoveryAuthnCodeInput.svelte +8 -6
  50. package/keycloakify-svelte/login/pages/LoginResetOtp.svelte +8 -6
  51. package/keycloakify-svelte/login/pages/LoginResetPassword.svelte +8 -6
  52. package/keycloakify-svelte/login/pages/LoginUpdatePassword.svelte +8 -6
  53. package/keycloakify-svelte/login/pages/LoginUpdateProfile.svelte +8 -6
  54. package/keycloakify-svelte/login/pages/LoginUsername.svelte +9 -7
  55. package/keycloakify-svelte/login/pages/LoginVerifyEmail.svelte +2 -2
  56. package/keycloakify-svelte/login/pages/LoginX509Info.svelte +8 -6
  57. package/keycloakify-svelte/login/pages/LogoutConfirm.svelte +8 -6
  58. package/keycloakify-svelte/login/pages/Register.svelte +9 -7
  59. package/keycloakify-svelte/login/pages/SamlPostForm.svelte +2 -2
  60. package/keycloakify-svelte/login/pages/SelectAuthenticator.svelte +3 -3
  61. package/keycloakify-svelte/login/pages/Terms.svelte +8 -6
  62. package/keycloakify-svelte/login/pages/UpdateEmail.svelte +8 -6
  63. package/keycloakify-svelte/login/pages/WebauthnAuthenticate.svelte +6 -5
  64. package/keycloakify-svelte/login/pages/WebauthnError.svelte +8 -6
  65. package/keycloakify-svelte/login/pages/WebauthnRegister.svelte +6 -5
  66. package/package.json +22 -20
  67. package/src/account/DefaultPage.svelte +1 -1
  68. package/src/account/Template.svelte +14 -7
  69. package/src/account/pages/Account.svelte +10 -8
  70. package/src/account/pages/Applications.svelte +8 -6
  71. package/src/account/pages/FederatedIdentity.svelte +2 -2
  72. package/src/account/pages/Log.svelte +8 -6
  73. package/src/account/pages/Password.svelte +10 -8
  74. package/src/account/pages/Sessions.svelte +8 -6
  75. package/src/account/pages/Totp.svelte +8 -6
  76. package/src/bin/initialize-account-theme/boilerplate/KcPage.svelte +3 -3
  77. package/src/bin/initialize-account-theme/boilerplate/KcPageStory.svelte +1 -1
  78. package/src/bin/initialize-account-theme/initialize-account-theme.ts +2 -1
  79. package/src/login/DefaultPage.svelte +1 -1
  80. package/src/login/Template.svelte +14 -8
  81. package/src/login/components/AddRemoveButtonsMultiValuedAttribute.svelte +6 -4
  82. package/src/login/components/GroupLabel.svelte +11 -9
  83. package/src/login/components/InputFieldByType.svelte +2 -2
  84. package/src/login/components/InputTag.svelte +5 -5
  85. package/src/login/components/InputTagSelects.svelte +51 -47
  86. package/src/login/components/LogoutOtherSessions.svelte +1 -1
  87. package/src/login/components/PasswordWrapper.svelte +2 -2
  88. package/src/login/components/SelectTag.svelte +21 -19
  89. package/src/login/components/TermsAcceptance.svelte +1 -1
  90. package/src/login/components/TextareaTag.svelte +6 -3
  91. package/src/login/components/UserProfileFormFields.svelte +6 -6
  92. package/src/login/pages/Code.svelte +9 -7
  93. package/src/login/pages/DeleteAccountConfirm.svelte +8 -6
  94. package/src/login/pages/DeleteCredential.svelte +8 -6
  95. package/src/login/pages/Error.svelte +2 -2
  96. package/src/login/pages/FrontchannelLogout.svelte +2 -2
  97. package/src/login/pages/IdpReviewUserProfile.svelte +8 -6
  98. package/src/login/pages/Info.svelte +2 -2
  99. package/src/login/pages/Login.svelte +10 -7
  100. package/src/login/pages/LoginConfigTotp.svelte +8 -6
  101. package/src/login/pages/LoginIdpLinkConfirm.svelte +8 -6
  102. package/src/login/pages/LoginIdpLinkConfirmOverride.svelte +8 -6
  103. package/src/login/pages/LoginIdpLinkEmail.svelte +2 -2
  104. package/src/login/pages/LoginOauth2DeviceVerifyUserCode.svelte +8 -6
  105. package/src/login/pages/LoginOauthGrant.svelte +8 -6
  106. package/src/login/pages/LoginOtp.svelte +8 -6
  107. package/src/login/pages/LoginPageExpired.svelte +2 -2
  108. package/src/login/pages/LoginPasskeysConditionalAuthenticate.svelte +14 -7
  109. package/src/login/pages/LoginPassword.svelte +8 -6
  110. package/src/login/pages/LoginRecoveryAuthnCodeConfig.svelte +10 -7
  111. package/src/login/pages/LoginRecoveryAuthnCodeInput.svelte +8 -6
  112. package/src/login/pages/LoginResetOtp.svelte +8 -6
  113. package/src/login/pages/LoginResetPassword.svelte +8 -6
  114. package/src/login/pages/LoginUpdatePassword.svelte +8 -6
  115. package/src/login/pages/LoginUpdateProfile.svelte +8 -6
  116. package/src/login/pages/LoginUsername.svelte +9 -7
  117. package/src/login/pages/LoginVerifyEmail.svelte +2 -2
  118. package/src/login/pages/LoginX509Info.svelte +8 -6
  119. package/src/login/pages/LogoutConfirm.svelte +8 -6
  120. package/src/login/pages/Register.svelte +9 -7
  121. package/src/login/pages/SamlPostForm.svelte +2 -2
  122. package/src/login/pages/SelectAuthenticator.svelte +3 -3
  123. package/src/login/pages/Terms.svelte +8 -6
  124. package/src/login/pages/UpdateEmail.svelte +8 -6
  125. package/src/login/pages/WebauthnAuthenticate.svelte +6 -5
  126. package/src/login/pages/WebauthnError.svelte +8 -6
  127. package/src/login/pages/WebauthnRegister.svelte +6 -5
@@ -10,7 +10,7 @@
10
10
  doMakeUserConfirmPassword: boolean;
11
11
  };
12
12
  const props: DefaultPageProps = $props();
13
- const { kcContext: kcContext, ...rest } = props;
13
+ const { kcContext, ...rest } = $derived(props);
14
14
  const loadComponent = () => {
15
15
  switch (kcContext.pageId) {
16
16
  case 'login.ftl':
@@ -5,7 +5,7 @@
5
5
  import { kcSanitize } from 'keycloakify/lib/kcSanitize';
6
6
  import { getKcClsx } from 'keycloakify/login/lib/kcClsx';
7
7
  import { clsx } from 'keycloakify/tools/clsx';
8
- import { onMount } from 'svelte';
8
+ import { onMount, untrack } from 'svelte';
9
9
  import type { I18n } from './i18n';
10
10
  import type { KcContext } from './KcContext';
11
11
 
@@ -24,24 +24,30 @@
24
24
  classes,
25
25
  children,
26
26
  }: TemplateProps<KcContext, I18n> = $props();
27
- const { kcClsx } = getKcClsx({ doUseDefaultCss, classes });
27
+ const { kcClsx } = $derived(getKcClsx({ doUseDefaultCss, classes }));
28
28
 
29
- const { msgStr, currentLanguage, enabledLanguages } = $i18n;
29
+ const { msgStr, currentLanguage, enabledLanguages } = $derived($i18n);
30
+
31
+ const { realm, auth, url, message, isAppInitiatedAction } = $derived(kcContext);
30
32
 
31
- const { realm, auth, url, message, isAppInitiatedAction } = kcContext;
32
33
  onMount(() => {
33
- document.title = documentTitle ?? msgStr('loginTitle', kcContext.realm.displayName);
34
+ document.title = documentTitle ?? untrack(() => msgStr('loginTitle', kcContext.realm.displayName));
34
35
  });
36
+
35
37
  useSetClassName({
36
38
  qualifiedName: 'html',
37
- className: kcClsx('kcHtmlClass'),
39
+ className: untrack(() => kcClsx('kcHtmlClass')),
38
40
  });
39
41
 
40
42
  useSetClassName({
41
43
  qualifiedName: 'body',
42
- className: bodyClassName ?? kcClsx('kcBodyClass'),
44
+ className: untrack(() => bodyClassName ?? kcClsx('kcBodyClass')),
45
+ });
46
+
47
+ const { isReadyToRender } = useInitialize({
48
+ kcContext: untrack(() => kcContext),
49
+ doUseDefaultCss: untrack(() => doUseDefaultCss),
43
50
  });
44
- const { isReadyToRender } = useInitialize({ kcContext, doUseDefaultCss });
45
51
  </script>
46
52
 
47
53
  {#if $isReadyToRender}
@@ -4,7 +4,7 @@
4
4
  type FormAction,
5
5
  } from '../lib/useUserProfileForm';
6
6
  import type { Attribute } from 'keycloakify/login/KcContext';
7
- import type { EventDispatcher } from 'svelte';
7
+ import { untrack, type EventDispatcher } from 'svelte';
8
8
  import type { Readable } from 'svelte/store';
9
9
  import type { I18n } from '../i18n';
10
10
 
@@ -17,11 +17,13 @@
17
17
  };
18
18
  const { attribute, values, fieldIndex, dispatchFormAction, i18n }: AddRemoveButtonsMultiValuedAttributeProps =
19
19
  $props();
20
- const { msg } = $i18n;
20
+ const { msg } = $derived($i18n);
21
21
 
22
- const { hasAdd, hasRemove } = getButtonToDisplayForMultivaluedAttributeField({ attribute, values, fieldIndex });
22
+ const { hasAdd, hasRemove } = $derived(
23
+ getButtonToDisplayForMultivaluedAttributeField({ attribute, values, fieldIndex }),
24
+ );
23
25
 
24
- const idPostfix = `-${attribute.name}-${fieldIndex + 1}`;
26
+ const idPostfix = `-${untrack(() => attribute.name)}-${untrack(() => fieldIndex) + 1}`;
25
27
  </script>
26
28
 
27
29
  {#if hasRemove}
@@ -1,6 +1,6 @@
1
1
  import { type FormAction } from '../lib/useUserProfileForm';
2
2
  import type { Attribute } from 'keycloakify/login/KcContext';
3
- import type { EventDispatcher } from 'svelte';
3
+ import { type EventDispatcher } from 'svelte';
4
4
  import type { Readable } from 'svelte/store';
5
5
  import type { I18n } from '../i18n';
6
6
  type AddRemoveButtonsMultiValuedAttributeProps = {
@@ -15,23 +15,25 @@
15
15
  kcClsx: KcClsx;
16
16
  };
17
17
  const { attribute, groupNameRef, i18n, kcClsx }: GroupLabelProps = $props();
18
- const { advancedMsg } = $i18n;
18
+ const { advancedMsg } = $derived($i18n);
19
19
 
20
20
  let isGrouplabel = $state<boolean>(false);
21
- if (attribute.group?.name !== groupNameRef.current) {
22
- groupNameRef.current = attribute.group?.name ?? '';
21
+ $effect(() => {
22
+ if (attribute.group?.name !== groupNameRef.current) {
23
+ groupNameRef.current = attribute.group?.name ?? '';
23
24
 
24
- if (groupNameRef.current !== '') {
25
- assert(attribute.group !== undefined);
26
- isGrouplabel = true;
25
+ if (groupNameRef.current !== '') {
26
+ assert(attribute.group !== undefined);
27
+ isGrouplabel = true;
28
+ }
27
29
  }
28
- }
30
+ });
29
31
 
30
- const html5DataAnnotations = {
32
+ const html5DataAnnotations = $derived({
31
33
  ...Object.fromEntries(
32
34
  Object.entries(attribute.group?.html5DataAnnotations ?? {}).map(([key, value]) => [`data-${key}`, value]),
33
35
  ),
34
- };
36
+ });
35
37
  </script>
36
38
 
37
39
  {#if isGrouplabel}
@@ -8,8 +8,8 @@
8
8
  import type { I18n } from '../i18n';
9
9
 
10
10
  let { displayableErrors, ...props }: InputFieldByTypeProps<I18n> = $props();
11
- const { attribute, valueOrValues } = props;
12
- const inputType = attribute.annotations.inputType ?? '';
11
+ const { attribute, valueOrValues } = $derived(props);
12
+ const inputType = $derived(attribute.annotations.inputType ?? '');
13
13
  </script>
14
14
 
15
15
  {#if inputType === 'hidden'}
@@ -16,9 +16,9 @@
16
16
  displayableErrors = $bindable([]),
17
17
  }: InputTagProps = $props();
18
18
 
19
- const { advancedMsgStr } = $i18n;
20
- const { inputType } = attribute.annotations;
21
- let value = $state(
19
+ const { advancedMsgStr } = $derived($i18n);
20
+ const { inputType } = $derived(attribute.annotations);
21
+ let value = $derived(
22
22
  (() => {
23
23
  if (fieldIndex !== undefined) {
24
24
  assert(valueOrValues instanceof Array);
@@ -30,11 +30,11 @@
30
30
  return valueOrValues;
31
31
  })(),
32
32
  );
33
- const html5DataAnnotations = {
33
+ const html5DataAnnotations = $derived({
34
34
  ...Object.fromEntries(
35
35
  Object.entries(attribute.group?.html5DataAnnotations ?? {}).map(([key, value]) => [`data-${key}`, value]),
36
36
  ),
37
- };
37
+ });
38
38
  </script>
39
39
 
40
40
  <input
@@ -7,59 +7,63 @@
7
7
  const { attribute, dispatchFormAction, kcClsx, i18n, valueOrValues, displayableErrors }: InputFieldByTypeProps<I18n> =
8
8
  $props();
9
9
 
10
- const { classDiv, classInput, classLabel, inputType } = (() => {
11
- const { inputType } = attribute.annotations;
12
-
13
- assert(inputType === 'select-radiobuttons' || inputType === 'multiselect-checkboxes');
14
-
15
- switch (inputType) {
16
- case 'select-radiobuttons':
17
- return {
18
- inputType: 'radio',
19
- classDiv: kcClsx('kcInputClassRadio'),
20
- classInput: kcClsx('kcInputClassRadioInput'),
21
- classLabel: kcClsx('kcInputClassRadioLabel'),
22
- };
23
- case 'multiselect-checkboxes':
24
- return {
25
- inputType: 'checkbox',
26
- classDiv: kcClsx('kcInputClassCheckbox'),
27
- classInput: kcClsx('kcInputClassCheckboxInput'),
28
- classLabel: kcClsx('kcInputClassCheckboxLabel'),
29
- };
30
- default:
31
- return {
32
- inputType: '',
33
- classDiv: '',
34
- classInput: '',
35
- classLabel: '',
36
- };
37
- }
38
- })();
39
-
40
- const options = (() => {
41
- walk: {
42
- const { inputOptionsFromValidation } = attribute.annotations;
43
-
44
- if (inputOptionsFromValidation === undefined) {
45
- break walk;
10
+ const { classDiv, classInput, classLabel, inputType } = $derived(
11
+ (() => {
12
+ const { inputType } = attribute.annotations;
13
+
14
+ assert(inputType === 'select-radiobuttons' || inputType === 'multiselect-checkboxes');
15
+
16
+ switch (inputType) {
17
+ case 'select-radiobuttons':
18
+ return {
19
+ inputType: 'radio',
20
+ classDiv: kcClsx('kcInputClassRadio'),
21
+ classInput: kcClsx('kcInputClassRadioInput'),
22
+ classLabel: kcClsx('kcInputClassRadioLabel'),
23
+ };
24
+ case 'multiselect-checkboxes':
25
+ return {
26
+ inputType: 'checkbox',
27
+ classDiv: kcClsx('kcInputClassCheckbox'),
28
+ classInput: kcClsx('kcInputClassCheckboxInput'),
29
+ classLabel: kcClsx('kcInputClassCheckboxLabel'),
30
+ };
31
+ default:
32
+ return {
33
+ inputType: '',
34
+ classDiv: '',
35
+ classInput: '',
36
+ classLabel: '',
37
+ };
46
38
  }
39
+ })(),
40
+ );
47
41
 
48
- const validator = (attribute.validators as Record<string, { options?: string[] }>)[inputOptionsFromValidation];
42
+ const options = $derived(
43
+ (() => {
44
+ walk: {
45
+ const { inputOptionsFromValidation } = attribute.annotations;
49
46
 
50
- if (validator === undefined) {
51
- break walk;
52
- }
47
+ if (inputOptionsFromValidation === undefined) {
48
+ break walk;
49
+ }
53
50
 
54
- if (validator.options === undefined) {
55
- break walk;
56
- }
51
+ const validator = (attribute.validators as Record<string, { options?: string[] }>)[inputOptionsFromValidation];
52
+
53
+ if (validator === undefined) {
54
+ break walk;
55
+ }
57
56
 
58
- return validator.options;
59
- }
57
+ if (validator.options === undefined) {
58
+ break walk;
59
+ }
60
+
61
+ return validator.options;
62
+ }
60
63
 
61
- return attribute.validators.options?.options ?? [];
62
- })();
64
+ return attribute.validators.options?.options ?? [];
65
+ })(),
66
+ );
63
67
  </script>
64
68
 
65
69
  {#each options as option (option)}
@@ -5,7 +5,7 @@
5
5
 
6
6
  const { kcClsx, i18n }: { kcClsx: KcClsx; i18n: Readable<I18n> } = $props();
7
7
 
8
- const { msg } = $i18n;
8
+ const { msg } = $derived($i18n);
9
9
  </script>
10
10
 
11
11
  <div
@@ -7,9 +7,9 @@
7
7
  import type { Readable } from 'svelte/store';
8
8
 
9
9
  const props: { kcClsx: KcClsx; i18n: Readable<I18n>; passwordInputId: string; children: Snippet } = $props();
10
- const { kcClsx, i18n, passwordInputId, children } = props;
10
+ const { kcClsx, i18n, passwordInputId, children } = $derived(props);
11
11
 
12
- const { msgStr } = $i18n;
12
+ const { msgStr } = $derived($i18n);
13
13
 
14
14
  const [isPasswordRevealed, toggleIsPasswordRevealed] = useReducer<boolean, boolean>(
15
15
  (isPasswordRevealed: boolean) => !isPasswordRevealed,
@@ -7,32 +7,34 @@
7
7
  const { attribute, dispatchFormAction, kcClsx, displayableErrors, i18n, valueOrValues }: InputFieldByTypeProps<I18n> =
8
8
  $props();
9
9
 
10
- const isMultiple = attribute.annotations.inputType === 'multiselect';
11
- const options = (() => {
12
- walk: {
13
- const { inputOptionsFromValidation } = attribute.annotations;
10
+ const isMultiple = $derived(attribute.annotations.inputType === 'multiselect');
11
+ const options = $derived(
12
+ (() => {
13
+ walk: {
14
+ const { inputOptionsFromValidation } = attribute.annotations;
14
15
 
15
- if (inputOptionsFromValidation === undefined) {
16
- break walk;
17
- }
16
+ if (inputOptionsFromValidation === undefined) {
17
+ break walk;
18
+ }
18
19
 
19
- assert(typeof inputOptionsFromValidation === 'string');
20
+ assert(typeof inputOptionsFromValidation === 'string');
20
21
 
21
- const validator = (attribute.validators as Record<string, { options?: string[] }>)[inputOptionsFromValidation];
22
+ const validator = (attribute.validators as Record<string, { options?: string[] }>)[inputOptionsFromValidation];
22
23
 
23
- if (validator === undefined) {
24
- break walk;
25
- }
24
+ if (validator === undefined) {
25
+ break walk;
26
+ }
26
27
 
27
- if (validator.options === undefined) {
28
- break walk;
29
- }
28
+ if (validator.options === undefined) {
29
+ break walk;
30
+ }
30
31
 
31
- return validator.options;
32
- }
32
+ return validator.options;
33
+ }
33
34
 
34
- return attribute.validators.options?.options ?? [];
35
- })();
35
+ return attribute.validators.options?.options ?? [];
36
+ })(),
37
+ );
36
38
  </script>
37
39
 
38
40
  <select
@@ -15,7 +15,7 @@
15
15
  const { i18n, kcClsx, messagesPerField, areTermsAccepted, onAreTermsAcceptedValueChange }: TermsAcceptanceProps =
16
16
  $props();
17
17
 
18
- const { msg } = $i18n;
18
+ const { msg } = $derived($i18n);
19
19
  </script>
20
20
 
21
21
  <div class="form-group">
@@ -6,9 +6,12 @@
6
6
  const { attribute, dispatchFormAction, kcClsx, displayableErrors, valueOrValues }: InputFieldByTypeProps<I18n> =
7
7
  $props();
8
8
 
9
- assert(typeof valueOrValues === 'string');
10
-
11
- const value = valueOrValues;
9
+ const value = $derived(
10
+ (() => {
11
+ assert(typeof valueOrValues === 'string');
12
+ return valueOrValues;
13
+ })(),
14
+ );
12
15
  </script>
13
16
 
14
17
  <textarea
@@ -4,7 +4,7 @@
4
4
  import InputFieldByType from './InputFieldByType.svelte';
5
5
  import type { UserProfileFormFieldsProps } from './UserProfileFormFieldsProps';
6
6
  import { useUserProfileForm } from '../lib/useUserProfileForm';
7
- import { onMount } from 'svelte';
7
+ import { onMount, untrack } from 'svelte';
8
8
  import { derived } from 'svelte/store';
9
9
  import type { I18n } from '../i18n';
10
10
  import type { KcContext } from '../KcContext';
@@ -18,14 +18,14 @@
18
18
  doMakeUserConfirmPassword,
19
19
  beforeField,
20
20
  afterField,
21
- } = props;
21
+ } = $derived(props);
22
22
 
23
- const { advancedMsg } = $i18n;
23
+ const { advancedMsg } = $derived($i18n);
24
24
 
25
25
  const { formState, dispatchFormAction } = useUserProfileForm({
26
- kcContext,
27
- i18n: $i18n,
28
- doMakeUserConfirmPassword,
26
+ kcContext: untrack(() => kcContext),
27
+ i18n: untrack(() => $i18n),
28
+ doMakeUserConfirmPassword: untrack(() => doMakeUserConfirmPassword),
29
29
  });
30
30
  onMount(() => {
31
31
  const unsubscribe = formState.subscribe(({ isFormSubmittable }) => {
@@ -6,16 +6,18 @@
6
6
  import type { I18n } from '../i18n';
7
7
 
8
8
  const props: PageProps<Extract<KcContext, { pageId: 'code.ftl' }>, I18n> = $props();
9
- const { kcContext, i18n, doUseDefaultCss, Template, classes } = props;
9
+ const { kcContext, i18n, doUseDefaultCss, Template, classes } = $derived(props);
10
10
 
11
- const { kcClsx } = getKcClsx({
12
- doUseDefaultCss,
13
- classes,
14
- });
11
+ const { kcClsx } = $derived(
12
+ getKcClsx({
13
+ doUseDefaultCss,
14
+ classes,
15
+ }),
16
+ );
15
17
 
16
- const { code } = kcContext;
18
+ const { code } = $derived(kcContext);
17
19
 
18
- const { msg } = $i18n;
20
+ const { msg } = $derived($i18n);
19
21
  </script>
20
22
 
21
23
  <Template
@@ -12,14 +12,16 @@
12
12
  classes,
13
13
  }: PageProps<Extract<KcContext, { pageId: 'delete-account-confirm.ftl' }>, I18n> = $props();
14
14
 
15
- const { kcClsx } = getKcClsx({
16
- doUseDefaultCss,
17
- classes,
18
- });
15
+ const { kcClsx } = $derived(
16
+ getKcClsx({
17
+ doUseDefaultCss,
18
+ classes,
19
+ }),
20
+ );
19
21
 
20
- const { url, triggered_from_aia } = kcContext;
22
+ const { url, triggered_from_aia } = $derived(kcContext);
21
23
 
22
- const { msg, msgStr } = $i18n;
24
+ const { msg, msgStr } = $derived($i18n);
23
25
  </script>
24
26
 
25
27
  <Template
@@ -12,14 +12,16 @@
12
12
  classes,
13
13
  }: PageProps<Extract<KcContext, { pageId: 'delete-credential.ftl' }>, I18n> = $props();
14
14
 
15
- const { msgStr, msg } = $i18n;
15
+ const { msgStr, msg } = $derived($i18n);
16
16
 
17
- const { kcClsx } = getKcClsx({
18
- doUseDefaultCss,
19
- classes,
20
- });
17
+ const { kcClsx } = $derived(
18
+ getKcClsx({
19
+ doUseDefaultCss,
20
+ classes,
21
+ }),
22
+ );
21
23
 
22
- const { url, credentialLabel } = kcContext;
24
+ const { url, credentialLabel } = $derived(kcContext);
23
25
  </script>
24
26
 
25
27
  <Template
@@ -12,9 +12,9 @@
12
12
  classes,
13
13
  }: PageProps<Extract<KcContext, { pageId: 'error.ftl' }>, I18n> = $props();
14
14
 
15
- const { message, client, skipLink } = kcContext;
15
+ const { message, client, skipLink } = $derived(kcContext);
16
16
 
17
- const { msg } = $i18n;
17
+ const { msg } = $derived($i18n);
18
18
  </script>
19
19
 
20
20
  <Template
@@ -11,9 +11,9 @@
11
11
  classes,
12
12
  }: PageProps<Extract<KcContext, { pageId: 'frontchannel-logout.ftl' }>, I18n> = $props();
13
13
 
14
- const { logout } = kcContext;
14
+ const { logout } = $derived(kcContext);
15
15
 
16
- const { msg, msgStr } = $i18n;
16
+ const { msg, msgStr } = $derived($i18n);
17
17
  let iframeLoadCount = $state(0);
18
18
  $effect(() => {
19
19
  if (!kcContext.logout.logoutRedirectUri) {
@@ -21,14 +21,16 @@
21
21
  UserProfileFormFields,
22
22
  doMakeUserConfirmPassword,
23
23
  }: IdpReviewUserProfileProps = $props();
24
- const { kcClsx } = getKcClsx({
25
- doUseDefaultCss,
26
- classes,
27
- });
24
+ const { kcClsx } = $derived(
25
+ getKcClsx({
26
+ doUseDefaultCss,
27
+ classes,
28
+ }),
29
+ );
28
30
 
29
- const { msg, msgStr } = $i18n;
31
+ const { msg, msgStr } = $derived($i18n);
30
32
 
31
- const { url, messagesPerField } = kcContext;
33
+ const { url, messagesPerField } = $derived(kcContext);
32
34
 
33
35
  const [isFomSubmittable, setIsFomSubmittable] = useState(false);
34
36
  </script>
@@ -12,9 +12,9 @@
12
12
  classes,
13
13
  }: PageProps<Extract<KcContext, { pageId: 'info.ftl' }>, I18n> = $props();
14
14
 
15
- const { advancedMsgStr, msg } = $i18n;
15
+ const { advancedMsgStr, msg } = $derived($i18n);
16
16
 
17
- const { messageHeader, message, requiredActions, skipLink, pageRedirectUri, actionUri, client } = kcContext;
17
+ const { messageHeader, message, requiredActions, skipLink, pageRedirectUri, actionUri, client } = $derived(kcContext);
18
18
  </script>
19
19
 
20
20
  <Template
@@ -14,14 +14,17 @@
14
14
  Template,
15
15
  classes,
16
16
  }: PageProps<Extract<KcContext, { pageId: 'login.ftl' }>, I18n> = $props();
17
- const { kcClsx } = getKcClsx({
18
- doUseDefaultCss,
19
- classes,
20
- });
17
+ const { kcClsx } = $derived(
18
+ getKcClsx({
19
+ doUseDefaultCss,
20
+ classes,
21
+ }),
22
+ );
21
23
 
22
- const { social, realm, url, usernameHidden, login, auth, registrationDisabled, messagesPerField } = kcContext;
24
+ const { social, realm, url, usernameHidden, login, auth, registrationDisabled, messagesPerField } =
25
+ $derived(kcContext);
23
26
 
24
- const { msg, msgStr } = $i18n;
27
+ const { msg, msgStr } = $derived($i18n);
25
28
 
26
29
  const [isLoginButtonDisabled, setIsLoginButtonDisabled] = useState(false);
27
30
  </script>
@@ -178,7 +181,7 @@
178
181
  name="rememberMe"
179
182
  type="checkbox"
180
183
  checked={!!login.rememberMe}
181
- />&nbsp;
184
+ />
182
185
  {@render msg('rememberMe')()}
183
186
  </label>
184
187
  </div>
@@ -14,14 +14,16 @@
14
14
  classes,
15
15
  }: PageProps<Extract<KcContext, { pageId: 'login-config-totp.ftl' }>, I18n> = $props();
16
16
 
17
- const { kcClsx } = getKcClsx({
18
- doUseDefaultCss,
19
- classes,
20
- });
17
+ const { kcClsx } = $derived(
18
+ getKcClsx({
19
+ doUseDefaultCss,
20
+ classes,
21
+ }),
22
+ );
21
23
 
22
- const { url, isAppInitiatedAction, totp, mode, messagesPerField } = kcContext;
24
+ const { url, isAppInitiatedAction, totp, mode, messagesPerField } = $derived(kcContext);
23
25
 
24
- const { msg, msgStr, advancedMsg } = $i18n;
26
+ const { msg, msgStr, advancedMsg } = $derived($i18n);
25
27
  </script>
26
28
 
27
29
  <Template
@@ -12,14 +12,16 @@
12
12
  classes,
13
13
  }: PageProps<Extract<KcContext, { pageId: 'login-idp-link-confirm.ftl' }>, I18n> = $props();
14
14
 
15
- const { kcClsx } = getKcClsx({
16
- doUseDefaultCss,
17
- classes,
18
- });
15
+ const { kcClsx } = $derived(
16
+ getKcClsx({
17
+ doUseDefaultCss,
18
+ classes,
19
+ }),
20
+ );
19
21
 
20
- const { url, idpAlias } = kcContext;
22
+ const { url, idpAlias } = $derived(kcContext);
21
23
 
22
- const { msg } = $i18n;
24
+ const { msg } = $derived($i18n);
23
25
  </script>
24
26
 
25
27
  <Template
@@ -12,14 +12,16 @@
12
12
  classes,
13
13
  }: PageProps<Extract<KcContext, { pageId: 'login-idp-link-confirm-override.ftl' }>, I18n> = $props();
14
14
 
15
- const { kcClsx } = getKcClsx({
16
- doUseDefaultCss,
17
- classes,
18
- });
15
+ const { kcClsx } = $derived(
16
+ getKcClsx({
17
+ doUseDefaultCss,
18
+ classes,
19
+ }),
20
+ );
19
21
 
20
- const { url, idpDisplayName } = kcContext;
22
+ const { url, idpDisplayName } = $derived(kcContext);
21
23
 
22
- const { msg } = $i18n;
24
+ const { msg } = $derived($i18n);
23
25
  </script>
24
26
 
25
27
  <Template