diff --git a/examples/svelte/package.json b/examples/svelte/package.json index 33859262..f1758693 100644 --- a/examples/svelte/package.json +++ b/examples/svelte/package.json @@ -13,9 +13,9 @@ }, "devDependencies": { "@sveltejs/adapter-auto": "^3.3.1", - "@sveltejs/kit": "^2.9.0", - "@typescript-eslint/eslint-plugin": "^8.17.0", - "@typescript-eslint/parser": "^8.17.0", + "@sveltejs/kit": "^2.11.1", + "@typescript-eslint/eslint-plugin": "^8.18.0", + "@typescript-eslint/parser": "^8.18.0", "eslint": "^8.53.0", "eslint-config-prettier": "^9.1.0", "eslint-plugin-svelte": "^2.46.1", @@ -30,7 +30,7 @@ "type": "module", "dependencies": { "@dagrejs/dagre": "^1.1.4", - "@sveltejs/vite-plugin-svelte": "^5.0.1", + "@sveltejs/vite-plugin-svelte": "^5.0.2", "@xyflow/svelte": "workspace:^" } } diff --git a/examples/svelte/src/routes/examples/add-node-on-drop/Flow.svelte b/examples/svelte/src/routes/examples/add-node-on-drop/Flow.svelte index 2f5378c2..5ba734b1 100644 --- a/examples/svelte/src/routes/examples/add-node-on-drop/Flow.svelte +++ b/examples/svelte/src/routes/examples/add-node-on-drop/Flow.svelte @@ -1,6 +1,8 @@ diff --git a/examples/svelte/src/routes/examples/color-mode/+page.svelte b/examples/svelte/src/routes/examples/color-mode/+page.svelte index e23c4d25..8d66d2d3 100644 --- a/examples/svelte/src/routes/examples/color-mode/+page.svelte +++ b/examples/svelte/src/routes/examples/color-mode/+page.svelte @@ -35,18 +35,18 @@ { id: 'A-D', source: 'A', target: 'D' } ]); - let colorMode: ColorMode = $state('dark'); + let colorMode: ColorMode = $state('system'); - + diff --git a/examples/svelte/src/routes/examples/custom-connection-line/ConnectionLine.svelte b/examples/svelte/src/routes/examples/custom-connection-line/ConnectionLine.svelte index 7782903b..5c48f62d 100644 --- a/examples/svelte/src/routes/examples/custom-connection-line/ConnectionLine.svelte +++ b/examples/svelte/src/routes/examples/custom-connection-line/ConnectionLine.svelte @@ -1,11 +1,11 @@ -{#if connection.inProgress} - +{#if connection.current.inProgress} + {/if} diff --git a/examples/svelte/src/routes/examples/dagre/+page.svelte b/examples/svelte/src/routes/examples/dagre/+page.svelte index 88470acc..78b14060 100644 --- a/examples/svelte/src/routes/examples/dagre/+page.svelte +++ b/examples/svelte/src/routes/examples/dagre/+page.svelte @@ -1,5 +1,4 @@ - import { writable } from 'svelte/store'; import { SvelteFlow, Controls, @@ -21,7 +20,7 @@ const onMove = (e: any) => console.log('move', e); const onMoveEnd = (e: any) => console.log('move end', e); - const nodes = writable([ + let nodes = $state.raw([ { id: '1', type: 'input', @@ -34,15 +33,15 @@ { id: '4', data: { label: 'Node 4' }, position: { x: 400, y: 200 }, className: 'light' } ]); - const edges = writable([ + let edges = $state.raw([ { id: 'e1-2', source: '1', target: '2', animated: true }, { id: 'e1-3', source: '1', target: '3' } ]); - import { writable } from 'svelte/store'; import { SvelteFlow, Controls, @@ -20,7 +19,7 @@ multi: MultiHandleNode }; - const nodes = writable([ + let nodes = $state.raw([ { id: '1', type: 'single', @@ -60,7 +59,7 @@ } ]); - const edges = writable([ + let edges = $state.raw([ { id: 'e1-2', source: '1', @@ -87,7 +86,7 @@ ]); - + diff --git a/examples/svelte/src/routes/examples/handle-connect/MultiHandleNode.svelte b/examples/svelte/src/routes/examples/handle-connect/MultiHandleNode.svelte index aa4842ee..48ab2bd0 100644 --- a/examples/svelte/src/routes/examples/handle-connect/MultiHandleNode.svelte +++ b/examples/svelte/src/routes/examples/handle-connect/MultiHandleNode.svelte @@ -27,7 +27,7 @@ const connections = useHandleConnections({ nodeId: id, type: 'target' }); - $inspect('connections', $connections); + $inspect(connections.current);
diff --git a/packages/svelte/package.json b/packages/svelte/package.json index 96774fd0..2c2c9742 100644 --- a/packages/svelte/package.json +++ b/packages/svelte/package.json @@ -56,11 +56,11 @@ }, "devDependencies": { "@sveltejs/adapter-auto": "^3.3.1", - "@sveltejs/kit": "^2.9.0", + "@sveltejs/kit": "^2.11.1", "@sveltejs/package": "^2.3.7", - "@sveltejs/vite-plugin-svelte": "^5.0.1", - "@typescript-eslint/eslint-plugin": "^8.17.0", - "@typescript-eslint/parser": "^8.17.0", + "@sveltejs/vite-plugin-svelte": "^5.0.2", + "@typescript-eslint/eslint-plugin": "^8.18.0", + "@typescript-eslint/parser": "^8.18.0", "autoprefixer": "^10.4.20", "cssnano": "^7.0.6", "dotenv": "^16.4.7", diff --git a/packages/svelte/src/lib/components/KeyHandler/KeyHandler.svelte b/packages/svelte/src/lib/components/KeyHandler/KeyHandler.svelte index 0b43df3c..f757ea7d 100644 --- a/packages/svelte/src/lib/components/KeyHandler/KeyHandler.svelte +++ b/packages/svelte/src/lib/components/KeyHandler/KeyHandler.svelte @@ -1,5 +1,4 @@ - -{#if store.adoptNodes && store.adoptEdges} -
+ + - - - - - - -
-
- - -
- -
-
- - {@render children?.()} -
-{/if} + + + + +
+
+ + +
+ +
+ + + {@render children?.()} +