mirror of
https://github.com/penpot/penpot.git
synced 2025-06-28 09:16:59 +02:00
✨ Expose component properties in components
This commit is contained in:
parent
1794859468
commit
7fd223893b
4 changed files with 116 additions and 4 deletions
|
@ -10,6 +10,8 @@
|
|||
[app.common.data :as d]
|
||||
[app.common.data.macros :as dm]
|
||||
[app.common.spec :as us]
|
||||
[app.common.types.container :as ctn]
|
||||
[app.common.types.file :as ctf]
|
||||
[app.common.uuid :as uuid]
|
||||
[app.main.store :as st]
|
||||
[app.util.object :as obj]
|
||||
|
@ -62,6 +64,14 @@
|
|||
(let [{:keys [profile-id]} (locate-presence session-id)]
|
||||
(dm/get-in @st/state [:users profile-id])))
|
||||
|
||||
(defn locate-component
|
||||
[objects shape]
|
||||
(let [current-file-id (:current-file-id @st/state)
|
||||
workspace-data (:workspace-data @st/state)
|
||||
workspace-libraries (:workspace-libraries @st/state)
|
||||
root (ctn/get-instance-root objects shape)]
|
||||
[root (ctf/resolve-component root {:id current-file-id :data workspace-data} workspace-libraries {:include-deleted? true})]))
|
||||
|
||||
(defn proxy->file
|
||||
[proxy]
|
||||
(let [id (obj/get proxy "$id")]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue