feat: switch to use Excalidraw api

This commit is contained in:
Tienson Qin
2021-03-09 23:24:45 +08:00
parent 76b33f2d8f
commit 92ad0296e6
24 changed files with 258 additions and 694 deletions

View File

@@ -54,6 +54,7 @@
:ui/sidebar-open? false
:ui/left-sidebar-open? false
:ui/theme (or (storage/get :ui/theme) "dark")
:ui/wide-mode? false
;; :show-all, :hide-block-body, :hide-block-children
:ui/cycle-collapse :show-all
:ui/collapsed-blocks {}
@@ -899,10 +900,13 @@
(set-state! :indexeddb/support? value))
(defn set-modal!
[modal-panel-content]
(swap! state assoc
:modal/show? (boolean modal-panel-content)
:modal/panel-content modal-panel-content))
([modal-panel-content]
(set-modal! modal-panel-content false))
([modal-panel-content fullscreen?]
(swap! state assoc
:modal/show? (boolean modal-panel-content)
:modal/panel-content modal-panel-content
:modal/fullscreen? fullscreen?)))
(defn close-modal!
[]
@@ -992,6 +996,14 @@
[]
(get-in @state [:repo/changed-files (get-current-repo)]))
(defn get-wide-mode?
[]
(:ui/wide-mode? @state))
(defn toggle-wide-mode!
[]
(update-state! :ui/wide-mode? not))
(defn set-online!
[value]
(set-state! :network/online? value))