chore(web): migration svelte 5 syntax (#13883)

This commit is contained in:
Alex
2024-11-14 08:43:25 -06:00
committed by GitHub
parent 9203a61709
commit 0b3742cf13
310 changed files with 6435 additions and 4176 deletions
+11 -3
View File
@@ -1,13 +1,21 @@
<script lang="ts">
import { run } from 'svelte/legacy';
import UploadCover from '$lib/components/shared-components/drag-and-drop-upload-overlay.svelte';
import { page } from '$app/stores';
import { assetViewingStore } from '$lib/stores/asset-viewing.store';
import type { Snippet } from 'svelte';
interface Props {
children?: Snippet;
}
let { children }: Props = $props();
let { isViewing: showAssetViewer, setAsset, gridScrollTarget } = assetViewingStore;
// $page.data.asset is loaded by route specific +page.ts loaders if that
// route contains the assetId path.
$: {
run(() => {
if ($page.data.asset) {
setAsset($page.data.asset);
} else {
@@ -15,11 +23,11 @@
}
const asset = $page.url.searchParams.get('at');
$gridScrollTarget = { at: asset };
}
});
</script>
<div class:display-none={$showAssetViewer}>
<slot />
{@render children?.()}
</div>
<UploadCover />