@functionalcms/svelte-components 5.24.8 → 5.24.9

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@functionalcms/svelte-components",
3
- "version": "5.24.8",
3
+ "version": "5.24.9",
4
4
  "license": "MIT",
5
5
  "watch": {
6
6
  "build": {
@@ -1,47 +1,51 @@
1
- <script lang="ts">
2
- import { SmartForm } from '@functionalcms/svelte-components';
3
- import * as m from '$lib/paraglide/messages.js';
4
- import { deserialize } from '$app/forms';
5
- import { fields } from './fields.js';
1
+ <script lang="ts">
2
+ import { SmartForm } from '@functionalcms/svelte-components';
3
+ import * as m from '$lib/paraglide/messages.js';
4
+ import { fields } from './fields.js';
5
+ import { goto } from '$app/navigation';
6
6
 
7
- interface Props {
8
- data: {
9
- username: string | null;
10
- errors: string;
11
- };
12
- form: any;
13
- }
7
+ interface Props {
8
+ data: {
9
+ username: string | null;
10
+ errors: string;
11
+ };
12
+ form: any;
13
+ }
14
14
 
15
- let { data, form = {} } = $props();
16
- </script>
15
+ let { data, form = {} } = $props();
17
16
 
18
- <article class="w-full">
19
- <main class="flex flex-col justify-around items-center gap-4 w-full m-auto p-4">
20
- <h1>{m.auth_setup_title()}</h1>
21
- {#if !data.username}
22
- <p>{m.auth_setup_missing_code()}</p>
23
- {:else}
24
- <div>
25
- {@html m.auth_setup_into()}
26
- </div>
27
- <SmartForm
28
- fields={fields(data.code ?? form.code)}
29
- errors={form?.errors}
30
- action="?/setup"
31
- buttons={[
32
- {
33
- type: 'submit',
34
- label: m.auth_submit(),
35
- color: 'primary'
36
- }
37
- ]}
38
- />
39
- {#if form?.success}
40
- <p>{m.auth_setup_success()}</p>
41
- {/if}
42
- {/if}
43
- </main>
44
- </article>
17
+ if (form?.success) {
18
+ goto('/');
19
+ }
20
+ </script>
45
21
 
46
- <style>
47
- </style>
22
+ <article class="w-full">
23
+ <main class="flex flex-col justify-around items-center gap-4 w-full m-auto p-4">
24
+ <h1>{m.auth_setup_title()}</h1>
25
+ {#if !data.username}
26
+ <p>{m.auth_setup_missing_code()}</p>
27
+ {:else}
28
+ <div>
29
+ {@html m.auth_setup_into()}
30
+ </div>
31
+ <SmartForm
32
+ fields={fields(data.code ?? form.code)}
33
+ errors={form?.errors}
34
+ action="?/setup"
35
+ buttons={[
36
+ {
37
+ type: 'submit',
38
+ label: m.auth_submit(),
39
+ color: 'primary'
40
+ }
41
+ ]}
42
+ />
43
+ {#if form?.success}
44
+ <p>{m.auth_setup_success()}</p>
45
+ {/if}
46
+ {/if}
47
+ </main>
48
+ </article>
49
+
50
+ <style>
51
+ </style>