mirror of
https://github.com/penpot/penpot.git
synced 2025-01-24 23:49:45 -05:00
♻️ Change uuid/next for js/Symbol on undo-id for transactions
This commit is contained in:
parent
31dfdf51c9
commit
4f81f9636a
9 changed files with 29 additions and 33 deletions
|
@ -1618,7 +1618,7 @@
|
|||
:height height
|
||||
:grow-type (if (> (count text) 100) :auto-height :auto-width)
|
||||
:content (as-content text)}
|
||||
undo-id (uuid/next)]
|
||||
undo-id (js/Symbol)]
|
||||
|
||||
(rx/of (dwu/start-undo-transaction undo-id)
|
||||
(dwsh/create-and-add-shape :text x y shape)
|
||||
|
|
|
@ -246,7 +246,7 @@
|
|||
|
||||
:always
|
||||
(ctsi/set-destination (:id target-frame))))
|
||||
undo-id (uuid/next)]
|
||||
undo-id (js/Symbol)]
|
||||
|
||||
(rx/of
|
||||
(dwu/start-undo-transaction undo-id)
|
||||
|
|
|
@ -154,7 +154,7 @@
|
|||
(pcb/with-library-data data)
|
||||
(pcb/update-color color))
|
||||
|
||||
undo-id (uuid/next)]
|
||||
undo-id (js/Symbol)]
|
||||
(rx/of (dwu/start-undo-transaction undo-id)
|
||||
(dch/commit-changes changes)
|
||||
(sync-file (:current-file-id state) file-id :colors (:id color))
|
||||
|
@ -259,7 +259,7 @@
|
|||
changes (-> (pcb/empty-changes it)
|
||||
(pcb/with-library-data data)
|
||||
(pcb/update-typography typography))
|
||||
undo-id (uuid/next)]
|
||||
undo-id (js/Symbol)]
|
||||
(rx/of (dwu/start-undo-transaction undo-id)
|
||||
(dch/commit-changes changes)
|
||||
(sync-file (:current-file-id state) file-id :typographies (:id typography))
|
||||
|
@ -650,7 +650,7 @@
|
|||
(let [current-file-id (:current-file-id state)
|
||||
page (wsh/lookup-page state)
|
||||
shape (ctn/get-shape page shape-id)
|
||||
undo-id (uuid/next)]
|
||||
undo-id (js/Symbol)]
|
||||
(rx/of
|
||||
(dwu/start-undo-transaction undo-id)
|
||||
(update-component shape-id)
|
||||
|
@ -664,7 +664,7 @@
|
|||
(ptk/reify ::update-component-in-bulk
|
||||
ptk/WatchEvent
|
||||
(watch [_ _ _]
|
||||
(let [undo-id (uuid/next)]
|
||||
(let [undo-id (js/Symbol)]
|
||||
(rx/concat
|
||||
(rx/of (dwu/start-undo-transaction undo-id))
|
||||
(rx/map #(update-component-sync (:id %) file-id) (rx/from shapes))
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
[app.common.types.modifiers :as ctm]
|
||||
[app.common.types.shape :as cts]
|
||||
[app.common.types.shape.layout :as ctl]
|
||||
[app.common.uuid :as uuid]
|
||||
[app.main.data.workspace.changes :as dch]
|
||||
[app.main.data.workspace.comments :as-alias dwcm]
|
||||
[app.main.data.workspace.guides :as-alias dwg]
|
||||
|
@ -343,7 +342,7 @@
|
|||
shapes (map (d/getf objects) ids)
|
||||
ignore-tree (->> (map #(get-ignore-tree object-modifiers objects %) shapes)
|
||||
(reduce merge {}))
|
||||
undo-id (uuid/next)]
|
||||
undo-id (js/Symbol)]
|
||||
|
||||
(rx/concat
|
||||
(if undo-transation?
|
||||
|
|
|
@ -561,7 +561,7 @@
|
|||
frames (into #{}
|
||||
(map #(get-in objects [% :frame-id]))
|
||||
selected)
|
||||
undo-id (uuid/next)]
|
||||
undo-id (js/Symbol)]
|
||||
|
||||
(rx/concat
|
||||
(->> (rx/from dup-frames)
|
||||
|
|
|
@ -380,7 +380,7 @@
|
|||
(cond-> (not= frame-id uuid/zero)
|
||||
(assoc :fills [] :hide-in-viewer true))
|
||||
(cts/setup-rect-selrect))
|
||||
undo-id (uuid/next)]
|
||||
undo-id (js/Symbol)]
|
||||
(rx/of
|
||||
(dwu/start-undo-transaction undo-id)
|
||||
(add-shape shape)
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
[app.common.types.modifiers :as ctm]
|
||||
[app.common.types.shape-tree :as ctst]
|
||||
[app.common.types.shape.layout :as ctl]
|
||||
[app.common.uuid :as uuid]
|
||||
[app.main.data.workspace.changes :as dch]
|
||||
[app.main.data.workspace.collapse :as dwc]
|
||||
[app.main.data.workspace.modifiers :as dwm]
|
||||
|
@ -509,7 +508,7 @@
|
|||
(rx/last)
|
||||
(rx/mapcat
|
||||
(fn [[_ target-frame drop-index]]
|
||||
(let [undo-id (uuid/next)]
|
||||
(let [undo-id (js/Symbol)]
|
||||
(rx/of (dwu/start-undo-transaction undo-id)
|
||||
(move-shapes-to-frame ids target-frame drop-index)
|
||||
(dwm/apply-modifiers {:undo-transation? false})
|
||||
|
|
|
@ -12,7 +12,6 @@
|
|||
[app.common.pages.helpers :as cph]
|
||||
[app.common.spec :as us]
|
||||
[app.common.text :as txt]
|
||||
[app.common.uuid :as uuid]
|
||||
[app.config :as cf]
|
||||
[app.main.data.events :as ev]
|
||||
[app.main.data.modal :as modal]
|
||||
|
@ -182,7 +181,7 @@
|
|||
|
||||
(defn- create-assets-group
|
||||
[rename components-to-group group-name]
|
||||
(let [undo-id (uuid/next)]
|
||||
(let [undo-id (js/Symbol)]
|
||||
(st/emit! (dwu/start-undo-transaction undo-id))
|
||||
(apply st/emit!
|
||||
(->> components-to-group
|
||||
|
@ -594,7 +593,7 @@
|
|||
(mf/use-fn
|
||||
(mf/deps @state)
|
||||
(fn []
|
||||
(let [undo-id (uuid/next)]
|
||||
(let [undo-id (js/Symbol)]
|
||||
(if (empty? selected-components)
|
||||
(st/emit! (dwl/duplicate-component {:id (:component-id @state)}))
|
||||
(do
|
||||
|
@ -606,7 +605,7 @@
|
|||
(mf/use-fn
|
||||
(mf/deps @state file-id multi-components? multi-assets?)
|
||||
(fn []
|
||||
(let [undo-id (uuid/next)]
|
||||
(let [undo-id (js/Symbol)]
|
||||
(if (or multi-components? multi-assets?)
|
||||
(on-assets-delete)
|
||||
(st/emit! (dwu/start-undo-transaction undo-id)
|
||||
|
@ -653,7 +652,7 @@
|
|||
(mf/deps components selected-components on-clear-selection)
|
||||
(fn [group-name]
|
||||
(on-clear-selection)
|
||||
(let [undo-id (uuid/next)]
|
||||
(let [undo-id (js/Symbol)]
|
||||
(st/emit! (dwu/start-undo-transaction undo-id))
|
||||
(apply st/emit!
|
||||
(->> components
|
||||
|
@ -670,7 +669,7 @@
|
|||
(mf/deps components)
|
||||
(fn [path last-path]
|
||||
(on-clear-selection)
|
||||
(let [undo-id (uuid/next)]
|
||||
(let [undo-id (js/Symbol)]
|
||||
(st/emit! (dwu/start-undo-transaction undo-id))
|
||||
(apply st/emit!
|
||||
(->> components
|
||||
|
@ -701,7 +700,7 @@
|
|||
(mf/deps components)
|
||||
(fn [path]
|
||||
(on-clear-selection)
|
||||
(let [undo-id (uuid/next)]
|
||||
(let [undo-id (js/Symbol)]
|
||||
(st/emit! (dwu/start-undo-transaction undo-id))
|
||||
(apply st/emit!
|
||||
(->> components
|
||||
|
@ -1029,7 +1028,7 @@
|
|||
(mf/deps objects selected-objects on-clear-selection)
|
||||
(fn [group-name]
|
||||
(on-clear-selection)
|
||||
(let [undo-id (uuid/next)]
|
||||
(let [undo-id (js/Symbol)]
|
||||
(st/emit! (dwu/start-undo-transaction undo-id))
|
||||
(apply st/emit!
|
||||
(->> objects
|
||||
|
@ -1046,7 +1045,7 @@
|
|||
(mf/deps objects)
|
||||
(fn [path last-path]
|
||||
(on-clear-selection)
|
||||
(let [undo-id (uuid/next)]
|
||||
(let [undo-id (js/Symbol)]
|
||||
(st/emit! (dwu/start-undo-transaction undo-id))
|
||||
(apply st/emit!
|
||||
(->> objects
|
||||
|
@ -1076,7 +1075,7 @@
|
|||
(mf/deps objects)
|
||||
(fn [path]
|
||||
(on-clear-selection)
|
||||
(let [undo-id (uuid/next)]
|
||||
(let [undo-id (js/Symbol)]
|
||||
(st/emit! (dwu/start-undo-transaction undo-id))
|
||||
(apply st/emit!
|
||||
(->> objects
|
||||
|
@ -1193,7 +1192,7 @@
|
|||
(fn []
|
||||
(if (or multi-colors? multi-assets?)
|
||||
(on-assets-delete)
|
||||
(let [undo-id (uuid/next)]
|
||||
(let [undo-id (js/Symbol)]
|
||||
(st/emit! (dwu/start-undo-transaction undo-id)
|
||||
(dwl/delete-color color)
|
||||
(dwl/sync-file file-id file-id :colors (:id color))
|
||||
|
@ -1458,7 +1457,7 @@
|
|||
(fn [color-id]
|
||||
(fn [group-name]
|
||||
(on-clear-selection)
|
||||
(let [undo-id (uuid/next)]
|
||||
(let [undo-id (js/Symbol)]
|
||||
(st/emit! (dwu/start-undo-transaction undo-id))
|
||||
(apply st/emit!
|
||||
(->> colors
|
||||
|
@ -1476,7 +1475,7 @@
|
|||
(mf/deps colors)
|
||||
(fn [path last-path]
|
||||
(on-clear-selection)
|
||||
(let [undo-id (uuid/next)]
|
||||
(let [undo-id (js/Symbol)]
|
||||
(st/emit! (dwu/start-undo-transaction undo-id))
|
||||
(apply st/emit!
|
||||
(->> colors
|
||||
|
@ -1508,7 +1507,7 @@
|
|||
(mf/deps colors)
|
||||
(fn [path]
|
||||
(on-clear-selection)
|
||||
(let [undo-id (uuid/next)]
|
||||
(let [undo-id (js/Symbol)]
|
||||
(st/emit! (dwu/start-undo-transaction undo-id))
|
||||
(apply st/emit!
|
||||
(->> colors
|
||||
|
@ -1757,7 +1756,7 @@
|
|||
(mf/deps typographies selected-typographies on-clear-selection file-id)
|
||||
(fn [group-name]
|
||||
(on-clear-selection)
|
||||
(let [undo-id (uuid/next)]
|
||||
(let [undo-id (js/Symbol)]
|
||||
(st/emit! (dwu/start-undo-transaction undo-id))
|
||||
(apply st/emit!
|
||||
(->> typographies
|
||||
|
@ -1775,7 +1774,7 @@
|
|||
(mf/deps typographies)
|
||||
(fn [path last-path]
|
||||
(on-clear-selection)
|
||||
(let [undo-id (uuid/next)]
|
||||
(let [undo-id (js/Symbol)]
|
||||
(st/emit! (dwu/start-undo-transaction undo-id))
|
||||
(apply st/emit!
|
||||
(->> typographies
|
||||
|
@ -1806,7 +1805,7 @@
|
|||
(mf/deps typographies)
|
||||
(fn [path]
|
||||
(on-clear-selection)
|
||||
(let [undo-id (uuid/next)]
|
||||
(let [undo-id (js/Symbol)]
|
||||
(st/emit! (dwu/start-undo-transaction undo-id))
|
||||
(apply st/emit!
|
||||
(->> typographies
|
||||
|
@ -1844,7 +1843,7 @@
|
|||
(mf/use-fn
|
||||
(mf/deps @state multi-typographies? multi-assets?)
|
||||
(fn []
|
||||
(let [undo-id (uuid/next)]
|
||||
(let [undo-id (js/Symbol)]
|
||||
(if (or multi-typographies? multi-assets?)
|
||||
(on-assets-delete)
|
||||
(st/emit! (dwu/start-undo-transaction undo-id)
|
||||
|
@ -2088,7 +2087,7 @@
|
|||
(mf/use-fn
|
||||
(mf/deps selected-assets)
|
||||
(fn []
|
||||
(let [undo-id (uuid/next)]
|
||||
(let [undo-id (js/Symbol)]
|
||||
(st/emit! (dwu/start-undo-transaction undo-id))
|
||||
(apply st/emit! (map #(dwl/delete-component {:id %})
|
||||
(:components selected-assets)))
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
[app.common.geom.shapes :as gsh]
|
||||
[app.common.types.shape.layout :as ctl]
|
||||
[app.common.types.shape.radius :as ctsr]
|
||||
[app.common.uuid :as uuid]
|
||||
[app.main.constants :refer [size-presets]]
|
||||
[app.main.data.workspace :as udw]
|
||||
[app.main.data.workspace.changes :as dch]
|
||||
|
@ -250,7 +249,7 @@
|
|||
(mf/deps ids)
|
||||
(fn [event]
|
||||
(let [value (-> event dom/get-target dom/checked?)
|
||||
undo-id (uuid/next)]
|
||||
undo-id (js/Symbol)]
|
||||
(do
|
||||
(st/emit! (dwu/start-undo-transaction undo-id)
|
||||
(dch/update-shapes ids (fn [shape] (assoc shape :hide-in-viewer (not value)))))
|
||||
|
|
Loading…
Add table
Reference in a new issue