Browse Source

enhance: mod+p to add properties quickly

Gabriel Horner 2 years ago
parent
commit
bc1bc6cde1
2 changed files with 8 additions and 2 deletions
  1. 7 2
      src/main/frontend/modules/shortcut/config.cljs
  2. 1 0
      src/resources/dicts/en.edn

+ 7 - 2
src/main/frontend/modules/shortcut/config.cljs

@@ -340,6 +340,9 @@
    :editor/toggle-number-list               {:binding "t n"
    :editor/toggle-number-list               {:binding "t n"
                                              :fn      #(state/pub-event! [:editor/toggle-own-number-list (state/get-selection-block-ids)])}
                                              :fn      #(state/pub-event! [:editor/toggle-own-number-list (state/get-selection-block-ids)])}
 
 
+   :editor/add-property                     {:binding "mod+p"
+                                             :fn      #(state/pub-event! [:editor/new-property])}
+
    :ui/toggle-brackets                      {:binding "mod+c mod+b"
    :ui/toggle-brackets                      {:binding "mod+c mod+b"
                                              :fn      config-handler/toggle-ui-show-brackets!}
                                              :fn      config-handler/toggle-ui-show-brackets!}
 
 
@@ -688,7 +691,8 @@
            :sidebar/open-today-page
            :sidebar/open-today-page
            :sidebar/clear
            :sidebar/clear
            :command/run
            :command/run
-           :command-palette/toggle])
+           :command-palette/toggle
+           :editor/add-property])
         (with-meta {:before m/prevent-default-behavior}))
         (with-meta {:before m/prevent-default-behavior}))
 
 
     :shortcut.handler/global-non-editing-only
     :shortcut.handler/global-non-editing-only
@@ -801,7 +805,8 @@
      :editor/open-link-in-sidebar
      :editor/open-link-in-sidebar
      :editor/move-block-up
      :editor/move-block-up
      :editor/move-block-down
      :editor/move-block-down
-     :editor/escape-editing]
+     :editor/escape-editing
+     :editor/add-property]
 
 
     :shortcut.category/block-command-editing
     :shortcut.category/block-command-editing
     [:editor/backspace
     [:editor/backspace

+ 1 - 0
src/resources/dicts/en.edn

@@ -747,6 +747,7 @@
   :editor/zoom-out                "Zoom out editing block / Backwards otherwise"
   :editor/zoom-out                "Zoom out editing block / Backwards otherwise"
   :editor/toggle-undo-redo-mode   "Toggle undo redo mode (global or page only)"
   :editor/toggle-undo-redo-mode   "Toggle undo redo mode (global or page only)"
   :editor/toggle-number-list      "Toggle number list"
   :editor/toggle-number-list      "Toggle number list"
+  :editor/add-property            "Add property"
   :whiteboard/select              "Select tool"
   :whiteboard/select              "Select tool"
   :whiteboard/pan                 "Pan tool"
   :whiteboard/pan                 "Pan tool"
   :whiteboard/portal              "Portal tool"
   :whiteboard/portal              "Portal tool"