mirror of
https://github.com/penpot/penpot.git
synced 2025-08-04 07:48:21 +02:00
🎉 Group component sync changes in a single undo
This commit is contained in:
parent
fe898315c3
commit
ad786ab95f
7 changed files with 142 additions and 116 deletions
|
@ -39,6 +39,12 @@
|
|||
[changes stack-undo?]
|
||||
(assoc changes :stack-undo? stack-undo?))
|
||||
|
||||
(defn set-undo-group
|
||||
[changes undo-group]
|
||||
(cond-> changes
|
||||
(some? undo-group)
|
||||
(assoc :undo-group undo-group)))
|
||||
|
||||
(defn with-page
|
||||
[changes page]
|
||||
(vary-meta changes assoc
|
||||
|
@ -80,7 +86,8 @@
|
|||
[changes1 changes2]
|
||||
{:redo-changes (d/concat-vec (:redo-changes changes1) (:redo-changes changes2))
|
||||
:undo-changes (d/concat-vec (:undo-changes changes1) (:undo-changes changes2))
|
||||
:origin (:origin changes1)})
|
||||
:origin (:origin changes1)
|
||||
:undo-group (:undo-group changes1)})
|
||||
|
||||
; TODO: remove this when not needed
|
||||
(defn- assert-page-id
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue