diff --git a/common/src/app/common/files/builder.cljc b/common/src/app/common/files/builder.cljc index 61ee4007b3..89e3d0fe49 100644 --- a/common/src/app/common/files/builder.cljc +++ b/common/src/app/common/files/builder.cljc @@ -18,6 +18,7 @@ [app.common.geom.shapes :as gsh] [app.common.schema :as sm] [app.common.svg :as csvg] + [app.common.time :as dt] [app.common.types.color :as types.color] [app.common.types.component :as types.comp] [app.common.types.container :as types.cont] @@ -575,6 +576,7 @@ :size (get blob :size)}) (update ::file-media assoc id {:id id + :created-at (dt/now) :name name :width width :height height diff --git a/library/CHANGES.md b/library/CHANGES.md index b78f0dcb29..6601125e39 100644 --- a/library/CHANGES.md +++ b/library/CHANGES.md @@ -5,6 +5,7 @@ - Fix incorrect boolean type assignation - Fix fill and stroke handling on boolean shape creation - Add sample-bool.js to the playground directory +- Fix compatibility issue on file media with penpot 2.7.x ## 1.0.1 diff --git a/library/src/lib/export.cljs b/library/src/lib/export.cljs index 5d9ee3efa0..55a11ae33a 100644 --- a/library/src/lib/export.cljs +++ b/library/src/lib/export.cljs @@ -41,6 +41,9 @@ (def ^:private encode-component (sm/encoder types.component/schema:component sm/json-transformer)) +(def encode-file-media + (sm/encoder types.file/schema:media sm/json-transformer)) + (def encode-color (sm/encoder types.color/schema:color sm/json-transformer)) @@ -175,6 +178,7 @@ [(str "files/" (:file-id file-media) "/media/" file-media-id ".json") (delay (-> file-media (dissoc :file-id) + (encode-file-media) (json/encode)))])))))) (defn- generate-manifest-procs