diff --git a/common/src/app/common/types/shape_tree.cljc b/common/src/app/common/types/shape_tree.cljc index 03fa81edb..bc219b0fb 100644 --- a/common/src/app/common/types/shape_tree.cljc +++ b/common/src/app/common/types/shape_tree.cljc @@ -110,7 +110,7 @@ (defn get-frames "Retrieves all frame objects as vector" ([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) (let [lookup (d/getf objects) xform (comp (remove #(= uuid/zero %)) @@ -118,8 +118,8 @@ (filter cph/frame-shape?))] (->> (keys objects) (into [] xform)))) - (filter #(or (not skip-components?) - (not (ctk/instance-root? %))))))) + (remove #(or (and skip-components? (ctk/instance-root? %)) + (and skip-copies? (and (ctk/instance-root? %) (not (ctk/main-instance? %))))))))) (defn get-frames-ids "Retrieves all frame ids as vector" diff --git a/frontend/src/app/main/ui/workspace/viewport/widgets.cljs b/frontend/src/app/main/ui/workspace/viewport/widgets.cljs index 4503911c6..7a92d2c29 100644 --- a/frontend/src/app/main/ui/workspace/viewport/widgets.cljs +++ b/frontend/src/app/main/ui/workspace/viewport/widgets.cljs @@ -176,7 +176,8 @@ on-frame-enter (unchecked-get props "on-frame-enter") on-frame-leave (unchecked-get props "on-frame-leave") 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) (into (set shapes) (map (d/getf objects))