mirror of
https://github.com/penpot/penpot.git
synced 2025-12-11 22:14:05 +01:00
✨ Allow pass variant related attrs on add-component change
This commit is contained in:
@@ -320,14 +320,18 @@
|
||||
[:shapes {:optional true} [:vector {:gen/max 3} ::sm/any]]
|
||||
[:path {:optional true} :string]
|
||||
[:main-instance-id ::sm/uuid]
|
||||
[:main-instance-page ::sm/uuid]]]
|
||||
[:main-instance-page ::sm/uuid]
|
||||
;; Only used by external processes (like Penpot SDK)
|
||||
[:variant-id {:optional true} ::sm/uuid]
|
||||
[:variant-properties {:optional true} [:vector ctv/schema:variant-property]]]]
|
||||
|
||||
[:mod-component
|
||||
[:map {:title "ModCompoenentChange"}
|
||||
[:type [:= :mod-component]]
|
||||
[:id ::sm/uuid]
|
||||
[:shapes {:optional true} [:vector {:gen/max 3} ::sm/any]]
|
||||
[:name {:optional true} :string]
|
||||
[:path {:optional true} :string]
|
||||
[:shapes {:optional true} [:vector {:gen/max 3} ::sm/any]]
|
||||
[:variant-id {:optional true} ::sm/uuid]
|
||||
[:variant-properties {:optional true} [:vector ctv/schema:variant-property]]]]
|
||||
|
||||
|
||||
@@ -83,9 +83,11 @@
|
||||
|
||||
(nil? variant-properties)
|
||||
(dissoc :variant-properties))
|
||||
|
||||
;; The set of properties that doesn't mark a component as touched
|
||||
diff (set/difference
|
||||
(ctk/diff-components component new-comp)
|
||||
#{:annotation :modified-at :variant-id :variant-properties})] ;; The set of properties that doesn't mark a component as touched
|
||||
#{:annotation :modified-at :variant-id :variant-properties})]
|
||||
|
||||
(if (empty? diff)
|
||||
new-comp
|
||||
|
||||
Reference in New Issue
Block a user