Compare commits

...
Author SHA1 Message Date
Eva Marco fc55bc2a48 🐛 Fix typography on shortcuts list 2026-08-06 13:41:58 +02:00
Eva Marco eb34e1c118 🐛 Fix delete path node 2026-08-06 13:38:10 +02:00
3 changed files with 30 additions and 16 deletions

No files matched your search

+21 -14
View File
@@ -204,20 +204,27 @@
(defn- bind!
[shortcuts]
(->> shortcuts
(remove #(:disabled (second %)))
(run! (fn [[key {:keys [command fn type overwrite]}]]
(let [callback (wrap-cb key fn)
commands (if (vector? command)
(into-array command)
#js [command])]
(if (vector? type)
(do (mousetrap/bind commands callback (nth type 0) overwrite)
(mousetrap/bind commands callback (nth type 1) overwrite))
(let [undefined (js* "(void 0)")]
(if type
(mousetrap/bind commands callback type overwrite)
(mousetrap/bind commands callback undefined overwrite)))))))))
(let [entries (remove #(:disabled (second %)) shortcuts)
bind-fn (fn [[key {:keys [command fn type overwrite]}]]
(let [callback (wrap-cb key fn)
commands (if (vector? command)
(into-array command)
#js [command])]
(if (vector? type)
(do (mousetrap/bind commands callback (nth type 0) overwrite)
(mousetrap/bind commands callback (nth type 1) overwrite))
(let [undefined (js* "(void 0)")]
(if type
(mousetrap/bind commands callback type overwrite)
(mousetrap/bind commands callback undefined overwrite))))))]
;; Bind non-overwrite entries first so that entries flagged with
;; `:overwrite` are bound last and can reliably splice out the
;; colliding callbacks bound earlier (mousetrap's overwrite only
;; removes callbacks that were already registered for the same
;; combo). Map iteration order is hash-based, so we must force the
;; order explicitly.
(run! bind-fn (remove (comp :overwrite second) entries))
(run! bind-fn (filter (comp :overwrite second) entries))))
(defn- reset!
([]
@@ -37,6 +37,7 @@
:command "p"
:subsections [:path-editor]
:section [:workspace]
:overwrite true
:fn #(st/emit! (drp/change-edit-mode :draw))}
:add-node {:tooltip (ds/shift "+")
@@ -49,7 +50,9 @@
:command ["del" "backspace"]
:subsections [:path-editor]
:section [:workspace]
:fn #(st/emit! (drp/remove-node))}
:overwrite true
:fn #(st/emit!
(drp/remove-node))}
:merge-nodes {:tooltip (ds/meta "J")
:command (ds/c-mod "j")
@@ -67,6 +70,7 @@
:command "k"
:subsections [:path-editor]
:section [:workspace]
:overwrite true
:fn #(st/emit! (drp/separate-nodes))}
:make-corner {:tooltip "X"
@@ -79,6 +83,7 @@
:command "c"
:subsections [:path-editor]
:section [:workspace]
:overwrite true
:fn #(st/emit! (drp/make-curve))}
:snap-nodes {:tooltip (ds/meta "'")
@@ -91,6 +96,7 @@
:escape {:tooltip (ds/esc)
:command ["escape" "enter" "v"]
:section [:workspace]
:overwrite true
:fn #(st/emit! (esc-pressed))}
:undo {:tooltip (ds/meta "Z")
+2 -1
View File
@@ -21,7 +21,7 @@
.section-title,
.subsection-title {
@include t.use-typography("title-small");
@include t.use-typography("headline-small");
display: flex;
align-items: center;
@@ -43,6 +43,7 @@
}
.subsection-title {
block-size: $sz-32;
text-transform: none;
padding-inline-start: var(--sp-m);
}