mirror of
https://github.com/penpot/penpot.git
synced 2025-05-10 18:36:38 +02:00
✨ Enhance dump-tree debug command and add dump-subtree
This commit is contained in:
parent
8b801b65f6
commit
f8e1a15907
4 changed files with 294 additions and 107 deletions
|
@ -303,16 +303,36 @@
|
|||
([state show-ids show-touched] (dump-tree' state show-ids show-touched false))
|
||||
([state show-ids show-touched show-modified]
|
||||
(let [page-id (get state :current-page-id)
|
||||
file-data (get state :workspace-data)
|
||||
file (assoc (get state :workspace-file)
|
||||
:data (get state :workspace-data))
|
||||
libraries (get state :workspace-libraries)]
|
||||
(ctf/dump-tree file-data page-id libraries show-ids show-touched show-modified))))
|
||||
|
||||
(ctf/dump-tree file page-id libraries {:show-ids show-ids
|
||||
:show-touched show-touched
|
||||
:show-modified show-modified}))))
|
||||
(defn ^:export dump-tree
|
||||
([] (dump-tree' @st/state))
|
||||
([show-ids] (dump-tree' @st/state show-ids false false))
|
||||
([show-ids show-touched] (dump-tree' @st/state show-ids show-touched false))
|
||||
([show-ids show-touched show-modified] (dump-tree' @st/state show-ids show-touched show-modified)))
|
||||
|
||||
(defn ^:export dump-subtree'
|
||||
([state shape-id] (dump-subtree' state shape-id false false false))
|
||||
([state shape-id show-ids] (dump-subtree' state shape-id show-ids false false))
|
||||
([state shape-id show-ids show-touched] (dump-subtree' state shape-id show-ids show-touched false))
|
||||
([state shape-id show-ids show-touched show-modified]
|
||||
(let [page-id (get state :current-page-id)
|
||||
file (assoc (get state :workspace-file)
|
||||
:data (get state :workspace-data))
|
||||
libraries (get state :workspace-libraries)]
|
||||
(ctf/dump-subtree file page-id shape-id libraries {:show-ids show-ids
|
||||
:show-touched show-touched
|
||||
:show-modified show-modified}))))
|
||||
(defn ^:export dump-subtree
|
||||
([shape-id] (dump-subtree' @st/state (uuid/uuid shape-id)))
|
||||
([shape-id show-ids] (dump-subtree' @st/state (uuid/uuid 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 show-modified] (dump-subtree' @st/state (uuid/uuid shape-id) show-ids show-touched show-modified)))
|
||||
|
||||
(when *assert*
|
||||
(defonce debug-subscription
|
||||
(->> st/stream
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue