mirror of
https://github.com/penpot/penpot.git
synced 2025-05-10 08:56:37 +02:00
💄 Rename "master" to "main" in components
This commit is contained in:
parent
a1e75c6e03
commit
1e25e543b3
9 changed files with 140 additions and 140 deletions
|
@ -33,7 +33,7 @@
|
|||
(let [shape1 (thp/get-shape new-state :shape1)
|
||||
|
||||
[[group shape1] [c-group c-shape1] component]
|
||||
(thl/resolve-instance-and-master
|
||||
(thl/resolve-instance-and-main
|
||||
new-state
|
||||
(:parent-id shape1))
|
||||
|
||||
|
@ -79,7 +79,7 @@
|
|||
[[group shape1 shape2]
|
||||
[c-group c-shape1 c-shape2]
|
||||
component]
|
||||
(thl/resolve-instance-and-master
|
||||
(thl/resolve-instance-and-main
|
||||
new-state
|
||||
(:parent-id shape1))
|
||||
|
||||
|
@ -129,7 +129,7 @@
|
|||
(let [[[group shape1 shape2]
|
||||
[c-group c-shape1 c-shape2]
|
||||
component]
|
||||
(thl/resolve-instance-and-master
|
||||
(thl/resolve-instance-and-main
|
||||
new-state
|
||||
(thp/id :group1))
|
||||
|
||||
|
@ -221,7 +221,7 @@
|
|||
[[instance1 shape1]
|
||||
[c-instance1 c-shape1]
|
||||
component1]
|
||||
(thl/resolve-instance-and-master
|
||||
(thl/resolve-instance-and-main
|
||||
new-state
|
||||
(:id instance1))
|
||||
|
||||
|
@ -314,7 +314,7 @@
|
|||
[[instance2 shape2]
|
||||
[c-instance2 c-shape2]
|
||||
component]
|
||||
(thl/resolve-instance-and-master
|
||||
(thl/resolve-instance-and-main
|
||||
new-state
|
||||
new-instance-id)]
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@
|
|||
(let [shape1 (thp/get-shape new-state :shape1)
|
||||
|
||||
[[group shape1] [c-group c-shape1] component]
|
||||
(thl/resolve-instance-and-master
|
||||
(thl/resolve-instance-and-main
|
||||
new-state
|
||||
(:id instance1))
|
||||
|
||||
|
@ -98,7 +98,7 @@
|
|||
(let [shape1 (thp/get-shape new-state :shape1)
|
||||
|
||||
[[group shape1] [c-group c-shape1] component]
|
||||
(thl/resolve-instance-and-master
|
||||
(thl/resolve-instance-and-main
|
||||
new-state
|
||||
(:id instance1))
|
||||
|
||||
|
|
|
@ -79,7 +79,7 @@
|
|||
|
||||
shapes-inst))
|
||||
|
||||
(defn resolve-instance-and-master
|
||||
(defn resolve-instance-and-main
|
||||
[state root-inst-id]
|
||||
(let [page (thp/current-page state)
|
||||
root-inst (cph/get-shape page root-inst-id)
|
||||
|
@ -94,26 +94,26 @@
|
|||
shapes-inst (cph/get-object-with-children
|
||||
root-inst-id
|
||||
(:objects page))
|
||||
shapes-master (cph/get-object-with-children
|
||||
shapes-main (cph/get-object-with-children
|
||||
(:shape-ref root-inst)
|
||||
(:objects component))
|
||||
|
||||
unique-refs (into #{} (map :shape-ref shapes-inst))
|
||||
|
||||
master-exists? (fn [shape]
|
||||
(t/is (some #(= (:id %) (:shape-ref shape))
|
||||
shapes-master)))]
|
||||
main-exists? (fn [shape]
|
||||
(t/is (some #(= (:id %) (:shape-ref shape))
|
||||
shapes-main)))]
|
||||
|
||||
;; Validate that the instance tree is well constructed
|
||||
(t/is (is-instance-root (first shapes-inst)))
|
||||
(run! is-instance-child (rest shapes-inst))
|
||||
(run! is-noninstance shapes-master)
|
||||
(run! is-noninstance shapes-main)
|
||||
(t/is (= (count shapes-inst)
|
||||
(count shapes-master)
|
||||
(count shapes-main)
|
||||
(count unique-refs)))
|
||||
(run! master-exists? shapes-inst)
|
||||
(run! main-exists? shapes-inst)
|
||||
|
||||
[shapes-inst shapes-master component]))
|
||||
[shapes-inst shapes-main component]))
|
||||
|
||||
(defn resolve-component
|
||||
[state component-id]
|
||||
|
@ -126,14 +126,14 @@
|
|||
file
|
||||
nil)
|
||||
|
||||
root-master (cph/get-component-root
|
||||
component)
|
||||
shapes-master (cph/get-object-with-children
|
||||
(:id root-master)
|
||||
(:objects component))]
|
||||
root-main (cph/get-component-root
|
||||
component)
|
||||
shapes-main (cph/get-object-with-children
|
||||
(:id root-main)
|
||||
(:objects component))]
|
||||
|
||||
;; Validate that the component tree is well constructed
|
||||
(run! is-noninstance shapes-master)
|
||||
(run! is-noninstance shapes-main)
|
||||
|
||||
[shapes-master component]))
|
||||
[shapes-main component]))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue