diff --git a/package-lock.json b/package-lock.json index 73a1c440..66888cee 100644 --- a/package-lock.json +++ b/package-lock.json @@ -35,6 +35,7 @@ "flexsearch": "^0.7.31", "fontkit": "^2.0.2", "glob": "^10.3.4", + "hotkeys-js": "^3.12.0", "jsdom": "^22.1.0", "npm-run-all": "^4.1.5", "patch-package": "^8.0.0", @@ -6273,6 +6274,12 @@ "node": ">=10" } }, + "node_modules/hotkeys-js": { + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/hotkeys-js/-/hotkeys-js-3.12.0.tgz", + "integrity": "sha512-Z+N573ycUKIGwFYS3ID1RzMJiGmtWMGKMiaNLyJS8B1ei+MllF4ZYmKS2T0kMWBktOz+WZLVNikftEgnukOrXg==", + "dev": true + }, "node_modules/html-encoding-sniffer": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-3.0.0.tgz", diff --git a/package.json b/package.json index 8dbf6d58..f1cb9ead 100644 --- a/package.json +++ b/package.json @@ -55,6 +55,7 @@ "flexsearch": "^0.7.31", "fontkit": "^2.0.2", "glob": "^10.3.4", + "hotkeys-js": "^3.12.0", "jsdom": "^22.1.0", "npm-run-all": "^4.1.5", "patch-package": "^8.0.0", @@ -80,4 +81,4 @@ "vitest": "^0.34.4" }, "type": "module" -} +} \ No newline at end of file diff --git a/src/lib/components/ActionListItem.svelte b/src/lib/components/ActionListItem.svelte index a3ae7949..b9973c8a 100644 --- a/src/lib/components/ActionListItem.svelte +++ b/src/lib/components/ActionListItem.svelte @@ -22,7 +22,7 @@ {key.description} {/if} - {key.icon || key.id || `0x${key.code.toString(16)}`} + {key.icon || key.id || `0x${key.code.toString(16)}`} {:else} 0x{key.toString(16)} {/if} @@ -61,18 +61,4 @@ text-align: start; } - - .key { - display: flex; - align-items: center; - justify-content: center; - - min-width: 32px; - padding: 4px; - - font-weight: 600; - - border: 1px solid currentcolor; - border-radius: 4px; - } diff --git a/src/lib/components/Button.svelte b/src/lib/components/Button.svelte new file mode 100644 index 00000000..e69de29b diff --git a/src/lib/components/Terminal.svelte b/src/lib/components/Terminal.svelte index ed460f30..8c05622c 100644 --- a/src/lib/components/Terminal.svelte +++ b/src/lib/components/Terminal.svelte @@ -16,7 +16,13 @@
{#each $serialLog as { type, value }} -

{value}

+ {#if type === "input"} + {value} + {:else if type === "output"} + {value} + {:else} +

{value}

+ {/if} {/each}
@@ -111,17 +117,15 @@ height: 1px; } + code, + samp, p { + display: block; overflow-anchor: none; margin-block: 0.15rem; } - p.input { - margin-block-end: 0.25rem; - font-weight: bold; - } - - p.system { + p { display: flex; justify-content: center; @@ -134,8 +138,9 @@ border-radius: 8px; } - p.input::before { + code::before { content: "> "; + margin-block-end: 0.25rem; font-weight: 900; color: var(--md-sys-color-primary); } diff --git a/src/lib/components/Tooltip.svelte b/src/lib/components/Tooltip.svelte new file mode 100644 index 00000000..b8153143 --- /dev/null +++ b/src/lib/components/Tooltip.svelte @@ -0,0 +1,22 @@ + + +{#if title} +

{title}

+{/if} + +{#if shortcut} + + {#each shortcut.split("+") as key} + {key} + {/each} + +{/if} + + diff --git a/src/lib/components/layout/ActionSelector.svelte b/src/lib/components/layout/ActionSelector.svelte index de709204..ce3e584b 100644 --- a/src/lib/components/layout/ActionSelector.svelte +++ b/src/lib/components/layout/ActionSelector.svelte @@ -5,6 +5,7 @@ import {createEventDispatcher} from "svelte" import ActionListItem from "$lib/components/ActionListItem.svelte" import LL from "../../../i18n/i18n-svelte" + import {action} from "$lib/title" export let currentAction: number @@ -38,10 +39,6 @@ function keyboardNavigation(event: KeyboardEvent) { if (event.shiftKey && event.key === "Enter") { dispatch("select", exact) - } else if (event.shiftKey && event.key === "Escape") { - dispatch("select", 0) - } else if (event.key === "Escape") { - dispatch("close") } else if (event.key === "ArrowDown") { const element = resultList.querySelector("li:focus-within")?.nextSibling ?? resultList.querySelector("li:not(.exact)") @@ -88,11 +85,14 @@ }} placeholder={$LL.actionSearch.PLACEHOLDER()} /> - select(0)} use:action={{shortcut: "shift+esc"}} + >{$LL.actionSearch.DELETE()} + -