fix astro example, fix svelte SSR, fix portals

This commit is contained in:
peterkogo
2025-06-10 20:44:14 +02:00
parent fee63db286
commit d1f8924b40
14 changed files with 2093 additions and 1907 deletions
@@ -1,11 +1,10 @@
<script lang="ts">
import { writable } from 'svelte/store';
import { SvelteFlow, Controls, Background, BackgroundVariant, type Node, type Edge } from '@xyflow/svelte';
import '@xyflow/svelte/dist/style.css';
import CustomNode from './CustomNode.svelte';
const nodes = writable<Node[]>([
let nodes = $state.raw<Node[]>([
{
id: '1',
position: { x: 0, y: 0 },
@@ -24,7 +23,7 @@
},
]);
const edges = writable<Edge[]>([{ id: '1-2', source: '1', target: '2' }]);
let edges = $state.raw<Edge[]>([{ id: '1-2', source: '1', target: '2' }]);
const nodeTypes = {
'input-node': CustomNode,
@@ -32,7 +31,7 @@
</script>
<div style="height: 400px; width: 700px;">
<SvelteFlow {nodes} {edges} {nodeTypes} fitView width={700} height={400}>
<SvelteFlow bind:nodes bind:edges {nodeTypes} fitView width={700} height={400}>
<Controls />
<Background variant={BackgroundVariant.Dots} />
</SvelteFlow>