|
1 | 1 | <script lang="ts">
|
2 |
| - import {Background, type ColorMode, Controls, MiniMap, SvelteFlow} from "@xyflow/svelte"; |
3 |
| - import '@xyflow/svelte/dist/style.css'; |
4 |
| - import {writable} from "svelte/store"; |
5 |
| - import Navbar from "@/components/Navbar.svelte"; |
6 |
| - import {Toaster} from "$lib/components/ui/sonner"; |
7 |
| - import {toast} from "svelte-sonner"; |
8 |
| - import {on} from "svelte/events"; |
| 2 | + import "@xyflow/svelte/dist/style.css"; |
| 3 | + import { Toaster } from "$lib/components/ui/sonner"; |
| 4 | + import { toast } from "svelte-sonner"; |
| 5 | + import { on } from "svelte/events"; |
| 6 | + import { ModeWatcher } from "mode-watcher"; |
| 7 | + import Navbar from "$/components/navbar/Navbar.svelte"; |
| 8 | + import Sidebar from "$/components/sidebar/Sidebar.svelte"; |
| 9 | + import BreakdownFlow from "$/components/flow/BreakdownFlow.svelte"; |
9 | 10 |
|
10 |
| - let colorMode: ColorMode = 'dark'; |
11 |
| - const nodes = writable([]); |
12 |
| - const edges = writable([]); |
| 11 | + $effect(() => { |
| 12 | + on(document, "keydown", (event: KeyboardEvent) => { |
| 13 | + event.preventDefault(); |
13 | 14 |
|
14 |
| - $effect(() => { |
15 |
| - on(document, 'keydown', (event: KeyboardEvent) => { |
16 |
| - event.preventDefault() |
| 15 | + if (event.ctrlKey && event.key === "s") { |
| 16 | + toast("Saved"); |
| 17 | + } |
| 18 | + }); |
| 19 | + }); |
17 | 20 |
|
18 |
| - if (event.ctrlKey && event.key === "s") { |
19 |
| - toast("Saved") |
20 |
| - } |
21 |
| - }) |
22 |
| - }) |
23 |
| -
|
24 |
| - $effect(() => { |
25 |
| - // setInterval(() => { |
26 |
| - // toast("Saved") |
27 |
| - // }, 5000) |
28 |
| - }) |
| 21 | + $effect(() => { |
| 22 | + // setInterval(() => { |
| 23 | + // toast("Saved") |
| 24 | + // }, 5000) |
| 25 | + }); |
29 | 26 |
|
30 | 27 | </script>
|
31 | 28 |
|
32 |
| -<main class="h-[100vh]"> |
33 |
| - <Navbar/> |
34 |
| - <SvelteFlow {nodes} {edges} fitView> |
35 |
| - <Background/> |
36 |
| - <Controls/> |
37 |
| - <MiniMap/> |
38 |
| - </SvelteFlow> |
39 |
| - <Toaster/> |
| 29 | +<ModeWatcher /> |
| 30 | +<Navbar /> |
| 31 | +<main class="flex h-[95vh]"> |
| 32 | + <Sidebar /> |
| 33 | + <BreakdownFlow /> |
| 34 | + <Toaster /> |
40 | 35 | </main>
|
| 36 | + |
0 commit comments