diff --git a/common/src/app/common/pages/common.cljc b/common/src/app/common/pages/common.cljc index 306a846b6..8cd547d62 100644 --- a/common/src/app/common/pages/common.cljc +++ b/common/src/app/common/pages/common.cljc @@ -9,7 +9,7 @@ [app.common.colors :as clr] [app.common.uuid :as uuid])) -(def file-version 15) +(def file-version 16) (def default-color clr/gray-20) (def root uuid/zero) diff --git a/common/src/app/common/pages/migrations.cljc b/common/src/app/common/pages/migrations.cljc index 844475a08..d70d0e345 100644 --- a/common/src/app/common/pages/migrations.cljc +++ b/common/src/app/common/pages/migrations.cljc @@ -355,3 +355,19 @@ (update-page [_ page] (update page :objects #(d/mapm update-object %)))] (update data :pages-index #(d/mapm update-page %)))) + +;; Add fills and strokes to components + +(defmethod migrate 16 + [data] + (letfn [(update-object [_ object] + (cond-> object + (and (not (= :text (:type object))) (nil? (:strokes object))) + (set-strokes) + + (and (not (= :text (:type object))) (nil? (:fills object))) + (set-fills))) + (update-container [_ container] + (update container :objects #(d/mapm update-object %)))] + (-> data + (update :components #(d/mapm update-container %)))))