From e5759748729a4aaefcaaeba7a77088c05976b122 Mon Sep 17 00:00:00 2001 From: Max Richter Date: Fri, 19 Apr 2024 21:51:07 +0200 Subject: [PATCH] feat: add shortcut viewer --- app/src/lib/graph-interface/edges/Edge.svelte | 20 ++- .../lib/graph-interface/graph/Graph.svelte | 133 +++++++++++------- app/src/lib/graph-interface/graph/stores.ts | 7 + .../graph-interface/node/NodeHeader.svelte | 8 +- .../graph-interface/node/NodeParameter.svelte | 8 +- app/src/lib/helpers/createKeyMap.ts | 43 ++++++ app/src/lib/settings/Keymap.svelte | 73 +++++++++- app/src/lib/settings/NestedSettings.svelte | 1 - app/src/routes/+page.svelte | 6 + 9 files changed, 232 insertions(+), 67 deletions(-) create mode 100644 app/src/lib/helpers/createKeyMap.ts diff --git a/app/src/lib/graph-interface/edges/Edge.svelte b/app/src/lib/graph-interface/edges/Edge.svelte index b804885..5b80f6c 100644 --- a/app/src/lib/graph-interface/edges/Edge.svelte +++ b/app/src/lib/graph-interface/edges/Edge.svelte @@ -20,7 +20,7 @@ - + - + {#if geometry} - + {/if} diff --git a/app/src/lib/graph-interface/graph/Graph.svelte b/app/src/lib/graph-interface/graph/Graph.svelte index c638b8e..dcde950 100644 --- a/app/src/lib/graph-interface/graph/Graph.svelte +++ b/app/src/lib/graph-interface/graph/Graph.svelte @@ -1,16 +1,10 @@ -duuude +
+

Editor

+ +
+ {#each $keys as key} + {#if key.description} +
+
+ {#if key.ctrl} + Ctrl + {/if} + {#if key.shift} + Shift + {/if} + {#if key.alt} + Alt + {/if} + {key.key} +
+
+

{key.description}

+ {/if} + {/each} +
+
+ + diff --git a/app/src/lib/settings/NestedSettings.svelte b/app/src/lib/settings/NestedSettings.svelte index 4afb3cb..dc88dc0 100644 --- a/app/src/lib/settings/NestedSettings.svelte +++ b/app/src/lib/settings/NestedSettings.svelte @@ -53,7 +53,6 @@ } details { padding: 1rem; - min-height: 69px; box-sizing: border-box; border-bottom: solid thin var(--outline); } diff --git a/app/src/routes/+page.svelte b/app/src/routes/+page.svelte index ed73fb5..0772a06 100644 --- a/app/src/routes/+page.svelte +++ b/app/src/routes/+page.svelte @@ -10,6 +10,8 @@ import { AppSettings, AppSettingTypes } from "$lib/settings/app-settings"; import { get, writable, type Writable } from "svelte/store"; import Keymap from "$lib/settings/Keymap.svelte"; + import { createKeyMap } from "$lib/helpers/createKeyMap"; + import { setContext } from "svelte"; const nodeRegistry = new RemoteNodeRegistry("http://localhost:3001"); const runtimeExecutor = new MemoryRuntimeExecutor(nodeRegistry); @@ -30,6 +32,10 @@ localStorage.setItem("graph", JSON.stringify(event.detail)); } + const keyMap = createKeyMap([]); + + setContext("keymap", keyMap); + let settings: Record = { general: { id: "general",