mirror of
https://github.com/penpot/penpot.git
synced 2025-02-13 10:38:13 -05:00
Merge remote-tracking branch 'origin/staging'
This commit is contained in:
commit
9adfaae6bc
5 changed files with 7 additions and 11 deletions
|
@ -509,6 +509,7 @@
|
||||||
(every? nil?)))]
|
(every? nil?)))]
|
||||||
(or
|
(or
|
||||||
;;We don't want to change the structure of component copies
|
;;We don't want to change the structure of component copies
|
||||||
|
(ctk/in-component-copy? parent)
|
||||||
(has-any-copy-parent? objects parent)
|
(has-any-copy-parent? objects parent)
|
||||||
;; If we are moving something containing a main instance the container can't be part of a component (neither main nor copy)
|
;; If we are moving something containing a main instance the container can't be part of a component (neither main nor copy)
|
||||||
(and selected-main-instance? parent-in-component?)
|
(and selected-main-instance? parent-in-component?)
|
||||||
|
|
|
@ -387,7 +387,7 @@
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|
||||||
(defn update-shape-flags
|
(defn update-shape-flags
|
||||||
[ids {:keys [blocked hidden transforming undo-group] :as flags}]
|
[ids {:keys [blocked hidden undo-group] :as flags}]
|
||||||
(dm/assert!
|
(dm/assert!
|
||||||
"expected valid coll of uuids"
|
"expected valid coll of uuids"
|
||||||
(every? uuid? ids))
|
(every? uuid? ids))
|
||||||
|
@ -403,15 +403,14 @@
|
||||||
(fn [obj]
|
(fn [obj]
|
||||||
(cond-> obj
|
(cond-> obj
|
||||||
(boolean? blocked) (assoc :blocked blocked)
|
(boolean? blocked) (assoc :blocked blocked)
|
||||||
(boolean? hidden) (assoc :hidden hidden)
|
(boolean? hidden) (assoc :hidden hidden)))
|
||||||
(boolean? transforming) (assoc :transforming transforming)))
|
|
||||||
objects (wsh/lookup-page-objects state)
|
objects (wsh/lookup-page-objects state)
|
||||||
;; We have change only the hidden behaviour, to hide only the
|
;; We have change only the hidden behaviour, to hide only the
|
||||||
;; selected shape, block behaviour remains the same.
|
;; selected shape, block behaviour remains the same.
|
||||||
ids (if (boolean? blocked)
|
ids (if (boolean? blocked)
|
||||||
(into ids (->> ids (mapcat #(cfh/get-children-ids objects %))))
|
(into ids (->> ids (mapcat #(cfh/get-children-ids objects %))))
|
||||||
ids)]
|
ids)]
|
||||||
(rx/of (dch/update-shapes ids update-fn {:attrs #{:blocked :hidden :transforming} :undo-group undo-group}))))))
|
(rx/of (dch/update-shapes ids update-fn {:attrs #{:blocked :hidden} :undo-group undo-group}))))))
|
||||||
|
|
||||||
(defn toggle-visibility-selected
|
(defn toggle-visibility-selected
|
||||||
[]
|
[]
|
||||||
|
|
|
@ -28,7 +28,6 @@
|
||||||
[app.main.data.workspace.collapse :as dwc]
|
[app.main.data.workspace.collapse :as dwc]
|
||||||
[app.main.data.workspace.modifiers :as dwm]
|
[app.main.data.workspace.modifiers :as dwm]
|
||||||
[app.main.data.workspace.selection :as dws]
|
[app.main.data.workspace.selection :as dws]
|
||||||
[app.main.data.workspace.shapes :as dwsh]
|
|
||||||
[app.main.data.workspace.state-helpers :as wsh]
|
[app.main.data.workspace.state-helpers :as wsh]
|
||||||
[app.main.data.workspace.undo :as dwu]
|
[app.main.data.workspace.undo :as dwu]
|
||||||
[app.main.snap :as snap]
|
[app.main.snap :as snap]
|
||||||
|
@ -291,10 +290,10 @@
|
||||||
ptk/WatchEvent
|
ptk/WatchEvent
|
||||||
(watch [_ _ stream]
|
(watch [_ _ stream]
|
||||||
(rx/concat
|
(rx/concat
|
||||||
(rx/of (dwsh/update-shape-flags ids {:transforming true}))
|
(rx/of #(assoc-in % [:workspace-local :transform] :move))
|
||||||
(->> (rx/timer 1000)
|
(->> (rx/timer 1000)
|
||||||
(rx/map (fn []
|
(rx/map (fn []
|
||||||
(dwsh/update-shape-flags ids {:transforming false})))
|
#(assoc-in % [:workspace-local :transform] nil)))
|
||||||
(rx/take-until
|
(rx/take-until
|
||||||
(rx/filter (ptk/type? ::trigger-bounding-box-cloaking) stream)))))))
|
(rx/filter (ptk/type? ::trigger-bounding-box-cloaking) stream)))))))
|
||||||
|
|
||||||
|
|
|
@ -113,8 +113,7 @@
|
||||||
(defn- show-outline?
|
(defn- show-outline?
|
||||||
[shape]
|
[shape]
|
||||||
(and (not (:hidden shape))
|
(and (not (:hidden shape))
|
||||||
(not (:blocked shape))
|
(not (:blocked shape))))
|
||||||
(not (:transforming shape))))
|
|
||||||
|
|
||||||
(mf/defc shape-outlines
|
(mf/defc shape-outlines
|
||||||
{::mf/wrap-props false}
|
{::mf/wrap-props false}
|
||||||
|
|
|
@ -321,7 +321,6 @@
|
||||||
transform (gsh/transform-str shape)]
|
transform (gsh/transform-str shape)]
|
||||||
|
|
||||||
(when (and (some? selrect)
|
(when (and (some? selrect)
|
||||||
(not (:transforming shape))
|
|
||||||
(not (or (= transform-type :move)
|
(not (or (= transform-type :move)
|
||||||
(= transform-type :rotate))))
|
(= transform-type :rotate))))
|
||||||
[:g.controls {:pointer-events (if ^boolean disable-handlers "none" "visible")}
|
[:g.controls {:pointer-events (if ^boolean disable-handlers "none" "visible")}
|
||||||
|
@ -356,7 +355,6 @@
|
||||||
(and flip-y (not flip-x)))]
|
(and flip-y (not flip-x)))]
|
||||||
|
|
||||||
(when (and (not ^boolean read-only?)
|
(when (and (not ^boolean read-only?)
|
||||||
(not (:transforming shape))
|
|
||||||
(not (or (= transform-type :move)
|
(not (or (= transform-type :move)
|
||||||
(= transform-type :rotate))))
|
(= transform-type :rotate))))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue