mirror of
https://github.com/penpot/penpot.git
synced 2025-08-07 14:38:33 +02:00
♻️ Refactor pages namespaces
This commit is contained in:
parent
83519e8513
commit
45882ba6a1
40 changed files with 1354 additions and 1247 deletions
|
@ -13,7 +13,6 @@
|
|||
[beicon.core :as rx]
|
||||
[okulary.core :as l]
|
||||
[app.common.pages :as cp]
|
||||
[app.common.pages-helpers :as cph]
|
||||
[app.common.uuid :as uuid]
|
||||
[app.main.constants :as c]
|
||||
[app.main.store :as st]))
|
||||
|
@ -142,7 +141,7 @@
|
|||
(l/derived :options workspace-page))
|
||||
|
||||
(def workspace-frames
|
||||
(l/derived cph/select-frames workspace-page-objects))
|
||||
(l/derived cp/select-frames workspace-page-objects))
|
||||
|
||||
(defn object-by-id
|
||||
[id]
|
||||
|
@ -162,7 +161,7 @@
|
|||
(let [page-id (:current-page-id state)
|
||||
objects (get-in state [:workspace-data :pages-index page-id :objects])
|
||||
selected (get-in state [:workspace-local :selected])
|
||||
children (cph/get-children id objects)]
|
||||
children (cp/get-children id objects)]
|
||||
(some selected children)))]
|
||||
(l/derived selector st/state)))
|
||||
|
||||
|
@ -181,7 +180,7 @@
|
|||
(let [selected (get-in state [:workspace-local :selected])
|
||||
page-id (:current-page-id state)
|
||||
objects (get-in state [:workspace-data :pages-index page-id :objects])
|
||||
children (mapcat #(cph/get-children % objects) selected)]
|
||||
children (mapcat #(cp/get-children % objects) selected)]
|
||||
(into selected children)))]
|
||||
(l/derived selector st/state =)))
|
||||
|
||||
|
@ -192,7 +191,7 @@
|
|||
(let [selected (get-in state [:workspace-local :selected])
|
||||
page-id (:current-page-id state)
|
||||
objects (get-in state [:workspace-data :pages-index page-id :objects])
|
||||
children (mapcat #(cph/get-children % objects) selected)
|
||||
children (mapcat #(cp/get-children % objects) selected)
|
||||
shapes (into selected children)]
|
||||
(mapv #(get objects %) shapes)))]
|
||||
(l/derived selector st/state =)))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue