feat: mod+a to select parent up to the whole page (#7803)

mod+a to select parent up to the whole page
This commit is contained in:
Tienson Qin
2022-12-29 22:29:26 +08:00
committed by GitHub
parent 755aeb5d22
commit 1206d54c86
4 changed files with 57 additions and 7 deletions

View File

@@ -145,6 +145,7 @@
;; either :up or :down, defaults to down
;; used to determine selection direction when two or more blocks are selected
:selection/direction :down
:selection/selected-all? false
:custom-context-menu/show? false
:custom-context-menu/links nil
:custom-context-menu/position nil
@@ -633,6 +634,7 @@ Similar to re-frame subscriptions"
(defn- get-selected-block-ids
[blocks]
(->> blocks
(remove nil?)
(keep #(when-let [id (dom/attr % "blockid")]
(uuid id)))
(distinct)))
@@ -966,11 +968,13 @@ Similar to re-frame subscriptions"
:selection/mode false
:selection/blocks nil
:selection/direction :down
:selection/start-block nil))
:selection/start-block nil
:selection/selected-all? false))
(defn get-selection-blocks
[]
(:selection/blocks @state))
(->> (:selection/blocks @state)
(remove nil?)))
(defn get-selection-block-ids
[]