mirror of
https://github.com/penpot/penpot.git
synced 2025-01-10 08:50:57 -05:00
🔧 Improve debug utility
This commit is contained in:
parent
7a05580df3
commit
b5477c4e30
1 changed files with 16 additions and 8 deletions
|
@ -277,15 +277,23 @@
|
||||||
(let [page-id (get state :current-page-id)
|
(let [page-id (get state :current-page-id)
|
||||||
file (assoc (get state :workspace-file)
|
file (assoc (get state :workspace-file)
|
||||||
:data (get state :workspace-data))
|
:data (get state :workspace-data))
|
||||||
libraries (get state :workspace-libraries)]
|
libraries (get state :workspace-libraries)
|
||||||
(ctf/dump-subtree file page-id shape-id libraries {:show-ids show-ids
|
shape-id (if (some? shape-id)
|
||||||
:show-touched show-touched
|
(uuid/uuid shape-id)
|
||||||
:show-modified show-modified}))))
|
(let [objects (get-in state [:workspace-data :pages-index page-id :objects])
|
||||||
|
selected (get-in state [:workspace-local :selected])]
|
||||||
|
(->> selected (map (d/getf objects)) first :id)))]
|
||||||
|
(if (some? shape-id)
|
||||||
|
(ctf/dump-subtree file page-id shape-id libraries {:show-ids show-ids
|
||||||
|
:show-touched show-touched
|
||||||
|
:show-modified show-modified})
|
||||||
|
(println "no selected shape")))))
|
||||||
|
|
||||||
(defn ^:export dump-subtree
|
(defn ^:export dump-subtree
|
||||||
([shape-id] (dump-subtree' @st/state (uuid/uuid shape-id)))
|
([shape-id] (dump-subtree' @st/state shape-id))
|
||||||
([shape-id show-ids] (dump-subtree' @st/state (uuid/uuid shape-id) show-ids false false))
|
([shape-id show-ids] (dump-subtree' @st/state shape-id show-ids false false))
|
||||||
([shape-id show-ids show-touched] (dump-subtree' @st/state (uuid/uuid shape-id) show-ids show-touched false))
|
([shape-id show-ids show-touched] (dump-subtree' @st/state shape-id show-ids show-touched false))
|
||||||
([shape-id show-ids show-touched show-modified] (dump-subtree' @st/state (uuid/uuid shape-id) show-ids show-touched show-modified)))
|
([shape-id show-ids show-touched show-modified] (dump-subtree' @st/state shape-id show-ids show-touched show-modified)))
|
||||||
|
|
||||||
(when *assert*
|
(when *assert*
|
||||||
(defonce debug-subscription
|
(defonce debug-subscription
|
||||||
|
|
Loading…
Reference in a new issue