diff --git a/common/src/app/common/files/builder.cljc b/common/src/app/common/files/builder.cljc index 3a3f734d61..6dbaf47efd 100644 --- a/common/src/app/common/files/builder.cljc +++ b/common/src/app/common/files/builder.cljc @@ -8,11 +8,11 @@ "Internal implementation of file builder. Mainly used as base impl for penpot library" (:require + ;; [app.common.features :as cfeat] [app.common.data :as d] [app.common.data.macros :as dm] [app.common.exceptions :as ex] [app.common.files.changes :as ch] - ;; [app.common.features :as cfeat] [app.common.files.helpers :as cph] [app.common.files.migrations :as fmig] [app.common.geom.shapes :as gsh] @@ -26,6 +26,7 @@ [app.common.types.path :as types.path] [app.common.types.shape :as types.shape] [app.common.types.typography :as types.typography] + [app.common.types.variant :as types.variant] [app.common.uuid :as uuid] [cuerdas.core :as str])) @@ -126,10 +127,12 @@ [:map [:component-id ::sm/uuid] [:file-id {:optional true} ::sm/uuid] + [:page-id {:optional true} ::sm/uuid] + [:frame-id {:optional true} ::sm/uuid] [:name {:optional true} ::sm/text] [:path {:optional true} ::sm/text] - [:frame-id {:optional true} ::sm/uuid] - [:page-id {:optional true} ::sm/uuid]]) + [:variant-id {:optional true} ::sm/uuid] + [:variant-properties {:optional true} [:vector types.variant/schema:variant-property]]]) (def ^:private check-add-component (sm/check-fn schema:add-component @@ -444,7 +447,7 @@ (defn add-component [state params] - (let [{:keys [component-id file-id page-id frame-id name path]} + (let [{:keys [component-id file-id page-id frame-id name path variant-id variant-properties]} (-> (check-add-component params) (update :component-id default-uuid)) @@ -464,7 +467,9 @@ :name (or name "anonmous") :path path :main-instance-id frame-id - :main-instance-page page-id}) + :main-instance-page page-id + :variant-id variant-id + :variant-properties variant-properties}) change2 {:type :mod-obj