mirror of
https://github.com/penpot/penpot.git
synced 2025-02-14 11:09:04 -05:00
✨ Hide frame titles for component copies
This commit is contained in:
parent
4ddd3811b2
commit
b45bdb52b2
2 changed files with 5 additions and 4 deletions
|
@ -110,7 +110,7 @@
|
||||||
(defn get-frames
|
(defn get-frames
|
||||||
"Retrieves all frame objects as vector"
|
"Retrieves all frame objects as vector"
|
||||||
([objects] (get-frames objects nil))
|
([objects] (get-frames objects nil))
|
||||||
([objects {:keys [skip-components?] :or {skip-components? false}}]
|
([objects {:keys [skip-components? skip-copies?] :or {skip-components? false skip-copies? false}}]
|
||||||
(->> (or (-> objects meta ::index-frames)
|
(->> (or (-> objects meta ::index-frames)
|
||||||
(let [lookup (d/getf objects)
|
(let [lookup (d/getf objects)
|
||||||
xform (comp (remove #(= uuid/zero %))
|
xform (comp (remove #(= uuid/zero %))
|
||||||
|
@ -118,8 +118,8 @@
|
||||||
(filter cph/frame-shape?))]
|
(filter cph/frame-shape?))]
|
||||||
(->> (keys objects)
|
(->> (keys objects)
|
||||||
(into [] xform))))
|
(into [] xform))))
|
||||||
(filter #(or (not skip-components?)
|
(remove #(or (and skip-components? (ctk/instance-root? %))
|
||||||
(not (ctk/instance-root? %)))))))
|
(and skip-copies? (and (ctk/instance-root? %) (not (ctk/main-instance? %)))))))))
|
||||||
|
|
||||||
(defn get-frames-ids
|
(defn get-frames-ids
|
||||||
"Retrieves all frame ids as vector"
|
"Retrieves all frame ids as vector"
|
||||||
|
|
|
@ -176,7 +176,8 @@
|
||||||
on-frame-enter (unchecked-get props "on-frame-enter")
|
on-frame-enter (unchecked-get props "on-frame-enter")
|
||||||
on-frame-leave (unchecked-get props "on-frame-leave")
|
on-frame-leave (unchecked-get props "on-frame-leave")
|
||||||
on-frame-select (unchecked-get props "on-frame-select")
|
on-frame-select (unchecked-get props "on-frame-select")
|
||||||
shapes (ctt/get-frames objects)
|
components-v2 (mf/use-ctx ctx/components-v2)
|
||||||
|
shapes (ctt/get-frames objects {:skip-copies? components-v2})
|
||||||
shapes (if (debug? :shape-titles)
|
shapes (if (debug? :shape-titles)
|
||||||
(into (set shapes)
|
(into (set shapes)
|
||||||
(map (d/getf objects))
|
(map (d/getf objects))
|
||||||
|
|
Loading…
Add table
Reference in a new issue