migrate: convert most components to svelte 5

This commit is contained in:
Xylight committed 2024-10-25 19:33:27 -07:00
1 parent d670f39f0a
commit 10ef4123da
225 files changed
+5441 -3341

No files matched your search

+6 -1
View File
@@ -4,6 +4,11 @@
import MultiSelect from '$lib/components/input/Switch.svelte'
import Tabs from '$lib/components/ui/layout/pages/Tabs.svelte'
import { contentPadding } from '$lib/components/ui/layout/Shell.svelte'
interface Props {
children?: import('svelte').Snippet;
}
let { children }: Props = $props();
</script>
<div class="flex flex-col gap-2">
@@ -42,5 +47,5 @@
currentRoute={$page.url.toString()}
/>
</div>
<slot />
{@render children?.()}
</div>
+3 -3
View File
@@ -2,9 +2,9 @@
import { isImage, isVideo } from '$lib/ui/image.js'
import { TextInput } from 'mono-svelte'
let imageInput = ''
$: inputIsImage = isImage(imageInput)
$: inputIsVideo = isVideo(imageInput)
let imageInput = $state('')
let inputIsImage = $derived(isImage(imageInput))
let inputIsVideo = $derived(isVideo(imageInput))
</script>
<h1 class="font-bold text-2xl">Functions</h1>
+7 -2
View File
@@ -1,10 +1,15 @@
<script lang="ts">
import { run } from 'svelte/legacy';
import { photonify } from '$lib/components/markdown/renderers/plugins'
import { TextInput } from 'mono-svelte'
let link = ''
let link = $state('')
$: photonified = photonify(link)
let photonified;
run(() => {
photonified = photonify(link)
});
</script>
<h1 class="font-bold text-2xl">Photonify links</h1>
+3 -3
View File
@@ -2,9 +2,9 @@
import { placeholders } from '$lib/util.js'
import { Button } from 'mono-svelte'
let post = placeholders.get('post')
let comment = placeholders.get('comment')
let url = placeholders.get('url')
let post = $state(placeholders.get('post'))
let comment = $state(placeholders.get('comment'))
let url = $state(placeholders.get('url'))
</script>
<h1 class="font-bold text-2xl">Placeholders</h1>