feat: update sidebar to svelte-5
All checks were successful
Deploy to GitHub Pages / build_site (push) Successful in 2m1s

This commit is contained in:
Max Richter
2026-01-18 18:39:02 +01:00
parent 8a540522dd
commit 80d3e117b4
8 changed files with 123 additions and 120 deletions

View File

@@ -1,12 +1,16 @@
<script lang="ts">
import { getContext } from "svelte";
import { getContext, type Snippet } from "svelte";
let index = -1;
let index = $state(-1);
let wrapper: HTMLDivElement;
$: if (index === -1) {
index = getContext<() => number>("registerCell")();
}
const { children } = $props<{ children?: Snippet }>();
$effect(() => {
if (index === -1) {
index = getContext<() => number>("registerCell")();
}
});
const sizes = getContext<{ value: string[] }>("sizes");
@@ -31,8 +35,8 @@
</script>
<svelte:window
on:mouseup={() => (mouseDown = false)}
on:mousemove={handleMouseMove}
onmouseup={() => (mouseDown = false)}
onmousemove={handleMouseMove}
/>
{#if index > 0}
@@ -40,12 +44,12 @@
class="seperator"
role="button"
tabindex="0"
on:mousedown={handleMouseDown}
onmousedown={handleMouseDown}
></div>
{/if}
<div class="cell" bind:this={wrapper}>
<slot />
{@render children?.()}
</div>
<style>