enhance(ux): management for the property shortcuts in the global shortcuts module

This commit is contained in:
charlie
2024-07-04 18:14:58 +08:00
parent a8e7e45170
commit d4e8f1d90c
8 changed files with 47 additions and 39 deletions

View File

@@ -888,18 +888,7 @@
util/node-test?
(state/editing?))))
(state/close-modal!)
(hide-context-menu-and-clear-selection e))
(and
(not (or (.-ctrlKey e) (.-metaKey e) (.-altKey e)))
(not (util/input? (.-target e)))
(not (seq @jump-handler/*jump-data))
(not @(:editor/latest-shortcut @state/state))
(not (state/editing?))
(seq (state/get-selection-blocks)))
(let [shift? (.-shiftKey e)
shortcut (if shift? (str "shift+" (.-key e)) (.-key e))]
(db-property-handler/set-property-by-shortcut! shortcut)))
(hide-context-menu-and-clear-selection e)))
(state/set-ui-last-key-code! (.-key e))))
(mixins/listen state js/window "keyup"
(fn [_e]