ux: cmd+k to create page/block shapes

This commit is contained in:
Tienson Qin
2022-05-17 18:07:34 +08:00
parent b48b6ba0df
commit 45ea8de1d1
4 changed files with 73 additions and 28 deletions

View File

@@ -0,0 +1,15 @@
(ns frontend.handler.whiteboard
(:require [frontend.state :as state]))
;; FIXME: embed /draw should be supported too
(defn whiteboard-mode?
[]
(= (state/get-current-route) :whiteboard))
(defn create-page!
[page-title]
(when-let [app ^js (state/get-current-whiteboard)]
(.createShapes app (clj->js
[{:id (str "logseq-portal-" "clojure")
:type "logseq-portal"
:pageId page-title}]))))