diff --git a/frontend/src/routes/(app)/dashboard/+page.svelte b/frontend/src/routes/(app)/dashboard/+page.svelte index 9288363..332698f 100644 --- a/frontend/src/routes/(app)/dashboard/+page.svelte +++ b/frontend/src/routes/(app)/dashboard/+page.svelte @@ -1,11 +1,10 @@
diff --git a/frontend/src/routes/(app)/dashboard/[...catchall]/+page.svelte b/frontend/src/routes/(app)/dashboard/[...catchall]/+page.svelte index 6e61a42..eeb9893 100644 --- a/frontend/src/routes/(app)/dashboard/[...catchall]/+page.svelte +++ b/frontend/src/routes/(app)/dashboard/[...catchall]/+page.svelte @@ -9,7 +9,7 @@
404
Page Not Found
- diff --git a/frontend/src/routes/(app)/dashboard/billing/+page.svelte b/frontend/src/routes/(app)/dashboard/billing/+page.svelte index 7a2ebc7..0e2d789 100644 --- a/frontend/src/routes/(app)/dashboard/billing/+page.svelte +++ b/frontend/src/routes/(app)/dashboard/billing/+page.svelte @@ -5,14 +5,13 @@ import { Separator } from '$lib/components/ui/separator' import * as Dialog from '$lib/components/ui/dialog' import { Check, LoaderCircleIcon } from 'lucide-svelte' - import type { PageData } from './$types' import { zodClient } from 'sveltekit-superforms/adapters' import { cancelSubscriptionSchema } from './schema' import { superForm } from 'sveltekit-superforms' import { toast } from 'svelte-sonner' import { ScrollArea } from '$lib/components/ui/scroll-area' - export let data: PageData + let { data } = $props() let cancelPlanDialogOpen = false @@ -158,7 +157,7 @@
diff --git a/frontend/src/routes/(app)/dashboard/links/(components)/form.svelte b/frontend/src/routes/(app)/dashboard/links/(components)/form.svelte index 1ab8000..c727825 100644 --- a/frontend/src/routes/(app)/dashboard/links/(components)/form.svelte +++ b/frontend/src/routes/(app)/dashboard/links/(components)/form.svelte @@ -18,10 +18,16 @@ import { ScrollArea } from '$lib/components/ui/scroll-area' import type { Project } from '$lib/db/types' - export let data: SuperValidated> - export let projects: Project[] - export let dialogOpen: boolean - let shortenerCategory: any = undefined + let { + data, + projects, + dialogOpen = $bindable(), + }: { + data: SuperValidated> + projects: Project[] + dialogOpen: boolean + } = $props() + let shortenerCategory = $state(undefined) const form = superForm(data, { validators: zodClient(formSchema), @@ -40,9 +46,9 @@ const { form: formData, enhance, submitting } = form - let inputTimer: any - let previewData: any - let isPreviewLoading: boolean = false + let inputTimer = $state() + let previewData = $state() + let isPreviewLoading = $state(false) const getMetadata = async () => { isPreviewLoading = true @@ -108,7 +114,7 @@ {...attrs} bind:value={$formData.link} placeholder="https://example.com" - on:input={getMetadata} /> + oninput={getMetadata} /> Shortener link @@ -167,8 +173,9 @@ bind:value={$formData.custom_code} placeholder="abcde" /> - Custom Code For The Shortener + + Custom Code For The Shortener + {/if} @@ -192,8 +199,9 @@ bind:value={$formData.ios_link} placeholder="https://example.com" /> - Shortener link for iOS + + Shortener link for iOS + {/if} @@ -217,8 +225,9 @@ bind:value={$formData.android_link} placeholder="https://example.com" /> - Shortener link for Android + + Shortener link for Android + {/if} diff --git a/frontend/src/routes/(app)/dashboard/links/+page.svelte b/frontend/src/routes/(app)/dashboard/links/+page.svelte index 647c218..9f19054 100644 --- a/frontend/src/routes/(app)/dashboard/links/+page.svelte +++ b/frontend/src/routes/(app)/dashboard/links/+page.svelte @@ -1,5 +1,4 @@
{ + oninput={({ target }) => { clearTimeout(searchUpdateTimeout) searchUpdateTimeout = setTimeout(() => { search = target.value pageNumber = 1 }, 500) }} /> -
@@ -230,14 +234,14 @@ class="max-w-[250px]" autofocus value={search} - on:input={({ target }) => { + oninput={({ target }) => { clearTimeout(searchUpdateTimeout) searchUpdateTimeout = setTimeout(() => { search = target.value pageNumber = 1 }, 500) }} /> - @@ -346,7 +350,7 @@

Add a new shortener

- - + + QR Link - - Standard - - - With Style - + + + Standard + + + With Style + + diff --git a/frontend/src/routes/(app)/dashboard/links/[id]/qr/+page.svelte b/frontend/src/routes/(app)/dashboard/links/[id]/qr/+page.svelte index 98da061..49ba36c 100644 --- a/frontend/src/routes/(app)/dashboard/links/[id]/qr/+page.svelte +++ b/frontend/src/routes/(app)/dashboard/links/[id]/qr/+page.svelte @@ -3,8 +3,10 @@ import type { PageData } from './$types' import QR from './(components)/qr.svelte' - export let data: PageData - export let shallowRouting = false + let { + data, + shallowRouting = $bindable(false), + }: { data: PageData; shallowRouting: boolean } = $props() {#if !shallowRouting} diff --git a/frontend/src/routes/(app)/dashboard/projects/+page.svelte b/frontend/src/routes/(app)/dashboard/projects/+page.svelte index 28be9f5..2a308af 100644 --- a/frontend/src/routes/(app)/dashboard/projects/+page.svelte +++ b/frontend/src/routes/(app)/dashboard/projects/+page.svelte @@ -11,9 +11,9 @@ import { zodClient } from 'sveltekit-superforms/adapters' import { toast } from 'svelte-sonner' - export let data + let { data } = $props() - let dialogOpen = false + let dialogOpen = $state(false) const form = superForm(data.form, { validators: zodClient(formSchema), @@ -102,7 +102,7 @@

Add a new project

@@ -168,24 +161,13 @@ class="max-w-[250px]" autofocus value={search} - on:input={({ target }) => { + oninput={({ target }) => { clearTimeout(searchUpdateTimeout) searchUpdateTimeout = setTimeout(() => { search = target.value }, 500) }} /> - @@ -223,7 +205,7 @@

Add a new shortener

- - + + QR Link - - Standard - - - With Style - + + + Standard + + + With Style + + diff --git a/frontend/src/routes/(app)/dashboard/projects/[id]/links/[linkid]/qr/+page.svelte b/frontend/src/routes/(app)/dashboard/projects/[id]/links/[linkid]/qr/+page.svelte index 94a49a3..10f0d94 100644 --- a/frontend/src/routes/(app)/dashboard/projects/[id]/links/[linkid]/qr/+page.svelte +++ b/frontend/src/routes/(app)/dashboard/projects/[id]/links/[linkid]/qr/+page.svelte @@ -3,8 +3,10 @@ import type { PageData } from './$types' import QR from './(components)/qr.svelte' - export let data: PageData - export let shallowRouting = false + let { + data, + shallowRouting, + }: { data: PageData; shallowRouting: boolean } = $props() const url = data.project.enable_custom_domain && data.project.custom_domain diff --git a/frontend/src/routes/(app)/dashboard/projects/[id]/settings/(components)/DemoQR.svelte b/frontend/src/routes/(app)/dashboard/projects/[id]/settings/(components)/DemoQR.svelte index 7326bf0..a92721f 100644 --- a/frontend/src/routes/(app)/dashboard/projects/[id]/settings/(components)/DemoQR.svelte +++ b/frontend/src/routes/(app)/dashboard/projects/[id]/settings/(components)/DemoQR.svelte @@ -2,16 +2,25 @@ import { onMount } from 'svelte' import { browser } from '$app/environment' - export let background = '#fff' - export let color = '#000' - export let value = 'example.com/abcdefgh' - export let cornerSquareStyle: 'dot' | 'square' | 'extra-rounded' = - 'square' - export let dotStyle: 'square' | 'rounded' = 'square' - export let existingQrImage: string | null = null - export let qrImage: File | null = null + let { + background = '#fff', + color = '#000', + value = 'example.com/abcdefgh', + cornerSquareStyle = 'square', + dotStyle = 'square', + existingQrImage = null, + qrImage = null, + }: { + background: string + color: string + value: string + cornerSquareStyle: 'dot' | 'square' | 'extra-rounded' + dotStyle: 'square' | 'rounded' + existingQrImage: string | null + qrImage: File | null + } = $props() - let image = '' + let image = $state('') async function generateQrCode() { if (!document || !window) { @@ -58,13 +67,18 @@ } } - $: browser && - background && - color && - cornerSquareStyle && - dotStyle && - (qrImage === null || qrImage) && - generateQrCode() + $effect(() => { + if ( + browser && + background && + color && + cornerSquareStyle && + dotStyle && + (qrImage === null || qrImage) + ) { + generateQrCode() + } + }) onMount(() => { generateQrCode() diff --git a/frontend/src/routes/(app)/dashboard/projects/[id]/settings/(components)/dns-info.svelte b/frontend/src/routes/(app)/dashboard/projects/[id]/settings/(components)/dns-info.svelte index 99b176f..7ceff19 100644 --- a/frontend/src/routes/(app)/dashboard/projects/[id]/settings/(components)/dns-info.svelte +++ b/frontend/src/routes/(app)/dashboard/projects/[id]/settings/(components)/dns-info.svelte @@ -2,10 +2,17 @@ import * as Tabs from '$lib/components/ui/tabs/index.js' import * as Card from '$lib/components/ui/card/index.js' - export let host: string - export let cname_record: string - export let a_record: string - export let aaaa_record: string + let { + host, + a_record, + aaaa_record, + cname_record, + }: { + host: string + cname_record: string + a_record: string + aaaa_record: string + } = $props() const defaultValue = cname_record ? 'cname' : 'a' diff --git a/frontend/src/routes/(app)/dashboard/projects/[id]/settings/(components)/dns-tooltip.svelte b/frontend/src/routes/(app)/dashboard/projects/[id]/settings/(components)/dns-tooltip.svelte index cce878b..cc46c2d 100644 --- a/frontend/src/routes/(app)/dashboard/projects/[id]/settings/(components)/dns-tooltip.svelte +++ b/frontend/src/routes/(app)/dashboard/projects/[id]/settings/(components)/dns-tooltip.svelte @@ -2,11 +2,19 @@ import * as Tooltip from '$lib/components/ui/tooltip/index.js' import { InfoIcon } from 'lucide-svelte' - export let domain: string - export let custom_ip: string | null - export let cname_record: string - export let a_record: string - export let aaaa_record: string + let { + a_record, + aaaa_record, + cname_record, + custom_ip, + domain, + }: { + domain: string + custom_ip: string | null + cname_record: string + a_record: string + aaaa_record: string + } = $props() diff --git a/frontend/src/routes/(app)/dashboard/projects/[id]/settings/(components)/form.svelte b/frontend/src/routes/(app)/dashboard/projects/[id]/settings/(components)/form.svelte index 8ecf4c5..6feda62 100644 --- a/frontend/src/routes/(app)/dashboard/projects/[id]/settings/(components)/form.svelte +++ b/frontend/src/routes/(app)/dashboard/projects/[id]/settings/(components)/form.svelte @@ -14,11 +14,17 @@ import DemoQr from './DemoQR.svelte' import { cn } from '$lib/utils' - export let data: SuperValidated> - export let qrImageBase64: string | null = null - export let isPro: boolean = false + let { + data, + qrImageBase64 = null, + isPro = false, + }: { + data: SuperValidated> + qrImageBase64: string | null + isPro: boolean + } = $props() - let qrImageInput: HTMLInputElement + let qrImageInput: HTMLInputElement | undefined = $state() const form = superForm(data, { validators: zodClient(formSchema), @@ -84,7 +90,7 @@
{#if !$formData.qrImage && !qrImageBase64} {:else} - diff --git a/frontend/src/routes/(app)/dashboard/settings/(components)/sidebar-nav.svelte b/frontend/src/routes/(app)/dashboard/settings/(components)/sidebar-nav.svelte index 70056a4..1b2d9ec 100644 --- a/frontend/src/routes/(app)/dashboard/settings/(components)/sidebar-nav.svelte +++ b/frontend/src/routes/(app)/dashboard/settings/(components)/sidebar-nav.svelte @@ -2,8 +2,12 @@ import { cn } from '$lib/utils' import { page } from '$app/stores' import { Button } from '$lib/components/ui/button' - let className: string | undefined | null = undefined - export { className as class } + + let { + class: className = undefined, + }: { + class: string | undefined | null + } = $props() const items = [ { diff --git a/frontend/src/routes/(app)/dashboard/settings/account/+page.svelte b/frontend/src/routes/(app)/dashboard/settings/account/+page.svelte index c47fd1b..1f31ac0 100644 --- a/frontend/src/routes/(app)/dashboard/settings/account/+page.svelte +++ b/frontend/src/routes/(app)/dashboard/settings/account/+page.svelte @@ -8,7 +8,7 @@ import { toast } from 'svelte-sonner' import { LoaderCircle, CheckIcon, XIcon } from 'lucide-svelte' - export let data + let { data } = $props() const form = superForm(data.form, { validators: zodClient(formSchema), diff --git a/frontend/src/routes/(app)/dashboard/settings/qr/(components)/DemoQR.svelte b/frontend/src/routes/(app)/dashboard/settings/qr/(components)/DemoQR.svelte index 9117529..aaed3e0 100644 --- a/frontend/src/routes/(app)/dashboard/settings/qr/(components)/DemoQR.svelte +++ b/frontend/src/routes/(app)/dashboard/settings/qr/(components)/DemoQR.svelte @@ -2,16 +2,25 @@ import { onMount } from 'svelte' import { browser } from '$app/environment' - export let background = '#fff' - export let color = '#000' - export let value = 'abcdefghajskdadsj' - export let cornerSquareStyle: 'dot' | 'square' | 'extra-rounded' = - 'square' - export let dotStyle: 'square' | 'rounded' = 'square' - export let existingQrImage: string | null = null - export let qrImage: File | null = null + let { + background = '#fff', + color = '#000', + value = 'abcdefghajskdadsj', + cornerSquareStyle = 'square', + dotStyle = 'square', + existingQrImage = null, + qrImage = null, + }: { + background: string + color: string + value: string + cornerSquareStyle: 'dot' | 'square' | 'extra-rounded' + dotStyle: 'square' | 'rounded' + existingQrImage: string | null + qrImage: File | null + } = $props() - let image = '' + let image = $state('') async function generateQrCode() { if (!document || !window) { @@ -58,13 +67,18 @@ } } - $: browser && - background && - color && - cornerSquareStyle && - dotStyle && - (qrImage === null || qrImage) && - generateQrCode() + $effect(() => { + if ( + browser && + background && + color && + cornerSquareStyle && + dotStyle && + (qrImage === null || qrImage) + ) { + generateQrCode() + } + }) onMount(() => { generateQrCode() diff --git a/frontend/src/routes/(app)/dashboard/settings/qr/+page.svelte b/frontend/src/routes/(app)/dashboard/settings/qr/+page.svelte index ceb79c4..946cabd 100644 --- a/frontend/src/routes/(app)/dashboard/settings/qr/+page.svelte +++ b/frontend/src/routes/(app)/dashboard/settings/qr/+page.svelte @@ -1,6 +1,5 @@
> + let { data }: { data: SuperValidated> } = $props() const form = superForm(data, { validators: zodClient(formSchema), diff --git a/frontend/src/routes/(auth)/login/+page.svelte b/frontend/src/routes/(auth)/login/+page.svelte index fd8d1a5..b5512cd 100644 --- a/frontend/src/routes/(auth)/login/+page.svelte +++ b/frontend/src/routes/(auth)/login/+page.svelte @@ -2,14 +2,13 @@ import ThemeToggle from '$lib/components/theme-toggle.svelte' import Form from './(components)/form.svelte' - import type { PageData } from './$types' import { Button } from '$lib/components/ui/button' import { LoaderIcon } from 'lucide-svelte' import Google from '$lib/components/icons/google.svelte' - export let data: PageData + let { data } = $props() - let isLoading = false + let isLoading = $state(false) const loginGoogle = async () => { // isLoading = true diff --git a/frontend/src/routes/(auth)/signup/(components)/form.svelte b/frontend/src/routes/(auth)/signup/(components)/form.svelte index 1c42e14..24f22c5 100644 --- a/frontend/src/routes/(auth)/signup/(components)/form.svelte +++ b/frontend/src/routes/(auth)/signup/(components)/form.svelte @@ -11,7 +11,7 @@ import { toast } from 'svelte-sonner' import { LoaderCircle } from 'lucide-svelte' - export let data: SuperValidated> + let { data }: { data: SuperValidated> } = $props() const form = superForm(data, { validators: zodClient(formSchema), diff --git a/frontend/src/routes/(auth)/signup/+page.svelte b/frontend/src/routes/(auth)/signup/+page.svelte index 61c579f..2d194dc 100644 --- a/frontend/src/routes/(auth)/signup/+page.svelte +++ b/frontend/src/routes/(auth)/signup/+page.svelte @@ -1,9 +1,8 @@ diff --git a/frontend/src/routes/(public)/url/[id]/qr/+page.svelte b/frontend/src/routes/(public)/url/[id]/qr/+page.svelte index 485ee76..c956d1a 100644 --- a/frontend/src/routes/(public)/url/[id]/qr/+page.svelte +++ b/frontend/src/routes/(public)/url/[id]/qr/+page.svelte @@ -5,9 +5,9 @@ import { onMount } from 'svelte' import * as Card from '$lib/components/ui/card' - export let data + let { data } = $props() - let image = '' + let image = $state('') const copyImageToClipboard = async () => { if (!image) return @@ -79,7 +79,7 @@ alt={data.url + '/' + data.shortenerId} width={300} height={300} /> -