Merge branch 'main' into develop

This commit is contained in:
Andrey Antukh 2021-07-15 15:17:36 +02:00
commit 9ddcb036cf
8 changed files with 50 additions and 34 deletions

View file

@ -141,6 +141,11 @@
(try
(us/assert ::spec/changes redo-changes)
(us/assert ::spec/changes undo-changes)
;; (prn "====== commit-changes ======" path)
;; (cljs.pprint/pprint redo-changes)
;; (cljs.pprint/pprint undo-changes)
(update-in state path cp/process-changes redo-changes false)
(catch :default e

View file

@ -350,6 +350,8 @@
(let [page-id (:current-page-id state)
objects (wsh/lookup-page-objects state page-id)
ids (cp/clean-loops objects ids)
groups-to-unmask
(reduce (fn [group-ids id]
;; When the shape to delete is the mask of a masked group,
@ -387,10 +389,12 @@
ids)
all-children
(reduce (fn [res id]
(into res (cp/get-children id objects)))
(d/ordered-set)
ids)
(->> ids
(reduce (fn [res id]
(into res (cp/get-children id objects)))
[])
(reverse)
(into (d/ordered-set)))
empty-parents
(into (d/ordered-set) empty-parents-xform all-parents)

View file

@ -6,7 +6,6 @@
(ns app.main.data.workspace.undo
(:require
[app.common.pages :as cp]
[app.common.pages.spec :as spec]
[app.common.spec :as us]
[cljs.spec.alpha :as s]
@ -31,13 +30,13 @@
(subvec undo (- cnt MAX-UNDO-SIZE))
undo)))
;; TODO: Review the necessity of this method
(defn materialize-undo
[changes index]
[_changes index]
(ptk/reify ::materialize-undo
ptk/UpdateEvent
(update [_ state]
(-> state
(update :workspace-data cp/process-changes changes)
(assoc-in [:workspace-undo :index] index)))))
(defn- add-undo-entry

View file

@ -139,8 +139,8 @@
(d/without-keys dissoc-attrs)
(assoc :type :path)
(assoc :content new-content)
(cond-> (= :image type)
(assoc :fill-image metadata))))
(cond-> (= :image type) (-> (assoc :fill-image metadata)
(dissoc :metadata)))))
;; Do nothing if the shape is not of a correct type
shape))

View file

@ -488,8 +488,9 @@
filter-values)))
(defn extract-ids [val]
(->> (re-seq xml-id-regex val)
(mapv second)))
(when (some? val)
(->> (re-seq xml-id-regex val)
(mapv second))))
(defn fix-dot-number
"Fixes decimal numbers starting in dot but without leading 0"