Skip to content

Commit 579554c

Browse files
committed
chore: ran npx sv migrate svelte-5
1 parent 4cff1e0 commit 579554c

File tree

13 files changed

+188
-155
lines changed

13 files changed

+188
-155
lines changed

src/components/camera-qr-scanner/camera-qr-scanner.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
<option value={cameraDevice}>{cameraDevice.label}</option>
8585
{/each}
8686
</select>
87-
<!-- svelte-ignore a11y-media-has-caption -->
87+
<!-- svelte-ignore a11y_media_has_caption -->
8888
<video class="w-full mt-3" bind:this={videoEl}></video>
8989
</div>
9090
{:else if availableCameraDevices && availableCameraDevices.length <= 0}

src/components/screen-qr-scanner/screen-qr-scanner.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
<button
5252
class="btn variant-filled block !p-0 w-[200px] rounded-lg overflow-hidden"
5353
type="button"
54-
on:click={() => scanQrCodeAtSource(source)}>
54+
onclick={() => scanQrCodeAtSource(source)}>
5555
<img class="h-auto max-w-full" src={source.thumbnail} alt="Thumbnail of {source.name}" />
5656
<p class="truncate p-1" title={source.name}>{source.name}</p>
5757
</button>

src/components/totp-list/totp-list.svelte

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -119,17 +119,17 @@
119119
dropTargetStyle: {},
120120
transformDraggedElement,
121121
}}
122-
on:consider={handleConsider}
123-
on:finalize={handleFinalize}>
122+
onconsider={handleConsider}
123+
onfinalize={handleFinalize}>
124124
{#each internalList as item (item.id)}
125125
{@const totp = item.item}
126126
<div animate:flip={{ duration: flipAnimationMs }}>
127127
<li class="h-14 p-1">
128128
<i
129129
class="material-icons drag-handle cursor-move"
130-
on:mousedown={startDrag}
131-
on:touchstart={startDrag}
132-
on:keydown={handleKeyDown}
130+
onmousedown={startDrag}
131+
ontouchstart={startDrag}
132+
onkeydown={handleKeyDown}
133133
role="none">
134134
<svg
135135
viewBox="0 0 16 16"
@@ -182,7 +182,7 @@
182182
</a>
183183
</li>
184184
<li>
185-
<button class="flex-auto" type="button" on:click={e => handleDeleteToken(e, item.item)}>
185+
<button class="flex-auto" type="button" onclick={e => handleDeleteToken(e, item.item)}>
186186
<svg
187187
xmlns="http://www.w3.org/2000/svg"
188188
fill="none"
@@ -200,7 +200,7 @@
200200
</li>
201201
</ul>
202202
</nav>
203-
<div class="arrow bg-surface-100-800-token !left-[10.333rem]" />
203+
<div class="arrow bg-surface-100-800-token !left-[10.333rem]"></div>
204204
</div>
205205
</li>
206206
</div>

src/routes/+layout.svelte

Lines changed: 46 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,12 @@
1414
import { AvailableTimezoneProviders } from '$lib/timezone-providers';
1515
import CommonPreloader from '$components/common-preloader/common-preloader.svelte';
1616
import Lightswitch from '$components/lightswitch/lightswitch.svelte';
17-
import { theme } from '$components/lightswitch/actions';
17+
import { theme } from '$components/lightswitch/actions';
18+
interface Props {
19+
children?: import('svelte').Snippet;
20+
}
21+
22+
let { children }: Props = $props();
1823
1924
initializeStores();
2025
@@ -93,7 +98,7 @@
9398
sync();
9499
</script>
95100

96-
<svelte:window on:beforeunload={closeTotpAppClient} />
101+
<svelte:window onbeforeunload={closeTotpAppClient} />
97102
<svelte:document use:theme />
98103

99104
{#if ready}
@@ -176,38 +181,44 @@
176181
</nav>
177182
</Drawer>
178183
<AppShell>
179-
<svelte:fragment slot="header">
180-
<AppBar>
181-
<svelte:fragment slot="lead">
182-
<button type="button" class="btn-icon bg-initial btn-lg" on:click={openMainMenu}>
183-
<svg
184-
xmlns="http://www.w3.org/2000/svg"
185-
fill="none"
186-
viewBox="0 0 24 24"
187-
stroke-width="1.5"
188-
stroke="currentColor"
189-
class="w-8 h-8">
190-
<path stroke-linecap="round" stroke-linejoin="round" d="M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5" />
191-
</svg>
192-
</button>
193-
</svelte:fragment>
194-
<h1 class="h3">Flipper Authenticator Companion</h1>
195-
<svelte:fragment slot="trail">
196-
<a href="/update" class="btn-icon bg-initial btn-lg">
197-
<svg
198-
xmlns="http://www.w3.org/2000/svg"
199-
fill="none"
200-
viewBox="0 0 24 24"
201-
stroke-width="1.5"
202-
stroke="currentColor"
203-
class="w-6 h-6">
204-
<path stroke-linecap="round" stroke-linejoin="round" d="M12 4.5v15m7.5-7.5h-15" />
205-
</svg>
206-
</a>
207-
</svelte:fragment>
208-
</AppBar>
209-
</svelte:fragment>
210-
211-
<slot />
184+
{#snippet header()}
185+
186+
<AppBar>
187+
{#snippet lead()}
188+
189+
<button type="button" class="btn-icon bg-initial btn-lg" onclick={openMainMenu}>
190+
<svg
191+
xmlns="http://www.w3.org/2000/svg"
192+
fill="none"
193+
viewBox="0 0 24 24"
194+
stroke-width="1.5"
195+
stroke="currentColor"
196+
class="w-8 h-8">
197+
<path stroke-linecap="round" stroke-linejoin="round" d="M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5" />
198+
</svg>
199+
</button>
200+
201+
{/snippet}
202+
<h1 class="h3">Flipper Authenticator Companion</h1>
203+
{#snippet trail()}
204+
205+
<a href="/update" class="btn-icon bg-initial btn-lg">
206+
<svg
207+
xmlns="http://www.w3.org/2000/svg"
208+
fill="none"
209+
viewBox="0 0 24 24"
210+
stroke-width="1.5"
211+
stroke="currentColor"
212+
class="w-6 h-6">
213+
<path stroke-linecap="round" stroke-linejoin="round" d="M12 4.5v15m7.5-7.5h-15" />
214+
</svg>
215+
</a>
216+
217+
{/snippet}
218+
</AppBar>
219+
220+
{/snippet}
221+
222+
{@render children?.()}
212223
</AppShell>
213224
{/if}

src/routes/import/2fas/+page.svelte

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
</div>
6060
<div class="flex justify-center w-full">
6161
<FileDropzone name="files" bind:files on:change={processFiles} accept=".2fas">
62-
<svelte:fragment slot="lead">
62+
{#snippet lead()}
6363
<div class="flex justify-center">
6464
<svg
6565
class="w-9 h-9"
@@ -73,12 +73,14 @@
7373
d="M593.9 771.5c-31.2-31.2-31.2-82.4 0-113.6l91.2-91.2c3.1-4.8 6.7-9.3 10.8-13.5 14-14 31.9-21.7 50.3-23.1v-109H507.9c-56.4 0-102.1-45.7-102.1-102.1V80.8H190.3c-27.6 0-50.2 22.6-50.2 50.2v723c0 27.6 22.6 50.2 50.2 50.2h483V791.7c-27.3 7.9-58 1.2-79.4-20.2z" />
7474
</svg>
7575
</div>
76-
</svelte:fragment>
77-
<svelte:fragment slot="message">
76+
{/snippet}
77+
{#snippet message()}
7878
<strong>Upload a file</strong>
7979
or drag and drop
80-
</svelte:fragment>
81-
<svelte:fragment slot="meta">Only 2FAS allowed</svelte:fragment>
80+
{/snippet}
81+
{#snippet meta()}
82+
Only 2FAS allowed
83+
{/snippet}
8284
</FileDropzone>
8385
</div>
8486
</div>

src/routes/import/aegis/+page.svelte

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
</div>
6363
<div class="flex justify-center w-full">
6464
<FileDropzone name="files" bind:files on:change={processFiles} accept=".json">
65-
<svelte:fragment slot="lead">
65+
{#snippet lead()}
6666
<div class="flex justify-center">
6767
<svg
6868
class="w-9 h-9"
@@ -76,12 +76,14 @@
7676
d="M593.9 771.5c-31.2-31.2-31.2-82.4 0-113.6l91.2-91.2c3.1-4.8 6.7-9.3 10.8-13.5 14-14 31.9-21.7 50.3-23.1v-109H507.9c-56.4 0-102.1-45.7-102.1-102.1V80.8H190.3c-27.6 0-50.2 22.6-50.2 50.2v723c0 27.6 22.6 50.2 50.2 50.2h483V791.7c-27.3 7.9-58 1.2-79.4-20.2z" />
7777
</svg>
7878
</div>
79-
</svelte:fragment>
80-
<svelte:fragment slot="message">
79+
{/snippet}
80+
{#snippet message()}
8181
<strong>Upload a file</strong>
8282
or drag and drop
83-
</svelte:fragment>
84-
<svelte:fragment slot="meta">Only JSON allowed</svelte:fragment>
83+
{/snippet}
84+
{#snippet meta()}
85+
Only JSON allowed
86+
{/snippet}
8587
</FileDropzone>
8688
</div>
8789
</div>

src/routes/import/bitwarden/+page.svelte

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
</div>
6060
<div class="flex justify-center w-full">
6161
<FileDropzone name="files" bind:files on:change={processFiles} accept=".json">
62-
<svelte:fragment slot="lead">
62+
{#snippet lead()}
6363
<div class="flex justify-center">
6464
<svg
6565
class="w-9 h-9"
@@ -73,12 +73,14 @@
7373
d="M593.9 771.5c-31.2-31.2-31.2-82.4 0-113.6l91.2-91.2c3.1-4.8 6.7-9.3 10.8-13.5 14-14 31.9-21.7 50.3-23.1v-109H507.9c-56.4 0-102.1-45.7-102.1-102.1V80.8H190.3c-27.6 0-50.2 22.6-50.2 50.2v723c0 27.6 22.6 50.2 50.2 50.2h483V791.7c-27.3 7.9-58 1.2-79.4-20.2z" />
7474
</svg>
7575
</div>
76-
</svelte:fragment>
77-
<svelte:fragment slot="message">
76+
{/snippet}
77+
{#snippet message()}
7878
<strong>Upload a file</strong>
7979
or drag and drop
80-
</svelte:fragment>
81-
<svelte:fragment slot="meta">Only JSON allowed</svelte:fragment>
80+
{/snippet}
81+
{#snippet meta()}
82+
Only JSON allowed
83+
{/snippet}
8284
</FileDropzone>
8385
</div>
8486
</div>

src/routes/import/confirm/+page.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
onDestroy(() => abortController.abort());
5959
</script>
6060

61-
<form class="flex flex-col w-full p-4" on:submit={doImport}>
61+
<form class="flex flex-col w-full p-4" onsubmit={doImport}>
6262
<h4 class="h4 text-center mb-3">Select accounts to import</h4>
6363
<ul class="list pt-3 pb-3">
6464
{#each tokensParsed as token}

src/routes/import/freeotpplus/+page.svelte

Lines changed: 27 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
1010
GlobalCommonToast.initialize();
1111
12-
let files: FileList;
12+
let files: FileList = $state();
1313
1414
async function processFiles() {
1515
if (files.length <= 0) return;
@@ -56,26 +56,32 @@
5656
</div>
5757
<div class="flex justify-center w-full">
5858
<FileDropzone name="files" bind:files on:change={processFiles} accept=".json">
59-
<svelte:fragment slot="lead">
60-
<div class="flex justify-center">
61-
<svg
62-
class="w-9 h-9"
63-
stroke-width="1.5"
64-
fill="currentColor"
65-
viewBox="0 0 1024 1024"
66-
xmlns="http://www.w3.org/2000/svg">
67-
<path
68-
d="M515.5 366.1h230.6L461 80.8v230.7c0 30 24.5 54.6 54.5 54.6zM882 681.7l-98.8-98.8c-16.3-16.3-43.1-16.3-59.4 0L625 681.7c-16.3 16.3-16.3 43.1 0 59.4 16.3 16.3 43.1 16.3 59.4 0l27.1-27.1v193.9c0 23.1 18.9 42 42 42s42-18.9 42-42V714l27.1 27.1c16.3 16.3 43.1 16.3 59.4 0 16.4-16.4 16.4-43.1 0-59.4z" />
69-
<path
70-
d="M593.9 771.5c-31.2-31.2-31.2-82.4 0-113.6l91.2-91.2c3.1-4.8 6.7-9.3 10.8-13.5 14-14 31.9-21.7 50.3-23.1v-109H507.9c-56.4 0-102.1-45.7-102.1-102.1V80.8H190.3c-27.6 0-50.2 22.6-50.2 50.2v723c0 27.6 22.6 50.2 50.2 50.2h483V791.7c-27.3 7.9-58 1.2-79.4-20.2z" />
71-
</svg>
72-
</div>
73-
</svelte:fragment>
74-
<svelte:fragment slot="message">
75-
<strong>Upload a file</strong>
76-
or drag and drop
77-
</svelte:fragment>
78-
<svelte:fragment slot="meta">Only JSON allowed</svelte:fragment>
59+
{#snippet lead()}
60+
61+
<div class="flex justify-center">
62+
<svg
63+
class="w-9 h-9"
64+
stroke-width="1.5"
65+
fill="currentColor"
66+
viewBox="0 0 1024 1024"
67+
xmlns="http://www.w3.org/2000/svg">
68+
<path
69+
d="M515.5 366.1h230.6L461 80.8v230.7c0 30 24.5 54.6 54.5 54.6zM882 681.7l-98.8-98.8c-16.3-16.3-43.1-16.3-59.4 0L625 681.7c-16.3 16.3-16.3 43.1 0 59.4 16.3 16.3 43.1 16.3 59.4 0l27.1-27.1v193.9c0 23.1 18.9 42 42 42s42-18.9 42-42V714l27.1 27.1c16.3 16.3 43.1 16.3 59.4 0 16.4-16.4 16.4-43.1 0-59.4z" />
70+
<path
71+
d="M593.9 771.5c-31.2-31.2-31.2-82.4 0-113.6l91.2-91.2c3.1-4.8 6.7-9.3 10.8-13.5 14-14 31.9-21.7 50.3-23.1v-109H507.9c-56.4 0-102.1-45.7-102.1-102.1V80.8H190.3c-27.6 0-50.2 22.6-50.2 50.2v723c0 27.6 22.6 50.2 50.2 50.2h483V791.7c-27.3 7.9-58 1.2-79.4-20.2z" />
72+
</svg>
73+
</div>
74+
75+
{/snippet}
76+
{#snippet message()}
77+
78+
<strong>Upload a file</strong>
79+
or drag and drop
80+
81+
{/snippet}
82+
{#snippet meta()}
83+
Only JSON allowed
84+
{/snippet}
7985
</FileDropzone>
8086
</div>
8187
</div>

src/routes/import/google/+page.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@
9393
Scan QR code
9494
</div>
9595
<div class="flex gap-3">
96-
<button class="btn btn-lg variant-filled-primary flex-grow" on:click={onScanQrCodeOnScreenClicked}>
96+
<button class="btn btn-lg variant-filled-primary flex-grow" onclick={onScanQrCodeOnScreenClicked}>
9797
<svg
9898
xmlns="http://www.w3.org/2000/svg"
9999
fill="none"
@@ -108,7 +108,7 @@
108108
</svg>
109109
<span>On Screen</span>
110110
</button>
111-
<button class="btn btn-lg variant-filled-primary flex-grow" on:click={onScanQrCodeOnCameraClicked}>
111+
<button class="btn btn-lg variant-filled-primary flex-grow" onclick={onScanQrCodeOnCameraClicked}>
112112
<svg
113113
xmlns="http://www.w3.org/2000/svg"
114114
fill="none"

src/routes/import/uri-list/+page.svelte

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
</div>
5858
<div class="flex justify-center w-full">
5959
<FileDropzone name="files" bind:files on:change={processFiles} accept=".txt">
60-
<svelte:fragment slot="lead">
60+
{#snippet lead()}
6161
<div class="flex justify-center">
6262
<svg
6363
class="w-9 h-9"
@@ -71,12 +71,14 @@
7171
d="M593.9 771.5c-31.2-31.2-31.2-82.4 0-113.6l91.2-91.2c3.1-4.8 6.7-9.3 10.8-13.5 14-14 31.9-21.7 50.3-23.1v-109H507.9c-56.4 0-102.1-45.7-102.1-102.1V80.8H190.3c-27.6 0-50.2 22.6-50.2 50.2v723c0 27.6 22.6 50.2 50.2 50.2h483V791.7c-27.3 7.9-58 1.2-79.4-20.2z" />
7272
</svg>
7373
</div>
74-
</svelte:fragment>
75-
<svelte:fragment slot="message">
74+
{/snippet}
75+
{#snippet message()}
7676
<strong>Upload a file</strong>
7777
or drag and drop
78-
</svelte:fragment>
79-
<svelte:fragment slot="meta">Only TXT allowed</svelte:fragment>
78+
{/snippet}
79+
{#snippet meta()}
80+
Only TXT allowed
81+
{/snippet}
8082
</FileDropzone>
8183
</div>
8284
</div>

src/routes/settings/+page.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353

5454
{#if deviceAppSettings}
5555
<div class="flex h-max min-h-full">
56-
<form class="w-full p-4" on:submit={saveSettings}>
56+
<form class="w-full p-4" onsubmit={saveSettings}>
5757
<div class="mb-5">
5858
<h3 class="h3">Date and time</h3>
5959
<label class="label mb-3" for="timeProvider">

0 commit comments

Comments
 (0)