Expose component properties in components

This commit is contained in:
alonso.torres 2024-06-20 13:16:23 +02:00
parent 1794859468
commit 7fd223893b
4 changed files with 116 additions and 4 deletions

View file

@ -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")]